]> ncurses.scripts.mit.edu Git - ncurses.git/blob - test/configure
98f3ed1c08f3e9a540c8bfd681fd61f8d1e63925
[ncurses.git] / test / configure
1 #! /bin/sh
2 # Guess values for system-dependent variables and create Makefiles.
3 # Generated by Autoconf 2.52.20200802.
4 #
5 # Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
6 # Free Software Foundation, Inc.
7 # This configure script is free software; the Free Software Foundation
8 # gives unlimited permission to copy, distribute and modify it.
9
10 # Avoid depending upon Character Ranges.
11 as_cr_letters='abcdefghijklmnopqrstuvwxyz'
12 as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
13 as_cr_Letters=$as_cr_letters$as_cr_LETTERS
14 as_cr_digits='0123456789'
15 as_cr_alnum=$as_cr_Letters$as_cr_digits
16
17 # Sed expression to map a string onto a valid variable name.
18 as_tr_sh="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g"
19
20 # Sed expression to map a string onto a valid CPP name.
21 as_tr_cpp="sed y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g"
22
23 # Be Bourne compatible
24 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
25   emulate sh
26   NULLCMD=:
27 elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
28   set -o posix
29 fi
30
31 # Name of the executable.
32 as_me=`echo "$0" |sed 's,.*[\\/],,'`
33
34 if expr a : '\(a\)' >/dev/null 2>&1; then
35   as_expr=expr
36 else
37   as_expr=false
38 fi
39
40 rm -f conf$$ conf$$.exe conf$$.file
41 echo >conf$$.file
42 if ln -s conf$$.file conf$$ 2>/dev/null; then
43   # We could just check for DJGPP; but this test a) works b) is more generic
44   # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
45   if test -f conf$$.exe; then
46     # Don't use ln at all; we don't have any links
47     as_ln_s='cp -p'
48   else
49     as_ln_s='ln -s'
50   fi
51 elif ln conf$$.file conf$$ 2>/dev/null; then
52   as_ln_s=ln
53 else
54   as_ln_s='cp -p'
55 fi
56 rm -f conf$$ conf$$.exe conf$$.file
57
58 as_executable_p="test -f"
59
60 # Support unset when possible.
61 if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
62   as_unset=unset
63 else
64   as_unset=false
65 fi
66
67 # NLS nuisances.
68 $as_unset LANG || test "${LANG+set}" != set || { LANG=C; export LANG; }
69 $as_unset LC_ALL || test "${LC_ALL+set}" != set || { LC_ALL=C; export LC_ALL; }
70 $as_unset LC_TIME || test "${LC_TIME+set}" != set || { LC_TIME=C; export LC_TIME; }
71 $as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set || { LC_CTYPE=C; export LC_CTYPE; }
72 $as_unset LANGUAGE || test "${LANGUAGE+set}" != set || { LANGUAGE=C; export LANGUAGE; }
73 $as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set || { LC_COLLATE=C; export LC_COLLATE; }
74 $as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set || { LC_NUMERIC=C; export LC_NUMERIC; }
75 $as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set || { LC_MESSAGES=C; export LC_MESSAGES; }
76
77 # IFS
78 # We need space, tab and new line, in precisely that order.
79 as_nl='
80 '
81 IFS="   $as_nl"
82
83 # CDPATH.
84 $as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=:; export CDPATH; }
85
86 # Name of the host.
87 # hostname on some systems (SVR3.2, Linux) returns a bogus exit status,
88 # so uname gets run too.
89 ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
90
91 exec 6>&1
92
93 #
94 # Initializations.
95 #
96 ac_default_prefix=/usr/local
97 cross_compiling=no
98 subdirs=
99 MFLAGS= MAKEFLAGS=
100 SHELL=${CONFIG_SHELL-/bin/sh}
101
102 # Maximum number of lines to put in a shell here document.
103 # This variable seems obsolete.  It should probably be removed, and
104 # only ac_max_sed_lines should be used.
105 : ${ac_max_here_lines=38}
106
107 ac_unique_file="ncurses.c"
108
109 # Initialize some variables set by options.
110 ac_init_help=
111 ac_init_version=false
112 # The variables have the same names as the options, with
113 # dashes changed to underlines.
114 cache_file=/dev/null
115 exec_prefix=NONE
116 no_create=
117 no_recursion=
118 prefix=NONE
119 program_prefix=NONE
120 program_suffix=NONE
121 program_transform_name=s,x,x,
122 silent=
123 site=
124 srcdir=
125 verbose=
126 x_includes=NONE
127 x_libraries=NONE
128
129 # Installation directory options.
130 # These are left unexpanded so users can "make install exec_prefix=/foo"
131 # and all the variables that are supposed to be based on exec_prefix
132 # by default will actually change.
133 # Use braces instead of parens because sh, perl, etc. also accept them.
134 bindir='${exec_prefix}/bin'
135 sbindir='${exec_prefix}/sbin'
136 libexecdir='${exec_prefix}/libexec'
137 datarootdir='${prefix}/share'
138 datadir='${datarootdir}'
139 sysconfdir='${prefix}/etc'
140 sharedstatedir='${prefix}/com'
141 localstatedir='${prefix}/var'
142 runstatedir='${localstatedir}/run'
143 libdir='${exec_prefix}/lib'
144 includedir='${prefix}/include'
145 oldincludedir='/usr/include'
146 infodir='${datarootdir}/info'
147 mandir='${datarootdir}/man'
148
149 # Identity of this package.
150 PACKAGE_NAME=
151 PACKAGE_TARNAME=
152 PACKAGE_VERSION=
153 PACKAGE_STRING=
154 PACKAGE_BUGREPORT=
155
156 ac_prev=
157 for ac_option
158 do
159   # If the previous option needs an argument, assign it.
160   if test -n "$ac_prev"; then
161     eval "$ac_prev=\$ac_option"
162     ac_prev=
163     continue
164   fi
165
166   ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'`
167
168   # Accept the important Cygnus configure options, so we can diagnose typos.
169
170   case $ac_option in
171
172   -bindir | --bindir | --bindi | --bind | --bin | --bi)
173     ac_prev=bindir ;;
174   -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
175     bindir=$ac_optarg ;;
176
177   -build | --build | --buil | --bui | --bu)
178     ac_prev=build_alias ;;
179   -build=* | --build=* | --buil=* | --bui=* | --bu=*)
180     build_alias=$ac_optarg ;;
181
182   -cache-file | --cache-file | --cache-fil | --cache-fi \
183   | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
184     ac_prev=cache_file ;;
185   -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
186   | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
187     cache_file=$ac_optarg ;;
188
189   --config-cache | -C)
190     cache_file=config.cache ;;
191
192   -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
193     ac_prev=datadir ;;
194   -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
195   | --da=*)
196     datadir=$ac_optarg ;;
197
198   -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \
199   | --dataroo | --dataro | --datar)
200     ac_prev=datarootdir ;;
201   -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \
202   | --dataroot=* | --dataroo=* | --dataro=* | --datar=*)
203     datarootdir=$ac_optarg ;;
204
205   -disable-* | --disable-*)
206     ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
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     eval "enable_$ac_feature=no" ;;
213
214   -enable-* | --enable-*)
215     ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
216     # Reject names that are not valid shell variable names.
217     expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
218       { echo "$as_me: error: invalid feature name: $ac_feature" >&2
219    { (exit 1); exit 1; }; }
220     ac_feature=`echo $ac_feature | sed 's/-/_/g'`
221     case $ac_option in
222       *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
223       *) ac_optarg=yes ;;
224     esac
225     eval "enable_$ac_feature='$ac_optarg'" ;;
226
227   -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
228   | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
229   | --exec | --exe | --ex)
230     ac_prev=exec_prefix ;;
231   -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
232   | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
233   | --exec=* | --exe=* | --ex=*)
234     exec_prefix=$ac_optarg ;;
235
236   -gas | --gas | --ga | --g)
237     # Obsolete; use --with-gas.
238     with_gas=yes ;;
239
240   -help | --help | --hel | --he | -h)
241     ac_init_help=long ;;
242   -help=r* | --help=r* | --hel=r* | --he=r* | -hr*)
243     ac_init_help=recursive ;;
244   -help=s* | --help=s* | --hel=s* | --he=s* | -hs*)
245     ac_init_help=short ;;
246
247   -host | --host | --hos | --ho)
248     ac_prev=host_alias ;;
249   -host=* | --host=* | --hos=* | --ho=*)
250     host_alias=$ac_optarg ;;
251
252   -includedir | --includedir | --includedi | --included | --include \
253   | --includ | --inclu | --incl | --inc)
254     ac_prev=includedir ;;
255   -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
256   | --includ=* | --inclu=* | --incl=* | --inc=*)
257     includedir=$ac_optarg ;;
258
259   -infodir | --infodir | --infodi | --infod | --info | --inf)
260     ac_prev=infodir ;;
261   -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
262     infodir=$ac_optarg ;;
263
264   -libdir | --libdir | --libdi | --libd)
265     ac_prev=libdir ;;
266   -libdir=* | --libdir=* | --libdi=* | --libd=*)
267     libdir=$ac_optarg ;;
268
269   -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
270   | --libexe | --libex | --libe)
271     ac_prev=libexecdir ;;
272   -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
273   | --libexe=* | --libex=* | --libe=*)
274     libexecdir=$ac_optarg ;;
275
276   -localstatedir | --localstatedir | --localstatedi | --localstated \
277   | --localstate | --localstat | --localsta | --localst \
278   | --locals | --local | --loca | --loc | --lo)
279     ac_prev=localstatedir ;;
280   -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
281   | --localstate=* | --localstat=* | --localsta=* | --localst=* \
282   | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
283     localstatedir=$ac_optarg ;;
284
285   -runstatedir | --runstatedir | --runstatedi | --runstated \
286   | --runstate | --runstat | --runsta | --runst \
287   | --runs | --run | --ru)
288     ac_prev=runstatedir ;;
289   -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \
290   | --runstate=* | --runstat=* | --runsta=* | --runst=* \
291   | --runs=* | --run=* | --ru=*)
292     runstatedir=$ac_optarg ;;
293
294   -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
295     ac_prev=mandir ;;
296   -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
297     mandir=$ac_optarg ;;
298
299   -nfp | --nfp | --nf)
300     # Obsolete; use --without-fp.
301     with_fp=no ;;
302
303   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
304   | --no-cr | --no-c)
305     no_create=yes ;;
306
307   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
308   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
309     no_recursion=yes ;;
310
311   -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
312   | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
313   | --oldin | --oldi | --old | --ol | --o)
314     ac_prev=oldincludedir ;;
315   -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
316   | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
317   | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
318     oldincludedir=$ac_optarg ;;
319
320   -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
321     ac_prev=prefix ;;
322   -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
323     prefix=$ac_optarg ;;
324
325   -program-prefix | --program-prefix | --program-prefi | --program-pref \
326   | --program-pre | --program-pr | --program-p)
327     ac_prev=program_prefix ;;
328   -program-prefix=* | --program-prefix=* | --program-prefi=* \
329   | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
330     program_prefix=$ac_optarg ;;
331
332   -program-suffix | --program-suffix | --program-suffi | --program-suff \
333   | --program-suf | --program-su | --program-s)
334     ac_prev=program_suffix ;;
335   -program-suffix=* | --program-suffix=* | --program-suffi=* \
336   | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
337     program_suffix=$ac_optarg ;;
338
339   -program-transform-name | --program-transform-name \
340   | --program-transform-nam | --program-transform-na \
341   | --program-transform-n | --program-transform- \
342   | --program-transform | --program-transfor \
343   | --program-transfo | --program-transf \
344   | --program-trans | --program-tran \
345   | --progr-tra | --program-tr | --program-t)
346     ac_prev=program_transform_name ;;
347   -program-transform-name=* | --program-transform-name=* \
348   | --program-transform-nam=* | --program-transform-na=* \
349   | --program-transform-n=* | --program-transform-=* \
350   | --program-transform=* | --program-transfor=* \
351   | --program-transfo=* | --program-transf=* \
352   | --program-trans=* | --program-tran=* \
353   | --progr-tra=* | --program-tr=* | --program-t=*)
354     program_transform_name=$ac_optarg ;;
355
356   -q | -quiet | --quiet | --quie | --qui | --qu | --q \
357   | -silent | --silent | --silen | --sile | --sil)
358     silent=yes ;;
359
360   -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
361     ac_prev=sbindir ;;
362   -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
363   | --sbi=* | --sb=*)
364     sbindir=$ac_optarg ;;
365
366   -sharedstatedir | --sharedstatedir | --sharedstatedi \
367   | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
368   | --sharedst | --shareds | --shared | --share | --shar \
369   | --sha | --sh)
370     ac_prev=sharedstatedir ;;
371   -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
372   | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
373   | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
374   | --sha=* | --sh=*)
375     sharedstatedir=$ac_optarg ;;
376
377   -site | --site | --sit)
378     ac_prev=site ;;
379   -site=* | --site=* | --sit=*)
380     site=$ac_optarg ;;
381
382   -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
383     ac_prev=srcdir ;;
384   -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
385     srcdir=$ac_optarg ;;
386
387   -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
388   | --syscon | --sysco | --sysc | --sys | --sy)
389     ac_prev=sysconfdir ;;
390   -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
391   | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
392     sysconfdir=$ac_optarg ;;
393
394   -target | --target | --targe | --targ | --tar | --ta | --t)
395     ac_prev=target_alias ;;
396   -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
397     target_alias=$ac_optarg ;;
398
399   -v | -verbose | --verbose | --verbos | --verbo | --verb)
400     verbose=yes ;;
401
402   -version | --version | --versio | --versi | --vers | -V)
403     ac_init_version=: ;;
404
405   -with-* | --with-*)
406     ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
407     # Reject names that are not valid shell variable names.
408     expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
409       { echo "$as_me: error: invalid package name: $ac_package" >&2
410    { (exit 1); exit 1; }; }
411     ac_package=`echo $ac_package| sed 's/-/_/g'`
412     case $ac_option in
413       *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
414       *) ac_optarg=yes ;;
415     esac
416     eval "with_$ac_package='$ac_optarg'" ;;
417
418   -without-* | --without-*)
419     ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'`
420     # Reject names that are not valid shell variable names.
421     expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
422       { echo "$as_me: error: invalid package name: $ac_package" >&2
423    { (exit 1); exit 1; }; }
424     ac_package=`echo $ac_package | sed 's/-/_/g'`
425     eval "with_$ac_package=no" ;;
426
427   --x)
428     # Obsolete; use --with-x.
429     with_x=yes ;;
430
431   -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
432   | --x-incl | --x-inc | --x-in | --x-i)
433     ac_prev=x_includes ;;
434   -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
435   | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
436     x_includes=$ac_optarg ;;
437
438   -x-libraries | --x-libraries | --x-librarie | --x-librari \
439   | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
440     ac_prev=x_libraries ;;
441   -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
442   | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
443     x_libraries=$ac_optarg ;;
444
445   -*) { echo "$as_me: error: unrecognized option: $ac_option
446 Try \`$0 --help' for more information." >&2
447    { (exit 1); exit 1; }; }
448     ;;
449
450   *=*)
451     ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
452     # Reject names that are not valid shell variable names.
453     expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null &&
454       { echo "$as_me: error: invalid variable name: $ac_envvar" >&2
455    { (exit 1); exit 1; }; }
456     ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`
457     eval "$ac_envvar='$ac_optarg'"
458     export $ac_envvar ;;
459
460   *)
461     # FIXME: should be removed in autoconf 3.0.
462     echo "$as_me: WARNING: you should use --build, --host, --target" >&2
463     expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
464       echo "$as_me: WARNING: invalid host type: $ac_option" >&2
465     : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}
466     ;;
467
468   esac
469 done
470
471 if test -n "$ac_prev"; then
472   ac_option=--`echo $ac_prev | sed 's/_/-/g'`
473   { echo "$as_me: error: missing argument to $ac_option" >&2
474    { (exit 1); exit 1; }; }
475 fi
476
477 # Be sure to have absolute paths.
478 for ac_var in exec_prefix prefix
479 do
480   eval ac_val=$`echo $ac_var`
481   case $ac_val in
482     [\\/$]* | ?:[\\/]* | NONE | '' ) ;;
483     *)  { echo "$as_me: error: expected an absolute path for --$ac_var: $ac_val" >&2
484    { (exit 1); exit 1; }; };;
485   esac
486 done
487
488 # Be sure to have absolute paths.
489 for ac_var in bindir sbindir libexecdir datarootdir datadir sysconfdir sharedstatedir \
490               localstatedir libdir includedir oldincludedir infodir mandir
491 do
492   eval ac_val=$`echo $ac_var`
493   case $ac_val in
494     [\\/$]* | ?:[\\/]* ) ;;
495     *)  { echo "$as_me: error: expected an absolute path for --$ac_var: $ac_val" >&2
496    { (exit 1); exit 1; }; };;
497   esac
498 done
499
500 # There might be people who depend on the old broken behavior: `$host'
501 # used to hold the argument of --host etc.
502 build=$build_alias
503 host=$host_alias
504 target=$target_alias
505
506 # FIXME: should be removed in autoconf 3.0.
507 if test "x$host_alias" != x; then
508   if test "x$build_alias" = x; then
509     cross_compiling=maybe
510     echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host.
511     If a cross compiler is detected then cross compile mode will be used." >&2
512   elif test "x$build_alias" != "x$host_alias"; then
513     cross_compiling=yes
514   fi
515 fi
516
517 ac_tool_prefix=
518 test -n "$host_alias" && ac_tool_prefix=$host_alias-
519
520 test "$silent" = yes && exec 6>/dev/null
521
522 # Find the source files, if location was not specified.
523 if test -z "$srcdir"; then
524   ac_srcdir_defaulted=yes
525   # Try the directory containing this script, then its parent.
526   ac_prog=$0
527   ac_confdir=`echo "$ac_prog" | sed 's%[\\/][^\\/][^\\/]*$%%'`
528   test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
529   srcdir=$ac_confdir
530   if test ! -r $srcdir/$ac_unique_file; then
531     srcdir=..
532   fi
533 else
534   ac_srcdir_defaulted=no
535 fi
536 if test ! -r $srcdir/$ac_unique_file; then
537   if test "$ac_srcdir_defaulted" = yes; then
538     { echo "$as_me: error: cannot find sources in $ac_confdir or .." >&2
539    { (exit 1); exit 1; }; }
540   else
541     { echo "$as_me: error: cannot find sources in $srcdir" >&2
542    { (exit 1); exit 1; }; }
543   fi
544 fi
545 srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'`
546 ac_env_build_alias_set=${build_alias+set}
547 ac_env_build_alias_value=$build_alias
548 ac_cv_env_build_alias_set=${build_alias+set}
549 ac_cv_env_build_alias_value=$build_alias
550 ac_env_host_alias_set=${host_alias+set}
551 ac_env_host_alias_value=$host_alias
552 ac_cv_env_host_alias_set=${host_alias+set}
553 ac_cv_env_host_alias_value=$host_alias
554 ac_env_target_alias_set=${target_alias+set}
555 ac_env_target_alias_value=$target_alias
556 ac_cv_env_target_alias_set=${target_alias+set}
557 ac_cv_env_target_alias_value=$target_alias
558 ac_env_CC_set=${CC+set}
559 ac_env_CC_value=$CC
560 ac_cv_env_CC_set=${CC+set}
561 ac_cv_env_CC_value=$CC
562 ac_env_CFLAGS_set=${CFLAGS+set}
563 ac_env_CFLAGS_value=$CFLAGS
564 ac_cv_env_CFLAGS_set=${CFLAGS+set}
565 ac_cv_env_CFLAGS_value=$CFLAGS
566 ac_env_LDFLAGS_set=${LDFLAGS+set}
567 ac_env_LDFLAGS_value=$LDFLAGS
568 ac_cv_env_LDFLAGS_set=${LDFLAGS+set}
569 ac_cv_env_LDFLAGS_value=$LDFLAGS
570 ac_env_CPPFLAGS_set=${CPPFLAGS+set}
571 ac_env_CPPFLAGS_value=$CPPFLAGS
572 ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set}
573 ac_cv_env_CPPFLAGS_value=$CPPFLAGS
574 ac_env_CPP_set=${CPP+set}
575 ac_env_CPP_value=$CPP
576 ac_cv_env_CPP_set=${CPP+set}
577 ac_cv_env_CPP_value=$CPP
578
579 #
580 # Report the --help message.
581 #
582 if test "$ac_init_help" = "long"; then
583   # Omit some internal or obsolete options to make the list less imposing.
584   # This message is too long to be a string in the A/UX 3.1 sh.
585   cat <<EOF
586 \`configure' configures this package to adapt to many kinds of systems.
587
588 Usage: $0 [OPTION]... [VAR=VALUE]...
589
590 To assign environment variables (e.g., CC, CFLAGS...), specify them as
591 VAR=VALUE.  See below for descriptions of some of the useful variables.
592
593 Defaults for the options are specified in brackets.
594
595 Configuration:
596   -h, --help              display this help and exit
597       --help=short        display options specific to this package
598       --help=recursive    display the short help of all the included packages
599   -V, --version           display version information and exit
600   -q, --quiet, --silent   do not print \`checking...' messages
601       --cache-file=FILE   cache test results in FILE [disabled]
602   -C, --config-cache      alias for \`--cache-file=config.cache'
603   -n, --no-create         do not create output files
604       --srcdir=DIR        find the sources in DIR [configure dir or \`..']
605
606 EOF
607
608   cat <<EOF
609 Installation directories:
610   --prefix=PREFIX         install architecture-independent files in PREFIX
611                           [$ac_default_prefix]
612   --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
613                           [PREFIX]
614
615 By default, \`make install' will install all the files in
616 \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc.  You can specify
617 an installation prefix other than \`$ac_default_prefix' using \`--prefix',
618 for instance \`--prefix=\$HOME'.
619
620 For better control, use the options below.
621
622 Fine tuning of the installation directories:
623   --bindir=DIR            user executables [EPREFIX/bin]
624   --sbindir=DIR           system admin executables [EPREFIX/sbin]
625   --libexecdir=DIR        program executables [EPREFIX/libexec]
626   --datarootdir=DIR       read-only architecture-independent data [PREFIX/share]
627   --datadir=DIR           read-only architecture-independent data [DATAROOTDIR]
628   --sysconfdir=DIR        read-only single-machine data [PREFIX/etc]
629   --sharedstatedir=DIR    modifiable architecture-independent data [PREFIX/com]
630   --localstatedir=DIR     modifiable single-machine data [PREFIX/var]
631   --runstatedir=DIR       extra definition of runtime data [LOCALSTATEDIR/run]
632   --libdir=DIR            object code libraries [EPREFIX/lib]
633   --includedir=DIR        C header files [PREFIX/include]
634   --oldincludedir=DIR     C header files for non-gcc [/usr/include]
635   --infodir=DIR           info documentation [DATAROOTDIR/info]
636   --mandir=DIR            man documentation [DATAROOTDIR/man]
637 EOF
638
639   cat <<\EOF
640
641 Program names:
642   --program-prefix=PREFIX            prepend PREFIX to installed program names
643   --program-suffix=SUFFIX            append SUFFIX to installed program names
644   --program-transform-name=PROGRAM   run sed PROGRAM on installed program names
645
646 X features:
647   --x-includes=DIR    X include files are in DIR
648   --x-libraries=DIR   X library files are in DIR
649
650 System types:
651   --build=BUILD           configure for building on BUILD [guessed]
652   --host=HOST       build programs to run on HOST [BUILD]
653 EOF
654 fi
655
656 if test -n "$ac_init_help"; then
657
658   cat <<\EOF
659
660 Optional Features:
661   --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
662   --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
663
664 Optional Packages:
665   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
666   --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
667
668 General Options:
669   --disable-stripping     do not strip (debug info) installed executables
670   --enable-string-hacks   work around bogus compiler/loader warnings
671   --with-pkg-config{=path} enable/disable use of pkg-config
672   --disable-echo          do not display "compiling" commands
673 Curses Version-dependent Options:
674   --with-ncurses-wrap-prefix naming-prefix for ncurses wrapped-variables
675   --disable-widec         disable checks for wide-character functions
676   --with-curses-dir=DIR   directory in which (n)curses is installed
677   --with-screen=XXX       use specified curses-libraries
678   --with-ncursesw         use wide ncurses-libraries
679   --with-ncurses          use ncurses-libraries
680   --with-pdcurses         compile/link with pdcurses X11 library
681   --with-curses-colr      compile/link with HPUX 10.x color-curses
682   --with-curses-5lib      compile/link with SunOS 5lib curses
683   --with-Xaw3d            link with Xaw 3d library
684   --with-Xaw3dxft         link with Xaw 3d xft library
685   --with-neXtaw           link with neXT Athena library
686   --with-XawPlus          link with Athena-Plus library
687   --with-x                use the X Window System
688   --with-x11-rgb=FILE   file containing X11 rgb information (EPREFIX/lib/X11/rgb.txt)
689   --with-form-libname=XXX override form basename of library
690   --with-menu-libname=XXX override menu basename of library
691   --with-panel-libname=XXX override panel basename of library
692   --disable-panel         disable checks for panel functions
693   --disable-menu          disable checks for menu functions
694   --disable-form          disable checks for form functions
695 Testing/development Options:
696   --enable-warnings       test: turn on gcc compiler warnings
697   --with-dmalloc          test: use Gray Watson's dmalloc library
698   --with-dbmalloc         test: use Conor Cahill's dbmalloc library
699   --with-valgrind         test: use valgrind
700   --disable-leaks         test: free permanent memory, analyze leaks
701   --disable-rpath-hack    don't add rpath options for additional libraries
702
703 Some influential environment variables:
704   CC          C compiler command
705   CFLAGS      C compiler flags
706   LDFLAGS     linker flags, e.g. -L<lib dir> if you have libraries in a
707               nonstandard directory <lib dir>
708   CPPFLAGS    C/C++ preprocessor flags, e.g. -I<include dir> if you have
709               headers in a nonstandard directory <include dir>
710   CPP         C preprocessor
711
712 Use these variables to override the choices made by `configure' or to help
713 it to find libraries and programs with nonstandard names/locations.
714
715 EOF
716 fi
717
718 if test "$ac_init_help" = "recursive"; then
719   # If there are subdirs, report their specific --help.
720   ac_popdir=`pwd`
721   for ac_subdir in : $ac_subdirs_all; do test "x$ac_subdir" = x: && continue
722     cd $ac_subdir
723     # A "../" for each directory in /$ac_subdir.
724     ac_dots=`echo $ac_subdir |
725              sed 's,^\./,,;s,[^/]$,&/,;s,[^/]*/,../,g'`
726
727     case $srcdir in
728     .) # No --srcdir option.  We are building in place.
729       ac_sub_srcdir=$srcdir ;;
730     [\\/]* | ?:[\\/]* ) # Absolute path.
731       ac_sub_srcdir=$srcdir/$ac_subdir ;;
732     *) # Relative path.
733       ac_sub_srcdir=$ac_dots$srcdir/$ac_subdir ;;
734     esac
735
736     # Check for guested configure; otherwise get Cygnus style configure.
737     if test -f $ac_sub_srcdir/configure.gnu; then
738       echo
739       $SHELL $ac_sub_srcdir/configure.gnu  --help=recursive
740     elif test -f $ac_sub_srcdir/configure; then
741       echo
742       $SHELL $ac_sub_srcdir/configure  --help=recursive
743     elif test -f $ac_sub_srcdir/configure.ac ||
744            test -f $ac_sub_srcdir/configure.in; then
745       echo
746       $ac_configure --help
747     else
748       echo "$as_me: WARNING: no configuration information is in $ac_subdir" >&2
749     fi
750     cd $ac_popdir
751   done
752 fi
753
754 test -n "$ac_init_help" && exit 0
755 if $ac_init_version; then
756   cat <<\EOF
757
758 Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
759 Free Software Foundation, Inc.
760 This configure script is free software; the Free Software Foundation
761 gives unlimited permission to copy, distribute and modify it.
762 EOF
763   exit 0
764 fi
765 exec 5>config.log
766 cat >&5 <<EOF
767 This file contains any messages produced by compilers while
768 running configure, to aid debugging if configure makes a mistake.
769
770 It was created by $as_me, which was
771 generated by GNU Autoconf 2.52.20200802.  Invocation command line was
772
773   $ $0 $@
774
775 EOF
776 {
777 cat <<_ASUNAME
778 ## ---------- ##
779 ## Platform.  ##
780 ## ---------- ##
781
782 hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
783 uname -m = `(uname -m) 2>/dev/null || echo unknown`
784 uname -r = `(uname -r) 2>/dev/null || echo unknown`
785 uname -s = `(uname -s) 2>/dev/null || echo unknown`
786 uname -v = `(uname -v) 2>/dev/null || echo unknown`
787
788 /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
789 /bin/uname -X     = `(/bin/uname -X) 2>/dev/null     || echo unknown`
790
791 /bin/arch              = `(/bin/arch) 2>/dev/null              || echo unknown`
792 /usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null       || echo unknown`
793 /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
794 hostinfo               = `(hostinfo) 2>/dev/null               || echo unknown`
795 /bin/machine           = `(/bin/machine) 2>/dev/null           || echo unknown`
796 /usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null       || echo unknown`
797 /bin/universe          = `(/bin/universe) 2>/dev/null          || echo unknown`
798
799 PATH = $PATH
800
801 _ASUNAME
802 } >&5
803
804 cat >&5 <<EOF
805 ## ------------ ##
806 ## Core tests.  ##
807 ## ------------ ##
808
809 EOF
810
811 # Keep a trace of the command line.
812 # Strip out --no-create and --no-recursion so they do not pile up.
813 # Also quote any args containing shell meta-characters.
814 ac_configure_args=
815 ac_sep=
816 for ac_arg
817 do
818   case $ac_arg in
819   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
820   | --no-cr | --no-c) ;;
821   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
822   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
823   *" "*|*"      "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
824     ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"`
825     ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'"
826     ac_sep=" " ;;
827   *) ac_configure_args="$ac_configure_args$ac_sep$ac_arg"
828      ac_sep=" " ;;
829   esac
830   # Get rid of the leading space.
831 done
832
833 # When interrupted or exit'd, cleanup temporary files, and complete
834 # config.log.  We remove comments because anyway the quotes in there
835 # would cause problems or look ugly.
836 trap 'exit_status=$?
837   # Save into config.log some information that might help in debugging.
838   echo >&5
839   echo "## ----------------- ##" >&5
840   echo "## Cache variables.  ##" >&5
841   echo "## ----------------- ##" >&5
842   echo >&5
843   # The following way of writing the cache mishandles newlines in values,
844 {
845   (set) 2>&1 |
846     case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in
847     *ac_space=\ *)
848       sed -n \
849         "s/'"'"'/'"'"'\\\\'"'"''"'"'/g;
850           s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p"
851       ;;
852     *)
853       sed -n \
854         "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
855       ;;
856     esac;
857 } >&5
858   sed "/^$/d" confdefs.h >conftest.log
859   if test -s conftest.log; then
860     echo >&5
861     echo "## ------------ ##" >&5
862     echo "## confdefs.h.  ##" >&5
863     echo "## ------------ ##" >&5
864     echo >&5
865     cat conftest.log >&5
866   fi
867   (echo; echo) >&5
868   test "$ac_signal" != 0 &&
869     echo "$as_me: caught signal $ac_signal" >&5
870   echo "$as_me: exit $exit_status" >&5
871   rm -rf conftest* confdefs* core core.* *.core conf$$* $ac_clean_files &&
872     exit $exit_status
873      ' 0
874 for ac_signal in 1 2 13 15; do
875   trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal
876 done
877 ac_signal=0
878
879 # confdefs.h avoids OS command line length limits that DEFS can exceed.
880 rm -rf conftest* confdefs.h
881 # AIX cpp loses on an empty file, so make sure it contains at least a newline.
882 echo >confdefs.h
883
884 # Let the site file select an alternate cache file if it wants to.
885 # Prefer explicitly selected file to automatically selected ones.
886 if test -z "$CONFIG_SITE"; then
887   if test "x$prefix" != xNONE; then
888     CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
889   else
890     CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
891   fi
892 fi
893 for ac_site_file in $CONFIG_SITE; do
894   if test -r "$ac_site_file"; then
895     { echo "$as_me:895: loading site script $ac_site_file" >&5
896 echo "$as_me: loading site script $ac_site_file" >&6;}
897     cat "$ac_site_file" >&5
898     . "$ac_site_file"
899   fi
900 done
901
902 if test -r "$cache_file"; then
903   # Some versions of bash will fail to source /dev/null (special
904   # files actually), so we avoid doing that.
905   if test -f "$cache_file"; then
906     { echo "$as_me:906: loading cache $cache_file" >&5
907 echo "$as_me: loading cache $cache_file" >&6;}
908     case $cache_file in
909       [\\/]* | ?:[\\/]* ) . $cache_file;;
910       *)                      . ./$cache_file;;
911     esac
912   fi
913 else
914   { echo "$as_me:914: creating cache $cache_file" >&5
915 echo "$as_me: creating cache $cache_file" >&6;}
916   >$cache_file
917 fi
918
919 # Check that the precious variables saved in the cache have kept the same
920 # value.
921 ac_cache_corrupted=false
922 for ac_var in `(set) 2>&1 |
923                sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do
924   eval ac_old_set=\$ac_cv_env_${ac_var}_set
925   eval ac_new_set=\$ac_env_${ac_var}_set
926   eval ac_old_val="\$ac_cv_env_${ac_var}_value"
927   eval ac_new_val="\$ac_env_${ac_var}_value"
928   case $ac_old_set,$ac_new_set in
929     set,)
930       { echo "$as_me:930: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
931 echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
932       ac_cache_corrupted=: ;;
933     ,set)
934       { echo "$as_me:934: error: \`$ac_var' was not set in the previous run" >&5
935 echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
936       ac_cache_corrupted=: ;;
937     ,);;
938     *)
939       if test "x$ac_old_val" != "x$ac_new_val"; then
940         { echo "$as_me:940: error: \`$ac_var' has changed since the previous run:" >&5
941 echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
942         { echo "$as_me:942:   former value:  $ac_old_val" >&5
943 echo "$as_me:   former value:  $ac_old_val" >&2;}
944         { echo "$as_me:944:   current value: $ac_new_val" >&5
945 echo "$as_me:   current value: $ac_new_val" >&2;}
946         ac_cache_corrupted=:
947       fi;;
948   esac
949   # Pass precious variables to config.status.  It doesn't matter if
950   # we pass some twice (in addition to the command line arguments).
951   if test "$ac_new_set" = set; then
952     case $ac_new_val in
953     *" "*|*"    "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
954       ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"`
955       ac_configure_args="$ac_configure_args '$ac_arg'"
956       ;;
957     *) ac_configure_args="$ac_configure_args $ac_var=$ac_new_val"
958        ;;
959     esac
960   fi
961 done
962 if $ac_cache_corrupted; then
963   { echo "$as_me:963: error: changes in the environment can compromise the build" >&5
964 echo "$as_me: error: changes in the environment can compromise the build" >&2;}
965   { { echo "$as_me:965: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5
966 echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;}
967    { (exit 1); exit 1; }; }
968 fi
969
970 ac_ext=c
971 ac_cpp='$CPP $CPPFLAGS'
972 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
973 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
974 ac_compiler_gnu=$ac_cv_c_compiler_gnu
975 ac_main_return=return
976
977 case `echo "testing\c" 2>/dev/null; echo 1,2,3`,`echo -n testing 2>/dev/null; echo 1,2,3` in
978   *c*,-n*) ECHO_N= ECHO_C=      # newlines do not sed ;-) only broken shells would use this case anyway
979                    ECHO_T='     ' ;;
980   *c*,*  ) ECHO_N=-n ECHO_C= ECHO_T= ;;
981   *)      ECHO_N= ECHO_C='\c' ECHO_T= ;;
982 esac
983 echo "#! $SHELL" >conftest.sh
984 echo  "exit 0"   >>conftest.sh
985 chmod +x conftest.sh
986 if { (echo "$as_me:986: PATH=\".;.\"; conftest.sh") >&5
987   (PATH=".;."; conftest.sh) 2>&5
988   ac_status=$?
989   echo "$as_me:989: \$? = $ac_status" >&5
990   (exit $ac_status); }; then
991   ac_path_separator=';'
992 else
993   ac_path_separator=:
994 fi
995 PATH_SEPARATOR="$ac_path_separator"
996 rm -f conftest.sh
997
998 ac_config_headers="$ac_config_headers ncurses_cfg.h:ncurses_tst.hin"
999
1000 test -f config.guess || ( test -f ../config.guess && cp ../config.guess ./ )
1001
1002 test -f config.sub || ( test -f ../config.sub && cp ../config.sub ./ )
1003
1004 ac_aux_dir=
1005 for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
1006   if test -f $ac_dir/install-sh; then
1007     ac_aux_dir=$ac_dir
1008     ac_install_sh="$ac_aux_dir/install-sh -c"
1009     break
1010   elif test -f $ac_dir/install.sh; then
1011     ac_aux_dir=$ac_dir
1012     ac_install_sh="$ac_aux_dir/install.sh -c"
1013     break
1014   elif test -f $ac_dir/shtool; then
1015     ac_aux_dir=$ac_dir
1016     ac_install_sh="$ac_aux_dir/shtool install -c"
1017     break
1018   fi
1019 done
1020 if test -z "$ac_aux_dir"; then
1021   { { echo "$as_me:1021: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5
1022 echo "$as_me: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&2;}
1023    { (exit 1); exit 1; }; }
1024 fi
1025 ac_config_guess="$SHELL $ac_aux_dir/config.guess"
1026 ac_config_sub="$SHELL $ac_aux_dir/config.sub"
1027 ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure.
1028
1029 # Make sure we can run config.sub.
1030 $ac_config_sub sun4 >/dev/null 2>&1 ||
1031   { { echo "$as_me:1031: error: cannot run $ac_config_sub" >&5
1032 echo "$as_me: error: cannot run $ac_config_sub" >&2;}
1033    { (exit 1); exit 1; }; }
1034
1035 echo "$as_me:1035: checking build system type" >&5
1036 echo $ECHO_N "checking build system type... $ECHO_C" >&6
1037 if test "${ac_cv_build+set}" = set; then
1038   echo $ECHO_N "(cached) $ECHO_C" >&6
1039 else
1040   ac_cv_build_alias=$build_alias
1041 test -z "$ac_cv_build_alias" &&
1042   ac_cv_build_alias=`$ac_config_guess`
1043 test -z "$ac_cv_build_alias" &&
1044   { { echo "$as_me:1044: error: cannot guess build type; you must specify one" >&5
1045 echo "$as_me: error: cannot guess build type; you must specify one" >&2;}
1046    { (exit 1); exit 1; }; }
1047 ac_cv_build=`$ac_config_sub $ac_cv_build_alias` ||
1048   { { echo "$as_me:1048: error: $ac_config_sub $ac_cv_build_alias failed." >&5
1049 echo "$as_me: error: $ac_config_sub $ac_cv_build_alias failed." >&2;}
1050    { (exit 1); exit 1; }; }
1051
1052 fi
1053 echo "$as_me:1053: result: $ac_cv_build" >&5
1054 echo "${ECHO_T}$ac_cv_build" >&6
1055 build=$ac_cv_build
1056 build_cpu=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
1057 build_vendor=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
1058 build_os=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
1059
1060 if test -f $srcdir/config.guess || test -f $ac_aux_dir/config.guess ; then
1061         echo "$as_me:1061: checking host system type" >&5
1062 echo $ECHO_N "checking host system type... $ECHO_C" >&6
1063 if test "${ac_cv_host+set}" = set; then
1064   echo $ECHO_N "(cached) $ECHO_C" >&6
1065 else
1066   ac_cv_host_alias=$host_alias
1067 test -z "$ac_cv_host_alias" &&
1068   ac_cv_host_alias=$ac_cv_build_alias
1069 ac_cv_host=`$ac_config_sub $ac_cv_host_alias` ||
1070   { { echo "$as_me:1070: error: $ac_config_sub $ac_cv_host_alias failed" >&5
1071 echo "$as_me: error: $ac_config_sub $ac_cv_host_alias failed" >&2;}
1072    { (exit 1); exit 1; }; }
1073
1074 fi
1075 echo "$as_me:1075: result: $ac_cv_host" >&5
1076 echo "${ECHO_T}$ac_cv_host" >&6
1077 host=$ac_cv_host
1078 host_cpu=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
1079 host_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
1080 host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
1081
1082         system_name="$host_os"
1083 else
1084         system_name="`(uname -s -r) 2>/dev/null`"
1085         if test -z "$system_name" ; then
1086                 system_name="`(hostname) 2>/dev/null`"
1087         fi
1088 fi
1089 test -n "$system_name" &&
1090 cat >>confdefs.h <<EOF
1091 #define SYSTEM_NAME "$system_name"
1092 EOF
1093
1094 if test "${cf_cv_system_name+set}" = set; then
1095   echo $ECHO_N "(cached) $ECHO_C" >&6
1096 else
1097   cf_cv_system_name="$system_name"
1098 fi
1099
1100 test -z "$system_name" && system_name="$cf_cv_system_name"
1101 test -n "$cf_cv_system_name" && echo "$as_me:1101: result: Configuring for $cf_cv_system_name" >&5
1102 echo "${ECHO_T}Configuring for $cf_cv_system_name" >&6
1103
1104 if test ".$system_name" != ".$cf_cv_system_name" ; then
1105         echo "$as_me:1105: result: Cached system name ($system_name) does not agree with actual ($cf_cv_system_name)" >&5
1106 echo "${ECHO_T}Cached system name ($system_name) does not agree with actual ($cf_cv_system_name)" >&6
1107         { { echo "$as_me:1107: error: \"Please remove config.cache and try again.\"" >&5
1108 echo "$as_me: error: \"Please remove config.cache and try again.\"" >&2;}
1109    { (exit 1); exit 1; }; }
1110 fi
1111
1112 test "$program_prefix" != NONE &&
1113   program_transform_name="s,^,$program_prefix,;$program_transform_name"
1114 # Use a double $ so make ignores it.
1115 test "$program_suffix" != NONE &&
1116   program_transform_name="s,\$,$program_suffix,;$program_transform_name"
1117 # Double any \ or $.  echo might interpret backslashes.
1118 # By default was `s,x,x', remove it if useless.
1119 cat <<\_ACEOF >conftest.sed
1120 s/[\\$]/&&/g;s/;s,x,x,$//
1121 _ACEOF
1122 program_transform_name=`echo $program_transform_name | sed -f conftest.sed`
1123 rm conftest.sed
1124
1125 echo "$as_me:1125: checking whether ${MAKE-make} sets \${MAKE}" >&5
1126 echo $ECHO_N "checking whether ${MAKE-make} sets \${MAKE}... $ECHO_C" >&6
1127 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,./+-,__p_,'`
1128 if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then
1129   echo $ECHO_N "(cached) $ECHO_C" >&6
1130 else
1131   cat >conftest.make <<\EOF
1132 all:
1133         @echo 'ac_maketemp="${MAKE}"'
1134 EOF
1135 # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
1136 eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=`
1137 if test -n "$ac_maketemp"; then
1138   eval ac_cv_prog_make_${ac_make}_set=yes
1139 else
1140   eval ac_cv_prog_make_${ac_make}_set=no
1141 fi
1142 rm -f conftest.make
1143 fi
1144 if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
1145   echo "$as_me:1145: result: yes" >&5
1146 echo "${ECHO_T}yes" >&6
1147   SET_MAKE=
1148 else
1149   echo "$as_me:1149: result: no" >&5
1150 echo "${ECHO_T}no" >&6
1151   SET_MAKE="MAKE=${MAKE-make}"
1152 fi
1153
1154 ac_ext=c
1155 ac_cpp='$CPP $CPPFLAGS'
1156 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
1157 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
1158 ac_compiler_gnu=$ac_cv_c_compiler_gnu
1159 ac_main_return=return
1160 if test -n "$ac_tool_prefix"; then
1161   # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
1162 set dummy ${ac_tool_prefix}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_CC+set}" = set; then
1166   echo $ECHO_N "(cached) $ECHO_C" >&6
1167 else
1168   if test -n "$CC"; then
1169   ac_cv_prog_CC="$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_CC="${ac_tool_prefix}gcc"
1178 echo "$as_me:1178: found $ac_dir/$ac_word" >&5
1179 break
1180 done
1181
1182 fi
1183 fi
1184 CC=$ac_cv_prog_CC
1185 if test -n "$CC"; then
1186   echo "$as_me:1186: result: $CC" >&5
1187 echo "${ECHO_T}$CC" >&6
1188 else
1189   echo "$as_me:1189: result: no" >&5
1190 echo "${ECHO_T}no" >&6
1191 fi
1192
1193 fi
1194 if test -z "$ac_cv_prog_CC"; then
1195   ac_ct_CC=$CC
1196   # Extract the first word of "gcc", so it can be a program name with args.
1197 set dummy gcc; ac_word=$2
1198 echo "$as_me:1198: checking for $ac_word" >&5
1199 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1200 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
1201   echo $ECHO_N "(cached) $ECHO_C" >&6
1202 else
1203   if test -n "$ac_ct_CC"; then
1204   ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
1205 else
1206   ac_save_IFS=$IFS; IFS=$ac_path_separator
1207 ac_dummy="$PATH"
1208 for ac_dir in $ac_dummy; do
1209   IFS=$ac_save_IFS
1210   test -z "$ac_dir" && ac_dir=.
1211   $as_executable_p "$ac_dir/$ac_word" || continue
1212 ac_cv_prog_ac_ct_CC="gcc"
1213 echo "$as_me:1213: found $ac_dir/$ac_word" >&5
1214 break
1215 done
1216
1217 fi
1218 fi
1219 ac_ct_CC=$ac_cv_prog_ac_ct_CC
1220 if test -n "$ac_ct_CC"; then
1221   echo "$as_me:1221: result: $ac_ct_CC" >&5
1222 echo "${ECHO_T}$ac_ct_CC" >&6
1223 else
1224   echo "$as_me:1224: result: no" >&5
1225 echo "${ECHO_T}no" >&6
1226 fi
1227
1228   CC=$ac_ct_CC
1229 else
1230   CC="$ac_cv_prog_CC"
1231 fi
1232
1233 if test -z "$CC"; then
1234   if test -n "$ac_tool_prefix"; then
1235   # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
1236 set dummy ${ac_tool_prefix}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_CC+set}" = set; then
1240   echo $ECHO_N "(cached) $ECHO_C" >&6
1241 else
1242   if test -n "$CC"; then
1243   ac_cv_prog_CC="$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_CC="${ac_tool_prefix}cc"
1252 echo "$as_me:1252: found $ac_dir/$ac_word" >&5
1253 break
1254 done
1255
1256 fi
1257 fi
1258 CC=$ac_cv_prog_CC
1259 if test -n "$CC"; then
1260   echo "$as_me:1260: result: $CC" >&5
1261 echo "${ECHO_T}$CC" >&6
1262 else
1263   echo "$as_me:1263: result: no" >&5
1264 echo "${ECHO_T}no" >&6
1265 fi
1266
1267 fi
1268 if test -z "$ac_cv_prog_CC"; then
1269   ac_ct_CC=$CC
1270   # Extract the first word of "cc", so it can be a program name with args.
1271 set dummy cc; ac_word=$2
1272 echo "$as_me:1272: checking for $ac_word" >&5
1273 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1274 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
1275   echo $ECHO_N "(cached) $ECHO_C" >&6
1276 else
1277   if test -n "$ac_ct_CC"; then
1278   ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
1279 else
1280   ac_save_IFS=$IFS; IFS=$ac_path_separator
1281 ac_dummy="$PATH"
1282 for ac_dir in $ac_dummy; do
1283   IFS=$ac_save_IFS
1284   test -z "$ac_dir" && ac_dir=.
1285   $as_executable_p "$ac_dir/$ac_word" || continue
1286 ac_cv_prog_ac_ct_CC="cc"
1287 echo "$as_me:1287: found $ac_dir/$ac_word" >&5
1288 break
1289 done
1290
1291 fi
1292 fi
1293 ac_ct_CC=$ac_cv_prog_ac_ct_CC
1294 if test -n "$ac_ct_CC"; then
1295   echo "$as_me:1295: result: $ac_ct_CC" >&5
1296 echo "${ECHO_T}$ac_ct_CC" >&6
1297 else
1298   echo "$as_me:1298: result: no" >&5
1299 echo "${ECHO_T}no" >&6
1300 fi
1301
1302   CC=$ac_ct_CC
1303 else
1304   CC="$ac_cv_prog_CC"
1305 fi
1306
1307 fi
1308 if test -z "$CC"; then
1309   # Extract the first word of "cc", so it can be a program name with args.
1310 set dummy cc; ac_word=$2
1311 echo "$as_me:1311: checking for $ac_word" >&5
1312 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1313 if test "${ac_cv_prog_CC+set}" = set; then
1314   echo $ECHO_N "(cached) $ECHO_C" >&6
1315 else
1316   if test -n "$CC"; then
1317   ac_cv_prog_CC="$CC" # Let the user override the test.
1318 else
1319   ac_prog_rejected=no
1320   ac_save_IFS=$IFS; IFS=$ac_path_separator
1321 ac_dummy="$PATH"
1322 for ac_dir in $ac_dummy; do
1323   IFS=$ac_save_IFS
1324   test -z "$ac_dir" && ac_dir=.
1325   $as_executable_p "$ac_dir/$ac_word" || continue
1326 if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
1327   ac_prog_rejected=yes
1328   continue
1329 fi
1330 ac_cv_prog_CC="cc"
1331 echo "$as_me:1331: found $ac_dir/$ac_word" >&5
1332 break
1333 done
1334
1335 if test $ac_prog_rejected = yes; then
1336   # We found a bogon in the path, so make sure we never use it.
1337   set dummy $ac_cv_prog_CC
1338   shift
1339   if test $# != 0; then
1340     # We chose a different compiler from the bogus one.
1341     # However, it has the same basename, so the bogon will be chosen
1342     # first if we set CC to just the basename; use the full file name.
1343     shift
1344     set dummy "$ac_dir/$ac_word" ${1+"$@"}
1345     shift
1346     ac_cv_prog_CC="$@"
1347   fi
1348 fi
1349 fi
1350 fi
1351 CC=$ac_cv_prog_CC
1352 if test -n "$CC"; then
1353   echo "$as_me:1353: result: $CC" >&5
1354 echo "${ECHO_T}$CC" >&6
1355 else
1356   echo "$as_me:1356: result: no" >&5
1357 echo "${ECHO_T}no" >&6
1358 fi
1359
1360 fi
1361 if test -z "$CC"; then
1362   if test -n "$ac_tool_prefix"; then
1363   for ac_prog in cl
1364   do
1365     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
1366 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
1367 echo "$as_me:1367: checking for $ac_word" >&5
1368 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1369 if test "${ac_cv_prog_CC+set}" = set; then
1370   echo $ECHO_N "(cached) $ECHO_C" >&6
1371 else
1372   if test -n "$CC"; then
1373   ac_cv_prog_CC="$CC" # Let the user override the test.
1374 else
1375   ac_save_IFS=$IFS; IFS=$ac_path_separator
1376 ac_dummy="$PATH"
1377 for ac_dir in $ac_dummy; do
1378   IFS=$ac_save_IFS
1379   test -z "$ac_dir" && ac_dir=.
1380   $as_executable_p "$ac_dir/$ac_word" || continue
1381 ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
1382 echo "$as_me:1382: found $ac_dir/$ac_word" >&5
1383 break
1384 done
1385
1386 fi
1387 fi
1388 CC=$ac_cv_prog_CC
1389 if test -n "$CC"; then
1390   echo "$as_me:1390: result: $CC" >&5
1391 echo "${ECHO_T}$CC" >&6
1392 else
1393   echo "$as_me:1393: result: no" >&5
1394 echo "${ECHO_T}no" >&6
1395 fi
1396
1397     test -n "$CC" && break
1398   done
1399 fi
1400 if test -z "$CC"; then
1401   ac_ct_CC=$CC
1402   for ac_prog in cl
1403 do
1404   # Extract the first word of "$ac_prog", so it can be a program name with args.
1405 set dummy $ac_prog; ac_word=$2
1406 echo "$as_me:1406: checking for $ac_word" >&5
1407 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1408 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
1409   echo $ECHO_N "(cached) $ECHO_C" >&6
1410 else
1411   if test -n "$ac_ct_CC"; then
1412   ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
1413 else
1414   ac_save_IFS=$IFS; IFS=$ac_path_separator
1415 ac_dummy="$PATH"
1416 for ac_dir in $ac_dummy; do
1417   IFS=$ac_save_IFS
1418   test -z "$ac_dir" && ac_dir=.
1419   $as_executable_p "$ac_dir/$ac_word" || continue
1420 ac_cv_prog_ac_ct_CC="$ac_prog"
1421 echo "$as_me:1421: found $ac_dir/$ac_word" >&5
1422 break
1423 done
1424
1425 fi
1426 fi
1427 ac_ct_CC=$ac_cv_prog_ac_ct_CC
1428 if test -n "$ac_ct_CC"; then
1429   echo "$as_me:1429: result: $ac_ct_CC" >&5
1430 echo "${ECHO_T}$ac_ct_CC" >&6
1431 else
1432   echo "$as_me:1432: result: no" >&5
1433 echo "${ECHO_T}no" >&6
1434 fi
1435
1436   test -n "$ac_ct_CC" && break
1437 done
1438
1439   CC=$ac_ct_CC
1440 fi
1441
1442 fi
1443
1444 test -z "$CC" && { { echo "$as_me:1444: error: no acceptable cc found in \$PATH" >&5
1445 echo "$as_me: error: no acceptable cc found in \$PATH" >&2;}
1446    { (exit 1); exit 1; }; }
1447
1448 # Provide some information about the compiler.
1449 echo "$as_me:1449:" \
1450      "checking for C compiler version" >&5
1451 ac_compiler=`set X $ac_compile; echo $2`
1452 { (eval echo "$as_me:1452: \"$ac_compiler --version </dev/null >&5\"") >&5
1453   (eval $ac_compiler --version </dev/null >&5) 2>&5
1454   ac_status=$?
1455   echo "$as_me:1455: \$? = $ac_status" >&5
1456   (exit $ac_status); }
1457 { (eval echo "$as_me:1457: \"$ac_compiler -v </dev/null >&5\"") >&5
1458   (eval $ac_compiler -v </dev/null >&5) 2>&5
1459   ac_status=$?
1460   echo "$as_me:1460: \$? = $ac_status" >&5
1461   (exit $ac_status); }
1462 { (eval echo "$as_me:1462: \"$ac_compiler -V </dev/null >&5\"") >&5
1463   (eval $ac_compiler -V </dev/null >&5) 2>&5
1464   ac_status=$?
1465   echo "$as_me:1465: \$? = $ac_status" >&5
1466   (exit $ac_status); }
1467
1468 cat >conftest.$ac_ext <<_ACEOF
1469 #line 1469 "configure"
1470 #include "confdefs.h"
1471
1472 int
1473 main (void)
1474 {
1475
1476   ;
1477   return 0;
1478 }
1479 _ACEOF
1480 ac_clean_files_save=$ac_clean_files
1481 ac_clean_files="$ac_clean_files a.out a.exe"
1482 # Try to create an executable without -o first, disregard a.out.
1483 # It will help us diagnose broken compilers, and finding out an intuition
1484 # of exeext.
1485 echo "$as_me:1485: checking for C compiler default output" >&5
1486 echo $ECHO_N "checking for C compiler default output... $ECHO_C" >&6
1487 ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
1488 if { (eval echo "$as_me:1488: \"$ac_link_default\"") >&5
1489   (eval $ac_link_default) 2>&5
1490   ac_status=$?
1491   echo "$as_me:1491: \$? = $ac_status" >&5
1492   (exit $ac_status); }; then
1493   # Find the output, starting from the most likely.  This scheme is
1494 # not robust to junk in `.', hence go to wildcards (a.*) only as a last
1495 # resort.
1496 for ac_file in `ls a.exe conftest.exe 2>/dev/null;
1497                 ls a.out conftest 2>/dev/null;
1498                 ls a.* conftest.* 2>/dev/null`; do
1499   case $ac_file in
1500     *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;;
1501     a.out ) # We found the default executable, but exeext='' is most
1502             # certainly right.
1503             break;;
1504     *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
1505           # FIXME: I believe we export ac_cv_exeext for Libtool --akim.
1506           export ac_cv_exeext
1507           break;;
1508     * ) break;;
1509   esac
1510 done
1511 else
1512   echo "$as_me: failed program was:" >&5
1513 cat conftest.$ac_ext >&5
1514 { { echo "$as_me:1514: error: C compiler cannot create executables" >&5
1515 echo "$as_me: error: C compiler cannot create executables" >&2;}
1516    { (exit 77); exit 77; }; }
1517 fi
1518
1519 ac_exeext=$ac_cv_exeext
1520 echo "$as_me:1520: result: $ac_file" >&5
1521 echo "${ECHO_T}$ac_file" >&6
1522
1523 # Check the compiler produces executables we can run.  If not, either
1524 # the compiler is broken, or we cross compile.
1525 echo "$as_me:1525: checking whether the C compiler works" >&5
1526 echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6
1527 # FIXME: These cross compiler hacks should be removed for Autoconf 3.0
1528 # If not cross compiling, check that we can run a simple program.
1529 if test "$cross_compiling" != yes; then
1530   if { ac_try='./$ac_file'
1531   { (eval echo "$as_me:1531: \"$ac_try\"") >&5
1532   (eval $ac_try) 2>&5
1533   ac_status=$?
1534   echo "$as_me:1534: \$? = $ac_status" >&5
1535   (exit $ac_status); }; }; then
1536     cross_compiling=no
1537   else
1538     if test "$cross_compiling" = maybe; then
1539         cross_compiling=yes
1540     else
1541         { { echo "$as_me:1541: error: cannot run C compiled programs.
1542 If you meant to cross compile, use \`--host'." >&5
1543 echo "$as_me: error: cannot run C compiled programs.
1544 If you meant to cross compile, use \`--host'." >&2;}
1545    { (exit 1); exit 1; }; }
1546     fi
1547   fi
1548 fi
1549 echo "$as_me:1549: result: yes" >&5
1550 echo "${ECHO_T}yes" >&6
1551
1552 rm -f a.out a.exe conftest$ac_cv_exeext
1553 ac_clean_files=$ac_clean_files_save
1554 # Check the compiler produces executables we can run.  If not, either
1555 # the compiler is broken, or we cross compile.
1556 echo "$as_me:1556: checking whether we are cross compiling" >&5
1557 echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6
1558 echo "$as_me:1558: result: $cross_compiling" >&5
1559 echo "${ECHO_T}$cross_compiling" >&6
1560
1561 echo "$as_me:1561: checking for executable suffix" >&5
1562 echo $ECHO_N "checking for executable suffix... $ECHO_C" >&6
1563 if { (eval echo "$as_me:1563: \"$ac_link\"") >&5
1564   (eval $ac_link) 2>&5
1565   ac_status=$?
1566   echo "$as_me:1566: \$? = $ac_status" >&5
1567   (exit $ac_status); }; then
1568   # If both `conftest.exe' and `conftest' are `present' (well, observable)
1569 # catch `conftest.exe'.  For instance with Cygwin, `ls conftest' will
1570 # work properly (i.e., refer to `conftest.exe'), while it won't with
1571 # `rm'.
1572 for ac_file in `(ls conftest.exe; ls conftest; ls conftest.*) 2>/dev/null`; do
1573   case $ac_file in
1574     *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;;
1575     *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
1576           export ac_cv_exeext
1577           break;;
1578     * ) break;;
1579   esac
1580 done
1581 else
1582   { { echo "$as_me:1582: error: cannot compute EXEEXT: cannot compile and link" >&5
1583 echo "$as_me: error: cannot compute EXEEXT: cannot compile and link" >&2;}
1584    { (exit 1); exit 1; }; }
1585 fi
1586
1587 rm -f conftest$ac_cv_exeext
1588 echo "$as_me:1588: result: $ac_cv_exeext" >&5
1589 echo "${ECHO_T}$ac_cv_exeext" >&6
1590
1591 rm -f conftest.$ac_ext
1592 EXEEXT=$ac_cv_exeext
1593 ac_exeext=$EXEEXT
1594 echo "$as_me:1594: checking for object suffix" >&5
1595 echo $ECHO_N "checking for object suffix... $ECHO_C" >&6
1596 if test "${ac_cv_objext+set}" = set; then
1597   echo $ECHO_N "(cached) $ECHO_C" >&6
1598 else
1599   cat >conftest.$ac_ext <<_ACEOF
1600 #line 1600 "configure"
1601 #include "confdefs.h"
1602
1603 int
1604 main (void)
1605 {
1606
1607   ;
1608   return 0;
1609 }
1610 _ACEOF
1611 rm -f conftest.o conftest.obj
1612 if { (eval echo "$as_me:1612: \"$ac_compile\"") >&5
1613   (eval $ac_compile) 2>&5
1614   ac_status=$?
1615   echo "$as_me:1615: \$? = $ac_status" >&5
1616   (exit $ac_status); }; then
1617   for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do
1618   case $ac_file in
1619     *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.map | *.inf ) ;;
1620     *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
1621        break;;
1622   esac
1623 done
1624 else
1625   echo "$as_me: failed program was:" >&5
1626 cat conftest.$ac_ext >&5
1627 { { echo "$as_me:1627: error: cannot compute OBJEXT: cannot compile" >&5
1628 echo "$as_me: error: cannot compute OBJEXT: cannot compile" >&2;}
1629    { (exit 1); exit 1; }; }
1630 fi
1631
1632 rm -f conftest.$ac_cv_objext conftest.$ac_ext
1633 fi
1634 echo "$as_me:1634: result: $ac_cv_objext" >&5
1635 echo "${ECHO_T}$ac_cv_objext" >&6
1636 OBJEXT=$ac_cv_objext
1637 ac_objext=$OBJEXT
1638 echo "$as_me:1638: checking whether we are using the GNU C compiler" >&5
1639 echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6
1640 if test "${ac_cv_c_compiler_gnu+set}" = set; then
1641   echo $ECHO_N "(cached) $ECHO_C" >&6
1642 else
1643   cat >conftest.$ac_ext <<_ACEOF
1644 #line 1644 "configure"
1645 #include "confdefs.h"
1646
1647 int
1648 main (void)
1649 {
1650 #ifndef __GNUC__
1651        choke me
1652 #endif
1653
1654   ;
1655   return 0;
1656 }
1657 _ACEOF
1658 rm -f conftest.$ac_objext
1659 if { (eval echo "$as_me:1659: \"$ac_compile\"") >&5
1660   (eval $ac_compile) 2>&5
1661   ac_status=$?
1662   echo "$as_me:1662: \$? = $ac_status" >&5
1663   (exit $ac_status); } &&
1664          { ac_try='test -s conftest.$ac_objext'
1665   { (eval echo "$as_me:1665: \"$ac_try\"") >&5
1666   (eval $ac_try) 2>&5
1667   ac_status=$?
1668   echo "$as_me:1668: \$? = $ac_status" >&5
1669   (exit $ac_status); }; }; then
1670   ac_compiler_gnu=yes
1671 else
1672   echo "$as_me: failed program was:" >&5
1673 cat conftest.$ac_ext >&5
1674 ac_compiler_gnu=no
1675 fi
1676 rm -f conftest.$ac_objext conftest.$ac_ext
1677 ac_cv_c_compiler_gnu=$ac_compiler_gnu
1678
1679 fi
1680 echo "$as_me:1680: result: $ac_cv_c_compiler_gnu" >&5
1681 echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6
1682 GCC=`test $ac_compiler_gnu = yes && echo yes`
1683 ac_test_CFLAGS=${CFLAGS+set}
1684 ac_save_CFLAGS=$CFLAGS
1685 CFLAGS="-g"
1686 echo "$as_me:1686: checking whether $CC accepts -g" >&5
1687 echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6
1688 if test "${ac_cv_prog_cc_g+set}" = set; then
1689   echo $ECHO_N "(cached) $ECHO_C" >&6
1690 else
1691   cat >conftest.$ac_ext <<_ACEOF
1692 #line 1692 "configure"
1693 #include "confdefs.h"
1694
1695 int
1696 main (void)
1697 {
1698
1699   ;
1700   return 0;
1701 }
1702 _ACEOF
1703 rm -f conftest.$ac_objext
1704 if { (eval echo "$as_me:1704: \"$ac_compile\"") >&5
1705   (eval $ac_compile) 2>&5
1706   ac_status=$?
1707   echo "$as_me:1707: \$? = $ac_status" >&5
1708   (exit $ac_status); } &&
1709          { ac_try='test -s conftest.$ac_objext'
1710   { (eval echo "$as_me:1710: \"$ac_try\"") >&5
1711   (eval $ac_try) 2>&5
1712   ac_status=$?
1713   echo "$as_me:1713: \$? = $ac_status" >&5
1714   (exit $ac_status); }; }; then
1715   ac_cv_prog_cc_g=yes
1716 else
1717   echo "$as_me: failed program was:" >&5
1718 cat conftest.$ac_ext >&5
1719 ac_cv_prog_cc_g=no
1720 fi
1721 rm -f conftest.$ac_objext conftest.$ac_ext
1722 fi
1723 echo "$as_me:1723: result: $ac_cv_prog_cc_g" >&5
1724 echo "${ECHO_T}$ac_cv_prog_cc_g" >&6
1725 if test "$ac_test_CFLAGS" = set; then
1726   CFLAGS=$ac_save_CFLAGS
1727 elif test $ac_cv_prog_cc_g = yes; then
1728   if test "$GCC" = yes; then
1729     CFLAGS="-g -O2"
1730   else
1731     CFLAGS="-g"
1732   fi
1733 else
1734   if test "$GCC" = yes; then
1735     CFLAGS="-O2"
1736   else
1737     CFLAGS=
1738   fi
1739 fi
1740 # Some people use a C++ compiler to compile C.  Since we use `exit',
1741 # in C++ we need to declare it.  In case someone uses the same compiler
1742 # for both compiling C and C++ we need to have the C++ compiler decide
1743 # the declaration of exit, since it's the most demanding environment.
1744 cat >conftest.$ac_ext <<_ACEOF
1745 #ifndef __cplusplus
1746   choke me
1747 #endif
1748 _ACEOF
1749 rm -f conftest.$ac_objext
1750 if { (eval echo "$as_me:1750: \"$ac_compile\"") >&5
1751   (eval $ac_compile) 2>&5
1752   ac_status=$?
1753   echo "$as_me:1753: \$? = $ac_status" >&5
1754   (exit $ac_status); } &&
1755          { ac_try='test -s conftest.$ac_objext'
1756   { (eval echo "$as_me:1756: \"$ac_try\"") >&5
1757   (eval $ac_try) 2>&5
1758   ac_status=$?
1759   echo "$as_me:1759: \$? = $ac_status" >&5
1760   (exit $ac_status); }; }; then
1761   for ac_declaration in \
1762    ''\
1763    '#include <stdlib.h>' \
1764    'extern "C" void std::exit (int) throw (); using std::exit;' \
1765    'extern "C" void std::exit (int); using std::exit;' \
1766    'extern "C" void exit (int) throw ();' \
1767    'extern "C" void exit (int);' \
1768    'void exit (int);'
1769 do
1770   cat >conftest.$ac_ext <<_ACEOF
1771 #line 1771 "configure"
1772 #include "confdefs.h"
1773 #include <stdlib.h>
1774 $ac_declaration
1775 int
1776 main (void)
1777 {
1778 exit (42);
1779   ;
1780   return 0;
1781 }
1782 _ACEOF
1783 rm -f conftest.$ac_objext
1784 if { (eval echo "$as_me:1784: \"$ac_compile\"") >&5
1785   (eval $ac_compile) 2>&5
1786   ac_status=$?
1787   echo "$as_me:1787: \$? = $ac_status" >&5
1788   (exit $ac_status); } &&
1789          { ac_try='test -s conftest.$ac_objext'
1790   { (eval echo "$as_me:1790: \"$ac_try\"") >&5
1791   (eval $ac_try) 2>&5
1792   ac_status=$?
1793   echo "$as_me:1793: \$? = $ac_status" >&5
1794   (exit $ac_status); }; }; then
1795   :
1796 else
1797   echo "$as_me: failed program was:" >&5
1798 cat conftest.$ac_ext >&5
1799 continue
1800 fi
1801 rm -f conftest.$ac_objext conftest.$ac_ext
1802   cat >conftest.$ac_ext <<_ACEOF
1803 #line 1803 "configure"
1804 #include "confdefs.h"
1805 $ac_declaration
1806 int
1807 main (void)
1808 {
1809 exit (42);
1810   ;
1811   return 0;
1812 }
1813 _ACEOF
1814 rm -f conftest.$ac_objext
1815 if { (eval echo "$as_me:1815: \"$ac_compile\"") >&5
1816   (eval $ac_compile) 2>&5
1817   ac_status=$?
1818   echo "$as_me:1818: \$? = $ac_status" >&5
1819   (exit $ac_status); } &&
1820          { ac_try='test -s conftest.$ac_objext'
1821   { (eval echo "$as_me:1821: \"$ac_try\"") >&5
1822   (eval $ac_try) 2>&5
1823   ac_status=$?
1824   echo "$as_me:1824: \$? = $ac_status" >&5
1825   (exit $ac_status); }; }; then
1826   break
1827 else
1828   echo "$as_me: failed program was:" >&5
1829 cat conftest.$ac_ext >&5
1830 fi
1831 rm -f conftest.$ac_objext conftest.$ac_ext
1832 done
1833 rm -rf conftest*
1834 if test -n "$ac_declaration"; then
1835   echo '#ifdef __cplusplus' >>confdefs.h
1836   echo $ac_declaration      >>confdefs.h
1837   echo '#endif'             >>confdefs.h
1838 fi
1839
1840 else
1841   echo "$as_me: failed program was:" >&5
1842 cat conftest.$ac_ext >&5
1843 fi
1844 rm -f conftest.$ac_objext conftest.$ac_ext
1845 ac_ext=c
1846 ac_cpp='$CPP $CPPFLAGS'
1847 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
1848 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
1849 ac_compiler_gnu=$ac_cv_c_compiler_gnu
1850 ac_main_return=return
1851
1852 GCC_VERSION=none
1853 if test "$GCC" = yes ; then
1854         echo "$as_me:1854: checking version of $CC" >&5
1855 echo $ECHO_N "checking version of $CC... $ECHO_C" >&6
1856         GCC_VERSION="`${CC} --version 2>/dev/null | sed -e '2,$d' -e 's/^.*(GCC[^)]*) //' -e 's/^.*(Debian[^)]*) //' -e 's/^[^0-9.]*//' -e 's/[^0-9.].*//'`"
1857         test -z "$GCC_VERSION" && GCC_VERSION=unknown
1858         echo "$as_me:1858: result: $GCC_VERSION" >&5
1859 echo "${ECHO_T}$GCC_VERSION" >&6
1860 fi
1861
1862 INTEL_COMPILER=no
1863
1864 if test "$GCC" = yes ; then
1865         case $host_os in
1866         (linux*|gnu*)
1867                 echo "$as_me:1867: checking if this is really Intel C compiler" >&5
1868 echo $ECHO_N "checking if this is really Intel C compiler... $ECHO_C" >&6
1869                 cf_save_CFLAGS="$CFLAGS"
1870                 CFLAGS="$CFLAGS -no-gcc"
1871                 cat >conftest.$ac_ext <<_ACEOF
1872 #line 1872 "configure"
1873 #include "confdefs.h"
1874
1875 int
1876 main (void)
1877 {
1878
1879 #ifdef __INTEL_COMPILER
1880 #else
1881 make an error
1882 #endif
1883
1884   ;
1885   return 0;
1886 }
1887 _ACEOF
1888 rm -f conftest.$ac_objext
1889 if { (eval echo "$as_me:1889: \"$ac_compile\"") >&5
1890   (eval $ac_compile) 2>&5
1891   ac_status=$?
1892   echo "$as_me:1892: \$? = $ac_status" >&5
1893   (exit $ac_status); } &&
1894          { ac_try='test -s conftest.$ac_objext'
1895   { (eval echo "$as_me:1895: \"$ac_try\"") >&5
1896   (eval $ac_try) 2>&5
1897   ac_status=$?
1898   echo "$as_me:1898: \$? = $ac_status" >&5
1899   (exit $ac_status); }; }; then
1900   INTEL_COMPILER=yes
1901 cf_save_CFLAGS="$cf_save_CFLAGS -we147"
1902
1903 else
1904   echo "$as_me: failed program was:" >&5
1905 cat conftest.$ac_ext >&5
1906 fi
1907 rm -f conftest.$ac_objext conftest.$ac_ext
1908                 CFLAGS="$cf_save_CFLAGS"
1909                 echo "$as_me:1909: result: $INTEL_COMPILER" >&5
1910 echo "${ECHO_T}$INTEL_COMPILER" >&6
1911                 ;;
1912         esac
1913 fi
1914
1915 CLANG_COMPILER=no
1916
1917 if test "$GCC" = yes ; then
1918         echo "$as_me:1918: checking if this is really Clang C compiler" >&5
1919 echo $ECHO_N "checking if this is really Clang C compiler... $ECHO_C" >&6
1920         cf_save_CFLAGS="$CFLAGS"
1921         cat >conftest.$ac_ext <<_ACEOF
1922 #line 1922 "configure"
1923 #include "confdefs.h"
1924
1925 int
1926 main (void)
1927 {
1928
1929 #ifdef __clang__
1930 #else
1931 make an error
1932 #endif
1933
1934   ;
1935   return 0;
1936 }
1937 _ACEOF
1938 rm -f conftest.$ac_objext
1939 if { (eval echo "$as_me:1939: \"$ac_compile\"") >&5
1940   (eval $ac_compile) 2>&5
1941   ac_status=$?
1942   echo "$as_me:1942: \$? = $ac_status" >&5
1943   (exit $ac_status); } &&
1944          { ac_try='test -s conftest.$ac_objext'
1945   { (eval echo "$as_me:1945: \"$ac_try\"") >&5
1946   (eval $ac_try) 2>&5
1947   ac_status=$?
1948   echo "$as_me:1948: \$? = $ac_status" >&5
1949   (exit $ac_status); }; }; then
1950   CLANG_COMPILER=yes
1951
1952 else
1953   echo "$as_me: failed program was:" >&5
1954 cat conftest.$ac_ext >&5
1955 fi
1956 rm -f conftest.$ac_objext conftest.$ac_ext
1957         CFLAGS="$cf_save_CFLAGS"
1958         echo "$as_me:1958: result: $CLANG_COMPILER" >&5
1959 echo "${ECHO_T}$CLANG_COMPILER" >&6
1960 fi
1961
1962 CLANG_VERSION=none
1963
1964 if test "x$CLANG_COMPILER" = "xyes" ; then
1965         case "$CC" in
1966         (c[1-9][0-9]|*/c[1-9][0-9])
1967                 { echo "$as_me:1967: WARNING: replacing broken compiler alias $CC" >&5
1968 echo "$as_me: WARNING: replacing broken compiler alias $CC" >&2;}
1969                 CFLAGS="$CFLAGS -std=`echo "$CC" | sed -e 's%.*/%%'`"
1970                 CC=clang
1971                 ;;
1972         esac
1973
1974         echo "$as_me:1974: checking version of $CC" >&5
1975 echo $ECHO_N "checking version of $CC... $ECHO_C" >&6
1976         CLANG_VERSION="`$CC --version 2>/dev/null | sed -e '2,$d' -e 's/^.*(CLANG[^)]*) //' -e 's/^.*(Debian[^)]*) //' -e 's/^[^0-9.]*//' -e 's/[^0-9.].*//'`"
1977         test -z "$CLANG_VERSION" && CLANG_VERSION=unknown
1978         echo "$as_me:1978: result: $CLANG_VERSION" >&5
1979 echo "${ECHO_T}$CLANG_VERSION" >&6
1980
1981         for cf_clang_opt in \
1982                 -Qunused-arguments \
1983                 -Wno-error=implicit-function-declaration
1984         do
1985                 echo "$as_me:1985: checking if option $cf_clang_opt works" >&5
1986 echo $ECHO_N "checking if option $cf_clang_opt works... $ECHO_C" >&6
1987                 cf_save_CFLAGS="$CFLAGS"
1988                 CFLAGS="$CFLAGS $cf_clang_opt"
1989                 cat >conftest.$ac_ext <<_ACEOF
1990 #line 1990 "configure"
1991 #include "confdefs.h"
1992
1993                         #include <stdio.h>
1994 int
1995 main (void)
1996 {
1997
1998                         printf("hello!\n");
1999   ;
2000   return 0;
2001 }
2002 _ACEOF
2003 rm -f conftest.$ac_objext conftest$ac_exeext
2004 if { (eval echo "$as_me:2004: \"$ac_link\"") >&5
2005   (eval $ac_link) 2>&5
2006   ac_status=$?
2007   echo "$as_me:2007: \$? = $ac_status" >&5
2008   (exit $ac_status); } &&
2009          { ac_try='test -s conftest$ac_exeext'
2010   { (eval echo "$as_me:2010: \"$ac_try\"") >&5
2011   (eval $ac_try) 2>&5
2012   ac_status=$?
2013   echo "$as_me:2013: \$? = $ac_status" >&5
2014   (exit $ac_status); }; }; then
2015
2016                         cf_clang_optok=yes
2017 else
2018   echo "$as_me: failed program was:" >&5
2019 cat conftest.$ac_ext >&5
2020
2021                         cf_clang_optok=no
2022 fi
2023 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
2024                 echo "$as_me:2024: result: $cf_clang_optok" >&5
2025 echo "${ECHO_T}$cf_clang_optok" >&6
2026                 CFLAGS="$cf_save_CFLAGS"
2027                 if test $cf_clang_optok = yes; then
2028                         test -n "$verbose" && echo "    adding option $cf_clang_opt" 1>&6
2029
2030 echo "${as_me:-configure}:2030: testing adding option $cf_clang_opt ..." 1>&5
2031
2032         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
2033         CFLAGS="${CFLAGS}$cf_clang_opt"
2034
2035                 fi
2036         done
2037 fi
2038
2039 echo "$as_me:2039: checking for $CC option to accept ANSI C" >&5
2040 echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6
2041 if test "${ac_cv_prog_cc_stdc+set}" = set; then
2042   echo $ECHO_N "(cached) $ECHO_C" >&6
2043 else
2044   ac_cv_prog_cc_stdc=no
2045 ac_save_CC=$CC
2046 cat >conftest.$ac_ext <<_ACEOF
2047 #line 2047 "configure"
2048 #include "confdefs.h"
2049 #include <stdarg.h>
2050 #include <stdio.h>
2051 #include <sys/types.h>
2052 #include <sys/stat.h>
2053 /* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
2054 struct buf { int x; };
2055 FILE * (*rcsopen) (struct buf *, struct stat *, int);
2056 static char *e (p, i)
2057      char **p;
2058      int i;
2059 {
2060   return p[i];
2061 }
2062 static char *f (char * (*g) (char **, int), char **p, ...)
2063 {
2064   char *s;
2065   va_list v;
2066   va_start (v,p);
2067   s = g (p, va_arg (v,int));
2068   va_end (v);
2069   return s;
2070 }
2071 int test (int i, double x);
2072 struct s1 {int (*f) (int a);};
2073 struct s2 {int (*f) (double a);};
2074 int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
2075 int argc;
2076 char **argv;
2077 int
2078 main (void)
2079 {
2080 return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
2081   ;
2082   return 0;
2083 }
2084 _ACEOF
2085 # Don't try gcc -ansi; that turns off useful extensions and
2086 # breaks some systems' header files.
2087 # AIX                   -qlanglvl=ansi
2088 # Ultrix and OSF/1      -std1
2089 # HP-UX 10.20 and later -Ae
2090 # HP-UX older versions  -Aa -D_HPUX_SOURCE
2091 # SVR4                  -Xc -D__EXTENSIONS__
2092 for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
2093 do
2094   CC="$ac_save_CC $ac_arg"
2095   rm -f conftest.$ac_objext
2096 if { (eval echo "$as_me:2096: \"$ac_compile\"") >&5
2097   (eval $ac_compile) 2>&5
2098   ac_status=$?
2099   echo "$as_me:2099: \$? = $ac_status" >&5
2100   (exit $ac_status); } &&
2101          { ac_try='test -s conftest.$ac_objext'
2102   { (eval echo "$as_me:2102: \"$ac_try\"") >&5
2103   (eval $ac_try) 2>&5
2104   ac_status=$?
2105   echo "$as_me:2105: \$? = $ac_status" >&5
2106   (exit $ac_status); }; }; then
2107   ac_cv_prog_cc_stdc=$ac_arg
2108 break
2109 else
2110   echo "$as_me: failed program was:" >&5
2111 cat conftest.$ac_ext >&5
2112 fi
2113 rm -f conftest.$ac_objext
2114 done
2115 rm -f conftest.$ac_ext conftest.$ac_objext
2116 CC=$ac_save_CC
2117
2118 fi
2119
2120 case "x$ac_cv_prog_cc_stdc" in
2121   x|xno)
2122     echo "$as_me:2122: result: none needed" >&5
2123 echo "${ECHO_T}none needed" >&6 ;;
2124   *)
2125     echo "$as_me:2125: result: $ac_cv_prog_cc_stdc" >&5
2126 echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6
2127     CC="$CC $ac_cv_prog_cc_stdc" ;;
2128 esac
2129
2130 # This should have been defined by AC_PROG_CC
2131 : ${CC:=cc}
2132
2133 echo "$as_me:2133: checking \$CFLAGS variable" >&5
2134 echo $ECHO_N "checking \$CFLAGS variable... $ECHO_C" >&6
2135 case "x$CFLAGS" in
2136 (*-[IUD]*)
2137         echo "$as_me:2137: result: broken" >&5
2138 echo "${ECHO_T}broken" >&6
2139         { echo "$as_me:2139: WARNING: your environment uses the CFLAGS variable to hold CPPFLAGS options" >&5
2140 echo "$as_me: WARNING: your environment uses the CFLAGS variable to hold CPPFLAGS options" >&2;}
2141         cf_flags="$CFLAGS"
2142         CFLAGS=
2143         for cf_arg in $cf_flags
2144         do
2145
2146 cf_fix_cppflags=no
2147 cf_new_cflags=
2148 cf_new_cppflags=
2149 cf_new_extra_cppflags=
2150
2151 for cf_add_cflags in $cf_arg
2152 do
2153 case $cf_fix_cppflags in
2154 (no)
2155         case $cf_add_cflags in
2156         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
2157                 case $cf_add_cflags in
2158                 (-D*)
2159                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
2160
2161                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
2162                                 && test -z "${cf_tst_cflags}" \
2163                                 && cf_fix_cppflags=yes
2164
2165                         if test $cf_fix_cppflags = yes ; then
2166
2167         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
2168         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
2169
2170                                 continue
2171                         elif test "${cf_tst_cflags}" = "\"'" ; then
2172
2173         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
2174         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
2175
2176                                 continue
2177                         fi
2178                         ;;
2179                 esac
2180                 case "$CPPFLAGS" in
2181                 (*$cf_add_cflags)
2182                         ;;
2183                 (*)
2184                         case $cf_add_cflags in
2185                         (-D*)
2186                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
2187
2188 CPPFLAGS=`echo "$CPPFLAGS" | \
2189         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
2190                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
2191
2192                                 ;;
2193                         esac
2194
2195         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
2196         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
2197
2198                         ;;
2199                 esac
2200                 ;;
2201         (*)
2202
2203         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
2204         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
2205
2206                 ;;
2207         esac
2208         ;;
2209 (yes)
2210
2211         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
2212         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
2213
2214         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
2215
2216         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
2217                 && test -z "${cf_tst_cflags}" \
2218                 && cf_fix_cppflags=no
2219         ;;
2220 esac
2221 done
2222
2223 if test -n "$cf_new_cflags" ; then
2224
2225         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
2226         CFLAGS="${CFLAGS}$cf_new_cflags"
2227
2228 fi
2229
2230 if test -n "$cf_new_cppflags" ; then
2231
2232         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
2233         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
2234
2235 fi
2236
2237 if test -n "$cf_new_extra_cppflags" ; then
2238
2239         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
2240         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
2241
2242 fi
2243
2244         done
2245         ;;
2246 (*)
2247         echo "$as_me:2247: result: ok" >&5
2248 echo "${ECHO_T}ok" >&6
2249         ;;
2250 esac
2251
2252 echo "$as_me:2252: checking \$CC variable" >&5
2253 echo $ECHO_N "checking \$CC variable... $ECHO_C" >&6
2254 case "$CC" in
2255 (*[\ \  ]-*)
2256         echo "$as_me:2256: result: broken" >&5
2257 echo "${ECHO_T}broken" >&6
2258         { echo "$as_me:2258: WARNING: your environment uses the CC variable to hold CFLAGS/CPPFLAGS options" >&5
2259 echo "$as_me: WARNING: your environment uses the CC variable to hold CFLAGS/CPPFLAGS options" >&2;}
2260         # humor him...
2261         cf_prog=`echo "$CC" | sed -e 's/        / /g' -e 's/[ ]* / /g' -e 's/[ ]*[ ]-[^ ].*//'`
2262         cf_flags=`echo "$CC" | ${AWK:-awk} -v prog="$cf_prog" '{ printf("%s", substr($0,1+length(prog))); }'`
2263         CC="$cf_prog"
2264         for cf_arg in $cf_flags
2265         do
2266                 case "x$cf_arg" in
2267                 (x-[IUDfgOW]*)
2268
2269 cf_fix_cppflags=no
2270 cf_new_cflags=
2271 cf_new_cppflags=
2272 cf_new_extra_cppflags=
2273
2274 for cf_add_cflags in $cf_arg
2275 do
2276 case $cf_fix_cppflags in
2277 (no)
2278         case $cf_add_cflags in
2279         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
2280                 case $cf_add_cflags in
2281                 (-D*)
2282                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
2283
2284                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
2285                                 && test -z "${cf_tst_cflags}" \
2286                                 && cf_fix_cppflags=yes
2287
2288                         if test $cf_fix_cppflags = yes ; then
2289
2290         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
2291         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
2292
2293                                 continue
2294                         elif test "${cf_tst_cflags}" = "\"'" ; then
2295
2296         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
2297         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
2298
2299                                 continue
2300                         fi
2301                         ;;
2302                 esac
2303                 case "$CPPFLAGS" in
2304                 (*$cf_add_cflags)
2305                         ;;
2306                 (*)
2307                         case $cf_add_cflags in
2308                         (-D*)
2309                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
2310
2311 CPPFLAGS=`echo "$CPPFLAGS" | \
2312         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
2313                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
2314
2315                                 ;;
2316                         esac
2317
2318         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
2319         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
2320
2321                         ;;
2322                 esac
2323                 ;;
2324         (*)
2325
2326         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
2327         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
2328
2329                 ;;
2330         esac
2331         ;;
2332 (yes)
2333
2334         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
2335         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
2336
2337         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
2338
2339         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
2340                 && test -z "${cf_tst_cflags}" \
2341                 && cf_fix_cppflags=no
2342         ;;
2343 esac
2344 done
2345
2346 if test -n "$cf_new_cflags" ; then
2347
2348         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
2349         CFLAGS="${CFLAGS}$cf_new_cflags"
2350
2351 fi
2352
2353 if test -n "$cf_new_cppflags" ; then
2354
2355         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
2356         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
2357
2358 fi
2359
2360 if test -n "$cf_new_extra_cppflags" ; then
2361
2362         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
2363         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
2364
2365 fi
2366
2367                         ;;
2368                 (*)
2369                         CC="$CC $cf_arg"
2370                         ;;
2371                 esac
2372         done
2373         test -n "$verbose" && echo "    resulting CC: '$CC'" 1>&6
2374
2375 echo "${as_me:-configure}:2375: testing resulting CC: '$CC' ..." 1>&5
2376
2377         test -n "$verbose" && echo "    resulting CFLAGS: '$CFLAGS'" 1>&6
2378
2379 echo "${as_me:-configure}:2379: testing resulting CFLAGS: '$CFLAGS' ..." 1>&5
2380
2381         test -n "$verbose" && echo "    resulting CPPFLAGS: '$CPPFLAGS'" 1>&6
2382
2383 echo "${as_me:-configure}:2383: testing resulting CPPFLAGS: '$CPPFLAGS' ..." 1>&5
2384
2385         ;;
2386 (*)
2387         echo "$as_me:2387: result: ok" >&5
2388 echo "${ECHO_T}ok" >&6
2389         ;;
2390 esac
2391
2392 echo "$as_me:2392: checking for inline" >&5
2393 echo $ECHO_N "checking for inline... $ECHO_C" >&6
2394 if test "${ac_cv_c_inline+set}" = set; then
2395   echo $ECHO_N "(cached) $ECHO_C" >&6
2396 else
2397   ac_cv_c_inline=no
2398 for ac_kw in inline __inline__ __inline; do
2399   cat >conftest.$ac_ext <<_ACEOF
2400 #line 2400 "configure"
2401 #include "confdefs.h"
2402 #ifndef __cplusplus
2403 static $ac_kw int static_foo () {return 0; }
2404 $ac_kw int foo () {return 0; }
2405 #endif
2406
2407 _ACEOF
2408 rm -f conftest.$ac_objext
2409 if { (eval echo "$as_me:2409: \"$ac_compile\"") >&5
2410   (eval $ac_compile) 2>&5
2411   ac_status=$?
2412   echo "$as_me:2412: \$? = $ac_status" >&5
2413   (exit $ac_status); } &&
2414          { ac_try='test -s conftest.$ac_objext'
2415   { (eval echo "$as_me:2415: \"$ac_try\"") >&5
2416   (eval $ac_try) 2>&5
2417   ac_status=$?
2418   echo "$as_me:2418: \$? = $ac_status" >&5
2419   (exit $ac_status); }; }; then
2420   ac_cv_c_inline=$ac_kw; break
2421 else
2422   echo "$as_me: failed program was:" >&5
2423 cat conftest.$ac_ext >&5
2424 fi
2425 rm -f conftest.$ac_objext conftest.$ac_ext
2426 done
2427
2428 fi
2429 echo "$as_me:2429: result: $ac_cv_c_inline" >&5
2430 echo "${ECHO_T}$ac_cv_c_inline" >&6
2431 case $ac_cv_c_inline in
2432   inline | yes) ;;
2433   no)
2434 cat >>confdefs.h <<\EOF
2435 #define inline
2436 EOF
2437  ;;
2438   *)  cat >>confdefs.h <<EOF
2439 #define inline $ac_cv_c_inline
2440 EOF
2441  ;;
2442 esac
2443
2444 ac_ext=c
2445 ac_cpp='$CPP $CPPFLAGS'
2446 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
2447 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
2448 ac_compiler_gnu=$ac_cv_c_compiler_gnu
2449 ac_main_return=return
2450 echo "$as_me:2450: checking how to run the C preprocessor" >&5
2451 echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6
2452 # On Suns, sometimes $CPP names a directory.
2453 if test -n "$CPP" && test -d "$CPP"; then
2454   CPP=
2455 fi
2456 if test -z "$CPP"; then
2457   if test "${ac_cv_prog_CPP+set}" = set; then
2458   echo $ECHO_N "(cached) $ECHO_C" >&6
2459 else
2460       # Double quotes because CPP needs to be expanded
2461     for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
2462     do
2463       ac_preproc_ok=false
2464 for ac_c_preproc_warn_flag in '' yes
2465 do
2466   # Use a header file that comes with gcc, so configuring glibc
2467   # with a fresh cross-compiler works.
2468   # On the NeXT, cc -E runs the code through the compiler's parser,
2469   # not just through cpp. "Syntax error" is here to catch this case.
2470   cat >conftest.$ac_ext <<_ACEOF
2471 #line 2471 "configure"
2472 #include "confdefs.h"
2473 #include <assert.h>
2474                      Syntax error
2475 _ACEOF
2476 if { (eval echo "$as_me:2476: \"$ac_cpp conftest.$ac_ext\"") >&5
2477   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
2478   ac_status=$?
2479   egrep -v '^ *\+' conftest.er1 >conftest.err
2480   rm -f conftest.er1
2481   cat conftest.err >&5
2482   echo "$as_me:2482: \$? = $ac_status" >&5
2483   (exit $ac_status); } >/dev/null; then
2484   if test -s conftest.err; then
2485     ac_cpp_err=$ac_c_preproc_warn_flag
2486   else
2487     ac_cpp_err=
2488   fi
2489 else
2490   ac_cpp_err=yes
2491 fi
2492 if test -z "$ac_cpp_err"; then
2493   :
2494 else
2495   echo "$as_me: failed program was:" >&5
2496   cat conftest.$ac_ext >&5
2497   # Broken: fails on valid input.
2498 continue
2499 fi
2500 rm -f conftest.err conftest.$ac_ext
2501
2502   # OK, works on sane cases.  Now check whether non-existent headers
2503   # can be detected and how.
2504   cat >conftest.$ac_ext <<_ACEOF
2505 #line 2505 "configure"
2506 #include "confdefs.h"
2507 #include <ac_nonexistent.h>
2508 _ACEOF
2509 if { (eval echo "$as_me:2509: \"$ac_cpp conftest.$ac_ext\"") >&5
2510   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
2511   ac_status=$?
2512   egrep -v '^ *\+' conftest.er1 >conftest.err
2513   rm -f conftest.er1
2514   cat conftest.err >&5
2515   echo "$as_me:2515: \$? = $ac_status" >&5
2516   (exit $ac_status); } >/dev/null; then
2517   if test -s conftest.err; then
2518     ac_cpp_err=$ac_c_preproc_warn_flag
2519   else
2520     ac_cpp_err=
2521   fi
2522 else
2523   ac_cpp_err=yes
2524 fi
2525 if test -z "$ac_cpp_err"; then
2526   # Broken: success on invalid input.
2527 continue
2528 else
2529   echo "$as_me: failed program was:" >&5
2530   cat conftest.$ac_ext >&5
2531   # Passes both tests.
2532 ac_preproc_ok=:
2533 break
2534 fi
2535 rm -f conftest.err conftest.$ac_ext
2536
2537 done
2538 # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
2539 rm -f conftest.err conftest.$ac_ext
2540 if $ac_preproc_ok; then
2541   break
2542 fi
2543
2544     done
2545     ac_cv_prog_CPP=$CPP
2546
2547 fi
2548   CPP=$ac_cv_prog_CPP
2549 else
2550   ac_cv_prog_CPP=$CPP
2551 fi
2552 echo "$as_me:2552: result: $CPP" >&5
2553 echo "${ECHO_T}$CPP" >&6
2554 ac_preproc_ok=false
2555 for ac_c_preproc_warn_flag in '' yes
2556 do
2557   # Use a header file that comes with gcc, so configuring glibc
2558   # with a fresh cross-compiler works.
2559   # On the NeXT, cc -E runs the code through the compiler's parser,
2560   # not just through cpp. "Syntax error" is here to catch this case.
2561   cat >conftest.$ac_ext <<_ACEOF
2562 #line 2562 "configure"
2563 #include "confdefs.h"
2564 #include <assert.h>
2565                      Syntax error
2566 _ACEOF
2567 if { (eval echo "$as_me:2567: \"$ac_cpp conftest.$ac_ext\"") >&5
2568   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
2569   ac_status=$?
2570   egrep -v '^ *\+' conftest.er1 >conftest.err
2571   rm -f conftest.er1
2572   cat conftest.err >&5
2573   echo "$as_me:2573: \$? = $ac_status" >&5
2574   (exit $ac_status); } >/dev/null; then
2575   if test -s conftest.err; then
2576     ac_cpp_err=$ac_c_preproc_warn_flag
2577   else
2578     ac_cpp_err=
2579   fi
2580 else
2581   ac_cpp_err=yes
2582 fi
2583 if test -z "$ac_cpp_err"; then
2584   :
2585 else
2586   echo "$as_me: failed program was:" >&5
2587   cat conftest.$ac_ext >&5
2588   # Broken: fails on valid input.
2589 continue
2590 fi
2591 rm -f conftest.err conftest.$ac_ext
2592
2593   # OK, works on sane cases.  Now check whether non-existent headers
2594   # can be detected and how.
2595   cat >conftest.$ac_ext <<_ACEOF
2596 #line 2596 "configure"
2597 #include "confdefs.h"
2598 #include <ac_nonexistent.h>
2599 _ACEOF
2600 if { (eval echo "$as_me:2600: \"$ac_cpp conftest.$ac_ext\"") >&5
2601   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
2602   ac_status=$?
2603   egrep -v '^ *\+' conftest.er1 >conftest.err
2604   rm -f conftest.er1
2605   cat conftest.err >&5
2606   echo "$as_me:2606: \$? = $ac_status" >&5
2607   (exit $ac_status); } >/dev/null; then
2608   if test -s conftest.err; then
2609     ac_cpp_err=$ac_c_preproc_warn_flag
2610   else
2611     ac_cpp_err=
2612   fi
2613 else
2614   ac_cpp_err=yes
2615 fi
2616 if test -z "$ac_cpp_err"; then
2617   # Broken: success on invalid input.
2618 continue
2619 else
2620   echo "$as_me: failed program was:" >&5
2621   cat conftest.$ac_ext >&5
2622   # Passes both tests.
2623 ac_preproc_ok=:
2624 break
2625 fi
2626 rm -f conftest.err conftest.$ac_ext
2627
2628 done
2629 # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
2630 rm -f conftest.err conftest.$ac_ext
2631 if $ac_preproc_ok; then
2632   :
2633 else
2634   { { echo "$as_me:2634: error: C preprocessor \"$CPP\" fails sanity check" >&5
2635 echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check" >&2;}
2636    { (exit 1); exit 1; }; }
2637 fi
2638
2639 ac_ext=c
2640 ac_cpp='$CPP $CPPFLAGS'
2641 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
2642 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
2643 ac_compiler_gnu=$ac_cv_c_compiler_gnu
2644 ac_main_return=return
2645
2646 for ac_prog in mawk gawk nawk awk
2647 do
2648   # Extract the first word of "$ac_prog", so it can be a program name with args.
2649 set dummy $ac_prog; ac_word=$2
2650 echo "$as_me:2650: checking for $ac_word" >&5
2651 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2652 if test "${ac_cv_prog_AWK+set}" = set; then
2653   echo $ECHO_N "(cached) $ECHO_C" >&6
2654 else
2655   if test -n "$AWK"; then
2656   ac_cv_prog_AWK="$AWK" # Let the user override the test.
2657 else
2658   ac_save_IFS=$IFS; IFS=$ac_path_separator
2659 ac_dummy="$PATH"
2660 for ac_dir in $ac_dummy; do
2661   IFS=$ac_save_IFS
2662   test -z "$ac_dir" && ac_dir=.
2663   $as_executable_p "$ac_dir/$ac_word" || continue
2664 ac_cv_prog_AWK="$ac_prog"
2665 echo "$as_me:2665: found $ac_dir/$ac_word" >&5
2666 break
2667 done
2668
2669 fi
2670 fi
2671 AWK=$ac_cv_prog_AWK
2672 if test -n "$AWK"; then
2673   echo "$as_me:2673: result: $AWK" >&5
2674 echo "${ECHO_T}$AWK" >&6
2675 else
2676   echo "$as_me:2676: result: no" >&5
2677 echo "${ECHO_T}no" >&6
2678 fi
2679
2680   test -n "$AWK" && break
2681 done
2682
2683 # Find a good install program.  We prefer a C program (faster),
2684 # so one script is as good as another.  But avoid the broken or
2685 # incompatible versions:
2686 # SysV /etc/install, /usr/sbin/install
2687 # SunOS /usr/etc/install
2688 # IRIX /sbin/install
2689 # AIX /bin/install
2690 # AmigaOS /C/install, which installs bootblocks on floppy discs
2691 # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
2692 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
2693 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
2694 # ./install, which can be erroneously created by make from ./install.sh.
2695 echo "$as_me:2695: checking for a BSD compatible install" >&5
2696 echo $ECHO_N "checking for a BSD compatible install... $ECHO_C" >&6
2697 if test -z "$INSTALL"; then
2698 if test "${ac_cv_path_install+set}" = set; then
2699   echo $ECHO_N "(cached) $ECHO_C" >&6
2700 else
2701     ac_save_IFS=$IFS; IFS=$ac_path_separator
2702   for ac_dir in $PATH; do
2703     IFS=$ac_save_IFS
2704     # Account for people who put trailing slashes in PATH elements.
2705     case $ac_dir/ in
2706     / | ./ | .// | /cC/* \
2707     | /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* \
2708     | /usr/ucb/* ) ;;
2709     *)
2710       # OSF1 and SCO ODT 3.0 have their own names for install.
2711       # Don't use installbsd from OSF since it installs stuff as root
2712       # by default.
2713       for ac_prog in ginstall scoinst install; do
2714         if $as_executable_p "$ac_dir/$ac_prog"; then
2715           if test $ac_prog = install &&
2716             grep dspmsg "$ac_dir/$ac_prog" >/dev/null 2>&1; then
2717             # AIX install.  It has an incompatible calling convention.
2718             :
2719           elif test $ac_prog = install &&
2720             grep pwplus "$ac_dir/$ac_prog" >/dev/null 2>&1; then
2721             # program-specific install script used by HP pwplus--don't use.
2722             :
2723           else
2724             ac_cv_path_install="$ac_dir/$ac_prog -c"
2725             break 2
2726           fi
2727         fi
2728       done
2729       ;;
2730     esac
2731   done
2732
2733 fi
2734   if test "${ac_cv_path_install+set}" = set; then
2735     INSTALL=$ac_cv_path_install
2736   else
2737     # As a last resort, use the slow shell script.  We don't cache a
2738     # path for INSTALL within a source directory, because that will
2739     # break other packages using the cache if that directory is
2740     # removed, or if the path is relative.
2741     INSTALL=$ac_install_sh
2742   fi
2743 fi
2744 echo "$as_me:2744: result: $INSTALL" >&5
2745 echo "${ECHO_T}$INSTALL" >&6
2746
2747 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
2748 # It thinks the first close brace ends the variable substitution.
2749 test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
2750
2751 test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
2752
2753 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
2754
2755 case $INSTALL in
2756 (/*)
2757         ;;
2758 (*)
2759         cf_dir=`echo $INSTALL | sed -e 's%/[^/]*$%%'`
2760         test -z "$cf_dir" && cf_dir=.
2761         INSTALL=`cd $cf_dir && pwd`/`echo $INSTALL | sed -e 's%^.*/%%'`
2762         ;;
2763 esac
2764
2765 echo "$as_me:2765: checking if you want to install stripped executables" >&5
2766 echo $ECHO_N "checking if you want to install stripped executables... $ECHO_C" >&6
2767
2768 # Check whether --enable-stripping or --disable-stripping was given.
2769 if test "${enable_stripping+set}" = set; then
2770   enableval="$enable_stripping"
2771   test "$enableval" != no && enableval=yes
2772         if test "$enableval" != "yes" ; then
2773     with_stripping=no
2774         else
2775                 with_stripping=yes
2776         fi
2777 else
2778   enableval=yes
2779         with_stripping=yes
2780
2781 fi;
2782 echo "$as_me:2782: result: $with_stripping" >&5
2783 echo "${ECHO_T}$with_stripping" >&6
2784
2785 if test "$with_stripping" = yes
2786 then
2787         INSTALL_OPT_S="-s"
2788 else
2789         INSTALL_OPT_S=
2790 fi
2791
2792 : ${INSTALL:=install}
2793 echo "$as_me:2793: checking if install accepts -p option" >&5
2794 echo $ECHO_N "checking if install accepts -p option... $ECHO_C" >&6
2795 if test "${cf_cv_install_p+set}" = set; then
2796   echo $ECHO_N "(cached) $ECHO_C" >&6
2797 else
2798
2799         rm -rf conftest*
2800         date >conftest.in
2801         mkdir conftest.out
2802         sleep 3
2803         if $INSTALL -p conftest.in conftest.out 2>/dev/null
2804         then
2805                 if test -f conftest.out/conftest.in
2806                 then
2807                         test conftest.in -nt conftest.out/conftest.in 2>conftest.err && \
2808                         test conftest.out/conftest.in -nt conftest.in 2>conftest.err
2809                         if test -s conftest.err
2810                         then
2811                                 cf_cv_install_p=no
2812                         else
2813                                 cf_cv_install_p=yes
2814                         fi
2815                 else
2816                         cf_cv_install_p=no
2817                 fi
2818         else
2819                 cf_cv_install_p=no
2820         fi
2821         rm -rf conftest*
2822
2823 fi
2824 echo "$as_me:2824: result: $cf_cv_install_p" >&5
2825 echo "${ECHO_T}$cf_cv_install_p" >&6
2826
2827 echo "$as_me:2827: checking if install needs to be told about ownership" >&5
2828 echo $ECHO_N "checking if install needs to be told about ownership... $ECHO_C" >&6
2829 case `$ac_config_guess` in
2830 (*minix)
2831         with_install_o=yes
2832         ;;
2833 (*)
2834         with_install_o=no
2835         ;;
2836 esac
2837
2838 echo "$as_me:2838: result: $with_install_o" >&5
2839 echo "${ECHO_T}$with_install_o" >&6
2840 if test "x$with_install_o" = xyes
2841 then
2842         INSTALL_OPT_O=`id root|sed -e 's/uid=[0-9]*(/ -o /' -e 's/gid=[0-9]*(/ -g /' -e 's/ [^=[:space:]][^=[:space:]]*=.*/ /' -e 's/)//g'`
2843 else
2844         INSTALL_OPT_O=
2845 fi
2846
2847 for ac_prog in lint cppcheck splint
2848 do
2849   # Extract the first word of "$ac_prog", so it can be a program name with args.
2850 set dummy $ac_prog; ac_word=$2
2851 echo "$as_me:2851: checking for $ac_word" >&5
2852 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2853 if test "${ac_cv_prog_LINT+set}" = set; then
2854   echo $ECHO_N "(cached) $ECHO_C" >&6
2855 else
2856   if test -n "$LINT"; then
2857   ac_cv_prog_LINT="$LINT" # Let the user override the test.
2858 else
2859   ac_save_IFS=$IFS; IFS=$ac_path_separator
2860 ac_dummy="$PATH"
2861 for ac_dir in $ac_dummy; do
2862   IFS=$ac_save_IFS
2863   test -z "$ac_dir" && ac_dir=.
2864   $as_executable_p "$ac_dir/$ac_word" || continue
2865 ac_cv_prog_LINT="$ac_prog"
2866 echo "$as_me:2866: found $ac_dir/$ac_word" >&5
2867 break
2868 done
2869
2870 fi
2871 fi
2872 LINT=$ac_cv_prog_LINT
2873 if test -n "$LINT"; then
2874   echo "$as_me:2874: result: $LINT" >&5
2875 echo "${ECHO_T}$LINT" >&6
2876 else
2877   echo "$as_me:2877: result: no" >&5
2878 echo "${ECHO_T}no" >&6
2879 fi
2880
2881   test -n "$LINT" && break
2882 done
2883
2884 case "x$LINT" in
2885 (xcppcheck|x*/cppcheck)
2886         test -z "$LINT_OPTS" && LINT_OPTS="--enable=all"
2887         ;;
2888 esac
2889
2890 echo "$as_me:2890: checking if filesystem supports mixed-case filenames" >&5
2891 echo $ECHO_N "checking if filesystem supports mixed-case filenames... $ECHO_C" >&6
2892 if test "${cf_cv_mixedcase+set}" = set; then
2893   echo $ECHO_N "(cached) $ECHO_C" >&6
2894 else
2895
2896 if test "$cross_compiling" = yes ; then
2897         case $target_alias in
2898         (*-os2-emx*|*-msdosdjgpp*|*-cygwin*|*-msys*|*-mingw*|*-uwin*|darwin*)
2899                 cf_cv_mixedcase=no
2900                 ;;
2901         (*)
2902                 cf_cv_mixedcase=yes
2903                 ;;
2904         esac
2905 else
2906         rm -f conftest CONFTEST
2907         echo test >conftest
2908         if test -f CONFTEST ; then
2909                 cf_cv_mixedcase=no
2910         else
2911                 cf_cv_mixedcase=yes
2912         fi
2913         rm -f conftest CONFTEST
2914 fi
2915
2916 fi
2917 echo "$as_me:2917: result: $cf_cv_mixedcase" >&5
2918 echo "${ECHO_T}$cf_cv_mixedcase" >&6
2919 test "$cf_cv_mixedcase" = yes &&
2920 cat >>confdefs.h <<\EOF
2921 #define MIXEDCASE_FILENAMES 1
2922 EOF
2923
2924 for ac_prog in exctags ctags
2925 do
2926   # Extract the first word of "$ac_prog", so it can be a program name with args.
2927 set dummy $ac_prog; ac_word=$2
2928 echo "$as_me:2928: checking for $ac_word" >&5
2929 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2930 if test "${ac_cv_prog_CTAGS+set}" = set; then
2931   echo $ECHO_N "(cached) $ECHO_C" >&6
2932 else
2933   if test -n "$CTAGS"; then
2934   ac_cv_prog_CTAGS="$CTAGS" # Let the user override the test.
2935 else
2936   ac_save_IFS=$IFS; IFS=$ac_path_separator
2937 ac_dummy="$PATH"
2938 for ac_dir in $ac_dummy; do
2939   IFS=$ac_save_IFS
2940   test -z "$ac_dir" && ac_dir=.
2941   $as_executable_p "$ac_dir/$ac_word" || continue
2942 ac_cv_prog_CTAGS="$ac_prog"
2943 echo "$as_me:2943: found $ac_dir/$ac_word" >&5
2944 break
2945 done
2946
2947 fi
2948 fi
2949 CTAGS=$ac_cv_prog_CTAGS
2950 if test -n "$CTAGS"; then
2951   echo "$as_me:2951: result: $CTAGS" >&5
2952 echo "${ECHO_T}$CTAGS" >&6
2953 else
2954   echo "$as_me:2954: result: no" >&5
2955 echo "${ECHO_T}no" >&6
2956 fi
2957
2958   test -n "$CTAGS" && break
2959 done
2960
2961 for ac_prog in exetags etags
2962 do
2963   # Extract the first word of "$ac_prog", so it can be a program name with args.
2964 set dummy $ac_prog; ac_word=$2
2965 echo "$as_me:2965: checking for $ac_word" >&5
2966 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2967 if test "${ac_cv_prog_ETAGS+set}" = set; then
2968   echo $ECHO_N "(cached) $ECHO_C" >&6
2969 else
2970   if test -n "$ETAGS"; then
2971   ac_cv_prog_ETAGS="$ETAGS" # Let the user override the test.
2972 else
2973   ac_save_IFS=$IFS; IFS=$ac_path_separator
2974 ac_dummy="$PATH"
2975 for ac_dir in $ac_dummy; do
2976   IFS=$ac_save_IFS
2977   test -z "$ac_dir" && ac_dir=.
2978   $as_executable_p "$ac_dir/$ac_word" || continue
2979 ac_cv_prog_ETAGS="$ac_prog"
2980 echo "$as_me:2980: found $ac_dir/$ac_word" >&5
2981 break
2982 done
2983
2984 fi
2985 fi
2986 ETAGS=$ac_cv_prog_ETAGS
2987 if test -n "$ETAGS"; then
2988   echo "$as_me:2988: result: $ETAGS" >&5
2989 echo "${ECHO_T}$ETAGS" >&6
2990 else
2991   echo "$as_me:2991: result: no" >&5
2992 echo "${ECHO_T}no" >&6
2993 fi
2994
2995   test -n "$ETAGS" && break
2996 done
2997
2998 # Extract the first word of "${CTAGS:-ctags}", so it can be a program name with args.
2999 set dummy ${CTAGS:-ctags}; ac_word=$2
3000 echo "$as_me:3000: checking for $ac_word" >&5
3001 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3002 if test "${ac_cv_prog_MAKE_LOWER_TAGS+set}" = set; then
3003   echo $ECHO_N "(cached) $ECHO_C" >&6
3004 else
3005   if test -n "$MAKE_LOWER_TAGS"; then
3006   ac_cv_prog_MAKE_LOWER_TAGS="$MAKE_LOWER_TAGS" # Let the user override the test.
3007 else
3008   ac_save_IFS=$IFS; IFS=$ac_path_separator
3009 ac_dummy="$PATH"
3010 for ac_dir in $ac_dummy; do
3011   IFS=$ac_save_IFS
3012   test -z "$ac_dir" && ac_dir=.
3013   $as_executable_p "$ac_dir/$ac_word" || continue
3014 ac_cv_prog_MAKE_LOWER_TAGS="yes"
3015 echo "$as_me:3015: found $ac_dir/$ac_word" >&5
3016 break
3017 done
3018
3019   test -z "$ac_cv_prog_MAKE_LOWER_TAGS" && ac_cv_prog_MAKE_LOWER_TAGS="no"
3020 fi
3021 fi
3022 MAKE_LOWER_TAGS=$ac_cv_prog_MAKE_LOWER_TAGS
3023 if test -n "$MAKE_LOWER_TAGS"; then
3024   echo "$as_me:3024: result: $MAKE_LOWER_TAGS" >&5
3025 echo "${ECHO_T}$MAKE_LOWER_TAGS" >&6
3026 else
3027   echo "$as_me:3027: result: no" >&5
3028 echo "${ECHO_T}no" >&6
3029 fi
3030
3031 if test "$cf_cv_mixedcase" = yes ; then
3032         # Extract the first word of "${ETAGS:-etags}", so it can be a program name with args.
3033 set dummy ${ETAGS:-etags}; ac_word=$2
3034 echo "$as_me:3034: checking for $ac_word" >&5
3035 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3036 if test "${ac_cv_prog_MAKE_UPPER_TAGS+set}" = set; then
3037   echo $ECHO_N "(cached) $ECHO_C" >&6
3038 else
3039   if test -n "$MAKE_UPPER_TAGS"; then
3040   ac_cv_prog_MAKE_UPPER_TAGS="$MAKE_UPPER_TAGS" # Let the user override the test.
3041 else
3042   ac_save_IFS=$IFS; IFS=$ac_path_separator
3043 ac_dummy="$PATH"
3044 for ac_dir in $ac_dummy; do
3045   IFS=$ac_save_IFS
3046   test -z "$ac_dir" && ac_dir=.
3047   $as_executable_p "$ac_dir/$ac_word" || continue
3048 ac_cv_prog_MAKE_UPPER_TAGS="yes"
3049 echo "$as_me:3049: found $ac_dir/$ac_word" >&5
3050 break
3051 done
3052
3053   test -z "$ac_cv_prog_MAKE_UPPER_TAGS" && ac_cv_prog_MAKE_UPPER_TAGS="no"
3054 fi
3055 fi
3056 MAKE_UPPER_TAGS=$ac_cv_prog_MAKE_UPPER_TAGS
3057 if test -n "$MAKE_UPPER_TAGS"; then
3058   echo "$as_me:3058: result: $MAKE_UPPER_TAGS" >&5
3059 echo "${ECHO_T}$MAKE_UPPER_TAGS" >&6
3060 else
3061   echo "$as_me:3061: result: no" >&5
3062 echo "${ECHO_T}no" >&6
3063 fi
3064
3065 else
3066         MAKE_UPPER_TAGS=no
3067 fi
3068
3069 if test "$MAKE_UPPER_TAGS" = yes ; then
3070         MAKE_UPPER_TAGS=
3071 else
3072         MAKE_UPPER_TAGS="#"
3073 fi
3074
3075 if test "$MAKE_LOWER_TAGS" = yes ; then
3076         MAKE_LOWER_TAGS=
3077 else
3078         MAKE_LOWER_TAGS="#"
3079 fi
3080
3081 echo "$as_me:3081: checking if -lm needed for math functions" >&5
3082 echo $ECHO_N "checking if -lm needed for math functions... $ECHO_C" >&6
3083 if test "${cf_cv_need_libm+set}" = set; then
3084   echo $ECHO_N "(cached) $ECHO_C" >&6
3085 else
3086
3087         cat >conftest.$ac_ext <<_ACEOF
3088 #line 3088 "configure"
3089 #include "confdefs.h"
3090
3091         #include <stdio.h>
3092         #include <stdlib.h>
3093         #include <math.h>
3094
3095 int
3096 main (void)
3097 {
3098 double x = rand(); printf("result = %g\n", pow(sin(x),x))
3099   ;
3100   return 0;
3101 }
3102 _ACEOF
3103 rm -f conftest.$ac_objext conftest$ac_exeext
3104 if { (eval echo "$as_me:3104: \"$ac_link\"") >&5
3105   (eval $ac_link) 2>&5
3106   ac_status=$?
3107   echo "$as_me:3107: \$? = $ac_status" >&5
3108   (exit $ac_status); } &&
3109          { ac_try='test -s conftest$ac_exeext'
3110   { (eval echo "$as_me:3110: \"$ac_try\"") >&5
3111   (eval $ac_try) 2>&5
3112   ac_status=$?
3113   echo "$as_me:3113: \$? = $ac_status" >&5
3114   (exit $ac_status); }; }; then
3115   cf_cv_need_libm=no
3116 else
3117   echo "$as_me: failed program was:" >&5
3118 cat conftest.$ac_ext >&5
3119 cf_cv_need_libm=yes
3120 fi
3121 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
3122 fi
3123 echo "$as_me:3123: result: $cf_cv_need_libm" >&5
3124 echo "${ECHO_T}$cf_cv_need_libm" >&6
3125 if test "$cf_cv_need_libm" = yes
3126 then
3127 MATH_LIB=-lm
3128 fi
3129
3130 top_builddir=`pwd`
3131
3132 CC_G_OPT="-g"
3133 CC_SHARED_OPTS=unknown
3134 CPPFLAGS="$CPPFLAGS"
3135 DFT_DEP_SUFFIX=""
3136 DFT_OBJ_SUBDIR=`pwd|sed -e's:.*/::'`
3137 DFT_UPR_MODEL="NORMAL"
3138 LD="ld"
3139 LDFLAGS_SHARED=""
3140 LDFLAGS_STATIC=""
3141 LD_MODEL=""
3142 LD_SHARED_OPTS=""
3143 LIBTOOL=""
3144 LIBTOOL_OPTS=""
3145 LIB_CLEAN=""
3146 LIB_COMPILE=""
3147 LIB_LINK='${CC}'
3148 LINK_TESTS=""
3149 LOCAL_LDFLAGS=""
3150 PACKAGE="ncurses-examples"
3151 PTHREAD="-lm"
3152 TEST_ARGS=""
3153 TEST_DEPS=""
3154 TEST_LIBS=""
3155 TINFO_LDFLAGS=''
3156 TINFO_LIBS='$(LIBS_CURSES)'
3157 cf_cv_abi_version=""
3158 cf_cv_rel_version=""
3159 includesubdir=""
3160
3161 cf_cv_screen=curses
3162 cf_cv_libtype=
3163
3164 if ( test "$GCC" = yes || test "$GXX" = yes )
3165 then
3166 cat > conftest.i <<EOF
3167 #ifndef GCC_PRINTF
3168 #define GCC_PRINTF 0
3169 #endif
3170 #ifndef GCC_SCANF
3171 #define GCC_SCANF 0
3172 #endif
3173 #ifndef GCC_NORETURN
3174 #define GCC_NORETURN /* nothing */
3175 #endif
3176 #ifndef GCC_UNUSED
3177 #define GCC_UNUSED /* nothing */
3178 #endif
3179 EOF
3180 if test "$GCC" = yes
3181 then
3182         { echo "$as_me:3182: checking for $CC __attribute__ directives..." >&5
3183 echo "$as_me: checking for $CC __attribute__ directives..." >&6;}
3184 cat > conftest.$ac_ext <<EOF
3185 #line 3185 "${as_me:-configure}"
3186 #include "confdefs.h"
3187 #include "conftest.h"
3188 #include "conftest.i"
3189 #if     GCC_PRINTF
3190 #define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
3191 #else
3192 #define GCC_PRINTFLIKE(fmt,var) /*nothing*/
3193 #endif
3194 #if     GCC_SCANF
3195 #define GCC_SCANFLIKE(fmt,var)  __attribute__((format(scanf,fmt,var)))
3196 #else
3197 #define GCC_SCANFLIKE(fmt,var)  /*nothing*/
3198 #endif
3199 extern void wow(char *,...) GCC_SCANFLIKE(1,2);
3200 extern void oops(char *,...) GCC_PRINTFLIKE(1,2) GCC_NORETURN;
3201 extern void foo(void) GCC_NORETURN;
3202 int main(int argc GCC_UNUSED, char *argv[] GCC_UNUSED) { (void)argc; (void)argv; return 0; }
3203 EOF
3204         cf_printf_attribute=no
3205         cf_scanf_attribute=no
3206         for cf_attribute in scanf printf unused noreturn
3207         do
3208
3209 cf_ATTRIBUTE=`echo "$cf_attribute" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
3210
3211                 cf_directive="__attribute__(($cf_attribute))"
3212                 echo "checking for $CC $cf_directive" 1>&5
3213
3214                 case $cf_attribute in
3215                 (printf)
3216                         cf_printf_attribute=yes
3217                         cat >conftest.h <<EOF
3218 #define GCC_$cf_ATTRIBUTE 1
3219 EOF
3220                         ;;
3221                 (scanf)
3222                         cf_scanf_attribute=yes
3223                         cat >conftest.h <<EOF
3224 #define GCC_$cf_ATTRIBUTE 1
3225 EOF
3226                         ;;
3227                 (*)
3228                         cat >conftest.h <<EOF
3229 #define GCC_$cf_ATTRIBUTE $cf_directive
3230 EOF
3231                         ;;
3232                 esac
3233
3234                 if { (eval echo "$as_me:3234: \"$ac_compile\"") >&5
3235   (eval $ac_compile) 2>&5
3236   ac_status=$?
3237   echo "$as_me:3237: \$? = $ac_status" >&5
3238   (exit $ac_status); }; then
3239                         test -n "$verbose" && echo "$as_me:3239: result: ... $cf_attribute" >&5
3240 echo "${ECHO_T}... $cf_attribute" >&6
3241                         cat conftest.h >>confdefs.h
3242                         case $cf_attribute in
3243                         (noreturn)
3244
3245 cat >>confdefs.h <<EOF
3246 #define GCC_NORETURN $cf_directive
3247 EOF
3248
3249                                 ;;
3250                         (printf)
3251                                 cf_value='/* nothing */'
3252                                 if test "$cf_printf_attribute" != no ; then
3253                                         cf_value='__attribute__((format(printf,fmt,var)))'
3254
3255 cat >>confdefs.h <<\EOF
3256 #define GCC_PRINTF 1
3257 EOF
3258
3259                                 fi
3260
3261 cat >>confdefs.h <<EOF
3262 #define GCC_PRINTFLIKE(fmt,var) $cf_value
3263 EOF
3264
3265                                 ;;
3266                         (scanf)
3267                                 cf_value='/* nothing */'
3268                                 if test "$cf_scanf_attribute" != no ; then
3269                                         cf_value='__attribute__((format(scanf,fmt,var)))'
3270
3271 cat >>confdefs.h <<\EOF
3272 #define GCC_SCANF 1
3273 EOF
3274
3275                                 fi
3276
3277 cat >>confdefs.h <<EOF
3278 #define GCC_SCANFLIKE(fmt,var) $cf_value
3279 EOF
3280
3281                                 ;;
3282                         (unused)
3283
3284 cat >>confdefs.h <<EOF
3285 #define GCC_UNUSED $cf_directive
3286 EOF
3287
3288                                 ;;
3289                         esac
3290                 fi
3291         done
3292 else
3293         fgrep define conftest.i >>confdefs.h
3294 fi
3295 rm -rf conftest*
3296 fi
3297
3298 echo "$as_me:3298: checking if you want to work around bogus compiler/loader warnings" >&5
3299 echo $ECHO_N "checking if you want to work around bogus compiler/loader warnings... $ECHO_C" >&6
3300
3301 # Check whether --enable-string-hacks or --disable-string-hacks was given.
3302 if test "${enable_string_hacks+set}" = set; then
3303   enableval="$enable_string_hacks"
3304   with_string_hacks=$enableval
3305 else
3306   with_string_hacks=no
3307 fi;
3308 echo "$as_me:3308: result: $with_string_hacks" >&5
3309 echo "${ECHO_T}$with_string_hacks" >&6
3310
3311 if test "x$with_string_hacks" = "xyes"; then
3312
3313 cat >>confdefs.h <<\EOF
3314 #define USE_STRING_HACKS 1
3315 EOF
3316
3317         { echo "$as_me:3317: WARNING: enabling string-hacks to work around bogus compiler/loader warnings" >&5
3318 echo "$as_me: WARNING: enabling string-hacks to work around bogus compiler/loader warnings" >&2;}
3319         echo "$as_me:3319: checking for strlcat" >&5
3320 echo $ECHO_N "checking for strlcat... $ECHO_C" >&6
3321 if test "${ac_cv_func_strlcat+set}" = set; then
3322   echo $ECHO_N "(cached) $ECHO_C" >&6
3323 else
3324   cat >conftest.$ac_ext <<_ACEOF
3325 #line 3325 "configure"
3326 #include "confdefs.h"
3327 #define strlcat autoconf_temporary
3328 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
3329 #undef strlcat
3330
3331 #ifdef __cplusplus
3332 extern "C"
3333 #endif
3334
3335 /* We use char because int might match the return type of a gcc2
3336    builtin and then its argument prototype would still apply.  */
3337 char strlcat (void);
3338
3339 int
3340 main (void)
3341 {
3342
3343 /* The GNU C library defines stubs for functions which it implements
3344     to always fail with ENOSYS.  Some functions are actually named
3345     something starting with __ and the normal name is an alias.  */
3346 #if defined (__stub_strlcat) || defined (__stub___strlcat)
3347 #error found stub for strlcat
3348 #endif
3349
3350         return strlcat ();
3351   ;
3352   return 0;
3353 }
3354 _ACEOF
3355 rm -f conftest.$ac_objext conftest$ac_exeext
3356 if { (eval echo "$as_me:3356: \"$ac_link\"") >&5
3357   (eval $ac_link) 2>&5
3358   ac_status=$?
3359   echo "$as_me:3359: \$? = $ac_status" >&5
3360   (exit $ac_status); } &&
3361          { ac_try='test -s conftest$ac_exeext'
3362   { (eval echo "$as_me:3362: \"$ac_try\"") >&5
3363   (eval $ac_try) 2>&5
3364   ac_status=$?
3365   echo "$as_me:3365: \$? = $ac_status" >&5
3366   (exit $ac_status); }; }; then
3367   ac_cv_func_strlcat=yes
3368 else
3369   echo "$as_me: failed program was:" >&5
3370 cat conftest.$ac_ext >&5
3371 ac_cv_func_strlcat=no
3372 fi
3373 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
3374 fi
3375 echo "$as_me:3375: result: $ac_cv_func_strlcat" >&5
3376 echo "${ECHO_T}$ac_cv_func_strlcat" >&6
3377 if test $ac_cv_func_strlcat = yes; then
3378
3379 cat >>confdefs.h <<\EOF
3380 #define HAVE_STRLCAT 1
3381 EOF
3382
3383 else
3384
3385                 echo "$as_me:3385: checking for strlcat in -lbsd" >&5
3386 echo $ECHO_N "checking for strlcat in -lbsd... $ECHO_C" >&6
3387 if test "${ac_cv_lib_bsd_strlcat+set}" = set; then
3388   echo $ECHO_N "(cached) $ECHO_C" >&6
3389 else
3390   ac_check_lib_save_LIBS=$LIBS
3391 LIBS="-lbsd  $LIBS"
3392 cat >conftest.$ac_ext <<_ACEOF
3393 #line 3393 "configure"
3394 #include "confdefs.h"
3395
3396 /* Override any gcc2 internal prototype to avoid an error.  */
3397 #ifdef __cplusplus
3398 extern "C"
3399 #endif
3400 /* We use char because int might match the return type of a gcc2
3401    builtin and then its argument prototype would still apply.  */
3402 char strlcat ();
3403 int
3404 main (void)
3405 {
3406 strlcat ();
3407   ;
3408   return 0;
3409 }
3410 _ACEOF
3411 rm -f conftest.$ac_objext conftest$ac_exeext
3412 if { (eval echo "$as_me:3412: \"$ac_link\"") >&5
3413   (eval $ac_link) 2>&5
3414   ac_status=$?
3415   echo "$as_me:3415: \$? = $ac_status" >&5
3416   (exit $ac_status); } &&
3417          { ac_try='test -s conftest$ac_exeext'
3418   { (eval echo "$as_me:3418: \"$ac_try\"") >&5
3419   (eval $ac_try) 2>&5
3420   ac_status=$?
3421   echo "$as_me:3421: \$? = $ac_status" >&5
3422   (exit $ac_status); }; }; then
3423   ac_cv_lib_bsd_strlcat=yes
3424 else
3425   echo "$as_me: failed program was:" >&5
3426 cat conftest.$ac_ext >&5
3427 ac_cv_lib_bsd_strlcat=no
3428 fi
3429 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
3430 LIBS=$ac_check_lib_save_LIBS
3431 fi
3432 echo "$as_me:3432: result: $ac_cv_lib_bsd_strlcat" >&5
3433 echo "${ECHO_T}$ac_cv_lib_bsd_strlcat" >&6
3434 if test $ac_cv_lib_bsd_strlcat = yes; then
3435
3436 cf_add_libs="$LIBS"
3437 # reverse order
3438 cf_add_0lib=
3439 for cf_add_1lib in -lbsd; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
3440 # filter duplicates
3441 for cf_add_1lib in $cf_add_0lib; do
3442         for cf_add_2lib in $cf_add_libs; do
3443                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
3444                         cf_add_1lib=
3445                         break
3446                 fi
3447         done
3448         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
3449 done
3450 LIBS="$cf_add_libs"
3451
3452 for ac_header in bsd/string.h
3453 do
3454 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
3455 echo "$as_me:3455: checking for $ac_header" >&5
3456 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
3457 if eval "test \"\${$as_ac_Header+set}\" = set"; then
3458   echo $ECHO_N "(cached) $ECHO_C" >&6
3459 else
3460   cat >conftest.$ac_ext <<_ACEOF
3461 #line 3461 "configure"
3462 #include "confdefs.h"
3463 #include <$ac_header>
3464 _ACEOF
3465 if { (eval echo "$as_me:3465: \"$ac_cpp conftest.$ac_ext\"") >&5
3466   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
3467   ac_status=$?
3468   egrep -v '^ *\+' conftest.er1 >conftest.err
3469   rm -f conftest.er1
3470   cat conftest.err >&5
3471   echo "$as_me:3471: \$? = $ac_status" >&5
3472   (exit $ac_status); } >/dev/null; then
3473   if test -s conftest.err; then
3474     ac_cpp_err=$ac_c_preproc_warn_flag
3475   else
3476     ac_cpp_err=
3477   fi
3478 else
3479   ac_cpp_err=yes
3480 fi
3481 if test -z "$ac_cpp_err"; then
3482   eval "$as_ac_Header=yes"
3483 else
3484   echo "$as_me: failed program was:" >&5
3485   cat conftest.$ac_ext >&5
3486   eval "$as_ac_Header=no"
3487 fi
3488 rm -f conftest.err conftest.$ac_ext
3489 fi
3490 echo "$as_me:3490: result: `eval echo '${'$as_ac_Header'}'`" >&5
3491 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
3492 if test `eval echo '${'$as_ac_Header'}'` = yes; then
3493   cat >>confdefs.h <<EOF
3494 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
3495 EOF
3496
3497 fi
3498 done
3499
3500 cat >>confdefs.h <<\EOF
3501 #define HAVE_STRLCAT 1
3502 EOF
3503
3504 fi
3505
3506 fi
3507
3508 for ac_func in strlcpy snprintf
3509 do
3510 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
3511 echo "$as_me:3511: checking for $ac_func" >&5
3512 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
3513 if eval "test \"\${$as_ac_var+set}\" = set"; then
3514   echo $ECHO_N "(cached) $ECHO_C" >&6
3515 else
3516   cat >conftest.$ac_ext <<_ACEOF
3517 #line 3517 "configure"
3518 #include "confdefs.h"
3519 #define $ac_func autoconf_temporary
3520 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
3521 #undef $ac_func
3522
3523 #ifdef __cplusplus
3524 extern "C"
3525 #endif
3526
3527 /* We use char because int might match the return type of a gcc2
3528    builtin and then its argument prototype would still apply.  */
3529 char $ac_func (void);
3530
3531 int
3532 main (void)
3533 {
3534
3535 /* The GNU C library defines stubs for functions which it implements
3536     to always fail with ENOSYS.  Some functions are actually named
3537     something starting with __ and the normal name is an alias.  */
3538 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
3539 #error found stub for $ac_func
3540 #endif
3541
3542         return $ac_func ();
3543   ;
3544   return 0;
3545 }
3546 _ACEOF
3547 rm -f conftest.$ac_objext conftest$ac_exeext
3548 if { (eval echo "$as_me:3548: \"$ac_link\"") >&5
3549   (eval $ac_link) 2>&5
3550   ac_status=$?
3551   echo "$as_me:3551: \$? = $ac_status" >&5
3552   (exit $ac_status); } &&
3553          { ac_try='test -s conftest$ac_exeext'
3554   { (eval echo "$as_me:3554: \"$ac_try\"") >&5
3555   (eval $ac_try) 2>&5
3556   ac_status=$?
3557   echo "$as_me:3557: \$? = $ac_status" >&5
3558   (exit $ac_status); }; }; then
3559   eval "$as_ac_var=yes"
3560 else
3561   echo "$as_me: failed program was:" >&5
3562 cat conftest.$ac_ext >&5
3563 eval "$as_ac_var=no"
3564 fi
3565 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
3566 fi
3567 echo "$as_me:3567: result: `eval echo '${'$as_ac_var'}'`" >&5
3568 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
3569 if test `eval echo '${'$as_ac_var'}'` = yes; then
3570   cat >>confdefs.h <<EOF
3571 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
3572 EOF
3573
3574 fi
3575 done
3576
3577 fi
3578
3579 echo "$as_me:3579: checking if the POSIX test-macros are already defined" >&5
3580 echo $ECHO_N "checking if the POSIX test-macros are already defined... $ECHO_C" >&6
3581 if test "${cf_cv_posix_visible+set}" = set; then
3582   echo $ECHO_N "(cached) $ECHO_C" >&6
3583 else
3584
3585 cat >conftest.$ac_ext <<_ACEOF
3586 #line 3586 "configure"
3587 #include "confdefs.h"
3588 #include <stdio.h>
3589 int
3590 main (void)
3591 {
3592
3593 #if defined(__POSIX_VISIBLE) && ((__POSIX_VISIBLE - 0L) > 0) \
3594         && defined(__XSI_VISIBLE) && ((__XSI_VISIBLE - 0L) > 0) \
3595         && defined(__BSD_VISIBLE) && ((__BSD_VISIBLE - 0L) > 0) \
3596         && defined(__ISO_C_VISIBLE) && ((__ISO_C_VISIBLE - 0L) > 0)
3597 #error conflicting symbols found
3598 #endif
3599
3600   ;
3601   return 0;
3602 }
3603 _ACEOF
3604 rm -f conftest.$ac_objext
3605 if { (eval echo "$as_me:3605: \"$ac_compile\"") >&5
3606   (eval $ac_compile) 2>&5
3607   ac_status=$?
3608   echo "$as_me:3608: \$? = $ac_status" >&5
3609   (exit $ac_status); } &&
3610          { ac_try='test -s conftest.$ac_objext'
3611   { (eval echo "$as_me:3611: \"$ac_try\"") >&5
3612   (eval $ac_try) 2>&5
3613   ac_status=$?
3614   echo "$as_me:3614: \$? = $ac_status" >&5
3615   (exit $ac_status); }; }; then
3616   cf_cv_posix_visible=no
3617 else
3618   echo "$as_me: failed program was:" >&5
3619 cat conftest.$ac_ext >&5
3620 cf_cv_posix_visible=yes
3621 fi
3622 rm -f conftest.$ac_objext conftest.$ac_ext
3623
3624 fi
3625 echo "$as_me:3625: result: $cf_cv_posix_visible" >&5
3626 echo "${ECHO_T}$cf_cv_posix_visible" >&6
3627
3628 if test "$cf_cv_posix_visible" = no; then
3629
3630 cf_XOPEN_SOURCE=600
3631 cf_POSIX_C_SOURCE=199506L
3632 cf_xopen_source=
3633
3634 case $host_os in
3635 (aix[4-7]*)
3636         cf_xopen_source="-D_ALL_SOURCE"
3637         ;;
3638 (msys)
3639         cf_XOPEN_SOURCE=600
3640         ;;
3641 (darwin[0-8].*)
3642         cf_xopen_source="-D_APPLE_C_SOURCE"
3643         ;;
3644 (darwin*)
3645         cf_xopen_source="-D_DARWIN_C_SOURCE"
3646         cf_XOPEN_SOURCE=
3647         ;;
3648 (freebsd*|dragonfly*|midnightbsd*)
3649         # 5.x headers associate
3650         #       _XOPEN_SOURCE=600 with _POSIX_C_SOURCE=200112L
3651         #       _XOPEN_SOURCE=500 with _POSIX_C_SOURCE=199506L
3652         cf_POSIX_C_SOURCE=200112L
3653         cf_XOPEN_SOURCE=600
3654         cf_xopen_source="-D_BSD_TYPES -D__BSD_VISIBLE -D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
3655         ;;
3656 (hpux11*)
3657         cf_xopen_source="-D_HPUX_SOURCE -D_XOPEN_SOURCE=500"
3658         ;;
3659 (hpux*)
3660         cf_xopen_source="-D_HPUX_SOURCE"
3661         ;;
3662 (irix[56].*)
3663         cf_xopen_source="-D_SGI_SOURCE"
3664         cf_XOPEN_SOURCE=
3665         ;;
3666 (linux*|uclinux*|gnu*|mint*|k*bsd*-gnu|cygwin)
3667
3668 cf_gnu_xopen_source=$cf_XOPEN_SOURCE
3669
3670 echo "$as_me:3670: checking if this is the GNU C library" >&5
3671 echo $ECHO_N "checking if this is the GNU C library... $ECHO_C" >&6
3672 if test "${cf_cv_gnu_library+set}" = set; then
3673   echo $ECHO_N "(cached) $ECHO_C" >&6
3674 else
3675
3676 cat >conftest.$ac_ext <<_ACEOF
3677 #line 3677 "configure"
3678 #include "confdefs.h"
3679 #include <sys/types.h>
3680 int
3681 main (void)
3682 {
3683
3684         #if __GLIBC__ > 0 && __GLIBC_MINOR__ >= 0
3685                 return 0;
3686         #elif __NEWLIB__ > 0 && __NEWLIB_MINOR__ >= 0
3687                 return 0;
3688         #else
3689         #       error not GNU C library
3690         #endif
3691   ;
3692   return 0;
3693 }
3694 _ACEOF
3695 rm -f conftest.$ac_objext
3696 if { (eval echo "$as_me:3696: \"$ac_compile\"") >&5
3697   (eval $ac_compile) 2>&5
3698   ac_status=$?
3699   echo "$as_me:3699: \$? = $ac_status" >&5
3700   (exit $ac_status); } &&
3701          { ac_try='test -s conftest.$ac_objext'
3702   { (eval echo "$as_me:3702: \"$ac_try\"") >&5
3703   (eval $ac_try) 2>&5
3704   ac_status=$?
3705   echo "$as_me:3705: \$? = $ac_status" >&5
3706   (exit $ac_status); }; }; then
3707   cf_cv_gnu_library=yes
3708 else
3709   echo "$as_me: failed program was:" >&5
3710 cat conftest.$ac_ext >&5
3711 cf_cv_gnu_library=no
3712 fi
3713 rm -f conftest.$ac_objext conftest.$ac_ext
3714
3715 fi
3716 echo "$as_me:3716: result: $cf_cv_gnu_library" >&5
3717 echo "${ECHO_T}$cf_cv_gnu_library" >&6
3718
3719 if test x$cf_cv_gnu_library = xyes; then
3720
3721         # With glibc 2.19 (13 years after this check was begun), _DEFAULT_SOURCE
3722         # was changed to help a little.  newlib incorporated the change about 4
3723         # years later.
3724         echo "$as_me:3724: checking if _DEFAULT_SOURCE can be used as a basis" >&5
3725 echo $ECHO_N "checking if _DEFAULT_SOURCE can be used as a basis... $ECHO_C" >&6
3726 if test "${cf_cv_gnu_library_219+set}" = set; then
3727   echo $ECHO_N "(cached) $ECHO_C" >&6
3728 else
3729
3730                 cf_save="$CPPFLAGS"
3731
3732         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
3733         CPPFLAGS="${CPPFLAGS}-D_DEFAULT_SOURCE"
3734
3735                 cat >conftest.$ac_ext <<_ACEOF
3736 #line 3736 "configure"
3737 #include "confdefs.h"
3738 #include <sys/types.h>
3739 int
3740 main (void)
3741 {
3742
3743                         #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 19) || (__GLIBC__ > 2)
3744                                 return 0;
3745                         #elif (__NEWLIB__ == 2 && __NEWLIB_MINOR__ >= 4) || (__GLIBC__ > 3)
3746                                 return 0;
3747                         #else
3748                         #       error GNU C library __GLIBC__.__GLIBC_MINOR__ is too old
3749                         #endif
3750   ;
3751   return 0;
3752 }
3753 _ACEOF
3754 rm -f conftest.$ac_objext
3755 if { (eval echo "$as_me:3755: \"$ac_compile\"") >&5
3756   (eval $ac_compile) 2>&5
3757   ac_status=$?
3758   echo "$as_me:3758: \$? = $ac_status" >&5
3759   (exit $ac_status); } &&
3760          { ac_try='test -s conftest.$ac_objext'
3761   { (eval echo "$as_me:3761: \"$ac_try\"") >&5
3762   (eval $ac_try) 2>&5
3763   ac_status=$?
3764   echo "$as_me:3764: \$? = $ac_status" >&5
3765   (exit $ac_status); }; }; then
3766   cf_cv_gnu_library_219=yes
3767 else
3768   echo "$as_me: failed program was:" >&5
3769 cat conftest.$ac_ext >&5
3770 cf_cv_gnu_library_219=no
3771 fi
3772 rm -f conftest.$ac_objext conftest.$ac_ext
3773                 CPPFLAGS="$cf_save"
3774
3775 fi
3776 echo "$as_me:3776: result: $cf_cv_gnu_library_219" >&5
3777 echo "${ECHO_T}$cf_cv_gnu_library_219" >&6
3778
3779         if test "x$cf_cv_gnu_library_219" = xyes; then
3780                 cf_save="$CPPFLAGS"
3781                 echo "$as_me:3781: checking if _XOPEN_SOURCE=$cf_gnu_xopen_source works with _DEFAULT_SOURCE" >&5
3782 echo $ECHO_N "checking if _XOPEN_SOURCE=$cf_gnu_xopen_source works with _DEFAULT_SOURCE... $ECHO_C" >&6
3783 if test "${cf_cv_gnu_dftsrc_219+set}" = set; then
3784   echo $ECHO_N "(cached) $ECHO_C" >&6
3785 else
3786
3787 cf_fix_cppflags=no
3788 cf_new_cflags=
3789 cf_new_cppflags=
3790 cf_new_extra_cppflags=
3791
3792 for cf_add_cflags in -D_DEFAULT_SOURCE -D_XOPEN_SOURCE=$cf_gnu_xopen_source
3793 do
3794 case $cf_fix_cppflags in
3795 (no)
3796         case $cf_add_cflags in
3797         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
3798                 case $cf_add_cflags in
3799                 (-D*)
3800                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
3801
3802                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
3803                                 && test -z "${cf_tst_cflags}" \
3804                                 && cf_fix_cppflags=yes
3805
3806                         if test $cf_fix_cppflags = yes ; then
3807
3808         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
3809         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
3810
3811                                 continue
3812                         elif test "${cf_tst_cflags}" = "\"'" ; then
3813
3814         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
3815         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
3816
3817                                 continue
3818                         fi
3819                         ;;
3820                 esac
3821                 case "$CPPFLAGS" in
3822                 (*$cf_add_cflags)
3823                         ;;
3824                 (*)
3825                         case $cf_add_cflags in
3826                         (-D*)
3827                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
3828
3829 CPPFLAGS=`echo "$CPPFLAGS" | \
3830         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
3831                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
3832
3833                                 ;;
3834                         esac
3835
3836         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
3837         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
3838
3839                         ;;
3840                 esac
3841                 ;;
3842         (*)
3843
3844         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
3845         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
3846
3847                 ;;
3848         esac
3849         ;;
3850 (yes)
3851
3852         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
3853         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
3854
3855         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
3856
3857         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
3858                 && test -z "${cf_tst_cflags}" \
3859                 && cf_fix_cppflags=no
3860         ;;
3861 esac
3862 done
3863
3864 if test -n "$cf_new_cflags" ; then
3865
3866         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
3867         CFLAGS="${CFLAGS}$cf_new_cflags"
3868
3869 fi
3870
3871 if test -n "$cf_new_cppflags" ; then
3872
3873         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
3874         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
3875
3876 fi
3877
3878 if test -n "$cf_new_extra_cppflags" ; then
3879
3880         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
3881         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
3882
3883 fi
3884
3885                         cat >conftest.$ac_ext <<_ACEOF
3886 #line 3886 "configure"
3887 #include "confdefs.h"
3888
3889                                 #include <limits.h>
3890                                 #include <sys/types.h>
3891
3892 int
3893 main (void)
3894 {
3895
3896                                 #if (_XOPEN_SOURCE >= $cf_gnu_xopen_source) && (MB_LEN_MAX > 1)
3897                                         return 0;
3898                                 #else
3899                                 #       error GNU C library is too old
3900                                 #endif
3901   ;
3902   return 0;
3903 }
3904 _ACEOF
3905 rm -f conftest.$ac_objext
3906 if { (eval echo "$as_me:3906: \"$ac_compile\"") >&5
3907   (eval $ac_compile) 2>&5
3908   ac_status=$?
3909   echo "$as_me:3909: \$? = $ac_status" >&5
3910   (exit $ac_status); } &&
3911          { ac_try='test -s conftest.$ac_objext'
3912   { (eval echo "$as_me:3912: \"$ac_try\"") >&5
3913   (eval $ac_try) 2>&5
3914   ac_status=$?
3915   echo "$as_me:3915: \$? = $ac_status" >&5
3916   (exit $ac_status); }; }; then
3917   cf_cv_gnu_dftsrc_219=yes
3918 else
3919   echo "$as_me: failed program was:" >&5
3920 cat conftest.$ac_ext >&5
3921 cf_cv_gnu_dftsrc_219=no
3922 fi
3923 rm -f conftest.$ac_objext conftest.$ac_ext
3924
3925 fi
3926 echo "$as_me:3926: result: $cf_cv_gnu_dftsrc_219" >&5
3927 echo "${ECHO_T}$cf_cv_gnu_dftsrc_219" >&6
3928                 test "x$cf_cv_gnu_dftsrc_219" = "xyes" || CPPFLAGS="$cf_save"
3929         else
3930                 cf_cv_gnu_dftsrc_219=maybe
3931         fi
3932
3933         if test "x$cf_cv_gnu_dftsrc_219" != xyes; then
3934
3935                 echo "$as_me:3935: checking if we must define _GNU_SOURCE" >&5
3936 echo $ECHO_N "checking if we must define _GNU_SOURCE... $ECHO_C" >&6
3937 if test "${cf_cv_gnu_source+set}" = set; then
3938   echo $ECHO_N "(cached) $ECHO_C" >&6
3939 else
3940
3941                 cat >conftest.$ac_ext <<_ACEOF
3942 #line 3942 "configure"
3943 #include "confdefs.h"
3944 #include <sys/types.h>
3945 int
3946 main (void)
3947 {
3948
3949                         #ifndef _XOPEN_SOURCE
3950                         #error  expected _XOPEN_SOURCE to be defined
3951                         #endif
3952   ;
3953   return 0;
3954 }
3955 _ACEOF
3956 rm -f conftest.$ac_objext
3957 if { (eval echo "$as_me:3957: \"$ac_compile\"") >&5
3958   (eval $ac_compile) 2>&5
3959   ac_status=$?
3960   echo "$as_me:3960: \$? = $ac_status" >&5
3961   (exit $ac_status); } &&
3962          { ac_try='test -s conftest.$ac_objext'
3963   { (eval echo "$as_me:3963: \"$ac_try\"") >&5
3964   (eval $ac_try) 2>&5
3965   ac_status=$?
3966   echo "$as_me:3966: \$? = $ac_status" >&5
3967   (exit $ac_status); }; }; then
3968   cf_cv_gnu_source=no
3969 else
3970   echo "$as_me: failed program was:" >&5
3971 cat conftest.$ac_ext >&5
3972 cf_save="$CPPFLAGS"
3973
3974 cf_fix_cppflags=no
3975 cf_new_cflags=
3976 cf_new_cppflags=
3977 cf_new_extra_cppflags=
3978
3979 for cf_add_cflags in -D_GNU_SOURCE
3980 do
3981 case $cf_fix_cppflags in
3982 (no)
3983         case $cf_add_cflags in
3984         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
3985                 case $cf_add_cflags in
3986                 (-D*)
3987                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
3988
3989                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
3990                                 && test -z "${cf_tst_cflags}" \
3991                                 && cf_fix_cppflags=yes
3992
3993                         if test $cf_fix_cppflags = yes ; then
3994
3995         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
3996         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
3997
3998                                 continue
3999                         elif test "${cf_tst_cflags}" = "\"'" ; then
4000
4001         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4002         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4003
4004                                 continue
4005                         fi
4006                         ;;
4007                 esac
4008                 case "$CPPFLAGS" in
4009                 (*$cf_add_cflags)
4010                         ;;
4011                 (*)
4012                         case $cf_add_cflags in
4013                         (-D*)
4014                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
4015
4016 CPPFLAGS=`echo "$CPPFLAGS" | \
4017         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
4018                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
4019
4020                                 ;;
4021                         esac
4022
4023         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
4024         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
4025
4026                         ;;
4027                 esac
4028                 ;;
4029         (*)
4030
4031         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
4032         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
4033
4034                 ;;
4035         esac
4036         ;;
4037 (yes)
4038
4039         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4040         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4041
4042         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
4043
4044         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4045                 && test -z "${cf_tst_cflags}" \
4046                 && cf_fix_cppflags=no
4047         ;;
4048 esac
4049 done
4050
4051 if test -n "$cf_new_cflags" ; then
4052
4053         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
4054         CFLAGS="${CFLAGS}$cf_new_cflags"
4055
4056 fi
4057
4058 if test -n "$cf_new_cppflags" ; then
4059
4060         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4061         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
4062
4063 fi
4064
4065 if test -n "$cf_new_extra_cppflags" ; then
4066
4067         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
4068         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
4069
4070 fi
4071
4072                          cat >conftest.$ac_ext <<_ACEOF
4073 #line 4073 "configure"
4074 #include "confdefs.h"
4075 #include <sys/types.h>
4076 int
4077 main (void)
4078 {
4079
4080                                 #ifdef _XOPEN_SOURCE
4081                                 #error  expected _XOPEN_SOURCE to be undefined
4082                                 #endif
4083   ;
4084   return 0;
4085 }
4086 _ACEOF
4087 rm -f conftest.$ac_objext
4088 if { (eval echo "$as_me:4088: \"$ac_compile\"") >&5
4089   (eval $ac_compile) 2>&5
4090   ac_status=$?
4091   echo "$as_me:4091: \$? = $ac_status" >&5
4092   (exit $ac_status); } &&
4093          { ac_try='test -s conftest.$ac_objext'
4094   { (eval echo "$as_me:4094: \"$ac_try\"") >&5
4095   (eval $ac_try) 2>&5
4096   ac_status=$?
4097   echo "$as_me:4097: \$? = $ac_status" >&5
4098   (exit $ac_status); }; }; then
4099   cf_cv_gnu_source=no
4100 else
4101   echo "$as_me: failed program was:" >&5
4102 cat conftest.$ac_ext >&5
4103 cf_cv_gnu_source=yes
4104 fi
4105 rm -f conftest.$ac_objext conftest.$ac_ext
4106                         CPPFLAGS="$cf_save"
4107
4108 fi
4109 rm -f conftest.$ac_objext conftest.$ac_ext
4110
4111 fi
4112 echo "$as_me:4112: result: $cf_cv_gnu_source" >&5
4113 echo "${ECHO_T}$cf_cv_gnu_source" >&6
4114
4115                 if test "$cf_cv_gnu_source" = yes
4116                 then
4117                 echo "$as_me:4117: checking if we should also define _DEFAULT_SOURCE" >&5
4118 echo $ECHO_N "checking if we should also define _DEFAULT_SOURCE... $ECHO_C" >&6
4119 if test "${cf_cv_default_source+set}" = set; then
4120   echo $ECHO_N "(cached) $ECHO_C" >&6
4121 else
4122
4123         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4124         CPPFLAGS="${CPPFLAGS}-D_GNU_SOURCE"
4125
4126                         cat >conftest.$ac_ext <<_ACEOF
4127 #line 4127 "configure"
4128 #include "confdefs.h"
4129 #include <sys/types.h>
4130 int
4131 main (void)
4132 {
4133
4134                                 #ifdef _DEFAULT_SOURCE
4135                                 #error  expected _DEFAULT_SOURCE to be undefined
4136                                 #endif
4137   ;
4138   return 0;
4139 }
4140 _ACEOF
4141 rm -f conftest.$ac_objext
4142 if { (eval echo "$as_me:4142: \"$ac_compile\"") >&5
4143   (eval $ac_compile) 2>&5
4144   ac_status=$?
4145   echo "$as_me:4145: \$? = $ac_status" >&5
4146   (exit $ac_status); } &&
4147          { ac_try='test -s conftest.$ac_objext'
4148   { (eval echo "$as_me:4148: \"$ac_try\"") >&5
4149   (eval $ac_try) 2>&5
4150   ac_status=$?
4151   echo "$as_me:4151: \$? = $ac_status" >&5
4152   (exit $ac_status); }; }; then
4153   cf_cv_default_source=no
4154 else
4155   echo "$as_me: failed program was:" >&5
4156 cat conftest.$ac_ext >&5
4157 cf_cv_default_source=yes
4158 fi
4159 rm -f conftest.$ac_objext conftest.$ac_ext
4160
4161 fi
4162 echo "$as_me:4162: result: $cf_cv_default_source" >&5
4163 echo "${ECHO_T}$cf_cv_default_source" >&6
4164                         if test "$cf_cv_default_source" = yes
4165                         then
4166
4167         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4168         CPPFLAGS="${CPPFLAGS}-D_DEFAULT_SOURCE"
4169
4170                         fi
4171                 fi
4172         fi
4173
4174 fi
4175
4176         ;;
4177 (minix*)
4178         cf_xopen_source="-D_NETBSD_SOURCE" # POSIX.1-2001 features are ifdef'd with this...
4179         ;;
4180 (mirbsd*)
4181         # setting _XOPEN_SOURCE or _POSIX_SOURCE breaks <sys/select.h> and other headers which use u_int / u_short types
4182         cf_XOPEN_SOURCE=
4183
4184 if test "$cf_cv_posix_visible" = no; then
4185
4186 cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE
4187
4188 cf_save_CFLAGS="$CFLAGS"
4189 cf_save_CPPFLAGS="$CPPFLAGS"
4190
4191 cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \
4192         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
4193                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
4194
4195 cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \
4196         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
4197                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
4198
4199 echo "$as_me:4199: checking if we should define _POSIX_C_SOURCE" >&5
4200 echo $ECHO_N "checking if we should define _POSIX_C_SOURCE... $ECHO_C" >&6
4201 if test "${cf_cv_posix_c_source+set}" = set; then
4202   echo $ECHO_N "(cached) $ECHO_C" >&6
4203 else
4204
4205 echo "${as_me:-configure}:4205: testing if the symbol is already defined go no further ..." 1>&5
4206
4207         cat >conftest.$ac_ext <<_ACEOF
4208 #line 4208 "configure"
4209 #include "confdefs.h"
4210 #include <sys/types.h>
4211 int
4212 main (void)
4213 {
4214
4215 #ifndef _POSIX_C_SOURCE
4216 make an error
4217 #endif
4218   ;
4219   return 0;
4220 }
4221 _ACEOF
4222 rm -f conftest.$ac_objext
4223 if { (eval echo "$as_me:4223: \"$ac_compile\"") >&5
4224   (eval $ac_compile) 2>&5
4225   ac_status=$?
4226   echo "$as_me:4226: \$? = $ac_status" >&5
4227   (exit $ac_status); } &&
4228          { ac_try='test -s conftest.$ac_objext'
4229   { (eval echo "$as_me:4229: \"$ac_try\"") >&5
4230   (eval $ac_try) 2>&5
4231   ac_status=$?
4232   echo "$as_me:4232: \$? = $ac_status" >&5
4233   (exit $ac_status); }; }; then
4234   cf_cv_posix_c_source=no
4235 else
4236   echo "$as_me: failed program was:" >&5
4237 cat conftest.$ac_ext >&5
4238 cf_want_posix_source=no
4239          case .$cf_POSIX_C_SOURCE in
4240          (.[12]??*)
4241                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
4242                 ;;
4243          (.2)
4244                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
4245                 cf_want_posix_source=yes
4246                 ;;
4247          (.*)
4248                 cf_want_posix_source=yes
4249                 ;;
4250          esac
4251          if test "$cf_want_posix_source" = yes ; then
4252                 cat >conftest.$ac_ext <<_ACEOF
4253 #line 4253 "configure"
4254 #include "confdefs.h"
4255 #include <sys/types.h>
4256 int
4257 main (void)
4258 {
4259
4260 #ifdef _POSIX_SOURCE
4261 make an error
4262 #endif
4263   ;
4264   return 0;
4265 }
4266 _ACEOF
4267 rm -f conftest.$ac_objext
4268 if { (eval echo "$as_me:4268: \"$ac_compile\"") >&5
4269   (eval $ac_compile) 2>&5
4270   ac_status=$?
4271   echo "$as_me:4271: \$? = $ac_status" >&5
4272   (exit $ac_status); } &&
4273          { ac_try='test -s conftest.$ac_objext'
4274   { (eval echo "$as_me:4274: \"$ac_try\"") >&5
4275   (eval $ac_try) 2>&5
4276   ac_status=$?
4277   echo "$as_me:4277: \$? = $ac_status" >&5
4278   (exit $ac_status); }; }; then
4279   :
4280 else
4281   echo "$as_me: failed program was:" >&5
4282 cat conftest.$ac_ext >&5
4283 cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE"
4284 fi
4285 rm -f conftest.$ac_objext conftest.$ac_ext
4286          fi
4287
4288 echo "${as_me:-configure}:4288: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
4289
4290          CFLAGS="$cf_trim_CFLAGS"
4291          CPPFLAGS="$cf_trim_CPPFLAGS"
4292
4293         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4294         CPPFLAGS="${CPPFLAGS}$cf_cv_posix_c_source"
4295
4296 echo "${as_me:-configure}:4296: testing if the second compile does not leave our definition intact error ..." 1>&5
4297
4298          cat >conftest.$ac_ext <<_ACEOF
4299 #line 4299 "configure"
4300 #include "confdefs.h"
4301 #include <sys/types.h>
4302 int
4303 main (void)
4304 {
4305
4306 #ifndef _POSIX_C_SOURCE
4307 make an error
4308 #endif
4309   ;
4310   return 0;
4311 }
4312 _ACEOF
4313 rm -f conftest.$ac_objext
4314 if { (eval echo "$as_me:4314: \"$ac_compile\"") >&5
4315   (eval $ac_compile) 2>&5
4316   ac_status=$?
4317   echo "$as_me:4317: \$? = $ac_status" >&5
4318   (exit $ac_status); } &&
4319          { ac_try='test -s conftest.$ac_objext'
4320   { (eval echo "$as_me:4320: \"$ac_try\"") >&5
4321   (eval $ac_try) 2>&5
4322   ac_status=$?
4323   echo "$as_me:4323: \$? = $ac_status" >&5
4324   (exit $ac_status); }; }; then
4325   :
4326 else
4327   echo "$as_me: failed program was:" >&5
4328 cat conftest.$ac_ext >&5
4329 cf_cv_posix_c_source=no
4330 fi
4331 rm -f conftest.$ac_objext conftest.$ac_ext
4332          CFLAGS="$cf_save_CFLAGS"
4333          CPPFLAGS="$cf_save_CPPFLAGS"
4334
4335 fi
4336 rm -f conftest.$ac_objext conftest.$ac_ext
4337
4338 fi
4339 echo "$as_me:4339: result: $cf_cv_posix_c_source" >&5
4340 echo "${ECHO_T}$cf_cv_posix_c_source" >&6
4341
4342 if test "$cf_cv_posix_c_source" != no ; then
4343         CFLAGS="$cf_trim_CFLAGS"
4344         CPPFLAGS="$cf_trim_CPPFLAGS"
4345
4346 cf_fix_cppflags=no
4347 cf_new_cflags=
4348 cf_new_cppflags=
4349 cf_new_extra_cppflags=
4350
4351 for cf_add_cflags in $cf_cv_posix_c_source
4352 do
4353 case $cf_fix_cppflags in
4354 (no)
4355         case $cf_add_cflags in
4356         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
4357                 case $cf_add_cflags in
4358                 (-D*)
4359                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
4360
4361                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4362                                 && test -z "${cf_tst_cflags}" \
4363                                 && cf_fix_cppflags=yes
4364
4365                         if test $cf_fix_cppflags = yes ; then
4366
4367         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4368         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4369
4370                                 continue
4371                         elif test "${cf_tst_cflags}" = "\"'" ; then
4372
4373         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4374         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4375
4376                                 continue
4377                         fi
4378                         ;;
4379                 esac
4380                 case "$CPPFLAGS" in
4381                 (*$cf_add_cflags)
4382                         ;;
4383                 (*)
4384                         case $cf_add_cflags in
4385                         (-D*)
4386                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
4387
4388 CPPFLAGS=`echo "$CPPFLAGS" | \
4389         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
4390                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
4391
4392                                 ;;
4393                         esac
4394
4395         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
4396         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
4397
4398                         ;;
4399                 esac
4400                 ;;
4401         (*)
4402
4403         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
4404         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
4405
4406                 ;;
4407         esac
4408         ;;
4409 (yes)
4410
4411         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4412         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4413
4414         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
4415
4416         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4417                 && test -z "${cf_tst_cflags}" \
4418                 && cf_fix_cppflags=no
4419         ;;
4420 esac
4421 done
4422
4423 if test -n "$cf_new_cflags" ; then
4424
4425         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
4426         CFLAGS="${CFLAGS}$cf_new_cflags"
4427
4428 fi
4429
4430 if test -n "$cf_new_cppflags" ; then
4431
4432         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4433         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
4434
4435 fi
4436
4437 if test -n "$cf_new_extra_cppflags" ; then
4438
4439         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
4440         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
4441
4442 fi
4443
4444 fi
4445
4446 fi # cf_cv_posix_visible
4447
4448         ;;
4449 (netbsd*)
4450         cf_xopen_source="-D_NETBSD_SOURCE" # setting _XOPEN_SOURCE breaks IPv6 for lynx on NetBSD 1.6, breaks xterm, is not needed for ncursesw
4451         ;;
4452 (openbsd[4-9]*)
4453         # setting _XOPEN_SOURCE lower than 500 breaks g++ compile with wchar.h, needed for ncursesw
4454         cf_xopen_source="-D_BSD_SOURCE"
4455         cf_XOPEN_SOURCE=600
4456         ;;
4457 (openbsd*)
4458         # setting _XOPEN_SOURCE breaks xterm on OpenBSD 2.8, is not needed for ncursesw
4459         ;;
4460 (osf[45]*)
4461         cf_xopen_source="-D_OSF_SOURCE"
4462         ;;
4463 (nto-qnx*)
4464         cf_xopen_source="-D_QNX_SOURCE"
4465         ;;
4466 (sco*)
4467         # setting _XOPEN_SOURCE breaks Lynx on SCO Unix / OpenServer
4468         ;;
4469 (solaris2.*)
4470         cf_xopen_source="-D__EXTENSIONS__"
4471         cf_cv_xopen_source=broken
4472         ;;
4473 (sysv4.2uw2.*) # Novell/SCO UnixWare 2.x (tested on 2.1.2)
4474         cf_XOPEN_SOURCE=
4475         cf_POSIX_C_SOURCE=
4476         ;;
4477 (*)
4478
4479 echo "$as_me:4479: checking if we should define _XOPEN_SOURCE" >&5
4480 echo $ECHO_N "checking if we should define _XOPEN_SOURCE... $ECHO_C" >&6
4481 if test "${cf_cv_xopen_source+set}" = set; then
4482   echo $ECHO_N "(cached) $ECHO_C" >&6
4483 else
4484
4485         cat >conftest.$ac_ext <<_ACEOF
4486 #line 4486 "configure"
4487 #include "confdefs.h"
4488
4489 #include <stdlib.h>
4490 #include <string.h>
4491 #include <sys/types.h>
4492
4493 int
4494 main (void)
4495 {
4496
4497 #ifndef _XOPEN_SOURCE
4498 make an error
4499 #endif
4500   ;
4501   return 0;
4502 }
4503 _ACEOF
4504 rm -f conftest.$ac_objext
4505 if { (eval echo "$as_me:4505: \"$ac_compile\"") >&5
4506   (eval $ac_compile) 2>&5
4507   ac_status=$?
4508   echo "$as_me:4508: \$? = $ac_status" >&5
4509   (exit $ac_status); } &&
4510          { ac_try='test -s conftest.$ac_objext'
4511   { (eval echo "$as_me:4511: \"$ac_try\"") >&5
4512   (eval $ac_try) 2>&5
4513   ac_status=$?
4514   echo "$as_me:4514: \$? = $ac_status" >&5
4515   (exit $ac_status); }; }; then
4516   cf_cv_xopen_source=no
4517 else
4518   echo "$as_me: failed program was:" >&5
4519 cat conftest.$ac_ext >&5
4520 cf_save="$CPPFLAGS"
4521
4522         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4523         CPPFLAGS="${CPPFLAGS}-D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
4524
4525          cat >conftest.$ac_ext <<_ACEOF
4526 #line 4526 "configure"
4527 #include "confdefs.h"
4528
4529 #include <stdlib.h>
4530 #include <string.h>
4531 #include <sys/types.h>
4532
4533 int
4534 main (void)
4535 {
4536
4537 #ifdef _XOPEN_SOURCE
4538 make an error
4539 #endif
4540   ;
4541   return 0;
4542 }
4543 _ACEOF
4544 rm -f conftest.$ac_objext
4545 if { (eval echo "$as_me:4545: \"$ac_compile\"") >&5
4546   (eval $ac_compile) 2>&5
4547   ac_status=$?
4548   echo "$as_me:4548: \$? = $ac_status" >&5
4549   (exit $ac_status); } &&
4550          { ac_try='test -s conftest.$ac_objext'
4551   { (eval echo "$as_me:4551: \"$ac_try\"") >&5
4552   (eval $ac_try) 2>&5
4553   ac_status=$?
4554   echo "$as_me:4554: \$? = $ac_status" >&5
4555   (exit $ac_status); }; }; then
4556   cf_cv_xopen_source=no
4557 else
4558   echo "$as_me: failed program was:" >&5
4559 cat conftest.$ac_ext >&5
4560 cf_cv_xopen_source=$cf_XOPEN_SOURCE
4561 fi
4562 rm -f conftest.$ac_objext conftest.$ac_ext
4563         CPPFLAGS="$cf_save"
4564
4565 fi
4566 rm -f conftest.$ac_objext conftest.$ac_ext
4567
4568 fi
4569 echo "$as_me:4569: result: $cf_cv_xopen_source" >&5
4570 echo "${ECHO_T}$cf_cv_xopen_source" >&6
4571
4572 if test "$cf_cv_xopen_source" != no ; then
4573
4574 CFLAGS=`echo "$CFLAGS" | \
4575         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
4576                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
4577
4578 CPPFLAGS=`echo "$CPPFLAGS" | \
4579         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
4580                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
4581
4582         cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source"
4583
4584 cf_fix_cppflags=no
4585 cf_new_cflags=
4586 cf_new_cppflags=
4587 cf_new_extra_cppflags=
4588
4589 for cf_add_cflags in $cf_temp_xopen_source
4590 do
4591 case $cf_fix_cppflags in
4592 (no)
4593         case $cf_add_cflags in
4594         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
4595                 case $cf_add_cflags in
4596                 (-D*)
4597                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
4598
4599                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4600                                 && test -z "${cf_tst_cflags}" \
4601                                 && cf_fix_cppflags=yes
4602
4603                         if test $cf_fix_cppflags = yes ; then
4604
4605         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4606         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4607
4608                                 continue
4609                         elif test "${cf_tst_cflags}" = "\"'" ; then
4610
4611         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4612         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4613
4614                                 continue
4615                         fi
4616                         ;;
4617                 esac
4618                 case "$CPPFLAGS" in
4619                 (*$cf_add_cflags)
4620                         ;;
4621                 (*)
4622                         case $cf_add_cflags in
4623                         (-D*)
4624                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
4625
4626 CPPFLAGS=`echo "$CPPFLAGS" | \
4627         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
4628                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
4629
4630                                 ;;
4631                         esac
4632
4633         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
4634         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
4635
4636                         ;;
4637                 esac
4638                 ;;
4639         (*)
4640
4641         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
4642         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
4643
4644                 ;;
4645         esac
4646         ;;
4647 (yes)
4648
4649         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4650         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4651
4652         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
4653
4654         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4655                 && test -z "${cf_tst_cflags}" \
4656                 && cf_fix_cppflags=no
4657         ;;
4658 esac
4659 done
4660
4661 if test -n "$cf_new_cflags" ; then
4662
4663         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
4664         CFLAGS="${CFLAGS}$cf_new_cflags"
4665
4666 fi
4667
4668 if test -n "$cf_new_cppflags" ; then
4669
4670         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4671         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
4672
4673 fi
4674
4675 if test -n "$cf_new_extra_cppflags" ; then
4676
4677         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
4678         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
4679
4680 fi
4681
4682 fi
4683
4684 if test "$cf_cv_posix_visible" = no; then
4685
4686 cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE
4687
4688 cf_save_CFLAGS="$CFLAGS"
4689 cf_save_CPPFLAGS="$CPPFLAGS"
4690
4691 cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \
4692         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
4693                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
4694
4695 cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \
4696         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
4697                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
4698
4699 echo "$as_me:4699: checking if we should define _POSIX_C_SOURCE" >&5
4700 echo $ECHO_N "checking if we should define _POSIX_C_SOURCE... $ECHO_C" >&6
4701 if test "${cf_cv_posix_c_source+set}" = set; then
4702   echo $ECHO_N "(cached) $ECHO_C" >&6
4703 else
4704
4705 echo "${as_me:-configure}:4705: testing if the symbol is already defined go no further ..." 1>&5
4706
4707         cat >conftest.$ac_ext <<_ACEOF
4708 #line 4708 "configure"
4709 #include "confdefs.h"
4710 #include <sys/types.h>
4711 int
4712 main (void)
4713 {
4714
4715 #ifndef _POSIX_C_SOURCE
4716 make an error
4717 #endif
4718   ;
4719   return 0;
4720 }
4721 _ACEOF
4722 rm -f conftest.$ac_objext
4723 if { (eval echo "$as_me:4723: \"$ac_compile\"") >&5
4724   (eval $ac_compile) 2>&5
4725   ac_status=$?
4726   echo "$as_me:4726: \$? = $ac_status" >&5
4727   (exit $ac_status); } &&
4728          { ac_try='test -s conftest.$ac_objext'
4729   { (eval echo "$as_me:4729: \"$ac_try\"") >&5
4730   (eval $ac_try) 2>&5
4731   ac_status=$?
4732   echo "$as_me:4732: \$? = $ac_status" >&5
4733   (exit $ac_status); }; }; then
4734   cf_cv_posix_c_source=no
4735 else
4736   echo "$as_me: failed program was:" >&5
4737 cat conftest.$ac_ext >&5
4738 cf_want_posix_source=no
4739          case .$cf_POSIX_C_SOURCE in
4740          (.[12]??*)
4741                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
4742                 ;;
4743          (.2)
4744                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
4745                 cf_want_posix_source=yes
4746                 ;;
4747          (.*)
4748                 cf_want_posix_source=yes
4749                 ;;
4750          esac
4751          if test "$cf_want_posix_source" = yes ; then
4752                 cat >conftest.$ac_ext <<_ACEOF
4753 #line 4753 "configure"
4754 #include "confdefs.h"
4755 #include <sys/types.h>
4756 int
4757 main (void)
4758 {
4759
4760 #ifdef _POSIX_SOURCE
4761 make an error
4762 #endif
4763   ;
4764   return 0;
4765 }
4766 _ACEOF
4767 rm -f conftest.$ac_objext
4768 if { (eval echo "$as_me:4768: \"$ac_compile\"") >&5
4769   (eval $ac_compile) 2>&5
4770   ac_status=$?
4771   echo "$as_me:4771: \$? = $ac_status" >&5
4772   (exit $ac_status); } &&
4773          { ac_try='test -s conftest.$ac_objext'
4774   { (eval echo "$as_me:4774: \"$ac_try\"") >&5
4775   (eval $ac_try) 2>&5
4776   ac_status=$?
4777   echo "$as_me:4777: \$? = $ac_status" >&5
4778   (exit $ac_status); }; }; then
4779   :
4780 else
4781   echo "$as_me: failed program was:" >&5
4782 cat conftest.$ac_ext >&5
4783 cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE"
4784 fi
4785 rm -f conftest.$ac_objext conftest.$ac_ext
4786          fi
4787
4788 echo "${as_me:-configure}:4788: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
4789
4790          CFLAGS="$cf_trim_CFLAGS"
4791          CPPFLAGS="$cf_trim_CPPFLAGS"
4792
4793         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4794         CPPFLAGS="${CPPFLAGS}$cf_cv_posix_c_source"
4795
4796 echo "${as_me:-configure}:4796: testing if the second compile does not leave our definition intact error ..." 1>&5
4797
4798          cat >conftest.$ac_ext <<_ACEOF
4799 #line 4799 "configure"
4800 #include "confdefs.h"
4801 #include <sys/types.h>
4802 int
4803 main (void)
4804 {
4805
4806 #ifndef _POSIX_C_SOURCE
4807 make an error
4808 #endif
4809   ;
4810   return 0;
4811 }
4812 _ACEOF
4813 rm -f conftest.$ac_objext
4814 if { (eval echo "$as_me:4814: \"$ac_compile\"") >&5
4815   (eval $ac_compile) 2>&5
4816   ac_status=$?
4817   echo "$as_me:4817: \$? = $ac_status" >&5
4818   (exit $ac_status); } &&
4819          { ac_try='test -s conftest.$ac_objext'
4820   { (eval echo "$as_me:4820: \"$ac_try\"") >&5
4821   (eval $ac_try) 2>&5
4822   ac_status=$?
4823   echo "$as_me:4823: \$? = $ac_status" >&5
4824   (exit $ac_status); }; }; then
4825   :
4826 else
4827   echo "$as_me: failed program was:" >&5
4828 cat conftest.$ac_ext >&5
4829 cf_cv_posix_c_source=no
4830 fi
4831 rm -f conftest.$ac_objext conftest.$ac_ext
4832          CFLAGS="$cf_save_CFLAGS"
4833          CPPFLAGS="$cf_save_CPPFLAGS"
4834
4835 fi
4836 rm -f conftest.$ac_objext conftest.$ac_ext
4837
4838 fi
4839 echo "$as_me:4839: result: $cf_cv_posix_c_source" >&5
4840 echo "${ECHO_T}$cf_cv_posix_c_source" >&6
4841
4842 if test "$cf_cv_posix_c_source" != no ; then
4843         CFLAGS="$cf_trim_CFLAGS"
4844         CPPFLAGS="$cf_trim_CPPFLAGS"
4845
4846 cf_fix_cppflags=no
4847 cf_new_cflags=
4848 cf_new_cppflags=
4849 cf_new_extra_cppflags=
4850
4851 for cf_add_cflags in $cf_cv_posix_c_source
4852 do
4853 case $cf_fix_cppflags in
4854 (no)
4855         case $cf_add_cflags in
4856         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
4857                 case $cf_add_cflags in
4858                 (-D*)
4859                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
4860
4861                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4862                                 && test -z "${cf_tst_cflags}" \
4863                                 && cf_fix_cppflags=yes
4864
4865                         if test $cf_fix_cppflags = yes ; then
4866
4867         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4868         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4869
4870                                 continue
4871                         elif test "${cf_tst_cflags}" = "\"'" ; then
4872
4873         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4874         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4875
4876                                 continue
4877                         fi
4878                         ;;
4879                 esac
4880                 case "$CPPFLAGS" in
4881                 (*$cf_add_cflags)
4882                         ;;
4883                 (*)
4884                         case $cf_add_cflags in
4885                         (-D*)
4886                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
4887
4888 CPPFLAGS=`echo "$CPPFLAGS" | \
4889         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
4890                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
4891
4892                                 ;;
4893                         esac
4894
4895         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
4896         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
4897
4898                         ;;
4899                 esac
4900                 ;;
4901         (*)
4902
4903         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
4904         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
4905
4906                 ;;
4907         esac
4908         ;;
4909 (yes)
4910
4911         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4912         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4913
4914         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
4915
4916         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4917                 && test -z "${cf_tst_cflags}" \
4918                 && cf_fix_cppflags=no
4919         ;;
4920 esac
4921 done
4922
4923 if test -n "$cf_new_cflags" ; then
4924
4925         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
4926         CFLAGS="${CFLAGS}$cf_new_cflags"
4927
4928 fi
4929
4930 if test -n "$cf_new_cppflags" ; then
4931
4932         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4933         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
4934
4935 fi
4936
4937 if test -n "$cf_new_extra_cppflags" ; then
4938
4939         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
4940         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
4941
4942 fi
4943
4944 fi
4945
4946 fi # cf_cv_posix_visible
4947
4948         ;;
4949 esac
4950
4951 if test -n "$cf_xopen_source" ; then
4952
4953 cf_fix_cppflags=no
4954 cf_new_cflags=
4955 cf_new_cppflags=
4956 cf_new_extra_cppflags=
4957
4958 for cf_add_cflags in $cf_xopen_source
4959 do
4960 case $cf_fix_cppflags in
4961 (no)
4962         case $cf_add_cflags in
4963         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
4964                 case $cf_add_cflags in
4965                 (-D*)
4966                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
4967
4968                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4969                                 && test -z "${cf_tst_cflags}" \
4970                                 && cf_fix_cppflags=yes
4971
4972                         if test $cf_fix_cppflags = yes ; then
4973
4974         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4975         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4976
4977                                 continue
4978                         elif test "${cf_tst_cflags}" = "\"'" ; then
4979
4980         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4981         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4982
4983                                 continue
4984                         fi
4985                         ;;
4986                 esac
4987                 case "$CPPFLAGS" in
4988                 (*$cf_add_cflags)
4989                         ;;
4990                 (*)
4991                         case $cf_add_cflags in
4992                         (-D*)
4993                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
4994
4995 CPPFLAGS=`echo "$CPPFLAGS" | \
4996         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
4997                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
4998
4999                                 ;;
5000                         esac
5001
5002         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
5003         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
5004
5005                         ;;
5006                 esac
5007                 ;;
5008         (*)
5009
5010         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
5011         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
5012
5013                 ;;
5014         esac
5015         ;;
5016 (yes)
5017
5018         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
5019         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
5020
5021         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
5022
5023         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
5024                 && test -z "${cf_tst_cflags}" \
5025                 && cf_fix_cppflags=no
5026         ;;
5027 esac
5028 done
5029
5030 if test -n "$cf_new_cflags" ; then
5031         test -n "$verbose" && echo "    add to \$CFLAGS $cf_new_cflags" 1>&6
5032
5033 echo "${as_me:-configure}:5033: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
5034
5035         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
5036         CFLAGS="${CFLAGS}$cf_new_cflags"
5037
5038 fi
5039
5040 if test -n "$cf_new_cppflags" ; then
5041         test -n "$verbose" && echo "    add to \$CPPFLAGS $cf_new_cppflags" 1>&6
5042
5043 echo "${as_me:-configure}:5043: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
5044
5045         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
5046         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
5047
5048 fi
5049
5050 if test -n "$cf_new_extra_cppflags" ; then
5051         test -n "$verbose" && echo "    add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6
5052
5053 echo "${as_me:-configure}:5053: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
5054
5055         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
5056         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
5057
5058 fi
5059
5060 fi
5061
5062 if test -n "$cf_XOPEN_SOURCE" && test -z "$cf_cv_xopen_source" ; then
5063         echo "$as_me:5063: checking if _XOPEN_SOURCE really is set" >&5
5064 echo $ECHO_N "checking if _XOPEN_SOURCE really is set... $ECHO_C" >&6
5065         cat >conftest.$ac_ext <<_ACEOF
5066 #line 5066 "configure"
5067 #include "confdefs.h"
5068 #include <stdlib.h>
5069 int
5070 main (void)
5071 {
5072
5073 #ifndef _XOPEN_SOURCE
5074 make an error
5075 #endif
5076   ;
5077   return 0;
5078 }
5079 _ACEOF
5080 rm -f conftest.$ac_objext
5081 if { (eval echo "$as_me:5081: \"$ac_compile\"") >&5
5082   (eval $ac_compile) 2>&5
5083   ac_status=$?
5084   echo "$as_me:5084: \$? = $ac_status" >&5
5085   (exit $ac_status); } &&
5086          { ac_try='test -s conftest.$ac_objext'
5087   { (eval echo "$as_me:5087: \"$ac_try\"") >&5
5088   (eval $ac_try) 2>&5
5089   ac_status=$?
5090   echo "$as_me:5090: \$? = $ac_status" >&5
5091   (exit $ac_status); }; }; then
5092   cf_XOPEN_SOURCE_set=yes
5093 else
5094   echo "$as_me: failed program was:" >&5
5095 cat conftest.$ac_ext >&5
5096 cf_XOPEN_SOURCE_set=no
5097 fi
5098 rm -f conftest.$ac_objext conftest.$ac_ext
5099         echo "$as_me:5099: result: $cf_XOPEN_SOURCE_set" >&5
5100 echo "${ECHO_T}$cf_XOPEN_SOURCE_set" >&6
5101         if test $cf_XOPEN_SOURCE_set = yes
5102         then
5103                 cat >conftest.$ac_ext <<_ACEOF
5104 #line 5104 "configure"
5105 #include "confdefs.h"
5106 #include <stdlib.h>
5107 int
5108 main (void)
5109 {
5110
5111 #if (_XOPEN_SOURCE - 0) < $cf_XOPEN_SOURCE
5112 make an error
5113 #endif
5114   ;
5115   return 0;
5116 }
5117 _ACEOF
5118 rm -f conftest.$ac_objext
5119 if { (eval echo "$as_me:5119: \"$ac_compile\"") >&5
5120   (eval $ac_compile) 2>&5
5121   ac_status=$?
5122   echo "$as_me:5122: \$? = $ac_status" >&5
5123   (exit $ac_status); } &&
5124          { ac_try='test -s conftest.$ac_objext'
5125   { (eval echo "$as_me:5125: \"$ac_try\"") >&5
5126   (eval $ac_try) 2>&5
5127   ac_status=$?
5128   echo "$as_me:5128: \$? = $ac_status" >&5
5129   (exit $ac_status); }; }; then
5130   cf_XOPEN_SOURCE_set_ok=yes
5131 else
5132   echo "$as_me: failed program was:" >&5
5133 cat conftest.$ac_ext >&5
5134 cf_XOPEN_SOURCE_set_ok=no
5135 fi
5136 rm -f conftest.$ac_objext conftest.$ac_ext
5137                 if test $cf_XOPEN_SOURCE_set_ok = no
5138                 then
5139                         { echo "$as_me:5139: WARNING: _XOPEN_SOURCE is lower than requested" >&5
5140 echo "$as_me: WARNING: _XOPEN_SOURCE is lower than requested" >&2;}
5141                 fi
5142         else
5143
5144 echo "$as_me:5144: checking if we should define _XOPEN_SOURCE" >&5
5145 echo $ECHO_N "checking if we should define _XOPEN_SOURCE... $ECHO_C" >&6
5146 if test "${cf_cv_xopen_source+set}" = set; then
5147   echo $ECHO_N "(cached) $ECHO_C" >&6
5148 else
5149
5150         cat >conftest.$ac_ext <<_ACEOF
5151 #line 5151 "configure"
5152 #include "confdefs.h"
5153
5154 #include <stdlib.h>
5155 #include <string.h>
5156 #include <sys/types.h>
5157
5158 int
5159 main (void)
5160 {
5161
5162 #ifndef _XOPEN_SOURCE
5163 make an error
5164 #endif
5165   ;
5166   return 0;
5167 }
5168 _ACEOF
5169 rm -f conftest.$ac_objext
5170 if { (eval echo "$as_me:5170: \"$ac_compile\"") >&5
5171   (eval $ac_compile) 2>&5
5172   ac_status=$?
5173   echo "$as_me:5173: \$? = $ac_status" >&5
5174   (exit $ac_status); } &&
5175          { ac_try='test -s conftest.$ac_objext'
5176   { (eval echo "$as_me:5176: \"$ac_try\"") >&5
5177   (eval $ac_try) 2>&5
5178   ac_status=$?
5179   echo "$as_me:5179: \$? = $ac_status" >&5
5180   (exit $ac_status); }; }; then
5181   cf_cv_xopen_source=no
5182 else
5183   echo "$as_me: failed program was:" >&5
5184 cat conftest.$ac_ext >&5
5185 cf_save="$CPPFLAGS"
5186
5187         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
5188         CPPFLAGS="${CPPFLAGS}-D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
5189
5190          cat >conftest.$ac_ext <<_ACEOF
5191 #line 5191 "configure"
5192 #include "confdefs.h"
5193
5194 #include <stdlib.h>
5195 #include <string.h>
5196 #include <sys/types.h>
5197
5198 int
5199 main (void)
5200 {
5201
5202 #ifdef _XOPEN_SOURCE
5203 make an error
5204 #endif
5205   ;
5206   return 0;
5207 }
5208 _ACEOF
5209 rm -f conftest.$ac_objext
5210 if { (eval echo "$as_me:5210: \"$ac_compile\"") >&5
5211   (eval $ac_compile) 2>&5
5212   ac_status=$?
5213   echo "$as_me:5213: \$? = $ac_status" >&5
5214   (exit $ac_status); } &&
5215          { ac_try='test -s conftest.$ac_objext'
5216   { (eval echo "$as_me:5216: \"$ac_try\"") >&5
5217   (eval $ac_try) 2>&5
5218   ac_status=$?
5219   echo "$as_me:5219: \$? = $ac_status" >&5
5220   (exit $ac_status); }; }; then
5221   cf_cv_xopen_source=no
5222 else
5223   echo "$as_me: failed program was:" >&5
5224 cat conftest.$ac_ext >&5
5225 cf_cv_xopen_source=$cf_XOPEN_SOURCE
5226 fi
5227 rm -f conftest.$ac_objext conftest.$ac_ext
5228         CPPFLAGS="$cf_save"
5229
5230 fi
5231 rm -f conftest.$ac_objext conftest.$ac_ext
5232
5233 fi
5234 echo "$as_me:5234: result: $cf_cv_xopen_source" >&5
5235 echo "${ECHO_T}$cf_cv_xopen_source" >&6
5236
5237 if test "$cf_cv_xopen_source" != no ; then
5238
5239 CFLAGS=`echo "$CFLAGS" | \
5240         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
5241                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
5242
5243 CPPFLAGS=`echo "$CPPFLAGS" | \
5244         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
5245                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
5246
5247         cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source"
5248
5249 cf_fix_cppflags=no
5250 cf_new_cflags=
5251 cf_new_cppflags=
5252 cf_new_extra_cppflags=
5253
5254 for cf_add_cflags in $cf_temp_xopen_source
5255 do
5256 case $cf_fix_cppflags in
5257 (no)
5258         case $cf_add_cflags in
5259         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
5260                 case $cf_add_cflags in
5261                 (-D*)
5262                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
5263
5264                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
5265                                 && test -z "${cf_tst_cflags}" \
5266                                 && cf_fix_cppflags=yes
5267
5268                         if test $cf_fix_cppflags = yes ; then
5269
5270         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
5271         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
5272
5273                                 continue
5274                         elif test "${cf_tst_cflags}" = "\"'" ; then
5275
5276         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
5277         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
5278
5279                                 continue
5280                         fi
5281                         ;;
5282                 esac
5283                 case "$CPPFLAGS" in
5284                 (*$cf_add_cflags)
5285                         ;;
5286                 (*)
5287                         case $cf_add_cflags in
5288                         (-D*)
5289                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
5290
5291 CPPFLAGS=`echo "$CPPFLAGS" | \
5292         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
5293                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
5294
5295                                 ;;
5296                         esac
5297
5298         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
5299         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
5300
5301                         ;;
5302                 esac
5303                 ;;
5304         (*)
5305
5306         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
5307         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
5308
5309                 ;;
5310         esac
5311         ;;
5312 (yes)
5313
5314         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
5315         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
5316
5317         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
5318
5319         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
5320                 && test -z "${cf_tst_cflags}" \
5321                 && cf_fix_cppflags=no
5322         ;;
5323 esac
5324 done
5325
5326 if test -n "$cf_new_cflags" ; then
5327
5328         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
5329         CFLAGS="${CFLAGS}$cf_new_cflags"
5330
5331 fi
5332
5333 if test -n "$cf_new_cppflags" ; then
5334
5335         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
5336         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
5337
5338 fi
5339
5340 if test -n "$cf_new_extra_cppflags" ; then
5341
5342         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
5343         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
5344
5345 fi
5346
5347 fi
5348
5349         fi
5350 fi
5351 fi # cf_cv_posix_visible
5352
5353 echo "$as_me:5353: checking for signal global datatype" >&5
5354 echo $ECHO_N "checking for signal global datatype... $ECHO_C" >&6
5355 if test "${cf_cv_sig_atomic_t+set}" = set; then
5356   echo $ECHO_N "(cached) $ECHO_C" >&6
5357 else
5358
5359         for cf_type in \
5360                 "volatile sig_atomic_t" \
5361                 "sig_atomic_t" \
5362                 "int"
5363         do
5364         cat >conftest.$ac_ext <<_ACEOF
5365 #line 5365 "configure"
5366 #include "confdefs.h"
5367
5368 #include <sys/types.h>
5369 #include <signal.h>
5370 #include <stdio.h>
5371
5372 extern $cf_type x;
5373 $cf_type x;
5374 static void handler(int sig)
5375 {
5376         (void)sig;
5377         x = 5;
5378 }
5379 int
5380 main (void)
5381 {
5382 signal(SIGINT, handler);
5383                  x = 1
5384   ;
5385   return 0;
5386 }
5387 _ACEOF
5388 rm -f conftest.$ac_objext
5389 if { (eval echo "$as_me:5389: \"$ac_compile\"") >&5
5390   (eval $ac_compile) 2>&5
5391   ac_status=$?
5392   echo "$as_me:5392: \$? = $ac_status" >&5
5393   (exit $ac_status); } &&
5394          { ac_try='test -s conftest.$ac_objext'
5395   { (eval echo "$as_me:5395: \"$ac_try\"") >&5
5396   (eval $ac_try) 2>&5
5397   ac_status=$?
5398   echo "$as_me:5398: \$? = $ac_status" >&5
5399   (exit $ac_status); }; }; then
5400   cf_cv_sig_atomic_t=$cf_type
5401 else
5402   echo "$as_me: failed program was:" >&5
5403 cat conftest.$ac_ext >&5
5404 cf_cv_sig_atomic_t=no
5405 fi
5406 rm -f conftest.$ac_objext conftest.$ac_ext
5407                 test "$cf_cv_sig_atomic_t" != no && break
5408         done
5409
5410 fi
5411
5412 echo "$as_me:5412: result: $cf_cv_sig_atomic_t" >&5
5413 echo "${ECHO_T}$cf_cv_sig_atomic_t" >&6
5414 test "$cf_cv_sig_atomic_t" != no &&
5415 cat >>confdefs.h <<EOF
5416 #define SIG_ATOMIC_T $cf_cv_sig_atomic_t
5417 EOF
5418
5419 # Work around breakage on OS X
5420
5421 echo "$as_me:5421: checking if SIGWINCH is defined" >&5
5422 echo $ECHO_N "checking if SIGWINCH is defined... $ECHO_C" >&6
5423 if test "${cf_cv_define_sigwinch+set}" = set; then
5424   echo $ECHO_N "(cached) $ECHO_C" >&6
5425 else
5426
5427         cat >conftest.$ac_ext <<_ACEOF
5428 #line 5428 "configure"
5429 #include "confdefs.h"
5430
5431 #include <sys/types.h>
5432 #include <sys/signal.h>
5433
5434 int
5435 main (void)
5436 {
5437 int x = SIGWINCH; (void)x
5438   ;
5439   return 0;
5440 }
5441 _ACEOF
5442 rm -f conftest.$ac_objext
5443 if { (eval echo "$as_me:5443: \"$ac_compile\"") >&5
5444   (eval $ac_compile) 2>&5
5445   ac_status=$?
5446   echo "$as_me:5446: \$? = $ac_status" >&5
5447   (exit $ac_status); } &&
5448          { ac_try='test -s conftest.$ac_objext'
5449   { (eval echo "$as_me:5449: \"$ac_try\"") >&5
5450   (eval $ac_try) 2>&5
5451   ac_status=$?
5452   echo "$as_me:5452: \$? = $ac_status" >&5
5453   (exit $ac_status); }; }; then
5454   cf_cv_define_sigwinch=yes
5455 else
5456   echo "$as_me: failed program was:" >&5
5457 cat conftest.$ac_ext >&5
5458 cat >conftest.$ac_ext <<_ACEOF
5459 #line 5459 "configure"
5460 #include "confdefs.h"
5461
5462 #undef _XOPEN_SOURCE
5463 #undef _POSIX_SOURCE
5464 #undef _POSIX_C_SOURCE
5465 #include <sys/types.h>
5466 #include <sys/signal.h>
5467
5468 int
5469 main (void)
5470 {
5471 int x = SIGWINCH; (void)x
5472   ;
5473   return 0;
5474 }
5475 _ACEOF
5476 rm -f conftest.$ac_objext
5477 if { (eval echo "$as_me:5477: \"$ac_compile\"") >&5
5478   (eval $ac_compile) 2>&5
5479   ac_status=$?
5480   echo "$as_me:5480: \$? = $ac_status" >&5
5481   (exit $ac_status); } &&
5482          { ac_try='test -s conftest.$ac_objext'
5483   { (eval echo "$as_me:5483: \"$ac_try\"") >&5
5484   (eval $ac_try) 2>&5
5485   ac_status=$?
5486   echo "$as_me:5486: \$? = $ac_status" >&5
5487   (exit $ac_status); }; }; then
5488   cf_cv_define_sigwinch=maybe
5489 else
5490   echo "$as_me: failed program was:" >&5
5491 cat conftest.$ac_ext >&5
5492 cf_cv_define_sigwinch=no
5493 fi
5494 rm -f conftest.$ac_objext conftest.$ac_ext
5495
5496 fi
5497 rm -f conftest.$ac_objext conftest.$ac_ext
5498
5499 fi
5500 echo "$as_me:5500: result: $cf_cv_define_sigwinch" >&5
5501 echo "${ECHO_T}$cf_cv_define_sigwinch" >&6
5502
5503 if test "$cf_cv_define_sigwinch" = maybe ; then
5504 echo "$as_me:5504: checking for actual SIGWINCH definition" >&5
5505 echo $ECHO_N "checking for actual SIGWINCH definition... $ECHO_C" >&6
5506 if test "${cf_cv_fixup_sigwinch+set}" = set; then
5507   echo $ECHO_N "(cached) $ECHO_C" >&6
5508 else
5509
5510 cf_cv_fixup_sigwinch=unknown
5511 cf_sigwinch=32
5512 while test $cf_sigwinch != 1
5513 do
5514         cat >conftest.$ac_ext <<_ACEOF
5515 #line 5515 "configure"
5516 #include "confdefs.h"
5517
5518 #undef _XOPEN_SOURCE
5519 #undef _POSIX_SOURCE
5520 #undef _POSIX_C_SOURCE
5521 #include <sys/types.h>
5522 #include <sys/signal.h>
5523
5524 int
5525 main (void)
5526 {
5527
5528 #if SIGWINCH != $cf_sigwinch
5529 make an error
5530 #endif
5531 int x = SIGWINCH; (void)x
5532   ;
5533   return 0;
5534 }
5535 _ACEOF
5536 rm -f conftest.$ac_objext
5537 if { (eval echo "$as_me:5537: \"$ac_compile\"") >&5
5538   (eval $ac_compile) 2>&5
5539   ac_status=$?
5540   echo "$as_me:5540: \$? = $ac_status" >&5
5541   (exit $ac_status); } &&
5542          { ac_try='test -s conftest.$ac_objext'
5543   { (eval echo "$as_me:5543: \"$ac_try\"") >&5
5544   (eval $ac_try) 2>&5
5545   ac_status=$?
5546   echo "$as_me:5546: \$? = $ac_status" >&5
5547   (exit $ac_status); }; }; then
5548   cf_cv_fixup_sigwinch=$cf_sigwinch
5549          break
5550 else
5551   echo "$as_me: failed program was:" >&5
5552 cat conftest.$ac_ext >&5
5553 fi
5554 rm -f conftest.$ac_objext conftest.$ac_ext
5555
5556 cf_sigwinch=`expr $cf_sigwinch - 1`
5557 done
5558
5559 fi
5560 echo "$as_me:5560: result: $cf_cv_fixup_sigwinch" >&5
5561 echo "${ECHO_T}$cf_cv_fixup_sigwinch" >&6
5562
5563         if test "$cf_cv_fixup_sigwinch" != unknown ; then
5564                 CPPFLAGS="$CPPFLAGS -DSIGWINCH=$cf_cv_fixup_sigwinch"
5565         fi
5566 fi
5567
5568 # Checks for CODESET support.
5569
5570 echo "$as_me:5570: checking for nl_langinfo and CODESET" >&5
5571 echo $ECHO_N "checking for nl_langinfo and CODESET... $ECHO_C" >&6
5572 if test "${am_cv_langinfo_codeset+set}" = set; then
5573   echo $ECHO_N "(cached) $ECHO_C" >&6
5574 else
5575   cat >conftest.$ac_ext <<_ACEOF
5576 #line 5576 "configure"
5577 #include "confdefs.h"
5578 #include <langinfo.h>
5579 int
5580 main (void)
5581 {
5582 char* cs = nl_langinfo(CODESET); (void)cs
5583   ;
5584   return 0;
5585 }
5586 _ACEOF
5587 rm -f conftest.$ac_objext conftest$ac_exeext
5588 if { (eval echo "$as_me:5588: \"$ac_link\"") >&5
5589   (eval $ac_link) 2>&5
5590   ac_status=$?
5591   echo "$as_me:5591: \$? = $ac_status" >&5
5592   (exit $ac_status); } &&
5593          { ac_try='test -s conftest$ac_exeext'
5594   { (eval echo "$as_me:5594: \"$ac_try\"") >&5
5595   (eval $ac_try) 2>&5
5596   ac_status=$?
5597   echo "$as_me:5597: \$? = $ac_status" >&5
5598   (exit $ac_status); }; }; then
5599   am_cv_langinfo_codeset=yes
5600 else
5601   echo "$as_me: failed program was:" >&5
5602 cat conftest.$ac_ext >&5
5603 am_cv_langinfo_codeset=no
5604 fi
5605 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5606
5607 fi
5608 echo "$as_me:5608: result: $am_cv_langinfo_codeset" >&5
5609 echo "${ECHO_T}$am_cv_langinfo_codeset" >&6
5610         if test $am_cv_langinfo_codeset = yes; then
5611
5612 cat >>confdefs.h <<\EOF
5613 #define HAVE_LANGINFO_CODESET 1
5614 EOF
5615
5616         fi
5617
5618 echo "$as_me:5618: checking if you want to use pkg-config" >&5
5619 echo $ECHO_N "checking if you want to use pkg-config... $ECHO_C" >&6
5620
5621 # Check whether --with-pkg-config or --without-pkg-config was given.
5622 if test "${with_pkg_config+set}" = set; then
5623   withval="$with_pkg_config"
5624   cf_pkg_config=$withval
5625 else
5626   cf_pkg_config=yes
5627 fi;
5628 echo "$as_me:5628: result: $cf_pkg_config" >&5
5629 echo "${ECHO_T}$cf_pkg_config" >&6
5630
5631 case $cf_pkg_config in
5632 (no)
5633         PKG_CONFIG=none
5634         ;;
5635 (yes)
5636
5637 if test -n "$ac_tool_prefix"; then
5638   # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
5639 set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
5640 echo "$as_me:5640: checking for $ac_word" >&5
5641 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
5642 if test "${ac_cv_path_PKG_CONFIG+set}" = set; then
5643   echo $ECHO_N "(cached) $ECHO_C" >&6
5644 else
5645   case $PKG_CONFIG in
5646   [\\/]* | ?:[\\/]*)
5647   ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
5648   ;;
5649   *)
5650   ac_save_IFS=$IFS; IFS=$ac_path_separator
5651 ac_dummy="$PATH"
5652 for ac_dir in $ac_dummy; do
5653   IFS=$ac_save_IFS
5654   test -z "$ac_dir" && ac_dir=.
5655   if $as_executable_p "$ac_dir/$ac_word"; then
5656    ac_cv_path_PKG_CONFIG="$ac_dir/$ac_word"
5657    echo "$as_me:5657: found $ac_dir/$ac_word" >&5
5658    break
5659 fi
5660 done
5661
5662   ;;
5663 esac
5664 fi
5665 PKG_CONFIG=$ac_cv_path_PKG_CONFIG
5666
5667 if test -n "$PKG_CONFIG"; then
5668   echo "$as_me:5668: result: $PKG_CONFIG" >&5
5669 echo "${ECHO_T}$PKG_CONFIG" >&6
5670 else
5671   echo "$as_me:5671: result: no" >&5
5672 echo "${ECHO_T}no" >&6
5673 fi
5674
5675 fi
5676 if test -z "$ac_cv_path_PKG_CONFIG"; then
5677   ac_pt_PKG_CONFIG=$PKG_CONFIG
5678   # Extract the first word of "pkg-config", so it can be a program name with args.
5679 set dummy pkg-config; ac_word=$2
5680 echo "$as_me:5680: checking for $ac_word" >&5
5681 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
5682 if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then
5683   echo $ECHO_N "(cached) $ECHO_C" >&6
5684 else
5685   case $ac_pt_PKG_CONFIG in
5686   [\\/]* | ?:[\\/]*)
5687   ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path.
5688   ;;
5689   *)
5690   ac_save_IFS=$IFS; IFS=$ac_path_separator
5691 ac_dummy="$PATH"
5692 for ac_dir in $ac_dummy; do
5693   IFS=$ac_save_IFS
5694   test -z "$ac_dir" && ac_dir=.
5695   if $as_executable_p "$ac_dir/$ac_word"; then
5696    ac_cv_path_ac_pt_PKG_CONFIG="$ac_dir/$ac_word"
5697    echo "$as_me:5697: found $ac_dir/$ac_word" >&5
5698    break
5699 fi
5700 done
5701
5702   test -z "$ac_cv_path_ac_pt_PKG_CONFIG" && ac_cv_path_ac_pt_PKG_CONFIG="none"
5703   ;;
5704 esac
5705 fi
5706 ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
5707
5708 if test -n "$ac_pt_PKG_CONFIG"; then
5709   echo "$as_me:5709: result: $ac_pt_PKG_CONFIG" >&5
5710 echo "${ECHO_T}$ac_pt_PKG_CONFIG" >&6
5711 else
5712   echo "$as_me:5712: result: no" >&5
5713 echo "${ECHO_T}no" >&6
5714 fi
5715
5716   PKG_CONFIG=$ac_pt_PKG_CONFIG
5717 else
5718   PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
5719 fi
5720
5721         ;;
5722 (*)
5723         PKG_CONFIG=$withval
5724         ;;
5725 esac
5726
5727 test -z "$PKG_CONFIG" && PKG_CONFIG=none
5728 if test "$PKG_CONFIG" != none ; then
5729
5730 if test "x$prefix" != xNONE; then
5731         cf_path_syntax="$prefix"
5732 else
5733         cf_path_syntax="$ac_default_prefix"
5734 fi
5735
5736 case ".$PKG_CONFIG" in
5737 (.\$\(*\)*|.\'*\'*)
5738         ;;
5739 (..|./*|.\\*)
5740         ;;
5741 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
5742         ;;
5743 (.\${*prefix}*|.\${*dir}*)
5744         eval PKG_CONFIG="$PKG_CONFIG"
5745         case ".$PKG_CONFIG" in
5746         (.NONE/*)
5747                 PKG_CONFIG=`echo $PKG_CONFIG | sed -e s%NONE%$cf_path_syntax%`
5748                 ;;
5749         esac
5750         ;;
5751 (.no|.NONE/*)
5752         PKG_CONFIG=`echo $PKG_CONFIG | sed -e s%NONE%$cf_path_syntax%`
5753         ;;
5754 (*)
5755         { { echo "$as_me:5755: error: expected a pathname, not \"$PKG_CONFIG\"" >&5
5756 echo "$as_me: error: expected a pathname, not \"$PKG_CONFIG\"" >&2;}
5757    { (exit 1); exit 1; }; }
5758         ;;
5759 esac
5760
5761 elif test "x$cf_pkg_config" != xno ; then
5762         { echo "$as_me:5762: WARNING: pkg-config is not installed" >&5
5763 echo "$as_me: WARNING: pkg-config is not installed" >&2;}
5764 fi
5765
5766 echo "$as_me:5766: checking if you want to see long compiling messages" >&5
5767 echo $ECHO_N "checking if you want to see long compiling messages... $ECHO_C" >&6
5768
5769 # Check whether --enable-echo or --disable-echo was given.
5770 if test "${enable_echo+set}" = set; then
5771   enableval="$enable_echo"
5772   test "$enableval" != no && enableval=yes
5773         if test "$enableval" != "yes" ; then
5774
5775         ECHO_LT='--silent'
5776         ECHO_LD='@echo linking $@;'
5777         RULE_CC='@echo compiling $<'
5778         SHOW_CC='@echo compiling $@'
5779         ECHO_CC='@'
5780
5781         else
5782
5783         ECHO_LT=''
5784         ECHO_LD=''
5785         RULE_CC=''
5786         SHOW_CC=''
5787         ECHO_CC=''
5788
5789         fi
5790 else
5791   enableval=yes
5792
5793         ECHO_LT=''
5794         ECHO_LD=''
5795         RULE_CC=''
5796         SHOW_CC=''
5797         ECHO_CC=''
5798
5799 fi;
5800 echo "$as_me:5800: result: $enableval" >&5
5801 echo "${ECHO_T}$enableval" >&6
5802
5803 echo "$as_me:5803: checking for ncurses wrap-prefix" >&5
5804 echo $ECHO_N "checking for ncurses wrap-prefix... $ECHO_C" >&6
5805
5806 # Check whether --with-ncurses-wrap-prefix or --without-ncurses-wrap-prefix was given.
5807 if test "${with_ncurses_wrap_prefix+set}" = set; then
5808   withval="$with_ncurses_wrap_prefix"
5809   NCURSES_WRAP_PREFIX=$withval
5810 else
5811   NCURSES_WRAP_PREFIX=_nc_
5812 fi;
5813 echo "$as_me:5813: result: $NCURSES_WRAP_PREFIX" >&5
5814 echo "${ECHO_T}$NCURSES_WRAP_PREFIX" >&6
5815
5816 echo "$as_me:5816: checking if you want to check for wide-character functions" >&5
5817 echo $ECHO_N "checking if you want to check for wide-character functions... $ECHO_C" >&6
5818
5819 # Check whether --enable-widec or --disable-widec was given.
5820 if test "${enable_widec+set}" = set; then
5821   enableval="$enable_widec"
5822   test "$enableval" != no && enableval=yes
5823         if test "$enableval" != "yes" ; then
5824     cf_enable_widec=no
5825         else
5826                 cf_enable_widec=yes
5827         fi
5828 else
5829   enableval=yes
5830         cf_enable_widec=yes
5831
5832 fi;
5833 echo "$as_me:5833: result: $cf_enable_widec" >&5
5834 echo "${ECHO_T}$cf_enable_widec" >&6
5835
5836 echo "$as_me:5836: checking for specific curses-directory" >&5
5837 echo $ECHO_N "checking for specific curses-directory... $ECHO_C" >&6
5838
5839 # Check whether --with-curses-dir or --without-curses-dir was given.
5840 if test "${with_curses_dir+set}" = set; then
5841   withval="$with_curses_dir"
5842   cf_cv_curses_dir=$withval
5843 else
5844   cf_cv_curses_dir=no
5845 fi;
5846 echo "$as_me:5846: result: $cf_cv_curses_dir" >&5
5847 echo "${ECHO_T}$cf_cv_curses_dir" >&6
5848
5849 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
5850 then
5851
5852 if test "x$prefix" != xNONE; then
5853         cf_path_syntax="$prefix"
5854 else
5855         cf_path_syntax="$ac_default_prefix"
5856 fi
5857
5858 case ".$withval" in
5859 (.\$\(*\)*|.\'*\'*)
5860         ;;
5861 (..|./*|.\\*)
5862         ;;
5863 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
5864         ;;
5865 (.\${*prefix}*|.\${*dir}*)
5866         eval withval="$withval"
5867         case ".$withval" in
5868         (.NONE/*)
5869                 withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
5870                 ;;
5871         esac
5872         ;;
5873 (.no|.NONE/*)
5874         withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
5875         ;;
5876 (*)
5877         { { echo "$as_me:5877: error: expected a pathname, not \"$withval\"" >&5
5878 echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;}
5879    { (exit 1); exit 1; }; }
5880         ;;
5881 esac
5882
5883         if test -d "$cf_cv_curses_dir"
5884         then
5885
5886 if test -n "$cf_cv_curses_dir/include" ; then
5887   for cf_add_incdir in $cf_cv_curses_dir/include
5888   do
5889         while test $cf_add_incdir != /usr/include
5890         do
5891           if test -d $cf_add_incdir
5892           then
5893                 cf_have_incdir=no
5894                 if test -n "$CFLAGS$CPPFLAGS" ; then
5895                   # a loop is needed to ensure we can add subdirs of existing dirs
5896                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
5897                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
5898                           cf_have_incdir=yes; break
5899                         fi
5900                   done
5901                 fi
5902
5903                 if test "$cf_have_incdir" = no ; then
5904                   if test "$cf_add_incdir" = /usr/local/include ; then
5905                         if test "$GCC" = yes
5906                         then
5907                           cf_save_CPPFLAGS=$CPPFLAGS
5908
5909         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
5910         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
5911
5912                           cat >conftest.$ac_ext <<_ACEOF
5913 #line 5913 "configure"
5914 #include "confdefs.h"
5915 #include <stdio.h>
5916 int
5917 main (void)
5918 {
5919 printf("Hello")
5920   ;
5921   return 0;
5922 }
5923 _ACEOF
5924 rm -f conftest.$ac_objext
5925 if { (eval echo "$as_me:5925: \"$ac_compile\"") >&5
5926   (eval $ac_compile) 2>&5
5927   ac_status=$?
5928   echo "$as_me:5928: \$? = $ac_status" >&5
5929   (exit $ac_status); } &&
5930          { ac_try='test -s conftest.$ac_objext'
5931   { (eval echo "$as_me:5931: \"$ac_try\"") >&5
5932   (eval $ac_try) 2>&5
5933   ac_status=$?
5934   echo "$as_me:5934: \$? = $ac_status" >&5
5935   (exit $ac_status); }; }; then
5936   :
5937 else
5938   echo "$as_me: failed program was:" >&5
5939 cat conftest.$ac_ext >&5
5940 cf_have_incdir=yes
5941 fi
5942 rm -f conftest.$ac_objext conftest.$ac_ext
5943                           CPPFLAGS=$cf_save_CPPFLAGS
5944                         fi
5945                   fi
5946                 fi
5947
5948                 if test "$cf_have_incdir" = no ; then
5949                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
5950
5951 echo "${as_me:-configure}:5951: testing adding $cf_add_incdir to include-path ..." 1>&5
5952
5953                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
5954
5955                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
5956                   test "$cf_top_incdir" = "$cf_add_incdir" && break
5957                   cf_add_incdir="$cf_top_incdir"
5958                 else
5959                   break
5960                 fi
5961           else
5962                 break
5963           fi
5964         done
5965   done
5966 fi
5967
5968 if test -n "$cf_cv_curses_dir/lib" ; then
5969         for cf_add_libdir in $cf_cv_curses_dir/lib
5970         do
5971                 if test $cf_add_libdir = /usr/lib ; then
5972                         :
5973                 elif test -d $cf_add_libdir
5974                 then
5975                         cf_have_libdir=no
5976                         if test -n "$LDFLAGS$LIBS" ; then
5977                                 # a loop is needed to ensure we can add subdirs of existing dirs
5978                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
5979                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
5980                                                 cf_have_libdir=yes; break
5981                                         fi
5982                                 done
5983                         fi
5984                         if test "$cf_have_libdir" = no ; then
5985                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
5986
5987 echo "${as_me:-configure}:5987: testing adding $cf_add_libdir to library-path ..." 1>&5
5988
5989                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
5990                         fi
5991                 fi
5992         done
5993 fi
5994
5995         fi
5996 fi
5997
5998 cf_cv_screen=curses
5999
6000 echo "$as_me:6000: checking for specified curses library type" >&5
6001 echo $ECHO_N "checking for specified curses library type... $ECHO_C" >&6
6002
6003 # Check whether --with-screen or --without-screen was given.
6004 if test "${with_screen+set}" = set; then
6005   withval="$with_screen"
6006   cf_cv_screen=$withval
6007 else
6008
6009 # Check whether --with-ncursesw or --without-ncursesw was given.
6010 if test "${with_ncursesw+set}" = set; then
6011   withval="$with_ncursesw"
6012   cf_cv_screen=ncursesw
6013 else
6014
6015 # Check whether --with-ncurses or --without-ncurses was given.
6016 if test "${with_ncurses+set}" = set; then
6017   withval="$with_ncurses"
6018   cf_cv_screen=ncurses
6019 else
6020
6021 # Check whether --with-pdcurses or --without-pdcurses was given.
6022 if test "${with_pdcurses+set}" = set; then
6023   withval="$with_pdcurses"
6024   cf_cv_screen=pdcurses
6025 else
6026
6027 # Check whether --with-curses-colr or --without-curses-colr was given.
6028 if test "${with_curses_colr+set}" = set; then
6029   withval="$with_curses_colr"
6030   cf_cv_screen=curses_colr
6031 else
6032
6033 # Check whether --with-curses-5lib or --without-curses-5lib was given.
6034 if test "${with_curses_5lib+set}" = set; then
6035   withval="$with_curses_5lib"
6036   cf_cv_screen=curses_5lib
6037 fi;
6038 fi;
6039 fi;
6040 fi;
6041 fi;
6042 fi;
6043
6044 echo "$as_me:6044: result: $cf_cv_screen" >&5
6045 echo "${ECHO_T}$cf_cv_screen" >&6
6046
6047 case $cf_cv_screen in
6048 (curses|curses_*)
6049
6050 echo "$as_me:6050: checking for extra include directories" >&5
6051 echo $ECHO_N "checking for extra include directories... $ECHO_C" >&6
6052 if test "${cf_cv_curses_incdir+set}" = set; then
6053   echo $ECHO_N "(cached) $ECHO_C" >&6
6054 else
6055
6056 cf_cv_curses_incdir=no
6057 case $host_os in
6058 (hpux10.*)
6059         if test "x$cf_cv_screen" = "xcurses_colr"
6060         then
6061                 test -d /usr/include/curses_colr && \
6062                 cf_cv_curses_incdir="-I/usr/include/curses_colr"
6063         fi
6064         ;;
6065 (sunos3*|sunos4*)
6066         if test "x$cf_cv_screen" = "xcurses_5lib"
6067         then
6068                 test -d /usr/5lib && \
6069                 test -d /usr/5include && \
6070                 cf_cv_curses_incdir="-I/usr/5include"
6071         fi
6072         ;;
6073 esac
6074
6075 fi
6076 echo "$as_me:6076: result: $cf_cv_curses_incdir" >&5
6077 echo "${ECHO_T}$cf_cv_curses_incdir" >&6
6078 if test "$cf_cv_curses_incdir" != no
6079 then
6080
6081         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
6082         CPPFLAGS="${CPPFLAGS}$cf_cv_curses_incdir"
6083
6084 fi
6085
6086 echo "$as_me:6086: checking if we have identified curses headers" >&5
6087 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
6088 if test "${cf_cv_ncurses_header+set}" = set; then
6089   echo $ECHO_N "(cached) $ECHO_C" >&6
6090 else
6091
6092 cf_cv_ncurses_header=none
6093 for cf_header in \
6094         ncurses.h  \
6095         curses.h  ncurses/ncurses.h ncurses/curses.h
6096 do
6097 cat >conftest.$ac_ext <<_ACEOF
6098 #line 6098 "configure"
6099 #include "confdefs.h"
6100 #include <${cf_header}>
6101 int
6102 main (void)
6103 {
6104 initscr(); tgoto("?", 0,0)
6105   ;
6106   return 0;
6107 }
6108 _ACEOF
6109 rm -f conftest.$ac_objext
6110 if { (eval echo "$as_me:6110: \"$ac_compile\"") >&5
6111   (eval $ac_compile) 2>&5
6112   ac_status=$?
6113   echo "$as_me:6113: \$? = $ac_status" >&5
6114   (exit $ac_status); } &&
6115          { ac_try='test -s conftest.$ac_objext'
6116   { (eval echo "$as_me:6116: \"$ac_try\"") >&5
6117   (eval $ac_try) 2>&5
6118   ac_status=$?
6119   echo "$as_me:6119: \$? = $ac_status" >&5
6120   (exit $ac_status); }; }; then
6121   cf_cv_ncurses_header=$cf_header; break
6122 else
6123   echo "$as_me: failed program was:" >&5
6124 cat conftest.$ac_ext >&5
6125 fi
6126 rm -f conftest.$ac_objext conftest.$ac_ext
6127 done
6128
6129 fi
6130 echo "$as_me:6130: result: $cf_cv_ncurses_header" >&5
6131 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
6132
6133 if test "$cf_cv_ncurses_header" = none ; then
6134         { { echo "$as_me:6134: error: No curses header-files found" >&5
6135 echo "$as_me: error: No curses header-files found" >&2;}
6136    { (exit 1); exit 1; }; }
6137 fi
6138
6139 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
6140
6141 for ac_header in $cf_cv_ncurses_header
6142 do
6143 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
6144 echo "$as_me:6144: checking for $ac_header" >&5
6145 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
6146 if eval "test \"\${$as_ac_Header+set}\" = set"; then
6147   echo $ECHO_N "(cached) $ECHO_C" >&6
6148 else
6149   cat >conftest.$ac_ext <<_ACEOF
6150 #line 6150 "configure"
6151 #include "confdefs.h"
6152 #include <$ac_header>
6153 _ACEOF
6154 if { (eval echo "$as_me:6154: \"$ac_cpp conftest.$ac_ext\"") >&5
6155   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
6156   ac_status=$?
6157   egrep -v '^ *\+' conftest.er1 >conftest.err
6158   rm -f conftest.er1
6159   cat conftest.err >&5
6160   echo "$as_me:6160: \$? = $ac_status" >&5
6161   (exit $ac_status); } >/dev/null; then
6162   if test -s conftest.err; then
6163     ac_cpp_err=$ac_c_preproc_warn_flag
6164   else
6165     ac_cpp_err=
6166   fi
6167 else
6168   ac_cpp_err=yes
6169 fi
6170 if test -z "$ac_cpp_err"; then
6171   eval "$as_ac_Header=yes"
6172 else
6173   echo "$as_me: failed program was:" >&5
6174   cat conftest.$ac_ext >&5
6175   eval "$as_ac_Header=no"
6176 fi
6177 rm -f conftest.err conftest.$ac_ext
6178 fi
6179 echo "$as_me:6179: result: `eval echo '${'$as_ac_Header'}'`" >&5
6180 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
6181 if test `eval echo '${'$as_ac_Header'}'` = yes; then
6182   cat >>confdefs.h <<EOF
6183 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
6184 EOF
6185
6186 fi
6187 done
6188
6189 echo "$as_me:6189: checking for terminfo header" >&5
6190 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
6191 if test "${cf_cv_term_header+set}" = set; then
6192   echo $ECHO_N "(cached) $ECHO_C" >&6
6193 else
6194
6195 case ${cf_cv_ncurses_header} in
6196 (*/ncurses.h|*/ncursesw.h)
6197         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
6198         ;;
6199 (*)
6200         cf_term_header=term.h
6201         ;;
6202 esac
6203
6204 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
6205 do
6206 cat >conftest.$ac_ext <<_ACEOF
6207 #line 6207 "configure"
6208 #include "confdefs.h"
6209 #include <stdio.h>
6210 #include <${cf_cv_ncurses_header:-curses.h}>
6211 #include <$cf_test>
6212
6213 int
6214 main (void)
6215 {
6216 int x = auto_left_margin; (void)x
6217   ;
6218   return 0;
6219 }
6220 _ACEOF
6221 rm -f conftest.$ac_objext
6222 if { (eval echo "$as_me:6222: \"$ac_compile\"") >&5
6223   (eval $ac_compile) 2>&5
6224   ac_status=$?
6225   echo "$as_me:6225: \$? = $ac_status" >&5
6226   (exit $ac_status); } &&
6227          { ac_try='test -s conftest.$ac_objext'
6228   { (eval echo "$as_me:6228: \"$ac_try\"") >&5
6229   (eval $ac_try) 2>&5
6230   ac_status=$?
6231   echo "$as_me:6231: \$? = $ac_status" >&5
6232   (exit $ac_status); }; }; then
6233
6234         cf_cv_term_header="$cf_test"
6235 else
6236   echo "$as_me: failed program was:" >&5
6237 cat conftest.$ac_ext >&5
6238
6239         cf_cv_term_header=unknown
6240
6241 fi
6242 rm -f conftest.$ac_objext conftest.$ac_ext
6243         test "$cf_cv_term_header" != unknown && break
6244 done
6245
6246 fi
6247 echo "$as_me:6247: result: $cf_cv_term_header" >&5
6248 echo "${ECHO_T}$cf_cv_term_header" >&6
6249
6250 # Set definitions to allow ifdef'ing to accommodate subdirectories
6251
6252 case $cf_cv_term_header in
6253 (*term.h)
6254
6255 cat >>confdefs.h <<\EOF
6256 #define HAVE_TERM_H 1
6257 EOF
6258
6259         ;;
6260 esac
6261
6262 case $cf_cv_term_header in
6263 (ncurses/term.h)
6264
6265 cat >>confdefs.h <<\EOF
6266 #define HAVE_NCURSES_TERM_H 1
6267 EOF
6268
6269         ;;
6270 (ncursesw/term.h)
6271
6272 cat >>confdefs.h <<\EOF
6273 #define HAVE_NCURSESW_TERM_H 1
6274 EOF
6275
6276         ;;
6277 esac
6278
6279 echo "$as_me:6279: checking for ncurses version" >&5
6280 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
6281 if test "${cf_cv_ncurses_version+set}" = set; then
6282   echo $ECHO_N "(cached) $ECHO_C" >&6
6283 else
6284
6285         cf_cv_ncurses_version=no
6286         cf_tempfile=out$$
6287         rm -f $cf_tempfile
6288         if test "$cross_compiling" = yes; then
6289
6290         # This will not work if the preprocessor splits the line after the
6291         # Autoconf token.  The 'unproto' program does that.
6292         cat > conftest.$ac_ext <<EOF
6293 #include <${cf_cv_ncurses_header:-curses.h}>
6294 #undef Autoconf
6295 #ifdef NCURSES_VERSION
6296 Autoconf NCURSES_VERSION
6297 #else
6298 #ifdef __NCURSES_H
6299 Autoconf "old"
6300 #endif
6301 ;
6302 #endif
6303 EOF
6304         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
6305         { (eval echo "$as_me:6305: \"$cf_try\"") >&5
6306   (eval $cf_try) 2>&5
6307   ac_status=$?
6308   echo "$as_me:6308: \$? = $ac_status" >&5
6309   (exit $ac_status); }
6310         if test -f conftest.out ; then
6311                 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
6312                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
6313                 rm -f conftest.out
6314         fi
6315
6316 else
6317   cat >conftest.$ac_ext <<_ACEOF
6318 #line 6318 "configure"
6319 #include "confdefs.h"
6320
6321 #include <${cf_cv_ncurses_header:-curses.h}>
6322 #include <stdio.h>
6323 int main(void)
6324 {
6325         FILE *fp = fopen("$cf_tempfile", "w");
6326 #ifdef NCURSES_VERSION
6327 # ifdef NCURSES_VERSION_PATCH
6328         fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
6329 # else
6330         fprintf(fp, "%s\n", NCURSES_VERSION);
6331 # endif
6332 #else
6333 # ifdef __NCURSES_H
6334         fprintf(fp, "old\n");
6335 # else
6336         make an error
6337 # endif
6338 #endif
6339         ${cf_cv_main_return:-return}(0);
6340 }
6341 _ACEOF
6342 rm -f conftest$ac_exeext
6343 if { (eval echo "$as_me:6343: \"$ac_link\"") >&5
6344   (eval $ac_link) 2>&5
6345   ac_status=$?
6346   echo "$as_me:6346: \$? = $ac_status" >&5
6347   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
6348   { (eval echo "$as_me:6348: \"$ac_try\"") >&5
6349   (eval $ac_try) 2>&5
6350   ac_status=$?
6351   echo "$as_me:6351: \$? = $ac_status" >&5
6352   (exit $ac_status); }; }; then
6353
6354         cf_cv_ncurses_version=`cat $cf_tempfile`
6355 else
6356   echo "$as_me: program exited with status $ac_status" >&5
6357 echo "$as_me: failed program was:" >&5
6358 cat conftest.$ac_ext >&5
6359 fi
6360 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
6361 fi
6362         rm -f $cf_tempfile
6363
6364 fi
6365 echo "$as_me:6365: result: $cf_cv_ncurses_version" >&5
6366 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
6367 test "$cf_cv_ncurses_version" = no ||
6368 cat >>confdefs.h <<\EOF
6369 #define NCURSES 1
6370 EOF
6371
6372 echo "$as_me:6372: checking if we have identified curses libraries" >&5
6373 echo $ECHO_N "checking if we have identified curses libraries... $ECHO_C" >&6
6374 cat >conftest.$ac_ext <<_ACEOF
6375 #line 6375 "configure"
6376 #include "confdefs.h"
6377 #include <${cf_cv_ncurses_header:-curses.h}>
6378 int
6379 main (void)
6380 {
6381 initscr(); tgoto("?", 0,0)
6382   ;
6383   return 0;
6384 }
6385 _ACEOF
6386 rm -f conftest.$ac_objext conftest$ac_exeext
6387 if { (eval echo "$as_me:6387: \"$ac_link\"") >&5
6388   (eval $ac_link) 2>&5
6389   ac_status=$?
6390   echo "$as_me:6390: \$? = $ac_status" >&5
6391   (exit $ac_status); } &&
6392          { ac_try='test -s conftest$ac_exeext'
6393   { (eval echo "$as_me:6393: \"$ac_try\"") >&5
6394   (eval $ac_try) 2>&5
6395   ac_status=$?
6396   echo "$as_me:6396: \$? = $ac_status" >&5
6397   (exit $ac_status); }; }; then
6398   cf_result=yes
6399 else
6400   echo "$as_me: failed program was:" >&5
6401 cat conftest.$ac_ext >&5
6402 cf_result=no
6403 fi
6404 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6405 echo "$as_me:6405: result: $cf_result" >&5
6406 echo "${ECHO_T}$cf_result" >&6
6407
6408 if test "$cf_result" = no ; then
6409 case $host_os in
6410 (freebsd*)
6411         echo "$as_me:6411: checking for tgoto in -lmytinfo" >&5
6412 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
6413 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
6414   echo $ECHO_N "(cached) $ECHO_C" >&6
6415 else
6416   ac_check_lib_save_LIBS=$LIBS
6417 LIBS="-lmytinfo  $LIBS"
6418 cat >conftest.$ac_ext <<_ACEOF
6419 #line 6419 "configure"
6420 #include "confdefs.h"
6421
6422 /* Override any gcc2 internal prototype to avoid an error.  */
6423 #ifdef __cplusplus
6424 extern "C"
6425 #endif
6426 /* We use char because int might match the return type of a gcc2
6427    builtin and then its argument prototype would still apply.  */
6428 char tgoto ();
6429 int
6430 main (void)
6431 {
6432 tgoto ();
6433   ;
6434   return 0;
6435 }
6436 _ACEOF
6437 rm -f conftest.$ac_objext conftest$ac_exeext
6438 if { (eval echo "$as_me:6438: \"$ac_link\"") >&5
6439   (eval $ac_link) 2>&5
6440   ac_status=$?
6441   echo "$as_me:6441: \$? = $ac_status" >&5
6442   (exit $ac_status); } &&
6443          { ac_try='test -s conftest$ac_exeext'
6444   { (eval echo "$as_me:6444: \"$ac_try\"") >&5
6445   (eval $ac_try) 2>&5
6446   ac_status=$?
6447   echo "$as_me:6447: \$? = $ac_status" >&5
6448   (exit $ac_status); }; }; then
6449   ac_cv_lib_mytinfo_tgoto=yes
6450 else
6451   echo "$as_me: failed program was:" >&5
6452 cat conftest.$ac_ext >&5
6453 ac_cv_lib_mytinfo_tgoto=no
6454 fi
6455 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6456 LIBS=$ac_check_lib_save_LIBS
6457 fi
6458 echo "$as_me:6458: result: $ac_cv_lib_mytinfo_tgoto" >&5
6459 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
6460 if test $ac_cv_lib_mytinfo_tgoto = yes; then
6461
6462 cf_add_libs="$LIBS"
6463 # reverse order
6464 cf_add_0lib=
6465 for cf_add_1lib in -lmytinfo; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
6466 # filter duplicates
6467 for cf_add_1lib in $cf_add_0lib; do
6468         for cf_add_2lib in $cf_add_libs; do
6469                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
6470                         cf_add_1lib=
6471                         break
6472                 fi
6473         done
6474         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
6475 done
6476 LIBS="$cf_add_libs"
6477
6478 fi
6479
6480         ;;
6481 (hpux10.*)
6482         # Looking at HPUX 10.20, the Hcurses library is the oldest (1997), cur_colr
6483         # next (1998), and xcurses "newer" (2000).  There is no header file for
6484         # Hcurses; the subdirectory curses_colr has the headers (curses.h and
6485         # term.h) for cur_colr
6486         if test "x$cf_cv_screen" = "xcurses_colr"
6487         then
6488                 echo "$as_me:6488: checking for initscr in -lcur_colr" >&5
6489 echo $ECHO_N "checking for initscr in -lcur_colr... $ECHO_C" >&6
6490 if test "${ac_cv_lib_cur_colr_initscr+set}" = set; then
6491   echo $ECHO_N "(cached) $ECHO_C" >&6
6492 else
6493   ac_check_lib_save_LIBS=$LIBS
6494 LIBS="-lcur_colr  $LIBS"
6495 cat >conftest.$ac_ext <<_ACEOF
6496 #line 6496 "configure"
6497 #include "confdefs.h"
6498
6499 /* Override any gcc2 internal prototype to avoid an error.  */
6500 #ifdef __cplusplus
6501 extern "C"
6502 #endif
6503 /* We use char because int might match the return type of a gcc2
6504    builtin and then its argument prototype would still apply.  */
6505 char initscr ();
6506 int
6507 main (void)
6508 {
6509 initscr ();
6510   ;
6511   return 0;
6512 }
6513 _ACEOF
6514 rm -f conftest.$ac_objext conftest$ac_exeext
6515 if { (eval echo "$as_me:6515: \"$ac_link\"") >&5
6516   (eval $ac_link) 2>&5
6517   ac_status=$?
6518   echo "$as_me:6518: \$? = $ac_status" >&5
6519   (exit $ac_status); } &&
6520          { ac_try='test -s conftest$ac_exeext'
6521   { (eval echo "$as_me:6521: \"$ac_try\"") >&5
6522   (eval $ac_try) 2>&5
6523   ac_status=$?
6524   echo "$as_me:6524: \$? = $ac_status" >&5
6525   (exit $ac_status); }; }; then
6526   ac_cv_lib_cur_colr_initscr=yes
6527 else
6528   echo "$as_me: failed program was:" >&5
6529 cat conftest.$ac_ext >&5
6530 ac_cv_lib_cur_colr_initscr=no
6531 fi
6532 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6533 LIBS=$ac_check_lib_save_LIBS
6534 fi
6535 echo "$as_me:6535: result: $ac_cv_lib_cur_colr_initscr" >&5
6536 echo "${ECHO_T}$ac_cv_lib_cur_colr_initscr" >&6
6537 if test $ac_cv_lib_cur_colr_initscr = yes; then
6538
6539 cf_add_libs="$LIBS"
6540 # reverse order
6541 cf_add_0lib=
6542 for cf_add_1lib in -lcur_colr; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
6543 # filter duplicates
6544 for cf_add_1lib in $cf_add_0lib; do
6545         for cf_add_2lib in $cf_add_libs; do
6546                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
6547                         cf_add_1lib=
6548                         break
6549                 fi
6550         done
6551         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
6552 done
6553 LIBS="$cf_add_libs"
6554
6555                         ac_cv_func_initscr=yes
6556
6557 else
6558
6559                 echo "$as_me:6559: checking for initscr in -lHcurses" >&5
6560 echo $ECHO_N "checking for initscr in -lHcurses... $ECHO_C" >&6
6561 if test "${ac_cv_lib_Hcurses_initscr+set}" = set; then
6562   echo $ECHO_N "(cached) $ECHO_C" >&6
6563 else
6564   ac_check_lib_save_LIBS=$LIBS
6565 LIBS="-lHcurses  $LIBS"
6566 cat >conftest.$ac_ext <<_ACEOF
6567 #line 6567 "configure"
6568 #include "confdefs.h"
6569
6570 /* Override any gcc2 internal prototype to avoid an error.  */
6571 #ifdef __cplusplus
6572 extern "C"
6573 #endif
6574 /* We use char because int might match the return type of a gcc2
6575    builtin and then its argument prototype would still apply.  */
6576 char initscr ();
6577 int
6578 main (void)
6579 {
6580 initscr ();
6581   ;
6582   return 0;
6583 }
6584 _ACEOF
6585 rm -f conftest.$ac_objext conftest$ac_exeext
6586 if { (eval echo "$as_me:6586: \"$ac_link\"") >&5
6587   (eval $ac_link) 2>&5
6588   ac_status=$?
6589   echo "$as_me:6589: \$? = $ac_status" >&5
6590   (exit $ac_status); } &&
6591          { ac_try='test -s conftest$ac_exeext'
6592   { (eval echo "$as_me:6592: \"$ac_try\"") >&5
6593   (eval $ac_try) 2>&5
6594   ac_status=$?
6595   echo "$as_me:6595: \$? = $ac_status" >&5
6596   (exit $ac_status); }; }; then
6597   ac_cv_lib_Hcurses_initscr=yes
6598 else
6599   echo "$as_me: failed program was:" >&5
6600 cat conftest.$ac_ext >&5
6601 ac_cv_lib_Hcurses_initscr=no
6602 fi
6603 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6604 LIBS=$ac_check_lib_save_LIBS
6605 fi
6606 echo "$as_me:6606: result: $ac_cv_lib_Hcurses_initscr" >&5
6607 echo "${ECHO_T}$ac_cv_lib_Hcurses_initscr" >&6
6608 if test $ac_cv_lib_Hcurses_initscr = yes; then
6609
6610                         # HP's header uses __HP_CURSES, but user claims _HP_CURSES.
6611
6612 cf_add_libs="$LIBS"
6613 # reverse order
6614 cf_add_0lib=
6615 for cf_add_1lib in -lHcurses; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
6616 # filter duplicates
6617 for cf_add_1lib in $cf_add_0lib; do
6618         for cf_add_2lib in $cf_add_libs; do
6619                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
6620                         cf_add_1lib=
6621                         break
6622                 fi
6623         done
6624         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
6625 done
6626 LIBS="$cf_add_libs"
6627
6628         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
6629         CPPFLAGS="${CPPFLAGS}-D__HP_CURSES -D_HP_CURSES"
6630
6631                         ac_cv_func_initscr=yes
6632
6633 fi
6634
6635 fi
6636
6637         fi
6638         ;;
6639 (linux*)
6640         case `arch 2>/dev/null` in
6641         (x86_64)
6642                 if test -d /lib64
6643                 then
6644
6645 if test -n "/lib64" ; then
6646         for cf_add_libdir in /lib64
6647         do
6648                 if test $cf_add_libdir = /usr/lib ; then
6649                         :
6650                 elif test -d $cf_add_libdir
6651                 then
6652                         cf_have_libdir=no
6653                         if test -n "$LDFLAGS$LIBS" ; then
6654                                 # a loop is needed to ensure we can add subdirs of existing dirs
6655                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
6656                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
6657                                                 cf_have_libdir=yes; break
6658                                         fi
6659                                 done
6660                         fi
6661                         if test "$cf_have_libdir" = no ; then
6662                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
6663
6664 echo "${as_me:-configure}:6664: testing adding $cf_add_libdir to library-path ..." 1>&5
6665
6666                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
6667                         fi
6668                 fi
6669         done
6670 fi
6671
6672                 else
6673
6674 if test -n "/lib" ; then
6675         for cf_add_libdir in /lib
6676         do
6677                 if test $cf_add_libdir = /usr/lib ; then
6678                         :
6679                 elif test -d $cf_add_libdir
6680                 then
6681                         cf_have_libdir=no
6682                         if test -n "$LDFLAGS$LIBS" ; then
6683                                 # a loop is needed to ensure we can add subdirs of existing dirs
6684                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
6685                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
6686                                                 cf_have_libdir=yes; break
6687                                         fi
6688                                 done
6689                         fi
6690                         if test "$cf_have_libdir" = no ; then
6691                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
6692
6693 echo "${as_me:-configure}:6693: testing adding $cf_add_libdir to library-path ..." 1>&5
6694
6695                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
6696                         fi
6697                 fi
6698         done
6699 fi
6700
6701                 fi
6702                 ;;
6703         (*)
6704
6705 if test -n "/lib" ; then
6706         for cf_add_libdir in /lib
6707         do
6708                 if test $cf_add_libdir = /usr/lib ; then
6709                         :
6710                 elif test -d $cf_add_libdir
6711                 then
6712                         cf_have_libdir=no
6713                         if test -n "$LDFLAGS$LIBS" ; then
6714                                 # a loop is needed to ensure we can add subdirs of existing dirs
6715                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
6716                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
6717                                                 cf_have_libdir=yes; break
6718                                         fi
6719                                 done
6720                         fi
6721                         if test "$cf_have_libdir" = no ; then
6722                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
6723
6724 echo "${as_me:-configure}:6724: testing adding $cf_add_libdir to library-path ..." 1>&5
6725
6726                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
6727                         fi
6728                 fi
6729         done
6730 fi
6731
6732                 ;;
6733         esac
6734         ;;
6735 (sunos3*|sunos4*)
6736         if test "x$cf_cv_screen" = "xcurses_5lib"
6737         then
6738                 if test -d /usr/5lib ; then
6739
6740 if test -n "/usr/5lib" ; then
6741         for cf_add_libdir in /usr/5lib
6742         do
6743                 if test $cf_add_libdir = /usr/lib ; then
6744                         :
6745                 elif test -d $cf_add_libdir
6746                 then
6747                         cf_have_libdir=no
6748                         if test -n "$LDFLAGS$LIBS" ; then
6749                                 # a loop is needed to ensure we can add subdirs of existing dirs
6750                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
6751                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
6752                                                 cf_have_libdir=yes; break
6753                                         fi
6754                                 done
6755                         fi
6756                         if test "$cf_have_libdir" = no ; then
6757                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
6758
6759 echo "${as_me:-configure}:6759: testing adding $cf_add_libdir to library-path ..." 1>&5
6760
6761                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
6762                         fi
6763                 fi
6764         done
6765 fi
6766
6767 cf_add_libs="$LIBS"
6768 # reverse order
6769 cf_add_0lib=
6770 for cf_add_1lib in -lcurses -ltermcap; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
6771 # filter duplicates
6772 for cf_add_1lib in $cf_add_0lib; do
6773         for cf_add_2lib in $cf_add_libs; do
6774                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
6775                         cf_add_1lib=
6776                         break
6777                 fi
6778         done
6779         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
6780 done
6781 LIBS="$cf_add_libs"
6782
6783                 fi
6784         fi
6785         ac_cv_func_initscr=yes
6786         ;;
6787 esac
6788
6789 if test ".$ac_cv_func_initscr" != .yes ; then
6790         cf_save_LIBS="$LIBS"
6791
6792         if test ".${cf_cv_ncurses_version:-no}" != .no
6793         then
6794                 cf_check_list="ncurses curses cursesX"
6795         else
6796                 cf_check_list="cursesX curses ncurses"
6797         fi
6798
6799         # Check for library containing tgoto.  Do this before curses library
6800         # because it may be needed to link the test-case for initscr.
6801         if test "x$cf_term_lib" = x
6802         then
6803                 echo "$as_me:6803: checking for tgoto" >&5
6804 echo $ECHO_N "checking for tgoto... $ECHO_C" >&6
6805 if test "${ac_cv_func_tgoto+set}" = set; then
6806   echo $ECHO_N "(cached) $ECHO_C" >&6
6807 else
6808   cat >conftest.$ac_ext <<_ACEOF
6809 #line 6809 "configure"
6810 #include "confdefs.h"
6811 #define tgoto autoconf_temporary
6812 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
6813 #undef tgoto
6814
6815 #ifdef __cplusplus
6816 extern "C"
6817 #endif
6818
6819 /* We use char because int might match the return type of a gcc2
6820    builtin and then its argument prototype would still apply.  */
6821 char tgoto (void);
6822
6823 int
6824 main (void)
6825 {
6826
6827 /* The GNU C library defines stubs for functions which it implements
6828     to always fail with ENOSYS.  Some functions are actually named
6829     something starting with __ and the normal name is an alias.  */
6830 #if defined (__stub_tgoto) || defined (__stub___tgoto)
6831 #error found stub for tgoto
6832 #endif
6833
6834         return tgoto ();
6835   ;
6836   return 0;
6837 }
6838 _ACEOF
6839 rm -f conftest.$ac_objext conftest$ac_exeext
6840 if { (eval echo "$as_me:6840: \"$ac_link\"") >&5
6841   (eval $ac_link) 2>&5
6842   ac_status=$?
6843   echo "$as_me:6843: \$? = $ac_status" >&5
6844   (exit $ac_status); } &&
6845          { ac_try='test -s conftest$ac_exeext'
6846   { (eval echo "$as_me:6846: \"$ac_try\"") >&5
6847   (eval $ac_try) 2>&5
6848   ac_status=$?
6849   echo "$as_me:6849: \$? = $ac_status" >&5
6850   (exit $ac_status); }; }; then
6851   ac_cv_func_tgoto=yes
6852 else
6853   echo "$as_me: failed program was:" >&5
6854 cat conftest.$ac_ext >&5
6855 ac_cv_func_tgoto=no
6856 fi
6857 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6858 fi
6859 echo "$as_me:6859: result: $ac_cv_func_tgoto" >&5
6860 echo "${ECHO_T}$ac_cv_func_tgoto" >&6
6861 if test $ac_cv_func_tgoto = yes; then
6862   cf_term_lib=predefined
6863 else
6864
6865                         for cf_term_lib in $cf_check_list otermcap termcap tinfo termlib unknown
6866                         do
6867                                 as_ac_Lib=`echo "ac_cv_lib_$cf_term_lib''_tgoto" | $as_tr_sh`
6868 echo "$as_me:6868: checking for tgoto in -l$cf_term_lib" >&5
6869 echo $ECHO_N "checking for tgoto in -l$cf_term_lib... $ECHO_C" >&6
6870 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
6871   echo $ECHO_N "(cached) $ECHO_C" >&6
6872 else
6873   ac_check_lib_save_LIBS=$LIBS
6874 LIBS="-l$cf_term_lib  $LIBS"
6875 cat >conftest.$ac_ext <<_ACEOF
6876 #line 6876 "configure"
6877 #include "confdefs.h"
6878
6879 /* Override any gcc2 internal prototype to avoid an error.  */
6880 #ifdef __cplusplus
6881 extern "C"
6882 #endif
6883 /* We use char because int might match the return type of a gcc2
6884    builtin and then its argument prototype would still apply.  */
6885 char tgoto ();
6886 int
6887 main (void)
6888 {
6889 tgoto ();
6890   ;
6891   return 0;
6892 }
6893 _ACEOF
6894 rm -f conftest.$ac_objext conftest$ac_exeext
6895 if { (eval echo "$as_me:6895: \"$ac_link\"") >&5
6896   (eval $ac_link) 2>&5
6897   ac_status=$?
6898   echo "$as_me:6898: \$? = $ac_status" >&5
6899   (exit $ac_status); } &&
6900          { ac_try='test -s conftest$ac_exeext'
6901   { (eval echo "$as_me:6901: \"$ac_try\"") >&5
6902   (eval $ac_try) 2>&5
6903   ac_status=$?
6904   echo "$as_me:6904: \$? = $ac_status" >&5
6905   (exit $ac_status); }; }; then
6906   eval "$as_ac_Lib=yes"
6907 else
6908   echo "$as_me: failed program was:" >&5
6909 cat conftest.$ac_ext >&5
6910 eval "$as_ac_Lib=no"
6911 fi
6912 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6913 LIBS=$ac_check_lib_save_LIBS
6914 fi
6915 echo "$as_me:6915: result: `eval echo '${'$as_ac_Lib'}'`" >&5
6916 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
6917 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
6918
6919                                         : ${cf_nculib_root:=$cf_term_lib}
6920                                         break
6921
6922 fi
6923
6924                         done
6925
6926 fi
6927
6928         fi
6929
6930         # Check for library containing initscr
6931         test "$cf_term_lib" != predefined && test "$cf_term_lib" != unknown && LIBS="-l$cf_term_lib $cf_save_LIBS"
6932         if test "x$cf_curs_lib" = x
6933         then
6934                 for cf_curs_lib in $cf_check_list xcurses jcurses pdcurses unknown
6935                 do
6936                         LIBS="-l$cf_curs_lib $cf_save_LIBS"
6937                         if test "$cf_term_lib" = unknown || test "$cf_term_lib" = "$cf_curs_lib" ; then
6938                                 echo "$as_me:6938: checking if we can link with $cf_curs_lib library" >&5
6939 echo $ECHO_N "checking if we can link with $cf_curs_lib library... $ECHO_C" >&6
6940                                 cat >conftest.$ac_ext <<_ACEOF
6941 #line 6941 "configure"
6942 #include "confdefs.h"
6943 #include <${cf_cv_ncurses_header:-curses.h}>
6944 int
6945 main (void)
6946 {
6947 initscr()
6948   ;
6949   return 0;
6950 }
6951 _ACEOF
6952 rm -f conftest.$ac_objext conftest$ac_exeext
6953 if { (eval echo "$as_me:6953: \"$ac_link\"") >&5
6954   (eval $ac_link) 2>&5
6955   ac_status=$?
6956   echo "$as_me:6956: \$? = $ac_status" >&5
6957   (exit $ac_status); } &&
6958          { ac_try='test -s conftest$ac_exeext'
6959   { (eval echo "$as_me:6959: \"$ac_try\"") >&5
6960   (eval $ac_try) 2>&5
6961   ac_status=$?
6962   echo "$as_me:6962: \$? = $ac_status" >&5
6963   (exit $ac_status); }; }; then
6964   cf_result=yes
6965 else
6966   echo "$as_me: failed program was:" >&5
6967 cat conftest.$ac_ext >&5
6968 cf_result=no
6969 fi
6970 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6971                                 echo "$as_me:6971: result: $cf_result" >&5
6972 echo "${ECHO_T}$cf_result" >&6
6973                                 test $cf_result = yes && break
6974                         elif test "$cf_curs_lib" = "$cf_term_lib" ; then
6975                                 cf_result=no
6976                         elif test "$cf_term_lib" != predefined ; then
6977                                 echo "$as_me:6977: checking if we need both $cf_curs_lib and $cf_term_lib libraries" >&5
6978 echo $ECHO_N "checking if we need both $cf_curs_lib and $cf_term_lib libraries... $ECHO_C" >&6
6979                                 cat >conftest.$ac_ext <<_ACEOF
6980 #line 6980 "configure"
6981 #include "confdefs.h"
6982 #include <${cf_cv_ncurses_header:-curses.h}>
6983 int
6984 main (void)
6985 {
6986 initscr(); tgoto((char *)0, 0, 0);
6987   ;
6988   return 0;
6989 }
6990 _ACEOF
6991 rm -f conftest.$ac_objext conftest$ac_exeext
6992 if { (eval echo "$as_me:6992: \"$ac_link\"") >&5
6993   (eval $ac_link) 2>&5
6994   ac_status=$?
6995   echo "$as_me:6995: \$? = $ac_status" >&5
6996   (exit $ac_status); } &&
6997          { ac_try='test -s conftest$ac_exeext'
6998   { (eval echo "$as_me:6998: \"$ac_try\"") >&5
6999   (eval $ac_try) 2>&5
7000   ac_status=$?
7001   echo "$as_me:7001: \$? = $ac_status" >&5
7002   (exit $ac_status); }; }; then
7003   cf_result=no
7004 else
7005   echo "$as_me: failed program was:" >&5
7006 cat conftest.$ac_ext >&5
7007
7008                                         LIBS="-l$cf_curs_lib -l$cf_term_lib $cf_save_LIBS"
7009                                         cat >conftest.$ac_ext <<_ACEOF
7010 #line 7010 "configure"
7011 #include "confdefs.h"
7012 #include <${cf_cv_ncurses_header:-curses.h}>
7013 int
7014 main (void)
7015 {
7016 initscr()
7017   ;
7018   return 0;
7019 }
7020 _ACEOF
7021 rm -f conftest.$ac_objext conftest$ac_exeext
7022 if { (eval echo "$as_me:7022: \"$ac_link\"") >&5
7023   (eval $ac_link) 2>&5
7024   ac_status=$?
7025   echo "$as_me:7025: \$? = $ac_status" >&5
7026   (exit $ac_status); } &&
7027          { ac_try='test -s conftest$ac_exeext'
7028   { (eval echo "$as_me:7028: \"$ac_try\"") >&5
7029   (eval $ac_try) 2>&5
7030   ac_status=$?
7031   echo "$as_me:7031: \$? = $ac_status" >&5
7032   (exit $ac_status); }; }; then
7033   cf_result=yes
7034 else
7035   echo "$as_me: failed program was:" >&5
7036 cat conftest.$ac_ext >&5
7037 cf_result=error
7038 fi
7039 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7040
7041 fi
7042 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7043                                 echo "$as_me:7043: result: $cf_result" >&5
7044 echo "${ECHO_T}$cf_result" >&6
7045                                 test $cf_result != error && break
7046                         fi
7047                 done
7048         fi
7049         test $cf_curs_lib = unknown && { { echo "$as_me:7049: error: no curses library found" >&5
7050 echo "$as_me: error: no curses library found" >&2;}
7051    { (exit 1); exit 1; }; }
7052 fi
7053 fi
7054
7055         ;;
7056 (ncursesw*)
7057
7058 echo "$as_me:7058: checking for multibyte character support" >&5
7059 echo $ECHO_N "checking for multibyte character support... $ECHO_C" >&6
7060 if test "${cf_cv_utf8_lib+set}" = set; then
7061   echo $ECHO_N "(cached) $ECHO_C" >&6
7062 else
7063
7064         cf_save_LIBS="$LIBS"
7065         cat >conftest.$ac_ext <<_ACEOF
7066 #line 7066 "configure"
7067 #include "confdefs.h"
7068
7069 #include <stdlib.h>
7070 int
7071 main (void)
7072 {
7073 putwc(0,0);
7074   ;
7075   return 0;
7076 }
7077 _ACEOF
7078 rm -f conftest.$ac_objext conftest$ac_exeext
7079 if { (eval echo "$as_me:7079: \"$ac_link\"") >&5
7080   (eval $ac_link) 2>&5
7081   ac_status=$?
7082   echo "$as_me:7082: \$? = $ac_status" >&5
7083   (exit $ac_status); } &&
7084          { ac_try='test -s conftest$ac_exeext'
7085   { (eval echo "$as_me:7085: \"$ac_try\"") >&5
7086   (eval $ac_try) 2>&5
7087   ac_status=$?
7088   echo "$as_me:7088: \$? = $ac_status" >&5
7089   (exit $ac_status); }; }; then
7090   cf_cv_utf8_lib=yes
7091 else
7092   echo "$as_me: failed program was:" >&5
7093 cat conftest.$ac_ext >&5
7094
7095 # If the linkage is not already in the $CPPFLAGS/$LDFLAGS configuration, these
7096 # will be set on completion of the AC_TRY_LINK below.
7097 cf_cv_header_path_utf8=
7098 cf_cv_library_path_utf8=
7099
7100 echo "${as_me:-configure}:7100: testing Starting FIND_LINKAGE(utf8,) ..." 1>&5
7101
7102 cf_save_LIBS="$LIBS"
7103
7104 cat >conftest.$ac_ext <<_ACEOF
7105 #line 7105 "configure"
7106 #include "confdefs.h"
7107
7108 #include <libutf8.h>
7109 int
7110 main (void)
7111 {
7112 putwc(0,0);
7113   ;
7114   return 0;
7115 }
7116 _ACEOF
7117 rm -f conftest.$ac_objext conftest$ac_exeext
7118 if { (eval echo "$as_me:7118: \"$ac_link\"") >&5
7119   (eval $ac_link) 2>&5
7120   ac_status=$?
7121   echo "$as_me:7121: \$? = $ac_status" >&5
7122   (exit $ac_status); } &&
7123          { ac_try='test -s conftest$ac_exeext'
7124   { (eval echo "$as_me:7124: \"$ac_try\"") >&5
7125   (eval $ac_try) 2>&5
7126   ac_status=$?
7127   echo "$as_me:7127: \$? = $ac_status" >&5
7128   (exit $ac_status); }; }; then
7129
7130         cf_cv_find_linkage_utf8=yes
7131         cf_cv_header_path_utf8=/usr/include
7132         cf_cv_library_path_utf8=/usr/lib
7133
7134 else
7135   echo "$as_me: failed program was:" >&5
7136 cat conftest.$ac_ext >&5
7137
7138 LIBS="-lutf8  $cf_save_LIBS"
7139
7140 cat >conftest.$ac_ext <<_ACEOF
7141 #line 7141 "configure"
7142 #include "confdefs.h"
7143
7144 #include <libutf8.h>
7145 int
7146 main (void)
7147 {
7148 putwc(0,0);
7149   ;
7150   return 0;
7151 }
7152 _ACEOF
7153 rm -f conftest.$ac_objext conftest$ac_exeext
7154 if { (eval echo "$as_me:7154: \"$ac_link\"") >&5
7155   (eval $ac_link) 2>&5
7156   ac_status=$?
7157   echo "$as_me:7157: \$? = $ac_status" >&5
7158   (exit $ac_status); } &&
7159          { ac_try='test -s conftest$ac_exeext'
7160   { (eval echo "$as_me:7160: \"$ac_try\"") >&5
7161   (eval $ac_try) 2>&5
7162   ac_status=$?
7163   echo "$as_me:7163: \$? = $ac_status" >&5
7164   (exit $ac_status); }; }; then
7165
7166         cf_cv_find_linkage_utf8=yes
7167         cf_cv_header_path_utf8=/usr/include
7168         cf_cv_library_path_utf8=/usr/lib
7169         cf_cv_library_file_utf8="-lutf8"
7170
7171 else
7172   echo "$as_me: failed program was:" >&5
7173 cat conftest.$ac_ext >&5
7174
7175         cf_cv_find_linkage_utf8=no
7176         LIBS="$cf_save_LIBS"
7177
7178         test -n "$verbose" && echo "    find linkage for utf8 library" 1>&6
7179
7180 echo "${as_me:-configure}:7180: testing find linkage for utf8 library ..." 1>&5
7181
7182 echo "${as_me:-configure}:7182: testing Searching for headers in FIND_LINKAGE(utf8,) ..." 1>&5
7183
7184         cf_save_CPPFLAGS="$CPPFLAGS"
7185         cf_test_CPPFLAGS="$CPPFLAGS"
7186
7187 cf_search=
7188
7189 # collect the current set of include-directories from compiler flags
7190 cf_header_path_list=""
7191 if test -n "${CFLAGS}${CPPFLAGS}" ; then
7192         for cf_header_path in $CPPFLAGS $CFLAGS
7193         do
7194                 case $cf_header_path in
7195                 (-I*)
7196                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
7197
7198 test "x$cf_header_path" != "xNONE" && \
7199 test -d "$cf_header_path" && \
7200  {
7201         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
7202         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
7203         test -d $cf_header_path/include/utf8 &&       cf_search="$cf_search $cf_header_path/include/utf8"
7204         test -d $cf_header_path/include/utf8/include &&    cf_search="$cf_search $cf_header_path/include/utf8/include"
7205         test -d $cf_header_path/utf8/include &&       cf_search="$cf_search $cf_header_path/utf8/include"
7206         test -d $cf_header_path/utf8/include/utf8 &&    cf_search="$cf_search $cf_header_path/utf8/include/utf8"
7207 }
7208
7209                         cf_header_path_list="$cf_header_path_list $cf_search"
7210                         ;;
7211                 esac
7212         done
7213 fi
7214
7215 # add the variations for the package we are looking for
7216
7217 cf_search=
7218
7219 test "x$prefix" != "xNONE" && \
7220 test -d "$prefix" && \
7221  {
7222         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
7223         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
7224         test -d $prefix/include/utf8 &&       cf_search="$cf_search $prefix/include/utf8"
7225         test -d $prefix/include/utf8/include &&    cf_search="$cf_search $prefix/include/utf8/include"
7226         test -d $prefix/utf8/include &&       cf_search="$cf_search $prefix/utf8/include"
7227         test -d $prefix/utf8/include/utf8 &&    cf_search="$cf_search $prefix/utf8/include/utf8"
7228 }
7229
7230 for cf_subdir_prefix in \
7231         /usr \
7232         /usr/local \
7233         /usr/pkg \
7234         /opt \
7235         /opt/local \
7236         $HOME
7237 do
7238
7239 test "x$cf_subdir_prefix" != "x$prefix" && \
7240 test -d "$cf_subdir_prefix" && \
7241 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
7242         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
7243         test -d $cf_subdir_prefix/include &&          cf_search="$cf_search $cf_subdir_prefix/include"
7244         test -d $cf_subdir_prefix/include/utf8 &&       cf_search="$cf_search $cf_subdir_prefix/include/utf8"
7245         test -d $cf_subdir_prefix/include/utf8/include &&    cf_search="$cf_search $cf_subdir_prefix/include/utf8/include"
7246         test -d $cf_subdir_prefix/utf8/include &&       cf_search="$cf_search $cf_subdir_prefix/utf8/include"
7247         test -d $cf_subdir_prefix/utf8/include/utf8 &&    cf_search="$cf_search $cf_subdir_prefix/utf8/include/utf8"
7248 }
7249
7250 done
7251
7252 test "$includedir" != NONE && \
7253 test "$includedir" != "/usr/include" && \
7254 test -d "$includedir" && {
7255         test -d $includedir &&    cf_search="$cf_search $includedir"
7256         test -d $includedir/utf8 && cf_search="$cf_search $includedir/utf8"
7257 }
7258
7259 test "$oldincludedir" != NONE && \
7260 test "$oldincludedir" != "/usr/include" && \
7261 test -d "$oldincludedir" && {
7262         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
7263         test -d $oldincludedir/utf8 && cf_search="$cf_search $oldincludedir/utf8"
7264 }
7265
7266 cf_search="$cf_search $cf_header_path_list"
7267
7268         for cf_cv_header_path_utf8 in $cf_search
7269         do
7270                 if test -d $cf_cv_header_path_utf8 ; then
7271                         test -n "$verbose" && echo "    ... testing $cf_cv_header_path_utf8" 1>&6
7272
7273 echo "${as_me:-configure}:7273: testing ... testing $cf_cv_header_path_utf8 ..." 1>&5
7274
7275                         CPPFLAGS="$cf_save_CPPFLAGS"
7276
7277         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
7278         CPPFLAGS="${CPPFLAGS}-I$cf_cv_header_path_utf8"
7279
7280                         cat >conftest.$ac_ext <<_ACEOF
7281 #line 7281 "configure"
7282 #include "confdefs.h"
7283
7284 #include <libutf8.h>
7285 int
7286 main (void)
7287 {
7288 putwc(0,0);
7289   ;
7290   return 0;
7291 }
7292 _ACEOF
7293 rm -f conftest.$ac_objext
7294 if { (eval echo "$as_me:7294: \"$ac_compile\"") >&5
7295   (eval $ac_compile) 2>&5
7296   ac_status=$?
7297   echo "$as_me:7297: \$? = $ac_status" >&5
7298   (exit $ac_status); } &&
7299          { ac_try='test -s conftest.$ac_objext'
7300   { (eval echo "$as_me:7300: \"$ac_try\"") >&5
7301   (eval $ac_try) 2>&5
7302   ac_status=$?
7303   echo "$as_me:7303: \$? = $ac_status" >&5
7304   (exit $ac_status); }; }; then
7305
7306                                 test -n "$verbose" && echo "    ... found utf8 headers in $cf_cv_header_path_utf8" 1>&6
7307
7308 echo "${as_me:-configure}:7308: testing ... found utf8 headers in $cf_cv_header_path_utf8 ..." 1>&5
7309
7310                                 cf_cv_find_linkage_utf8=maybe
7311                                 cf_test_CPPFLAGS="$CPPFLAGS"
7312                                 break
7313 else
7314   echo "$as_me: failed program was:" >&5
7315 cat conftest.$ac_ext >&5
7316
7317                                 CPPFLAGS="$cf_save_CPPFLAGS"
7318
7319 fi
7320 rm -f conftest.$ac_objext conftest.$ac_ext
7321                 fi
7322         done
7323
7324         if test "$cf_cv_find_linkage_utf8" = maybe ; then
7325
7326 echo "${as_me:-configure}:7326: testing Searching for utf8 library in FIND_LINKAGE(utf8,) ..." 1>&5
7327
7328                 cf_save_LIBS="$LIBS"
7329                 cf_save_LDFLAGS="$LDFLAGS"
7330
7331                 if test "$cf_cv_find_linkage_utf8" != yes ; then
7332
7333 cf_search=
7334 cf_library_path_list=""
7335 if test -n "${LDFLAGS}${LIBS}" ; then
7336         for cf_library_path in $LDFLAGS $LIBS
7337         do
7338                 case $cf_library_path in
7339                 (-L*)
7340                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
7341
7342 test "x$cf_library_path" != "xNONE" && \
7343 test -d "$cf_library_path" && \
7344  {
7345         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
7346         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
7347         test -d $cf_library_path/lib/utf8 &&       cf_search="$cf_search $cf_library_path/lib/utf8"
7348         test -d $cf_library_path/lib/utf8/lib &&    cf_search="$cf_search $cf_library_path/lib/utf8/lib"
7349         test -d $cf_library_path/utf8/lib &&       cf_search="$cf_search $cf_library_path/utf8/lib"
7350         test -d $cf_library_path/utf8/lib/utf8 &&    cf_search="$cf_search $cf_library_path/utf8/lib/utf8"
7351 }
7352
7353                         cf_library_path_list="$cf_library_path_list $cf_search"
7354                         ;;
7355                 esac
7356         done
7357 fi
7358
7359 cf_search=
7360
7361 test "x$prefix" != "xNONE" && \
7362 test -d "$prefix" && \
7363  {
7364         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
7365         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
7366         test -d $prefix/lib/utf8 &&       cf_search="$cf_search $prefix/lib/utf8"
7367         test -d $prefix/lib/utf8/lib &&    cf_search="$cf_search $prefix/lib/utf8/lib"
7368         test -d $prefix/utf8/lib &&       cf_search="$cf_search $prefix/utf8/lib"
7369         test -d $prefix/utf8/lib/utf8 &&    cf_search="$cf_search $prefix/utf8/lib/utf8"
7370 }
7371
7372 for cf_subdir_prefix in \
7373         /usr \
7374         /usr/local \
7375         /usr/pkg \
7376         /opt \
7377         /opt/local \
7378         $HOME
7379 do
7380
7381 test "x$cf_subdir_prefix" != "x$prefix" && \
7382 test -d "$cf_subdir_prefix" && \
7383 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
7384         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
7385         test -d $cf_subdir_prefix/lib &&          cf_search="$cf_search $cf_subdir_prefix/lib"
7386         test -d $cf_subdir_prefix/lib/utf8 &&       cf_search="$cf_search $cf_subdir_prefix/lib/utf8"
7387         test -d $cf_subdir_prefix/lib/utf8/lib &&    cf_search="$cf_search $cf_subdir_prefix/lib/utf8/lib"
7388         test -d $cf_subdir_prefix/utf8/lib &&       cf_search="$cf_search $cf_subdir_prefix/utf8/lib"
7389         test -d $cf_subdir_prefix/utf8/lib/utf8 &&    cf_search="$cf_search $cf_subdir_prefix/utf8/lib/utf8"
7390 }
7391
7392 done
7393
7394 cf_search="$cf_library_path_list $cf_search"
7395
7396                         for cf_cv_library_path_utf8 in $cf_search
7397                         do
7398                                 if test -d $cf_cv_library_path_utf8 ; then
7399                                         test -n "$verbose" && echo "    ... testing $cf_cv_library_path_utf8" 1>&6
7400
7401 echo "${as_me:-configure}:7401: testing ... testing $cf_cv_library_path_utf8 ..." 1>&5
7402
7403                                         CPPFLAGS="$cf_test_CPPFLAGS"
7404                                         LIBS="-lutf8  $cf_save_LIBS"
7405                                         LDFLAGS="$cf_save_LDFLAGS -L$cf_cv_library_path_utf8"
7406                                         cat >conftest.$ac_ext <<_ACEOF
7407 #line 7407 "configure"
7408 #include "confdefs.h"
7409
7410 #include <libutf8.h>
7411 int
7412 main (void)
7413 {
7414 putwc(0,0);
7415   ;
7416   return 0;
7417 }
7418 _ACEOF
7419 rm -f conftest.$ac_objext conftest$ac_exeext
7420 if { (eval echo "$as_me:7420: \"$ac_link\"") >&5
7421   (eval $ac_link) 2>&5
7422   ac_status=$?
7423   echo "$as_me:7423: \$? = $ac_status" >&5
7424   (exit $ac_status); } &&
7425          { ac_try='test -s conftest$ac_exeext'
7426   { (eval echo "$as_me:7426: \"$ac_try\"") >&5
7427   (eval $ac_try) 2>&5
7428   ac_status=$?
7429   echo "$as_me:7429: \$? = $ac_status" >&5
7430   (exit $ac_status); }; }; then
7431
7432                                         test -n "$verbose" && echo "    ... found utf8 library in $cf_cv_library_path_utf8" 1>&6
7433
7434 echo "${as_me:-configure}:7434: testing ... found utf8 library in $cf_cv_library_path_utf8 ..." 1>&5
7435
7436                                         cf_cv_find_linkage_utf8=yes
7437                                         cf_cv_library_file_utf8="-lutf8"
7438                                         break
7439 else
7440   echo "$as_me: failed program was:" >&5
7441 cat conftest.$ac_ext >&5
7442
7443                                         CPPFLAGS="$cf_save_CPPFLAGS"
7444                                         LIBS="$cf_save_LIBS"
7445                                         LDFLAGS="$cf_save_LDFLAGS"
7446
7447 fi
7448 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7449                                 fi
7450                         done
7451                         CPPFLAGS="$cf_save_CPPFLAGS"
7452                         LDFLAGS="$cf_save_LDFLAGS"
7453                 fi
7454
7455         else
7456                 cf_cv_find_linkage_utf8=no
7457         fi
7458
7459 fi
7460 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7461
7462 fi
7463 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7464
7465 LIBS="$cf_save_LIBS"
7466
7467 if test "$cf_cv_find_linkage_utf8" = yes ; then
7468 cf_cv_utf8_lib=add-on
7469 else
7470 cf_cv_utf8_lib=no
7471 fi
7472
7473 fi
7474 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7475 fi
7476 echo "$as_me:7476: result: $cf_cv_utf8_lib" >&5
7477 echo "${ECHO_T}$cf_cv_utf8_lib" >&6
7478
7479 # HAVE_LIBUTF8_H is used by ncurses if curses.h is shared between
7480 # ncurses/ncursesw:
7481 if test "$cf_cv_utf8_lib" = "add-on" ; then
7482
7483 cat >>confdefs.h <<\EOF
7484 #define HAVE_LIBUTF8_H 1
7485 EOF
7486
7487 if test -n "$cf_cv_header_path_utf8" ; then
7488   for cf_add_incdir in $cf_cv_header_path_utf8
7489   do
7490         while test $cf_add_incdir != /usr/include
7491         do
7492           if test -d $cf_add_incdir
7493           then
7494                 cf_have_incdir=no
7495                 if test -n "$CFLAGS$CPPFLAGS" ; then
7496                   # a loop is needed to ensure we can add subdirs of existing dirs
7497                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
7498                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
7499                           cf_have_incdir=yes; break
7500                         fi
7501                   done
7502                 fi
7503
7504                 if test "$cf_have_incdir" = no ; then
7505                   if test "$cf_add_incdir" = /usr/local/include ; then
7506                         if test "$GCC" = yes
7507                         then
7508                           cf_save_CPPFLAGS=$CPPFLAGS
7509
7510         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
7511         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
7512
7513                           cat >conftest.$ac_ext <<_ACEOF
7514 #line 7514 "configure"
7515 #include "confdefs.h"
7516 #include <stdio.h>
7517 int
7518 main (void)
7519 {
7520 printf("Hello")
7521   ;
7522   return 0;
7523 }
7524 _ACEOF
7525 rm -f conftest.$ac_objext
7526 if { (eval echo "$as_me:7526: \"$ac_compile\"") >&5
7527   (eval $ac_compile) 2>&5
7528   ac_status=$?
7529   echo "$as_me:7529: \$? = $ac_status" >&5
7530   (exit $ac_status); } &&
7531          { ac_try='test -s conftest.$ac_objext'
7532   { (eval echo "$as_me:7532: \"$ac_try\"") >&5
7533   (eval $ac_try) 2>&5
7534   ac_status=$?
7535   echo "$as_me:7535: \$? = $ac_status" >&5
7536   (exit $ac_status); }; }; then
7537   :
7538 else
7539   echo "$as_me: failed program was:" >&5
7540 cat conftest.$ac_ext >&5
7541 cf_have_incdir=yes
7542 fi
7543 rm -f conftest.$ac_objext conftest.$ac_ext
7544                           CPPFLAGS=$cf_save_CPPFLAGS
7545                         fi
7546                   fi
7547                 fi
7548
7549                 if test "$cf_have_incdir" = no ; then
7550                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
7551
7552 echo "${as_me:-configure}:7552: testing adding $cf_add_incdir to include-path ..." 1>&5
7553
7554                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
7555
7556                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
7557                   test "$cf_top_incdir" = "$cf_add_incdir" && break
7558                   cf_add_incdir="$cf_top_incdir"
7559                 else
7560                   break
7561                 fi
7562           else
7563                 break
7564           fi
7565         done
7566   done
7567 fi
7568
7569 if test -n "$cf_cv_library_path_utf8" ; then
7570         for cf_add_libdir in $cf_cv_library_path_utf8
7571         do
7572                 if test $cf_add_libdir = /usr/lib ; then
7573                         :
7574                 elif test -d $cf_add_libdir
7575                 then
7576                         cf_have_libdir=no
7577                         if test -n "$LDFLAGS$LIBS" ; then
7578                                 # a loop is needed to ensure we can add subdirs of existing dirs
7579                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
7580                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
7581                                                 cf_have_libdir=yes; break
7582                                         fi
7583                                 done
7584                         fi
7585                         if test "$cf_have_libdir" = no ; then
7586                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
7587
7588 echo "${as_me:-configure}:7588: testing adding $cf_add_libdir to library-path ..." 1>&5
7589
7590                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
7591                         fi
7592                 fi
7593         done
7594 fi
7595
7596 cf_add_libs="$LIBS"
7597 # reverse order
7598 cf_add_0lib=
7599 for cf_add_1lib in $cf_cv_library_file_utf8; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
7600 # filter duplicates
7601 for cf_add_1lib in $cf_add_0lib; do
7602         for cf_add_2lib in $cf_add_libs; do
7603                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
7604                         cf_add_1lib=
7605                         break
7606                 fi
7607         done
7608         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
7609 done
7610 LIBS="$cf_add_libs"
7611
7612 fi
7613
7614 cf_ncuconfig_root=$cf_cv_screen
7615 cf_have_ncuconfig=no
7616
7617 if test "x${PKG_CONFIG:=none}" != xnone; then
7618         echo "$as_me:7618: checking pkg-config for $cf_ncuconfig_root" >&5
7619 echo $ECHO_N "checking pkg-config for $cf_ncuconfig_root... $ECHO_C" >&6
7620         if "$PKG_CONFIG" --exists $cf_ncuconfig_root ; then
7621                 echo "$as_me:7621: result: yes" >&5
7622 echo "${ECHO_T}yes" >&6
7623
7624                 echo "$as_me:7624: checking if the $cf_ncuconfig_root package files work" >&5
7625 echo $ECHO_N "checking if the $cf_ncuconfig_root package files work... $ECHO_C" >&6
7626                 cf_have_ncuconfig=unknown
7627
7628                 cf_save_CFLAGS="$CFLAGS"
7629                 cf_save_CPPFLAGS="$CPPFLAGS"
7630                 cf_save_LIBS="$LIBS"
7631
7632                 cf_pkg_cflags=`$PKG_CONFIG --cflags $cf_ncuconfig_root`
7633                 cf_pkg_libs=`$PKG_CONFIG --libs $cf_ncuconfig_root`
7634
7635                 # while -W for passing linker flags is prevalent, it is not "standard".
7636                 # At least one wrapper for c89/c99 (in Apple's xcode) has its own
7637                 # incompatible _and_ non-standard -W option which gives an error.  Work
7638                 # around that pitfall.
7639                 case "x${CC}@@${cf_pkg_libs}@${cf_pkg_cflags}" in
7640                 (x*c[89]9@@*-W*)
7641
7642 cf_fix_cppflags=no
7643 cf_new_cflags=
7644 cf_new_cppflags=
7645 cf_new_extra_cppflags=
7646
7647 for cf_add_cflags in $cf_pkg_cflags
7648 do
7649 case $cf_fix_cppflags in
7650 (no)
7651         case $cf_add_cflags in
7652         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
7653                 case $cf_add_cflags in
7654                 (-D*)
7655                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
7656
7657                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
7658                                 && test -z "${cf_tst_cflags}" \
7659                                 && cf_fix_cppflags=yes
7660
7661                         if test $cf_fix_cppflags = yes ; then
7662
7663         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7664         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7665
7666                                 continue
7667                         elif test "${cf_tst_cflags}" = "\"'" ; then
7668
7669         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7670         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7671
7672                                 continue
7673                         fi
7674                         ;;
7675                 esac
7676                 case "$CPPFLAGS" in
7677                 (*$cf_add_cflags)
7678                         ;;
7679                 (*)
7680                         case $cf_add_cflags in
7681                         (-D*)
7682                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
7683
7684 CPPFLAGS=`echo "$CPPFLAGS" | \
7685         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
7686                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
7687
7688                                 ;;
7689                         esac
7690
7691         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
7692         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
7693
7694                         ;;
7695                 esac
7696                 ;;
7697         (*)
7698
7699         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
7700         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
7701
7702                 ;;
7703         esac
7704         ;;
7705 (yes)
7706
7707         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7708         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7709
7710         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
7711
7712         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
7713                 && test -z "${cf_tst_cflags}" \
7714                 && cf_fix_cppflags=no
7715         ;;
7716 esac
7717 done
7718
7719 if test -n "$cf_new_cflags" ; then
7720
7721         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
7722         CFLAGS="${CFLAGS}$cf_new_cflags"
7723
7724 fi
7725
7726 if test -n "$cf_new_cppflags" ; then
7727
7728         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
7729         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
7730
7731 fi
7732
7733 if test -n "$cf_new_extra_cppflags" ; then
7734
7735         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
7736         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
7737
7738 fi
7739
7740 cf_add_libs="$LIBS"
7741 # reverse order
7742 cf_add_0lib=
7743 for cf_add_1lib in $cf_pkg_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
7744 # filter duplicates
7745 for cf_add_1lib in $cf_add_0lib; do
7746         for cf_add_2lib in $cf_add_libs; do
7747                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
7748                         cf_add_1lib=
7749                         break
7750                 fi
7751         done
7752         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
7753 done
7754 LIBS="$cf_add_libs"
7755
7756                         cat >conftest.$ac_ext <<_ACEOF
7757 #line 7757 "configure"
7758 #include "confdefs.h"
7759 #include <${cf_cv_ncurses_header:-curses.h}>
7760 int
7761 main (void)
7762 {
7763 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
7764   ;
7765   return 0;
7766 }
7767 _ACEOF
7768 rm -f conftest.$ac_objext conftest$ac_exeext
7769 if { (eval echo "$as_me:7769: \"$ac_link\"") >&5
7770   (eval $ac_link) 2>&5
7771   ac_status=$?
7772   echo "$as_me:7772: \$? = $ac_status" >&5
7773   (exit $ac_status); } &&
7774          { ac_try='test -s conftest$ac_exeext'
7775   { (eval echo "$as_me:7775: \"$ac_try\"") >&5
7776   (eval $ac_try) 2>&5
7777   ac_status=$?
7778   echo "$as_me:7778: \$? = $ac_status" >&5
7779   (exit $ac_status); }; }; then
7780   if test "$cross_compiling" = yes; then
7781   cf_test_ncuconfig=maybe
7782 else
7783   cat >conftest.$ac_ext <<_ACEOF
7784 #line 7784 "configure"
7785 #include "confdefs.h"
7786 #include <${cf_cv_ncurses_header:-curses.h}>
7787                                         int main(void)
7788                                         { char *xx = curses_version(); return (xx == 0); }
7789 _ACEOF
7790 rm -f conftest$ac_exeext
7791 if { (eval echo "$as_me:7791: \"$ac_link\"") >&5
7792   (eval $ac_link) 2>&5
7793   ac_status=$?
7794   echo "$as_me:7794: \$? = $ac_status" >&5
7795   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
7796   { (eval echo "$as_me:7796: \"$ac_try\"") >&5
7797   (eval $ac_try) 2>&5
7798   ac_status=$?
7799   echo "$as_me:7799: \$? = $ac_status" >&5
7800   (exit $ac_status); }; }; then
7801   cf_test_ncuconfig=yes
7802 else
7803   echo "$as_me: program exited with status $ac_status" >&5
7804 echo "$as_me: failed program was:" >&5
7805 cat conftest.$ac_ext >&5
7806 cf_test_ncuconfig=no
7807 fi
7808 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
7809 fi
7810 else
7811   echo "$as_me: failed program was:" >&5
7812 cat conftest.$ac_ext >&5
7813 cf_test_ncuconfig=no
7814 fi
7815 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7816
7817                         CFLAGS="$cf_save_CFLAGS"
7818                         CPPFLAGS="$cf_save_CPPFLAGS"
7819                         LIBS="$cf_save_LIBS"
7820
7821                         if test "x$cf_test_ncuconfig" != xyes; then
7822                                 cf_temp=`echo "x$cf_pkg_cflags" | sed -e s/^x// -e 's/-W[^      ]*//g'`
7823                                 cf_pkg_cflags="$cf_temp"
7824                                 cf_temp=`echo "x$cf_pkg_libs" | sed -e s/^x// -e 's/-W[^        ]*//g'`
7825                                 cf_pkg_libs="$cf_temp"
7826                         fi
7827                         ;;
7828                 esac
7829
7830 cf_fix_cppflags=no
7831 cf_new_cflags=
7832 cf_new_cppflags=
7833 cf_new_extra_cppflags=
7834
7835 for cf_add_cflags in $cf_pkg_cflags
7836 do
7837 case $cf_fix_cppflags in
7838 (no)
7839         case $cf_add_cflags in
7840         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
7841                 case $cf_add_cflags in
7842                 (-D*)
7843                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
7844
7845                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
7846                                 && test -z "${cf_tst_cflags}" \
7847                                 && cf_fix_cppflags=yes
7848
7849                         if test $cf_fix_cppflags = yes ; then
7850
7851         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7852         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7853
7854                                 continue
7855                         elif test "${cf_tst_cflags}" = "\"'" ; then
7856
7857         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7858         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7859
7860                                 continue
7861                         fi
7862                         ;;
7863                 esac
7864                 case "$CPPFLAGS" in
7865                 (*$cf_add_cflags)
7866                         ;;
7867                 (*)
7868                         case $cf_add_cflags in
7869                         (-D*)
7870                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
7871
7872 CPPFLAGS=`echo "$CPPFLAGS" | \
7873         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
7874                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
7875
7876                                 ;;
7877                         esac
7878
7879         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
7880         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
7881
7882                         ;;
7883                 esac
7884                 ;;
7885         (*)
7886
7887         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
7888         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
7889
7890                 ;;
7891         esac
7892         ;;
7893 (yes)
7894
7895         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7896         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7897
7898         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
7899
7900         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
7901                 && test -z "${cf_tst_cflags}" \
7902                 && cf_fix_cppflags=no
7903         ;;
7904 esac
7905 done
7906
7907 if test -n "$cf_new_cflags" ; then
7908
7909         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
7910         CFLAGS="${CFLAGS}$cf_new_cflags"
7911
7912 fi
7913
7914 if test -n "$cf_new_cppflags" ; then
7915
7916         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
7917         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
7918
7919 fi
7920
7921 if test -n "$cf_new_extra_cppflags" ; then
7922
7923         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
7924         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
7925
7926 fi
7927
7928 cf_add_libs="$LIBS"
7929 # reverse order
7930 cf_add_0lib=
7931 for cf_add_1lib in $cf_pkg_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
7932 # filter duplicates
7933 for cf_add_1lib in $cf_add_0lib; do
7934         for cf_add_2lib in $cf_add_libs; do
7935                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
7936                         cf_add_1lib=
7937                         break
7938                 fi
7939         done
7940         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
7941 done
7942 LIBS="$cf_add_libs"
7943
7944                 cat >conftest.$ac_ext <<_ACEOF
7945 #line 7945 "configure"
7946 #include "confdefs.h"
7947 #include <${cf_cv_ncurses_header:-curses.h}>
7948 int
7949 main (void)
7950 {
7951 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
7952   ;
7953   return 0;
7954 }
7955 _ACEOF
7956 rm -f conftest.$ac_objext conftest$ac_exeext
7957 if { (eval echo "$as_me:7957: \"$ac_link\"") >&5
7958   (eval $ac_link) 2>&5
7959   ac_status=$?
7960   echo "$as_me:7960: \$? = $ac_status" >&5
7961   (exit $ac_status); } &&
7962          { ac_try='test -s conftest$ac_exeext'
7963   { (eval echo "$as_me:7963: \"$ac_try\"") >&5
7964   (eval $ac_try) 2>&5
7965   ac_status=$?
7966   echo "$as_me:7966: \$? = $ac_status" >&5
7967   (exit $ac_status); }; }; then
7968   if test "$cross_compiling" = yes; then
7969   cf_have_ncuconfig=maybe
7970 else
7971   cat >conftest.$ac_ext <<_ACEOF
7972 #line 7972 "configure"
7973 #include "confdefs.h"
7974 #include <${cf_cv_ncurses_header:-curses.h}>
7975                                 int main(void)
7976                                 { char *xx = curses_version(); return (xx == 0); }
7977 _ACEOF
7978 rm -f conftest$ac_exeext
7979 if { (eval echo "$as_me:7979: \"$ac_link\"") >&5
7980   (eval $ac_link) 2>&5
7981   ac_status=$?
7982   echo "$as_me:7982: \$? = $ac_status" >&5
7983   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
7984   { (eval echo "$as_me:7984: \"$ac_try\"") >&5
7985   (eval $ac_try) 2>&5
7986   ac_status=$?
7987   echo "$as_me:7987: \$? = $ac_status" >&5
7988   (exit $ac_status); }; }; then
7989   cf_have_ncuconfig=yes
7990 else
7991   echo "$as_me: program exited with status $ac_status" >&5
7992 echo "$as_me: failed program was:" >&5
7993 cat conftest.$ac_ext >&5
7994 cf_have_ncuconfig=no
7995 fi
7996 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
7997 fi
7998 else
7999   echo "$as_me: failed program was:" >&5
8000 cat conftest.$ac_ext >&5
8001 cf_have_ncuconfig=no
8002 fi
8003 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8004                 echo "$as_me:8004: result: $cf_have_ncuconfig" >&5
8005 echo "${ECHO_T}$cf_have_ncuconfig" >&6
8006                 test "$cf_have_ncuconfig" = maybe && cf_have_ncuconfig=yes
8007                 if test "$cf_have_ncuconfig" != "yes"
8008                 then
8009                         CPPFLAGS="$cf_save_CPPFLAGS"
8010                         LIBS="$cf_save_LIBS"
8011                         NCURSES_CONFIG_PKG=none
8012                 else
8013
8014 cat >>confdefs.h <<\EOF
8015 #define NCURSES 1
8016 EOF
8017
8018                         NCURSES_CONFIG_PKG=$cf_ncuconfig_root
8019
8020 echo "$as_me:8020: checking for terminfo header" >&5
8021 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
8022 if test "${cf_cv_term_header+set}" = set; then
8023   echo $ECHO_N "(cached) $ECHO_C" >&6
8024 else
8025
8026 case ${cf_cv_ncurses_header} in
8027 (*/ncurses.h|*/ncursesw.h)
8028         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
8029         ;;
8030 (*)
8031         cf_term_header=term.h
8032         ;;
8033 esac
8034
8035 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
8036 do
8037 cat >conftest.$ac_ext <<_ACEOF
8038 #line 8038 "configure"
8039 #include "confdefs.h"
8040 #include <stdio.h>
8041 #include <${cf_cv_ncurses_header:-curses.h}>
8042 #include <$cf_test>
8043
8044 int
8045 main (void)
8046 {
8047 int x = auto_left_margin; (void)x
8048   ;
8049   return 0;
8050 }
8051 _ACEOF
8052 rm -f conftest.$ac_objext
8053 if { (eval echo "$as_me:8053: \"$ac_compile\"") >&5
8054   (eval $ac_compile) 2>&5
8055   ac_status=$?
8056   echo "$as_me:8056: \$? = $ac_status" >&5
8057   (exit $ac_status); } &&
8058          { ac_try='test -s conftest.$ac_objext'
8059   { (eval echo "$as_me:8059: \"$ac_try\"") >&5
8060   (eval $ac_try) 2>&5
8061   ac_status=$?
8062   echo "$as_me:8062: \$? = $ac_status" >&5
8063   (exit $ac_status); }; }; then
8064
8065         cf_cv_term_header="$cf_test"
8066 else
8067   echo "$as_me: failed program was:" >&5
8068 cat conftest.$ac_ext >&5
8069
8070         cf_cv_term_header=unknown
8071
8072 fi
8073 rm -f conftest.$ac_objext conftest.$ac_ext
8074         test "$cf_cv_term_header" != unknown && break
8075 done
8076
8077 fi
8078 echo "$as_me:8078: result: $cf_cv_term_header" >&5
8079 echo "${ECHO_T}$cf_cv_term_header" >&6
8080
8081 # Set definitions to allow ifdef'ing to accommodate subdirectories
8082
8083 case $cf_cv_term_header in
8084 (*term.h)
8085
8086 cat >>confdefs.h <<\EOF
8087 #define HAVE_TERM_H 1
8088 EOF
8089
8090         ;;
8091 esac
8092
8093 case $cf_cv_term_header in
8094 (ncurses/term.h)
8095
8096 cat >>confdefs.h <<\EOF
8097 #define HAVE_NCURSES_TERM_H 1
8098 EOF
8099
8100         ;;
8101 (ncursesw/term.h)
8102
8103 cat >>confdefs.h <<\EOF
8104 #define HAVE_NCURSESW_TERM_H 1
8105 EOF
8106
8107         ;;
8108 esac
8109
8110                 fi
8111
8112         else
8113                 echo "$as_me:8113: result: no" >&5
8114 echo "${ECHO_T}no" >&6
8115                 NCURSES_CONFIG_PKG=none
8116         fi
8117 else
8118         NCURSES_CONFIG_PKG=none
8119 fi
8120
8121 if test "x$cf_have_ncuconfig" = "xno"; then
8122         cf_ncurses_config="${cf_ncuconfig_root}${NCURSES_CONFIG_SUFFIX}-config"; echo "Looking for ${cf_ncurses_config}"
8123
8124 if test -n "$ac_tool_prefix"; then
8125   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
8126   do
8127     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
8128 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
8129 echo "$as_me:8129: checking for $ac_word" >&5
8130 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
8131 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
8132   echo $ECHO_N "(cached) $ECHO_C" >&6
8133 else
8134   if test -n "$NCURSES_CONFIG"; then
8135   ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
8136 else
8137   ac_save_IFS=$IFS; IFS=$ac_path_separator
8138 ac_dummy="$PATH"
8139 for ac_dir in $ac_dummy; do
8140   IFS=$ac_save_IFS
8141   test -z "$ac_dir" && ac_dir=.
8142   $as_executable_p "$ac_dir/$ac_word" || continue
8143 ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
8144 echo "$as_me:8144: found $ac_dir/$ac_word" >&5
8145 break
8146 done
8147
8148 fi
8149 fi
8150 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
8151 if test -n "$NCURSES_CONFIG"; then
8152   echo "$as_me:8152: result: $NCURSES_CONFIG" >&5
8153 echo "${ECHO_T}$NCURSES_CONFIG" >&6
8154 else
8155   echo "$as_me:8155: result: no" >&5
8156 echo "${ECHO_T}no" >&6
8157 fi
8158
8159     test -n "$NCURSES_CONFIG" && break
8160   done
8161 fi
8162 if test -z "$NCURSES_CONFIG"; then
8163   ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
8164   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
8165 do
8166   # Extract the first word of "$ac_prog", so it can be a program name with args.
8167 set dummy $ac_prog; ac_word=$2
8168 echo "$as_me:8168: checking for $ac_word" >&5
8169 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
8170 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
8171   echo $ECHO_N "(cached) $ECHO_C" >&6
8172 else
8173   if test -n "$ac_ct_NCURSES_CONFIG"; then
8174   ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
8175 else
8176   ac_save_IFS=$IFS; IFS=$ac_path_separator
8177 ac_dummy="$PATH"
8178 for ac_dir in $ac_dummy; do
8179   IFS=$ac_save_IFS
8180   test -z "$ac_dir" && ac_dir=.
8181   $as_executable_p "$ac_dir/$ac_word" || continue
8182 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
8183 echo "$as_me:8183: found $ac_dir/$ac_word" >&5
8184 break
8185 done
8186
8187 fi
8188 fi
8189 ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
8190 if test -n "$ac_ct_NCURSES_CONFIG"; then
8191   echo "$as_me:8191: result: $ac_ct_NCURSES_CONFIG" >&5
8192 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
8193 else
8194   echo "$as_me:8194: result: no" >&5
8195 echo "${ECHO_T}no" >&6
8196 fi
8197
8198   test -n "$ac_ct_NCURSES_CONFIG" && break
8199 done
8200 test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
8201
8202   NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
8203 fi
8204
8205         if test "$NCURSES_CONFIG" != none ; then
8206
8207 cf_fix_cppflags=no
8208 cf_new_cflags=
8209 cf_new_cppflags=
8210 cf_new_extra_cppflags=
8211
8212 for cf_add_cflags in `$NCURSES_CONFIG --cflags`
8213 do
8214 case $cf_fix_cppflags in
8215 (no)
8216         case $cf_add_cflags in
8217         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
8218                 case $cf_add_cflags in
8219                 (-D*)
8220                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
8221
8222                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
8223                                 && test -z "${cf_tst_cflags}" \
8224                                 && cf_fix_cppflags=yes
8225
8226                         if test $cf_fix_cppflags = yes ; then
8227
8228         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
8229         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
8230
8231                                 continue
8232                         elif test "${cf_tst_cflags}" = "\"'" ; then
8233
8234         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
8235         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
8236
8237                                 continue
8238                         fi
8239                         ;;
8240                 esac
8241                 case "$CPPFLAGS" in
8242                 (*$cf_add_cflags)
8243                         ;;
8244                 (*)
8245                         case $cf_add_cflags in
8246                         (-D*)
8247                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
8248
8249 CPPFLAGS=`echo "$CPPFLAGS" | \
8250         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
8251                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
8252
8253                                 ;;
8254                         esac
8255
8256         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
8257         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
8258
8259                         ;;
8260                 esac
8261                 ;;
8262         (*)
8263
8264         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
8265         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
8266
8267                 ;;
8268         esac
8269         ;;
8270 (yes)
8271
8272         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
8273         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
8274
8275         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
8276
8277         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
8278                 && test -z "${cf_tst_cflags}" \
8279                 && cf_fix_cppflags=no
8280         ;;
8281 esac
8282 done
8283
8284 if test -n "$cf_new_cflags" ; then
8285
8286         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
8287         CFLAGS="${CFLAGS}$cf_new_cflags"
8288
8289 fi
8290
8291 if test -n "$cf_new_cppflags" ; then
8292
8293         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
8294         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
8295
8296 fi
8297
8298 if test -n "$cf_new_extra_cppflags" ; then
8299
8300         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
8301         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
8302
8303 fi
8304
8305 cf_add_libs="$LIBS"
8306 # reverse order
8307 cf_add_0lib=
8308 for cf_add_1lib in `$NCURSES_CONFIG --libs`; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
8309 # filter duplicates
8310 for cf_add_1lib in $cf_add_0lib; do
8311         for cf_add_2lib in $cf_add_libs; do
8312                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
8313                         cf_add_1lib=
8314                         break
8315                 fi
8316         done
8317         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
8318 done
8319 LIBS="$cf_add_libs"
8320
8321                 # even with config script, some packages use no-override for curses.h
8322
8323 echo "$as_me:8323: checking if we have identified curses headers" >&5
8324 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
8325 if test "${cf_cv_ncurses_header+set}" = set; then
8326   echo $ECHO_N "(cached) $ECHO_C" >&6
8327 else
8328
8329 cf_cv_ncurses_header=none
8330 for cf_header in \
8331         ncurses.h $cf_cv_screen/ncurses.h \
8332         curses.h $cf_cv_screen/curses.h
8333 do
8334 cat >conftest.$ac_ext <<_ACEOF
8335 #line 8335 "configure"
8336 #include "confdefs.h"
8337 #include <${cf_header}>
8338 int
8339 main (void)
8340 {
8341 initscr(); tgoto("?", 0,0)
8342   ;
8343   return 0;
8344 }
8345 _ACEOF
8346 rm -f conftest.$ac_objext
8347 if { (eval echo "$as_me:8347: \"$ac_compile\"") >&5
8348   (eval $ac_compile) 2>&5
8349   ac_status=$?
8350   echo "$as_me:8350: \$? = $ac_status" >&5
8351   (exit $ac_status); } &&
8352          { ac_try='test -s conftest.$ac_objext'
8353   { (eval echo "$as_me:8353: \"$ac_try\"") >&5
8354   (eval $ac_try) 2>&5
8355   ac_status=$?
8356   echo "$as_me:8356: \$? = $ac_status" >&5
8357   (exit $ac_status); }; }; then
8358   cf_cv_ncurses_header=$cf_header; break
8359 else
8360   echo "$as_me: failed program was:" >&5
8361 cat conftest.$ac_ext >&5
8362 fi
8363 rm -f conftest.$ac_objext conftest.$ac_ext
8364 done
8365
8366 fi
8367 echo "$as_me:8367: result: $cf_cv_ncurses_header" >&5
8368 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
8369
8370 if test "$cf_cv_ncurses_header" = none ; then
8371         { { echo "$as_me:8371: error: No curses header-files found" >&5
8372 echo "$as_me: error: No curses header-files found" >&2;}
8373    { (exit 1); exit 1; }; }
8374 fi
8375
8376 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
8377
8378 for ac_header in $cf_cv_ncurses_header
8379 do
8380 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
8381 echo "$as_me:8381: checking for $ac_header" >&5
8382 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
8383 if eval "test \"\${$as_ac_Header+set}\" = set"; then
8384   echo $ECHO_N "(cached) $ECHO_C" >&6
8385 else
8386   cat >conftest.$ac_ext <<_ACEOF
8387 #line 8387 "configure"
8388 #include "confdefs.h"
8389 #include <$ac_header>
8390 _ACEOF
8391 if { (eval echo "$as_me:8391: \"$ac_cpp conftest.$ac_ext\"") >&5
8392   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
8393   ac_status=$?
8394   egrep -v '^ *\+' conftest.er1 >conftest.err
8395   rm -f conftest.er1
8396   cat conftest.err >&5
8397   echo "$as_me:8397: \$? = $ac_status" >&5
8398   (exit $ac_status); } >/dev/null; then
8399   if test -s conftest.err; then
8400     ac_cpp_err=$ac_c_preproc_warn_flag
8401   else
8402     ac_cpp_err=
8403   fi
8404 else
8405   ac_cpp_err=yes
8406 fi
8407 if test -z "$ac_cpp_err"; then
8408   eval "$as_ac_Header=yes"
8409 else
8410   echo "$as_me: failed program was:" >&5
8411   cat conftest.$ac_ext >&5
8412   eval "$as_ac_Header=no"
8413 fi
8414 rm -f conftest.err conftest.$ac_ext
8415 fi
8416 echo "$as_me:8416: result: `eval echo '${'$as_ac_Header'}'`" >&5
8417 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
8418 if test `eval echo '${'$as_ac_Header'}'` = yes; then
8419   cat >>confdefs.h <<EOF
8420 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
8421 EOF
8422
8423 fi
8424 done
8425
8426 cat >>confdefs.h <<\EOF
8427 #define NCURSES 1
8428 EOF
8429
8430 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
8431
8432                 cat >>confdefs.h <<EOF
8433 #define $cf_nculib_ROOT 1
8434 EOF
8435
8436                                 cf_cv_ncurses_version=`$NCURSES_CONFIG --version`
8437
8438         else
8439
8440 cf_ncuhdr_root=$cf_cv_screen
8441
8442 test -n "$cf_cv_curses_dir" && \
8443 test "$cf_cv_curses_dir" != "no" && { \
8444
8445 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
8446   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
8447   do
8448         while test $cf_add_incdir != /usr/include
8449         do
8450           if test -d $cf_add_incdir
8451           then
8452                 cf_have_incdir=no
8453                 if test -n "$CFLAGS$CPPFLAGS" ; then
8454                   # a loop is needed to ensure we can add subdirs of existing dirs
8455                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
8456                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
8457                           cf_have_incdir=yes; break
8458                         fi
8459                   done
8460                 fi
8461
8462                 if test "$cf_have_incdir" = no ; then
8463                   if test "$cf_add_incdir" = /usr/local/include ; then
8464                         if test "$GCC" = yes
8465                         then
8466                           cf_save_CPPFLAGS=$CPPFLAGS
8467
8468         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
8469         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
8470
8471                           cat >conftest.$ac_ext <<_ACEOF
8472 #line 8472 "configure"
8473 #include "confdefs.h"
8474 #include <stdio.h>
8475 int
8476 main (void)
8477 {
8478 printf("Hello")
8479   ;
8480   return 0;
8481 }
8482 _ACEOF
8483 rm -f conftest.$ac_objext
8484 if { (eval echo "$as_me:8484: \"$ac_compile\"") >&5
8485   (eval $ac_compile) 2>&5
8486   ac_status=$?
8487   echo "$as_me:8487: \$? = $ac_status" >&5
8488   (exit $ac_status); } &&
8489          { ac_try='test -s conftest.$ac_objext'
8490   { (eval echo "$as_me:8490: \"$ac_try\"") >&5
8491   (eval $ac_try) 2>&5
8492   ac_status=$?
8493   echo "$as_me:8493: \$? = $ac_status" >&5
8494   (exit $ac_status); }; }; then
8495   :
8496 else
8497   echo "$as_me: failed program was:" >&5
8498 cat conftest.$ac_ext >&5
8499 cf_have_incdir=yes
8500 fi
8501 rm -f conftest.$ac_objext conftest.$ac_ext
8502                           CPPFLAGS=$cf_save_CPPFLAGS
8503                         fi
8504                   fi
8505                 fi
8506
8507                 if test "$cf_have_incdir" = no ; then
8508                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
8509
8510 echo "${as_me:-configure}:8510: testing adding $cf_add_incdir to include-path ..." 1>&5
8511
8512                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8513
8514                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
8515                   test "$cf_top_incdir" = "$cf_add_incdir" && break
8516                   cf_add_incdir="$cf_top_incdir"
8517                 else
8518                   break
8519                 fi
8520           else
8521                 break
8522           fi
8523         done
8524   done
8525 fi
8526
8527 }
8528
8529 echo "$as_me:8529: checking for $cf_ncuhdr_root header in include-path" >&5
8530 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
8531 if test "${cf_cv_ncurses_h+set}" = set; then
8532   echo $ECHO_N "(cached) $ECHO_C" >&6
8533 else
8534
8535         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
8536         ( test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw ) && cf_header_list="$cf_header_list curses.h ncurses.h"
8537         for cf_header in $cf_header_list
8538         do
8539
8540         cat >conftest.$ac_ext <<_ACEOF
8541 #line 8541 "configure"
8542 #include "confdefs.h"
8543
8544 #include <$cf_header>
8545 int
8546 main (void)
8547 {
8548
8549 #ifdef NCURSES_VERSION
8550
8551 printf("%s\n", NCURSES_VERSION);
8552 #else
8553 #ifdef __NCURSES_H
8554 printf("old\n");
8555 #else
8556         make an error
8557 #endif
8558 #endif
8559
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_h=$cf_header
8577
8578 else
8579   echo "$as_me: failed program was:" >&5
8580 cat conftest.$ac_ext >&5
8581 cf_cv_ncurses_h=no
8582 fi
8583 rm -f conftest.$ac_objext conftest.$ac_ext
8584
8585                 test "$cf_cv_ncurses_h" != no && break
8586         done
8587
8588 fi
8589 echo "$as_me:8589: result: $cf_cv_ncurses_h" >&5
8590 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
8591
8592 if test "$cf_cv_ncurses_h" != no ; then
8593         cf_cv_ncurses_header=$cf_cv_ncurses_h
8594 else
8595
8596 echo "$as_me:8596: checking for $cf_ncuhdr_root include-path" >&5
8597 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
8598 if test "${cf_cv_ncurses_h2+set}" = set; then
8599   echo $ECHO_N "(cached) $ECHO_C" >&6
8600 else
8601
8602         test -n "$verbose" && echo
8603
8604 cf_search=
8605
8606 # collect the current set of include-directories from compiler flags
8607 cf_header_path_list=""
8608 if test -n "${CFLAGS}${CPPFLAGS}" ; then
8609         for cf_header_path in $CPPFLAGS $CFLAGS
8610         do
8611                 case $cf_header_path in
8612                 (-I*)
8613                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
8614
8615 test "x$cf_header_path" != "xNONE" && \
8616 test -d "$cf_header_path" && \
8617  {
8618         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
8619         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
8620         test -d $cf_header_path/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
8621         test -d $cf_header_path/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
8622         test -d $cf_header_path/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
8623         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"
8624 }
8625
8626                         cf_header_path_list="$cf_header_path_list $cf_search"
8627                         ;;
8628                 esac
8629         done
8630 fi
8631
8632 # add the variations for the package we are looking for
8633
8634 cf_search=
8635
8636 test "x$prefix" != "xNONE" && \
8637 test -d "$prefix" && \
8638  {
8639         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
8640         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
8641         test -d $prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
8642         test -d $prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
8643         test -d $prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
8644         test -d $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
8645 }
8646
8647 for cf_subdir_prefix in \
8648         /usr \
8649         /usr/local \
8650         /usr/pkg \
8651         /opt \
8652         /opt/local \
8653         $HOME
8654 do
8655
8656 test "x$cf_subdir_prefix" != "x$prefix" && \
8657 test -d "$cf_subdir_prefix" && \
8658 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
8659         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
8660         test -d $cf_subdir_prefix/include &&          cf_search="$cf_search $cf_subdir_prefix/include"
8661         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root"
8662         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root/include"
8663         test -d $cf_subdir_prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include"
8664         test -d $cf_subdir_prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
8665 }
8666
8667 done
8668
8669 test "$includedir" != NONE && \
8670 test "$includedir" != "/usr/include" && \
8671 test -d "$includedir" && {
8672         test -d $includedir &&    cf_search="$cf_search $includedir"
8673         test -d $includedir/$cf_ncuhdr_root && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
8674 }
8675
8676 test "$oldincludedir" != NONE && \
8677 test "$oldincludedir" != "/usr/include" && \
8678 test -d "$oldincludedir" && {
8679         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
8680         test -d $oldincludedir/$cf_ncuhdr_root && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
8681 }
8682
8683 cf_search="$cf_search $cf_header_path_list"
8684
8685         test -n "$verbose" && echo search path $cf_search
8686         cf_save2_CPPFLAGS="$CPPFLAGS"
8687         for cf_incdir in $cf_search
8688         do
8689
8690 if test -n "$cf_incdir" ; then
8691   for cf_add_incdir in $cf_incdir
8692   do
8693         while test $cf_add_incdir != /usr/include
8694         do
8695           if test -d $cf_add_incdir
8696           then
8697                 cf_have_incdir=no
8698                 if test -n "$CFLAGS$CPPFLAGS" ; then
8699                   # a loop is needed to ensure we can add subdirs of existing dirs
8700                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
8701                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
8702                           cf_have_incdir=yes; break
8703                         fi
8704                   done
8705                 fi
8706
8707                 if test "$cf_have_incdir" = no ; then
8708                   if test "$cf_add_incdir" = /usr/local/include ; then
8709                         if test "$GCC" = yes
8710                         then
8711                           cf_save_CPPFLAGS=$CPPFLAGS
8712
8713         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
8714         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
8715
8716                           cat >conftest.$ac_ext <<_ACEOF
8717 #line 8717 "configure"
8718 #include "confdefs.h"
8719 #include <stdio.h>
8720 int
8721 main (void)
8722 {
8723 printf("Hello")
8724   ;
8725   return 0;
8726 }
8727 _ACEOF
8728 rm -f conftest.$ac_objext
8729 if { (eval echo "$as_me:8729: \"$ac_compile\"") >&5
8730   (eval $ac_compile) 2>&5
8731   ac_status=$?
8732   echo "$as_me:8732: \$? = $ac_status" >&5
8733   (exit $ac_status); } &&
8734          { ac_try='test -s conftest.$ac_objext'
8735   { (eval echo "$as_me:8735: \"$ac_try\"") >&5
8736   (eval $ac_try) 2>&5
8737   ac_status=$?
8738   echo "$as_me:8738: \$? = $ac_status" >&5
8739   (exit $ac_status); }; }; then
8740   :
8741 else
8742   echo "$as_me: failed program was:" >&5
8743 cat conftest.$ac_ext >&5
8744 cf_have_incdir=yes
8745 fi
8746 rm -f conftest.$ac_objext conftest.$ac_ext
8747                           CPPFLAGS=$cf_save_CPPFLAGS
8748                         fi
8749                   fi
8750                 fi
8751
8752                 if test "$cf_have_incdir" = no ; then
8753                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
8754
8755 echo "${as_me:-configure}:8755: testing adding $cf_add_incdir to include-path ..." 1>&5
8756
8757                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8758
8759                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
8760                   test "$cf_top_incdir" = "$cf_add_incdir" && break
8761                   cf_add_incdir="$cf_top_incdir"
8762                 else
8763                   break
8764                 fi
8765           else
8766                 break
8767           fi
8768         done
8769   done
8770 fi
8771
8772                 for cf_header in \
8773                         ncurses.h \
8774                         curses.h
8775                 do
8776
8777         cat >conftest.$ac_ext <<_ACEOF
8778 #line 8778 "configure"
8779 #include "confdefs.h"
8780
8781 #include <$cf_header>
8782 int
8783 main (void)
8784 {
8785
8786 #ifdef NCURSES_VERSION
8787
8788 printf("%s\n", NCURSES_VERSION);
8789 #else
8790 #ifdef __NCURSES_H
8791 printf("old\n");
8792 #else
8793         make an error
8794 #endif
8795 #endif
8796
8797   ;
8798   return 0;
8799 }
8800 _ACEOF
8801 rm -f conftest.$ac_objext
8802 if { (eval echo "$as_me:8802: \"$ac_compile\"") >&5
8803   (eval $ac_compile) 2>&5
8804   ac_status=$?
8805   echo "$as_me:8805: \$? = $ac_status" >&5
8806   (exit $ac_status); } &&
8807          { ac_try='test -s conftest.$ac_objext'
8808   { (eval echo "$as_me:8808: \"$ac_try\"") >&5
8809   (eval $ac_try) 2>&5
8810   ac_status=$?
8811   echo "$as_me:8811: \$? = $ac_status" >&5
8812   (exit $ac_status); }; }; then
8813   cf_cv_ncurses_h2=$cf_header
8814
8815 else
8816   echo "$as_me: failed program was:" >&5
8817 cat conftest.$ac_ext >&5
8818 cf_cv_ncurses_h2=no
8819 fi
8820 rm -f conftest.$ac_objext conftest.$ac_ext
8821
8822                         if test "$cf_cv_ncurses_h2" != no ; then
8823                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
8824                                 test -n "$verbose" && echo $ac_n "      ... found $ac_c" 1>&6
8825                                 break
8826                         fi
8827                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
8828                 done
8829                 CPPFLAGS="$cf_save2_CPPFLAGS"
8830                 test "$cf_cv_ncurses_h2" != no && break
8831         done
8832         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:8832: error: not found" >&5
8833 echo "$as_me: error: not found" >&2;}
8834    { (exit 1); exit 1; }; }
8835
8836 fi
8837 echo "$as_me:8837: result: $cf_cv_ncurses_h2" >&5
8838 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
8839
8840         cf_1st_incdir=`echo $cf_cv_ncurses_h2 | sed -e 's%/[^/]*$%%'`
8841         cf_cv_ncurses_header=`basename $cf_cv_ncurses_h2`
8842         if test `basename $cf_1st_incdir` = $cf_ncuhdr_root ; then
8843                 cf_cv_ncurses_header=$cf_ncuhdr_root/$cf_cv_ncurses_header
8844         fi
8845
8846 if test -n "$cf_1st_incdir" ; then
8847   for cf_add_incdir in $cf_1st_incdir
8848   do
8849         while test $cf_add_incdir != /usr/include
8850         do
8851           if test -d $cf_add_incdir
8852           then
8853                 cf_have_incdir=no
8854                 if test -n "$CFLAGS$CPPFLAGS" ; then
8855                   # a loop is needed to ensure we can add subdirs of existing dirs
8856                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
8857                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
8858                           cf_have_incdir=yes; break
8859                         fi
8860                   done
8861                 fi
8862
8863                 if test "$cf_have_incdir" = no ; then
8864                   if test "$cf_add_incdir" = /usr/local/include ; then
8865                         if test "$GCC" = yes
8866                         then
8867                           cf_save_CPPFLAGS=$CPPFLAGS
8868
8869         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
8870         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
8871
8872                           cat >conftest.$ac_ext <<_ACEOF
8873 #line 8873 "configure"
8874 #include "confdefs.h"
8875 #include <stdio.h>
8876 int
8877 main (void)
8878 {
8879 printf("Hello")
8880   ;
8881   return 0;
8882 }
8883 _ACEOF
8884 rm -f conftest.$ac_objext
8885 if { (eval echo "$as_me:8885: \"$ac_compile\"") >&5
8886   (eval $ac_compile) 2>&5
8887   ac_status=$?
8888   echo "$as_me:8888: \$? = $ac_status" >&5
8889   (exit $ac_status); } &&
8890          { ac_try='test -s conftest.$ac_objext'
8891   { (eval echo "$as_me:8891: \"$ac_try\"") >&5
8892   (eval $ac_try) 2>&5
8893   ac_status=$?
8894   echo "$as_me:8894: \$? = $ac_status" >&5
8895   (exit $ac_status); }; }; then
8896   :
8897 else
8898   echo "$as_me: failed program was:" >&5
8899 cat conftest.$ac_ext >&5
8900 cf_have_incdir=yes
8901 fi
8902 rm -f conftest.$ac_objext conftest.$ac_ext
8903                           CPPFLAGS=$cf_save_CPPFLAGS
8904                         fi
8905                   fi
8906                 fi
8907
8908                 if test "$cf_have_incdir" = no ; then
8909                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
8910
8911 echo "${as_me:-configure}:8911: testing adding $cf_add_incdir to include-path ..." 1>&5
8912
8913                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8914
8915                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
8916                   test "$cf_top_incdir" = "$cf_add_incdir" && break
8917                   cf_add_incdir="$cf_top_incdir"
8918                 else
8919                   break
8920                 fi
8921           else
8922                 break
8923           fi
8924         done
8925   done
8926 fi
8927
8928 fi
8929
8930 # Set definitions to allow ifdef'ing for ncurses.h
8931
8932 case $cf_cv_ncurses_header in
8933 (*ncurses.h)
8934
8935 cat >>confdefs.h <<\EOF
8936 #define HAVE_NCURSES_H 1
8937 EOF
8938
8939         ;;
8940 esac
8941
8942 case $cf_cv_ncurses_header in
8943 (ncurses/curses.h|ncurses/ncurses.h)
8944
8945 cat >>confdefs.h <<\EOF
8946 #define HAVE_NCURSES_NCURSES_H 1
8947 EOF
8948
8949         ;;
8950 (ncursesw/curses.h|ncursesw/ncurses.h)
8951
8952 cat >>confdefs.h <<\EOF
8953 #define HAVE_NCURSESW_NCURSES_H 1
8954 EOF
8955
8956         ;;
8957 esac
8958
8959 echo "$as_me:8959: checking for terminfo header" >&5
8960 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
8961 if test "${cf_cv_term_header+set}" = set; then
8962   echo $ECHO_N "(cached) $ECHO_C" >&6
8963 else
8964
8965 case ${cf_cv_ncurses_header} in
8966 (*/ncurses.h|*/ncursesw.h)
8967         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
8968         ;;
8969 (*)
8970         cf_term_header=term.h
8971         ;;
8972 esac
8973
8974 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
8975 do
8976 cat >conftest.$ac_ext <<_ACEOF
8977 #line 8977 "configure"
8978 #include "confdefs.h"
8979 #include <stdio.h>
8980 #include <${cf_cv_ncurses_header:-curses.h}>
8981 #include <$cf_test>
8982
8983 int
8984 main (void)
8985 {
8986 int x = auto_left_margin; (void)x
8987   ;
8988   return 0;
8989 }
8990 _ACEOF
8991 rm -f conftest.$ac_objext
8992 if { (eval echo "$as_me:8992: \"$ac_compile\"") >&5
8993   (eval $ac_compile) 2>&5
8994   ac_status=$?
8995   echo "$as_me:8995: \$? = $ac_status" >&5
8996   (exit $ac_status); } &&
8997          { ac_try='test -s conftest.$ac_objext'
8998   { (eval echo "$as_me:8998: \"$ac_try\"") >&5
8999   (eval $ac_try) 2>&5
9000   ac_status=$?
9001   echo "$as_me:9001: \$? = $ac_status" >&5
9002   (exit $ac_status); }; }; then
9003
9004         cf_cv_term_header="$cf_test"
9005 else
9006   echo "$as_me: failed program was:" >&5
9007 cat conftest.$ac_ext >&5
9008
9009         cf_cv_term_header=unknown
9010
9011 fi
9012 rm -f conftest.$ac_objext conftest.$ac_ext
9013         test "$cf_cv_term_header" != unknown && break
9014 done
9015
9016 fi
9017 echo "$as_me:9017: result: $cf_cv_term_header" >&5
9018 echo "${ECHO_T}$cf_cv_term_header" >&6
9019
9020 # Set definitions to allow ifdef'ing to accommodate subdirectories
9021
9022 case $cf_cv_term_header in
9023 (*term.h)
9024
9025 cat >>confdefs.h <<\EOF
9026 #define HAVE_TERM_H 1
9027 EOF
9028
9029         ;;
9030 esac
9031
9032 case $cf_cv_term_header in
9033 (ncurses/term.h)
9034
9035 cat >>confdefs.h <<\EOF
9036 #define HAVE_NCURSES_TERM_H 1
9037 EOF
9038
9039         ;;
9040 (ncursesw/term.h)
9041
9042 cat >>confdefs.h <<\EOF
9043 #define HAVE_NCURSESW_TERM_H 1
9044 EOF
9045
9046         ;;
9047 esac
9048
9049 # some applications need this, but should check for NCURSES_VERSION
9050
9051 cat >>confdefs.h <<\EOF
9052 #define NCURSES 1
9053 EOF
9054
9055 echo "$as_me:9055: checking for ncurses version" >&5
9056 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
9057 if test "${cf_cv_ncurses_version+set}" = set; then
9058   echo $ECHO_N "(cached) $ECHO_C" >&6
9059 else
9060
9061         cf_cv_ncurses_version=no
9062         cf_tempfile=out$$
9063         rm -f $cf_tempfile
9064         if test "$cross_compiling" = yes; then
9065
9066         # This will not work if the preprocessor splits the line after the
9067         # Autoconf token.  The 'unproto' program does that.
9068         cat > conftest.$ac_ext <<EOF
9069 #include <${cf_cv_ncurses_header:-curses.h}>
9070 #undef Autoconf
9071 #ifdef NCURSES_VERSION
9072 Autoconf NCURSES_VERSION
9073 #else
9074 #ifdef __NCURSES_H
9075 Autoconf "old"
9076 #endif
9077 ;
9078 #endif
9079 EOF
9080         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
9081         { (eval echo "$as_me:9081: \"$cf_try\"") >&5
9082   (eval $cf_try) 2>&5
9083   ac_status=$?
9084   echo "$as_me:9084: \$? = $ac_status" >&5
9085   (exit $ac_status); }
9086         if test -f conftest.out ; then
9087                 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
9088                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
9089                 rm -f conftest.out
9090         fi
9091
9092 else
9093   cat >conftest.$ac_ext <<_ACEOF
9094 #line 9094 "configure"
9095 #include "confdefs.h"
9096
9097 #include <${cf_cv_ncurses_header:-curses.h}>
9098 #include <stdio.h>
9099 int main(void)
9100 {
9101         FILE *fp = fopen("$cf_tempfile", "w");
9102 #ifdef NCURSES_VERSION
9103 # ifdef NCURSES_VERSION_PATCH
9104         fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
9105 # else
9106         fprintf(fp, "%s\n", NCURSES_VERSION);
9107 # endif
9108 #else
9109 # ifdef __NCURSES_H
9110         fprintf(fp, "old\n");
9111 # else
9112         make an error
9113 # endif
9114 #endif
9115         ${cf_cv_main_return:-return}(0);
9116 }
9117 _ACEOF
9118 rm -f conftest$ac_exeext
9119 if { (eval echo "$as_me:9119: \"$ac_link\"") >&5
9120   (eval $ac_link) 2>&5
9121   ac_status=$?
9122   echo "$as_me:9122: \$? = $ac_status" >&5
9123   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
9124   { (eval echo "$as_me:9124: \"$ac_try\"") >&5
9125   (eval $ac_try) 2>&5
9126   ac_status=$?
9127   echo "$as_me:9127: \$? = $ac_status" >&5
9128   (exit $ac_status); }; }; then
9129
9130         cf_cv_ncurses_version=`cat $cf_tempfile`
9131 else
9132   echo "$as_me: program exited with status $ac_status" >&5
9133 echo "$as_me: failed program was:" >&5
9134 cat conftest.$ac_ext >&5
9135 fi
9136 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
9137 fi
9138         rm -f $cf_tempfile
9139
9140 fi
9141 echo "$as_me:9141: result: $cf_cv_ncurses_version" >&5
9142 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
9143 test "$cf_cv_ncurses_version" = no ||
9144 cat >>confdefs.h <<\EOF
9145 #define NCURSES 1
9146 EOF
9147
9148 cf_nculib_root=$cf_cv_screen
9149         # This works, except for the special case where we find gpm, but
9150         # ncurses is in a nonstandard location via $LIBS, and we really want
9151         # to link gpm.
9152 cf_ncurses_LIBS=""
9153 cf_ncurses_SAVE="$LIBS"
9154 echo "$as_me:9154: checking for Gpm_Open in -lgpm" >&5
9155 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
9156 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
9157   echo $ECHO_N "(cached) $ECHO_C" >&6
9158 else
9159   ac_check_lib_save_LIBS=$LIBS
9160 LIBS="-lgpm  $LIBS"
9161 cat >conftest.$ac_ext <<_ACEOF
9162 #line 9162 "configure"
9163 #include "confdefs.h"
9164
9165 /* Override any gcc2 internal prototype to avoid an error.  */
9166 #ifdef __cplusplus
9167 extern "C"
9168 #endif
9169 /* We use char because int might match the return type of a gcc2
9170    builtin and then its argument prototype would still apply.  */
9171 char Gpm_Open ();
9172 int
9173 main (void)
9174 {
9175 Gpm_Open ();
9176   ;
9177   return 0;
9178 }
9179 _ACEOF
9180 rm -f conftest.$ac_objext conftest$ac_exeext
9181 if { (eval echo "$as_me:9181: \"$ac_link\"") >&5
9182   (eval $ac_link) 2>&5
9183   ac_status=$?
9184   echo "$as_me:9184: \$? = $ac_status" >&5
9185   (exit $ac_status); } &&
9186          { ac_try='test -s conftest$ac_exeext'
9187   { (eval echo "$as_me:9187: \"$ac_try\"") >&5
9188   (eval $ac_try) 2>&5
9189   ac_status=$?
9190   echo "$as_me:9190: \$? = $ac_status" >&5
9191   (exit $ac_status); }; }; then
9192   ac_cv_lib_gpm_Gpm_Open=yes
9193 else
9194   echo "$as_me: failed program was:" >&5
9195 cat conftest.$ac_ext >&5
9196 ac_cv_lib_gpm_Gpm_Open=no
9197 fi
9198 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9199 LIBS=$ac_check_lib_save_LIBS
9200 fi
9201 echo "$as_me:9201: result: $ac_cv_lib_gpm_Gpm_Open" >&5
9202 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
9203 if test $ac_cv_lib_gpm_Gpm_Open = yes; then
9204   echo "$as_me:9204: checking for initscr in -lgpm" >&5
9205 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
9206 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
9207   echo $ECHO_N "(cached) $ECHO_C" >&6
9208 else
9209   ac_check_lib_save_LIBS=$LIBS
9210 LIBS="-lgpm  $LIBS"
9211 cat >conftest.$ac_ext <<_ACEOF
9212 #line 9212 "configure"
9213 #include "confdefs.h"
9214
9215 /* Override any gcc2 internal prototype to avoid an error.  */
9216 #ifdef __cplusplus
9217 extern "C"
9218 #endif
9219 /* We use char because int might match the return type of a gcc2
9220    builtin and then its argument prototype would still apply.  */
9221 char initscr ();
9222 int
9223 main (void)
9224 {
9225 initscr ();
9226   ;
9227   return 0;
9228 }
9229 _ACEOF
9230 rm -f conftest.$ac_objext conftest$ac_exeext
9231 if { (eval echo "$as_me:9231: \"$ac_link\"") >&5
9232   (eval $ac_link) 2>&5
9233   ac_status=$?
9234   echo "$as_me:9234: \$? = $ac_status" >&5
9235   (exit $ac_status); } &&
9236          { ac_try='test -s conftest$ac_exeext'
9237   { (eval echo "$as_me:9237: \"$ac_try\"") >&5
9238   (eval $ac_try) 2>&5
9239   ac_status=$?
9240   echo "$as_me:9240: \$? = $ac_status" >&5
9241   (exit $ac_status); }; }; then
9242   ac_cv_lib_gpm_initscr=yes
9243 else
9244   echo "$as_me: failed program was:" >&5
9245 cat conftest.$ac_ext >&5
9246 ac_cv_lib_gpm_initscr=no
9247 fi
9248 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9249 LIBS=$ac_check_lib_save_LIBS
9250 fi
9251 echo "$as_me:9251: result: $ac_cv_lib_gpm_initscr" >&5
9252 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
9253 if test $ac_cv_lib_gpm_initscr = yes; then
9254   LIBS="$cf_ncurses_SAVE"
9255 else
9256   cf_ncurses_LIBS="-lgpm"
9257 fi
9258
9259 fi
9260
9261 case $host_os in
9262 (freebsd*)
9263         # This is only necessary if you are linking against an obsolete
9264         # version of ncurses (but it should do no harm, since it's static).
9265         if test "$cf_nculib_root" = ncurses ; then
9266                 echo "$as_me:9266: checking for tgoto in -lmytinfo" >&5
9267 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
9268 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
9269   echo $ECHO_N "(cached) $ECHO_C" >&6
9270 else
9271   ac_check_lib_save_LIBS=$LIBS
9272 LIBS="-lmytinfo  $LIBS"
9273 cat >conftest.$ac_ext <<_ACEOF
9274 #line 9274 "configure"
9275 #include "confdefs.h"
9276
9277 /* Override any gcc2 internal prototype to avoid an error.  */
9278 #ifdef __cplusplus
9279 extern "C"
9280 #endif
9281 /* We use char because int might match the return type of a gcc2
9282    builtin and then its argument prototype would still apply.  */
9283 char tgoto ();
9284 int
9285 main (void)
9286 {
9287 tgoto ();
9288   ;
9289   return 0;
9290 }
9291 _ACEOF
9292 rm -f conftest.$ac_objext conftest$ac_exeext
9293 if { (eval echo "$as_me:9293: \"$ac_link\"") >&5
9294   (eval $ac_link) 2>&5
9295   ac_status=$?
9296   echo "$as_me:9296: \$? = $ac_status" >&5
9297   (exit $ac_status); } &&
9298          { ac_try='test -s conftest$ac_exeext'
9299   { (eval echo "$as_me:9299: \"$ac_try\"") >&5
9300   (eval $ac_try) 2>&5
9301   ac_status=$?
9302   echo "$as_me:9302: \$? = $ac_status" >&5
9303   (exit $ac_status); }; }; then
9304   ac_cv_lib_mytinfo_tgoto=yes
9305 else
9306   echo "$as_me: failed program was:" >&5
9307 cat conftest.$ac_ext >&5
9308 ac_cv_lib_mytinfo_tgoto=no
9309 fi
9310 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9311 LIBS=$ac_check_lib_save_LIBS
9312 fi
9313 echo "$as_me:9313: result: $ac_cv_lib_mytinfo_tgoto" >&5
9314 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
9315 if test $ac_cv_lib_mytinfo_tgoto = yes; then
9316   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
9317 fi
9318
9319         fi
9320         ;;
9321 esac
9322
9323 cf_add_libs="$LIBS"
9324 # reverse order
9325 cf_add_0lib=
9326 for cf_add_1lib in $cf_ncurses_LIBS; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
9327 # filter duplicates
9328 for cf_add_1lib in $cf_add_0lib; do
9329         for cf_add_2lib in $cf_add_libs; do
9330                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
9331                         cf_add_1lib=
9332                         break
9333                 fi
9334         done
9335         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
9336 done
9337 LIBS="$cf_add_libs"
9338
9339 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
9340 then
9341
9342 cf_add_libs="$LIBS"
9343 # reverse order
9344 cf_add_0lib=
9345 for cf_add_1lib in -l$cf_nculib_root; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
9346 # filter duplicates
9347 for cf_add_1lib in $cf_add_0lib; do
9348         for cf_add_2lib in $cf_add_libs; do
9349                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
9350                         cf_add_1lib=
9351                         break
9352                 fi
9353         done
9354         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
9355 done
9356 LIBS="$cf_add_libs"
9357
9358 else
9359
9360         eval 'cf_cv_have_lib_'$cf_nculib_root'=no'
9361         cf_libdir=""
9362         echo "$as_me:9362: checking for initscr" >&5
9363 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
9364 if test "${ac_cv_func_initscr+set}" = set; then
9365   echo $ECHO_N "(cached) $ECHO_C" >&6
9366 else
9367   cat >conftest.$ac_ext <<_ACEOF
9368 #line 9368 "configure"
9369 #include "confdefs.h"
9370 #define initscr autoconf_temporary
9371 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
9372 #undef initscr
9373
9374 #ifdef __cplusplus
9375 extern "C"
9376 #endif
9377
9378 /* We use char because int might match the return type of a gcc2
9379    builtin and then its argument prototype would still apply.  */
9380 char initscr (void);
9381
9382 int
9383 main (void)
9384 {
9385
9386 /* The GNU C library defines stubs for functions which it implements
9387     to always fail with ENOSYS.  Some functions are actually named
9388     something starting with __ and the normal name is an alias.  */
9389 #if defined (__stub_initscr) || defined (__stub___initscr)
9390 #error found stub for initscr
9391 #endif
9392
9393         return initscr ();
9394   ;
9395   return 0;
9396 }
9397 _ACEOF
9398 rm -f conftest.$ac_objext conftest$ac_exeext
9399 if { (eval echo "$as_me:9399: \"$ac_link\"") >&5
9400   (eval $ac_link) 2>&5
9401   ac_status=$?
9402   echo "$as_me:9402: \$? = $ac_status" >&5
9403   (exit $ac_status); } &&
9404          { ac_try='test -s conftest$ac_exeext'
9405   { (eval echo "$as_me:9405: \"$ac_try\"") >&5
9406   (eval $ac_try) 2>&5
9407   ac_status=$?
9408   echo "$as_me:9408: \$? = $ac_status" >&5
9409   (exit $ac_status); }; }; then
9410   ac_cv_func_initscr=yes
9411 else
9412   echo "$as_me: failed program was:" >&5
9413 cat conftest.$ac_ext >&5
9414 ac_cv_func_initscr=no
9415 fi
9416 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9417 fi
9418 echo "$as_me:9418: result: $ac_cv_func_initscr" >&5
9419 echo "${ECHO_T}$ac_cv_func_initscr" >&6
9420 if test $ac_cv_func_initscr = yes; then
9421   eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
9422 else
9423
9424                 cf_save_LIBS="$LIBS"
9425                 echo "$as_me:9425: checking for initscr in -l$cf_nculib_root" >&5
9426 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
9427                 LIBS="-l$cf_nculib_root $LIBS"
9428                 cat >conftest.$ac_ext <<_ACEOF
9429 #line 9429 "configure"
9430 #include "confdefs.h"
9431 #include <${cf_cv_ncurses_header:-curses.h}>
9432 int
9433 main (void)
9434 {
9435 initscr()
9436   ;
9437   return 0;
9438 }
9439 _ACEOF
9440 rm -f conftest.$ac_objext conftest$ac_exeext
9441 if { (eval echo "$as_me:9441: \"$ac_link\"") >&5
9442   (eval $ac_link) 2>&5
9443   ac_status=$?
9444   echo "$as_me:9444: \$? = $ac_status" >&5
9445   (exit $ac_status); } &&
9446          { ac_try='test -s conftest$ac_exeext'
9447   { (eval echo "$as_me:9447: \"$ac_try\"") >&5
9448   (eval $ac_try) 2>&5
9449   ac_status=$?
9450   echo "$as_me:9450: \$? = $ac_status" >&5
9451   (exit $ac_status); }; }; then
9452   echo "$as_me:9452: result: yes" >&5
9453 echo "${ECHO_T}yes" >&6
9454                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
9455
9456 else
9457   echo "$as_me: failed program was:" >&5
9458 cat conftest.$ac_ext >&5
9459 echo "$as_me:9459: result: no" >&5
9460 echo "${ECHO_T}no" >&6
9461
9462 cf_search=
9463 cf_library_path_list=""
9464 if test -n "${LDFLAGS}${LIBS}" ; then
9465         for cf_library_path in $LDFLAGS $LIBS
9466         do
9467                 case $cf_library_path in
9468                 (-L*)
9469                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
9470
9471 test "x$cf_library_path" != "xNONE" && \
9472 test -d "$cf_library_path" && \
9473  {
9474         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
9475         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
9476         test -d $cf_library_path/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
9477         test -d $cf_library_path/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
9478         test -d $cf_library_path/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
9479         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"
9480 }
9481
9482                         cf_library_path_list="$cf_library_path_list $cf_search"
9483                         ;;
9484                 esac
9485         done
9486 fi
9487
9488 cf_search=
9489
9490 test "x$prefix" != "xNONE" && \
9491 test -d "$prefix" && \
9492  {
9493         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
9494         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
9495         test -d $prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
9496         test -d $prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
9497         test -d $prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
9498         test -d $prefix/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
9499 }
9500
9501 for cf_subdir_prefix in \
9502         /usr \
9503         /usr/local \
9504         /usr/pkg \
9505         /opt \
9506         /opt/local \
9507         $HOME
9508 do
9509
9510 test "x$cf_subdir_prefix" != "x$prefix" && \
9511 test -d "$cf_subdir_prefix" && \
9512 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
9513         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
9514         test -d $cf_subdir_prefix/lib &&          cf_search="$cf_search $cf_subdir_prefix/lib"
9515         test -d $cf_subdir_prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root"
9516         test -d $cf_subdir_prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root/lib"
9517         test -d $cf_subdir_prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib"
9518         test -d $cf_subdir_prefix/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib/$cf_nculib_root"
9519 }
9520
9521 done
9522
9523 cf_search="$cf_library_path_list $cf_search"
9524
9525                         for cf_libdir in $cf_search
9526                         do
9527                                 echo "$as_me:9527: checking for -l$cf_nculib_root in $cf_libdir" >&5
9528 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
9529                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
9530                                 cat >conftest.$ac_ext <<_ACEOF
9531 #line 9531 "configure"
9532 #include "confdefs.h"
9533 #include <${cf_cv_ncurses_header:-curses.h}>
9534 int
9535 main (void)
9536 {
9537 initscr()
9538   ;
9539   return 0;
9540 }
9541 _ACEOF
9542 rm -f conftest.$ac_objext conftest$ac_exeext
9543 if { (eval echo "$as_me:9543: \"$ac_link\"") >&5
9544   (eval $ac_link) 2>&5
9545   ac_status=$?
9546   echo "$as_me:9546: \$? = $ac_status" >&5
9547   (exit $ac_status); } &&
9548          { ac_try='test -s conftest$ac_exeext'
9549   { (eval echo "$as_me:9549: \"$ac_try\"") >&5
9550   (eval $ac_try) 2>&5
9551   ac_status=$?
9552   echo "$as_me:9552: \$? = $ac_status" >&5
9553   (exit $ac_status); }; }; then
9554   echo "$as_me:9554: result: yes" >&5
9555 echo "${ECHO_T}yes" >&6
9556                                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
9557                                          break
9558 else
9559   echo "$as_me: failed program was:" >&5
9560 cat conftest.$ac_ext >&5
9561 echo "$as_me:9561: result: no" >&5
9562 echo "${ECHO_T}no" >&6
9563                                          LIBS="$cf_save_LIBS"
9564 fi
9565 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9566                         done
9567
9568 fi
9569 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9570
9571 fi
9572
9573 eval 'cf_found_library=$cf_cv_have_lib_'$cf_nculib_root
9574
9575 if test $cf_found_library = no ; then
9576         { { echo "$as_me:9576: error: Cannot link $cf_nculib_root library" >&5
9577 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
9578    { (exit 1); exit 1; }; }
9579 fi
9580
9581 fi
9582
9583 if test -n "$cf_ncurses_LIBS" ; then
9584         echo "$as_me:9584: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
9585 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
9586         cf_ncurses_SAVE="$LIBS"
9587         for p in $cf_ncurses_LIBS ; do
9588                 q=`echo $LIBS | sed -e "s%$p %%" -e "s%$p$%%"`
9589                 if test "$q" != "$LIBS" ; then
9590                         LIBS="$q"
9591                 fi
9592         done
9593         cat >conftest.$ac_ext <<_ACEOF
9594 #line 9594 "configure"
9595 #include "confdefs.h"
9596 #include <${cf_cv_ncurses_header:-curses.h}>
9597 int
9598 main (void)
9599 {
9600 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
9601   ;
9602   return 0;
9603 }
9604 _ACEOF
9605 rm -f conftest.$ac_objext conftest$ac_exeext
9606 if { (eval echo "$as_me:9606: \"$ac_link\"") >&5
9607   (eval $ac_link) 2>&5
9608   ac_status=$?
9609   echo "$as_me:9609: \$? = $ac_status" >&5
9610   (exit $ac_status); } &&
9611          { ac_try='test -s conftest$ac_exeext'
9612   { (eval echo "$as_me:9612: \"$ac_try\"") >&5
9613   (eval $ac_try) 2>&5
9614   ac_status=$?
9615   echo "$as_me:9615: \$? = $ac_status" >&5
9616   (exit $ac_status); }; }; then
9617   echo "$as_me:9617: result: yes" >&5
9618 echo "${ECHO_T}yes" >&6
9619 else
9620   echo "$as_me: failed program was:" >&5
9621 cat conftest.$ac_ext >&5
9622 echo "$as_me:9622: result: no" >&5
9623 echo "${ECHO_T}no" >&6
9624                  LIBS="$cf_ncurses_SAVE"
9625 fi
9626 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9627 fi
9628
9629 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
9630
9631 cat >>confdefs.h <<EOF
9632 #define $cf_nculib_ROOT 1
9633 EOF
9634
9635         fi
9636 else
9637         NCURSES_CONFIG=none
9638 fi
9639
9640         ;;
9641 (ncurses*)
9642
9643 cf_ncuconfig_root=$cf_cv_screen
9644 cf_have_ncuconfig=no
9645
9646 if test "x${PKG_CONFIG:=none}" != xnone; then
9647         echo "$as_me:9647: checking pkg-config for $cf_ncuconfig_root" >&5
9648 echo $ECHO_N "checking pkg-config for $cf_ncuconfig_root... $ECHO_C" >&6
9649         if "$PKG_CONFIG" --exists $cf_ncuconfig_root ; then
9650                 echo "$as_me:9650: result: yes" >&5
9651 echo "${ECHO_T}yes" >&6
9652
9653                 echo "$as_me:9653: checking if the $cf_ncuconfig_root package files work" >&5
9654 echo $ECHO_N "checking if the $cf_ncuconfig_root package files work... $ECHO_C" >&6
9655                 cf_have_ncuconfig=unknown
9656
9657                 cf_save_CFLAGS="$CFLAGS"
9658                 cf_save_CPPFLAGS="$CPPFLAGS"
9659                 cf_save_LIBS="$LIBS"
9660
9661                 cf_pkg_cflags=`$PKG_CONFIG --cflags $cf_ncuconfig_root`
9662                 cf_pkg_libs=`$PKG_CONFIG --libs $cf_ncuconfig_root`
9663
9664                 # while -W for passing linker flags is prevalent, it is not "standard".
9665                 # At least one wrapper for c89/c99 (in Apple's xcode) has its own
9666                 # incompatible _and_ non-standard -W option which gives an error.  Work
9667                 # around that pitfall.
9668                 case "x${CC}@@${cf_pkg_libs}@${cf_pkg_cflags}" in
9669                 (x*c[89]9@@*-W*)
9670
9671 cf_fix_cppflags=no
9672 cf_new_cflags=
9673 cf_new_cppflags=
9674 cf_new_extra_cppflags=
9675
9676 for cf_add_cflags in $cf_pkg_cflags
9677 do
9678 case $cf_fix_cppflags in
9679 (no)
9680         case $cf_add_cflags in
9681         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
9682                 case $cf_add_cflags in
9683                 (-D*)
9684                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
9685
9686                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
9687                                 && test -z "${cf_tst_cflags}" \
9688                                 && cf_fix_cppflags=yes
9689
9690                         if test $cf_fix_cppflags = yes ; then
9691
9692         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9693         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9694
9695                                 continue
9696                         elif test "${cf_tst_cflags}" = "\"'" ; then
9697
9698         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9699         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9700
9701                                 continue
9702                         fi
9703                         ;;
9704                 esac
9705                 case "$CPPFLAGS" in
9706                 (*$cf_add_cflags)
9707                         ;;
9708                 (*)
9709                         case $cf_add_cflags in
9710                         (-D*)
9711                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
9712
9713 CPPFLAGS=`echo "$CPPFLAGS" | \
9714         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
9715                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
9716
9717                                 ;;
9718                         esac
9719
9720         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
9721         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
9722
9723                         ;;
9724                 esac
9725                 ;;
9726         (*)
9727
9728         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
9729         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
9730
9731                 ;;
9732         esac
9733         ;;
9734 (yes)
9735
9736         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9737         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9738
9739         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
9740
9741         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
9742                 && test -z "${cf_tst_cflags}" \
9743                 && cf_fix_cppflags=no
9744         ;;
9745 esac
9746 done
9747
9748 if test -n "$cf_new_cflags" ; then
9749
9750         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
9751         CFLAGS="${CFLAGS}$cf_new_cflags"
9752
9753 fi
9754
9755 if test -n "$cf_new_cppflags" ; then
9756
9757         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
9758         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
9759
9760 fi
9761
9762 if test -n "$cf_new_extra_cppflags" ; then
9763
9764         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
9765         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
9766
9767 fi
9768
9769 cf_add_libs="$LIBS"
9770 # reverse order
9771 cf_add_0lib=
9772 for cf_add_1lib in $cf_pkg_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
9773 # filter duplicates
9774 for cf_add_1lib in $cf_add_0lib; do
9775         for cf_add_2lib in $cf_add_libs; do
9776                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
9777                         cf_add_1lib=
9778                         break
9779                 fi
9780         done
9781         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
9782 done
9783 LIBS="$cf_add_libs"
9784
9785                         cat >conftest.$ac_ext <<_ACEOF
9786 #line 9786 "configure"
9787 #include "confdefs.h"
9788 #include <${cf_cv_ncurses_header:-curses.h}>
9789 int
9790 main (void)
9791 {
9792 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
9793   ;
9794   return 0;
9795 }
9796 _ACEOF
9797 rm -f conftest.$ac_objext conftest$ac_exeext
9798 if { (eval echo "$as_me:9798: \"$ac_link\"") >&5
9799   (eval $ac_link) 2>&5
9800   ac_status=$?
9801   echo "$as_me:9801: \$? = $ac_status" >&5
9802   (exit $ac_status); } &&
9803          { ac_try='test -s conftest$ac_exeext'
9804   { (eval echo "$as_me:9804: \"$ac_try\"") >&5
9805   (eval $ac_try) 2>&5
9806   ac_status=$?
9807   echo "$as_me:9807: \$? = $ac_status" >&5
9808   (exit $ac_status); }; }; then
9809   if test "$cross_compiling" = yes; then
9810   cf_test_ncuconfig=maybe
9811 else
9812   cat >conftest.$ac_ext <<_ACEOF
9813 #line 9813 "configure"
9814 #include "confdefs.h"
9815 #include <${cf_cv_ncurses_header:-curses.h}>
9816                                         int main(void)
9817                                         { char *xx = curses_version(); return (xx == 0); }
9818 _ACEOF
9819 rm -f conftest$ac_exeext
9820 if { (eval echo "$as_me:9820: \"$ac_link\"") >&5
9821   (eval $ac_link) 2>&5
9822   ac_status=$?
9823   echo "$as_me:9823: \$? = $ac_status" >&5
9824   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
9825   { (eval echo "$as_me:9825: \"$ac_try\"") >&5
9826   (eval $ac_try) 2>&5
9827   ac_status=$?
9828   echo "$as_me:9828: \$? = $ac_status" >&5
9829   (exit $ac_status); }; }; then
9830   cf_test_ncuconfig=yes
9831 else
9832   echo "$as_me: program exited with status $ac_status" >&5
9833 echo "$as_me: failed program was:" >&5
9834 cat conftest.$ac_ext >&5
9835 cf_test_ncuconfig=no
9836 fi
9837 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
9838 fi
9839 else
9840   echo "$as_me: failed program was:" >&5
9841 cat conftest.$ac_ext >&5
9842 cf_test_ncuconfig=no
9843 fi
9844 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9845
9846                         CFLAGS="$cf_save_CFLAGS"
9847                         CPPFLAGS="$cf_save_CPPFLAGS"
9848                         LIBS="$cf_save_LIBS"
9849
9850                         if test "x$cf_test_ncuconfig" != xyes; then
9851                                 cf_temp=`echo "x$cf_pkg_cflags" | sed -e s/^x// -e 's/-W[^      ]*//g'`
9852                                 cf_pkg_cflags="$cf_temp"
9853                                 cf_temp=`echo "x$cf_pkg_libs" | sed -e s/^x// -e 's/-W[^        ]*//g'`
9854                                 cf_pkg_libs="$cf_temp"
9855                         fi
9856                         ;;
9857                 esac
9858
9859 cf_fix_cppflags=no
9860 cf_new_cflags=
9861 cf_new_cppflags=
9862 cf_new_extra_cppflags=
9863
9864 for cf_add_cflags in $cf_pkg_cflags
9865 do
9866 case $cf_fix_cppflags in
9867 (no)
9868         case $cf_add_cflags in
9869         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
9870                 case $cf_add_cflags in
9871                 (-D*)
9872                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
9873
9874                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
9875                                 && test -z "${cf_tst_cflags}" \
9876                                 && cf_fix_cppflags=yes
9877
9878                         if test $cf_fix_cppflags = yes ; then
9879
9880         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9881         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9882
9883                                 continue
9884                         elif test "${cf_tst_cflags}" = "\"'" ; then
9885
9886         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9887         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9888
9889                                 continue
9890                         fi
9891                         ;;
9892                 esac
9893                 case "$CPPFLAGS" in
9894                 (*$cf_add_cflags)
9895                         ;;
9896                 (*)
9897                         case $cf_add_cflags in
9898                         (-D*)
9899                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
9900
9901 CPPFLAGS=`echo "$CPPFLAGS" | \
9902         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
9903                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
9904
9905                                 ;;
9906                         esac
9907
9908         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
9909         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
9910
9911                         ;;
9912                 esac
9913                 ;;
9914         (*)
9915
9916         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
9917         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
9918
9919                 ;;
9920         esac
9921         ;;
9922 (yes)
9923
9924         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9925         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9926
9927         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
9928
9929         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
9930                 && test -z "${cf_tst_cflags}" \
9931                 && cf_fix_cppflags=no
9932         ;;
9933 esac
9934 done
9935
9936 if test -n "$cf_new_cflags" ; then
9937
9938         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
9939         CFLAGS="${CFLAGS}$cf_new_cflags"
9940
9941 fi
9942
9943 if test -n "$cf_new_cppflags" ; then
9944
9945         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
9946         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
9947
9948 fi
9949
9950 if test -n "$cf_new_extra_cppflags" ; then
9951
9952         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
9953         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
9954
9955 fi
9956
9957 cf_add_libs="$LIBS"
9958 # reverse order
9959 cf_add_0lib=
9960 for cf_add_1lib in $cf_pkg_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
9961 # filter duplicates
9962 for cf_add_1lib in $cf_add_0lib; do
9963         for cf_add_2lib in $cf_add_libs; do
9964                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
9965                         cf_add_1lib=
9966                         break
9967                 fi
9968         done
9969         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
9970 done
9971 LIBS="$cf_add_libs"
9972
9973                 cat >conftest.$ac_ext <<_ACEOF
9974 #line 9974 "configure"
9975 #include "confdefs.h"
9976 #include <${cf_cv_ncurses_header:-curses.h}>
9977 int
9978 main (void)
9979 {
9980 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
9981   ;
9982   return 0;
9983 }
9984 _ACEOF
9985 rm -f conftest.$ac_objext conftest$ac_exeext
9986 if { (eval echo "$as_me:9986: \"$ac_link\"") >&5
9987   (eval $ac_link) 2>&5
9988   ac_status=$?
9989   echo "$as_me:9989: \$? = $ac_status" >&5
9990   (exit $ac_status); } &&
9991          { ac_try='test -s conftest$ac_exeext'
9992   { (eval echo "$as_me:9992: \"$ac_try\"") >&5
9993   (eval $ac_try) 2>&5
9994   ac_status=$?
9995   echo "$as_me:9995: \$? = $ac_status" >&5
9996   (exit $ac_status); }; }; then
9997   if test "$cross_compiling" = yes; then
9998   cf_have_ncuconfig=maybe
9999 else
10000   cat >conftest.$ac_ext <<_ACEOF
10001 #line 10001 "configure"
10002 #include "confdefs.h"
10003 #include <${cf_cv_ncurses_header:-curses.h}>
10004                                 int main(void)
10005                                 { char *xx = curses_version(); return (xx == 0); }
10006 _ACEOF
10007 rm -f conftest$ac_exeext
10008 if { (eval echo "$as_me:10008: \"$ac_link\"") >&5
10009   (eval $ac_link) 2>&5
10010   ac_status=$?
10011   echo "$as_me:10011: \$? = $ac_status" >&5
10012   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
10013   { (eval echo "$as_me:10013: \"$ac_try\"") >&5
10014   (eval $ac_try) 2>&5
10015   ac_status=$?
10016   echo "$as_me:10016: \$? = $ac_status" >&5
10017   (exit $ac_status); }; }; then
10018   cf_have_ncuconfig=yes
10019 else
10020   echo "$as_me: program exited with status $ac_status" >&5
10021 echo "$as_me: failed program was:" >&5
10022 cat conftest.$ac_ext >&5
10023 cf_have_ncuconfig=no
10024 fi
10025 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
10026 fi
10027 else
10028   echo "$as_me: failed program was:" >&5
10029 cat conftest.$ac_ext >&5
10030 cf_have_ncuconfig=no
10031 fi
10032 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10033                 echo "$as_me:10033: result: $cf_have_ncuconfig" >&5
10034 echo "${ECHO_T}$cf_have_ncuconfig" >&6
10035                 test "$cf_have_ncuconfig" = maybe && cf_have_ncuconfig=yes
10036                 if test "$cf_have_ncuconfig" != "yes"
10037                 then
10038                         CPPFLAGS="$cf_save_CPPFLAGS"
10039                         LIBS="$cf_save_LIBS"
10040                         NCURSES_CONFIG_PKG=none
10041                 else
10042
10043 cat >>confdefs.h <<\EOF
10044 #define NCURSES 1
10045 EOF
10046
10047                         NCURSES_CONFIG_PKG=$cf_ncuconfig_root
10048
10049 echo "$as_me:10049: checking for terminfo header" >&5
10050 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
10051 if test "${cf_cv_term_header+set}" = set; then
10052   echo $ECHO_N "(cached) $ECHO_C" >&6
10053 else
10054
10055 case ${cf_cv_ncurses_header} in
10056 (*/ncurses.h|*/ncursesw.h)
10057         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
10058         ;;
10059 (*)
10060         cf_term_header=term.h
10061         ;;
10062 esac
10063
10064 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
10065 do
10066 cat >conftest.$ac_ext <<_ACEOF
10067 #line 10067 "configure"
10068 #include "confdefs.h"
10069 #include <stdio.h>
10070 #include <${cf_cv_ncurses_header:-curses.h}>
10071 #include <$cf_test>
10072
10073 int
10074 main (void)
10075 {
10076 int x = auto_left_margin; (void)x
10077   ;
10078   return 0;
10079 }
10080 _ACEOF
10081 rm -f conftest.$ac_objext
10082 if { (eval echo "$as_me:10082: \"$ac_compile\"") >&5
10083   (eval $ac_compile) 2>&5
10084   ac_status=$?
10085   echo "$as_me:10085: \$? = $ac_status" >&5
10086   (exit $ac_status); } &&
10087          { ac_try='test -s conftest.$ac_objext'
10088   { (eval echo "$as_me:10088: \"$ac_try\"") >&5
10089   (eval $ac_try) 2>&5
10090   ac_status=$?
10091   echo "$as_me:10091: \$? = $ac_status" >&5
10092   (exit $ac_status); }; }; then
10093
10094         cf_cv_term_header="$cf_test"
10095 else
10096   echo "$as_me: failed program was:" >&5
10097 cat conftest.$ac_ext >&5
10098
10099         cf_cv_term_header=unknown
10100
10101 fi
10102 rm -f conftest.$ac_objext conftest.$ac_ext
10103         test "$cf_cv_term_header" != unknown && break
10104 done
10105
10106 fi
10107 echo "$as_me:10107: result: $cf_cv_term_header" >&5
10108 echo "${ECHO_T}$cf_cv_term_header" >&6
10109
10110 # Set definitions to allow ifdef'ing to accommodate subdirectories
10111
10112 case $cf_cv_term_header in
10113 (*term.h)
10114
10115 cat >>confdefs.h <<\EOF
10116 #define HAVE_TERM_H 1
10117 EOF
10118
10119         ;;
10120 esac
10121
10122 case $cf_cv_term_header in
10123 (ncurses/term.h)
10124
10125 cat >>confdefs.h <<\EOF
10126 #define HAVE_NCURSES_TERM_H 1
10127 EOF
10128
10129         ;;
10130 (ncursesw/term.h)
10131
10132 cat >>confdefs.h <<\EOF
10133 #define HAVE_NCURSESW_TERM_H 1
10134 EOF
10135
10136         ;;
10137 esac
10138
10139                 fi
10140
10141         else
10142                 echo "$as_me:10142: result: no" >&5
10143 echo "${ECHO_T}no" >&6
10144                 NCURSES_CONFIG_PKG=none
10145         fi
10146 else
10147         NCURSES_CONFIG_PKG=none
10148 fi
10149
10150 if test "x$cf_have_ncuconfig" = "xno"; then
10151         cf_ncurses_config="${cf_ncuconfig_root}${NCURSES_CONFIG_SUFFIX}-config"; echo "Looking for ${cf_ncurses_config}"
10152
10153 if test -n "$ac_tool_prefix"; then
10154   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
10155   do
10156     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
10157 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
10158 echo "$as_me:10158: checking for $ac_word" >&5
10159 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
10160 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
10161   echo $ECHO_N "(cached) $ECHO_C" >&6
10162 else
10163   if test -n "$NCURSES_CONFIG"; then
10164   ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
10165 else
10166   ac_save_IFS=$IFS; IFS=$ac_path_separator
10167 ac_dummy="$PATH"
10168 for ac_dir in $ac_dummy; do
10169   IFS=$ac_save_IFS
10170   test -z "$ac_dir" && ac_dir=.
10171   $as_executable_p "$ac_dir/$ac_word" || continue
10172 ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
10173 echo "$as_me:10173: found $ac_dir/$ac_word" >&5
10174 break
10175 done
10176
10177 fi
10178 fi
10179 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
10180 if test -n "$NCURSES_CONFIG"; then
10181   echo "$as_me:10181: result: $NCURSES_CONFIG" >&5
10182 echo "${ECHO_T}$NCURSES_CONFIG" >&6
10183 else
10184   echo "$as_me:10184: result: no" >&5
10185 echo "${ECHO_T}no" >&6
10186 fi
10187
10188     test -n "$NCURSES_CONFIG" && break
10189   done
10190 fi
10191 if test -z "$NCURSES_CONFIG"; then
10192   ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
10193   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
10194 do
10195   # Extract the first word of "$ac_prog", so it can be a program name with args.
10196 set dummy $ac_prog; ac_word=$2
10197 echo "$as_me:10197: checking for $ac_word" >&5
10198 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
10199 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
10200   echo $ECHO_N "(cached) $ECHO_C" >&6
10201 else
10202   if test -n "$ac_ct_NCURSES_CONFIG"; then
10203   ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
10204 else
10205   ac_save_IFS=$IFS; IFS=$ac_path_separator
10206 ac_dummy="$PATH"
10207 for ac_dir in $ac_dummy; do
10208   IFS=$ac_save_IFS
10209   test -z "$ac_dir" && ac_dir=.
10210   $as_executable_p "$ac_dir/$ac_word" || continue
10211 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
10212 echo "$as_me:10212: found $ac_dir/$ac_word" >&5
10213 break
10214 done
10215
10216 fi
10217 fi
10218 ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
10219 if test -n "$ac_ct_NCURSES_CONFIG"; then
10220   echo "$as_me:10220: result: $ac_ct_NCURSES_CONFIG" >&5
10221 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
10222 else
10223   echo "$as_me:10223: result: no" >&5
10224 echo "${ECHO_T}no" >&6
10225 fi
10226
10227   test -n "$ac_ct_NCURSES_CONFIG" && break
10228 done
10229 test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
10230
10231   NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
10232 fi
10233
10234         if test "$NCURSES_CONFIG" != none ; then
10235
10236 cf_fix_cppflags=no
10237 cf_new_cflags=
10238 cf_new_cppflags=
10239 cf_new_extra_cppflags=
10240
10241 for cf_add_cflags in `$NCURSES_CONFIG --cflags`
10242 do
10243 case $cf_fix_cppflags in
10244 (no)
10245         case $cf_add_cflags in
10246         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
10247                 case $cf_add_cflags in
10248                 (-D*)
10249                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
10250
10251                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10252                                 && test -z "${cf_tst_cflags}" \
10253                                 && cf_fix_cppflags=yes
10254
10255                         if test $cf_fix_cppflags = yes ; then
10256
10257         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
10258         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
10259
10260                                 continue
10261                         elif test "${cf_tst_cflags}" = "\"'" ; then
10262
10263         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
10264         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
10265
10266                                 continue
10267                         fi
10268                         ;;
10269                 esac
10270                 case "$CPPFLAGS" in
10271                 (*$cf_add_cflags)
10272                         ;;
10273                 (*)
10274                         case $cf_add_cflags in
10275                         (-D*)
10276                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
10277
10278 CPPFLAGS=`echo "$CPPFLAGS" | \
10279         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
10280                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
10281
10282                                 ;;
10283                         esac
10284
10285         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
10286         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
10287
10288                         ;;
10289                 esac
10290                 ;;
10291         (*)
10292
10293         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
10294         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
10295
10296                 ;;
10297         esac
10298         ;;
10299 (yes)
10300
10301         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
10302         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
10303
10304         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
10305
10306         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10307                 && test -z "${cf_tst_cflags}" \
10308                 && cf_fix_cppflags=no
10309         ;;
10310 esac
10311 done
10312
10313 if test -n "$cf_new_cflags" ; then
10314
10315         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
10316         CFLAGS="${CFLAGS}$cf_new_cflags"
10317
10318 fi
10319
10320 if test -n "$cf_new_cppflags" ; then
10321
10322         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
10323         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
10324
10325 fi
10326
10327 if test -n "$cf_new_extra_cppflags" ; then
10328
10329         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
10330         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
10331
10332 fi
10333
10334 cf_add_libs="$LIBS"
10335 # reverse order
10336 cf_add_0lib=
10337 for cf_add_1lib in `$NCURSES_CONFIG --libs`; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
10338 # filter duplicates
10339 for cf_add_1lib in $cf_add_0lib; do
10340         for cf_add_2lib in $cf_add_libs; do
10341                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
10342                         cf_add_1lib=
10343                         break
10344                 fi
10345         done
10346         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
10347 done
10348 LIBS="$cf_add_libs"
10349
10350                 # even with config script, some packages use no-override for curses.h
10351
10352 echo "$as_me:10352: checking if we have identified curses headers" >&5
10353 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
10354 if test "${cf_cv_ncurses_header+set}" = set; then
10355   echo $ECHO_N "(cached) $ECHO_C" >&6
10356 else
10357
10358 cf_cv_ncurses_header=none
10359 for cf_header in \
10360         ncurses.h $cf_cv_screen/ncurses.h \
10361         curses.h $cf_cv_screen/curses.h
10362 do
10363 cat >conftest.$ac_ext <<_ACEOF
10364 #line 10364 "configure"
10365 #include "confdefs.h"
10366 #include <${cf_header}>
10367 int
10368 main (void)
10369 {
10370 initscr(); tgoto("?", 0,0)
10371   ;
10372   return 0;
10373 }
10374 _ACEOF
10375 rm -f conftest.$ac_objext
10376 if { (eval echo "$as_me:10376: \"$ac_compile\"") >&5
10377   (eval $ac_compile) 2>&5
10378   ac_status=$?
10379   echo "$as_me:10379: \$? = $ac_status" >&5
10380   (exit $ac_status); } &&
10381          { ac_try='test -s conftest.$ac_objext'
10382   { (eval echo "$as_me:10382: \"$ac_try\"") >&5
10383   (eval $ac_try) 2>&5
10384   ac_status=$?
10385   echo "$as_me:10385: \$? = $ac_status" >&5
10386   (exit $ac_status); }; }; then
10387   cf_cv_ncurses_header=$cf_header; break
10388 else
10389   echo "$as_me: failed program was:" >&5
10390 cat conftest.$ac_ext >&5
10391 fi
10392 rm -f conftest.$ac_objext conftest.$ac_ext
10393 done
10394
10395 fi
10396 echo "$as_me:10396: result: $cf_cv_ncurses_header" >&5
10397 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
10398
10399 if test "$cf_cv_ncurses_header" = none ; then
10400         { { echo "$as_me:10400: error: No curses header-files found" >&5
10401 echo "$as_me: error: No curses header-files found" >&2;}
10402    { (exit 1); exit 1; }; }
10403 fi
10404
10405 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
10406
10407 for ac_header in $cf_cv_ncurses_header
10408 do
10409 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
10410 echo "$as_me:10410: checking for $ac_header" >&5
10411 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
10412 if eval "test \"\${$as_ac_Header+set}\" = set"; then
10413   echo $ECHO_N "(cached) $ECHO_C" >&6
10414 else
10415   cat >conftest.$ac_ext <<_ACEOF
10416 #line 10416 "configure"
10417 #include "confdefs.h"
10418 #include <$ac_header>
10419 _ACEOF
10420 if { (eval echo "$as_me:10420: \"$ac_cpp conftest.$ac_ext\"") >&5
10421   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
10422   ac_status=$?
10423   egrep -v '^ *\+' conftest.er1 >conftest.err
10424   rm -f conftest.er1
10425   cat conftest.err >&5
10426   echo "$as_me:10426: \$? = $ac_status" >&5
10427   (exit $ac_status); } >/dev/null; then
10428   if test -s conftest.err; then
10429     ac_cpp_err=$ac_c_preproc_warn_flag
10430   else
10431     ac_cpp_err=
10432   fi
10433 else
10434   ac_cpp_err=yes
10435 fi
10436 if test -z "$ac_cpp_err"; then
10437   eval "$as_ac_Header=yes"
10438 else
10439   echo "$as_me: failed program was:" >&5
10440   cat conftest.$ac_ext >&5
10441   eval "$as_ac_Header=no"
10442 fi
10443 rm -f conftest.err conftest.$ac_ext
10444 fi
10445 echo "$as_me:10445: result: `eval echo '${'$as_ac_Header'}'`" >&5
10446 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
10447 if test `eval echo '${'$as_ac_Header'}'` = yes; then
10448   cat >>confdefs.h <<EOF
10449 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
10450 EOF
10451
10452 fi
10453 done
10454
10455 cat >>confdefs.h <<\EOF
10456 #define NCURSES 1
10457 EOF
10458
10459 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
10460
10461                 cat >>confdefs.h <<EOF
10462 #define $cf_nculib_ROOT 1
10463 EOF
10464
10465                                 cf_cv_ncurses_version=`$NCURSES_CONFIG --version`
10466
10467         else
10468
10469 cf_ncuhdr_root=$cf_cv_screen
10470
10471 test -n "$cf_cv_curses_dir" && \
10472 test "$cf_cv_curses_dir" != "no" && { \
10473
10474 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
10475   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
10476   do
10477         while test $cf_add_incdir != /usr/include
10478         do
10479           if test -d $cf_add_incdir
10480           then
10481                 cf_have_incdir=no
10482                 if test -n "$CFLAGS$CPPFLAGS" ; then
10483                   # a loop is needed to ensure we can add subdirs of existing dirs
10484                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
10485                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
10486                           cf_have_incdir=yes; break
10487                         fi
10488                   done
10489                 fi
10490
10491                 if test "$cf_have_incdir" = no ; then
10492                   if test "$cf_add_incdir" = /usr/local/include ; then
10493                         if test "$GCC" = yes
10494                         then
10495                           cf_save_CPPFLAGS=$CPPFLAGS
10496
10497         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
10498         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
10499
10500                           cat >conftest.$ac_ext <<_ACEOF
10501 #line 10501 "configure"
10502 #include "confdefs.h"
10503 #include <stdio.h>
10504 int
10505 main (void)
10506 {
10507 printf("Hello")
10508   ;
10509   return 0;
10510 }
10511 _ACEOF
10512 rm -f conftest.$ac_objext
10513 if { (eval echo "$as_me:10513: \"$ac_compile\"") >&5
10514   (eval $ac_compile) 2>&5
10515   ac_status=$?
10516   echo "$as_me:10516: \$? = $ac_status" >&5
10517   (exit $ac_status); } &&
10518          { ac_try='test -s conftest.$ac_objext'
10519   { (eval echo "$as_me:10519: \"$ac_try\"") >&5
10520   (eval $ac_try) 2>&5
10521   ac_status=$?
10522   echo "$as_me:10522: \$? = $ac_status" >&5
10523   (exit $ac_status); }; }; then
10524   :
10525 else
10526   echo "$as_me: failed program was:" >&5
10527 cat conftest.$ac_ext >&5
10528 cf_have_incdir=yes
10529 fi
10530 rm -f conftest.$ac_objext conftest.$ac_ext
10531                           CPPFLAGS=$cf_save_CPPFLAGS
10532                         fi
10533                   fi
10534                 fi
10535
10536                 if test "$cf_have_incdir" = no ; then
10537                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
10538
10539 echo "${as_me:-configure}:10539: testing adding $cf_add_incdir to include-path ..." 1>&5
10540
10541                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
10542
10543                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
10544                   test "$cf_top_incdir" = "$cf_add_incdir" && break
10545                   cf_add_incdir="$cf_top_incdir"
10546                 else
10547                   break
10548                 fi
10549           else
10550                 break
10551           fi
10552         done
10553   done
10554 fi
10555
10556 }
10557
10558 echo "$as_me:10558: checking for $cf_ncuhdr_root header in include-path" >&5
10559 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
10560 if test "${cf_cv_ncurses_h+set}" = set; then
10561   echo $ECHO_N "(cached) $ECHO_C" >&6
10562 else
10563
10564         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
10565         ( test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw ) && cf_header_list="$cf_header_list curses.h ncurses.h"
10566         for cf_header in $cf_header_list
10567         do
10568
10569         cat >conftest.$ac_ext <<_ACEOF
10570 #line 10570 "configure"
10571 #include "confdefs.h"
10572
10573 #include <$cf_header>
10574 int
10575 main (void)
10576 {
10577
10578 #ifdef NCURSES_VERSION
10579
10580 printf("%s\n", NCURSES_VERSION);
10581 #else
10582 #ifdef __NCURSES_H
10583 printf("old\n");
10584 #else
10585         make an error
10586 #endif
10587 #endif
10588
10589   ;
10590   return 0;
10591 }
10592 _ACEOF
10593 rm -f conftest.$ac_objext
10594 if { (eval echo "$as_me:10594: \"$ac_compile\"") >&5
10595   (eval $ac_compile) 2>&5
10596   ac_status=$?
10597   echo "$as_me:10597: \$? = $ac_status" >&5
10598   (exit $ac_status); } &&
10599          { ac_try='test -s conftest.$ac_objext'
10600   { (eval echo "$as_me:10600: \"$ac_try\"") >&5
10601   (eval $ac_try) 2>&5
10602   ac_status=$?
10603   echo "$as_me:10603: \$? = $ac_status" >&5
10604   (exit $ac_status); }; }; then
10605   cf_cv_ncurses_h=$cf_header
10606
10607 else
10608   echo "$as_me: failed program was:" >&5
10609 cat conftest.$ac_ext >&5
10610 cf_cv_ncurses_h=no
10611 fi
10612 rm -f conftest.$ac_objext conftest.$ac_ext
10613
10614                 test "$cf_cv_ncurses_h" != no && break
10615         done
10616
10617 fi
10618 echo "$as_me:10618: result: $cf_cv_ncurses_h" >&5
10619 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
10620
10621 if test "$cf_cv_ncurses_h" != no ; then
10622         cf_cv_ncurses_header=$cf_cv_ncurses_h
10623 else
10624
10625 echo "$as_me:10625: checking for $cf_ncuhdr_root include-path" >&5
10626 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
10627 if test "${cf_cv_ncurses_h2+set}" = set; then
10628   echo $ECHO_N "(cached) $ECHO_C" >&6
10629 else
10630
10631         test -n "$verbose" && echo
10632
10633 cf_search=
10634
10635 # collect the current set of include-directories from compiler flags
10636 cf_header_path_list=""
10637 if test -n "${CFLAGS}${CPPFLAGS}" ; then
10638         for cf_header_path in $CPPFLAGS $CFLAGS
10639         do
10640                 case $cf_header_path in
10641                 (-I*)
10642                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
10643
10644 test "x$cf_header_path" != "xNONE" && \
10645 test -d "$cf_header_path" && \
10646  {
10647         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
10648         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
10649         test -d $cf_header_path/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
10650         test -d $cf_header_path/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
10651         test -d $cf_header_path/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
10652         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"
10653 }
10654
10655                         cf_header_path_list="$cf_header_path_list $cf_search"
10656                         ;;
10657                 esac
10658         done
10659 fi
10660
10661 # add the variations for the package we are looking for
10662
10663 cf_search=
10664
10665 test "x$prefix" != "xNONE" && \
10666 test -d "$prefix" && \
10667  {
10668         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
10669         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
10670         test -d $prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
10671         test -d $prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
10672         test -d $prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
10673         test -d $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
10674 }
10675
10676 for cf_subdir_prefix in \
10677         /usr \
10678         /usr/local \
10679         /usr/pkg \
10680         /opt \
10681         /opt/local \
10682         $HOME
10683 do
10684
10685 test "x$cf_subdir_prefix" != "x$prefix" && \
10686 test -d "$cf_subdir_prefix" && \
10687 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
10688         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
10689         test -d $cf_subdir_prefix/include &&          cf_search="$cf_search $cf_subdir_prefix/include"
10690         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root"
10691         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root/include"
10692         test -d $cf_subdir_prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include"
10693         test -d $cf_subdir_prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
10694 }
10695
10696 done
10697
10698 test "$includedir" != NONE && \
10699 test "$includedir" != "/usr/include" && \
10700 test -d "$includedir" && {
10701         test -d $includedir &&    cf_search="$cf_search $includedir"
10702         test -d $includedir/$cf_ncuhdr_root && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
10703 }
10704
10705 test "$oldincludedir" != NONE && \
10706 test "$oldincludedir" != "/usr/include" && \
10707 test -d "$oldincludedir" && {
10708         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
10709         test -d $oldincludedir/$cf_ncuhdr_root && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
10710 }
10711
10712 cf_search="$cf_search $cf_header_path_list"
10713
10714         test -n "$verbose" && echo search path $cf_search
10715         cf_save2_CPPFLAGS="$CPPFLAGS"
10716         for cf_incdir in $cf_search
10717         do
10718
10719 if test -n "$cf_incdir" ; then
10720   for cf_add_incdir in $cf_incdir
10721   do
10722         while test $cf_add_incdir != /usr/include
10723         do
10724           if test -d $cf_add_incdir
10725           then
10726                 cf_have_incdir=no
10727                 if test -n "$CFLAGS$CPPFLAGS" ; then
10728                   # a loop is needed to ensure we can add subdirs of existing dirs
10729                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
10730                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
10731                           cf_have_incdir=yes; break
10732                         fi
10733                   done
10734                 fi
10735
10736                 if test "$cf_have_incdir" = no ; then
10737                   if test "$cf_add_incdir" = /usr/local/include ; then
10738                         if test "$GCC" = yes
10739                         then
10740                           cf_save_CPPFLAGS=$CPPFLAGS
10741
10742         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
10743         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
10744
10745                           cat >conftest.$ac_ext <<_ACEOF
10746 #line 10746 "configure"
10747 #include "confdefs.h"
10748 #include <stdio.h>
10749 int
10750 main (void)
10751 {
10752 printf("Hello")
10753   ;
10754   return 0;
10755 }
10756 _ACEOF
10757 rm -f conftest.$ac_objext
10758 if { (eval echo "$as_me:10758: \"$ac_compile\"") >&5
10759   (eval $ac_compile) 2>&5
10760   ac_status=$?
10761   echo "$as_me:10761: \$? = $ac_status" >&5
10762   (exit $ac_status); } &&
10763          { ac_try='test -s conftest.$ac_objext'
10764   { (eval echo "$as_me:10764: \"$ac_try\"") >&5
10765   (eval $ac_try) 2>&5
10766   ac_status=$?
10767   echo "$as_me:10767: \$? = $ac_status" >&5
10768   (exit $ac_status); }; }; then
10769   :
10770 else
10771   echo "$as_me: failed program was:" >&5
10772 cat conftest.$ac_ext >&5
10773 cf_have_incdir=yes
10774 fi
10775 rm -f conftest.$ac_objext conftest.$ac_ext
10776                           CPPFLAGS=$cf_save_CPPFLAGS
10777                         fi
10778                   fi
10779                 fi
10780
10781                 if test "$cf_have_incdir" = no ; then
10782                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
10783
10784 echo "${as_me:-configure}:10784: testing adding $cf_add_incdir to include-path ..." 1>&5
10785
10786                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
10787
10788                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
10789                   test "$cf_top_incdir" = "$cf_add_incdir" && break
10790                   cf_add_incdir="$cf_top_incdir"
10791                 else
10792                   break
10793                 fi
10794           else
10795                 break
10796           fi
10797         done
10798   done
10799 fi
10800
10801                 for cf_header in \
10802                         ncurses.h \
10803                         curses.h
10804                 do
10805
10806         cat >conftest.$ac_ext <<_ACEOF
10807 #line 10807 "configure"
10808 #include "confdefs.h"
10809
10810 #include <$cf_header>
10811 int
10812 main (void)
10813 {
10814
10815 #ifdef NCURSES_VERSION
10816
10817 printf("%s\n", NCURSES_VERSION);
10818 #else
10819 #ifdef __NCURSES_H
10820 printf("old\n");
10821 #else
10822         make an error
10823 #endif
10824 #endif
10825
10826   ;
10827   return 0;
10828 }
10829 _ACEOF
10830 rm -f conftest.$ac_objext
10831 if { (eval echo "$as_me:10831: \"$ac_compile\"") >&5
10832   (eval $ac_compile) 2>&5
10833   ac_status=$?
10834   echo "$as_me:10834: \$? = $ac_status" >&5
10835   (exit $ac_status); } &&
10836          { ac_try='test -s conftest.$ac_objext'
10837   { (eval echo "$as_me:10837: \"$ac_try\"") >&5
10838   (eval $ac_try) 2>&5
10839   ac_status=$?
10840   echo "$as_me:10840: \$? = $ac_status" >&5
10841   (exit $ac_status); }; }; then
10842   cf_cv_ncurses_h2=$cf_header
10843
10844 else
10845   echo "$as_me: failed program was:" >&5
10846 cat conftest.$ac_ext >&5
10847 cf_cv_ncurses_h2=no
10848 fi
10849 rm -f conftest.$ac_objext conftest.$ac_ext
10850
10851                         if test "$cf_cv_ncurses_h2" != no ; then
10852                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
10853                                 test -n "$verbose" && echo $ac_n "      ... found $ac_c" 1>&6
10854                                 break
10855                         fi
10856                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
10857                 done
10858                 CPPFLAGS="$cf_save2_CPPFLAGS"
10859                 test "$cf_cv_ncurses_h2" != no && break
10860         done
10861         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:10861: error: not found" >&5
10862 echo "$as_me: error: not found" >&2;}
10863    { (exit 1); exit 1; }; }
10864
10865 fi
10866 echo "$as_me:10866: result: $cf_cv_ncurses_h2" >&5
10867 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
10868
10869         cf_1st_incdir=`echo $cf_cv_ncurses_h2 | sed -e 's%/[^/]*$%%'`
10870         cf_cv_ncurses_header=`basename $cf_cv_ncurses_h2`
10871         if test `basename $cf_1st_incdir` = $cf_ncuhdr_root ; then
10872                 cf_cv_ncurses_header=$cf_ncuhdr_root/$cf_cv_ncurses_header
10873         fi
10874
10875 if test -n "$cf_1st_incdir" ; then
10876   for cf_add_incdir in $cf_1st_incdir
10877   do
10878         while test $cf_add_incdir != /usr/include
10879         do
10880           if test -d $cf_add_incdir
10881           then
10882                 cf_have_incdir=no
10883                 if test -n "$CFLAGS$CPPFLAGS" ; then
10884                   # a loop is needed to ensure we can add subdirs of existing dirs
10885                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
10886                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
10887                           cf_have_incdir=yes; break
10888                         fi
10889                   done
10890                 fi
10891
10892                 if test "$cf_have_incdir" = no ; then
10893                   if test "$cf_add_incdir" = /usr/local/include ; then
10894                         if test "$GCC" = yes
10895                         then
10896                           cf_save_CPPFLAGS=$CPPFLAGS
10897
10898         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
10899         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
10900
10901                           cat >conftest.$ac_ext <<_ACEOF
10902 #line 10902 "configure"
10903 #include "confdefs.h"
10904 #include <stdio.h>
10905 int
10906 main (void)
10907 {
10908 printf("Hello")
10909   ;
10910   return 0;
10911 }
10912 _ACEOF
10913 rm -f conftest.$ac_objext
10914 if { (eval echo "$as_me:10914: \"$ac_compile\"") >&5
10915   (eval $ac_compile) 2>&5
10916   ac_status=$?
10917   echo "$as_me:10917: \$? = $ac_status" >&5
10918   (exit $ac_status); } &&
10919          { ac_try='test -s conftest.$ac_objext'
10920   { (eval echo "$as_me:10920: \"$ac_try\"") >&5
10921   (eval $ac_try) 2>&5
10922   ac_status=$?
10923   echo "$as_me:10923: \$? = $ac_status" >&5
10924   (exit $ac_status); }; }; then
10925   :
10926 else
10927   echo "$as_me: failed program was:" >&5
10928 cat conftest.$ac_ext >&5
10929 cf_have_incdir=yes
10930 fi
10931 rm -f conftest.$ac_objext conftest.$ac_ext
10932                           CPPFLAGS=$cf_save_CPPFLAGS
10933                         fi
10934                   fi
10935                 fi
10936
10937                 if test "$cf_have_incdir" = no ; then
10938                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
10939
10940 echo "${as_me:-configure}:10940: testing adding $cf_add_incdir to include-path ..." 1>&5
10941
10942                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
10943
10944                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
10945                   test "$cf_top_incdir" = "$cf_add_incdir" && break
10946                   cf_add_incdir="$cf_top_incdir"
10947                 else
10948                   break
10949                 fi
10950           else
10951                 break
10952           fi
10953         done
10954   done
10955 fi
10956
10957 fi
10958
10959 # Set definitions to allow ifdef'ing for ncurses.h
10960
10961 case $cf_cv_ncurses_header in
10962 (*ncurses.h)
10963
10964 cat >>confdefs.h <<\EOF
10965 #define HAVE_NCURSES_H 1
10966 EOF
10967
10968         ;;
10969 esac
10970
10971 case $cf_cv_ncurses_header in
10972 (ncurses/curses.h|ncurses/ncurses.h)
10973
10974 cat >>confdefs.h <<\EOF
10975 #define HAVE_NCURSES_NCURSES_H 1
10976 EOF
10977
10978         ;;
10979 (ncursesw/curses.h|ncursesw/ncurses.h)
10980
10981 cat >>confdefs.h <<\EOF
10982 #define HAVE_NCURSESW_NCURSES_H 1
10983 EOF
10984
10985         ;;
10986 esac
10987
10988 echo "$as_me:10988: checking for terminfo header" >&5
10989 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
10990 if test "${cf_cv_term_header+set}" = set; then
10991   echo $ECHO_N "(cached) $ECHO_C" >&6
10992 else
10993
10994 case ${cf_cv_ncurses_header} in
10995 (*/ncurses.h|*/ncursesw.h)
10996         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
10997         ;;
10998 (*)
10999         cf_term_header=term.h
11000         ;;
11001 esac
11002
11003 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
11004 do
11005 cat >conftest.$ac_ext <<_ACEOF
11006 #line 11006 "configure"
11007 #include "confdefs.h"
11008 #include <stdio.h>
11009 #include <${cf_cv_ncurses_header:-curses.h}>
11010 #include <$cf_test>
11011
11012 int
11013 main (void)
11014 {
11015 int x = auto_left_margin; (void)x
11016   ;
11017   return 0;
11018 }
11019 _ACEOF
11020 rm -f conftest.$ac_objext
11021 if { (eval echo "$as_me:11021: \"$ac_compile\"") >&5
11022   (eval $ac_compile) 2>&5
11023   ac_status=$?
11024   echo "$as_me:11024: \$? = $ac_status" >&5
11025   (exit $ac_status); } &&
11026          { ac_try='test -s conftest.$ac_objext'
11027   { (eval echo "$as_me:11027: \"$ac_try\"") >&5
11028   (eval $ac_try) 2>&5
11029   ac_status=$?
11030   echo "$as_me:11030: \$? = $ac_status" >&5
11031   (exit $ac_status); }; }; then
11032
11033         cf_cv_term_header="$cf_test"
11034 else
11035   echo "$as_me: failed program was:" >&5
11036 cat conftest.$ac_ext >&5
11037
11038         cf_cv_term_header=unknown
11039
11040 fi
11041 rm -f conftest.$ac_objext conftest.$ac_ext
11042         test "$cf_cv_term_header" != unknown && break
11043 done
11044
11045 fi
11046 echo "$as_me:11046: result: $cf_cv_term_header" >&5
11047 echo "${ECHO_T}$cf_cv_term_header" >&6
11048
11049 # Set definitions to allow ifdef'ing to accommodate subdirectories
11050
11051 case $cf_cv_term_header in
11052 (*term.h)
11053
11054 cat >>confdefs.h <<\EOF
11055 #define HAVE_TERM_H 1
11056 EOF
11057
11058         ;;
11059 esac
11060
11061 case $cf_cv_term_header in
11062 (ncurses/term.h)
11063
11064 cat >>confdefs.h <<\EOF
11065 #define HAVE_NCURSES_TERM_H 1
11066 EOF
11067
11068         ;;
11069 (ncursesw/term.h)
11070
11071 cat >>confdefs.h <<\EOF
11072 #define HAVE_NCURSESW_TERM_H 1
11073 EOF
11074
11075         ;;
11076 esac
11077
11078 # some applications need this, but should check for NCURSES_VERSION
11079
11080 cat >>confdefs.h <<\EOF
11081 #define NCURSES 1
11082 EOF
11083
11084 echo "$as_me:11084: checking for ncurses version" >&5
11085 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
11086 if test "${cf_cv_ncurses_version+set}" = set; then
11087   echo $ECHO_N "(cached) $ECHO_C" >&6
11088 else
11089
11090         cf_cv_ncurses_version=no
11091         cf_tempfile=out$$
11092         rm -f $cf_tempfile
11093         if test "$cross_compiling" = yes; then
11094
11095         # This will not work if the preprocessor splits the line after the
11096         # Autoconf token.  The 'unproto' program does that.
11097         cat > conftest.$ac_ext <<EOF
11098 #include <${cf_cv_ncurses_header:-curses.h}>
11099 #undef Autoconf
11100 #ifdef NCURSES_VERSION
11101 Autoconf NCURSES_VERSION
11102 #else
11103 #ifdef __NCURSES_H
11104 Autoconf "old"
11105 #endif
11106 ;
11107 #endif
11108 EOF
11109         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
11110         { (eval echo "$as_me:11110: \"$cf_try\"") >&5
11111   (eval $cf_try) 2>&5
11112   ac_status=$?
11113   echo "$as_me:11113: \$? = $ac_status" >&5
11114   (exit $ac_status); }
11115         if test -f conftest.out ; then
11116                 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
11117                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
11118                 rm -f conftest.out
11119         fi
11120
11121 else
11122   cat >conftest.$ac_ext <<_ACEOF
11123 #line 11123 "configure"
11124 #include "confdefs.h"
11125
11126 #include <${cf_cv_ncurses_header:-curses.h}>
11127 #include <stdio.h>
11128 int main(void)
11129 {
11130         FILE *fp = fopen("$cf_tempfile", "w");
11131 #ifdef NCURSES_VERSION
11132 # ifdef NCURSES_VERSION_PATCH
11133         fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
11134 # else
11135         fprintf(fp, "%s\n", NCURSES_VERSION);
11136 # endif
11137 #else
11138 # ifdef __NCURSES_H
11139         fprintf(fp, "old\n");
11140 # else
11141         make an error
11142 # endif
11143 #endif
11144         ${cf_cv_main_return:-return}(0);
11145 }
11146 _ACEOF
11147 rm -f conftest$ac_exeext
11148 if { (eval echo "$as_me:11148: \"$ac_link\"") >&5
11149   (eval $ac_link) 2>&5
11150   ac_status=$?
11151   echo "$as_me:11151: \$? = $ac_status" >&5
11152   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
11153   { (eval echo "$as_me:11153: \"$ac_try\"") >&5
11154   (eval $ac_try) 2>&5
11155   ac_status=$?
11156   echo "$as_me:11156: \$? = $ac_status" >&5
11157   (exit $ac_status); }; }; then
11158
11159         cf_cv_ncurses_version=`cat $cf_tempfile`
11160 else
11161   echo "$as_me: program exited with status $ac_status" >&5
11162 echo "$as_me: failed program was:" >&5
11163 cat conftest.$ac_ext >&5
11164 fi
11165 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
11166 fi
11167         rm -f $cf_tempfile
11168
11169 fi
11170 echo "$as_me:11170: result: $cf_cv_ncurses_version" >&5
11171 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
11172 test "$cf_cv_ncurses_version" = no ||
11173 cat >>confdefs.h <<\EOF
11174 #define NCURSES 1
11175 EOF
11176
11177 cf_nculib_root=$cf_cv_screen
11178         # This works, except for the special case where we find gpm, but
11179         # ncurses is in a nonstandard location via $LIBS, and we really want
11180         # to link gpm.
11181 cf_ncurses_LIBS=""
11182 cf_ncurses_SAVE="$LIBS"
11183 echo "$as_me:11183: checking for Gpm_Open in -lgpm" >&5
11184 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
11185 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
11186   echo $ECHO_N "(cached) $ECHO_C" >&6
11187 else
11188   ac_check_lib_save_LIBS=$LIBS
11189 LIBS="-lgpm  $LIBS"
11190 cat >conftest.$ac_ext <<_ACEOF
11191 #line 11191 "configure"
11192 #include "confdefs.h"
11193
11194 /* Override any gcc2 internal prototype to avoid an error.  */
11195 #ifdef __cplusplus
11196 extern "C"
11197 #endif
11198 /* We use char because int might match the return type of a gcc2
11199    builtin and then its argument prototype would still apply.  */
11200 char Gpm_Open ();
11201 int
11202 main (void)
11203 {
11204 Gpm_Open ();
11205   ;
11206   return 0;
11207 }
11208 _ACEOF
11209 rm -f conftest.$ac_objext conftest$ac_exeext
11210 if { (eval echo "$as_me:11210: \"$ac_link\"") >&5
11211   (eval $ac_link) 2>&5
11212   ac_status=$?
11213   echo "$as_me:11213: \$? = $ac_status" >&5
11214   (exit $ac_status); } &&
11215          { ac_try='test -s conftest$ac_exeext'
11216   { (eval echo "$as_me:11216: \"$ac_try\"") >&5
11217   (eval $ac_try) 2>&5
11218   ac_status=$?
11219   echo "$as_me:11219: \$? = $ac_status" >&5
11220   (exit $ac_status); }; }; then
11221   ac_cv_lib_gpm_Gpm_Open=yes
11222 else
11223   echo "$as_me: failed program was:" >&5
11224 cat conftest.$ac_ext >&5
11225 ac_cv_lib_gpm_Gpm_Open=no
11226 fi
11227 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11228 LIBS=$ac_check_lib_save_LIBS
11229 fi
11230 echo "$as_me:11230: result: $ac_cv_lib_gpm_Gpm_Open" >&5
11231 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
11232 if test $ac_cv_lib_gpm_Gpm_Open = yes; then
11233   echo "$as_me:11233: checking for initscr in -lgpm" >&5
11234 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
11235 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
11236   echo $ECHO_N "(cached) $ECHO_C" >&6
11237 else
11238   ac_check_lib_save_LIBS=$LIBS
11239 LIBS="-lgpm  $LIBS"
11240 cat >conftest.$ac_ext <<_ACEOF
11241 #line 11241 "configure"
11242 #include "confdefs.h"
11243
11244 /* Override any gcc2 internal prototype to avoid an error.  */
11245 #ifdef __cplusplus
11246 extern "C"
11247 #endif
11248 /* We use char because int might match the return type of a gcc2
11249    builtin and then its argument prototype would still apply.  */
11250 char initscr ();
11251 int
11252 main (void)
11253 {
11254 initscr ();
11255   ;
11256   return 0;
11257 }
11258 _ACEOF
11259 rm -f conftest.$ac_objext conftest$ac_exeext
11260 if { (eval echo "$as_me:11260: \"$ac_link\"") >&5
11261   (eval $ac_link) 2>&5
11262   ac_status=$?
11263   echo "$as_me:11263: \$? = $ac_status" >&5
11264   (exit $ac_status); } &&
11265          { ac_try='test -s conftest$ac_exeext'
11266   { (eval echo "$as_me:11266: \"$ac_try\"") >&5
11267   (eval $ac_try) 2>&5
11268   ac_status=$?
11269   echo "$as_me:11269: \$? = $ac_status" >&5
11270   (exit $ac_status); }; }; then
11271   ac_cv_lib_gpm_initscr=yes
11272 else
11273   echo "$as_me: failed program was:" >&5
11274 cat conftest.$ac_ext >&5
11275 ac_cv_lib_gpm_initscr=no
11276 fi
11277 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11278 LIBS=$ac_check_lib_save_LIBS
11279 fi
11280 echo "$as_me:11280: result: $ac_cv_lib_gpm_initscr" >&5
11281 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
11282 if test $ac_cv_lib_gpm_initscr = yes; then
11283   LIBS="$cf_ncurses_SAVE"
11284 else
11285   cf_ncurses_LIBS="-lgpm"
11286 fi
11287
11288 fi
11289
11290 case $host_os in
11291 (freebsd*)
11292         # This is only necessary if you are linking against an obsolete
11293         # version of ncurses (but it should do no harm, since it's static).
11294         if test "$cf_nculib_root" = ncurses ; then
11295                 echo "$as_me:11295: checking for tgoto in -lmytinfo" >&5
11296 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
11297 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
11298   echo $ECHO_N "(cached) $ECHO_C" >&6
11299 else
11300   ac_check_lib_save_LIBS=$LIBS
11301 LIBS="-lmytinfo  $LIBS"
11302 cat >conftest.$ac_ext <<_ACEOF
11303 #line 11303 "configure"
11304 #include "confdefs.h"
11305
11306 /* Override any gcc2 internal prototype to avoid an error.  */
11307 #ifdef __cplusplus
11308 extern "C"
11309 #endif
11310 /* We use char because int might match the return type of a gcc2
11311    builtin and then its argument prototype would still apply.  */
11312 char tgoto ();
11313 int
11314 main (void)
11315 {
11316 tgoto ();
11317   ;
11318   return 0;
11319 }
11320 _ACEOF
11321 rm -f conftest.$ac_objext conftest$ac_exeext
11322 if { (eval echo "$as_me:11322: \"$ac_link\"") >&5
11323   (eval $ac_link) 2>&5
11324   ac_status=$?
11325   echo "$as_me:11325: \$? = $ac_status" >&5
11326   (exit $ac_status); } &&
11327          { ac_try='test -s conftest$ac_exeext'
11328   { (eval echo "$as_me:11328: \"$ac_try\"") >&5
11329   (eval $ac_try) 2>&5
11330   ac_status=$?
11331   echo "$as_me:11331: \$? = $ac_status" >&5
11332   (exit $ac_status); }; }; then
11333   ac_cv_lib_mytinfo_tgoto=yes
11334 else
11335   echo "$as_me: failed program was:" >&5
11336 cat conftest.$ac_ext >&5
11337 ac_cv_lib_mytinfo_tgoto=no
11338 fi
11339 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11340 LIBS=$ac_check_lib_save_LIBS
11341 fi
11342 echo "$as_me:11342: result: $ac_cv_lib_mytinfo_tgoto" >&5
11343 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
11344 if test $ac_cv_lib_mytinfo_tgoto = yes; then
11345   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
11346 fi
11347
11348         fi
11349         ;;
11350 esac
11351
11352 cf_add_libs="$LIBS"
11353 # reverse order
11354 cf_add_0lib=
11355 for cf_add_1lib in $cf_ncurses_LIBS; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
11356 # filter duplicates
11357 for cf_add_1lib in $cf_add_0lib; do
11358         for cf_add_2lib in $cf_add_libs; do
11359                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
11360                         cf_add_1lib=
11361                         break
11362                 fi
11363         done
11364         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
11365 done
11366 LIBS="$cf_add_libs"
11367
11368 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
11369 then
11370
11371 cf_add_libs="$LIBS"
11372 # reverse order
11373 cf_add_0lib=
11374 for cf_add_1lib in -l$cf_nculib_root; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
11375 # filter duplicates
11376 for cf_add_1lib in $cf_add_0lib; do
11377         for cf_add_2lib in $cf_add_libs; do
11378                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
11379                         cf_add_1lib=
11380                         break
11381                 fi
11382         done
11383         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
11384 done
11385 LIBS="$cf_add_libs"
11386
11387 else
11388
11389         eval 'cf_cv_have_lib_'$cf_nculib_root'=no'
11390         cf_libdir=""
11391         echo "$as_me:11391: checking for initscr" >&5
11392 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
11393 if test "${ac_cv_func_initscr+set}" = set; then
11394   echo $ECHO_N "(cached) $ECHO_C" >&6
11395 else
11396   cat >conftest.$ac_ext <<_ACEOF
11397 #line 11397 "configure"
11398 #include "confdefs.h"
11399 #define initscr autoconf_temporary
11400 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
11401 #undef initscr
11402
11403 #ifdef __cplusplus
11404 extern "C"
11405 #endif
11406
11407 /* We use char because int might match the return type of a gcc2
11408    builtin and then its argument prototype would still apply.  */
11409 char initscr (void);
11410
11411 int
11412 main (void)
11413 {
11414
11415 /* The GNU C library defines stubs for functions which it implements
11416     to always fail with ENOSYS.  Some functions are actually named
11417     something starting with __ and the normal name is an alias.  */
11418 #if defined (__stub_initscr) || defined (__stub___initscr)
11419 #error found stub for initscr
11420 #endif
11421
11422         return initscr ();
11423   ;
11424   return 0;
11425 }
11426 _ACEOF
11427 rm -f conftest.$ac_objext conftest$ac_exeext
11428 if { (eval echo "$as_me:11428: \"$ac_link\"") >&5
11429   (eval $ac_link) 2>&5
11430   ac_status=$?
11431   echo "$as_me:11431: \$? = $ac_status" >&5
11432   (exit $ac_status); } &&
11433          { ac_try='test -s conftest$ac_exeext'
11434   { (eval echo "$as_me:11434: \"$ac_try\"") >&5
11435   (eval $ac_try) 2>&5
11436   ac_status=$?
11437   echo "$as_me:11437: \$? = $ac_status" >&5
11438   (exit $ac_status); }; }; then
11439   ac_cv_func_initscr=yes
11440 else
11441   echo "$as_me: failed program was:" >&5
11442 cat conftest.$ac_ext >&5
11443 ac_cv_func_initscr=no
11444 fi
11445 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11446 fi
11447 echo "$as_me:11447: result: $ac_cv_func_initscr" >&5
11448 echo "${ECHO_T}$ac_cv_func_initscr" >&6
11449 if test $ac_cv_func_initscr = yes; then
11450   eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
11451 else
11452
11453                 cf_save_LIBS="$LIBS"
11454                 echo "$as_me:11454: checking for initscr in -l$cf_nculib_root" >&5
11455 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
11456                 LIBS="-l$cf_nculib_root $LIBS"
11457                 cat >conftest.$ac_ext <<_ACEOF
11458 #line 11458 "configure"
11459 #include "confdefs.h"
11460 #include <${cf_cv_ncurses_header:-curses.h}>
11461 int
11462 main (void)
11463 {
11464 initscr()
11465   ;
11466   return 0;
11467 }
11468 _ACEOF
11469 rm -f conftest.$ac_objext conftest$ac_exeext
11470 if { (eval echo "$as_me:11470: \"$ac_link\"") >&5
11471   (eval $ac_link) 2>&5
11472   ac_status=$?
11473   echo "$as_me:11473: \$? = $ac_status" >&5
11474   (exit $ac_status); } &&
11475          { ac_try='test -s conftest$ac_exeext'
11476   { (eval echo "$as_me:11476: \"$ac_try\"") >&5
11477   (eval $ac_try) 2>&5
11478   ac_status=$?
11479   echo "$as_me:11479: \$? = $ac_status" >&5
11480   (exit $ac_status); }; }; then
11481   echo "$as_me:11481: result: yes" >&5
11482 echo "${ECHO_T}yes" >&6
11483                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
11484
11485 else
11486   echo "$as_me: failed program was:" >&5
11487 cat conftest.$ac_ext >&5
11488 echo "$as_me:11488: result: no" >&5
11489 echo "${ECHO_T}no" >&6
11490
11491 cf_search=
11492 cf_library_path_list=""
11493 if test -n "${LDFLAGS}${LIBS}" ; then
11494         for cf_library_path in $LDFLAGS $LIBS
11495         do
11496                 case $cf_library_path in
11497                 (-L*)
11498                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
11499
11500 test "x$cf_library_path" != "xNONE" && \
11501 test -d "$cf_library_path" && \
11502  {
11503         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
11504         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
11505         test -d $cf_library_path/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
11506         test -d $cf_library_path/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
11507         test -d $cf_library_path/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
11508         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"
11509 }
11510
11511                         cf_library_path_list="$cf_library_path_list $cf_search"
11512                         ;;
11513                 esac
11514         done
11515 fi
11516
11517 cf_search=
11518
11519 test "x$prefix" != "xNONE" && \
11520 test -d "$prefix" && \
11521  {
11522         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
11523         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
11524         test -d $prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
11525         test -d $prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
11526         test -d $prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
11527         test -d $prefix/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
11528 }
11529
11530 for cf_subdir_prefix in \
11531         /usr \
11532         /usr/local \
11533         /usr/pkg \
11534         /opt \
11535         /opt/local \
11536         $HOME
11537 do
11538
11539 test "x$cf_subdir_prefix" != "x$prefix" && \
11540 test -d "$cf_subdir_prefix" && \
11541 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
11542         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
11543         test -d $cf_subdir_prefix/lib &&          cf_search="$cf_search $cf_subdir_prefix/lib"
11544         test -d $cf_subdir_prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root"
11545         test -d $cf_subdir_prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root/lib"
11546         test -d $cf_subdir_prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib"
11547         test -d $cf_subdir_prefix/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib/$cf_nculib_root"
11548 }
11549
11550 done
11551
11552 cf_search="$cf_library_path_list $cf_search"
11553
11554                         for cf_libdir in $cf_search
11555                         do
11556                                 echo "$as_me:11556: checking for -l$cf_nculib_root in $cf_libdir" >&5
11557 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
11558                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
11559                                 cat >conftest.$ac_ext <<_ACEOF
11560 #line 11560 "configure"
11561 #include "confdefs.h"
11562 #include <${cf_cv_ncurses_header:-curses.h}>
11563 int
11564 main (void)
11565 {
11566 initscr()
11567   ;
11568   return 0;
11569 }
11570 _ACEOF
11571 rm -f conftest.$ac_objext conftest$ac_exeext
11572 if { (eval echo "$as_me:11572: \"$ac_link\"") >&5
11573   (eval $ac_link) 2>&5
11574   ac_status=$?
11575   echo "$as_me:11575: \$? = $ac_status" >&5
11576   (exit $ac_status); } &&
11577          { ac_try='test -s conftest$ac_exeext'
11578   { (eval echo "$as_me:11578: \"$ac_try\"") >&5
11579   (eval $ac_try) 2>&5
11580   ac_status=$?
11581   echo "$as_me:11581: \$? = $ac_status" >&5
11582   (exit $ac_status); }; }; then
11583   echo "$as_me:11583: result: yes" >&5
11584 echo "${ECHO_T}yes" >&6
11585                                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
11586                                          break
11587 else
11588   echo "$as_me: failed program was:" >&5
11589 cat conftest.$ac_ext >&5
11590 echo "$as_me:11590: result: no" >&5
11591 echo "${ECHO_T}no" >&6
11592                                          LIBS="$cf_save_LIBS"
11593 fi
11594 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11595                         done
11596
11597 fi
11598 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11599
11600 fi
11601
11602 eval 'cf_found_library=$cf_cv_have_lib_'$cf_nculib_root
11603
11604 if test $cf_found_library = no ; then
11605         { { echo "$as_me:11605: error: Cannot link $cf_nculib_root library" >&5
11606 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
11607    { (exit 1); exit 1; }; }
11608 fi
11609
11610 fi
11611
11612 if test -n "$cf_ncurses_LIBS" ; then
11613         echo "$as_me:11613: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
11614 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
11615         cf_ncurses_SAVE="$LIBS"
11616         for p in $cf_ncurses_LIBS ; do
11617                 q=`echo $LIBS | sed -e "s%$p %%" -e "s%$p$%%"`
11618                 if test "$q" != "$LIBS" ; then
11619                         LIBS="$q"
11620                 fi
11621         done
11622         cat >conftest.$ac_ext <<_ACEOF
11623 #line 11623 "configure"
11624 #include "confdefs.h"
11625 #include <${cf_cv_ncurses_header:-curses.h}>
11626 int
11627 main (void)
11628 {
11629 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
11630   ;
11631   return 0;
11632 }
11633 _ACEOF
11634 rm -f conftest.$ac_objext conftest$ac_exeext
11635 if { (eval echo "$as_me:11635: \"$ac_link\"") >&5
11636   (eval $ac_link) 2>&5
11637   ac_status=$?
11638   echo "$as_me:11638: \$? = $ac_status" >&5
11639   (exit $ac_status); } &&
11640          { ac_try='test -s conftest$ac_exeext'
11641   { (eval echo "$as_me:11641: \"$ac_try\"") >&5
11642   (eval $ac_try) 2>&5
11643   ac_status=$?
11644   echo "$as_me:11644: \$? = $ac_status" >&5
11645   (exit $ac_status); }; }; then
11646   echo "$as_me:11646: result: yes" >&5
11647 echo "${ECHO_T}yes" >&6
11648 else
11649   echo "$as_me: failed program was:" >&5
11650 cat conftest.$ac_ext >&5
11651 echo "$as_me:11651: result: no" >&5
11652 echo "${ECHO_T}no" >&6
11653                  LIBS="$cf_ncurses_SAVE"
11654 fi
11655 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11656 fi
11657
11658 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
11659
11660 cat >>confdefs.h <<EOF
11661 #define $cf_nculib_ROOT 1
11662 EOF
11663
11664         fi
11665 else
11666         NCURSES_CONFIG=none
11667 fi
11668
11669         ;;
11670 (pdcurses)
11671         echo "$as_me:11671: checking for X" >&5
11672 echo $ECHO_N "checking for X... $ECHO_C" >&6
11673
11674 # Check whether --with-x or --without-x was given.
11675 if test "${with_x+set}" = set; then
11676   withval="$with_x"
11677
11678 fi;
11679 # $have_x is `yes', `no', `disabled', or empty when we do not yet know.
11680 if test "x$with_x" = xno; then
11681   # The user explicitly disabled X.
11682   have_x=disabled
11683 else
11684   if test "x$x_includes" != xNONE && test "x$x_libraries" != xNONE; then
11685     # Both variables are already set.
11686     have_x=yes
11687   else
11688     if test "${ac_cv_have_x+set}" = set; then
11689   echo $ECHO_N "(cached) $ECHO_C" >&6
11690 else
11691   # One or both of the vars are not set, and there is no cached value.
11692 ac_x_includes=no ac_x_libraries=no
11693 rm -fr conftest.dir
11694 if mkdir conftest.dir; then
11695   cd conftest.dir
11696   # Make sure to not put "make" in the Imakefile rules, since we grep it out.
11697   cat >Imakefile <<'EOF'
11698 acfindx:
11699         @echo 'ac_im_incroot="${INCROOT}"; ac_im_usrlibdir="${USRLIBDIR}"; ac_im_libdir="${LIBDIR}"'
11700 EOF
11701   if (xmkmf) >/dev/null 2>/dev/null && test -f Makefile; then
11702     # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
11703     eval `${MAKE-make} acfindx 2>/dev/null | grep -v make`
11704     # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR.
11705     for ac_extension in a so sl dylib dll; do
11706       if test ! -f $ac_im_usrlibdir/libX11.$ac_extension &&
11707          test -f $ac_im_libdir/libX11.$ac_extension; then
11708         ac_im_usrlibdir=$ac_im_libdir; break
11709       fi
11710     done
11711     # Screen out bogus values from the imake configuration.  They are
11712     # bogus both because they are the default anyway, and because
11713     # using them would break gcc on systems where it needs fixed includes.
11714     case $ac_im_incroot in
11715         /usr/include) ;;
11716         *) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes=$ac_im_incroot;;
11717     esac
11718     case $ac_im_usrlibdir in
11719         /usr/lib | /lib) ;;
11720         *) test -d "$ac_im_usrlibdir" && ac_x_libraries=$ac_im_usrlibdir ;;
11721     esac
11722   fi
11723   cd ..
11724   rm -fr conftest.dir
11725 fi
11726
11727 # Standard set of common directories for X headers.
11728 # Check X11 before X11Rn because it is often a symlink to the current release.
11729 ac_x_header_dirs='
11730 /usr/X11/include
11731 /usr/X11R7/include
11732 /usr/X11R6/include
11733 /usr/X11R5/include
11734 /usr/X11R4/include
11735
11736 /opt/local/include
11737 /opt/X11/include
11738
11739 /usr/include/X11
11740 /usr/include/X11R7
11741 /usr/include/X11R6
11742 /usr/include/X11R5
11743 /usr/include/X11R4
11744
11745 /usr/local/X11/include
11746 /usr/local/X11R7/include
11747 /usr/local/X11R6/include
11748 /usr/local/X11R5/include
11749 /usr/local/X11R4/include
11750
11751 /usr/local/include/X11
11752 /usr/local/include/X11R7
11753 /usr/local/include/X11R6
11754 /usr/local/include/X11R5
11755 /usr/local/include/X11R4
11756
11757 /usr/X386/include
11758 /usr/x386/include
11759 /usr/XFree86/include/X11
11760
11761 /usr/include
11762 /usr/local/include
11763 /usr/unsupported/include
11764 /usr/athena/include
11765 /usr/local/x11r5/include
11766 /usr/lpp/Xamples/include
11767
11768 /usr/openwin/include
11769 /usr/openwin/share/include'
11770
11771 if test "$ac_x_includes" = no; then
11772   # Guess where to find include files, by looking for Intrinsic.h.
11773   # First, try using that file with no special directory specified.
11774   cat >conftest.$ac_ext <<_ACEOF
11775 #line 11775 "configure"
11776 #include "confdefs.h"
11777 #include <X11/Intrinsic.h>
11778 _ACEOF
11779 if { (eval echo "$as_me:11779: \"$ac_cpp conftest.$ac_ext\"") >&5
11780   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
11781   ac_status=$?
11782   egrep -v '^ *\+' conftest.er1 >conftest.err
11783   rm -f conftest.er1
11784   cat conftest.err >&5
11785   echo "$as_me:11785: \$? = $ac_status" >&5
11786   (exit $ac_status); } >/dev/null; then
11787   if test -s conftest.err; then
11788     ac_cpp_err=$ac_c_preproc_warn_flag
11789   else
11790     ac_cpp_err=
11791   fi
11792 else
11793   ac_cpp_err=yes
11794 fi
11795 if test -z "$ac_cpp_err"; then
11796   # We can compile using X headers with no special include directory.
11797 ac_x_includes=
11798 else
11799   echo "$as_me: failed program was:" >&5
11800   cat conftest.$ac_ext >&5
11801   for ac_dir in $ac_x_header_dirs; do
11802   if test -r "$ac_dir/X11/Intrinsic.h"; then
11803     ac_x_includes=$ac_dir
11804     break
11805   fi
11806 done
11807 fi
11808 rm -f conftest.err conftest.$ac_ext
11809 fi # $ac_x_includes = no
11810
11811 if test "$ac_x_libraries" = no; then
11812   # Check for the libraries.
11813   # See if we find them without any special options.
11814   # Don't add to $LIBS permanently.
11815   ac_save_LIBS=$LIBS
11816   LIBS="-lXt $LIBS"
11817   cat >conftest.$ac_ext <<_ACEOF
11818 #line 11818 "configure"
11819 #include "confdefs.h"
11820 #include <X11/Intrinsic.h>
11821 int
11822 main (void)
11823 {
11824 XtMalloc (0)
11825   ;
11826   return 0;
11827 }
11828 _ACEOF
11829 rm -f conftest.$ac_objext conftest$ac_exeext
11830 if { (eval echo "$as_me:11830: \"$ac_link\"") >&5
11831   (eval $ac_link) 2>&5
11832   ac_status=$?
11833   echo "$as_me:11833: \$? = $ac_status" >&5
11834   (exit $ac_status); } &&
11835          { ac_try='test -s conftest$ac_exeext'
11836   { (eval echo "$as_me:11836: \"$ac_try\"") >&5
11837   (eval $ac_try) 2>&5
11838   ac_status=$?
11839   echo "$as_me:11839: \$? = $ac_status" >&5
11840   (exit $ac_status); }; }; then
11841   LIBS=$ac_save_LIBS
11842 # We can link X programs with no special library path.
11843 ac_x_libraries=
11844 else
11845   echo "$as_me: failed program was:" >&5
11846 cat conftest.$ac_ext >&5
11847 LIBS=$ac_save_LIBS
11848 for ac_dir in `echo "$ac_x_includes $ac_x_header_dirs" | sed s/include/lib/g`
11849 do
11850   # Don't even attempt the hair of trying to link an X program!
11851   for ac_extension in a so sl dylib dll; do
11852     if test -r $ac_dir/libXt.$ac_extension; then
11853       ac_x_libraries=$ac_dir
11854       break 2
11855     fi
11856   done
11857 done
11858 fi
11859 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11860 fi # $ac_x_libraries = no
11861
11862 if test "$ac_x_includes" = no || test "$ac_x_libraries" = no; then
11863   # Didn't find X anywhere.  Cache the known absence of X.
11864   ac_cv_have_x="have_x=no"
11865 else
11866   # Record where we found X for the cache.
11867   ac_cv_have_x="have_x=yes \
11868                 ac_x_includes=$ac_x_includes ac_x_libraries=$ac_x_libraries"
11869 fi
11870 fi
11871
11872   fi
11873   eval "$ac_cv_have_x"
11874 fi # $with_x != no
11875
11876 if test "$have_x" != yes; then
11877   echo "$as_me:11877: result: $have_x" >&5
11878 echo "${ECHO_T}$have_x" >&6
11879   no_x=yes
11880 else
11881   # If each of the values was on the command line, it overrides each guess.
11882   test "x$x_includes" = xNONE && x_includes=$ac_x_includes
11883   test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries
11884   # Update the cache value to reflect the command line values.
11885   ac_cv_have_x="have_x=yes \
11886                 ac_x_includes=$x_includes ac_x_libraries=$x_libraries"
11887   echo "$as_me:11887: result: libraries $x_libraries, headers $x_includes" >&5
11888 echo "${ECHO_T}libraries $x_libraries, headers $x_includes" >&6
11889 fi
11890
11891 if test "$no_x" = yes; then
11892   # Not all programs may use this symbol, but it does not hurt to define it.
11893
11894 cat >>confdefs.h <<\EOF
11895 #define X_DISPLAY_MISSING 1
11896 EOF
11897
11898   X_CFLAGS= X_PRE_LIBS= X_LIBS= X_EXTRA_LIBS=
11899 else
11900   if test -n "$x_includes"; then
11901     X_CFLAGS="$X_CFLAGS -I$x_includes"
11902   fi
11903
11904   # It would also be nice to do this for all -L options, not just this one.
11905   if test -n "$x_libraries"; then
11906     X_LIBS="$X_LIBS -L$x_libraries"
11907     # For Solaris; some versions of Sun CC require a space after -R and
11908     # others require no space.  Words are not sufficient . . . .
11909     case `(uname -sr) 2>/dev/null` in
11910     "SunOS 5"*)
11911       echo "$as_me:11911: checking whether -R must be followed by a space" >&5
11912 echo $ECHO_N "checking whether -R must be followed by a space... $ECHO_C" >&6
11913       ac_xsave_LIBS=$LIBS; LIBS="$LIBS -R$x_libraries"
11914       cat >conftest.$ac_ext <<_ACEOF
11915 #line 11915 "configure"
11916 #include "confdefs.h"
11917
11918 int
11919 main (void)
11920 {
11921
11922   ;
11923   return 0;
11924 }
11925 _ACEOF
11926 rm -f conftest.$ac_objext conftest$ac_exeext
11927 if { (eval echo "$as_me:11927: \"$ac_link\"") >&5
11928   (eval $ac_link) 2>&5
11929   ac_status=$?
11930   echo "$as_me:11930: \$? = $ac_status" >&5
11931   (exit $ac_status); } &&
11932          { ac_try='test -s conftest$ac_exeext'
11933   { (eval echo "$as_me:11933: \"$ac_try\"") >&5
11934   (eval $ac_try) 2>&5
11935   ac_status=$?
11936   echo "$as_me:11936: \$? = $ac_status" >&5
11937   (exit $ac_status); }; }; then
11938   ac_R_nospace=yes
11939 else
11940   echo "$as_me: failed program was:" >&5
11941 cat conftest.$ac_ext >&5
11942 ac_R_nospace=no
11943 fi
11944 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11945       if test $ac_R_nospace = yes; then
11946         echo "$as_me:11946: result: no" >&5
11947 echo "${ECHO_T}no" >&6
11948         X_LIBS="$X_LIBS -R$x_libraries"
11949       else
11950         LIBS="$ac_xsave_LIBS -R $x_libraries"
11951         cat >conftest.$ac_ext <<_ACEOF
11952 #line 11952 "configure"
11953 #include "confdefs.h"
11954
11955 int
11956 main (void)
11957 {
11958
11959   ;
11960   return 0;
11961 }
11962 _ACEOF
11963 rm -f conftest.$ac_objext conftest$ac_exeext
11964 if { (eval echo "$as_me:11964: \"$ac_link\"") >&5
11965   (eval $ac_link) 2>&5
11966   ac_status=$?
11967   echo "$as_me:11967: \$? = $ac_status" >&5
11968   (exit $ac_status); } &&
11969          { ac_try='test -s conftest$ac_exeext'
11970   { (eval echo "$as_me:11970: \"$ac_try\"") >&5
11971   (eval $ac_try) 2>&5
11972   ac_status=$?
11973   echo "$as_me:11973: \$? = $ac_status" >&5
11974   (exit $ac_status); }; }; then
11975   ac_R_space=yes
11976 else
11977   echo "$as_me: failed program was:" >&5
11978 cat conftest.$ac_ext >&5
11979 ac_R_space=no
11980 fi
11981 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11982         if test $ac_R_space = yes; then
11983           echo "$as_me:11983: result: yes" >&5
11984 echo "${ECHO_T}yes" >&6
11985           X_LIBS="$X_LIBS -R $x_libraries"
11986         else
11987           echo "$as_me:11987: result: neither works" >&5
11988 echo "${ECHO_T}neither works" >&6
11989         fi
11990       fi
11991       LIBS=$ac_xsave_LIBS
11992     esac
11993   fi
11994
11995   # Check for system-dependent libraries X programs must link with.
11996   # Do this before checking for the system-independent R6 libraries
11997   # (-lICE), since we may need -lsocket or whatever for X linking.
11998
11999   if test "$ISC" = yes; then
12000     X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl_s -linet"
12001   else
12002     # Martyn Johnson says this is needed for Ultrix, if the X
12003     # libraries were built with DECnet support.  And Karl Berry says
12004     # the Alpha needs dnet_stub (dnet does not exist).
12005     ac_xsave_LIBS="$LIBS"; LIBS="$LIBS $X_LIBS -lX11"
12006     cat >conftest.$ac_ext <<_ACEOF
12007 #line 12007 "configure"
12008 #include "confdefs.h"
12009
12010 /* Override any gcc2 internal prototype to avoid an error.  */
12011 #ifdef __cplusplus
12012 extern "C"
12013 #endif
12014 /* We use char because int might match the return type of a gcc2
12015    builtin and then its argument prototype would still apply.  */
12016 char XOpenDisplay ();
12017 int
12018 main (void)
12019 {
12020 XOpenDisplay ();
12021   ;
12022   return 0;
12023 }
12024 _ACEOF
12025 rm -f conftest.$ac_objext conftest$ac_exeext
12026 if { (eval echo "$as_me:12026: \"$ac_link\"") >&5
12027   (eval $ac_link) 2>&5
12028   ac_status=$?
12029   echo "$as_me:12029: \$? = $ac_status" >&5
12030   (exit $ac_status); } &&
12031          { ac_try='test -s conftest$ac_exeext'
12032   { (eval echo "$as_me:12032: \"$ac_try\"") >&5
12033   (eval $ac_try) 2>&5
12034   ac_status=$?
12035   echo "$as_me:12035: \$? = $ac_status" >&5
12036   (exit $ac_status); }; }; then
12037   :
12038 else
12039   echo "$as_me: failed program was:" >&5
12040 cat conftest.$ac_ext >&5
12041 echo "$as_me:12041: checking for dnet_ntoa in -ldnet" >&5
12042 echo $ECHO_N "checking for dnet_ntoa in -ldnet... $ECHO_C" >&6
12043 if test "${ac_cv_lib_dnet_dnet_ntoa+set}" = set; then
12044   echo $ECHO_N "(cached) $ECHO_C" >&6
12045 else
12046   ac_check_lib_save_LIBS=$LIBS
12047 LIBS="-ldnet  $LIBS"
12048 cat >conftest.$ac_ext <<_ACEOF
12049 #line 12049 "configure"
12050 #include "confdefs.h"
12051
12052 /* Override any gcc2 internal prototype to avoid an error.  */
12053 #ifdef __cplusplus
12054 extern "C"
12055 #endif
12056 /* We use char because int might match the return type of a gcc2
12057    builtin and then its argument prototype would still apply.  */
12058 char dnet_ntoa ();
12059 int
12060 main (void)
12061 {
12062 dnet_ntoa ();
12063   ;
12064   return 0;
12065 }
12066 _ACEOF
12067 rm -f conftest.$ac_objext conftest$ac_exeext
12068 if { (eval echo "$as_me:12068: \"$ac_link\"") >&5
12069   (eval $ac_link) 2>&5
12070   ac_status=$?
12071   echo "$as_me:12071: \$? = $ac_status" >&5
12072   (exit $ac_status); } &&
12073          { ac_try='test -s conftest$ac_exeext'
12074   { (eval echo "$as_me:12074: \"$ac_try\"") >&5
12075   (eval $ac_try) 2>&5
12076   ac_status=$?
12077   echo "$as_me:12077: \$? = $ac_status" >&5
12078   (exit $ac_status); }; }; then
12079   ac_cv_lib_dnet_dnet_ntoa=yes
12080 else
12081   echo "$as_me: failed program was:" >&5
12082 cat conftest.$ac_ext >&5
12083 ac_cv_lib_dnet_dnet_ntoa=no
12084 fi
12085 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12086 LIBS=$ac_check_lib_save_LIBS
12087 fi
12088 echo "$as_me:12088: result: $ac_cv_lib_dnet_dnet_ntoa" >&5
12089 echo "${ECHO_T}$ac_cv_lib_dnet_dnet_ntoa" >&6
12090 if test $ac_cv_lib_dnet_dnet_ntoa = yes; then
12091   X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet"
12092 fi
12093
12094     if test $ac_cv_lib_dnet_dnet_ntoa = no; then
12095       echo "$as_me:12095: checking for dnet_ntoa in -ldnet_stub" >&5
12096 echo $ECHO_N "checking for dnet_ntoa in -ldnet_stub... $ECHO_C" >&6
12097 if test "${ac_cv_lib_dnet_stub_dnet_ntoa+set}" = set; then
12098   echo $ECHO_N "(cached) $ECHO_C" >&6
12099 else
12100   ac_check_lib_save_LIBS=$LIBS
12101 LIBS="-ldnet_stub  $LIBS"
12102 cat >conftest.$ac_ext <<_ACEOF
12103 #line 12103 "configure"
12104 #include "confdefs.h"
12105
12106 /* Override any gcc2 internal prototype to avoid an error.  */
12107 #ifdef __cplusplus
12108 extern "C"
12109 #endif
12110 /* We use char because int might match the return type of a gcc2
12111    builtin and then its argument prototype would still apply.  */
12112 char dnet_ntoa ();
12113 int
12114 main (void)
12115 {
12116 dnet_ntoa ();
12117   ;
12118   return 0;
12119 }
12120 _ACEOF
12121 rm -f conftest.$ac_objext conftest$ac_exeext
12122 if { (eval echo "$as_me:12122: \"$ac_link\"") >&5
12123   (eval $ac_link) 2>&5
12124   ac_status=$?
12125   echo "$as_me:12125: \$? = $ac_status" >&5
12126   (exit $ac_status); } &&
12127          { ac_try='test -s conftest$ac_exeext'
12128   { (eval echo "$as_me:12128: \"$ac_try\"") >&5
12129   (eval $ac_try) 2>&5
12130   ac_status=$?
12131   echo "$as_me:12131: \$? = $ac_status" >&5
12132   (exit $ac_status); }; }; then
12133   ac_cv_lib_dnet_stub_dnet_ntoa=yes
12134 else
12135   echo "$as_me: failed program was:" >&5
12136 cat conftest.$ac_ext >&5
12137 ac_cv_lib_dnet_stub_dnet_ntoa=no
12138 fi
12139 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12140 LIBS=$ac_check_lib_save_LIBS
12141 fi
12142 echo "$as_me:12142: result: $ac_cv_lib_dnet_stub_dnet_ntoa" >&5
12143 echo "${ECHO_T}$ac_cv_lib_dnet_stub_dnet_ntoa" >&6
12144 if test $ac_cv_lib_dnet_stub_dnet_ntoa = yes; then
12145   X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub"
12146 fi
12147
12148     fi
12149 fi
12150 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12151     LIBS="$ac_xsave_LIBS"
12152
12153     # msh@cis.ufl.edu says -lnsl (and -lsocket) are needed for his 386/AT,
12154     # to get the SysV transport functions.
12155     # Chad R. Larson says the Pyramis MIS-ES running DC/OSx (SVR4)
12156     # needs -lnsl.
12157     # The nsl library prevents programs from opening the X display
12158     # on Irix 5.2, according to T.E. Dickey.
12159     # The functions gethostbyname, getservbyname, and inet_addr are
12160     # in -lbsd on LynxOS 3.0.1/i386, according to Lars Hecking.
12161     echo "$as_me:12161: checking for gethostbyname" >&5
12162 echo $ECHO_N "checking for gethostbyname... $ECHO_C" >&6
12163 if test "${ac_cv_func_gethostbyname+set}" = set; then
12164   echo $ECHO_N "(cached) $ECHO_C" >&6
12165 else
12166   cat >conftest.$ac_ext <<_ACEOF
12167 #line 12167 "configure"
12168 #include "confdefs.h"
12169 #define gethostbyname autoconf_temporary
12170 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
12171 #undef gethostbyname
12172
12173 #ifdef __cplusplus
12174 extern "C"
12175 #endif
12176
12177 /* We use char because int might match the return type of a gcc2
12178    builtin and then its argument prototype would still apply.  */
12179 char gethostbyname (void);
12180
12181 int
12182 main (void)
12183 {
12184
12185 /* The GNU C library defines stubs for functions which it implements
12186     to always fail with ENOSYS.  Some functions are actually named
12187     something starting with __ and the normal name is an alias.  */
12188 #if defined (__stub_gethostbyname) || defined (__stub___gethostbyname)
12189 #error found stub for gethostbyname
12190 #endif
12191
12192         return gethostbyname ();
12193   ;
12194   return 0;
12195 }
12196 _ACEOF
12197 rm -f conftest.$ac_objext conftest$ac_exeext
12198 if { (eval echo "$as_me:12198: \"$ac_link\"") >&5
12199   (eval $ac_link) 2>&5
12200   ac_status=$?
12201   echo "$as_me:12201: \$? = $ac_status" >&5
12202   (exit $ac_status); } &&
12203          { ac_try='test -s conftest$ac_exeext'
12204   { (eval echo "$as_me:12204: \"$ac_try\"") >&5
12205   (eval $ac_try) 2>&5
12206   ac_status=$?
12207   echo "$as_me:12207: \$? = $ac_status" >&5
12208   (exit $ac_status); }; }; then
12209   ac_cv_func_gethostbyname=yes
12210 else
12211   echo "$as_me: failed program was:" >&5
12212 cat conftest.$ac_ext >&5
12213 ac_cv_func_gethostbyname=no
12214 fi
12215 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12216 fi
12217 echo "$as_me:12217: result: $ac_cv_func_gethostbyname" >&5
12218 echo "${ECHO_T}$ac_cv_func_gethostbyname" >&6
12219
12220     if test $ac_cv_func_gethostbyname = no; then
12221       echo "$as_me:12221: checking for gethostbyname in -lnsl" >&5
12222 echo $ECHO_N "checking for gethostbyname in -lnsl... $ECHO_C" >&6
12223 if test "${ac_cv_lib_nsl_gethostbyname+set}" = set; then
12224   echo $ECHO_N "(cached) $ECHO_C" >&6
12225 else
12226   ac_check_lib_save_LIBS=$LIBS
12227 LIBS="-lnsl  $LIBS"
12228 cat >conftest.$ac_ext <<_ACEOF
12229 #line 12229 "configure"
12230 #include "confdefs.h"
12231
12232 /* Override any gcc2 internal prototype to avoid an error.  */
12233 #ifdef __cplusplus
12234 extern "C"
12235 #endif
12236 /* We use char because int might match the return type of a gcc2
12237    builtin and then its argument prototype would still apply.  */
12238 char gethostbyname ();
12239 int
12240 main (void)
12241 {
12242 gethostbyname ();
12243   ;
12244   return 0;
12245 }
12246 _ACEOF
12247 rm -f conftest.$ac_objext conftest$ac_exeext
12248 if { (eval echo "$as_me:12248: \"$ac_link\"") >&5
12249   (eval $ac_link) 2>&5
12250   ac_status=$?
12251   echo "$as_me:12251: \$? = $ac_status" >&5
12252   (exit $ac_status); } &&
12253          { ac_try='test -s conftest$ac_exeext'
12254   { (eval echo "$as_me:12254: \"$ac_try\"") >&5
12255   (eval $ac_try) 2>&5
12256   ac_status=$?
12257   echo "$as_me:12257: \$? = $ac_status" >&5
12258   (exit $ac_status); }; }; then
12259   ac_cv_lib_nsl_gethostbyname=yes
12260 else
12261   echo "$as_me: failed program was:" >&5
12262 cat conftest.$ac_ext >&5
12263 ac_cv_lib_nsl_gethostbyname=no
12264 fi
12265 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12266 LIBS=$ac_check_lib_save_LIBS
12267 fi
12268 echo "$as_me:12268: result: $ac_cv_lib_nsl_gethostbyname" >&5
12269 echo "${ECHO_T}$ac_cv_lib_nsl_gethostbyname" >&6
12270 if test $ac_cv_lib_nsl_gethostbyname = yes; then
12271   X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl"
12272 fi
12273
12274       if test $ac_cv_lib_nsl_gethostbyname = no; then
12275         echo "$as_me:12275: checking for gethostbyname in -lbsd" >&5
12276 echo $ECHO_N "checking for gethostbyname in -lbsd... $ECHO_C" >&6
12277 if test "${ac_cv_lib_bsd_gethostbyname+set}" = set; then
12278   echo $ECHO_N "(cached) $ECHO_C" >&6
12279 else
12280   ac_check_lib_save_LIBS=$LIBS
12281 LIBS="-lbsd  $LIBS"
12282 cat >conftest.$ac_ext <<_ACEOF
12283 #line 12283 "configure"
12284 #include "confdefs.h"
12285
12286 /* Override any gcc2 internal prototype to avoid an error.  */
12287 #ifdef __cplusplus
12288 extern "C"
12289 #endif
12290 /* We use char because int might match the return type of a gcc2
12291    builtin and then its argument prototype would still apply.  */
12292 char gethostbyname ();
12293 int
12294 main (void)
12295 {
12296 gethostbyname ();
12297   ;
12298   return 0;
12299 }
12300 _ACEOF
12301 rm -f conftest.$ac_objext conftest$ac_exeext
12302 if { (eval echo "$as_me:12302: \"$ac_link\"") >&5
12303   (eval $ac_link) 2>&5
12304   ac_status=$?
12305   echo "$as_me:12305: \$? = $ac_status" >&5
12306   (exit $ac_status); } &&
12307          { ac_try='test -s conftest$ac_exeext'
12308   { (eval echo "$as_me:12308: \"$ac_try\"") >&5
12309   (eval $ac_try) 2>&5
12310   ac_status=$?
12311   echo "$as_me:12311: \$? = $ac_status" >&5
12312   (exit $ac_status); }; }; then
12313   ac_cv_lib_bsd_gethostbyname=yes
12314 else
12315   echo "$as_me: failed program was:" >&5
12316 cat conftest.$ac_ext >&5
12317 ac_cv_lib_bsd_gethostbyname=no
12318 fi
12319 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12320 LIBS=$ac_check_lib_save_LIBS
12321 fi
12322 echo "$as_me:12322: result: $ac_cv_lib_bsd_gethostbyname" >&5
12323 echo "${ECHO_T}$ac_cv_lib_bsd_gethostbyname" >&6
12324 if test $ac_cv_lib_bsd_gethostbyname = yes; then
12325   X_EXTRA_LIBS="$X_EXTRA_LIBS -lbsd"
12326 fi
12327
12328       fi
12329     fi
12330
12331     # lieder@skyler.mavd.honeywell.com says without -lsocket,
12332     # socket/setsockopt and other routines are undefined under SCO ODT
12333     # 2.0.  But -lsocket is broken on IRIX 5.2 (and is not necessary
12334     # on later versions), says Simon Leinen: it contains gethostby*
12335     # variants that don't use the nameserver (or something).  -lsocket
12336     # must be given before -lnsl if both are needed.  We assume that
12337     # if connect needs -lnsl, so does gethostbyname.
12338     echo "$as_me:12338: checking for connect" >&5
12339 echo $ECHO_N "checking for connect... $ECHO_C" >&6
12340 if test "${ac_cv_func_connect+set}" = set; then
12341   echo $ECHO_N "(cached) $ECHO_C" >&6
12342 else
12343   cat >conftest.$ac_ext <<_ACEOF
12344 #line 12344 "configure"
12345 #include "confdefs.h"
12346 #define connect autoconf_temporary
12347 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
12348 #undef connect
12349
12350 #ifdef __cplusplus
12351 extern "C"
12352 #endif
12353
12354 /* We use char because int might match the return type of a gcc2
12355    builtin and then its argument prototype would still apply.  */
12356 char connect (void);
12357
12358 int
12359 main (void)
12360 {
12361
12362 /* The GNU C library defines stubs for functions which it implements
12363     to always fail with ENOSYS.  Some functions are actually named
12364     something starting with __ and the normal name is an alias.  */
12365 #if defined (__stub_connect) || defined (__stub___connect)
12366 #error found stub for connect
12367 #endif
12368
12369         return connect ();
12370   ;
12371   return 0;
12372 }
12373 _ACEOF
12374 rm -f conftest.$ac_objext conftest$ac_exeext
12375 if { (eval echo "$as_me:12375: \"$ac_link\"") >&5
12376   (eval $ac_link) 2>&5
12377   ac_status=$?
12378   echo "$as_me:12378: \$? = $ac_status" >&5
12379   (exit $ac_status); } &&
12380          { ac_try='test -s conftest$ac_exeext'
12381   { (eval echo "$as_me:12381: \"$ac_try\"") >&5
12382   (eval $ac_try) 2>&5
12383   ac_status=$?
12384   echo "$as_me:12384: \$? = $ac_status" >&5
12385   (exit $ac_status); }; }; then
12386   ac_cv_func_connect=yes
12387 else
12388   echo "$as_me: failed program was:" >&5
12389 cat conftest.$ac_ext >&5
12390 ac_cv_func_connect=no
12391 fi
12392 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12393 fi
12394 echo "$as_me:12394: result: $ac_cv_func_connect" >&5
12395 echo "${ECHO_T}$ac_cv_func_connect" >&6
12396
12397     if test $ac_cv_func_connect = no; then
12398       echo "$as_me:12398: checking for connect in -lsocket" >&5
12399 echo $ECHO_N "checking for connect in -lsocket... $ECHO_C" >&6
12400 if test "${ac_cv_lib_socket_connect+set}" = set; then
12401   echo $ECHO_N "(cached) $ECHO_C" >&6
12402 else
12403   ac_check_lib_save_LIBS=$LIBS
12404 LIBS="-lsocket $X_EXTRA_LIBS $LIBS"
12405 cat >conftest.$ac_ext <<_ACEOF
12406 #line 12406 "configure"
12407 #include "confdefs.h"
12408
12409 /* Override any gcc2 internal prototype to avoid an error.  */
12410 #ifdef __cplusplus
12411 extern "C"
12412 #endif
12413 /* We use char because int might match the return type of a gcc2
12414    builtin and then its argument prototype would still apply.  */
12415 char connect ();
12416 int
12417 main (void)
12418 {
12419 connect ();
12420   ;
12421   return 0;
12422 }
12423 _ACEOF
12424 rm -f conftest.$ac_objext conftest$ac_exeext
12425 if { (eval echo "$as_me:12425: \"$ac_link\"") >&5
12426   (eval $ac_link) 2>&5
12427   ac_status=$?
12428   echo "$as_me:12428: \$? = $ac_status" >&5
12429   (exit $ac_status); } &&
12430          { ac_try='test -s conftest$ac_exeext'
12431   { (eval echo "$as_me:12431: \"$ac_try\"") >&5
12432   (eval $ac_try) 2>&5
12433   ac_status=$?
12434   echo "$as_me:12434: \$? = $ac_status" >&5
12435   (exit $ac_status); }; }; then
12436   ac_cv_lib_socket_connect=yes
12437 else
12438   echo "$as_me: failed program was:" >&5
12439 cat conftest.$ac_ext >&5
12440 ac_cv_lib_socket_connect=no
12441 fi
12442 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12443 LIBS=$ac_check_lib_save_LIBS
12444 fi
12445 echo "$as_me:12445: result: $ac_cv_lib_socket_connect" >&5
12446 echo "${ECHO_T}$ac_cv_lib_socket_connect" >&6
12447 if test $ac_cv_lib_socket_connect = yes; then
12448   X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS"
12449 fi
12450
12451     fi
12452
12453     # Guillermo Gomez says -lposix is necessary on A/UX.
12454     echo "$as_me:12454: checking for remove" >&5
12455 echo $ECHO_N "checking for remove... $ECHO_C" >&6
12456 if test "${ac_cv_func_remove+set}" = set; then
12457   echo $ECHO_N "(cached) $ECHO_C" >&6
12458 else
12459   cat >conftest.$ac_ext <<_ACEOF
12460 #line 12460 "configure"
12461 #include "confdefs.h"
12462 #define remove autoconf_temporary
12463 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
12464 #undef remove
12465
12466 #ifdef __cplusplus
12467 extern "C"
12468 #endif
12469
12470 /* We use char because int might match the return type of a gcc2
12471    builtin and then its argument prototype would still apply.  */
12472 char remove (void);
12473
12474 int
12475 main (void)
12476 {
12477
12478 /* The GNU C library defines stubs for functions which it implements
12479     to always fail with ENOSYS.  Some functions are actually named
12480     something starting with __ and the normal name is an alias.  */
12481 #if defined (__stub_remove) || defined (__stub___remove)
12482 #error found stub for remove
12483 #endif
12484
12485         return remove ();
12486   ;
12487   return 0;
12488 }
12489 _ACEOF
12490 rm -f conftest.$ac_objext conftest$ac_exeext
12491 if { (eval echo "$as_me:12491: \"$ac_link\"") >&5
12492   (eval $ac_link) 2>&5
12493   ac_status=$?
12494   echo "$as_me:12494: \$? = $ac_status" >&5
12495   (exit $ac_status); } &&
12496          { ac_try='test -s conftest$ac_exeext'
12497   { (eval echo "$as_me:12497: \"$ac_try\"") >&5
12498   (eval $ac_try) 2>&5
12499   ac_status=$?
12500   echo "$as_me:12500: \$? = $ac_status" >&5
12501   (exit $ac_status); }; }; then
12502   ac_cv_func_remove=yes
12503 else
12504   echo "$as_me: failed program was:" >&5
12505 cat conftest.$ac_ext >&5
12506 ac_cv_func_remove=no
12507 fi
12508 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12509 fi
12510 echo "$as_me:12510: result: $ac_cv_func_remove" >&5
12511 echo "${ECHO_T}$ac_cv_func_remove" >&6
12512
12513     if test $ac_cv_func_remove = no; then
12514       echo "$as_me:12514: checking for remove in -lposix" >&5
12515 echo $ECHO_N "checking for remove in -lposix... $ECHO_C" >&6
12516 if test "${ac_cv_lib_posix_remove+set}" = set; then
12517   echo $ECHO_N "(cached) $ECHO_C" >&6
12518 else
12519   ac_check_lib_save_LIBS=$LIBS
12520 LIBS="-lposix  $LIBS"
12521 cat >conftest.$ac_ext <<_ACEOF
12522 #line 12522 "configure"
12523 #include "confdefs.h"
12524
12525 /* Override any gcc2 internal prototype to avoid an error.  */
12526 #ifdef __cplusplus
12527 extern "C"
12528 #endif
12529 /* We use char because int might match the return type of a gcc2
12530    builtin and then its argument prototype would still apply.  */
12531 char remove ();
12532 int
12533 main (void)
12534 {
12535 remove ();
12536   ;
12537   return 0;
12538 }
12539 _ACEOF
12540 rm -f conftest.$ac_objext conftest$ac_exeext
12541 if { (eval echo "$as_me:12541: \"$ac_link\"") >&5
12542   (eval $ac_link) 2>&5
12543   ac_status=$?
12544   echo "$as_me:12544: \$? = $ac_status" >&5
12545   (exit $ac_status); } &&
12546          { ac_try='test -s conftest$ac_exeext'
12547   { (eval echo "$as_me:12547: \"$ac_try\"") >&5
12548   (eval $ac_try) 2>&5
12549   ac_status=$?
12550   echo "$as_me:12550: \$? = $ac_status" >&5
12551   (exit $ac_status); }; }; then
12552   ac_cv_lib_posix_remove=yes
12553 else
12554   echo "$as_me: failed program was:" >&5
12555 cat conftest.$ac_ext >&5
12556 ac_cv_lib_posix_remove=no
12557 fi
12558 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12559 LIBS=$ac_check_lib_save_LIBS
12560 fi
12561 echo "$as_me:12561: result: $ac_cv_lib_posix_remove" >&5
12562 echo "${ECHO_T}$ac_cv_lib_posix_remove" >&6
12563 if test $ac_cv_lib_posix_remove = yes; then
12564   X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix"
12565 fi
12566
12567     fi
12568
12569     # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay.
12570     echo "$as_me:12570: checking for shmat" >&5
12571 echo $ECHO_N "checking for shmat... $ECHO_C" >&6
12572 if test "${ac_cv_func_shmat+set}" = set; then
12573   echo $ECHO_N "(cached) $ECHO_C" >&6
12574 else
12575   cat >conftest.$ac_ext <<_ACEOF
12576 #line 12576 "configure"
12577 #include "confdefs.h"
12578 #define shmat autoconf_temporary
12579 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
12580 #undef shmat
12581
12582 #ifdef __cplusplus
12583 extern "C"
12584 #endif
12585
12586 /* We use char because int might match the return type of a gcc2
12587    builtin and then its argument prototype would still apply.  */
12588 char shmat (void);
12589
12590 int
12591 main (void)
12592 {
12593
12594 /* The GNU C library defines stubs for functions which it implements
12595     to always fail with ENOSYS.  Some functions are actually named
12596     something starting with __ and the normal name is an alias.  */
12597 #if defined (__stub_shmat) || defined (__stub___shmat)
12598 #error found stub for shmat
12599 #endif
12600
12601         return shmat ();
12602   ;
12603   return 0;
12604 }
12605 _ACEOF
12606 rm -f conftest.$ac_objext conftest$ac_exeext
12607 if { (eval echo "$as_me:12607: \"$ac_link\"") >&5
12608   (eval $ac_link) 2>&5
12609   ac_status=$?
12610   echo "$as_me:12610: \$? = $ac_status" >&5
12611   (exit $ac_status); } &&
12612          { ac_try='test -s conftest$ac_exeext'
12613   { (eval echo "$as_me:12613: \"$ac_try\"") >&5
12614   (eval $ac_try) 2>&5
12615   ac_status=$?
12616   echo "$as_me:12616: \$? = $ac_status" >&5
12617   (exit $ac_status); }; }; then
12618   ac_cv_func_shmat=yes
12619 else
12620   echo "$as_me: failed program was:" >&5
12621 cat conftest.$ac_ext >&5
12622 ac_cv_func_shmat=no
12623 fi
12624 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12625 fi
12626 echo "$as_me:12626: result: $ac_cv_func_shmat" >&5
12627 echo "${ECHO_T}$ac_cv_func_shmat" >&6
12628
12629     if test $ac_cv_func_shmat = no; then
12630       echo "$as_me:12630: checking for shmat in -lipc" >&5
12631 echo $ECHO_N "checking for shmat in -lipc... $ECHO_C" >&6
12632 if test "${ac_cv_lib_ipc_shmat+set}" = set; then
12633   echo $ECHO_N "(cached) $ECHO_C" >&6
12634 else
12635   ac_check_lib_save_LIBS=$LIBS
12636 LIBS="-lipc  $LIBS"
12637 cat >conftest.$ac_ext <<_ACEOF
12638 #line 12638 "configure"
12639 #include "confdefs.h"
12640
12641 /* Override any gcc2 internal prototype to avoid an error.  */
12642 #ifdef __cplusplus
12643 extern "C"
12644 #endif
12645 /* We use char because int might match the return type of a gcc2
12646    builtin and then its argument prototype would still apply.  */
12647 char shmat ();
12648 int
12649 main (void)
12650 {
12651 shmat ();
12652   ;
12653   return 0;
12654 }
12655 _ACEOF
12656 rm -f conftest.$ac_objext conftest$ac_exeext
12657 if { (eval echo "$as_me:12657: \"$ac_link\"") >&5
12658   (eval $ac_link) 2>&5
12659   ac_status=$?
12660   echo "$as_me:12660: \$? = $ac_status" >&5
12661   (exit $ac_status); } &&
12662          { ac_try='test -s conftest$ac_exeext'
12663   { (eval echo "$as_me:12663: \"$ac_try\"") >&5
12664   (eval $ac_try) 2>&5
12665   ac_status=$?
12666   echo "$as_me:12666: \$? = $ac_status" >&5
12667   (exit $ac_status); }; }; then
12668   ac_cv_lib_ipc_shmat=yes
12669 else
12670   echo "$as_me: failed program was:" >&5
12671 cat conftest.$ac_ext >&5
12672 ac_cv_lib_ipc_shmat=no
12673 fi
12674 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12675 LIBS=$ac_check_lib_save_LIBS
12676 fi
12677 echo "$as_me:12677: result: $ac_cv_lib_ipc_shmat" >&5
12678 echo "${ECHO_T}$ac_cv_lib_ipc_shmat" >&6
12679 if test $ac_cv_lib_ipc_shmat = yes; then
12680   X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc"
12681 fi
12682
12683     fi
12684   fi
12685
12686   # Check for libraries that X11R6 Xt/Xaw programs need.
12687   ac_save_LDFLAGS=$LDFLAGS
12688   test -n "$x_libraries" && LDFLAGS="$LDFLAGS -L$x_libraries"
12689   # SM needs ICE to (dynamically) link under SunOS 4.x (so we have to
12690   # check for ICE first), but we must link in the order -lSM -lICE or
12691   # we get undefined symbols.  So assume we have SM if we have ICE.
12692   # These have to be linked with before -lX11, unlike the other
12693   # libraries we check for below, so use a different variable.
12694   # John Interrante, Karl Berry
12695   echo "$as_me:12695: checking for IceConnectionNumber in -lICE" >&5
12696 echo $ECHO_N "checking for IceConnectionNumber in -lICE... $ECHO_C" >&6
12697 if test "${ac_cv_lib_ICE_IceConnectionNumber+set}" = set; then
12698   echo $ECHO_N "(cached) $ECHO_C" >&6
12699 else
12700   ac_check_lib_save_LIBS=$LIBS
12701 LIBS="-lICE $X_EXTRA_LIBS $LIBS"
12702 cat >conftest.$ac_ext <<_ACEOF
12703 #line 12703 "configure"
12704 #include "confdefs.h"
12705
12706 /* Override any gcc2 internal prototype to avoid an error.  */
12707 #ifdef __cplusplus
12708 extern "C"
12709 #endif
12710 /* We use char because int might match the return type of a gcc2
12711    builtin and then its argument prototype would still apply.  */
12712 char IceConnectionNumber ();
12713 int
12714 main (void)
12715 {
12716 IceConnectionNumber ();
12717   ;
12718   return 0;
12719 }
12720 _ACEOF
12721 rm -f conftest.$ac_objext conftest$ac_exeext
12722 if { (eval echo "$as_me:12722: \"$ac_link\"") >&5
12723   (eval $ac_link) 2>&5
12724   ac_status=$?
12725   echo "$as_me:12725: \$? = $ac_status" >&5
12726   (exit $ac_status); } &&
12727          { ac_try='test -s conftest$ac_exeext'
12728   { (eval echo "$as_me:12728: \"$ac_try\"") >&5
12729   (eval $ac_try) 2>&5
12730   ac_status=$?
12731   echo "$as_me:12731: \$? = $ac_status" >&5
12732   (exit $ac_status); }; }; then
12733   ac_cv_lib_ICE_IceConnectionNumber=yes
12734 else
12735   echo "$as_me: failed program was:" >&5
12736 cat conftest.$ac_ext >&5
12737 ac_cv_lib_ICE_IceConnectionNumber=no
12738 fi
12739 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12740 LIBS=$ac_check_lib_save_LIBS
12741 fi
12742 echo "$as_me:12742: result: $ac_cv_lib_ICE_IceConnectionNumber" >&5
12743 echo "${ECHO_T}$ac_cv_lib_ICE_IceConnectionNumber" >&6
12744 if test $ac_cv_lib_ICE_IceConnectionNumber = yes; then
12745   X_PRE_LIBS="$X_PRE_LIBS -lSM -lICE"
12746 fi
12747
12748   LDFLAGS=$ac_save_LDFLAGS
12749
12750 fi
12751
12752 cf_x_athena=${cf_x_athena:-Xaw}
12753
12754 echo "$as_me:12754: checking if you want to link with Xaw 3d library" >&5
12755 echo $ECHO_N "checking if you want to link with Xaw 3d library... $ECHO_C" >&6
12756 withval=
12757
12758 # Check whether --with-Xaw3d or --without-Xaw3d was given.
12759 if test "${with_Xaw3d+set}" = set; then
12760   withval="$with_Xaw3d"
12761
12762 fi;
12763 if test "$withval" = yes ; then
12764         cf_x_athena=Xaw3d
12765         echo "$as_me:12765: result: yes" >&5
12766 echo "${ECHO_T}yes" >&6
12767 else
12768         echo "$as_me:12768: result: no" >&5
12769 echo "${ECHO_T}no" >&6
12770 fi
12771
12772 echo "$as_me:12772: checking if you want to link with Xaw 3d xft library" >&5
12773 echo $ECHO_N "checking if you want to link with Xaw 3d xft library... $ECHO_C" >&6
12774 withval=
12775
12776 # Check whether --with-Xaw3dxft or --without-Xaw3dxft was given.
12777 if test "${with_Xaw3dxft+set}" = set; then
12778   withval="$with_Xaw3dxft"
12779
12780 fi;
12781 if test "$withval" = yes ; then
12782         cf_x_athena=Xaw3dxft
12783         echo "$as_me:12783: result: yes" >&5
12784 echo "${ECHO_T}yes" >&6
12785 else
12786         echo "$as_me:12786: result: no" >&5
12787 echo "${ECHO_T}no" >&6
12788 fi
12789
12790 echo "$as_me:12790: checking if you want to link with neXT Athena library" >&5
12791 echo $ECHO_N "checking if you want to link with neXT Athena library... $ECHO_C" >&6
12792 withval=
12793
12794 # Check whether --with-neXtaw or --without-neXtaw was given.
12795 if test "${with_neXtaw+set}" = set; then
12796   withval="$with_neXtaw"
12797
12798 fi;
12799 if test "$withval" = yes ; then
12800         cf_x_athena=neXtaw
12801         echo "$as_me:12801: result: yes" >&5
12802 echo "${ECHO_T}yes" >&6
12803 else
12804         echo "$as_me:12804: result: no" >&5
12805 echo "${ECHO_T}no" >&6
12806 fi
12807
12808 echo "$as_me:12808: checking if you want to link with Athena-Plus library" >&5
12809 echo $ECHO_N "checking if you want to link with Athena-Plus library... $ECHO_C" >&6
12810 withval=
12811
12812 # Check whether --with-XawPlus or --without-XawPlus was given.
12813 if test "${with_XawPlus+set}" = set; then
12814   withval="$with_XawPlus"
12815
12816 fi;
12817 if test "$withval" = yes ; then
12818         cf_x_athena=XawPlus
12819         echo "$as_me:12819: result: yes" >&5
12820 echo "${ECHO_T}yes" >&6
12821 else
12822         echo "$as_me:12822: result: no" >&5
12823 echo "${ECHO_T}no" >&6
12824 fi
12825
12826 cf_x_athena_lib=""
12827
12828 if test "$PKG_CONFIG" != none ; then
12829         cf_athena_list=
12830         test "$cf_x_athena" = Xaw && cf_athena_list="xaw8 xaw7 xaw6"
12831         for cf_athena_pkg in \
12832                 $cf_athena_list \
12833                 ${cf_x_athena} \
12834                 ${cf_x_athena}-devel \
12835                 lib${cf_x_athena} \
12836                 lib${cf_x_athena}-devel
12837         do
12838
12839 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists $cf_athena_pkg; then
12840         test -n "$verbose" && echo "    found package $cf_athena_pkg" 1>&6
12841
12842 echo "${as_me:-configure}:12842: testing found package $cf_athena_pkg ..." 1>&5
12843
12844         cf_pkgconfig_incs="`$PKG_CONFIG --cflags $cf_athena_pkg 2>/dev/null`"
12845         cf_pkgconfig_libs="`$PKG_CONFIG --libs   $cf_athena_pkg 2>/dev/null`"
12846         test -n "$verbose" && echo "    package $cf_athena_pkg CFLAGS: $cf_pkgconfig_incs" 1>&6
12847
12848 echo "${as_me:-configure}:12848: testing package $cf_athena_pkg CFLAGS: $cf_pkgconfig_incs ..." 1>&5
12849
12850         test -n "$verbose" && echo "    package $cf_athena_pkg LIBS: $cf_pkgconfig_libs" 1>&6
12851
12852 echo "${as_me:-configure}:12852: testing package $cf_athena_pkg LIBS: $cf_pkgconfig_libs ..." 1>&5
12853
12854 cf_fix_cppflags=no
12855 cf_new_cflags=
12856 cf_new_cppflags=
12857 cf_new_extra_cppflags=
12858
12859 for cf_add_cflags in $cf_pkgconfig_incs
12860 do
12861 case $cf_fix_cppflags in
12862 (no)
12863         case $cf_add_cflags in
12864         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
12865                 case $cf_add_cflags in
12866                 (-D*)
12867                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
12868
12869                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12870                                 && test -z "${cf_tst_cflags}" \
12871                                 && cf_fix_cppflags=yes
12872
12873                         if test $cf_fix_cppflags = yes ; then
12874
12875         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12876         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12877
12878                                 continue
12879                         elif test "${cf_tst_cflags}" = "\"'" ; then
12880
12881         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12882         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12883
12884                                 continue
12885                         fi
12886                         ;;
12887                 esac
12888                 case "$CPPFLAGS" in
12889                 (*$cf_add_cflags)
12890                         ;;
12891                 (*)
12892                         case $cf_add_cflags in
12893                         (-D*)
12894                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
12895
12896 CPPFLAGS=`echo "$CPPFLAGS" | \
12897         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
12898                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
12899
12900                                 ;;
12901                         esac
12902
12903         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
12904         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
12905
12906                         ;;
12907                 esac
12908                 ;;
12909         (*)
12910
12911         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
12912         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
12913
12914                 ;;
12915         esac
12916         ;;
12917 (yes)
12918
12919         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12920         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12921
12922         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
12923
12924         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12925                 && test -z "${cf_tst_cflags}" \
12926                 && cf_fix_cppflags=no
12927         ;;
12928 esac
12929 done
12930
12931 if test -n "$cf_new_cflags" ; then
12932
12933         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
12934         CFLAGS="${CFLAGS}$cf_new_cflags"
12935
12936 fi
12937
12938 if test -n "$cf_new_cppflags" ; then
12939
12940         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12941         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
12942
12943 fi
12944
12945 if test -n "$cf_new_extra_cppflags" ; then
12946
12947         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
12948         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
12949
12950 fi
12951
12952 cf_add_libs="$LIBS"
12953 # reverse order
12954 cf_add_0lib=
12955 for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
12956 # filter duplicates
12957 for cf_add_1lib in $cf_add_0lib; do
12958         for cf_add_2lib in $cf_add_libs; do
12959                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
12960                         cf_add_1lib=
12961                         break
12962                 fi
12963         done
12964         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
12965 done
12966 LIBS="$cf_add_libs"
12967
12968                         cf_x_athena_lib="$cf_pkgconfig_libs"
12969
12970 cf_x_athena_LIBS=`echo "HAVE_LIB_$cf_x_athena" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
12971
12972                         cat >>confdefs.h <<EOF
12973 #define $cf_x_athena_LIBS 1
12974 EOF
12975
12976         for cf_trim_lib in Xmu Xt X11
12977         do
12978                 case "$LIBS" in
12979                 (*-l$cf_trim_lib\ *-l$cf_trim_lib*)
12980                         LIBS=`echo "$LIBS " | sed -e 's/  / /g' -e 's%-l'"$cf_trim_lib"' %%' -e 's/ $//'`
12981                         test -n "$verbose" && echo "    ..trimmed $LIBS" 1>&6
12982
12983 echo "${as_me:-configure}:12983: testing ..trimmed $LIBS ..." 1>&5
12984
12985                         ;;
12986                 esac
12987         done
12988
12989 echo "$as_me:12989: checking for usable $cf_x_athena/Xmu package" >&5
12990 echo $ECHO_N "checking for usable $cf_x_athena/Xmu package... $ECHO_C" >&6
12991 if test "${cf_cv_xaw_compat+set}" = set; then
12992   echo $ECHO_N "(cached) $ECHO_C" >&6
12993 else
12994
12995 cat >conftest.$ac_ext <<_ACEOF
12996 #line 12996 "configure"
12997 #include "confdefs.h"
12998
12999 #include <X11/Xmu/CharSet.h>
13000
13001 int
13002 main (void)
13003 {
13004
13005 int check = XmuCompareISOLatin1("big", "small");
13006 (void)check;
13007
13008   ;
13009   return 0;
13010 }
13011 _ACEOF
13012 rm -f conftest.$ac_objext conftest$ac_exeext
13013 if { (eval echo "$as_me:13013: \"$ac_link\"") >&5
13014   (eval $ac_link) 2>&5
13015   ac_status=$?
13016   echo "$as_me:13016: \$? = $ac_status" >&5
13017   (exit $ac_status); } &&
13018          { ac_try='test -s conftest$ac_exeext'
13019   { (eval echo "$as_me:13019: \"$ac_try\"") >&5
13020   (eval $ac_try) 2>&5
13021   ac_status=$?
13022   echo "$as_me:13022: \$? = $ac_status" >&5
13023   (exit $ac_status); }; }; then
13024   cf_cv_xaw_compat=yes
13025 else
13026   echo "$as_me: failed program was:" >&5
13027 cat conftest.$ac_ext >&5
13028 cf_cv_xaw_compat=no
13029 fi
13030 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13031 fi
13032 echo "$as_me:13032: result: $cf_cv_xaw_compat" >&5
13033 echo "${ECHO_T}$cf_cv_xaw_compat" >&6
13034
13035                         if test "$cf_cv_xaw_compat" = no
13036                         then
13037                                 # workaround for broken ".pc" files...
13038                                 case "$cf_x_athena_lib" in
13039                                 (*-lXmu*)
13040                                         ;;
13041                                 (*)
13042                                         test -n "$verbose" && echo "    work around broken package" 1>&6
13043
13044 echo "${as_me:-configure}:13044: testing work around broken package ..." 1>&5
13045
13046                                         cf_save_xmu="$LIBS"
13047                                         cf_first_lib=`echo "$cf_save_xmu" | sed -e 's/^  *//' -e 's/ .*//'`
13048
13049 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists xmu; then
13050         test -n "$verbose" && echo "    found package xmu" 1>&6
13051
13052 echo "${as_me:-configure}:13052: testing found package xmu ..." 1>&5
13053
13054         cf_pkgconfig_incs="`$PKG_CONFIG --cflags xmu 2>/dev/null`"
13055         cf_pkgconfig_libs="`$PKG_CONFIG --libs   xmu 2>/dev/null`"
13056         test -n "$verbose" && echo "    package xmu CFLAGS: $cf_pkgconfig_incs" 1>&6
13057
13058 echo "${as_me:-configure}:13058: testing package xmu CFLAGS: $cf_pkgconfig_incs ..." 1>&5
13059
13060         test -n "$verbose" && echo "    package xmu LIBS: $cf_pkgconfig_libs" 1>&6
13061
13062 echo "${as_me:-configure}:13062: testing package xmu LIBS: $cf_pkgconfig_libs ..." 1>&5
13063
13064 cf_fix_cppflags=no
13065 cf_new_cflags=
13066 cf_new_cppflags=
13067 cf_new_extra_cppflags=
13068
13069 for cf_add_cflags in $cf_pkgconfig_incs
13070 do
13071 case $cf_fix_cppflags in
13072 (no)
13073         case $cf_add_cflags in
13074         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13075                 case $cf_add_cflags in
13076                 (-D*)
13077                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13078
13079                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13080                                 && test -z "${cf_tst_cflags}" \
13081                                 && cf_fix_cppflags=yes
13082
13083                         if test $cf_fix_cppflags = yes ; then
13084
13085         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13086         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13087
13088                                 continue
13089                         elif test "${cf_tst_cflags}" = "\"'" ; then
13090
13091         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13092         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13093
13094                                 continue
13095                         fi
13096                         ;;
13097                 esac
13098                 case "$CPPFLAGS" in
13099                 (*$cf_add_cflags)
13100                         ;;
13101                 (*)
13102                         case $cf_add_cflags in
13103                         (-D*)
13104                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13105
13106 CPPFLAGS=`echo "$CPPFLAGS" | \
13107         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13108                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13109
13110                                 ;;
13111                         esac
13112
13113         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13114         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
13115
13116                         ;;
13117                 esac
13118                 ;;
13119         (*)
13120
13121         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
13122         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
13123
13124                 ;;
13125         esac
13126         ;;
13127 (yes)
13128
13129         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13130         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13131
13132         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
13133
13134         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13135                 && test -z "${cf_tst_cflags}" \
13136                 && cf_fix_cppflags=no
13137         ;;
13138 esac
13139 done
13140
13141 if test -n "$cf_new_cflags" ; then
13142
13143         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
13144         CFLAGS="${CFLAGS}$cf_new_cflags"
13145
13146 fi
13147
13148 if test -n "$cf_new_cppflags" ; then
13149
13150         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13151         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
13152
13153 fi
13154
13155 if test -n "$cf_new_extra_cppflags" ; then
13156
13157         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
13158         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
13159
13160 fi
13161
13162 cf_add_libs="$LIBS"
13163 # reverse order
13164 cf_add_0lib=
13165 for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
13166 # filter duplicates
13167 for cf_add_1lib in $cf_add_0lib; do
13168         for cf_add_2lib in $cf_add_libs; do
13169                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
13170                         cf_add_1lib=
13171                         break
13172                 fi
13173         done
13174         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
13175 done
13176 LIBS="$cf_add_libs"
13177
13178                                                         LIBS="$cf_save_xmu"
13179
13180 test -n "$verbose" && echo "    ...before $LIBS" 1>&6
13181
13182 echo "${as_me:-configure}:13182: testing ...before $LIBS ..." 1>&5
13183
13184 LIBS=`echo "$LIBS" | sed -e "s/[        ][      ]*/ /g" -e "s%$cf_first_lib %$cf_first_lib $cf_pkgconfig_libs %" -e 's%  % %g'`
13185 test -n "$verbose" && echo "    ...after  $LIBS" 1>&6
13186
13187 echo "${as_me:-configure}:13187: testing ...after  $LIBS ..." 1>&5
13188
13189 else
13190         cf_pkgconfig_incs=
13191         cf_pkgconfig_libs=
13192
13193 test -n "$verbose" && echo "    ...before $LIBS" 1>&6
13194
13195 echo "${as_me:-configure}:13195: testing ...before $LIBS ..." 1>&5
13196
13197 LIBS=`echo "$LIBS" | sed -e "s/[        ][      ]*/ /g" -e "s%$cf_first_lib %$cf_first_lib -lXmu %" -e 's%  % %g'`
13198 test -n "$verbose" && echo "    ...after  $LIBS" 1>&6
13199
13200 echo "${as_me:-configure}:13200: testing ...after  $LIBS ..." 1>&5
13201
13202 fi
13203
13204         for cf_trim_lib in Xmu Xt X11
13205         do
13206                 case "$LIBS" in
13207                 (*-l$cf_trim_lib\ *-l$cf_trim_lib*)
13208                         LIBS=`echo "$LIBS " | sed -e 's/  / /g' -e 's%-l'"$cf_trim_lib"' %%' -e 's/ $//'`
13209                         test -n "$verbose" && echo "    ..trimmed $LIBS" 1>&6
13210
13211 echo "${as_me:-configure}:13211: testing ..trimmed $LIBS ..." 1>&5
13212
13213                         ;;
13214                 esac
13215         done
13216
13217                                         ;;
13218                                 esac
13219                         fi
13220
13221                         break
13222 else
13223         cf_pkgconfig_incs=
13224         cf_pkgconfig_libs=
13225         :
13226 fi
13227
13228         done
13229 fi
13230
13231 if test -z "$cf_x_athena_lib" ; then
13232
13233 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists Xext; then
13234         test -n "$verbose" && echo "    found package Xext" 1>&6
13235
13236 echo "${as_me:-configure}:13236: testing found package Xext ..." 1>&5
13237
13238         cf_pkgconfig_incs="`$PKG_CONFIG --cflags Xext 2>/dev/null`"
13239         cf_pkgconfig_libs="`$PKG_CONFIG --libs   Xext 2>/dev/null`"
13240         test -n "$verbose" && echo "    package Xext CFLAGS: $cf_pkgconfig_incs" 1>&6
13241
13242 echo "${as_me:-configure}:13242: testing package Xext CFLAGS: $cf_pkgconfig_incs ..." 1>&5
13243
13244         test -n "$verbose" && echo "    package Xext LIBS: $cf_pkgconfig_libs" 1>&6
13245
13246 echo "${as_me:-configure}:13246: testing package Xext LIBS: $cf_pkgconfig_libs ..." 1>&5
13247
13248 cf_fix_cppflags=no
13249 cf_new_cflags=
13250 cf_new_cppflags=
13251 cf_new_extra_cppflags=
13252
13253 for cf_add_cflags in $cf_pkgconfig_incs
13254 do
13255 case $cf_fix_cppflags in
13256 (no)
13257         case $cf_add_cflags in
13258         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13259                 case $cf_add_cflags in
13260                 (-D*)
13261                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13262
13263                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13264                                 && test -z "${cf_tst_cflags}" \
13265                                 && cf_fix_cppflags=yes
13266
13267                         if test $cf_fix_cppflags = yes ; then
13268
13269         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13270         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13271
13272                                 continue
13273                         elif test "${cf_tst_cflags}" = "\"'" ; then
13274
13275         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13276         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13277
13278                                 continue
13279                         fi
13280                         ;;
13281                 esac
13282                 case "$CPPFLAGS" in
13283                 (*$cf_add_cflags)
13284                         ;;
13285                 (*)
13286                         case $cf_add_cflags in
13287                         (-D*)
13288                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13289
13290 CPPFLAGS=`echo "$CPPFLAGS" | \
13291         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13292                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13293
13294                                 ;;
13295                         esac
13296
13297         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13298         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
13299
13300                         ;;
13301                 esac
13302                 ;;
13303         (*)
13304
13305         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
13306         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
13307
13308                 ;;
13309         esac
13310         ;;
13311 (yes)
13312
13313         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13314         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13315
13316         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
13317
13318         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13319                 && test -z "${cf_tst_cflags}" \
13320                 && cf_fix_cppflags=no
13321         ;;
13322 esac
13323 done
13324
13325 if test -n "$cf_new_cflags" ; then
13326
13327         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
13328         CFLAGS="${CFLAGS}$cf_new_cflags"
13329
13330 fi
13331
13332 if test -n "$cf_new_cppflags" ; then
13333
13334         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13335         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
13336
13337 fi
13338
13339 if test -n "$cf_new_extra_cppflags" ; then
13340
13341         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
13342         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
13343
13344 fi
13345
13346 cf_add_libs="$LIBS"
13347 # reverse order
13348 cf_add_0lib=
13349 for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
13350 # filter duplicates
13351 for cf_add_1lib in $cf_add_0lib; do
13352         for cf_add_2lib in $cf_add_libs; do
13353                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
13354                         cf_add_1lib=
13355                         break
13356                 fi
13357         done
13358         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
13359 done
13360 LIBS="$cf_add_libs"
13361
13362         :
13363 else
13364         cf_pkgconfig_incs=
13365         cf_pkgconfig_libs=
13366
13367         echo "$as_me:13367: checking for XextCreateExtension in -lXext" >&5
13368 echo $ECHO_N "checking for XextCreateExtension in -lXext... $ECHO_C" >&6
13369 if test "${ac_cv_lib_Xext_XextCreateExtension+set}" = set; then
13370   echo $ECHO_N "(cached) $ECHO_C" >&6
13371 else
13372   ac_check_lib_save_LIBS=$LIBS
13373 LIBS="-lXext  $LIBS"
13374 cat >conftest.$ac_ext <<_ACEOF
13375 #line 13375 "configure"
13376 #include "confdefs.h"
13377
13378 /* Override any gcc2 internal prototype to avoid an error.  */
13379 #ifdef __cplusplus
13380 extern "C"
13381 #endif
13382 /* We use char because int might match the return type of a gcc2
13383    builtin and then its argument prototype would still apply.  */
13384 char XextCreateExtension ();
13385 int
13386 main (void)
13387 {
13388 XextCreateExtension ();
13389   ;
13390   return 0;
13391 }
13392 _ACEOF
13393 rm -f conftest.$ac_objext conftest$ac_exeext
13394 if { (eval echo "$as_me:13394: \"$ac_link\"") >&5
13395   (eval $ac_link) 2>&5
13396   ac_status=$?
13397   echo "$as_me:13397: \$? = $ac_status" >&5
13398   (exit $ac_status); } &&
13399          { ac_try='test -s conftest$ac_exeext'
13400   { (eval echo "$as_me:13400: \"$ac_try\"") >&5
13401   (eval $ac_try) 2>&5
13402   ac_status=$?
13403   echo "$as_me:13403: \$? = $ac_status" >&5
13404   (exit $ac_status); }; }; then
13405   ac_cv_lib_Xext_XextCreateExtension=yes
13406 else
13407   echo "$as_me: failed program was:" >&5
13408 cat conftest.$ac_ext >&5
13409 ac_cv_lib_Xext_XextCreateExtension=no
13410 fi
13411 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13412 LIBS=$ac_check_lib_save_LIBS
13413 fi
13414 echo "$as_me:13414: result: $ac_cv_lib_Xext_XextCreateExtension" >&5
13415 echo "${ECHO_T}$ac_cv_lib_Xext_XextCreateExtension" >&6
13416 if test $ac_cv_lib_Xext_XextCreateExtension = yes; then
13417
13418 cf_add_libs="$LIBS"
13419 # reverse order
13420 cf_add_0lib=
13421 for cf_add_1lib in -lXext; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
13422 # filter duplicates
13423 for cf_add_1lib in $cf_add_0lib; do
13424         for cf_add_2lib in $cf_add_libs; do
13425                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
13426                         cf_add_1lib=
13427                         break
13428                 fi
13429         done
13430         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
13431 done
13432 LIBS="$cf_add_libs"
13433
13434 fi
13435
13436 fi
13437
13438 # OSX is schizoid about who owns /usr/X11 (old) versus /opt/X11 (new) (and
13439 # in some cases has installed dummy files in the former, other cases replaced
13440 # it with a link to the new location).  This complicates the configure script.
13441 # Check for that pitfall, and recover using pkg-config
13442 #
13443 # If none of these are set, the configuration is almost certainly broken.
13444 if test -z "${X_CFLAGS}${X_PRE_LIBS}${X_LIBS}${X_EXTRA_LIBS}"
13445 then
13446
13447 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists x11; then
13448         test -n "$verbose" && echo "    found package x11" 1>&6
13449
13450 echo "${as_me:-configure}:13450: testing found package x11 ..." 1>&5
13451
13452         cf_pkgconfig_incs="`$PKG_CONFIG --cflags x11 2>/dev/null`"
13453         cf_pkgconfig_libs="`$PKG_CONFIG --libs   x11 2>/dev/null`"
13454         test -n "$verbose" && echo "    package x11 CFLAGS: $cf_pkgconfig_incs" 1>&6
13455
13456 echo "${as_me:-configure}:13456: testing package x11 CFLAGS: $cf_pkgconfig_incs ..." 1>&5
13457
13458         test -n "$verbose" && echo "    package x11 LIBS: $cf_pkgconfig_libs" 1>&6
13459
13460 echo "${as_me:-configure}:13460: testing package x11 LIBS: $cf_pkgconfig_libs ..." 1>&5
13461
13462 cf_fix_cppflags=no
13463 cf_new_cflags=
13464 cf_new_cppflags=
13465 cf_new_extra_cppflags=
13466
13467 for cf_add_cflags in $cf_pkgconfig_incs
13468 do
13469 case $cf_fix_cppflags in
13470 (no)
13471         case $cf_add_cflags in
13472         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13473                 case $cf_add_cflags in
13474                 (-D*)
13475                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13476
13477                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13478                                 && test -z "${cf_tst_cflags}" \
13479                                 && cf_fix_cppflags=yes
13480
13481                         if test $cf_fix_cppflags = yes ; then
13482
13483         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13484         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13485
13486                                 continue
13487                         elif test "${cf_tst_cflags}" = "\"'" ; then
13488
13489         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13490         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13491
13492                                 continue
13493                         fi
13494                         ;;
13495                 esac
13496                 case "$CPPFLAGS" in
13497                 (*$cf_add_cflags)
13498                         ;;
13499                 (*)
13500                         case $cf_add_cflags in
13501                         (-D*)
13502                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13503
13504 CPPFLAGS=`echo "$CPPFLAGS" | \
13505         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13506                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13507
13508                                 ;;
13509                         esac
13510
13511         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13512         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
13513
13514                         ;;
13515                 esac
13516                 ;;
13517         (*)
13518
13519         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
13520         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
13521
13522                 ;;
13523         esac
13524         ;;
13525 (yes)
13526
13527         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13528         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13529
13530         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
13531
13532         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13533                 && test -z "${cf_tst_cflags}" \
13534                 && cf_fix_cppflags=no
13535         ;;
13536 esac
13537 done
13538
13539 if test -n "$cf_new_cflags" ; then
13540
13541         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
13542         CFLAGS="${CFLAGS}$cf_new_cflags"
13543
13544 fi
13545
13546 if test -n "$cf_new_cppflags" ; then
13547
13548         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13549         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
13550
13551 fi
13552
13553 if test -n "$cf_new_extra_cppflags" ; then
13554
13555         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
13556         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
13557
13558 fi
13559
13560 cf_add_libs="$LIBS"
13561 # reverse order
13562 cf_add_0lib=
13563 for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
13564 # filter duplicates
13565 for cf_add_1lib in $cf_add_0lib; do
13566         for cf_add_2lib in $cf_add_libs; do
13567                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
13568                         cf_add_1lib=
13569                         break
13570                 fi
13571         done
13572         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
13573 done
13574 LIBS="$cf_add_libs"
13575
13576         :
13577 else
13578         cf_pkgconfig_incs=
13579         cf_pkgconfig_libs=
13580         { echo "$as_me:13580: WARNING: unable to find X11 library" >&5
13581 echo "$as_me: WARNING: unable to find X11 library" >&2;}
13582 fi
13583
13584 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists ice; then
13585         test -n "$verbose" && echo "    found package ice" 1>&6
13586
13587 echo "${as_me:-configure}:13587: testing found package ice ..." 1>&5
13588
13589         cf_pkgconfig_incs="`$PKG_CONFIG --cflags ice 2>/dev/null`"
13590         cf_pkgconfig_libs="`$PKG_CONFIG --libs   ice 2>/dev/null`"
13591         test -n "$verbose" && echo "    package ice CFLAGS: $cf_pkgconfig_incs" 1>&6
13592
13593 echo "${as_me:-configure}:13593: testing package ice CFLAGS: $cf_pkgconfig_incs ..." 1>&5
13594
13595         test -n "$verbose" && echo "    package ice LIBS: $cf_pkgconfig_libs" 1>&6
13596
13597 echo "${as_me:-configure}:13597: testing package ice LIBS: $cf_pkgconfig_libs ..." 1>&5
13598
13599 cf_fix_cppflags=no
13600 cf_new_cflags=
13601 cf_new_cppflags=
13602 cf_new_extra_cppflags=
13603
13604 for cf_add_cflags in $cf_pkgconfig_incs
13605 do
13606 case $cf_fix_cppflags in
13607 (no)
13608         case $cf_add_cflags in
13609         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13610                 case $cf_add_cflags in
13611                 (-D*)
13612                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13613
13614                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13615                                 && test -z "${cf_tst_cflags}" \
13616                                 && cf_fix_cppflags=yes
13617
13618                         if test $cf_fix_cppflags = yes ; then
13619
13620         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13621         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13622
13623                                 continue
13624                         elif test "${cf_tst_cflags}" = "\"'" ; then
13625
13626         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13627         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13628
13629                                 continue
13630                         fi
13631                         ;;
13632                 esac
13633                 case "$CPPFLAGS" in
13634                 (*$cf_add_cflags)
13635                         ;;
13636                 (*)
13637                         case $cf_add_cflags in
13638                         (-D*)
13639                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13640
13641 CPPFLAGS=`echo "$CPPFLAGS" | \
13642         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13643                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13644
13645                                 ;;
13646                         esac
13647
13648         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13649         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
13650
13651                         ;;
13652                 esac
13653                 ;;
13654         (*)
13655
13656         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
13657         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
13658
13659                 ;;
13660         esac
13661         ;;
13662 (yes)
13663
13664         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13665         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13666
13667         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
13668
13669         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13670                 && test -z "${cf_tst_cflags}" \
13671                 && cf_fix_cppflags=no
13672         ;;
13673 esac
13674 done
13675
13676 if test -n "$cf_new_cflags" ; then
13677
13678         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
13679         CFLAGS="${CFLAGS}$cf_new_cflags"
13680
13681 fi
13682
13683 if test -n "$cf_new_cppflags" ; then
13684
13685         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13686         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
13687
13688 fi
13689
13690 if test -n "$cf_new_extra_cppflags" ; then
13691
13692         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
13693         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
13694
13695 fi
13696
13697 cf_add_libs="$LIBS"
13698 # reverse order
13699 cf_add_0lib=
13700 for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
13701 # filter duplicates
13702 for cf_add_1lib in $cf_add_0lib; do
13703         for cf_add_2lib in $cf_add_libs; do
13704                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
13705                         cf_add_1lib=
13706                         break
13707                 fi
13708         done
13709         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
13710 done
13711 LIBS="$cf_add_libs"
13712
13713         :
13714 else
13715         cf_pkgconfig_incs=
13716         cf_pkgconfig_libs=
13717         { echo "$as_me:13717: WARNING: unable to find ICE library" >&5
13718 echo "$as_me: WARNING: unable to find ICE library" >&2;}
13719 fi
13720
13721 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists sm; then
13722         test -n "$verbose" && echo "    found package sm" 1>&6
13723
13724 echo "${as_me:-configure}:13724: testing found package sm ..." 1>&5
13725
13726         cf_pkgconfig_incs="`$PKG_CONFIG --cflags sm 2>/dev/null`"
13727         cf_pkgconfig_libs="`$PKG_CONFIG --libs   sm 2>/dev/null`"
13728         test -n "$verbose" && echo "    package sm CFLAGS: $cf_pkgconfig_incs" 1>&6
13729
13730 echo "${as_me:-configure}:13730: testing package sm CFLAGS: $cf_pkgconfig_incs ..." 1>&5
13731
13732         test -n "$verbose" && echo "    package sm LIBS: $cf_pkgconfig_libs" 1>&6
13733
13734 echo "${as_me:-configure}:13734: testing package sm LIBS: $cf_pkgconfig_libs ..." 1>&5
13735
13736 cf_fix_cppflags=no
13737 cf_new_cflags=
13738 cf_new_cppflags=
13739 cf_new_extra_cppflags=
13740
13741 for cf_add_cflags in $cf_pkgconfig_incs
13742 do
13743 case $cf_fix_cppflags in
13744 (no)
13745         case $cf_add_cflags in
13746         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13747                 case $cf_add_cflags in
13748                 (-D*)
13749                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13750
13751                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13752                                 && test -z "${cf_tst_cflags}" \
13753                                 && cf_fix_cppflags=yes
13754
13755                         if test $cf_fix_cppflags = yes ; then
13756
13757         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13758         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13759
13760                                 continue
13761                         elif test "${cf_tst_cflags}" = "\"'" ; then
13762
13763         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13764         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13765
13766                                 continue
13767                         fi
13768                         ;;
13769                 esac
13770                 case "$CPPFLAGS" in
13771                 (*$cf_add_cflags)
13772                         ;;
13773                 (*)
13774                         case $cf_add_cflags in
13775                         (-D*)
13776                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13777
13778 CPPFLAGS=`echo "$CPPFLAGS" | \
13779         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13780                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13781
13782                                 ;;
13783                         esac
13784
13785         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13786         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
13787
13788                         ;;
13789                 esac
13790                 ;;
13791         (*)
13792
13793         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
13794         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
13795
13796                 ;;
13797         esac
13798         ;;
13799 (yes)
13800
13801         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13802         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13803
13804         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
13805
13806         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13807                 && test -z "${cf_tst_cflags}" \
13808                 && cf_fix_cppflags=no
13809         ;;
13810 esac
13811 done
13812
13813 if test -n "$cf_new_cflags" ; then
13814
13815         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
13816         CFLAGS="${CFLAGS}$cf_new_cflags"
13817
13818 fi
13819
13820 if test -n "$cf_new_cppflags" ; then
13821
13822         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13823         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
13824
13825 fi
13826
13827 if test -n "$cf_new_extra_cppflags" ; then
13828
13829         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
13830         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
13831
13832 fi
13833
13834 cf_add_libs="$LIBS"
13835 # reverse order
13836 cf_add_0lib=
13837 for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
13838 # filter duplicates
13839 for cf_add_1lib in $cf_add_0lib; do
13840         for cf_add_2lib in $cf_add_libs; do
13841                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
13842                         cf_add_1lib=
13843                         break
13844                 fi
13845         done
13846         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
13847 done
13848 LIBS="$cf_add_libs"
13849
13850         :
13851 else
13852         cf_pkgconfig_incs=
13853         cf_pkgconfig_libs=
13854         { echo "$as_me:13854: WARNING: unable to find SM library" >&5
13855 echo "$as_me: WARNING: unable to find SM library" >&2;}
13856 fi
13857
13858 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists xt; then
13859         test -n "$verbose" && echo "    found package xt" 1>&6
13860
13861 echo "${as_me:-configure}:13861: testing found package xt ..." 1>&5
13862
13863         cf_pkgconfig_incs="`$PKG_CONFIG --cflags xt 2>/dev/null`"
13864         cf_pkgconfig_libs="`$PKG_CONFIG --libs   xt 2>/dev/null`"
13865         test -n "$verbose" && echo "    package xt CFLAGS: $cf_pkgconfig_incs" 1>&6
13866
13867 echo "${as_me:-configure}:13867: testing package xt CFLAGS: $cf_pkgconfig_incs ..." 1>&5
13868
13869         test -n "$verbose" && echo "    package xt LIBS: $cf_pkgconfig_libs" 1>&6
13870
13871 echo "${as_me:-configure}:13871: testing package xt LIBS: $cf_pkgconfig_libs ..." 1>&5
13872
13873 cf_fix_cppflags=no
13874 cf_new_cflags=
13875 cf_new_cppflags=
13876 cf_new_extra_cppflags=
13877
13878 for cf_add_cflags in $cf_pkgconfig_incs
13879 do
13880 case $cf_fix_cppflags in
13881 (no)
13882         case $cf_add_cflags in
13883         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13884                 case $cf_add_cflags in
13885                 (-D*)
13886                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13887
13888                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13889                                 && test -z "${cf_tst_cflags}" \
13890                                 && cf_fix_cppflags=yes
13891
13892                         if test $cf_fix_cppflags = yes ; then
13893
13894         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13895         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13896
13897                                 continue
13898                         elif test "${cf_tst_cflags}" = "\"'" ; then
13899
13900         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13901         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13902
13903                                 continue
13904                         fi
13905                         ;;
13906                 esac
13907                 case "$CPPFLAGS" in
13908                 (*$cf_add_cflags)
13909                         ;;
13910                 (*)
13911                         case $cf_add_cflags in
13912                         (-D*)
13913                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13914
13915 CPPFLAGS=`echo "$CPPFLAGS" | \
13916         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13917                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13918
13919                                 ;;
13920                         esac
13921
13922         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13923         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
13924
13925                         ;;
13926                 esac
13927                 ;;
13928         (*)
13929
13930         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
13931         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
13932
13933                 ;;
13934         esac
13935         ;;
13936 (yes)
13937
13938         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13939         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13940
13941         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
13942
13943         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13944                 && test -z "${cf_tst_cflags}" \
13945                 && cf_fix_cppflags=no
13946         ;;
13947 esac
13948 done
13949
13950 if test -n "$cf_new_cflags" ; then
13951
13952         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
13953         CFLAGS="${CFLAGS}$cf_new_cflags"
13954
13955 fi
13956
13957 if test -n "$cf_new_cppflags" ; then
13958
13959         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13960         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
13961
13962 fi
13963
13964 if test -n "$cf_new_extra_cppflags" ; then
13965
13966         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
13967         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
13968
13969 fi
13970
13971 cf_add_libs="$LIBS"
13972 # reverse order
13973 cf_add_0lib=
13974 for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
13975 # filter duplicates
13976 for cf_add_1lib in $cf_add_0lib; do
13977         for cf_add_2lib in $cf_add_libs; do
13978                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
13979                         cf_add_1lib=
13980                         break
13981                 fi
13982         done
13983         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
13984 done
13985 LIBS="$cf_add_libs"
13986
13987         :
13988 else
13989         cf_pkgconfig_incs=
13990         cf_pkgconfig_libs=
13991         { echo "$as_me:13991: WARNING: unable to find Xt library" >&5
13992 echo "$as_me: WARNING: unable to find Xt library" >&2;}
13993 fi
13994
13995 else
13996         LIBS="$X_PRE_LIBS $LIBS $X_EXTRA_LIBS"
13997 fi
13998
13999 cf_have_X_LIBS=no
14000
14001 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists xt; then
14002         test -n "$verbose" && echo "    found package xt" 1>&6
14003
14004 echo "${as_me:-configure}:14004: testing found package xt ..." 1>&5
14005
14006         cf_pkgconfig_incs="`$PKG_CONFIG --cflags xt 2>/dev/null`"
14007         cf_pkgconfig_libs="`$PKG_CONFIG --libs   xt 2>/dev/null`"
14008         test -n "$verbose" && echo "    package xt CFLAGS: $cf_pkgconfig_incs" 1>&6
14009
14010 echo "${as_me:-configure}:14010: testing package xt CFLAGS: $cf_pkgconfig_incs ..." 1>&5
14011
14012         test -n "$verbose" && echo "    package xt LIBS: $cf_pkgconfig_libs" 1>&6
14013
14014 echo "${as_me:-configure}:14014: testing package xt LIBS: $cf_pkgconfig_libs ..." 1>&5
14015
14016 cf_fix_cppflags=no
14017 cf_new_cflags=
14018 cf_new_cppflags=
14019 cf_new_extra_cppflags=
14020
14021 for cf_add_cflags in $cf_pkgconfig_incs
14022 do
14023 case $cf_fix_cppflags in
14024 (no)
14025         case $cf_add_cflags in
14026         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
14027                 case $cf_add_cflags in
14028                 (-D*)
14029                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
14030
14031                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14032                                 && test -z "${cf_tst_cflags}" \
14033                                 && cf_fix_cppflags=yes
14034
14035                         if test $cf_fix_cppflags = yes ; then
14036
14037         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14038         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14039
14040                                 continue
14041                         elif test "${cf_tst_cflags}" = "\"'" ; then
14042
14043         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14044         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14045
14046                                 continue
14047                         fi
14048                         ;;
14049                 esac
14050                 case "$CPPFLAGS" in
14051                 (*$cf_add_cflags)
14052                         ;;
14053                 (*)
14054                         case $cf_add_cflags in
14055                         (-D*)
14056                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
14057
14058 CPPFLAGS=`echo "$CPPFLAGS" | \
14059         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
14060                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
14061
14062                                 ;;
14063                         esac
14064
14065         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
14066         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
14067
14068                         ;;
14069                 esac
14070                 ;;
14071         (*)
14072
14073         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
14074         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
14075
14076                 ;;
14077         esac
14078         ;;
14079 (yes)
14080
14081         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14082         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14083
14084         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
14085
14086         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14087                 && test -z "${cf_tst_cflags}" \
14088                 && cf_fix_cppflags=no
14089         ;;
14090 esac
14091 done
14092
14093 if test -n "$cf_new_cflags" ; then
14094
14095         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
14096         CFLAGS="${CFLAGS}$cf_new_cflags"
14097
14098 fi
14099
14100 if test -n "$cf_new_cppflags" ; then
14101
14102         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14103         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
14104
14105 fi
14106
14107 if test -n "$cf_new_extra_cppflags" ; then
14108
14109         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
14110         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
14111
14112 fi
14113
14114 cf_add_libs="$LIBS"
14115 # reverse order
14116 cf_add_0lib=
14117 for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
14118 # filter duplicates
14119 for cf_add_1lib in $cf_add_0lib; do
14120         for cf_add_2lib in $cf_add_libs; do
14121                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
14122                         cf_add_1lib=
14123                         break
14124                 fi
14125         done
14126         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
14127 done
14128 LIBS="$cf_add_libs"
14129
14130         case "x$LIBS" in
14131         (*-lX11*)
14132                 ;;
14133         (*)
14134 # we have an "xt" package, but it may omit Xt's dependency on X11
14135 echo "$as_me:14135: checking for usable X dependency" >&5
14136 echo $ECHO_N "checking for usable X dependency... $ECHO_C" >&6
14137 if test "${cf_cv_xt_x11_compat+set}" = set; then
14138   echo $ECHO_N "(cached) $ECHO_C" >&6
14139 else
14140
14141 cat >conftest.$ac_ext <<_ACEOF
14142 #line 14142 "configure"
14143 #include "confdefs.h"
14144
14145 #include <X11/Xlib.h>
14146
14147 int
14148 main (void)
14149 {
14150
14151         int rc1 = XDrawLine((Display*) 0, (Drawable) 0, (GC) 0, 0, 0, 0, 0);
14152         int rc2 = XClearWindow((Display*) 0, (Window) 0);
14153         int rc3 = XMoveWindow((Display*) 0, (Window) 0, 0, 0);
14154         int rc4 = XMoveResizeWindow((Display*)0, (Window)0, 0, 0, 0, 0);
14155
14156   ;
14157   return 0;
14158 }
14159 _ACEOF
14160 rm -f conftest.$ac_objext conftest$ac_exeext
14161 if { (eval echo "$as_me:14161: \"$ac_link\"") >&5
14162   (eval $ac_link) 2>&5
14163   ac_status=$?
14164   echo "$as_me:14164: \$? = $ac_status" >&5
14165   (exit $ac_status); } &&
14166          { ac_try='test -s conftest$ac_exeext'
14167   { (eval echo "$as_me:14167: \"$ac_try\"") >&5
14168   (eval $ac_try) 2>&5
14169   ac_status=$?
14170   echo "$as_me:14170: \$? = $ac_status" >&5
14171   (exit $ac_status); }; }; then
14172   cf_cv_xt_x11_compat=yes
14173 else
14174   echo "$as_me: failed program was:" >&5
14175 cat conftest.$ac_ext >&5
14176 cf_cv_xt_x11_compat=no
14177 fi
14178 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14179 fi
14180 echo "$as_me:14180: result: $cf_cv_xt_x11_compat" >&5
14181 echo "${ECHO_T}$cf_cv_xt_x11_compat" >&6
14182                 if test "$cf_cv_xt_x11_compat" = no
14183                 then
14184                         test -n "$verbose" && echo "    work around broken X11 dependency" 1>&6
14185
14186 echo "${as_me:-configure}:14186: testing work around broken X11 dependency ..." 1>&5
14187
14188                         # 2010/11/19 - good enough until a working Xt on Xcb is delivered.
14189
14190 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists x11; then
14191         test -n "$verbose" && echo "    found package x11" 1>&6
14192
14193 echo "${as_me:-configure}:14193: testing found package x11 ..." 1>&5
14194
14195         cf_pkgconfig_incs="`$PKG_CONFIG --cflags x11 2>/dev/null`"
14196         cf_pkgconfig_libs="`$PKG_CONFIG --libs   x11 2>/dev/null`"
14197         test -n "$verbose" && echo "    package x11 CFLAGS: $cf_pkgconfig_incs" 1>&6
14198
14199 echo "${as_me:-configure}:14199: testing package x11 CFLAGS: $cf_pkgconfig_incs ..." 1>&5
14200
14201         test -n "$verbose" && echo "    package x11 LIBS: $cf_pkgconfig_libs" 1>&6
14202
14203 echo "${as_me:-configure}:14203: testing package x11 LIBS: $cf_pkgconfig_libs ..." 1>&5
14204
14205 cf_fix_cppflags=no
14206 cf_new_cflags=
14207 cf_new_cppflags=
14208 cf_new_extra_cppflags=
14209
14210 for cf_add_cflags in $cf_pkgconfig_incs
14211 do
14212 case $cf_fix_cppflags in
14213 (no)
14214         case $cf_add_cflags in
14215         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
14216                 case $cf_add_cflags in
14217                 (-D*)
14218                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
14219
14220                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14221                                 && test -z "${cf_tst_cflags}" \
14222                                 && cf_fix_cppflags=yes
14223
14224                         if test $cf_fix_cppflags = yes ; then
14225
14226         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14227         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14228
14229                                 continue
14230                         elif test "${cf_tst_cflags}" = "\"'" ; then
14231
14232         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14233         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14234
14235                                 continue
14236                         fi
14237                         ;;
14238                 esac
14239                 case "$CPPFLAGS" in
14240                 (*$cf_add_cflags)
14241                         ;;
14242                 (*)
14243                         case $cf_add_cflags in
14244                         (-D*)
14245                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
14246
14247 CPPFLAGS=`echo "$CPPFLAGS" | \
14248         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
14249                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
14250
14251                                 ;;
14252                         esac
14253
14254         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
14255         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
14256
14257                         ;;
14258                 esac
14259                 ;;
14260         (*)
14261
14262         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
14263         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
14264
14265                 ;;
14266         esac
14267         ;;
14268 (yes)
14269
14270         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14271         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14272
14273         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
14274
14275         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14276                 && test -z "${cf_tst_cflags}" \
14277                 && cf_fix_cppflags=no
14278         ;;
14279 esac
14280 done
14281
14282 if test -n "$cf_new_cflags" ; then
14283
14284         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
14285         CFLAGS="${CFLAGS}$cf_new_cflags"
14286
14287 fi
14288
14289 if test -n "$cf_new_cppflags" ; then
14290
14291         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14292         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
14293
14294 fi
14295
14296 if test -n "$cf_new_extra_cppflags" ; then
14297
14298         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
14299         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
14300
14301 fi
14302
14303 cf_add_libs="$LIBS"
14304 # reverse order
14305 cf_add_0lib=
14306 for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
14307 # filter duplicates
14308 for cf_add_1lib in $cf_add_0lib; do
14309         for cf_add_2lib in $cf_add_libs; do
14310                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
14311                         cf_add_1lib=
14312                         break
14313                 fi
14314         done
14315         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
14316 done
14317 LIBS="$cf_add_libs"
14318
14319         :
14320 else
14321         cf_pkgconfig_incs=
14322         cf_pkgconfig_libs=
14323
14324 test -n "$verbose" && echo "    ...before $LIBS" 1>&6
14325
14326 echo "${as_me:-configure}:14326: testing ...before $LIBS ..." 1>&5
14327
14328 LIBS=`echo "$LIBS" | sed -e "s/[        ][      ]*/ /g" -e "s%-lXt %-lXt -lX11 %" -e 's%  % %g'`
14329 test -n "$verbose" && echo "    ...after  $LIBS" 1>&6
14330
14331 echo "${as_me:-configure}:14331: testing ...after  $LIBS ..." 1>&5
14332
14333 fi
14334
14335                 fi
14336                 ;;
14337         esac
14338
14339 echo "$as_me:14339: checking for usable X Toolkit package" >&5
14340 echo $ECHO_N "checking for usable X Toolkit package... $ECHO_C" >&6
14341 if test "${cf_cv_xt_ice_compat+set}" = set; then
14342   echo $ECHO_N "(cached) $ECHO_C" >&6
14343 else
14344
14345 cat >conftest.$ac_ext <<_ACEOF
14346 #line 14346 "configure"
14347 #include "confdefs.h"
14348
14349 #include <X11/Shell.h>
14350
14351 int
14352 main (void)
14353 {
14354 int num = IceConnectionNumber(0); (void) num
14355
14356   ;
14357   return 0;
14358 }
14359 _ACEOF
14360 rm -f conftest.$ac_objext conftest$ac_exeext
14361 if { (eval echo "$as_me:14361: \"$ac_link\"") >&5
14362   (eval $ac_link) 2>&5
14363   ac_status=$?
14364   echo "$as_me:14364: \$? = $ac_status" >&5
14365   (exit $ac_status); } &&
14366          { ac_try='test -s conftest$ac_exeext'
14367   { (eval echo "$as_me:14367: \"$ac_try\"") >&5
14368   (eval $ac_try) 2>&5
14369   ac_status=$?
14370   echo "$as_me:14370: \$? = $ac_status" >&5
14371   (exit $ac_status); }; }; then
14372   cf_cv_xt_ice_compat=yes
14373 else
14374   echo "$as_me: failed program was:" >&5
14375 cat conftest.$ac_ext >&5
14376 cf_cv_xt_ice_compat=no
14377 fi
14378 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14379 fi
14380 echo "$as_me:14380: result: $cf_cv_xt_ice_compat" >&5
14381 echo "${ECHO_T}$cf_cv_xt_ice_compat" >&6
14382
14383         if test "$cf_cv_xt_ice_compat" = no
14384         then
14385                 # workaround for broken ".pc" files used for X Toolkit.
14386                 case "x$X_PRE_LIBS" in
14387                 (*-lICE*)
14388                         case "x$LIBS" in
14389                         (*-lICE*)
14390                                 ;;
14391                         (*)
14392                                 test -n "$verbose" && echo "    work around broken ICE dependency" 1>&6
14393
14394 echo "${as_me:-configure}:14394: testing work around broken ICE dependency ..." 1>&5
14395
14396 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists ice; then
14397         test -n "$verbose" && echo "    found package ice" 1>&6
14398
14399 echo "${as_me:-configure}:14399: testing found package ice ..." 1>&5
14400
14401         cf_pkgconfig_incs="`$PKG_CONFIG --cflags ice 2>/dev/null`"
14402         cf_pkgconfig_libs="`$PKG_CONFIG --libs   ice 2>/dev/null`"
14403         test -n "$verbose" && echo "    package ice CFLAGS: $cf_pkgconfig_incs" 1>&6
14404
14405 echo "${as_me:-configure}:14405: testing package ice CFLAGS: $cf_pkgconfig_incs ..." 1>&5
14406
14407         test -n "$verbose" && echo "    package ice LIBS: $cf_pkgconfig_libs" 1>&6
14408
14409 echo "${as_me:-configure}:14409: testing package ice LIBS: $cf_pkgconfig_libs ..." 1>&5
14410
14411 cf_fix_cppflags=no
14412 cf_new_cflags=
14413 cf_new_cppflags=
14414 cf_new_extra_cppflags=
14415
14416 for cf_add_cflags in $cf_pkgconfig_incs
14417 do
14418 case $cf_fix_cppflags in
14419 (no)
14420         case $cf_add_cflags in
14421         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
14422                 case $cf_add_cflags in
14423                 (-D*)
14424                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
14425
14426                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14427                                 && test -z "${cf_tst_cflags}" \
14428                                 && cf_fix_cppflags=yes
14429
14430                         if test $cf_fix_cppflags = yes ; then
14431
14432         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14433         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14434
14435                                 continue
14436                         elif test "${cf_tst_cflags}" = "\"'" ; then
14437
14438         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14439         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14440
14441                                 continue
14442                         fi
14443                         ;;
14444                 esac
14445                 case "$CPPFLAGS" in
14446                 (*$cf_add_cflags)
14447                         ;;
14448                 (*)
14449                         case $cf_add_cflags in
14450                         (-D*)
14451                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
14452
14453 CPPFLAGS=`echo "$CPPFLAGS" | \
14454         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
14455                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
14456
14457                                 ;;
14458                         esac
14459
14460         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
14461         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
14462
14463                         ;;
14464                 esac
14465                 ;;
14466         (*)
14467
14468         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
14469         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
14470
14471                 ;;
14472         esac
14473         ;;
14474 (yes)
14475
14476         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14477         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14478
14479         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
14480
14481         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14482                 && test -z "${cf_tst_cflags}" \
14483                 && cf_fix_cppflags=no
14484         ;;
14485 esac
14486 done
14487
14488 if test -n "$cf_new_cflags" ; then
14489
14490         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
14491         CFLAGS="${CFLAGS}$cf_new_cflags"
14492
14493 fi
14494
14495 if test -n "$cf_new_cppflags" ; then
14496
14497         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14498         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
14499
14500 fi
14501
14502 if test -n "$cf_new_extra_cppflags" ; then
14503
14504         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
14505         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
14506
14507 fi
14508
14509 cf_add_libs="$LIBS"
14510 # reverse order
14511 cf_add_0lib=
14512 for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
14513 # filter duplicates
14514 for cf_add_1lib in $cf_add_0lib; do
14515         for cf_add_2lib in $cf_add_libs; do
14516                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
14517                         cf_add_1lib=
14518                         break
14519                 fi
14520         done
14521         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
14522 done
14523 LIBS="$cf_add_libs"
14524
14525 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists sm; then
14526         test -n "$verbose" && echo "    found package sm" 1>&6
14527
14528 echo "${as_me:-configure}:14528: testing found package sm ..." 1>&5
14529
14530         cf_pkgconfig_incs="`$PKG_CONFIG --cflags sm 2>/dev/null`"
14531         cf_pkgconfig_libs="`$PKG_CONFIG --libs   sm 2>/dev/null`"
14532         test -n "$verbose" && echo "    package sm CFLAGS: $cf_pkgconfig_incs" 1>&6
14533
14534 echo "${as_me:-configure}:14534: testing package sm CFLAGS: $cf_pkgconfig_incs ..." 1>&5
14535
14536         test -n "$verbose" && echo "    package sm LIBS: $cf_pkgconfig_libs" 1>&6
14537
14538 echo "${as_me:-configure}:14538: testing package sm LIBS: $cf_pkgconfig_libs ..." 1>&5
14539
14540 cf_fix_cppflags=no
14541 cf_new_cflags=
14542 cf_new_cppflags=
14543 cf_new_extra_cppflags=
14544
14545 for cf_add_cflags in $cf_pkgconfig_incs
14546 do
14547 case $cf_fix_cppflags in
14548 (no)
14549         case $cf_add_cflags in
14550         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
14551                 case $cf_add_cflags in
14552                 (-D*)
14553                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
14554
14555                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14556                                 && test -z "${cf_tst_cflags}" \
14557                                 && cf_fix_cppflags=yes
14558
14559                         if test $cf_fix_cppflags = yes ; then
14560
14561         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14562         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14563
14564                                 continue
14565                         elif test "${cf_tst_cflags}" = "\"'" ; then
14566
14567         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14568         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14569
14570                                 continue
14571                         fi
14572                         ;;
14573                 esac
14574                 case "$CPPFLAGS" in
14575                 (*$cf_add_cflags)
14576                         ;;
14577                 (*)
14578                         case $cf_add_cflags in
14579                         (-D*)
14580                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
14581
14582 CPPFLAGS=`echo "$CPPFLAGS" | \
14583         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
14584                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
14585
14586                                 ;;
14587                         esac
14588
14589         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
14590         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
14591
14592                         ;;
14593                 esac
14594                 ;;
14595         (*)
14596
14597         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
14598         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
14599
14600                 ;;
14601         esac
14602         ;;
14603 (yes)
14604
14605         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14606         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14607
14608         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
14609
14610         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14611                 && test -z "${cf_tst_cflags}" \
14612                 && cf_fix_cppflags=no
14613         ;;
14614 esac
14615 done
14616
14617 if test -n "$cf_new_cflags" ; then
14618
14619         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
14620         CFLAGS="${CFLAGS}$cf_new_cflags"
14621
14622 fi
14623
14624 if test -n "$cf_new_cppflags" ; then
14625
14626         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14627         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
14628
14629 fi
14630
14631 if test -n "$cf_new_extra_cppflags" ; then
14632
14633         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
14634         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
14635
14636 fi
14637
14638 cf_add_libs="$LIBS"
14639 # reverse order
14640 cf_add_0lib=
14641 for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
14642 # filter duplicates
14643 for cf_add_1lib in $cf_add_0lib; do
14644         for cf_add_2lib in $cf_add_libs; do
14645                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
14646                         cf_add_1lib=
14647                         break
14648                 fi
14649         done
14650         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
14651 done
14652 LIBS="$cf_add_libs"
14653
14654         :
14655 else
14656         cf_pkgconfig_incs=
14657         cf_pkgconfig_libs=
14658         :
14659 fi
14660
14661 else
14662         cf_pkgconfig_incs=
14663         cf_pkgconfig_libs=
14664
14665 test -n "$verbose" && echo "    ...before $LIBS" 1>&6
14666
14667 echo "${as_me:-configure}:14667: testing ...before $LIBS ..." 1>&5
14668
14669 LIBS=`echo "$LIBS" | sed -e "s/[        ][      ]*/ /g" -e "s%-lXt %-lXt $X_PRE_LIBS %" -e 's%  % %g'`
14670 test -n "$verbose" && echo "    ...after  $LIBS" 1>&6
14671
14672 echo "${as_me:-configure}:14672: testing ...after  $LIBS ..." 1>&5
14673
14674 fi
14675
14676                                 ;;
14677                         esac
14678                         ;;
14679                 esac
14680         fi
14681
14682         cf_have_X_LIBS=yes
14683
14684 else
14685         cf_pkgconfig_incs=
14686         cf_pkgconfig_libs=
14687
14688         LDFLAGS="$X_LIBS $LDFLAGS"
14689
14690 test -n "$verbose" && echo "    checking additions to CFLAGS" 1>&6
14691
14692 echo "${as_me:-configure}:14692: testing checking additions to CFLAGS ..." 1>&5
14693
14694 cf_check_cflags="$CFLAGS"
14695 cf_check_cppflags="$CPPFLAGS"
14696
14697 cf_fix_cppflags=no
14698 cf_new_cflags=
14699 cf_new_cppflags=
14700 cf_new_extra_cppflags=
14701
14702 for cf_add_cflags in $X_CFLAGS
14703 do
14704 case $cf_fix_cppflags in
14705 (no)
14706         case $cf_add_cflags in
14707         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
14708                 case $cf_add_cflags in
14709                 (-D*)
14710                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
14711
14712                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14713                                 && test -z "${cf_tst_cflags}" \
14714                                 && cf_fix_cppflags=yes
14715
14716                         if test $cf_fix_cppflags = yes ; then
14717
14718         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14719         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14720
14721                                 continue
14722                         elif test "${cf_tst_cflags}" = "\"'" ; then
14723
14724         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14725         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14726
14727                                 continue
14728                         fi
14729                         ;;
14730                 esac
14731                 case "$CPPFLAGS" in
14732                 (*$cf_add_cflags)
14733                         ;;
14734                 (*)
14735                         case $cf_add_cflags in
14736                         (-D*)
14737                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
14738
14739 CPPFLAGS=`echo "$CPPFLAGS" | \
14740         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
14741                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
14742
14743                                 ;;
14744                         esac
14745
14746         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
14747         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
14748
14749                         ;;
14750                 esac
14751                 ;;
14752         (*)
14753
14754         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
14755         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
14756
14757                 ;;
14758         esac
14759         ;;
14760 (yes)
14761
14762         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14763         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14764
14765         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
14766
14767         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14768                 && test -z "${cf_tst_cflags}" \
14769                 && cf_fix_cppflags=no
14770         ;;
14771 esac
14772 done
14773
14774 if test -n "$cf_new_cflags" ; then
14775         test -n "$verbose" && echo "    add to \$CFLAGS $cf_new_cflags" 1>&6
14776
14777 echo "${as_me:-configure}:14777: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
14778
14779         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
14780         CFLAGS="${CFLAGS}$cf_new_cflags"
14781
14782 fi
14783
14784 if test -n "$cf_new_cppflags" ; then
14785         test -n "$verbose" && echo "    add to \$CPPFLAGS $cf_new_cppflags" 1>&6
14786
14787 echo "${as_me:-configure}:14787: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
14788
14789         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14790         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
14791
14792 fi
14793
14794 if test -n "$cf_new_extra_cppflags" ; then
14795         test -n "$verbose" && echo "    add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6
14796
14797 echo "${as_me:-configure}:14797: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
14798
14799         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
14800         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
14801
14802 fi
14803
14804 if test "x$cf_check_cflags" != "x$CFLAGS" ; then
14805 cat >conftest.$ac_ext <<_ACEOF
14806 #line 14806 "configure"
14807 #include "confdefs.h"
14808 #include <stdio.h>
14809 int
14810 main (void)
14811 {
14812 printf("Hello world");
14813   ;
14814   return 0;
14815 }
14816 _ACEOF
14817 rm -f conftest.$ac_objext conftest$ac_exeext
14818 if { (eval echo "$as_me:14818: \"$ac_link\"") >&5
14819   (eval $ac_link) 2>&5
14820   ac_status=$?
14821   echo "$as_me:14821: \$? = $ac_status" >&5
14822   (exit $ac_status); } &&
14823          { ac_try='test -s conftest$ac_exeext'
14824   { (eval echo "$as_me:14824: \"$ac_try\"") >&5
14825   (eval $ac_try) 2>&5
14826   ac_status=$?
14827   echo "$as_me:14827: \$? = $ac_status" >&5
14828   (exit $ac_status); }; }; then
14829   :
14830 else
14831   echo "$as_me: failed program was:" >&5
14832 cat conftest.$ac_ext >&5
14833 test -n "$verbose" && echo "    test-compile failed.  Undoing change to \$CFLAGS" 1>&6
14834
14835 echo "${as_me:-configure}:14835: testing test-compile failed.  Undoing change to \$CFLAGS ..." 1>&5
14836
14837          if test "x$cf_check_cppflags" != "x$CPPFLAGS" ; then
14838                  test -n "$verbose" && echo "   but keeping change to \$CPPFLAGS" 1>&6
14839
14840 echo "${as_me:-configure}:14840: testing but keeping change to \$CPPFLAGS ..." 1>&5
14841
14842          fi
14843          CFLAGS="$cf_check_flags"
14844 fi
14845 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14846 fi
14847
14848         echo "$as_me:14848: checking for XOpenDisplay" >&5
14849 echo $ECHO_N "checking for XOpenDisplay... $ECHO_C" >&6
14850 if test "${ac_cv_func_XOpenDisplay+set}" = set; then
14851   echo $ECHO_N "(cached) $ECHO_C" >&6
14852 else
14853   cat >conftest.$ac_ext <<_ACEOF
14854 #line 14854 "configure"
14855 #include "confdefs.h"
14856 #define XOpenDisplay autoconf_temporary
14857 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
14858 #undef XOpenDisplay
14859
14860 #ifdef __cplusplus
14861 extern "C"
14862 #endif
14863
14864 /* We use char because int might match the return type of a gcc2
14865    builtin and then its argument prototype would still apply.  */
14866 char XOpenDisplay (void);
14867
14868 int
14869 main (void)
14870 {
14871
14872 /* The GNU C library defines stubs for functions which it implements
14873     to always fail with ENOSYS.  Some functions are actually named
14874     something starting with __ and the normal name is an alias.  */
14875 #if defined (__stub_XOpenDisplay) || defined (__stub___XOpenDisplay)
14876 #error found stub for XOpenDisplay
14877 #endif
14878
14879         return XOpenDisplay ();
14880   ;
14881   return 0;
14882 }
14883 _ACEOF
14884 rm -f conftest.$ac_objext conftest$ac_exeext
14885 if { (eval echo "$as_me:14885: \"$ac_link\"") >&5
14886   (eval $ac_link) 2>&5
14887   ac_status=$?
14888   echo "$as_me:14888: \$? = $ac_status" >&5
14889   (exit $ac_status); } &&
14890          { ac_try='test -s conftest$ac_exeext'
14891   { (eval echo "$as_me:14891: \"$ac_try\"") >&5
14892   (eval $ac_try) 2>&5
14893   ac_status=$?
14894   echo "$as_me:14894: \$? = $ac_status" >&5
14895   (exit $ac_status); }; }; then
14896   ac_cv_func_XOpenDisplay=yes
14897 else
14898   echo "$as_me: failed program was:" >&5
14899 cat conftest.$ac_ext >&5
14900 ac_cv_func_XOpenDisplay=no
14901 fi
14902 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14903 fi
14904 echo "$as_me:14904: result: $ac_cv_func_XOpenDisplay" >&5
14905 echo "${ECHO_T}$ac_cv_func_XOpenDisplay" >&6
14906 if test $ac_cv_func_XOpenDisplay = yes; then
14907   :
14908 else
14909
14910         echo "$as_me:14910: checking for XOpenDisplay in -lX11" >&5
14911 echo $ECHO_N "checking for XOpenDisplay in -lX11... $ECHO_C" >&6
14912 if test "${ac_cv_lib_X11_XOpenDisplay+set}" = set; then
14913   echo $ECHO_N "(cached) $ECHO_C" >&6
14914 else
14915   ac_check_lib_save_LIBS=$LIBS
14916 LIBS="-lX11  $LIBS"
14917 cat >conftest.$ac_ext <<_ACEOF
14918 #line 14918 "configure"
14919 #include "confdefs.h"
14920
14921 /* Override any gcc2 internal prototype to avoid an error.  */
14922 #ifdef __cplusplus
14923 extern "C"
14924 #endif
14925 /* We use char because int might match the return type of a gcc2
14926    builtin and then its argument prototype would still apply.  */
14927 char XOpenDisplay ();
14928 int
14929 main (void)
14930 {
14931 XOpenDisplay ();
14932   ;
14933   return 0;
14934 }
14935 _ACEOF
14936 rm -f conftest.$ac_objext conftest$ac_exeext
14937 if { (eval echo "$as_me:14937: \"$ac_link\"") >&5
14938   (eval $ac_link) 2>&5
14939   ac_status=$?
14940   echo "$as_me:14940: \$? = $ac_status" >&5
14941   (exit $ac_status); } &&
14942          { ac_try='test -s conftest$ac_exeext'
14943   { (eval echo "$as_me:14943: \"$ac_try\"") >&5
14944   (eval $ac_try) 2>&5
14945   ac_status=$?
14946   echo "$as_me:14946: \$? = $ac_status" >&5
14947   (exit $ac_status); }; }; then
14948   ac_cv_lib_X11_XOpenDisplay=yes
14949 else
14950   echo "$as_me: failed program was:" >&5
14951 cat conftest.$ac_ext >&5
14952 ac_cv_lib_X11_XOpenDisplay=no
14953 fi
14954 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14955 LIBS=$ac_check_lib_save_LIBS
14956 fi
14957 echo "$as_me:14957: result: $ac_cv_lib_X11_XOpenDisplay" >&5
14958 echo "${ECHO_T}$ac_cv_lib_X11_XOpenDisplay" >&6
14959 if test $ac_cv_lib_X11_XOpenDisplay = yes; then
14960
14961 cf_add_libs="$LIBS"
14962 # reverse order
14963 cf_add_0lib=
14964 for cf_add_1lib in -lX11; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
14965 # filter duplicates
14966 for cf_add_1lib in $cf_add_0lib; do
14967         for cf_add_2lib in $cf_add_libs; do
14968                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
14969                         cf_add_1lib=
14970                         break
14971                 fi
14972         done
14973         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
14974 done
14975 LIBS="$cf_add_libs"
14976
14977 fi
14978
14979 fi
14980
14981         echo "$as_me:14981: checking for XtAppInitialize" >&5
14982 echo $ECHO_N "checking for XtAppInitialize... $ECHO_C" >&6
14983 if test "${ac_cv_func_XtAppInitialize+set}" = set; then
14984   echo $ECHO_N "(cached) $ECHO_C" >&6
14985 else
14986   cat >conftest.$ac_ext <<_ACEOF
14987 #line 14987 "configure"
14988 #include "confdefs.h"
14989 #define XtAppInitialize autoconf_temporary
14990 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
14991 #undef XtAppInitialize
14992
14993 #ifdef __cplusplus
14994 extern "C"
14995 #endif
14996
14997 /* We use char because int might match the return type of a gcc2
14998    builtin and then its argument prototype would still apply.  */
14999 char XtAppInitialize (void);
15000
15001 int
15002 main (void)
15003 {
15004
15005 /* The GNU C library defines stubs for functions which it implements
15006     to always fail with ENOSYS.  Some functions are actually named
15007     something starting with __ and the normal name is an alias.  */
15008 #if defined (__stub_XtAppInitialize) || defined (__stub___XtAppInitialize)
15009 #error found stub for XtAppInitialize
15010 #endif
15011
15012         return XtAppInitialize ();
15013   ;
15014   return 0;
15015 }
15016 _ACEOF
15017 rm -f conftest.$ac_objext conftest$ac_exeext
15018 if { (eval echo "$as_me:15018: \"$ac_link\"") >&5
15019   (eval $ac_link) 2>&5
15020   ac_status=$?
15021   echo "$as_me:15021: \$? = $ac_status" >&5
15022   (exit $ac_status); } &&
15023          { ac_try='test -s conftest$ac_exeext'
15024   { (eval echo "$as_me:15024: \"$ac_try\"") >&5
15025   (eval $ac_try) 2>&5
15026   ac_status=$?
15027   echo "$as_me:15027: \$? = $ac_status" >&5
15028   (exit $ac_status); }; }; then
15029   ac_cv_func_XtAppInitialize=yes
15030 else
15031   echo "$as_me: failed program was:" >&5
15032 cat conftest.$ac_ext >&5
15033 ac_cv_func_XtAppInitialize=no
15034 fi
15035 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15036 fi
15037 echo "$as_me:15037: result: $ac_cv_func_XtAppInitialize" >&5
15038 echo "${ECHO_T}$ac_cv_func_XtAppInitialize" >&6
15039 if test $ac_cv_func_XtAppInitialize = yes; then
15040   :
15041 else
15042
15043         echo "$as_me:15043: checking for XtAppInitialize in -lXt" >&5
15044 echo $ECHO_N "checking for XtAppInitialize in -lXt... $ECHO_C" >&6
15045 if test "${ac_cv_lib_Xt_XtAppInitialize+set}" = set; then
15046   echo $ECHO_N "(cached) $ECHO_C" >&6
15047 else
15048   ac_check_lib_save_LIBS=$LIBS
15049 LIBS="-lXt  $LIBS"
15050 cat >conftest.$ac_ext <<_ACEOF
15051 #line 15051 "configure"
15052 #include "confdefs.h"
15053
15054 /* Override any gcc2 internal prototype to avoid an error.  */
15055 #ifdef __cplusplus
15056 extern "C"
15057 #endif
15058 /* We use char because int might match the return type of a gcc2
15059    builtin and then its argument prototype would still apply.  */
15060 char XtAppInitialize ();
15061 int
15062 main (void)
15063 {
15064 XtAppInitialize ();
15065   ;
15066   return 0;
15067 }
15068 _ACEOF
15069 rm -f conftest.$ac_objext conftest$ac_exeext
15070 if { (eval echo "$as_me:15070: \"$ac_link\"") >&5
15071   (eval $ac_link) 2>&5
15072   ac_status=$?
15073   echo "$as_me:15073: \$? = $ac_status" >&5
15074   (exit $ac_status); } &&
15075          { ac_try='test -s conftest$ac_exeext'
15076   { (eval echo "$as_me:15076: \"$ac_try\"") >&5
15077   (eval $ac_try) 2>&5
15078   ac_status=$?
15079   echo "$as_me:15079: \$? = $ac_status" >&5
15080   (exit $ac_status); }; }; then
15081   ac_cv_lib_Xt_XtAppInitialize=yes
15082 else
15083   echo "$as_me: failed program was:" >&5
15084 cat conftest.$ac_ext >&5
15085 ac_cv_lib_Xt_XtAppInitialize=no
15086 fi
15087 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15088 LIBS=$ac_check_lib_save_LIBS
15089 fi
15090 echo "$as_me:15090: result: $ac_cv_lib_Xt_XtAppInitialize" >&5
15091 echo "${ECHO_T}$ac_cv_lib_Xt_XtAppInitialize" >&6
15092 if test $ac_cv_lib_Xt_XtAppInitialize = yes; then
15093
15094 cat >>confdefs.h <<\EOF
15095 #define HAVE_LIBXT 1
15096 EOF
15097
15098                  cf_have_X_LIBS=Xt
15099                  LIBS="-lXt $LIBS"
15100 fi
15101
15102 fi
15103
15104 fi
15105
15106 if test $cf_have_X_LIBS = no ; then
15107         { echo "$as_me:15107: WARNING: Unable to successfully link X Toolkit library (-lXt) with
15108 test program.  You will have to check and add the proper libraries by hand
15109 to makefile." >&5
15110 echo "$as_me: WARNING: Unable to successfully link X Toolkit library (-lXt) with
15111 test program.  You will have to check and add the proper libraries by hand
15112 to makefile." >&2;}
15113 fi
15114
15115 cf_x_athena_root=$cf_x_athena
15116 cf_x_athena_inc=""
15117
15118 for cf_path in default \
15119         /usr/contrib/X11R6 \
15120         /usr/contrib/X11R5 \
15121         /usr/lib/X11R5 \
15122         /usr/local
15123 do
15124         if test -z "$cf_x_athena_inc" ; then
15125
15126 cf_save_LIBS_CF_X_ATHENA_CPPFLAGS="$LIBS"
15127 cf_save_CFLAGS_CF_X_ATHENA_CPPFLAGS="$CFLAGS"
15128 cf_save_CPPFLAGS_CF_X_ATHENA_CPPFLAGS="$CPPFLAGS"
15129 LIBS="$LIBS ${X_PRE_LIBS} ${X_LIBS} ${X_EXTRA_LIBS}"
15130 for cf_X_CFLAGS in $X_CFLAGS
15131 do
15132         case "x$cf_X_CFLAGS" in
15133         x-[IUD]*)
15134                 CPPFLAGS="$CPPFLAGS $cf_X_CFLAGS"
15135                 ;;
15136         *)
15137                 CFLAGS="$CFLAGS $cf_X_CFLAGS"
15138                 ;;
15139         esac
15140 done
15141
15142                 cf_test=X11/$cf_x_athena_root/SimpleMenu.h
15143                 if test $cf_path != default ; then
15144
15145         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
15146         CPPFLAGS="${CPPFLAGS}-I$cf_path/include"
15147
15148                         echo "$as_me:15148: checking for $cf_test in $cf_path" >&5
15149 echo $ECHO_N "checking for $cf_test in $cf_path... $ECHO_C" >&6
15150                 else
15151                         echo "$as_me:15151: checking for $cf_test" >&5
15152 echo $ECHO_N "checking for $cf_test... $ECHO_C" >&6
15153                 fi
15154                 cat >conftest.$ac_ext <<_ACEOF
15155 #line 15155 "configure"
15156 #include "confdefs.h"
15157
15158 #include <X11/Intrinsic.h>
15159 #include <$cf_test>
15160 int
15161 main (void)
15162 {
15163
15164   ;
15165   return 0;
15166 }
15167 _ACEOF
15168 rm -f conftest.$ac_objext
15169 if { (eval echo "$as_me:15169: \"$ac_compile\"") >&5
15170   (eval $ac_compile) 2>&5
15171   ac_status=$?
15172   echo "$as_me:15172: \$? = $ac_status" >&5
15173   (exit $ac_status); } &&
15174          { ac_try='test -s conftest.$ac_objext'
15175   { (eval echo "$as_me:15175: \"$ac_try\"") >&5
15176   (eval $ac_try) 2>&5
15177   ac_status=$?
15178   echo "$as_me:15178: \$? = $ac_status" >&5
15179   (exit $ac_status); }; }; then
15180   cf_result=yes
15181 else
15182   echo "$as_me: failed program was:" >&5
15183 cat conftest.$ac_ext >&5
15184 cf_result=no
15185 fi
15186 rm -f conftest.$ac_objext conftest.$ac_ext
15187                 echo "$as_me:15187: result: $cf_result" >&5
15188 echo "${ECHO_T}$cf_result" >&6
15189
15190 LIBS="$cf_save_LIBS_CF_X_ATHENA_CPPFLAGS"
15191 CFLAGS="$cf_save_CFLAGS_CF_X_ATHENA_CPPFLAGS"
15192 CPPFLAGS="$cf_save_CPPFLAGS_CF_X_ATHENA_CPPFLAGS"
15193
15194                 if test "$cf_result" = yes ; then
15195                         test "$cf_path"  = default && cf_x_athena_inc=default
15196                         test "$cf_path" != default && cf_x_athena_inc=$cf_path/include
15197                         break
15198                 fi
15199         fi
15200 done
15201
15202 if test -z "$cf_x_athena_inc" ; then
15203         { echo "$as_me:15203: WARNING: Unable to find Athena header files" >&5
15204 echo "$as_me: WARNING: Unable to find Athena header files" >&2;}
15205 elif test "$cf_x_athena_inc" != default ; then
15206
15207         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
15208         CPPFLAGS="${CPPFLAGS}-I$cf_x_athena_inc"
15209
15210 fi
15211
15212 cf_x_athena_root=$cf_x_athena
15213 cf_x_athena_lib=""
15214
15215 for cf_path in default \
15216         /usr/contrib/X11R6 \
15217         /usr/contrib/X11R5 \
15218         /usr/lib/X11R5 \
15219         /usr/local
15220 do
15221         for cf_lib in \
15222                 ${cf_x_athena_root} \
15223                 ${cf_x_athena_root}7 \
15224                 ${cf_x_athena_root}6
15225         do
15226         for cf_libs in \
15227                 "-l$cf_lib -lXmu" \
15228                 "-l$cf_lib -lXpm -lXmu" \
15229                 "-l${cf_lib}_s -lXmu_s"
15230         do
15231                 test -n "$cf_x_athena_lib" && break
15232
15233 cf_save_LIBS_CF_X_ATHENA_LIBS="$LIBS"
15234 cf_save_CFLAGS_CF_X_ATHENA_LIBS="$CFLAGS"
15235 cf_save_CPPFLAGS_CF_X_ATHENA_LIBS="$CPPFLAGS"
15236 LIBS="$LIBS ${X_PRE_LIBS} ${X_LIBS} ${X_EXTRA_LIBS}"
15237 for cf_X_CFLAGS in $X_CFLAGS
15238 do
15239         case "x$cf_X_CFLAGS" in
15240         x-[IUD]*)
15241                 CPPFLAGS="$CPPFLAGS $cf_X_CFLAGS"
15242                 ;;
15243         *)
15244                 CFLAGS="$CFLAGS $cf_X_CFLAGS"
15245                 ;;
15246         esac
15247 done
15248
15249                 cf_test=XawSimpleMenuAddGlobalActions
15250                 test "$cf_path" != default && cf_libs="-L$cf_path/lib $cf_libs"
15251
15252 cf_add_libs="$LIBS"
15253 # reverse order
15254 cf_add_0lib=
15255 for cf_add_1lib in $cf_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
15256 # filter duplicates
15257 for cf_add_1lib in $cf_add_0lib; do
15258         for cf_add_2lib in $cf_add_libs; do
15259                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
15260                         cf_add_1lib=
15261                         break
15262                 fi
15263         done
15264         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
15265 done
15266 LIBS="$cf_add_libs"
15267
15268                 echo "$as_me:15268: checking for $cf_test in $cf_libs" >&5
15269 echo $ECHO_N "checking for $cf_test in $cf_libs... $ECHO_C" >&6
15270                 cat >conftest.$ac_ext <<_ACEOF
15271 #line 15271 "configure"
15272 #include "confdefs.h"
15273
15274 #include <X11/Intrinsic.h>
15275 #include <X11/$cf_x_athena_root/SimpleMenu.h>
15276
15277 int
15278 main (void)
15279 {
15280
15281 $cf_test((XtAppContext) 0)
15282   ;
15283   return 0;
15284 }
15285 _ACEOF
15286 rm -f conftest.$ac_objext conftest$ac_exeext
15287 if { (eval echo "$as_me:15287: \"$ac_link\"") >&5
15288   (eval $ac_link) 2>&5
15289   ac_status=$?
15290   echo "$as_me:15290: \$? = $ac_status" >&5
15291   (exit $ac_status); } &&
15292          { ac_try='test -s conftest$ac_exeext'
15293   { (eval echo "$as_me:15293: \"$ac_try\"") >&5
15294   (eval $ac_try) 2>&5
15295   ac_status=$?
15296   echo "$as_me:15296: \$? = $ac_status" >&5
15297   (exit $ac_status); }; }; then
15298   cf_result=yes
15299 else
15300   echo "$as_me: failed program was:" >&5
15301 cat conftest.$ac_ext >&5
15302 cf_result=no
15303 fi
15304 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15305                 echo "$as_me:15305: result: $cf_result" >&5
15306 echo "${ECHO_T}$cf_result" >&6
15307
15308 LIBS="$cf_save_LIBS_CF_X_ATHENA_LIBS"
15309 CFLAGS="$cf_save_CFLAGS_CF_X_ATHENA_LIBS"
15310 CPPFLAGS="$cf_save_CPPFLAGS_CF_X_ATHENA_LIBS"
15311
15312                 if test "$cf_result" = yes ; then
15313                         cf_x_athena_lib="$cf_libs"
15314                         break
15315                 fi
15316         done # cf_libs
15317                 test -n "$cf_x_athena_lib" && break
15318         done # cf_lib
15319 done
15320
15321 if test -z "$cf_x_athena_lib" ; then
15322         { { echo "$as_me:15322: error: Unable to successfully link Athena library (-l$cf_x_athena_root) with test program" >&5
15323 echo "$as_me: error: Unable to successfully link Athena library (-l$cf_x_athena_root) with test program" >&2;}
15324    { (exit 1); exit 1; }; }
15325 fi
15326
15327 cf_add_libs="$LIBS"
15328 # reverse order
15329 cf_add_0lib=
15330 for cf_add_1lib in $cf_x_athena_lib; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
15331 # filter duplicates
15332 for cf_add_1lib in $cf_add_0lib; do
15333         for cf_add_2lib in $cf_add_libs; do
15334                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
15335                         cf_add_1lib=
15336                         break
15337                 fi
15338         done
15339         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
15340 done
15341 LIBS="$cf_add_libs"
15342
15343 cf_x_athena_LIBS=`echo "HAVE_LIB_$cf_x_athena" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
15344
15345 cat >>confdefs.h <<EOF
15346 #define $cf_x_athena_LIBS 1
15347 EOF
15348
15349 fi
15350
15351 if test -n "$ac_tool_prefix"; then
15352   for ac_prog in xcurses-config
15353   do
15354     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
15355 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
15356 echo "$as_me:15356: checking for $ac_word" >&5
15357 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
15358 if test "${ac_cv_prog_XCURSES_CONFIG+set}" = set; then
15359   echo $ECHO_N "(cached) $ECHO_C" >&6
15360 else
15361   if test -n "$XCURSES_CONFIG"; then
15362   ac_cv_prog_XCURSES_CONFIG="$XCURSES_CONFIG" # Let the user override the test.
15363 else
15364   ac_save_IFS=$IFS; IFS=$ac_path_separator
15365 ac_dummy="$PATH"
15366 for ac_dir in $ac_dummy; do
15367   IFS=$ac_save_IFS
15368   test -z "$ac_dir" && ac_dir=.
15369   $as_executable_p "$ac_dir/$ac_word" || continue
15370 ac_cv_prog_XCURSES_CONFIG="$ac_tool_prefix$ac_prog"
15371 echo "$as_me:15371: found $ac_dir/$ac_word" >&5
15372 break
15373 done
15374
15375 fi
15376 fi
15377 XCURSES_CONFIG=$ac_cv_prog_XCURSES_CONFIG
15378 if test -n "$XCURSES_CONFIG"; then
15379   echo "$as_me:15379: result: $XCURSES_CONFIG" >&5
15380 echo "${ECHO_T}$XCURSES_CONFIG" >&6
15381 else
15382   echo "$as_me:15382: result: no" >&5
15383 echo "${ECHO_T}no" >&6
15384 fi
15385
15386     test -n "$XCURSES_CONFIG" && break
15387   done
15388 fi
15389 if test -z "$XCURSES_CONFIG"; then
15390   ac_ct_XCURSES_CONFIG=$XCURSES_CONFIG
15391   for ac_prog in xcurses-config
15392 do
15393   # Extract the first word of "$ac_prog", so it can be a program name with args.
15394 set dummy $ac_prog; ac_word=$2
15395 echo "$as_me:15395: checking for $ac_word" >&5
15396 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
15397 if test "${ac_cv_prog_ac_ct_XCURSES_CONFIG+set}" = set; then
15398   echo $ECHO_N "(cached) $ECHO_C" >&6
15399 else
15400   if test -n "$ac_ct_XCURSES_CONFIG"; then
15401   ac_cv_prog_ac_ct_XCURSES_CONFIG="$ac_ct_XCURSES_CONFIG" # Let the user override the test.
15402 else
15403   ac_save_IFS=$IFS; IFS=$ac_path_separator
15404 ac_dummy="$PATH"
15405 for ac_dir in $ac_dummy; do
15406   IFS=$ac_save_IFS
15407   test -z "$ac_dir" && ac_dir=.
15408   $as_executable_p "$ac_dir/$ac_word" || continue
15409 ac_cv_prog_ac_ct_XCURSES_CONFIG="$ac_prog"
15410 echo "$as_me:15410: found $ac_dir/$ac_word" >&5
15411 break
15412 done
15413
15414 fi
15415 fi
15416 ac_ct_XCURSES_CONFIG=$ac_cv_prog_ac_ct_XCURSES_CONFIG
15417 if test -n "$ac_ct_XCURSES_CONFIG"; then
15418   echo "$as_me:15418: result: $ac_ct_XCURSES_CONFIG" >&5
15419 echo "${ECHO_T}$ac_ct_XCURSES_CONFIG" >&6
15420 else
15421   echo "$as_me:15421: result: no" >&5
15422 echo "${ECHO_T}no" >&6
15423 fi
15424
15425   test -n "$ac_ct_XCURSES_CONFIG" && break
15426 done
15427 test -n "$ac_ct_XCURSES_CONFIG" || ac_ct_XCURSES_CONFIG="none"
15428
15429   XCURSES_CONFIG=$ac_ct_XCURSES_CONFIG
15430 fi
15431
15432 if test "$XCURSES_CONFIG" != none ; then
15433
15434 cf_fix_cppflags=no
15435 cf_new_cflags=
15436 cf_new_cppflags=
15437 cf_new_extra_cppflags=
15438
15439 for cf_add_cflags in `$XCURSES_CONFIG --cflags`
15440 do
15441 case $cf_fix_cppflags in
15442 (no)
15443         case $cf_add_cflags in
15444         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
15445                 case $cf_add_cflags in
15446                 (-D*)
15447                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
15448
15449                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
15450                                 && test -z "${cf_tst_cflags}" \
15451                                 && cf_fix_cppflags=yes
15452
15453                         if test $cf_fix_cppflags = yes ; then
15454
15455         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15456         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15457
15458                                 continue
15459                         elif test "${cf_tst_cflags}" = "\"'" ; then
15460
15461         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15462         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15463
15464                                 continue
15465                         fi
15466                         ;;
15467                 esac
15468                 case "$CPPFLAGS" in
15469                 (*$cf_add_cflags)
15470                         ;;
15471                 (*)
15472                         case $cf_add_cflags in
15473                         (-D*)
15474                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
15475
15476 CPPFLAGS=`echo "$CPPFLAGS" | \
15477         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
15478                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
15479
15480                                 ;;
15481                         esac
15482
15483         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
15484         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
15485
15486                         ;;
15487                 esac
15488                 ;;
15489         (*)
15490
15491         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
15492         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
15493
15494                 ;;
15495         esac
15496         ;;
15497 (yes)
15498
15499         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15500         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15501
15502         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
15503
15504         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
15505                 && test -z "${cf_tst_cflags}" \
15506                 && cf_fix_cppflags=no
15507         ;;
15508 esac
15509 done
15510
15511 if test -n "$cf_new_cflags" ; then
15512
15513         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
15514         CFLAGS="${CFLAGS}$cf_new_cflags"
15515
15516 fi
15517
15518 if test -n "$cf_new_cppflags" ; then
15519
15520         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
15521         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
15522
15523 fi
15524
15525 if test -n "$cf_new_extra_cppflags" ; then
15526
15527         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
15528         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
15529
15530 fi
15531
15532 cf_add_libs="$LIBS"
15533 # reverse order
15534 cf_add_0lib=
15535 for cf_add_1lib in `$XCURSES_CONFIG --libs`; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
15536 # filter duplicates
15537 for cf_add_1lib in $cf_add_0lib; do
15538         for cf_add_2lib in $cf_add_libs; do
15539                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
15540                         cf_add_1lib=
15541                         break
15542                 fi
15543         done
15544         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
15545 done
15546 LIBS="$cf_add_libs"
15547
15548 cf_cv_lib_XCurses=yes
15549
15550 else
15551
15552 LDFLAGS="$LDFLAGS $X_LIBS"
15553
15554 test -n "$verbose" && echo "    checking additions to CFLAGS" 1>&6
15555
15556 echo "${as_me:-configure}:15556: testing checking additions to CFLAGS ..." 1>&5
15557
15558 cf_check_cflags="$CFLAGS"
15559 cf_check_cppflags="$CPPFLAGS"
15560
15561 cf_fix_cppflags=no
15562 cf_new_cflags=
15563 cf_new_cppflags=
15564 cf_new_extra_cppflags=
15565
15566 for cf_add_cflags in $X_CFLAGS
15567 do
15568 case $cf_fix_cppflags in
15569 (no)
15570         case $cf_add_cflags in
15571         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
15572                 case $cf_add_cflags in
15573                 (-D*)
15574                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
15575
15576                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
15577                                 && test -z "${cf_tst_cflags}" \
15578                                 && cf_fix_cppflags=yes
15579
15580                         if test $cf_fix_cppflags = yes ; then
15581
15582         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15583         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15584
15585                                 continue
15586                         elif test "${cf_tst_cflags}" = "\"'" ; then
15587
15588         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15589         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15590
15591                                 continue
15592                         fi
15593                         ;;
15594                 esac
15595                 case "$CPPFLAGS" in
15596                 (*$cf_add_cflags)
15597                         ;;
15598                 (*)
15599                         case $cf_add_cflags in
15600                         (-D*)
15601                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
15602
15603 CPPFLAGS=`echo "$CPPFLAGS" | \
15604         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
15605                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
15606
15607                                 ;;
15608                         esac
15609
15610         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
15611         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
15612
15613                         ;;
15614                 esac
15615                 ;;
15616         (*)
15617
15618         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
15619         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
15620
15621                 ;;
15622         esac
15623         ;;
15624 (yes)
15625
15626         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15627         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15628
15629         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
15630
15631         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
15632                 && test -z "${cf_tst_cflags}" \
15633                 && cf_fix_cppflags=no
15634         ;;
15635 esac
15636 done
15637
15638 if test -n "$cf_new_cflags" ; then
15639         test -n "$verbose" && echo "    add to \$CFLAGS $cf_new_cflags" 1>&6
15640
15641 echo "${as_me:-configure}:15641: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
15642
15643         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
15644         CFLAGS="${CFLAGS}$cf_new_cflags"
15645
15646 fi
15647
15648 if test -n "$cf_new_cppflags" ; then
15649         test -n "$verbose" && echo "    add to \$CPPFLAGS $cf_new_cppflags" 1>&6
15650
15651 echo "${as_me:-configure}:15651: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
15652
15653         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
15654         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
15655
15656 fi
15657
15658 if test -n "$cf_new_extra_cppflags" ; then
15659         test -n "$verbose" && echo "    add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6
15660
15661 echo "${as_me:-configure}:15661: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
15662
15663         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
15664         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
15665
15666 fi
15667
15668 if test "x$cf_check_cflags" != "x$CFLAGS" ; then
15669 cat >conftest.$ac_ext <<_ACEOF
15670 #line 15670 "configure"
15671 #include "confdefs.h"
15672 #include <stdio.h>
15673 int
15674 main (void)
15675 {
15676 printf("Hello world");
15677   ;
15678   return 0;
15679 }
15680 _ACEOF
15681 rm -f conftest.$ac_objext conftest$ac_exeext
15682 if { (eval echo "$as_me:15682: \"$ac_link\"") >&5
15683   (eval $ac_link) 2>&5
15684   ac_status=$?
15685   echo "$as_me:15685: \$? = $ac_status" >&5
15686   (exit $ac_status); } &&
15687          { ac_try='test -s conftest$ac_exeext'
15688   { (eval echo "$as_me:15688: \"$ac_try\"") >&5
15689   (eval $ac_try) 2>&5
15690   ac_status=$?
15691   echo "$as_me:15691: \$? = $ac_status" >&5
15692   (exit $ac_status); }; }; then
15693   :
15694 else
15695   echo "$as_me: failed program was:" >&5
15696 cat conftest.$ac_ext >&5
15697 test -n "$verbose" && echo "    test-compile failed.  Undoing change to \$CFLAGS" 1>&6
15698
15699 echo "${as_me:-configure}:15699: testing test-compile failed.  Undoing change to \$CFLAGS ..." 1>&5
15700
15701          if test "x$cf_check_cppflags" != "x$CPPFLAGS" ; then
15702                  test -n "$verbose" && echo "   but keeping change to \$CPPFLAGS" 1>&6
15703
15704 echo "${as_me:-configure}:15704: testing but keeping change to \$CPPFLAGS ..." 1>&5
15705
15706          fi
15707          CFLAGS="$cf_check_flags"
15708 fi
15709 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15710 fi
15711
15712 echo "$as_me:15712: checking for XOpenDisplay in -lX11" >&5
15713 echo $ECHO_N "checking for XOpenDisplay in -lX11... $ECHO_C" >&6
15714 if test "${ac_cv_lib_X11_XOpenDisplay+set}" = set; then
15715   echo $ECHO_N "(cached) $ECHO_C" >&6
15716 else
15717   ac_check_lib_save_LIBS=$LIBS
15718 LIBS="-lX11 $X_PRE_LIBS $LIBS $X_EXTRA_LIBS $LIBS"
15719 cat >conftest.$ac_ext <<_ACEOF
15720 #line 15720 "configure"
15721 #include "confdefs.h"
15722
15723 /* Override any gcc2 internal prototype to avoid an error.  */
15724 #ifdef __cplusplus
15725 extern "C"
15726 #endif
15727 /* We use char because int might match the return type of a gcc2
15728    builtin and then its argument prototype would still apply.  */
15729 char XOpenDisplay ();
15730 int
15731 main (void)
15732 {
15733 XOpenDisplay ();
15734   ;
15735   return 0;
15736 }
15737 _ACEOF
15738 rm -f conftest.$ac_objext conftest$ac_exeext
15739 if { (eval echo "$as_me:15739: \"$ac_link\"") >&5
15740   (eval $ac_link) 2>&5
15741   ac_status=$?
15742   echo "$as_me:15742: \$? = $ac_status" >&5
15743   (exit $ac_status); } &&
15744          { ac_try='test -s conftest$ac_exeext'
15745   { (eval echo "$as_me:15745: \"$ac_try\"") >&5
15746   (eval $ac_try) 2>&5
15747   ac_status=$?
15748   echo "$as_me:15748: \$? = $ac_status" >&5
15749   (exit $ac_status); }; }; then
15750   ac_cv_lib_X11_XOpenDisplay=yes
15751 else
15752   echo "$as_me: failed program was:" >&5
15753 cat conftest.$ac_ext >&5
15754 ac_cv_lib_X11_XOpenDisplay=no
15755 fi
15756 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15757 LIBS=$ac_check_lib_save_LIBS
15758 fi
15759 echo "$as_me:15759: result: $ac_cv_lib_X11_XOpenDisplay" >&5
15760 echo "${ECHO_T}$ac_cv_lib_X11_XOpenDisplay" >&6
15761 if test $ac_cv_lib_X11_XOpenDisplay = yes; then
15762
15763 cf_add_libs="$LIBS"
15764 # reverse order
15765 cf_add_0lib=
15766 for cf_add_1lib in -lX11; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
15767 # filter duplicates
15768 for cf_add_1lib in $cf_add_0lib; do
15769         for cf_add_2lib in $cf_add_libs; do
15770                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
15771                         cf_add_1lib=
15772                         break
15773                 fi
15774         done
15775         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
15776 done
15777 LIBS="$cf_add_libs"
15778
15779 fi
15780
15781 echo "$as_me:15781: checking for XCurses library" >&5
15782 echo $ECHO_N "checking for XCurses library... $ECHO_C" >&6
15783 if test "${cf_cv_lib_XCurses+set}" = set; then
15784   echo $ECHO_N "(cached) $ECHO_C" >&6
15785 else
15786
15787 cf_add_libs="$LIBS"
15788 # reverse order
15789 cf_add_0lib=
15790 for cf_add_1lib in -lXCurses; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
15791 # filter duplicates
15792 for cf_add_1lib in $cf_add_0lib; do
15793         for cf_add_2lib in $cf_add_libs; do
15794                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
15795                         cf_add_1lib=
15796                         break
15797                 fi
15798         done
15799         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
15800 done
15801 LIBS="$cf_add_libs"
15802
15803 cat >conftest.$ac_ext <<_ACEOF
15804 #line 15804 "configure"
15805 #include "confdefs.h"
15806
15807 #include <xcurses.h>
15808 char *XCursesProgramName = "test";
15809
15810 int
15811 main (void)
15812 {
15813 XCursesExit();
15814   ;
15815   return 0;
15816 }
15817 _ACEOF
15818 rm -f conftest.$ac_objext conftest$ac_exeext
15819 if { (eval echo "$as_me:15819: \"$ac_link\"") >&5
15820   (eval $ac_link) 2>&5
15821   ac_status=$?
15822   echo "$as_me:15822: \$? = $ac_status" >&5
15823   (exit $ac_status); } &&
15824          { ac_try='test -s conftest$ac_exeext'
15825   { (eval echo "$as_me:15825: \"$ac_try\"") >&5
15826   (eval $ac_try) 2>&5
15827   ac_status=$?
15828   echo "$as_me:15828: \$? = $ac_status" >&5
15829   (exit $ac_status); }; }; then
15830   cf_cv_lib_XCurses=yes
15831 else
15832   echo "$as_me: failed program was:" >&5
15833 cat conftest.$ac_ext >&5
15834 cf_cv_lib_XCurses=no
15835 fi
15836 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15837
15838 fi
15839 echo "$as_me:15839: result: $cf_cv_lib_XCurses" >&5
15840 echo "${ECHO_T}$cf_cv_lib_XCurses" >&6
15841
15842 fi
15843
15844 if test $cf_cv_lib_XCurses = yes ; then
15845
15846 cat >>confdefs.h <<\EOF
15847 #define UNIX 1
15848 EOF
15849
15850 cat >>confdefs.h <<\EOF
15851 #define XCURSES 1
15852 EOF
15853
15854         echo "$as_me:15854: checking for xcurses.h" >&5
15855 echo $ECHO_N "checking for xcurses.h... $ECHO_C" >&6
15856 if test "${ac_cv_header_xcurses_h+set}" = set; then
15857   echo $ECHO_N "(cached) $ECHO_C" >&6
15858 else
15859   cat >conftest.$ac_ext <<_ACEOF
15860 #line 15860 "configure"
15861 #include "confdefs.h"
15862 #include <xcurses.h>
15863 _ACEOF
15864 if { (eval echo "$as_me:15864: \"$ac_cpp conftest.$ac_ext\"") >&5
15865   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
15866   ac_status=$?
15867   egrep -v '^ *\+' conftest.er1 >conftest.err
15868   rm -f conftest.er1
15869   cat conftest.err >&5
15870   echo "$as_me:15870: \$? = $ac_status" >&5
15871   (exit $ac_status); } >/dev/null; then
15872   if test -s conftest.err; then
15873     ac_cpp_err=$ac_c_preproc_warn_flag
15874   else
15875     ac_cpp_err=
15876   fi
15877 else
15878   ac_cpp_err=yes
15879 fi
15880 if test -z "$ac_cpp_err"; then
15881   ac_cv_header_xcurses_h=yes
15882 else
15883   echo "$as_me: failed program was:" >&5
15884   cat conftest.$ac_ext >&5
15885   ac_cv_header_xcurses_h=no
15886 fi
15887 rm -f conftest.err conftest.$ac_ext
15888 fi
15889 echo "$as_me:15889: result: $ac_cv_header_xcurses_h" >&5
15890 echo "${ECHO_T}$ac_cv_header_xcurses_h" >&6
15891 if test $ac_cv_header_xcurses_h = yes; then
15892
15893 cat >>confdefs.h <<\EOF
15894 #define HAVE_XCURSES 1
15895 EOF
15896
15897 fi
15898
15899 else
15900         { { echo "$as_me:15900: error: Cannot link with XCurses" >&5
15901 echo "$as_me: error: Cannot link with XCurses" >&2;}
15902    { (exit 1); exit 1; }; }
15903 fi
15904
15905         ;;
15906 (*)
15907         { { echo "$as_me:15907: error: unexpected screen-value: $cf_cv_screen" >&5
15908 echo "$as_me: error: unexpected screen-value: $cf_cv_screen" >&2;}
15909    { (exit 1); exit 1; }; }
15910         ;;
15911 esac
15912
15913 : ${cf_nculib_root:=$cf_cv_screen}
15914 as_ac_Lib=`echo "ac_cv_lib_$cf_nculib_root''__nc_init_pthreads" | $as_tr_sh`
15915 echo "$as_me:15915: checking for _nc_init_pthreads in -l$cf_nculib_root" >&5
15916 echo $ECHO_N "checking for _nc_init_pthreads in -l$cf_nculib_root... $ECHO_C" >&6
15917 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
15918   echo $ECHO_N "(cached) $ECHO_C" >&6
15919 else
15920   ac_check_lib_save_LIBS=$LIBS
15921 LIBS="-l$cf_nculib_root  $LIBS"
15922 cat >conftest.$ac_ext <<_ACEOF
15923 #line 15923 "configure"
15924 #include "confdefs.h"
15925
15926 /* Override any gcc2 internal prototype to avoid an error.  */
15927 #ifdef __cplusplus
15928 extern "C"
15929 #endif
15930 /* We use char because int might match the return type of a gcc2
15931    builtin and then its argument prototype would still apply.  */
15932 char _nc_init_pthreads ();
15933 int
15934 main (void)
15935 {
15936 _nc_init_pthreads ();
15937   ;
15938   return 0;
15939 }
15940 _ACEOF
15941 rm -f conftest.$ac_objext conftest$ac_exeext
15942 if { (eval echo "$as_me:15942: \"$ac_link\"") >&5
15943   (eval $ac_link) 2>&5
15944   ac_status=$?
15945   echo "$as_me:15945: \$? = $ac_status" >&5
15946   (exit $ac_status); } &&
15947          { ac_try='test -s conftest$ac_exeext'
15948   { (eval echo "$as_me:15948: \"$ac_try\"") >&5
15949   (eval $ac_try) 2>&5
15950   ac_status=$?
15951   echo "$as_me:15951: \$? = $ac_status" >&5
15952   (exit $ac_status); }; }; then
15953   eval "$as_ac_Lib=yes"
15954 else
15955   echo "$as_me: failed program was:" >&5
15956 cat conftest.$ac_ext >&5
15957 eval "$as_ac_Lib=no"
15958 fi
15959 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15960 LIBS=$ac_check_lib_save_LIBS
15961 fi
15962 echo "$as_me:15962: result: `eval echo '${'$as_ac_Lib'}'`" >&5
15963 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
15964 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
15965   cf_cv_ncurses_pthreads=yes
15966 else
15967   cf_cv_ncurses_pthreads=no
15968 fi
15969
15970 if test "$cf_cv_ncurses_pthreads" = yes
15971 then
15972
15973 cf_add_libs="$LIBS"
15974 # reverse order
15975 cf_add_0lib=
15976 for cf_add_1lib in -lpthread; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
15977 # filter duplicates
15978 for cf_add_1lib in $cf_add_0lib; do
15979         for cf_add_2lib in $cf_add_libs; do
15980                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
15981                         cf_add_1lib=
15982                         break
15983                 fi
15984         done
15985         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
15986 done
15987 LIBS="$cf_add_libs"
15988
15989 fi
15990
15991 case $cf_cv_screen in
15992 (ncurses*)
15993         cf_cv_libtype=`echo "$cf_cv_screen" | sed -e 's/^ncurses//'`
15994         ;;
15995 esac
15996
15997 echo "$as_me:15997: checking for X11 rgb file" >&5
15998 echo $ECHO_N "checking for X11 rgb file... $ECHO_C" >&6
15999
16000 # Check whether --with-x11-rgb or --without-x11-rgb was given.
16001 if test "${with_x11_rgb+set}" = set; then
16002   withval="$with_x11_rgb"
16003   RGB_PATH=$withval
16004 else
16005   RGB_PATH=auto
16006 fi;
16007
16008 if test "x$RGB_PATH" = xauto
16009 then
16010         RGB_PATH='${exec_prefix}/lib/X11/rgb.txt'
16011         for cf_path in \
16012                 /opt/local/share/X11/rgb.txt \
16013                 /opt/X11/share/X11/rgb.txt \
16014                 /usr/share/X11/rgb.txt \
16015                 /usr/X11/share/X11/rgb.txt \
16016                 /usr/X11/lib/X11/rgb.txt \
16017                 /usr/lib/X11/rgb.txt \
16018                 /etc/X11/rgb.txt \
16019                 /usr/pkg/lib/X11/rgb.txt \
16020                 /usr/X11R7/lib/X11/rgb.txt \
16021                 /usr/X11R6/lib/X11/rgb.txt \
16022                 /usr/X11R5/lib/X11/rgb.txt \
16023                 /usr/X11R4/lib/X11/rgb.txt \
16024                 /usr/local/lib/X11/rgb.txt \
16025                 /usr/local/share/X11/rgb.txt \
16026                 /usr/lib64/X11/rgb.txt
16027         do
16028                 if test -f "$cf_path" ; then
16029                         RGB_PATH="$cf_path"
16030                         break
16031                 fi
16032         done
16033 else
16034         cf_path=$RGB_PATH
16035
16036 if test "x$prefix" != xNONE; then
16037         cf_path_syntax="$prefix"
16038 else
16039         cf_path_syntax="$ac_default_prefix"
16040 fi
16041
16042 case ".$cf_path" in
16043 (.\$\(*\)*|.\'*\'*)
16044         ;;
16045 (..|./*|.\\*)
16046         ;;
16047 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
16048         ;;
16049 (.\${*prefix}*|.\${*dir}*)
16050         eval cf_path="$cf_path"
16051         case ".$cf_path" in
16052         (.NONE/*)
16053                 cf_path=`echo $cf_path | sed -e s%NONE%$cf_path_syntax%`
16054                 ;;
16055         esac
16056         ;;
16057 (.no|.NONE/*)
16058         cf_path=`echo $cf_path | sed -e s%NONE%$cf_path_syntax%`
16059         ;;
16060 (*)
16061         { { echo "$as_me:16061: error: expected a pathname, not \"$cf_path\"" >&5
16062 echo "$as_me: error: expected a pathname, not \"$cf_path\"" >&2;}
16063    { (exit 1); exit 1; }; }
16064         ;;
16065 esac
16066
16067 fi
16068
16069 echo "$as_me:16069: result: $RGB_PATH" >&5
16070 echo "${ECHO_T}$RGB_PATH" >&6
16071
16072 cat >>confdefs.h <<EOF
16073 #define RGB_PATH "$cf_path"
16074 EOF
16075
16076 no_x11_rgb=
16077 if test "$RGB_PATH" = no
16078 then
16079         no_x11_rgb="#"
16080 fi
16081
16082 cf_curses_headers=
16083
16084 case $cf_cv_screen in
16085 (pdcurses)
16086         cf_default_panel=no
16087         cf_default_form=no
16088         cf_default_menu=no
16089         cf_default_tinfo=no
16090         ;;
16091 (xcurses|bsdcurses)
16092         cf_default_panel=no
16093         cf_default_form=no
16094         cf_default_menu=no
16095         cf_default_tinfo=yes
16096         ;;
16097 (*)
16098         cf_default_panel=yes
16099         cf_default_form=yes
16100         cf_default_menu=yes
16101         cf_default_tinfo=yes
16102         case $cf_cv_screen in
16103         (ncurses*)
16104                 cf_curses_headers="nc_alloc.h nomacros.h term_entry.h"
16105                 ;;
16106         esac
16107         ;;
16108 esac
16109
16110 echo "$as_me:16110: checking for desired basename for form library" >&5
16111 echo $ECHO_N "checking for desired basename for form library... $ECHO_C" >&6
16112
16113 # Check whether --with-form-libname or --without-form-libname was given.
16114 if test "${with_form_libname+set}" = set; then
16115   withval="$with_form_libname"
16116   with_lib_basename=$withval
16117 else
16118   with_lib_basename=form
16119 fi;
16120 FORM_NAME="$with_lib_basename"
16121
16122 case "x$FORM_NAME" in
16123 (x|xno|xnone|xyes)
16124         FORM_NAME=form
16125         ;;
16126 (*)
16127         ;;
16128 esac
16129
16130 echo "$as_me:16130: result: $FORM_NAME" >&5
16131 echo "${ECHO_T}$FORM_NAME" >&6
16132
16133 echo "$as_me:16133: checking for desired basename for menu library" >&5
16134 echo $ECHO_N "checking for desired basename for menu library... $ECHO_C" >&6
16135
16136 # Check whether --with-menu-libname or --without-menu-libname was given.
16137 if test "${with_menu_libname+set}" = set; then
16138   withval="$with_menu_libname"
16139   with_lib_basename=$withval
16140 else
16141   with_lib_basename=menu
16142 fi;
16143 MENU_NAME="$with_lib_basename"
16144
16145 case "x$MENU_NAME" in
16146 (x|xno|xnone|xyes)
16147         MENU_NAME=menu
16148         ;;
16149 (*)
16150         ;;
16151 esac
16152
16153 echo "$as_me:16153: result: $MENU_NAME" >&5
16154 echo "${ECHO_T}$MENU_NAME" >&6
16155
16156 echo "$as_me:16156: checking for desired basename for panel library" >&5
16157 echo $ECHO_N "checking for desired basename for panel library... $ECHO_C" >&6
16158
16159 # Check whether --with-panel-libname or --without-panel-libname was given.
16160 if test "${with_panel_libname+set}" = set; then
16161   withval="$with_panel_libname"
16162   with_lib_basename=$withval
16163 else
16164   with_lib_basename=panel
16165 fi;
16166 PANEL_NAME="$with_lib_basename"
16167
16168 case "x$PANEL_NAME" in
16169 (x|xno|xnone|xyes)
16170         PANEL_NAME=panel
16171         ;;
16172 (*)
16173         ;;
16174 esac
16175
16176 echo "$as_me:16176: result: $PANEL_NAME" >&5
16177 echo "${ECHO_T}$PANEL_NAME" >&6
16178
16179 echo "$as_me:16179: checking if you want to check for panel functions" >&5
16180 echo $ECHO_N "checking if you want to check for panel functions... $ECHO_C" >&6
16181
16182 # Check whether --enable-panel or --disable-panel was given.
16183 if test "${enable_panel+set}" = set; then
16184   enableval="$enable_panel"
16185   test "$enableval" != no && enableval=yes
16186         if test "$enableval" != "yes" ; then
16187     cf_enable_panel=no
16188         else
16189                 cf_enable_panel=$cf_default_panel
16190         fi
16191 else
16192   enableval=yes
16193         cf_enable_panel=$cf_default_panel
16194
16195 fi;
16196 echo "$as_me:16196: result: $cf_enable_panel" >&5
16197 echo "${ECHO_T}$cf_enable_panel" >&6
16198 if test $cf_enable_panel = yes
16199 then
16200
16201 cf_have_curses_lib=no
16202
16203 : ${NCURSES_CONFIG_PKG:=none}
16204 if test "x${NCURSES_CONFIG_PKG}" = xnone; then
16205         :
16206 elif test "x${PKG_CONFIG:=none}" != xnone; then
16207         echo "$as_me:16207: checking pkg-config for $PANEL_NAME$cf_cv_libtype" >&5
16208 echo $ECHO_N "checking pkg-config for $PANEL_NAME$cf_cv_libtype... $ECHO_C" >&6
16209         if "$PKG_CONFIG" --exists $PANEL_NAME$cf_cv_libtype ; then
16210                 echo "$as_me:16210: result: yes" >&5
16211 echo "${ECHO_T}yes" >&6
16212
16213                 echo "$as_me:16213: checking if the $PANEL_NAME$cf_cv_libtype package files work" >&5
16214 echo $ECHO_N "checking if the $PANEL_NAME$cf_cv_libtype package files work... $ECHO_C" >&6
16215
16216                 cf_save_CPPFLAGS="$CPPFLAGS"
16217                 cf_save_LIBS="$LIBS"
16218
16219 cf_fix_cppflags=no
16220 cf_new_cflags=
16221 cf_new_cppflags=
16222 cf_new_extra_cppflags=
16223
16224 for cf_add_cflags in `$PKG_CONFIG --cflags $PANEL_NAME$cf_cv_libtype`
16225 do
16226 case $cf_fix_cppflags in
16227 (no)
16228         case $cf_add_cflags in
16229         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
16230                 case $cf_add_cflags in
16231                 (-D*)
16232                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
16233
16234                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
16235                                 && test -z "${cf_tst_cflags}" \
16236                                 && cf_fix_cppflags=yes
16237
16238                         if test $cf_fix_cppflags = yes ; then
16239
16240         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
16241         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
16242
16243                                 continue
16244                         elif test "${cf_tst_cflags}" = "\"'" ; then
16245
16246         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
16247         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
16248
16249                                 continue
16250                         fi
16251                         ;;
16252                 esac
16253                 case "$CPPFLAGS" in
16254                 (*$cf_add_cflags)
16255                         ;;
16256                 (*)
16257                         case $cf_add_cflags in
16258                         (-D*)
16259                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
16260
16261 CPPFLAGS=`echo "$CPPFLAGS" | \
16262         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
16263                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
16264
16265                                 ;;
16266                         esac
16267
16268         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
16269         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
16270
16271                         ;;
16272                 esac
16273                 ;;
16274         (*)
16275
16276         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
16277         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
16278
16279                 ;;
16280         esac
16281         ;;
16282 (yes)
16283
16284         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
16285         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
16286
16287         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
16288
16289         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
16290                 && test -z "${cf_tst_cflags}" \
16291                 && cf_fix_cppflags=no
16292         ;;
16293 esac
16294 done
16295
16296 if test -n "$cf_new_cflags" ; then
16297
16298         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
16299         CFLAGS="${CFLAGS}$cf_new_cflags"
16300
16301 fi
16302
16303 if test -n "$cf_new_cppflags" ; then
16304
16305         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
16306         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
16307
16308 fi
16309
16310 if test -n "$cf_new_extra_cppflags" ; then
16311
16312         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
16313         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
16314
16315 fi
16316
16317 cf_add_libs="$LIBS"
16318 # reverse order
16319 cf_add_0lib=
16320 for cf_add_1lib in `$PKG_CONFIG --libs $PANEL_NAME$cf_cv_libtype`; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
16321 # filter duplicates
16322 for cf_add_1lib in $cf_add_0lib; do
16323         for cf_add_2lib in $cf_add_libs; do
16324                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
16325                         cf_add_1lib=
16326                         break
16327                 fi
16328         done
16329         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
16330 done
16331 LIBS="$cf_add_libs"
16332
16333                 cat >conftest.$ac_ext <<_ACEOF
16334 #line 16334 "configure"
16335 #include "confdefs.h"
16336 #include <$PANEL_NAME.h>
16337 int
16338 main (void)
16339 {
16340 (void) new_panel ( 0 );
16341   ;
16342   return 0;
16343 }
16344 _ACEOF
16345 rm -f conftest.$ac_objext conftest$ac_exeext
16346 if { (eval echo "$as_me:16346: \"$ac_link\"") >&5
16347   (eval $ac_link) 2>&5
16348   ac_status=$?
16349   echo "$as_me:16349: \$? = $ac_status" >&5
16350   (exit $ac_status); } &&
16351          { ac_try='test -s conftest$ac_exeext'
16352   { (eval echo "$as_me:16352: \"$ac_try\"") >&5
16353   (eval $ac_try) 2>&5
16354   ac_status=$?
16355   echo "$as_me:16355: \$? = $ac_status" >&5
16356   (exit $ac_status); }; }; then
16357   if test "$cross_compiling" = yes; then
16358   cf_have_curses_lib=maybe
16359 else
16360   cat >conftest.$ac_ext <<_ACEOF
16361 #line 16361 "configure"
16362 #include "confdefs.h"
16363 #include <$PANEL_NAME.h>
16364                                 int main(void)
16365                                 { (void) new_panel ( 0 ); return 0; }
16366 _ACEOF
16367 rm -f conftest$ac_exeext
16368 if { (eval echo "$as_me:16368: \"$ac_link\"") >&5
16369   (eval $ac_link) 2>&5
16370   ac_status=$?
16371   echo "$as_me:16371: \$? = $ac_status" >&5
16372   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
16373   { (eval echo "$as_me:16373: \"$ac_try\"") >&5
16374   (eval $ac_try) 2>&5
16375   ac_status=$?
16376   echo "$as_me:16376: \$? = $ac_status" >&5
16377   (exit $ac_status); }; }; then
16378   cf_have_curses_lib=yes
16379 else
16380   echo "$as_me: program exited with status $ac_status" >&5
16381 echo "$as_me: failed program was:" >&5
16382 cat conftest.$ac_ext >&5
16383 cf_have_curses_lib=no
16384 fi
16385 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
16386 fi
16387 else
16388   echo "$as_me: failed program was:" >&5
16389 cat conftest.$ac_ext >&5
16390 cf_have_curses_lib=no
16391 fi
16392 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
16393                 echo "$as_me:16393: result: $cf_have_curses_lib" >&5
16394 echo "${ECHO_T}$cf_have_curses_lib" >&6
16395                 test "$cf_have_curses_lib" = maybe && cf_have_curses_lib=yes
16396                 if test "$cf_have_curses_lib" != "yes"
16397                 then
16398                         CPPFLAGS="$cf_save_CPPFLAGS"
16399                         LIBS="$cf_save_LIBS"
16400                 else
16401
16402 cf_upper=`echo "have_lib$PANEL_NAME" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
16403
16404                         cat >>confdefs.h <<EOF
16405 #define $cf_upper 1
16406 EOF
16407
16408                 fi
16409         fi
16410 fi
16411 if test "$cf_have_curses_lib" = no; then
16412         as_ac_Lib=`echo "ac_cv_lib_$PANEL_NAME$cf_cv_libtype''_new_panel" | $as_tr_sh`
16413 echo "$as_me:16413: checking for new_panel in -l$PANEL_NAME$cf_cv_libtype" >&5
16414 echo $ECHO_N "checking for new_panel in -l$PANEL_NAME$cf_cv_libtype... $ECHO_C" >&6
16415 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
16416   echo $ECHO_N "(cached) $ECHO_C" >&6
16417 else
16418   ac_check_lib_save_LIBS=$LIBS
16419 LIBS="-l$PANEL_NAME$cf_cv_libtype  $LIBS"
16420 cat >conftest.$ac_ext <<_ACEOF
16421 #line 16421 "configure"
16422 #include "confdefs.h"
16423
16424 /* Override any gcc2 internal prototype to avoid an error.  */
16425 #ifdef __cplusplus
16426 extern "C"
16427 #endif
16428 /* We use char because int might match the return type of a gcc2
16429    builtin and then its argument prototype would still apply.  */
16430 char new_panel ();
16431 int
16432 main (void)
16433 {
16434 new_panel ();
16435   ;
16436   return 0;
16437 }
16438 _ACEOF
16439 rm -f conftest.$ac_objext conftest$ac_exeext
16440 if { (eval echo "$as_me:16440: \"$ac_link\"") >&5
16441   (eval $ac_link) 2>&5
16442   ac_status=$?
16443   echo "$as_me:16443: \$? = $ac_status" >&5
16444   (exit $ac_status); } &&
16445          { ac_try='test -s conftest$ac_exeext'
16446   { (eval echo "$as_me:16446: \"$ac_try\"") >&5
16447   (eval $ac_try) 2>&5
16448   ac_status=$?
16449   echo "$as_me:16449: \$? = $ac_status" >&5
16450   (exit $ac_status); }; }; then
16451   eval "$as_ac_Lib=yes"
16452 else
16453   echo "$as_me: failed program was:" >&5
16454 cat conftest.$ac_ext >&5
16455 eval "$as_ac_Lib=no"
16456 fi
16457 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
16458 LIBS=$ac_check_lib_save_LIBS
16459 fi
16460 echo "$as_me:16460: result: `eval echo '${'$as_ac_Lib'}'`" >&5
16461 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
16462 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
16463
16464 cf_upper=`echo "have_lib$PANEL_NAME" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
16465
16466 cf_add_libs="$LIBS"
16467 # reverse order
16468 cf_add_0lib=
16469 for cf_add_1lib in -l$PANEL_NAME$cf_cv_libtype; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
16470 # filter duplicates
16471 for cf_add_1lib in $cf_add_0lib; do
16472         for cf_add_2lib in $cf_add_libs; do
16473                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
16474                         cf_add_1lib=
16475                         break
16476                 fi
16477         done
16478         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
16479 done
16480 LIBS="$cf_add_libs"
16481
16482                 cat >>confdefs.h <<EOF
16483 #define $cf_upper 1
16484 EOF
16485
16486 fi
16487
16488 fi
16489
16490         cf_curses_headers="$cf_curses_headers panel.h"
16491 fi
16492
16493 echo "$as_me:16493: checking if you want to check for menu functions" >&5
16494 echo $ECHO_N "checking if you want to check for menu functions... $ECHO_C" >&6
16495
16496 # Check whether --enable-menu or --disable-menu was given.
16497 if test "${enable_menu+set}" = set; then
16498   enableval="$enable_menu"
16499   test "$enableval" != no && enableval=yes
16500         if test "$enableval" != "yes" ; then
16501     cf_enable_menu=no
16502         else
16503                 cf_enable_menu=$cf_default_menu
16504         fi
16505 else
16506   enableval=yes
16507         cf_enable_menu=$cf_default_menu
16508
16509 fi;
16510 echo "$as_me:16510: result: $cf_enable_menu" >&5
16511 echo "${ECHO_T}$cf_enable_menu" >&6
16512 if test $cf_enable_menu = yes
16513 then
16514         case $cf_cv_screen in
16515         (ncurses*)
16516                 ;;
16517         (curses*)
16518
16519 echo "$as_me:16519: checking for NetBSD menu.h" >&5
16520 echo $ECHO_N "checking for NetBSD menu.h... $ECHO_C" >&6
16521 if test "${cf_cv_netbsd_menu_h+set}" = set; then
16522   echo $ECHO_N "(cached) $ECHO_C" >&6
16523 else
16524
16525 cat >conftest.$ac_ext <<_ACEOF
16526 #line 16526 "configure"
16527 #include "confdefs.h"
16528
16529 #include <${cf_cv_ncurses_header:-curses.h}>
16530 #include <menu.h>
16531
16532 int
16533 main (void)
16534 {
16535
16536         MENU *menu;
16537         int y = menu->max_item_width;
16538
16539   ;
16540   return 0;
16541 }
16542 _ACEOF
16543 rm -f conftest.$ac_objext
16544 if { (eval echo "$as_me:16544: \"$ac_compile\"") >&5
16545   (eval $ac_compile) 2>&5
16546   ac_status=$?
16547   echo "$as_me:16547: \$? = $ac_status" >&5
16548   (exit $ac_status); } &&
16549          { ac_try='test -s conftest.$ac_objext'
16550   { (eval echo "$as_me:16550: \"$ac_try\"") >&5
16551   (eval $ac_try) 2>&5
16552   ac_status=$?
16553   echo "$as_me:16553: \$? = $ac_status" >&5
16554   (exit $ac_status); }; }; then
16555   cf_cv_netbsd_menu_h=yes
16556
16557 else
16558   echo "$as_me: failed program was:" >&5
16559 cat conftest.$ac_ext >&5
16560 cf_cv_netbsd_menu_h=no
16561 fi
16562 rm -f conftest.$ac_objext conftest.$ac_ext
16563
16564 fi
16565 echo "$as_me:16565: result: $cf_cv_netbsd_menu_h" >&5
16566 echo "${ECHO_T}$cf_cv_netbsd_menu_h" >&6
16567
16568 test "$cf_cv_netbsd_menu_h" = yes &&
16569 cat >>confdefs.h <<\EOF
16570 #define HAVE_NETBSD_MENU_H 1
16571 EOF
16572
16573                 ;;
16574         esac
16575
16576 cf_have_curses_lib=no
16577
16578 : ${NCURSES_CONFIG_PKG:=none}
16579 if test "x${NCURSES_CONFIG_PKG}" = xnone; then
16580         :
16581 elif test "x${PKG_CONFIG:=none}" != xnone; then
16582         echo "$as_me:16582: checking pkg-config for $MENU_NAME$cf_cv_libtype" >&5
16583 echo $ECHO_N "checking pkg-config for $MENU_NAME$cf_cv_libtype... $ECHO_C" >&6
16584         if "$PKG_CONFIG" --exists $MENU_NAME$cf_cv_libtype ; then
16585                 echo "$as_me:16585: result: yes" >&5
16586 echo "${ECHO_T}yes" >&6
16587
16588                 echo "$as_me:16588: checking if the $MENU_NAME$cf_cv_libtype package files work" >&5
16589 echo $ECHO_N "checking if the $MENU_NAME$cf_cv_libtype package files work... $ECHO_C" >&6
16590
16591                 cf_save_CPPFLAGS="$CPPFLAGS"
16592                 cf_save_LIBS="$LIBS"
16593
16594 cf_fix_cppflags=no
16595 cf_new_cflags=
16596 cf_new_cppflags=
16597 cf_new_extra_cppflags=
16598
16599 for cf_add_cflags in `$PKG_CONFIG --cflags $MENU_NAME$cf_cv_libtype`
16600 do
16601 case $cf_fix_cppflags in
16602 (no)
16603         case $cf_add_cflags in
16604         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
16605                 case $cf_add_cflags in
16606                 (-D*)
16607                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
16608
16609                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
16610                                 && test -z "${cf_tst_cflags}" \
16611                                 && cf_fix_cppflags=yes
16612
16613                         if test $cf_fix_cppflags = yes ; then
16614
16615         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
16616         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
16617
16618                                 continue
16619                         elif test "${cf_tst_cflags}" = "\"'" ; then
16620
16621         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
16622         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
16623
16624                                 continue
16625                         fi
16626                         ;;
16627                 esac
16628                 case "$CPPFLAGS" in
16629                 (*$cf_add_cflags)
16630                         ;;
16631                 (*)
16632                         case $cf_add_cflags in
16633                         (-D*)
16634                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
16635
16636 CPPFLAGS=`echo "$CPPFLAGS" | \
16637         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
16638                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
16639
16640                                 ;;
16641                         esac
16642
16643         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
16644         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
16645
16646                         ;;
16647                 esac
16648                 ;;
16649         (*)
16650
16651         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
16652         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
16653
16654                 ;;
16655         esac
16656         ;;
16657 (yes)
16658
16659         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
16660         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
16661
16662         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
16663
16664         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
16665                 && test -z "${cf_tst_cflags}" \
16666                 && cf_fix_cppflags=no
16667         ;;
16668 esac
16669 done
16670
16671 if test -n "$cf_new_cflags" ; then
16672
16673         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
16674         CFLAGS="${CFLAGS}$cf_new_cflags"
16675
16676 fi
16677
16678 if test -n "$cf_new_cppflags" ; then
16679
16680         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
16681         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
16682
16683 fi
16684
16685 if test -n "$cf_new_extra_cppflags" ; then
16686
16687         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
16688         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
16689
16690 fi
16691
16692 cf_add_libs="$LIBS"
16693 # reverse order
16694 cf_add_0lib=
16695 for cf_add_1lib in `$PKG_CONFIG --libs $MENU_NAME$cf_cv_libtype`; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
16696 # filter duplicates
16697 for cf_add_1lib in $cf_add_0lib; do
16698         for cf_add_2lib in $cf_add_libs; do
16699                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
16700                         cf_add_1lib=
16701                         break
16702                 fi
16703         done
16704         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
16705 done
16706 LIBS="$cf_add_libs"
16707
16708                 cat >conftest.$ac_ext <<_ACEOF
16709 #line 16709 "configure"
16710 #include "confdefs.h"
16711 #include <$MENU_NAME.h>
16712 int
16713 main (void)
16714 {
16715 (void) menu_driver ( 0,0 );
16716   ;
16717   return 0;
16718 }
16719 _ACEOF
16720 rm -f conftest.$ac_objext conftest$ac_exeext
16721 if { (eval echo "$as_me:16721: \"$ac_link\"") >&5
16722   (eval $ac_link) 2>&5
16723   ac_status=$?
16724   echo "$as_me:16724: \$? = $ac_status" >&5
16725   (exit $ac_status); } &&
16726          { ac_try='test -s conftest$ac_exeext'
16727   { (eval echo "$as_me:16727: \"$ac_try\"") >&5
16728   (eval $ac_try) 2>&5
16729   ac_status=$?
16730   echo "$as_me:16730: \$? = $ac_status" >&5
16731   (exit $ac_status); }; }; then
16732   if test "$cross_compiling" = yes; then
16733   cf_have_curses_lib=maybe
16734 else
16735   cat >conftest.$ac_ext <<_ACEOF
16736 #line 16736 "configure"
16737 #include "confdefs.h"
16738 #include <$MENU_NAME.h>
16739                                 int main(void)
16740                                 { (void) menu_driver ( 0,0 ); return 0; }
16741 _ACEOF
16742 rm -f conftest$ac_exeext
16743 if { (eval echo "$as_me:16743: \"$ac_link\"") >&5
16744   (eval $ac_link) 2>&5
16745   ac_status=$?
16746   echo "$as_me:16746: \$? = $ac_status" >&5
16747   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
16748   { (eval echo "$as_me:16748: \"$ac_try\"") >&5
16749   (eval $ac_try) 2>&5
16750   ac_status=$?
16751   echo "$as_me:16751: \$? = $ac_status" >&5
16752   (exit $ac_status); }; }; then
16753   cf_have_curses_lib=yes
16754 else
16755   echo "$as_me: program exited with status $ac_status" >&5
16756 echo "$as_me: failed program was:" >&5
16757 cat conftest.$ac_ext >&5
16758 cf_have_curses_lib=no
16759 fi
16760 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
16761 fi
16762 else
16763   echo "$as_me: failed program was:" >&5
16764 cat conftest.$ac_ext >&5
16765 cf_have_curses_lib=no
16766 fi
16767 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
16768                 echo "$as_me:16768: result: $cf_have_curses_lib" >&5
16769 echo "${ECHO_T}$cf_have_curses_lib" >&6
16770                 test "$cf_have_curses_lib" = maybe && cf_have_curses_lib=yes
16771                 if test "$cf_have_curses_lib" != "yes"
16772                 then
16773                         CPPFLAGS="$cf_save_CPPFLAGS"
16774                         LIBS="$cf_save_LIBS"
16775                 else
16776
16777 cf_upper=`echo "have_lib$MENU_NAME" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
16778
16779                         cat >>confdefs.h <<EOF
16780 #define $cf_upper 1
16781 EOF
16782
16783                 fi
16784         fi
16785 fi
16786 if test "$cf_have_curses_lib" = no; then
16787         as_ac_Lib=`echo "ac_cv_lib_$MENU_NAME$cf_cv_libtype''_menu_driver" | $as_tr_sh`
16788 echo "$as_me:16788: checking for menu_driver in -l$MENU_NAME$cf_cv_libtype" >&5
16789 echo $ECHO_N "checking for menu_driver in -l$MENU_NAME$cf_cv_libtype... $ECHO_C" >&6
16790 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
16791   echo $ECHO_N "(cached) $ECHO_C" >&6
16792 else
16793   ac_check_lib_save_LIBS=$LIBS
16794 LIBS="-l$MENU_NAME$cf_cv_libtype  $LIBS"
16795 cat >conftest.$ac_ext <<_ACEOF
16796 #line 16796 "configure"
16797 #include "confdefs.h"
16798
16799 /* Override any gcc2 internal prototype to avoid an error.  */
16800 #ifdef __cplusplus
16801 extern "C"
16802 #endif
16803 /* We use char because int might match the return type of a gcc2
16804    builtin and then its argument prototype would still apply.  */
16805 char menu_driver ();
16806 int
16807 main (void)
16808 {
16809 menu_driver ();
16810   ;
16811   return 0;
16812 }
16813 _ACEOF
16814 rm -f conftest.$ac_objext conftest$ac_exeext
16815 if { (eval echo "$as_me:16815: \"$ac_link\"") >&5
16816   (eval $ac_link) 2>&5
16817   ac_status=$?
16818   echo "$as_me:16818: \$? = $ac_status" >&5
16819   (exit $ac_status); } &&
16820          { ac_try='test -s conftest$ac_exeext'
16821   { (eval echo "$as_me:16821: \"$ac_try\"") >&5
16822   (eval $ac_try) 2>&5
16823   ac_status=$?
16824   echo "$as_me:16824: \$? = $ac_status" >&5
16825   (exit $ac_status); }; }; then
16826   eval "$as_ac_Lib=yes"
16827 else
16828   echo "$as_me: failed program was:" >&5
16829 cat conftest.$ac_ext >&5
16830 eval "$as_ac_Lib=no"
16831 fi
16832 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
16833 LIBS=$ac_check_lib_save_LIBS
16834 fi
16835 echo "$as_me:16835: result: `eval echo '${'$as_ac_Lib'}'`" >&5
16836 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
16837 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
16838
16839 cf_upper=`echo "have_lib$MENU_NAME" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
16840
16841 cf_add_libs="$LIBS"
16842 # reverse order
16843 cf_add_0lib=
16844 for cf_add_1lib in -l$MENU_NAME$cf_cv_libtype; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
16845 # filter duplicates
16846 for cf_add_1lib in $cf_add_0lib; do
16847         for cf_add_2lib in $cf_add_libs; do
16848                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
16849                         cf_add_1lib=
16850                         break
16851                 fi
16852         done
16853         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
16854 done
16855 LIBS="$cf_add_libs"
16856
16857                 cat >>confdefs.h <<EOF
16858 #define $cf_upper 1
16859 EOF
16860
16861 fi
16862
16863 fi
16864
16865         cf_curses_headers="$cf_curses_headers menu.h"
16866 fi
16867
16868 echo "$as_me:16868: checking if you want to check for form functions" >&5
16869 echo $ECHO_N "checking if you want to check for form functions... $ECHO_C" >&6
16870
16871 # Check whether --enable-form or --disable-form was given.
16872 if test "${enable_form+set}" = set; then
16873   enableval="$enable_form"
16874   test "$enableval" != no && enableval=yes
16875         if test "$enableval" != "yes" ; then
16876     cf_enable_form=no
16877         else
16878                 cf_enable_form=$cf_default_form
16879         fi
16880 else
16881   enableval=yes
16882         cf_enable_form=$cf_default_form
16883
16884 fi;
16885 echo "$as_me:16885: result: $cf_enable_form" >&5
16886 echo "${ECHO_T}$cf_enable_form" >&6
16887 if test $cf_enable_form = yes
16888 then
16889         case $cf_cv_screen in
16890         (ncurses*)
16891                 ;;
16892         (curses*)
16893
16894 echo "$as_me:16894: checking for NetBSD form.h" >&5
16895 echo $ECHO_N "checking for NetBSD form.h... $ECHO_C" >&6
16896 if test "${cf_cv_netbsd_form_h+set}" = set; then
16897   echo $ECHO_N "(cached) $ECHO_C" >&6
16898 else
16899
16900 cat >conftest.$ac_ext <<_ACEOF
16901 #line 16901 "configure"
16902 #include "confdefs.h"
16903
16904 #include <${cf_cv_ncurses_header:-curses.h}>
16905 #include <form.h>
16906
16907 int
16908 main (void)
16909 {
16910
16911         FORM *form;
16912         int y = current_field(form)->cursor_ypos;
16913         int x = current_field(form)->cursor_xpos;
16914
16915   ;
16916   return 0;
16917 }
16918 _ACEOF
16919 rm -f conftest.$ac_objext
16920 if { (eval echo "$as_me:16920: \"$ac_compile\"") >&5
16921   (eval $ac_compile) 2>&5
16922   ac_status=$?
16923   echo "$as_me:16923: \$? = $ac_status" >&5
16924   (exit $ac_status); } &&
16925          { ac_try='test -s conftest.$ac_objext'
16926   { (eval echo "$as_me:16926: \"$ac_try\"") >&5
16927   (eval $ac_try) 2>&5
16928   ac_status=$?
16929   echo "$as_me:16929: \$? = $ac_status" >&5
16930   (exit $ac_status); }; }; then
16931   cf_cv_netbsd_form_h=yes
16932
16933 else
16934   echo "$as_me: failed program was:" >&5
16935 cat conftest.$ac_ext >&5
16936 cf_cv_netbsd_form_h=no
16937 fi
16938 rm -f conftest.$ac_objext conftest.$ac_ext
16939
16940 fi
16941 echo "$as_me:16941: result: $cf_cv_netbsd_form_h" >&5
16942 echo "${ECHO_T}$cf_cv_netbsd_form_h" >&6
16943
16944 test "$cf_cv_netbsd_form_h" = yes &&
16945 cat >>confdefs.h <<\EOF
16946 #define HAVE_NETBSD_FORM_H 1
16947 EOF
16948
16949                 ;;
16950         esac
16951
16952 cf_have_curses_lib=no
16953
16954 : ${NCURSES_CONFIG_PKG:=none}
16955 if test "x${NCURSES_CONFIG_PKG}" = xnone; then
16956         :
16957 elif test "x${PKG_CONFIG:=none}" != xnone; then
16958         echo "$as_me:16958: checking pkg-config for $FORM_NAME$cf_cv_libtype" >&5
16959 echo $ECHO_N "checking pkg-config for $FORM_NAME$cf_cv_libtype... $ECHO_C" >&6
16960         if "$PKG_CONFIG" --exists $FORM_NAME$cf_cv_libtype ; then
16961                 echo "$as_me:16961: result: yes" >&5
16962 echo "${ECHO_T}yes" >&6
16963
16964                 echo "$as_me:16964: checking if the $FORM_NAME$cf_cv_libtype package files work" >&5
16965 echo $ECHO_N "checking if the $FORM_NAME$cf_cv_libtype package files work... $ECHO_C" >&6
16966
16967                 cf_save_CPPFLAGS="$CPPFLAGS"
16968                 cf_save_LIBS="$LIBS"
16969
16970 cf_fix_cppflags=no
16971 cf_new_cflags=
16972 cf_new_cppflags=
16973 cf_new_extra_cppflags=
16974
16975 for cf_add_cflags in `$PKG_CONFIG --cflags $FORM_NAME$cf_cv_libtype`
16976 do
16977 case $cf_fix_cppflags in
16978 (no)
16979         case $cf_add_cflags in
16980         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
16981                 case $cf_add_cflags in
16982                 (-D*)
16983                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
16984
16985                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
16986                                 && test -z "${cf_tst_cflags}" \
16987                                 && cf_fix_cppflags=yes
16988
16989                         if test $cf_fix_cppflags = yes ; then
16990
16991         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
16992         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
16993
16994                                 continue
16995                         elif test "${cf_tst_cflags}" = "\"'" ; then
16996
16997         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
16998         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
16999
17000                                 continue
17001                         fi
17002                         ;;
17003                 esac
17004                 case "$CPPFLAGS" in
17005                 (*$cf_add_cflags)
17006                         ;;
17007                 (*)
17008                         case $cf_add_cflags in
17009                         (-D*)
17010                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
17011
17012 CPPFLAGS=`echo "$CPPFLAGS" | \
17013         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
17014                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
17015
17016                                 ;;
17017                         esac
17018
17019         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
17020         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
17021
17022                         ;;
17023                 esac
17024                 ;;
17025         (*)
17026
17027         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
17028         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
17029
17030                 ;;
17031         esac
17032         ;;
17033 (yes)
17034
17035         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
17036         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
17037
17038         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
17039
17040         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
17041                 && test -z "${cf_tst_cflags}" \
17042                 && cf_fix_cppflags=no
17043         ;;
17044 esac
17045 done
17046
17047 if test -n "$cf_new_cflags" ; then
17048
17049         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
17050         CFLAGS="${CFLAGS}$cf_new_cflags"
17051
17052 fi
17053
17054 if test -n "$cf_new_cppflags" ; then
17055
17056         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
17057         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
17058
17059 fi
17060
17061 if test -n "$cf_new_extra_cppflags" ; then
17062
17063         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
17064         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
17065
17066 fi
17067
17068 cf_add_libs="$LIBS"
17069 # reverse order
17070 cf_add_0lib=
17071 for cf_add_1lib in `$PKG_CONFIG --libs $FORM_NAME$cf_cv_libtype`; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
17072 # filter duplicates
17073 for cf_add_1lib in $cf_add_0lib; do
17074         for cf_add_2lib in $cf_add_libs; do
17075                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
17076                         cf_add_1lib=
17077                         break
17078                 fi
17079         done
17080         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
17081 done
17082 LIBS="$cf_add_libs"
17083
17084                 cat >conftest.$ac_ext <<_ACEOF
17085 #line 17085 "configure"
17086 #include "confdefs.h"
17087 #include <$FORM_NAME.h>
17088 int
17089 main (void)
17090 {
17091 (void) form_driver ( 0,0 );
17092   ;
17093   return 0;
17094 }
17095 _ACEOF
17096 rm -f conftest.$ac_objext conftest$ac_exeext
17097 if { (eval echo "$as_me:17097: \"$ac_link\"") >&5
17098   (eval $ac_link) 2>&5
17099   ac_status=$?
17100   echo "$as_me:17100: \$? = $ac_status" >&5
17101   (exit $ac_status); } &&
17102          { ac_try='test -s conftest$ac_exeext'
17103   { (eval echo "$as_me:17103: \"$ac_try\"") >&5
17104   (eval $ac_try) 2>&5
17105   ac_status=$?
17106   echo "$as_me:17106: \$? = $ac_status" >&5
17107   (exit $ac_status); }; }; then
17108   if test "$cross_compiling" = yes; then
17109   cf_have_curses_lib=maybe
17110 else
17111   cat >conftest.$ac_ext <<_ACEOF
17112 #line 17112 "configure"
17113 #include "confdefs.h"
17114 #include <$FORM_NAME.h>
17115                                 int main(void)
17116                                 { (void) form_driver ( 0,0 ); return 0; }
17117 _ACEOF
17118 rm -f conftest$ac_exeext
17119 if { (eval echo "$as_me:17119: \"$ac_link\"") >&5
17120   (eval $ac_link) 2>&5
17121   ac_status=$?
17122   echo "$as_me:17122: \$? = $ac_status" >&5
17123   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
17124   { (eval echo "$as_me:17124: \"$ac_try\"") >&5
17125   (eval $ac_try) 2>&5
17126   ac_status=$?
17127   echo "$as_me:17127: \$? = $ac_status" >&5
17128   (exit $ac_status); }; }; then
17129   cf_have_curses_lib=yes
17130 else
17131   echo "$as_me: program exited with status $ac_status" >&5
17132 echo "$as_me: failed program was:" >&5
17133 cat conftest.$ac_ext >&5
17134 cf_have_curses_lib=no
17135 fi
17136 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
17137 fi
17138 else
17139   echo "$as_me: failed program was:" >&5
17140 cat conftest.$ac_ext >&5
17141 cf_have_curses_lib=no
17142 fi
17143 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
17144                 echo "$as_me:17144: result: $cf_have_curses_lib" >&5
17145 echo "${ECHO_T}$cf_have_curses_lib" >&6
17146                 test "$cf_have_curses_lib" = maybe && cf_have_curses_lib=yes
17147                 if test "$cf_have_curses_lib" != "yes"
17148                 then
17149                         CPPFLAGS="$cf_save_CPPFLAGS"
17150                         LIBS="$cf_save_LIBS"
17151                 else
17152
17153 cf_upper=`echo "have_lib$FORM_NAME" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
17154
17155                         cat >>confdefs.h <<EOF
17156 #define $cf_upper 1
17157 EOF
17158
17159                 fi
17160         fi
17161 fi
17162 if test "$cf_have_curses_lib" = no; then
17163         as_ac_Lib=`echo "ac_cv_lib_$FORM_NAME$cf_cv_libtype''_form_driver" | $as_tr_sh`
17164 echo "$as_me:17164: checking for form_driver in -l$FORM_NAME$cf_cv_libtype" >&5
17165 echo $ECHO_N "checking for form_driver in -l$FORM_NAME$cf_cv_libtype... $ECHO_C" >&6
17166 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
17167   echo $ECHO_N "(cached) $ECHO_C" >&6
17168 else
17169   ac_check_lib_save_LIBS=$LIBS
17170 LIBS="-l$FORM_NAME$cf_cv_libtype  $LIBS"
17171 cat >conftest.$ac_ext <<_ACEOF
17172 #line 17172 "configure"
17173 #include "confdefs.h"
17174
17175 /* Override any gcc2 internal prototype to avoid an error.  */
17176 #ifdef __cplusplus
17177 extern "C"
17178 #endif
17179 /* We use char because int might match the return type of a gcc2
17180    builtin and then its argument prototype would still apply.  */
17181 char form_driver ();
17182 int
17183 main (void)
17184 {
17185 form_driver ();
17186   ;
17187   return 0;
17188 }
17189 _ACEOF
17190 rm -f conftest.$ac_objext conftest$ac_exeext
17191 if { (eval echo "$as_me:17191: \"$ac_link\"") >&5
17192   (eval $ac_link) 2>&5
17193   ac_status=$?
17194   echo "$as_me:17194: \$? = $ac_status" >&5
17195   (exit $ac_status); } &&
17196          { ac_try='test -s conftest$ac_exeext'
17197   { (eval echo "$as_me:17197: \"$ac_try\"") >&5
17198   (eval $ac_try) 2>&5
17199   ac_status=$?
17200   echo "$as_me:17200: \$? = $ac_status" >&5
17201   (exit $ac_status); }; }; then
17202   eval "$as_ac_Lib=yes"
17203 else
17204   echo "$as_me: failed program was:" >&5
17205 cat conftest.$ac_ext >&5
17206 eval "$as_ac_Lib=no"
17207 fi
17208 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
17209 LIBS=$ac_check_lib_save_LIBS
17210 fi
17211 echo "$as_me:17211: result: `eval echo '${'$as_ac_Lib'}'`" >&5
17212 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
17213 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
17214
17215 cf_upper=`echo "have_lib$FORM_NAME" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
17216
17217 cf_add_libs="$LIBS"
17218 # reverse order
17219 cf_add_0lib=
17220 for cf_add_1lib in -l$FORM_NAME$cf_cv_libtype; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
17221 # filter duplicates
17222 for cf_add_1lib in $cf_add_0lib; do
17223         for cf_add_2lib in $cf_add_libs; do
17224                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
17225                         cf_add_1lib=
17226                         break
17227                 fi
17228         done
17229         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
17230 done
17231 LIBS="$cf_add_libs"
17232
17233                 cat >>confdefs.h <<EOF
17234 #define $cf_upper 1
17235 EOF
17236
17237 fi
17238
17239 fi
17240
17241         cf_curses_headers="$cf_curses_headers form.h"
17242 fi
17243
17244 # look for curses-related headers
17245
17246 for ac_header in $cf_curses_headers
17247 do
17248 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
17249 echo "$as_me:17249: checking for $ac_header" >&5
17250 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
17251 if eval "test \"\${$as_ac_Header+set}\" = set"; then
17252   echo $ECHO_N "(cached) $ECHO_C" >&6
17253 else
17254   cat >conftest.$ac_ext <<_ACEOF
17255 #line 17255 "configure"
17256 #include "confdefs.h"
17257 #include <$ac_header>
17258 _ACEOF
17259 if { (eval echo "$as_me:17259: \"$ac_cpp conftest.$ac_ext\"") >&5
17260   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
17261   ac_status=$?
17262   egrep -v '^ *\+' conftest.er1 >conftest.err
17263   rm -f conftest.er1
17264   cat conftest.err >&5
17265   echo "$as_me:17265: \$? = $ac_status" >&5
17266   (exit $ac_status); } >/dev/null; then
17267   if test -s conftest.err; then
17268     ac_cpp_err=$ac_c_preproc_warn_flag
17269   else
17270     ac_cpp_err=
17271   fi
17272 else
17273   ac_cpp_err=yes
17274 fi
17275 if test -z "$ac_cpp_err"; then
17276   eval "$as_ac_Header=yes"
17277 else
17278   echo "$as_me: failed program was:" >&5
17279   cat conftest.$ac_ext >&5
17280   eval "$as_ac_Header=no"
17281 fi
17282 rm -f conftest.err conftest.$ac_ext
17283 fi
17284 echo "$as_me:17284: result: `eval echo '${'$as_ac_Header'}'`" >&5
17285 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
17286 if test `eval echo '${'$as_ac_Header'}'` = yes; then
17287   cat >>confdefs.h <<EOF
17288 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
17289 EOF
17290
17291 fi
17292 done
17293
17294 echo "$as_me:17294: checking for ANSI C header files" >&5
17295 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
17296 if test "${ac_cv_header_stdc+set}" = set; then
17297   echo $ECHO_N "(cached) $ECHO_C" >&6
17298 else
17299   cat >conftest.$ac_ext <<_ACEOF
17300 #line 17300 "configure"
17301 #include "confdefs.h"
17302 #include <stdlib.h>
17303 #include <stdarg.h>
17304 #include <string.h>
17305 #include <float.h>
17306
17307 _ACEOF
17308 if { (eval echo "$as_me:17308: \"$ac_cpp conftest.$ac_ext\"") >&5
17309   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
17310   ac_status=$?
17311   egrep -v '^ *\+' conftest.er1 >conftest.err
17312   rm -f conftest.er1
17313   cat conftest.err >&5
17314   echo "$as_me:17314: \$? = $ac_status" >&5
17315   (exit $ac_status); } >/dev/null; then
17316   if test -s conftest.err; then
17317     ac_cpp_err=$ac_c_preproc_warn_flag
17318   else
17319     ac_cpp_err=
17320   fi
17321 else
17322   ac_cpp_err=yes
17323 fi
17324 if test -z "$ac_cpp_err"; then
17325   ac_cv_header_stdc=yes
17326 else
17327   echo "$as_me: failed program was:" >&5
17328   cat conftest.$ac_ext >&5
17329   ac_cv_header_stdc=no
17330 fi
17331 rm -f conftest.err conftest.$ac_ext
17332
17333 if test $ac_cv_header_stdc = yes; then
17334   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
17335   cat >conftest.$ac_ext <<_ACEOF
17336 #line 17336 "configure"
17337 #include "confdefs.h"
17338 #include <string.h>
17339
17340 _ACEOF
17341 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
17342   egrep "memchr" >/dev/null 2>&1; then
17343   :
17344 else
17345   ac_cv_header_stdc=no
17346 fi
17347 rm -rf conftest*
17348
17349 fi
17350
17351 if test $ac_cv_header_stdc = yes; then
17352   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
17353   cat >conftest.$ac_ext <<_ACEOF
17354 #line 17354 "configure"
17355 #include "confdefs.h"
17356 #include <stdlib.h>
17357
17358 _ACEOF
17359 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
17360   egrep "free" >/dev/null 2>&1; then
17361   :
17362 else
17363   ac_cv_header_stdc=no
17364 fi
17365 rm -rf conftest*
17366
17367 fi
17368
17369 if test $ac_cv_header_stdc = yes; then
17370   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
17371   if test "$cross_compiling" = yes; then
17372   :
17373 else
17374   cat >conftest.$ac_ext <<_ACEOF
17375 #line 17375 "configure"
17376 #include "confdefs.h"
17377 #include <ctype.h>
17378 #if ((' ' & 0x0FF) == 0x020)
17379 # define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
17380 # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
17381 #else
17382 # define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
17383                      || ('j' <= (c) && (c) <= 'r') \
17384                      || ('s' <= (c) && (c) <= 'z'))
17385 # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
17386 #endif
17387
17388 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
17389 int
17390 main (void)
17391 {
17392   int i;
17393   for (i = 0; i < 256; i++)
17394     if (XOR (islower (i), ISLOWER (i))
17395         || toupper (i) != TOUPPER (i))
17396       $ac_main_return(2);
17397   $ac_main_return (0);
17398 }
17399 _ACEOF
17400 rm -f conftest$ac_exeext
17401 if { (eval echo "$as_me:17401: \"$ac_link\"") >&5
17402   (eval $ac_link) 2>&5
17403   ac_status=$?
17404   echo "$as_me:17404: \$? = $ac_status" >&5
17405   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
17406   { (eval echo "$as_me:17406: \"$ac_try\"") >&5
17407   (eval $ac_try) 2>&5
17408   ac_status=$?
17409   echo "$as_me:17409: \$? = $ac_status" >&5
17410   (exit $ac_status); }; }; then
17411   :
17412 else
17413   echo "$as_me: program exited with status $ac_status" >&5
17414 echo "$as_me: failed program was:" >&5
17415 cat conftest.$ac_ext >&5
17416 ac_cv_header_stdc=no
17417 fi
17418 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
17419 fi
17420 fi
17421 fi
17422 echo "$as_me:17422: result: $ac_cv_header_stdc" >&5
17423 echo "${ECHO_T}$ac_cv_header_stdc" >&6
17424 if test $ac_cv_header_stdc = yes; then
17425
17426 cat >>confdefs.h <<\EOF
17427 #define STDC_HEADERS 1
17428 EOF
17429
17430 fi
17431
17432 echo "$as_me:17432: checking whether time.h and sys/time.h may both be included" >&5
17433 echo $ECHO_N "checking whether time.h and sys/time.h may both be included... $ECHO_C" >&6
17434 if test "${ac_cv_header_time+set}" = set; then
17435   echo $ECHO_N "(cached) $ECHO_C" >&6
17436 else
17437   cat >conftest.$ac_ext <<_ACEOF
17438 #line 17438 "configure"
17439 #include "confdefs.h"
17440 #include <sys/types.h>
17441 #include <sys/time.h>
17442 #include <time.h>
17443
17444 int
17445 main (void)
17446 {
17447 if ((struct tm *) 0)
17448 return 0;
17449   ;
17450   return 0;
17451 }
17452 _ACEOF
17453 rm -f conftest.$ac_objext
17454 if { (eval echo "$as_me:17454: \"$ac_compile\"") >&5
17455   (eval $ac_compile) 2>&5
17456   ac_status=$?
17457   echo "$as_me:17457: \$? = $ac_status" >&5
17458   (exit $ac_status); } &&
17459          { ac_try='test -s conftest.$ac_objext'
17460   { (eval echo "$as_me:17460: \"$ac_try\"") >&5
17461   (eval $ac_try) 2>&5
17462   ac_status=$?
17463   echo "$as_me:17463: \$? = $ac_status" >&5
17464   (exit $ac_status); }; }; then
17465   ac_cv_header_time=yes
17466 else
17467   echo "$as_me: failed program was:" >&5
17468 cat conftest.$ac_ext >&5
17469 ac_cv_header_time=no
17470 fi
17471 rm -f conftest.$ac_objext conftest.$ac_ext
17472 fi
17473 echo "$as_me:17473: result: $ac_cv_header_time" >&5
17474 echo "${ECHO_T}$ac_cv_header_time" >&6
17475 if test $ac_cv_header_time = yes; then
17476
17477 cat >>confdefs.h <<\EOF
17478 #define TIME_WITH_SYS_TIME 1
17479 EOF
17480
17481 fi
17482
17483 for ac_header in \
17484 getopt.h \
17485 locale.h \
17486 math.h \
17487 stdarg.h \
17488 stdint.h \
17489 sys/ioctl.h \
17490 sys/select.h \
17491 sys/time.h \
17492 termios.h \
17493 unistd.h \
17494
17495 do
17496 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
17497 echo "$as_me:17497: checking for $ac_header" >&5
17498 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
17499 if eval "test \"\${$as_ac_Header+set}\" = set"; then
17500   echo $ECHO_N "(cached) $ECHO_C" >&6
17501 else
17502   cat >conftest.$ac_ext <<_ACEOF
17503 #line 17503 "configure"
17504 #include "confdefs.h"
17505 #include <$ac_header>
17506 _ACEOF
17507 if { (eval echo "$as_me:17507: \"$ac_cpp conftest.$ac_ext\"") >&5
17508   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
17509   ac_status=$?
17510   egrep -v '^ *\+' conftest.er1 >conftest.err
17511   rm -f conftest.er1
17512   cat conftest.err >&5
17513   echo "$as_me:17513: \$? = $ac_status" >&5
17514   (exit $ac_status); } >/dev/null; then
17515   if test -s conftest.err; then
17516     ac_cpp_err=$ac_c_preproc_warn_flag
17517   else
17518     ac_cpp_err=
17519   fi
17520 else
17521   ac_cpp_err=yes
17522 fi
17523 if test -z "$ac_cpp_err"; then
17524   eval "$as_ac_Header=yes"
17525 else
17526   echo "$as_me: failed program was:" >&5
17527   cat conftest.$ac_ext >&5
17528   eval "$as_ac_Header=no"
17529 fi
17530 rm -f conftest.err conftest.$ac_ext
17531 fi
17532 echo "$as_me:17532: result: `eval echo '${'$as_ac_Header'}'`" >&5
17533 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
17534 if test `eval echo '${'$as_ac_Header'}'` = yes; then
17535   cat >>confdefs.h <<EOF
17536 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
17537 EOF
17538
17539 fi
17540 done
17541
17542 for ac_header in unistd.h getopt.h
17543 do
17544 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
17545 echo "$as_me:17545: checking for $ac_header" >&5
17546 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
17547 if eval "test \"\${$as_ac_Header+set}\" = set"; then
17548   echo $ECHO_N "(cached) $ECHO_C" >&6
17549 else
17550   cat >conftest.$ac_ext <<_ACEOF
17551 #line 17551 "configure"
17552 #include "confdefs.h"
17553 #include <$ac_header>
17554 _ACEOF
17555 if { (eval echo "$as_me:17555: \"$ac_cpp conftest.$ac_ext\"") >&5
17556   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
17557   ac_status=$?
17558   egrep -v '^ *\+' conftest.er1 >conftest.err
17559   rm -f conftest.er1
17560   cat conftest.err >&5
17561   echo "$as_me:17561: \$? = $ac_status" >&5
17562   (exit $ac_status); } >/dev/null; then
17563   if test -s conftest.err; then
17564     ac_cpp_err=$ac_c_preproc_warn_flag
17565   else
17566     ac_cpp_err=
17567   fi
17568 else
17569   ac_cpp_err=yes
17570 fi
17571 if test -z "$ac_cpp_err"; then
17572   eval "$as_ac_Header=yes"
17573 else
17574   echo "$as_me: failed program was:" >&5
17575   cat conftest.$ac_ext >&5
17576   eval "$as_ac_Header=no"
17577 fi
17578 rm -f conftest.err conftest.$ac_ext
17579 fi
17580 echo "$as_me:17580: result: `eval echo '${'$as_ac_Header'}'`" >&5
17581 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
17582 if test `eval echo '${'$as_ac_Header'}'` = yes; then
17583   cat >>confdefs.h <<EOF
17584 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
17585 EOF
17586
17587 fi
17588 done
17589
17590 echo "$as_me:17590: checking for header declaring getopt variables" >&5
17591 echo $ECHO_N "checking for header declaring getopt variables... $ECHO_C" >&6
17592 if test "${cf_cv_getopt_header+set}" = set; then
17593   echo $ECHO_N "(cached) $ECHO_C" >&6
17594 else
17595
17596 cf_cv_getopt_header=none
17597 for cf_header in stdio.h stdlib.h unistd.h getopt.h
17598 do
17599 cat >conftest.$ac_ext <<_ACEOF
17600 #line 17600 "configure"
17601 #include "confdefs.h"
17602
17603 #include <$cf_header>
17604 int
17605 main (void)
17606 {
17607 int x = optind; char *y = optarg
17608   ;
17609   return 0;
17610 }
17611 _ACEOF
17612 rm -f conftest.$ac_objext
17613 if { (eval echo "$as_me:17613: \"$ac_compile\"") >&5
17614   (eval $ac_compile) 2>&5
17615   ac_status=$?
17616   echo "$as_me:17616: \$? = $ac_status" >&5
17617   (exit $ac_status); } &&
17618          { ac_try='test -s conftest.$ac_objext'
17619   { (eval echo "$as_me:17619: \"$ac_try\"") >&5
17620   (eval $ac_try) 2>&5
17621   ac_status=$?
17622   echo "$as_me:17622: \$? = $ac_status" >&5
17623   (exit $ac_status); }; }; then
17624   cf_cv_getopt_header=$cf_header
17625  break
17626 else
17627   echo "$as_me: failed program was:" >&5
17628 cat conftest.$ac_ext >&5
17629 fi
17630 rm -f conftest.$ac_objext conftest.$ac_ext
17631 done
17632
17633 fi
17634 echo "$as_me:17634: result: $cf_cv_getopt_header" >&5
17635 echo "${ECHO_T}$cf_cv_getopt_header" >&6
17636 if test $cf_cv_getopt_header != none ; then
17637
17638 cat >>confdefs.h <<\EOF
17639 #define HAVE_GETOPT_HEADER 1
17640 EOF
17641
17642 fi
17643 if test $cf_cv_getopt_header = getopt.h ; then
17644
17645 cat >>confdefs.h <<\EOF
17646 #define NEED_GETOPT_H 1
17647 EOF
17648
17649 fi
17650
17651 for ac_func in \
17652 getopt \
17653 gettimeofday \
17654 snprintf \
17655 strdup \
17656 strstr \
17657 tsearch \
17658
17659 do
17660 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
17661 echo "$as_me:17661: checking for $ac_func" >&5
17662 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
17663 if eval "test \"\${$as_ac_var+set}\" = set"; then
17664   echo $ECHO_N "(cached) $ECHO_C" >&6
17665 else
17666   cat >conftest.$ac_ext <<_ACEOF
17667 #line 17667 "configure"
17668 #include "confdefs.h"
17669 #define $ac_func autoconf_temporary
17670 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
17671 #undef $ac_func
17672
17673 #ifdef __cplusplus
17674 extern "C"
17675 #endif
17676
17677 /* We use char because int might match the return type of a gcc2
17678    builtin and then its argument prototype would still apply.  */
17679 char $ac_func (void);
17680
17681 int
17682 main (void)
17683 {
17684
17685 /* The GNU C library defines stubs for functions which it implements
17686     to always fail with ENOSYS.  Some functions are actually named
17687     something starting with __ and the normal name is an alias.  */
17688 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
17689 #error found stub for $ac_func
17690 #endif
17691
17692         return $ac_func ();
17693   ;
17694   return 0;
17695 }
17696 _ACEOF
17697 rm -f conftest.$ac_objext conftest$ac_exeext
17698 if { (eval echo "$as_me:17698: \"$ac_link\"") >&5
17699   (eval $ac_link) 2>&5
17700   ac_status=$?
17701   echo "$as_me:17701: \$? = $ac_status" >&5
17702   (exit $ac_status); } &&
17703          { ac_try='test -s conftest$ac_exeext'
17704   { (eval echo "$as_me:17704: \"$ac_try\"") >&5
17705   (eval $ac_try) 2>&5
17706   ac_status=$?
17707   echo "$as_me:17707: \$? = $ac_status" >&5
17708   (exit $ac_status); }; }; then
17709   eval "$as_ac_var=yes"
17710 else
17711   echo "$as_me: failed program was:" >&5
17712 cat conftest.$ac_ext >&5
17713 eval "$as_ac_var=no"
17714 fi
17715 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
17716 fi
17717 echo "$as_me:17717: result: `eval echo '${'$as_ac_var'}'`" >&5
17718 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
17719 if test `eval echo '${'$as_ac_var'}'` = yes; then
17720   cat >>confdefs.h <<EOF
17721 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
17722 EOF
17723
17724 fi
17725 done
17726
17727 # use a compile-check to work with ncurses*-config and subdirectory includes
17728 echo "$as_me:17728: checking if we can use termcap.h" >&5
17729 echo $ECHO_N "checking if we can use termcap.h... $ECHO_C" >&6
17730 if test "${cf_cv_have_termcap_h+set}" = set; then
17731   echo $ECHO_N "(cached) $ECHO_C" >&6
17732 else
17733
17734         cat >conftest.$ac_ext <<_ACEOF
17735 #line 17735 "configure"
17736 #include "confdefs.h"
17737
17738 #include <curses.h>
17739 #ifdef NCURSES_VERSION
17740 #undef NCURSES_VERSION
17741 #endif
17742 #include <termcap.h>
17743 #ifndef NCURSES_VERSION
17744 #error wrong header
17745 #endif
17746
17747 int
17748 main (void)
17749 {
17750 return 0;
17751   ;
17752   return 0;
17753 }
17754 _ACEOF
17755 rm -f conftest.$ac_objext
17756 if { (eval echo "$as_me:17756: \"$ac_compile\"") >&5
17757   (eval $ac_compile) 2>&5
17758   ac_status=$?
17759   echo "$as_me:17759: \$? = $ac_status" >&5
17760   (exit $ac_status); } &&
17761          { ac_try='test -s conftest.$ac_objext'
17762   { (eval echo "$as_me:17762: \"$ac_try\"") >&5
17763   (eval $ac_try) 2>&5
17764   ac_status=$?
17765   echo "$as_me:17765: \$? = $ac_status" >&5
17766   (exit $ac_status); }; }; then
17767   cf_cv_have_termcap_h=yes
17768 else
17769   echo "$as_me: failed program was:" >&5
17770 cat conftest.$ac_ext >&5
17771 cf_cv_have_termcap_h=no
17772 fi
17773 rm -f conftest.$ac_objext conftest.$ac_ext
17774 fi
17775 echo "$as_me:17775: result: $cf_cv_have_termcap_h" >&5
17776 echo "${ECHO_T}$cf_cv_have_termcap_h" >&6
17777 if test "x$cf_cv_have_termcap_h" = xyes
17778 then
17779
17780 cat >>confdefs.h <<\EOF
17781 #define HAVE_TERMCAP_H 1
17782 EOF
17783
17784 else
17785 echo "$as_me:17785: checking if we can use ncurses/termcap.h" >&5
17786 echo $ECHO_N "checking if we can use ncurses/termcap.h... $ECHO_C" >&6
17787 if test "${cf_cv_have_ncurses_termcap_h+set}" = set; then
17788   echo $ECHO_N "(cached) $ECHO_C" >&6
17789 else
17790
17791         cat >conftest.$ac_ext <<_ACEOF
17792 #line 17792 "configure"
17793 #include "confdefs.h"
17794
17795 #include <ncurses/curses.h>
17796 #ifdef NCURSES_VERSION
17797 #undef NCURSES_VERSION
17798 #endif
17799 #include <ncurses/termcap.h>
17800 #ifndef NCURSES_VERSION
17801 #error wrong header
17802 #endif
17803
17804 int
17805 main (void)
17806 {
17807 return 0;
17808   ;
17809   return 0;
17810 }
17811 _ACEOF
17812 rm -f conftest.$ac_objext
17813 if { (eval echo "$as_me:17813: \"$ac_compile\"") >&5
17814   (eval $ac_compile) 2>&5
17815   ac_status=$?
17816   echo "$as_me:17816: \$? = $ac_status" >&5
17817   (exit $ac_status); } &&
17818          { ac_try='test -s conftest.$ac_objext'
17819   { (eval echo "$as_me:17819: \"$ac_try\"") >&5
17820   (eval $ac_try) 2>&5
17821   ac_status=$?
17822   echo "$as_me:17822: \$? = $ac_status" >&5
17823   (exit $ac_status); }; }; then
17824   cf_cv_have_ncurses_termcap_h=yes
17825 else
17826   echo "$as_me: failed program was:" >&5
17827 cat conftest.$ac_ext >&5
17828 cf_cv_have_ncurses_termcap_h=no
17829 fi
17830 rm -f conftest.$ac_objext conftest.$ac_ext
17831 fi
17832 echo "$as_me:17832: result: $cf_cv_have_ncurses_termcap_h" >&5
17833 echo "${ECHO_T}$cf_cv_have_ncurses_termcap_h" >&6
17834 test "x$cf_cv_have_ncurses_termcap_h" = xyes &&
17835 cat >>confdefs.h <<\EOF
17836 #define HAVE_NCURSES_TERMCAP_H 1
17837 EOF
17838
17839 fi
17840
17841 if test "x$ac_cv_func_getopt" = xno; then
17842         { { echo "$as_me:17842: error: getopt is required for building programs" >&5
17843 echo "$as_me: error: getopt is required for building programs" >&2;}
17844    { (exit 1); exit 1; }; }
17845 fi
17846
17847 if test "$cf_enable_widec" = yes; then
17848
17849 for ac_func in \
17850 mblen \
17851 mbrlen \
17852 mbrtowc \
17853 mbsrtowcs \
17854 mbstowcs \
17855 mbtowc \
17856 wcsrtombs \
17857 wcstombs \
17858
17859 do
17860 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
17861 echo "$as_me:17861: checking for $ac_func" >&5
17862 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
17863 if eval "test \"\${$as_ac_var+set}\" = set"; then
17864   echo $ECHO_N "(cached) $ECHO_C" >&6
17865 else
17866   cat >conftest.$ac_ext <<_ACEOF
17867 #line 17867 "configure"
17868 #include "confdefs.h"
17869 #define $ac_func autoconf_temporary
17870 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
17871 #undef $ac_func
17872
17873 #ifdef __cplusplus
17874 extern "C"
17875 #endif
17876
17877 /* We use char because int might match the return type of a gcc2
17878    builtin and then its argument prototype would still apply.  */
17879 char $ac_func (void);
17880
17881 int
17882 main (void)
17883 {
17884
17885 /* The GNU C library defines stubs for functions which it implements
17886     to always fail with ENOSYS.  Some functions are actually named
17887     something starting with __ and the normal name is an alias.  */
17888 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
17889 #error found stub for $ac_func
17890 #endif
17891
17892         return $ac_func ();
17893   ;
17894   return 0;
17895 }
17896 _ACEOF
17897 rm -f conftest.$ac_objext conftest$ac_exeext
17898 if { (eval echo "$as_me:17898: \"$ac_link\"") >&5
17899   (eval $ac_link) 2>&5
17900   ac_status=$?
17901   echo "$as_me:17901: \$? = $ac_status" >&5
17902   (exit $ac_status); } &&
17903          { ac_try='test -s conftest$ac_exeext'
17904   { (eval echo "$as_me:17904: \"$ac_try\"") >&5
17905   (eval $ac_try) 2>&5
17906   ac_status=$?
17907   echo "$as_me:17907: \$? = $ac_status" >&5
17908   (exit $ac_status); }; }; then
17909   eval "$as_ac_var=yes"
17910 else
17911   echo "$as_me: failed program was:" >&5
17912 cat conftest.$ac_ext >&5
17913 eval "$as_ac_var=no"
17914 fi
17915 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
17916 fi
17917 echo "$as_me:17917: result: `eval echo '${'$as_ac_var'}'`" >&5
17918 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
17919 if test `eval echo '${'$as_ac_var'}'` = yes; then
17920   cat >>confdefs.h <<EOF
17921 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
17922 EOF
17923
17924 fi
17925 done
17926
17927 fi
17928
17929 echo "$as_me:17929: checking definition to turn on extended curses functions" >&5
17930 echo $ECHO_N "checking definition to turn on extended curses functions... $ECHO_C" >&6
17931 if test "${cf_cv_need_xopen_extension+set}" = set; then
17932   echo $ECHO_N "(cached) $ECHO_C" >&6
17933 else
17934
17935 cf_cv_need_xopen_extension=unknown
17936 cat >conftest.$ac_ext <<_ACEOF
17937 #line 17937 "configure"
17938 #include "confdefs.h"
17939
17940 #include <stdlib.h>
17941 #include <${cf_cv_ncurses_header:-curses.h}>
17942 int
17943 main (void)
17944 {
17945
17946 #if defined(NCURSES_VERSION_PATCH)
17947 #if (NCURSES_VERSION_PATCH < 20100501) && (NCURSES_VERSION_PATCH >= 20100403)
17948         make an error
17949 #endif
17950 #endif
17951 #ifdef NCURSES_VERSION
17952         cchar_t check;
17953         int check2 = curs_set((int)sizeof(check));
17954 #endif
17955         long x = winnstr(stdscr, "", 0);
17956         int x1, y1;
17957 #ifdef NCURSES_VERSION
17958         (void)check2;
17959 #endif
17960         getbegyx(stdscr, y1, x1);
17961         (void)x;
17962         (void)y1;
17963         (void)x1;
17964
17965   ;
17966   return 0;
17967 }
17968 _ACEOF
17969 rm -f conftest.$ac_objext conftest$ac_exeext
17970 if { (eval echo "$as_me:17970: \"$ac_link\"") >&5
17971   (eval $ac_link) 2>&5
17972   ac_status=$?
17973   echo "$as_me:17973: \$? = $ac_status" >&5
17974   (exit $ac_status); } &&
17975          { ac_try='test -s conftest$ac_exeext'
17976   { (eval echo "$as_me:17976: \"$ac_try\"") >&5
17977   (eval $ac_try) 2>&5
17978   ac_status=$?
17979   echo "$as_me:17979: \$? = $ac_status" >&5
17980   (exit $ac_status); }; }; then
17981   cf_cv_need_xopen_extension=none
17982 else
17983   echo "$as_me: failed program was:" >&5
17984 cat conftest.$ac_ext >&5
17985
17986         for cf_try_xopen_extension in _XOPEN_SOURCE_EXTENDED NCURSES_WIDECHAR
17987         do
17988                 cat >conftest.$ac_ext <<_ACEOF
17989 #line 17989 "configure"
17990 #include "confdefs.h"
17991
17992 #define $cf_try_xopen_extension 1
17993 #include <stdlib.h>
17994 #include <${cf_cv_ncurses_header:-curses.h}>
17995 int
17996 main (void)
17997 {
17998
17999 #ifdef NCURSES_VERSION
18000                 cchar_t check;
18001                 int check2 = curs_set((int)sizeof(check));
18002 #endif
18003                 long x = winnstr(stdscr, "", 0);
18004                 int x1, y1;
18005                 getbegyx(stdscr, y1, x1);
18006 #ifdef NCURSES_VERSION
18007                 (void)check2;
18008 #endif
18009                 (void)x;
18010                 (void)y1;
18011                 (void)x1;
18012
18013   ;
18014   return 0;
18015 }
18016 _ACEOF
18017 rm -f conftest.$ac_objext conftest$ac_exeext
18018 if { (eval echo "$as_me:18018: \"$ac_link\"") >&5
18019   (eval $ac_link) 2>&5
18020   ac_status=$?
18021   echo "$as_me:18021: \$? = $ac_status" >&5
18022   (exit $ac_status); } &&
18023          { ac_try='test -s conftest$ac_exeext'
18024   { (eval echo "$as_me:18024: \"$ac_try\"") >&5
18025   (eval $ac_try) 2>&5
18026   ac_status=$?
18027   echo "$as_me:18027: \$? = $ac_status" >&5
18028   (exit $ac_status); }; }; then
18029   cf_cv_need_xopen_extension=$cf_try_xopen_extension; break
18030 else
18031   echo "$as_me: failed program was:" >&5
18032 cat conftest.$ac_ext >&5
18033 fi
18034 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
18035         done
18036
18037 fi
18038 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
18039
18040 fi
18041 echo "$as_me:18041: result: $cf_cv_need_xopen_extension" >&5
18042 echo "${ECHO_T}$cf_cv_need_xopen_extension" >&6
18043
18044 case $cf_cv_need_xopen_extension in
18045 (*_*)
18046
18047         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
18048         CPPFLAGS="${CPPFLAGS}-D$cf_cv_need_xopen_extension"
18049
18050         ;;
18051 esac
18052
18053 echo "$as_me:18053: checking for term.h" >&5
18054 echo $ECHO_N "checking for term.h... $ECHO_C" >&6
18055 if test "${cf_cv_term_header+set}" = set; then
18056   echo $ECHO_N "(cached) $ECHO_C" >&6
18057 else
18058
18059 # If we found <ncurses/curses.h>, look for <ncurses/term.h>, but always look
18060 # for <term.h> if we do not find the variant.
18061
18062 cf_header_list="term.h ncurses/term.h ncursesw/term.h"
18063
18064 case ${cf_cv_ncurses_header:-curses.h} in
18065 (*/*)
18066         cf_header_item=`echo ${cf_cv_ncurses_header:-curses.h} | sed -e 's%\..*%%' -e 's%/.*%/%'`term.h
18067         cf_header_list="$cf_header_item $cf_header_list"
18068         ;;
18069 esac
18070
18071 for cf_header in $cf_header_list
18072 do
18073         cat >conftest.$ac_ext <<_ACEOF
18074 #line 18074 "configure"
18075 #include "confdefs.h"
18076
18077 #include <${cf_cv_ncurses_header:-curses.h}>
18078 #include <${cf_header}>
18079 int
18080 main (void)
18081 {
18082 WINDOW *x; (void)x
18083   ;
18084   return 0;
18085 }
18086 _ACEOF
18087 rm -f conftest.$ac_objext
18088 if { (eval echo "$as_me:18088: \"$ac_compile\"") >&5
18089   (eval $ac_compile) 2>&5
18090   ac_status=$?
18091   echo "$as_me:18091: \$? = $ac_status" >&5
18092   (exit $ac_status); } &&
18093          { ac_try='test -s conftest.$ac_objext'
18094   { (eval echo "$as_me:18094: \"$ac_try\"") >&5
18095   (eval $ac_try) 2>&5
18096   ac_status=$?
18097   echo "$as_me:18097: \$? = $ac_status" >&5
18098   (exit $ac_status); }; }; then
18099   cf_cv_term_header=$cf_header
18100          break
18101 else
18102   echo "$as_me: failed program was:" >&5
18103 cat conftest.$ac_ext >&5
18104 cf_cv_term_header=no
18105 fi
18106 rm -f conftest.$ac_objext conftest.$ac_ext
18107 done
18108
18109 case $cf_cv_term_header in
18110 (no)
18111         # If curses is ncurses, some packagers still mess it up by trying to make
18112         # us use GNU termcap.  This handles the most common case.
18113         for cf_header in ncurses/term.h ncursesw/term.h
18114         do
18115                 cat >conftest.$ac_ext <<_ACEOF
18116 #line 18116 "configure"
18117 #include "confdefs.h"
18118
18119 #include <${cf_cv_ncurses_header:-curses.h}>
18120 #ifdef NCURSES_VERSION
18121 #include <${cf_header}>
18122 #else
18123 make an error
18124 #endif
18125 int
18126 main (void)
18127 {
18128 WINDOW *x; (void)x
18129   ;
18130   return 0;
18131 }
18132 _ACEOF
18133 rm -f conftest.$ac_objext
18134 if { (eval echo "$as_me:18134: \"$ac_compile\"") >&5
18135   (eval $ac_compile) 2>&5
18136   ac_status=$?
18137   echo "$as_me:18137: \$? = $ac_status" >&5
18138   (exit $ac_status); } &&
18139          { ac_try='test -s conftest.$ac_objext'
18140   { (eval echo "$as_me:18140: \"$ac_try\"") >&5
18141   (eval $ac_try) 2>&5
18142   ac_status=$?
18143   echo "$as_me:18143: \$? = $ac_status" >&5
18144   (exit $ac_status); }; }; then
18145   cf_cv_term_header=$cf_header
18146                          break
18147 else
18148   echo "$as_me: failed program was:" >&5
18149 cat conftest.$ac_ext >&5
18150 cf_cv_term_header=no
18151 fi
18152 rm -f conftest.$ac_objext conftest.$ac_ext
18153         done
18154         ;;
18155 esac
18156
18157 fi
18158 echo "$as_me:18158: result: $cf_cv_term_header" >&5
18159 echo "${ECHO_T}$cf_cv_term_header" >&6
18160
18161 case $cf_cv_term_header in
18162 (term.h)
18163
18164 cat >>confdefs.h <<\EOF
18165 #define HAVE_TERM_H 1
18166 EOF
18167
18168         ;;
18169 (ncurses/term.h)
18170
18171 cat >>confdefs.h <<\EOF
18172 #define HAVE_NCURSES_TERM_H 1
18173 EOF
18174
18175         ;;
18176 (ncursesw/term.h)
18177
18178 cat >>confdefs.h <<\EOF
18179 #define HAVE_NCURSESW_TERM_H 1
18180 EOF
18181
18182         ;;
18183 esac
18184
18185 echo "$as_me:18185: checking for unctrl.h" >&5
18186 echo $ECHO_N "checking for unctrl.h... $ECHO_C" >&6
18187 if test "${cf_cv_unctrl_header+set}" = set; then
18188   echo $ECHO_N "(cached) $ECHO_C" >&6
18189 else
18190
18191 # If we found <ncurses/curses.h>, look for <ncurses/unctrl.h>, but always look
18192 # for <unctrl.h> if we do not find the variant.
18193
18194 cf_header_list="unctrl.h ncurses/unctrl.h ncursesw/unctrl.h"
18195
18196 case ${cf_cv_ncurses_header:-curses.h} in
18197 (*/*)
18198         cf_header_item=`echo ${cf_cv_ncurses_header:-curses.h} | sed -e 's%\..*%%' -e 's%/.*%/%'`unctrl.h
18199         cf_header_list="$cf_header_item $cf_header_list"
18200         ;;
18201 esac
18202
18203 for cf_header in $cf_header_list
18204 do
18205         cat >conftest.$ac_ext <<_ACEOF
18206 #line 18206 "configure"
18207 #include "confdefs.h"
18208
18209 #include <${cf_cv_ncurses_header:-curses.h}>
18210 #include <${cf_header}>
18211 int
18212 main (void)
18213 {
18214 WINDOW *x; (void)x
18215   ;
18216   return 0;
18217 }
18218 _ACEOF
18219 rm -f conftest.$ac_objext
18220 if { (eval echo "$as_me:18220: \"$ac_compile\"") >&5
18221   (eval $ac_compile) 2>&5
18222   ac_status=$?
18223   echo "$as_me:18223: \$? = $ac_status" >&5
18224   (exit $ac_status); } &&
18225          { ac_try='test -s conftest.$ac_objext'
18226   { (eval echo "$as_me:18226: \"$ac_try\"") >&5
18227   (eval $ac_try) 2>&5
18228   ac_status=$?
18229   echo "$as_me:18229: \$? = $ac_status" >&5
18230   (exit $ac_status); }; }; then
18231   cf_cv_unctrl_header=$cf_header
18232          break
18233 else
18234   echo "$as_me: failed program was:" >&5
18235 cat conftest.$ac_ext >&5
18236 cf_cv_unctrl_header=no
18237 fi
18238 rm -f conftest.$ac_objext conftest.$ac_ext
18239 done
18240
18241 fi
18242 echo "$as_me:18242: result: $cf_cv_unctrl_header" >&5
18243 echo "${ECHO_T}$cf_cv_unctrl_header" >&6
18244
18245 case $cf_cv_unctrl_header in
18246 (no)
18247         { echo "$as_me:18247: WARNING: unctrl.h header not found" >&5
18248 echo "$as_me: WARNING: unctrl.h header not found" >&2;}
18249         ;;
18250 esac
18251
18252 case $cf_cv_unctrl_header in
18253 (unctrl.h)
18254
18255 cat >>confdefs.h <<\EOF
18256 #define HAVE_UNCTRL_H 1
18257 EOF
18258
18259         ;;
18260 (ncurses/unctrl.h)
18261
18262 cat >>confdefs.h <<\EOF
18263 #define HAVE_NCURSES_UNCTRL_H 1
18264 EOF
18265
18266         ;;
18267 (ncursesw/unctrl.h)
18268
18269 cat >>confdefs.h <<\EOF
18270 #define HAVE_NCURSESW_UNCTRL_H 1
18271 EOF
18272
18273         ;;
18274 esac
18275
18276 for cf_func in \
18277 alloc_pair \
18278 assume_default_colors \
18279 chgat \
18280 color_content \
18281 color_set \
18282 copywin \
18283 delscreen \
18284 dupwin \
18285 exit_curses \
18286 exit_terminfo \
18287 filter \
18288 getbegx \
18289 getcurx \
18290 getmaxx \
18291 getnstr \
18292 getparx \
18293 getwin \
18294 halfdelay \
18295 init_extended_color \
18296 mvderwin \
18297 mvvline \
18298 mvwin \
18299 mvwvline \
18300 napms \
18301 newpad \
18302 putwin \
18303 reset_color_pairs \
18304 resize_term \
18305 resizeterm \
18306 restartterm \
18307 ripoffline \
18308 scr_dump \
18309 setupterm \
18310 slk_color \
18311 slk_init \
18312 termattrs \
18313 termname \
18314 tgetent \
18315 tigetnum \
18316 tigetstr \
18317 tputs_sp \
18318 typeahead \
18319 use_default_colors \
18320 use_env \
18321 use_extended_names \
18322 use_screen \
18323 use_window \
18324 vid_puts \
18325 vidputs \
18326 vsscanf \
18327 vw_printw \
18328 wchgat \
18329 winsdelln \
18330 winsstr \
18331 wresize \
18332 wsyncdown \
18333 _tracef \
18334
18335 do
18336
18337 cf_tr_func=`echo "$cf_func" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
18338
18339         echo "$as_me:18339: checking for ${cf_func}" >&5
18340 echo $ECHO_N "checking for ${cf_func}... $ECHO_C" >&6
18341
18342 echo "${as_me:-configure}:18342: testing ${cf_func} ..." 1>&5
18343
18344         if eval "test \"\${cf_cv_func_$cf_func+set}\" = set"; then
18345   echo $ECHO_N "(cached) $ECHO_C" >&6
18346 else
18347
18348                 eval cf_result='$ac_cv_func_'$cf_func
18349                 if test ".$cf_result" != ".no"; then
18350                         cat >conftest.$ac_ext <<_ACEOF
18351 #line 18351 "configure"
18352 #include "confdefs.h"
18353
18354 #ifdef HAVE_XCURSES
18355 #include <xcurses.h>
18356 char * XCursesProgramName = "test";
18357 #else
18358 #include <${cf_cv_ncurses_header:-curses.h}>
18359 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
18360 #include <ncursesw/term.h>
18361 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
18362 #include <ncurses/term.h>
18363 #elif defined(HAVE_TERM_H)
18364 #include <term.h>
18365 #endif
18366 #endif
18367
18368 int
18369 main (void)
18370 {
18371
18372 #ifndef ${cf_func}
18373 long foo = (long)(&${cf_func});
18374 fprintf(stderr, "testing linkage of $cf_func:%p\n", (void *)foo);
18375 if (foo + 1234L > 5678L)
18376         ${cf_cv_main_return:-return}(foo != 0);
18377 #endif
18378
18379   ;
18380   return 0;
18381 }
18382 _ACEOF
18383 rm -f conftest.$ac_objext conftest$ac_exeext
18384 if { (eval echo "$as_me:18384: \"$ac_link\"") >&5
18385   (eval $ac_link) 2>&5
18386   ac_status=$?
18387   echo "$as_me:18387: \$? = $ac_status" >&5
18388   (exit $ac_status); } &&
18389          { ac_try='test -s conftest$ac_exeext'
18390   { (eval echo "$as_me:18390: \"$ac_try\"") >&5
18391   (eval $ac_try) 2>&5
18392   ac_status=$?
18393   echo "$as_me:18393: \$? = $ac_status" >&5
18394   (exit $ac_status); }; }; then
18395   cf_result=yes
18396 else
18397   echo "$as_me: failed program was:" >&5
18398 cat conftest.$ac_ext >&5
18399 cf_result=no
18400 fi
18401 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
18402                 fi
18403                 eval 'cf_cv_func_'$cf_func'=$cf_result'
18404
18405 fi
18406
18407         # use the computed/retrieved cache-value:
18408         eval 'cf_result=$cf_cv_func_'$cf_func
18409         echo "$as_me:18409: result: $cf_result" >&5
18410 echo "${ECHO_T}$cf_result" >&6
18411         if test $cf_result != no; then
18412                 cat >>confdefs.h <<EOF
18413 #define HAVE_${cf_tr_func} 1
18414 EOF
18415
18416         fi
18417 done
18418
18419 for cf_func in tputs
18420 do
18421
18422 cf_tr_func=`echo "$cf_func" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
18423
18424         echo "$as_me:18424: checking for ${cf_func}" >&5
18425 echo $ECHO_N "checking for ${cf_func}... $ECHO_C" >&6
18426
18427 echo "${as_me:-configure}:18427: testing ${cf_func} ..." 1>&5
18428
18429         if eval "test \"\${cf_cv_func_$cf_func+set}\" = set"; then
18430   echo $ECHO_N "(cached) $ECHO_C" >&6
18431 else
18432
18433                 eval cf_result='$ac_cv_func_'$cf_func
18434                 if test ".$cf_result" != ".no"; then
18435                         cat >conftest.$ac_ext <<_ACEOF
18436 #line 18436 "configure"
18437 #include "confdefs.h"
18438
18439 #ifdef HAVE_XCURSES
18440 #include <xcurses.h>
18441 char * XCursesProgramName = "test";
18442 #else
18443 #include <${cf_cv_ncurses_header:-curses.h}>
18444 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
18445 #include <ncursesw/term.h>
18446 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
18447 #include <ncurses/term.h>
18448 #elif defined(HAVE_TERM_H)
18449 #include <term.h>
18450 #endif
18451 #endif
18452
18453 int
18454 main (void)
18455 {
18456
18457 #ifndef ${cf_func}
18458 long foo = (long)(&${cf_func});
18459 fprintf(stderr, "testing linkage of $cf_func:%p\n", (void *)foo);
18460 if (foo + 1234L > 5678L)
18461         ${cf_cv_main_return:-return}(foo != 0);
18462 #endif
18463
18464   ;
18465   return 0;
18466 }
18467 _ACEOF
18468 rm -f conftest.$ac_objext conftest$ac_exeext
18469 if { (eval echo "$as_me:18469: \"$ac_link\"") >&5
18470   (eval $ac_link) 2>&5
18471   ac_status=$?
18472   echo "$as_me:18472: \$? = $ac_status" >&5
18473   (exit $ac_status); } &&
18474          { ac_try='test -s conftest$ac_exeext'
18475   { (eval echo "$as_me:18475: \"$ac_try\"") >&5
18476   (eval $ac_try) 2>&5
18477   ac_status=$?
18478   echo "$as_me:18478: \$? = $ac_status" >&5
18479   (exit $ac_status); }; }; then
18480   cf_result=yes
18481 else
18482   echo "$as_me: failed program was:" >&5
18483 cat conftest.$ac_ext >&5
18484 cf_result=no
18485 fi
18486 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
18487                 fi
18488                 eval 'cf_cv_func_'$cf_func'=$cf_result'
18489
18490 fi
18491
18492         # use the computed/retrieved cache-value:
18493         eval 'cf_result=$cf_cv_func_'$cf_func
18494         echo "$as_me:18494: result: $cf_result" >&5
18495 echo "${ECHO_T}$cf_result" >&6
18496         if test $cf_result != no; then
18497                 cat >>confdefs.h <<EOF
18498 #define HAVE_${cf_tr_func} 1
18499 EOF
18500
18501         fi
18502 done
18503
18504 if test x$cf_cv_func_tputs = xyes
18505 then
18506         cf_done=no
18507         for cf_arg in int char
18508         do
18509                 for cf_ret in int void
18510                 do
18511                         if test $cf_ret = void
18512                         then
18513                                 cf_return="/* nothing */"
18514                         else
18515                                 cf_return="return value"
18516                         fi
18517                         cat >conftest.$ac_ext <<_ACEOF
18518 #line 18518 "configure"
18519 #include "confdefs.h"
18520
18521 #include <${cf_cv_ncurses_header:-curses.h}>
18522 #include <$cf_cv_term_header>
18523
18524 static $cf_ret outc($cf_arg value) { $cf_return; }
18525
18526 int
18527 main (void)
18528 {
18529
18530         tputs("hello", 0, outc);
18531         ${cf_cv_main_return:-return}(0);
18532
18533   ;
18534   return 0;
18535 }
18536 _ACEOF
18537 rm -f conftest.$ac_objext
18538 if { (eval echo "$as_me:18538: \"$ac_compile\"") >&5
18539   (eval $ac_compile) 2>&5
18540   ac_status=$?
18541   echo "$as_me:18541: \$? = $ac_status" >&5
18542   (exit $ac_status); } &&
18543          { ac_try='test -s conftest.$ac_objext'
18544   { (eval echo "$as_me:18544: \"$ac_try\"") >&5
18545   (eval $ac_try) 2>&5
18546   ac_status=$?
18547   echo "$as_me:18547: \$? = $ac_status" >&5
18548   (exit $ac_status); }; }; then
18549
18550                 test -n "$verbose" && echo "    prototype $cf_ret func($cf_arg value)" 1>&6
18551
18552 echo "${as_me:-configure}:18552: testing prototype $cf_ret func($cf_arg value) ..." 1>&5
18553
18554                 cat >>confdefs.h <<EOF
18555 #define TPUTS_ARG               $cf_arg
18556 #define TPUTS_PROTO(func,value) $cf_ret func(TPUTS_ARG value)
18557 #define TPUTS_RETURN(value)     $cf_return
18558 EOF
18559                 cf_done=yes
18560                 break
18561
18562 else
18563   echo "$as_me: failed program was:" >&5
18564 cat conftest.$ac_ext >&5
18565 fi
18566 rm -f conftest.$ac_objext conftest.$ac_ext
18567                 done
18568                 test $cf_done = yes && break
18569         done
18570 fi
18571
18572 echo "$as_me:18572: checking for ncurses extended functions" >&5
18573 echo $ECHO_N "checking for ncurses extended functions... $ECHO_C" >&6
18574 if test "${cf_cv_ncurses_ext_funcs+set}" = set; then
18575   echo $ECHO_N "(cached) $ECHO_C" >&6
18576 else
18577
18578 cat >conftest.$ac_ext <<_ACEOF
18579 #line 18579 "configure"
18580 #include "confdefs.h"
18581
18582 #include <${cf_cv_ncurses_header:-curses.h}>
18583 int
18584 main (void)
18585 {
18586
18587 int x = NCURSES_EXT_FUNCS
18588
18589   ;
18590   return 0;
18591 }
18592 _ACEOF
18593 rm -f conftest.$ac_objext
18594 if { (eval echo "$as_me:18594: \"$ac_compile\"") >&5
18595   (eval $ac_compile) 2>&5
18596   ac_status=$?
18597   echo "$as_me:18597: \$? = $ac_status" >&5
18598   (exit $ac_status); } &&
18599          { ac_try='test -s conftest.$ac_objext'
18600   { (eval echo "$as_me:18600: \"$ac_try\"") >&5
18601   (eval $ac_try) 2>&5
18602   ac_status=$?
18603   echo "$as_me:18603: \$? = $ac_status" >&5
18604   (exit $ac_status); }; }; then
18605   cf_cv_ncurses_ext_funcs=defined
18606 else
18607   echo "$as_me: failed program was:" >&5
18608 cat conftest.$ac_ext >&5
18609
18610 cat >conftest.$ac_ext <<_ACEOF
18611 #line 18611 "configure"
18612 #include "confdefs.h"
18613
18614 #include <${cf_cv_ncurses_header:-curses.h}>
18615 int
18616 main (void)
18617 {
18618
18619         (void) assume_default_colors (0, 0);
18620         (void) curses_version ();
18621         (void) define_key (0, 0);
18622         (void) is_term_resized (0, 0);
18623         (void) key_defined (0);
18624         (void) keybound (0, 0);
18625         (void) keyok (0, 0);
18626         (void) resize_term (0, 0);
18627         (void) resizeterm (0, 0);
18628         (void) use_default_colors ();
18629         (void) use_extended_names (0);
18630         (void) wresize (0, 0, 0);
18631   ;
18632   return 0;
18633 }
18634 _ACEOF
18635 rm -f conftest.$ac_objext conftest$ac_exeext
18636 if { (eval echo "$as_me:18636: \"$ac_link\"") >&5
18637   (eval $ac_link) 2>&5
18638   ac_status=$?
18639   echo "$as_me:18639: \$? = $ac_status" >&5
18640   (exit $ac_status); } &&
18641          { ac_try='test -s conftest$ac_exeext'
18642   { (eval echo "$as_me:18642: \"$ac_try\"") >&5
18643   (eval $ac_try) 2>&5
18644   ac_status=$?
18645   echo "$as_me:18645: \$? = $ac_status" >&5
18646   (exit $ac_status); }; }; then
18647   cf_cv_ncurses_ext_funcs=yes
18648 else
18649   echo "$as_me: failed program was:" >&5
18650 cat conftest.$ac_ext >&5
18651 cf_cv_ncurses_ext_funcs=no
18652 fi
18653 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
18654
18655 fi
18656 rm -f conftest.$ac_objext conftest.$ac_ext
18657
18658 fi
18659 echo "$as_me:18659: result: $cf_cv_ncurses_ext_funcs" >&5
18660 echo "${ECHO_T}$cf_cv_ncurses_ext_funcs" >&6
18661 test "$cf_cv_ncurses_ext_funcs" = yes &&
18662 cat >>confdefs.h <<\EOF
18663 #define NCURSES_EXT_FUNCS 1
18664 EOF
18665
18666 if test "$cf_enable_widec" = yes
18667 then
18668         # workaround for systems with ncurses before 20111029, due to change of
18669         # feature test macro from _XPG5 to _XOPEN_SOURCE
18670         if test -n "$cf_cv_ncurses_version" && test "x$cf_cv_ncurses_version" != xno
18671         then
18672                 cf_define_xpg5=no
18673                 echo "$as_me:18673: checking if _XPG5 should be defined to enable wide-characters" >&5
18674 echo $ECHO_N "checking if _XPG5 should be defined to enable wide-characters... $ECHO_C" >&6
18675
18676                 cat >conftest.$ac_ext <<_ACEOF
18677 #line 18677 "configure"
18678 #include "confdefs.h"
18679
18680 #include <${cf_cv_ncurses_header:-curses.h}>
18681 int
18682 main (void)
18683 {
18684 int x = _XPG5
18685   ;
18686   return 0;
18687 }
18688 _ACEOF
18689 rm -f conftest.$ac_objext
18690 if { (eval echo "$as_me:18690: \"$ac_compile\"") >&5
18691   (eval $ac_compile) 2>&5
18692   ac_status=$?
18693   echo "$as_me:18693: \$? = $ac_status" >&5
18694   (exit $ac_status); } &&
18695          { ac_try='test -s conftest.$ac_objext'
18696   { (eval echo "$as_me:18696: \"$ac_try\"") >&5
18697   (eval $ac_try) 2>&5
18698   ac_status=$?
18699   echo "$as_me:18699: \$? = $ac_status" >&5
18700   (exit $ac_status); }; }; then
18701   :
18702 else
18703   echo "$as_me: failed program was:" >&5
18704 cat conftest.$ac_ext >&5
18705 cf_save_cppflags="$CPPFLAGS"
18706                          CPPFLAGS="$CPPFLAGS -D_XPG5"
18707                          cat >conftest.$ac_ext <<_ACEOF
18708 #line 18708 "configure"
18709 #include "confdefs.h"
18710
18711 #include <${cf_cv_ncurses_header:-curses.h}>
18712 int
18713 main (void)
18714 {
18715 int x = _XPG5
18716   ;
18717   return 0;
18718 }
18719 _ACEOF
18720 rm -f conftest.$ac_objext
18721 if { (eval echo "$as_me:18721: \"$ac_compile\"") >&5
18722   (eval $ac_compile) 2>&5
18723   ac_status=$?
18724   echo "$as_me:18724: \$? = $ac_status" >&5
18725   (exit $ac_status); } &&
18726          { ac_try='test -s conftest.$ac_objext'
18727   { (eval echo "$as_me:18727: \"$ac_try\"") >&5
18728   (eval $ac_try) 2>&5
18729   ac_status=$?
18730   echo "$as_me:18730: \$? = $ac_status" >&5
18731   (exit $ac_status); }; }; then
18732   cf_define_xpg5=yes
18733 else
18734   echo "$as_me: failed program was:" >&5
18735 cat conftest.$ac_ext >&5
18736 fi
18737 rm -f conftest.$ac_objext conftest.$ac_ext
18738                          CPPFLAGS="$cf_save_cppflags"
18739 fi
18740 rm -f conftest.$ac_objext conftest.$ac_ext
18741                 echo "$as_me:18741: result: $cf_define_xpg5" >&5
18742 echo "${ECHO_T}$cf_define_xpg5" >&6
18743
18744                 if test "$cf_define_xpg5" = yes
18745                 then
18746                         CPPFLAGS="$CPPFLAGS -D_XPG5"
18747                 fi
18748         fi
18749
18750         echo "$as_me:18750: checking for wide-character functions" >&5
18751 echo $ECHO_N "checking for wide-character functions... $ECHO_C" >&6
18752 if test "${cf_cv_widechar_funcs+set}" = set; then
18753   echo $ECHO_N "(cached) $ECHO_C" >&6
18754 else
18755
18756         cat >conftest.$ac_ext <<_ACEOF
18757 #line 18757 "configure"
18758 #include "confdefs.h"
18759
18760 #include <${cf_cv_ncurses_header:-curses.h}>
18761 int
18762 main (void)
18763 {
18764
18765                 static wchar_t src_wchar[2];
18766                 static cchar_t dst_cchar;
18767                 setcchar(&dst_cchar, src_wchar, A_NORMAL, 0, (void *) 0);
18768
18769   ;
18770   return 0;
18771 }
18772 _ACEOF
18773 rm -f conftest.$ac_objext conftest$ac_exeext
18774 if { (eval echo "$as_me:18774: \"$ac_link\"") >&5
18775   (eval $ac_link) 2>&5
18776   ac_status=$?
18777   echo "$as_me:18777: \$? = $ac_status" >&5
18778   (exit $ac_status); } &&
18779          { ac_try='test -s conftest$ac_exeext'
18780   { (eval echo "$as_me:18780: \"$ac_try\"") >&5
18781   (eval $ac_try) 2>&5
18782   ac_status=$?
18783   echo "$as_me:18783: \$? = $ac_status" >&5
18784   (exit $ac_status); }; }; then
18785   cf_cv_widechar_funcs=yes
18786 else
18787   echo "$as_me: failed program was:" >&5
18788 cat conftest.$ac_ext >&5
18789 cf_cv_widechar_funcs=no
18790 fi
18791 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
18792
18793 fi
18794 echo "$as_me:18794: result: $cf_cv_widechar_funcs" >&5
18795 echo "${ECHO_T}$cf_cv_widechar_funcs" >&6
18796         if test "$cf_cv_widechar_funcs" != no ; then
18797
18798 cat >>confdefs.h <<\EOF
18799 #define USE_WIDEC_SUPPORT 1
18800 EOF
18801
18802         else
18803                 cat >>confdefs.h <<\EOF
18804 #define USE_WIDEC_SUPPORT 0
18805 EOF
18806
18807         fi
18808 else
18809         cat >>confdefs.h <<\EOF
18810 #define USE_WIDEC_SUPPORT 0
18811 EOF
18812
18813 fi
18814
18815 echo "$as_me:18815: checking if $cf_cv_screen library uses pthreads" >&5
18816 echo $ECHO_N "checking if $cf_cv_screen library uses pthreads... $ECHO_C" >&6
18817 if test "${cf_cv_use_pthreads+set}" = set; then
18818   echo $ECHO_N "(cached) $ECHO_C" >&6
18819 else
18820
18821 cat >conftest.$ac_ext <<_ACEOF
18822 #line 18822 "configure"
18823 #include "confdefs.h"
18824
18825 #include <${cf_cv_ncurses_header:-curses.h}>
18826 extern void _nc_init_pthreads(void);
18827
18828 int
18829 main (void)
18830 {
18831
18832         initscr();
18833         _nc_init_pthreads();
18834
18835   ;
18836   return 0;
18837 }
18838 _ACEOF
18839 rm -f conftest.$ac_objext conftest$ac_exeext
18840 if { (eval echo "$as_me:18840: \"$ac_link\"") >&5
18841   (eval $ac_link) 2>&5
18842   ac_status=$?
18843   echo "$as_me:18843: \$? = $ac_status" >&5
18844   (exit $ac_status); } &&
18845          { ac_try='test -s conftest$ac_exeext'
18846   { (eval echo "$as_me:18846: \"$ac_try\"") >&5
18847   (eval $ac_try) 2>&5
18848   ac_status=$?
18849   echo "$as_me:18849: \$? = $ac_status" >&5
18850   (exit $ac_status); }; }; then
18851   cf_cv_use_pthreads=yes
18852 else
18853   echo "$as_me: failed program was:" >&5
18854 cat conftest.$ac_ext >&5
18855 cf_cv_use_pthreads=no
18856 fi
18857 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
18858
18859 fi
18860 echo "$as_me:18860: result: $cf_cv_use_pthreads" >&5
18861 echo "${ECHO_T}$cf_cv_use_pthreads" >&6
18862 test $cf_cv_use_pthreads = yes &&
18863 cat >>confdefs.h <<\EOF
18864 #define USE_PTHREADS 1
18865 EOF
18866
18867 echo "$as_me:18867: checking if sys/time.h works with sys/select.h" >&5
18868 echo $ECHO_N "checking if sys/time.h works with sys/select.h... $ECHO_C" >&6
18869 if test "${cf_cv_sys_time_select+set}" = set; then
18870   echo $ECHO_N "(cached) $ECHO_C" >&6
18871 else
18872
18873 cat >conftest.$ac_ext <<_ACEOF
18874 #line 18874 "configure"
18875 #include "confdefs.h"
18876
18877 #include <sys/types.h>
18878 #ifdef HAVE_SYS_TIME_H
18879 #include <sys/time.h>
18880 #endif
18881 #ifdef HAVE_SYS_SELECT_H
18882 #include <sys/select.h>
18883 #endif
18884
18885 int
18886 main (void)
18887 {
18888
18889   ;
18890   return 0;
18891 }
18892 _ACEOF
18893 rm -f conftest.$ac_objext
18894 if { (eval echo "$as_me:18894: \"$ac_compile\"") >&5
18895   (eval $ac_compile) 2>&5
18896   ac_status=$?
18897   echo "$as_me:18897: \$? = $ac_status" >&5
18898   (exit $ac_status); } &&
18899          { ac_try='test -s conftest.$ac_objext'
18900   { (eval echo "$as_me:18900: \"$ac_try\"") >&5
18901   (eval $ac_try) 2>&5
18902   ac_status=$?
18903   echo "$as_me:18903: \$? = $ac_status" >&5
18904   (exit $ac_status); }; }; then
18905   cf_cv_sys_time_select=yes
18906 else
18907   echo "$as_me: failed program was:" >&5
18908 cat conftest.$ac_ext >&5
18909 cf_cv_sys_time_select=no
18910 fi
18911 rm -f conftest.$ac_objext conftest.$ac_ext
18912
18913 fi
18914
18915 echo "$as_me:18915: result: $cf_cv_sys_time_select" >&5
18916 echo "${ECHO_T}$cf_cv_sys_time_select" >&6
18917 test "$cf_cv_sys_time_select" = yes &&
18918 cat >>confdefs.h <<\EOF
18919 #define HAVE_SYS_TIME_SELECT 1
18920 EOF
18921
18922 # special check for test/ditto.c
18923
18924 echo "$as_me:18924: checking for openpty in -lutil" >&5
18925 echo $ECHO_N "checking for openpty in -lutil... $ECHO_C" >&6
18926 if test "${ac_cv_lib_util_openpty+set}" = set; then
18927   echo $ECHO_N "(cached) $ECHO_C" >&6
18928 else
18929   ac_check_lib_save_LIBS=$LIBS
18930 LIBS="-lutil  $LIBS"
18931 cat >conftest.$ac_ext <<_ACEOF
18932 #line 18932 "configure"
18933 #include "confdefs.h"
18934
18935 /* Override any gcc2 internal prototype to avoid an error.  */
18936 #ifdef __cplusplus
18937 extern "C"
18938 #endif
18939 /* We use char because int might match the return type of a gcc2
18940    builtin and then its argument prototype would still apply.  */
18941 char openpty ();
18942 int
18943 main (void)
18944 {
18945 openpty ();
18946   ;
18947   return 0;
18948 }
18949 _ACEOF
18950 rm -f conftest.$ac_objext conftest$ac_exeext
18951 if { (eval echo "$as_me:18951: \"$ac_link\"") >&5
18952   (eval $ac_link) 2>&5
18953   ac_status=$?
18954   echo "$as_me:18954: \$? = $ac_status" >&5
18955   (exit $ac_status); } &&
18956          { ac_try='test -s conftest$ac_exeext'
18957   { (eval echo "$as_me:18957: \"$ac_try\"") >&5
18958   (eval $ac_try) 2>&5
18959   ac_status=$?
18960   echo "$as_me:18960: \$? = $ac_status" >&5
18961   (exit $ac_status); }; }; then
18962   ac_cv_lib_util_openpty=yes
18963 else
18964   echo "$as_me: failed program was:" >&5
18965 cat conftest.$ac_ext >&5
18966 ac_cv_lib_util_openpty=no
18967 fi
18968 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
18969 LIBS=$ac_check_lib_save_LIBS
18970 fi
18971 echo "$as_me:18971: result: $ac_cv_lib_util_openpty" >&5
18972 echo "${ECHO_T}$ac_cv_lib_util_openpty" >&6
18973 if test $ac_cv_lib_util_openpty = yes; then
18974   cf_cv_lib_util=yes
18975 else
18976   cf_cv_lib_util=no
18977 fi
18978
18979 echo "$as_me:18979: checking for openpty header" >&5
18980 echo $ECHO_N "checking for openpty header... $ECHO_C" >&6
18981 if test "${cf_cv_func_openpty+set}" = set; then
18982   echo $ECHO_N "(cached) $ECHO_C" >&6
18983 else
18984
18985         cf_save_LIBS="$LIBS"
18986         test $cf_cv_lib_util = yes && {
18987 cf_add_libs="$LIBS"
18988 # reverse order
18989 cf_add_0lib=
18990 for cf_add_1lib in -lutil; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
18991 # filter duplicates
18992 for cf_add_1lib in $cf_add_0lib; do
18993         for cf_add_2lib in $cf_add_libs; do
18994                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
18995                         cf_add_1lib=
18996                         break
18997                 fi
18998         done
18999         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
19000 done
19001 LIBS="$cf_add_libs"
19002  }
19003         for cf_header in pty.h libutil.h util.h
19004         do
19005         cat >conftest.$ac_ext <<_ACEOF
19006 #line 19006 "configure"
19007 #include "confdefs.h"
19008
19009 #include <$cf_header>
19010
19011 int
19012 main (void)
19013 {
19014
19015         int x = openpty((int *)0, (int *)0, (char *)0,
19016                                    (struct termios *)0, (struct winsize *)0);
19017
19018   ;
19019   return 0;
19020 }
19021 _ACEOF
19022 rm -f conftest.$ac_objext conftest$ac_exeext
19023 if { (eval echo "$as_me:19023: \"$ac_link\"") >&5
19024   (eval $ac_link) 2>&5
19025   ac_status=$?
19026   echo "$as_me:19026: \$? = $ac_status" >&5
19027   (exit $ac_status); } &&
19028          { ac_try='test -s conftest$ac_exeext'
19029   { (eval echo "$as_me:19029: \"$ac_try\"") >&5
19030   (eval $ac_try) 2>&5
19031   ac_status=$?
19032   echo "$as_me:19032: \$? = $ac_status" >&5
19033   (exit $ac_status); }; }; then
19034
19035                 cf_cv_func_openpty=$cf_header
19036                 break
19037
19038 else
19039   echo "$as_me: failed program was:" >&5
19040 cat conftest.$ac_ext >&5
19041
19042                 cf_cv_func_openpty=no
19043
19044 fi
19045 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
19046         done
19047         LIBS="$cf_save_LIBS"
19048
19049 fi
19050 echo "$as_me:19050: result: $cf_cv_func_openpty" >&5
19051 echo "${ECHO_T}$cf_cv_func_openpty" >&6
19052
19053 if test "$cf_cv_func_openpty" != no ; then
19054
19055 cat >>confdefs.h <<EOF
19056 #define USE_OPENPTY_HEADER <$cf_cv_func_openpty>
19057 EOF
19058
19059 cat >>confdefs.h <<\EOF
19060 #define USE_XTERM_PTY 1
19061 EOF
19062
19063         if test "x$cf_cv_lib_util" = xyes ; then
19064
19065 cf_add_libs="$TEST_LIBS"
19066 # reverse order
19067 cf_add_0lib=
19068 for cf_add_1lib in -lutil; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
19069 # filter duplicates
19070 for cf_add_1lib in $cf_add_0lib; do
19071         for cf_add_2lib in $cf_add_libs; do
19072                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
19073                         cf_add_1lib=
19074                         break
19075                 fi
19076         done
19077         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
19078 done
19079 TEST_LIBS="$cf_add_libs"
19080
19081         fi
19082 fi
19083
19084 echo "$as_me:19084: checking for function curses_version" >&5
19085 echo $ECHO_N "checking for function curses_version... $ECHO_C" >&6
19086 if test "${cf_cv_func_curses_version+set}" = set; then
19087   echo $ECHO_N "(cached) $ECHO_C" >&6
19088 else
19089
19090 if test "$cross_compiling" = yes; then
19091   cf_cv_func_curses_version=unknown
19092 else
19093   cat >conftest.$ac_ext <<_ACEOF
19094 #line 19094 "configure"
19095 #include "confdefs.h"
19096
19097 #include <${cf_cv_ncurses_header:-curses.h}>
19098 int main(void)
19099 {
19100         char temp[1024];
19101         sprintf(temp, "%s\n", curses_version());
19102         ${cf_cv_main_return:-return}(0);
19103 }
19104
19105 _ACEOF
19106 rm -f conftest$ac_exeext
19107 if { (eval echo "$as_me:19107: \"$ac_link\"") >&5
19108   (eval $ac_link) 2>&5
19109   ac_status=$?
19110   echo "$as_me:19110: \$? = $ac_status" >&5
19111   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
19112   { (eval echo "$as_me:19112: \"$ac_try\"") >&5
19113   (eval $ac_try) 2>&5
19114   ac_status=$?
19115   echo "$as_me:19115: \$? = $ac_status" >&5
19116   (exit $ac_status); }; }; then
19117   cf_cv_func_curses_version=yes
19118
19119 else
19120   echo "$as_me: program exited with status $ac_status" >&5
19121 echo "$as_me: failed program was:" >&5
19122 cat conftest.$ac_ext >&5
19123 cf_cv_func_curses_version=no
19124
19125 fi
19126 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
19127 fi
19128 rm -f core
19129 fi
19130 echo "$as_me:19130: result: $cf_cv_func_curses_version" >&5
19131 echo "${ECHO_T}$cf_cv_func_curses_version" >&6
19132 test "$cf_cv_func_curses_version" = yes &&
19133 cat >>confdefs.h <<\EOF
19134 #define HAVE_CURSES_VERSION 1
19135 EOF
19136
19137 echo "$as_me:19137: checking for alternate character set array" >&5
19138 echo $ECHO_N "checking for alternate character set array... $ECHO_C" >&6
19139 if test "${cf_cv_curses_acs_map+set}" = set; then
19140   echo $ECHO_N "(cached) $ECHO_C" >&6
19141 else
19142
19143 cf_cv_curses_acs_map=unknown
19144 for name in acs_map _acs_map __acs_map ${NCURSES_WRAP_PREFIX}acs_map
19145 do
19146 cat >conftest.$ac_ext <<_ACEOF
19147 #line 19147 "configure"
19148 #include "confdefs.h"
19149
19150 #include <${cf_cv_ncurses_header:-curses.h}>
19151
19152 int
19153 main (void)
19154 {
19155
19156 $name['k'] = ACS_PLUS
19157
19158   ;
19159   return 0;
19160 }
19161 _ACEOF
19162 rm -f conftest.$ac_objext conftest$ac_exeext
19163 if { (eval echo "$as_me:19163: \"$ac_link\"") >&5
19164   (eval $ac_link) 2>&5
19165   ac_status=$?
19166   echo "$as_me:19166: \$? = $ac_status" >&5
19167   (exit $ac_status); } &&
19168          { ac_try='test -s conftest$ac_exeext'
19169   { (eval echo "$as_me:19169: \"$ac_try\"") >&5
19170   (eval $ac_try) 2>&5
19171   ac_status=$?
19172   echo "$as_me:19172: \$? = $ac_status" >&5
19173   (exit $ac_status); }; }; then
19174   cf_cv_curses_acs_map=$name; break
19175 else
19176   echo "$as_me: failed program was:" >&5
19177 cat conftest.$ac_ext >&5
19178 fi
19179 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
19180 done
19181
19182 fi
19183 echo "$as_me:19183: result: $cf_cv_curses_acs_map" >&5
19184 echo "${ECHO_T}$cf_cv_curses_acs_map" >&6
19185
19186 test "$cf_cv_curses_acs_map" != unknown &&
19187 cat >>confdefs.h <<EOF
19188 #define CURSES_ACS_ARRAY $cf_cv_curses_acs_map
19189 EOF
19190
19191 if test "$cf_enable_widec" = yes; then
19192
19193 echo "$as_me:19193: checking for wide alternate character set array" >&5
19194 echo $ECHO_N "checking for wide alternate character set array... $ECHO_C" >&6
19195 if test "${cf_cv_curses_wacs_map+set}" = set; then
19196   echo $ECHO_N "(cached) $ECHO_C" >&6
19197 else
19198
19199         cf_cv_curses_wacs_map=unknown
19200         for name in wacs_map _wacs_map __wacs_map _nc_wacs _wacs_char
19201         do
19202         cat >conftest.$ac_ext <<_ACEOF
19203 #line 19203 "configure"
19204 #include "confdefs.h"
19205
19206 #ifndef _XOPEN_SOURCE_EXTENDED
19207 #define _XOPEN_SOURCE_EXTENDED
19208 #endif
19209 #include <${cf_cv_ncurses_header:-curses.h}>
19210 int
19211 main (void)
19212 {
19213 void *foo = &($name['k']); (void)foo
19214   ;
19215   return 0;
19216 }
19217 _ACEOF
19218 rm -f conftest.$ac_objext conftest$ac_exeext
19219 if { (eval echo "$as_me:19219: \"$ac_link\"") >&5
19220   (eval $ac_link) 2>&5
19221   ac_status=$?
19222   echo "$as_me:19222: \$? = $ac_status" >&5
19223   (exit $ac_status); } &&
19224          { ac_try='test -s conftest$ac_exeext'
19225   { (eval echo "$as_me:19225: \"$ac_try\"") >&5
19226   (eval $ac_try) 2>&5
19227   ac_status=$?
19228   echo "$as_me:19228: \$? = $ac_status" >&5
19229   (exit $ac_status); }; }; then
19230   cf_cv_curses_wacs_map=$name
19231          break
19232 else
19233   echo "$as_me: failed program was:" >&5
19234 cat conftest.$ac_ext >&5
19235 fi
19236 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
19237         done
19238 fi
19239 echo "$as_me:19239: result: $cf_cv_curses_wacs_map" >&5
19240 echo "${ECHO_T}$cf_cv_curses_wacs_map" >&6
19241
19242 test "$cf_cv_curses_wacs_map" != unknown &&
19243 cat >>confdefs.h <<EOF
19244 #define CURSES_WACS_ARRAY $cf_cv_curses_wacs_map
19245 EOF
19246
19247 echo "$as_me:19247: checking for wide alternate character constants" >&5
19248 echo $ECHO_N "checking for wide alternate character constants... $ECHO_C" >&6
19249 if test "${cf_cv_curses_wacs_symbols+set}" = set; then
19250   echo $ECHO_N "(cached) $ECHO_C" >&6
19251 else
19252
19253 cf_cv_curses_wacs_symbols=no
19254 if test "$cf_cv_curses_wacs_map" != unknown
19255 then
19256         cat >conftest.$ac_ext <<_ACEOF
19257 #line 19257 "configure"
19258 #include "confdefs.h"
19259
19260 #ifndef _XOPEN_SOURCE_EXTENDED
19261 #define _XOPEN_SOURCE_EXTENDED
19262 #endif
19263 #include <${cf_cv_ncurses_header:-curses.h}>
19264 int
19265 main (void)
19266 {
19267 cchar_t *foo = WACS_PLUS;
19268          $cf_cv_curses_wacs_map['k'] = *WACS_PLUS; (void)foo
19269   ;
19270   return 0;
19271 }
19272 _ACEOF
19273 rm -f conftest.$ac_objext conftest$ac_exeext
19274 if { (eval echo "$as_me:19274: \"$ac_link\"") >&5
19275   (eval $ac_link) 2>&5
19276   ac_status=$?
19277   echo "$as_me:19277: \$? = $ac_status" >&5
19278   (exit $ac_status); } &&
19279          { ac_try='test -s conftest$ac_exeext'
19280   { (eval echo "$as_me:19280: \"$ac_try\"") >&5
19281   (eval $ac_try) 2>&5
19282   ac_status=$?
19283   echo "$as_me:19283: \$? = $ac_status" >&5
19284   (exit $ac_status); }; }; then
19285   cf_cv_curses_wacs_symbols=yes
19286 else
19287   echo "$as_me: failed program was:" >&5
19288 cat conftest.$ac_ext >&5
19289 fi
19290 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
19291 else
19292         cat >conftest.$ac_ext <<_ACEOF
19293 #line 19293 "configure"
19294 #include "confdefs.h"
19295
19296 #ifndef _XOPEN_SOURCE_EXTENDED
19297 #define _XOPEN_SOURCE_EXTENDED
19298 #endif
19299 #include <${cf_cv_ncurses_header:-curses.h}>
19300 int
19301 main (void)
19302 {
19303 cchar_t *foo = WACS_PLUS; (void)foo
19304   ;
19305   return 0;
19306 }
19307 _ACEOF
19308 rm -f conftest.$ac_objext conftest$ac_exeext
19309 if { (eval echo "$as_me:19309: \"$ac_link\"") >&5
19310   (eval $ac_link) 2>&5
19311   ac_status=$?
19312   echo "$as_me:19312: \$? = $ac_status" >&5
19313   (exit $ac_status); } &&
19314          { ac_try='test -s conftest$ac_exeext'
19315   { (eval echo "$as_me:19315: \"$ac_try\"") >&5
19316   (eval $ac_try) 2>&5
19317   ac_status=$?
19318   echo "$as_me:19318: \$? = $ac_status" >&5
19319   (exit $ac_status); }; }; then
19320   cf_cv_curses_wacs_symbols=yes
19321 else
19322   echo "$as_me: failed program was:" >&5
19323 cat conftest.$ac_ext >&5
19324 fi
19325 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
19326 fi
19327
19328 fi
19329 echo "$as_me:19329: result: $cf_cv_curses_wacs_symbols" >&5
19330 echo "${ECHO_T}$cf_cv_curses_wacs_symbols" >&6
19331
19332 test "$cf_cv_curses_wacs_symbols" != no &&
19333 cat >>confdefs.h <<\EOF
19334 #define CURSES_WACS_SYMBOLS 1
19335 EOF
19336
19337 fi
19338
19339 echo "$as_me:19339: checking for type attr_t in ${cf_cv_ncurses_header:-curses.h}" >&5
19340 echo $ECHO_N "checking for type attr_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
19341 cat >conftest.$ac_ext <<_ACEOF
19342 #line 19342 "configure"
19343 #include "confdefs.h"
19344
19345 #ifndef _XOPEN_SOURCE_EXTENDED
19346 #define _XOPEN_SOURCE_EXTENDED
19347 #endif
19348 #include <${cf_cv_ncurses_header:-curses.h}>
19349 int
19350 main (void)
19351 {
19352
19353 attr_t foo
19354
19355   ;
19356   return 0;
19357 }
19358 _ACEOF
19359 rm -f conftest.$ac_objext
19360 if { (eval echo "$as_me:19360: \"$ac_compile\"") >&5
19361   (eval $ac_compile) 2>&5
19362   ac_status=$?
19363   echo "$as_me:19363: \$? = $ac_status" >&5
19364   (exit $ac_status); } &&
19365          { ac_try='test -s conftest.$ac_objext'
19366   { (eval echo "$as_me:19366: \"$ac_try\"") >&5
19367   (eval $ac_try) 2>&5
19368   ac_status=$?
19369   echo "$as_me:19369: \$? = $ac_status" >&5
19370   (exit $ac_status); }; }; then
19371   cf_result=yes
19372 else
19373   echo "$as_me: failed program was:" >&5
19374 cat conftest.$ac_ext >&5
19375 cf_result=no
19376 fi
19377 rm -f conftest.$ac_objext conftest.$ac_ext
19378 echo "$as_me:19378: result: $cf_result" >&5
19379 echo "${ECHO_T}$cf_result" >&6
19380 if test $cf_result = yes ; then
19381
19382 cf_result=`echo "have_type_attr_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
19383
19384 cat >>confdefs.h <<EOF
19385 #define $cf_result 1
19386 EOF
19387
19388 else
19389
19390 cat >>confdefs.h <<EOF
19391 #define attr_t long
19392 EOF
19393
19394 fi
19395
19396 if test "$cf_enable_widec" = yes; then
19397
19398 # This is needed on Tru64 5.0 to declare mbstate_t
19399 echo "$as_me:19399: checking if we must include wchar.h to declare mbstate_t" >&5
19400 echo $ECHO_N "checking if we must include wchar.h to declare mbstate_t... $ECHO_C" >&6
19401 if test "${cf_cv_mbstate_t+set}" = set; then
19402   echo $ECHO_N "(cached) $ECHO_C" >&6
19403 else
19404
19405 cat >conftest.$ac_ext <<_ACEOF
19406 #line 19406 "configure"
19407 #include "confdefs.h"
19408
19409 #include <stdlib.h>
19410 #include <stdarg.h>
19411 #include <stdio.h>
19412 #ifdef HAVE_LIBUTF8_H
19413 #include <libutf8.h>
19414 #endif
19415 int
19416 main (void)
19417 {
19418 mbstate_t state
19419   ;
19420   return 0;
19421 }
19422 _ACEOF
19423 rm -f conftest.$ac_objext
19424 if { (eval echo "$as_me:19424: \"$ac_compile\"") >&5
19425   (eval $ac_compile) 2>&5
19426   ac_status=$?
19427   echo "$as_me:19427: \$? = $ac_status" >&5
19428   (exit $ac_status); } &&
19429          { ac_try='test -s conftest.$ac_objext'
19430   { (eval echo "$as_me:19430: \"$ac_try\"") >&5
19431   (eval $ac_try) 2>&5
19432   ac_status=$?
19433   echo "$as_me:19433: \$? = $ac_status" >&5
19434   (exit $ac_status); }; }; then
19435   cf_cv_mbstate_t=no
19436 else
19437   echo "$as_me: failed program was:" >&5
19438 cat conftest.$ac_ext >&5
19439 cat >conftest.$ac_ext <<_ACEOF
19440 #line 19440 "configure"
19441 #include "confdefs.h"
19442
19443 #include <stdlib.h>
19444 #include <stdarg.h>
19445 #include <stdio.h>
19446 #include <wchar.h>
19447 #ifdef HAVE_LIBUTF8_H
19448 #include <libutf8.h>
19449 #endif
19450 int
19451 main (void)
19452 {
19453 mbstate_t value
19454   ;
19455   return 0;
19456 }
19457 _ACEOF
19458 rm -f conftest.$ac_objext
19459 if { (eval echo "$as_me:19459: \"$ac_compile\"") >&5
19460   (eval $ac_compile) 2>&5
19461   ac_status=$?
19462   echo "$as_me:19462: \$? = $ac_status" >&5
19463   (exit $ac_status); } &&
19464          { ac_try='test -s conftest.$ac_objext'
19465   { (eval echo "$as_me:19465: \"$ac_try\"") >&5
19466   (eval $ac_try) 2>&5
19467   ac_status=$?
19468   echo "$as_me:19468: \$? = $ac_status" >&5
19469   (exit $ac_status); }; }; then
19470   cf_cv_mbstate_t=yes
19471 else
19472   echo "$as_me: failed program was:" >&5
19473 cat conftest.$ac_ext >&5
19474 cf_cv_mbstate_t=unknown
19475 fi
19476 rm -f conftest.$ac_objext conftest.$ac_ext
19477 fi
19478 rm -f conftest.$ac_objext conftest.$ac_ext
19479 fi
19480 echo "$as_me:19480: result: $cf_cv_mbstate_t" >&5
19481 echo "${ECHO_T}$cf_cv_mbstate_t" >&6
19482
19483 if test "$cf_cv_mbstate_t" = yes ; then
19484
19485 cat >>confdefs.h <<\EOF
19486 #define NEED_WCHAR_H 1
19487 EOF
19488
19489         NEED_WCHAR_H=1
19490 fi
19491
19492 # if we do not find mbstate_t in either place, use substitution to provide a fallback.
19493 if test "$cf_cv_mbstate_t" = unknown ; then
19494         NCURSES_MBSTATE_T=1
19495 fi
19496
19497 # if we find mbstate_t in either place, use substitution to provide a fallback.
19498 if test "$cf_cv_mbstate_t" != unknown ; then
19499         NCURSES_OK_MBSTATE_T=1
19500 fi
19501
19502 # This is needed on Tru64 5.0 to declare wchar_t
19503 echo "$as_me:19503: checking if we must include wchar.h to declare wchar_t" >&5
19504 echo $ECHO_N "checking if we must include wchar.h to declare wchar_t... $ECHO_C" >&6
19505 if test "${cf_cv_wchar_t+set}" = set; then
19506   echo $ECHO_N "(cached) $ECHO_C" >&6
19507 else
19508
19509 cat >conftest.$ac_ext <<_ACEOF
19510 #line 19510 "configure"
19511 #include "confdefs.h"
19512
19513 #include <stdlib.h>
19514 #include <stdarg.h>
19515 #include <stdio.h>
19516 #ifdef HAVE_LIBUTF8_H
19517 #include <libutf8.h>
19518 #endif
19519 int
19520 main (void)
19521 {
19522 wchar_t state
19523   ;
19524   return 0;
19525 }
19526 _ACEOF
19527 rm -f conftest.$ac_objext
19528 if { (eval echo "$as_me:19528: \"$ac_compile\"") >&5
19529   (eval $ac_compile) 2>&5
19530   ac_status=$?
19531   echo "$as_me:19531: \$? = $ac_status" >&5
19532   (exit $ac_status); } &&
19533          { ac_try='test -s conftest.$ac_objext'
19534   { (eval echo "$as_me:19534: \"$ac_try\"") >&5
19535   (eval $ac_try) 2>&5
19536   ac_status=$?
19537   echo "$as_me:19537: \$? = $ac_status" >&5
19538   (exit $ac_status); }; }; then
19539   cf_cv_wchar_t=no
19540 else
19541   echo "$as_me: failed program was:" >&5
19542 cat conftest.$ac_ext >&5
19543 cat >conftest.$ac_ext <<_ACEOF
19544 #line 19544 "configure"
19545 #include "confdefs.h"
19546
19547 #include <stdlib.h>
19548 #include <stdarg.h>
19549 #include <stdio.h>
19550 #include <wchar.h>
19551 #ifdef HAVE_LIBUTF8_H
19552 #include <libutf8.h>
19553 #endif
19554 int
19555 main (void)
19556 {
19557 wchar_t value
19558   ;
19559   return 0;
19560 }
19561 _ACEOF
19562 rm -f conftest.$ac_objext
19563 if { (eval echo "$as_me:19563: \"$ac_compile\"") >&5
19564   (eval $ac_compile) 2>&5
19565   ac_status=$?
19566   echo "$as_me:19566: \$? = $ac_status" >&5
19567   (exit $ac_status); } &&
19568          { ac_try='test -s conftest.$ac_objext'
19569   { (eval echo "$as_me:19569: \"$ac_try\"") >&5
19570   (eval $ac_try) 2>&5
19571   ac_status=$?
19572   echo "$as_me:19572: \$? = $ac_status" >&5
19573   (exit $ac_status); }; }; then
19574   cf_cv_wchar_t=yes
19575 else
19576   echo "$as_me: failed program was:" >&5
19577 cat conftest.$ac_ext >&5
19578 cf_cv_wchar_t=unknown
19579 fi
19580 rm -f conftest.$ac_objext conftest.$ac_ext
19581 fi
19582 rm -f conftest.$ac_objext conftest.$ac_ext
19583 fi
19584 echo "$as_me:19584: result: $cf_cv_wchar_t" >&5
19585 echo "${ECHO_T}$cf_cv_wchar_t" >&6
19586
19587 if test "$cf_cv_wchar_t" = yes ; then
19588
19589 cat >>confdefs.h <<\EOF
19590 #define NEED_WCHAR_H 1
19591 EOF
19592
19593         NEED_WCHAR_H=1
19594 fi
19595
19596 # if we do not find wchar_t in either place, use substitution to provide a fallback.
19597 if test "$cf_cv_wchar_t" = unknown ; then
19598         NCURSES_WCHAR_T=1
19599 fi
19600
19601 # if we find wchar_t in either place, use substitution to provide a fallback.
19602 if test "$cf_cv_wchar_t" != unknown ; then
19603         NCURSES_OK_WCHAR_T=1
19604 fi
19605
19606 # This is needed on Tru64 5.0 to declare wint_t
19607 echo "$as_me:19607: checking if we must include wchar.h to declare wint_t" >&5
19608 echo $ECHO_N "checking if we must include wchar.h to declare wint_t... $ECHO_C" >&6
19609 if test "${cf_cv_wint_t+set}" = set; then
19610   echo $ECHO_N "(cached) $ECHO_C" >&6
19611 else
19612
19613 cat >conftest.$ac_ext <<_ACEOF
19614 #line 19614 "configure"
19615 #include "confdefs.h"
19616
19617 #include <stdlib.h>
19618 #include <stdarg.h>
19619 #include <stdio.h>
19620 #ifdef HAVE_LIBUTF8_H
19621 #include <libutf8.h>
19622 #endif
19623 int
19624 main (void)
19625 {
19626 wint_t state
19627   ;
19628   return 0;
19629 }
19630 _ACEOF
19631 rm -f conftest.$ac_objext
19632 if { (eval echo "$as_me:19632: \"$ac_compile\"") >&5
19633   (eval $ac_compile) 2>&5
19634   ac_status=$?
19635   echo "$as_me:19635: \$? = $ac_status" >&5
19636   (exit $ac_status); } &&
19637          { ac_try='test -s conftest.$ac_objext'
19638   { (eval echo "$as_me:19638: \"$ac_try\"") >&5
19639   (eval $ac_try) 2>&5
19640   ac_status=$?
19641   echo "$as_me:19641: \$? = $ac_status" >&5
19642   (exit $ac_status); }; }; then
19643   cf_cv_wint_t=no
19644 else
19645   echo "$as_me: failed program was:" >&5
19646 cat conftest.$ac_ext >&5
19647 cat >conftest.$ac_ext <<_ACEOF
19648 #line 19648 "configure"
19649 #include "confdefs.h"
19650
19651 #include <stdlib.h>
19652 #include <stdarg.h>
19653 #include <stdio.h>
19654 #include <wchar.h>
19655 #ifdef HAVE_LIBUTF8_H
19656 #include <libutf8.h>
19657 #endif
19658 int
19659 main (void)
19660 {
19661 wint_t value
19662   ;
19663   return 0;
19664 }
19665 _ACEOF
19666 rm -f conftest.$ac_objext
19667 if { (eval echo "$as_me:19667: \"$ac_compile\"") >&5
19668   (eval $ac_compile) 2>&5
19669   ac_status=$?
19670   echo "$as_me:19670: \$? = $ac_status" >&5
19671   (exit $ac_status); } &&
19672          { ac_try='test -s conftest.$ac_objext'
19673   { (eval echo "$as_me:19673: \"$ac_try\"") >&5
19674   (eval $ac_try) 2>&5
19675   ac_status=$?
19676   echo "$as_me:19676: \$? = $ac_status" >&5
19677   (exit $ac_status); }; }; then
19678   cf_cv_wint_t=yes
19679 else
19680   echo "$as_me: failed program was:" >&5
19681 cat conftest.$ac_ext >&5
19682 cf_cv_wint_t=unknown
19683 fi
19684 rm -f conftest.$ac_objext conftest.$ac_ext
19685 fi
19686 rm -f conftest.$ac_objext conftest.$ac_ext
19687 fi
19688 echo "$as_me:19688: result: $cf_cv_wint_t" >&5
19689 echo "${ECHO_T}$cf_cv_wint_t" >&6
19690
19691 if test "$cf_cv_wint_t" = yes ; then
19692
19693 cat >>confdefs.h <<\EOF
19694 #define NEED_WCHAR_H 1
19695 EOF
19696
19697         NEED_WCHAR_H=1
19698 fi
19699
19700 # if we do not find wint_t in either place, use substitution to provide a fallback.
19701 if test "$cf_cv_wint_t" = unknown ; then
19702         NCURSES_WINT_T=1
19703 fi
19704
19705 # if we find wint_t in either place, use substitution to provide a fallback.
19706 if test "$cf_cv_wint_t" != unknown ; then
19707         NCURSES_OK_WINT_T=1
19708 fi
19709
19710         if test "$NCURSES_OK_MBSTATE_T" = 0 ; then
19711
19712 echo "$as_me:19712: checking for type mbstate_t in ${cf_cv_ncurses_header:-curses.h}" >&5
19713 echo $ECHO_N "checking for type mbstate_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
19714 cat >conftest.$ac_ext <<_ACEOF
19715 #line 19715 "configure"
19716 #include "confdefs.h"
19717
19718 #ifndef _XOPEN_SOURCE_EXTENDED
19719 #define _XOPEN_SOURCE_EXTENDED
19720 #endif
19721 #include <${cf_cv_ncurses_header:-curses.h}>
19722 int
19723 main (void)
19724 {
19725
19726 mbstate_t foo
19727
19728   ;
19729   return 0;
19730 }
19731 _ACEOF
19732 rm -f conftest.$ac_objext
19733 if { (eval echo "$as_me:19733: \"$ac_compile\"") >&5
19734   (eval $ac_compile) 2>&5
19735   ac_status=$?
19736   echo "$as_me:19736: \$? = $ac_status" >&5
19737   (exit $ac_status); } &&
19738          { ac_try='test -s conftest.$ac_objext'
19739   { (eval echo "$as_me:19739: \"$ac_try\"") >&5
19740   (eval $ac_try) 2>&5
19741   ac_status=$?
19742   echo "$as_me:19742: \$? = $ac_status" >&5
19743   (exit $ac_status); }; }; then
19744   cf_result=yes
19745 else
19746   echo "$as_me: failed program was:" >&5
19747 cat conftest.$ac_ext >&5
19748 cf_result=no
19749 fi
19750 rm -f conftest.$ac_objext conftest.$ac_ext
19751 echo "$as_me:19751: result: $cf_result" >&5
19752 echo "${ECHO_T}$cf_result" >&6
19753 if test $cf_result = yes ; then
19754
19755 cf_result=`echo "have_type_mbstate_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
19756
19757 cat >>confdefs.h <<EOF
19758 #define $cf_result 1
19759 EOF
19760
19761 else
19762
19763 cat >>confdefs.h <<EOF
19764 #define mbstate_t long
19765 EOF
19766
19767 fi
19768
19769         fi
19770
19771         if test "$NCURSES_OK_WCHAR_T" = 0 ; then
19772
19773 echo "$as_me:19773: checking for type wchar_t in ${cf_cv_ncurses_header:-curses.h}" >&5
19774 echo $ECHO_N "checking for type wchar_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
19775 cat >conftest.$ac_ext <<_ACEOF
19776 #line 19776 "configure"
19777 #include "confdefs.h"
19778
19779 #ifndef _XOPEN_SOURCE_EXTENDED
19780 #define _XOPEN_SOURCE_EXTENDED
19781 #endif
19782 #include <${cf_cv_ncurses_header:-curses.h}>
19783 int
19784 main (void)
19785 {
19786
19787 wchar_t foo
19788
19789   ;
19790   return 0;
19791 }
19792 _ACEOF
19793 rm -f conftest.$ac_objext
19794 if { (eval echo "$as_me:19794: \"$ac_compile\"") >&5
19795   (eval $ac_compile) 2>&5
19796   ac_status=$?
19797   echo "$as_me:19797: \$? = $ac_status" >&5
19798   (exit $ac_status); } &&
19799          { ac_try='test -s conftest.$ac_objext'
19800   { (eval echo "$as_me:19800: \"$ac_try\"") >&5
19801   (eval $ac_try) 2>&5
19802   ac_status=$?
19803   echo "$as_me:19803: \$? = $ac_status" >&5
19804   (exit $ac_status); }; }; then
19805   cf_result=yes
19806 else
19807   echo "$as_me: failed program was:" >&5
19808 cat conftest.$ac_ext >&5
19809 cf_result=no
19810 fi
19811 rm -f conftest.$ac_objext conftest.$ac_ext
19812 echo "$as_me:19812: result: $cf_result" >&5
19813 echo "${ECHO_T}$cf_result" >&6
19814 if test $cf_result = yes ; then
19815
19816 cf_result=`echo "have_type_wchar_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
19817
19818 cat >>confdefs.h <<EOF
19819 #define $cf_result 1
19820 EOF
19821
19822 else
19823
19824 cat >>confdefs.h <<EOF
19825 #define wchar_t long
19826 EOF
19827
19828 fi
19829
19830         fi
19831
19832         if test "$NCURSES_OK_WINT_T" = 0 ; then
19833
19834 echo "$as_me:19834: checking for type wint_t in ${cf_cv_ncurses_header:-curses.h}" >&5
19835 echo $ECHO_N "checking for type wint_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
19836 cat >conftest.$ac_ext <<_ACEOF
19837 #line 19837 "configure"
19838 #include "confdefs.h"
19839
19840 #ifndef _XOPEN_SOURCE_EXTENDED
19841 #define _XOPEN_SOURCE_EXTENDED
19842 #endif
19843 #include <${cf_cv_ncurses_header:-curses.h}>
19844 int
19845 main (void)
19846 {
19847
19848 wint_t foo
19849
19850   ;
19851   return 0;
19852 }
19853 _ACEOF
19854 rm -f conftest.$ac_objext
19855 if { (eval echo "$as_me:19855: \"$ac_compile\"") >&5
19856   (eval $ac_compile) 2>&5
19857   ac_status=$?
19858   echo "$as_me:19858: \$? = $ac_status" >&5
19859   (exit $ac_status); } &&
19860          { ac_try='test -s conftest.$ac_objext'
19861   { (eval echo "$as_me:19861: \"$ac_try\"") >&5
19862   (eval $ac_try) 2>&5
19863   ac_status=$?
19864   echo "$as_me:19864: \$? = $ac_status" >&5
19865   (exit $ac_status); }; }; then
19866   cf_result=yes
19867 else
19868   echo "$as_me: failed program was:" >&5
19869 cat conftest.$ac_ext >&5
19870 cf_result=no
19871 fi
19872 rm -f conftest.$ac_objext conftest.$ac_ext
19873 echo "$as_me:19873: result: $cf_result" >&5
19874 echo "${ECHO_T}$cf_result" >&6
19875 if test $cf_result = yes ; then
19876
19877 cf_result=`echo "have_type_wint_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
19878
19879 cat >>confdefs.h <<EOF
19880 #define $cf_result 1
19881 EOF
19882
19883 else
19884
19885 cat >>confdefs.h <<EOF
19886 #define wint_t long
19887 EOF
19888
19889 fi
19890
19891         fi
19892 fi
19893
19894 for cf_data in \
19895 TABSIZE \
19896 curscr \
19897 ospeed \
19898 boolnames \
19899 boolfnames \
19900 ttytype
19901 do
19902 echo "$as_me:19902: checking for data $cf_data declaration in ${cf_cv_ncurses_header:-curses.h}" >&5
19903 echo $ECHO_N "checking for data $cf_data declaration in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
19904
19905 cat >conftest.$ac_ext <<_ACEOF
19906 #line 19906 "configure"
19907 #include "confdefs.h"
19908
19909 #ifdef HAVE_XCURSES
19910 #include <xcurses.h>
19911 char * XCursesProgramName = "test";
19912 #else
19913 #include <${cf_cv_ncurses_header:-curses.h}>
19914 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
19915 #include <ncursesw/term.h>
19916 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
19917 #include <ncurses/term.h>
19918 #elif defined(HAVE_TERM_H)
19919 #include <term.h>
19920 #endif
19921 #endif
19922
19923 int
19924 main (void)
19925 {
19926
19927 #if defined($cf_data) && ((defined(NCURSES_WRAPPED_VAR) && (NCURSES_VERSION_PATCH < 20200208)) || defined(NCURSES_BROKEN_LINKER) || defined(NCURSES_REENTRANT))
19928         const void *foo = (const void *)($cf_data);
19929 #else
19930         const void *foo = &($cf_data);
19931 #endif
19932         fprintf(stderr, "testing linkage of $cf_data:%p\n", (const void *)foo);
19933
19934   ;
19935   return 0;
19936 }
19937 _ACEOF
19938 rm -f conftest.$ac_objext
19939 if { (eval echo "$as_me:19939: \"$ac_compile\"") >&5
19940   (eval $ac_compile) 2>&5
19941   ac_status=$?
19942   echo "$as_me:19942: \$? = $ac_status" >&5
19943   (exit $ac_status); } &&
19944          { ac_try='test -s conftest.$ac_objext'
19945   { (eval echo "$as_me:19945: \"$ac_try\"") >&5
19946   (eval $ac_try) 2>&5
19947   ac_status=$?
19948   echo "$as_me:19948: \$? = $ac_status" >&5
19949   (exit $ac_status); }; }; then
19950   cf_result=yes
19951
19952 else
19953   echo "$as_me: failed program was:" >&5
19954 cat conftest.$ac_ext >&5
19955 cf_result=no
19956 fi
19957 rm -f conftest.$ac_objext conftest.$ac_ext
19958 echo "$as_me:19958: result: $cf_result" >&5
19959 echo "${ECHO_T}$cf_result" >&6
19960
19961 if test $cf_result = yes ; then
19962
19963 cf_result=`echo "have_curses_data_$cf_data" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
19964
19965         cat >>confdefs.h <<EOF
19966 #define $cf_result 1
19967 EOF
19968
19969 else
19970         echo "$as_me:19970: checking for data $cf_data in library" >&5
19971 echo $ECHO_N "checking for data $cf_data in library... $ECHO_C" >&6
19972         # BSD linkers insist on making weak linkage, but resolve at runtime.
19973         if test "$cross_compiling" = yes; then
19974
19975         # cross-compiling
19976         cat >conftest.$ac_ext <<_ACEOF
19977 #line 19977 "configure"
19978 #include "confdefs.h"
19979
19980 #ifdef HAVE_XCURSES
19981 #include <xcurses.h>
19982 char * XCursesProgramName = "test";
19983 #else
19984 #include <${cf_cv_ncurses_header:-curses.h}>
19985 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
19986 #include <ncursesw/term.h>
19987 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
19988 #include <ncurses/term.h>
19989 #elif defined(HAVE_TERM_H)
19990 #include <term.h>
19991 #endif
19992 #endif
19993
19994 extern char $cf_data;
19995 int
19996 main (void)
19997 {
19998
19999         do {
20000
20001 #if defined($cf_data) && ((defined(NCURSES_WRAPPED_VAR) && (NCURSES_VERSION_PATCH < 20200208)) || defined(NCURSES_BROKEN_LINKER) || defined(NCURSES_REENTRANT))
20002         const void *foo = (const void *)($cf_data);
20003 #else
20004         const void *foo = &($cf_data);
20005 #endif
20006         fprintf(stderr, "testing linkage of $cf_data:%p\n", (const void *)foo);
20007
20008                 ${cf_cv_main_return:-return}(foo == 0);
20009         } while (0)
20010
20011   ;
20012   return 0;
20013 }
20014 _ACEOF
20015 rm -f conftest.$ac_objext conftest$ac_exeext
20016 if { (eval echo "$as_me:20016: \"$ac_link\"") >&5
20017   (eval $ac_link) 2>&5
20018   ac_status=$?
20019   echo "$as_me:20019: \$? = $ac_status" >&5
20020   (exit $ac_status); } &&
20021          { ac_try='test -s conftest$ac_exeext'
20022   { (eval echo "$as_me:20022: \"$ac_try\"") >&5
20023   (eval $ac_try) 2>&5
20024   ac_status=$?
20025   echo "$as_me:20025: \$? = $ac_status" >&5
20026   (exit $ac_status); }; }; then
20027   cf_result=yes
20028 else
20029   echo "$as_me: failed program was:" >&5
20030 cat conftest.$ac_ext >&5
20031 cf_result=no
20032 fi
20033 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
20034
20035 else
20036   cat >conftest.$ac_ext <<_ACEOF
20037 #line 20037 "configure"
20038 #include "confdefs.h"
20039
20040 #ifdef HAVE_XCURSES
20041 #include <xcurses.h>
20042 char * XCursesProgramName = "test";
20043 #else
20044 #include <${cf_cv_ncurses_header:-curses.h}>
20045 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
20046 #include <ncursesw/term.h>
20047 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
20048 #include <ncurses/term.h>
20049 #elif defined(HAVE_TERM_H)
20050 #include <term.h>
20051 #endif
20052 #endif
20053
20054 extern char $cf_data;
20055 int main(void)
20056 {
20057
20058 #if defined($cf_data) && ((defined(NCURSES_WRAPPED_VAR) && (NCURSES_VERSION_PATCH < 20200208)) || defined(NCURSES_BROKEN_LINKER) || defined(NCURSES_REENTRANT))
20059         const void *foo = (const void *)($cf_data);
20060 #else
20061         const void *foo = &($cf_data);
20062 #endif
20063         fprintf(stderr, "testing linkage of $cf_data:%p\n", (const void *)foo);
20064
20065         ${cf_cv_main_return:-return}(foo == 0);
20066 }
20067 _ACEOF
20068 rm -f conftest$ac_exeext
20069 if { (eval echo "$as_me:20069: \"$ac_link\"") >&5
20070   (eval $ac_link) 2>&5
20071   ac_status=$?
20072   echo "$as_me:20072: \$? = $ac_status" >&5
20073   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
20074   { (eval echo "$as_me:20074: \"$ac_try\"") >&5
20075   (eval $ac_try) 2>&5
20076   ac_status=$?
20077   echo "$as_me:20077: \$? = $ac_status" >&5
20078   (exit $ac_status); }; }; then
20079   cf_result=yes
20080
20081 else
20082   echo "$as_me: program exited with status $ac_status" >&5
20083 echo "$as_me: failed program was:" >&5
20084 cat conftest.$ac_ext >&5
20085 cf_result=no
20086 fi
20087 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
20088 fi
20089         echo "$as_me:20089: result: $cf_result" >&5
20090 echo "${ECHO_T}$cf_result" >&6
20091         if test $cf_result = yes ; then
20092
20093 cf_result=`echo "decl_curses_data_$cf_data" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
20094
20095                 cat >>confdefs.h <<EOF
20096 #define $cf_result 1
20097 EOF
20098
20099                 # do not exit loop here, since we prefer system's declarations
20100         fi
20101 fi
20102 done
20103
20104 if test -n "$with_screen" && test "x$with_screen" = "xpdcurses"
20105 then
20106         echo "$as_me:20106: checking for X" >&5
20107 echo $ECHO_N "checking for X... $ECHO_C" >&6
20108
20109 # Check whether --with-x or --without-x was given.
20110 if test "${with_x+set}" = set; then
20111   withval="$with_x"
20112
20113 fi;
20114 # $have_x is `yes', `no', `disabled', or empty when we do not yet know.
20115 if test "x$with_x" = xno; then
20116   # The user explicitly disabled X.
20117   have_x=disabled
20118 else
20119   if test "x$x_includes" != xNONE && test "x$x_libraries" != xNONE; then
20120     # Both variables are already set.
20121     have_x=yes
20122   else
20123     if test "${ac_cv_have_x+set}" = set; then
20124   echo $ECHO_N "(cached) $ECHO_C" >&6
20125 else
20126   # One or both of the vars are not set, and there is no cached value.
20127 ac_x_includes=no ac_x_libraries=no
20128 rm -fr conftest.dir
20129 if mkdir conftest.dir; then
20130   cd conftest.dir
20131   # Make sure to not put "make" in the Imakefile rules, since we grep it out.
20132   cat >Imakefile <<'EOF'
20133 acfindx:
20134         @echo 'ac_im_incroot="${INCROOT}"; ac_im_usrlibdir="${USRLIBDIR}"; ac_im_libdir="${LIBDIR}"'
20135 EOF
20136   if (xmkmf) >/dev/null 2>/dev/null && test -f Makefile; then
20137     # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
20138     eval `${MAKE-make} acfindx 2>/dev/null | grep -v make`
20139     # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR.
20140     for ac_extension in a so sl dylib dll; do
20141       if test ! -f $ac_im_usrlibdir/libX11.$ac_extension &&
20142          test -f $ac_im_libdir/libX11.$ac_extension; then
20143         ac_im_usrlibdir=$ac_im_libdir; break
20144       fi
20145     done
20146     # Screen out bogus values from the imake configuration.  They are
20147     # bogus both because they are the default anyway, and because
20148     # using them would break gcc on systems where it needs fixed includes.
20149     case $ac_im_incroot in
20150         /usr/include) ;;
20151         *) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes=$ac_im_incroot;;
20152     esac
20153     case $ac_im_usrlibdir in
20154         /usr/lib | /lib) ;;
20155         *) test -d "$ac_im_usrlibdir" && ac_x_libraries=$ac_im_usrlibdir ;;
20156     esac
20157   fi
20158   cd ..
20159   rm -fr conftest.dir
20160 fi
20161
20162 # Standard set of common directories for X headers.
20163 # Check X11 before X11Rn because it is often a symlink to the current release.
20164 ac_x_header_dirs='
20165 /usr/X11/include
20166 /usr/X11R7/include
20167 /usr/X11R6/include
20168 /usr/X11R5/include
20169 /usr/X11R4/include
20170
20171 /opt/local/include
20172 /opt/X11/include
20173
20174 /usr/include/X11
20175 /usr/include/X11R7
20176 /usr/include/X11R6
20177 /usr/include/X11R5
20178 /usr/include/X11R4
20179
20180 /usr/local/X11/include
20181 /usr/local/X11R7/include
20182 /usr/local/X11R6/include
20183 /usr/local/X11R5/include
20184 /usr/local/X11R4/include
20185
20186 /usr/local/include/X11
20187 /usr/local/include/X11R7
20188 /usr/local/include/X11R6
20189 /usr/local/include/X11R5
20190 /usr/local/include/X11R4
20191
20192 /usr/X386/include
20193 /usr/x386/include
20194 /usr/XFree86/include/X11
20195
20196 /usr/include
20197 /usr/local/include
20198 /usr/unsupported/include
20199 /usr/athena/include
20200 /usr/local/x11r5/include
20201 /usr/lpp/Xamples/include
20202
20203 /usr/openwin/include
20204 /usr/openwin/share/include'
20205
20206 if test "$ac_x_includes" = no; then
20207   # Guess where to find include files, by looking for Intrinsic.h.
20208   # First, try using that file with no special directory specified.
20209   cat >conftest.$ac_ext <<_ACEOF
20210 #line 20210 "configure"
20211 #include "confdefs.h"
20212 #include <X11/Intrinsic.h>
20213 _ACEOF
20214 if { (eval echo "$as_me:20214: \"$ac_cpp conftest.$ac_ext\"") >&5
20215   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
20216   ac_status=$?
20217   egrep -v '^ *\+' conftest.er1 >conftest.err
20218   rm -f conftest.er1
20219   cat conftest.err >&5
20220   echo "$as_me:20220: \$? = $ac_status" >&5
20221   (exit $ac_status); } >/dev/null; then
20222   if test -s conftest.err; then
20223     ac_cpp_err=$ac_c_preproc_warn_flag
20224   else
20225     ac_cpp_err=
20226   fi
20227 else
20228   ac_cpp_err=yes
20229 fi
20230 if test -z "$ac_cpp_err"; then
20231   # We can compile using X headers with no special include directory.
20232 ac_x_includes=
20233 else
20234   echo "$as_me: failed program was:" >&5
20235   cat conftest.$ac_ext >&5
20236   for ac_dir in $ac_x_header_dirs; do
20237   if test -r "$ac_dir/X11/Intrinsic.h"; then
20238     ac_x_includes=$ac_dir
20239     break
20240   fi
20241 done
20242 fi
20243 rm -f conftest.err conftest.$ac_ext
20244 fi # $ac_x_includes = no
20245
20246 if test "$ac_x_libraries" = no; then
20247   # Check for the libraries.
20248   # See if we find them without any special options.
20249   # Don't add to $LIBS permanently.
20250   ac_save_LIBS=$LIBS
20251   LIBS="-lXt $LIBS"
20252   cat >conftest.$ac_ext <<_ACEOF
20253 #line 20253 "configure"
20254 #include "confdefs.h"
20255 #include <X11/Intrinsic.h>
20256 int
20257 main (void)
20258 {
20259 XtMalloc (0)
20260   ;
20261   return 0;
20262 }
20263 _ACEOF
20264 rm -f conftest.$ac_objext conftest$ac_exeext
20265 if { (eval echo "$as_me:20265: \"$ac_link\"") >&5
20266   (eval $ac_link) 2>&5
20267   ac_status=$?
20268   echo "$as_me:20268: \$? = $ac_status" >&5
20269   (exit $ac_status); } &&
20270          { ac_try='test -s conftest$ac_exeext'
20271   { (eval echo "$as_me:20271: \"$ac_try\"") >&5
20272   (eval $ac_try) 2>&5
20273   ac_status=$?
20274   echo "$as_me:20274: \$? = $ac_status" >&5
20275   (exit $ac_status); }; }; then
20276   LIBS=$ac_save_LIBS
20277 # We can link X programs with no special library path.
20278 ac_x_libraries=
20279 else
20280   echo "$as_me: failed program was:" >&5
20281 cat conftest.$ac_ext >&5
20282 LIBS=$ac_save_LIBS
20283 for ac_dir in `echo "$ac_x_includes $ac_x_header_dirs" | sed s/include/lib/g`
20284 do
20285   # Don't even attempt the hair of trying to link an X program!
20286   for ac_extension in a so sl dylib dll; do
20287     if test -r $ac_dir/libXt.$ac_extension; then
20288       ac_x_libraries=$ac_dir
20289       break 2
20290     fi
20291   done
20292 done
20293 fi
20294 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
20295 fi # $ac_x_libraries = no
20296
20297 if test "$ac_x_includes" = no || test "$ac_x_libraries" = no; then
20298   # Didn't find X anywhere.  Cache the known absence of X.
20299   ac_cv_have_x="have_x=no"
20300 else
20301   # Record where we found X for the cache.
20302   ac_cv_have_x="have_x=yes \
20303                 ac_x_includes=$ac_x_includes ac_x_libraries=$ac_x_libraries"
20304 fi
20305 fi
20306
20307   fi
20308   eval "$ac_cv_have_x"
20309 fi # $with_x != no
20310
20311 if test "$have_x" != yes; then
20312   echo "$as_me:20312: result: $have_x" >&5
20313 echo "${ECHO_T}$have_x" >&6
20314   no_x=yes
20315 else
20316   # If each of the values was on the command line, it overrides each guess.
20317   test "x$x_includes" = xNONE && x_includes=$ac_x_includes
20318   test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries
20319   # Update the cache value to reflect the command line values.
20320   ac_cv_have_x="have_x=yes \
20321                 ac_x_includes=$x_includes ac_x_libraries=$x_libraries"
20322   echo "$as_me:20322: result: libraries $x_libraries, headers $x_includes" >&5
20323 echo "${ECHO_T}libraries $x_libraries, headers $x_includes" >&6
20324 fi
20325
20326         if test "$no_x" = yes; then
20327   # Not all programs may use this symbol, but it does not hurt to define it.
20328
20329 cat >>confdefs.h <<\EOF
20330 #define X_DISPLAY_MISSING 1
20331 EOF
20332
20333   X_CFLAGS= X_PRE_LIBS= X_LIBS= X_EXTRA_LIBS=
20334 else
20335   if test -n "$x_includes"; then
20336     X_CFLAGS="$X_CFLAGS -I$x_includes"
20337   fi
20338
20339   # It would also be nice to do this for all -L options, not just this one.
20340   if test -n "$x_libraries"; then
20341     X_LIBS="$X_LIBS -L$x_libraries"
20342     # For Solaris; some versions of Sun CC require a space after -R and
20343     # others require no space.  Words are not sufficient . . . .
20344     case `(uname -sr) 2>/dev/null` in
20345     "SunOS 5"*)
20346       echo "$as_me:20346: checking whether -R must be followed by a space" >&5
20347 echo $ECHO_N "checking whether -R must be followed by a space... $ECHO_C" >&6
20348       ac_xsave_LIBS=$LIBS; LIBS="$LIBS -R$x_libraries"
20349       cat >conftest.$ac_ext <<_ACEOF
20350 #line 20350 "configure"
20351 #include "confdefs.h"
20352
20353 int
20354 main (void)
20355 {
20356
20357   ;
20358   return 0;
20359 }
20360 _ACEOF
20361 rm -f conftest.$ac_objext conftest$ac_exeext
20362 if { (eval echo "$as_me:20362: \"$ac_link\"") >&5
20363   (eval $ac_link) 2>&5
20364   ac_status=$?
20365   echo "$as_me:20365: \$? = $ac_status" >&5
20366   (exit $ac_status); } &&
20367          { ac_try='test -s conftest$ac_exeext'
20368   { (eval echo "$as_me:20368: \"$ac_try\"") >&5
20369   (eval $ac_try) 2>&5
20370   ac_status=$?
20371   echo "$as_me:20371: \$? = $ac_status" >&5
20372   (exit $ac_status); }; }; then
20373   ac_R_nospace=yes
20374 else
20375   echo "$as_me: failed program was:" >&5
20376 cat conftest.$ac_ext >&5
20377 ac_R_nospace=no
20378 fi
20379 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
20380       if test $ac_R_nospace = yes; then
20381         echo "$as_me:20381: result: no" >&5
20382 echo "${ECHO_T}no" >&6
20383         X_LIBS="$X_LIBS -R$x_libraries"
20384       else
20385         LIBS="$ac_xsave_LIBS -R $x_libraries"
20386         cat >conftest.$ac_ext <<_ACEOF
20387 #line 20387 "configure"
20388 #include "confdefs.h"
20389
20390 int
20391 main (void)
20392 {
20393
20394   ;
20395   return 0;
20396 }
20397 _ACEOF
20398 rm -f conftest.$ac_objext conftest$ac_exeext
20399 if { (eval echo "$as_me:20399: \"$ac_link\"") >&5
20400   (eval $ac_link) 2>&5
20401   ac_status=$?
20402   echo "$as_me:20402: \$? = $ac_status" >&5
20403   (exit $ac_status); } &&
20404          { ac_try='test -s conftest$ac_exeext'
20405   { (eval echo "$as_me:20405: \"$ac_try\"") >&5
20406   (eval $ac_try) 2>&5
20407   ac_status=$?
20408   echo "$as_me:20408: \$? = $ac_status" >&5
20409   (exit $ac_status); }; }; then
20410   ac_R_space=yes
20411 else
20412   echo "$as_me: failed program was:" >&5
20413 cat conftest.$ac_ext >&5
20414 ac_R_space=no
20415 fi
20416 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
20417         if test $ac_R_space = yes; then
20418           echo "$as_me:20418: result: yes" >&5
20419 echo "${ECHO_T}yes" >&6
20420           X_LIBS="$X_LIBS -R $x_libraries"
20421         else
20422           echo "$as_me:20422: result: neither works" >&5
20423 echo "${ECHO_T}neither works" >&6
20424         fi
20425       fi
20426       LIBS=$ac_xsave_LIBS
20427     esac
20428   fi
20429
20430   # Check for system-dependent libraries X programs must link with.
20431   # Do this before checking for the system-independent R6 libraries
20432   # (-lICE), since we may need -lsocket or whatever for X linking.
20433
20434   if test "$ISC" = yes; then
20435     X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl_s -linet"
20436   else
20437     # Martyn Johnson says this is needed for Ultrix, if the X
20438     # libraries were built with DECnet support.  And Karl Berry says
20439     # the Alpha needs dnet_stub (dnet does not exist).
20440     ac_xsave_LIBS="$LIBS"; LIBS="$LIBS $X_LIBS -lX11"
20441     cat >conftest.$ac_ext <<_ACEOF
20442 #line 20442 "configure"
20443 #include "confdefs.h"
20444
20445 /* Override any gcc2 internal prototype to avoid an error.  */
20446 #ifdef __cplusplus
20447 extern "C"
20448 #endif
20449 /* We use char because int might match the return type of a gcc2
20450    builtin and then its argument prototype would still apply.  */
20451 char XOpenDisplay ();
20452 int
20453 main (void)
20454 {
20455 XOpenDisplay ();
20456   ;
20457   return 0;
20458 }
20459 _ACEOF
20460 rm -f conftest.$ac_objext conftest$ac_exeext
20461 if { (eval echo "$as_me:20461: \"$ac_link\"") >&5
20462   (eval $ac_link) 2>&5
20463   ac_status=$?
20464   echo "$as_me:20464: \$? = $ac_status" >&5
20465   (exit $ac_status); } &&
20466          { ac_try='test -s conftest$ac_exeext'
20467   { (eval echo "$as_me:20467: \"$ac_try\"") >&5
20468   (eval $ac_try) 2>&5
20469   ac_status=$?
20470   echo "$as_me:20470: \$? = $ac_status" >&5
20471   (exit $ac_status); }; }; then
20472   :
20473 else
20474   echo "$as_me: failed program was:" >&5
20475 cat conftest.$ac_ext >&5
20476 echo "$as_me:20476: checking for dnet_ntoa in -ldnet" >&5
20477 echo $ECHO_N "checking for dnet_ntoa in -ldnet... $ECHO_C" >&6
20478 if test "${ac_cv_lib_dnet_dnet_ntoa+set}" = set; then
20479   echo $ECHO_N "(cached) $ECHO_C" >&6
20480 else
20481   ac_check_lib_save_LIBS=$LIBS
20482 LIBS="-ldnet  $LIBS"
20483 cat >conftest.$ac_ext <<_ACEOF
20484 #line 20484 "configure"
20485 #include "confdefs.h"
20486
20487 /* Override any gcc2 internal prototype to avoid an error.  */
20488 #ifdef __cplusplus
20489 extern "C"
20490 #endif
20491 /* We use char because int might match the return type of a gcc2
20492    builtin and then its argument prototype would still apply.  */
20493 char dnet_ntoa ();
20494 int
20495 main (void)
20496 {
20497 dnet_ntoa ();
20498   ;
20499   return 0;
20500 }
20501 _ACEOF
20502 rm -f conftest.$ac_objext conftest$ac_exeext
20503 if { (eval echo "$as_me:20503: \"$ac_link\"") >&5
20504   (eval $ac_link) 2>&5
20505   ac_status=$?
20506   echo "$as_me:20506: \$? = $ac_status" >&5
20507   (exit $ac_status); } &&
20508          { ac_try='test -s conftest$ac_exeext'
20509   { (eval echo "$as_me:20509: \"$ac_try\"") >&5
20510   (eval $ac_try) 2>&5
20511   ac_status=$?
20512   echo "$as_me:20512: \$? = $ac_status" >&5
20513   (exit $ac_status); }; }; then
20514   ac_cv_lib_dnet_dnet_ntoa=yes
20515 else
20516   echo "$as_me: failed program was:" >&5
20517 cat conftest.$ac_ext >&5
20518 ac_cv_lib_dnet_dnet_ntoa=no
20519 fi
20520 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
20521 LIBS=$ac_check_lib_save_LIBS
20522 fi
20523 echo "$as_me:20523: result: $ac_cv_lib_dnet_dnet_ntoa" >&5
20524 echo "${ECHO_T}$ac_cv_lib_dnet_dnet_ntoa" >&6
20525 if test $ac_cv_lib_dnet_dnet_ntoa = yes; then
20526   X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet"
20527 fi
20528
20529     if test $ac_cv_lib_dnet_dnet_ntoa = no; then
20530       echo "$as_me:20530: checking for dnet_ntoa in -ldnet_stub" >&5
20531 echo $ECHO_N "checking for dnet_ntoa in -ldnet_stub... $ECHO_C" >&6
20532 if test "${ac_cv_lib_dnet_stub_dnet_ntoa+set}" = set; then
20533   echo $ECHO_N "(cached) $ECHO_C" >&6
20534 else
20535   ac_check_lib_save_LIBS=$LIBS
20536 LIBS="-ldnet_stub  $LIBS"
20537 cat >conftest.$ac_ext <<_ACEOF
20538 #line 20538 "configure"
20539 #include "confdefs.h"
20540
20541 /* Override any gcc2 internal prototype to avoid an error.  */
20542 #ifdef __cplusplus
20543 extern "C"
20544 #endif
20545 /* We use char because int might match the return type of a gcc2
20546    builtin and then its argument prototype would still apply.  */
20547 char dnet_ntoa ();
20548 int
20549 main (void)
20550 {
20551 dnet_ntoa ();
20552   ;
20553   return 0;
20554 }
20555 _ACEOF
20556 rm -f conftest.$ac_objext conftest$ac_exeext
20557 if { (eval echo "$as_me:20557: \"$ac_link\"") >&5
20558   (eval $ac_link) 2>&5
20559   ac_status=$?
20560   echo "$as_me:20560: \$? = $ac_status" >&5
20561   (exit $ac_status); } &&
20562          { ac_try='test -s conftest$ac_exeext'
20563   { (eval echo "$as_me:20563: \"$ac_try\"") >&5
20564   (eval $ac_try) 2>&5
20565   ac_status=$?
20566   echo "$as_me:20566: \$? = $ac_status" >&5
20567   (exit $ac_status); }; }; then
20568   ac_cv_lib_dnet_stub_dnet_ntoa=yes
20569 else
20570   echo "$as_me: failed program was:" >&5
20571 cat conftest.$ac_ext >&5
20572 ac_cv_lib_dnet_stub_dnet_ntoa=no
20573 fi
20574 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
20575 LIBS=$ac_check_lib_save_LIBS
20576 fi
20577 echo "$as_me:20577: result: $ac_cv_lib_dnet_stub_dnet_ntoa" >&5
20578 echo "${ECHO_T}$ac_cv_lib_dnet_stub_dnet_ntoa" >&6
20579 if test $ac_cv_lib_dnet_stub_dnet_ntoa = yes; then
20580   X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub"
20581 fi
20582
20583     fi
20584 fi
20585 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
20586     LIBS="$ac_xsave_LIBS"
20587
20588     # msh@cis.ufl.edu says -lnsl (and -lsocket) are needed for his 386/AT,
20589     # to get the SysV transport functions.
20590     # Chad R. Larson says the Pyramis MIS-ES running DC/OSx (SVR4)
20591     # needs -lnsl.
20592     # The nsl library prevents programs from opening the X display
20593     # on Irix 5.2, according to T.E. Dickey.
20594     # The functions gethostbyname, getservbyname, and inet_addr are
20595     # in -lbsd on LynxOS 3.0.1/i386, according to Lars Hecking.
20596     echo "$as_me:20596: checking for gethostbyname" >&5
20597 echo $ECHO_N "checking for gethostbyname... $ECHO_C" >&6
20598 if test "${ac_cv_func_gethostbyname+set}" = set; then
20599   echo $ECHO_N "(cached) $ECHO_C" >&6
20600 else
20601   cat >conftest.$ac_ext <<_ACEOF
20602 #line 20602 "configure"
20603 #include "confdefs.h"
20604 #define gethostbyname autoconf_temporary
20605 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
20606 #undef gethostbyname
20607
20608 #ifdef __cplusplus
20609 extern "C"
20610 #endif
20611
20612 /* We use char because int might match the return type of a gcc2
20613    builtin and then its argument prototype would still apply.  */
20614 char gethostbyname (void);
20615
20616 int
20617 main (void)
20618 {
20619
20620 /* The GNU C library defines stubs for functions which it implements
20621     to always fail with ENOSYS.  Some functions are actually named
20622     something starting with __ and the normal name is an alias.  */
20623 #if defined (__stub_gethostbyname) || defined (__stub___gethostbyname)
20624 #error found stub for gethostbyname
20625 #endif
20626
20627         return gethostbyname ();
20628   ;
20629   return 0;
20630 }
20631 _ACEOF
20632 rm -f conftest.$ac_objext conftest$ac_exeext
20633 if { (eval echo "$as_me:20633: \"$ac_link\"") >&5
20634   (eval $ac_link) 2>&5
20635   ac_status=$?
20636   echo "$as_me:20636: \$? = $ac_status" >&5
20637   (exit $ac_status); } &&
20638          { ac_try='test -s conftest$ac_exeext'
20639   { (eval echo "$as_me:20639: \"$ac_try\"") >&5
20640   (eval $ac_try) 2>&5
20641   ac_status=$?
20642   echo "$as_me:20642: \$? = $ac_status" >&5
20643   (exit $ac_status); }; }; then
20644   ac_cv_func_gethostbyname=yes
20645 else
20646   echo "$as_me: failed program was:" >&5
20647 cat conftest.$ac_ext >&5
20648 ac_cv_func_gethostbyname=no
20649 fi
20650 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
20651 fi
20652 echo "$as_me:20652: result: $ac_cv_func_gethostbyname" >&5
20653 echo "${ECHO_T}$ac_cv_func_gethostbyname" >&6
20654
20655     if test $ac_cv_func_gethostbyname = no; then
20656       echo "$as_me:20656: checking for gethostbyname in -lnsl" >&5
20657 echo $ECHO_N "checking for gethostbyname in -lnsl... $ECHO_C" >&6
20658 if test "${ac_cv_lib_nsl_gethostbyname+set}" = set; then
20659   echo $ECHO_N "(cached) $ECHO_C" >&6
20660 else
20661   ac_check_lib_save_LIBS=$LIBS
20662 LIBS="-lnsl  $LIBS"
20663 cat >conftest.$ac_ext <<_ACEOF
20664 #line 20664 "configure"
20665 #include "confdefs.h"
20666
20667 /* Override any gcc2 internal prototype to avoid an error.  */
20668 #ifdef __cplusplus
20669 extern "C"
20670 #endif
20671 /* We use char because int might match the return type of a gcc2
20672    builtin and then its argument prototype would still apply.  */
20673 char gethostbyname ();
20674 int
20675 main (void)
20676 {
20677 gethostbyname ();
20678   ;
20679   return 0;
20680 }
20681 _ACEOF
20682 rm -f conftest.$ac_objext conftest$ac_exeext
20683 if { (eval echo "$as_me:20683: \"$ac_link\"") >&5
20684   (eval $ac_link) 2>&5
20685   ac_status=$?
20686   echo "$as_me:20686: \$? = $ac_status" >&5
20687   (exit $ac_status); } &&
20688          { ac_try='test -s conftest$ac_exeext'
20689   { (eval echo "$as_me:20689: \"$ac_try\"") >&5
20690   (eval $ac_try) 2>&5
20691   ac_status=$?
20692   echo "$as_me:20692: \$? = $ac_status" >&5
20693   (exit $ac_status); }; }; then
20694   ac_cv_lib_nsl_gethostbyname=yes
20695 else
20696   echo "$as_me: failed program was:" >&5
20697 cat conftest.$ac_ext >&5
20698 ac_cv_lib_nsl_gethostbyname=no
20699 fi
20700 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
20701 LIBS=$ac_check_lib_save_LIBS
20702 fi
20703 echo "$as_me:20703: result: $ac_cv_lib_nsl_gethostbyname" >&5
20704 echo "${ECHO_T}$ac_cv_lib_nsl_gethostbyname" >&6
20705 if test $ac_cv_lib_nsl_gethostbyname = yes; then
20706   X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl"
20707 fi
20708
20709       if test $ac_cv_lib_nsl_gethostbyname = no; then
20710         echo "$as_me:20710: checking for gethostbyname in -lbsd" >&5
20711 echo $ECHO_N "checking for gethostbyname in -lbsd... $ECHO_C" >&6
20712 if test "${ac_cv_lib_bsd_gethostbyname+set}" = set; then
20713   echo $ECHO_N "(cached) $ECHO_C" >&6
20714 else
20715   ac_check_lib_save_LIBS=$LIBS
20716 LIBS="-lbsd  $LIBS"
20717 cat >conftest.$ac_ext <<_ACEOF
20718 #line 20718 "configure"
20719 #include "confdefs.h"
20720
20721 /* Override any gcc2 internal prototype to avoid an error.  */
20722 #ifdef __cplusplus
20723 extern "C"
20724 #endif
20725 /* We use char because int might match the return type of a gcc2
20726    builtin and then its argument prototype would still apply.  */
20727 char gethostbyname ();
20728 int
20729 main (void)
20730 {
20731 gethostbyname ();
20732   ;
20733   return 0;
20734 }
20735 _ACEOF
20736 rm -f conftest.$ac_objext conftest$ac_exeext
20737 if { (eval echo "$as_me:20737: \"$ac_link\"") >&5
20738   (eval $ac_link) 2>&5
20739   ac_status=$?
20740   echo "$as_me:20740: \$? = $ac_status" >&5
20741   (exit $ac_status); } &&
20742          { ac_try='test -s conftest$ac_exeext'
20743   { (eval echo "$as_me:20743: \"$ac_try\"") >&5
20744   (eval $ac_try) 2>&5
20745   ac_status=$?
20746   echo "$as_me:20746: \$? = $ac_status" >&5
20747   (exit $ac_status); }; }; then
20748   ac_cv_lib_bsd_gethostbyname=yes
20749 else
20750   echo "$as_me: failed program was:" >&5
20751 cat conftest.$ac_ext >&5
20752 ac_cv_lib_bsd_gethostbyname=no
20753 fi
20754 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
20755 LIBS=$ac_check_lib_save_LIBS
20756 fi
20757 echo "$as_me:20757: result: $ac_cv_lib_bsd_gethostbyname" >&5
20758 echo "${ECHO_T}$ac_cv_lib_bsd_gethostbyname" >&6
20759 if test $ac_cv_lib_bsd_gethostbyname = yes; then
20760   X_EXTRA_LIBS="$X_EXTRA_LIBS -lbsd"
20761 fi
20762
20763       fi
20764     fi
20765
20766     # lieder@skyler.mavd.honeywell.com says without -lsocket,
20767     # socket/setsockopt and other routines are undefined under SCO ODT
20768     # 2.0.  But -lsocket is broken on IRIX 5.2 (and is not necessary
20769     # on later versions), says Simon Leinen: it contains gethostby*
20770     # variants that don't use the nameserver (or something).  -lsocket
20771     # must be given before -lnsl if both are needed.  We assume that
20772     # if connect needs -lnsl, so does gethostbyname.
20773     echo "$as_me:20773: checking for connect" >&5
20774 echo $ECHO_N "checking for connect... $ECHO_C" >&6
20775 if test "${ac_cv_func_connect+set}" = set; then
20776   echo $ECHO_N "(cached) $ECHO_C" >&6
20777 else
20778   cat >conftest.$ac_ext <<_ACEOF
20779 #line 20779 "configure"
20780 #include "confdefs.h"
20781 #define connect autoconf_temporary
20782 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
20783 #undef connect
20784
20785 #ifdef __cplusplus
20786 extern "C"
20787 #endif
20788
20789 /* We use char because int might match the return type of a gcc2
20790    builtin and then its argument prototype would still apply.  */
20791 char connect (void);
20792
20793 int
20794 main (void)
20795 {
20796
20797 /* The GNU C library defines stubs for functions which it implements
20798     to always fail with ENOSYS.  Some functions are actually named
20799     something starting with __ and the normal name is an alias.  */
20800 #if defined (__stub_connect) || defined (__stub___connect)
20801 #error found stub for connect
20802 #endif
20803
20804         return connect ();
20805   ;
20806   return 0;
20807 }
20808 _ACEOF
20809 rm -f conftest.$ac_objext conftest$ac_exeext
20810 if { (eval echo "$as_me:20810: \"$ac_link\"") >&5
20811   (eval $ac_link) 2>&5
20812   ac_status=$?
20813   echo "$as_me:20813: \$? = $ac_status" >&5
20814   (exit $ac_status); } &&
20815          { ac_try='test -s conftest$ac_exeext'
20816   { (eval echo "$as_me:20816: \"$ac_try\"") >&5
20817   (eval $ac_try) 2>&5
20818   ac_status=$?
20819   echo "$as_me:20819: \$? = $ac_status" >&5
20820   (exit $ac_status); }; }; then
20821   ac_cv_func_connect=yes
20822 else
20823   echo "$as_me: failed program was:" >&5
20824 cat conftest.$ac_ext >&5
20825 ac_cv_func_connect=no
20826 fi
20827 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
20828 fi
20829 echo "$as_me:20829: result: $ac_cv_func_connect" >&5
20830 echo "${ECHO_T}$ac_cv_func_connect" >&6
20831
20832     if test $ac_cv_func_connect = no; then
20833       echo "$as_me:20833: checking for connect in -lsocket" >&5
20834 echo $ECHO_N "checking for connect in -lsocket... $ECHO_C" >&6
20835 if test "${ac_cv_lib_socket_connect+set}" = set; then
20836   echo $ECHO_N "(cached) $ECHO_C" >&6
20837 else
20838   ac_check_lib_save_LIBS=$LIBS
20839 LIBS="-lsocket $X_EXTRA_LIBS $LIBS"
20840 cat >conftest.$ac_ext <<_ACEOF
20841 #line 20841 "configure"
20842 #include "confdefs.h"
20843
20844 /* Override any gcc2 internal prototype to avoid an error.  */
20845 #ifdef __cplusplus
20846 extern "C"
20847 #endif
20848 /* We use char because int might match the return type of a gcc2
20849    builtin and then its argument prototype would still apply.  */
20850 char connect ();
20851 int
20852 main (void)
20853 {
20854 connect ();
20855   ;
20856   return 0;
20857 }
20858 _ACEOF
20859 rm -f conftest.$ac_objext conftest$ac_exeext
20860 if { (eval echo "$as_me:20860: \"$ac_link\"") >&5
20861   (eval $ac_link) 2>&5
20862   ac_status=$?
20863   echo "$as_me:20863: \$? = $ac_status" >&5
20864   (exit $ac_status); } &&
20865          { ac_try='test -s conftest$ac_exeext'
20866   { (eval echo "$as_me:20866: \"$ac_try\"") >&5
20867   (eval $ac_try) 2>&5
20868   ac_status=$?
20869   echo "$as_me:20869: \$? = $ac_status" >&5
20870   (exit $ac_status); }; }; then
20871   ac_cv_lib_socket_connect=yes
20872 else
20873   echo "$as_me: failed program was:" >&5
20874 cat conftest.$ac_ext >&5
20875 ac_cv_lib_socket_connect=no
20876 fi
20877 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
20878 LIBS=$ac_check_lib_save_LIBS
20879 fi
20880 echo "$as_me:20880: result: $ac_cv_lib_socket_connect" >&5
20881 echo "${ECHO_T}$ac_cv_lib_socket_connect" >&6
20882 if test $ac_cv_lib_socket_connect = yes; then
20883   X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS"
20884 fi
20885
20886     fi
20887
20888     # Guillermo Gomez says -lposix is necessary on A/UX.
20889     echo "$as_me:20889: checking for remove" >&5
20890 echo $ECHO_N "checking for remove... $ECHO_C" >&6
20891 if test "${ac_cv_func_remove+set}" = set; then
20892   echo $ECHO_N "(cached) $ECHO_C" >&6
20893 else
20894   cat >conftest.$ac_ext <<_ACEOF
20895 #line 20895 "configure"
20896 #include "confdefs.h"
20897 #define remove autoconf_temporary
20898 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
20899 #undef remove
20900
20901 #ifdef __cplusplus
20902 extern "C"
20903 #endif
20904
20905 /* We use char because int might match the return type of a gcc2
20906    builtin and then its argument prototype would still apply.  */
20907 char remove (void);
20908
20909 int
20910 main (void)
20911 {
20912
20913 /* The GNU C library defines stubs for functions which it implements
20914     to always fail with ENOSYS.  Some functions are actually named
20915     something starting with __ and the normal name is an alias.  */
20916 #if defined (__stub_remove) || defined (__stub___remove)
20917 #error found stub for remove
20918 #endif
20919
20920         return remove ();
20921   ;
20922   return 0;
20923 }
20924 _ACEOF
20925 rm -f conftest.$ac_objext conftest$ac_exeext
20926 if { (eval echo "$as_me:20926: \"$ac_link\"") >&5
20927   (eval $ac_link) 2>&5
20928   ac_status=$?
20929   echo "$as_me:20929: \$? = $ac_status" >&5
20930   (exit $ac_status); } &&
20931          { ac_try='test -s conftest$ac_exeext'
20932   { (eval echo "$as_me:20932: \"$ac_try\"") >&5
20933   (eval $ac_try) 2>&5
20934   ac_status=$?
20935   echo "$as_me:20935: \$? = $ac_status" >&5
20936   (exit $ac_status); }; }; then
20937   ac_cv_func_remove=yes
20938 else
20939   echo "$as_me: failed program was:" >&5
20940 cat conftest.$ac_ext >&5
20941 ac_cv_func_remove=no
20942 fi
20943 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
20944 fi
20945 echo "$as_me:20945: result: $ac_cv_func_remove" >&5
20946 echo "${ECHO_T}$ac_cv_func_remove" >&6
20947
20948     if test $ac_cv_func_remove = no; then
20949       echo "$as_me:20949: checking for remove in -lposix" >&5
20950 echo $ECHO_N "checking for remove in -lposix... $ECHO_C" >&6
20951 if test "${ac_cv_lib_posix_remove+set}" = set; then
20952   echo $ECHO_N "(cached) $ECHO_C" >&6
20953 else
20954   ac_check_lib_save_LIBS=$LIBS
20955 LIBS="-lposix  $LIBS"
20956 cat >conftest.$ac_ext <<_ACEOF
20957 #line 20957 "configure"
20958 #include "confdefs.h"
20959
20960 /* Override any gcc2 internal prototype to avoid an error.  */
20961 #ifdef __cplusplus
20962 extern "C"
20963 #endif
20964 /* We use char because int might match the return type of a gcc2
20965    builtin and then its argument prototype would still apply.  */
20966 char remove ();
20967 int
20968 main (void)
20969 {
20970 remove ();
20971   ;
20972   return 0;
20973 }
20974 _ACEOF
20975 rm -f conftest.$ac_objext conftest$ac_exeext
20976 if { (eval echo "$as_me:20976: \"$ac_link\"") >&5
20977   (eval $ac_link) 2>&5
20978   ac_status=$?
20979   echo "$as_me:20979: \$? = $ac_status" >&5
20980   (exit $ac_status); } &&
20981          { ac_try='test -s conftest$ac_exeext'
20982   { (eval echo "$as_me:20982: \"$ac_try\"") >&5
20983   (eval $ac_try) 2>&5
20984   ac_status=$?
20985   echo "$as_me:20985: \$? = $ac_status" >&5
20986   (exit $ac_status); }; }; then
20987   ac_cv_lib_posix_remove=yes
20988 else
20989   echo "$as_me: failed program was:" >&5
20990 cat conftest.$ac_ext >&5
20991 ac_cv_lib_posix_remove=no
20992 fi
20993 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
20994 LIBS=$ac_check_lib_save_LIBS
20995 fi
20996 echo "$as_me:20996: result: $ac_cv_lib_posix_remove" >&5
20997 echo "${ECHO_T}$ac_cv_lib_posix_remove" >&6
20998 if test $ac_cv_lib_posix_remove = yes; then
20999   X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix"
21000 fi
21001
21002     fi
21003
21004     # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay.
21005     echo "$as_me:21005: checking for shmat" >&5
21006 echo $ECHO_N "checking for shmat... $ECHO_C" >&6
21007 if test "${ac_cv_func_shmat+set}" = set; then
21008   echo $ECHO_N "(cached) $ECHO_C" >&6
21009 else
21010   cat >conftest.$ac_ext <<_ACEOF
21011 #line 21011 "configure"
21012 #include "confdefs.h"
21013 #define shmat autoconf_temporary
21014 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
21015 #undef shmat
21016
21017 #ifdef __cplusplus
21018 extern "C"
21019 #endif
21020
21021 /* We use char because int might match the return type of a gcc2
21022    builtin and then its argument prototype would still apply.  */
21023 char shmat (void);
21024
21025 int
21026 main (void)
21027 {
21028
21029 /* The GNU C library defines stubs for functions which it implements
21030     to always fail with ENOSYS.  Some functions are actually named
21031     something starting with __ and the normal name is an alias.  */
21032 #if defined (__stub_shmat) || defined (__stub___shmat)
21033 #error found stub for shmat
21034 #endif
21035
21036         return shmat ();
21037   ;
21038   return 0;
21039 }
21040 _ACEOF
21041 rm -f conftest.$ac_objext conftest$ac_exeext
21042 if { (eval echo "$as_me:21042: \"$ac_link\"") >&5
21043   (eval $ac_link) 2>&5
21044   ac_status=$?
21045   echo "$as_me:21045: \$? = $ac_status" >&5
21046   (exit $ac_status); } &&
21047          { ac_try='test -s conftest$ac_exeext'
21048   { (eval echo "$as_me:21048: \"$ac_try\"") >&5
21049   (eval $ac_try) 2>&5
21050   ac_status=$?
21051   echo "$as_me:21051: \$? = $ac_status" >&5
21052   (exit $ac_status); }; }; then
21053   ac_cv_func_shmat=yes
21054 else
21055   echo "$as_me: failed program was:" >&5
21056 cat conftest.$ac_ext >&5
21057 ac_cv_func_shmat=no
21058 fi
21059 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
21060 fi
21061 echo "$as_me:21061: result: $ac_cv_func_shmat" >&5
21062 echo "${ECHO_T}$ac_cv_func_shmat" >&6
21063
21064     if test $ac_cv_func_shmat = no; then
21065       echo "$as_me:21065: checking for shmat in -lipc" >&5
21066 echo $ECHO_N "checking for shmat in -lipc... $ECHO_C" >&6
21067 if test "${ac_cv_lib_ipc_shmat+set}" = set; then
21068   echo $ECHO_N "(cached) $ECHO_C" >&6
21069 else
21070   ac_check_lib_save_LIBS=$LIBS
21071 LIBS="-lipc  $LIBS"
21072 cat >conftest.$ac_ext <<_ACEOF
21073 #line 21073 "configure"
21074 #include "confdefs.h"
21075
21076 /* Override any gcc2 internal prototype to avoid an error.  */
21077 #ifdef __cplusplus
21078 extern "C"
21079 #endif
21080 /* We use char because int might match the return type of a gcc2
21081    builtin and then its argument prototype would still apply.  */
21082 char shmat ();
21083 int
21084 main (void)
21085 {
21086 shmat ();
21087   ;
21088   return 0;
21089 }
21090 _ACEOF
21091 rm -f conftest.$ac_objext conftest$ac_exeext
21092 if { (eval echo "$as_me:21092: \"$ac_link\"") >&5
21093   (eval $ac_link) 2>&5
21094   ac_status=$?
21095   echo "$as_me:21095: \$? = $ac_status" >&5
21096   (exit $ac_status); } &&
21097          { ac_try='test -s conftest$ac_exeext'
21098   { (eval echo "$as_me:21098: \"$ac_try\"") >&5
21099   (eval $ac_try) 2>&5
21100   ac_status=$?
21101   echo "$as_me:21101: \$? = $ac_status" >&5
21102   (exit $ac_status); }; }; then
21103   ac_cv_lib_ipc_shmat=yes
21104 else
21105   echo "$as_me: failed program was:" >&5
21106 cat conftest.$ac_ext >&5
21107 ac_cv_lib_ipc_shmat=no
21108 fi
21109 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
21110 LIBS=$ac_check_lib_save_LIBS
21111 fi
21112 echo "$as_me:21112: result: $ac_cv_lib_ipc_shmat" >&5
21113 echo "${ECHO_T}$ac_cv_lib_ipc_shmat" >&6
21114 if test $ac_cv_lib_ipc_shmat = yes; then
21115   X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc"
21116 fi
21117
21118     fi
21119   fi
21120
21121   # Check for libraries that X11R6 Xt/Xaw programs need.
21122   ac_save_LDFLAGS=$LDFLAGS
21123   test -n "$x_libraries" && LDFLAGS="$LDFLAGS -L$x_libraries"
21124   # SM needs ICE to (dynamically) link under SunOS 4.x (so we have to
21125   # check for ICE first), but we must link in the order -lSM -lICE or
21126   # we get undefined symbols.  So assume we have SM if we have ICE.
21127   # These have to be linked with before -lX11, unlike the other
21128   # libraries we check for below, so use a different variable.
21129   # John Interrante, Karl Berry
21130   echo "$as_me:21130: checking for IceConnectionNumber in -lICE" >&5
21131 echo $ECHO_N "checking for IceConnectionNumber in -lICE... $ECHO_C" >&6
21132 if test "${ac_cv_lib_ICE_IceConnectionNumber+set}" = set; then
21133   echo $ECHO_N "(cached) $ECHO_C" >&6
21134 else
21135   ac_check_lib_save_LIBS=$LIBS
21136 LIBS="-lICE $X_EXTRA_LIBS $LIBS"
21137 cat >conftest.$ac_ext <<_ACEOF
21138 #line 21138 "configure"
21139 #include "confdefs.h"
21140
21141 /* Override any gcc2 internal prototype to avoid an error.  */
21142 #ifdef __cplusplus
21143 extern "C"
21144 #endif
21145 /* We use char because int might match the return type of a gcc2
21146    builtin and then its argument prototype would still apply.  */
21147 char IceConnectionNumber ();
21148 int
21149 main (void)
21150 {
21151 IceConnectionNumber ();
21152   ;
21153   return 0;
21154 }
21155 _ACEOF
21156 rm -f conftest.$ac_objext conftest$ac_exeext
21157 if { (eval echo "$as_me:21157: \"$ac_link\"") >&5
21158   (eval $ac_link) 2>&5
21159   ac_status=$?
21160   echo "$as_me:21160: \$? = $ac_status" >&5
21161   (exit $ac_status); } &&
21162          { ac_try='test -s conftest$ac_exeext'
21163   { (eval echo "$as_me:21163: \"$ac_try\"") >&5
21164   (eval $ac_try) 2>&5
21165   ac_status=$?
21166   echo "$as_me:21166: \$? = $ac_status" >&5
21167   (exit $ac_status); }; }; then
21168   ac_cv_lib_ICE_IceConnectionNumber=yes
21169 else
21170   echo "$as_me: failed program was:" >&5
21171 cat conftest.$ac_ext >&5
21172 ac_cv_lib_ICE_IceConnectionNumber=no
21173 fi
21174 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
21175 LIBS=$ac_check_lib_save_LIBS
21176 fi
21177 echo "$as_me:21177: result: $ac_cv_lib_ICE_IceConnectionNumber" >&5
21178 echo "${ECHO_T}$ac_cv_lib_ICE_IceConnectionNumber" >&6
21179 if test $ac_cv_lib_ICE_IceConnectionNumber = yes; then
21180   X_PRE_LIBS="$X_PRE_LIBS -lSM -lICE"
21181 fi
21182
21183   LDFLAGS=$ac_save_LDFLAGS
21184
21185 fi
21186
21187 fi
21188
21189 if ( test "$GCC" = yes || test "$GXX" = yes )
21190 then
21191
21192 if ( test "$GCC" = yes || test "$GXX" = yes )
21193 then
21194         case $CFLAGS in
21195         (*-Werror=*)
21196                 test -n "$verbose" && echo "    repairing CFLAGS: $CFLAGS" 1>&6
21197
21198 echo "${as_me:-configure}:21198: testing repairing CFLAGS: $CFLAGS ..." 1>&5
21199
21200                 cf_temp_flags=
21201                 for cf_temp_scan in $CFLAGS
21202                 do
21203                         case "x$cf_temp_scan" in
21204                         (x-Werror=*)
21205
21206         test -n "$EXTRA_CFLAGS" && EXTRA_CFLAGS="$EXTRA_CFLAGS "
21207         EXTRA_CFLAGS="${EXTRA_CFLAGS}"$cf_temp_scan""
21208
21209                                 ;;
21210                         (*)
21211
21212         test -n "$cf_temp_flags" && cf_temp_flags="$cf_temp_flags "
21213         cf_temp_flags="${cf_temp_flags}"$cf_temp_scan""
21214
21215                                 ;;
21216                         esac
21217                 done
21218                 CFLAGS="$cf_temp_flags"
21219                 test -n "$verbose" && echo "    ... fixed $CFLAGS" 1>&6
21220
21221 echo "${as_me:-configure}:21221: testing ... fixed $CFLAGS ..." 1>&5
21222
21223                 test -n "$verbose" && echo "    ... extra $EXTRA_CFLAGS" 1>&6
21224
21225 echo "${as_me:-configure}:21225: testing ... extra $EXTRA_CFLAGS ..." 1>&5
21226
21227                 ;;
21228         esac
21229 fi
21230
21231 if ( test "$GCC" = yes || test "$GXX" = yes )
21232 then
21233         case $CPPFLAGS in
21234         (*-Werror=*)
21235                 test -n "$verbose" && echo "    repairing CPPFLAGS: $CPPFLAGS" 1>&6
21236
21237 echo "${as_me:-configure}:21237: testing repairing CPPFLAGS: $CPPFLAGS ..." 1>&5
21238
21239                 cf_temp_flags=
21240                 for cf_temp_scan in $CPPFLAGS
21241                 do
21242                         case "x$cf_temp_scan" in
21243                         (x-Werror=*)
21244
21245         test -n "$EXTRA_CFLAGS" && EXTRA_CFLAGS="$EXTRA_CFLAGS "
21246         EXTRA_CFLAGS="${EXTRA_CFLAGS}"$cf_temp_scan""
21247
21248                                 ;;
21249                         (*)
21250
21251         test -n "$cf_temp_flags" && cf_temp_flags="$cf_temp_flags "
21252         cf_temp_flags="${cf_temp_flags}"$cf_temp_scan""
21253
21254                                 ;;
21255                         esac
21256                 done
21257                 CPPFLAGS="$cf_temp_flags"
21258                 test -n "$verbose" && echo "    ... fixed $CPPFLAGS" 1>&6
21259
21260 echo "${as_me:-configure}:21260: testing ... fixed $CPPFLAGS ..." 1>&5
21261
21262                 test -n "$verbose" && echo "    ... extra $EXTRA_CFLAGS" 1>&6
21263
21264 echo "${as_me:-configure}:21264: testing ... extra $EXTRA_CFLAGS ..." 1>&5
21265
21266                 ;;
21267         esac
21268 fi
21269
21270 if ( test "$GCC" = yes || test "$GXX" = yes )
21271 then
21272         case $LDFLAGS in
21273         (*-Werror=*)
21274                 test -n "$verbose" && echo "    repairing LDFLAGS: $LDFLAGS" 1>&6
21275
21276 echo "${as_me:-configure}:21276: testing repairing LDFLAGS: $LDFLAGS ..." 1>&5
21277
21278                 cf_temp_flags=
21279                 for cf_temp_scan in $LDFLAGS
21280                 do
21281                         case "x$cf_temp_scan" in
21282                         (x-Werror=*)
21283
21284         test -n "$EXTRA_CFLAGS" && EXTRA_CFLAGS="$EXTRA_CFLAGS "
21285         EXTRA_CFLAGS="${EXTRA_CFLAGS}"$cf_temp_scan""
21286
21287                                 ;;
21288                         (*)
21289
21290         test -n "$cf_temp_flags" && cf_temp_flags="$cf_temp_flags "
21291         cf_temp_flags="${cf_temp_flags}"$cf_temp_scan""
21292
21293                                 ;;
21294                         esac
21295                 done
21296                 LDFLAGS="$cf_temp_flags"
21297                 test -n "$verbose" && echo "    ... fixed $LDFLAGS" 1>&6
21298
21299 echo "${as_me:-configure}:21299: testing ... fixed $LDFLAGS ..." 1>&5
21300
21301                 test -n "$verbose" && echo "    ... extra $EXTRA_CFLAGS" 1>&6
21302
21303 echo "${as_me:-configure}:21303: testing ... extra $EXTRA_CFLAGS ..." 1>&5
21304
21305                 ;;
21306         esac
21307 fi
21308
21309 echo "$as_me:21309: checking if you want to turn on gcc warnings" >&5
21310 echo $ECHO_N "checking if you want to turn on gcc warnings... $ECHO_C" >&6
21311
21312 # Check whether --enable-warnings or --disable-warnings was given.
21313 if test "${enable_warnings+set}" = set; then
21314   enableval="$enable_warnings"
21315   test "$enableval" != yes && enableval=no
21316         if test "$enableval" != "no" ; then
21317     with_warnings=yes
21318         else
21319                 with_warnings=no
21320         fi
21321 else
21322   enableval=no
21323         with_warnings=no
21324
21325 fi;
21326 echo "$as_me:21326: result: $with_warnings" >&5
21327 echo "${ECHO_T}$with_warnings" >&6
21328 if test "$with_warnings" = "yes"
21329 then
21330
21331 if ( test "$GCC" = yes || test "$GXX" = yes )
21332 then
21333 cat > conftest.i <<EOF
21334 #ifndef GCC_PRINTF
21335 #define GCC_PRINTF 0
21336 #endif
21337 #ifndef GCC_SCANF
21338 #define GCC_SCANF 0
21339 #endif
21340 #ifndef GCC_NORETURN
21341 #define GCC_NORETURN /* nothing */
21342 #endif
21343 #ifndef GCC_UNUSED
21344 #define GCC_UNUSED /* nothing */
21345 #endif
21346 EOF
21347 if test "$GCC" = yes
21348 then
21349         { echo "$as_me:21349: checking for $CC __attribute__ directives..." >&5
21350 echo "$as_me: checking for $CC __attribute__ directives..." >&6;}
21351 cat > conftest.$ac_ext <<EOF
21352 #line 21352 "${as_me:-configure}"
21353 #include "confdefs.h"
21354 #include "conftest.h"
21355 #include "conftest.i"
21356 #if     GCC_PRINTF
21357 #define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
21358 #else
21359 #define GCC_PRINTFLIKE(fmt,var) /*nothing*/
21360 #endif
21361 #if     GCC_SCANF
21362 #define GCC_SCANFLIKE(fmt,var)  __attribute__((format(scanf,fmt,var)))
21363 #else
21364 #define GCC_SCANFLIKE(fmt,var)  /*nothing*/
21365 #endif
21366 extern void wow(char *,...) GCC_SCANFLIKE(1,2);
21367 extern void oops(char *,...) GCC_PRINTFLIKE(1,2) GCC_NORETURN;
21368 extern void foo(void) GCC_NORETURN;
21369 int main(int argc GCC_UNUSED, char *argv[] GCC_UNUSED) { (void)argc; (void)argv; return 0; }
21370 EOF
21371         cf_printf_attribute=no
21372         cf_scanf_attribute=no
21373         for cf_attribute in scanf printf unused noreturn
21374         do
21375
21376 cf_ATTRIBUTE=`echo "$cf_attribute" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
21377
21378                 cf_directive="__attribute__(($cf_attribute))"
21379                 echo "checking for $CC $cf_directive" 1>&5
21380
21381                 case $cf_attribute in
21382                 (printf)
21383                         cf_printf_attribute=yes
21384                         cat >conftest.h <<EOF
21385 #define GCC_$cf_ATTRIBUTE 1
21386 EOF
21387                         ;;
21388                 (scanf)
21389                         cf_scanf_attribute=yes
21390                         cat >conftest.h <<EOF
21391 #define GCC_$cf_ATTRIBUTE 1
21392 EOF
21393                         ;;
21394                 (*)
21395                         cat >conftest.h <<EOF
21396 #define GCC_$cf_ATTRIBUTE $cf_directive
21397 EOF
21398                         ;;
21399                 esac
21400
21401                 if { (eval echo "$as_me:21401: \"$ac_compile\"") >&5
21402   (eval $ac_compile) 2>&5
21403   ac_status=$?
21404   echo "$as_me:21404: \$? = $ac_status" >&5
21405   (exit $ac_status); }; then
21406                         test -n "$verbose" && echo "$as_me:21406: result: ... $cf_attribute" >&5
21407 echo "${ECHO_T}... $cf_attribute" >&6
21408                         cat conftest.h >>confdefs.h
21409                         case $cf_attribute in
21410                         (noreturn)
21411
21412 cat >>confdefs.h <<EOF
21413 #define GCC_NORETURN $cf_directive
21414 EOF
21415
21416                                 ;;
21417                         (printf)
21418                                 cf_value='/* nothing */'
21419                                 if test "$cf_printf_attribute" != no ; then
21420                                         cf_value='__attribute__((format(printf,fmt,var)))'
21421
21422 cat >>confdefs.h <<\EOF
21423 #define GCC_PRINTF 1
21424 EOF
21425
21426                                 fi
21427
21428 cat >>confdefs.h <<EOF
21429 #define GCC_PRINTFLIKE(fmt,var) $cf_value
21430 EOF
21431
21432                                 ;;
21433                         (scanf)
21434                                 cf_value='/* nothing */'
21435                                 if test "$cf_scanf_attribute" != no ; then
21436                                         cf_value='__attribute__((format(scanf,fmt,var)))'
21437
21438 cat >>confdefs.h <<\EOF
21439 #define GCC_SCANF 1
21440 EOF
21441
21442                                 fi
21443
21444 cat >>confdefs.h <<EOF
21445 #define GCC_SCANFLIKE(fmt,var) $cf_value
21446 EOF
21447
21448                                 ;;
21449                         (unused)
21450
21451 cat >>confdefs.h <<EOF
21452 #define GCC_UNUSED $cf_directive
21453 EOF
21454
21455                                 ;;
21456                         esac
21457                 fi
21458         done
21459 else
21460         fgrep define conftest.i >>confdefs.h
21461 fi
21462 rm -rf conftest*
21463 fi
21464
21465 if test "x$have_x" = xyes; then
21466
21467 cf_save_LIBS_CF_CONST_X_STRING="$LIBS"
21468 cf_save_CFLAGS_CF_CONST_X_STRING="$CFLAGS"
21469 cf_save_CPPFLAGS_CF_CONST_X_STRING="$CPPFLAGS"
21470 LIBS="$LIBS ${X_PRE_LIBS} ${X_LIBS} ${X_EXTRA_LIBS}"
21471 for cf_X_CFLAGS in $X_CFLAGS
21472 do
21473         case "x$cf_X_CFLAGS" in
21474         x-[IUD]*)
21475                 CPPFLAGS="$CPPFLAGS $cf_X_CFLAGS"
21476                 ;;
21477         *)
21478                 CFLAGS="$CFLAGS $cf_X_CFLAGS"
21479                 ;;
21480         esac
21481 done
21482
21483 cat >conftest.$ac_ext <<_ACEOF
21484 #line 21484 "configure"
21485 #include "confdefs.h"
21486
21487 #include <stdlib.h>
21488 #include <X11/Intrinsic.h>
21489
21490 int
21491 main (void)
21492 {
21493 String foo = malloc(1); (void)foo
21494   ;
21495   return 0;
21496 }
21497 _ACEOF
21498 rm -f conftest.$ac_objext
21499 if { (eval echo "$as_me:21499: \"$ac_compile\"") >&5
21500   (eval $ac_compile) 2>&5
21501   ac_status=$?
21502   echo "$as_me:21502: \$? = $ac_status" >&5
21503   (exit $ac_status); } &&
21504          { ac_try='test -s conftest.$ac_objext'
21505   { (eval echo "$as_me:21505: \"$ac_try\"") >&5
21506   (eval $ac_try) 2>&5
21507   ac_status=$?
21508   echo "$as_me:21508: \$? = $ac_status" >&5
21509   (exit $ac_status); }; }; then
21510
21511 echo "$as_me:21511: checking for X11/Xt const-feature" >&5
21512 echo $ECHO_N "checking for X11/Xt const-feature... $ECHO_C" >&6
21513 if test "${cf_cv_const_x_string+set}" = set; then
21514   echo $ECHO_N "(cached) $ECHO_C" >&6
21515 else
21516
21517         cat >conftest.$ac_ext <<_ACEOF
21518 #line 21518 "configure"
21519 #include "confdefs.h"
21520
21521 #define _CONST_X_STRING /* X11R7.8 (perhaps) */
21522 #undef  XTSTRINGDEFINES /* X11R5 and later */
21523 #include <stdlib.h>
21524 #include <X11/Intrinsic.h>
21525
21526 int
21527 main (void)
21528 {
21529 String foo = malloc(1); *foo = 0
21530   ;
21531   return 0;
21532 }
21533 _ACEOF
21534 rm -f conftest.$ac_objext
21535 if { (eval echo "$as_me:21535: \"$ac_compile\"") >&5
21536   (eval $ac_compile) 2>&5
21537   ac_status=$?
21538   echo "$as_me:21538: \$? = $ac_status" >&5
21539   (exit $ac_status); } &&
21540          { ac_try='test -s conftest.$ac_objext'
21541   { (eval echo "$as_me:21541: \"$ac_try\"") >&5
21542   (eval $ac_try) 2>&5
21543   ac_status=$?
21544   echo "$as_me:21544: \$? = $ac_status" >&5
21545   (exit $ac_status); }; }; then
21546
21547                         cf_cv_const_x_string=no
21548
21549 else
21550   echo "$as_me: failed program was:" >&5
21551 cat conftest.$ac_ext >&5
21552
21553                         cf_cv_const_x_string=yes
21554
21555 fi
21556 rm -f conftest.$ac_objext conftest.$ac_ext
21557
21558 fi
21559 echo "$as_me:21559: result: $cf_cv_const_x_string" >&5
21560 echo "${ECHO_T}$cf_cv_const_x_string" >&6
21561
21562 LIBS="$cf_save_LIBS_CF_CONST_X_STRING"
21563 CFLAGS="$cf_save_CFLAGS_CF_CONST_X_STRING"
21564 CPPFLAGS="$cf_save_CPPFLAGS_CF_CONST_X_STRING"
21565
21566 case $cf_cv_const_x_string in
21567 (no)
21568
21569         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
21570         CPPFLAGS="${CPPFLAGS}-DXTSTRINGDEFINES"
21571
21572         ;;
21573 (*)
21574
21575         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
21576         CPPFLAGS="${CPPFLAGS}-D_CONST_X_STRING"
21577
21578         ;;
21579 esac
21580
21581 else
21582   echo "$as_me: failed program was:" >&5
21583 cat conftest.$ac_ext >&5
21584 fi
21585 rm -f conftest.$ac_objext conftest.$ac_ext
21586  fi
21587 cat > conftest.$ac_ext <<EOF
21588 #line 21588 "${as_me:-configure}"
21589 int main(int argc, char *argv[]) { return (argv[argc-1] == 0) ; }
21590 EOF
21591 if test "$INTEL_COMPILER" = yes
21592 then
21593 # The "-wdXXX" options suppress warnings:
21594 # remark #1419: external declaration in primary source file
21595 # remark #1683: explicit conversion of a 64-bit integral type to a smaller integral type (potential portability problem)
21596 # remark #1684: conversion from pointer to same-sized integral type (potential portability problem)
21597 # remark #193: zero used for undefined preprocessing identifier
21598 # remark #593: variable "curs_sb_left_arrow" was set but never used
21599 # remark #810: conversion from "int" to "Dimension={unsigned short}" may lose significant bits
21600 # remark #869: parameter "tw" was never referenced
21601 # remark #981: operands are evaluated in unspecified order
21602 # warning #279: controlling expression is constant
21603
21604         { echo "$as_me:21604: checking for $CC warning options..." >&5
21605 echo "$as_me: checking for $CC warning options..." >&6;}
21606         cf_save_CFLAGS="$CFLAGS"
21607         EXTRA_CFLAGS="$EXTRA_CFLAGS -Wall"
21608         for cf_opt in \
21609                 wd1419 \
21610                 wd1683 \
21611                 wd1684 \
21612                 wd193 \
21613                 wd593 \
21614                 wd279 \
21615                 wd810 \
21616                 wd869 \
21617                 wd981
21618         do
21619                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
21620                 if { (eval echo "$as_me:21620: \"$ac_compile\"") >&5
21621   (eval $ac_compile) 2>&5
21622   ac_status=$?
21623   echo "$as_me:21623: \$? = $ac_status" >&5
21624   (exit $ac_status); }; then
21625                         test -n "$verbose" && echo "$as_me:21625: result: ... -$cf_opt" >&5
21626 echo "${ECHO_T}... -$cf_opt" >&6
21627                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
21628                 fi
21629         done
21630         CFLAGS="$cf_save_CFLAGS"
21631 elif test "$GCC" = yes && test "$GCC_VERSION" != "unknown"
21632 then
21633         { echo "$as_me:21633: checking for $CC warning options..." >&5
21634 echo "$as_me: checking for $CC warning options..." >&6;}
21635         cf_save_CFLAGS="$CFLAGS"
21636         cf_warn_CONST=""
21637         test "$with_ext_const" = yes && cf_warn_CONST="Wwrite-strings"
21638         cf_gcc_warnings="Wignored-qualifiers Wlogical-op Wvarargs"
21639         test "x$CLANG_COMPILER" = xyes && cf_gcc_warnings=
21640         for cf_opt in W Wall \
21641                 Wbad-function-cast \
21642                 Wcast-align \
21643                 Wcast-qual \
21644                 Wdeclaration-after-statement \
21645                 Wextra \
21646                 Winline \
21647                 Wmissing-declarations \
21648                 Wmissing-prototypes \
21649                 Wnested-externs \
21650                 Wpointer-arith \
21651                 Wshadow \
21652                 Wstrict-prototypes \
21653                 Wundef Wno-inline $cf_gcc_warnings $cf_warn_CONST Wno-unknown-pragmas
21654         do
21655                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
21656                 if { (eval echo "$as_me:21656: \"$ac_compile\"") >&5
21657   (eval $ac_compile) 2>&5
21658   ac_status=$?
21659   echo "$as_me:21659: \$? = $ac_status" >&5
21660   (exit $ac_status); }; then
21661                         test -n "$verbose" && echo "$as_me:21661: result: ... -$cf_opt" >&5
21662 echo "${ECHO_T}... -$cf_opt" >&6
21663                         case $cf_opt in
21664                         (Winline)
21665                                 case $GCC_VERSION in
21666                                 ([34].*)
21667                                         test -n "$verbose" && echo "    feature is broken in gcc $GCC_VERSION" 1>&6
21668
21669 echo "${as_me:-configure}:21669: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
21670
21671                                         continue;;
21672                                 esac
21673                                 ;;
21674                         (Wpointer-arith)
21675                                 case $GCC_VERSION in
21676                                 ([12].*)
21677                                         test -n "$verbose" && echo "    feature is broken in gcc $GCC_VERSION" 1>&6
21678
21679 echo "${as_me:-configure}:21679: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
21680
21681                                         continue;;
21682                                 esac
21683                                 ;;
21684                         esac
21685                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
21686                 fi
21687         done
21688         CFLAGS="$cf_save_CFLAGS"
21689 fi
21690 rm -rf conftest*
21691
21692 fi
21693
21694 fi
21695
21696 echo "$as_me:21696: checking if you want to use dmalloc for testing" >&5
21697 echo $ECHO_N "checking if you want to use dmalloc for testing... $ECHO_C" >&6
21698
21699 # Check whether --with-dmalloc or --without-dmalloc was given.
21700 if test "${with_dmalloc+set}" = set; then
21701   withval="$with_dmalloc"
21702
21703 cat >>confdefs.h <<EOF
21704 #define USE_DMALLOC 1
21705 EOF
21706
21707         : ${with_cflags:=-g}
21708         : ${with_no_leaks:=yes}
21709          with_dmalloc=yes
21710 else
21711   with_dmalloc=
21712 fi;
21713 echo "$as_me:21713: result: ${with_dmalloc:-no}" >&5
21714 echo "${ECHO_T}${with_dmalloc:-no}" >&6
21715
21716 case .$with_cflags in
21717 (.*-g*)
21718         case .$CFLAGS in
21719         (.*-g*)
21720                 ;;
21721         (*)
21722
21723 cf_fix_cppflags=no
21724 cf_new_cflags=
21725 cf_new_cppflags=
21726 cf_new_extra_cppflags=
21727
21728 for cf_add_cflags in -g
21729 do
21730 case $cf_fix_cppflags in
21731 (no)
21732         case $cf_add_cflags in
21733         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
21734                 case $cf_add_cflags in
21735                 (-D*)
21736                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
21737
21738                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
21739                                 && test -z "${cf_tst_cflags}" \
21740                                 && cf_fix_cppflags=yes
21741
21742                         if test $cf_fix_cppflags = yes ; then
21743
21744         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
21745         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
21746
21747                                 continue
21748                         elif test "${cf_tst_cflags}" = "\"'" ; then
21749
21750         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
21751         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
21752
21753                                 continue
21754                         fi
21755                         ;;
21756                 esac
21757                 case "$CPPFLAGS" in
21758                 (*$cf_add_cflags)
21759                         ;;
21760                 (*)
21761                         case $cf_add_cflags in
21762                         (-D*)
21763                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
21764
21765 CPPFLAGS=`echo "$CPPFLAGS" | \
21766         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
21767                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
21768
21769                                 ;;
21770                         esac
21771
21772         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
21773         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
21774
21775                         ;;
21776                 esac
21777                 ;;
21778         (*)
21779
21780         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
21781         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
21782
21783                 ;;
21784         esac
21785         ;;
21786 (yes)
21787
21788         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
21789         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
21790
21791         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
21792
21793         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
21794                 && test -z "${cf_tst_cflags}" \
21795                 && cf_fix_cppflags=no
21796         ;;
21797 esac
21798 done
21799
21800 if test -n "$cf_new_cflags" ; then
21801
21802         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
21803         CFLAGS="${CFLAGS}$cf_new_cflags"
21804
21805 fi
21806
21807 if test -n "$cf_new_cppflags" ; then
21808
21809         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
21810         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
21811
21812 fi
21813
21814 if test -n "$cf_new_extra_cppflags" ; then
21815
21816         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
21817         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
21818
21819 fi
21820
21821                 ;;
21822         esac
21823         ;;
21824 esac
21825
21826 if test "$with_dmalloc" = yes ; then
21827         echo "$as_me:21827: checking for dmalloc.h" >&5
21828 echo $ECHO_N "checking for dmalloc.h... $ECHO_C" >&6
21829 if test "${ac_cv_header_dmalloc_h+set}" = set; then
21830   echo $ECHO_N "(cached) $ECHO_C" >&6
21831 else
21832   cat >conftest.$ac_ext <<_ACEOF
21833 #line 21833 "configure"
21834 #include "confdefs.h"
21835 #include <dmalloc.h>
21836 _ACEOF
21837 if { (eval echo "$as_me:21837: \"$ac_cpp conftest.$ac_ext\"") >&5
21838   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
21839   ac_status=$?
21840   egrep -v '^ *\+' conftest.er1 >conftest.err
21841   rm -f conftest.er1
21842   cat conftest.err >&5
21843   echo "$as_me:21843: \$? = $ac_status" >&5
21844   (exit $ac_status); } >/dev/null; then
21845   if test -s conftest.err; then
21846     ac_cpp_err=$ac_c_preproc_warn_flag
21847   else
21848     ac_cpp_err=
21849   fi
21850 else
21851   ac_cpp_err=yes
21852 fi
21853 if test -z "$ac_cpp_err"; then
21854   ac_cv_header_dmalloc_h=yes
21855 else
21856   echo "$as_me: failed program was:" >&5
21857   cat conftest.$ac_ext >&5
21858   ac_cv_header_dmalloc_h=no
21859 fi
21860 rm -f conftest.err conftest.$ac_ext
21861 fi
21862 echo "$as_me:21862: result: $ac_cv_header_dmalloc_h" >&5
21863 echo "${ECHO_T}$ac_cv_header_dmalloc_h" >&6
21864 if test $ac_cv_header_dmalloc_h = yes; then
21865
21866 echo "$as_me:21866: checking for dmalloc_debug in -ldmalloc" >&5
21867 echo $ECHO_N "checking for dmalloc_debug in -ldmalloc... $ECHO_C" >&6
21868 if test "${ac_cv_lib_dmalloc_dmalloc_debug+set}" = set; then
21869   echo $ECHO_N "(cached) $ECHO_C" >&6
21870 else
21871   ac_check_lib_save_LIBS=$LIBS
21872 LIBS="-ldmalloc  $LIBS"
21873 cat >conftest.$ac_ext <<_ACEOF
21874 #line 21874 "configure"
21875 #include "confdefs.h"
21876
21877 /* Override any gcc2 internal prototype to avoid an error.  */
21878 #ifdef __cplusplus
21879 extern "C"
21880 #endif
21881 /* We use char because int might match the return type of a gcc2
21882    builtin and then its argument prototype would still apply.  */
21883 char dmalloc_debug ();
21884 int
21885 main (void)
21886 {
21887 dmalloc_debug ();
21888   ;
21889   return 0;
21890 }
21891 _ACEOF
21892 rm -f conftest.$ac_objext conftest$ac_exeext
21893 if { (eval echo "$as_me:21893: \"$ac_link\"") >&5
21894   (eval $ac_link) 2>&5
21895   ac_status=$?
21896   echo "$as_me:21896: \$? = $ac_status" >&5
21897   (exit $ac_status); } &&
21898          { ac_try='test -s conftest$ac_exeext'
21899   { (eval echo "$as_me:21899: \"$ac_try\"") >&5
21900   (eval $ac_try) 2>&5
21901   ac_status=$?
21902   echo "$as_me:21902: \$? = $ac_status" >&5
21903   (exit $ac_status); }; }; then
21904   ac_cv_lib_dmalloc_dmalloc_debug=yes
21905 else
21906   echo "$as_me: failed program was:" >&5
21907 cat conftest.$ac_ext >&5
21908 ac_cv_lib_dmalloc_dmalloc_debug=no
21909 fi
21910 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
21911 LIBS=$ac_check_lib_save_LIBS
21912 fi
21913 echo "$as_me:21913: result: $ac_cv_lib_dmalloc_dmalloc_debug" >&5
21914 echo "${ECHO_T}$ac_cv_lib_dmalloc_dmalloc_debug" >&6
21915 if test $ac_cv_lib_dmalloc_dmalloc_debug = yes; then
21916   cat >>confdefs.h <<EOF
21917 #define HAVE_LIBDMALLOC 1
21918 EOF
21919
21920   LIBS="-ldmalloc $LIBS"
21921
21922 fi
21923
21924 fi
21925
21926 fi
21927
21928 echo "$as_me:21928: checking if you want to use dbmalloc for testing" >&5
21929 echo $ECHO_N "checking if you want to use dbmalloc for testing... $ECHO_C" >&6
21930
21931 # Check whether --with-dbmalloc or --without-dbmalloc was given.
21932 if test "${with_dbmalloc+set}" = set; then
21933   withval="$with_dbmalloc"
21934
21935 cat >>confdefs.h <<EOF
21936 #define USE_DBMALLOC 1
21937 EOF
21938
21939         : ${with_cflags:=-g}
21940         : ${with_no_leaks:=yes}
21941          with_dbmalloc=yes
21942 else
21943   with_dbmalloc=
21944 fi;
21945 echo "$as_me:21945: result: ${with_dbmalloc:-no}" >&5
21946 echo "${ECHO_T}${with_dbmalloc:-no}" >&6
21947
21948 case .$with_cflags in
21949 (.*-g*)
21950         case .$CFLAGS in
21951         (.*-g*)
21952                 ;;
21953         (*)
21954
21955 cf_fix_cppflags=no
21956 cf_new_cflags=
21957 cf_new_cppflags=
21958 cf_new_extra_cppflags=
21959
21960 for cf_add_cflags in -g
21961 do
21962 case $cf_fix_cppflags in
21963 (no)
21964         case $cf_add_cflags in
21965         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
21966                 case $cf_add_cflags in
21967                 (-D*)
21968                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
21969
21970                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
21971                                 && test -z "${cf_tst_cflags}" \
21972                                 && cf_fix_cppflags=yes
21973
21974                         if test $cf_fix_cppflags = yes ; then
21975
21976         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
21977         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
21978
21979                                 continue
21980                         elif test "${cf_tst_cflags}" = "\"'" ; then
21981
21982         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
21983         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
21984
21985                                 continue
21986                         fi
21987                         ;;
21988                 esac
21989                 case "$CPPFLAGS" in
21990                 (*$cf_add_cflags)
21991                         ;;
21992                 (*)
21993                         case $cf_add_cflags in
21994                         (-D*)
21995                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
21996
21997 CPPFLAGS=`echo "$CPPFLAGS" | \
21998         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
21999                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
22000
22001                                 ;;
22002                         esac
22003
22004         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
22005         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
22006
22007                         ;;
22008                 esac
22009                 ;;
22010         (*)
22011
22012         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
22013         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
22014
22015                 ;;
22016         esac
22017         ;;
22018 (yes)
22019
22020         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
22021         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
22022
22023         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
22024
22025         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
22026                 && test -z "${cf_tst_cflags}" \
22027                 && cf_fix_cppflags=no
22028         ;;
22029 esac
22030 done
22031
22032 if test -n "$cf_new_cflags" ; then
22033
22034         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
22035         CFLAGS="${CFLAGS}$cf_new_cflags"
22036
22037 fi
22038
22039 if test -n "$cf_new_cppflags" ; then
22040
22041         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
22042         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
22043
22044 fi
22045
22046 if test -n "$cf_new_extra_cppflags" ; then
22047
22048         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
22049         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
22050
22051 fi
22052
22053                 ;;
22054         esac
22055         ;;
22056 esac
22057
22058 if test "$with_dbmalloc" = yes ; then
22059         echo "$as_me:22059: checking for dbmalloc.h" >&5
22060 echo $ECHO_N "checking for dbmalloc.h... $ECHO_C" >&6
22061 if test "${ac_cv_header_dbmalloc_h+set}" = set; then
22062   echo $ECHO_N "(cached) $ECHO_C" >&6
22063 else
22064   cat >conftest.$ac_ext <<_ACEOF
22065 #line 22065 "configure"
22066 #include "confdefs.h"
22067 #include <dbmalloc.h>
22068 _ACEOF
22069 if { (eval echo "$as_me:22069: \"$ac_cpp conftest.$ac_ext\"") >&5
22070   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
22071   ac_status=$?
22072   egrep -v '^ *\+' conftest.er1 >conftest.err
22073   rm -f conftest.er1
22074   cat conftest.err >&5
22075   echo "$as_me:22075: \$? = $ac_status" >&5
22076   (exit $ac_status); } >/dev/null; then
22077   if test -s conftest.err; then
22078     ac_cpp_err=$ac_c_preproc_warn_flag
22079   else
22080     ac_cpp_err=
22081   fi
22082 else
22083   ac_cpp_err=yes
22084 fi
22085 if test -z "$ac_cpp_err"; then
22086   ac_cv_header_dbmalloc_h=yes
22087 else
22088   echo "$as_me: failed program was:" >&5
22089   cat conftest.$ac_ext >&5
22090   ac_cv_header_dbmalloc_h=no
22091 fi
22092 rm -f conftest.err conftest.$ac_ext
22093 fi
22094 echo "$as_me:22094: result: $ac_cv_header_dbmalloc_h" >&5
22095 echo "${ECHO_T}$ac_cv_header_dbmalloc_h" >&6
22096 if test $ac_cv_header_dbmalloc_h = yes; then
22097
22098 echo "$as_me:22098: checking for debug_malloc in -ldbmalloc" >&5
22099 echo $ECHO_N "checking for debug_malloc in -ldbmalloc... $ECHO_C" >&6
22100 if test "${ac_cv_lib_dbmalloc_debug_malloc+set}" = set; then
22101   echo $ECHO_N "(cached) $ECHO_C" >&6
22102 else
22103   ac_check_lib_save_LIBS=$LIBS
22104 LIBS="-ldbmalloc  $LIBS"
22105 cat >conftest.$ac_ext <<_ACEOF
22106 #line 22106 "configure"
22107 #include "confdefs.h"
22108
22109 /* Override any gcc2 internal prototype to avoid an error.  */
22110 #ifdef __cplusplus
22111 extern "C"
22112 #endif
22113 /* We use char because int might match the return type of a gcc2
22114    builtin and then its argument prototype would still apply.  */
22115 char debug_malloc ();
22116 int
22117 main (void)
22118 {
22119 debug_malloc ();
22120   ;
22121   return 0;
22122 }
22123 _ACEOF
22124 rm -f conftest.$ac_objext conftest$ac_exeext
22125 if { (eval echo "$as_me:22125: \"$ac_link\"") >&5
22126   (eval $ac_link) 2>&5
22127   ac_status=$?
22128   echo "$as_me:22128: \$? = $ac_status" >&5
22129   (exit $ac_status); } &&
22130          { ac_try='test -s conftest$ac_exeext'
22131   { (eval echo "$as_me:22131: \"$ac_try\"") >&5
22132   (eval $ac_try) 2>&5
22133   ac_status=$?
22134   echo "$as_me:22134: \$? = $ac_status" >&5
22135   (exit $ac_status); }; }; then
22136   ac_cv_lib_dbmalloc_debug_malloc=yes
22137 else
22138   echo "$as_me: failed program was:" >&5
22139 cat conftest.$ac_ext >&5
22140 ac_cv_lib_dbmalloc_debug_malloc=no
22141 fi
22142 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
22143 LIBS=$ac_check_lib_save_LIBS
22144 fi
22145 echo "$as_me:22145: result: $ac_cv_lib_dbmalloc_debug_malloc" >&5
22146 echo "${ECHO_T}$ac_cv_lib_dbmalloc_debug_malloc" >&6
22147 if test $ac_cv_lib_dbmalloc_debug_malloc = yes; then
22148   cat >>confdefs.h <<EOF
22149 #define HAVE_LIBDBMALLOC 1
22150 EOF
22151
22152   LIBS="-ldbmalloc $LIBS"
22153
22154 fi
22155
22156 fi
22157
22158 fi
22159
22160 echo "$as_me:22160: checking if you want to use valgrind for testing" >&5
22161 echo $ECHO_N "checking if you want to use valgrind for testing... $ECHO_C" >&6
22162
22163 # Check whether --with-valgrind or --without-valgrind was given.
22164 if test "${with_valgrind+set}" = set; then
22165   withval="$with_valgrind"
22166
22167 cat >>confdefs.h <<EOF
22168 #define USE_VALGRIND 1
22169 EOF
22170
22171         : ${with_cflags:=-g}
22172         : ${with_no_leaks:=yes}
22173          with_valgrind=yes
22174 else
22175   with_valgrind=
22176 fi;
22177 echo "$as_me:22177: result: ${with_valgrind:-no}" >&5
22178 echo "${ECHO_T}${with_valgrind:-no}" >&6
22179
22180 case .$with_cflags in
22181 (.*-g*)
22182         case .$CFLAGS in
22183         (.*-g*)
22184                 ;;
22185         (*)
22186
22187 cf_fix_cppflags=no
22188 cf_new_cflags=
22189 cf_new_cppflags=
22190 cf_new_extra_cppflags=
22191
22192 for cf_add_cflags in -g
22193 do
22194 case $cf_fix_cppflags in
22195 (no)
22196         case $cf_add_cflags in
22197         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
22198                 case $cf_add_cflags in
22199                 (-D*)
22200                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
22201
22202                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
22203                                 && test -z "${cf_tst_cflags}" \
22204                                 && cf_fix_cppflags=yes
22205
22206                         if test $cf_fix_cppflags = yes ; then
22207
22208         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
22209         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
22210
22211                                 continue
22212                         elif test "${cf_tst_cflags}" = "\"'" ; then
22213
22214         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
22215         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
22216
22217                                 continue
22218                         fi
22219                         ;;
22220                 esac
22221                 case "$CPPFLAGS" in
22222                 (*$cf_add_cflags)
22223                         ;;
22224                 (*)
22225                         case $cf_add_cflags in
22226                         (-D*)
22227                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
22228
22229 CPPFLAGS=`echo "$CPPFLAGS" | \
22230         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
22231                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
22232
22233                                 ;;
22234                         esac
22235
22236         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
22237         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
22238
22239                         ;;
22240                 esac
22241                 ;;
22242         (*)
22243
22244         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
22245         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
22246
22247                 ;;
22248         esac
22249         ;;
22250 (yes)
22251
22252         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
22253         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
22254
22255         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
22256
22257         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
22258                 && test -z "${cf_tst_cflags}" \
22259                 && cf_fix_cppflags=no
22260         ;;
22261 esac
22262 done
22263
22264 if test -n "$cf_new_cflags" ; then
22265
22266         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
22267         CFLAGS="${CFLAGS}$cf_new_cflags"
22268
22269 fi
22270
22271 if test -n "$cf_new_cppflags" ; then
22272
22273         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
22274         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
22275
22276 fi
22277
22278 if test -n "$cf_new_extra_cppflags" ; then
22279
22280         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
22281         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
22282
22283 fi
22284
22285                 ;;
22286         esac
22287         ;;
22288 esac
22289
22290 echo "$as_me:22290: checking if you want to perform memory-leak testing" >&5
22291 echo $ECHO_N "checking if you want to perform memory-leak testing... $ECHO_C" >&6
22292
22293 # Check whether --enable-leaks or --disable-leaks was given.
22294 if test "${enable_leaks+set}" = set; then
22295   enableval="$enable_leaks"
22296   if test "x$enableval" = xno; then with_no_leaks=yes; else with_no_leaks=no; fi
22297 else
22298   : ${with_no_leaks:=no}
22299 fi;
22300 echo "$as_me:22300: result: $with_no_leaks" >&5
22301 echo "${ECHO_T}$with_no_leaks" >&6
22302
22303 if test "$with_no_leaks" = yes ; then
22304
22305 cat >>confdefs.h <<\EOF
22306 #define NO_LEAKS 1
22307 EOF
22308
22309 cat >>confdefs.h <<\EOF
22310 #define YY_NO_LEAKS 1
22311 EOF
22312
22313 fi
22314
22315 LD_RPATH_OPT=
22316 if test "x$cf_cv_enable_rpath" != xno
22317 then
22318         echo "$as_me:22318: checking for an rpath option" >&5
22319 echo $ECHO_N "checking for an rpath option... $ECHO_C" >&6
22320         case $cf_cv_system_name in
22321         (irix*)
22322                 if test "$GCC" = yes; then
22323                         LD_RPATH_OPT="-Wl,-rpath,"
22324                 else
22325                         LD_RPATH_OPT="-rpath "
22326                 fi
22327                 ;;
22328         (linux*|gnu*|k*bsd*-gnu|freebsd*)
22329                 LD_RPATH_OPT="-Wl,-rpath,"
22330                 ;;
22331         (openbsd[2-9].*|mirbsd*)
22332                 LD_RPATH_OPT="-Wl,-rpath,"
22333                 ;;
22334         (dragonfly*)
22335                 LD_RPATH_OPT="-rpath "
22336                 ;;
22337         (netbsd*)
22338                 LD_RPATH_OPT="-Wl,-rpath,"
22339                 ;;
22340         (osf*|mls+*)
22341                 LD_RPATH_OPT="-rpath "
22342                 ;;
22343         (solaris2*)
22344                 LD_RPATH_OPT="-R"
22345                 ;;
22346         (*)
22347                 ;;
22348         esac
22349         echo "$as_me:22349: result: $LD_RPATH_OPT" >&5
22350 echo "${ECHO_T}$LD_RPATH_OPT" >&6
22351
22352         case "x$LD_RPATH_OPT" in
22353         (x-R*)
22354                 echo "$as_me:22354: checking if we need a space after rpath option" >&5
22355 echo $ECHO_N "checking if we need a space after rpath option... $ECHO_C" >&6
22356                 cf_save_LIBS="$LIBS"
22357
22358 cf_add_libs="$LIBS"
22359 # reverse order
22360 cf_add_0lib=
22361 for cf_add_1lib in ${LD_RPATH_OPT}$libdir; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
22362 # filter duplicates
22363 for cf_add_1lib in $cf_add_0lib; do
22364         for cf_add_2lib in $cf_add_libs; do
22365                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
22366                         cf_add_1lib=
22367                         break
22368                 fi
22369         done
22370         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
22371 done
22372 LIBS="$cf_add_libs"
22373
22374                 cat >conftest.$ac_ext <<_ACEOF
22375 #line 22375 "configure"
22376 #include "confdefs.h"
22377
22378 int
22379 main (void)
22380 {
22381
22382   ;
22383   return 0;
22384 }
22385 _ACEOF
22386 rm -f conftest.$ac_objext conftest$ac_exeext
22387 if { (eval echo "$as_me:22387: \"$ac_link\"") >&5
22388   (eval $ac_link) 2>&5
22389   ac_status=$?
22390   echo "$as_me:22390: \$? = $ac_status" >&5
22391   (exit $ac_status); } &&
22392          { ac_try='test -s conftest$ac_exeext'
22393   { (eval echo "$as_me:22393: \"$ac_try\"") >&5
22394   (eval $ac_try) 2>&5
22395   ac_status=$?
22396   echo "$as_me:22396: \$? = $ac_status" >&5
22397   (exit $ac_status); }; }; then
22398   cf_rpath_space=no
22399 else
22400   echo "$as_me: failed program was:" >&5
22401 cat conftest.$ac_ext >&5
22402 cf_rpath_space=yes
22403 fi
22404 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
22405                 LIBS="$cf_save_LIBS"
22406                 echo "$as_me:22406: result: $cf_rpath_space" >&5
22407 echo "${ECHO_T}$cf_rpath_space" >&6
22408                 test "$cf_rpath_space" = yes && LD_RPATH_OPT="$LD_RPATH_OPT "
22409                 ;;
22410         esac
22411 fi
22412
22413 echo "$as_me:22413: checking if rpath-hack should be disabled" >&5
22414 echo $ECHO_N "checking if rpath-hack should be disabled... $ECHO_C" >&6
22415
22416 # Check whether --enable-rpath-hack or --disable-rpath-hack was given.
22417 if test "${enable_rpath_hack+set}" = set; then
22418   enableval="$enable_rpath_hack"
22419   test "$enableval" != no && enableval=yes
22420         if test "$enableval" != "yes" ; then
22421     cf_disable_rpath_hack=yes
22422         else
22423                 cf_disable_rpath_hack=no
22424         fi
22425 else
22426   enableval=yes
22427         cf_disable_rpath_hack=no
22428
22429 fi;
22430 echo "$as_me:22430: result: $cf_disable_rpath_hack" >&5
22431 echo "${ECHO_T}$cf_disable_rpath_hack" >&6
22432 if test "$cf_disable_rpath_hack" = no ; then
22433
22434 echo "$as_me:22434: checking for updated LDFLAGS" >&5
22435 echo $ECHO_N "checking for updated LDFLAGS... $ECHO_C" >&6
22436 if test -n "$LD_RPATH_OPT" ; then
22437         echo "$as_me:22437: result: maybe" >&5
22438 echo "${ECHO_T}maybe" >&6
22439
22440         for ac_prog in ldd
22441 do
22442   # Extract the first word of "$ac_prog", so it can be a program name with args.
22443 set dummy $ac_prog; ac_word=$2
22444 echo "$as_me:22444: checking for $ac_word" >&5
22445 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
22446 if test "${ac_cv_prog_cf_ldd_prog+set}" = set; then
22447   echo $ECHO_N "(cached) $ECHO_C" >&6
22448 else
22449   if test -n "$cf_ldd_prog"; then
22450   ac_cv_prog_cf_ldd_prog="$cf_ldd_prog" # Let the user override the test.
22451 else
22452   ac_save_IFS=$IFS; IFS=$ac_path_separator
22453 ac_dummy="$PATH"
22454 for ac_dir in $ac_dummy; do
22455   IFS=$ac_save_IFS
22456   test -z "$ac_dir" && ac_dir=.
22457   $as_executable_p "$ac_dir/$ac_word" || continue
22458 ac_cv_prog_cf_ldd_prog="$ac_prog"
22459 echo "$as_me:22459: found $ac_dir/$ac_word" >&5
22460 break
22461 done
22462
22463 fi
22464 fi
22465 cf_ldd_prog=$ac_cv_prog_cf_ldd_prog
22466 if test -n "$cf_ldd_prog"; then
22467   echo "$as_me:22467: result: $cf_ldd_prog" >&5
22468 echo "${ECHO_T}$cf_ldd_prog" >&6
22469 else
22470   echo "$as_me:22470: result: no" >&5
22471 echo "${ECHO_T}no" >&6
22472 fi
22473
22474   test -n "$cf_ldd_prog" && break
22475 done
22476 test -n "$cf_ldd_prog" || cf_ldd_prog="no"
22477
22478         cf_rpath_list="/usr/lib /lib"
22479         if test "$cf_ldd_prog" != no
22480         then
22481                 cf_rpath_oops=
22482
22483 cat >conftest.$ac_ext <<_ACEOF
22484 #line 22484 "configure"
22485 #include "confdefs.h"
22486 #include <stdio.h>
22487 int
22488 main (void)
22489 {
22490 printf("Hello");
22491   ;
22492   return 0;
22493 }
22494 _ACEOF
22495 rm -f conftest.$ac_objext conftest$ac_exeext
22496 if { (eval echo "$as_me:22496: \"$ac_link\"") >&5
22497   (eval $ac_link) 2>&5
22498   ac_status=$?
22499   echo "$as_me:22499: \$? = $ac_status" >&5
22500   (exit $ac_status); } &&
22501          { ac_try='test -s conftest$ac_exeext'
22502   { (eval echo "$as_me:22502: \"$ac_try\"") >&5
22503   (eval $ac_try) 2>&5
22504   ac_status=$?
22505   echo "$as_me:22505: \$? = $ac_status" >&5
22506   (exit $ac_status); }; }; then
22507   cf_rpath_oops=`$cf_ldd_prog conftest$ac_exeext | fgrep ' not found' | sed -e 's% =>.*$%%' |sort | uniq`
22508                  cf_rpath_list=`$cf_ldd_prog conftest$ac_exeext | fgrep / | sed -e 's%^.*[      ]/%/%' -e 's%/[^/][^/]*$%%' |sort | uniq`
22509 else
22510   echo "$as_me: failed program was:" >&5
22511 cat conftest.$ac_ext >&5
22512 fi
22513 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
22514
22515                 # If we passed the link-test, but get a "not found" on a given library,
22516                 # this could be due to inept reconfiguration of gcc to make it only
22517                 # partly honor /usr/local/lib (or whatever).  Sometimes this behavior
22518                 # is intentional, e.g., installing gcc in /usr/bin and suppressing the
22519                 # /usr/local libraries.
22520                 if test -n "$cf_rpath_oops"
22521                 then
22522                         for cf_rpath_src in $cf_rpath_oops
22523                         do
22524                                 for cf_rpath_dir in \
22525                                         /usr/local \
22526                                         /usr/pkg \
22527                                         /opt/sfw
22528                                 do
22529                                         if test -f $cf_rpath_dir/lib/$cf_rpath_src
22530                                         then
22531                                                 test -n "$verbose" && echo "    ...adding -L$cf_rpath_dir/lib to LDFLAGS for $cf_rpath_src" 1>&6
22532
22533 echo "${as_me:-configure}:22533: testing ...adding -L$cf_rpath_dir/lib to LDFLAGS for $cf_rpath_src ..." 1>&5
22534
22535                                                 LDFLAGS="$LDFLAGS -L$cf_rpath_dir/lib"
22536                                                 break
22537                                         fi
22538                                 done
22539                         done
22540                 fi
22541         fi
22542
22543         test -n "$verbose" && echo "    ...checking EXTRA_LDFLAGS $EXTRA_LDFLAGS" 1>&6
22544
22545 echo "${as_me:-configure}:22545: testing ...checking EXTRA_LDFLAGS $EXTRA_LDFLAGS ..." 1>&5
22546
22547 test -n "$verbose" && echo "    ...checking LDFLAGS $LDFLAGS" 1>&6
22548
22549 echo "${as_me:-configure}:22549: testing ...checking LDFLAGS $LDFLAGS ..." 1>&5
22550
22551 cf_rpath_dst=
22552 for cf_rpath_src in $LDFLAGS
22553 do
22554         case $cf_rpath_src in
22555         (-L*)
22556
22557                 # check if this refers to a directory which we will ignore
22558                 cf_rpath_skip=no
22559                 if test -n "$cf_rpath_list"
22560                 then
22561                         for cf_rpath_item in $cf_rpath_list
22562                         do
22563                                 if test "x$cf_rpath_src" = "x-L$cf_rpath_item"
22564                                 then
22565                                         cf_rpath_skip=yes
22566                                         break
22567                                 fi
22568                         done
22569                 fi
22570
22571                 if test "$cf_rpath_skip" = no
22572                 then
22573                         # transform the option
22574                         if test "$LD_RPATH_OPT" = "-R " ; then
22575                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%-R %"`
22576                         else
22577                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%$LD_RPATH_OPT%"`
22578                         fi
22579
22580                         # if we have not already added this, add it now
22581                         cf_rpath_tst=`echo "$EXTRA_LDFLAGS" | sed -e "s%$cf_rpath_tmp %%"`
22582                         if test "x$cf_rpath_tst" = "x$EXTRA_LDFLAGS"
22583                         then
22584                                 test -n "$verbose" && echo "    ...Filter $cf_rpath_src ->$cf_rpath_tmp" 1>&6
22585
22586 echo "${as_me:-configure}:22586: testing ...Filter $cf_rpath_src ->$cf_rpath_tmp ..." 1>&5
22587
22588                                 EXTRA_LDFLAGS="$cf_rpath_tmp $EXTRA_LDFLAGS"
22589                         fi
22590                 fi
22591                 ;;
22592         esac
22593         cf_rpath_dst="$cf_rpath_dst $cf_rpath_src"
22594 done
22595 LDFLAGS=$cf_rpath_dst
22596
22597 test -n "$verbose" && echo "    ...checked LDFLAGS $LDFLAGS" 1>&6
22598
22599 echo "${as_me:-configure}:22599: testing ...checked LDFLAGS $LDFLAGS ..." 1>&5
22600
22601 test -n "$verbose" && echo "    ...checking LIBS $LIBS" 1>&6
22602
22603 echo "${as_me:-configure}:22603: testing ...checking LIBS $LIBS ..." 1>&5
22604
22605 cf_rpath_dst=
22606 for cf_rpath_src in $LIBS
22607 do
22608         case $cf_rpath_src in
22609         (-L*)
22610
22611                 # check if this refers to a directory which we will ignore
22612                 cf_rpath_skip=no
22613                 if test -n "$cf_rpath_list"
22614                 then
22615                         for cf_rpath_item in $cf_rpath_list
22616                         do
22617                                 if test "x$cf_rpath_src" = "x-L$cf_rpath_item"
22618                                 then
22619                                         cf_rpath_skip=yes
22620                                         break
22621                                 fi
22622                         done
22623                 fi
22624
22625                 if test "$cf_rpath_skip" = no
22626                 then
22627                         # transform the option
22628                         if test "$LD_RPATH_OPT" = "-R " ; then
22629                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%-R %"`
22630                         else
22631                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%$LD_RPATH_OPT%"`
22632                         fi
22633
22634                         # if we have not already added this, add it now
22635                         cf_rpath_tst=`echo "$EXTRA_LDFLAGS" | sed -e "s%$cf_rpath_tmp %%"`
22636                         if test "x$cf_rpath_tst" = "x$EXTRA_LDFLAGS"
22637                         then
22638                                 test -n "$verbose" && echo "    ...Filter $cf_rpath_src ->$cf_rpath_tmp" 1>&6
22639
22640 echo "${as_me:-configure}:22640: testing ...Filter $cf_rpath_src ->$cf_rpath_tmp ..." 1>&5
22641
22642                                 EXTRA_LDFLAGS="$cf_rpath_tmp $EXTRA_LDFLAGS"
22643                         fi
22644                 fi
22645                 ;;
22646         esac
22647         cf_rpath_dst="$cf_rpath_dst $cf_rpath_src"
22648 done
22649 LIBS=$cf_rpath_dst
22650
22651 test -n "$verbose" && echo "    ...checked LIBS $LIBS" 1>&6
22652
22653 echo "${as_me:-configure}:22653: testing ...checked LIBS $LIBS ..." 1>&5
22654
22655         test -n "$verbose" && echo "    ...checked EXTRA_LDFLAGS $EXTRA_LDFLAGS" 1>&6
22656
22657 echo "${as_me:-configure}:22657: testing ...checked EXTRA_LDFLAGS $EXTRA_LDFLAGS ..." 1>&5
22658
22659 else
22660         echo "$as_me:22660: result: no" >&5
22661 echo "${ECHO_T}no" >&6
22662 fi
22663
22664 fi
22665
22666 TEST_ARGS="$LIBS"
22667 LIBS=
22668
22669 ac_config_files="$ac_config_files Makefile"
22670 ac_config_commands="$ac_config_commands default"
22671 cat >confcache <<\_ACEOF
22672 # This file is a shell script that caches the results of configure
22673 # tests run on this system so they can be shared between configure
22674 # scripts and configure runs, see configure's option --config-cache.
22675 # It is not useful on other systems.  If it contains results you don't
22676 # want to keep, you may remove or edit it.
22677 #
22678 # config.status only pays attention to the cache file if you give it
22679 # the --recheck option to rerun configure.
22680 #
22681 # `ac_cv_env_foo' variables (set or unset) will be overriden when
22682 # loading this file, other *unset* `ac_cv_foo' will be assigned the
22683 # following values.
22684
22685 _ACEOF
22686
22687 # The following way of writing the cache mishandles newlines in values,
22688 # but we know of no workaround that is simple, portable, and efficient.
22689 # So, don't put newlines in cache variables' values.
22690 # Ultrix sh set writes to stderr and can't be redirected directly,
22691 # and sets the high bit in the cache file unless we assign to the vars.
22692 {
22693   (set) 2>&1 |
22694     case `(ac_space=' '; set | grep ac_space) 2>&1` in
22695     *ac_space=\ *)
22696       # `set' does not quote correctly, so add quotes (double-quote
22697       # substitution turns \\\\ into \\, and sed turns \\ into \).
22698       sed -n \
22699         "s/'/'\\\\''/g;
22700           s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
22701       ;;
22702     *)
22703       # `set' quotes correctly as required by POSIX, so do not add quotes.
22704       sed -n \
22705         "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
22706       ;;
22707     esac;
22708 } |
22709   sed '
22710      t clear
22711      : clear
22712      s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
22713      t end
22714      /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
22715      : end' >>confcache
22716 if cmp -s $cache_file confcache; then :; else
22717   if test -w $cache_file; then
22718     test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file"
22719     cat confcache >$cache_file
22720   else
22721     echo "not updating unwritable cache $cache_file"
22722   fi
22723 fi
22724 rm -f confcache
22725
22726 test "x$prefix" = xNONE && prefix=$ac_default_prefix
22727 # Let make expand exec_prefix.
22728 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
22729
22730 # VPATH may cause trouble with some makes, so we remove $(srcdir),
22731 # ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
22732 # trailing colons and then remove the whole line if VPATH becomes empty
22733 # (actually we leave an empty line to preserve line numbers).
22734 if test "x$srcdir" = x.; then
22735   ac_vpsub='/^[         ]*VPATH[        ]*=/{
22736 s/:*\$(srcdir):*/:/;
22737 s/:*\${srcdir}:*/:/;
22738 s/:*@srcdir@:*/:/;
22739 s/^\([^=]*=[    ]*\):*/\1/;
22740 s/:*$//;
22741 s/^[^=]*=[      ]*$//;
22742 }'
22743 fi
22744
22745 DEFS=-DHAVE_CONFIG_H
22746
22747 : ${CONFIG_STATUS=./config.status}
22748 ac_clean_files_save=$ac_clean_files
22749 ac_clean_files="$ac_clean_files $CONFIG_STATUS"
22750 { echo "$as_me:22750: creating $CONFIG_STATUS" >&5
22751 echo "$as_me: creating $CONFIG_STATUS" >&6;}
22752 cat >$CONFIG_STATUS <<_ACEOF
22753 #! $SHELL
22754 # Generated automatically by configure.
22755 # Run this file to recreate the current configuration.
22756 # Compiler output produced by configure, useful for debugging
22757 # configure, is in config.log if it exists.
22758
22759 debug=false
22760 SHELL=\${CONFIG_SHELL-$SHELL}
22761 ac_cs_invocation="\$0 \$@"
22762
22763 CLICOLOR_FORCE= GREP_OPTIONS=
22764 unset CLICOLOR_FORCE GREP_OPTIONS
22765 _ACEOF
22766
22767 cat >>$CONFIG_STATUS <<\_ACEOF
22768 # Be Bourne compatible
22769 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
22770   emulate sh
22771   NULLCMD=:
22772 elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
22773   set -o posix
22774 fi
22775
22776 # Name of the executable.
22777 as_me=`echo "$0" |sed 's,.*[\\/],,'`
22778
22779 if expr a : '\(a\)' >/dev/null 2>&1; then
22780   as_expr=expr
22781 else
22782   as_expr=false
22783 fi
22784
22785 rm -f conf$$ conf$$.exe conf$$.file
22786 echo >conf$$.file
22787 if ln -s conf$$.file conf$$ 2>/dev/null; then
22788   # We could just check for DJGPP; but this test a) works b) is more generic
22789   # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
22790   if test -f conf$$.exe; then
22791     # Don't use ln at all; we don't have any links
22792     as_ln_s='cp -p'
22793   else
22794     as_ln_s='ln -s'
22795   fi
22796 elif ln conf$$.file conf$$ 2>/dev/null; then
22797   as_ln_s=ln
22798 else
22799   as_ln_s='cp -p'
22800 fi
22801 rm -f conf$$ conf$$.exe conf$$.file
22802
22803 as_executable_p="test -f"
22804
22805 # Support unset when possible.
22806 if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
22807   as_unset=unset
22808 else
22809   as_unset=false
22810 fi
22811
22812 # NLS nuisances.
22813 $as_unset LANG || test "${LANG+set}" != set || { LANG=C; export LANG; }
22814 $as_unset LC_ALL || test "${LC_ALL+set}" != set || { LC_ALL=C; export LC_ALL; }
22815 $as_unset LC_TIME || test "${LC_TIME+set}" != set || { LC_TIME=C; export LC_TIME; }
22816 $as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set || { LC_CTYPE=C; export LC_CTYPE; }
22817 $as_unset LANGUAGE || test "${LANGUAGE+set}" != set || { LANGUAGE=C; export LANGUAGE; }
22818 $as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set || { LC_COLLATE=C; export LC_COLLATE; }
22819 $as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set || { LC_NUMERIC=C; export LC_NUMERIC; }
22820 $as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set || { LC_MESSAGES=C; export LC_MESSAGES; }
22821
22822 # IFS
22823 # We need space, tab and new line, in precisely that order.
22824 as_nl='
22825 '
22826 IFS="   $as_nl"
22827
22828 # CDPATH.
22829 $as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=:; export CDPATH; }
22830
22831 exec 6>&1
22832
22833 _ACEOF
22834
22835 # Files that config.status was made for.
22836 if test -n "$ac_config_files"; then
22837   echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS
22838 fi
22839
22840 if test -n "$ac_config_headers"; then
22841   echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS
22842 fi
22843
22844 if test -n "$ac_config_links"; then
22845   echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS
22846 fi
22847
22848 if test -n "$ac_config_commands"; then
22849   echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS
22850 fi
22851
22852 cat >>$CONFIG_STATUS <<\EOF
22853
22854 ac_cs_usage="\
22855 \`$as_me' instantiates files from templates according to the
22856 current configuration.
22857
22858 Usage: $0 [OPTIONS] [FILE]...
22859
22860   -h, --help       print this help, then exit
22861   -V, --version    print version number, then exit
22862   -d, --debug      don't remove temporary files
22863       --recheck    update $as_me by reconfiguring in the same conditions
22864   --file=FILE[:TEMPLATE]
22865                    instantiate the configuration file FILE
22866   --header=FILE[:TEMPLATE]
22867                    instantiate the configuration header FILE
22868
22869 Configuration files:
22870 $config_files
22871
22872 Configuration headers:
22873 $config_headers
22874
22875 Configuration commands:
22876 $config_commands
22877
22878 Report bugs to <dickey@invisible-island.net>."
22879 EOF
22880
22881 cat >>$CONFIG_STATUS <<EOF
22882 ac_cs_version="\\
22883 config.status
22884 configured by $0, generated by GNU Autoconf 2.52.20200802,
22885   with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
22886
22887 Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
22888 Free Software Foundation, Inc.
22889 This config.status script is free software; the Free Software Foundation
22890 gives unlimited permission to copy, distribute and modify it."
22891 srcdir=$srcdir
22892 INSTALL="$INSTALL"
22893 EOF
22894
22895 cat >>$CONFIG_STATUS <<\EOF
22896 # If no file are specified by the user, then we need to provide default
22897 # value.  By we need to know if files were specified by the user.
22898 ac_need_defaults=:
22899 while test $# != 0
22900 do
22901   case $1 in
22902   --*=*)
22903     ac_option=`expr "x$1" : 'x\([^=]*\)='`
22904     ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'`
22905     shift
22906     set dummy "$ac_option" "$ac_optarg" ${1+"$@"}
22907     shift
22908     ;;
22909   -*);;
22910   *) # This is not an option, so the user has probably given explicit
22911      # arguments.
22912      ac_need_defaults=false;;
22913   esac
22914
22915   case $1 in
22916   # Handling of the options.
22917 EOF
22918 cat >>$CONFIG_STATUS <<EOF
22919   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
22920     echo "running $SHELL $0 " $ac_configure_args " --no-create --no-recursion"
22921     exec $SHELL $0 $ac_configure_args --no-create --no-recursion ;;
22922 EOF
22923 cat >>$CONFIG_STATUS <<\EOF
22924   --version | --vers* | -V )
22925     echo "$ac_cs_version"; exit 0 ;;
22926   --he | --h)
22927     # Conflict between --help and --header
22928     { { echo "$as_me:22928: error: ambiguous option: $1
22929 Try \`$0 --help' for more information." >&5
22930 echo "$as_me: error: ambiguous option: $1
22931 Try \`$0 --help' for more information." >&2;}
22932    { (exit 1); exit 1; }; };;
22933   --help | --hel | -h )
22934     echo "$ac_cs_usage"; exit 0 ;;
22935   --debug | --d* | -d )
22936     debug=: ;;
22937   --file | --fil | --fi | --f )
22938     shift
22939     CONFIG_FILES="$CONFIG_FILES $1"
22940     ac_need_defaults=false;;
22941   --header | --heade | --head | --hea )
22942     shift
22943     CONFIG_HEADERS="$CONFIG_HEADERS $1"
22944     ac_need_defaults=false;;
22945
22946   # This is an error.
22947   -*) { { echo "$as_me:22947: error: unrecognized option: $1
22948 Try \`$0 --help' for more information." >&5
22949 echo "$as_me: error: unrecognized option: $1
22950 Try \`$0 --help' for more information." >&2;}
22951    { (exit 1); exit 1; }; } ;;
22952
22953   *) ac_config_targets="$ac_config_targets $1" ;;
22954
22955   esac
22956   shift
22957 done
22958
22959 exec 5>>config.log
22960 cat >&5 << _ACEOF
22961
22962 ## ----------------------- ##
22963 ## Running config.status.  ##
22964 ## ----------------------- ##
22965
22966 This file was extended by $as_me 2.52.20200802, executed with
22967   CONFIG_FILES    = $CONFIG_FILES
22968   CONFIG_HEADERS  = $CONFIG_HEADERS
22969   CONFIG_LINKS    = $CONFIG_LINKS
22970   CONFIG_COMMANDS = $CONFIG_COMMANDS
22971   > $ac_cs_invocation
22972 on `(hostname || uname -n) 2>/dev/null | sed 1q`
22973
22974 _ACEOF
22975 EOF
22976
22977 cat >>$CONFIG_STATUS <<EOF
22978 #
22979 # INIT-COMMANDS section.
22980 #
22981
22982 AWK="$AWK"
22983 ECHO_CC="$ECHO_CC"
22984 ECHO_LD="$ECHO_LD"
22985 SHOW_CC="$SHOW_LD"
22986
22987 EOF
22988
22989 cat >>$CONFIG_STATUS <<\EOF
22990 for ac_config_target in $ac_config_targets
22991 do
22992   case "$ac_config_target" in
22993   # Handling of arguments.
22994   "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;;
22995   "default" ) CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;;
22996   "ncurses_cfg.h" ) CONFIG_HEADERS="$CONFIG_HEADERS ncurses_cfg.h:ncurses_tst.hin" ;;
22997   *) { { echo "$as_me:22997: error: invalid argument: $ac_config_target" >&5
22998 echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
22999    { (exit 1); exit 1; }; };;
23000   esac
23001 done
23002
23003 # If the user did not use the arguments to specify the items to instantiate,
23004 # then the envvar interface is used.  Set only those that are not.
23005 # We use the long form for the default assignment because of an extremely
23006 # bizarre bug on SunOS 4.1.3.
23007 if $ac_need_defaults; then
23008   test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
23009   test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
23010   test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
23011 fi
23012
23013 # Create a temporary directory, and hook for its removal unless debugging.
23014 $debug ||
23015 {
23016   trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0
23017   trap '{ (exit 1); exit 1; }' 1 2 13 15
23018 }
23019
23020 # Create a (secure) tmp directory for tmp files.
23021 : ${TMPDIR=/tmp}
23022 {
23023   tmp=`(umask 077 && mktemp -d -q "$TMPDIR/csXXXXXX") 2>/dev/null` &&
23024   test -n "$tmp" && test -d "$tmp"
23025 }  ||
23026 {
23027   tmp=$TMPDIR/cs$$-$RANDOM
23028   (umask 077 && mkdir $tmp)
23029 } ||
23030 {
23031    echo "$me: cannot create a temporary directory in $TMPDIR" >&2
23032    { (exit 1); exit 1; }
23033 }
23034
23035 EOF
23036
23037 cat >>$CONFIG_STATUS <<EOF
23038
23039 #
23040 # CONFIG_FILES section.
23041 #
23042
23043 # No need to generate the scripts if there are no CONFIG_FILES.
23044 # This happens for instance when ./config.status config.h
23045 if test -n "\$CONFIG_FILES"; then
23046   # Protect against being on the right side of a sed subst in config.status.
23047   sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g;
23048    s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF
23049 s,@SHELL@,$SHELL,;t t
23050 s,@exec_prefix@,$exec_prefix,;t t
23051 s,@prefix@,$prefix,;t t
23052 s,@program_transform_name@,$program_transform_name,;t t
23053 s,@bindir@,$bindir,;t t
23054 s,@sbindir@,$sbindir,;t t
23055 s,@libexecdir@,$libexecdir,;t t
23056 s,@datarootdir@,$datarootdir,;t t
23057 s,@datadir@,$datadir,;t t
23058 s,@sysconfdir@,$sysconfdir,;t t
23059 s,@sharedstatedir@,$sharedstatedir,;t t
23060 s,@localstatedir@,$localstatedir,;t t
23061 s,@runstatedir@,$runstatedir,;t t
23062 s,@libdir@,$libdir,;t t
23063 s,@includedir@,$includedir,;t t
23064 s,@oldincludedir@,$oldincludedir,;t t
23065 s,@infodir@,$infodir,;t t
23066 s,@mandir@,$mandir,;t t
23067 s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t
23068 s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t
23069 s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t
23070 s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t
23071 s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t
23072 s,@build_alias@,$build_alias,;t t
23073 s,@host_alias@,$host_alias,;t t
23074 s,@target_alias@,$target_alias,;t t
23075 s,@ECHO_C@,$ECHO_C,;t t
23076 s,@ECHO_N@,$ECHO_N,;t t
23077 s,@ECHO_T@,$ECHO_T,;t t
23078 s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t
23079 s,@DEFS@,$DEFS,;t t
23080 s,@LIBS@,$LIBS,;t t
23081 s,@build@,$build,;t t
23082 s,@build_cpu@,$build_cpu,;t t
23083 s,@build_vendor@,$build_vendor,;t t
23084 s,@build_os@,$build_os,;t t
23085 s,@host@,$host,;t t
23086 s,@host_cpu@,$host_cpu,;t t
23087 s,@host_vendor@,$host_vendor,;t t
23088 s,@host_os@,$host_os,;t t
23089 s,@SET_MAKE@,$SET_MAKE,;t t
23090 s,@CC@,$CC,;t t
23091 s,@CFLAGS@,$CFLAGS,;t t
23092 s,@LDFLAGS@,$LDFLAGS,;t t
23093 s,@CPPFLAGS@,$CPPFLAGS,;t t
23094 s,@ac_ct_CC@,$ac_ct_CC,;t t
23095 s,@EXEEXT@,$EXEEXT,;t t
23096 s,@OBJEXT@,$OBJEXT,;t t
23097 s,@EXTRA_CPPFLAGS@,$EXTRA_CPPFLAGS,;t t
23098 s,@CPP@,$CPP,;t t
23099 s,@AWK@,$AWK,;t t
23100 s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t
23101 s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t
23102 s,@INSTALL_DATA@,$INSTALL_DATA,;t t
23103 s,@INSTALL_OPT_S@,$INSTALL_OPT_S,;t t
23104 s,@INSTALL_OPT_O@,$INSTALL_OPT_O,;t t
23105 s,@LINT@,$LINT,;t t
23106 s,@LINT_OPTS@,$LINT_OPTS,;t t
23107 s,@CTAGS@,$CTAGS,;t t
23108 s,@ETAGS@,$ETAGS,;t t
23109 s,@MAKE_LOWER_TAGS@,$MAKE_LOWER_TAGS,;t t
23110 s,@MAKE_UPPER_TAGS@,$MAKE_UPPER_TAGS,;t t
23111 s,@MATH_LIB@,$MATH_LIB,;t t
23112 s,@top_builddir@,$top_builddir,;t t
23113 s,@CC_G_OPT@,$CC_G_OPT,;t t
23114 s,@CC_SHARED_OPTS@,$CC_SHARED_OPTS,;t t
23115 s,@DFT_DEP_SUFFIX@,$DFT_DEP_SUFFIX,;t t
23116 s,@DFT_OBJ_SUBDIR@,$DFT_OBJ_SUBDIR,;t t
23117 s,@DFT_UPR_MODEL@,$DFT_UPR_MODEL,;t t
23118 s,@LD@,$LD,;t t
23119 s,@LDFLAGS_SHARED@,$LDFLAGS_SHARED,;t t
23120 s,@LDFLAGS_STATIC@,$LDFLAGS_STATIC,;t t
23121 s,@LD_MODEL@,$LD_MODEL,;t t
23122 s,@LD_SHARED_OPTS@,$LD_SHARED_OPTS,;t t
23123 s,@LIBTOOL@,$LIBTOOL,;t t
23124 s,@LIBTOOL_OPTS@,$LIBTOOL_OPTS,;t t
23125 s,@LIB_CLEAN@,$LIB_CLEAN,;t t
23126 s,@LIB_COMPILE@,$LIB_COMPILE,;t t
23127 s,@LIB_LINK@,$LIB_LINK,;t t
23128 s,@LINK_TESTS@,$LINK_TESTS,;t t
23129 s,@LOCAL_LDFLAGS@,$LOCAL_LDFLAGS,;t t
23130 s,@PACKAGE@,$PACKAGE,;t t
23131 s,@PTHREAD@,$PTHREAD,;t t
23132 s,@TEST_ARGS@,$TEST_ARGS,;t t
23133 s,@TEST_DEPS@,$TEST_DEPS,;t t
23134 s,@TEST_LIBS@,$TEST_LIBS,;t t
23135 s,@TINFO_LDFLAGS@,$TINFO_LDFLAGS,;t t
23136 s,@TINFO_LIBS@,$TINFO_LIBS,;t t
23137 s,@cf_cv_abi_version@,$cf_cv_abi_version,;t t
23138 s,@cf_cv_rel_version@,$cf_cv_rel_version,;t t
23139 s,@includesubdir@,$includesubdir,;t t
23140 s,@PKG_CONFIG@,$PKG_CONFIG,;t t
23141 s,@ac_pt_PKG_CONFIG@,$ac_pt_PKG_CONFIG,;t t
23142 s,@ECHO_LT@,$ECHO_LT,;t t
23143 s,@ECHO_LD@,$ECHO_LD,;t t
23144 s,@RULE_CC@,$RULE_CC,;t t
23145 s,@SHOW_CC@,$SHOW_CC,;t t
23146 s,@ECHO_CC@,$ECHO_CC,;t t
23147 s,@NCURSES_WRAP_PREFIX@,$NCURSES_WRAP_PREFIX,;t t
23148 s,@NCURSES_CONFIG@,$NCURSES_CONFIG,;t t
23149 s,@ac_ct_NCURSES_CONFIG@,$ac_ct_NCURSES_CONFIG,;t t
23150 s,@X_CFLAGS@,$X_CFLAGS,;t t
23151 s,@X_PRE_LIBS@,$X_PRE_LIBS,;t t
23152 s,@X_LIBS@,$X_LIBS,;t t
23153 s,@X_EXTRA_LIBS@,$X_EXTRA_LIBS,;t t
23154 s,@XCURSES_CONFIG@,$XCURSES_CONFIG,;t t
23155 s,@ac_ct_XCURSES_CONFIG@,$ac_ct_XCURSES_CONFIG,;t t
23156 s,@RGB_PATH@,$RGB_PATH,;t t
23157 s,@no_x11_rgb@,$no_x11_rgb,;t t
23158 s,@FORM_NAME@,$FORM_NAME,;t t
23159 s,@MENU_NAME@,$MENU_NAME,;t t
23160 s,@PANEL_NAME@,$PANEL_NAME,;t t
23161 s,@EXTRA_CFLAGS@,$EXTRA_CFLAGS,;t t
23162 s,@cf_ldd_prog@,$cf_ldd_prog,;t t
23163 s,@EXTRA_LDFLAGS@,$EXTRA_LDFLAGS,;t t
23164 CEOF
23165
23166 EOF
23167
23168   cat >>$CONFIG_STATUS <<\EOF
23169   # Split the substitutions into bite-sized pieces for seds with
23170   # small command number limits, like on Digital OSF/1 and HP-UX.
23171   ac_max_sed_lines=48
23172   ac_sed_frag=1 # Number of current file.
23173   ac_beg=1 # First line for current file.
23174   ac_end=$ac_max_sed_lines # Line after last line for current file.
23175   ac_more_lines=:
23176   ac_sed_cmds=
23177   while $ac_more_lines; do
23178     if test $ac_beg -gt 1; then
23179       sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
23180     else
23181       sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
23182     fi
23183     if test ! -s $tmp/subs.frag; then
23184       ac_more_lines=false
23185     else
23186       # The purpose of the label and of the branching condition is to
23187       # speed up the sed processing (if there are no `@' at all, there
23188       # is no need to browse any of the substitutions).
23189       # These are the two extra sed commands mentioned above.
23190       (echo ':t
23191   /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed
23192       # It is possible to make a multiline substitution using escaped newlines.
23193       # Ensure that we do not split the substitution between script fragments.
23194       ac_BEG=$ac_end
23195       ac_END=`expr $ac_end + $ac_max_sed_lines`
23196       sed "1,${ac_BEG}d; ${ac_END}p; q" $tmp/subs.sed >$tmp/subs.next
23197       if test -s $tmp/subs.next; then
23198         grep '^s,@[^@,][^@,]*@,.*\\$' $tmp/subs.next >$tmp/subs.edit
23199         if test ! -s $tmp/subs.edit; then
23200           grep "^s,@[^@,][^@,]*@,.*,;t t$" $tmp/subs.next >$tmp/subs.edit
23201           if test ! -s $tmp/subs.edit; then
23202             if test $ac_beg -gt 1; then
23203               ac_end=`expr $ac_end - 1`
23204               continue
23205             fi
23206           fi
23207         fi
23208       fi
23209
23210       if test -z "$ac_sed_cmds"; then
23211         ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed"
23212       else
23213         ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed"
23214       fi
23215       ac_sed_frag=`expr $ac_sed_frag + 1`
23216       ac_beg=$ac_end
23217       ac_end=`expr $ac_end + $ac_max_sed_lines`
23218     fi
23219   done
23220   if test -z "$ac_sed_cmds"; then
23221     ac_sed_cmds=cat
23222   fi
23223 fi # test -n "$CONFIG_FILES"
23224
23225 EOF
23226 cat >>$CONFIG_STATUS <<\EOF
23227 for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue
23228   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
23229   case $ac_file in
23230   - | *:- | *:-:* ) # input from stdin
23231         cat >$tmp/stdin
23232         ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
23233         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
23234   *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
23235         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
23236   * )   ac_file_in=$ac_file.in ;;
23237   esac
23238
23239   # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories.
23240   ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
23241          X"$ac_file" : 'X\(//\)[^/]' \| \
23242          X"$ac_file" : 'X\(//\)$' \| \
23243          X"$ac_file" : 'X\(/\)' \| \
23244          .     : '\(.\)' 2>/dev/null ||
23245 echo X"$ac_file" |
23246     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
23247           /^X\(\/\/\)[^/].*/{ s//\1/; q; }
23248           /^X\(\/\/\)$/{ s//\1/; q; }
23249           /^X\(\/\).*/{ s//\1/; q; }
23250           s/.*/./; q'`
23251   if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
23252     { case "$ac_dir" in
23253   [\\/]* | ?:[\\/]* ) as_incr_dir=;;
23254   *)                      as_incr_dir=.;;
23255 esac
23256 as_dummy="$ac_dir"
23257 for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
23258   case $as_mkdir_dir in
23259     # Skip DOS drivespec
23260     ?:) as_incr_dir=$as_mkdir_dir ;;
23261     *)
23262       as_incr_dir=$as_incr_dir/$as_mkdir_dir
23263       test -d "$as_incr_dir" || mkdir "$as_incr_dir"
23264     ;;
23265   esac
23266 done; }
23267
23268     ac_dir_suffix="/`echo $ac_dir|sed 's,^\./,,'`"
23269     # A "../" for each directory in $ac_dir_suffix.
23270     ac_dots=`echo "$ac_dir_suffix" | sed 's,/[^/]*,../,g'`
23271   else
23272     ac_dir_suffix= ac_dots=
23273   fi
23274
23275   case $srcdir in
23276   .)  ac_srcdir=.
23277       if test -z "$ac_dots"; then
23278          ac_top_srcdir=.
23279       else
23280          ac_top_srcdir=`echo $ac_dots | sed 's,/$,,'`
23281       fi ;;
23282   [\\/]* | ?:[\\/]* )
23283       ac_srcdir=$srcdir$ac_dir_suffix;
23284       ac_top_srcdir=$srcdir ;;
23285   *) # Relative path.
23286     ac_srcdir=$ac_dots$srcdir$ac_dir_suffix
23287     ac_top_srcdir=$ac_dots$srcdir ;;
23288   esac
23289
23290   case $INSTALL in
23291   [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
23292   *) ac_INSTALL=$ac_dots$INSTALL ;;
23293   esac
23294
23295   if test x"$ac_file" != x-; then
23296     { echo "$as_me:23296: creating $ac_file" >&5
23297 echo "$as_me: creating $ac_file" >&6;}
23298     rm -f "$ac_file"
23299   fi
23300   # Let's still pretend it is `configure' which instantiates (i.e., don't
23301   # use $as_me), people would be surprised to read:
23302   #    /* config.h.  Generated automatically by config.status.  */
23303   configure_input="Generated automatically from `echo $ac_file_in |
23304                                                  sed 's,.*/,,'` by configure."
23305
23306   # First look for the input files in the build tree, otherwise in the
23307   # src tree.
23308   ac_file_inputs=`IFS=:
23309     for f in $ac_file_in; do
23310       case $f in
23311       -) echo $tmp/stdin ;;
23312       [\\/$]*)
23313          # Absolute (can't be DOS-style, as IFS=:)
23314          test -f "$f" || { { echo "$as_me:23314: error: cannot find input file: $f" >&5
23315 echo "$as_me: error: cannot find input file: $f" >&2;}
23316    { (exit 1); exit 1; }; }
23317          echo $f;;
23318       *) # Relative
23319          if test -f "$f"; then
23320            # Build tree
23321            echo $f
23322          elif test -f "$srcdir/$f"; then
23323            # Source tree
23324            echo $srcdir/$f
23325          else
23326            # /dev/null tree
23327            { { echo "$as_me:23327: error: cannot find input file: $f" >&5
23328 echo "$as_me: error: cannot find input file: $f" >&2;}
23329    { (exit 1); exit 1; }; }
23330          fi;;
23331       esac
23332     done` || { (exit 1); exit 1; }
23333 EOF
23334 cat >>$CONFIG_STATUS <<\EOF
23335   ac_warn_datarootdir=no
23336   if test x"$ac_file" != x-; then
23337     for ac_item in $ac_file_inputs
23338     do
23339       ac_seen=`grep '@\(datadir\|mandir\|infodir\)@' $ac_item`
23340       if test -n "$ac_seen"; then
23341         ac_used=`grep '@datarootdir@' $ac_item`
23342         if test -z "$ac_used"; then
23343           { echo "$as_me:23343: WARNING: datarootdir was used implicitly but not set:
23344 $ac_seen" >&5
23345 echo "$as_me: WARNING: datarootdir was used implicitly but not set:
23346 $ac_seen" >&2;}
23347           ac_warn_datarootdir=yes
23348         fi
23349       fi
23350       ac_seen=`grep '${datarootdir}' $ac_item`
23351       if test -n "$ac_seen"; then
23352         { echo "$as_me:23352: WARNING: datarootdir was used explicitly but not set:
23353 $ac_seen" >&5
23354 echo "$as_me: WARNING: datarootdir was used explicitly but not set:
23355 $ac_seen" >&2;}
23356         ac_warn_datarootdir=yes
23357       fi
23358     done
23359   fi
23360
23361 if test "x$ac_warn_datarootdir" = xyes; then
23362   ac_sed_cmds="$ac_sed_cmds | sed -e 's,@datarootdir@,\${prefix}/share,g' -e 's,\${datarootdir},\${prefix}/share,g'"
23363 fi
23364
23365 EOF
23366 cat >>$CONFIG_STATUS <<EOF
23367   sed "$ac_vpsub
23368 $extrasub
23369 EOF
23370 cat >>$CONFIG_STATUS <<\EOF
23371 :t
23372 /@[a-zA-Z_][a-zA-Z_0-9]*@/!b
23373 s,@configure_input@,$configure_input,;t t
23374 s,@srcdir@,$ac_srcdir,;t t
23375 s,@top_srcdir@,$ac_top_srcdir,;t t
23376 s,@INSTALL@,$ac_INSTALL,;t t
23377 " $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out
23378   rm -f $tmp/stdin
23379   if test x"$ac_file" != x-; then
23380     cp $tmp/out $ac_file
23381
23382     for ac_name in prefix exec_prefix datarootdir
23383     do
23384         ac_seen=`fgrep -n '${'$ac_name'[:=].*}' $ac_file`
23385         if test -n "$ac_seen"; then
23386             ac_init=`egrep '[   ]*'$ac_name'[   ]*=' $ac_file`
23387             if test -z "$ac_init"; then
23388               ac_seen=`echo "$ac_seen" |sed -e 's,^,'$ac_file':,'`
23389               { echo "$as_me:23389: WARNING: Variable $ac_name is used but was not set:
23390 $ac_seen" >&5
23391 echo "$as_me: WARNING: Variable $ac_name is used but was not set:
23392 $ac_seen" >&2;}
23393             fi
23394         fi
23395     done
23396     egrep -n '@[a-z_][a-z_0-9]+@' $ac_file >$tmp/out
23397     egrep -n '@[A-Z_][A-Z_0-9]+@' $ac_file >>$tmp/out
23398     if test -s $tmp/out; then
23399       ac_seen=`sed -e 's,^,'$ac_file':,' < $tmp/out`
23400       { echo "$as_me:23400: WARNING: Some variables may not be substituted:
23401 $ac_seen" >&5
23402 echo "$as_me: WARNING: Some variables may not be substituted:
23403 $ac_seen" >&2;}
23404     fi
23405   else
23406     cat $tmp/out
23407   fi
23408   rm -f $tmp/out
23409
23410 done
23411 EOF
23412 cat >>$CONFIG_STATUS <<\EOF
23413
23414 #
23415 # CONFIG_HEADER section.
23416 #
23417
23418 # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
23419 # NAME is the cpp macro being defined and VALUE is the value it is being given.
23420 #
23421 # ac_d sets the value in "#define NAME VALUE" lines.
23422 ac_dA='s,^\([   ]*\)#\([        ]*define[       ][      ]*\)'
23423 ac_dB='[        ].*$,\1#\2'
23424 ac_dC=' '
23425 ac_dD=',;t'
23426 # ac_i turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
23427 ac_iA='s,^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
23428 ac_iB='\([      ]\),\1#\2define\3'
23429 ac_iC=' '
23430 ac_iD='\4,;t'
23431 # ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
23432 ac_uA='s,^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
23433 ac_uB='$,\1#\2define\3'
23434 ac_uC=' '
23435 ac_uD=',;t'
23436
23437 for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue
23438   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
23439   case $ac_file in
23440   - | *:- | *:-:* ) # input from stdin
23441         cat >$tmp/stdin
23442         ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
23443         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
23444   *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
23445         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
23446   * )   ac_file_in=$ac_file.in ;;
23447   esac
23448
23449   test x"$ac_file" != x- && { echo "$as_me:23449: creating $ac_file" >&5
23450 echo "$as_me: creating $ac_file" >&6;}
23451
23452   # First look for the input files in the build tree, otherwise in the
23453   # src tree.
23454   ac_file_inputs=`IFS=:
23455     for f in $ac_file_in; do
23456       case $f in
23457       -) echo $tmp/stdin ;;
23458       [\\/$]*)
23459          # Absolute (can't be DOS-style, as IFS=:)
23460          test -f "$f" || { { echo "$as_me:23460: error: cannot find input file: $f" >&5
23461 echo "$as_me: error: cannot find input file: $f" >&2;}
23462    { (exit 1); exit 1; }; }
23463          echo $f;;
23464       *) # Relative
23465          if test -f "$f"; then
23466            # Build tree
23467            echo $f
23468          elif test -f "$srcdir/$f"; then
23469            # Source tree
23470            echo $srcdir/$f
23471          else
23472            # /dev/null tree
23473            { { echo "$as_me:23473: error: cannot find input file: $f" >&5
23474 echo "$as_me: error: cannot find input file: $f" >&2;}
23475    { (exit 1); exit 1; }; }
23476          fi;;
23477       esac
23478     done` || { (exit 1); exit 1; }
23479   # Remove the trailing spaces.
23480   sed 's/[      ]*$//' $ac_file_inputs >$tmp/in
23481
23482 EOF
23483
23484 # Transform confdefs.h into a list of #define's.  We won't use it as a sed
23485 # script, but as data to insert where we see @DEFS@.  We expect AC_SAVE_DEFS to
23486 # be either 'cat' or 'sort'.
23487 cat confdefs.h | uniq >conftest.vals
23488
23489 # Break up conftest.vals because some shells have a limit on
23490 # the size of here documents, and old seds have small limits too.
23491
23492 rm -f conftest.tail
23493 echo '  rm -f conftest.frag' >> $CONFIG_STATUS
23494 while grep . conftest.vals >/dev/null
23495 do
23496   # Write chunks of a limited-size here document to conftest.frag.
23497   echo '  cat >> conftest.frag <<CEOF' >> $CONFIG_STATUS
23498   sed ${ac_max_here_lines}q conftest.vals | sed -e 's/#ifdef.*/#if 0/' >> $CONFIG_STATUS
23499   echo 'CEOF' >> $CONFIG_STATUS
23500   sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
23501   rm -f conftest.vals
23502   mv conftest.tail conftest.vals
23503 done
23504 rm -f conftest.vals
23505
23506 # Run sed to substitute the contents of conftest.frag into $tmp/in at the
23507 # marker @DEFS@.
23508 echo '  cat >> conftest.edit <<CEOF
23509 /@DEFS@/r conftest.frag
23510 /@DEFS@/d
23511 CEOF
23512 sed -f conftest.edit $tmp/in > $tmp/out
23513 rm -f $tmp/in
23514 mv $tmp/out $tmp/in
23515 rm -f conftest.edit conftest.frag
23516 ' >> $CONFIG_STATUS
23517
23518 cat >>$CONFIG_STATUS <<\EOF
23519   # Let's still pretend it is `configure' which instantiates (i.e., don't
23520   # use $as_me), people would be surprised to read:
23521   #    /* config.h.  Generated automatically by config.status.  */
23522   if test x"$ac_file" = x-; then
23523     echo "/* Generated automatically by configure.  */" >$tmp/config.h
23524   else
23525     echo "/* $ac_file.  Generated automatically by configure.  */" >$tmp/config.h
23526   fi
23527   cat $tmp/in >>$tmp/config.h
23528   rm -f $tmp/in
23529   if test x"$ac_file" != x-; then
23530     if cmp -s $ac_file $tmp/config.h 2>/dev/null; then
23531       { echo "$as_me:23531: $ac_file is unchanged" >&5
23532 echo "$as_me: $ac_file is unchanged" >&6;}
23533     else
23534       ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
23535          X"$ac_file" : 'X\(//\)[^/]' \| \
23536          X"$ac_file" : 'X\(//\)$' \| \
23537          X"$ac_file" : 'X\(/\)' \| \
23538          .     : '\(.\)' 2>/dev/null ||
23539 echo X"$ac_file" |
23540     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
23541           /^X\(\/\/\)[^/].*/{ s//\1/; q; }
23542           /^X\(\/\/\)$/{ s//\1/; q; }
23543           /^X\(\/\).*/{ s//\1/; q; }
23544           s/.*/./; q'`
23545       if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
23546         { case "$ac_dir" in
23547   [\\/]* | ?:[\\/]* ) as_incr_dir=;;
23548   *)                      as_incr_dir=.;;
23549 esac
23550 as_dummy="$ac_dir"
23551 for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
23552   case $as_mkdir_dir in
23553     # Skip DOS drivespec
23554     ?:) as_incr_dir=$as_mkdir_dir ;;
23555     *)
23556       as_incr_dir=$as_incr_dir/$as_mkdir_dir
23557       test -d "$as_incr_dir" || mkdir "$as_incr_dir"
23558     ;;
23559   esac
23560 done; }
23561
23562       fi
23563       rm -f $ac_file
23564       mv $tmp/config.h $ac_file
23565     fi
23566   else
23567     cat $tmp/config.h
23568     rm -f $tmp/config.h
23569   fi
23570 done
23571 EOF
23572 cat >>$CONFIG_STATUS <<\EOF
23573 #
23574 # CONFIG_COMMANDS section.
23575 #
23576 for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue
23577   ac_dest=`echo "$ac_file" | sed 's,:.*,,'`
23578   ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'`
23579
23580   case $ac_dest in
23581     default )
23582
23583 for cf_dir in .
23584 do
23585         if test ! -d $srcdir/$cf_dir; then
23586                 continue
23587         elif test -f $srcdir/$cf_dir/programs; then
23588                 $AWK -f $srcdir/mk-test.awk INSTALL=yes ECHO_LINK="$ECHO_LD" $srcdir/$cf_dir/programs >>$cf_dir/Makefile
23589         fi
23590 done
23591
23592         cat >>Makefile <<TEST_EOF
23593
23594 # These rules are generated so we do not rely on suffix rules, which do not
23595 # work consistently for different make-programs (the '\$(MODEL)/' confuses
23596 # some, and the '\$x' confuses others).
23597 TEST_EOF
23598
23599 LIST=`sed -e 's/[       ].*//' -e '/^[#@]/d' $srcdir/modules`
23600 for N in $LIST
23601 do
23602         cat >>Makefile <<TEST_EOF
23603
23604 \$(MODEL)/$N.o : \$(srcdir)/$N.c \\
23605         \$(srcdir)/test.priv.h \\
23606         ncurses_cfg.h
23607         $SHOW_CC
23608         $ECHO_CC\$(CC) -c \$(CFLAGS_DEFAULT) -DMODULE_NAME="$N" \$(srcdir)/$N.c
23609 TEST_EOF
23610 done
23611
23612 if test -f ../config.guess && test -f ../config.sub
23613 then
23614         cat >>Makefile <<TEST_EOF
23615
23616 # if we used CF_INHERIT for getting these files, we can remove them
23617 distclean::
23618         rm -f config.guess config.sub
23619 TEST_EOF
23620 fi
23621  ;;
23622   esac
23623 done
23624 EOF
23625
23626 cat >>$CONFIG_STATUS <<\EOF
23627
23628 { (exit 0); exit 0; }
23629 EOF
23630 chmod +x $CONFIG_STATUS
23631 ac_clean_files=$ac_clean_files_save
23632
23633 # configure is writing to config.log, and then calls config.status.
23634 # config.status does its own redirection, appending to config.log.
23635 # Unfortunately, on DOS this fails, as config.log is still kept open
23636 # by configure, so config.status won't be able to write to it; its
23637 # output is simply discarded.  So we exec the FD to /dev/null,
23638 # effectively closing config.log, so it can be properly (re)opened and
23639 # appended to by config.status.  When coming back to configure, we
23640 # need to make the FD available again.
23641 if test "$no_create" != yes; then
23642   ac_cs_success=:
23643   exec 5>/dev/null
23644   $SHELL $CONFIG_STATUS || ac_cs_success=false
23645   exec 5>>config.log
23646   # Use ||, not &&, to avoid exiting from the if with $? = 1, which
23647   # would make configure fail if this is the last instruction.
23648   $ac_cs_success || { (exit 1); exit 1; }
23649 fi
23650