]> ncurses.scripts.mit.edu Git - ncurses.git/blob - Ada95/configure
a574d5ebf7831ac086cbc5192ddd9b17222ed002
[ncurses.git] / Ada95 / configure
1 #! /bin/sh
2 # From configure.in Revision: 1.60 .
3 # Guess values for system-dependent variables and create Makefiles.
4 # Generated by Autoconf 2.52.20141204.
5 #
6 # Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
7 # Free Software Foundation, Inc.
8 # This configure script is free software; the Free Software Foundation
9 # gives unlimited permission to copy, distribute and modify it.
10
11 # Avoid depending upon Character Ranges.
12 as_cr_letters='abcdefghijklmnopqrstuvwxyz'
13 as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
14 as_cr_Letters=$as_cr_letters$as_cr_LETTERS
15 as_cr_digits='0123456789'
16 as_cr_alnum=$as_cr_Letters$as_cr_digits
17
18 # Sed expression to map a string onto a valid variable name.
19 as_tr_sh="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g"
20
21 # Sed expression to map a string onto a valid CPP name.
22 as_tr_cpp="sed y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g"
23
24 # Be Bourne compatible
25 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
26   emulate sh
27   NULLCMD=:
28 elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
29   set -o posix
30 fi
31
32 # Name of the executable.
33 as_me=`echo "$0" |sed 's,.*[\\/],,'`
34
35 if expr a : '\(a\)' >/dev/null 2>&1; then
36   as_expr=expr
37 else
38   as_expr=false
39 fi
40
41 rm -f conf$$ conf$$.exe conf$$.file
42 echo >conf$$.file
43 if ln -s conf$$.file conf$$ 2>/dev/null; then
44   # We could just check for DJGPP; but this test a) works b) is more generic
45   # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
46   if test -f conf$$.exe; then
47     # Don't use ln at all; we don't have any links
48     as_ln_s='cp -p'
49   else
50     as_ln_s='ln -s'
51   fi
52 elif ln conf$$.file conf$$ 2>/dev/null; then
53   as_ln_s=ln
54 else
55   as_ln_s='cp -p'
56 fi
57 rm -f conf$$ conf$$.exe conf$$.file
58
59 as_executable_p="test -f"
60
61 # Support unset when possible.
62 if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
63   as_unset=unset
64 else
65   as_unset=false
66 fi
67
68 # NLS nuisances.
69 $as_unset LANG || test "${LANG+set}" != set || { LANG=C; export LANG; }
70 $as_unset LC_ALL || test "${LC_ALL+set}" != set || { LC_ALL=C; export LC_ALL; }
71 $as_unset LC_TIME || test "${LC_TIME+set}" != set || { LC_TIME=C; export LC_TIME; }
72 $as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set || { LC_CTYPE=C; export LC_CTYPE; }
73 $as_unset LANGUAGE || test "${LANGUAGE+set}" != set || { LANGUAGE=C; export LANGUAGE; }
74 $as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set || { LC_COLLATE=C; export LC_COLLATE; }
75 $as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set || { LC_NUMERIC=C; export LC_NUMERIC; }
76 $as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set || { LC_MESSAGES=C; export LC_MESSAGES; }
77
78 # IFS
79 # We need space, tab and new line, in precisely that order.
80 as_nl='
81 '
82 IFS="   $as_nl"
83
84 # CDPATH.
85 $as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=:; export CDPATH; }
86
87 # Name of the host.
88 # hostname on some systems (SVR3.2, Linux) returns a bogus exit status,
89 # so uname gets run too.
90 ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
91
92 exec 6>&1
93
94 #
95 # Initializations.
96 #
97 ac_default_prefix=/usr/local
98 cross_compiling=no
99 subdirs=
100 MFLAGS= MAKEFLAGS=
101 SHELL=${CONFIG_SHELL-/bin/sh}
102
103 # Maximum number of lines to put in a shell here document.
104 # This variable seems obsolete.  It should probably be removed, and
105 # only ac_max_sed_lines should be used.
106 : ${ac_max_here_lines=38}
107
108 ac_unique_file="gen/gen.c"
109
110 # Initialize some variables set by options.
111 ac_init_help=
112 ac_init_version=false
113 # The variables have the same names as the options, with
114 # dashes changed to underlines.
115 cache_file=/dev/null
116 exec_prefix=NONE
117 no_create=
118 no_recursion=
119 prefix=NONE
120 program_prefix=NONE
121 program_suffix=NONE
122 program_transform_name=s,x,x,
123 silent=
124 site=
125 srcdir=
126 verbose=
127 x_includes=NONE
128 x_libraries=NONE
129
130 # Installation directory options.
131 # These are left unexpanded so users can "make install exec_prefix=/foo"
132 # and all the variables that are supposed to be based on exec_prefix
133 # by default will actually change.
134 # Use braces instead of parens because sh, perl, etc. also accept them.
135 bindir='${exec_prefix}/bin'
136 sbindir='${exec_prefix}/sbin'
137 libexecdir='${exec_prefix}/libexec'
138 datarootdir='${prefix}/share'
139 datadir='${datarootdir}'
140 sysconfdir='${prefix}/etc'
141 sharedstatedir='${prefix}/com'
142 localstatedir='${prefix}/var'
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   -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
286     ac_prev=mandir ;;
287   -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
288     mandir=$ac_optarg ;;
289
290   -nfp | --nfp | --nf)
291     # Obsolete; use --without-fp.
292     with_fp=no ;;
293
294   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
295   | --no-cr | --no-c)
296     no_create=yes ;;
297
298   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
299   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
300     no_recursion=yes ;;
301
302   -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
303   | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
304   | --oldin | --oldi | --old | --ol | --o)
305     ac_prev=oldincludedir ;;
306   -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
307   | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
308   | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
309     oldincludedir=$ac_optarg ;;
310
311   -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
312     ac_prev=prefix ;;
313   -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
314     prefix=$ac_optarg ;;
315
316   -program-prefix | --program-prefix | --program-prefi | --program-pref \
317   | --program-pre | --program-pr | --program-p)
318     ac_prev=program_prefix ;;
319   -program-prefix=* | --program-prefix=* | --program-prefi=* \
320   | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
321     program_prefix=$ac_optarg ;;
322
323   -program-suffix | --program-suffix | --program-suffi | --program-suff \
324   | --program-suf | --program-su | --program-s)
325     ac_prev=program_suffix ;;
326   -program-suffix=* | --program-suffix=* | --program-suffi=* \
327   | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
328     program_suffix=$ac_optarg ;;
329
330   -program-transform-name | --program-transform-name \
331   | --program-transform-nam | --program-transform-na \
332   | --program-transform-n | --program-transform- \
333   | --program-transform | --program-transfor \
334   | --program-transfo | --program-transf \
335   | --program-trans | --program-tran \
336   | --progr-tra | --program-tr | --program-t)
337     ac_prev=program_transform_name ;;
338   -program-transform-name=* | --program-transform-name=* \
339   | --program-transform-nam=* | --program-transform-na=* \
340   | --program-transform-n=* | --program-transform-=* \
341   | --program-transform=* | --program-transfor=* \
342   | --program-transfo=* | --program-transf=* \
343   | --program-trans=* | --program-tran=* \
344   | --progr-tra=* | --program-tr=* | --program-t=*)
345     program_transform_name=$ac_optarg ;;
346
347   -q | -quiet | --quiet | --quie | --qui | --qu | --q \
348   | -silent | --silent | --silen | --sile | --sil)
349     silent=yes ;;
350
351   -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
352     ac_prev=sbindir ;;
353   -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
354   | --sbi=* | --sb=*)
355     sbindir=$ac_optarg ;;
356
357   -sharedstatedir | --sharedstatedir | --sharedstatedi \
358   | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
359   | --sharedst | --shareds | --shared | --share | --shar \
360   | --sha | --sh)
361     ac_prev=sharedstatedir ;;
362   -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
363   | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
364   | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
365   | --sha=* | --sh=*)
366     sharedstatedir=$ac_optarg ;;
367
368   -site | --site | --sit)
369     ac_prev=site ;;
370   -site=* | --site=* | --sit=*)
371     site=$ac_optarg ;;
372
373   -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
374     ac_prev=srcdir ;;
375   -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
376     srcdir=$ac_optarg ;;
377
378   -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
379   | --syscon | --sysco | --sysc | --sys | --sy)
380     ac_prev=sysconfdir ;;
381   -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
382   | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
383     sysconfdir=$ac_optarg ;;
384
385   -target | --target | --targe | --targ | --tar | --ta | --t)
386     ac_prev=target_alias ;;
387   -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
388     target_alias=$ac_optarg ;;
389
390   -v | -verbose | --verbose | --verbos | --verbo | --verb)
391     verbose=yes ;;
392
393   -version | --version | --versio | --versi | --vers | -V)
394     ac_init_version=: ;;
395
396   -with-* | --with-*)
397     ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
398     # Reject names that are not valid shell variable names.
399     expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
400       { echo "$as_me: error: invalid package name: $ac_package" >&2
401    { (exit 1); exit 1; }; }
402     ac_package=`echo $ac_package| sed 's/-/_/g'`
403     case $ac_option in
404       *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
405       *) ac_optarg=yes ;;
406     esac
407     eval "with_$ac_package='$ac_optarg'" ;;
408
409   -without-* | --without-*)
410     ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'`
411     # Reject names that are not valid shell variable names.
412     expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
413       { echo "$as_me: error: invalid package name: $ac_package" >&2
414    { (exit 1); exit 1; }; }
415     ac_package=`echo $ac_package | sed 's/-/_/g'`
416     eval "with_$ac_package=no" ;;
417
418   --x)
419     # Obsolete; use --with-x.
420     with_x=yes ;;
421
422   -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
423   | --x-incl | --x-inc | --x-in | --x-i)
424     ac_prev=x_includes ;;
425   -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
426   | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
427     x_includes=$ac_optarg ;;
428
429   -x-libraries | --x-libraries | --x-librarie | --x-librari \
430   | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
431     ac_prev=x_libraries ;;
432   -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
433   | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
434     x_libraries=$ac_optarg ;;
435
436   -*) { echo "$as_me: error: unrecognized option: $ac_option
437 Try \`$0 --help' for more information." >&2
438    { (exit 1); exit 1; }; }
439     ;;
440
441   *=*)
442     ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
443     # Reject names that are not valid shell variable names.
444     expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null &&
445       { echo "$as_me: error: invalid variable name: $ac_envvar" >&2
446    { (exit 1); exit 1; }; }
447     ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`
448     eval "$ac_envvar='$ac_optarg'"
449     export $ac_envvar ;;
450
451   *)
452     # FIXME: should be removed in autoconf 3.0.
453     echo "$as_me: WARNING: you should use --build, --host, --target" >&2
454     expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
455       echo "$as_me: WARNING: invalid host type: $ac_option" >&2
456     : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}
457     ;;
458
459   esac
460 done
461
462 if test -n "$ac_prev"; then
463   ac_option=--`echo $ac_prev | sed 's/_/-/g'`
464   { echo "$as_me: error: missing argument to $ac_option" >&2
465    { (exit 1); exit 1; }; }
466 fi
467
468 # Be sure to have absolute paths.
469 for ac_var in exec_prefix prefix
470 do
471   eval ac_val=$`echo $ac_var`
472   case $ac_val in
473     [\\/$]* | ?:[\\/]* | NONE | '' ) ;;
474     *)  { echo "$as_me: error: expected an absolute path for --$ac_var: $ac_val" >&2
475    { (exit 1); exit 1; }; };;
476   esac
477 done
478
479 # Be sure to have absolute paths.
480 for ac_var in bindir sbindir libexecdir datarootdir datadir sysconfdir sharedstatedir \
481               localstatedir libdir includedir oldincludedir infodir mandir
482 do
483   eval ac_val=$`echo $ac_var`
484   case $ac_val in
485     [\\/$]* | ?:[\\/]* ) ;;
486     *)  { echo "$as_me: error: expected an absolute path for --$ac_var: $ac_val" >&2
487    { (exit 1); exit 1; }; };;
488   esac
489 done
490
491 # There might be people who depend on the old broken behavior: `$host'
492 # used to hold the argument of --host etc.
493 build=$build_alias
494 host=$host_alias
495 target=$target_alias
496
497 # FIXME: should be removed in autoconf 3.0.
498 if test "x$host_alias" != x; then
499   if test "x$build_alias" = x; then
500     cross_compiling=maybe
501     echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host.
502     If a cross compiler is detected then cross compile mode will be used." >&2
503   elif test "x$build_alias" != "x$host_alias"; then
504     cross_compiling=yes
505   fi
506 fi
507
508 ac_tool_prefix=
509 test -n "$host_alias" && ac_tool_prefix=$host_alias-
510
511 test "$silent" = yes && exec 6>/dev/null
512
513 # Find the source files, if location was not specified.
514 if test -z "$srcdir"; then
515   ac_srcdir_defaulted=yes
516   # Try the directory containing this script, then its parent.
517   ac_prog=$0
518   ac_confdir=`echo "$ac_prog" | sed 's%[\\/][^\\/][^\\/]*$%%'`
519   test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
520   srcdir=$ac_confdir
521   if test ! -r $srcdir/$ac_unique_file; then
522     srcdir=..
523   fi
524 else
525   ac_srcdir_defaulted=no
526 fi
527 if test ! -r $srcdir/$ac_unique_file; then
528   if test "$ac_srcdir_defaulted" = yes; then
529     { echo "$as_me: error: cannot find sources in $ac_confdir or .." >&2
530    { (exit 1); exit 1; }; }
531   else
532     { echo "$as_me: error: cannot find sources in $srcdir" >&2
533    { (exit 1); exit 1; }; }
534   fi
535 fi
536 srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'`
537 ac_env_build_alias_set=${build_alias+set}
538 ac_env_build_alias_value=$build_alias
539 ac_cv_env_build_alias_set=${build_alias+set}
540 ac_cv_env_build_alias_value=$build_alias
541 ac_env_host_alias_set=${host_alias+set}
542 ac_env_host_alias_value=$host_alias
543 ac_cv_env_host_alias_set=${host_alias+set}
544 ac_cv_env_host_alias_value=$host_alias
545 ac_env_target_alias_set=${target_alias+set}
546 ac_env_target_alias_value=$target_alias
547 ac_cv_env_target_alias_set=${target_alias+set}
548 ac_cv_env_target_alias_value=$target_alias
549 ac_env_CC_set=${CC+set}
550 ac_env_CC_value=$CC
551 ac_cv_env_CC_set=${CC+set}
552 ac_cv_env_CC_value=$CC
553 ac_env_CFLAGS_set=${CFLAGS+set}
554 ac_env_CFLAGS_value=$CFLAGS
555 ac_cv_env_CFLAGS_set=${CFLAGS+set}
556 ac_cv_env_CFLAGS_value=$CFLAGS
557 ac_env_LDFLAGS_set=${LDFLAGS+set}
558 ac_env_LDFLAGS_value=$LDFLAGS
559 ac_cv_env_LDFLAGS_set=${LDFLAGS+set}
560 ac_cv_env_LDFLAGS_value=$LDFLAGS
561 ac_env_CPPFLAGS_set=${CPPFLAGS+set}
562 ac_env_CPPFLAGS_value=$CPPFLAGS
563 ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set}
564 ac_cv_env_CPPFLAGS_value=$CPPFLAGS
565 ac_env_CPP_set=${CPP+set}
566 ac_env_CPP_value=$CPP
567 ac_cv_env_CPP_set=${CPP+set}
568 ac_cv_env_CPP_value=$CPP
569
570 #
571 # Report the --help message.
572 #
573 if test "$ac_init_help" = "long"; then
574   # Omit some internal or obsolete options to make the list less imposing.
575   # This message is too long to be a string in the A/UX 3.1 sh.
576   cat <<EOF
577 \`configure' configures this package to adapt to many kinds of systems.
578
579 Usage: $0 [OPTION]... [VAR=VALUE]...
580
581 To assign environment variables (e.g., CC, CFLAGS...), specify them as
582 VAR=VALUE.  See below for descriptions of some of the useful variables.
583
584 Defaults for the options are specified in brackets.
585
586 Configuration:
587   -h, --help              display this help and exit
588       --help=short        display options specific to this package
589       --help=recursive    display the short help of all the included packages
590   -V, --version           display version information and exit
591   -q, --quiet, --silent   do not print \`checking...' messages
592       --cache-file=FILE   cache test results in FILE [disabled]
593   -C, --config-cache      alias for \`--cache-file=config.cache'
594   -n, --no-create         do not create output files
595       --srcdir=DIR        find the sources in DIR [configure dir or \`..']
596
597 EOF
598
599   cat <<EOF
600 Installation directories:
601   --prefix=PREFIX         install architecture-independent files in PREFIX
602                           [$ac_default_prefix]
603   --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
604                           [PREFIX]
605
606 By default, \`make install' will install all the files in
607 \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc.  You can specify
608 an installation prefix other than \`$ac_default_prefix' using \`--prefix',
609 for instance \`--prefix=\$HOME'.
610
611 For better control, use the options below.
612
613 Fine tuning of the installation directories:
614   --bindir=DIR            user executables [EPREFIX/bin]
615   --sbindir=DIR           system admin executables [EPREFIX/sbin]
616   --libexecdir=DIR        program executables [EPREFIX/libexec]
617   --datarootdir=DIR       read-only architecture-independent data [PREFIX/share]
618   --datadir=DIR           read-only architecture-independent data [DATAROOTDIR]
619   --sysconfdir=DIR        read-only single-machine data [PREFIX/etc]
620   --sharedstatedir=DIR    modifiable architecture-independent data [PREFIX/com]
621   --localstatedir=DIR     modifiable single-machine data [PREFIX/var]
622   --libdir=DIR            object code libraries [EPREFIX/lib]
623   --includedir=DIR        C header files [PREFIX/include]
624   --oldincludedir=DIR     C header files for non-gcc [/usr/include]
625   --infodir=DIR           info documentation [DATAROOTDIR/info]
626   --mandir=DIR            man documentation [DATAROOTDIR/man]
627 EOF
628
629   cat <<\EOF
630
631 Program names:
632   --program-prefix=PREFIX            prepend PREFIX to installed program names
633   --program-suffix=SUFFIX            append SUFFIX to installed program names
634   --program-transform-name=PROGRAM   run sed PROGRAM on installed program names
635
636 System types:
637   --build=BUILD           configure for building on BUILD [guessed]
638   --host=HOST       build programs to run on HOST [BUILD]
639   --target=TARGET   configure for building compilers for TARGET [HOST]
640 EOF
641 fi
642
643 if test -n "$ac_init_help"; then
644
645   cat <<\EOF
646
647 Optional Packages:
648   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
649   --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
650
651 Optional Features:
652   --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
653   --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
654
655   --with-system-type=XXX  test: override derived host system-type
656   --with-pkg-config{=path} enable/disable use of pkg-config
657   --with-pkg-config-libdir=XXX use given directory for installing pc-files
658   --without-tests         suppress build with test-programs
659   --enable-mixed-case     tic should assume mixed-case filenames
660   --with-install-prefix   prefixes actual install-location ($DESTDIR)
661 Build-Tools Needed to Compile Temporary Applications for Cross-compiling:
662   --with-build-cc=XXX     the build C compiler ($BUILD_CC)
663   --with-build-cpp=XXX    the build C preprocessor ($BUILD_CPP)
664   --with-build-cflags=XXX the build C compiler-flags ($BUILD_CFLAGS)
665   --with-build-cppflags=XXX the build C preprocessor-flags ($BUILD_CPPFLAGS)
666   --with-build-ldflags=XXX the build linker-flags ($BUILD_LDFLAGS)
667   --with-build-libs=XXX   the build libraries (${BUILD_LIBS})
668 Options to Specify the Libraries Built/Used:
669   --with-shared           generate shared C-objects (needed for --with-ada-sharedlib)
670   --with-curses-dir=DIR   directory in which (n)curses is installed
671   --enable-widec          compile with wide-char/UTF-8 code
672   --with-lib-prefix       override library-prefix
673   --with-shlib-version=X  Specify rel or abi version for shared libs
674   --enable-rpath-link     link sample programs with rpath option
675 Fine-Tuning Your Configuration:
676   --enable-broken_linker  compile with broken-linker support code
677   --disable-largefile     omit support for large files
678   --with-rcs-ids          compile-in RCS identifiers
679 Extensions:
680   --disable-ext-funcs     disable function-extensions
681   --enable-const          compile with extra/non-standard const
682 Development Code:
683   --without-develop       disable development options
684 Experimental Code:
685   --with-pthread          use POSIX thread library
686   --enable-weak-symbols   enable weak-symbols for pthreads
687   --enable-reentrant      compile with experimental reentrant code
688   --with-wrap-prefix=XXX  override prefix used for public variables
689 Testing/development Options:
690   --disable-echo          do not display "compiling" commands
691   --enable-warnings       build: turn on GCC compiler warnings
692   --enable-assertions     test: turn on generation of assertion code
693   --enable-expanded       test: generate functions for certain macros
694   --disable-macros        test: use functions rather than macros
695   --with-trace            test: add trace() function to all models of ncurses
696   --disable-gnat-projects test: disable GNAT projects even if usable
697 Ada95 Binding Options:
698   --with-ada-compiler=CMD specify Ada95 compiler command (default gnatmake)
699   --with-ada-include=DIR  Ada includes are in DIR (default: PREFIX/share/ada/adainclude)
700   --with-ada-objects=DIR  Ada objects are in DIR (default: PREFIX/lib/ada/adalib)
701   --with-ada-sharedlib=soname build shared-library (requires GNAT projects)
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.20141204.  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 include/ncurses_cfg.h:include/ncurses_cfg.hin"
999
1000 top_builddir=`pwd`
1001
1002 ac_aux_dir=
1003 for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
1004   if test -f $ac_dir/install-sh; then
1005     ac_aux_dir=$ac_dir
1006     ac_install_sh="$ac_aux_dir/install-sh -c"
1007     break
1008   elif test -f $ac_dir/install.sh; then
1009     ac_aux_dir=$ac_dir
1010     ac_install_sh="$ac_aux_dir/install.sh -c"
1011     break
1012   elif test -f $ac_dir/shtool; then
1013     ac_aux_dir=$ac_dir
1014     ac_install_sh="$ac_aux_dir/shtool install -c"
1015     break
1016   fi
1017 done
1018 if test -z "$ac_aux_dir"; then
1019   { { echo "$as_me:1019: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5
1020 echo "$as_me: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&2;}
1021    { (exit 1); exit 1; }; }
1022 fi
1023 ac_config_guess="$SHELL $ac_aux_dir/config.guess"
1024 ac_config_sub="$SHELL $ac_aux_dir/config.sub"
1025 ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure.
1026
1027 # Make sure we can run config.sub.
1028 $ac_config_sub sun4 >/dev/null 2>&1 ||
1029   { { echo "$as_me:1029: error: cannot run $ac_config_sub" >&5
1030 echo "$as_me: error: cannot run $ac_config_sub" >&2;}
1031    { (exit 1); exit 1; }; }
1032
1033 echo "$as_me:1033: checking build system type" >&5
1034 echo $ECHO_N "checking build system type... $ECHO_C" >&6
1035 if test "${ac_cv_build+set}" = set; then
1036   echo $ECHO_N "(cached) $ECHO_C" >&6
1037 else
1038   ac_cv_build_alias=$build_alias
1039 test -z "$ac_cv_build_alias" &&
1040   ac_cv_build_alias=`$ac_config_guess`
1041 test -z "$ac_cv_build_alias" &&
1042   { { echo "$as_me:1042: error: cannot guess build type; you must specify one" >&5
1043 echo "$as_me: error: cannot guess build type; you must specify one" >&2;}
1044    { (exit 1); exit 1; }; }
1045 ac_cv_build=`$ac_config_sub $ac_cv_build_alias` ||
1046   { { echo "$as_me:1046: error: $ac_config_sub $ac_cv_build_alias failed." >&5
1047 echo "$as_me: error: $ac_config_sub $ac_cv_build_alias failed." >&2;}
1048    { (exit 1); exit 1; }; }
1049
1050 fi
1051 echo "$as_me:1051: result: $ac_cv_build" >&5
1052 echo "${ECHO_T}$ac_cv_build" >&6
1053 build=$ac_cv_build
1054 build_cpu=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
1055 build_vendor=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
1056 build_os=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
1057
1058 echo "$as_me:1058: checking host system type" >&5
1059 echo $ECHO_N "checking host system type... $ECHO_C" >&6
1060 if test "${ac_cv_host+set}" = set; then
1061   echo $ECHO_N "(cached) $ECHO_C" >&6
1062 else
1063   ac_cv_host_alias=$host_alias
1064 test -z "$ac_cv_host_alias" &&
1065   ac_cv_host_alias=$ac_cv_build_alias
1066 ac_cv_host=`$ac_config_sub $ac_cv_host_alias` ||
1067   { { echo "$as_me:1067: error: $ac_config_sub $ac_cv_host_alias failed" >&5
1068 echo "$as_me: error: $ac_config_sub $ac_cv_host_alias failed" >&2;}
1069    { (exit 1); exit 1; }; }
1070
1071 fi
1072 echo "$as_me:1072: result: $ac_cv_host" >&5
1073 echo "${ECHO_T}$ac_cv_host" >&6
1074 host=$ac_cv_host
1075 host_cpu=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
1076 host_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
1077 host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
1078
1079 if test -f $srcdir/config.guess || test -f $ac_aux_dir/config.guess ; then
1080         echo "$as_me:1080: checking target system type" >&5
1081 echo $ECHO_N "checking target system type... $ECHO_C" >&6
1082 if test "${ac_cv_target+set}" = set; then
1083   echo $ECHO_N "(cached) $ECHO_C" >&6
1084 else
1085   ac_cv_target_alias=$target_alias
1086 test "x$ac_cv_target_alias" = "x" &&
1087   ac_cv_target_alias=$ac_cv_host_alias
1088 ac_cv_target=`$ac_config_sub $ac_cv_target_alias` ||
1089   { { echo "$as_me:1089: error: $ac_config_sub $ac_cv_target_alias failed" >&5
1090 echo "$as_me: error: $ac_config_sub $ac_cv_target_alias failed" >&2;}
1091    { (exit 1); exit 1; }; }
1092
1093 fi
1094 echo "$as_me:1094: result: $ac_cv_target" >&5
1095 echo "${ECHO_T}$ac_cv_target" >&6
1096 target=$ac_cv_target
1097 target_cpu=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
1098 target_vendor=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
1099 target_os=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
1100
1101 # The aliases save the names the user supplied, while $host etc.
1102 # will get canonicalized.
1103 test -n "$target_alias" &&
1104   test "$program_prefix$program_suffix$program_transform_name" = \
1105     NONENONEs,x,x, &&
1106   program_prefix=${target_alias}-
1107         system_name="$host_os"
1108 else
1109         system_name="`(uname -s -r) 2>/dev/null`"
1110         if test -z "$system_name" ; then
1111                 system_name="`(hostname) 2>/dev/null`"
1112         fi
1113 fi
1114 test -n "$system_name" &&
1115 cat >>confdefs.h <<EOF
1116 #define SYSTEM_NAME "$system_name"
1117 EOF
1118
1119 if test "${cf_cv_system_name+set}" = set; then
1120   echo $ECHO_N "(cached) $ECHO_C" >&6
1121 else
1122   cf_cv_system_name="$system_name"
1123 fi
1124
1125 test -z "$system_name" && system_name="$cf_cv_system_name"
1126 test -n "$cf_cv_system_name" && echo "$as_me:1126: result: Configuring for $cf_cv_system_name" >&5
1127 echo "${ECHO_T}Configuring for $cf_cv_system_name" >&6
1128
1129 if test ".$system_name" != ".$cf_cv_system_name" ; then
1130         echo "$as_me:1130: result: Cached system name ($system_name) does not agree with actual ($cf_cv_system_name)" >&5
1131 echo "${ECHO_T}Cached system name ($system_name) does not agree with actual ($cf_cv_system_name)" >&6
1132         { { echo "$as_me:1132: error: \"Please remove config.cache and try again.\"" >&5
1133 echo "$as_me: error: \"Please remove config.cache and try again.\"" >&2;}
1134    { (exit 1); exit 1; }; }
1135 fi
1136
1137 # Check whether --with-system-type or --without-system-type was given.
1138 if test "${with_system_type+set}" = set; then
1139   withval="$with_system_type"
1140   { echo "$as_me:1140: WARNING: overriding system type to $withval" >&5
1141 echo "$as_me: WARNING: overriding system type to $withval" >&2;}
1142         cf_cv_system_name=$withval
1143         host_os=$withval
1144
1145 fi;
1146
1147 ###     Save the given $CFLAGS to allow user-override.
1148 cf_user_CFLAGS="$CFLAGS"
1149
1150 ###     Default install-location
1151
1152 echo "$as_me:1152: checking for prefix" >&5
1153 echo $ECHO_N "checking for prefix... $ECHO_C" >&6
1154 if test "x$prefix" = "xNONE" ; then
1155         case "$cf_cv_system_name" in
1156                 # non-vendor systems don't have a conflict
1157         (openbsd*|freebsd*|mirbsd*|linux*|cygwin*|msys*|k*bsd*-gnu|mingw*)
1158                 prefix=/usr
1159                 ;;
1160         (*)     prefix=$ac_default_prefix
1161                 ;;
1162         esac
1163 fi
1164 echo "$as_me:1164: result: $prefix" >&5
1165 echo "${ECHO_T}$prefix" >&6
1166
1167 if test "x$prefix" = "xNONE" ; then
1168 echo "$as_me:1168: checking for default include-directory" >&5
1169 echo $ECHO_N "checking for default include-directory... $ECHO_C" >&6
1170 test -n "$verbose" && echo 1>&6
1171 for cf_symbol in \
1172         $includedir \
1173         $includedir/ncurses \
1174         $prefix/include \
1175         $prefix/include/ncurses \
1176         /usr/local/include \
1177         /usr/local/include/ncurses \
1178         /usr/include \
1179         /usr/include/ncurses
1180 do
1181         cf_dir=`eval echo $cf_symbol`
1182         if test -f $cf_dir/curses.h ; then
1183         if ( fgrep NCURSES_VERSION $cf_dir/curses.h 2>&1 >/dev/null ) ; then
1184                 includedir="$cf_symbol"
1185                 test -n "$verbose"  && echo $ac_n "     found " 1>&6
1186                 break
1187         fi
1188         fi
1189         test -n "$verbose"  && echo "   tested $cf_dir" 1>&6
1190 done
1191 echo "$as_me:1191: result: $includedir" >&5
1192 echo "${ECHO_T}$includedir" >&6
1193 fi
1194
1195 ###     Checks for programs.
1196
1197 ac_ext=c
1198 ac_cpp='$CPP $CPPFLAGS'
1199 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
1200 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
1201 ac_compiler_gnu=$ac_cv_c_compiler_gnu
1202 ac_main_return=return
1203 if test -n "$ac_tool_prefix"; then
1204   for ac_prog in gnatgcc gcc cc
1205   do
1206     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
1207 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
1208 echo "$as_me:1208: checking for $ac_word" >&5
1209 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1210 if test "${ac_cv_prog_CC+set}" = set; then
1211   echo $ECHO_N "(cached) $ECHO_C" >&6
1212 else
1213   if test -n "$CC"; then
1214   ac_cv_prog_CC="$CC" # Let the user override the test.
1215 else
1216   ac_save_IFS=$IFS; IFS=$ac_path_separator
1217 ac_dummy="$PATH"
1218 for ac_dir in $ac_dummy; do
1219   IFS=$ac_save_IFS
1220   test -z "$ac_dir" && ac_dir=.
1221   $as_executable_p "$ac_dir/$ac_word" || continue
1222 ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
1223 echo "$as_me:1223: found $ac_dir/$ac_word" >&5
1224 break
1225 done
1226
1227 fi
1228 fi
1229 CC=$ac_cv_prog_CC
1230 if test -n "$CC"; then
1231   echo "$as_me:1231: result: $CC" >&5
1232 echo "${ECHO_T}$CC" >&6
1233 else
1234   echo "$as_me:1234: result: no" >&5
1235 echo "${ECHO_T}no" >&6
1236 fi
1237
1238     test -n "$CC" && break
1239   done
1240 fi
1241 if test -z "$CC"; then
1242   ac_ct_CC=$CC
1243   for ac_prog in gnatgcc gcc cc
1244 do
1245   # Extract the first word of "$ac_prog", so it can be a program name with args.
1246 set dummy $ac_prog; ac_word=$2
1247 echo "$as_me:1247: checking for $ac_word" >&5
1248 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1249 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
1250   echo $ECHO_N "(cached) $ECHO_C" >&6
1251 else
1252   if test -n "$ac_ct_CC"; then
1253   ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
1254 else
1255   ac_save_IFS=$IFS; IFS=$ac_path_separator
1256 ac_dummy="$PATH"
1257 for ac_dir in $ac_dummy; do
1258   IFS=$ac_save_IFS
1259   test -z "$ac_dir" && ac_dir=.
1260   $as_executable_p "$ac_dir/$ac_word" || continue
1261 ac_cv_prog_ac_ct_CC="$ac_prog"
1262 echo "$as_me:1262: found $ac_dir/$ac_word" >&5
1263 break
1264 done
1265
1266 fi
1267 fi
1268 ac_ct_CC=$ac_cv_prog_ac_ct_CC
1269 if test -n "$ac_ct_CC"; then
1270   echo "$as_me:1270: result: $ac_ct_CC" >&5
1271 echo "${ECHO_T}$ac_ct_CC" >&6
1272 else
1273   echo "$as_me:1273: result: no" >&5
1274 echo "${ECHO_T}no" >&6
1275 fi
1276
1277   test -n "$ac_ct_CC" && break
1278 done
1279
1280   CC=$ac_ct_CC
1281 fi
1282
1283 test -z "$CC" && { { echo "$as_me:1283: error: no acceptable cc found in \$PATH" >&5
1284 echo "$as_me: error: no acceptable cc found in \$PATH" >&2;}
1285    { (exit 1); exit 1; }; }
1286
1287 # Provide some information about the compiler.
1288 echo "$as_me:1288:" \
1289      "checking for C compiler version" >&5
1290 ac_compiler=`set X $ac_compile; echo $2`
1291 { (eval echo "$as_me:1291: \"$ac_compiler --version </dev/null >&5\"") >&5
1292   (eval $ac_compiler --version </dev/null >&5) 2>&5
1293   ac_status=$?
1294   echo "$as_me:1294: \$? = $ac_status" >&5
1295   (exit $ac_status); }
1296 { (eval echo "$as_me:1296: \"$ac_compiler -v </dev/null >&5\"") >&5
1297   (eval $ac_compiler -v </dev/null >&5) 2>&5
1298   ac_status=$?
1299   echo "$as_me:1299: \$? = $ac_status" >&5
1300   (exit $ac_status); }
1301 { (eval echo "$as_me:1301: \"$ac_compiler -V </dev/null >&5\"") >&5
1302   (eval $ac_compiler -V </dev/null >&5) 2>&5
1303   ac_status=$?
1304   echo "$as_me:1304: \$? = $ac_status" >&5
1305   (exit $ac_status); }
1306
1307 cat >conftest.$ac_ext <<_ACEOF
1308 #line 1308 "configure"
1309 #include "confdefs.h"
1310
1311 int
1312 main ()
1313 {
1314
1315   ;
1316   return 0;
1317 }
1318 _ACEOF
1319 ac_clean_files_save=$ac_clean_files
1320 ac_clean_files="$ac_clean_files a.out a.exe"
1321 # Try to create an executable without -o first, disregard a.out.
1322 # It will help us diagnose broken compilers, and finding out an intuition
1323 # of exeext.
1324 echo "$as_me:1324: checking for C compiler default output" >&5
1325 echo $ECHO_N "checking for C compiler default output... $ECHO_C" >&6
1326 ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
1327 if { (eval echo "$as_me:1327: \"$ac_link_default\"") >&5
1328   (eval $ac_link_default) 2>&5
1329   ac_status=$?
1330   echo "$as_me:1330: \$? = $ac_status" >&5
1331   (exit $ac_status); }; then
1332   # Find the output, starting from the most likely.  This scheme is
1333 # not robust to junk in `.', hence go to wildcards (a.*) only as a last
1334 # resort.
1335 for ac_file in `ls a.exe conftest.exe 2>/dev/null;
1336                 ls a.out conftest 2>/dev/null;
1337                 ls a.* conftest.* 2>/dev/null`; do
1338   case $ac_file in
1339     *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;;
1340     a.out ) # We found the default executable, but exeext='' is most
1341             # certainly right.
1342             break;;
1343     *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
1344           # FIXME: I believe we export ac_cv_exeext for Libtool --akim.
1345           export ac_cv_exeext
1346           break;;
1347     * ) break;;
1348   esac
1349 done
1350 else
1351   echo "$as_me: failed program was:" >&5
1352 cat conftest.$ac_ext >&5
1353 { { echo "$as_me:1353: error: C compiler cannot create executables" >&5
1354 echo "$as_me: error: C compiler cannot create executables" >&2;}
1355    { (exit 77); exit 77; }; }
1356 fi
1357
1358 ac_exeext=$ac_cv_exeext
1359 echo "$as_me:1359: result: $ac_file" >&5
1360 echo "${ECHO_T}$ac_file" >&6
1361
1362 # Check the compiler produces executables we can run.  If not, either
1363 # the compiler is broken, or we cross compile.
1364 echo "$as_me:1364: checking whether the C compiler works" >&5
1365 echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6
1366 # FIXME: These cross compiler hacks should be removed for Autoconf 3.0
1367 # If not cross compiling, check that we can run a simple program.
1368 if test "$cross_compiling" != yes; then
1369   if { ac_try='./$ac_file'
1370   { (eval echo "$as_me:1370: \"$ac_try\"") >&5
1371   (eval $ac_try) 2>&5
1372   ac_status=$?
1373   echo "$as_me:1373: \$? = $ac_status" >&5
1374   (exit $ac_status); }; }; then
1375     cross_compiling=no
1376   else
1377     if test "$cross_compiling" = maybe; then
1378         cross_compiling=yes
1379     else
1380         { { echo "$as_me:1380: error: cannot run C compiled programs.
1381 If you meant to cross compile, use \`--host'." >&5
1382 echo "$as_me: error: cannot run C compiled programs.
1383 If you meant to cross compile, use \`--host'." >&2;}
1384    { (exit 1); exit 1; }; }
1385     fi
1386   fi
1387 fi
1388 echo "$as_me:1388: result: yes" >&5
1389 echo "${ECHO_T}yes" >&6
1390
1391 rm -f a.out a.exe conftest$ac_cv_exeext
1392 ac_clean_files=$ac_clean_files_save
1393 # Check the compiler produces executables we can run.  If not, either
1394 # the compiler is broken, or we cross compile.
1395 echo "$as_me:1395: checking whether we are cross compiling" >&5
1396 echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6
1397 echo "$as_me:1397: result: $cross_compiling" >&5
1398 echo "${ECHO_T}$cross_compiling" >&6
1399
1400 echo "$as_me:1400: checking for executable suffix" >&5
1401 echo $ECHO_N "checking for executable suffix... $ECHO_C" >&6
1402 if { (eval echo "$as_me:1402: \"$ac_link\"") >&5
1403   (eval $ac_link) 2>&5
1404   ac_status=$?
1405   echo "$as_me:1405: \$? = $ac_status" >&5
1406   (exit $ac_status); }; then
1407   # If both `conftest.exe' and `conftest' are `present' (well, observable)
1408 # catch `conftest.exe'.  For instance with Cygwin, `ls conftest' will
1409 # work properly (i.e., refer to `conftest.exe'), while it won't with
1410 # `rm'.
1411 for ac_file in `(ls conftest.exe; ls conftest; ls conftest.*) 2>/dev/null`; do
1412   case $ac_file in
1413     *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;;
1414     *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
1415           export ac_cv_exeext
1416           break;;
1417     * ) break;;
1418   esac
1419 done
1420 else
1421   { { echo "$as_me:1421: error: cannot compute EXEEXT: cannot compile and link" >&5
1422 echo "$as_me: error: cannot compute EXEEXT: cannot compile and link" >&2;}
1423    { (exit 1); exit 1; }; }
1424 fi
1425
1426 rm -f conftest$ac_cv_exeext
1427 echo "$as_me:1427: result: $ac_cv_exeext" >&5
1428 echo "${ECHO_T}$ac_cv_exeext" >&6
1429
1430 rm -f conftest.$ac_ext
1431 EXEEXT=$ac_cv_exeext
1432 ac_exeext=$EXEEXT
1433 echo "$as_me:1433: checking for object suffix" >&5
1434 echo $ECHO_N "checking for object suffix... $ECHO_C" >&6
1435 if test "${ac_cv_objext+set}" = set; then
1436   echo $ECHO_N "(cached) $ECHO_C" >&6
1437 else
1438   cat >conftest.$ac_ext <<_ACEOF
1439 #line 1439 "configure"
1440 #include "confdefs.h"
1441
1442 int
1443 main ()
1444 {
1445
1446   ;
1447   return 0;
1448 }
1449 _ACEOF
1450 rm -f conftest.o conftest.obj
1451 if { (eval echo "$as_me:1451: \"$ac_compile\"") >&5
1452   (eval $ac_compile) 2>&5
1453   ac_status=$?
1454   echo "$as_me:1454: \$? = $ac_status" >&5
1455   (exit $ac_status); }; then
1456   for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do
1457   case $ac_file in
1458     *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.map | *.inf ) ;;
1459     *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
1460        break;;
1461   esac
1462 done
1463 else
1464   echo "$as_me: failed program was:" >&5
1465 cat conftest.$ac_ext >&5
1466 { { echo "$as_me:1466: error: cannot compute OBJEXT: cannot compile" >&5
1467 echo "$as_me: error: cannot compute OBJEXT: cannot compile" >&2;}
1468    { (exit 1); exit 1; }; }
1469 fi
1470
1471 rm -f conftest.$ac_cv_objext conftest.$ac_ext
1472 fi
1473 echo "$as_me:1473: result: $ac_cv_objext" >&5
1474 echo "${ECHO_T}$ac_cv_objext" >&6
1475 OBJEXT=$ac_cv_objext
1476 ac_objext=$OBJEXT
1477 echo "$as_me:1477: checking whether we are using the GNU C compiler" >&5
1478 echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6
1479 if test "${ac_cv_c_compiler_gnu+set}" = set; then
1480   echo $ECHO_N "(cached) $ECHO_C" >&6
1481 else
1482   cat >conftest.$ac_ext <<_ACEOF
1483 #line 1483 "configure"
1484 #include "confdefs.h"
1485
1486 int
1487 main ()
1488 {
1489 #ifndef __GNUC__
1490        choke me
1491 #endif
1492
1493   ;
1494   return 0;
1495 }
1496 _ACEOF
1497 rm -f conftest.$ac_objext
1498 if { (eval echo "$as_me:1498: \"$ac_compile\"") >&5
1499   (eval $ac_compile) 2>&5
1500   ac_status=$?
1501   echo "$as_me:1501: \$? = $ac_status" >&5
1502   (exit $ac_status); } &&
1503          { ac_try='test -s conftest.$ac_objext'
1504   { (eval echo "$as_me:1504: \"$ac_try\"") >&5
1505   (eval $ac_try) 2>&5
1506   ac_status=$?
1507   echo "$as_me:1507: \$? = $ac_status" >&5
1508   (exit $ac_status); }; }; then
1509   ac_compiler_gnu=yes
1510 else
1511   echo "$as_me: failed program was:" >&5
1512 cat conftest.$ac_ext >&5
1513 ac_compiler_gnu=no
1514 fi
1515 rm -f conftest.$ac_objext conftest.$ac_ext
1516 ac_cv_c_compiler_gnu=$ac_compiler_gnu
1517
1518 fi
1519 echo "$as_me:1519: result: $ac_cv_c_compiler_gnu" >&5
1520 echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6
1521 GCC=`test $ac_compiler_gnu = yes && echo yes`
1522 ac_test_CFLAGS=${CFLAGS+set}
1523 ac_save_CFLAGS=$CFLAGS
1524 CFLAGS="-g"
1525 echo "$as_me:1525: checking whether $CC accepts -g" >&5
1526 echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6
1527 if test "${ac_cv_prog_cc_g+set}" = set; then
1528   echo $ECHO_N "(cached) $ECHO_C" >&6
1529 else
1530   cat >conftest.$ac_ext <<_ACEOF
1531 #line 1531 "configure"
1532 #include "confdefs.h"
1533
1534 int
1535 main ()
1536 {
1537
1538   ;
1539   return 0;
1540 }
1541 _ACEOF
1542 rm -f conftest.$ac_objext
1543 if { (eval echo "$as_me:1543: \"$ac_compile\"") >&5
1544   (eval $ac_compile) 2>&5
1545   ac_status=$?
1546   echo "$as_me:1546: \$? = $ac_status" >&5
1547   (exit $ac_status); } &&
1548          { ac_try='test -s conftest.$ac_objext'
1549   { (eval echo "$as_me:1549: \"$ac_try\"") >&5
1550   (eval $ac_try) 2>&5
1551   ac_status=$?
1552   echo "$as_me:1552: \$? = $ac_status" >&5
1553   (exit $ac_status); }; }; then
1554   ac_cv_prog_cc_g=yes
1555 else
1556   echo "$as_me: failed program was:" >&5
1557 cat conftest.$ac_ext >&5
1558 ac_cv_prog_cc_g=no
1559 fi
1560 rm -f conftest.$ac_objext conftest.$ac_ext
1561 fi
1562 echo "$as_me:1562: result: $ac_cv_prog_cc_g" >&5
1563 echo "${ECHO_T}$ac_cv_prog_cc_g" >&6
1564 if test "$ac_test_CFLAGS" = set; then
1565   CFLAGS=$ac_save_CFLAGS
1566 elif test $ac_cv_prog_cc_g = yes; then
1567   if test "$GCC" = yes; then
1568     CFLAGS="-g -O2"
1569   else
1570     CFLAGS="-g"
1571   fi
1572 else
1573   if test "$GCC" = yes; then
1574     CFLAGS="-O2"
1575   else
1576     CFLAGS=
1577   fi
1578 fi
1579 # Some people use a C++ compiler to compile C.  Since we use `exit',
1580 # in C++ we need to declare it.  In case someone uses the same compiler
1581 # for both compiling C and C++ we need to have the C++ compiler decide
1582 # the declaration of exit, since it's the most demanding environment.
1583 cat >conftest.$ac_ext <<_ACEOF
1584 #ifndef __cplusplus
1585   choke me
1586 #endif
1587 _ACEOF
1588 rm -f conftest.$ac_objext
1589 if { (eval echo "$as_me:1589: \"$ac_compile\"") >&5
1590   (eval $ac_compile) 2>&5
1591   ac_status=$?
1592   echo "$as_me:1592: \$? = $ac_status" >&5
1593   (exit $ac_status); } &&
1594          { ac_try='test -s conftest.$ac_objext'
1595   { (eval echo "$as_me:1595: \"$ac_try\"") >&5
1596   (eval $ac_try) 2>&5
1597   ac_status=$?
1598   echo "$as_me:1598: \$? = $ac_status" >&5
1599   (exit $ac_status); }; }; then
1600   for ac_declaration in \
1601    ''\
1602    '#include <stdlib.h>' \
1603    'extern "C" void std::exit (int) throw (); using std::exit;' \
1604    'extern "C" void std::exit (int); using std::exit;' \
1605    'extern "C" void exit (int) throw ();' \
1606    'extern "C" void exit (int);' \
1607    'void exit (int);'
1608 do
1609   cat >conftest.$ac_ext <<_ACEOF
1610 #line 1610 "configure"
1611 #include "confdefs.h"
1612 #include <stdlib.h>
1613 $ac_declaration
1614 int
1615 main ()
1616 {
1617 exit (42);
1618   ;
1619   return 0;
1620 }
1621 _ACEOF
1622 rm -f conftest.$ac_objext
1623 if { (eval echo "$as_me:1623: \"$ac_compile\"") >&5
1624   (eval $ac_compile) 2>&5
1625   ac_status=$?
1626   echo "$as_me:1626: \$? = $ac_status" >&5
1627   (exit $ac_status); } &&
1628          { ac_try='test -s conftest.$ac_objext'
1629   { (eval echo "$as_me:1629: \"$ac_try\"") >&5
1630   (eval $ac_try) 2>&5
1631   ac_status=$?
1632   echo "$as_me:1632: \$? = $ac_status" >&5
1633   (exit $ac_status); }; }; then
1634   :
1635 else
1636   echo "$as_me: failed program was:" >&5
1637 cat conftest.$ac_ext >&5
1638 continue
1639 fi
1640 rm -f conftest.$ac_objext conftest.$ac_ext
1641   cat >conftest.$ac_ext <<_ACEOF
1642 #line 1642 "configure"
1643 #include "confdefs.h"
1644 $ac_declaration
1645 int
1646 main ()
1647 {
1648 exit (42);
1649   ;
1650   return 0;
1651 }
1652 _ACEOF
1653 rm -f conftest.$ac_objext
1654 if { (eval echo "$as_me:1654: \"$ac_compile\"") >&5
1655   (eval $ac_compile) 2>&5
1656   ac_status=$?
1657   echo "$as_me:1657: \$? = $ac_status" >&5
1658   (exit $ac_status); } &&
1659          { ac_try='test -s conftest.$ac_objext'
1660   { (eval echo "$as_me:1660: \"$ac_try\"") >&5
1661   (eval $ac_try) 2>&5
1662   ac_status=$?
1663   echo "$as_me:1663: \$? = $ac_status" >&5
1664   (exit $ac_status); }; }; then
1665   break
1666 else
1667   echo "$as_me: failed program was:" >&5
1668 cat conftest.$ac_ext >&5
1669 fi
1670 rm -f conftest.$ac_objext conftest.$ac_ext
1671 done
1672 rm -rf conftest*
1673 if test -n "$ac_declaration"; then
1674   echo '#ifdef __cplusplus' >>confdefs.h
1675   echo $ac_declaration      >>confdefs.h
1676   echo '#endif'             >>confdefs.h
1677 fi
1678
1679 else
1680   echo "$as_me: failed program was:" >&5
1681 cat conftest.$ac_ext >&5
1682 fi
1683 rm -f conftest.$ac_objext conftest.$ac_ext
1684 ac_ext=c
1685 ac_cpp='$CPP $CPPFLAGS'
1686 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
1687 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
1688 ac_compiler_gnu=$ac_cv_c_compiler_gnu
1689 ac_main_return=return
1690
1691 GCC_VERSION=none
1692 if test "$GCC" = yes ; then
1693         echo "$as_me:1693: checking version of $CC" >&5
1694 echo $ECHO_N "checking version of $CC... $ECHO_C" >&6
1695         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.].*//'`"
1696         test -z "$GCC_VERSION" && GCC_VERSION=unknown
1697         echo "$as_me:1697: result: $GCC_VERSION" >&5
1698 echo "${ECHO_T}$GCC_VERSION" >&6
1699 fi
1700
1701 echo "$as_me:1701: checking for $CC option to accept ANSI C" >&5
1702 echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6
1703 if test "${ac_cv_prog_cc_stdc+set}" = set; then
1704   echo $ECHO_N "(cached) $ECHO_C" >&6
1705 else
1706   ac_cv_prog_cc_stdc=no
1707 ac_save_CC=$CC
1708 cat >conftest.$ac_ext <<_ACEOF
1709 #line 1709 "configure"
1710 #include "confdefs.h"
1711 #include <stdarg.h>
1712 #include <stdio.h>
1713 #include <sys/types.h>
1714 #include <sys/stat.h>
1715 /* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
1716 struct buf { int x; };
1717 FILE * (*rcsopen) (struct buf *, struct stat *, int);
1718 static char *e (p, i)
1719      char **p;
1720      int i;
1721 {
1722   return p[i];
1723 }
1724 static char *f (char * (*g) (char **, int), char **p, ...)
1725 {
1726   char *s;
1727   va_list v;
1728   va_start (v,p);
1729   s = g (p, va_arg (v,int));
1730   va_end (v);
1731   return s;
1732 }
1733 int test (int i, double x);
1734 struct s1 {int (*f) (int a);};
1735 struct s2 {int (*f) (double a);};
1736 int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
1737 int argc;
1738 char **argv;
1739 int
1740 main ()
1741 {
1742 return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
1743   ;
1744   return 0;
1745 }
1746 _ACEOF
1747 # Don't try gcc -ansi; that turns off useful extensions and
1748 # breaks some systems' header files.
1749 # AIX                   -qlanglvl=ansi
1750 # Ultrix and OSF/1      -std1
1751 # HP-UX 10.20 and later -Ae
1752 # HP-UX older versions  -Aa -D_HPUX_SOURCE
1753 # SVR4                  -Xc -D__EXTENSIONS__
1754 for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
1755 do
1756   CC="$ac_save_CC $ac_arg"
1757   rm -f conftest.$ac_objext
1758 if { (eval echo "$as_me:1758: \"$ac_compile\"") >&5
1759   (eval $ac_compile) 2>&5
1760   ac_status=$?
1761   echo "$as_me:1761: \$? = $ac_status" >&5
1762   (exit $ac_status); } &&
1763          { ac_try='test -s conftest.$ac_objext'
1764   { (eval echo "$as_me:1764: \"$ac_try\"") >&5
1765   (eval $ac_try) 2>&5
1766   ac_status=$?
1767   echo "$as_me:1767: \$? = $ac_status" >&5
1768   (exit $ac_status); }; }; then
1769   ac_cv_prog_cc_stdc=$ac_arg
1770 break
1771 else
1772   echo "$as_me: failed program was:" >&5
1773 cat conftest.$ac_ext >&5
1774 fi
1775 rm -f conftest.$ac_objext
1776 done
1777 rm -f conftest.$ac_ext conftest.$ac_objext
1778 CC=$ac_save_CC
1779
1780 fi
1781
1782 case "x$ac_cv_prog_cc_stdc" in
1783   x|xno)
1784     echo "$as_me:1784: result: none needed" >&5
1785 echo "${ECHO_T}none needed" >&6 ;;
1786   *)
1787     echo "$as_me:1787: result: $ac_cv_prog_cc_stdc" >&5
1788 echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6
1789     CC="$CC $ac_cv_prog_cc_stdc" ;;
1790 esac
1791
1792 # This should have been defined by AC_PROG_CC
1793 : ${CC:=cc}
1794
1795 echo "$as_me:1795: checking \$CC variable" >&5
1796 echo $ECHO_N "checking \$CC variable... $ECHO_C" >&6
1797 case "$CC" in
1798 (*[\ \  ]-[IUD]*)
1799         echo "$as_me:1799: result: broken" >&5
1800 echo "${ECHO_T}broken" >&6
1801         { echo "$as_me:1801: WARNING: your environment misuses the CC variable to hold CFLAGS/CPPFLAGS options" >&5
1802 echo "$as_me: WARNING: your environment misuses the CC variable to hold CFLAGS/CPPFLAGS options" >&2;}
1803         # humor him...
1804         cf_flags=`echo "$CC" | sed -e 's/^[^    ]*[     ]//'`
1805         CC=`echo "$CC" | sed -e 's/[    ].*//'`
1806
1807 cf_fix_cppflags=no
1808 cf_new_cflags=
1809 cf_new_cppflags=
1810 cf_new_extra_cppflags=
1811
1812 for cf_add_cflags in $cf_flags
1813 do
1814 case $cf_fix_cppflags in
1815 (no)
1816         case $cf_add_cflags in
1817         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
1818                 case $cf_add_cflags in
1819                 (-D*)
1820                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
1821
1822                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
1823                                 && test -z "${cf_tst_cflags}" \
1824                                 && cf_fix_cppflags=yes
1825
1826                         if test $cf_fix_cppflags = yes ; then
1827                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
1828                                 continue
1829                         elif test "${cf_tst_cflags}" = "\"'" ; then
1830                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
1831                                 continue
1832                         fi
1833                         ;;
1834                 esac
1835                 case "$CPPFLAGS" in
1836                 (*$cf_add_cflags)
1837                         ;;
1838                 (*)
1839                         case $cf_add_cflags in
1840                         (-D*)
1841                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
1842
1843 CPPFLAGS=`echo "$CPPFLAGS" | \
1844         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
1845                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
1846
1847                                 ;;
1848                         esac
1849                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
1850                         ;;
1851                 esac
1852                 ;;
1853         (*)
1854                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
1855                 ;;
1856         esac
1857         ;;
1858 (yes)
1859         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
1860
1861         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
1862
1863         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
1864                 && test -z "${cf_tst_cflags}" \
1865                 && cf_fix_cppflags=no
1866         ;;
1867 esac
1868 done
1869
1870 if test -n "$cf_new_cflags" ; then
1871
1872         CFLAGS="$CFLAGS $cf_new_cflags"
1873 fi
1874
1875 if test -n "$cf_new_cppflags" ; then
1876
1877         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
1878 fi
1879
1880 if test -n "$cf_new_extra_cppflags" ; then
1881
1882         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
1883 fi
1884
1885         ;;
1886 (*)
1887         echo "$as_me:1887: result: ok" >&5
1888 echo "${ECHO_T}ok" >&6
1889         ;;
1890 esac
1891
1892 ac_ext=c
1893 ac_cpp='$CPP $CPPFLAGS'
1894 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
1895 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
1896 ac_compiler_gnu=$ac_cv_c_compiler_gnu
1897 ac_main_return=return
1898 echo "$as_me:1898: checking how to run the C preprocessor" >&5
1899 echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6
1900 # On Suns, sometimes $CPP names a directory.
1901 if test -n "$CPP" && test -d "$CPP"; then
1902   CPP=
1903 fi
1904 if test -z "$CPP"; then
1905   if test "${ac_cv_prog_CPP+set}" = set; then
1906   echo $ECHO_N "(cached) $ECHO_C" >&6
1907 else
1908       # Double quotes because CPP needs to be expanded
1909     for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
1910     do
1911       ac_preproc_ok=false
1912 for ac_c_preproc_warn_flag in '' yes
1913 do
1914   # Use a header file that comes with gcc, so configuring glibc
1915   # with a fresh cross-compiler works.
1916   # On the NeXT, cc -E runs the code through the compiler's parser,
1917   # not just through cpp. "Syntax error" is here to catch this case.
1918   cat >conftest.$ac_ext <<_ACEOF
1919 #line 1919 "configure"
1920 #include "confdefs.h"
1921 #include <assert.h>
1922                      Syntax error
1923 _ACEOF
1924 if { (eval echo "$as_me:1924: \"$ac_cpp conftest.$ac_ext\"") >&5
1925   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
1926   ac_status=$?
1927   egrep -v '^ *\+' conftest.er1 >conftest.err
1928   rm -f conftest.er1
1929   cat conftest.err >&5
1930   echo "$as_me:1930: \$? = $ac_status" >&5
1931   (exit $ac_status); } >/dev/null; then
1932   if test -s conftest.err; then
1933     ac_cpp_err=$ac_c_preproc_warn_flag
1934   else
1935     ac_cpp_err=
1936   fi
1937 else
1938   ac_cpp_err=yes
1939 fi
1940 if test -z "$ac_cpp_err"; then
1941   :
1942 else
1943   echo "$as_me: failed program was:" >&5
1944   cat conftest.$ac_ext >&5
1945   # Broken: fails on valid input.
1946 continue
1947 fi
1948 rm -f conftest.err conftest.$ac_ext
1949
1950   # OK, works on sane cases.  Now check whether non-existent headers
1951   # can be detected and how.
1952   cat >conftest.$ac_ext <<_ACEOF
1953 #line 1953 "configure"
1954 #include "confdefs.h"
1955 #include <ac_nonexistent.h>
1956 _ACEOF
1957 if { (eval echo "$as_me:1957: \"$ac_cpp conftest.$ac_ext\"") >&5
1958   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
1959   ac_status=$?
1960   egrep -v '^ *\+' conftest.er1 >conftest.err
1961   rm -f conftest.er1
1962   cat conftest.err >&5
1963   echo "$as_me:1963: \$? = $ac_status" >&5
1964   (exit $ac_status); } >/dev/null; then
1965   if test -s conftest.err; then
1966     ac_cpp_err=$ac_c_preproc_warn_flag
1967   else
1968     ac_cpp_err=
1969   fi
1970 else
1971   ac_cpp_err=yes
1972 fi
1973 if test -z "$ac_cpp_err"; then
1974   # Broken: success on invalid input.
1975 continue
1976 else
1977   echo "$as_me: failed program was:" >&5
1978   cat conftest.$ac_ext >&5
1979   # Passes both tests.
1980 ac_preproc_ok=:
1981 break
1982 fi
1983 rm -f conftest.err conftest.$ac_ext
1984
1985 done
1986 # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
1987 rm -f conftest.err conftest.$ac_ext
1988 if $ac_preproc_ok; then
1989   break
1990 fi
1991
1992     done
1993     ac_cv_prog_CPP=$CPP
1994
1995 fi
1996   CPP=$ac_cv_prog_CPP
1997 else
1998   ac_cv_prog_CPP=$CPP
1999 fi
2000 echo "$as_me:2000: result: $CPP" >&5
2001 echo "${ECHO_T}$CPP" >&6
2002 ac_preproc_ok=false
2003 for ac_c_preproc_warn_flag in '' yes
2004 do
2005   # Use a header file that comes with gcc, so configuring glibc
2006   # with a fresh cross-compiler works.
2007   # On the NeXT, cc -E runs the code through the compiler's parser,
2008   # not just through cpp. "Syntax error" is here to catch this case.
2009   cat >conftest.$ac_ext <<_ACEOF
2010 #line 2010 "configure"
2011 #include "confdefs.h"
2012 #include <assert.h>
2013                      Syntax error
2014 _ACEOF
2015 if { (eval echo "$as_me:2015: \"$ac_cpp conftest.$ac_ext\"") >&5
2016   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
2017   ac_status=$?
2018   egrep -v '^ *\+' conftest.er1 >conftest.err
2019   rm -f conftest.er1
2020   cat conftest.err >&5
2021   echo "$as_me:2021: \$? = $ac_status" >&5
2022   (exit $ac_status); } >/dev/null; then
2023   if test -s conftest.err; then
2024     ac_cpp_err=$ac_c_preproc_warn_flag
2025   else
2026     ac_cpp_err=
2027   fi
2028 else
2029   ac_cpp_err=yes
2030 fi
2031 if test -z "$ac_cpp_err"; then
2032   :
2033 else
2034   echo "$as_me: failed program was:" >&5
2035   cat conftest.$ac_ext >&5
2036   # Broken: fails on valid input.
2037 continue
2038 fi
2039 rm -f conftest.err conftest.$ac_ext
2040
2041   # OK, works on sane cases.  Now check whether non-existent headers
2042   # can be detected and how.
2043   cat >conftest.$ac_ext <<_ACEOF
2044 #line 2044 "configure"
2045 #include "confdefs.h"
2046 #include <ac_nonexistent.h>
2047 _ACEOF
2048 if { (eval echo "$as_me:2048: \"$ac_cpp conftest.$ac_ext\"") >&5
2049   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
2050   ac_status=$?
2051   egrep -v '^ *\+' conftest.er1 >conftest.err
2052   rm -f conftest.er1
2053   cat conftest.err >&5
2054   echo "$as_me:2054: \$? = $ac_status" >&5
2055   (exit $ac_status); } >/dev/null; then
2056   if test -s conftest.err; then
2057     ac_cpp_err=$ac_c_preproc_warn_flag
2058   else
2059     ac_cpp_err=
2060   fi
2061 else
2062   ac_cpp_err=yes
2063 fi
2064 if test -z "$ac_cpp_err"; then
2065   # Broken: success on invalid input.
2066 continue
2067 else
2068   echo "$as_me: failed program was:" >&5
2069   cat conftest.$ac_ext >&5
2070   # Passes both tests.
2071 ac_preproc_ok=:
2072 break
2073 fi
2074 rm -f conftest.err conftest.$ac_ext
2075
2076 done
2077 # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
2078 rm -f conftest.err conftest.$ac_ext
2079 if $ac_preproc_ok; then
2080   :
2081 else
2082   { { echo "$as_me:2082: error: C preprocessor \"$CPP\" fails sanity check" >&5
2083 echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check" >&2;}
2084    { (exit 1); exit 1; }; }
2085 fi
2086
2087 ac_ext=c
2088 ac_cpp='$CPP $CPPFLAGS'
2089 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
2090 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
2091 ac_compiler_gnu=$ac_cv_c_compiler_gnu
2092 ac_main_return=return
2093
2094 if test $ac_cv_c_compiler_gnu = yes; then
2095     echo "$as_me:2095: checking whether $CC needs -traditional" >&5
2096 echo $ECHO_N "checking whether $CC needs -traditional... $ECHO_C" >&6
2097 if test "${ac_cv_prog_gcc_traditional+set}" = set; then
2098   echo $ECHO_N "(cached) $ECHO_C" >&6
2099 else
2100     ac_pattern="Autoconf.*'x'"
2101   cat >conftest.$ac_ext <<_ACEOF
2102 #line 2102 "configure"
2103 #include "confdefs.h"
2104 #include <sgtty.h>
2105 int Autoconf = TIOCGETP;
2106 _ACEOF
2107 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
2108   egrep "$ac_pattern" >/dev/null 2>&1; then
2109   ac_cv_prog_gcc_traditional=yes
2110 else
2111   ac_cv_prog_gcc_traditional=no
2112 fi
2113 rm -rf conftest*
2114
2115   if test $ac_cv_prog_gcc_traditional = no; then
2116     cat >conftest.$ac_ext <<_ACEOF
2117 #line 2117 "configure"
2118 #include "confdefs.h"
2119 #include <termio.h>
2120 int Autoconf = TCGETA;
2121 _ACEOF
2122 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
2123   egrep "$ac_pattern" >/dev/null 2>&1; then
2124   ac_cv_prog_gcc_traditional=yes
2125 fi
2126 rm -rf conftest*
2127
2128   fi
2129 fi
2130 echo "$as_me:2130: result: $ac_cv_prog_gcc_traditional" >&5
2131 echo "${ECHO_T}$ac_cv_prog_gcc_traditional" >&6
2132   if test $ac_cv_prog_gcc_traditional = yes; then
2133     CC="$CC -traditional"
2134   fi
2135 fi
2136
2137 echo "$as_me:2137: checking whether $CC understands -c and -o together" >&5
2138 echo $ECHO_N "checking whether $CC understands -c and -o together... $ECHO_C" >&6
2139 if test "${cf_cv_prog_CC_c_o+set}" = set; then
2140   echo $ECHO_N "(cached) $ECHO_C" >&6
2141 else
2142
2143 cat > conftest.$ac_ext <<CF_EOF
2144 #include <stdio.h>
2145 int main()
2146 {
2147         ${cf_cv_main_return:-return}(0);
2148 }
2149 CF_EOF
2150 # We do the test twice because some compilers refuse to overwrite an
2151 # existing .o file with -o, though they will create one.
2152 ac_try='$CC -c conftest.$ac_ext -o conftest2.$ac_objext >&5'
2153 if { (eval echo "$as_me:2153: \"$ac_try\"") >&5
2154   (eval $ac_try) 2>&5
2155   ac_status=$?
2156   echo "$as_me:2156: \$? = $ac_status" >&5
2157   (exit $ac_status); } &&
2158   test -f conftest2.$ac_objext && { (eval echo "$as_me:2158: \"$ac_try\"") >&5
2159   (eval $ac_try) 2>&5
2160   ac_status=$?
2161   echo "$as_me:2161: \$? = $ac_status" >&5
2162   (exit $ac_status); };
2163 then
2164   eval cf_cv_prog_CC_c_o=yes
2165 else
2166   eval cf_cv_prog_CC_c_o=no
2167 fi
2168 rm -rf conftest*
2169
2170 fi
2171 if test $cf_cv_prog_CC_c_o = yes; then
2172   echo "$as_me:2172: result: yes" >&5
2173 echo "${ECHO_T}yes" >&6
2174 else
2175   echo "$as_me:2175: result: no" >&5
2176 echo "${ECHO_T}no" >&6
2177 fi
2178
2179 test "$program_prefix" != NONE &&
2180   program_transform_name="s,^,$program_prefix,;$program_transform_name"
2181 # Use a double $ so make ignores it.
2182 test "$program_suffix" != NONE &&
2183   program_transform_name="s,\$,$program_suffix,;$program_transform_name"
2184 # Double any \ or $.  echo might interpret backslashes.
2185 # By default was `s,x,x', remove it if useless.
2186 cat <<\_ACEOF >conftest.sed
2187 s/[\\$]/&&/g;s/;s,x,x,$//
2188 _ACEOF
2189 program_transform_name=`echo $program_transform_name | sed -f conftest.sed`
2190 rm conftest.sed
2191
2192 for ac_prog in mawk gawk nawk awk
2193 do
2194   # Extract the first word of "$ac_prog", so it can be a program name with args.
2195 set dummy $ac_prog; ac_word=$2
2196 echo "$as_me:2196: checking for $ac_word" >&5
2197 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2198 if test "${ac_cv_prog_AWK+set}" = set; then
2199   echo $ECHO_N "(cached) $ECHO_C" >&6
2200 else
2201   if test -n "$AWK"; then
2202   ac_cv_prog_AWK="$AWK" # Let the user override the test.
2203 else
2204   ac_save_IFS=$IFS; IFS=$ac_path_separator
2205 ac_dummy="$PATH"
2206 for ac_dir in $ac_dummy; do
2207   IFS=$ac_save_IFS
2208   test -z "$ac_dir" && ac_dir=.
2209   $as_executable_p "$ac_dir/$ac_word" || continue
2210 ac_cv_prog_AWK="$ac_prog"
2211 echo "$as_me:2211: found $ac_dir/$ac_word" >&5
2212 break
2213 done
2214
2215 fi
2216 fi
2217 AWK=$ac_cv_prog_AWK
2218 if test -n "$AWK"; then
2219   echo "$as_me:2219: result: $AWK" >&5
2220 echo "${ECHO_T}$AWK" >&6
2221 else
2222   echo "$as_me:2222: result: no" >&5
2223 echo "${ECHO_T}no" >&6
2224 fi
2225
2226   test -n "$AWK" && break
2227 done
2228
2229 test -z "$AWK" && { { echo "$as_me:2229: error: No awk program found" >&5
2230 echo "$as_me: error: No awk program found" >&2;}
2231    { (exit 1); exit 1; }; }
2232
2233 echo "$as_me:2233: checking for egrep" >&5
2234 echo $ECHO_N "checking for egrep... $ECHO_C" >&6
2235 if test "${ac_cv_prog_egrep+set}" = set; then
2236   echo $ECHO_N "(cached) $ECHO_C" >&6
2237 else
2238   if echo a | (grep -E '(a|b)') >/dev/null 2>&1
2239                 then ac_cv_prog_egrep='grep -E'
2240                 else ac_cv_prog_egrep='egrep'
2241         fi
2242 fi
2243 echo "$as_me:2243: result: $ac_cv_prog_egrep" >&5
2244 echo "${ECHO_T}$ac_cv_prog_egrep" >&6
2245         EGREP=$ac_cv_prog_egrep
2246
2247         test -z "$EGREP" && { { echo "$as_me:2247: error: No egrep program found" >&5
2248 echo "$as_me: error: No egrep program found" >&2;}
2249    { (exit 1); exit 1; }; }
2250
2251 # Find a good install program.  We prefer a C program (faster),
2252 # so one script is as good as another.  But avoid the broken or
2253 # incompatible versions:
2254 # SysV /etc/install, /usr/sbin/install
2255 # SunOS /usr/etc/install
2256 # IRIX /sbin/install
2257 # AIX /bin/install
2258 # AmigaOS /C/install, which installs bootblocks on floppy discs
2259 # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
2260 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
2261 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
2262 # ./install, which can be erroneously created by make from ./install.sh.
2263 echo "$as_me:2263: checking for a BSD compatible install" >&5
2264 echo $ECHO_N "checking for a BSD compatible install... $ECHO_C" >&6
2265 if test -z "$INSTALL"; then
2266 if test "${ac_cv_path_install+set}" = set; then
2267   echo $ECHO_N "(cached) $ECHO_C" >&6
2268 else
2269     ac_save_IFS=$IFS; IFS=$ac_path_separator
2270   for ac_dir in $PATH; do
2271     IFS=$ac_save_IFS
2272     # Account for people who put trailing slashes in PATH elements.
2273     case $ac_dir/ in
2274     / | ./ | .// | /cC/* \
2275     | /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* \
2276     | /usr/ucb/* ) ;;
2277     *)
2278       # OSF1 and SCO ODT 3.0 have their own names for install.
2279       # Don't use installbsd from OSF since it installs stuff as root
2280       # by default.
2281       for ac_prog in ginstall scoinst install; do
2282         if $as_executable_p "$ac_dir/$ac_prog"; then
2283           if test $ac_prog = install &&
2284             grep dspmsg "$ac_dir/$ac_prog" >/dev/null 2>&1; then
2285             # AIX install.  It has an incompatible calling convention.
2286             :
2287           elif test $ac_prog = install &&
2288             grep pwplus "$ac_dir/$ac_prog" >/dev/null 2>&1; then
2289             # program-specific install script used by HP pwplus--don't use.
2290             :
2291           else
2292             ac_cv_path_install="$ac_dir/$ac_prog -c"
2293             break 2
2294           fi
2295         fi
2296       done
2297       ;;
2298     esac
2299   done
2300
2301 fi
2302   if test "${ac_cv_path_install+set}" = set; then
2303     INSTALL=$ac_cv_path_install
2304   else
2305     # As a last resort, use the slow shell script.  We don't cache a
2306     # path for INSTALL within a source directory, because that will
2307     # break other packages using the cache if that directory is
2308     # removed, or if the path is relative.
2309     INSTALL=$ac_install_sh
2310   fi
2311 fi
2312 echo "$as_me:2312: result: $INSTALL" >&5
2313 echo "${ECHO_T}$INSTALL" >&6
2314
2315 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
2316 # It thinks the first close brace ends the variable substitution.
2317 test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
2318
2319 test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
2320
2321 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
2322
2323 echo "$as_me:2323: checking whether ln -s works" >&5
2324 echo $ECHO_N "checking whether ln -s works... $ECHO_C" >&6
2325 LN_S=$as_ln_s
2326 if test "$LN_S" = "ln -s"; then
2327   echo "$as_me:2327: result: yes" >&5
2328 echo "${ECHO_T}yes" >&6
2329 else
2330   echo "$as_me:2330: result: no, using $LN_S" >&5
2331 echo "${ECHO_T}no, using $LN_S" >&6
2332 fi
2333
2334 echo "$as_me:2334: checking if $LN_S -f options work" >&5
2335 echo $ECHO_N "checking if $LN_S -f options work... $ECHO_C" >&6
2336
2337 rm -f conf$$.src conf$$dst
2338 echo >conf$$.dst
2339 echo first >conf$$.src
2340 if $LN_S -f conf$$.src conf$$.dst 2>/dev/null; then
2341         cf_prog_ln_sf=yes
2342 else
2343         cf_prog_ln_sf=no
2344 fi
2345 rm -f conf$$.dst conf$$src
2346 echo "$as_me:2346: result: $cf_prog_ln_sf" >&5
2347 echo "${ECHO_T}$cf_prog_ln_sf" >&6
2348
2349 test "$cf_prog_ln_sf" = yes && LN_S="$LN_S -f"
2350
2351 echo "$as_me:2351: checking for long file names" >&5
2352 echo $ECHO_N "checking for long file names... $ECHO_C" >&6
2353 if test "${ac_cv_sys_long_file_names+set}" = set; then
2354   echo $ECHO_N "(cached) $ECHO_C" >&6
2355 else
2356   ac_cv_sys_long_file_names=yes
2357 # Test for long file names in all the places we know might matter:
2358 #      .                the current directory, where building will happen
2359 #      $prefix/lib      where we will be installing things
2360 #      $exec_prefix/lib likewise
2361 # eval it to expand exec_prefix.
2362 #      $TMPDIR          if set, where it might want to write temporary files
2363 # if $TMPDIR is not set:
2364 #      /tmp             where it might want to write temporary files
2365 #      /var/tmp         likewise
2366 #      /usr/tmp         likewise
2367 if test -n "$TMPDIR" && test -d "$TMPDIR" && test -w "$TMPDIR"; then
2368   ac_tmpdirs=$TMPDIR
2369 else
2370   ac_tmpdirs='/tmp /var/tmp /usr/tmp'
2371 fi
2372 for ac_dir in  . $ac_tmpdirs `eval echo $prefix/lib $exec_prefix/lib` ; do
2373   test -d $ac_dir || continue
2374   test -w $ac_dir || continue # It is less confusing to not echo anything here.
2375   ac_xdir=$ac_dir/cf$$
2376   (umask 077 && mkdir $ac_xdir 2>/dev/null) || continue
2377   ac_tf1=$ac_xdir/conftest9012345
2378   ac_tf2=$ac_xdir/conftest9012346
2379   (echo 1 >$ac_tf1) 2>/dev/null
2380   (echo 2 >$ac_tf2) 2>/dev/null
2381   ac_val=`cat $ac_tf1 2>/dev/null`
2382   if test ! -f $ac_tf1 || test "$ac_val" != 1; then
2383     ac_cv_sys_long_file_names=no
2384     rm -rf $ac_xdir 2>/dev/null
2385     break
2386   fi
2387   rm -rf $ac_xdir 2>/dev/null
2388 done
2389 fi
2390 echo "$as_me:2390: result: $ac_cv_sys_long_file_names" >&5
2391 echo "${ECHO_T}$ac_cv_sys_long_file_names" >&6
2392 if test $ac_cv_sys_long_file_names = yes; then
2393
2394 cat >>confdefs.h <<\EOF
2395 #define HAVE_LONG_FILE_NAMES 1
2396 EOF
2397
2398 fi
2399
2400 # if we find pkg-config, check if we should install the ".pc" files.
2401
2402 echo "$as_me:2402: checking if you want to use pkg-config" >&5
2403 echo $ECHO_N "checking if you want to use pkg-config... $ECHO_C" >&6
2404
2405 # Check whether --with-pkg-config or --without-pkg-config was given.
2406 if test "${with_pkg_config+set}" = set; then
2407   withval="$with_pkg_config"
2408   cf_pkg_config=$withval
2409 else
2410   cf_pkg_config=yes
2411 fi;
2412 echo "$as_me:2412: result: $cf_pkg_config" >&5
2413 echo "${ECHO_T}$cf_pkg_config" >&6
2414
2415 case $cf_pkg_config in
2416 (no)
2417         PKG_CONFIG=none
2418         ;;
2419 (yes)
2420
2421 if test -n "$ac_tool_prefix"; then
2422   # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
2423 set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
2424 echo "$as_me:2424: checking for $ac_word" >&5
2425 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2426 if test "${ac_cv_path_PKG_CONFIG+set}" = set; then
2427   echo $ECHO_N "(cached) $ECHO_C" >&6
2428 else
2429   case $PKG_CONFIG in
2430   [\\/]* | ?:[\\/]*)
2431   ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
2432   ;;
2433   *)
2434   ac_save_IFS=$IFS; IFS=$ac_path_separator
2435 ac_dummy="$PATH"
2436 for ac_dir in $ac_dummy; do
2437   IFS=$ac_save_IFS
2438   test -z "$ac_dir" && ac_dir=.
2439   if $as_executable_p "$ac_dir/$ac_word"; then
2440    ac_cv_path_PKG_CONFIG="$ac_dir/$ac_word"
2441    echo "$as_me:2441: found $ac_dir/$ac_word" >&5
2442    break
2443 fi
2444 done
2445
2446   ;;
2447 esac
2448 fi
2449 PKG_CONFIG=$ac_cv_path_PKG_CONFIG
2450
2451 if test -n "$PKG_CONFIG"; then
2452   echo "$as_me:2452: result: $PKG_CONFIG" >&5
2453 echo "${ECHO_T}$PKG_CONFIG" >&6
2454 else
2455   echo "$as_me:2455: result: no" >&5
2456 echo "${ECHO_T}no" >&6
2457 fi
2458
2459 fi
2460 if test -z "$ac_cv_path_PKG_CONFIG"; then
2461   ac_pt_PKG_CONFIG=$PKG_CONFIG
2462   # Extract the first word of "pkg-config", so it can be a program name with args.
2463 set dummy pkg-config; ac_word=$2
2464 echo "$as_me:2464: checking for $ac_word" >&5
2465 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2466 if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then
2467   echo $ECHO_N "(cached) $ECHO_C" >&6
2468 else
2469   case $ac_pt_PKG_CONFIG in
2470   [\\/]* | ?:[\\/]*)
2471   ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path.
2472   ;;
2473   *)
2474   ac_save_IFS=$IFS; IFS=$ac_path_separator
2475 ac_dummy="$PATH"
2476 for ac_dir in $ac_dummy; do
2477   IFS=$ac_save_IFS
2478   test -z "$ac_dir" && ac_dir=.
2479   if $as_executable_p "$ac_dir/$ac_word"; then
2480    ac_cv_path_ac_pt_PKG_CONFIG="$ac_dir/$ac_word"
2481    echo "$as_me:2481: found $ac_dir/$ac_word" >&5
2482    break
2483 fi
2484 done
2485
2486   test -z "$ac_cv_path_ac_pt_PKG_CONFIG" && ac_cv_path_ac_pt_PKG_CONFIG="none"
2487   ;;
2488 esac
2489 fi
2490 ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
2491
2492 if test -n "$ac_pt_PKG_CONFIG"; then
2493   echo "$as_me:2493: result: $ac_pt_PKG_CONFIG" >&5
2494 echo "${ECHO_T}$ac_pt_PKG_CONFIG" >&6
2495 else
2496   echo "$as_me:2496: result: no" >&5
2497 echo "${ECHO_T}no" >&6
2498 fi
2499
2500   PKG_CONFIG=$ac_pt_PKG_CONFIG
2501 else
2502   PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
2503 fi
2504
2505         ;;
2506 (*)
2507         PKG_CONFIG=$withval
2508         ;;
2509 esac
2510
2511 test -z "$PKG_CONFIG" && PKG_CONFIG=none
2512 if test "$PKG_CONFIG" != none ; then
2513
2514 if test "x$prefix" != xNONE; then
2515         cf_path_syntax="$prefix"
2516 else
2517         cf_path_syntax="$ac_default_prefix"
2518 fi
2519
2520 case ".$PKG_CONFIG" in
2521 (.\$\(*\)*|.\'*\'*)
2522         ;;
2523 (..|./*|.\\*)
2524         ;;
2525 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
2526         ;;
2527 (.\${*prefix}*|.\${*dir}*)
2528         eval PKG_CONFIG="$PKG_CONFIG"
2529         case ".$PKG_CONFIG" in
2530         (.NONE/*)
2531                 PKG_CONFIG=`echo $PKG_CONFIG | sed -e s%NONE%$cf_path_syntax%`
2532                 ;;
2533         esac
2534         ;;
2535 (.no|.NONE/*)
2536         PKG_CONFIG=`echo $PKG_CONFIG | sed -e s%NONE%$cf_path_syntax%`
2537         ;;
2538 (*)
2539         { { echo "$as_me:2539: error: expected a pathname, not \"$PKG_CONFIG\"" >&5
2540 echo "$as_me: error: expected a pathname, not \"$PKG_CONFIG\"" >&2;}
2541    { (exit 1); exit 1; }; }
2542         ;;
2543 esac
2544
2545 elif test "x$cf_pkg_config" != xno ; then
2546         { echo "$as_me:2546: WARNING: pkg-config is not installed" >&5
2547 echo "$as_me: WARNING: pkg-config is not installed" >&2;}
2548 fi
2549
2550 echo "$as_me:2550: checking for $PKG_CONFIG library directory" >&5
2551 echo $ECHO_N "checking for $PKG_CONFIG library directory... $ECHO_C" >&6
2552 if test "x$PKG_CONFIG" = xnone ; then
2553         PKG_CONFIG_LIBDIR=none
2554 else
2555
2556 # Check whether --with-pkg-config-libdir or --without-pkg-config-libdir was given.
2557 if test "${with_pkg_config_libdir+set}" = set; then
2558   withval="$with_pkg_config_libdir"
2559   PKG_CONFIG_LIBDIR=$withval
2560 else
2561   PKG_CONFIG_LIBDIR=yes
2562 fi;
2563 fi
2564
2565 case x$PKG_CONFIG_LIBDIR in
2566 (x/*)
2567         ;;
2568 (xyes)
2569         # Look for the library directory using the same prefix as the executable
2570         if test "x$PKG_CONFIG" = xnone
2571         then
2572                 cf_path=$prefix
2573         else
2574                 cf_path=`echo "$PKG_CONFIG" | sed -e 's,/[^/]*/[^/]*$,,'`
2575         fi
2576
2577         # If you don't like using the default architecture, you have to specify the
2578         # intended library directory and corresponding compiler/linker options.
2579         #
2580         # This case allows for Debian's 2014-flavor of multiarch, along with the
2581         # most common variations before that point.  Some other variants spell the
2582         # directory differently, e.g., "pkg-config", and put it in unusual places.
2583         # pkg-config has always been poorly standardized, which is ironic...
2584         case x`(arch) 2>/dev/null` in
2585         (*64)
2586                 cf_search_path="\
2587                         $cf_path/lib/*64-linux-gnu \
2588                         $cf_path/share \
2589                         $cf_path/lib64 \
2590                         $cf_path/lib32 \
2591                         $cf_path/lib"
2592                 ;;
2593         (*)
2594                 cf_search_path="\
2595                         $cf_path/lib/*-linux-gnu \
2596                         $cf_path/share \
2597                         $cf_path/lib32 \
2598                         $cf_path/lib \
2599                         $cf_path/libdata"
2600                 ;;
2601         esac
2602
2603         test -n "$verbose" && echo "    list..." 1>&6
2604
2605 echo "${as_me:-configure}:2605: testing list... ..." 1>&5
2606
2607         for cf_config in $cf_search_path
2608         do
2609                 test -n "$verbose" && echo "    checking $cf_config/pkgconfig" 1>&6
2610
2611 echo "${as_me:-configure}:2611: testing checking $cf_config/pkgconfig ..." 1>&5
2612
2613                 if test -d $cf_config/pkgconfig
2614                 then
2615                         PKG_CONFIG_LIBDIR=$cf_config/pkgconfig
2616                         echo "$as_me:2616: checking done" >&5
2617 echo $ECHO_N "checking done... $ECHO_C" >&6
2618                         break
2619                 fi
2620         done
2621         ;;
2622 (*)
2623         ;;
2624 esac
2625
2626 if test "x$PKG_CONFIG" != xnone ; then
2627         echo "$as_me:2627: result: $PKG_CONFIG_LIBDIR" >&5
2628 echo "${ECHO_T}$PKG_CONFIG_LIBDIR" >&6
2629 fi
2630
2631 echo "$as_me:2631: checking if you want to build test-programs" >&5
2632 echo $ECHO_N "checking if you want to build test-programs... $ECHO_C" >&6
2633
2634 # Check whether --with-tests or --without-tests was given.
2635 if test "${with_tests+set}" = set; then
2636   withval="$with_tests"
2637   cf_with_tests=$withval
2638 else
2639   cf_with_tests=yes
2640 fi;
2641 echo "$as_me:2641: result: $cf_with_tests" >&5
2642 echo "${ECHO_T}$cf_with_tests" >&6
2643
2644 echo "$as_me:2644: checking if we should assume mixed-case filenames" >&5
2645 echo $ECHO_N "checking if we should assume mixed-case filenames... $ECHO_C" >&6
2646
2647 # Check whether --enable-mixed-case or --disable-mixed-case was given.
2648 if test "${enable_mixed_case+set}" = set; then
2649   enableval="$enable_mixed_case"
2650   enable_mixedcase=$enableval
2651 else
2652   enable_mixedcase=auto
2653 fi;
2654 echo "$as_me:2654: result: $enable_mixedcase" >&5
2655 echo "${ECHO_T}$enable_mixedcase" >&6
2656 if test "$enable_mixedcase" = "auto" ; then
2657
2658 echo "$as_me:2658: checking if filesystem supports mixed-case filenames" >&5
2659 echo $ECHO_N "checking if filesystem supports mixed-case filenames... $ECHO_C" >&6
2660 if test "${cf_cv_mixedcase+set}" = set; then
2661   echo $ECHO_N "(cached) $ECHO_C" >&6
2662 else
2663
2664 if test "$cross_compiling" = yes ; then
2665         case $target_alias in
2666         (*-os2-emx*|*-msdosdjgpp*|*-cygwin*|*-msys*|*-mingw*|*-uwin*)
2667                 cf_cv_mixedcase=no
2668                 ;;
2669         (*)
2670                 cf_cv_mixedcase=yes
2671                 ;;
2672         esac
2673 else
2674         rm -f conftest CONFTEST
2675         echo test >conftest
2676         if test -f CONFTEST ; then
2677                 cf_cv_mixedcase=no
2678         else
2679                 cf_cv_mixedcase=yes
2680         fi
2681         rm -f conftest CONFTEST
2682 fi
2683
2684 fi
2685 echo "$as_me:2685: result: $cf_cv_mixedcase" >&5
2686 echo "${ECHO_T}$cf_cv_mixedcase" >&6
2687 test "$cf_cv_mixedcase" = yes &&
2688 cat >>confdefs.h <<\EOF
2689 #define MIXEDCASE_FILENAMES 1
2690 EOF
2691
2692 else
2693         cf_cv_mixedcase=$enable_mixedcase
2694         if test "$enable_mixedcase" = "yes" ; then
2695                 cat >>confdefs.h <<\EOF
2696 #define MIXEDCASE_FILENAMES 1
2697 EOF
2698
2699         fi
2700 fi
2701
2702 # do this after mixed-case option (tags/TAGS is not as important as tic).
2703 echo "$as_me:2703: checking whether ${MAKE-make} sets \${MAKE}" >&5
2704 echo $ECHO_N "checking whether ${MAKE-make} sets \${MAKE}... $ECHO_C" >&6
2705 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,./+-,__p_,'`
2706 if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then
2707   echo $ECHO_N "(cached) $ECHO_C" >&6
2708 else
2709   cat >conftest.make <<\EOF
2710 all:
2711         @echo 'ac_maketemp="${MAKE}"'
2712 EOF
2713 # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
2714 eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=`
2715 if test -n "$ac_maketemp"; then
2716   eval ac_cv_prog_make_${ac_make}_set=yes
2717 else
2718   eval ac_cv_prog_make_${ac_make}_set=no
2719 fi
2720 rm -f conftest.make
2721 fi
2722 if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
2723   echo "$as_me:2723: result: yes" >&5
2724 echo "${ECHO_T}yes" >&6
2725   SET_MAKE=
2726 else
2727   echo "$as_me:2727: result: no" >&5
2728 echo "${ECHO_T}no" >&6
2729   SET_MAKE="MAKE=${MAKE-make}"
2730 fi
2731
2732 for ac_prog in exctags ctags
2733 do
2734   # Extract the first word of "$ac_prog", so it can be a program name with args.
2735 set dummy $ac_prog; ac_word=$2
2736 echo "$as_me:2736: checking for $ac_word" >&5
2737 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2738 if test "${ac_cv_prog_CTAGS+set}" = set; then
2739   echo $ECHO_N "(cached) $ECHO_C" >&6
2740 else
2741   if test -n "$CTAGS"; then
2742   ac_cv_prog_CTAGS="$CTAGS" # Let the user override the test.
2743 else
2744   ac_save_IFS=$IFS; IFS=$ac_path_separator
2745 ac_dummy="$PATH"
2746 for ac_dir in $ac_dummy; do
2747   IFS=$ac_save_IFS
2748   test -z "$ac_dir" && ac_dir=.
2749   $as_executable_p "$ac_dir/$ac_word" || continue
2750 ac_cv_prog_CTAGS="$ac_prog"
2751 echo "$as_me:2751: found $ac_dir/$ac_word" >&5
2752 break
2753 done
2754
2755 fi
2756 fi
2757 CTAGS=$ac_cv_prog_CTAGS
2758 if test -n "$CTAGS"; then
2759   echo "$as_me:2759: result: $CTAGS" >&5
2760 echo "${ECHO_T}$CTAGS" >&6
2761 else
2762   echo "$as_me:2762: result: no" >&5
2763 echo "${ECHO_T}no" >&6
2764 fi
2765
2766   test -n "$CTAGS" && break
2767 done
2768
2769 for ac_prog in exetags etags
2770 do
2771   # Extract the first word of "$ac_prog", so it can be a program name with args.
2772 set dummy $ac_prog; ac_word=$2
2773 echo "$as_me:2773: checking for $ac_word" >&5
2774 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2775 if test "${ac_cv_prog_ETAGS+set}" = set; then
2776   echo $ECHO_N "(cached) $ECHO_C" >&6
2777 else
2778   if test -n "$ETAGS"; then
2779   ac_cv_prog_ETAGS="$ETAGS" # Let the user override the test.
2780 else
2781   ac_save_IFS=$IFS; IFS=$ac_path_separator
2782 ac_dummy="$PATH"
2783 for ac_dir in $ac_dummy; do
2784   IFS=$ac_save_IFS
2785   test -z "$ac_dir" && ac_dir=.
2786   $as_executable_p "$ac_dir/$ac_word" || continue
2787 ac_cv_prog_ETAGS="$ac_prog"
2788 echo "$as_me:2788: found $ac_dir/$ac_word" >&5
2789 break
2790 done
2791
2792 fi
2793 fi
2794 ETAGS=$ac_cv_prog_ETAGS
2795 if test -n "$ETAGS"; then
2796   echo "$as_me:2796: result: $ETAGS" >&5
2797 echo "${ECHO_T}$ETAGS" >&6
2798 else
2799   echo "$as_me:2799: result: no" >&5
2800 echo "${ECHO_T}no" >&6
2801 fi
2802
2803   test -n "$ETAGS" && break
2804 done
2805
2806 # Extract the first word of "${CTAGS:-ctags}", so it can be a program name with args.
2807 set dummy ${CTAGS:-ctags}; ac_word=$2
2808 echo "$as_me:2808: checking for $ac_word" >&5
2809 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2810 if test "${ac_cv_prog_MAKE_LOWER_TAGS+set}" = set; then
2811   echo $ECHO_N "(cached) $ECHO_C" >&6
2812 else
2813   if test -n "$MAKE_LOWER_TAGS"; then
2814   ac_cv_prog_MAKE_LOWER_TAGS="$MAKE_LOWER_TAGS" # Let the user override the test.
2815 else
2816   ac_save_IFS=$IFS; IFS=$ac_path_separator
2817 ac_dummy="$PATH"
2818 for ac_dir in $ac_dummy; do
2819   IFS=$ac_save_IFS
2820   test -z "$ac_dir" && ac_dir=.
2821   $as_executable_p "$ac_dir/$ac_word" || continue
2822 ac_cv_prog_MAKE_LOWER_TAGS="yes"
2823 echo "$as_me:2823: found $ac_dir/$ac_word" >&5
2824 break
2825 done
2826
2827   test -z "$ac_cv_prog_MAKE_LOWER_TAGS" && ac_cv_prog_MAKE_LOWER_TAGS="no"
2828 fi
2829 fi
2830 MAKE_LOWER_TAGS=$ac_cv_prog_MAKE_LOWER_TAGS
2831 if test -n "$MAKE_LOWER_TAGS"; then
2832   echo "$as_me:2832: result: $MAKE_LOWER_TAGS" >&5
2833 echo "${ECHO_T}$MAKE_LOWER_TAGS" >&6
2834 else
2835   echo "$as_me:2835: result: no" >&5
2836 echo "${ECHO_T}no" >&6
2837 fi
2838
2839 if test "$cf_cv_mixedcase" = yes ; then
2840         # Extract the first word of "${ETAGS:-etags}", so it can be a program name with args.
2841 set dummy ${ETAGS:-etags}; ac_word=$2
2842 echo "$as_me:2842: checking for $ac_word" >&5
2843 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2844 if test "${ac_cv_prog_MAKE_UPPER_TAGS+set}" = set; then
2845   echo $ECHO_N "(cached) $ECHO_C" >&6
2846 else
2847   if test -n "$MAKE_UPPER_TAGS"; then
2848   ac_cv_prog_MAKE_UPPER_TAGS="$MAKE_UPPER_TAGS" # Let the user override the test.
2849 else
2850   ac_save_IFS=$IFS; IFS=$ac_path_separator
2851 ac_dummy="$PATH"
2852 for ac_dir in $ac_dummy; do
2853   IFS=$ac_save_IFS
2854   test -z "$ac_dir" && ac_dir=.
2855   $as_executable_p "$ac_dir/$ac_word" || continue
2856 ac_cv_prog_MAKE_UPPER_TAGS="yes"
2857 echo "$as_me:2857: found $ac_dir/$ac_word" >&5
2858 break
2859 done
2860
2861   test -z "$ac_cv_prog_MAKE_UPPER_TAGS" && ac_cv_prog_MAKE_UPPER_TAGS="no"
2862 fi
2863 fi
2864 MAKE_UPPER_TAGS=$ac_cv_prog_MAKE_UPPER_TAGS
2865 if test -n "$MAKE_UPPER_TAGS"; then
2866   echo "$as_me:2866: result: $MAKE_UPPER_TAGS" >&5
2867 echo "${ECHO_T}$MAKE_UPPER_TAGS" >&6
2868 else
2869   echo "$as_me:2869: result: no" >&5
2870 echo "${ECHO_T}no" >&6
2871 fi
2872
2873 else
2874         MAKE_UPPER_TAGS=no
2875 fi
2876
2877 if test "$MAKE_UPPER_TAGS" = yes ; then
2878         MAKE_UPPER_TAGS=
2879 else
2880         MAKE_UPPER_TAGS="#"
2881 fi
2882
2883 if test "$MAKE_LOWER_TAGS" = yes ; then
2884         MAKE_LOWER_TAGS=
2885 else
2886         MAKE_LOWER_TAGS="#"
2887 fi
2888
2889 echo "$as_me:2889: checking for makeflags variable" >&5
2890 echo $ECHO_N "checking for makeflags variable... $ECHO_C" >&6
2891 if test "${cf_cv_makeflags+set}" = set; then
2892   echo $ECHO_N "(cached) $ECHO_C" >&6
2893 else
2894
2895         cf_cv_makeflags=''
2896         for cf_option in '-${MAKEFLAGS}' '${MFLAGS}'
2897         do
2898                 cat >cf_makeflags.tmp <<CF_EOF
2899 SHELL = /bin/sh
2900 all :
2901         @ echo '.$cf_option'
2902 CF_EOF
2903                 cf_result=`${MAKE:-make} -k -f cf_makeflags.tmp 2>/dev/null | fgrep -v "ing directory" | sed -e 's,[    ]*$,,'`
2904                 case "$cf_result" in
2905                 (.*k|.*kw)
2906                         cf_result=`${MAKE:-make} -k -f cf_makeflags.tmp CC=cc 2>/dev/null`
2907                         case "$cf_result" in
2908                         (.*CC=*)        cf_cv_makeflags=
2909                                 ;;
2910                         (*)     cf_cv_makeflags=$cf_option
2911                                 ;;
2912                         esac
2913                         break
2914                         ;;
2915                 (.-)    ;;
2916                 (*)     echo "given option \"$cf_option\", no match \"$cf_result\""
2917                         ;;
2918                 esac
2919         done
2920         rm -f cf_makeflags.tmp
2921
2922 fi
2923 echo "$as_me:2923: result: $cf_cv_makeflags" >&5
2924 echo "${ECHO_T}$cf_cv_makeflags" >&6
2925
2926 if test -n "$ac_tool_prefix"; then
2927   # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
2928 set dummy ${ac_tool_prefix}ranlib; ac_word=$2
2929 echo "$as_me:2929: checking for $ac_word" >&5
2930 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2931 if test "${ac_cv_prog_RANLIB+set}" = set; then
2932   echo $ECHO_N "(cached) $ECHO_C" >&6
2933 else
2934   if test -n "$RANLIB"; then
2935   ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
2936 else
2937   ac_save_IFS=$IFS; IFS=$ac_path_separator
2938 ac_dummy="$PATH"
2939 for ac_dir in $ac_dummy; do
2940   IFS=$ac_save_IFS
2941   test -z "$ac_dir" && ac_dir=.
2942   $as_executable_p "$ac_dir/$ac_word" || continue
2943 ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
2944 echo "$as_me:2944: found $ac_dir/$ac_word" >&5
2945 break
2946 done
2947
2948 fi
2949 fi
2950 RANLIB=$ac_cv_prog_RANLIB
2951 if test -n "$RANLIB"; then
2952   echo "$as_me:2952: result: $RANLIB" >&5
2953 echo "${ECHO_T}$RANLIB" >&6
2954 else
2955   echo "$as_me:2955: result: no" >&5
2956 echo "${ECHO_T}no" >&6
2957 fi
2958
2959 fi
2960 if test -z "$ac_cv_prog_RANLIB"; then
2961   ac_ct_RANLIB=$RANLIB
2962   # Extract the first word of "ranlib", so it can be a program name with args.
2963 set dummy ranlib; ac_word=$2
2964 echo "$as_me:2964: checking for $ac_word" >&5
2965 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2966 if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then
2967   echo $ECHO_N "(cached) $ECHO_C" >&6
2968 else
2969   if test -n "$ac_ct_RANLIB"; then
2970   ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
2971 else
2972   ac_save_IFS=$IFS; IFS=$ac_path_separator
2973 ac_dummy="$PATH"
2974 for ac_dir in $ac_dummy; do
2975   IFS=$ac_save_IFS
2976   test -z "$ac_dir" && ac_dir=.
2977   $as_executable_p "$ac_dir/$ac_word" || continue
2978 ac_cv_prog_ac_ct_RANLIB="ranlib"
2979 echo "$as_me:2979: found $ac_dir/$ac_word" >&5
2980 break
2981 done
2982
2983   test -z "$ac_cv_prog_ac_ct_RANLIB" && ac_cv_prog_ac_ct_RANLIB="':'"
2984 fi
2985 fi
2986 ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
2987 if test -n "$ac_ct_RANLIB"; then
2988   echo "$as_me:2988: result: $ac_ct_RANLIB" >&5
2989 echo "${ECHO_T}$ac_ct_RANLIB" >&6
2990 else
2991   echo "$as_me:2991: result: no" >&5
2992 echo "${ECHO_T}no" >&6
2993 fi
2994
2995   RANLIB=$ac_ct_RANLIB
2996 else
2997   RANLIB="$ac_cv_prog_RANLIB"
2998 fi
2999
3000 if test -n "$ac_tool_prefix"; then
3001   # Extract the first word of "${ac_tool_prefix}ld", so it can be a program name with args.
3002 set dummy ${ac_tool_prefix}ld; ac_word=$2
3003 echo "$as_me:3003: checking for $ac_word" >&5
3004 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3005 if test "${ac_cv_prog_LD+set}" = set; then
3006   echo $ECHO_N "(cached) $ECHO_C" >&6
3007 else
3008   if test -n "$LD"; then
3009   ac_cv_prog_LD="$LD" # Let the user override the test.
3010 else
3011   ac_save_IFS=$IFS; IFS=$ac_path_separator
3012 ac_dummy="$PATH"
3013 for ac_dir in $ac_dummy; do
3014   IFS=$ac_save_IFS
3015   test -z "$ac_dir" && ac_dir=.
3016   $as_executable_p "$ac_dir/$ac_word" || continue
3017 ac_cv_prog_LD="${ac_tool_prefix}ld"
3018 echo "$as_me:3018: found $ac_dir/$ac_word" >&5
3019 break
3020 done
3021
3022 fi
3023 fi
3024 LD=$ac_cv_prog_LD
3025 if test -n "$LD"; then
3026   echo "$as_me:3026: result: $LD" >&5
3027 echo "${ECHO_T}$LD" >&6
3028 else
3029   echo "$as_me:3029: result: no" >&5
3030 echo "${ECHO_T}no" >&6
3031 fi
3032
3033 fi
3034 if test -z "$ac_cv_prog_LD"; then
3035   ac_ct_LD=$LD
3036   # Extract the first word of "ld", so it can be a program name with args.
3037 set dummy ld; ac_word=$2
3038 echo "$as_me:3038: checking for $ac_word" >&5
3039 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3040 if test "${ac_cv_prog_ac_ct_LD+set}" = set; then
3041   echo $ECHO_N "(cached) $ECHO_C" >&6
3042 else
3043   if test -n "$ac_ct_LD"; then
3044   ac_cv_prog_ac_ct_LD="$ac_ct_LD" # Let the user override the test.
3045 else
3046   ac_save_IFS=$IFS; IFS=$ac_path_separator
3047 ac_dummy="$PATH"
3048 for ac_dir in $ac_dummy; do
3049   IFS=$ac_save_IFS
3050   test -z "$ac_dir" && ac_dir=.
3051   $as_executable_p "$ac_dir/$ac_word" || continue
3052 ac_cv_prog_ac_ct_LD="ld"
3053 echo "$as_me:3053: found $ac_dir/$ac_word" >&5
3054 break
3055 done
3056
3057   test -z "$ac_cv_prog_ac_ct_LD" && ac_cv_prog_ac_ct_LD="ld"
3058 fi
3059 fi
3060 ac_ct_LD=$ac_cv_prog_ac_ct_LD
3061 if test -n "$ac_ct_LD"; then
3062   echo "$as_me:3062: result: $ac_ct_LD" >&5
3063 echo "${ECHO_T}$ac_ct_LD" >&6
3064 else
3065   echo "$as_me:3065: result: no" >&5
3066 echo "${ECHO_T}no" >&6
3067 fi
3068
3069   LD=$ac_ct_LD
3070 else
3071   LD="$ac_cv_prog_LD"
3072 fi
3073
3074 if test -n "$ac_tool_prefix"; then
3075   # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
3076 set dummy ${ac_tool_prefix}ar; ac_word=$2
3077 echo "$as_me:3077: checking for $ac_word" >&5
3078 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3079 if test "${ac_cv_prog_AR+set}" = set; then
3080   echo $ECHO_N "(cached) $ECHO_C" >&6
3081 else
3082   if test -n "$AR"; then
3083   ac_cv_prog_AR="$AR" # Let the user override the test.
3084 else
3085   ac_save_IFS=$IFS; IFS=$ac_path_separator
3086 ac_dummy="$PATH"
3087 for ac_dir in $ac_dummy; do
3088   IFS=$ac_save_IFS
3089   test -z "$ac_dir" && ac_dir=.
3090   $as_executable_p "$ac_dir/$ac_word" || continue
3091 ac_cv_prog_AR="${ac_tool_prefix}ar"
3092 echo "$as_me:3092: found $ac_dir/$ac_word" >&5
3093 break
3094 done
3095
3096 fi
3097 fi
3098 AR=$ac_cv_prog_AR
3099 if test -n "$AR"; then
3100   echo "$as_me:3100: result: $AR" >&5
3101 echo "${ECHO_T}$AR" >&6
3102 else
3103   echo "$as_me:3103: result: no" >&5
3104 echo "${ECHO_T}no" >&6
3105 fi
3106
3107 fi
3108 if test -z "$ac_cv_prog_AR"; then
3109   ac_ct_AR=$AR
3110   # Extract the first word of "ar", so it can be a program name with args.
3111 set dummy ar; ac_word=$2
3112 echo "$as_me:3112: checking for $ac_word" >&5
3113 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3114 if test "${ac_cv_prog_ac_ct_AR+set}" = set; then
3115   echo $ECHO_N "(cached) $ECHO_C" >&6
3116 else
3117   if test -n "$ac_ct_AR"; then
3118   ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test.
3119 else
3120   ac_save_IFS=$IFS; IFS=$ac_path_separator
3121 ac_dummy="$PATH"
3122 for ac_dir in $ac_dummy; do
3123   IFS=$ac_save_IFS
3124   test -z "$ac_dir" && ac_dir=.
3125   $as_executable_p "$ac_dir/$ac_word" || continue
3126 ac_cv_prog_ac_ct_AR="ar"
3127 echo "$as_me:3127: found $ac_dir/$ac_word" >&5
3128 break
3129 done
3130
3131   test -z "$ac_cv_prog_ac_ct_AR" && ac_cv_prog_ac_ct_AR="ar"
3132 fi
3133 fi
3134 ac_ct_AR=$ac_cv_prog_ac_ct_AR
3135 if test -n "$ac_ct_AR"; then
3136   echo "$as_me:3136: result: $ac_ct_AR" >&5
3137 echo "${ECHO_T}$ac_ct_AR" >&6
3138 else
3139   echo "$as_me:3139: result: no" >&5
3140 echo "${ECHO_T}no" >&6
3141 fi
3142
3143   AR=$ac_ct_AR
3144 else
3145   AR="$ac_cv_prog_AR"
3146 fi
3147
3148 if test -n "$ac_tool_prefix"; then
3149   # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
3150 set dummy ${ac_tool_prefix}ar; ac_word=$2
3151 echo "$as_me:3151: checking for $ac_word" >&5
3152 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3153 if test "${ac_cv_prog_AR+set}" = set; then
3154   echo $ECHO_N "(cached) $ECHO_C" >&6
3155 else
3156   if test -n "$AR"; then
3157   ac_cv_prog_AR="$AR" # Let the user override the test.
3158 else
3159   ac_save_IFS=$IFS; IFS=$ac_path_separator
3160 ac_dummy="$PATH"
3161 for ac_dir in $ac_dummy; do
3162   IFS=$ac_save_IFS
3163   test -z "$ac_dir" && ac_dir=.
3164   $as_executable_p "$ac_dir/$ac_word" || continue
3165 ac_cv_prog_AR="${ac_tool_prefix}ar"
3166 echo "$as_me:3166: found $ac_dir/$ac_word" >&5
3167 break
3168 done
3169
3170 fi
3171 fi
3172 AR=$ac_cv_prog_AR
3173 if test -n "$AR"; then
3174   echo "$as_me:3174: result: $AR" >&5
3175 echo "${ECHO_T}$AR" >&6
3176 else
3177   echo "$as_me:3177: result: no" >&5
3178 echo "${ECHO_T}no" >&6
3179 fi
3180
3181 fi
3182 if test -z "$ac_cv_prog_AR"; then
3183   ac_ct_AR=$AR
3184   # Extract the first word of "ar", so it can be a program name with args.
3185 set dummy ar; ac_word=$2
3186 echo "$as_me:3186: checking for $ac_word" >&5
3187 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3188 if test "${ac_cv_prog_ac_ct_AR+set}" = set; then
3189   echo $ECHO_N "(cached) $ECHO_C" >&6
3190 else
3191   if test -n "$ac_ct_AR"; then
3192   ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test.
3193 else
3194   ac_save_IFS=$IFS; IFS=$ac_path_separator
3195 ac_dummy="$PATH"
3196 for ac_dir in $ac_dummy; do
3197   IFS=$ac_save_IFS
3198   test -z "$ac_dir" && ac_dir=.
3199   $as_executable_p "$ac_dir/$ac_word" || continue
3200 ac_cv_prog_ac_ct_AR="ar"
3201 echo "$as_me:3201: found $ac_dir/$ac_word" >&5
3202 break
3203 done
3204
3205   test -z "$ac_cv_prog_ac_ct_AR" && ac_cv_prog_ac_ct_AR="ar"
3206 fi
3207 fi
3208 ac_ct_AR=$ac_cv_prog_ac_ct_AR
3209 if test -n "$ac_ct_AR"; then
3210   echo "$as_me:3210: result: $ac_ct_AR" >&5
3211 echo "${ECHO_T}$ac_ct_AR" >&6
3212 else
3213   echo "$as_me:3213: result: no" >&5
3214 echo "${ECHO_T}no" >&6
3215 fi
3216
3217   AR=$ac_ct_AR
3218 else
3219   AR="$ac_cv_prog_AR"
3220 fi
3221
3222 echo "$as_me:3222: checking for options to update archives" >&5
3223 echo $ECHO_N "checking for options to update archives... $ECHO_C" >&6
3224 if test "${cf_cv_ar_flags+set}" = set; then
3225   echo $ECHO_N "(cached) $ECHO_C" >&6
3226 else
3227
3228         cf_cv_ar_flags=unknown
3229         for cf_ar_flags in -curv curv -crv crv -cqv cqv -rv rv
3230         do
3231
3232                 # check if $ARFLAGS already contains this choice
3233                 if test "x$ARFLAGS" != "x" ; then
3234                         cf_check_ar_flags=`echo "x$ARFLAGS" | sed -e "s/$cf_ar_flags\$//" -e "s/$cf_ar_flags / /"`
3235                         if test "x$ARFLAGS" != "$cf_check_ar_flags" ; then
3236                                 cf_cv_ar_flags=
3237                                 break
3238                         fi
3239                 fi
3240
3241                 rm -f conftest.$ac_cv_objext
3242                 rm -f conftest.a
3243
3244                 cat >conftest.$ac_ext <<EOF
3245 #line 3245 "configure"
3246 int     testdata[3] = { 123, 456, 789 };
3247 EOF
3248                 if { (eval echo "$as_me:3248: \"$ac_compile\"") >&5
3249   (eval $ac_compile) 2>&5
3250   ac_status=$?
3251   echo "$as_me:3251: \$? = $ac_status" >&5
3252   (exit $ac_status); } ; then
3253                         echo "$AR $ARFLAGS $cf_ar_flags conftest.a conftest.$ac_cv_objext" >&5
3254                         $AR $ARFLAGS $cf_ar_flags conftest.a conftest.$ac_cv_objext 2>&5 1>/dev/null
3255                         if test -f conftest.a ; then
3256                                 cf_cv_ar_flags=$cf_ar_flags
3257                                 break
3258                         fi
3259                 else
3260                         test -n "$verbose" && echo "    cannot compile test-program" 1>&6
3261
3262 echo "${as_me:-configure}:3262: testing cannot compile test-program ..." 1>&5
3263
3264                         break
3265                 fi
3266         done
3267         rm -f conftest.a conftest.$ac_ext conftest.$ac_cv_objext
3268
3269 fi
3270 echo "$as_me:3270: result: $cf_cv_ar_flags" >&5
3271 echo "${ECHO_T}$cf_cv_ar_flags" >&6
3272
3273 if test -n "$ARFLAGS" ; then
3274         if test -n "$cf_cv_ar_flags" ; then
3275                 ARFLAGS="$ARFLAGS $cf_cv_ar_flags"
3276         fi
3277 else
3278         ARFLAGS=$cf_cv_ar_flags
3279 fi
3280
3281         echo "$as_me:3281: checking for PATH separator" >&5
3282 echo $ECHO_N "checking for PATH separator... $ECHO_C" >&6
3283         case $cf_cv_system_name in
3284         (os2*)  PATH_SEPARATOR=';'  ;;
3285         (*)     ${PATH_SEPARATOR:=':'}  ;;
3286         esac
3287
3288         echo "$as_me:3288: result: $PATH_SEPARATOR" >&5
3289 echo "${ECHO_T}$PATH_SEPARATOR" >&6
3290
3291 echo "$as_me:3291: checking if you have specified an install-prefix" >&5
3292 echo $ECHO_N "checking if you have specified an install-prefix... $ECHO_C" >&6
3293
3294 # Check whether --with-install-prefix or --without-install-prefix was given.
3295 if test "${with_install_prefix+set}" = set; then
3296   withval="$with_install_prefix"
3297   case "$withval" in
3298         (yes|no)
3299                 ;;
3300         (*)     DESTDIR="$withval"
3301                 ;;
3302         esac
3303 fi;
3304 echo "$as_me:3304: result: $DESTDIR" >&5
3305 echo "${ECHO_T}$DESTDIR" >&6
3306
3307 ###############################################################################
3308
3309 # If we're cross-compiling, allow the user to override the tools and their
3310 # options.  The configure script is oriented toward identifying the host
3311 # compiler, etc., but we need a build compiler to generate parts of the source.
3312
3313 if test "$cross_compiling" = yes ; then
3314
3315         # defaults that we might want to override
3316         : ${BUILD_CFLAGS:=''}
3317         : ${BUILD_CPPFLAGS:=''}
3318         : ${BUILD_LDFLAGS:=''}
3319         : ${BUILD_LIBS:=''}
3320         : ${BUILD_EXEEXT:='$x'}
3321         : ${BUILD_OBJEXT:='o'}
3322
3323 # Check whether --with-build-cc or --without-build-cc was given.
3324 if test "${with_build_cc+set}" = set; then
3325   withval="$with_build_cc"
3326   BUILD_CC="$withval"
3327 else
3328   for ac_prog in gcc cc cl
3329 do
3330   # Extract the first word of "$ac_prog", so it can be a program name with args.
3331 set dummy $ac_prog; ac_word=$2
3332 echo "$as_me:3332: checking for $ac_word" >&5
3333 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3334 if test "${ac_cv_prog_BUILD_CC+set}" = set; then
3335   echo $ECHO_N "(cached) $ECHO_C" >&6
3336 else
3337   if test -n "$BUILD_CC"; then
3338   ac_cv_prog_BUILD_CC="$BUILD_CC" # Let the user override the test.
3339 else
3340   ac_save_IFS=$IFS; IFS=$ac_path_separator
3341 ac_dummy="$PATH"
3342 for ac_dir in $ac_dummy; do
3343   IFS=$ac_save_IFS
3344   test -z "$ac_dir" && ac_dir=.
3345   $as_executable_p "$ac_dir/$ac_word" || continue
3346 ac_cv_prog_BUILD_CC="$ac_prog"
3347 echo "$as_me:3347: found $ac_dir/$ac_word" >&5
3348 break
3349 done
3350
3351 fi
3352 fi
3353 BUILD_CC=$ac_cv_prog_BUILD_CC
3354 if test -n "$BUILD_CC"; then
3355   echo "$as_me:3355: result: $BUILD_CC" >&5
3356 echo "${ECHO_T}$BUILD_CC" >&6
3357 else
3358   echo "$as_me:3358: result: no" >&5
3359 echo "${ECHO_T}no" >&6
3360 fi
3361
3362   test -n "$BUILD_CC" && break
3363 done
3364
3365 fi;
3366         echo "$as_me:3366: checking for native build C compiler" >&5
3367 echo $ECHO_N "checking for native build C compiler... $ECHO_C" >&6
3368         echo "$as_me:3368: result: $BUILD_CC" >&5
3369 echo "${ECHO_T}$BUILD_CC" >&6
3370
3371         echo "$as_me:3371: checking for native build C preprocessor" >&5
3372 echo $ECHO_N "checking for native build C preprocessor... $ECHO_C" >&6
3373
3374 # Check whether --with-build-cpp or --without-build-cpp was given.
3375 if test "${with_build_cpp+set}" = set; then
3376   withval="$with_build_cpp"
3377   BUILD_CPP="$withval"
3378 else
3379   BUILD_CPP='${BUILD_CC} -E'
3380 fi;
3381         echo "$as_me:3381: result: $BUILD_CPP" >&5
3382 echo "${ECHO_T}$BUILD_CPP" >&6
3383
3384         echo "$as_me:3384: checking for native build C flags" >&5
3385 echo $ECHO_N "checking for native build C flags... $ECHO_C" >&6
3386
3387 # Check whether --with-build-cflags or --without-build-cflags was given.
3388 if test "${with_build_cflags+set}" = set; then
3389   withval="$with_build_cflags"
3390   BUILD_CFLAGS="$withval"
3391 fi;
3392         echo "$as_me:3392: result: $BUILD_CFLAGS" >&5
3393 echo "${ECHO_T}$BUILD_CFLAGS" >&6
3394
3395         echo "$as_me:3395: checking for native build C preprocessor-flags" >&5
3396 echo $ECHO_N "checking for native build C preprocessor-flags... $ECHO_C" >&6
3397
3398 # Check whether --with-build-cppflags or --without-build-cppflags was given.
3399 if test "${with_build_cppflags+set}" = set; then
3400   withval="$with_build_cppflags"
3401   BUILD_CPPFLAGS="$withval"
3402 fi;
3403         echo "$as_me:3403: result: $BUILD_CPPFLAGS" >&5
3404 echo "${ECHO_T}$BUILD_CPPFLAGS" >&6
3405
3406         echo "$as_me:3406: checking for native build linker-flags" >&5
3407 echo $ECHO_N "checking for native build linker-flags... $ECHO_C" >&6
3408
3409 # Check whether --with-build-ldflags or --without-build-ldflags was given.
3410 if test "${with_build_ldflags+set}" = set; then
3411   withval="$with_build_ldflags"
3412   BUILD_LDFLAGS="$withval"
3413 fi;
3414         echo "$as_me:3414: result: $BUILD_LDFLAGS" >&5
3415 echo "${ECHO_T}$BUILD_LDFLAGS" >&6
3416
3417         echo "$as_me:3417: checking for native build linker-libraries" >&5
3418 echo $ECHO_N "checking for native build linker-libraries... $ECHO_C" >&6
3419
3420 # Check whether --with-build-libs or --without-build-libs was given.
3421 if test "${with_build_libs+set}" = set; then
3422   withval="$with_build_libs"
3423   BUILD_LIBS="$withval"
3424 fi;
3425         echo "$as_me:3425: result: $BUILD_LIBS" >&5
3426 echo "${ECHO_T}$BUILD_LIBS" >&6
3427
3428         # this assumes we're on Unix.
3429         BUILD_EXEEXT=
3430         BUILD_OBJEXT=o
3431
3432         : ${BUILD_CC:='${CC}'}
3433
3434         if ( test "$BUILD_CC" = "$CC" || test "$BUILD_CC" = '${CC}' ) ; then
3435                 { { echo "$as_me:3435: error: Cross-build requires two compilers.
3436 Use --with-build-cc to specify the native compiler." >&5
3437 echo "$as_me: error: Cross-build requires two compilers.
3438 Use --with-build-cc to specify the native compiler." >&2;}
3439    { (exit 1); exit 1; }; }
3440         fi
3441
3442 else
3443         : ${BUILD_CC:='${CC}'}
3444         : ${BUILD_CPP:='${CPP}'}
3445         : ${BUILD_CFLAGS:='${CFLAGS}'}
3446         : ${BUILD_CPPFLAGS:='${CPPFLAGS}'}
3447         : ${BUILD_LDFLAGS:='${LDFLAGS}'}
3448         : ${BUILD_LIBS:='${LIBS}'}
3449         : ${BUILD_EXEEXT:='$x'}
3450         : ${BUILD_OBJEXT:='o'}
3451 fi
3452
3453 ###############################################################################
3454
3455 ### Options to allow the user to specify the set of libraries which are used.
3456 ### Use "--without-normal --with-shared" to allow the default model to be
3457 ### shared, for example.
3458 cf_list_models=""
3459
3460 echo "$as_me:3460: checking if you want to build shared C-objects" >&5
3461 echo $ECHO_N "checking if you want to build shared C-objects... $ECHO_C" >&6
3462
3463 # Check whether --with-shared or --without-shared was given.
3464 if test "${with_shared+set}" = set; then
3465   withval="$with_shared"
3466   with_shared=$withval
3467 else
3468   with_shared=no
3469 fi;
3470 echo "$as_me:3470: result: $with_shared" >&5
3471 echo "${ECHO_T}$with_shared" >&6
3472 test "$with_shared" = "yes" && cf_list_models="$cf_list_models shared"
3473
3474 echo "$as_me:3474: checking for specified models" >&5
3475 echo $ECHO_N "checking for specified models... $ECHO_C" >&6
3476 test -z "$cf_list_models" && cf_list_models=normal
3477 echo "$as_me:3477: result: $cf_list_models" >&5
3478 echo "${ECHO_T}$cf_list_models" >&6
3479
3480 ### Use the first model as the default, and save its suffix for use in building
3481 ### up test-applications.
3482 echo "$as_me:3482: checking for default model" >&5
3483 echo $ECHO_N "checking for default model... $ECHO_C" >&6
3484 DFT_LWR_MODEL=`echo "$cf_list_models" | $AWK '{print $1}'`
3485 echo "$as_me:3485: result: $DFT_LWR_MODEL" >&5
3486 echo "${ECHO_T}$DFT_LWR_MODEL" >&6
3487
3488 DFT_UPR_MODEL=`echo "$DFT_LWR_MODEL" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
3489
3490 echo "$as_me:3490: checking for specific curses-directory" >&5
3491 echo $ECHO_N "checking for specific curses-directory... $ECHO_C" >&6
3492
3493 # Check whether --with-curses-dir or --without-curses-dir was given.
3494 if test "${with_curses_dir+set}" = set; then
3495   withval="$with_curses_dir"
3496   cf_cv_curses_dir=$withval
3497 else
3498   cf_cv_curses_dir=no
3499 fi;
3500 echo "$as_me:3500: result: $cf_cv_curses_dir" >&5
3501 echo "${ECHO_T}$cf_cv_curses_dir" >&6
3502
3503 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
3504 then
3505
3506 if test "x$prefix" != xNONE; then
3507         cf_path_syntax="$prefix"
3508 else
3509         cf_path_syntax="$ac_default_prefix"
3510 fi
3511
3512 case ".$withval" in
3513 (.\$\(*\)*|.\'*\'*)
3514         ;;
3515 (..|./*|.\\*)
3516         ;;
3517 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
3518         ;;
3519 (.\${*prefix}*|.\${*dir}*)
3520         eval withval="$withval"
3521         case ".$withval" in
3522         (.NONE/*)
3523                 withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
3524                 ;;
3525         esac
3526         ;;
3527 (.no|.NONE/*)
3528         withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
3529         ;;
3530 (*)
3531         { { echo "$as_me:3531: error: expected a pathname, not \"$withval\"" >&5
3532 echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;}
3533    { (exit 1); exit 1; }; }
3534         ;;
3535 esac
3536
3537         if test -d "$cf_cv_curses_dir"
3538         then
3539
3540 if test -n "$cf_cv_curses_dir/include" ; then
3541   for cf_add_incdir in $cf_cv_curses_dir/include
3542   do
3543         while test $cf_add_incdir != /usr/include
3544         do
3545           if test -d $cf_add_incdir
3546           then
3547                 cf_have_incdir=no
3548                 if test -n "$CFLAGS$CPPFLAGS" ; then
3549                   # a loop is needed to ensure we can add subdirs of existing dirs
3550                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
3551                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
3552                           cf_have_incdir=yes; break
3553                         fi
3554                   done
3555                 fi
3556
3557                 if test "$cf_have_incdir" = no ; then
3558                   if test "$cf_add_incdir" = /usr/local/include ; then
3559                         if test "$GCC" = yes
3560                         then
3561                           cf_save_CPPFLAGS=$CPPFLAGS
3562                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
3563                           cat >conftest.$ac_ext <<_ACEOF
3564 #line 3564 "configure"
3565 #include "confdefs.h"
3566 #include <stdio.h>
3567 int
3568 main ()
3569 {
3570 printf("Hello")
3571   ;
3572   return 0;
3573 }
3574 _ACEOF
3575 rm -f conftest.$ac_objext
3576 if { (eval echo "$as_me:3576: \"$ac_compile\"") >&5
3577   (eval $ac_compile) 2>&5
3578   ac_status=$?
3579   echo "$as_me:3579: \$? = $ac_status" >&5
3580   (exit $ac_status); } &&
3581          { ac_try='test -s conftest.$ac_objext'
3582   { (eval echo "$as_me:3582: \"$ac_try\"") >&5
3583   (eval $ac_try) 2>&5
3584   ac_status=$?
3585   echo "$as_me:3585: \$? = $ac_status" >&5
3586   (exit $ac_status); }; }; then
3587   :
3588 else
3589   echo "$as_me: failed program was:" >&5
3590 cat conftest.$ac_ext >&5
3591 cf_have_incdir=yes
3592 fi
3593 rm -f conftest.$ac_objext conftest.$ac_ext
3594                           CPPFLAGS=$cf_save_CPPFLAGS
3595                         fi
3596                   fi
3597                 fi
3598
3599                 if test "$cf_have_incdir" = no ; then
3600                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
3601
3602 echo "${as_me:-configure}:3602: testing adding $cf_add_incdir to include-path ..." 1>&5
3603
3604                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
3605
3606                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
3607                   test "$cf_top_incdir" = "$cf_add_incdir" && break
3608                   cf_add_incdir="$cf_top_incdir"
3609                 else
3610                   break
3611                 fi
3612           fi
3613         done
3614   done
3615 fi
3616
3617 if test -n "$cf_cv_curses_dir/lib" ; then
3618         for cf_add_libdir in $cf_cv_curses_dir/lib
3619         do
3620                 if test $cf_add_libdir = /usr/lib ; then
3621                         :
3622                 elif test -d $cf_add_libdir
3623                 then
3624                         cf_have_libdir=no
3625                         if test -n "$LDFLAGS$LIBS" ; then
3626                                 # a loop is needed to ensure we can add subdirs of existing dirs
3627                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
3628                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
3629                                                 cf_have_libdir=yes; break
3630                                         fi
3631                                 done
3632                         fi
3633                         if test "$cf_have_libdir" = no ; then
3634                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
3635
3636 echo "${as_me:-configure}:3636: testing adding $cf_add_libdir to library-path ..." 1>&5
3637
3638                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
3639                         fi
3640                 fi
3641         done
3642 fi
3643
3644         fi
3645 fi
3646
3647 cf_ncuconfig_root=ncurses
3648 cf_have_ncuconfig=no
3649
3650 if test "x$PKG_CONFIG" != xnone; then
3651         echo "$as_me:3651: checking pkg-config for $cf_ncuconfig_root" >&5
3652 echo $ECHO_N "checking pkg-config for $cf_ncuconfig_root... $ECHO_C" >&6
3653         if "$PKG_CONFIG" --exists $cf_ncuconfig_root ; then
3654                 echo "$as_me:3654: result: yes" >&5
3655 echo "${ECHO_T}yes" >&6
3656
3657                 echo "$as_me:3657: checking if the $cf_ncuconfig_root package files work" >&5
3658 echo $ECHO_N "checking if the $cf_ncuconfig_root package files work... $ECHO_C" >&6
3659                 cf_have_ncuconfig=unknown
3660
3661                 cf_save_CPPFLAGS="$CPPFLAGS"
3662                 cf_save_LIBS="$LIBS"
3663
3664                 CPPFLAGS="$CPPFLAGS `$PKG_CONFIG --cflags $cf_ncuconfig_root`"
3665
3666 cf_add_libs="`$PKG_CONFIG --libs $cf_ncuconfig_root`"
3667 # Filter out duplicates - this happens with badly-designed ".pc" files...
3668 for cf_add_1lib in $LIBS
3669 do
3670         for cf_add_2lib in $cf_add_libs
3671         do
3672                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
3673                 then
3674                         cf_add_1lib=
3675                         break
3676                 fi
3677         done
3678         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
3679 done
3680 LIBS="$cf_add_libs"
3681
3682                 cat >conftest.$ac_ext <<_ACEOF
3683 #line 3683 "configure"
3684 #include "confdefs.h"
3685 #include <${cf_cv_ncurses_header:-curses.h}>
3686 int
3687 main ()
3688 {
3689 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
3690   ;
3691   return 0;
3692 }
3693 _ACEOF
3694 rm -f conftest.$ac_objext conftest$ac_exeext
3695 if { (eval echo "$as_me:3695: \"$ac_link\"") >&5
3696   (eval $ac_link) 2>&5
3697   ac_status=$?
3698   echo "$as_me:3698: \$? = $ac_status" >&5
3699   (exit $ac_status); } &&
3700          { ac_try='test -s conftest$ac_exeext'
3701   { (eval echo "$as_me:3701: \"$ac_try\"") >&5
3702   (eval $ac_try) 2>&5
3703   ac_status=$?
3704   echo "$as_me:3704: \$? = $ac_status" >&5
3705   (exit $ac_status); }; }; then
3706   if test "$cross_compiling" = yes; then
3707   { { echo "$as_me:3707: error: cannot run test program while cross compiling" >&5
3708 echo "$as_me: error: cannot run test program while cross compiling" >&2;}
3709    { (exit 1); exit 1; }; }
3710 else
3711   cat >conftest.$ac_ext <<_ACEOF
3712 #line 3712 "configure"
3713 #include "confdefs.h"
3714 #include <${cf_cv_ncurses_header:-curses.h}>
3715                                 int main(void)
3716                                 { char *xx = curses_version(); return (xx == 0); }
3717 _ACEOF
3718 rm -f conftest$ac_exeext
3719 if { (eval echo "$as_me:3719: \"$ac_link\"") >&5
3720   (eval $ac_link) 2>&5
3721   ac_status=$?
3722   echo "$as_me:3722: \$? = $ac_status" >&5
3723   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
3724   { (eval echo "$as_me:3724: \"$ac_try\"") >&5
3725   (eval $ac_try) 2>&5
3726   ac_status=$?
3727   echo "$as_me:3727: \$? = $ac_status" >&5
3728   (exit $ac_status); }; }; then
3729   cf_have_ncuconfig=yes
3730 else
3731   echo "$as_me: program exited with status $ac_status" >&5
3732 echo "$as_me: failed program was:" >&5
3733 cat conftest.$ac_ext >&5
3734 cf_have_ncuconfig=no
3735 fi
3736 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
3737 fi
3738 else
3739   echo "$as_me: failed program was:" >&5
3740 cat conftest.$ac_ext >&5
3741 cf_have_ncuconfig=no
3742 fi
3743 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
3744
3745                 echo "$as_me:3745: result: $cf_have_ncuconfig" >&5
3746 echo "${ECHO_T}$cf_have_ncuconfig" >&6
3747                 if test "$cf_have_ncuconfig" != "yes"
3748                 then
3749                         CPPFLAGS="$cf_save_CPPFLAGS"
3750                         LIBS="$cf_save_LIBS"
3751                         NCURSES_CONFIG_PKG=none
3752                 else
3753
3754 cat >>confdefs.h <<\EOF
3755 #define NCURSES 1
3756 EOF
3757
3758                         NCURSES_CONFIG_PKG=$cf_ncuconfig_root
3759                 fi
3760
3761         else
3762                 echo "$as_me:3762: result: no" >&5
3763 echo "${ECHO_T}no" >&6
3764                 NCURSES_CONFIG_PKG=none
3765         fi
3766 else
3767         NCURSES_CONFIG_PKG=none
3768 fi
3769
3770 if test "x$cf_have_ncuconfig" = "xno"; then
3771         echo "Looking for ${cf_ncuconfig_root}-config"
3772
3773 if test -n "$ac_tool_prefix"; then
3774   for ac_prog in ${cf_ncuconfig_root}-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
3775   do
3776     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
3777 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
3778 echo "$as_me:3778: checking for $ac_word" >&5
3779 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3780 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
3781   echo $ECHO_N "(cached) $ECHO_C" >&6
3782 else
3783   if test -n "$NCURSES_CONFIG"; then
3784   ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
3785 else
3786   ac_save_IFS=$IFS; IFS=$ac_path_separator
3787 ac_dummy="$PATH"
3788 for ac_dir in $ac_dummy; do
3789   IFS=$ac_save_IFS
3790   test -z "$ac_dir" && ac_dir=.
3791   $as_executable_p "$ac_dir/$ac_word" || continue
3792 ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
3793 echo "$as_me:3793: found $ac_dir/$ac_word" >&5
3794 break
3795 done
3796
3797 fi
3798 fi
3799 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
3800 if test -n "$NCURSES_CONFIG"; then
3801   echo "$as_me:3801: result: $NCURSES_CONFIG" >&5
3802 echo "${ECHO_T}$NCURSES_CONFIG" >&6
3803 else
3804   echo "$as_me:3804: result: no" >&5
3805 echo "${ECHO_T}no" >&6
3806 fi
3807
3808     test -n "$NCURSES_CONFIG" && break
3809   done
3810 fi
3811 if test -z "$NCURSES_CONFIG"; then
3812   ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
3813   for ac_prog in ${cf_ncuconfig_root}-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
3814 do
3815   # Extract the first word of "$ac_prog", so it can be a program name with args.
3816 set dummy $ac_prog; ac_word=$2
3817 echo "$as_me:3817: checking for $ac_word" >&5
3818 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3819 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
3820   echo $ECHO_N "(cached) $ECHO_C" >&6
3821 else
3822   if test -n "$ac_ct_NCURSES_CONFIG"; then
3823   ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
3824 else
3825   ac_save_IFS=$IFS; IFS=$ac_path_separator
3826 ac_dummy="$PATH"
3827 for ac_dir in $ac_dummy; do
3828   IFS=$ac_save_IFS
3829   test -z "$ac_dir" && ac_dir=.
3830   $as_executable_p "$ac_dir/$ac_word" || continue
3831 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
3832 echo "$as_me:3832: found $ac_dir/$ac_word" >&5
3833 break
3834 done
3835
3836 fi
3837 fi
3838 ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
3839 if test -n "$ac_ct_NCURSES_CONFIG"; then
3840   echo "$as_me:3840: result: $ac_ct_NCURSES_CONFIG" >&5
3841 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
3842 else
3843   echo "$as_me:3843: result: no" >&5
3844 echo "${ECHO_T}no" >&6
3845 fi
3846
3847   test -n "$ac_ct_NCURSES_CONFIG" && break
3848 done
3849 test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
3850
3851   NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
3852 fi
3853
3854         if test "$NCURSES_CONFIG" != none ; then
3855
3856                 CPPFLAGS="$CPPFLAGS `$NCURSES_CONFIG --cflags`"
3857
3858 cf_add_libs="`$NCURSES_CONFIG --libs`"
3859 # Filter out duplicates - this happens with badly-designed ".pc" files...
3860 for cf_add_1lib in $LIBS
3861 do
3862         for cf_add_2lib in $cf_add_libs
3863         do
3864                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
3865                 then
3866                         cf_add_1lib=
3867                         break
3868                 fi
3869         done
3870         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
3871 done
3872 LIBS="$cf_add_libs"
3873
3874                 # even with config script, some packages use no-override for curses.h
3875
3876 echo "$as_me:3876: checking if we have identified curses headers" >&5
3877 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
3878 if test "${cf_cv_ncurses_header+set}" = set; then
3879   echo $ECHO_N "(cached) $ECHO_C" >&6
3880 else
3881
3882 cf_cv_ncurses_header=none
3883 for cf_header in \
3884         ncurses.h ncurses/ncurses.h \
3885         curses.h ncurses/curses.h
3886 do
3887 cat >conftest.$ac_ext <<_ACEOF
3888 #line 3888 "configure"
3889 #include "confdefs.h"
3890 #include <${cf_header}>
3891 int
3892 main ()
3893 {
3894 initscr(); tgoto("?", 0,0)
3895   ;
3896   return 0;
3897 }
3898 _ACEOF
3899 rm -f conftest.$ac_objext
3900 if { (eval echo "$as_me:3900: \"$ac_compile\"") >&5
3901   (eval $ac_compile) 2>&5
3902   ac_status=$?
3903   echo "$as_me:3903: \$? = $ac_status" >&5
3904   (exit $ac_status); } &&
3905          { ac_try='test -s conftest.$ac_objext'
3906   { (eval echo "$as_me:3906: \"$ac_try\"") >&5
3907   (eval $ac_try) 2>&5
3908   ac_status=$?
3909   echo "$as_me:3909: \$? = $ac_status" >&5
3910   (exit $ac_status); }; }; then
3911   cf_cv_ncurses_header=$cf_header; break
3912 else
3913   echo "$as_me: failed program was:" >&5
3914 cat conftest.$ac_ext >&5
3915 fi
3916 rm -f conftest.$ac_objext conftest.$ac_ext
3917 done
3918
3919 fi
3920 echo "$as_me:3920: result: $cf_cv_ncurses_header" >&5
3921 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
3922
3923 if test "$cf_cv_ncurses_header" = none ; then
3924         { { echo "$as_me:3924: error: No curses header-files found" >&5
3925 echo "$as_me: error: No curses header-files found" >&2;}
3926    { (exit 1); exit 1; }; }
3927 fi
3928
3929 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
3930
3931 for ac_header in $cf_cv_ncurses_header
3932 do
3933 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
3934 echo "$as_me:3934: checking for $ac_header" >&5
3935 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
3936 if eval "test \"\${$as_ac_Header+set}\" = set"; then
3937   echo $ECHO_N "(cached) $ECHO_C" >&6
3938 else
3939   cat >conftest.$ac_ext <<_ACEOF
3940 #line 3940 "configure"
3941 #include "confdefs.h"
3942 #include <$ac_header>
3943 _ACEOF
3944 if { (eval echo "$as_me:3944: \"$ac_cpp conftest.$ac_ext\"") >&5
3945   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
3946   ac_status=$?
3947   egrep -v '^ *\+' conftest.er1 >conftest.err
3948   rm -f conftest.er1
3949   cat conftest.err >&5
3950   echo "$as_me:3950: \$? = $ac_status" >&5
3951   (exit $ac_status); } >/dev/null; then
3952   if test -s conftest.err; then
3953     ac_cpp_err=$ac_c_preproc_warn_flag
3954   else
3955     ac_cpp_err=
3956   fi
3957 else
3958   ac_cpp_err=yes
3959 fi
3960 if test -z "$ac_cpp_err"; then
3961   eval "$as_ac_Header=yes"
3962 else
3963   echo "$as_me: failed program was:" >&5
3964   cat conftest.$ac_ext >&5
3965   eval "$as_ac_Header=no"
3966 fi
3967 rm -f conftest.err conftest.$ac_ext
3968 fi
3969 echo "$as_me:3969: result: `eval echo '${'$as_ac_Header'}'`" >&5
3970 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
3971 if test `eval echo '${'$as_ac_Header'}'` = yes; then
3972   cat >>confdefs.h <<EOF
3973 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
3974 EOF
3975
3976 fi
3977 done
3978
3979 cat >>confdefs.h <<\EOF
3980 #define NCURSES 1
3981 EOF
3982
3983 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
3984
3985                 cat >>confdefs.h <<EOF
3986 #define $cf_nculib_ROOT 1
3987 EOF
3988
3989                                 cf_cv_ncurses_version=`$NCURSES_CONFIG --version`
3990
3991         else
3992
3993 cf_ncuhdr_root=ncurses
3994
3995 test -n "$cf_cv_curses_dir" && \
3996 test "$cf_cv_curses_dir" != "no" && { \
3997
3998 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
3999   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
4000   do
4001         while test $cf_add_incdir != /usr/include
4002         do
4003           if test -d $cf_add_incdir
4004           then
4005                 cf_have_incdir=no
4006                 if test -n "$CFLAGS$CPPFLAGS" ; then
4007                   # a loop is needed to ensure we can add subdirs of existing dirs
4008                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
4009                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
4010                           cf_have_incdir=yes; break
4011                         fi
4012                   done
4013                 fi
4014
4015                 if test "$cf_have_incdir" = no ; then
4016                   if test "$cf_add_incdir" = /usr/local/include ; then
4017                         if test "$GCC" = yes
4018                         then
4019                           cf_save_CPPFLAGS=$CPPFLAGS
4020                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
4021                           cat >conftest.$ac_ext <<_ACEOF
4022 #line 4022 "configure"
4023 #include "confdefs.h"
4024 #include <stdio.h>
4025 int
4026 main ()
4027 {
4028 printf("Hello")
4029   ;
4030   return 0;
4031 }
4032 _ACEOF
4033 rm -f conftest.$ac_objext
4034 if { (eval echo "$as_me:4034: \"$ac_compile\"") >&5
4035   (eval $ac_compile) 2>&5
4036   ac_status=$?
4037   echo "$as_me:4037: \$? = $ac_status" >&5
4038   (exit $ac_status); } &&
4039          { ac_try='test -s conftest.$ac_objext'
4040   { (eval echo "$as_me:4040: \"$ac_try\"") >&5
4041   (eval $ac_try) 2>&5
4042   ac_status=$?
4043   echo "$as_me:4043: \$? = $ac_status" >&5
4044   (exit $ac_status); }; }; then
4045   :
4046 else
4047   echo "$as_me: failed program was:" >&5
4048 cat conftest.$ac_ext >&5
4049 cf_have_incdir=yes
4050 fi
4051 rm -f conftest.$ac_objext conftest.$ac_ext
4052                           CPPFLAGS=$cf_save_CPPFLAGS
4053                         fi
4054                   fi
4055                 fi
4056
4057                 if test "$cf_have_incdir" = no ; then
4058                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
4059
4060 echo "${as_me:-configure}:4060: testing adding $cf_add_incdir to include-path ..." 1>&5
4061
4062                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
4063
4064                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
4065                   test "$cf_top_incdir" = "$cf_add_incdir" && break
4066                   cf_add_incdir="$cf_top_incdir"
4067                 else
4068                   break
4069                 fi
4070           fi
4071         done
4072   done
4073 fi
4074
4075 }
4076
4077 echo "$as_me:4077: checking for $cf_ncuhdr_root header in include-path" >&5
4078 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
4079 if test "${cf_cv_ncurses_h+set}" = set; then
4080   echo $ECHO_N "(cached) $ECHO_C" >&6
4081 else
4082
4083         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
4084         ( test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw ) && cf_header_list="$cf_header_list curses.h ncurses.h"
4085         for cf_header in $cf_header_list
4086         do
4087
4088         cat >conftest.$ac_ext <<_ACEOF
4089 #line 4089 "configure"
4090 #include "confdefs.h"
4091
4092 #include <$cf_header>
4093 int
4094 main ()
4095 {
4096
4097 #ifdef NCURSES_VERSION
4098
4099 printf("%s\n", NCURSES_VERSION);
4100 #else
4101 #ifdef __NCURSES_H
4102 printf("old\n");
4103 #else
4104         make an error
4105 #endif
4106 #endif
4107
4108   ;
4109   return 0;
4110 }
4111 _ACEOF
4112 rm -f conftest.$ac_objext
4113 if { (eval echo "$as_me:4113: \"$ac_compile\"") >&5
4114   (eval $ac_compile) 2>&5
4115   ac_status=$?
4116   echo "$as_me:4116: \$? = $ac_status" >&5
4117   (exit $ac_status); } &&
4118          { ac_try='test -s conftest.$ac_objext'
4119   { (eval echo "$as_me:4119: \"$ac_try\"") >&5
4120   (eval $ac_try) 2>&5
4121   ac_status=$?
4122   echo "$as_me:4122: \$? = $ac_status" >&5
4123   (exit $ac_status); }; }; then
4124   cf_cv_ncurses_h=$cf_header
4125
4126 else
4127   echo "$as_me: failed program was:" >&5
4128 cat conftest.$ac_ext >&5
4129 cf_cv_ncurses_h=no
4130 fi
4131 rm -f conftest.$ac_objext conftest.$ac_ext
4132
4133                 test "$cf_cv_ncurses_h" != no && break
4134         done
4135
4136 fi
4137 echo "$as_me:4137: result: $cf_cv_ncurses_h" >&5
4138 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
4139
4140 if test "$cf_cv_ncurses_h" != no ; then
4141         cf_cv_ncurses_header=$cf_cv_ncurses_h
4142 else
4143
4144 echo "$as_me:4144: checking for $cf_ncuhdr_root include-path" >&5
4145 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
4146 if test "${cf_cv_ncurses_h2+set}" = set; then
4147   echo $ECHO_N "(cached) $ECHO_C" >&6
4148 else
4149
4150         test -n "$verbose" && echo
4151
4152 cf_search=
4153
4154 # collect the current set of include-directories from compiler flags
4155 cf_header_path_list=""
4156 if test -n "${CFLAGS}${CPPFLAGS}" ; then
4157         for cf_header_path in $CPPFLAGS $CFLAGS
4158         do
4159                 case $cf_header_path in
4160                 (-I*)
4161                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
4162
4163 test "x$cf_header_path" != "xNONE" && \
4164 test -d "$cf_header_path" && \
4165  {
4166         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
4167         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
4168         test -d $cf_header_path/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
4169         test -d $cf_header_path/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
4170         test -d $cf_header_path/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
4171         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"
4172 }
4173
4174                         cf_header_path_list="$cf_header_path_list $cf_search"
4175                         ;;
4176                 esac
4177         done
4178 fi
4179
4180 # add the variations for the package we are looking for
4181
4182 cf_search=
4183
4184 test "x$prefix" != "xNONE" && \
4185 test -d "$prefix" && \
4186  {
4187         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
4188         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
4189         test -d $prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
4190         test -d $prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
4191         test -d $prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
4192         test -d $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
4193 }
4194
4195 for cf_subdir_prefix in \
4196         /usr \
4197         /usr/local \
4198         /usr/pkg \
4199         /opt \
4200         /opt/local \
4201         $HOME
4202 do
4203
4204 test "x$cf_subdir_prefix" != "x$prefix" && \
4205 test -d "$cf_subdir_prefix" && \
4206 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
4207         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
4208         test -d $cf_subdir_prefix/include &&          cf_search="$cf_search $cf_subdir_prefix/include"
4209         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root"
4210         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root/include"
4211         test -d $cf_subdir_prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include"
4212         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"
4213 }
4214
4215 done
4216
4217 test "$includedir" != NONE && \
4218 test "$includedir" != "/usr/include" && \
4219 test -d "$includedir" && {
4220         test -d $includedir &&    cf_search="$cf_search $includedir"
4221         test -d $includedir/$cf_ncuhdr_root && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
4222 }
4223
4224 test "$oldincludedir" != NONE && \
4225 test "$oldincludedir" != "/usr/include" && \
4226 test -d "$oldincludedir" && {
4227         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
4228         test -d $oldincludedir/$cf_ncuhdr_root && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
4229 }
4230
4231 cf_search="$cf_search $cf_header_path_list"
4232
4233         test -n "$verbose" && echo search path $cf_search
4234         cf_save2_CPPFLAGS="$CPPFLAGS"
4235         for cf_incdir in $cf_search
4236         do
4237
4238 if test -n "$cf_incdir" ; then
4239   for cf_add_incdir in $cf_incdir
4240   do
4241         while test $cf_add_incdir != /usr/include
4242         do
4243           if test -d $cf_add_incdir
4244           then
4245                 cf_have_incdir=no
4246                 if test -n "$CFLAGS$CPPFLAGS" ; then
4247                   # a loop is needed to ensure we can add subdirs of existing dirs
4248                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
4249                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
4250                           cf_have_incdir=yes; break
4251                         fi
4252                   done
4253                 fi
4254
4255                 if test "$cf_have_incdir" = no ; then
4256                   if test "$cf_add_incdir" = /usr/local/include ; then
4257                         if test "$GCC" = yes
4258                         then
4259                           cf_save_CPPFLAGS=$CPPFLAGS
4260                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
4261                           cat >conftest.$ac_ext <<_ACEOF
4262 #line 4262 "configure"
4263 #include "confdefs.h"
4264 #include <stdio.h>
4265 int
4266 main ()
4267 {
4268 printf("Hello")
4269   ;
4270   return 0;
4271 }
4272 _ACEOF
4273 rm -f conftest.$ac_objext
4274 if { (eval echo "$as_me:4274: \"$ac_compile\"") >&5
4275   (eval $ac_compile) 2>&5
4276   ac_status=$?
4277   echo "$as_me:4277: \$? = $ac_status" >&5
4278   (exit $ac_status); } &&
4279          { ac_try='test -s conftest.$ac_objext'
4280   { (eval echo "$as_me:4280: \"$ac_try\"") >&5
4281   (eval $ac_try) 2>&5
4282   ac_status=$?
4283   echo "$as_me:4283: \$? = $ac_status" >&5
4284   (exit $ac_status); }; }; then
4285   :
4286 else
4287   echo "$as_me: failed program was:" >&5
4288 cat conftest.$ac_ext >&5
4289 cf_have_incdir=yes
4290 fi
4291 rm -f conftest.$ac_objext conftest.$ac_ext
4292                           CPPFLAGS=$cf_save_CPPFLAGS
4293                         fi
4294                   fi
4295                 fi
4296
4297                 if test "$cf_have_incdir" = no ; then
4298                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
4299
4300 echo "${as_me:-configure}:4300: testing adding $cf_add_incdir to include-path ..." 1>&5
4301
4302                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
4303
4304                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
4305                   test "$cf_top_incdir" = "$cf_add_incdir" && break
4306                   cf_add_incdir="$cf_top_incdir"
4307                 else
4308                   break
4309                 fi
4310           fi
4311         done
4312   done
4313 fi
4314
4315                 for cf_header in \
4316                         ncurses.h \
4317                         curses.h
4318                 do
4319
4320         cat >conftest.$ac_ext <<_ACEOF
4321 #line 4321 "configure"
4322 #include "confdefs.h"
4323
4324 #include <$cf_header>
4325 int
4326 main ()
4327 {
4328
4329 #ifdef NCURSES_VERSION
4330
4331 printf("%s\n", NCURSES_VERSION);
4332 #else
4333 #ifdef __NCURSES_H
4334 printf("old\n");
4335 #else
4336         make an error
4337 #endif
4338 #endif
4339
4340   ;
4341   return 0;
4342 }
4343 _ACEOF
4344 rm -f conftest.$ac_objext
4345 if { (eval echo "$as_me:4345: \"$ac_compile\"") >&5
4346   (eval $ac_compile) 2>&5
4347   ac_status=$?
4348   echo "$as_me:4348: \$? = $ac_status" >&5
4349   (exit $ac_status); } &&
4350          { ac_try='test -s conftest.$ac_objext'
4351   { (eval echo "$as_me:4351: \"$ac_try\"") >&5
4352   (eval $ac_try) 2>&5
4353   ac_status=$?
4354   echo "$as_me:4354: \$? = $ac_status" >&5
4355   (exit $ac_status); }; }; then
4356   cf_cv_ncurses_h2=$cf_header
4357
4358 else
4359   echo "$as_me: failed program was:" >&5
4360 cat conftest.$ac_ext >&5
4361 cf_cv_ncurses_h2=no
4362 fi
4363 rm -f conftest.$ac_objext conftest.$ac_ext
4364
4365                         if test "$cf_cv_ncurses_h2" != no ; then
4366                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
4367                                 test -n "$verbose" && echo $ac_n "      ... found $ac_c" 1>&6
4368                                 break
4369                         fi
4370                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
4371                 done
4372                 CPPFLAGS="$cf_save2_CPPFLAGS"
4373                 test "$cf_cv_ncurses_h2" != no && break
4374         done
4375         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:4375: error: not found" >&5
4376 echo "$as_me: error: not found" >&2;}
4377    { (exit 1); exit 1; }; }
4378
4379 fi
4380 echo "$as_me:4380: result: $cf_cv_ncurses_h2" >&5
4381 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
4382
4383         cf_1st_incdir=`echo $cf_cv_ncurses_h2 | sed -e 's%/[^/]*$%%'`
4384         cf_cv_ncurses_header=`basename $cf_cv_ncurses_h2`
4385         if test `basename $cf_1st_incdir` = $cf_ncuhdr_root ; then
4386                 cf_cv_ncurses_header=$cf_ncuhdr_root/$cf_cv_ncurses_header
4387         fi
4388
4389 if test -n "$cf_1st_incdir" ; then
4390   for cf_add_incdir in $cf_1st_incdir
4391   do
4392         while test $cf_add_incdir != /usr/include
4393         do
4394           if test -d $cf_add_incdir
4395           then
4396                 cf_have_incdir=no
4397                 if test -n "$CFLAGS$CPPFLAGS" ; then
4398                   # a loop is needed to ensure we can add subdirs of existing dirs
4399                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
4400                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
4401                           cf_have_incdir=yes; break
4402                         fi
4403                   done
4404                 fi
4405
4406                 if test "$cf_have_incdir" = no ; then
4407                   if test "$cf_add_incdir" = /usr/local/include ; then
4408                         if test "$GCC" = yes
4409                         then
4410                           cf_save_CPPFLAGS=$CPPFLAGS
4411                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
4412                           cat >conftest.$ac_ext <<_ACEOF
4413 #line 4413 "configure"
4414 #include "confdefs.h"
4415 #include <stdio.h>
4416 int
4417 main ()
4418 {
4419 printf("Hello")
4420   ;
4421   return 0;
4422 }
4423 _ACEOF
4424 rm -f conftest.$ac_objext
4425 if { (eval echo "$as_me:4425: \"$ac_compile\"") >&5
4426   (eval $ac_compile) 2>&5
4427   ac_status=$?
4428   echo "$as_me:4428: \$? = $ac_status" >&5
4429   (exit $ac_status); } &&
4430          { ac_try='test -s conftest.$ac_objext'
4431   { (eval echo "$as_me:4431: \"$ac_try\"") >&5
4432   (eval $ac_try) 2>&5
4433   ac_status=$?
4434   echo "$as_me:4434: \$? = $ac_status" >&5
4435   (exit $ac_status); }; }; then
4436   :
4437 else
4438   echo "$as_me: failed program was:" >&5
4439 cat conftest.$ac_ext >&5
4440 cf_have_incdir=yes
4441 fi
4442 rm -f conftest.$ac_objext conftest.$ac_ext
4443                           CPPFLAGS=$cf_save_CPPFLAGS
4444                         fi
4445                   fi
4446                 fi
4447
4448                 if test "$cf_have_incdir" = no ; then
4449                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
4450
4451 echo "${as_me:-configure}:4451: testing adding $cf_add_incdir to include-path ..." 1>&5
4452
4453                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
4454
4455                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
4456                   test "$cf_top_incdir" = "$cf_add_incdir" && break
4457                   cf_add_incdir="$cf_top_incdir"
4458                 else
4459                   break
4460                 fi
4461           fi
4462         done
4463   done
4464 fi
4465
4466 fi
4467
4468 # Set definitions to allow ifdef'ing for ncurses.h
4469
4470 case $cf_cv_ncurses_header in
4471 (*ncurses.h)
4472
4473 cat >>confdefs.h <<\EOF
4474 #define HAVE_NCURSES_H 1
4475 EOF
4476
4477         ;;
4478 esac
4479
4480 case $cf_cv_ncurses_header in
4481 (ncurses/curses.h|ncurses/ncurses.h)
4482
4483 cat >>confdefs.h <<\EOF
4484 #define HAVE_NCURSES_NCURSES_H 1
4485 EOF
4486
4487         ;;
4488 (ncursesw/curses.h|ncursesw/ncurses.h)
4489
4490 cat >>confdefs.h <<\EOF
4491 #define HAVE_NCURSESW_NCURSES_H 1
4492 EOF
4493
4494         ;;
4495 esac
4496
4497 echo "$as_me:4497: checking for terminfo header" >&5
4498 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
4499 if test "${cf_cv_term_header+set}" = set; then
4500   echo $ECHO_N "(cached) $ECHO_C" >&6
4501 else
4502
4503 case ${cf_cv_ncurses_header} in
4504 (*/ncurses.h|*/ncursesw.h)
4505         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
4506         ;;
4507 (*)
4508         cf_term_header=term.h
4509         ;;
4510 esac
4511
4512 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
4513 do
4514 cat >conftest.$ac_ext <<_ACEOF
4515 #line 4515 "configure"
4516 #include "confdefs.h"
4517 #include <stdio.h>
4518 #include <${cf_cv_ncurses_header:-curses.h}>
4519 #include <$cf_test>
4520
4521 int
4522 main ()
4523 {
4524 int x = auto_left_margin
4525   ;
4526   return 0;
4527 }
4528 _ACEOF
4529 rm -f conftest.$ac_objext
4530 if { (eval echo "$as_me:4530: \"$ac_compile\"") >&5
4531   (eval $ac_compile) 2>&5
4532   ac_status=$?
4533   echo "$as_me:4533: \$? = $ac_status" >&5
4534   (exit $ac_status); } &&
4535          { ac_try='test -s conftest.$ac_objext'
4536   { (eval echo "$as_me:4536: \"$ac_try\"") >&5
4537   (eval $ac_try) 2>&5
4538   ac_status=$?
4539   echo "$as_me:4539: \$? = $ac_status" >&5
4540   (exit $ac_status); }; }; then
4541
4542         cf_cv_term_header="$cf_test"
4543 else
4544   echo "$as_me: failed program was:" >&5
4545 cat conftest.$ac_ext >&5
4546
4547         cf_cv_term_header=unknown
4548
4549 fi
4550 rm -f conftest.$ac_objext conftest.$ac_ext
4551         test "$cf_cv_term_header" != unknown && break
4552 done
4553
4554 fi
4555 echo "$as_me:4555: result: $cf_cv_term_header" >&5
4556 echo "${ECHO_T}$cf_cv_term_header" >&6
4557
4558 # Set definitions to allow ifdef'ing to accommodate subdirectories
4559
4560 case $cf_cv_term_header in
4561 (*term.h)
4562
4563 cat >>confdefs.h <<\EOF
4564 #define HAVE_TERM_H 1
4565 EOF
4566
4567         ;;
4568 esac
4569
4570 case $cf_cv_term_header in
4571 (ncurses/term.h)
4572
4573 cat >>confdefs.h <<\EOF
4574 #define HAVE_NCURSES_TERM_H 1
4575 EOF
4576
4577         ;;
4578 (ncursesw/term.h)
4579
4580 cat >>confdefs.h <<\EOF
4581 #define HAVE_NCURSESW_TERM_H 1
4582 EOF
4583
4584         ;;
4585 esac
4586
4587 # some applications need this, but should check for NCURSES_VERSION
4588
4589 cat >>confdefs.h <<\EOF
4590 #define NCURSES 1
4591 EOF
4592
4593 echo "$as_me:4593: checking for ncurses version" >&5
4594 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
4595 if test "${cf_cv_ncurses_version+set}" = set; then
4596   echo $ECHO_N "(cached) $ECHO_C" >&6
4597 else
4598
4599         cf_cv_ncurses_version=no
4600         cf_tempfile=out$$
4601         rm -f $cf_tempfile
4602         if test "$cross_compiling" = yes; then
4603
4604         # This will not work if the preprocessor splits the line after the
4605         # Autoconf token.  The 'unproto' program does that.
4606         cat > conftest.$ac_ext <<EOF
4607 #include <${cf_cv_ncurses_header:-curses.h}>
4608 #undef Autoconf
4609 #ifdef NCURSES_VERSION
4610 Autoconf NCURSES_VERSION
4611 #else
4612 #ifdef __NCURSES_H
4613 Autoconf "old"
4614 #endif
4615 ;
4616 #endif
4617 EOF
4618         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
4619         { (eval echo "$as_me:4619: \"$cf_try\"") >&5
4620   (eval $cf_try) 2>&5
4621   ac_status=$?
4622   echo "$as_me:4622: \$? = $ac_status" >&5
4623   (exit $ac_status); }
4624         if test -f conftest.out ; then
4625                 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
4626                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
4627                 rm -f conftest.out
4628         fi
4629
4630 else
4631   cat >conftest.$ac_ext <<_ACEOF
4632 #line 4632 "configure"
4633 #include "confdefs.h"
4634
4635 #include <${cf_cv_ncurses_header:-curses.h}>
4636 #include <stdio.h>
4637 int main()
4638 {
4639         FILE *fp = fopen("$cf_tempfile", "w");
4640 #ifdef NCURSES_VERSION
4641 # ifdef NCURSES_VERSION_PATCH
4642         fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
4643 # else
4644         fprintf(fp, "%s\n", NCURSES_VERSION);
4645 # endif
4646 #else
4647 # ifdef __NCURSES_H
4648         fprintf(fp, "old\n");
4649 # else
4650         make an error
4651 # endif
4652 #endif
4653         ${cf_cv_main_return:-return}(0);
4654 }
4655 _ACEOF
4656 rm -f conftest$ac_exeext
4657 if { (eval echo "$as_me:4657: \"$ac_link\"") >&5
4658   (eval $ac_link) 2>&5
4659   ac_status=$?
4660   echo "$as_me:4660: \$? = $ac_status" >&5
4661   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
4662   { (eval echo "$as_me:4662: \"$ac_try\"") >&5
4663   (eval $ac_try) 2>&5
4664   ac_status=$?
4665   echo "$as_me:4665: \$? = $ac_status" >&5
4666   (exit $ac_status); }; }; then
4667
4668         cf_cv_ncurses_version=`cat $cf_tempfile`
4669 else
4670   echo "$as_me: program exited with status $ac_status" >&5
4671 echo "$as_me: failed program was:" >&5
4672 cat conftest.$ac_ext >&5
4673 fi
4674 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
4675 fi
4676         rm -f $cf_tempfile
4677
4678 fi
4679 echo "$as_me:4679: result: $cf_cv_ncurses_version" >&5
4680 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
4681 test "$cf_cv_ncurses_version" = no ||
4682 cat >>confdefs.h <<\EOF
4683 #define NCURSES 1
4684 EOF
4685
4686 cf_nculib_root=ncurses
4687         # This works, except for the special case where we find gpm, but
4688         # ncurses is in a nonstandard location via $LIBS, and we really want
4689         # to link gpm.
4690 cf_ncurses_LIBS=""
4691 cf_ncurses_SAVE="$LIBS"
4692 echo "$as_me:4692: checking for Gpm_Open in -lgpm" >&5
4693 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
4694 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
4695   echo $ECHO_N "(cached) $ECHO_C" >&6
4696 else
4697   ac_check_lib_save_LIBS=$LIBS
4698 LIBS="-lgpm  $LIBS"
4699 cat >conftest.$ac_ext <<_ACEOF
4700 #line 4700 "configure"
4701 #include "confdefs.h"
4702
4703 /* Override any gcc2 internal prototype to avoid an error.  */
4704 #ifdef __cplusplus
4705 extern "C"
4706 #endif
4707 /* We use char because int might match the return type of a gcc2
4708    builtin and then its argument prototype would still apply.  */
4709 char Gpm_Open ();
4710 int
4711 main ()
4712 {
4713 Gpm_Open ();
4714   ;
4715   return 0;
4716 }
4717 _ACEOF
4718 rm -f conftest.$ac_objext conftest$ac_exeext
4719 if { (eval echo "$as_me:4719: \"$ac_link\"") >&5
4720   (eval $ac_link) 2>&5
4721   ac_status=$?
4722   echo "$as_me:4722: \$? = $ac_status" >&5
4723   (exit $ac_status); } &&
4724          { ac_try='test -s conftest$ac_exeext'
4725   { (eval echo "$as_me:4725: \"$ac_try\"") >&5
4726   (eval $ac_try) 2>&5
4727   ac_status=$?
4728   echo "$as_me:4728: \$? = $ac_status" >&5
4729   (exit $ac_status); }; }; then
4730   ac_cv_lib_gpm_Gpm_Open=yes
4731 else
4732   echo "$as_me: failed program was:" >&5
4733 cat conftest.$ac_ext >&5
4734 ac_cv_lib_gpm_Gpm_Open=no
4735 fi
4736 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
4737 LIBS=$ac_check_lib_save_LIBS
4738 fi
4739 echo "$as_me:4739: result: $ac_cv_lib_gpm_Gpm_Open" >&5
4740 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
4741 if test $ac_cv_lib_gpm_Gpm_Open = yes; then
4742   echo "$as_me:4742: checking for initscr in -lgpm" >&5
4743 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
4744 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
4745   echo $ECHO_N "(cached) $ECHO_C" >&6
4746 else
4747   ac_check_lib_save_LIBS=$LIBS
4748 LIBS="-lgpm  $LIBS"
4749 cat >conftest.$ac_ext <<_ACEOF
4750 #line 4750 "configure"
4751 #include "confdefs.h"
4752
4753 /* Override any gcc2 internal prototype to avoid an error.  */
4754 #ifdef __cplusplus
4755 extern "C"
4756 #endif
4757 /* We use char because int might match the return type of a gcc2
4758    builtin and then its argument prototype would still apply.  */
4759 char initscr ();
4760 int
4761 main ()
4762 {
4763 initscr ();
4764   ;
4765   return 0;
4766 }
4767 _ACEOF
4768 rm -f conftest.$ac_objext conftest$ac_exeext
4769 if { (eval echo "$as_me:4769: \"$ac_link\"") >&5
4770   (eval $ac_link) 2>&5
4771   ac_status=$?
4772   echo "$as_me:4772: \$? = $ac_status" >&5
4773   (exit $ac_status); } &&
4774          { ac_try='test -s conftest$ac_exeext'
4775   { (eval echo "$as_me:4775: \"$ac_try\"") >&5
4776   (eval $ac_try) 2>&5
4777   ac_status=$?
4778   echo "$as_me:4778: \$? = $ac_status" >&5
4779   (exit $ac_status); }; }; then
4780   ac_cv_lib_gpm_initscr=yes
4781 else
4782   echo "$as_me: failed program was:" >&5
4783 cat conftest.$ac_ext >&5
4784 ac_cv_lib_gpm_initscr=no
4785 fi
4786 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
4787 LIBS=$ac_check_lib_save_LIBS
4788 fi
4789 echo "$as_me:4789: result: $ac_cv_lib_gpm_initscr" >&5
4790 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
4791 if test $ac_cv_lib_gpm_initscr = yes; then
4792   LIBS="$cf_ncurses_SAVE"
4793 else
4794   cf_ncurses_LIBS="-lgpm"
4795 fi
4796
4797 fi
4798
4799 case $host_os in
4800 (freebsd*)
4801         # This is only necessary if you are linking against an obsolete
4802         # version of ncurses (but it should do no harm, since it's static).
4803         if test "$cf_nculib_root" = ncurses ; then
4804                 echo "$as_me:4804: checking for tgoto in -lmytinfo" >&5
4805 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
4806 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
4807   echo $ECHO_N "(cached) $ECHO_C" >&6
4808 else
4809   ac_check_lib_save_LIBS=$LIBS
4810 LIBS="-lmytinfo  $LIBS"
4811 cat >conftest.$ac_ext <<_ACEOF
4812 #line 4812 "configure"
4813 #include "confdefs.h"
4814
4815 /* Override any gcc2 internal prototype to avoid an error.  */
4816 #ifdef __cplusplus
4817 extern "C"
4818 #endif
4819 /* We use char because int might match the return type of a gcc2
4820    builtin and then its argument prototype would still apply.  */
4821 char tgoto ();
4822 int
4823 main ()
4824 {
4825 tgoto ();
4826   ;
4827   return 0;
4828 }
4829 _ACEOF
4830 rm -f conftest.$ac_objext conftest$ac_exeext
4831 if { (eval echo "$as_me:4831: \"$ac_link\"") >&5
4832   (eval $ac_link) 2>&5
4833   ac_status=$?
4834   echo "$as_me:4834: \$? = $ac_status" >&5
4835   (exit $ac_status); } &&
4836          { ac_try='test -s conftest$ac_exeext'
4837   { (eval echo "$as_me:4837: \"$ac_try\"") >&5
4838   (eval $ac_try) 2>&5
4839   ac_status=$?
4840   echo "$as_me:4840: \$? = $ac_status" >&5
4841   (exit $ac_status); }; }; then
4842   ac_cv_lib_mytinfo_tgoto=yes
4843 else
4844   echo "$as_me: failed program was:" >&5
4845 cat conftest.$ac_ext >&5
4846 ac_cv_lib_mytinfo_tgoto=no
4847 fi
4848 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
4849 LIBS=$ac_check_lib_save_LIBS
4850 fi
4851 echo "$as_me:4851: result: $ac_cv_lib_mytinfo_tgoto" >&5
4852 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
4853 if test $ac_cv_lib_mytinfo_tgoto = yes; then
4854   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
4855 fi
4856
4857         fi
4858         ;;
4859 esac
4860
4861 cf_add_libs="$cf_ncurses_LIBS"
4862 # Filter out duplicates - this happens with badly-designed ".pc" files...
4863 for cf_add_1lib in $LIBS
4864 do
4865         for cf_add_2lib in $cf_add_libs
4866         do
4867                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
4868                 then
4869                         cf_add_1lib=
4870                         break
4871                 fi
4872         done
4873         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
4874 done
4875 LIBS="$cf_add_libs"
4876
4877 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
4878 then
4879
4880 cf_add_libs="-l$cf_nculib_root"
4881 # Filter out duplicates - this happens with badly-designed ".pc" files...
4882 for cf_add_1lib in $LIBS
4883 do
4884         for cf_add_2lib in $cf_add_libs
4885         do
4886                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
4887                 then
4888                         cf_add_1lib=
4889                         break
4890                 fi
4891         done
4892         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
4893 done
4894 LIBS="$cf_add_libs"
4895
4896 else
4897
4898         eval 'cf_cv_have_lib_'$cf_nculib_root'=no'
4899         cf_libdir=""
4900         echo "$as_me:4900: checking for initscr" >&5
4901 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
4902 if test "${ac_cv_func_initscr+set}" = set; then
4903   echo $ECHO_N "(cached) $ECHO_C" >&6
4904 else
4905   cat >conftest.$ac_ext <<_ACEOF
4906 #line 4906 "configure"
4907 #include "confdefs.h"
4908 /* System header to define __stub macros and hopefully few prototypes,
4909     which can conflict with char initscr (); below.  */
4910 #include <assert.h>
4911 /* Override any gcc2 internal prototype to avoid an error.  */
4912 #ifdef __cplusplus
4913 extern "C"
4914 #endif
4915 /* We use char because int might match the return type of a gcc2
4916    builtin and then its argument prototype would still apply.  */
4917 char initscr ();
4918 char (*f) ();
4919
4920 int
4921 main ()
4922 {
4923 /* The GNU C library defines this for functions which it implements
4924     to always fail with ENOSYS.  Some functions are actually named
4925     something starting with __ and the normal name is an alias.  */
4926 #if defined (__stub_initscr) || defined (__stub___initscr)
4927 choke me
4928 #else
4929 f = initscr; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
4930 #endif
4931
4932   ;
4933   return 0;
4934 }
4935 _ACEOF
4936 rm -f conftest.$ac_objext conftest$ac_exeext
4937 if { (eval echo "$as_me:4937: \"$ac_link\"") >&5
4938   (eval $ac_link) 2>&5
4939   ac_status=$?
4940   echo "$as_me:4940: \$? = $ac_status" >&5
4941   (exit $ac_status); } &&
4942          { ac_try='test -s conftest$ac_exeext'
4943   { (eval echo "$as_me:4943: \"$ac_try\"") >&5
4944   (eval $ac_try) 2>&5
4945   ac_status=$?
4946   echo "$as_me:4946: \$? = $ac_status" >&5
4947   (exit $ac_status); }; }; then
4948   ac_cv_func_initscr=yes
4949 else
4950   echo "$as_me: failed program was:" >&5
4951 cat conftest.$ac_ext >&5
4952 ac_cv_func_initscr=no
4953 fi
4954 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
4955 fi
4956 echo "$as_me:4956: result: $ac_cv_func_initscr" >&5
4957 echo "${ECHO_T}$ac_cv_func_initscr" >&6
4958 if test $ac_cv_func_initscr = yes; then
4959   eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
4960 else
4961
4962                 cf_save_LIBS="$LIBS"
4963                 echo "$as_me:4963: checking for initscr in -l$cf_nculib_root" >&5
4964 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
4965                 LIBS="-l$cf_nculib_root $LIBS"
4966                 cat >conftest.$ac_ext <<_ACEOF
4967 #line 4967 "configure"
4968 #include "confdefs.h"
4969 #include <${cf_cv_ncurses_header:-curses.h}>
4970 int
4971 main ()
4972 {
4973 initscr()
4974   ;
4975   return 0;
4976 }
4977 _ACEOF
4978 rm -f conftest.$ac_objext conftest$ac_exeext
4979 if { (eval echo "$as_me:4979: \"$ac_link\"") >&5
4980   (eval $ac_link) 2>&5
4981   ac_status=$?
4982   echo "$as_me:4982: \$? = $ac_status" >&5
4983   (exit $ac_status); } &&
4984          { ac_try='test -s conftest$ac_exeext'
4985   { (eval echo "$as_me:4985: \"$ac_try\"") >&5
4986   (eval $ac_try) 2>&5
4987   ac_status=$?
4988   echo "$as_me:4988: \$? = $ac_status" >&5
4989   (exit $ac_status); }; }; then
4990   echo "$as_me:4990: result: yes" >&5
4991 echo "${ECHO_T}yes" >&6
4992                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
4993
4994 else
4995   echo "$as_me: failed program was:" >&5
4996 cat conftest.$ac_ext >&5
4997 echo "$as_me:4997: result: no" >&5
4998 echo "${ECHO_T}no" >&6
4999
5000 cf_search=
5001 cf_library_path_list=""
5002 if test -n "${LDFLAGS}${LIBS}" ; then
5003         for cf_library_path in $LDFLAGS $LIBS
5004         do
5005                 case $cf_library_path in
5006                 (-L*)
5007                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
5008
5009 test "x$cf_library_path" != "xNONE" && \
5010 test -d "$cf_library_path" && \
5011  {
5012         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
5013         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
5014         test -d $cf_library_path/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
5015         test -d $cf_library_path/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
5016         test -d $cf_library_path/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
5017         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"
5018 }
5019
5020                         cf_library_path_list="$cf_library_path_list $cf_search"
5021                         ;;
5022                 esac
5023         done
5024 fi
5025
5026 cf_search=
5027
5028 test "x$prefix" != "xNONE" && \
5029 test -d "$prefix" && \
5030  {
5031         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
5032         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
5033         test -d $prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
5034         test -d $prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
5035         test -d $prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
5036         test -d $prefix/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
5037 }
5038
5039 for cf_subdir_prefix in \
5040         /usr \
5041         /usr/local \
5042         /usr/pkg \
5043         /opt \
5044         /opt/local \
5045         $HOME
5046 do
5047
5048 test "x$cf_subdir_prefix" != "x$prefix" && \
5049 test -d "$cf_subdir_prefix" && \
5050 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
5051         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
5052         test -d $cf_subdir_prefix/lib &&          cf_search="$cf_search $cf_subdir_prefix/lib"
5053         test -d $cf_subdir_prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root"
5054         test -d $cf_subdir_prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root/lib"
5055         test -d $cf_subdir_prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib"
5056         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"
5057 }
5058
5059 done
5060
5061 cf_search="$cf_library_path_list $cf_search"
5062
5063                         for cf_libdir in $cf_search
5064                         do
5065                                 echo "$as_me:5065: checking for -l$cf_nculib_root in $cf_libdir" >&5
5066 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
5067                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
5068                                 cat >conftest.$ac_ext <<_ACEOF
5069 #line 5069 "configure"
5070 #include "confdefs.h"
5071 #include <${cf_cv_ncurses_header:-curses.h}>
5072 int
5073 main ()
5074 {
5075 initscr()
5076   ;
5077   return 0;
5078 }
5079 _ACEOF
5080 rm -f conftest.$ac_objext conftest$ac_exeext
5081 if { (eval echo "$as_me:5081: \"$ac_link\"") >&5
5082   (eval $ac_link) 2>&5
5083   ac_status=$?
5084   echo "$as_me:5084: \$? = $ac_status" >&5
5085   (exit $ac_status); } &&
5086          { ac_try='test -s conftest$ac_exeext'
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   echo "$as_me:5092: result: yes" >&5
5093 echo "${ECHO_T}yes" >&6
5094                                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
5095                                          break
5096 else
5097   echo "$as_me: failed program was:" >&5
5098 cat conftest.$ac_ext >&5
5099 echo "$as_me:5099: result: no" >&5
5100 echo "${ECHO_T}no" >&6
5101                                          LIBS="$cf_save_LIBS"
5102 fi
5103 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5104                         done
5105
5106 fi
5107 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5108
5109 fi
5110
5111 eval 'cf_found_library=$cf_cv_have_lib_'$cf_nculib_root
5112
5113 if test $cf_found_library = no ; then
5114         { { echo "$as_me:5114: error: Cannot link $cf_nculib_root library" >&5
5115 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
5116    { (exit 1); exit 1; }; }
5117 fi
5118
5119 fi
5120
5121 if test -n "$cf_ncurses_LIBS" ; then
5122         echo "$as_me:5122: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
5123 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
5124         cf_ncurses_SAVE="$LIBS"
5125         for p in $cf_ncurses_LIBS ; do
5126                 q=`echo $LIBS | sed -e "s%$p %%" -e "s%$p$%%"`
5127                 if test "$q" != "$LIBS" ; then
5128                         LIBS="$q"
5129                 fi
5130         done
5131         cat >conftest.$ac_ext <<_ACEOF
5132 #line 5132 "configure"
5133 #include "confdefs.h"
5134 #include <${cf_cv_ncurses_header:-curses.h}>
5135 int
5136 main ()
5137 {
5138 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
5139   ;
5140   return 0;
5141 }
5142 _ACEOF
5143 rm -f conftest.$ac_objext conftest$ac_exeext
5144 if { (eval echo "$as_me:5144: \"$ac_link\"") >&5
5145   (eval $ac_link) 2>&5
5146   ac_status=$?
5147   echo "$as_me:5147: \$? = $ac_status" >&5
5148   (exit $ac_status); } &&
5149          { ac_try='test -s conftest$ac_exeext'
5150   { (eval echo "$as_me:5150: \"$ac_try\"") >&5
5151   (eval $ac_try) 2>&5
5152   ac_status=$?
5153   echo "$as_me:5153: \$? = $ac_status" >&5
5154   (exit $ac_status); }; }; then
5155   echo "$as_me:5155: result: yes" >&5
5156 echo "${ECHO_T}yes" >&6
5157 else
5158   echo "$as_me: failed program was:" >&5
5159 cat conftest.$ac_ext >&5
5160 echo "$as_me:5160: result: no" >&5
5161 echo "${ECHO_T}no" >&6
5162                  LIBS="$cf_ncurses_SAVE"
5163 fi
5164 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5165 fi
5166
5167 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
5168
5169 cat >>confdefs.h <<EOF
5170 #define $cf_nculib_ROOT 1
5171 EOF
5172
5173         fi
5174 else
5175         NCURSES_CONFIG=none
5176 fi
5177
5178 echo "$as_me:5178: checking if you want wide-character code" >&5
5179 echo $ECHO_N "checking if you want wide-character code... $ECHO_C" >&6
5180
5181 # Check whether --enable-widec or --disable-widec was given.
5182 if test "${enable_widec+set}" = set; then
5183   enableval="$enable_widec"
5184   with_widec=$enableval
5185 else
5186   with_widec=no
5187 fi;
5188 echo "$as_me:5188: result: $with_widec" >&5
5189 echo "${ECHO_T}$with_widec" >&6
5190 if test "$with_widec" = yes ; then
5191
5192 echo "$as_me:5192: checking for multibyte character support" >&5
5193 echo $ECHO_N "checking for multibyte character support... $ECHO_C" >&6
5194 if test "${cf_cv_utf8_lib+set}" = set; then
5195   echo $ECHO_N "(cached) $ECHO_C" >&6
5196 else
5197
5198         cf_save_LIBS="$LIBS"
5199         cat >conftest.$ac_ext <<_ACEOF
5200 #line 5200 "configure"
5201 #include "confdefs.h"
5202
5203 #include <stdlib.h>
5204 int
5205 main ()
5206 {
5207 putwc(0,0);
5208   ;
5209   return 0;
5210 }
5211 _ACEOF
5212 rm -f conftest.$ac_objext conftest$ac_exeext
5213 if { (eval echo "$as_me:5213: \"$ac_link\"") >&5
5214   (eval $ac_link) 2>&5
5215   ac_status=$?
5216   echo "$as_me:5216: \$? = $ac_status" >&5
5217   (exit $ac_status); } &&
5218          { ac_try='test -s conftest$ac_exeext'
5219   { (eval echo "$as_me:5219: \"$ac_try\"") >&5
5220   (eval $ac_try) 2>&5
5221   ac_status=$?
5222   echo "$as_me:5222: \$? = $ac_status" >&5
5223   (exit $ac_status); }; }; then
5224   cf_cv_utf8_lib=yes
5225 else
5226   echo "$as_me: failed program was:" >&5
5227 cat conftest.$ac_ext >&5
5228
5229 # If the linkage is not already in the $CPPFLAGS/$LDFLAGS configuration, these
5230 # will be set on completion of the AC_TRY_LINK below.
5231 cf_cv_header_path_utf8=
5232 cf_cv_library_path_utf8=
5233
5234 echo "${as_me:-configure}:5234: testing Starting FIND_LINKAGE(utf8,) ..." 1>&5
5235
5236 cf_save_LIBS="$LIBS"
5237
5238 cat >conftest.$ac_ext <<_ACEOF
5239 #line 5239 "configure"
5240 #include "confdefs.h"
5241
5242 #include <libutf8.h>
5243 int
5244 main ()
5245 {
5246 putwc(0,0);
5247   ;
5248   return 0;
5249 }
5250 _ACEOF
5251 rm -f conftest.$ac_objext conftest$ac_exeext
5252 if { (eval echo "$as_me:5252: \"$ac_link\"") >&5
5253   (eval $ac_link) 2>&5
5254   ac_status=$?
5255   echo "$as_me:5255: \$? = $ac_status" >&5
5256   (exit $ac_status); } &&
5257          { ac_try='test -s conftest$ac_exeext'
5258   { (eval echo "$as_me:5258: \"$ac_try\"") >&5
5259   (eval $ac_try) 2>&5
5260   ac_status=$?
5261   echo "$as_me:5261: \$? = $ac_status" >&5
5262   (exit $ac_status); }; }; then
5263
5264         cf_cv_find_linkage_utf8=yes
5265         cf_cv_header_path_utf8=/usr/include
5266         cf_cv_library_path_utf8=/usr/lib
5267
5268 else
5269   echo "$as_me: failed program was:" >&5
5270 cat conftest.$ac_ext >&5
5271
5272 LIBS="-lutf8  $cf_save_LIBS"
5273
5274 cat >conftest.$ac_ext <<_ACEOF
5275 #line 5275 "configure"
5276 #include "confdefs.h"
5277
5278 #include <libutf8.h>
5279 int
5280 main ()
5281 {
5282 putwc(0,0);
5283   ;
5284   return 0;
5285 }
5286 _ACEOF
5287 rm -f conftest.$ac_objext conftest$ac_exeext
5288 if { (eval echo "$as_me:5288: \"$ac_link\"") >&5
5289   (eval $ac_link) 2>&5
5290   ac_status=$?
5291   echo "$as_me:5291: \$? = $ac_status" >&5
5292   (exit $ac_status); } &&
5293          { ac_try='test -s conftest$ac_exeext'
5294   { (eval echo "$as_me:5294: \"$ac_try\"") >&5
5295   (eval $ac_try) 2>&5
5296   ac_status=$?
5297   echo "$as_me:5297: \$? = $ac_status" >&5
5298   (exit $ac_status); }; }; then
5299
5300         cf_cv_find_linkage_utf8=yes
5301         cf_cv_header_path_utf8=/usr/include
5302         cf_cv_library_path_utf8=/usr/lib
5303         cf_cv_library_file_utf8="-lutf8"
5304
5305 else
5306   echo "$as_me: failed program was:" >&5
5307 cat conftest.$ac_ext >&5
5308
5309         cf_cv_find_linkage_utf8=no
5310         LIBS="$cf_save_LIBS"
5311
5312         test -n "$verbose" && echo "    find linkage for utf8 library" 1>&6
5313
5314 echo "${as_me:-configure}:5314: testing find linkage for utf8 library ..." 1>&5
5315
5316 echo "${as_me:-configure}:5316: testing Searching for headers in FIND_LINKAGE(utf8,) ..." 1>&5
5317
5318         cf_save_CPPFLAGS="$CPPFLAGS"
5319         cf_test_CPPFLAGS="$CPPFLAGS"
5320
5321 cf_search=
5322
5323 # collect the current set of include-directories from compiler flags
5324 cf_header_path_list=""
5325 if test -n "${CFLAGS}${CPPFLAGS}" ; then
5326         for cf_header_path in $CPPFLAGS $CFLAGS
5327         do
5328                 case $cf_header_path in
5329                 (-I*)
5330                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
5331
5332 test "x$cf_header_path" != "xNONE" && \
5333 test -d "$cf_header_path" && \
5334  {
5335         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
5336         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
5337         test -d $cf_header_path/include/utf8 &&       cf_search="$cf_search $cf_header_path/include/utf8"
5338         test -d $cf_header_path/include/utf8/include &&    cf_search="$cf_search $cf_header_path/include/utf8/include"
5339         test -d $cf_header_path/utf8/include &&       cf_search="$cf_search $cf_header_path/utf8/include"
5340         test -d $cf_header_path/utf8/include/utf8 &&    cf_search="$cf_search $cf_header_path/utf8/include/utf8"
5341 }
5342
5343                         cf_header_path_list="$cf_header_path_list $cf_search"
5344                         ;;
5345                 esac
5346         done
5347 fi
5348
5349 # add the variations for the package we are looking for
5350
5351 cf_search=
5352
5353 test "x$prefix" != "xNONE" && \
5354 test -d "$prefix" && \
5355  {
5356         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
5357         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
5358         test -d $prefix/include/utf8 &&       cf_search="$cf_search $prefix/include/utf8"
5359         test -d $prefix/include/utf8/include &&    cf_search="$cf_search $prefix/include/utf8/include"
5360         test -d $prefix/utf8/include &&       cf_search="$cf_search $prefix/utf8/include"
5361         test -d $prefix/utf8/include/utf8 &&    cf_search="$cf_search $prefix/utf8/include/utf8"
5362 }
5363
5364 for cf_subdir_prefix in \
5365         /usr \
5366         /usr/local \
5367         /usr/pkg \
5368         /opt \
5369         /opt/local \
5370         $HOME
5371 do
5372
5373 test "x$cf_subdir_prefix" != "x$prefix" && \
5374 test -d "$cf_subdir_prefix" && \
5375 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
5376         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
5377         test -d $cf_subdir_prefix/include &&          cf_search="$cf_search $cf_subdir_prefix/include"
5378         test -d $cf_subdir_prefix/include/utf8 &&       cf_search="$cf_search $cf_subdir_prefix/include/utf8"
5379         test -d $cf_subdir_prefix/include/utf8/include &&    cf_search="$cf_search $cf_subdir_prefix/include/utf8/include"
5380         test -d $cf_subdir_prefix/utf8/include &&       cf_search="$cf_search $cf_subdir_prefix/utf8/include"
5381         test -d $cf_subdir_prefix/utf8/include/utf8 &&    cf_search="$cf_search $cf_subdir_prefix/utf8/include/utf8"
5382 }
5383
5384 done
5385
5386 test "$includedir" != NONE && \
5387 test "$includedir" != "/usr/include" && \
5388 test -d "$includedir" && {
5389         test -d $includedir &&    cf_search="$cf_search $includedir"
5390         test -d $includedir/utf8 && cf_search="$cf_search $includedir/utf8"
5391 }
5392
5393 test "$oldincludedir" != NONE && \
5394 test "$oldincludedir" != "/usr/include" && \
5395 test -d "$oldincludedir" && {
5396         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
5397         test -d $oldincludedir/utf8 && cf_search="$cf_search $oldincludedir/utf8"
5398 }
5399
5400 cf_search="$cf_search $cf_header_path_list"
5401
5402         for cf_cv_header_path_utf8 in $cf_search
5403         do
5404                 if test -d $cf_cv_header_path_utf8 ; then
5405                         test -n "$verbose" && echo "    ... testing $cf_cv_header_path_utf8" 1>&6
5406
5407 echo "${as_me:-configure}:5407: testing ... testing $cf_cv_header_path_utf8 ..." 1>&5
5408
5409                         CPPFLAGS="$cf_save_CPPFLAGS -I$cf_cv_header_path_utf8"
5410                         cat >conftest.$ac_ext <<_ACEOF
5411 #line 5411 "configure"
5412 #include "confdefs.h"
5413
5414 #include <libutf8.h>
5415 int
5416 main ()
5417 {
5418 putwc(0,0);
5419   ;
5420   return 0;
5421 }
5422 _ACEOF
5423 rm -f conftest.$ac_objext
5424 if { (eval echo "$as_me:5424: \"$ac_compile\"") >&5
5425   (eval $ac_compile) 2>&5
5426   ac_status=$?
5427   echo "$as_me:5427: \$? = $ac_status" >&5
5428   (exit $ac_status); } &&
5429          { ac_try='test -s conftest.$ac_objext'
5430   { (eval echo "$as_me:5430: \"$ac_try\"") >&5
5431   (eval $ac_try) 2>&5
5432   ac_status=$?
5433   echo "$as_me:5433: \$? = $ac_status" >&5
5434   (exit $ac_status); }; }; then
5435
5436                                 test -n "$verbose" && echo "    ... found utf8 headers in $cf_cv_header_path_utf8" 1>&6
5437
5438 echo "${as_me:-configure}:5438: testing ... found utf8 headers in $cf_cv_header_path_utf8 ..." 1>&5
5439
5440                                 cf_cv_find_linkage_utf8=maybe
5441                                 cf_test_CPPFLAGS="$CPPFLAGS"
5442                                 break
5443 else
5444   echo "$as_me: failed program was:" >&5
5445 cat conftest.$ac_ext >&5
5446
5447                                 CPPFLAGS="$cf_save_CPPFLAGS"
5448
5449 fi
5450 rm -f conftest.$ac_objext conftest.$ac_ext
5451                 fi
5452         done
5453
5454         if test "$cf_cv_find_linkage_utf8" = maybe ; then
5455
5456 echo "${as_me:-configure}:5456: testing Searching for utf8 library in FIND_LINKAGE(utf8,) ..." 1>&5
5457
5458                 cf_save_LIBS="$LIBS"
5459                 cf_save_LDFLAGS="$LDFLAGS"
5460
5461                 if test "$cf_cv_find_linkage_utf8" != yes ; then
5462
5463 cf_search=
5464 cf_library_path_list=""
5465 if test -n "${LDFLAGS}${LIBS}" ; then
5466         for cf_library_path in $LDFLAGS $LIBS
5467         do
5468                 case $cf_library_path in
5469                 (-L*)
5470                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
5471
5472 test "x$cf_library_path" != "xNONE" && \
5473 test -d "$cf_library_path" && \
5474  {
5475         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
5476         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
5477         test -d $cf_library_path/lib/utf8 &&       cf_search="$cf_search $cf_library_path/lib/utf8"
5478         test -d $cf_library_path/lib/utf8/lib &&    cf_search="$cf_search $cf_library_path/lib/utf8/lib"
5479         test -d $cf_library_path/utf8/lib &&       cf_search="$cf_search $cf_library_path/utf8/lib"
5480         test -d $cf_library_path/utf8/lib/utf8 &&    cf_search="$cf_search $cf_library_path/utf8/lib/utf8"
5481 }
5482
5483                         cf_library_path_list="$cf_library_path_list $cf_search"
5484                         ;;
5485                 esac
5486         done
5487 fi
5488
5489 cf_search=
5490
5491 test "x$prefix" != "xNONE" && \
5492 test -d "$prefix" && \
5493  {
5494         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
5495         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
5496         test -d $prefix/lib/utf8 &&       cf_search="$cf_search $prefix/lib/utf8"
5497         test -d $prefix/lib/utf8/lib &&    cf_search="$cf_search $prefix/lib/utf8/lib"
5498         test -d $prefix/utf8/lib &&       cf_search="$cf_search $prefix/utf8/lib"
5499         test -d $prefix/utf8/lib/utf8 &&    cf_search="$cf_search $prefix/utf8/lib/utf8"
5500 }
5501
5502 for cf_subdir_prefix in \
5503         /usr \
5504         /usr/local \
5505         /usr/pkg \
5506         /opt \
5507         /opt/local \
5508         $HOME
5509 do
5510
5511 test "x$cf_subdir_prefix" != "x$prefix" && \
5512 test -d "$cf_subdir_prefix" && \
5513 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
5514         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
5515         test -d $cf_subdir_prefix/lib &&          cf_search="$cf_search $cf_subdir_prefix/lib"
5516         test -d $cf_subdir_prefix/lib/utf8 &&       cf_search="$cf_search $cf_subdir_prefix/lib/utf8"
5517         test -d $cf_subdir_prefix/lib/utf8/lib &&    cf_search="$cf_search $cf_subdir_prefix/lib/utf8/lib"
5518         test -d $cf_subdir_prefix/utf8/lib &&       cf_search="$cf_search $cf_subdir_prefix/utf8/lib"
5519         test -d $cf_subdir_prefix/utf8/lib/utf8 &&    cf_search="$cf_search $cf_subdir_prefix/utf8/lib/utf8"
5520 }
5521
5522 done
5523
5524 cf_search="$cf_library_path_list $cf_search"
5525
5526                         for cf_cv_library_path_utf8 in $cf_search
5527                         do
5528                                 if test -d $cf_cv_library_path_utf8 ; then
5529                                         test -n "$verbose" && echo "    ... testing $cf_cv_library_path_utf8" 1>&6
5530
5531 echo "${as_me:-configure}:5531: testing ... testing $cf_cv_library_path_utf8 ..." 1>&5
5532
5533                                         CPPFLAGS="$cf_test_CPPFLAGS"
5534                                         LIBS="-lutf8  $cf_save_LIBS"
5535                                         LDFLAGS="$cf_save_LDFLAGS -L$cf_cv_library_path_utf8"
5536                                         cat >conftest.$ac_ext <<_ACEOF
5537 #line 5537 "configure"
5538 #include "confdefs.h"
5539
5540 #include <libutf8.h>
5541 int
5542 main ()
5543 {
5544 putwc(0,0);
5545   ;
5546   return 0;
5547 }
5548 _ACEOF
5549 rm -f conftest.$ac_objext conftest$ac_exeext
5550 if { (eval echo "$as_me:5550: \"$ac_link\"") >&5
5551   (eval $ac_link) 2>&5
5552   ac_status=$?
5553   echo "$as_me:5553: \$? = $ac_status" >&5
5554   (exit $ac_status); } &&
5555          { ac_try='test -s conftest$ac_exeext'
5556   { (eval echo "$as_me:5556: \"$ac_try\"") >&5
5557   (eval $ac_try) 2>&5
5558   ac_status=$?
5559   echo "$as_me:5559: \$? = $ac_status" >&5
5560   (exit $ac_status); }; }; then
5561
5562                                         test -n "$verbose" && echo "    ... found utf8 library in $cf_cv_library_path_utf8" 1>&6
5563
5564 echo "${as_me:-configure}:5564: testing ... found utf8 library in $cf_cv_library_path_utf8 ..." 1>&5
5565
5566                                         cf_cv_find_linkage_utf8=yes
5567                                         cf_cv_library_file_utf8="-lutf8"
5568                                         break
5569 else
5570   echo "$as_me: failed program was:" >&5
5571 cat conftest.$ac_ext >&5
5572
5573                                         CPPFLAGS="$cf_save_CPPFLAGS"
5574                                         LIBS="$cf_save_LIBS"
5575                                         LDFLAGS="$cf_save_LDFLAGS"
5576
5577 fi
5578 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5579                                 fi
5580                         done
5581                         CPPFLAGS="$cf_save_CPPFLAGS"
5582                         LDFLAGS="$cf_save_LDFLAGS"
5583                 fi
5584
5585         else
5586                 cf_cv_find_linkage_utf8=no
5587         fi
5588
5589 fi
5590 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5591
5592 fi
5593 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5594
5595 LIBS="$cf_save_LIBS"
5596
5597 if test "$cf_cv_find_linkage_utf8" = yes ; then
5598 cf_cv_utf8_lib=add-on
5599 else
5600 cf_cv_utf8_lib=no
5601 fi
5602
5603 fi
5604 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5605 fi
5606 echo "$as_me:5606: result: $cf_cv_utf8_lib" >&5
5607 echo "${ECHO_T}$cf_cv_utf8_lib" >&6
5608
5609 # HAVE_LIBUTF8_H is used by ncurses if curses.h is shared between
5610 # ncurses/ncursesw:
5611 if test "$cf_cv_utf8_lib" = "add-on" ; then
5612
5613 cat >>confdefs.h <<\EOF
5614 #define HAVE_LIBUTF8_H 1
5615 EOF
5616
5617 if test -n "$cf_cv_header_path_utf8" ; then
5618   for cf_add_incdir in $cf_cv_header_path_utf8
5619   do
5620         while test $cf_add_incdir != /usr/include
5621         do
5622           if test -d $cf_add_incdir
5623           then
5624                 cf_have_incdir=no
5625                 if test -n "$CFLAGS$CPPFLAGS" ; then
5626                   # a loop is needed to ensure we can add subdirs of existing dirs
5627                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
5628                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
5629                           cf_have_incdir=yes; break
5630                         fi
5631                   done
5632                 fi
5633
5634                 if test "$cf_have_incdir" = no ; then
5635                   if test "$cf_add_incdir" = /usr/local/include ; then
5636                         if test "$GCC" = yes
5637                         then
5638                           cf_save_CPPFLAGS=$CPPFLAGS
5639                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
5640                           cat >conftest.$ac_ext <<_ACEOF
5641 #line 5641 "configure"
5642 #include "confdefs.h"
5643 #include <stdio.h>
5644 int
5645 main ()
5646 {
5647 printf("Hello")
5648   ;
5649   return 0;
5650 }
5651 _ACEOF
5652 rm -f conftest.$ac_objext
5653 if { (eval echo "$as_me:5653: \"$ac_compile\"") >&5
5654   (eval $ac_compile) 2>&5
5655   ac_status=$?
5656   echo "$as_me:5656: \$? = $ac_status" >&5
5657   (exit $ac_status); } &&
5658          { ac_try='test -s conftest.$ac_objext'
5659   { (eval echo "$as_me:5659: \"$ac_try\"") >&5
5660   (eval $ac_try) 2>&5
5661   ac_status=$?
5662   echo "$as_me:5662: \$? = $ac_status" >&5
5663   (exit $ac_status); }; }; then
5664   :
5665 else
5666   echo "$as_me: failed program was:" >&5
5667 cat conftest.$ac_ext >&5
5668 cf_have_incdir=yes
5669 fi
5670 rm -f conftest.$ac_objext conftest.$ac_ext
5671                           CPPFLAGS=$cf_save_CPPFLAGS
5672                         fi
5673                   fi
5674                 fi
5675
5676                 if test "$cf_have_incdir" = no ; then
5677                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
5678
5679 echo "${as_me:-configure}:5679: testing adding $cf_add_incdir to include-path ..." 1>&5
5680
5681                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
5682
5683                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
5684                   test "$cf_top_incdir" = "$cf_add_incdir" && break
5685                   cf_add_incdir="$cf_top_incdir"
5686                 else
5687                   break
5688                 fi
5689           fi
5690         done
5691   done
5692 fi
5693
5694 if test -n "$cf_cv_library_path_utf8" ; then
5695         for cf_add_libdir in $cf_cv_library_path_utf8
5696         do
5697                 if test $cf_add_libdir = /usr/lib ; then
5698                         :
5699                 elif test -d $cf_add_libdir
5700                 then
5701                         cf_have_libdir=no
5702                         if test -n "$LDFLAGS$LIBS" ; then
5703                                 # a loop is needed to ensure we can add subdirs of existing dirs
5704                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
5705                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
5706                                                 cf_have_libdir=yes; break
5707                                         fi
5708                                 done
5709                         fi
5710                         if test "$cf_have_libdir" = no ; then
5711                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
5712
5713 echo "${as_me:-configure}:5713: testing adding $cf_add_libdir to library-path ..." 1>&5
5714
5715                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
5716                         fi
5717                 fi
5718         done
5719 fi
5720
5721 cf_add_libs="$cf_cv_library_file_utf8"
5722 # Filter out duplicates - this happens with badly-designed ".pc" files...
5723 for cf_add_1lib in $LIBS
5724 do
5725         for cf_add_2lib in $cf_add_libs
5726         do
5727                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
5728                 then
5729                         cf_add_1lib=
5730                         break
5731                 fi
5732         done
5733         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
5734 done
5735 LIBS="$cf_add_libs"
5736
5737 fi
5738
5739 cf_ncuconfig_root=ncursesw
5740 cf_have_ncuconfig=no
5741
5742 if test "x$PKG_CONFIG" != xnone; then
5743         echo "$as_me:5743: checking pkg-config for $cf_ncuconfig_root" >&5
5744 echo $ECHO_N "checking pkg-config for $cf_ncuconfig_root... $ECHO_C" >&6
5745         if "$PKG_CONFIG" --exists $cf_ncuconfig_root ; then
5746                 echo "$as_me:5746: result: yes" >&5
5747 echo "${ECHO_T}yes" >&6
5748
5749                 echo "$as_me:5749: checking if the $cf_ncuconfig_root package files work" >&5
5750 echo $ECHO_N "checking if the $cf_ncuconfig_root package files work... $ECHO_C" >&6
5751                 cf_have_ncuconfig=unknown
5752
5753                 cf_save_CPPFLAGS="$CPPFLAGS"
5754                 cf_save_LIBS="$LIBS"
5755
5756                 CPPFLAGS="$CPPFLAGS `$PKG_CONFIG --cflags $cf_ncuconfig_root`"
5757
5758 cf_add_libs="`$PKG_CONFIG --libs $cf_ncuconfig_root`"
5759 # Filter out duplicates - this happens with badly-designed ".pc" files...
5760 for cf_add_1lib in $LIBS
5761 do
5762         for cf_add_2lib in $cf_add_libs
5763         do
5764                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
5765                 then
5766                         cf_add_1lib=
5767                         break
5768                 fi
5769         done
5770         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
5771 done
5772 LIBS="$cf_add_libs"
5773
5774                 cat >conftest.$ac_ext <<_ACEOF
5775 #line 5775 "configure"
5776 #include "confdefs.h"
5777 #include <${cf_cv_ncurses_header:-curses.h}>
5778 int
5779 main ()
5780 {
5781 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
5782   ;
5783   return 0;
5784 }
5785 _ACEOF
5786 rm -f conftest.$ac_objext conftest$ac_exeext
5787 if { (eval echo "$as_me:5787: \"$ac_link\"") >&5
5788   (eval $ac_link) 2>&5
5789   ac_status=$?
5790   echo "$as_me:5790: \$? = $ac_status" >&5
5791   (exit $ac_status); } &&
5792          { ac_try='test -s conftest$ac_exeext'
5793   { (eval echo "$as_me:5793: \"$ac_try\"") >&5
5794   (eval $ac_try) 2>&5
5795   ac_status=$?
5796   echo "$as_me:5796: \$? = $ac_status" >&5
5797   (exit $ac_status); }; }; then
5798   if test "$cross_compiling" = yes; then
5799   { { echo "$as_me:5799: error: cannot run test program while cross compiling" >&5
5800 echo "$as_me: error: cannot run test program while cross compiling" >&2;}
5801    { (exit 1); exit 1; }; }
5802 else
5803   cat >conftest.$ac_ext <<_ACEOF
5804 #line 5804 "configure"
5805 #include "confdefs.h"
5806 #include <${cf_cv_ncurses_header:-curses.h}>
5807                                 int main(void)
5808                                 { char *xx = curses_version(); return (xx == 0); }
5809 _ACEOF
5810 rm -f conftest$ac_exeext
5811 if { (eval echo "$as_me:5811: \"$ac_link\"") >&5
5812   (eval $ac_link) 2>&5
5813   ac_status=$?
5814   echo "$as_me:5814: \$? = $ac_status" >&5
5815   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
5816   { (eval echo "$as_me:5816: \"$ac_try\"") >&5
5817   (eval $ac_try) 2>&5
5818   ac_status=$?
5819   echo "$as_me:5819: \$? = $ac_status" >&5
5820   (exit $ac_status); }; }; then
5821   cf_have_ncuconfig=yes
5822 else
5823   echo "$as_me: program exited with status $ac_status" >&5
5824 echo "$as_me: failed program was:" >&5
5825 cat conftest.$ac_ext >&5
5826 cf_have_ncuconfig=no
5827 fi
5828 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
5829 fi
5830 else
5831   echo "$as_me: failed program was:" >&5
5832 cat conftest.$ac_ext >&5
5833 cf_have_ncuconfig=no
5834 fi
5835 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5836
5837                 echo "$as_me:5837: result: $cf_have_ncuconfig" >&5
5838 echo "${ECHO_T}$cf_have_ncuconfig" >&6
5839                 if test "$cf_have_ncuconfig" != "yes"
5840                 then
5841                         CPPFLAGS="$cf_save_CPPFLAGS"
5842                         LIBS="$cf_save_LIBS"
5843                         NCURSES_CONFIG_PKG=none
5844                 else
5845
5846 cat >>confdefs.h <<\EOF
5847 #define NCURSES 1
5848 EOF
5849
5850                         NCURSES_CONFIG_PKG=$cf_ncuconfig_root
5851                 fi
5852
5853         else
5854                 echo "$as_me:5854: result: no" >&5
5855 echo "${ECHO_T}no" >&6
5856                 NCURSES_CONFIG_PKG=none
5857         fi
5858 else
5859         NCURSES_CONFIG_PKG=none
5860 fi
5861
5862 if test "x$cf_have_ncuconfig" = "xno"; then
5863         echo "Looking for ${cf_ncuconfig_root}-config"
5864
5865 if test -n "$ac_tool_prefix"; then
5866   for ac_prog in ${cf_ncuconfig_root}-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
5867   do
5868     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
5869 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
5870 echo "$as_me:5870: checking for $ac_word" >&5
5871 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
5872 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
5873   echo $ECHO_N "(cached) $ECHO_C" >&6
5874 else
5875   if test -n "$NCURSES_CONFIG"; then
5876   ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
5877 else
5878   ac_save_IFS=$IFS; IFS=$ac_path_separator
5879 ac_dummy="$PATH"
5880 for ac_dir in $ac_dummy; do
5881   IFS=$ac_save_IFS
5882   test -z "$ac_dir" && ac_dir=.
5883   $as_executable_p "$ac_dir/$ac_word" || continue
5884 ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
5885 echo "$as_me:5885: found $ac_dir/$ac_word" >&5
5886 break
5887 done
5888
5889 fi
5890 fi
5891 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
5892 if test -n "$NCURSES_CONFIG"; then
5893   echo "$as_me:5893: result: $NCURSES_CONFIG" >&5
5894 echo "${ECHO_T}$NCURSES_CONFIG" >&6
5895 else
5896   echo "$as_me:5896: result: no" >&5
5897 echo "${ECHO_T}no" >&6
5898 fi
5899
5900     test -n "$NCURSES_CONFIG" && break
5901   done
5902 fi
5903 if test -z "$NCURSES_CONFIG"; then
5904   ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
5905   for ac_prog in ${cf_ncuconfig_root}-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
5906 do
5907   # Extract the first word of "$ac_prog", so it can be a program name with args.
5908 set dummy $ac_prog; ac_word=$2
5909 echo "$as_me:5909: checking for $ac_word" >&5
5910 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
5911 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
5912   echo $ECHO_N "(cached) $ECHO_C" >&6
5913 else
5914   if test -n "$ac_ct_NCURSES_CONFIG"; then
5915   ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
5916 else
5917   ac_save_IFS=$IFS; IFS=$ac_path_separator
5918 ac_dummy="$PATH"
5919 for ac_dir in $ac_dummy; do
5920   IFS=$ac_save_IFS
5921   test -z "$ac_dir" && ac_dir=.
5922   $as_executable_p "$ac_dir/$ac_word" || continue
5923 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
5924 echo "$as_me:5924: found $ac_dir/$ac_word" >&5
5925 break
5926 done
5927
5928 fi
5929 fi
5930 ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
5931 if test -n "$ac_ct_NCURSES_CONFIG"; then
5932   echo "$as_me:5932: result: $ac_ct_NCURSES_CONFIG" >&5
5933 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
5934 else
5935   echo "$as_me:5935: result: no" >&5
5936 echo "${ECHO_T}no" >&6
5937 fi
5938
5939   test -n "$ac_ct_NCURSES_CONFIG" && break
5940 done
5941 test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
5942
5943   NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
5944 fi
5945
5946         if test "$NCURSES_CONFIG" != none ; then
5947
5948                 CPPFLAGS="$CPPFLAGS `$NCURSES_CONFIG --cflags`"
5949
5950 cf_add_libs="`$NCURSES_CONFIG --libs`"
5951 # Filter out duplicates - this happens with badly-designed ".pc" files...
5952 for cf_add_1lib in $LIBS
5953 do
5954         for cf_add_2lib in $cf_add_libs
5955         do
5956                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
5957                 then
5958                         cf_add_1lib=
5959                         break
5960                 fi
5961         done
5962         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
5963 done
5964 LIBS="$cf_add_libs"
5965
5966                 # even with config script, some packages use no-override for curses.h
5967
5968 echo "$as_me:5968: checking if we have identified curses headers" >&5
5969 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
5970 if test "${cf_cv_ncurses_header+set}" = set; then
5971   echo $ECHO_N "(cached) $ECHO_C" >&6
5972 else
5973
5974 cf_cv_ncurses_header=none
5975 for cf_header in \
5976         ncurses.h ncursesw/ncurses.h \
5977         curses.h ncursesw/curses.h
5978 do
5979 cat >conftest.$ac_ext <<_ACEOF
5980 #line 5980 "configure"
5981 #include "confdefs.h"
5982 #include <${cf_header}>
5983 int
5984 main ()
5985 {
5986 initscr(); tgoto("?", 0,0)
5987   ;
5988   return 0;
5989 }
5990 _ACEOF
5991 rm -f conftest.$ac_objext
5992 if { (eval echo "$as_me:5992: \"$ac_compile\"") >&5
5993   (eval $ac_compile) 2>&5
5994   ac_status=$?
5995   echo "$as_me:5995: \$? = $ac_status" >&5
5996   (exit $ac_status); } &&
5997          { ac_try='test -s conftest.$ac_objext'
5998   { (eval echo "$as_me:5998: \"$ac_try\"") >&5
5999   (eval $ac_try) 2>&5
6000   ac_status=$?
6001   echo "$as_me:6001: \$? = $ac_status" >&5
6002   (exit $ac_status); }; }; then
6003   cf_cv_ncurses_header=$cf_header; break
6004 else
6005   echo "$as_me: failed program was:" >&5
6006 cat conftest.$ac_ext >&5
6007 fi
6008 rm -f conftest.$ac_objext conftest.$ac_ext
6009 done
6010
6011 fi
6012 echo "$as_me:6012: result: $cf_cv_ncurses_header" >&5
6013 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
6014
6015 if test "$cf_cv_ncurses_header" = none ; then
6016         { { echo "$as_me:6016: error: No curses header-files found" >&5
6017 echo "$as_me: error: No curses header-files found" >&2;}
6018    { (exit 1); exit 1; }; }
6019 fi
6020
6021 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
6022
6023 for ac_header in $cf_cv_ncurses_header
6024 do
6025 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
6026 echo "$as_me:6026: checking for $ac_header" >&5
6027 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
6028 if eval "test \"\${$as_ac_Header+set}\" = set"; then
6029   echo $ECHO_N "(cached) $ECHO_C" >&6
6030 else
6031   cat >conftest.$ac_ext <<_ACEOF
6032 #line 6032 "configure"
6033 #include "confdefs.h"
6034 #include <$ac_header>
6035 _ACEOF
6036 if { (eval echo "$as_me:6036: \"$ac_cpp conftest.$ac_ext\"") >&5
6037   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
6038   ac_status=$?
6039   egrep -v '^ *\+' conftest.er1 >conftest.err
6040   rm -f conftest.er1
6041   cat conftest.err >&5
6042   echo "$as_me:6042: \$? = $ac_status" >&5
6043   (exit $ac_status); } >/dev/null; then
6044   if test -s conftest.err; then
6045     ac_cpp_err=$ac_c_preproc_warn_flag
6046   else
6047     ac_cpp_err=
6048   fi
6049 else
6050   ac_cpp_err=yes
6051 fi
6052 if test -z "$ac_cpp_err"; then
6053   eval "$as_ac_Header=yes"
6054 else
6055   echo "$as_me: failed program was:" >&5
6056   cat conftest.$ac_ext >&5
6057   eval "$as_ac_Header=no"
6058 fi
6059 rm -f conftest.err conftest.$ac_ext
6060 fi
6061 echo "$as_me:6061: result: `eval echo '${'$as_ac_Header'}'`" >&5
6062 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
6063 if test `eval echo '${'$as_ac_Header'}'` = yes; then
6064   cat >>confdefs.h <<EOF
6065 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
6066 EOF
6067
6068 fi
6069 done
6070
6071 cat >>confdefs.h <<\EOF
6072 #define NCURSES 1
6073 EOF
6074
6075 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
6076
6077                 cat >>confdefs.h <<EOF
6078 #define $cf_nculib_ROOT 1
6079 EOF
6080
6081                                 cf_cv_ncurses_version=`$NCURSES_CONFIG --version`
6082
6083         else
6084
6085 cf_ncuhdr_root=ncursesw
6086
6087 test -n "$cf_cv_curses_dir" && \
6088 test "$cf_cv_curses_dir" != "no" && { \
6089
6090 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
6091   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
6092   do
6093         while test $cf_add_incdir != /usr/include
6094         do
6095           if test -d $cf_add_incdir
6096           then
6097                 cf_have_incdir=no
6098                 if test -n "$CFLAGS$CPPFLAGS" ; then
6099                   # a loop is needed to ensure we can add subdirs of existing dirs
6100                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
6101                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
6102                           cf_have_incdir=yes; break
6103                         fi
6104                   done
6105                 fi
6106
6107                 if test "$cf_have_incdir" = no ; then
6108                   if test "$cf_add_incdir" = /usr/local/include ; then
6109                         if test "$GCC" = yes
6110                         then
6111                           cf_save_CPPFLAGS=$CPPFLAGS
6112                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6113                           cat >conftest.$ac_ext <<_ACEOF
6114 #line 6114 "configure"
6115 #include "confdefs.h"
6116 #include <stdio.h>
6117 int
6118 main ()
6119 {
6120 printf("Hello")
6121   ;
6122   return 0;
6123 }
6124 _ACEOF
6125 rm -f conftest.$ac_objext
6126 if { (eval echo "$as_me:6126: \"$ac_compile\"") >&5
6127   (eval $ac_compile) 2>&5
6128   ac_status=$?
6129   echo "$as_me:6129: \$? = $ac_status" >&5
6130   (exit $ac_status); } &&
6131          { ac_try='test -s conftest.$ac_objext'
6132   { (eval echo "$as_me:6132: \"$ac_try\"") >&5
6133   (eval $ac_try) 2>&5
6134   ac_status=$?
6135   echo "$as_me:6135: \$? = $ac_status" >&5
6136   (exit $ac_status); }; }; then
6137   :
6138 else
6139   echo "$as_me: failed program was:" >&5
6140 cat conftest.$ac_ext >&5
6141 cf_have_incdir=yes
6142 fi
6143 rm -f conftest.$ac_objext conftest.$ac_ext
6144                           CPPFLAGS=$cf_save_CPPFLAGS
6145                         fi
6146                   fi
6147                 fi
6148
6149                 if test "$cf_have_incdir" = no ; then
6150                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
6151
6152 echo "${as_me:-configure}:6152: testing adding $cf_add_incdir to include-path ..." 1>&5
6153
6154                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6155
6156                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
6157                   test "$cf_top_incdir" = "$cf_add_incdir" && break
6158                   cf_add_incdir="$cf_top_incdir"
6159                 else
6160                   break
6161                 fi
6162           fi
6163         done
6164   done
6165 fi
6166
6167 }
6168
6169 echo "$as_me:6169: checking for $cf_ncuhdr_root header in include-path" >&5
6170 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
6171 if test "${cf_cv_ncurses_h+set}" = set; then
6172   echo $ECHO_N "(cached) $ECHO_C" >&6
6173 else
6174
6175         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
6176         ( test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw ) && cf_header_list="$cf_header_list curses.h ncurses.h"
6177         for cf_header in $cf_header_list
6178         do
6179
6180         cat >conftest.$ac_ext <<_ACEOF
6181 #line 6181 "configure"
6182 #include "confdefs.h"
6183
6184 #define _XOPEN_SOURCE_EXTENDED
6185 #undef  HAVE_LIBUTF8_H  /* in case we used CF_UTF8_LIB */
6186 #define HAVE_LIBUTF8_H  /* to force ncurses' header file to use cchar_t */
6187
6188 #include <$cf_header>
6189 int
6190 main ()
6191 {
6192
6193 #ifdef NCURSES_VERSION
6194
6195 #ifndef WACS_BSSB
6196         make an error
6197 #endif
6198
6199 printf("%s\n", NCURSES_VERSION);
6200 #else
6201 #ifdef __NCURSES_H
6202 printf("old\n");
6203 #else
6204         make an error
6205 #endif
6206 #endif
6207
6208   ;
6209   return 0;
6210 }
6211 _ACEOF
6212 rm -f conftest.$ac_objext
6213 if { (eval echo "$as_me:6213: \"$ac_compile\"") >&5
6214   (eval $ac_compile) 2>&5
6215   ac_status=$?
6216   echo "$as_me:6216: \$? = $ac_status" >&5
6217   (exit $ac_status); } &&
6218          { ac_try='test -s conftest.$ac_objext'
6219   { (eval echo "$as_me:6219: \"$ac_try\"") >&5
6220   (eval $ac_try) 2>&5
6221   ac_status=$?
6222   echo "$as_me:6222: \$? = $ac_status" >&5
6223   (exit $ac_status); }; }; then
6224   cf_cv_ncurses_h=$cf_header
6225
6226 else
6227   echo "$as_me: failed program was:" >&5
6228 cat conftest.$ac_ext >&5
6229 cf_cv_ncurses_h=no
6230 fi
6231 rm -f conftest.$ac_objext conftest.$ac_ext
6232
6233                 test "$cf_cv_ncurses_h" != no && break
6234         done
6235
6236 fi
6237 echo "$as_me:6237: result: $cf_cv_ncurses_h" >&5
6238 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
6239
6240 if test "$cf_cv_ncurses_h" != no ; then
6241         cf_cv_ncurses_header=$cf_cv_ncurses_h
6242 else
6243
6244 echo "$as_me:6244: checking for $cf_ncuhdr_root include-path" >&5
6245 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
6246 if test "${cf_cv_ncurses_h2+set}" = set; then
6247   echo $ECHO_N "(cached) $ECHO_C" >&6
6248 else
6249
6250         test -n "$verbose" && echo
6251
6252 cf_search=
6253
6254 # collect the current set of include-directories from compiler flags
6255 cf_header_path_list=""
6256 if test -n "${CFLAGS}${CPPFLAGS}" ; then
6257         for cf_header_path in $CPPFLAGS $CFLAGS
6258         do
6259                 case $cf_header_path in
6260                 (-I*)
6261                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
6262
6263 test "x$cf_header_path" != "xNONE" && \
6264 test -d "$cf_header_path" && \
6265  {
6266         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
6267         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
6268         test -d $cf_header_path/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
6269         test -d $cf_header_path/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
6270         test -d $cf_header_path/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
6271         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"
6272 }
6273
6274                         cf_header_path_list="$cf_header_path_list $cf_search"
6275                         ;;
6276                 esac
6277         done
6278 fi
6279
6280 # add the variations for the package we are looking for
6281
6282 cf_search=
6283
6284 test "x$prefix" != "xNONE" && \
6285 test -d "$prefix" && \
6286  {
6287         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
6288         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
6289         test -d $prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
6290         test -d $prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
6291         test -d $prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
6292         test -d $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
6293 }
6294
6295 for cf_subdir_prefix in \
6296         /usr \
6297         /usr/local \
6298         /usr/pkg \
6299         /opt \
6300         /opt/local \
6301         $HOME
6302 do
6303
6304 test "x$cf_subdir_prefix" != "x$prefix" && \
6305 test -d "$cf_subdir_prefix" && \
6306 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
6307         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
6308         test -d $cf_subdir_prefix/include &&          cf_search="$cf_search $cf_subdir_prefix/include"
6309         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root"
6310         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root/include"
6311         test -d $cf_subdir_prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include"
6312         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"
6313 }
6314
6315 done
6316
6317 test "$includedir" != NONE && \
6318 test "$includedir" != "/usr/include" && \
6319 test -d "$includedir" && {
6320         test -d $includedir &&    cf_search="$cf_search $includedir"
6321         test -d $includedir/$cf_ncuhdr_root && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
6322 }
6323
6324 test "$oldincludedir" != NONE && \
6325 test "$oldincludedir" != "/usr/include" && \
6326 test -d "$oldincludedir" && {
6327         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
6328         test -d $oldincludedir/$cf_ncuhdr_root && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
6329 }
6330
6331 cf_search="$cf_search $cf_header_path_list"
6332
6333         test -n "$verbose" && echo search path $cf_search
6334         cf_save2_CPPFLAGS="$CPPFLAGS"
6335         for cf_incdir in $cf_search
6336         do
6337
6338 if test -n "$cf_incdir" ; then
6339   for cf_add_incdir in $cf_incdir
6340   do
6341         while test $cf_add_incdir != /usr/include
6342         do
6343           if test -d $cf_add_incdir
6344           then
6345                 cf_have_incdir=no
6346                 if test -n "$CFLAGS$CPPFLAGS" ; then
6347                   # a loop is needed to ensure we can add subdirs of existing dirs
6348                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
6349                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
6350                           cf_have_incdir=yes; break
6351                         fi
6352                   done
6353                 fi
6354
6355                 if test "$cf_have_incdir" = no ; then
6356                   if test "$cf_add_incdir" = /usr/local/include ; then
6357                         if test "$GCC" = yes
6358                         then
6359                           cf_save_CPPFLAGS=$CPPFLAGS
6360                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6361                           cat >conftest.$ac_ext <<_ACEOF
6362 #line 6362 "configure"
6363 #include "confdefs.h"
6364 #include <stdio.h>
6365 int
6366 main ()
6367 {
6368 printf("Hello")
6369   ;
6370   return 0;
6371 }
6372 _ACEOF
6373 rm -f conftest.$ac_objext
6374 if { (eval echo "$as_me:6374: \"$ac_compile\"") >&5
6375   (eval $ac_compile) 2>&5
6376   ac_status=$?
6377   echo "$as_me:6377: \$? = $ac_status" >&5
6378   (exit $ac_status); } &&
6379          { ac_try='test -s conftest.$ac_objext'
6380   { (eval echo "$as_me:6380: \"$ac_try\"") >&5
6381   (eval $ac_try) 2>&5
6382   ac_status=$?
6383   echo "$as_me:6383: \$? = $ac_status" >&5
6384   (exit $ac_status); }; }; then
6385   :
6386 else
6387   echo "$as_me: failed program was:" >&5
6388 cat conftest.$ac_ext >&5
6389 cf_have_incdir=yes
6390 fi
6391 rm -f conftest.$ac_objext conftest.$ac_ext
6392                           CPPFLAGS=$cf_save_CPPFLAGS
6393                         fi
6394                   fi
6395                 fi
6396
6397                 if test "$cf_have_incdir" = no ; then
6398                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
6399
6400 echo "${as_me:-configure}:6400: testing adding $cf_add_incdir to include-path ..." 1>&5
6401
6402                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6403
6404                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
6405                   test "$cf_top_incdir" = "$cf_add_incdir" && break
6406                   cf_add_incdir="$cf_top_incdir"
6407                 else
6408                   break
6409                 fi
6410           fi
6411         done
6412   done
6413 fi
6414
6415                 for cf_header in \
6416                         ncurses.h \
6417                         curses.h
6418                 do
6419
6420         cat >conftest.$ac_ext <<_ACEOF
6421 #line 6421 "configure"
6422 #include "confdefs.h"
6423
6424 #include <$cf_header>
6425 int
6426 main ()
6427 {
6428
6429 #ifdef NCURSES_VERSION
6430
6431 printf("%s\n", NCURSES_VERSION);
6432 #else
6433 #ifdef __NCURSES_H
6434 printf("old\n");
6435 #else
6436         make an error
6437 #endif
6438 #endif
6439
6440   ;
6441   return 0;
6442 }
6443 _ACEOF
6444 rm -f conftest.$ac_objext
6445 if { (eval echo "$as_me:6445: \"$ac_compile\"") >&5
6446   (eval $ac_compile) 2>&5
6447   ac_status=$?
6448   echo "$as_me:6448: \$? = $ac_status" >&5
6449   (exit $ac_status); } &&
6450          { ac_try='test -s conftest.$ac_objext'
6451   { (eval echo "$as_me:6451: \"$ac_try\"") >&5
6452   (eval $ac_try) 2>&5
6453   ac_status=$?
6454   echo "$as_me:6454: \$? = $ac_status" >&5
6455   (exit $ac_status); }; }; then
6456   cf_cv_ncurses_h2=$cf_header
6457
6458 else
6459   echo "$as_me: failed program was:" >&5
6460 cat conftest.$ac_ext >&5
6461 cf_cv_ncurses_h2=no
6462 fi
6463 rm -f conftest.$ac_objext conftest.$ac_ext
6464
6465                         if test "$cf_cv_ncurses_h2" != no ; then
6466                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
6467                                 test -n "$verbose" && echo $ac_n "      ... found $ac_c" 1>&6
6468                                 break
6469                         fi
6470                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
6471                 done
6472                 CPPFLAGS="$cf_save2_CPPFLAGS"
6473                 test "$cf_cv_ncurses_h2" != no && break
6474         done
6475         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:6475: error: not found" >&5
6476 echo "$as_me: error: not found" >&2;}
6477    { (exit 1); exit 1; }; }
6478
6479 fi
6480 echo "$as_me:6480: result: $cf_cv_ncurses_h2" >&5
6481 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
6482
6483         cf_1st_incdir=`echo $cf_cv_ncurses_h2 | sed -e 's%/[^/]*$%%'`
6484         cf_cv_ncurses_header=`basename $cf_cv_ncurses_h2`
6485         if test `basename $cf_1st_incdir` = $cf_ncuhdr_root ; then
6486                 cf_cv_ncurses_header=$cf_ncuhdr_root/$cf_cv_ncurses_header
6487         fi
6488
6489 if test -n "$cf_1st_incdir" ; then
6490   for cf_add_incdir in $cf_1st_incdir
6491   do
6492         while test $cf_add_incdir != /usr/include
6493         do
6494           if test -d $cf_add_incdir
6495           then
6496                 cf_have_incdir=no
6497                 if test -n "$CFLAGS$CPPFLAGS" ; then
6498                   # a loop is needed to ensure we can add subdirs of existing dirs
6499                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
6500                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
6501                           cf_have_incdir=yes; break
6502                         fi
6503                   done
6504                 fi
6505
6506                 if test "$cf_have_incdir" = no ; then
6507                   if test "$cf_add_incdir" = /usr/local/include ; then
6508                         if test "$GCC" = yes
6509                         then
6510                           cf_save_CPPFLAGS=$CPPFLAGS
6511                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6512                           cat >conftest.$ac_ext <<_ACEOF
6513 #line 6513 "configure"
6514 #include "confdefs.h"
6515 #include <stdio.h>
6516 int
6517 main ()
6518 {
6519 printf("Hello")
6520   ;
6521   return 0;
6522 }
6523 _ACEOF
6524 rm -f conftest.$ac_objext
6525 if { (eval echo "$as_me:6525: \"$ac_compile\"") >&5
6526   (eval $ac_compile) 2>&5
6527   ac_status=$?
6528   echo "$as_me:6528: \$? = $ac_status" >&5
6529   (exit $ac_status); } &&
6530          { ac_try='test -s conftest.$ac_objext'
6531   { (eval echo "$as_me:6531: \"$ac_try\"") >&5
6532   (eval $ac_try) 2>&5
6533   ac_status=$?
6534   echo "$as_me:6534: \$? = $ac_status" >&5
6535   (exit $ac_status); }; }; then
6536   :
6537 else
6538   echo "$as_me: failed program was:" >&5
6539 cat conftest.$ac_ext >&5
6540 cf_have_incdir=yes
6541 fi
6542 rm -f conftest.$ac_objext conftest.$ac_ext
6543                           CPPFLAGS=$cf_save_CPPFLAGS
6544                         fi
6545                   fi
6546                 fi
6547
6548                 if test "$cf_have_incdir" = no ; then
6549                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
6550
6551 echo "${as_me:-configure}:6551: testing adding $cf_add_incdir to include-path ..." 1>&5
6552
6553                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6554
6555                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
6556                   test "$cf_top_incdir" = "$cf_add_incdir" && break
6557                   cf_add_incdir="$cf_top_incdir"
6558                 else
6559                   break
6560                 fi
6561           fi
6562         done
6563   done
6564 fi
6565
6566 fi
6567
6568 # Set definitions to allow ifdef'ing for ncurses.h
6569
6570 case $cf_cv_ncurses_header in
6571 (*ncurses.h)
6572
6573 cat >>confdefs.h <<\EOF
6574 #define HAVE_NCURSES_H 1
6575 EOF
6576
6577         ;;
6578 esac
6579
6580 case $cf_cv_ncurses_header in
6581 (ncurses/curses.h|ncurses/ncurses.h)
6582
6583 cat >>confdefs.h <<\EOF
6584 #define HAVE_NCURSES_NCURSES_H 1
6585 EOF
6586
6587         ;;
6588 (ncursesw/curses.h|ncursesw/ncurses.h)
6589
6590 cat >>confdefs.h <<\EOF
6591 #define HAVE_NCURSESW_NCURSES_H 1
6592 EOF
6593
6594         ;;
6595 esac
6596
6597 echo "$as_me:6597: checking for terminfo header" >&5
6598 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
6599 if test "${cf_cv_term_header+set}" = set; then
6600   echo $ECHO_N "(cached) $ECHO_C" >&6
6601 else
6602
6603 case ${cf_cv_ncurses_header} in
6604 (*/ncurses.h|*/ncursesw.h)
6605         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
6606         ;;
6607 (*)
6608         cf_term_header=term.h
6609         ;;
6610 esac
6611
6612 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
6613 do
6614 cat >conftest.$ac_ext <<_ACEOF
6615 #line 6615 "configure"
6616 #include "confdefs.h"
6617 #include <stdio.h>
6618 #include <${cf_cv_ncurses_header:-curses.h}>
6619 #include <$cf_test>
6620
6621 int
6622 main ()
6623 {
6624 int x = auto_left_margin
6625   ;
6626   return 0;
6627 }
6628 _ACEOF
6629 rm -f conftest.$ac_objext
6630 if { (eval echo "$as_me:6630: \"$ac_compile\"") >&5
6631   (eval $ac_compile) 2>&5
6632   ac_status=$?
6633   echo "$as_me:6633: \$? = $ac_status" >&5
6634   (exit $ac_status); } &&
6635          { ac_try='test -s conftest.$ac_objext'
6636   { (eval echo "$as_me:6636: \"$ac_try\"") >&5
6637   (eval $ac_try) 2>&5
6638   ac_status=$?
6639   echo "$as_me:6639: \$? = $ac_status" >&5
6640   (exit $ac_status); }; }; then
6641
6642         cf_cv_term_header="$cf_test"
6643 else
6644   echo "$as_me: failed program was:" >&5
6645 cat conftest.$ac_ext >&5
6646
6647         cf_cv_term_header=unknown
6648
6649 fi
6650 rm -f conftest.$ac_objext conftest.$ac_ext
6651         test "$cf_cv_term_header" != unknown && break
6652 done
6653
6654 fi
6655 echo "$as_me:6655: result: $cf_cv_term_header" >&5
6656 echo "${ECHO_T}$cf_cv_term_header" >&6
6657
6658 # Set definitions to allow ifdef'ing to accommodate subdirectories
6659
6660 case $cf_cv_term_header in
6661 (*term.h)
6662
6663 cat >>confdefs.h <<\EOF
6664 #define HAVE_TERM_H 1
6665 EOF
6666
6667         ;;
6668 esac
6669
6670 case $cf_cv_term_header in
6671 (ncurses/term.h)
6672
6673 cat >>confdefs.h <<\EOF
6674 #define HAVE_NCURSES_TERM_H 1
6675 EOF
6676
6677         ;;
6678 (ncursesw/term.h)
6679
6680 cat >>confdefs.h <<\EOF
6681 #define HAVE_NCURSESW_TERM_H 1
6682 EOF
6683
6684         ;;
6685 esac
6686
6687 # some applications need this, but should check for NCURSES_VERSION
6688
6689 cat >>confdefs.h <<\EOF
6690 #define NCURSES 1
6691 EOF
6692
6693 echo "$as_me:6693: checking for ncurses version" >&5
6694 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
6695 if test "${cf_cv_ncurses_version+set}" = set; then
6696   echo $ECHO_N "(cached) $ECHO_C" >&6
6697 else
6698
6699         cf_cv_ncurses_version=no
6700         cf_tempfile=out$$
6701         rm -f $cf_tempfile
6702         if test "$cross_compiling" = yes; then
6703
6704         # This will not work if the preprocessor splits the line after the
6705         # Autoconf token.  The 'unproto' program does that.
6706         cat > conftest.$ac_ext <<EOF
6707 #include <${cf_cv_ncurses_header:-curses.h}>
6708 #undef Autoconf
6709 #ifdef NCURSES_VERSION
6710 Autoconf NCURSES_VERSION
6711 #else
6712 #ifdef __NCURSES_H
6713 Autoconf "old"
6714 #endif
6715 ;
6716 #endif
6717 EOF
6718         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
6719         { (eval echo "$as_me:6719: \"$cf_try\"") >&5
6720   (eval $cf_try) 2>&5
6721   ac_status=$?
6722   echo "$as_me:6722: \$? = $ac_status" >&5
6723   (exit $ac_status); }
6724         if test -f conftest.out ; then
6725                 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
6726                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
6727                 rm -f conftest.out
6728         fi
6729
6730 else
6731   cat >conftest.$ac_ext <<_ACEOF
6732 #line 6732 "configure"
6733 #include "confdefs.h"
6734
6735 #include <${cf_cv_ncurses_header:-curses.h}>
6736 #include <stdio.h>
6737 int main()
6738 {
6739         FILE *fp = fopen("$cf_tempfile", "w");
6740 #ifdef NCURSES_VERSION
6741 # ifdef NCURSES_VERSION_PATCH
6742         fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
6743 # else
6744         fprintf(fp, "%s\n", NCURSES_VERSION);
6745 # endif
6746 #else
6747 # ifdef __NCURSES_H
6748         fprintf(fp, "old\n");
6749 # else
6750         make an error
6751 # endif
6752 #endif
6753         ${cf_cv_main_return:-return}(0);
6754 }
6755 _ACEOF
6756 rm -f conftest$ac_exeext
6757 if { (eval echo "$as_me:6757: \"$ac_link\"") >&5
6758   (eval $ac_link) 2>&5
6759   ac_status=$?
6760   echo "$as_me:6760: \$? = $ac_status" >&5
6761   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
6762   { (eval echo "$as_me:6762: \"$ac_try\"") >&5
6763   (eval $ac_try) 2>&5
6764   ac_status=$?
6765   echo "$as_me:6765: \$? = $ac_status" >&5
6766   (exit $ac_status); }; }; then
6767
6768         cf_cv_ncurses_version=`cat $cf_tempfile`
6769 else
6770   echo "$as_me: program exited with status $ac_status" >&5
6771 echo "$as_me: failed program was:" >&5
6772 cat conftest.$ac_ext >&5
6773 fi
6774 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
6775 fi
6776         rm -f $cf_tempfile
6777
6778 fi
6779 echo "$as_me:6779: result: $cf_cv_ncurses_version" >&5
6780 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
6781 test "$cf_cv_ncurses_version" = no ||
6782 cat >>confdefs.h <<\EOF
6783 #define NCURSES 1
6784 EOF
6785
6786 cf_nculib_root=ncursesw
6787         # This works, except for the special case where we find gpm, but
6788         # ncurses is in a nonstandard location via $LIBS, and we really want
6789         # to link gpm.
6790 cf_ncurses_LIBS=""
6791 cf_ncurses_SAVE="$LIBS"
6792 echo "$as_me:6792: checking for Gpm_Open in -lgpm" >&5
6793 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
6794 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
6795   echo $ECHO_N "(cached) $ECHO_C" >&6
6796 else
6797   ac_check_lib_save_LIBS=$LIBS
6798 LIBS="-lgpm  $LIBS"
6799 cat >conftest.$ac_ext <<_ACEOF
6800 #line 6800 "configure"
6801 #include "confdefs.h"
6802
6803 /* Override any gcc2 internal prototype to avoid an error.  */
6804 #ifdef __cplusplus
6805 extern "C"
6806 #endif
6807 /* We use char because int might match the return type of a gcc2
6808    builtin and then its argument prototype would still apply.  */
6809 char Gpm_Open ();
6810 int
6811 main ()
6812 {
6813 Gpm_Open ();
6814   ;
6815   return 0;
6816 }
6817 _ACEOF
6818 rm -f conftest.$ac_objext conftest$ac_exeext
6819 if { (eval echo "$as_me:6819: \"$ac_link\"") >&5
6820   (eval $ac_link) 2>&5
6821   ac_status=$?
6822   echo "$as_me:6822: \$? = $ac_status" >&5
6823   (exit $ac_status); } &&
6824          { ac_try='test -s conftest$ac_exeext'
6825   { (eval echo "$as_me:6825: \"$ac_try\"") >&5
6826   (eval $ac_try) 2>&5
6827   ac_status=$?
6828   echo "$as_me:6828: \$? = $ac_status" >&5
6829   (exit $ac_status); }; }; then
6830   ac_cv_lib_gpm_Gpm_Open=yes
6831 else
6832   echo "$as_me: failed program was:" >&5
6833 cat conftest.$ac_ext >&5
6834 ac_cv_lib_gpm_Gpm_Open=no
6835 fi
6836 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6837 LIBS=$ac_check_lib_save_LIBS
6838 fi
6839 echo "$as_me:6839: result: $ac_cv_lib_gpm_Gpm_Open" >&5
6840 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
6841 if test $ac_cv_lib_gpm_Gpm_Open = yes; then
6842   echo "$as_me:6842: checking for initscr in -lgpm" >&5
6843 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
6844 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
6845   echo $ECHO_N "(cached) $ECHO_C" >&6
6846 else
6847   ac_check_lib_save_LIBS=$LIBS
6848 LIBS="-lgpm  $LIBS"
6849 cat >conftest.$ac_ext <<_ACEOF
6850 #line 6850 "configure"
6851 #include "confdefs.h"
6852
6853 /* Override any gcc2 internal prototype to avoid an error.  */
6854 #ifdef __cplusplus
6855 extern "C"
6856 #endif
6857 /* We use char because int might match the return type of a gcc2
6858    builtin and then its argument prototype would still apply.  */
6859 char initscr ();
6860 int
6861 main ()
6862 {
6863 initscr ();
6864   ;
6865   return 0;
6866 }
6867 _ACEOF
6868 rm -f conftest.$ac_objext conftest$ac_exeext
6869 if { (eval echo "$as_me:6869: \"$ac_link\"") >&5
6870   (eval $ac_link) 2>&5
6871   ac_status=$?
6872   echo "$as_me:6872: \$? = $ac_status" >&5
6873   (exit $ac_status); } &&
6874          { ac_try='test -s conftest$ac_exeext'
6875   { (eval echo "$as_me:6875: \"$ac_try\"") >&5
6876   (eval $ac_try) 2>&5
6877   ac_status=$?
6878   echo "$as_me:6878: \$? = $ac_status" >&5
6879   (exit $ac_status); }; }; then
6880   ac_cv_lib_gpm_initscr=yes
6881 else
6882   echo "$as_me: failed program was:" >&5
6883 cat conftest.$ac_ext >&5
6884 ac_cv_lib_gpm_initscr=no
6885 fi
6886 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6887 LIBS=$ac_check_lib_save_LIBS
6888 fi
6889 echo "$as_me:6889: result: $ac_cv_lib_gpm_initscr" >&5
6890 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
6891 if test $ac_cv_lib_gpm_initscr = yes; then
6892   LIBS="$cf_ncurses_SAVE"
6893 else
6894   cf_ncurses_LIBS="-lgpm"
6895 fi
6896
6897 fi
6898
6899 case $host_os in
6900 (freebsd*)
6901         # This is only necessary if you are linking against an obsolete
6902         # version of ncurses (but it should do no harm, since it's static).
6903         if test "$cf_nculib_root" = ncurses ; then
6904                 echo "$as_me:6904: checking for tgoto in -lmytinfo" >&5
6905 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
6906 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
6907   echo $ECHO_N "(cached) $ECHO_C" >&6
6908 else
6909   ac_check_lib_save_LIBS=$LIBS
6910 LIBS="-lmytinfo  $LIBS"
6911 cat >conftest.$ac_ext <<_ACEOF
6912 #line 6912 "configure"
6913 #include "confdefs.h"
6914
6915 /* Override any gcc2 internal prototype to avoid an error.  */
6916 #ifdef __cplusplus
6917 extern "C"
6918 #endif
6919 /* We use char because int might match the return type of a gcc2
6920    builtin and then its argument prototype would still apply.  */
6921 char tgoto ();
6922 int
6923 main ()
6924 {
6925 tgoto ();
6926   ;
6927   return 0;
6928 }
6929 _ACEOF
6930 rm -f conftest.$ac_objext conftest$ac_exeext
6931 if { (eval echo "$as_me:6931: \"$ac_link\"") >&5
6932   (eval $ac_link) 2>&5
6933   ac_status=$?
6934   echo "$as_me:6934: \$? = $ac_status" >&5
6935   (exit $ac_status); } &&
6936          { ac_try='test -s conftest$ac_exeext'
6937   { (eval echo "$as_me:6937: \"$ac_try\"") >&5
6938   (eval $ac_try) 2>&5
6939   ac_status=$?
6940   echo "$as_me:6940: \$? = $ac_status" >&5
6941   (exit $ac_status); }; }; then
6942   ac_cv_lib_mytinfo_tgoto=yes
6943 else
6944   echo "$as_me: failed program was:" >&5
6945 cat conftest.$ac_ext >&5
6946 ac_cv_lib_mytinfo_tgoto=no
6947 fi
6948 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6949 LIBS=$ac_check_lib_save_LIBS
6950 fi
6951 echo "$as_me:6951: result: $ac_cv_lib_mytinfo_tgoto" >&5
6952 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
6953 if test $ac_cv_lib_mytinfo_tgoto = yes; then
6954   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
6955 fi
6956
6957         fi
6958         ;;
6959 esac
6960
6961 cf_add_libs="$cf_ncurses_LIBS"
6962 # Filter out duplicates - this happens with badly-designed ".pc" files...
6963 for cf_add_1lib in $LIBS
6964 do
6965         for cf_add_2lib in $cf_add_libs
6966         do
6967                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
6968                 then
6969                         cf_add_1lib=
6970                         break
6971                 fi
6972         done
6973         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
6974 done
6975 LIBS="$cf_add_libs"
6976
6977 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
6978 then
6979
6980 cf_add_libs="-l$cf_nculib_root"
6981 # Filter out duplicates - this happens with badly-designed ".pc" files...
6982 for cf_add_1lib in $LIBS
6983 do
6984         for cf_add_2lib in $cf_add_libs
6985         do
6986                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
6987                 then
6988                         cf_add_1lib=
6989                         break
6990                 fi
6991         done
6992         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
6993 done
6994 LIBS="$cf_add_libs"
6995
6996 else
6997
6998         eval 'cf_cv_have_lib_'$cf_nculib_root'=no'
6999         cf_libdir=""
7000         echo "$as_me:7000: checking for initscr" >&5
7001 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
7002 if test "${ac_cv_func_initscr+set}" = set; then
7003   echo $ECHO_N "(cached) $ECHO_C" >&6
7004 else
7005   cat >conftest.$ac_ext <<_ACEOF
7006 #line 7006 "configure"
7007 #include "confdefs.h"
7008 /* System header to define __stub macros and hopefully few prototypes,
7009     which can conflict with char initscr (); below.  */
7010 #include <assert.h>
7011 /* Override any gcc2 internal prototype to avoid an error.  */
7012 #ifdef __cplusplus
7013 extern "C"
7014 #endif
7015 /* We use char because int might match the return type of a gcc2
7016    builtin and then its argument prototype would still apply.  */
7017 char initscr ();
7018 char (*f) ();
7019
7020 int
7021 main ()
7022 {
7023 /* The GNU C library defines this for functions which it implements
7024     to always fail with ENOSYS.  Some functions are actually named
7025     something starting with __ and the normal name is an alias.  */
7026 #if defined (__stub_initscr) || defined (__stub___initscr)
7027 choke me
7028 #else
7029 f = initscr; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
7030 #endif
7031
7032   ;
7033   return 0;
7034 }
7035 _ACEOF
7036 rm -f conftest.$ac_objext conftest$ac_exeext
7037 if { (eval echo "$as_me:7037: \"$ac_link\"") >&5
7038   (eval $ac_link) 2>&5
7039   ac_status=$?
7040   echo "$as_me:7040: \$? = $ac_status" >&5
7041   (exit $ac_status); } &&
7042          { ac_try='test -s conftest$ac_exeext'
7043   { (eval echo "$as_me:7043: \"$ac_try\"") >&5
7044   (eval $ac_try) 2>&5
7045   ac_status=$?
7046   echo "$as_me:7046: \$? = $ac_status" >&5
7047   (exit $ac_status); }; }; then
7048   ac_cv_func_initscr=yes
7049 else
7050   echo "$as_me: failed program was:" >&5
7051 cat conftest.$ac_ext >&5
7052 ac_cv_func_initscr=no
7053 fi
7054 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7055 fi
7056 echo "$as_me:7056: result: $ac_cv_func_initscr" >&5
7057 echo "${ECHO_T}$ac_cv_func_initscr" >&6
7058 if test $ac_cv_func_initscr = yes; then
7059   eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
7060 else
7061
7062                 cf_save_LIBS="$LIBS"
7063                 echo "$as_me:7063: checking for initscr in -l$cf_nculib_root" >&5
7064 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
7065                 LIBS="-l$cf_nculib_root $LIBS"
7066                 cat >conftest.$ac_ext <<_ACEOF
7067 #line 7067 "configure"
7068 #include "confdefs.h"
7069 #include <${cf_cv_ncurses_header:-curses.h}>
7070 int
7071 main ()
7072 {
7073 initscr()
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   echo "$as_me:7090: result: yes" >&5
7091 echo "${ECHO_T}yes" >&6
7092                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
7093
7094 else
7095   echo "$as_me: failed program was:" >&5
7096 cat conftest.$ac_ext >&5
7097 echo "$as_me:7097: result: no" >&5
7098 echo "${ECHO_T}no" >&6
7099
7100 cf_search=
7101 cf_library_path_list=""
7102 if test -n "${LDFLAGS}${LIBS}" ; then
7103         for cf_library_path in $LDFLAGS $LIBS
7104         do
7105                 case $cf_library_path in
7106                 (-L*)
7107                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
7108
7109 test "x$cf_library_path" != "xNONE" && \
7110 test -d "$cf_library_path" && \
7111  {
7112         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
7113         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
7114         test -d $cf_library_path/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
7115         test -d $cf_library_path/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
7116         test -d $cf_library_path/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
7117         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"
7118 }
7119
7120                         cf_library_path_list="$cf_library_path_list $cf_search"
7121                         ;;
7122                 esac
7123         done
7124 fi
7125
7126 cf_search=
7127
7128 test "x$prefix" != "xNONE" && \
7129 test -d "$prefix" && \
7130  {
7131         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
7132         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
7133         test -d $prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
7134         test -d $prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
7135         test -d $prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
7136         test -d $prefix/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
7137 }
7138
7139 for cf_subdir_prefix in \
7140         /usr \
7141         /usr/local \
7142         /usr/pkg \
7143         /opt \
7144         /opt/local \
7145         $HOME
7146 do
7147
7148 test "x$cf_subdir_prefix" != "x$prefix" && \
7149 test -d "$cf_subdir_prefix" && \
7150 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
7151         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
7152         test -d $cf_subdir_prefix/lib &&          cf_search="$cf_search $cf_subdir_prefix/lib"
7153         test -d $cf_subdir_prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root"
7154         test -d $cf_subdir_prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root/lib"
7155         test -d $cf_subdir_prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib"
7156         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"
7157 }
7158
7159 done
7160
7161 cf_search="$cf_library_path_list $cf_search"
7162
7163                         for cf_libdir in $cf_search
7164                         do
7165                                 echo "$as_me:7165: checking for -l$cf_nculib_root in $cf_libdir" >&5
7166 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
7167                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
7168                                 cat >conftest.$ac_ext <<_ACEOF
7169 #line 7169 "configure"
7170 #include "confdefs.h"
7171 #include <${cf_cv_ncurses_header:-curses.h}>
7172 int
7173 main ()
7174 {
7175 initscr()
7176   ;
7177   return 0;
7178 }
7179 _ACEOF
7180 rm -f conftest.$ac_objext conftest$ac_exeext
7181 if { (eval echo "$as_me:7181: \"$ac_link\"") >&5
7182   (eval $ac_link) 2>&5
7183   ac_status=$?
7184   echo "$as_me:7184: \$? = $ac_status" >&5
7185   (exit $ac_status); } &&
7186          { ac_try='test -s conftest$ac_exeext'
7187   { (eval echo "$as_me:7187: \"$ac_try\"") >&5
7188   (eval $ac_try) 2>&5
7189   ac_status=$?
7190   echo "$as_me:7190: \$? = $ac_status" >&5
7191   (exit $ac_status); }; }; then
7192   echo "$as_me:7192: result: yes" >&5
7193 echo "${ECHO_T}yes" >&6
7194                                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
7195                                          break
7196 else
7197   echo "$as_me: failed program was:" >&5
7198 cat conftest.$ac_ext >&5
7199 echo "$as_me:7199: result: no" >&5
7200 echo "${ECHO_T}no" >&6
7201                                          LIBS="$cf_save_LIBS"
7202 fi
7203 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7204                         done
7205
7206 fi
7207 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7208
7209 fi
7210
7211 eval 'cf_found_library=$cf_cv_have_lib_'$cf_nculib_root
7212
7213 if test $cf_found_library = no ; then
7214         { { echo "$as_me:7214: error: Cannot link $cf_nculib_root library" >&5
7215 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
7216    { (exit 1); exit 1; }; }
7217 fi
7218
7219 fi
7220
7221 if test -n "$cf_ncurses_LIBS" ; then
7222         echo "$as_me:7222: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
7223 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
7224         cf_ncurses_SAVE="$LIBS"
7225         for p in $cf_ncurses_LIBS ; do
7226                 q=`echo $LIBS | sed -e "s%$p %%" -e "s%$p$%%"`
7227                 if test "$q" != "$LIBS" ; then
7228                         LIBS="$q"
7229                 fi
7230         done
7231         cat >conftest.$ac_ext <<_ACEOF
7232 #line 7232 "configure"
7233 #include "confdefs.h"
7234 #include <${cf_cv_ncurses_header:-curses.h}>
7235 int
7236 main ()
7237 {
7238 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
7239   ;
7240   return 0;
7241 }
7242 _ACEOF
7243 rm -f conftest.$ac_objext conftest$ac_exeext
7244 if { (eval echo "$as_me:7244: \"$ac_link\"") >&5
7245   (eval $ac_link) 2>&5
7246   ac_status=$?
7247   echo "$as_me:7247: \$? = $ac_status" >&5
7248   (exit $ac_status); } &&
7249          { ac_try='test -s conftest$ac_exeext'
7250   { (eval echo "$as_me:7250: \"$ac_try\"") >&5
7251   (eval $ac_try) 2>&5
7252   ac_status=$?
7253   echo "$as_me:7253: \$? = $ac_status" >&5
7254   (exit $ac_status); }; }; then
7255   echo "$as_me:7255: result: yes" >&5
7256 echo "${ECHO_T}yes" >&6
7257 else
7258   echo "$as_me: failed program was:" >&5
7259 cat conftest.$ac_ext >&5
7260 echo "$as_me:7260: result: no" >&5
7261 echo "${ECHO_T}no" >&6
7262                  LIBS="$cf_ncurses_SAVE"
7263 fi
7264 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7265 fi
7266
7267 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
7268
7269 cat >>confdefs.h <<EOF
7270 #define $cf_nculib_ROOT 1
7271 EOF
7272
7273         fi
7274 else
7275         NCURSES_CONFIG=none
7276 fi
7277
7278 else
7279
7280 cf_ncuconfig_root=ncurses
7281 cf_have_ncuconfig=no
7282
7283 if test "x$PKG_CONFIG" != xnone; then
7284         echo "$as_me:7284: checking pkg-config for $cf_ncuconfig_root" >&5
7285 echo $ECHO_N "checking pkg-config for $cf_ncuconfig_root... $ECHO_C" >&6
7286         if "$PKG_CONFIG" --exists $cf_ncuconfig_root ; then
7287                 echo "$as_me:7287: result: yes" >&5
7288 echo "${ECHO_T}yes" >&6
7289
7290                 echo "$as_me:7290: checking if the $cf_ncuconfig_root package files work" >&5
7291 echo $ECHO_N "checking if the $cf_ncuconfig_root package files work... $ECHO_C" >&6
7292                 cf_have_ncuconfig=unknown
7293
7294                 cf_save_CPPFLAGS="$CPPFLAGS"
7295                 cf_save_LIBS="$LIBS"
7296
7297                 CPPFLAGS="$CPPFLAGS `$PKG_CONFIG --cflags $cf_ncuconfig_root`"
7298
7299 cf_add_libs="`$PKG_CONFIG --libs $cf_ncuconfig_root`"
7300 # Filter out duplicates - this happens with badly-designed ".pc" files...
7301 for cf_add_1lib in $LIBS
7302 do
7303         for cf_add_2lib in $cf_add_libs
7304         do
7305                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
7306                 then
7307                         cf_add_1lib=
7308                         break
7309                 fi
7310         done
7311         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
7312 done
7313 LIBS="$cf_add_libs"
7314
7315                 cat >conftest.$ac_ext <<_ACEOF
7316 #line 7316 "configure"
7317 #include "confdefs.h"
7318 #include <${cf_cv_ncurses_header:-curses.h}>
7319 int
7320 main ()
7321 {
7322 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
7323   ;
7324   return 0;
7325 }
7326 _ACEOF
7327 rm -f conftest.$ac_objext conftest$ac_exeext
7328 if { (eval echo "$as_me:7328: \"$ac_link\"") >&5
7329   (eval $ac_link) 2>&5
7330   ac_status=$?
7331   echo "$as_me:7331: \$? = $ac_status" >&5
7332   (exit $ac_status); } &&
7333          { ac_try='test -s conftest$ac_exeext'
7334   { (eval echo "$as_me:7334: \"$ac_try\"") >&5
7335   (eval $ac_try) 2>&5
7336   ac_status=$?
7337   echo "$as_me:7337: \$? = $ac_status" >&5
7338   (exit $ac_status); }; }; then
7339   if test "$cross_compiling" = yes; then
7340   { { echo "$as_me:7340: error: cannot run test program while cross compiling" >&5
7341 echo "$as_me: error: cannot run test program while cross compiling" >&2;}
7342    { (exit 1); exit 1; }; }
7343 else
7344   cat >conftest.$ac_ext <<_ACEOF
7345 #line 7345 "configure"
7346 #include "confdefs.h"
7347 #include <${cf_cv_ncurses_header:-curses.h}>
7348                                 int main(void)
7349                                 { char *xx = curses_version(); return (xx == 0); }
7350 _ACEOF
7351 rm -f conftest$ac_exeext
7352 if { (eval echo "$as_me:7352: \"$ac_link\"") >&5
7353   (eval $ac_link) 2>&5
7354   ac_status=$?
7355   echo "$as_me:7355: \$? = $ac_status" >&5
7356   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
7357   { (eval echo "$as_me:7357: \"$ac_try\"") >&5
7358   (eval $ac_try) 2>&5
7359   ac_status=$?
7360   echo "$as_me:7360: \$? = $ac_status" >&5
7361   (exit $ac_status); }; }; then
7362   cf_have_ncuconfig=yes
7363 else
7364   echo "$as_me: program exited with status $ac_status" >&5
7365 echo "$as_me: failed program was:" >&5
7366 cat conftest.$ac_ext >&5
7367 cf_have_ncuconfig=no
7368 fi
7369 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
7370 fi
7371 else
7372   echo "$as_me: failed program was:" >&5
7373 cat conftest.$ac_ext >&5
7374 cf_have_ncuconfig=no
7375 fi
7376 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7377
7378                 echo "$as_me:7378: result: $cf_have_ncuconfig" >&5
7379 echo "${ECHO_T}$cf_have_ncuconfig" >&6
7380                 if test "$cf_have_ncuconfig" != "yes"
7381                 then
7382                         CPPFLAGS="$cf_save_CPPFLAGS"
7383                         LIBS="$cf_save_LIBS"
7384                         NCURSES_CONFIG_PKG=none
7385                 else
7386
7387 cat >>confdefs.h <<\EOF
7388 #define NCURSES 1
7389 EOF
7390
7391                         NCURSES_CONFIG_PKG=$cf_ncuconfig_root
7392                 fi
7393
7394         else
7395                 echo "$as_me:7395: result: no" >&5
7396 echo "${ECHO_T}no" >&6
7397                 NCURSES_CONFIG_PKG=none
7398         fi
7399 else
7400         NCURSES_CONFIG_PKG=none
7401 fi
7402
7403 if test "x$cf_have_ncuconfig" = "xno"; then
7404         echo "Looking for ${cf_ncuconfig_root}-config"
7405
7406 if test -n "$ac_tool_prefix"; then
7407   for ac_prog in ${cf_ncuconfig_root}-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
7408   do
7409     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
7410 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
7411 echo "$as_me:7411: checking for $ac_word" >&5
7412 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
7413 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
7414   echo $ECHO_N "(cached) $ECHO_C" >&6
7415 else
7416   if test -n "$NCURSES_CONFIG"; then
7417   ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
7418 else
7419   ac_save_IFS=$IFS; IFS=$ac_path_separator
7420 ac_dummy="$PATH"
7421 for ac_dir in $ac_dummy; do
7422   IFS=$ac_save_IFS
7423   test -z "$ac_dir" && ac_dir=.
7424   $as_executable_p "$ac_dir/$ac_word" || continue
7425 ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
7426 echo "$as_me:7426: found $ac_dir/$ac_word" >&5
7427 break
7428 done
7429
7430 fi
7431 fi
7432 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
7433 if test -n "$NCURSES_CONFIG"; then
7434   echo "$as_me:7434: result: $NCURSES_CONFIG" >&5
7435 echo "${ECHO_T}$NCURSES_CONFIG" >&6
7436 else
7437   echo "$as_me:7437: result: no" >&5
7438 echo "${ECHO_T}no" >&6
7439 fi
7440
7441     test -n "$NCURSES_CONFIG" && break
7442   done
7443 fi
7444 if test -z "$NCURSES_CONFIG"; then
7445   ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
7446   for ac_prog in ${cf_ncuconfig_root}-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
7447 do
7448   # Extract the first word of "$ac_prog", so it can be a program name with args.
7449 set dummy $ac_prog; ac_word=$2
7450 echo "$as_me:7450: checking for $ac_word" >&5
7451 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
7452 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
7453   echo $ECHO_N "(cached) $ECHO_C" >&6
7454 else
7455   if test -n "$ac_ct_NCURSES_CONFIG"; then
7456   ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
7457 else
7458   ac_save_IFS=$IFS; IFS=$ac_path_separator
7459 ac_dummy="$PATH"
7460 for ac_dir in $ac_dummy; do
7461   IFS=$ac_save_IFS
7462   test -z "$ac_dir" && ac_dir=.
7463   $as_executable_p "$ac_dir/$ac_word" || continue
7464 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
7465 echo "$as_me:7465: found $ac_dir/$ac_word" >&5
7466 break
7467 done
7468
7469 fi
7470 fi
7471 ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
7472 if test -n "$ac_ct_NCURSES_CONFIG"; then
7473   echo "$as_me:7473: result: $ac_ct_NCURSES_CONFIG" >&5
7474 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
7475 else
7476   echo "$as_me:7476: result: no" >&5
7477 echo "${ECHO_T}no" >&6
7478 fi
7479
7480   test -n "$ac_ct_NCURSES_CONFIG" && break
7481 done
7482 test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
7483
7484   NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
7485 fi
7486
7487         if test "$NCURSES_CONFIG" != none ; then
7488
7489                 CPPFLAGS="$CPPFLAGS `$NCURSES_CONFIG --cflags`"
7490
7491 cf_add_libs="`$NCURSES_CONFIG --libs`"
7492 # Filter out duplicates - this happens with badly-designed ".pc" files...
7493 for cf_add_1lib in $LIBS
7494 do
7495         for cf_add_2lib in $cf_add_libs
7496         do
7497                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
7498                 then
7499                         cf_add_1lib=
7500                         break
7501                 fi
7502         done
7503         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
7504 done
7505 LIBS="$cf_add_libs"
7506
7507                 # even with config script, some packages use no-override for curses.h
7508
7509 echo "$as_me:7509: checking if we have identified curses headers" >&5
7510 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
7511 if test "${cf_cv_ncurses_header+set}" = set; then
7512   echo $ECHO_N "(cached) $ECHO_C" >&6
7513 else
7514
7515 cf_cv_ncurses_header=none
7516 for cf_header in \
7517         ncurses.h ncurses/ncurses.h \
7518         curses.h ncurses/curses.h
7519 do
7520 cat >conftest.$ac_ext <<_ACEOF
7521 #line 7521 "configure"
7522 #include "confdefs.h"
7523 #include <${cf_header}>
7524 int
7525 main ()
7526 {
7527 initscr(); tgoto("?", 0,0)
7528   ;
7529   return 0;
7530 }
7531 _ACEOF
7532 rm -f conftest.$ac_objext
7533 if { (eval echo "$as_me:7533: \"$ac_compile\"") >&5
7534   (eval $ac_compile) 2>&5
7535   ac_status=$?
7536   echo "$as_me:7536: \$? = $ac_status" >&5
7537   (exit $ac_status); } &&
7538          { ac_try='test -s conftest.$ac_objext'
7539   { (eval echo "$as_me:7539: \"$ac_try\"") >&5
7540   (eval $ac_try) 2>&5
7541   ac_status=$?
7542   echo "$as_me:7542: \$? = $ac_status" >&5
7543   (exit $ac_status); }; }; then
7544   cf_cv_ncurses_header=$cf_header; break
7545 else
7546   echo "$as_me: failed program was:" >&5
7547 cat conftest.$ac_ext >&5
7548 fi
7549 rm -f conftest.$ac_objext conftest.$ac_ext
7550 done
7551
7552 fi
7553 echo "$as_me:7553: result: $cf_cv_ncurses_header" >&5
7554 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
7555
7556 if test "$cf_cv_ncurses_header" = none ; then
7557         { { echo "$as_me:7557: error: No curses header-files found" >&5
7558 echo "$as_me: error: No curses header-files found" >&2;}
7559    { (exit 1); exit 1; }; }
7560 fi
7561
7562 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
7563
7564 for ac_header in $cf_cv_ncurses_header
7565 do
7566 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
7567 echo "$as_me:7567: checking for $ac_header" >&5
7568 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
7569 if eval "test \"\${$as_ac_Header+set}\" = set"; then
7570   echo $ECHO_N "(cached) $ECHO_C" >&6
7571 else
7572   cat >conftest.$ac_ext <<_ACEOF
7573 #line 7573 "configure"
7574 #include "confdefs.h"
7575 #include <$ac_header>
7576 _ACEOF
7577 if { (eval echo "$as_me:7577: \"$ac_cpp conftest.$ac_ext\"") >&5
7578   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
7579   ac_status=$?
7580   egrep -v '^ *\+' conftest.er1 >conftest.err
7581   rm -f conftest.er1
7582   cat conftest.err >&5
7583   echo "$as_me:7583: \$? = $ac_status" >&5
7584   (exit $ac_status); } >/dev/null; then
7585   if test -s conftest.err; then
7586     ac_cpp_err=$ac_c_preproc_warn_flag
7587   else
7588     ac_cpp_err=
7589   fi
7590 else
7591   ac_cpp_err=yes
7592 fi
7593 if test -z "$ac_cpp_err"; then
7594   eval "$as_ac_Header=yes"
7595 else
7596   echo "$as_me: failed program was:" >&5
7597   cat conftest.$ac_ext >&5
7598   eval "$as_ac_Header=no"
7599 fi
7600 rm -f conftest.err conftest.$ac_ext
7601 fi
7602 echo "$as_me:7602: result: `eval echo '${'$as_ac_Header'}'`" >&5
7603 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
7604 if test `eval echo '${'$as_ac_Header'}'` = yes; then
7605   cat >>confdefs.h <<EOF
7606 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
7607 EOF
7608
7609 fi
7610 done
7611
7612 cat >>confdefs.h <<\EOF
7613 #define NCURSES 1
7614 EOF
7615
7616 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
7617
7618                 cat >>confdefs.h <<EOF
7619 #define $cf_nculib_ROOT 1
7620 EOF
7621
7622                                 cf_cv_ncurses_version=`$NCURSES_CONFIG --version`
7623
7624         else
7625
7626 cf_ncuhdr_root=ncurses
7627
7628 test -n "$cf_cv_curses_dir" && \
7629 test "$cf_cv_curses_dir" != "no" && { \
7630
7631 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
7632   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
7633   do
7634         while test $cf_add_incdir != /usr/include
7635         do
7636           if test -d $cf_add_incdir
7637           then
7638                 cf_have_incdir=no
7639                 if test -n "$CFLAGS$CPPFLAGS" ; then
7640                   # a loop is needed to ensure we can add subdirs of existing dirs
7641                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
7642                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
7643                           cf_have_incdir=yes; break
7644                         fi
7645                   done
7646                 fi
7647
7648                 if test "$cf_have_incdir" = no ; then
7649                   if test "$cf_add_incdir" = /usr/local/include ; then
7650                         if test "$GCC" = yes
7651                         then
7652                           cf_save_CPPFLAGS=$CPPFLAGS
7653                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
7654                           cat >conftest.$ac_ext <<_ACEOF
7655 #line 7655 "configure"
7656 #include "confdefs.h"
7657 #include <stdio.h>
7658 int
7659 main ()
7660 {
7661 printf("Hello")
7662   ;
7663   return 0;
7664 }
7665 _ACEOF
7666 rm -f conftest.$ac_objext
7667 if { (eval echo "$as_me:7667: \"$ac_compile\"") >&5
7668   (eval $ac_compile) 2>&5
7669   ac_status=$?
7670   echo "$as_me:7670: \$? = $ac_status" >&5
7671   (exit $ac_status); } &&
7672          { ac_try='test -s conftest.$ac_objext'
7673   { (eval echo "$as_me:7673: \"$ac_try\"") >&5
7674   (eval $ac_try) 2>&5
7675   ac_status=$?
7676   echo "$as_me:7676: \$? = $ac_status" >&5
7677   (exit $ac_status); }; }; then
7678   :
7679 else
7680   echo "$as_me: failed program was:" >&5
7681 cat conftest.$ac_ext >&5
7682 cf_have_incdir=yes
7683 fi
7684 rm -f conftest.$ac_objext conftest.$ac_ext
7685                           CPPFLAGS=$cf_save_CPPFLAGS
7686                         fi
7687                   fi
7688                 fi
7689
7690                 if test "$cf_have_incdir" = no ; then
7691                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
7692
7693 echo "${as_me:-configure}:7693: testing adding $cf_add_incdir to include-path ..." 1>&5
7694
7695                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
7696
7697                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
7698                   test "$cf_top_incdir" = "$cf_add_incdir" && break
7699                   cf_add_incdir="$cf_top_incdir"
7700                 else
7701                   break
7702                 fi
7703           fi
7704         done
7705   done
7706 fi
7707
7708 }
7709
7710 echo "$as_me:7710: checking for $cf_ncuhdr_root header in include-path" >&5
7711 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
7712 if test "${cf_cv_ncurses_h+set}" = set; then
7713   echo $ECHO_N "(cached) $ECHO_C" >&6
7714 else
7715
7716         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
7717         ( test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw ) && cf_header_list="$cf_header_list curses.h ncurses.h"
7718         for cf_header in $cf_header_list
7719         do
7720
7721         cat >conftest.$ac_ext <<_ACEOF
7722 #line 7722 "configure"
7723 #include "confdefs.h"
7724
7725 #include <$cf_header>
7726 int
7727 main ()
7728 {
7729
7730 #ifdef NCURSES_VERSION
7731
7732 printf("%s\n", NCURSES_VERSION);
7733 #else
7734 #ifdef __NCURSES_H
7735 printf("old\n");
7736 #else
7737         make an error
7738 #endif
7739 #endif
7740
7741   ;
7742   return 0;
7743 }
7744 _ACEOF
7745 rm -f conftest.$ac_objext
7746 if { (eval echo "$as_me:7746: \"$ac_compile\"") >&5
7747   (eval $ac_compile) 2>&5
7748   ac_status=$?
7749   echo "$as_me:7749: \$? = $ac_status" >&5
7750   (exit $ac_status); } &&
7751          { ac_try='test -s conftest.$ac_objext'
7752   { (eval echo "$as_me:7752: \"$ac_try\"") >&5
7753   (eval $ac_try) 2>&5
7754   ac_status=$?
7755   echo "$as_me:7755: \$? = $ac_status" >&5
7756   (exit $ac_status); }; }; then
7757   cf_cv_ncurses_h=$cf_header
7758
7759 else
7760   echo "$as_me: failed program was:" >&5
7761 cat conftest.$ac_ext >&5
7762 cf_cv_ncurses_h=no
7763 fi
7764 rm -f conftest.$ac_objext conftest.$ac_ext
7765
7766                 test "$cf_cv_ncurses_h" != no && break
7767         done
7768
7769 fi
7770 echo "$as_me:7770: result: $cf_cv_ncurses_h" >&5
7771 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
7772
7773 if test "$cf_cv_ncurses_h" != no ; then
7774         cf_cv_ncurses_header=$cf_cv_ncurses_h
7775 else
7776
7777 echo "$as_me:7777: checking for $cf_ncuhdr_root include-path" >&5
7778 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
7779 if test "${cf_cv_ncurses_h2+set}" = set; then
7780   echo $ECHO_N "(cached) $ECHO_C" >&6
7781 else
7782
7783         test -n "$verbose" && echo
7784
7785 cf_search=
7786
7787 # collect the current set of include-directories from compiler flags
7788 cf_header_path_list=""
7789 if test -n "${CFLAGS}${CPPFLAGS}" ; then
7790         for cf_header_path in $CPPFLAGS $CFLAGS
7791         do
7792                 case $cf_header_path in
7793                 (-I*)
7794                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
7795
7796 test "x$cf_header_path" != "xNONE" && \
7797 test -d "$cf_header_path" && \
7798  {
7799         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
7800         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
7801         test -d $cf_header_path/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
7802         test -d $cf_header_path/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
7803         test -d $cf_header_path/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
7804         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"
7805 }
7806
7807                         cf_header_path_list="$cf_header_path_list $cf_search"
7808                         ;;
7809                 esac
7810         done
7811 fi
7812
7813 # add the variations for the package we are looking for
7814
7815 cf_search=
7816
7817 test "x$prefix" != "xNONE" && \
7818 test -d "$prefix" && \
7819  {
7820         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
7821         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
7822         test -d $prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
7823         test -d $prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
7824         test -d $prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
7825         test -d $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
7826 }
7827
7828 for cf_subdir_prefix in \
7829         /usr \
7830         /usr/local \
7831         /usr/pkg \
7832         /opt \
7833         /opt/local \
7834         $HOME
7835 do
7836
7837 test "x$cf_subdir_prefix" != "x$prefix" && \
7838 test -d "$cf_subdir_prefix" && \
7839 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
7840         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
7841         test -d $cf_subdir_prefix/include &&          cf_search="$cf_search $cf_subdir_prefix/include"
7842         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root"
7843         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root/include"
7844         test -d $cf_subdir_prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include"
7845         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"
7846 }
7847
7848 done
7849
7850 test "$includedir" != NONE && \
7851 test "$includedir" != "/usr/include" && \
7852 test -d "$includedir" && {
7853         test -d $includedir &&    cf_search="$cf_search $includedir"
7854         test -d $includedir/$cf_ncuhdr_root && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
7855 }
7856
7857 test "$oldincludedir" != NONE && \
7858 test "$oldincludedir" != "/usr/include" && \
7859 test -d "$oldincludedir" && {
7860         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
7861         test -d $oldincludedir/$cf_ncuhdr_root && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
7862 }
7863
7864 cf_search="$cf_search $cf_header_path_list"
7865
7866         test -n "$verbose" && echo search path $cf_search
7867         cf_save2_CPPFLAGS="$CPPFLAGS"
7868         for cf_incdir in $cf_search
7869         do
7870
7871 if test -n "$cf_incdir" ; then
7872   for cf_add_incdir in $cf_incdir
7873   do
7874         while test $cf_add_incdir != /usr/include
7875         do
7876           if test -d $cf_add_incdir
7877           then
7878                 cf_have_incdir=no
7879                 if test -n "$CFLAGS$CPPFLAGS" ; then
7880                   # a loop is needed to ensure we can add subdirs of existing dirs
7881                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
7882                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
7883                           cf_have_incdir=yes; break
7884                         fi
7885                   done
7886                 fi
7887
7888                 if test "$cf_have_incdir" = no ; then
7889                   if test "$cf_add_incdir" = /usr/local/include ; then
7890                         if test "$GCC" = yes
7891                         then
7892                           cf_save_CPPFLAGS=$CPPFLAGS
7893                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
7894                           cat >conftest.$ac_ext <<_ACEOF
7895 #line 7895 "configure"
7896 #include "confdefs.h"
7897 #include <stdio.h>
7898 int
7899 main ()
7900 {
7901 printf("Hello")
7902   ;
7903   return 0;
7904 }
7905 _ACEOF
7906 rm -f conftest.$ac_objext
7907 if { (eval echo "$as_me:7907: \"$ac_compile\"") >&5
7908   (eval $ac_compile) 2>&5
7909   ac_status=$?
7910   echo "$as_me:7910: \$? = $ac_status" >&5
7911   (exit $ac_status); } &&
7912          { ac_try='test -s conftest.$ac_objext'
7913   { (eval echo "$as_me:7913: \"$ac_try\"") >&5
7914   (eval $ac_try) 2>&5
7915   ac_status=$?
7916   echo "$as_me:7916: \$? = $ac_status" >&5
7917   (exit $ac_status); }; }; then
7918   :
7919 else
7920   echo "$as_me: failed program was:" >&5
7921 cat conftest.$ac_ext >&5
7922 cf_have_incdir=yes
7923 fi
7924 rm -f conftest.$ac_objext conftest.$ac_ext
7925                           CPPFLAGS=$cf_save_CPPFLAGS
7926                         fi
7927                   fi
7928                 fi
7929
7930                 if test "$cf_have_incdir" = no ; then
7931                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
7932
7933 echo "${as_me:-configure}:7933: testing adding $cf_add_incdir to include-path ..." 1>&5
7934
7935                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
7936
7937                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
7938                   test "$cf_top_incdir" = "$cf_add_incdir" && break
7939                   cf_add_incdir="$cf_top_incdir"
7940                 else
7941                   break
7942                 fi
7943           fi
7944         done
7945   done
7946 fi
7947
7948                 for cf_header in \
7949                         ncurses.h \
7950                         curses.h
7951                 do
7952
7953         cat >conftest.$ac_ext <<_ACEOF
7954 #line 7954 "configure"
7955 #include "confdefs.h"
7956
7957 #include <$cf_header>
7958 int
7959 main ()
7960 {
7961
7962 #ifdef NCURSES_VERSION
7963
7964 printf("%s\n", NCURSES_VERSION);
7965 #else
7966 #ifdef __NCURSES_H
7967 printf("old\n");
7968 #else
7969         make an error
7970 #endif
7971 #endif
7972
7973   ;
7974   return 0;
7975 }
7976 _ACEOF
7977 rm -f conftest.$ac_objext
7978 if { (eval echo "$as_me:7978: \"$ac_compile\"") >&5
7979   (eval $ac_compile) 2>&5
7980   ac_status=$?
7981   echo "$as_me:7981: \$? = $ac_status" >&5
7982   (exit $ac_status); } &&
7983          { ac_try='test -s conftest.$ac_objext'
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_cv_ncurses_h2=$cf_header
7990
7991 else
7992   echo "$as_me: failed program was:" >&5
7993 cat conftest.$ac_ext >&5
7994 cf_cv_ncurses_h2=no
7995 fi
7996 rm -f conftest.$ac_objext conftest.$ac_ext
7997
7998                         if test "$cf_cv_ncurses_h2" != no ; then
7999                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
8000                                 test -n "$verbose" && echo $ac_n "      ... found $ac_c" 1>&6
8001                                 break
8002                         fi
8003                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
8004                 done
8005                 CPPFLAGS="$cf_save2_CPPFLAGS"
8006                 test "$cf_cv_ncurses_h2" != no && break
8007         done
8008         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:8008: error: not found" >&5
8009 echo "$as_me: error: not found" >&2;}
8010    { (exit 1); exit 1; }; }
8011
8012 fi
8013 echo "$as_me:8013: result: $cf_cv_ncurses_h2" >&5
8014 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
8015
8016         cf_1st_incdir=`echo $cf_cv_ncurses_h2 | sed -e 's%/[^/]*$%%'`
8017         cf_cv_ncurses_header=`basename $cf_cv_ncurses_h2`
8018         if test `basename $cf_1st_incdir` = $cf_ncuhdr_root ; then
8019                 cf_cv_ncurses_header=$cf_ncuhdr_root/$cf_cv_ncurses_header
8020         fi
8021
8022 if test -n "$cf_1st_incdir" ; then
8023   for cf_add_incdir in $cf_1st_incdir
8024   do
8025         while test $cf_add_incdir != /usr/include
8026         do
8027           if test -d $cf_add_incdir
8028           then
8029                 cf_have_incdir=no
8030                 if test -n "$CFLAGS$CPPFLAGS" ; then
8031                   # a loop is needed to ensure we can add subdirs of existing dirs
8032                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
8033                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
8034                           cf_have_incdir=yes; break
8035                         fi
8036                   done
8037                 fi
8038
8039                 if test "$cf_have_incdir" = no ; then
8040                   if test "$cf_add_incdir" = /usr/local/include ; then
8041                         if test "$GCC" = yes
8042                         then
8043                           cf_save_CPPFLAGS=$CPPFLAGS
8044                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8045                           cat >conftest.$ac_ext <<_ACEOF
8046 #line 8046 "configure"
8047 #include "confdefs.h"
8048 #include <stdio.h>
8049 int
8050 main ()
8051 {
8052 printf("Hello")
8053   ;
8054   return 0;
8055 }
8056 _ACEOF
8057 rm -f conftest.$ac_objext
8058 if { (eval echo "$as_me:8058: \"$ac_compile\"") >&5
8059   (eval $ac_compile) 2>&5
8060   ac_status=$?
8061   echo "$as_me:8061: \$? = $ac_status" >&5
8062   (exit $ac_status); } &&
8063          { ac_try='test -s conftest.$ac_objext'
8064   { (eval echo "$as_me:8064: \"$ac_try\"") >&5
8065   (eval $ac_try) 2>&5
8066   ac_status=$?
8067   echo "$as_me:8067: \$? = $ac_status" >&5
8068   (exit $ac_status); }; }; then
8069   :
8070 else
8071   echo "$as_me: failed program was:" >&5
8072 cat conftest.$ac_ext >&5
8073 cf_have_incdir=yes
8074 fi
8075 rm -f conftest.$ac_objext conftest.$ac_ext
8076                           CPPFLAGS=$cf_save_CPPFLAGS
8077                         fi
8078                   fi
8079                 fi
8080
8081                 if test "$cf_have_incdir" = no ; then
8082                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
8083
8084 echo "${as_me:-configure}:8084: testing adding $cf_add_incdir to include-path ..." 1>&5
8085
8086                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8087
8088                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
8089                   test "$cf_top_incdir" = "$cf_add_incdir" && break
8090                   cf_add_incdir="$cf_top_incdir"
8091                 else
8092                   break
8093                 fi
8094           fi
8095         done
8096   done
8097 fi
8098
8099 fi
8100
8101 # Set definitions to allow ifdef'ing for ncurses.h
8102
8103 case $cf_cv_ncurses_header in
8104 (*ncurses.h)
8105
8106 cat >>confdefs.h <<\EOF
8107 #define HAVE_NCURSES_H 1
8108 EOF
8109
8110         ;;
8111 esac
8112
8113 case $cf_cv_ncurses_header in
8114 (ncurses/curses.h|ncurses/ncurses.h)
8115
8116 cat >>confdefs.h <<\EOF
8117 #define HAVE_NCURSES_NCURSES_H 1
8118 EOF
8119
8120         ;;
8121 (ncursesw/curses.h|ncursesw/ncurses.h)
8122
8123 cat >>confdefs.h <<\EOF
8124 #define HAVE_NCURSESW_NCURSES_H 1
8125 EOF
8126
8127         ;;
8128 esac
8129
8130 echo "$as_me:8130: checking for terminfo header" >&5
8131 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
8132 if test "${cf_cv_term_header+set}" = set; then
8133   echo $ECHO_N "(cached) $ECHO_C" >&6
8134 else
8135
8136 case ${cf_cv_ncurses_header} in
8137 (*/ncurses.h|*/ncursesw.h)
8138         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
8139         ;;
8140 (*)
8141         cf_term_header=term.h
8142         ;;
8143 esac
8144
8145 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
8146 do
8147 cat >conftest.$ac_ext <<_ACEOF
8148 #line 8148 "configure"
8149 #include "confdefs.h"
8150 #include <stdio.h>
8151 #include <${cf_cv_ncurses_header:-curses.h}>
8152 #include <$cf_test>
8153
8154 int
8155 main ()
8156 {
8157 int x = auto_left_margin
8158   ;
8159   return 0;
8160 }
8161 _ACEOF
8162 rm -f conftest.$ac_objext
8163 if { (eval echo "$as_me:8163: \"$ac_compile\"") >&5
8164   (eval $ac_compile) 2>&5
8165   ac_status=$?
8166   echo "$as_me:8166: \$? = $ac_status" >&5
8167   (exit $ac_status); } &&
8168          { ac_try='test -s conftest.$ac_objext'
8169   { (eval echo "$as_me:8169: \"$ac_try\"") >&5
8170   (eval $ac_try) 2>&5
8171   ac_status=$?
8172   echo "$as_me:8172: \$? = $ac_status" >&5
8173   (exit $ac_status); }; }; then
8174
8175         cf_cv_term_header="$cf_test"
8176 else
8177   echo "$as_me: failed program was:" >&5
8178 cat conftest.$ac_ext >&5
8179
8180         cf_cv_term_header=unknown
8181
8182 fi
8183 rm -f conftest.$ac_objext conftest.$ac_ext
8184         test "$cf_cv_term_header" != unknown && break
8185 done
8186
8187 fi
8188 echo "$as_me:8188: result: $cf_cv_term_header" >&5
8189 echo "${ECHO_T}$cf_cv_term_header" >&6
8190
8191 # Set definitions to allow ifdef'ing to accommodate subdirectories
8192
8193 case $cf_cv_term_header in
8194 (*term.h)
8195
8196 cat >>confdefs.h <<\EOF
8197 #define HAVE_TERM_H 1
8198 EOF
8199
8200         ;;
8201 esac
8202
8203 case $cf_cv_term_header in
8204 (ncurses/term.h)
8205
8206 cat >>confdefs.h <<\EOF
8207 #define HAVE_NCURSES_TERM_H 1
8208 EOF
8209
8210         ;;
8211 (ncursesw/term.h)
8212
8213 cat >>confdefs.h <<\EOF
8214 #define HAVE_NCURSESW_TERM_H 1
8215 EOF
8216
8217         ;;
8218 esac
8219
8220 # some applications need this, but should check for NCURSES_VERSION
8221
8222 cat >>confdefs.h <<\EOF
8223 #define NCURSES 1
8224 EOF
8225
8226 echo "$as_me:8226: checking for ncurses version" >&5
8227 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
8228 if test "${cf_cv_ncurses_version+set}" = set; then
8229   echo $ECHO_N "(cached) $ECHO_C" >&6
8230 else
8231
8232         cf_cv_ncurses_version=no
8233         cf_tempfile=out$$
8234         rm -f $cf_tempfile
8235         if test "$cross_compiling" = yes; then
8236
8237         # This will not work if the preprocessor splits the line after the
8238         # Autoconf token.  The 'unproto' program does that.
8239         cat > conftest.$ac_ext <<EOF
8240 #include <${cf_cv_ncurses_header:-curses.h}>
8241 #undef Autoconf
8242 #ifdef NCURSES_VERSION
8243 Autoconf NCURSES_VERSION
8244 #else
8245 #ifdef __NCURSES_H
8246 Autoconf "old"
8247 #endif
8248 ;
8249 #endif
8250 EOF
8251         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
8252         { (eval echo "$as_me:8252: \"$cf_try\"") >&5
8253   (eval $cf_try) 2>&5
8254   ac_status=$?
8255   echo "$as_me:8255: \$? = $ac_status" >&5
8256   (exit $ac_status); }
8257         if test -f conftest.out ; then
8258                 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
8259                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
8260                 rm -f conftest.out
8261         fi
8262
8263 else
8264   cat >conftest.$ac_ext <<_ACEOF
8265 #line 8265 "configure"
8266 #include "confdefs.h"
8267
8268 #include <${cf_cv_ncurses_header:-curses.h}>
8269 #include <stdio.h>
8270 int main()
8271 {
8272         FILE *fp = fopen("$cf_tempfile", "w");
8273 #ifdef NCURSES_VERSION
8274 # ifdef NCURSES_VERSION_PATCH
8275         fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
8276 # else
8277         fprintf(fp, "%s\n", NCURSES_VERSION);
8278 # endif
8279 #else
8280 # ifdef __NCURSES_H
8281         fprintf(fp, "old\n");
8282 # else
8283         make an error
8284 # endif
8285 #endif
8286         ${cf_cv_main_return:-return}(0);
8287 }
8288 _ACEOF
8289 rm -f conftest$ac_exeext
8290 if { (eval echo "$as_me:8290: \"$ac_link\"") >&5
8291   (eval $ac_link) 2>&5
8292   ac_status=$?
8293   echo "$as_me:8293: \$? = $ac_status" >&5
8294   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
8295   { (eval echo "$as_me:8295: \"$ac_try\"") >&5
8296   (eval $ac_try) 2>&5
8297   ac_status=$?
8298   echo "$as_me:8298: \$? = $ac_status" >&5
8299   (exit $ac_status); }; }; then
8300
8301         cf_cv_ncurses_version=`cat $cf_tempfile`
8302 else
8303   echo "$as_me: program exited with status $ac_status" >&5
8304 echo "$as_me: failed program was:" >&5
8305 cat conftest.$ac_ext >&5
8306 fi
8307 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
8308 fi
8309         rm -f $cf_tempfile
8310
8311 fi
8312 echo "$as_me:8312: result: $cf_cv_ncurses_version" >&5
8313 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
8314 test "$cf_cv_ncurses_version" = no ||
8315 cat >>confdefs.h <<\EOF
8316 #define NCURSES 1
8317 EOF
8318
8319 cf_nculib_root=ncurses
8320         # This works, except for the special case where we find gpm, but
8321         # ncurses is in a nonstandard location via $LIBS, and we really want
8322         # to link gpm.
8323 cf_ncurses_LIBS=""
8324 cf_ncurses_SAVE="$LIBS"
8325 echo "$as_me:8325: checking for Gpm_Open in -lgpm" >&5
8326 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
8327 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
8328   echo $ECHO_N "(cached) $ECHO_C" >&6
8329 else
8330   ac_check_lib_save_LIBS=$LIBS
8331 LIBS="-lgpm  $LIBS"
8332 cat >conftest.$ac_ext <<_ACEOF
8333 #line 8333 "configure"
8334 #include "confdefs.h"
8335
8336 /* Override any gcc2 internal prototype to avoid an error.  */
8337 #ifdef __cplusplus
8338 extern "C"
8339 #endif
8340 /* We use char because int might match the return type of a gcc2
8341    builtin and then its argument prototype would still apply.  */
8342 char Gpm_Open ();
8343 int
8344 main ()
8345 {
8346 Gpm_Open ();
8347   ;
8348   return 0;
8349 }
8350 _ACEOF
8351 rm -f conftest.$ac_objext conftest$ac_exeext
8352 if { (eval echo "$as_me:8352: \"$ac_link\"") >&5
8353   (eval $ac_link) 2>&5
8354   ac_status=$?
8355   echo "$as_me:8355: \$? = $ac_status" >&5
8356   (exit $ac_status); } &&
8357          { ac_try='test -s conftest$ac_exeext'
8358   { (eval echo "$as_me:8358: \"$ac_try\"") >&5
8359   (eval $ac_try) 2>&5
8360   ac_status=$?
8361   echo "$as_me:8361: \$? = $ac_status" >&5
8362   (exit $ac_status); }; }; then
8363   ac_cv_lib_gpm_Gpm_Open=yes
8364 else
8365   echo "$as_me: failed program was:" >&5
8366 cat conftest.$ac_ext >&5
8367 ac_cv_lib_gpm_Gpm_Open=no
8368 fi
8369 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8370 LIBS=$ac_check_lib_save_LIBS
8371 fi
8372 echo "$as_me:8372: result: $ac_cv_lib_gpm_Gpm_Open" >&5
8373 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
8374 if test $ac_cv_lib_gpm_Gpm_Open = yes; then
8375   echo "$as_me:8375: checking for initscr in -lgpm" >&5
8376 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
8377 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
8378   echo $ECHO_N "(cached) $ECHO_C" >&6
8379 else
8380   ac_check_lib_save_LIBS=$LIBS
8381 LIBS="-lgpm  $LIBS"
8382 cat >conftest.$ac_ext <<_ACEOF
8383 #line 8383 "configure"
8384 #include "confdefs.h"
8385
8386 /* Override any gcc2 internal prototype to avoid an error.  */
8387 #ifdef __cplusplus
8388 extern "C"
8389 #endif
8390 /* We use char because int might match the return type of a gcc2
8391    builtin and then its argument prototype would still apply.  */
8392 char initscr ();
8393 int
8394 main ()
8395 {
8396 initscr ();
8397   ;
8398   return 0;
8399 }
8400 _ACEOF
8401 rm -f conftest.$ac_objext conftest$ac_exeext
8402 if { (eval echo "$as_me:8402: \"$ac_link\"") >&5
8403   (eval $ac_link) 2>&5
8404   ac_status=$?
8405   echo "$as_me:8405: \$? = $ac_status" >&5
8406   (exit $ac_status); } &&
8407          { ac_try='test -s conftest$ac_exeext'
8408   { (eval echo "$as_me:8408: \"$ac_try\"") >&5
8409   (eval $ac_try) 2>&5
8410   ac_status=$?
8411   echo "$as_me:8411: \$? = $ac_status" >&5
8412   (exit $ac_status); }; }; then
8413   ac_cv_lib_gpm_initscr=yes
8414 else
8415   echo "$as_me: failed program was:" >&5
8416 cat conftest.$ac_ext >&5
8417 ac_cv_lib_gpm_initscr=no
8418 fi
8419 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8420 LIBS=$ac_check_lib_save_LIBS
8421 fi
8422 echo "$as_me:8422: result: $ac_cv_lib_gpm_initscr" >&5
8423 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
8424 if test $ac_cv_lib_gpm_initscr = yes; then
8425   LIBS="$cf_ncurses_SAVE"
8426 else
8427   cf_ncurses_LIBS="-lgpm"
8428 fi
8429
8430 fi
8431
8432 case $host_os in
8433 (freebsd*)
8434         # This is only necessary if you are linking against an obsolete
8435         # version of ncurses (but it should do no harm, since it's static).
8436         if test "$cf_nculib_root" = ncurses ; then
8437                 echo "$as_me:8437: checking for tgoto in -lmytinfo" >&5
8438 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
8439 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
8440   echo $ECHO_N "(cached) $ECHO_C" >&6
8441 else
8442   ac_check_lib_save_LIBS=$LIBS
8443 LIBS="-lmytinfo  $LIBS"
8444 cat >conftest.$ac_ext <<_ACEOF
8445 #line 8445 "configure"
8446 #include "confdefs.h"
8447
8448 /* Override any gcc2 internal prototype to avoid an error.  */
8449 #ifdef __cplusplus
8450 extern "C"
8451 #endif
8452 /* We use char because int might match the return type of a gcc2
8453    builtin and then its argument prototype would still apply.  */
8454 char tgoto ();
8455 int
8456 main ()
8457 {
8458 tgoto ();
8459   ;
8460   return 0;
8461 }
8462 _ACEOF
8463 rm -f conftest.$ac_objext conftest$ac_exeext
8464 if { (eval echo "$as_me:8464: \"$ac_link\"") >&5
8465   (eval $ac_link) 2>&5
8466   ac_status=$?
8467   echo "$as_me:8467: \$? = $ac_status" >&5
8468   (exit $ac_status); } &&
8469          { ac_try='test -s conftest$ac_exeext'
8470   { (eval echo "$as_me:8470: \"$ac_try\"") >&5
8471   (eval $ac_try) 2>&5
8472   ac_status=$?
8473   echo "$as_me:8473: \$? = $ac_status" >&5
8474   (exit $ac_status); }; }; then
8475   ac_cv_lib_mytinfo_tgoto=yes
8476 else
8477   echo "$as_me: failed program was:" >&5
8478 cat conftest.$ac_ext >&5
8479 ac_cv_lib_mytinfo_tgoto=no
8480 fi
8481 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8482 LIBS=$ac_check_lib_save_LIBS
8483 fi
8484 echo "$as_me:8484: result: $ac_cv_lib_mytinfo_tgoto" >&5
8485 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
8486 if test $ac_cv_lib_mytinfo_tgoto = yes; then
8487   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
8488 fi
8489
8490         fi
8491         ;;
8492 esac
8493
8494 cf_add_libs="$cf_ncurses_LIBS"
8495 # Filter out duplicates - this happens with badly-designed ".pc" files...
8496 for cf_add_1lib in $LIBS
8497 do
8498         for cf_add_2lib in $cf_add_libs
8499         do
8500                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
8501                 then
8502                         cf_add_1lib=
8503                         break
8504                 fi
8505         done
8506         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
8507 done
8508 LIBS="$cf_add_libs"
8509
8510 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
8511 then
8512
8513 cf_add_libs="-l$cf_nculib_root"
8514 # Filter out duplicates - this happens with badly-designed ".pc" files...
8515 for cf_add_1lib in $LIBS
8516 do
8517         for cf_add_2lib in $cf_add_libs
8518         do
8519                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
8520                 then
8521                         cf_add_1lib=
8522                         break
8523                 fi
8524         done
8525         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
8526 done
8527 LIBS="$cf_add_libs"
8528
8529 else
8530
8531         eval 'cf_cv_have_lib_'$cf_nculib_root'=no'
8532         cf_libdir=""
8533         echo "$as_me:8533: checking for initscr" >&5
8534 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
8535 if test "${ac_cv_func_initscr+set}" = set; then
8536   echo $ECHO_N "(cached) $ECHO_C" >&6
8537 else
8538   cat >conftest.$ac_ext <<_ACEOF
8539 #line 8539 "configure"
8540 #include "confdefs.h"
8541 /* System header to define __stub macros and hopefully few prototypes,
8542     which can conflict with char initscr (); below.  */
8543 #include <assert.h>
8544 /* Override any gcc2 internal prototype to avoid an error.  */
8545 #ifdef __cplusplus
8546 extern "C"
8547 #endif
8548 /* We use char because int might match the return type of a gcc2
8549    builtin and then its argument prototype would still apply.  */
8550 char initscr ();
8551 char (*f) ();
8552
8553 int
8554 main ()
8555 {
8556 /* The GNU C library defines this for functions which it implements
8557     to always fail with ENOSYS.  Some functions are actually named
8558     something starting with __ and the normal name is an alias.  */
8559 #if defined (__stub_initscr) || defined (__stub___initscr)
8560 choke me
8561 #else
8562 f = initscr; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
8563 #endif
8564
8565   ;
8566   return 0;
8567 }
8568 _ACEOF
8569 rm -f conftest.$ac_objext conftest$ac_exeext
8570 if { (eval echo "$as_me:8570: \"$ac_link\"") >&5
8571   (eval $ac_link) 2>&5
8572   ac_status=$?
8573   echo "$as_me:8573: \$? = $ac_status" >&5
8574   (exit $ac_status); } &&
8575          { ac_try='test -s conftest$ac_exeext'
8576   { (eval echo "$as_me:8576: \"$ac_try\"") >&5
8577   (eval $ac_try) 2>&5
8578   ac_status=$?
8579   echo "$as_me:8579: \$? = $ac_status" >&5
8580   (exit $ac_status); }; }; then
8581   ac_cv_func_initscr=yes
8582 else
8583   echo "$as_me: failed program was:" >&5
8584 cat conftest.$ac_ext >&5
8585 ac_cv_func_initscr=no
8586 fi
8587 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8588 fi
8589 echo "$as_me:8589: result: $ac_cv_func_initscr" >&5
8590 echo "${ECHO_T}$ac_cv_func_initscr" >&6
8591 if test $ac_cv_func_initscr = yes; then
8592   eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
8593 else
8594
8595                 cf_save_LIBS="$LIBS"
8596                 echo "$as_me:8596: checking for initscr in -l$cf_nculib_root" >&5
8597 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
8598                 LIBS="-l$cf_nculib_root $LIBS"
8599                 cat >conftest.$ac_ext <<_ACEOF
8600 #line 8600 "configure"
8601 #include "confdefs.h"
8602 #include <${cf_cv_ncurses_header:-curses.h}>
8603 int
8604 main ()
8605 {
8606 initscr()
8607   ;
8608   return 0;
8609 }
8610 _ACEOF
8611 rm -f conftest.$ac_objext conftest$ac_exeext
8612 if { (eval echo "$as_me:8612: \"$ac_link\"") >&5
8613   (eval $ac_link) 2>&5
8614   ac_status=$?
8615   echo "$as_me:8615: \$? = $ac_status" >&5
8616   (exit $ac_status); } &&
8617          { ac_try='test -s conftest$ac_exeext'
8618   { (eval echo "$as_me:8618: \"$ac_try\"") >&5
8619   (eval $ac_try) 2>&5
8620   ac_status=$?
8621   echo "$as_me:8621: \$? = $ac_status" >&5
8622   (exit $ac_status); }; }; then
8623   echo "$as_me:8623: result: yes" >&5
8624 echo "${ECHO_T}yes" >&6
8625                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
8626
8627 else
8628   echo "$as_me: failed program was:" >&5
8629 cat conftest.$ac_ext >&5
8630 echo "$as_me:8630: result: no" >&5
8631 echo "${ECHO_T}no" >&6
8632
8633 cf_search=
8634 cf_library_path_list=""
8635 if test -n "${LDFLAGS}${LIBS}" ; then
8636         for cf_library_path in $LDFLAGS $LIBS
8637         do
8638                 case $cf_library_path in
8639                 (-L*)
8640                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
8641
8642 test "x$cf_library_path" != "xNONE" && \
8643 test -d "$cf_library_path" && \
8644  {
8645         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
8646         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
8647         test -d $cf_library_path/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
8648         test -d $cf_library_path/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
8649         test -d $cf_library_path/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
8650         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"
8651 }
8652
8653                         cf_library_path_list="$cf_library_path_list $cf_search"
8654                         ;;
8655                 esac
8656         done
8657 fi
8658
8659 cf_search=
8660
8661 test "x$prefix" != "xNONE" && \
8662 test -d "$prefix" && \
8663  {
8664         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
8665         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
8666         test -d $prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
8667         test -d $prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
8668         test -d $prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
8669         test -d $prefix/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
8670 }
8671
8672 for cf_subdir_prefix in \
8673         /usr \
8674         /usr/local \
8675         /usr/pkg \
8676         /opt \
8677         /opt/local \
8678         $HOME
8679 do
8680
8681 test "x$cf_subdir_prefix" != "x$prefix" && \
8682 test -d "$cf_subdir_prefix" && \
8683 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
8684         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
8685         test -d $cf_subdir_prefix/lib &&          cf_search="$cf_search $cf_subdir_prefix/lib"
8686         test -d $cf_subdir_prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root"
8687         test -d $cf_subdir_prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root/lib"
8688         test -d $cf_subdir_prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib"
8689         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"
8690 }
8691
8692 done
8693
8694 cf_search="$cf_library_path_list $cf_search"
8695
8696                         for cf_libdir in $cf_search
8697                         do
8698                                 echo "$as_me:8698: checking for -l$cf_nculib_root in $cf_libdir" >&5
8699 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
8700                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
8701                                 cat >conftest.$ac_ext <<_ACEOF
8702 #line 8702 "configure"
8703 #include "confdefs.h"
8704 #include <${cf_cv_ncurses_header:-curses.h}>
8705 int
8706 main ()
8707 {
8708 initscr()
8709   ;
8710   return 0;
8711 }
8712 _ACEOF
8713 rm -f conftest.$ac_objext conftest$ac_exeext
8714 if { (eval echo "$as_me:8714: \"$ac_link\"") >&5
8715   (eval $ac_link) 2>&5
8716   ac_status=$?
8717   echo "$as_me:8717: \$? = $ac_status" >&5
8718   (exit $ac_status); } &&
8719          { ac_try='test -s conftest$ac_exeext'
8720   { (eval echo "$as_me:8720: \"$ac_try\"") >&5
8721   (eval $ac_try) 2>&5
8722   ac_status=$?
8723   echo "$as_me:8723: \$? = $ac_status" >&5
8724   (exit $ac_status); }; }; then
8725   echo "$as_me:8725: result: yes" >&5
8726 echo "${ECHO_T}yes" >&6
8727                                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
8728                                          break
8729 else
8730   echo "$as_me: failed program was:" >&5
8731 cat conftest.$ac_ext >&5
8732 echo "$as_me:8732: result: no" >&5
8733 echo "${ECHO_T}no" >&6
8734                                          LIBS="$cf_save_LIBS"
8735 fi
8736 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8737                         done
8738
8739 fi
8740 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8741
8742 fi
8743
8744 eval 'cf_found_library=$cf_cv_have_lib_'$cf_nculib_root
8745
8746 if test $cf_found_library = no ; then
8747         { { echo "$as_me:8747: error: Cannot link $cf_nculib_root library" >&5
8748 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
8749    { (exit 1); exit 1; }; }
8750 fi
8751
8752 fi
8753
8754 if test -n "$cf_ncurses_LIBS" ; then
8755         echo "$as_me:8755: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
8756 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
8757         cf_ncurses_SAVE="$LIBS"
8758         for p in $cf_ncurses_LIBS ; do
8759                 q=`echo $LIBS | sed -e "s%$p %%" -e "s%$p$%%"`
8760                 if test "$q" != "$LIBS" ; then
8761                         LIBS="$q"
8762                 fi
8763         done
8764         cat >conftest.$ac_ext <<_ACEOF
8765 #line 8765 "configure"
8766 #include "confdefs.h"
8767 #include <${cf_cv_ncurses_header:-curses.h}>
8768 int
8769 main ()
8770 {
8771 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
8772   ;
8773   return 0;
8774 }
8775 _ACEOF
8776 rm -f conftest.$ac_objext conftest$ac_exeext
8777 if { (eval echo "$as_me:8777: \"$ac_link\"") >&5
8778   (eval $ac_link) 2>&5
8779   ac_status=$?
8780   echo "$as_me:8780: \$? = $ac_status" >&5
8781   (exit $ac_status); } &&
8782          { ac_try='test -s conftest$ac_exeext'
8783   { (eval echo "$as_me:8783: \"$ac_try\"") >&5
8784   (eval $ac_try) 2>&5
8785   ac_status=$?
8786   echo "$as_me:8786: \$? = $ac_status" >&5
8787   (exit $ac_status); }; }; then
8788   echo "$as_me:8788: result: yes" >&5
8789 echo "${ECHO_T}yes" >&6
8790 else
8791   echo "$as_me: failed program was:" >&5
8792 cat conftest.$ac_ext >&5
8793 echo "$as_me:8793: result: no" >&5
8794 echo "${ECHO_T}no" >&6
8795                  LIBS="$cf_ncurses_SAVE"
8796 fi
8797 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8798 fi
8799
8800 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
8801
8802 cat >>confdefs.h <<EOF
8803 #define $cf_nculib_ROOT 1
8804 EOF
8805
8806         fi
8807 else
8808         NCURSES_CONFIG=none
8809 fi
8810
8811 fi
8812
8813 if test "$NCURSES_CONFIG_PKG" != none ; then
8814         cf_version=`$PKG_CONFIG --modversion $NCURSES_CONFIG_PKG 2>/dev/null`
8815
8816         NCURSES_MAJOR=`echo "$cf_version" | sed -e 's/\..*//'`
8817         NCURSES_MINOR=`echo "$cf_version" | sed -e 's/^[0-9][0-9]*\.//' -e 's/\..*//'`
8818         NCURSES_PATCH=`echo "$cf_version" | sed -e 's/^[0-9][0-9]*\.[0-9][0-9]*\.//'`
8819
8820         cf_cv_abi_version=`$PKG_CONFIG --variable=abi_version $NCURSES_CONFIG_PKG 2>/dev/null`
8821         if test -z "$cf_cv_abi_version"
8822         then
8823                 cf_cv_abi_version=`$PKG_CONFIG --variable=major_version $NCURSES_CONFIG_PKG 2>/dev/null`
8824         fi
8825
8826 elif test "$NCURSES_CONFIG" != none ; then
8827
8828         cf_version=`$NCURSES_CONFIG --version 2>/dev/null`
8829
8830         NCURSES_MAJOR=`echo "$cf_version" | sed -e 's/\..*//'`
8831         NCURSES_MINOR=`echo "$cf_version" | sed -e 's/^[0-9][0-9]*\.//' -e 's/\..*//'`
8832         NCURSES_PATCH=`echo "$cf_version" | sed -e 's/^[0-9][0-9]*\.[0-9][0-9]*\.//'`
8833
8834         # ABI version is not available from headers
8835         cf_cv_abi_version=`$NCURSES_CONFIG --abi-version 2>/dev/null`
8836
8837 else
8838
8839         for cf_name in MAJOR MINOR PATCH
8840         do
8841         cat >conftest.$ac_ext <<CF_EOF
8842         #include <${cf_cv_ncurses_header:-curses.h}>
8843         AUTOCONF_$cf_name NCURSES_VERSION_$cf_name
8844 CF_EOF
8845                 cf_try="$ac_cpp conftest.$ac_ext 2>&5 | fgrep AUTOCONF_$cf_name >conftest.out"
8846                 { (eval echo "$as_me:8846: \"$cf_try\"") >&5
8847   (eval $cf_try) 2>&5
8848   ac_status=$?
8849   echo "$as_me:8849: \$? = $ac_status" >&5
8850   (exit $ac_status); }
8851                 if test -f conftest.out ; then
8852                         cf_result=`cat conftest.out | sed -e "s/^.*AUTOCONF_$cf_name[   ][      ]*//"`
8853                         eval NCURSES_$cf_name=\"$cf_result\"
8854                         # cat conftest.$ac_ext
8855                         # cat conftest.out
8856                 fi
8857         done
8858
8859         cf_cv_abi_version=${NCURSES_MAJOR}
8860
8861 fi
8862
8863 cf_cv_rel_version=${NCURSES_MAJOR}.${NCURSES_MINOR}
8864
8865 cf_cv_timestamp=`date`
8866
8867 echo "$as_me:8867: result: Configuring NCURSES $cf_cv_rel_version ABI $cf_cv_abi_version ($cf_cv_timestamp)" >&5
8868 echo "${ECHO_T}Configuring NCURSES $cf_cv_rel_version ABI $cf_cv_abi_version ($cf_cv_timestamp)" >&6
8869
8870 echo "$as_me:8870: checking if you want to have a library-prefix" >&5
8871 echo $ECHO_N "checking if you want to have a library-prefix... $ECHO_C" >&6
8872
8873 # Check whether --with-lib-prefix or --without-lib-prefix was given.
8874 if test "${with_lib_prefix+set}" = set; then
8875   withval="$with_lib_prefix"
8876   with_lib_prefix=$withval
8877 else
8878   with_lib_prefix=auto
8879 fi;
8880 echo "$as_me:8880: result: $with_lib_prefix" >&5
8881 echo "${ECHO_T}$with_lib_prefix" >&6
8882
8883 if test $with_lib_prefix = auto
8884 then
8885
8886         case $cf_cv_system_name in
8887         (OS/2*|os2*)
8888                 LIB_PREFIX=''
8889                 ;;
8890         (*)     LIB_PREFIX='lib'
8891                 ;;
8892         esac
8893 cf_prefix=$LIB_PREFIX
8894
8895 elif test $with_lib_prefix = no
8896 then
8897         LIB_PREFIX=
8898 else
8899         LIB_PREFIX=$with_lib_prefix
8900 fi
8901
8902 LIB_SUFFIX=
8903
8904 ###############################################################################
8905
8906 if test X"$CC_G_OPT" = X"" ; then
8907         CC_G_OPT='-g'
8908         test -n "$GCC" && test "${ac_cv_prog_cc_g}" != yes && CC_G_OPT=''
8909 fi
8910
8911 echo "$as_me:8911: checking for default loader flags" >&5
8912 echo $ECHO_N "checking for default loader flags... $ECHO_C" >&6
8913 case $DFT_LWR_MODEL in
8914 (normal)  LD_MODEL=''   ;;
8915 (debug)   LD_MODEL=$CC_G_OPT ;;
8916 (profile) LD_MODEL='-pg';;
8917 (shared)  LD_MODEL=''   ;;
8918 esac
8919 echo "$as_me:8919: result: $LD_MODEL" >&5
8920 echo "${ECHO_T}$LD_MODEL" >&6
8921
8922 LD_RPATH_OPT=
8923 echo "$as_me:8923: checking for an rpath option" >&5
8924 echo $ECHO_N "checking for an rpath option... $ECHO_C" >&6
8925 case $cf_cv_system_name in
8926 (irix*)
8927         if test "$GCC" = yes; then
8928                 LD_RPATH_OPT="-Wl,-rpath,"
8929         else
8930                 LD_RPATH_OPT="-rpath "
8931         fi
8932         ;;
8933 (linux*|gnu*|k*bsd*-gnu)
8934         LD_RPATH_OPT="-Wl,-rpath,"
8935         ;;
8936 (openbsd[2-9].*|mirbsd*)
8937         LD_RPATH_OPT="-Wl,-rpath,"
8938         ;;
8939 (dragonfly*|freebsd*)
8940         LD_RPATH_OPT="-rpath "
8941         ;;
8942 (netbsd*)
8943         LD_RPATH_OPT="-Wl,-rpath,"
8944         ;;
8945 (osf*|mls+*)
8946         LD_RPATH_OPT="-rpath "
8947         ;;
8948 (solaris2*)
8949         LD_RPATH_OPT="-R"
8950         ;;
8951 (*)
8952         ;;
8953 esac
8954 echo "$as_me:8954: result: $LD_RPATH_OPT" >&5
8955 echo "${ECHO_T}$LD_RPATH_OPT" >&6
8956
8957 case "x$LD_RPATH_OPT" in
8958 (x-R*)
8959         echo "$as_me:8959: checking if we need a space after rpath option" >&5
8960 echo $ECHO_N "checking if we need a space after rpath option... $ECHO_C" >&6
8961         cf_save_LIBS="$LIBS"
8962
8963 cf_add_libs="${LD_RPATH_OPT}$libdir"
8964 # Filter out duplicates - this happens with badly-designed ".pc" files...
8965 for cf_add_1lib in $LIBS
8966 do
8967         for cf_add_2lib in $cf_add_libs
8968         do
8969                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
8970                 then
8971                         cf_add_1lib=
8972                         break
8973                 fi
8974         done
8975         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
8976 done
8977 LIBS="$cf_add_libs"
8978
8979         cat >conftest.$ac_ext <<_ACEOF
8980 #line 8980 "configure"
8981 #include "confdefs.h"
8982
8983 int
8984 main ()
8985 {
8986
8987   ;
8988   return 0;
8989 }
8990 _ACEOF
8991 rm -f conftest.$ac_objext conftest$ac_exeext
8992 if { (eval echo "$as_me:8992: \"$ac_link\"") >&5
8993   (eval $ac_link) 2>&5
8994   ac_status=$?
8995   echo "$as_me:8995: \$? = $ac_status" >&5
8996   (exit $ac_status); } &&
8997          { ac_try='test -s conftest$ac_exeext'
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   cf_rpath_space=no
9004 else
9005   echo "$as_me: failed program was:" >&5
9006 cat conftest.$ac_ext >&5
9007 cf_rpath_space=yes
9008 fi
9009 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9010         LIBS="$cf_save_LIBS"
9011         echo "$as_me:9011: result: $cf_rpath_space" >&5
9012 echo "${ECHO_T}$cf_rpath_space" >&6
9013         test "$cf_rpath_space" = yes && LD_RPATH_OPT="$LD_RPATH_OPT "
9014         ;;
9015 esac
9016
9017         RM_SHARED_OPTS=
9018         LOCAL_LDFLAGS=
9019         LOCAL_LDFLAGS2=
9020         LD_SHARED_OPTS=
9021         INSTALL_LIB="-m 644"
9022         : ${rel_builddir:=.}
9023
9024         shlibdir=$libdir
9025
9026         MAKE_DLLS="#"
9027
9028         cf_cv_do_symlinks=no
9029         cf_ld_rpath_opt=
9030         test "$cf_cv_enable_rpath" = yes && cf_ld_rpath_opt="$LD_RPATH_OPT"
9031
9032         echo "$as_me:9032: checking if release/abi version should be used for shared libs" >&5
9033 echo $ECHO_N "checking if release/abi version should be used for shared libs... $ECHO_C" >&6
9034
9035 # Check whether --with-shlib-version or --without-shlib-version was given.
9036 if test "${with_shlib_version+set}" = set; then
9037   withval="$with_shlib_version"
9038   test -z "$withval" && withval=auto
9039         case $withval in
9040         (yes)
9041                 cf_cv_shlib_version=auto
9042                 ;;
9043         (rel|abi|auto|no)
9044                 cf_cv_shlib_version=$withval
9045                 ;;
9046         (*)
9047                 { { echo "$as_me:9047: error: option value must be one of: rel, abi, auto or no" >&5
9048 echo "$as_me: error: option value must be one of: rel, abi, auto or no" >&2;}
9049    { (exit 1); exit 1; }; }
9050                 ;;
9051         esac
9052
9053 else
9054   cf_cv_shlib_version=auto
9055 fi;
9056         echo "$as_me:9056: result: $cf_cv_shlib_version" >&5
9057 echo "${ECHO_T}$cf_cv_shlib_version" >&6
9058
9059         cf_cv_rm_so_locs=no
9060         cf_try_cflags=
9061
9062         # Some less-capable ports of gcc support only -fpic
9063         CC_SHARED_OPTS=
9064         if test "$GCC" = yes
9065         then
9066                 echo "$as_me:9066: checking which $CC option to use" >&5
9067 echo $ECHO_N "checking which $CC option to use... $ECHO_C" >&6
9068                 cf_save_CFLAGS="$CFLAGS"
9069                 for CC_SHARED_OPTS in -fPIC -fpic ''
9070                 do
9071                         CFLAGS="$cf_save_CFLAGS $CC_SHARED_OPTS"
9072                         cat >conftest.$ac_ext <<_ACEOF
9073 #line 9073 "configure"
9074 #include "confdefs.h"
9075 #include <stdio.h>
9076 int
9077 main ()
9078 {
9079 int x = 1
9080   ;
9081   return 0;
9082 }
9083 _ACEOF
9084 rm -f conftest.$ac_objext
9085 if { (eval echo "$as_me:9085: \"$ac_compile\"") >&5
9086   (eval $ac_compile) 2>&5
9087   ac_status=$?
9088   echo "$as_me:9088: \$? = $ac_status" >&5
9089   (exit $ac_status); } &&
9090          { ac_try='test -s conftest.$ac_objext'
9091   { (eval echo "$as_me:9091: \"$ac_try\"") >&5
9092   (eval $ac_try) 2>&5
9093   ac_status=$?
9094   echo "$as_me:9094: \$? = $ac_status" >&5
9095   (exit $ac_status); }; }; then
9096   break
9097 else
9098   echo "$as_me: failed program was:" >&5
9099 cat conftest.$ac_ext >&5
9100 fi
9101 rm -f conftest.$ac_objext conftest.$ac_ext
9102                 done
9103                 echo "$as_me:9103: result: $CC_SHARED_OPTS" >&5
9104 echo "${ECHO_T}$CC_SHARED_OPTS" >&6
9105                 CFLAGS="$cf_save_CFLAGS"
9106         fi
9107
9108         cf_cv_shlib_version_infix=no
9109
9110         case $cf_cv_system_name in
9111         (aix4.3-9*|aix[5-7]*)
9112                 if test "$GCC" = yes; then
9113                         CC_SHARED_OPTS='-Wl,-brtl'
9114                         MK_SHARED_LIB='${CC} -shared -Wl,-brtl -Wl,-blibpath:${RPATH_LIST}:/usr/lib -o $@'
9115                 else
9116                         CC_SHARED_OPTS='-brtl'
9117                         # as well as '-qpic=large -G' or perhaps "-bM:SRE -bnoentry -bexpall"
9118                         MK_SHARED_LIB='${CC} -G -Wl,-brtl -Wl,-blibpath:${RPATH_LIST}:/usr/lib -o $@'
9119                 fi
9120                 ;;
9121         (beos*)
9122                 MK_SHARED_LIB='${CC} ${CFLAGS} -o $@ -Xlinker -soname=`basename $@` -nostart -e 0'
9123                 ;;
9124         (cygwin*)
9125                 CC_SHARED_OPTS=
9126                 MK_SHARED_LIB='sh '$rel_builddir'/mk_shared_lib.sh $@ ${CC} ${CFLAGS}'
9127                 RM_SHARED_OPTS="$RM_SHARED_OPTS $rel_builddir/mk_shared_lib.sh *.dll.a"
9128                 cf_cv_shlib_version=cygdll
9129                 cf_cv_shlib_version_infix=cygdll
9130                 shlibdir=$bindir
9131                 MAKE_DLLS=
9132                 cat >mk_shared_lib.sh <<-CF_EOF
9133                 #!/bin/sh
9134                 SHARED_LIB=\$1
9135                 IMPORT_LIB=\`echo "\$1" | sed -e 's/cyg/lib/' -e 's/[0-9]*\.dll$/.dll.a/'\`
9136                 shift
9137                 cat <<-EOF
9138                 Linking shared library
9139                 ** SHARED_LIB \$SHARED_LIB
9140                 ** IMPORT_LIB \$IMPORT_LIB
9141 EOF
9142                 exec \$* -shared -Wl,--out-implib=\${IMPORT_LIB} -Wl,--export-all-symbols -o \${SHARED_LIB}
9143 CF_EOF
9144                 chmod +x mk_shared_lib.sh
9145                 ;;
9146         (msys*)
9147                 CC_SHARED_OPTS=
9148                 MK_SHARED_LIB='sh '$rel_builddir'/mk_shared_lib.sh $@ ${CC} ${CFLAGS}'
9149                 RM_SHARED_OPTS="$RM_SHARED_OPTS $rel_builddir/mk_shared_lib.sh *.dll.a"
9150                 cf_cv_shlib_version=msysdll
9151                 cf_cv_shlib_version_infix=msysdll
9152                 shlibdir=$bindir
9153                 MAKE_DLLS=
9154                 cat >mk_shared_lib.sh <<-CF_EOF
9155                 #!/bin/sh
9156                 SHARED_LIB=\$1
9157                 IMPORT_LIB=\`echo "\$1" | sed -e 's/msys-/lib/' -e 's/[0-9]*\.dll$/.dll.a/'\`
9158                 shift
9159                 cat <<-EOF
9160                 Linking shared library
9161                 ** SHARED_LIB \$SHARED_LIB
9162                 ** IMPORT_LIB \$IMPORT_LIB
9163 EOF
9164                 exec \$* -shared -Wl,--out-implib=\${IMPORT_LIB} -Wl,--export-all-symbols -o \${SHARED_LIB}
9165 CF_EOF
9166                 chmod +x mk_shared_lib.sh
9167                 ;;
9168         (darwin*)
9169                 cf_try_cflags="no-cpp-precomp"
9170                 CC_SHARED_OPTS="-dynamic"
9171                 MK_SHARED_LIB='${CC} ${CFLAGS} -dynamiclib -install_name ${libdir}/`basename $@` -compatibility_version ${ABI_VERSION} -current_version ${ABI_VERSION} -o $@'
9172                 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=abi
9173                 cf_cv_shlib_version_infix=yes
9174                 echo "$as_me:9174: checking if ld -search_paths_first works" >&5
9175 echo $ECHO_N "checking if ld -search_paths_first works... $ECHO_C" >&6
9176 if test "${cf_cv_ldflags_search_paths_first+set}" = set; then
9177   echo $ECHO_N "(cached) $ECHO_C" >&6
9178 else
9179
9180                         cf_save_LDFLAGS=$LDFLAGS
9181                         LDFLAGS="$LDFLAGS -Wl,-search_paths_first"
9182                         cat >conftest.$ac_ext <<_ACEOF
9183 #line 9183 "configure"
9184 #include "confdefs.h"
9185
9186 int
9187 main ()
9188 {
9189 int i;
9190   ;
9191   return 0;
9192 }
9193 _ACEOF
9194 rm -f conftest.$ac_objext conftest$ac_exeext
9195 if { (eval echo "$as_me:9195: \"$ac_link\"") >&5
9196   (eval $ac_link) 2>&5
9197   ac_status=$?
9198   echo "$as_me:9198: \$? = $ac_status" >&5
9199   (exit $ac_status); } &&
9200          { ac_try='test -s conftest$ac_exeext'
9201   { (eval echo "$as_me:9201: \"$ac_try\"") >&5
9202   (eval $ac_try) 2>&5
9203   ac_status=$?
9204   echo "$as_me:9204: \$? = $ac_status" >&5
9205   (exit $ac_status); }; }; then
9206   cf_cv_ldflags_search_paths_first=yes
9207 else
9208   echo "$as_me: failed program was:" >&5
9209 cat conftest.$ac_ext >&5
9210 cf_cv_ldflags_search_paths_first=no
9211 fi
9212 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9213                                 LDFLAGS=$cf_save_LDFLAGS
9214 fi
9215 echo "$as_me:9215: result: $cf_cv_ldflags_search_paths_first" >&5
9216 echo "${ECHO_T}$cf_cv_ldflags_search_paths_first" >&6
9217                 if test $cf_cv_ldflags_search_paths_first = yes; then
9218                         LDFLAGS="$LDFLAGS -Wl,-search_paths_first"
9219                 fi
9220                 ;;
9221         (hpux[7-8]*)
9222                 # HP-UX 8.07 ld lacks "+b" option used for libdir search-list
9223                 if test "$GCC" != yes; then
9224                         CC_SHARED_OPTS='+Z'
9225                 fi
9226                 MK_SHARED_LIB='${LD} -b -o $@'
9227                 INSTALL_LIB="-m 555"
9228                 ;;
9229         (hpux*)
9230                 # (tested with gcc 2.7.2 -- I don't have c89)
9231                 if test "$GCC" = yes; then
9232                         LD_SHARED_OPTS='-Xlinker +b -Xlinker ${libdir}'
9233                 else
9234                         CC_SHARED_OPTS='+Z'
9235                         LD_SHARED_OPTS='-Wl,+b,${libdir}'
9236                 fi
9237                 MK_SHARED_LIB='${LD} +b ${libdir} -b -o $@'
9238                 # HP-UX shared libraries must be executable, and should be
9239                 # readonly to exploit a quirk in the memory manager.
9240                 INSTALL_LIB="-m 555"
9241                 ;;
9242         (interix*)
9243                 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
9244                 if test "$cf_cv_shlib_version" = rel; then
9245                         cf_shared_soname='`basename  .${REL_VERSION}`.${ABI_VERSION}'
9246                 else
9247                         cf_shared_soname='`basename `'
9248                 fi
9249                 CC_SHARED_OPTS=
9250                 MK_SHARED_LIB='${CC} -shared -Wl,-rpath,${RPATH_LIST} -Wl,-h,'$cf_shared_soname' -o '
9251                 ;;
9252         (irix*)
9253                 if test "$cf_cv_enable_rpath" = yes ; then
9254                         EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
9255                 fi
9256                 # tested with IRIX 5.2 and 'cc'.
9257                 if test "$GCC" != yes; then
9258                         CC_SHARED_OPTS='-KPIC'
9259                         MK_SHARED_LIB='${CC} -shared -rdata_shared -soname `basename $@` -o $@'
9260                 else
9261                         MK_SHARED_LIB='${CC} -shared -Wl,-soname,`basename $@` -o $@'
9262                 fi
9263                 cf_cv_rm_so_locs=yes
9264                 ;;
9265         (linux*|gnu*|k*bsd*-gnu)
9266                 if test "$DFT_LWR_MODEL" = "shared" ; then
9267                         LOCAL_LDFLAGS="${LD_RPATH_OPT}\$(LOCAL_LIBDIR)"
9268                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
9269                 fi
9270                 if test "$cf_cv_enable_rpath" = yes ; then
9271                         EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
9272                 fi
9273
9274         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
9275         if test "$cf_cv_shlib_version" = rel; then
9276                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
9277         else
9278                 cf_cv_shared_soname='`basename $@`'
9279         fi
9280
9281                 MK_SHARED_LIB='${CC} ${CFLAGS} -shared -Wl,-soname,'$cf_cv_shared_soname',-stats,-lc -o $@'
9282                 ;;
9283         (mingw*)
9284                 cf_cv_shlib_version=mingw
9285                 cf_cv_shlib_version_infix=mingw
9286                 shlibdir=$bindir
9287                 MAKE_DLLS=
9288                 if test "$DFT_LWR_MODEL" = "shared" ; then
9289                         LOCAL_LDFLAGS="-Wl,--enable-auto-import"
9290                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
9291                         EXTRA_LDFLAGS="-Wl,--enable-auto-import $EXTRA_LDFLAGS"
9292                 fi
9293                 CC_SHARED_OPTS=
9294                 MK_SHARED_LIB='sh '$rel_builddir'/mk_shared_lib.sh $@ ${CC} ${CFLAGS}'
9295                 RM_SHARED_OPTS="$RM_SHARED_OPTS $rel_builddir/mk_shared_lib.sh *.dll.a"
9296                 cat >mk_shared_lib.sh <<-CF_EOF
9297                 #!/bin/sh
9298                 SHARED_LIB=\$1
9299                 IMPORT_LIB=\`echo "\$1" | sed -e 's/[0-9]*\.dll$/.dll.a/'\`
9300                 shift
9301                 cat <<-EOF
9302                 Linking shared library
9303                 ** SHARED_LIB \$SHARED_LIB
9304                 ** IMPORT_LIB \$IMPORT_LIB
9305 EOF
9306                 exec \$* -shared -Wl,--enable-auto-import,--out-implib=\${IMPORT_LIB} -Wl,--export-all-symbols -o \${SHARED_LIB}
9307 CF_EOF
9308                 chmod +x mk_shared_lib.sh
9309                 ;;
9310         (openbsd[2-9].*|mirbsd*)
9311                 if test "$DFT_LWR_MODEL" = "shared" ; then
9312                         LOCAL_LDFLAGS="${LD_RPATH_OPT}\$(LOCAL_LIBDIR)"
9313                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
9314                 fi
9315                 if test "$cf_cv_enable_rpath" = yes ; then
9316                         EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
9317                 fi
9318                 CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
9319
9320         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
9321         if test "$cf_cv_shlib_version" = rel; then
9322                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
9323         else
9324                 cf_cv_shared_soname='`basename $@`'
9325         fi
9326
9327                 MK_SHARED_LIB='${CC} ${CFLAGS} -shared -Wl,-Bshareable,-soname,'$cf_cv_shared_soname',-stats,-lc -o $@'
9328                 ;;
9329         (nto-qnx*|openbsd*|freebsd[12].*)
9330                 CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
9331                 MK_SHARED_LIB='${LD} -Bshareable -o $@'
9332                 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
9333                 ;;
9334         (dragonfly*|freebsd*)
9335                 CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
9336                 if test "$DFT_LWR_MODEL" = "shared" && test "$cf_cv_enable_rpath" = yes ; then
9337                         LOCAL_LDFLAGS="${cf_ld_rpath_opt}\$(LOCAL_LIBDIR)"
9338                         LOCAL_LDFLAGS2="${cf_ld_rpath_opt}\${RPATH_LIST} $LOCAL_LDFLAGS"
9339                         EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
9340                 fi
9341
9342         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
9343         if test "$cf_cv_shlib_version" = rel; then
9344                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
9345         else
9346                 cf_cv_shared_soname='`basename $@`'
9347         fi
9348
9349                 MK_SHARED_LIB='${CC} ${CFLAGS} -shared -Wl,-soname,'$cf_cv_shared_soname',-stats,-lc -o $@'
9350                 ;;
9351         (netbsd*)
9352                 CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
9353                 if test "$DFT_LWR_MODEL" = "shared" && test "$cf_cv_enable_rpath" = yes ; then
9354                         LOCAL_LDFLAGS="${cf_ld_rpath_opt}\$(LOCAL_LIBDIR)"
9355                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
9356                         EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
9357                         if test "$cf_cv_shlib_version" = auto; then
9358                         if test -f /usr/libexec/ld.elf_so; then
9359                                 cf_cv_shlib_version=abi
9360                         else
9361                                 cf_cv_shlib_version=rel
9362                         fi
9363                         fi
9364
9365         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
9366         if test "$cf_cv_shlib_version" = rel; then
9367                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
9368         else
9369                 cf_cv_shared_soname='`basename $@`'
9370         fi
9371
9372                         MK_SHARED_LIB='${CC} ${CFLAGS} -shared -Wl,-soname,'$cf_cv_shared_soname' -o $@'
9373                 else
9374                         MK_SHARED_LIB='${CC} -Wl,-shared -Wl,-Bshareable -o $@'
9375                 fi
9376                 ;;
9377         (osf*|mls+*)
9378                 # tested with OSF/1 V3.2 and 'cc'
9379                 # tested with OSF/1 V3.2 and gcc 2.6.3 (but the c++ demo didn't
9380                 # link with shared libs).
9381                 MK_SHARED_LIB='${LD} -set_version ${REL_VERSION}:${ABI_VERSION} -expect_unresolved "*" -shared -soname `basename $@`'
9382                 case $host_os in
9383                 (osf4*)
9384                         MK_SHARED_LIB="${MK_SHARED_LIB} -msym"
9385                         ;;
9386                 esac
9387                 MK_SHARED_LIB="${MK_SHARED_LIB}"' -o $@'
9388                 if test "$DFT_LWR_MODEL" = "shared" ; then
9389                         LOCAL_LDFLAGS="${LD_RPATH_OPT}\$(LOCAL_LIBDIR)"
9390                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
9391                 fi
9392                 cf_cv_rm_so_locs=yes
9393                 ;;
9394         (sco3.2v5*)  # also uw2* and UW7: hops 13-Apr-98
9395                 # tested with osr5.0.5
9396                 if test "$GCC" != yes; then
9397                         CC_SHARED_OPTS='-belf -KPIC'
9398                 fi
9399                 MK_SHARED_LIB='${LD} -dy -G -h `basename $@ .${REL_VERSION}`.${ABI_VERSION} -o $@'
9400                 if test "$cf_cv_enable_rpath" = yes ; then
9401                         # only way is to set LD_RUN_PATH but no switch for it
9402                         RUN_PATH=$libdir
9403                 fi
9404                 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
9405                 LINK_PROGS='LD_RUN_PATH=${libdir}'
9406                 LINK_TESTS='Pwd=`pwd`;LD_RUN_PATH=`dirname $${Pwd}`/lib'
9407                 ;;
9408         (sunos4*)
9409                 # tested with SunOS 4.1.1 and gcc 2.7.0
9410                 if test "$GCC" != yes; then
9411                         CC_SHARED_OPTS='-KPIC'
9412                 fi
9413                 MK_SHARED_LIB='${LD} -assert pure-text -o $@'
9414                 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
9415                 ;;
9416         (solaris2*)
9417                 # tested with SunOS 5.5.1 (solaris 2.5.1) and gcc 2.7.2
9418                 # tested with SunOS 5.10 (solaris 10) and gcc 3.4.3
9419                 if test "$DFT_LWR_MODEL" = "shared" ; then
9420                         LOCAL_LDFLAGS="-R \$(LOCAL_LIBDIR):\${libdir}"
9421                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
9422                 fi
9423                 if test "$cf_cv_enable_rpath" = yes ; then
9424                         EXTRA_LDFLAGS="-R \${libdir} $EXTRA_LDFLAGS"
9425                 fi
9426
9427         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
9428         if test "$cf_cv_shlib_version" = rel; then
9429                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
9430         else
9431                 cf_cv_shared_soname='`basename $@`'
9432         fi
9433
9434                 if test "$GCC" != yes; then
9435                         cf_save_CFLAGS="$CFLAGS"
9436                         for cf_shared_opts in -xcode=pic32 -xcode=pic13 -KPIC -Kpic -O
9437                         do
9438                                 CFLAGS="$cf_shared_opts $cf_save_CFLAGS"
9439                                 cat >conftest.$ac_ext <<_ACEOF
9440 #line 9440 "configure"
9441 #include "confdefs.h"
9442 #include <stdio.h>
9443 int
9444 main ()
9445 {
9446 printf("Hello\n");
9447   ;
9448   return 0;
9449 }
9450 _ACEOF
9451 rm -f conftest.$ac_objext
9452 if { (eval echo "$as_me:9452: \"$ac_compile\"") >&5
9453   (eval $ac_compile) 2>&5
9454   ac_status=$?
9455   echo "$as_me:9455: \$? = $ac_status" >&5
9456   (exit $ac_status); } &&
9457          { ac_try='test -s conftest.$ac_objext'
9458   { (eval echo "$as_me:9458: \"$ac_try\"") >&5
9459   (eval $ac_try) 2>&5
9460   ac_status=$?
9461   echo "$as_me:9461: \$? = $ac_status" >&5
9462   (exit $ac_status); }; }; then
9463   break
9464 else
9465   echo "$as_me: failed program was:" >&5
9466 cat conftest.$ac_ext >&5
9467 fi
9468 rm -f conftest.$ac_objext conftest.$ac_ext
9469                         done
9470                         CFLAGS="$cf_save_CFLAGS"
9471                         CC_SHARED_OPTS=$cf_shared_opts
9472                         MK_SHARED_LIB='${CC} -dy -G -h '$cf_cv_shared_soname' -o $@'
9473                 else
9474                         MK_SHARED_LIB='${CC} -shared -dy -G -h '$cf_cv_shared_soname' -o $@'
9475                 fi
9476                 ;;
9477         (sysv5uw7*|unix_sv*)
9478                 # tested with UnixWare 7.1.0 (gcc 2.95.2 and cc)
9479                 if test "$GCC" != yes; then
9480                         CC_SHARED_OPTS='-KPIC'
9481                 fi
9482                 MK_SHARED_LIB='${LD} -d y -G -o $@'
9483                 ;;
9484         (*)
9485                 CC_SHARED_OPTS='unknown'
9486                 MK_SHARED_LIB='echo unknown'
9487                 ;;
9488         esac
9489
9490         # This works if the last tokens in $MK_SHARED_LIB are the -o target.
9491         case "$cf_cv_shlib_version" in
9492         (rel|abi)
9493                 case "$MK_SHARED_LIB" in
9494                 (*'-o $@')
9495                         test "$cf_cv_do_symlinks" = no && cf_cv_do_symlinks=yes
9496                         ;;
9497                 (*)
9498                         { echo "$as_me:9498: WARNING: ignored --with-shlib-version" >&5
9499 echo "$as_me: WARNING: ignored --with-shlib-version" >&2;}
9500                         ;;
9501                 esac
9502                 ;;
9503         esac
9504
9505         if test -n "$cf_try_cflags"
9506         then
9507 cat > conftest.$ac_ext <<EOF
9508 #line 9508 "${as_me:-configure}"
9509 #include <stdio.h>
9510 int main(int argc, char *argv[])
9511 {
9512         printf("hello\n");
9513         return (argv[argc-1] == 0) ;
9514 }
9515 EOF
9516                 cf_save_CFLAGS="$CFLAGS"
9517                 for cf_opt in $cf_try_cflags
9518                 do
9519                         CFLAGS="$cf_save_CFLAGS -$cf_opt"
9520                         echo "$as_me:9520: checking if CFLAGS option -$cf_opt works" >&5
9521 echo $ECHO_N "checking if CFLAGS option -$cf_opt works... $ECHO_C" >&6
9522                         if { (eval echo "$as_me:9522: \"$ac_compile\"") >&5
9523   (eval $ac_compile) 2>&5
9524   ac_status=$?
9525   echo "$as_me:9525: \$? = $ac_status" >&5
9526   (exit $ac_status); }; then
9527                                 echo "$as_me:9527: result: yes" >&5
9528 echo "${ECHO_T}yes" >&6
9529                                 cf_save_CFLAGS="$CFLAGS"
9530                         else
9531                                 echo "$as_me:9531: result: no" >&5
9532 echo "${ECHO_T}no" >&6
9533                         fi
9534                 done
9535                 CFLAGS="$cf_save_CFLAGS"
9536         fi
9537
9538         # RPATH_LIST is a colon-separated list of directories
9539         test -n "$cf_ld_rpath_opt" && MK_SHARED_LIB="$MK_SHARED_LIB $cf_ld_rpath_opt\${RPATH_LIST}"
9540         test -z "$RPATH_LIST" && RPATH_LIST="\${libdir}"
9541
9542         test $cf_cv_rm_so_locs = yes && RM_SHARED_OPTS="$RM_SHARED_OPTS so_locations"
9543
9544         test -n "$verbose" && echo "    CC_SHARED_OPTS: $CC_SHARED_OPTS" 1>&6
9545
9546 echo "${as_me:-configure}:9546: testing CC_SHARED_OPTS: $CC_SHARED_OPTS ..." 1>&5
9547
9548         test -n "$verbose" && echo "    MK_SHARED_LIB:  $MK_SHARED_LIB" 1>&6
9549
9550 echo "${as_me:-configure}:9550: testing MK_SHARED_LIB:  $MK_SHARED_LIB ..." 1>&5
9551
9552 # The test/sample programs in the original tree link using rpath option.
9553 # Make it optional for packagers.
9554 if test -n "$LOCAL_LDFLAGS"
9555 then
9556         echo "$as_me:9556: checking if you want to link sample programs with rpath option" >&5
9557 echo $ECHO_N "checking if you want to link sample programs with rpath option... $ECHO_C" >&6
9558
9559 # Check whether --enable-rpath-link or --disable-rpath-link was given.
9560 if test "${enable_rpath_link+set}" = set; then
9561   enableval="$enable_rpath_link"
9562   with_rpath_link=$enableval
9563 else
9564   with_rpath_link=yes
9565 fi;
9566         echo "$as_me:9566: result: $with_rpath_link" >&5
9567 echo "${ECHO_T}$with_rpath_link" >&6
9568         if test "$with_rpath_link" = no
9569         then
9570                 LOCAL_LDFLAGS=
9571                 LOCAL_LDFLAGS2=
9572         fi
9573 fi
9574
9575 ###############################################################################
9576
9577 ###   use option --enable-broken-linker to force on use of broken-linker support
9578 echo "$as_me:9578: checking if you want broken-linker support code" >&5
9579 echo $ECHO_N "checking if you want broken-linker support code... $ECHO_C" >&6
9580
9581 # Check whether --enable-broken_linker or --disable-broken_linker was given.
9582 if test "${enable_broken_linker+set}" = set; then
9583   enableval="$enable_broken_linker"
9584   with_broken_linker=$enableval
9585 else
9586   with_broken_linker=${BROKEN_LINKER:-no}
9587 fi;
9588 echo "$as_me:9588: result: $with_broken_linker" >&5
9589 echo "${ECHO_T}$with_broken_linker" >&6
9590
9591 BROKEN_LINKER=0
9592 if test "$with_broken_linker" = yes ; then
9593         cat >>confdefs.h <<\EOF
9594 #define BROKEN_LINKER 1
9595 EOF
9596
9597         BROKEN_LINKER=1
9598 elif test "$DFT_LWR_MODEL" = shared ; then
9599         case $cf_cv_system_name in
9600         (cygwin*)
9601                 cat >>confdefs.h <<\EOF
9602 #define BROKEN_LINKER 1
9603 EOF
9604
9605                 BROKEN_LINKER=1
9606                 test -n "$verbose" && echo "    cygwin linker is broken anyway" 1>&6
9607
9608 echo "${as_me:-configure}:9608: testing cygwin linker is broken anyway ..." 1>&5
9609
9610                 ;;
9611         esac
9612 fi
9613
9614 # Check to define _XOPEN_SOURCE "automatically"
9615
9616 cf_XOPEN_SOURCE=500
9617 cf_POSIX_C_SOURCE=199506L
9618 cf_xopen_source=
9619
9620 case $host_os in
9621 (aix[4-7]*)
9622         cf_xopen_source="-D_ALL_SOURCE"
9623         ;;
9624 (cygwin|msys)
9625         cf_XOPEN_SOURCE=600
9626         ;;
9627 (darwin[0-8].*)
9628         cf_xopen_source="-D_APPLE_C_SOURCE"
9629         ;;
9630 (darwin*)
9631         cf_xopen_source="-D_DARWIN_C_SOURCE"
9632         cf_XOPEN_SOURCE=
9633         ;;
9634 (freebsd*|dragonfly*)
9635         # 5.x headers associate
9636         #       _XOPEN_SOURCE=600 with _POSIX_C_SOURCE=200112L
9637         #       _XOPEN_SOURCE=500 with _POSIX_C_SOURCE=199506L
9638         cf_POSIX_C_SOURCE=200112L
9639         cf_XOPEN_SOURCE=600
9640         cf_xopen_source="-D_BSD_TYPES -D__BSD_VISIBLE -D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
9641         ;;
9642 (hpux11*)
9643         cf_xopen_source="-D_HPUX_SOURCE -D_XOPEN_SOURCE=500"
9644         ;;
9645 (hpux*)
9646         cf_xopen_source="-D_HPUX_SOURCE"
9647         ;;
9648 (irix[56].*)
9649         cf_xopen_source="-D_SGI_SOURCE"
9650         cf_XOPEN_SOURCE=
9651         ;;
9652 (linux*|gnu*|mint*|k*bsd*-gnu)
9653
9654 echo "$as_me:9654: checking if we must define _GNU_SOURCE" >&5
9655 echo $ECHO_N "checking if we must define _GNU_SOURCE... $ECHO_C" >&6
9656 if test "${cf_cv_gnu_source+set}" = set; then
9657   echo $ECHO_N "(cached) $ECHO_C" >&6
9658 else
9659
9660 cat >conftest.$ac_ext <<_ACEOF
9661 #line 9661 "configure"
9662 #include "confdefs.h"
9663 #include <sys/types.h>
9664 int
9665 main ()
9666 {
9667
9668 #ifndef _XOPEN_SOURCE
9669 make an error
9670 #endif
9671   ;
9672   return 0;
9673 }
9674 _ACEOF
9675 rm -f conftest.$ac_objext
9676 if { (eval echo "$as_me:9676: \"$ac_compile\"") >&5
9677   (eval $ac_compile) 2>&5
9678   ac_status=$?
9679   echo "$as_me:9679: \$? = $ac_status" >&5
9680   (exit $ac_status); } &&
9681          { ac_try='test -s conftest.$ac_objext'
9682   { (eval echo "$as_me:9682: \"$ac_try\"") >&5
9683   (eval $ac_try) 2>&5
9684   ac_status=$?
9685   echo "$as_me:9685: \$? = $ac_status" >&5
9686   (exit $ac_status); }; }; then
9687   cf_cv_gnu_source=no
9688 else
9689   echo "$as_me: failed program was:" >&5
9690 cat conftest.$ac_ext >&5
9691 cf_save="$CPPFLAGS"
9692          CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
9693          cat >conftest.$ac_ext <<_ACEOF
9694 #line 9694 "configure"
9695 #include "confdefs.h"
9696 #include <sys/types.h>
9697 int
9698 main ()
9699 {
9700
9701 #ifdef _XOPEN_SOURCE
9702 make an error
9703 #endif
9704   ;
9705   return 0;
9706 }
9707 _ACEOF
9708 rm -f conftest.$ac_objext
9709 if { (eval echo "$as_me:9709: \"$ac_compile\"") >&5
9710   (eval $ac_compile) 2>&5
9711   ac_status=$?
9712   echo "$as_me:9712: \$? = $ac_status" >&5
9713   (exit $ac_status); } &&
9714          { ac_try='test -s conftest.$ac_objext'
9715   { (eval echo "$as_me:9715: \"$ac_try\"") >&5
9716   (eval $ac_try) 2>&5
9717   ac_status=$?
9718   echo "$as_me:9718: \$? = $ac_status" >&5
9719   (exit $ac_status); }; }; then
9720   cf_cv_gnu_source=no
9721 else
9722   echo "$as_me: failed program was:" >&5
9723 cat conftest.$ac_ext >&5
9724 cf_cv_gnu_source=yes
9725 fi
9726 rm -f conftest.$ac_objext conftest.$ac_ext
9727         CPPFLAGS="$cf_save"
9728
9729 fi
9730 rm -f conftest.$ac_objext conftest.$ac_ext
9731
9732 fi
9733 echo "$as_me:9733: result: $cf_cv_gnu_source" >&5
9734 echo "${ECHO_T}$cf_cv_gnu_source" >&6
9735 test "$cf_cv_gnu_source" = yes && CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
9736
9737         ;;
9738 (minix*)
9739         cf_xopen_source="-D_NETBSD_SOURCE" # POSIX.1-2001 features are ifdef'd with this...
9740         ;;
9741 (mirbsd*)
9742         # setting _XOPEN_SOURCE or _POSIX_SOURCE breaks <sys/select.h> and other headers which use u_int / u_short types
9743         cf_XOPEN_SOURCE=
9744
9745 cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE
9746
9747 cf_save_CFLAGS="$CFLAGS"
9748 cf_save_CPPFLAGS="$CPPFLAGS"
9749
9750 cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \
9751         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
9752                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
9753
9754 cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \
9755         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
9756                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
9757
9758 echo "$as_me:9758: checking if we should define _POSIX_C_SOURCE" >&5
9759 echo $ECHO_N "checking if we should define _POSIX_C_SOURCE... $ECHO_C" >&6
9760 if test "${cf_cv_posix_c_source+set}" = set; then
9761   echo $ECHO_N "(cached) $ECHO_C" >&6
9762 else
9763
9764 echo "${as_me:-configure}:9764: testing if the symbol is already defined go no further ..." 1>&5
9765
9766         cat >conftest.$ac_ext <<_ACEOF
9767 #line 9767 "configure"
9768 #include "confdefs.h"
9769 #include <sys/types.h>
9770 int
9771 main ()
9772 {
9773
9774 #ifndef _POSIX_C_SOURCE
9775 make an error
9776 #endif
9777   ;
9778   return 0;
9779 }
9780 _ACEOF
9781 rm -f conftest.$ac_objext
9782 if { (eval echo "$as_me:9782: \"$ac_compile\"") >&5
9783   (eval $ac_compile) 2>&5
9784   ac_status=$?
9785   echo "$as_me:9785: \$? = $ac_status" >&5
9786   (exit $ac_status); } &&
9787          { ac_try='test -s conftest.$ac_objext'
9788   { (eval echo "$as_me:9788: \"$ac_try\"") >&5
9789   (eval $ac_try) 2>&5
9790   ac_status=$?
9791   echo "$as_me:9791: \$? = $ac_status" >&5
9792   (exit $ac_status); }; }; then
9793   cf_cv_posix_c_source=no
9794 else
9795   echo "$as_me: failed program was:" >&5
9796 cat conftest.$ac_ext >&5
9797 cf_want_posix_source=no
9798          case .$cf_POSIX_C_SOURCE in
9799          (.[12]??*)
9800                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
9801                 ;;
9802          (.2)
9803                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
9804                 cf_want_posix_source=yes
9805                 ;;
9806          (.*)
9807                 cf_want_posix_source=yes
9808                 ;;
9809          esac
9810          if test "$cf_want_posix_source" = yes ; then
9811                 cat >conftest.$ac_ext <<_ACEOF
9812 #line 9812 "configure"
9813 #include "confdefs.h"
9814 #include <sys/types.h>
9815 int
9816 main ()
9817 {
9818
9819 #ifdef _POSIX_SOURCE
9820 make an error
9821 #endif
9822   ;
9823   return 0;
9824 }
9825 _ACEOF
9826 rm -f conftest.$ac_objext
9827 if { (eval echo "$as_me:9827: \"$ac_compile\"") >&5
9828   (eval $ac_compile) 2>&5
9829   ac_status=$?
9830   echo "$as_me:9830: \$? = $ac_status" >&5
9831   (exit $ac_status); } &&
9832          { ac_try='test -s conftest.$ac_objext'
9833   { (eval echo "$as_me:9833: \"$ac_try\"") >&5
9834   (eval $ac_try) 2>&5
9835   ac_status=$?
9836   echo "$as_me:9836: \$? = $ac_status" >&5
9837   (exit $ac_status); }; }; then
9838   :
9839 else
9840   echo "$as_me: failed program was:" >&5
9841 cat conftest.$ac_ext >&5
9842 cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE"
9843 fi
9844 rm -f conftest.$ac_objext conftest.$ac_ext
9845          fi
9846
9847 echo "${as_me:-configure}:9847: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
9848
9849          CFLAGS="$cf_trim_CFLAGS"
9850          CPPFLAGS="$cf_trim_CPPFLAGS $cf_cv_posix_c_source"
9851
9852 echo "${as_me:-configure}:9852: testing if the second compile does not leave our definition intact error ..." 1>&5
9853
9854          cat >conftest.$ac_ext <<_ACEOF
9855 #line 9855 "configure"
9856 #include "confdefs.h"
9857 #include <sys/types.h>
9858 int
9859 main ()
9860 {
9861
9862 #ifndef _POSIX_C_SOURCE
9863 make an error
9864 #endif
9865   ;
9866   return 0;
9867 }
9868 _ACEOF
9869 rm -f conftest.$ac_objext
9870 if { (eval echo "$as_me:9870: \"$ac_compile\"") >&5
9871   (eval $ac_compile) 2>&5
9872   ac_status=$?
9873   echo "$as_me:9873: \$? = $ac_status" >&5
9874   (exit $ac_status); } &&
9875          { ac_try='test -s conftest.$ac_objext'
9876   { (eval echo "$as_me:9876: \"$ac_try\"") >&5
9877   (eval $ac_try) 2>&5
9878   ac_status=$?
9879   echo "$as_me:9879: \$? = $ac_status" >&5
9880   (exit $ac_status); }; }; then
9881   :
9882 else
9883   echo "$as_me: failed program was:" >&5
9884 cat conftest.$ac_ext >&5
9885 cf_cv_posix_c_source=no
9886 fi
9887 rm -f conftest.$ac_objext conftest.$ac_ext
9888          CFLAGS="$cf_save_CFLAGS"
9889          CPPFLAGS="$cf_save_CPPFLAGS"
9890
9891 fi
9892 rm -f conftest.$ac_objext conftest.$ac_ext
9893
9894 fi
9895 echo "$as_me:9895: result: $cf_cv_posix_c_source" >&5
9896 echo "${ECHO_T}$cf_cv_posix_c_source" >&6
9897
9898 if test "$cf_cv_posix_c_source" != no ; then
9899         CFLAGS="$cf_trim_CFLAGS"
9900         CPPFLAGS="$cf_trim_CPPFLAGS"
9901
9902 cf_fix_cppflags=no
9903 cf_new_cflags=
9904 cf_new_cppflags=
9905 cf_new_extra_cppflags=
9906
9907 for cf_add_cflags in $cf_cv_posix_c_source
9908 do
9909 case $cf_fix_cppflags in
9910 (no)
9911         case $cf_add_cflags in
9912         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
9913                 case $cf_add_cflags in
9914                 (-D*)
9915                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
9916
9917                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
9918                                 && test -z "${cf_tst_cflags}" \
9919                                 && cf_fix_cppflags=yes
9920
9921                         if test $cf_fix_cppflags = yes ; then
9922                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
9923                                 continue
9924                         elif test "${cf_tst_cflags}" = "\"'" ; then
9925                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
9926                                 continue
9927                         fi
9928                         ;;
9929                 esac
9930                 case "$CPPFLAGS" in
9931                 (*$cf_add_cflags)
9932                         ;;
9933                 (*)
9934                         case $cf_add_cflags in
9935                         (-D*)
9936                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
9937
9938 CPPFLAGS=`echo "$CPPFLAGS" | \
9939         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
9940                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
9941
9942                                 ;;
9943                         esac
9944                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
9945                         ;;
9946                 esac
9947                 ;;
9948         (*)
9949                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
9950                 ;;
9951         esac
9952         ;;
9953 (yes)
9954         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
9955
9956         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
9957
9958         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
9959                 && test -z "${cf_tst_cflags}" \
9960                 && cf_fix_cppflags=no
9961         ;;
9962 esac
9963 done
9964
9965 if test -n "$cf_new_cflags" ; then
9966
9967         CFLAGS="$CFLAGS $cf_new_cflags"
9968 fi
9969
9970 if test -n "$cf_new_cppflags" ; then
9971
9972         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
9973 fi
9974
9975 if test -n "$cf_new_extra_cppflags" ; then
9976
9977         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
9978 fi
9979
9980 fi
9981
9982         ;;
9983 (netbsd*)
9984         cf_xopen_source="-D_NETBSD_SOURCE" # setting _XOPEN_SOURCE breaks IPv6 for lynx on NetBSD 1.6, breaks xterm, is not needed for ncursesw
9985         ;;
9986 (openbsd[4-9]*)
9987         # setting _XOPEN_SOURCE lower than 500 breaks g++ compile with wchar.h, needed for ncursesw
9988         cf_xopen_source="-D_BSD_SOURCE"
9989         cf_XOPEN_SOURCE=600
9990         ;;
9991 (openbsd*)
9992         # setting _XOPEN_SOURCE breaks xterm on OpenBSD 2.8, is not needed for ncursesw
9993         ;;
9994 (osf[45]*)
9995         cf_xopen_source="-D_OSF_SOURCE"
9996         ;;
9997 (nto-qnx*)
9998         cf_xopen_source="-D_QNX_SOURCE"
9999         ;;
10000 (sco*)
10001         # setting _XOPEN_SOURCE breaks Lynx on SCO Unix / OpenServer
10002         ;;
10003 (solaris2.*)
10004         cf_xopen_source="-D__EXTENSIONS__"
10005         cf_cv_xopen_source=broken
10006         ;;
10007 (sysv4.2uw2.*) # Novell/SCO UnixWare 2.x (tested on 2.1.2)
10008         cf_XOPEN_SOURCE=
10009         cf_POSIX_C_SOURCE=
10010         ;;
10011 (*)
10012
10013 echo "$as_me:10013: checking if we should define _XOPEN_SOURCE" >&5
10014 echo $ECHO_N "checking if we should define _XOPEN_SOURCE... $ECHO_C" >&6
10015 if test "${cf_cv_xopen_source+set}" = set; then
10016   echo $ECHO_N "(cached) $ECHO_C" >&6
10017 else
10018
10019         cat >conftest.$ac_ext <<_ACEOF
10020 #line 10020 "configure"
10021 #include "confdefs.h"
10022
10023 #include <stdlib.h>
10024 #include <string.h>
10025 #include <sys/types.h>
10026
10027 int
10028 main ()
10029 {
10030
10031 #ifndef _XOPEN_SOURCE
10032 make an error
10033 #endif
10034   ;
10035   return 0;
10036 }
10037 _ACEOF
10038 rm -f conftest.$ac_objext
10039 if { (eval echo "$as_me:10039: \"$ac_compile\"") >&5
10040   (eval $ac_compile) 2>&5
10041   ac_status=$?
10042   echo "$as_me:10042: \$? = $ac_status" >&5
10043   (exit $ac_status); } &&
10044          { ac_try='test -s conftest.$ac_objext'
10045   { (eval echo "$as_me:10045: \"$ac_try\"") >&5
10046   (eval $ac_try) 2>&5
10047   ac_status=$?
10048   echo "$as_me:10048: \$? = $ac_status" >&5
10049   (exit $ac_status); }; }; then
10050   cf_cv_xopen_source=no
10051 else
10052   echo "$as_me: failed program was:" >&5
10053 cat conftest.$ac_ext >&5
10054 cf_save="$CPPFLAGS"
10055          CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
10056          cat >conftest.$ac_ext <<_ACEOF
10057 #line 10057 "configure"
10058 #include "confdefs.h"
10059
10060 #include <stdlib.h>
10061 #include <string.h>
10062 #include <sys/types.h>
10063
10064 int
10065 main ()
10066 {
10067
10068 #ifdef _XOPEN_SOURCE
10069 make an error
10070 #endif
10071   ;
10072   return 0;
10073 }
10074 _ACEOF
10075 rm -f conftest.$ac_objext
10076 if { (eval echo "$as_me:10076: \"$ac_compile\"") >&5
10077   (eval $ac_compile) 2>&5
10078   ac_status=$?
10079   echo "$as_me:10079: \$? = $ac_status" >&5
10080   (exit $ac_status); } &&
10081          { ac_try='test -s conftest.$ac_objext'
10082   { (eval echo "$as_me:10082: \"$ac_try\"") >&5
10083   (eval $ac_try) 2>&5
10084   ac_status=$?
10085   echo "$as_me:10085: \$? = $ac_status" >&5
10086   (exit $ac_status); }; }; then
10087   cf_cv_xopen_source=no
10088 else
10089   echo "$as_me: failed program was:" >&5
10090 cat conftest.$ac_ext >&5
10091 cf_cv_xopen_source=$cf_XOPEN_SOURCE
10092 fi
10093 rm -f conftest.$ac_objext conftest.$ac_ext
10094         CPPFLAGS="$cf_save"
10095
10096 fi
10097 rm -f conftest.$ac_objext conftest.$ac_ext
10098
10099 fi
10100 echo "$as_me:10100: result: $cf_cv_xopen_source" >&5
10101 echo "${ECHO_T}$cf_cv_xopen_source" >&6
10102
10103 if test "$cf_cv_xopen_source" != no ; then
10104
10105 CFLAGS=`echo "$CFLAGS" | \
10106         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
10107                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
10108
10109 CPPFLAGS=`echo "$CPPFLAGS" | \
10110         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
10111                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
10112
10113         cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source"
10114
10115 cf_fix_cppflags=no
10116 cf_new_cflags=
10117 cf_new_cppflags=
10118 cf_new_extra_cppflags=
10119
10120 for cf_add_cflags in $cf_temp_xopen_source
10121 do
10122 case $cf_fix_cppflags in
10123 (no)
10124         case $cf_add_cflags in
10125         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
10126                 case $cf_add_cflags in
10127                 (-D*)
10128                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
10129
10130                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10131                                 && test -z "${cf_tst_cflags}" \
10132                                 && cf_fix_cppflags=yes
10133
10134                         if test $cf_fix_cppflags = yes ; then
10135                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10136                                 continue
10137                         elif test "${cf_tst_cflags}" = "\"'" ; then
10138                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10139                                 continue
10140                         fi
10141                         ;;
10142                 esac
10143                 case "$CPPFLAGS" in
10144                 (*$cf_add_cflags)
10145                         ;;
10146                 (*)
10147                         case $cf_add_cflags in
10148                         (-D*)
10149                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
10150
10151 CPPFLAGS=`echo "$CPPFLAGS" | \
10152         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
10153                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
10154
10155                                 ;;
10156                         esac
10157                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
10158                         ;;
10159                 esac
10160                 ;;
10161         (*)
10162                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
10163                 ;;
10164         esac
10165         ;;
10166 (yes)
10167         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10168
10169         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
10170
10171         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10172                 && test -z "${cf_tst_cflags}" \
10173                 && cf_fix_cppflags=no
10174         ;;
10175 esac
10176 done
10177
10178 if test -n "$cf_new_cflags" ; then
10179
10180         CFLAGS="$CFLAGS $cf_new_cflags"
10181 fi
10182
10183 if test -n "$cf_new_cppflags" ; then
10184
10185         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
10186 fi
10187
10188 if test -n "$cf_new_extra_cppflags" ; then
10189
10190         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
10191 fi
10192
10193 fi
10194
10195 cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE
10196
10197 cf_save_CFLAGS="$CFLAGS"
10198 cf_save_CPPFLAGS="$CPPFLAGS"
10199
10200 cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \
10201         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
10202                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
10203
10204 cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \
10205         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
10206                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
10207
10208 echo "$as_me:10208: checking if we should define _POSIX_C_SOURCE" >&5
10209 echo $ECHO_N "checking if we should define _POSIX_C_SOURCE... $ECHO_C" >&6
10210 if test "${cf_cv_posix_c_source+set}" = set; then
10211   echo $ECHO_N "(cached) $ECHO_C" >&6
10212 else
10213
10214 echo "${as_me:-configure}:10214: testing if the symbol is already defined go no further ..." 1>&5
10215
10216         cat >conftest.$ac_ext <<_ACEOF
10217 #line 10217 "configure"
10218 #include "confdefs.h"
10219 #include <sys/types.h>
10220 int
10221 main ()
10222 {
10223
10224 #ifndef _POSIX_C_SOURCE
10225 make an error
10226 #endif
10227   ;
10228   return 0;
10229 }
10230 _ACEOF
10231 rm -f conftest.$ac_objext
10232 if { (eval echo "$as_me:10232: \"$ac_compile\"") >&5
10233   (eval $ac_compile) 2>&5
10234   ac_status=$?
10235   echo "$as_me:10235: \$? = $ac_status" >&5
10236   (exit $ac_status); } &&
10237          { ac_try='test -s conftest.$ac_objext'
10238   { (eval echo "$as_me:10238: \"$ac_try\"") >&5
10239   (eval $ac_try) 2>&5
10240   ac_status=$?
10241   echo "$as_me:10241: \$? = $ac_status" >&5
10242   (exit $ac_status); }; }; then
10243   cf_cv_posix_c_source=no
10244 else
10245   echo "$as_me: failed program was:" >&5
10246 cat conftest.$ac_ext >&5
10247 cf_want_posix_source=no
10248          case .$cf_POSIX_C_SOURCE in
10249          (.[12]??*)
10250                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
10251                 ;;
10252          (.2)
10253                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
10254                 cf_want_posix_source=yes
10255                 ;;
10256          (.*)
10257                 cf_want_posix_source=yes
10258                 ;;
10259          esac
10260          if test "$cf_want_posix_source" = yes ; then
10261                 cat >conftest.$ac_ext <<_ACEOF
10262 #line 10262 "configure"
10263 #include "confdefs.h"
10264 #include <sys/types.h>
10265 int
10266 main ()
10267 {
10268
10269 #ifdef _POSIX_SOURCE
10270 make an error
10271 #endif
10272   ;
10273   return 0;
10274 }
10275 _ACEOF
10276 rm -f conftest.$ac_objext
10277 if { (eval echo "$as_me:10277: \"$ac_compile\"") >&5
10278   (eval $ac_compile) 2>&5
10279   ac_status=$?
10280   echo "$as_me:10280: \$? = $ac_status" >&5
10281   (exit $ac_status); } &&
10282          { ac_try='test -s conftest.$ac_objext'
10283   { (eval echo "$as_me:10283: \"$ac_try\"") >&5
10284   (eval $ac_try) 2>&5
10285   ac_status=$?
10286   echo "$as_me:10286: \$? = $ac_status" >&5
10287   (exit $ac_status); }; }; then
10288   :
10289 else
10290   echo "$as_me: failed program was:" >&5
10291 cat conftest.$ac_ext >&5
10292 cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE"
10293 fi
10294 rm -f conftest.$ac_objext conftest.$ac_ext
10295          fi
10296
10297 echo "${as_me:-configure}:10297: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
10298
10299          CFLAGS="$cf_trim_CFLAGS"
10300          CPPFLAGS="$cf_trim_CPPFLAGS $cf_cv_posix_c_source"
10301
10302 echo "${as_me:-configure}:10302: testing if the second compile does not leave our definition intact error ..." 1>&5
10303
10304          cat >conftest.$ac_ext <<_ACEOF
10305 #line 10305 "configure"
10306 #include "confdefs.h"
10307 #include <sys/types.h>
10308 int
10309 main ()
10310 {
10311
10312 #ifndef _POSIX_C_SOURCE
10313 make an error
10314 #endif
10315   ;
10316   return 0;
10317 }
10318 _ACEOF
10319 rm -f conftest.$ac_objext
10320 if { (eval echo "$as_me:10320: \"$ac_compile\"") >&5
10321   (eval $ac_compile) 2>&5
10322   ac_status=$?
10323   echo "$as_me:10323: \$? = $ac_status" >&5
10324   (exit $ac_status); } &&
10325          { ac_try='test -s conftest.$ac_objext'
10326   { (eval echo "$as_me:10326: \"$ac_try\"") >&5
10327   (eval $ac_try) 2>&5
10328   ac_status=$?
10329   echo "$as_me:10329: \$? = $ac_status" >&5
10330   (exit $ac_status); }; }; then
10331   :
10332 else
10333   echo "$as_me: failed program was:" >&5
10334 cat conftest.$ac_ext >&5
10335 cf_cv_posix_c_source=no
10336 fi
10337 rm -f conftest.$ac_objext conftest.$ac_ext
10338          CFLAGS="$cf_save_CFLAGS"
10339          CPPFLAGS="$cf_save_CPPFLAGS"
10340
10341 fi
10342 rm -f conftest.$ac_objext conftest.$ac_ext
10343
10344 fi
10345 echo "$as_me:10345: result: $cf_cv_posix_c_source" >&5
10346 echo "${ECHO_T}$cf_cv_posix_c_source" >&6
10347
10348 if test "$cf_cv_posix_c_source" != no ; then
10349         CFLAGS="$cf_trim_CFLAGS"
10350         CPPFLAGS="$cf_trim_CPPFLAGS"
10351
10352 cf_fix_cppflags=no
10353 cf_new_cflags=
10354 cf_new_cppflags=
10355 cf_new_extra_cppflags=
10356
10357 for cf_add_cflags in $cf_cv_posix_c_source
10358 do
10359 case $cf_fix_cppflags in
10360 (no)
10361         case $cf_add_cflags in
10362         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
10363                 case $cf_add_cflags in
10364                 (-D*)
10365                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
10366
10367                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10368                                 && test -z "${cf_tst_cflags}" \
10369                                 && cf_fix_cppflags=yes
10370
10371                         if test $cf_fix_cppflags = yes ; then
10372                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10373                                 continue
10374                         elif test "${cf_tst_cflags}" = "\"'" ; then
10375                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10376                                 continue
10377                         fi
10378                         ;;
10379                 esac
10380                 case "$CPPFLAGS" in
10381                 (*$cf_add_cflags)
10382                         ;;
10383                 (*)
10384                         case $cf_add_cflags in
10385                         (-D*)
10386                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
10387
10388 CPPFLAGS=`echo "$CPPFLAGS" | \
10389         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
10390                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
10391
10392                                 ;;
10393                         esac
10394                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
10395                         ;;
10396                 esac
10397                 ;;
10398         (*)
10399                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
10400                 ;;
10401         esac
10402         ;;
10403 (yes)
10404         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10405
10406         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
10407
10408         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10409                 && test -z "${cf_tst_cflags}" \
10410                 && cf_fix_cppflags=no
10411         ;;
10412 esac
10413 done
10414
10415 if test -n "$cf_new_cflags" ; then
10416
10417         CFLAGS="$CFLAGS $cf_new_cflags"
10418 fi
10419
10420 if test -n "$cf_new_cppflags" ; then
10421
10422         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
10423 fi
10424
10425 if test -n "$cf_new_extra_cppflags" ; then
10426
10427         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
10428 fi
10429
10430 fi
10431
10432         ;;
10433 esac
10434
10435 if test -n "$cf_xopen_source" ; then
10436
10437 cf_fix_cppflags=no
10438 cf_new_cflags=
10439 cf_new_cppflags=
10440 cf_new_extra_cppflags=
10441
10442 for cf_add_cflags in $cf_xopen_source
10443 do
10444 case $cf_fix_cppflags in
10445 (no)
10446         case $cf_add_cflags in
10447         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
10448                 case $cf_add_cflags in
10449                 (-D*)
10450                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
10451
10452                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10453                                 && test -z "${cf_tst_cflags}" \
10454                                 && cf_fix_cppflags=yes
10455
10456                         if test $cf_fix_cppflags = yes ; then
10457                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10458                                 continue
10459                         elif test "${cf_tst_cflags}" = "\"'" ; then
10460                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10461                                 continue
10462                         fi
10463                         ;;
10464                 esac
10465                 case "$CPPFLAGS" in
10466                 (*$cf_add_cflags)
10467                         ;;
10468                 (*)
10469                         case $cf_add_cflags in
10470                         (-D*)
10471                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
10472
10473 CPPFLAGS=`echo "$CPPFLAGS" | \
10474         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
10475                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
10476
10477                                 ;;
10478                         esac
10479                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
10480                         ;;
10481                 esac
10482                 ;;
10483         (*)
10484                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
10485                 ;;
10486         esac
10487         ;;
10488 (yes)
10489         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10490
10491         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
10492
10493         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10494                 && test -z "${cf_tst_cflags}" \
10495                 && cf_fix_cppflags=no
10496         ;;
10497 esac
10498 done
10499
10500 if test -n "$cf_new_cflags" ; then
10501         test -n "$verbose" && echo "    add to \$CFLAGS $cf_new_cflags" 1>&6
10502
10503 echo "${as_me:-configure}:10503: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
10504
10505         CFLAGS="$CFLAGS $cf_new_cflags"
10506 fi
10507
10508 if test -n "$cf_new_cppflags" ; then
10509         test -n "$verbose" && echo "    add to \$CPPFLAGS $cf_new_cppflags" 1>&6
10510
10511 echo "${as_me:-configure}:10511: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
10512
10513         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
10514 fi
10515
10516 if test -n "$cf_new_extra_cppflags" ; then
10517         test -n "$verbose" && echo "    add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6
10518
10519 echo "${as_me:-configure}:10519: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
10520
10521         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
10522 fi
10523
10524 fi
10525
10526 if test -n "$cf_XOPEN_SOURCE" && test -z "$cf_cv_xopen_source" ; then
10527         echo "$as_me:10527: checking if _XOPEN_SOURCE really is set" >&5
10528 echo $ECHO_N "checking if _XOPEN_SOURCE really is set... $ECHO_C" >&6
10529         cat >conftest.$ac_ext <<_ACEOF
10530 #line 10530 "configure"
10531 #include "confdefs.h"
10532 #include <stdlib.h>
10533 int
10534 main ()
10535 {
10536
10537 #ifndef _XOPEN_SOURCE
10538 make an error
10539 #endif
10540   ;
10541   return 0;
10542 }
10543 _ACEOF
10544 rm -f conftest.$ac_objext
10545 if { (eval echo "$as_me:10545: \"$ac_compile\"") >&5
10546   (eval $ac_compile) 2>&5
10547   ac_status=$?
10548   echo "$as_me:10548: \$? = $ac_status" >&5
10549   (exit $ac_status); } &&
10550          { ac_try='test -s conftest.$ac_objext'
10551   { (eval echo "$as_me:10551: \"$ac_try\"") >&5
10552   (eval $ac_try) 2>&5
10553   ac_status=$?
10554   echo "$as_me:10554: \$? = $ac_status" >&5
10555   (exit $ac_status); }; }; then
10556   cf_XOPEN_SOURCE_set=yes
10557 else
10558   echo "$as_me: failed program was:" >&5
10559 cat conftest.$ac_ext >&5
10560 cf_XOPEN_SOURCE_set=no
10561 fi
10562 rm -f conftest.$ac_objext conftest.$ac_ext
10563         echo "$as_me:10563: result: $cf_XOPEN_SOURCE_set" >&5
10564 echo "${ECHO_T}$cf_XOPEN_SOURCE_set" >&6
10565         if test $cf_XOPEN_SOURCE_set = yes
10566         then
10567                 cat >conftest.$ac_ext <<_ACEOF
10568 #line 10568 "configure"
10569 #include "confdefs.h"
10570 #include <stdlib.h>
10571 int
10572 main ()
10573 {
10574
10575 #if (_XOPEN_SOURCE - 0) < $cf_XOPEN_SOURCE
10576 make an error
10577 #endif
10578   ;
10579   return 0;
10580 }
10581 _ACEOF
10582 rm -f conftest.$ac_objext
10583 if { (eval echo "$as_me:10583: \"$ac_compile\"") >&5
10584   (eval $ac_compile) 2>&5
10585   ac_status=$?
10586   echo "$as_me:10586: \$? = $ac_status" >&5
10587   (exit $ac_status); } &&
10588          { ac_try='test -s conftest.$ac_objext'
10589   { (eval echo "$as_me:10589: \"$ac_try\"") >&5
10590   (eval $ac_try) 2>&5
10591   ac_status=$?
10592   echo "$as_me:10592: \$? = $ac_status" >&5
10593   (exit $ac_status); }; }; then
10594   cf_XOPEN_SOURCE_set_ok=yes
10595 else
10596   echo "$as_me: failed program was:" >&5
10597 cat conftest.$ac_ext >&5
10598 cf_XOPEN_SOURCE_set_ok=no
10599 fi
10600 rm -f conftest.$ac_objext conftest.$ac_ext
10601                 if test $cf_XOPEN_SOURCE_set_ok = no
10602                 then
10603                         { echo "$as_me:10603: WARNING: _XOPEN_SOURCE is lower than requested" >&5
10604 echo "$as_me: WARNING: _XOPEN_SOURCE is lower than requested" >&2;}
10605                 fi
10606         else
10607
10608 echo "$as_me:10608: checking if we should define _XOPEN_SOURCE" >&5
10609 echo $ECHO_N "checking if we should define _XOPEN_SOURCE... $ECHO_C" >&6
10610 if test "${cf_cv_xopen_source+set}" = set; then
10611   echo $ECHO_N "(cached) $ECHO_C" >&6
10612 else
10613
10614         cat >conftest.$ac_ext <<_ACEOF
10615 #line 10615 "configure"
10616 #include "confdefs.h"
10617
10618 #include <stdlib.h>
10619 #include <string.h>
10620 #include <sys/types.h>
10621
10622 int
10623 main ()
10624 {
10625
10626 #ifndef _XOPEN_SOURCE
10627 make an error
10628 #endif
10629   ;
10630   return 0;
10631 }
10632 _ACEOF
10633 rm -f conftest.$ac_objext
10634 if { (eval echo "$as_me:10634: \"$ac_compile\"") >&5
10635   (eval $ac_compile) 2>&5
10636   ac_status=$?
10637   echo "$as_me:10637: \$? = $ac_status" >&5
10638   (exit $ac_status); } &&
10639          { ac_try='test -s conftest.$ac_objext'
10640   { (eval echo "$as_me:10640: \"$ac_try\"") >&5
10641   (eval $ac_try) 2>&5
10642   ac_status=$?
10643   echo "$as_me:10643: \$? = $ac_status" >&5
10644   (exit $ac_status); }; }; then
10645   cf_cv_xopen_source=no
10646 else
10647   echo "$as_me: failed program was:" >&5
10648 cat conftest.$ac_ext >&5
10649 cf_save="$CPPFLAGS"
10650          CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
10651          cat >conftest.$ac_ext <<_ACEOF
10652 #line 10652 "configure"
10653 #include "confdefs.h"
10654
10655 #include <stdlib.h>
10656 #include <string.h>
10657 #include <sys/types.h>
10658
10659 int
10660 main ()
10661 {
10662
10663 #ifdef _XOPEN_SOURCE
10664 make an error
10665 #endif
10666   ;
10667   return 0;
10668 }
10669 _ACEOF
10670 rm -f conftest.$ac_objext
10671 if { (eval echo "$as_me:10671: \"$ac_compile\"") >&5
10672   (eval $ac_compile) 2>&5
10673   ac_status=$?
10674   echo "$as_me:10674: \$? = $ac_status" >&5
10675   (exit $ac_status); } &&
10676          { ac_try='test -s conftest.$ac_objext'
10677   { (eval echo "$as_me:10677: \"$ac_try\"") >&5
10678   (eval $ac_try) 2>&5
10679   ac_status=$?
10680   echo "$as_me:10680: \$? = $ac_status" >&5
10681   (exit $ac_status); }; }; then
10682   cf_cv_xopen_source=no
10683 else
10684   echo "$as_me: failed program was:" >&5
10685 cat conftest.$ac_ext >&5
10686 cf_cv_xopen_source=$cf_XOPEN_SOURCE
10687 fi
10688 rm -f conftest.$ac_objext conftest.$ac_ext
10689         CPPFLAGS="$cf_save"
10690
10691 fi
10692 rm -f conftest.$ac_objext conftest.$ac_ext
10693
10694 fi
10695 echo "$as_me:10695: result: $cf_cv_xopen_source" >&5
10696 echo "${ECHO_T}$cf_cv_xopen_source" >&6
10697
10698 if test "$cf_cv_xopen_source" != no ; then
10699
10700 CFLAGS=`echo "$CFLAGS" | \
10701         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
10702                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
10703
10704 CPPFLAGS=`echo "$CPPFLAGS" | \
10705         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
10706                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
10707
10708         cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source"
10709
10710 cf_fix_cppflags=no
10711 cf_new_cflags=
10712 cf_new_cppflags=
10713 cf_new_extra_cppflags=
10714
10715 for cf_add_cflags in $cf_temp_xopen_source
10716 do
10717 case $cf_fix_cppflags in
10718 (no)
10719         case $cf_add_cflags in
10720         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
10721                 case $cf_add_cflags in
10722                 (-D*)
10723                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
10724
10725                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10726                                 && test -z "${cf_tst_cflags}" \
10727                                 && cf_fix_cppflags=yes
10728
10729                         if test $cf_fix_cppflags = yes ; then
10730                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10731                                 continue
10732                         elif test "${cf_tst_cflags}" = "\"'" ; then
10733                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10734                                 continue
10735                         fi
10736                         ;;
10737                 esac
10738                 case "$CPPFLAGS" in
10739                 (*$cf_add_cflags)
10740                         ;;
10741                 (*)
10742                         case $cf_add_cflags in
10743                         (-D*)
10744                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
10745
10746 CPPFLAGS=`echo "$CPPFLAGS" | \
10747         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
10748                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
10749
10750                                 ;;
10751                         esac
10752                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
10753                         ;;
10754                 esac
10755                 ;;
10756         (*)
10757                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
10758                 ;;
10759         esac
10760         ;;
10761 (yes)
10762         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10763
10764         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
10765
10766         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10767                 && test -z "${cf_tst_cflags}" \
10768                 && cf_fix_cppflags=no
10769         ;;
10770 esac
10771 done
10772
10773 if test -n "$cf_new_cflags" ; then
10774
10775         CFLAGS="$CFLAGS $cf_new_cflags"
10776 fi
10777
10778 if test -n "$cf_new_cppflags" ; then
10779
10780         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
10781 fi
10782
10783 if test -n "$cf_new_extra_cppflags" ; then
10784
10785         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
10786 fi
10787
10788 fi
10789
10790         fi
10791 fi
10792
10793 # Check whether --enable-largefile or --disable-largefile was given.
10794 if test "${enable_largefile+set}" = set; then
10795   enableval="$enable_largefile"
10796
10797 fi;
10798 if test "$enable_largefile" != no; then
10799
10800   echo "$as_me:10800: checking for special C compiler options needed for large files" >&5
10801 echo $ECHO_N "checking for special C compiler options needed for large files... $ECHO_C" >&6
10802 if test "${ac_cv_sys_largefile_CC+set}" = set; then
10803   echo $ECHO_N "(cached) $ECHO_C" >&6
10804 else
10805   ac_cv_sys_largefile_CC=no
10806      if test "$GCC" != yes; then
10807        ac_save_CC=$CC
10808        while :; do
10809          # IRIX 6.2 and later do not support large files by default,
10810          # so use the C compiler's -n32 option if that helps.
10811          cat >conftest.$ac_ext <<_ACEOF
10812 #line 10812 "configure"
10813 #include "confdefs.h"
10814 #include <sys/types.h>
10815  /* Check that off_t can represent 2**63 - 1 correctly.
10816     We can't simply define LARGE_OFF_T to be 9223372036854775807,
10817     since some C++ compilers masquerading as C compilers
10818     incorrectly reject 9223372036854775807.  */
10819 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
10820   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
10821                        && LARGE_OFF_T % 2147483647 == 1)
10822                       ? 1 : -1];
10823 int
10824 main ()
10825 {
10826
10827   ;
10828   return 0;
10829 }
10830 _ACEOF
10831          rm -f conftest.$ac_objext
10832 if { (eval echo "$as_me:10832: \"$ac_compile\"") >&5
10833   (eval $ac_compile) 2>&5
10834   ac_status=$?
10835   echo "$as_me:10835: \$? = $ac_status" >&5
10836   (exit $ac_status); } &&
10837          { ac_try='test -s conftest.$ac_objext'
10838   { (eval echo "$as_me:10838: \"$ac_try\"") >&5
10839   (eval $ac_try) 2>&5
10840   ac_status=$?
10841   echo "$as_me:10841: \$? = $ac_status" >&5
10842   (exit $ac_status); }; }; then
10843   break
10844 else
10845   echo "$as_me: failed program was:" >&5
10846 cat conftest.$ac_ext >&5
10847 fi
10848 rm -f conftest.$ac_objext
10849          CC="$CC -n32"
10850          rm -f conftest.$ac_objext
10851 if { (eval echo "$as_me:10851: \"$ac_compile\"") >&5
10852   (eval $ac_compile) 2>&5
10853   ac_status=$?
10854   echo "$as_me:10854: \$? = $ac_status" >&5
10855   (exit $ac_status); } &&
10856          { ac_try='test -s conftest.$ac_objext'
10857   { (eval echo "$as_me:10857: \"$ac_try\"") >&5
10858   (eval $ac_try) 2>&5
10859   ac_status=$?
10860   echo "$as_me:10860: \$? = $ac_status" >&5
10861   (exit $ac_status); }; }; then
10862   ac_cv_sys_largefile_CC=' -n32'; break
10863 else
10864   echo "$as_me: failed program was:" >&5
10865 cat conftest.$ac_ext >&5
10866 fi
10867 rm -f conftest.$ac_objext
10868          break
10869        done
10870        CC=$ac_save_CC
10871        rm -f conftest.$ac_ext
10872     fi
10873 fi
10874 echo "$as_me:10874: result: $ac_cv_sys_largefile_CC" >&5
10875 echo "${ECHO_T}$ac_cv_sys_largefile_CC" >&6
10876   if test "$ac_cv_sys_largefile_CC" != no; then
10877     CC=$CC$ac_cv_sys_largefile_CC
10878   fi
10879
10880   echo "$as_me:10880: checking for _FILE_OFFSET_BITS value needed for large files" >&5
10881 echo $ECHO_N "checking for _FILE_OFFSET_BITS value needed for large files... $ECHO_C" >&6
10882 if test "${ac_cv_sys_file_offset_bits+set}" = set; then
10883   echo $ECHO_N "(cached) $ECHO_C" >&6
10884 else
10885   while :; do
10886   ac_cv_sys_file_offset_bits=no
10887   cat >conftest.$ac_ext <<_ACEOF
10888 #line 10888 "configure"
10889 #include "confdefs.h"
10890 #include <sys/types.h>
10891  /* Check that off_t can represent 2**63 - 1 correctly.
10892     We can't simply define LARGE_OFF_T to be 9223372036854775807,
10893     since some C++ compilers masquerading as C compilers
10894     incorrectly reject 9223372036854775807.  */
10895 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
10896   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
10897                        && LARGE_OFF_T % 2147483647 == 1)
10898                       ? 1 : -1];
10899 int
10900 main ()
10901 {
10902
10903   ;
10904   return 0;
10905 }
10906 _ACEOF
10907 rm -f conftest.$ac_objext
10908 if { (eval echo "$as_me:10908: \"$ac_compile\"") >&5
10909   (eval $ac_compile) 2>&5
10910   ac_status=$?
10911   echo "$as_me:10911: \$? = $ac_status" >&5
10912   (exit $ac_status); } &&
10913          { ac_try='test -s conftest.$ac_objext'
10914   { (eval echo "$as_me:10914: \"$ac_try\"") >&5
10915   (eval $ac_try) 2>&5
10916   ac_status=$?
10917   echo "$as_me:10917: \$? = $ac_status" >&5
10918   (exit $ac_status); }; }; then
10919   break
10920 else
10921   echo "$as_me: failed program was:" >&5
10922 cat conftest.$ac_ext >&5
10923 fi
10924 rm -f conftest.$ac_objext conftest.$ac_ext
10925   cat >conftest.$ac_ext <<_ACEOF
10926 #line 10926 "configure"
10927 #include "confdefs.h"
10928 #define _FILE_OFFSET_BITS 64
10929 #include <sys/types.h>
10930  /* Check that off_t can represent 2**63 - 1 correctly.
10931     We can't simply define LARGE_OFF_T to be 9223372036854775807,
10932     since some C++ compilers masquerading as C compilers
10933     incorrectly reject 9223372036854775807.  */
10934 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
10935   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
10936                        && LARGE_OFF_T % 2147483647 == 1)
10937                       ? 1 : -1];
10938 int
10939 main ()
10940 {
10941
10942   ;
10943   return 0;
10944 }
10945 _ACEOF
10946 rm -f conftest.$ac_objext
10947 if { (eval echo "$as_me:10947: \"$ac_compile\"") >&5
10948   (eval $ac_compile) 2>&5
10949   ac_status=$?
10950   echo "$as_me:10950: \$? = $ac_status" >&5
10951   (exit $ac_status); } &&
10952          { ac_try='test -s conftest.$ac_objext'
10953   { (eval echo "$as_me:10953: \"$ac_try\"") >&5
10954   (eval $ac_try) 2>&5
10955   ac_status=$?
10956   echo "$as_me:10956: \$? = $ac_status" >&5
10957   (exit $ac_status); }; }; then
10958   ac_cv_sys_file_offset_bits=64; break
10959 else
10960   echo "$as_me: failed program was:" >&5
10961 cat conftest.$ac_ext >&5
10962 fi
10963 rm -f conftest.$ac_objext conftest.$ac_ext
10964   break
10965 done
10966 fi
10967 echo "$as_me:10967: result: $ac_cv_sys_file_offset_bits" >&5
10968 echo "${ECHO_T}$ac_cv_sys_file_offset_bits" >&6
10969 if test "$ac_cv_sys_file_offset_bits" != no; then
10970
10971 cat >>confdefs.h <<EOF
10972 #define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits
10973 EOF
10974
10975 fi
10976 rm -rf conftest*
10977   echo "$as_me:10977: checking for _LARGE_FILES value needed for large files" >&5
10978 echo $ECHO_N "checking for _LARGE_FILES value needed for large files... $ECHO_C" >&6
10979 if test "${ac_cv_sys_large_files+set}" = set; then
10980   echo $ECHO_N "(cached) $ECHO_C" >&6
10981 else
10982   while :; do
10983   ac_cv_sys_large_files=no
10984   cat >conftest.$ac_ext <<_ACEOF
10985 #line 10985 "configure"
10986 #include "confdefs.h"
10987 #include <sys/types.h>
10988  /* Check that off_t can represent 2**63 - 1 correctly.
10989     We can't simply define LARGE_OFF_T to be 9223372036854775807,
10990     since some C++ compilers masquerading as C compilers
10991     incorrectly reject 9223372036854775807.  */
10992 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
10993   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
10994                        && LARGE_OFF_T % 2147483647 == 1)
10995                       ? 1 : -1];
10996 int
10997 main ()
10998 {
10999
11000   ;
11001   return 0;
11002 }
11003 _ACEOF
11004 rm -f conftest.$ac_objext
11005 if { (eval echo "$as_me:11005: \"$ac_compile\"") >&5
11006   (eval $ac_compile) 2>&5
11007   ac_status=$?
11008   echo "$as_me:11008: \$? = $ac_status" >&5
11009   (exit $ac_status); } &&
11010          { ac_try='test -s conftest.$ac_objext'
11011   { (eval echo "$as_me:11011: \"$ac_try\"") >&5
11012   (eval $ac_try) 2>&5
11013   ac_status=$?
11014   echo "$as_me:11014: \$? = $ac_status" >&5
11015   (exit $ac_status); }; }; then
11016   break
11017 else
11018   echo "$as_me: failed program was:" >&5
11019 cat conftest.$ac_ext >&5
11020 fi
11021 rm -f conftest.$ac_objext conftest.$ac_ext
11022   cat >conftest.$ac_ext <<_ACEOF
11023 #line 11023 "configure"
11024 #include "confdefs.h"
11025 #define _LARGE_FILES 1
11026 #include <sys/types.h>
11027  /* Check that off_t can represent 2**63 - 1 correctly.
11028     We can't simply define LARGE_OFF_T to be 9223372036854775807,
11029     since some C++ compilers masquerading as C compilers
11030     incorrectly reject 9223372036854775807.  */
11031 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
11032   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
11033                        && LARGE_OFF_T % 2147483647 == 1)
11034                       ? 1 : -1];
11035 int
11036 main ()
11037 {
11038
11039   ;
11040   return 0;
11041 }
11042 _ACEOF
11043 rm -f conftest.$ac_objext
11044 if { (eval echo "$as_me:11044: \"$ac_compile\"") >&5
11045   (eval $ac_compile) 2>&5
11046   ac_status=$?
11047   echo "$as_me:11047: \$? = $ac_status" >&5
11048   (exit $ac_status); } &&
11049          { ac_try='test -s conftest.$ac_objext'
11050   { (eval echo "$as_me:11050: \"$ac_try\"") >&5
11051   (eval $ac_try) 2>&5
11052   ac_status=$?
11053   echo "$as_me:11053: \$? = $ac_status" >&5
11054   (exit $ac_status); }; }; then
11055   ac_cv_sys_large_files=1; break
11056 else
11057   echo "$as_me: failed program was:" >&5
11058 cat conftest.$ac_ext >&5
11059 fi
11060 rm -f conftest.$ac_objext conftest.$ac_ext
11061   break
11062 done
11063 fi
11064 echo "$as_me:11064: result: $ac_cv_sys_large_files" >&5
11065 echo "${ECHO_T}$ac_cv_sys_large_files" >&6
11066 if test "$ac_cv_sys_large_files" != no; then
11067
11068 cat >>confdefs.h <<EOF
11069 #define _LARGE_FILES $ac_cv_sys_large_files
11070 EOF
11071
11072 fi
11073 rm -rf conftest*
11074 fi
11075
11076         if test "$enable_largefile" != no ; then
11077         echo "$as_me:11077: checking for _LARGEFILE_SOURCE value needed for large files" >&5
11078 echo $ECHO_N "checking for _LARGEFILE_SOURCE value needed for large files... $ECHO_C" >&6
11079 if test "${ac_cv_sys_largefile_source+set}" = set; then
11080   echo $ECHO_N "(cached) $ECHO_C" >&6
11081 else
11082   while :; do
11083   ac_cv_sys_largefile_source=no
11084   cat >conftest.$ac_ext <<_ACEOF
11085 #line 11085 "configure"
11086 #include "confdefs.h"
11087 #include <stdio.h>
11088 int
11089 main ()
11090 {
11091 return !fseeko;
11092   ;
11093   return 0;
11094 }
11095 _ACEOF
11096 rm -f conftest.$ac_objext
11097 if { (eval echo "$as_me:11097: \"$ac_compile\"") >&5
11098   (eval $ac_compile) 2>&5
11099   ac_status=$?
11100   echo "$as_me:11100: \$? = $ac_status" >&5
11101   (exit $ac_status); } &&
11102          { ac_try='test -s conftest.$ac_objext'
11103   { (eval echo "$as_me:11103: \"$ac_try\"") >&5
11104   (eval $ac_try) 2>&5
11105   ac_status=$?
11106   echo "$as_me:11106: \$? = $ac_status" >&5
11107   (exit $ac_status); }; }; then
11108   break
11109 else
11110   echo "$as_me: failed program was:" >&5
11111 cat conftest.$ac_ext >&5
11112 fi
11113 rm -f conftest.$ac_objext conftest.$ac_ext
11114   cat >conftest.$ac_ext <<_ACEOF
11115 #line 11115 "configure"
11116 #include "confdefs.h"
11117 #define _LARGEFILE_SOURCE 1
11118 #include <stdio.h>
11119 int
11120 main ()
11121 {
11122 return !fseeko;
11123   ;
11124   return 0;
11125 }
11126 _ACEOF
11127 rm -f conftest.$ac_objext
11128 if { (eval echo "$as_me:11128: \"$ac_compile\"") >&5
11129   (eval $ac_compile) 2>&5
11130   ac_status=$?
11131   echo "$as_me:11131: \$? = $ac_status" >&5
11132   (exit $ac_status); } &&
11133          { ac_try='test -s conftest.$ac_objext'
11134   { (eval echo "$as_me:11134: \"$ac_try\"") >&5
11135   (eval $ac_try) 2>&5
11136   ac_status=$?
11137   echo "$as_me:11137: \$? = $ac_status" >&5
11138   (exit $ac_status); }; }; then
11139   ac_cv_sys_largefile_source=1; break
11140 else
11141   echo "$as_me: failed program was:" >&5
11142 cat conftest.$ac_ext >&5
11143 fi
11144 rm -f conftest.$ac_objext conftest.$ac_ext
11145   break
11146 done
11147 fi
11148 echo "$as_me:11148: result: $ac_cv_sys_largefile_source" >&5
11149 echo "${ECHO_T}$ac_cv_sys_largefile_source" >&6
11150 if test "$ac_cv_sys_largefile_source" != no; then
11151
11152 cat >>confdefs.h <<EOF
11153 #define _LARGEFILE_SOURCE $ac_cv_sys_largefile_source
11154 EOF
11155
11156 fi
11157 rm -rf conftest*
11158
11159 # We used to try defining _XOPEN_SOURCE=500 too, to work around a bug
11160 # in glibc 2.1.3, but that breaks too many other things.
11161 # If you want fseeko and ftello with glibc, upgrade to a fixed glibc.
11162 echo "$as_me:11162: checking for fseeko" >&5
11163 echo $ECHO_N "checking for fseeko... $ECHO_C" >&6
11164 if test "${ac_cv_func_fseeko+set}" = set; then
11165   echo $ECHO_N "(cached) $ECHO_C" >&6
11166 else
11167   cat >conftest.$ac_ext <<_ACEOF
11168 #line 11168 "configure"
11169 #include "confdefs.h"
11170 #include <stdio.h>
11171 int
11172 main ()
11173 {
11174 return fseeko && fseeko (stdin, 0, 0);
11175   ;
11176   return 0;
11177 }
11178 _ACEOF
11179 rm -f conftest.$ac_objext conftest$ac_exeext
11180 if { (eval echo "$as_me:11180: \"$ac_link\"") >&5
11181   (eval $ac_link) 2>&5
11182   ac_status=$?
11183   echo "$as_me:11183: \$? = $ac_status" >&5
11184   (exit $ac_status); } &&
11185          { ac_try='test -s conftest$ac_exeext'
11186   { (eval echo "$as_me:11186: \"$ac_try\"") >&5
11187   (eval $ac_try) 2>&5
11188   ac_status=$?
11189   echo "$as_me:11189: \$? = $ac_status" >&5
11190   (exit $ac_status); }; }; then
11191   ac_cv_func_fseeko=yes
11192 else
11193   echo "$as_me: failed program was:" >&5
11194 cat conftest.$ac_ext >&5
11195 ac_cv_func_fseeko=no
11196 fi
11197 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11198 fi
11199 echo "$as_me:11199: result: $ac_cv_func_fseeko" >&5
11200 echo "${ECHO_T}$ac_cv_func_fseeko" >&6
11201 if test $ac_cv_func_fseeko = yes; then
11202
11203 cat >>confdefs.h <<\EOF
11204 #define HAVE_FSEEKO 1
11205 EOF
11206
11207 fi
11208
11209         # Normally we would collect these definitions in the config.h,
11210         # but (like _XOPEN_SOURCE), some environments rely on having these
11211         # defined before any of the system headers are included.  Another
11212         # case comes up with C++, e.g., on AIX the compiler compiles the
11213         # header files by themselves before looking at the body files it is
11214         # told to compile.  For ncurses, those header files do not include
11215         # the config.h
11216         test "$ac_cv_sys_large_files"      != no && CPPFLAGS="$CPPFLAGS -D_LARGE_FILES "
11217         test "$ac_cv_sys_largefile_source" != no && CPPFLAGS="$CPPFLAGS -D_LARGEFILE_SOURCE "
11218         test "$ac_cv_sys_file_offset_bits" != no && CPPFLAGS="$CPPFLAGS -D_FILE_OFFSET_BITS=$ac_cv_sys_file_offset_bits "
11219
11220         echo "$as_me:11220: checking whether to use struct dirent64" >&5
11221 echo $ECHO_N "checking whether to use struct dirent64... $ECHO_C" >&6
11222 if test "${cf_cv_struct_dirent64+set}" = set; then
11223   echo $ECHO_N "(cached) $ECHO_C" >&6
11224 else
11225
11226                 cat >conftest.$ac_ext <<_ACEOF
11227 #line 11227 "configure"
11228 #include "confdefs.h"
11229
11230 #include <sys/types.h>
11231 #include <dirent.h>
11232
11233 int
11234 main ()
11235 {
11236
11237                 /* if transitional largefile support is setup, this is true */
11238                 extern struct dirent64 * readdir(DIR *);
11239                 struct dirent64 *x = readdir((DIR *)0);
11240                 struct dirent *y = readdir((DIR *)0);
11241                 int z = x - y;
11242
11243   ;
11244   return 0;
11245 }
11246 _ACEOF
11247 rm -f conftest.$ac_objext
11248 if { (eval echo "$as_me:11248: \"$ac_compile\"") >&5
11249   (eval $ac_compile) 2>&5
11250   ac_status=$?
11251   echo "$as_me:11251: \$? = $ac_status" >&5
11252   (exit $ac_status); } &&
11253          { ac_try='test -s conftest.$ac_objext'
11254   { (eval echo "$as_me:11254: \"$ac_try\"") >&5
11255   (eval $ac_try) 2>&5
11256   ac_status=$?
11257   echo "$as_me:11257: \$? = $ac_status" >&5
11258   (exit $ac_status); }; }; then
11259   cf_cv_struct_dirent64=yes
11260 else
11261   echo "$as_me: failed program was:" >&5
11262 cat conftest.$ac_ext >&5
11263 cf_cv_struct_dirent64=no
11264 fi
11265 rm -f conftest.$ac_objext conftest.$ac_ext
11266
11267 fi
11268 echo "$as_me:11268: result: $cf_cv_struct_dirent64" >&5
11269 echo "${ECHO_T}$cf_cv_struct_dirent64" >&6
11270         test "$cf_cv_struct_dirent64" = yes &&
11271 cat >>confdefs.h <<\EOF
11272 #define HAVE_STRUCT_DIRENT64 1
11273 EOF
11274
11275         fi
11276
11277 ### Enable compiling-in rcs id's
11278 echo "$as_me:11278: checking if RCS identifiers should be compiled-in" >&5
11279 echo $ECHO_N "checking if RCS identifiers should be compiled-in... $ECHO_C" >&6
11280
11281 # Check whether --with-rcs-ids or --without-rcs-ids was given.
11282 if test "${with_rcs_ids+set}" = set; then
11283   withval="$with_rcs_ids"
11284   with_rcs_ids=$withval
11285 else
11286   with_rcs_ids=no
11287 fi;
11288 echo "$as_me:11288: result: $with_rcs_ids" >&5
11289 echo "${ECHO_T}$with_rcs_ids" >&6
11290 test "$with_rcs_ids" = yes &&
11291 cat >>confdefs.h <<\EOF
11292 #define USE_RCS_IDS 1
11293 EOF
11294
11295 ###############################################################################
11296
11297 ### Note that some functions (such as const) are normally disabled anyway.
11298 echo "$as_me:11298: checking if you want to build with function extensions" >&5
11299 echo $ECHO_N "checking if you want to build with function extensions... $ECHO_C" >&6
11300
11301 # Check whether --enable-ext-funcs or --disable-ext-funcs was given.
11302 if test "${enable_ext_funcs+set}" = set; then
11303   enableval="$enable_ext_funcs"
11304   with_ext_funcs=$enableval
11305 else
11306   with_ext_funcs=yes
11307 fi;
11308 echo "$as_me:11308: result: $with_ext_funcs" >&5
11309 echo "${ECHO_T}$with_ext_funcs" >&6
11310 if test "$with_ext_funcs" = yes ; then
11311         NCURSES_EXT_FUNCS=1
11312
11313 cat >>confdefs.h <<\EOF
11314 #define HAVE_USE_DEFAULT_COLORS 1
11315 EOF
11316
11317 cat >>confdefs.h <<\EOF
11318 #define NCURSES_EXT_FUNCS 1
11319 EOF
11320
11321 else
11322         NCURSES_EXT_FUNCS=0
11323 fi
11324
11325 ###   use option --enable-const to turn on use of const beyond that in XSI.
11326 echo "$as_me:11326: checking for extended use of const keyword" >&5
11327 echo $ECHO_N "checking for extended use of const keyword... $ECHO_C" >&6
11328
11329 # Check whether --enable-const or --disable-const was given.
11330 if test "${enable_const+set}" = set; then
11331   enableval="$enable_const"
11332   with_ext_const=$enableval
11333 else
11334   with_ext_const=no
11335 fi;
11336 echo "$as_me:11336: result: $with_ext_const" >&5
11337 echo "${ECHO_T}$with_ext_const" >&6
11338 NCURSES_CONST='/*nothing*/'
11339 if test "$with_ext_const" = yes ; then
11340         NCURSES_CONST=const
11341 fi
11342
11343 ###############################################################################
11344 # These options are relatively safe to experiment with.
11345
11346 echo "$as_me:11346: checking if you want all development code" >&5
11347 echo $ECHO_N "checking if you want all development code... $ECHO_C" >&6
11348
11349 # Check whether --with-develop or --without-develop was given.
11350 if test "${with_develop+set}" = set; then
11351   withval="$with_develop"
11352   with_develop=$withval
11353 else
11354   with_develop=no
11355 fi;
11356 echo "$as_me:11356: result: $with_develop" >&5
11357 echo "${ECHO_T}$with_develop" >&6
11358
11359 ###############################################################################
11360 # These are just experimental, probably should not be in a package:
11361
11362 # This is still experimental (20080329), but should ultimately be moved to
11363 # the script-block --with-normal, etc.
11364
11365 echo "$as_me:11365: checking if you want to link with the pthread library" >&5
11366 echo $ECHO_N "checking if you want to link with the pthread library... $ECHO_C" >&6
11367
11368 # Check whether --with-pthread or --without-pthread was given.
11369 if test "${with_pthread+set}" = set; then
11370   withval="$with_pthread"
11371   with_pthread=$withval
11372 else
11373   with_pthread=no
11374 fi;
11375 echo "$as_me:11375: result: $with_pthread" >&5
11376 echo "${ECHO_T}$with_pthread" >&6
11377
11378 if test "$with_pthread" != no ; then
11379         echo "$as_me:11379: checking for pthread.h" >&5
11380 echo $ECHO_N "checking for pthread.h... $ECHO_C" >&6
11381 if test "${ac_cv_header_pthread_h+set}" = set; then
11382   echo $ECHO_N "(cached) $ECHO_C" >&6
11383 else
11384   cat >conftest.$ac_ext <<_ACEOF
11385 #line 11385 "configure"
11386 #include "confdefs.h"
11387 #include <pthread.h>
11388 _ACEOF
11389 if { (eval echo "$as_me:11389: \"$ac_cpp conftest.$ac_ext\"") >&5
11390   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
11391   ac_status=$?
11392   egrep -v '^ *\+' conftest.er1 >conftest.err
11393   rm -f conftest.er1
11394   cat conftest.err >&5
11395   echo "$as_me:11395: \$? = $ac_status" >&5
11396   (exit $ac_status); } >/dev/null; then
11397   if test -s conftest.err; then
11398     ac_cpp_err=$ac_c_preproc_warn_flag
11399   else
11400     ac_cpp_err=
11401   fi
11402 else
11403   ac_cpp_err=yes
11404 fi
11405 if test -z "$ac_cpp_err"; then
11406   ac_cv_header_pthread_h=yes
11407 else
11408   echo "$as_me: failed program was:" >&5
11409   cat conftest.$ac_ext >&5
11410   ac_cv_header_pthread_h=no
11411 fi
11412 rm -f conftest.err conftest.$ac_ext
11413 fi
11414 echo "$as_me:11414: result: $ac_cv_header_pthread_h" >&5
11415 echo "${ECHO_T}$ac_cv_header_pthread_h" >&6
11416 if test $ac_cv_header_pthread_h = yes; then
11417
11418 cat >>confdefs.h <<\EOF
11419 #define HAVE_PTHREADS_H 1
11420 EOF
11421
11422         for cf_lib_pthread in pthread c_r
11423         do
11424             echo "$as_me:11424: checking if we can link with the $cf_lib_pthread library" >&5
11425 echo $ECHO_N "checking if we can link with the $cf_lib_pthread library... $ECHO_C" >&6
11426             cf_save_LIBS="$LIBS"
11427
11428 cf_add_libs="-l$cf_lib_pthread"
11429 # Filter out duplicates - this happens with badly-designed ".pc" files...
11430 for cf_add_1lib in $LIBS
11431 do
11432         for cf_add_2lib in $cf_add_libs
11433         do
11434                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
11435                 then
11436                         cf_add_1lib=
11437                         break
11438                 fi
11439         done
11440         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
11441 done
11442 LIBS="$cf_add_libs"
11443
11444             cat >conftest.$ac_ext <<_ACEOF
11445 #line 11445 "configure"
11446 #include "confdefs.h"
11447
11448 #include <pthread.h>
11449
11450 int
11451 main ()
11452 {
11453
11454                 int rc = pthread_create(0,0,0,0);
11455                 int r2 = pthread_mutexattr_settype(0, 0);
11456
11457   ;
11458   return 0;
11459 }
11460 _ACEOF
11461 rm -f conftest.$ac_objext conftest$ac_exeext
11462 if { (eval echo "$as_me:11462: \"$ac_link\"") >&5
11463   (eval $ac_link) 2>&5
11464   ac_status=$?
11465   echo "$as_me:11465: \$? = $ac_status" >&5
11466   (exit $ac_status); } &&
11467          { ac_try='test -s conftest$ac_exeext'
11468   { (eval echo "$as_me:11468: \"$ac_try\"") >&5
11469   (eval $ac_try) 2>&5
11470   ac_status=$?
11471   echo "$as_me:11471: \$? = $ac_status" >&5
11472   (exit $ac_status); }; }; then
11473   with_pthread=yes
11474 else
11475   echo "$as_me: failed program was:" >&5
11476 cat conftest.$ac_ext >&5
11477 with_pthread=no
11478 fi
11479 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11480             LIBS="$cf_save_LIBS"
11481             echo "$as_me:11481: result: $with_pthread" >&5
11482 echo "${ECHO_T}$with_pthread" >&6
11483             test "$with_pthread" = yes && break
11484         done
11485
11486         if test "$with_pthread" = yes ; then
11487
11488 cf_add_libs="-l$cf_lib_pthread"
11489 # Filter out duplicates - this happens with badly-designed ".pc" files...
11490 for cf_add_1lib in $LIBS
11491 do
11492         for cf_add_2lib in $cf_add_libs
11493         do
11494                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
11495                 then
11496                         cf_add_1lib=
11497                         break
11498                 fi
11499         done
11500         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
11501 done
11502 LIBS="$cf_add_libs"
11503
11504 cat >>confdefs.h <<\EOF
11505 #define HAVE_LIBPTHREADS 1
11506 EOF
11507
11508         else
11509             { { echo "$as_me:11509: error: Cannot link with pthread library" >&5
11510 echo "$as_me: error: Cannot link with pthread library" >&2;}
11511    { (exit 1); exit 1; }; }
11512         fi
11513
11514 fi
11515
11516 fi
11517
11518 echo "$as_me:11518: checking if you want to use weak-symbols for pthreads" >&5
11519 echo $ECHO_N "checking if you want to use weak-symbols for pthreads... $ECHO_C" >&6
11520
11521 # Check whether --enable-weak-symbols or --disable-weak-symbols was given.
11522 if test "${enable_weak_symbols+set}" = set; then
11523   enableval="$enable_weak_symbols"
11524   use_weak_symbols=$withval
11525 else
11526   use_weak_symbols=no
11527 fi;
11528 echo "$as_me:11528: result: $use_weak_symbols" >&5
11529 echo "${ECHO_T}$use_weak_symbols" >&6
11530 if test "$use_weak_symbols" = yes ; then
11531
11532 echo "$as_me:11532: checking if $CC supports weak symbols" >&5
11533 echo $ECHO_N "checking if $CC supports weak symbols... $ECHO_C" >&6
11534 if test "${cf_cv_weak_symbols+set}" = set; then
11535   echo $ECHO_N "(cached) $ECHO_C" >&6
11536 else
11537
11538 cat >conftest.$ac_ext <<_ACEOF
11539 #line 11539 "configure"
11540 #include "confdefs.h"
11541
11542 #include <stdio.h>
11543 int
11544 main ()
11545 {
11546
11547 #if defined(__GNUC__)
11548 #  if defined __USE_ISOC99
11549 #    define _cat_pragma(exp)    _Pragma(#exp)
11550 #    define _weak_pragma(exp)   _cat_pragma(weak name)
11551 #  else
11552 #    define _weak_pragma(exp)
11553 #  endif
11554 #  define _declare(name)        __extension__ extern __typeof__(name) name
11555 #  define weak_symbol(name)     _weak_pragma(name) _declare(name) __attribute__((weak))
11556 #endif
11557
11558 weak_symbol(fopen);
11559
11560   ;
11561   return 0;
11562 }
11563 _ACEOF
11564 rm -f conftest.$ac_objext
11565 if { (eval echo "$as_me:11565: \"$ac_compile\"") >&5
11566   (eval $ac_compile) 2>&5
11567   ac_status=$?
11568   echo "$as_me:11568: \$? = $ac_status" >&5
11569   (exit $ac_status); } &&
11570          { ac_try='test -s conftest.$ac_objext'
11571   { (eval echo "$as_me:11571: \"$ac_try\"") >&5
11572   (eval $ac_try) 2>&5
11573   ac_status=$?
11574   echo "$as_me:11574: \$? = $ac_status" >&5
11575   (exit $ac_status); }; }; then
11576   cf_cv_weak_symbols=yes
11577 else
11578   echo "$as_me: failed program was:" >&5
11579 cat conftest.$ac_ext >&5
11580 cf_cv_weak_symbols=no
11581 fi
11582 rm -f conftest.$ac_objext conftest.$ac_ext
11583
11584 fi
11585 echo "$as_me:11585: result: $cf_cv_weak_symbols" >&5
11586 echo "${ECHO_T}$cf_cv_weak_symbols" >&6
11587
11588 else
11589         cf_cv_weak_symbols=no
11590 fi
11591
11592 if test $cf_cv_weak_symbols = yes ; then
11593
11594 cat >>confdefs.h <<\EOF
11595 #define USE_WEAK_SYMBOLS 1
11596 EOF
11597
11598 fi
11599
11600 PTHREAD=
11601 if test "$with_pthread" = "yes" ; then
11602
11603 cat >>confdefs.h <<\EOF
11604 #define USE_PTHREADS 1
11605 EOF
11606
11607         enable_reentrant=yes
11608         if test $cf_cv_weak_symbols = yes ; then
11609                 PTHREAD=-lpthread
11610         fi
11611 fi
11612
11613 # OpenSUSE is installing ncurses6, using reentrant option.
11614 echo "$as_me:11614: checking for _nc_TABSIZE" >&5
11615 echo $ECHO_N "checking for _nc_TABSIZE... $ECHO_C" >&6
11616 if test "${ac_cv_func__nc_TABSIZE+set}" = set; then
11617   echo $ECHO_N "(cached) $ECHO_C" >&6
11618 else
11619   cat >conftest.$ac_ext <<_ACEOF
11620 #line 11620 "configure"
11621 #include "confdefs.h"
11622 /* System header to define __stub macros and hopefully few prototypes,
11623     which can conflict with char _nc_TABSIZE (); below.  */
11624 #include <assert.h>
11625 /* Override any gcc2 internal prototype to avoid an error.  */
11626 #ifdef __cplusplus
11627 extern "C"
11628 #endif
11629 /* We use char because int might match the return type of a gcc2
11630    builtin and then its argument prototype would still apply.  */
11631 char _nc_TABSIZE ();
11632 char (*f) ();
11633
11634 int
11635 main ()
11636 {
11637 /* The GNU C library defines this for functions which it implements
11638     to always fail with ENOSYS.  Some functions are actually named
11639     something starting with __ and the normal name is an alias.  */
11640 #if defined (__stub__nc_TABSIZE) || defined (__stub____nc_TABSIZE)
11641 choke me
11642 #else
11643 f = _nc_TABSIZE; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
11644 #endif
11645
11646   ;
11647   return 0;
11648 }
11649 _ACEOF
11650 rm -f conftest.$ac_objext conftest$ac_exeext
11651 if { (eval echo "$as_me:11651: \"$ac_link\"") >&5
11652   (eval $ac_link) 2>&5
11653   ac_status=$?
11654   echo "$as_me:11654: \$? = $ac_status" >&5
11655   (exit $ac_status); } &&
11656          { ac_try='test -s conftest$ac_exeext'
11657   { (eval echo "$as_me:11657: \"$ac_try\"") >&5
11658   (eval $ac_try) 2>&5
11659   ac_status=$?
11660   echo "$as_me:11660: \$? = $ac_status" >&5
11661   (exit $ac_status); }; }; then
11662   ac_cv_func__nc_TABSIZE=yes
11663 else
11664   echo "$as_me: failed program was:" >&5
11665 cat conftest.$ac_ext >&5
11666 ac_cv_func__nc_TABSIZE=no
11667 fi
11668 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11669 fi
11670 echo "$as_me:11670: result: $ac_cv_func__nc_TABSIZE" >&5
11671 echo "${ECHO_T}$ac_cv_func__nc_TABSIZE" >&6
11672 if test $ac_cv_func__nc_TABSIZE = yes; then
11673   assume_reentrant=yes
11674 else
11675   assume_reentrant=no
11676 fi
11677
11678 # Reentrant code has to be opaque; there's little advantage to making ncurses
11679 # opaque outside of that, so there is no --enable-opaque option.  We can use
11680 # this option without --with-pthreads, but this will be always set for
11681 # pthreads.
11682 echo "$as_me:11682: checking if you want experimental reentrant code" >&5
11683 echo $ECHO_N "checking if you want experimental reentrant code... $ECHO_C" >&6
11684
11685 # Check whether --enable-reentrant or --disable-reentrant was given.
11686 if test "${enable_reentrant+set}" = set; then
11687   enableval="$enable_reentrant"
11688   with_reentrant=$enableval
11689 else
11690   with_reentrant=$assume_reentrant
11691 fi;
11692 echo "$as_me:11692: result: $with_reentrant" >&5
11693 echo "${ECHO_T}$with_reentrant" >&6
11694 if test "$with_reentrant" = yes ; then
11695         cf_cv_enable_reentrant=1
11696         if test $cf_cv_weak_symbols = yes ; then
11697
11698 # remove pthread library from $LIBS
11699 LIBS=`echo "$LIBS" | sed -e 's/-lpthread[       ]//g' -e 's/-lpthread$//'`
11700
11701         elif test "$assume_reentrant" = no ; then
11702                 LIB_SUFFIX="t${LIB_SUFFIX}"
11703         fi
11704
11705 cat >>confdefs.h <<\EOF
11706 #define USE_REENTRANT 1
11707 EOF
11708
11709 else
11710         cf_cv_enable_reentrant=0
11711 fi
11712
11713 ### Allow using a different wrap-prefix
11714 if test "$cf_cv_enable_reentrant" != 0 || test "$BROKEN_LINKER" = 1 ; then
11715         echo "$as_me:11715: checking for prefix used to wrap public variables" >&5
11716 echo $ECHO_N "checking for prefix used to wrap public variables... $ECHO_C" >&6
11717
11718 # Check whether --with-wrap-prefix or --without-wrap-prefix was given.
11719 if test "${with_wrap_prefix+set}" = set; then
11720   withval="$with_wrap_prefix"
11721   NCURSES_WRAP_PREFIX=$withval
11722 else
11723   NCURSES_WRAP_PREFIX=_nc_
11724 fi;
11725         echo "$as_me:11725: result: $NCURSES_WRAP_PREFIX" >&5
11726 echo "${ECHO_T}$NCURSES_WRAP_PREFIX" >&6
11727 else
11728         NCURSES_WRAP_PREFIX=_nc_
11729 fi
11730
11731 cat >>confdefs.h <<EOF
11732 #define NCURSES_WRAP_PREFIX "$NCURSES_WRAP_PREFIX"
11733 EOF
11734
11735 ###############################################################################
11736
11737 ###     use option --disable-echo to suppress full display compiling commands
11738
11739 echo "$as_me:11739: checking if you want to see long compiling messages" >&5
11740 echo $ECHO_N "checking if you want to see long compiling messages... $ECHO_C" >&6
11741
11742 # Check whether --enable-echo or --disable-echo was given.
11743 if test "${enable_echo+set}" = set; then
11744   enableval="$enable_echo"
11745   test "$enableval" != no && enableval=yes
11746   if test "$enableval" != "yes" ; then
11747
11748         ECHO_LT='--silent'
11749         ECHO_LD='@echo linking $@;'
11750         RULE_CC='@echo compiling $<'
11751         SHOW_CC='@echo compiling $@'
11752         ECHO_CC='@'
11753
11754   else
11755
11756         ECHO_LT=''
11757         ECHO_LD=''
11758         RULE_CC=''
11759         SHOW_CC=''
11760         ECHO_CC=''
11761
11762   fi
11763 else
11764   enableval=yes
11765
11766         ECHO_LT=''
11767         ECHO_LD=''
11768         RULE_CC=''
11769         SHOW_CC=''
11770         ECHO_CC=''
11771
11772 fi;
11773 echo "$as_me:11773: result: $enableval" >&5
11774 echo "${ECHO_T}$enableval" >&6
11775
11776 ###     use option --enable-warnings to turn on all gcc warnings
11777 echo "$as_me:11777: checking if you want to see compiler warnings" >&5
11778 echo $ECHO_N "checking if you want to see compiler warnings... $ECHO_C" >&6
11779
11780 # Check whether --enable-warnings or --disable-warnings was given.
11781 if test "${enable_warnings+set}" = set; then
11782   enableval="$enable_warnings"
11783   with_warnings=$enableval
11784 fi;
11785 echo "$as_me:11785: result: $with_warnings" >&5
11786 echo "${ECHO_T}$with_warnings" >&6
11787
11788 if test "x$with_warnings" = "xyes"; then
11789
11790         ADAFLAGS="$ADAFLAGS -gnatg"
11791
11792 INTEL_COMPILER=no
11793
11794 if test "$GCC" = yes ; then
11795         case $host_os in
11796         (linux*|gnu*)
11797                 echo "$as_me:11797: checking if this is really Intel C compiler" >&5
11798 echo $ECHO_N "checking if this is really Intel C compiler... $ECHO_C" >&6
11799                 cf_save_CFLAGS="$CFLAGS"
11800                 CFLAGS="$CFLAGS -no-gcc"
11801                 cat >conftest.$ac_ext <<_ACEOF
11802 #line 11802 "configure"
11803 #include "confdefs.h"
11804
11805 int
11806 main ()
11807 {
11808
11809 #ifdef __INTEL_COMPILER
11810 #else
11811 make an error
11812 #endif
11813
11814   ;
11815   return 0;
11816 }
11817 _ACEOF
11818 rm -f conftest.$ac_objext
11819 if { (eval echo "$as_me:11819: \"$ac_compile\"") >&5
11820   (eval $ac_compile) 2>&5
11821   ac_status=$?
11822   echo "$as_me:11822: \$? = $ac_status" >&5
11823   (exit $ac_status); } &&
11824          { ac_try='test -s conftest.$ac_objext'
11825   { (eval echo "$as_me:11825: \"$ac_try\"") >&5
11826   (eval $ac_try) 2>&5
11827   ac_status=$?
11828   echo "$as_me:11828: \$? = $ac_status" >&5
11829   (exit $ac_status); }; }; then
11830   INTEL_COMPILER=yes
11831 cf_save_CFLAGS="$cf_save_CFLAGS -we147"
11832
11833 else
11834   echo "$as_me: failed program was:" >&5
11835 cat conftest.$ac_ext >&5
11836 fi
11837 rm -f conftest.$ac_objext conftest.$ac_ext
11838                 CFLAGS="$cf_save_CFLAGS"
11839                 echo "$as_me:11839: result: $INTEL_COMPILER" >&5
11840 echo "${ECHO_T}$INTEL_COMPILER" >&6
11841                 ;;
11842         esac
11843 fi
11844
11845 CLANG_COMPILER=no
11846
11847 if test "$GCC" = yes ; then
11848         echo "$as_me:11848: checking if this is really Clang C compiler" >&5
11849 echo $ECHO_N "checking if this is really Clang C compiler... $ECHO_C" >&6
11850         cf_save_CFLAGS="$CFLAGS"
11851         CFLAGS="$CFLAGS -Qunused-arguments"
11852         cat >conftest.$ac_ext <<_ACEOF
11853 #line 11853 "configure"
11854 #include "confdefs.h"
11855
11856 int
11857 main ()
11858 {
11859
11860 #ifdef __clang__
11861 #else
11862 make an error
11863 #endif
11864
11865   ;
11866   return 0;
11867 }
11868 _ACEOF
11869 rm -f conftest.$ac_objext
11870 if { (eval echo "$as_me:11870: \"$ac_compile\"") >&5
11871   (eval $ac_compile) 2>&5
11872   ac_status=$?
11873   echo "$as_me:11873: \$? = $ac_status" >&5
11874   (exit $ac_status); } &&
11875          { ac_try='test -s conftest.$ac_objext'
11876   { (eval echo "$as_me:11876: \"$ac_try\"") >&5
11877   (eval $ac_try) 2>&5
11878   ac_status=$?
11879   echo "$as_me:11879: \$? = $ac_status" >&5
11880   (exit $ac_status); }; }; then
11881   CLANG_COMPILER=yes
11882 cf_save_CFLAGS="$cf_save_CFLAGS -Qunused-arguments"
11883
11884 else
11885   echo "$as_me: failed program was:" >&5
11886 cat conftest.$ac_ext >&5
11887 fi
11888 rm -f conftest.$ac_objext conftest.$ac_ext
11889         CFLAGS="$cf_save_CFLAGS"
11890         echo "$as_me:11890: result: $CLANG_COMPILER" >&5
11891 echo "${ECHO_T}$CLANG_COMPILER" >&6
11892 fi
11893
11894 cat > conftest.$ac_ext <<EOF
11895 #line 11895 "${as_me:-configure}"
11896 int main(int argc, char *argv[]) { return (argv[argc-1] == 0) ; }
11897 EOF
11898
11899 if test "$INTEL_COMPILER" = yes
11900 then
11901 # The "-wdXXX" options suppress warnings:
11902 # remark #1419: external declaration in primary source file
11903 # remark #1683: explicit conversion of a 64-bit integral type to a smaller integral type (potential portability problem)
11904 # remark #1684: conversion from pointer to same-sized integral type (potential portability problem)
11905 # remark #193: zero used for undefined preprocessing identifier
11906 # remark #593: variable "curs_sb_left_arrow" was set but never used
11907 # remark #810: conversion from "int" to "Dimension={unsigned short}" may lose significant bits
11908 # remark #869: parameter "tw" was never referenced
11909 # remark #981: operands are evaluated in unspecified order
11910 # warning #279: controlling expression is constant
11911
11912         { echo "$as_me:11912: checking for $CC warning options..." >&5
11913 echo "$as_me: checking for $CC warning options..." >&6;}
11914         cf_save_CFLAGS="$CFLAGS"
11915         EXTRA_CFLAGS="-Wall"
11916         for cf_opt in \
11917                 wd1419 \
11918                 wd1683 \
11919                 wd1684 \
11920                 wd193 \
11921                 wd593 \
11922                 wd279 \
11923                 wd810 \
11924                 wd869 \
11925                 wd981
11926         do
11927                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
11928                 if { (eval echo "$as_me:11928: \"$ac_compile\"") >&5
11929   (eval $ac_compile) 2>&5
11930   ac_status=$?
11931   echo "$as_me:11931: \$? = $ac_status" >&5
11932   (exit $ac_status); }; then
11933                         test -n "$verbose" && echo "$as_me:11933: result: ... -$cf_opt" >&5
11934 echo "${ECHO_T}... -$cf_opt" >&6
11935                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
11936                 fi
11937         done
11938         CFLAGS="$cf_save_CFLAGS"
11939
11940 elif test "$GCC" = yes
11941 then
11942         { echo "$as_me:11942: checking for $CC warning options..." >&5
11943 echo "$as_me: checking for $CC warning options..." >&6;}
11944         cf_save_CFLAGS="$CFLAGS"
11945         EXTRA_CFLAGS=
11946         cf_warn_CONST=""
11947         test "$with_ext_const" = yes && cf_warn_CONST="Wwrite-strings"
11948         cf_gcc_warnings="Wignored-qualifiers Wlogical-op Wvarargs"
11949         test "x$CLANG_COMPILER" = xyes && cf_gcc_warnings=
11950         for cf_opt in W Wall \
11951                 Wbad-function-cast \
11952                 Wcast-align \
11953                 Wcast-qual \
11954                 Wdeclaration-after-statement \
11955                 Wextra \
11956                 Winline \
11957                 Wmissing-declarations \
11958                 Wmissing-prototypes \
11959                 Wnested-externs \
11960                 Wpointer-arith \
11961                 Wshadow \
11962                 Wstrict-prototypes \
11963                 Wundef $cf_gcc_warnings $cf_warn_CONST Wno-unknown-pragmas Wswitch-enum
11964         do
11965                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
11966                 if { (eval echo "$as_me:11966: \"$ac_compile\"") >&5
11967   (eval $ac_compile) 2>&5
11968   ac_status=$?
11969   echo "$as_me:11969: \$? = $ac_status" >&5
11970   (exit $ac_status); }; then
11971                         test -n "$verbose" && echo "$as_me:11971: result: ... -$cf_opt" >&5
11972 echo "${ECHO_T}... -$cf_opt" >&6
11973                         case $cf_opt in
11974                         (Wcast-qual)
11975                                 CPPFLAGS="$CPPFLAGS -DXTSTRINGDEFINES"
11976                                 ;;
11977                         (Winline)
11978                                 case $GCC_VERSION in
11979                                 ([34].*)
11980                                         test -n "$verbose" && echo "    feature is broken in gcc $GCC_VERSION" 1>&6
11981
11982 echo "${as_me:-configure}:11982: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
11983
11984                                         continue;;
11985                                 esac
11986                                 ;;
11987                         (Wpointer-arith)
11988                                 case $GCC_VERSION in
11989                                 ([12].*)
11990                                         test -n "$verbose" && echo "    feature is broken in gcc $GCC_VERSION" 1>&6
11991
11992 echo "${as_me:-configure}:11992: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
11993
11994                                         continue;;
11995                                 esac
11996                                 ;;
11997                         esac
11998                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
11999                 fi
12000         done
12001         CFLAGS="$cf_save_CFLAGS"
12002 fi
12003 rm -rf conftest*
12004
12005 fi
12006
12007 if test "$GCC" = yes
12008 then
12009 cat > conftest.i <<EOF
12010 #ifndef GCC_PRINTF
12011 #define GCC_PRINTF 0
12012 #endif
12013 #ifndef GCC_SCANF
12014 #define GCC_SCANF 0
12015 #endif
12016 #ifndef GCC_NORETURN
12017 #define GCC_NORETURN /* nothing */
12018 #endif
12019 #ifndef GCC_UNUSED
12020 #define GCC_UNUSED /* nothing */
12021 #endif
12022 EOF
12023 if test "$GCC" = yes
12024 then
12025         { echo "$as_me:12025: checking for $CC __attribute__ directives..." >&5
12026 echo "$as_me: checking for $CC __attribute__ directives..." >&6;}
12027 cat > conftest.$ac_ext <<EOF
12028 #line 12028 "${as_me:-configure}"
12029 #include "confdefs.h"
12030 #include "conftest.h"
12031 #include "conftest.i"
12032 #if     GCC_PRINTF
12033 #define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
12034 #else
12035 #define GCC_PRINTFLIKE(fmt,var) /*nothing*/
12036 #endif
12037 #if     GCC_SCANF
12038 #define GCC_SCANFLIKE(fmt,var)  __attribute__((format(scanf,fmt,var)))
12039 #else
12040 #define GCC_SCANFLIKE(fmt,var)  /*nothing*/
12041 #endif
12042 extern void wow(char *,...) GCC_SCANFLIKE(1,2);
12043 extern void oops(char *,...) GCC_PRINTFLIKE(1,2) GCC_NORETURN;
12044 extern void foo(void) GCC_NORETURN;
12045 int main(int argc GCC_UNUSED, char *argv[] GCC_UNUSED) { return 0; }
12046 EOF
12047         cf_printf_attribute=no
12048         cf_scanf_attribute=no
12049         for cf_attribute in scanf printf unused noreturn
12050         do
12051
12052 cf_ATTRIBUTE=`echo "$cf_attribute" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
12053
12054                 cf_directive="__attribute__(($cf_attribute))"
12055                 echo "checking for $CC $cf_directive" 1>&5
12056
12057                 case $cf_attribute in
12058                 (printf)
12059                         cf_printf_attribute=yes
12060                         cat >conftest.h <<EOF
12061 #define GCC_$cf_ATTRIBUTE 1
12062 EOF
12063                         ;;
12064                 (scanf)
12065                         cf_scanf_attribute=yes
12066                         cat >conftest.h <<EOF
12067 #define GCC_$cf_ATTRIBUTE 1
12068 EOF
12069                         ;;
12070                 (*)
12071                         cat >conftest.h <<EOF
12072 #define GCC_$cf_ATTRIBUTE $cf_directive
12073 EOF
12074                         ;;
12075                 esac
12076
12077                 if { (eval echo "$as_me:12077: \"$ac_compile\"") >&5
12078   (eval $ac_compile) 2>&5
12079   ac_status=$?
12080   echo "$as_me:12080: \$? = $ac_status" >&5
12081   (exit $ac_status); }; then
12082                         test -n "$verbose" && echo "$as_me:12082: result: ... $cf_attribute" >&5
12083 echo "${ECHO_T}... $cf_attribute" >&6
12084                         cat conftest.h >>confdefs.h
12085                         case $cf_attribute in
12086                         (noreturn)
12087
12088 cat >>confdefs.h <<EOF
12089 #define GCC_NORETURN $cf_directive
12090 EOF
12091
12092                                 ;;
12093                         (printf)
12094                                 cf_value='/* nothing */'
12095                                 if test "$cf_printf_attribute" != no ; then
12096                                         cf_value='__attribute__((format(printf,fmt,var)))'
12097
12098 cat >>confdefs.h <<\EOF
12099 #define GCC_PRINTF 1
12100 EOF
12101
12102                                 fi
12103
12104 cat >>confdefs.h <<EOF
12105 #define GCC_PRINTFLIKE(fmt,var) $cf_value
12106 EOF
12107
12108                                 ;;
12109                         (scanf)
12110                                 cf_value='/* nothing */'
12111                                 if test "$cf_scanf_attribute" != no ; then
12112                                         cf_value='__attribute__((format(scanf,fmt,var)))'
12113
12114 cat >>confdefs.h <<\EOF
12115 #define GCC_SCANF 1
12116 EOF
12117
12118                                 fi
12119
12120 cat >>confdefs.h <<EOF
12121 #define GCC_SCANFLIKE(fmt,var) $cf_value
12122 EOF
12123
12124                                 ;;
12125                         (unused)
12126
12127 cat >>confdefs.h <<EOF
12128 #define GCC_UNUSED $cf_directive
12129 EOF
12130
12131                                 ;;
12132                         esac
12133                 fi
12134         done
12135 else
12136         fgrep define conftest.i >>confdefs.h
12137 fi
12138 rm -rf conftest*
12139 fi
12140
12141 ###     use option --enable-assertions to turn on generation of assertion code
12142 echo "$as_me:12142: checking if you want to enable runtime assertions" >&5
12143 echo $ECHO_N "checking if you want to enable runtime assertions... $ECHO_C" >&6
12144
12145 # Check whether --enable-assertions or --disable-assertions was given.
12146 if test "${enable_assertions+set}" = set; then
12147   enableval="$enable_assertions"
12148   with_assertions=$enableval
12149 else
12150   with_assertions=no
12151 fi;
12152 echo "$as_me:12152: result: $with_assertions" >&5
12153 echo "${ECHO_T}$with_assertions" >&6
12154 if test -n "$GCC"
12155 then
12156         if test "$with_assertions" = no
12157         then
12158                 CPPFLAGS="$CPPFLAGS -DNDEBUG"
12159         else
12160
12161         ADAFLAGS="$ADAFLAGS -gnata"
12162
12163         fi
12164 fi
12165
12166 ###     use option --disable-leaks to suppress "permanent" leaks, for testing
12167
12168 cat >>confdefs.h <<\EOF
12169 #define HAVE_NC_ALLOC_H 1
12170 EOF
12171
12172 ###     use option --enable-expanded to generate certain macros as functions
12173
12174 # Check whether --enable-expanded or --disable-expanded was given.
12175 if test "${enable_expanded+set}" = set; then
12176   enableval="$enable_expanded"
12177   test "$enableval" = yes &&
12178 cat >>confdefs.h <<\EOF
12179 #define NCURSES_EXPANDED 1
12180 EOF
12181
12182 fi;
12183
12184 ###     use option --disable-macros to suppress macros in favor of functions
12185
12186 # Check whether --enable-macros or --disable-macros was given.
12187 if test "${enable_macros+set}" = set; then
12188   enableval="$enable_macros"
12189   test "$enableval" = no &&
12190 cat >>confdefs.h <<\EOF
12191 #define NCURSES_NOMACROS 1
12192 EOF
12193
12194 fi;
12195
12196 # Normally we only add trace() to the debug-library.  Allow this to be
12197 # extended to all models of the ncurses library:
12198 cf_all_traces=no
12199 case "$CFLAGS $CPPFLAGS" in
12200 (*-DTRACE*)
12201         cf_all_traces=yes
12202         ;;
12203 esac
12204
12205 echo "$as_me:12205: checking whether to add trace feature to all models" >&5
12206 echo $ECHO_N "checking whether to add trace feature to all models... $ECHO_C" >&6
12207
12208 # Check whether --with-trace or --without-trace was given.
12209 if test "${with_trace+set}" = set; then
12210   withval="$with_trace"
12211   cf_with_trace=$withval
12212 else
12213   cf_with_trace=$cf_all_traces
12214 fi;
12215 echo "$as_me:12215: result: $cf_with_trace" >&5
12216 echo "${ECHO_T}$cf_with_trace" >&6
12217
12218 if test "$cf_with_trace" = yes ; then
12219         ADA_TRACE=TRUE
12220
12221 cf_fix_cppflags=no
12222 cf_new_cflags=
12223 cf_new_cppflags=
12224 cf_new_extra_cppflags=
12225
12226 for cf_add_cflags in -DTRACE
12227 do
12228 case $cf_fix_cppflags in
12229 (no)
12230         case $cf_add_cflags in
12231         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
12232                 case $cf_add_cflags in
12233                 (-D*)
12234                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
12235
12236                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12237                                 && test -z "${cf_tst_cflags}" \
12238                                 && cf_fix_cppflags=yes
12239
12240                         if test $cf_fix_cppflags = yes ; then
12241                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
12242                                 continue
12243                         elif test "${cf_tst_cflags}" = "\"'" ; then
12244                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
12245                                 continue
12246                         fi
12247                         ;;
12248                 esac
12249                 case "$CPPFLAGS" in
12250                 (*$cf_add_cflags)
12251                         ;;
12252                 (*)
12253                         case $cf_add_cflags in
12254                         (-D*)
12255                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
12256
12257 CPPFLAGS=`echo "$CPPFLAGS" | \
12258         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
12259                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
12260
12261                                 ;;
12262                         esac
12263                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
12264                         ;;
12265                 esac
12266                 ;;
12267         (*)
12268                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
12269                 ;;
12270         esac
12271         ;;
12272 (yes)
12273         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
12274
12275         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
12276
12277         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12278                 && test -z "${cf_tst_cflags}" \
12279                 && cf_fix_cppflags=no
12280         ;;
12281 esac
12282 done
12283
12284 if test -n "$cf_new_cflags" ; then
12285
12286         CFLAGS="$CFLAGS $cf_new_cflags"
12287 fi
12288
12289 if test -n "$cf_new_cppflags" ; then
12290
12291         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
12292 fi
12293
12294 if test -n "$cf_new_extra_cppflags" ; then
12295
12296         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
12297 fi
12298
12299 else
12300         ADA_TRACE=FALSE
12301 fi
12302
12303 echo "$as_me:12303: checking if we want to use GNAT projects" >&5
12304 echo $ECHO_N "checking if we want to use GNAT projects... $ECHO_C" >&6
12305
12306 # Check whether --enable-gnat-projects or --disable-gnat-projects was given.
12307 if test "${enable_gnat_projects+set}" = set; then
12308   enableval="$enable_gnat_projects"
12309   test "$enableval" != no && enableval=yes
12310   if test "$enableval" != "yes" ; then
12311     enable_gnat_projects=no
12312   else
12313     enable_gnat_projects=yes
12314   fi
12315 else
12316   enableval=yes
12317   enable_gnat_projects=yes
12318
12319 fi;
12320 echo "$as_me:12320: result: $enable_gnat_projects" >&5
12321 echo "${ECHO_T}$enable_gnat_projects" >&6
12322
12323 ###     Checks for libraries.
12324 case $cf_cv_system_name in
12325 (*mingw32*)
12326         ;;
12327 (*)
12328 echo "$as_me:12328: checking for gettimeofday" >&5
12329 echo $ECHO_N "checking for gettimeofday... $ECHO_C" >&6
12330 if test "${ac_cv_func_gettimeofday+set}" = set; then
12331   echo $ECHO_N "(cached) $ECHO_C" >&6
12332 else
12333   cat >conftest.$ac_ext <<_ACEOF
12334 #line 12334 "configure"
12335 #include "confdefs.h"
12336 /* System header to define __stub macros and hopefully few prototypes,
12337     which can conflict with char gettimeofday (); below.  */
12338 #include <assert.h>
12339 /* Override any gcc2 internal prototype to avoid an error.  */
12340 #ifdef __cplusplus
12341 extern "C"
12342 #endif
12343 /* We use char because int might match the return type of a gcc2
12344    builtin and then its argument prototype would still apply.  */
12345 char gettimeofday ();
12346 char (*f) ();
12347
12348 int
12349 main ()
12350 {
12351 /* The GNU C library defines this for functions which it implements
12352     to always fail with ENOSYS.  Some functions are actually named
12353     something starting with __ and the normal name is an alias.  */
12354 #if defined (__stub_gettimeofday) || defined (__stub___gettimeofday)
12355 choke me
12356 #else
12357 f = gettimeofday; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
12358 #endif
12359
12360   ;
12361   return 0;
12362 }
12363 _ACEOF
12364 rm -f conftest.$ac_objext conftest$ac_exeext
12365 if { (eval echo "$as_me:12365: \"$ac_link\"") >&5
12366   (eval $ac_link) 2>&5
12367   ac_status=$?
12368   echo "$as_me:12368: \$? = $ac_status" >&5
12369   (exit $ac_status); } &&
12370          { ac_try='test -s conftest$ac_exeext'
12371   { (eval echo "$as_me:12371: \"$ac_try\"") >&5
12372   (eval $ac_try) 2>&5
12373   ac_status=$?
12374   echo "$as_me:12374: \$? = $ac_status" >&5
12375   (exit $ac_status); }; }; then
12376   ac_cv_func_gettimeofday=yes
12377 else
12378   echo "$as_me: failed program was:" >&5
12379 cat conftest.$ac_ext >&5
12380 ac_cv_func_gettimeofday=no
12381 fi
12382 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12383 fi
12384 echo "$as_me:12384: result: $ac_cv_func_gettimeofday" >&5
12385 echo "${ECHO_T}$ac_cv_func_gettimeofday" >&6
12386 if test $ac_cv_func_gettimeofday = yes; then
12387   cat >>confdefs.h <<\EOF
12388 #define HAVE_GETTIMEOFDAY 1
12389 EOF
12390
12391 else
12392
12393 echo "$as_me:12393: checking for gettimeofday in -lbsd" >&5
12394 echo $ECHO_N "checking for gettimeofday in -lbsd... $ECHO_C" >&6
12395 if test "${ac_cv_lib_bsd_gettimeofday+set}" = set; then
12396   echo $ECHO_N "(cached) $ECHO_C" >&6
12397 else
12398   ac_check_lib_save_LIBS=$LIBS
12399 LIBS="-lbsd  $LIBS"
12400 cat >conftest.$ac_ext <<_ACEOF
12401 #line 12401 "configure"
12402 #include "confdefs.h"
12403
12404 /* Override any gcc2 internal prototype to avoid an error.  */
12405 #ifdef __cplusplus
12406 extern "C"
12407 #endif
12408 /* We use char because int might match the return type of a gcc2
12409    builtin and then its argument prototype would still apply.  */
12410 char gettimeofday ();
12411 int
12412 main ()
12413 {
12414 gettimeofday ();
12415   ;
12416   return 0;
12417 }
12418 _ACEOF
12419 rm -f conftest.$ac_objext conftest$ac_exeext
12420 if { (eval echo "$as_me:12420: \"$ac_link\"") >&5
12421   (eval $ac_link) 2>&5
12422   ac_status=$?
12423   echo "$as_me:12423: \$? = $ac_status" >&5
12424   (exit $ac_status); } &&
12425          { ac_try='test -s conftest$ac_exeext'
12426   { (eval echo "$as_me:12426: \"$ac_try\"") >&5
12427   (eval $ac_try) 2>&5
12428   ac_status=$?
12429   echo "$as_me:12429: \$? = $ac_status" >&5
12430   (exit $ac_status); }; }; then
12431   ac_cv_lib_bsd_gettimeofday=yes
12432 else
12433   echo "$as_me: failed program was:" >&5
12434 cat conftest.$ac_ext >&5
12435 ac_cv_lib_bsd_gettimeofday=no
12436 fi
12437 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12438 LIBS=$ac_check_lib_save_LIBS
12439 fi
12440 echo "$as_me:12440: result: $ac_cv_lib_bsd_gettimeofday" >&5
12441 echo "${ECHO_T}$ac_cv_lib_bsd_gettimeofday" >&6
12442 if test $ac_cv_lib_bsd_gettimeofday = yes; then
12443
12444 cat >>confdefs.h <<\EOF
12445 #define HAVE_GETTIMEOFDAY 1
12446 EOF
12447
12448         LIBS="$LIBS -lbsd"
12449 fi
12450
12451 fi
12452         ;;
12453 esac
12454
12455 ###     Checks for header files.
12456 echo "$as_me:12456: checking for ANSI C header files" >&5
12457 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
12458 if test "${ac_cv_header_stdc+set}" = set; then
12459   echo $ECHO_N "(cached) $ECHO_C" >&6
12460 else
12461   cat >conftest.$ac_ext <<_ACEOF
12462 #line 12462 "configure"
12463 #include "confdefs.h"
12464 #include <stdlib.h>
12465 #include <stdarg.h>
12466 #include <string.h>
12467 #include <float.h>
12468
12469 _ACEOF
12470 if { (eval echo "$as_me:12470: \"$ac_cpp conftest.$ac_ext\"") >&5
12471   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
12472   ac_status=$?
12473   egrep -v '^ *\+' conftest.er1 >conftest.err
12474   rm -f conftest.er1
12475   cat conftest.err >&5
12476   echo "$as_me:12476: \$? = $ac_status" >&5
12477   (exit $ac_status); } >/dev/null; then
12478   if test -s conftest.err; then
12479     ac_cpp_err=$ac_c_preproc_warn_flag
12480   else
12481     ac_cpp_err=
12482   fi
12483 else
12484   ac_cpp_err=yes
12485 fi
12486 if test -z "$ac_cpp_err"; then
12487   ac_cv_header_stdc=yes
12488 else
12489   echo "$as_me: failed program was:" >&5
12490   cat conftest.$ac_ext >&5
12491   ac_cv_header_stdc=no
12492 fi
12493 rm -f conftest.err conftest.$ac_ext
12494
12495 if test $ac_cv_header_stdc = yes; then
12496   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
12497   cat >conftest.$ac_ext <<_ACEOF
12498 #line 12498 "configure"
12499 #include "confdefs.h"
12500 #include <string.h>
12501
12502 _ACEOF
12503 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
12504   egrep "memchr" >/dev/null 2>&1; then
12505   :
12506 else
12507   ac_cv_header_stdc=no
12508 fi
12509 rm -rf conftest*
12510
12511 fi
12512
12513 if test $ac_cv_header_stdc = yes; then
12514   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
12515   cat >conftest.$ac_ext <<_ACEOF
12516 #line 12516 "configure"
12517 #include "confdefs.h"
12518 #include <stdlib.h>
12519
12520 _ACEOF
12521 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
12522   egrep "free" >/dev/null 2>&1; then
12523   :
12524 else
12525   ac_cv_header_stdc=no
12526 fi
12527 rm -rf conftest*
12528
12529 fi
12530
12531 if test $ac_cv_header_stdc = yes; then
12532   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
12533   if test "$cross_compiling" = yes; then
12534   :
12535 else
12536   cat >conftest.$ac_ext <<_ACEOF
12537 #line 12537 "configure"
12538 #include "confdefs.h"
12539 #include <ctype.h>
12540 #if ((' ' & 0x0FF) == 0x020)
12541 # define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
12542 # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
12543 #else
12544 # define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
12545                      || ('j' <= (c) && (c) <= 'r') \
12546                      || ('s' <= (c) && (c) <= 'z'))
12547 # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
12548 #endif
12549
12550 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
12551 int
12552 main ()
12553 {
12554   int i;
12555   for (i = 0; i < 256; i++)
12556     if (XOR (islower (i), ISLOWER (i))
12557         || toupper (i) != TOUPPER (i))
12558       $ac_main_return(2);
12559   $ac_main_return (0);
12560 }
12561 _ACEOF
12562 rm -f conftest$ac_exeext
12563 if { (eval echo "$as_me:12563: \"$ac_link\"") >&5
12564   (eval $ac_link) 2>&5
12565   ac_status=$?
12566   echo "$as_me:12566: \$? = $ac_status" >&5
12567   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
12568   { (eval echo "$as_me:12568: \"$ac_try\"") >&5
12569   (eval $ac_try) 2>&5
12570   ac_status=$?
12571   echo "$as_me:12571: \$? = $ac_status" >&5
12572   (exit $ac_status); }; }; then
12573   :
12574 else
12575   echo "$as_me: program exited with status $ac_status" >&5
12576 echo "$as_me: failed program was:" >&5
12577 cat conftest.$ac_ext >&5
12578 ac_cv_header_stdc=no
12579 fi
12580 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
12581 fi
12582 fi
12583 fi
12584 echo "$as_me:12584: result: $ac_cv_header_stdc" >&5
12585 echo "${ECHO_T}$ac_cv_header_stdc" >&6
12586 if test $ac_cv_header_stdc = yes; then
12587
12588 cat >>confdefs.h <<\EOF
12589 #define STDC_HEADERS 1
12590 EOF
12591
12592 fi
12593
12594 ac_header_dirent=no
12595 for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h; do
12596   as_ac_Header=`echo "ac_cv_header_dirent_$ac_hdr" | $as_tr_sh`
12597 echo "$as_me:12597: checking for $ac_hdr that defines DIR" >&5
12598 echo $ECHO_N "checking for $ac_hdr that defines DIR... $ECHO_C" >&6
12599 if eval "test \"\${$as_ac_Header+set}\" = set"; then
12600   echo $ECHO_N "(cached) $ECHO_C" >&6
12601 else
12602   cat >conftest.$ac_ext <<_ACEOF
12603 #line 12603 "configure"
12604 #include "confdefs.h"
12605 #include <sys/types.h>
12606 #include <$ac_hdr>
12607
12608 int
12609 main ()
12610 {
12611 if ((DIR *) 0)
12612 return 0;
12613   ;
12614   return 0;
12615 }
12616 _ACEOF
12617 rm -f conftest.$ac_objext
12618 if { (eval echo "$as_me:12618: \"$ac_compile\"") >&5
12619   (eval $ac_compile) 2>&5
12620   ac_status=$?
12621   echo "$as_me:12621: \$? = $ac_status" >&5
12622   (exit $ac_status); } &&
12623          { ac_try='test -s conftest.$ac_objext'
12624   { (eval echo "$as_me:12624: \"$ac_try\"") >&5
12625   (eval $ac_try) 2>&5
12626   ac_status=$?
12627   echo "$as_me:12627: \$? = $ac_status" >&5
12628   (exit $ac_status); }; }; then
12629   eval "$as_ac_Header=yes"
12630 else
12631   echo "$as_me: failed program was:" >&5
12632 cat conftest.$ac_ext >&5
12633 eval "$as_ac_Header=no"
12634 fi
12635 rm -f conftest.$ac_objext conftest.$ac_ext
12636 fi
12637 echo "$as_me:12637: result: `eval echo '${'$as_ac_Header'}'`" >&5
12638 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
12639 if test `eval echo '${'$as_ac_Header'}'` = yes; then
12640   cat >>confdefs.h <<EOF
12641 #define `echo "HAVE_$ac_hdr" | $as_tr_cpp` 1
12642 EOF
12643
12644 ac_header_dirent=$ac_hdr; break
12645 fi
12646
12647 done
12648 # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix.
12649 if test $ac_header_dirent = dirent.h; then
12650   echo "$as_me:12650: checking for opendir in -ldir" >&5
12651 echo $ECHO_N "checking for opendir in -ldir... $ECHO_C" >&6
12652 if test "${ac_cv_lib_dir_opendir+set}" = set; then
12653   echo $ECHO_N "(cached) $ECHO_C" >&6
12654 else
12655   ac_check_lib_save_LIBS=$LIBS
12656 LIBS="-ldir  $LIBS"
12657 cat >conftest.$ac_ext <<_ACEOF
12658 #line 12658 "configure"
12659 #include "confdefs.h"
12660
12661 /* Override any gcc2 internal prototype to avoid an error.  */
12662 #ifdef __cplusplus
12663 extern "C"
12664 #endif
12665 /* We use char because int might match the return type of a gcc2
12666    builtin and then its argument prototype would still apply.  */
12667 char opendir ();
12668 int
12669 main ()
12670 {
12671 opendir ();
12672   ;
12673   return 0;
12674 }
12675 _ACEOF
12676 rm -f conftest.$ac_objext conftest$ac_exeext
12677 if { (eval echo "$as_me:12677: \"$ac_link\"") >&5
12678   (eval $ac_link) 2>&5
12679   ac_status=$?
12680   echo "$as_me:12680: \$? = $ac_status" >&5
12681   (exit $ac_status); } &&
12682          { ac_try='test -s conftest$ac_exeext'
12683   { (eval echo "$as_me:12683: \"$ac_try\"") >&5
12684   (eval $ac_try) 2>&5
12685   ac_status=$?
12686   echo "$as_me:12686: \$? = $ac_status" >&5
12687   (exit $ac_status); }; }; then
12688   ac_cv_lib_dir_opendir=yes
12689 else
12690   echo "$as_me: failed program was:" >&5
12691 cat conftest.$ac_ext >&5
12692 ac_cv_lib_dir_opendir=no
12693 fi
12694 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12695 LIBS=$ac_check_lib_save_LIBS
12696 fi
12697 echo "$as_me:12697: result: $ac_cv_lib_dir_opendir" >&5
12698 echo "${ECHO_T}$ac_cv_lib_dir_opendir" >&6
12699 if test $ac_cv_lib_dir_opendir = yes; then
12700   LIBS="$LIBS -ldir"
12701 fi
12702
12703 else
12704   echo "$as_me:12704: checking for opendir in -lx" >&5
12705 echo $ECHO_N "checking for opendir in -lx... $ECHO_C" >&6
12706 if test "${ac_cv_lib_x_opendir+set}" = set; then
12707   echo $ECHO_N "(cached) $ECHO_C" >&6
12708 else
12709   ac_check_lib_save_LIBS=$LIBS
12710 LIBS="-lx  $LIBS"
12711 cat >conftest.$ac_ext <<_ACEOF
12712 #line 12712 "configure"
12713 #include "confdefs.h"
12714
12715 /* Override any gcc2 internal prototype to avoid an error.  */
12716 #ifdef __cplusplus
12717 extern "C"
12718 #endif
12719 /* We use char because int might match the return type of a gcc2
12720    builtin and then its argument prototype would still apply.  */
12721 char opendir ();
12722 int
12723 main ()
12724 {
12725 opendir ();
12726   ;
12727   return 0;
12728 }
12729 _ACEOF
12730 rm -f conftest.$ac_objext conftest$ac_exeext
12731 if { (eval echo "$as_me:12731: \"$ac_link\"") >&5
12732   (eval $ac_link) 2>&5
12733   ac_status=$?
12734   echo "$as_me:12734: \$? = $ac_status" >&5
12735   (exit $ac_status); } &&
12736          { ac_try='test -s conftest$ac_exeext'
12737   { (eval echo "$as_me:12737: \"$ac_try\"") >&5
12738   (eval $ac_try) 2>&5
12739   ac_status=$?
12740   echo "$as_me:12740: \$? = $ac_status" >&5
12741   (exit $ac_status); }; }; then
12742   ac_cv_lib_x_opendir=yes
12743 else
12744   echo "$as_me: failed program was:" >&5
12745 cat conftest.$ac_ext >&5
12746 ac_cv_lib_x_opendir=no
12747 fi
12748 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12749 LIBS=$ac_check_lib_save_LIBS
12750 fi
12751 echo "$as_me:12751: result: $ac_cv_lib_x_opendir" >&5
12752 echo "${ECHO_T}$ac_cv_lib_x_opendir" >&6
12753 if test $ac_cv_lib_x_opendir = yes; then
12754   LIBS="$LIBS -lx"
12755 fi
12756
12757 fi
12758
12759 echo "$as_me:12759: checking whether time.h and sys/time.h may both be included" >&5
12760 echo $ECHO_N "checking whether time.h and sys/time.h may both be included... $ECHO_C" >&6
12761 if test "${ac_cv_header_time+set}" = set; then
12762   echo $ECHO_N "(cached) $ECHO_C" >&6
12763 else
12764   cat >conftest.$ac_ext <<_ACEOF
12765 #line 12765 "configure"
12766 #include "confdefs.h"
12767 #include <sys/types.h>
12768 #include <sys/time.h>
12769 #include <time.h>
12770
12771 int
12772 main ()
12773 {
12774 if ((struct tm *) 0)
12775 return 0;
12776   ;
12777   return 0;
12778 }
12779 _ACEOF
12780 rm -f conftest.$ac_objext
12781 if { (eval echo "$as_me:12781: \"$ac_compile\"") >&5
12782   (eval $ac_compile) 2>&5
12783   ac_status=$?
12784   echo "$as_me:12784: \$? = $ac_status" >&5
12785   (exit $ac_status); } &&
12786          { ac_try='test -s conftest.$ac_objext'
12787   { (eval echo "$as_me:12787: \"$ac_try\"") >&5
12788   (eval $ac_try) 2>&5
12789   ac_status=$?
12790   echo "$as_me:12790: \$? = $ac_status" >&5
12791   (exit $ac_status); }; }; then
12792   ac_cv_header_time=yes
12793 else
12794   echo "$as_me: failed program was:" >&5
12795 cat conftest.$ac_ext >&5
12796 ac_cv_header_time=no
12797 fi
12798 rm -f conftest.$ac_objext conftest.$ac_ext
12799 fi
12800 echo "$as_me:12800: result: $ac_cv_header_time" >&5
12801 echo "${ECHO_T}$ac_cv_header_time" >&6
12802 if test $ac_cv_header_time = yes; then
12803
12804 cat >>confdefs.h <<\EOF
12805 #define TIME_WITH_SYS_TIME 1
12806 EOF
12807
12808 fi
12809
12810 ###     checks for compiler characteristics
12811 ac_ext=c
12812 ac_cpp='$CPP $CPPFLAGS'
12813 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
12814 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
12815 ac_compiler_gnu=$ac_cv_c_compiler_gnu
12816 ac_main_return=return
12817
12818 echo "$as_me:12818: checking for an ANSI C-conforming const" >&5
12819 echo $ECHO_N "checking for an ANSI C-conforming const... $ECHO_C" >&6
12820 if test "${ac_cv_c_const+set}" = set; then
12821   echo $ECHO_N "(cached) $ECHO_C" >&6
12822 else
12823   cat >conftest.$ac_ext <<_ACEOF
12824 #line 12824 "configure"
12825 #include "confdefs.h"
12826
12827 int
12828 main ()
12829 {
12830 /* FIXME: Include the comments suggested by Paul. */
12831 #ifndef __cplusplus
12832   /* Ultrix mips cc rejects this.  */
12833   typedef int charset[2];
12834   const charset x;
12835   /* SunOS 4.1.1 cc rejects this.  */
12836   char const *const *ccp;
12837   char **p;
12838   /* NEC SVR4.0.2 mips cc rejects this.  */
12839   struct point {int x, y;};
12840   static struct point const zero = {0,0};
12841   /* AIX XL C 1.02.0.0 rejects this.
12842      It does not let you subtract one const X* pointer from another in
12843      an arm of an if-expression whose if-part is not a constant
12844      expression */
12845   const char *g = "string";
12846   ccp = &g + (g ? g-g : 0);
12847   /* HPUX 7.0 cc rejects these. */
12848   ++ccp;
12849   p = (char**) ccp;
12850   ccp = (char const *const *) p;
12851   { /* SCO 3.2v4 cc rejects this.  */
12852     char *t;
12853     char const *s = 0 ? (char *) 0 : (char const *) 0;
12854
12855     *t++ = 0;
12856   }
12857   { /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  */
12858     int x[] = {25, 17};
12859     const int *foo = &x[0];
12860     ++foo;
12861   }
12862   { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
12863     typedef const int *iptr;
12864     iptr p = 0;
12865     ++p;
12866   }
12867   { /* AIX XL C 1.02.0.0 rejects this saying
12868        "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
12869     struct s { int j; const int *ap[3]; };
12870     struct s *b; b->j = 5;
12871   }
12872   { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
12873     const int foo = 10;
12874   }
12875 #endif
12876
12877   ;
12878   return 0;
12879 }
12880 _ACEOF
12881 rm -f conftest.$ac_objext
12882 if { (eval echo "$as_me:12882: \"$ac_compile\"") >&5
12883   (eval $ac_compile) 2>&5
12884   ac_status=$?
12885   echo "$as_me:12885: \$? = $ac_status" >&5
12886   (exit $ac_status); } &&
12887          { ac_try='test -s conftest.$ac_objext'
12888   { (eval echo "$as_me:12888: \"$ac_try\"") >&5
12889   (eval $ac_try) 2>&5
12890   ac_status=$?
12891   echo "$as_me:12891: \$? = $ac_status" >&5
12892   (exit $ac_status); }; }; then
12893   ac_cv_c_const=yes
12894 else
12895   echo "$as_me: failed program was:" >&5
12896 cat conftest.$ac_ext >&5
12897 ac_cv_c_const=no
12898 fi
12899 rm -f conftest.$ac_objext conftest.$ac_ext
12900 fi
12901 echo "$as_me:12901: result: $ac_cv_c_const" >&5
12902 echo "${ECHO_T}$ac_cv_c_const" >&6
12903 if test $ac_cv_c_const = no; then
12904
12905 cat >>confdefs.h <<\EOF
12906 #define const
12907 EOF
12908
12909 fi
12910
12911 ###     Checks for external-data
12912
12913 echo "$as_me:12913: checking if data-only library module links" >&5
12914 echo $ECHO_N "checking if data-only library module links... $ECHO_C" >&6
12915 if test "${cf_cv_link_dataonly+set}" = set; then
12916   echo $ECHO_N "(cached) $ECHO_C" >&6
12917 else
12918
12919         rm -f conftest.a
12920         cat >conftest.$ac_ext <<EOF
12921 #line 12921 "configure"
12922 int     testdata[3] = { 123, 456, 789 };
12923 EOF
12924         if { (eval echo "$as_me:12924: \"$ac_compile\"") >&5
12925   (eval $ac_compile) 2>&5
12926   ac_status=$?
12927   echo "$as_me:12927: \$? = $ac_status" >&5
12928   (exit $ac_status); } ; then
12929                 mv conftest.o data.o && \
12930                 ( $AR $ARFLAGS conftest.a data.o ) 2>&5 1>/dev/null
12931         fi
12932         rm -f conftest.$ac_ext data.o
12933         cat >conftest.$ac_ext <<EOF
12934 #line 12934 "configure"
12935 int     testfunc()
12936 {
12937 #if defined(NeXT)
12938         ${cf_cv_main_return:-return}(1);        /* I'm told this linker is broken */
12939 #else
12940         extern int testdata[3];
12941         return testdata[0] == 123
12942            &&  testdata[1] == 456
12943            &&  testdata[2] == 789;
12944 #endif
12945 }
12946 EOF
12947         if { (eval echo "$as_me:12947: \"$ac_compile\"") >&5
12948   (eval $ac_compile) 2>&5
12949   ac_status=$?
12950   echo "$as_me:12950: \$? = $ac_status" >&5
12951   (exit $ac_status); }; then
12952                 mv conftest.o func.o && \
12953                 ( $AR $ARFLAGS conftest.a func.o ) 2>&5 1>/dev/null
12954         fi
12955         rm -f conftest.$ac_ext func.o
12956         ( eval $RANLIB conftest.a ) 2>&5 >/dev/null
12957         cf_saveLIBS="$LIBS"
12958         LIBS="conftest.a $LIBS"
12959         if test "$cross_compiling" = yes; then
12960   cf_cv_link_dataonly=unknown
12961 else
12962   cat >conftest.$ac_ext <<_ACEOF
12963 #line 12963 "configure"
12964 #include "confdefs.h"
12965
12966         int main()
12967         {
12968                 extern int testfunc();
12969                 ${cf_cv_main_return:-return} (!testfunc());
12970         }
12971
12972 _ACEOF
12973 rm -f conftest$ac_exeext
12974 if { (eval echo "$as_me:12974: \"$ac_link\"") >&5
12975   (eval $ac_link) 2>&5
12976   ac_status=$?
12977   echo "$as_me:12977: \$? = $ac_status" >&5
12978   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
12979   { (eval echo "$as_me:12979: \"$ac_try\"") >&5
12980   (eval $ac_try) 2>&5
12981   ac_status=$?
12982   echo "$as_me:12982: \$? = $ac_status" >&5
12983   (exit $ac_status); }; }; then
12984   cf_cv_link_dataonly=yes
12985 else
12986   echo "$as_me: program exited with status $ac_status" >&5
12987 echo "$as_me: failed program was:" >&5
12988 cat conftest.$ac_ext >&5
12989 cf_cv_link_dataonly=no
12990 fi
12991 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
12992 fi
12993         LIBS="$cf_saveLIBS"
12994
12995 fi
12996
12997 echo "$as_me:12997: result: $cf_cv_link_dataonly" >&5
12998 echo "${ECHO_T}$cf_cv_link_dataonly" >&6
12999
13000 if test "$cf_cv_link_dataonly" = no ; then
13001
13002 cat >>confdefs.h <<\EOF
13003 #define BROKEN_LINKER 1
13004 EOF
13005
13006         BROKEN_LINKER=1
13007 fi
13008
13009 ###     Checks for library functions.
13010
13011 echo "$as_me:13011: checking for working mkstemp" >&5
13012 echo $ECHO_N "checking for working mkstemp... $ECHO_C" >&6
13013 if test "${cf_cv_func_mkstemp+set}" = set; then
13014   echo $ECHO_N "(cached) $ECHO_C" >&6
13015 else
13016
13017 rm -rf conftest*
13018 if test "$cross_compiling" = yes; then
13019   cf_cv_func_mkstemp=maybe
13020 else
13021   cat >conftest.$ac_ext <<_ACEOF
13022 #line 13022 "configure"
13023 #include "confdefs.h"
13024
13025 #include <sys/types.h>
13026 #include <stdlib.h>
13027 #include <stdio.h>
13028 #include <string.h>
13029 #include <sys/stat.h>
13030 int main()
13031 {
13032         char *tmpl = "conftestXXXXXX";
13033         char name[2][80];
13034         int n;
13035         int result = 0;
13036         int fd;
13037         struct stat sb;
13038
13039         umask(077);
13040         for (n = 0; n < 2; ++n) {
13041                 strcpy(name[n], tmpl);
13042                 if ((fd = mkstemp(name[n])) >= 0) {
13043                         if (!strcmp(name[n], tmpl)
13044                          || stat(name[n], &sb) != 0
13045                          || (sb.st_mode & S_IFMT) != S_IFREG
13046                          || (sb.st_mode & 077) != 0) {
13047                                 result = 1;
13048                         }
13049                         close(fd);
13050                 }
13051         }
13052         if (result == 0
13053          && !strcmp(name[0], name[1]))
13054                 result = 1;
13055         ${cf_cv_main_return:-return}(result);
13056 }
13057
13058 _ACEOF
13059 rm -f conftest$ac_exeext
13060 if { (eval echo "$as_me:13060: \"$ac_link\"") >&5
13061   (eval $ac_link) 2>&5
13062   ac_status=$?
13063   echo "$as_me:13063: \$? = $ac_status" >&5
13064   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
13065   { (eval echo "$as_me:13065: \"$ac_try\"") >&5
13066   (eval $ac_try) 2>&5
13067   ac_status=$?
13068   echo "$as_me:13068: \$? = $ac_status" >&5
13069   (exit $ac_status); }; }; then
13070   cf_cv_func_mkstemp=yes
13071
13072 else
13073   echo "$as_me: program exited with status $ac_status" >&5
13074 echo "$as_me: failed program was:" >&5
13075 cat conftest.$ac_ext >&5
13076 cf_cv_func_mkstemp=no
13077
13078 fi
13079 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
13080 fi
13081
13082 fi
13083 echo "$as_me:13083: result: $cf_cv_func_mkstemp" >&5
13084 echo "${ECHO_T}$cf_cv_func_mkstemp" >&6
13085 if test "x$cf_cv_func_mkstemp" = xmaybe ; then
13086         echo "$as_me:13086: checking for mkstemp" >&5
13087 echo $ECHO_N "checking for mkstemp... $ECHO_C" >&6
13088 if test "${ac_cv_func_mkstemp+set}" = set; then
13089   echo $ECHO_N "(cached) $ECHO_C" >&6
13090 else
13091   cat >conftest.$ac_ext <<_ACEOF
13092 #line 13092 "configure"
13093 #include "confdefs.h"
13094 /* System header to define __stub macros and hopefully few prototypes,
13095     which can conflict with char mkstemp (); below.  */
13096 #include <assert.h>
13097 /* Override any gcc2 internal prototype to avoid an error.  */
13098 #ifdef __cplusplus
13099 extern "C"
13100 #endif
13101 /* We use char because int might match the return type of a gcc2
13102    builtin and then its argument prototype would still apply.  */
13103 char mkstemp ();
13104 char (*f) ();
13105
13106 int
13107 main ()
13108 {
13109 /* The GNU C library defines this for functions which it implements
13110     to always fail with ENOSYS.  Some functions are actually named
13111     something starting with __ and the normal name is an alias.  */
13112 #if defined (__stub_mkstemp) || defined (__stub___mkstemp)
13113 choke me
13114 #else
13115 f = mkstemp; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
13116 #endif
13117
13118   ;
13119   return 0;
13120 }
13121 _ACEOF
13122 rm -f conftest.$ac_objext conftest$ac_exeext
13123 if { (eval echo "$as_me:13123: \"$ac_link\"") >&5
13124   (eval $ac_link) 2>&5
13125   ac_status=$?
13126   echo "$as_me:13126: \$? = $ac_status" >&5
13127   (exit $ac_status); } &&
13128          { ac_try='test -s conftest$ac_exeext'
13129   { (eval echo "$as_me:13129: \"$ac_try\"") >&5
13130   (eval $ac_try) 2>&5
13131   ac_status=$?
13132   echo "$as_me:13132: \$? = $ac_status" >&5
13133   (exit $ac_status); }; }; then
13134   ac_cv_func_mkstemp=yes
13135 else
13136   echo "$as_me: failed program was:" >&5
13137 cat conftest.$ac_ext >&5
13138 ac_cv_func_mkstemp=no
13139 fi
13140 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13141 fi
13142 echo "$as_me:13142: result: $ac_cv_func_mkstemp" >&5
13143 echo "${ECHO_T}$ac_cv_func_mkstemp" >&6
13144
13145 fi
13146 if test "x$cf_cv_func_mkstemp" = xyes || test "x$ac_cv_func_mkstemp" = xyes ; then
13147
13148 cat >>confdefs.h <<\EOF
13149 #define HAVE_MKSTEMP 1
13150 EOF
13151
13152 fi
13153
13154 if test -z "$cf_user_CFLAGS" && test "$with_no_leaks" = no ; then
13155         CFLAGS=`echo ${CFLAGS} | sed -e 's%-g %%' -e 's%-g$%%'`
13156         CXXFLAGS=`echo ${CXXFLAGS} | sed -e 's%-g %%' -e 's%-g$%%'`
13157 fi
13158
13159 cf_with_ada=yes
13160 if test "$cf_with_ada" != "no" ; then
13161
13162 cf_ada_make=gnatmake
13163 # Extract the first word of "$cf_ada_make", so it can be a program name with args.
13164 set dummy $cf_ada_make; ac_word=$2
13165 echo "$as_me:13165: checking for $ac_word" >&5
13166 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
13167 if test "${ac_cv_prog_gnat_exists+set}" = set; then
13168   echo $ECHO_N "(cached) $ECHO_C" >&6
13169 else
13170   if test -n "$gnat_exists"; then
13171   ac_cv_prog_gnat_exists="$gnat_exists" # Let the user override the test.
13172 else
13173   ac_save_IFS=$IFS; IFS=$ac_path_separator
13174 ac_dummy="$PATH"
13175 for ac_dir in $ac_dummy; do
13176   IFS=$ac_save_IFS
13177   test -z "$ac_dir" && ac_dir=.
13178   $as_executable_p "$ac_dir/$ac_word" || continue
13179 ac_cv_prog_gnat_exists="yes"
13180 echo "$as_me:13180: found $ac_dir/$ac_word" >&5
13181 break
13182 done
13183
13184   test -z "$ac_cv_prog_gnat_exists" && ac_cv_prog_gnat_exists="no"
13185 fi
13186 fi
13187 gnat_exists=$ac_cv_prog_gnat_exists
13188 if test -n "$gnat_exists"; then
13189   echo "$as_me:13189: result: $gnat_exists" >&5
13190 echo "${ECHO_T}$gnat_exists" >&6
13191 else
13192   echo "$as_me:13192: result: no" >&5
13193 echo "${ECHO_T}no" >&6
13194 fi
13195
13196 if test "$ac_cv_prog_gnat_exists" = no; then
13197         cf_ada_make=
13198         cf_cv_prog_gnat_correct=no
13199 else
13200
13201 echo "$as_me:13201: checking for gnat version" >&5
13202 echo $ECHO_N "checking for gnat version... $ECHO_C" >&6
13203 cf_gnat_version=`${cf_ada_make:-gnatmake} -v 2>&1 | \
13204         grep '[0-9].[0-9][0-9]*' |\
13205         sed -e '2,$d' -e 's/[^0-9 \.]//g' -e 's/^[ ]*//' -e 's/ .*//'`
13206 echo "$as_me:13206: result: $cf_gnat_version" >&5
13207 echo "${ECHO_T}$cf_gnat_version" >&6
13208
13209 case $cf_gnat_version in
13210 (3.1[1-9]*|3.[2-9]*|[4-9].*|20[0-9][0-9])
13211         cf_cv_prog_gnat_correct=yes
13212         ;;
13213 (*)
13214         { echo "$as_me:13214: WARNING: Unsupported GNAT version $cf_gnat_version. We require 3.11 or better. Disabling Ada95 binding." >&5
13215 echo "$as_me: WARNING: Unsupported GNAT version $cf_gnat_version. We require 3.11 or better. Disabling Ada95 binding." >&2;}
13216         cf_cv_prog_gnat_correct=no
13217         ;;
13218 esac
13219
13220         # Extract the first word of "m4", so it can be a program name with args.
13221 set dummy m4; ac_word=$2
13222 echo "$as_me:13222: checking for $ac_word" >&5
13223 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
13224 if test "${ac_cv_prog_M4_exists+set}" = set; then
13225   echo $ECHO_N "(cached) $ECHO_C" >&6
13226 else
13227   if test -n "$M4_exists"; then
13228   ac_cv_prog_M4_exists="$M4_exists" # Let the user override the test.
13229 else
13230   ac_save_IFS=$IFS; IFS=$ac_path_separator
13231 ac_dummy="$PATH"
13232 for ac_dir in $ac_dummy; do
13233   IFS=$ac_save_IFS
13234   test -z "$ac_dir" && ac_dir=.
13235   $as_executable_p "$ac_dir/$ac_word" || continue
13236 ac_cv_prog_M4_exists="yes"
13237 echo "$as_me:13237: found $ac_dir/$ac_word" >&5
13238 break
13239 done
13240
13241   test -z "$ac_cv_prog_M4_exists" && ac_cv_prog_M4_exists="no"
13242 fi
13243 fi
13244 M4_exists=$ac_cv_prog_M4_exists
13245 if test -n "$M4_exists"; then
13246   echo "$as_me:13246: result: $M4_exists" >&5
13247 echo "${ECHO_T}$M4_exists" >&6
13248 else
13249   echo "$as_me:13249: result: no" >&5
13250 echo "${ECHO_T}no" >&6
13251 fi
13252
13253         if test "$ac_cv_prog_M4_exists" = no; then
13254                 cf_cv_prog_gnat_correct=no
13255                 echo Ada95 binding required program m4 not found. Ada95 binding disabled.
13256         fi
13257         if test "$cf_cv_prog_gnat_correct" = yes; then
13258                 echo "$as_me:13258: checking if GNAT works" >&5
13259 echo $ECHO_N "checking if GNAT works... $ECHO_C" >&6
13260
13261 rm -rf conftest* *~conftest*
13262 cat >>conftest.ads <<CF_EOF
13263 procedure conftest;
13264 CF_EOF
13265 cat >>conftest.adb <<CF_EOF
13266 with Text_IO;
13267 with GNAT.OS_Lib;
13268 procedure conftest is
13269 begin
13270    Text_IO.Put ("Hello World");
13271    Text_IO.New_Line;
13272    GNAT.OS_Lib.OS_Exit (0);
13273 end conftest;
13274 CF_EOF
13275 if ( $cf_ada_make $ADAFLAGS conftest 1>&5 2>&1 ) ; then
13276    if ( ./conftest 1>&5 2>&1 ) ; then
13277       cf_cv_prog_gnat_correct=yes
13278    else
13279       cf_cv_prog_gnat_correct=no
13280    fi
13281 else
13282    cf_cv_prog_gnat_correct=no
13283 fi
13284 rm -rf conftest* *~conftest*
13285
13286                 echo "$as_me:13286: result: $cf_cv_prog_gnat_correct" >&5
13287 echo "${ECHO_T}$cf_cv_prog_gnat_correct" >&6
13288         fi
13289 fi
13290
13291         if test "$cf_cv_prog_gnat_correct" = yes; then
13292
13293         echo "$as_me:13293: checking optimization options for ADAFLAGS" >&5
13294 echo $ECHO_N "checking optimization options for ADAFLAGS... $ECHO_C" >&6
13295         case "$CFLAGS" in
13296         (*-g*)
13297
13298         ADAFLAGS="$ADAFLAGS -g"
13299
13300                 ;;
13301         esac
13302         case "$CFLAGS" in
13303         (*-O*)
13304                 cf_O_flag=`echo "$CFLAGS" |sed -e 's/^.*-O/-O/' -e 's/[         ].*//'`
13305
13306         ADAFLAGS="$ADAFLAGS $cf_O_flag"
13307
13308                 ;;
13309         esac
13310         echo "$as_me:13310: result: $ADAFLAGS" >&5
13311 echo "${ECHO_T}$ADAFLAGS" >&6
13312
13313 echo "$as_me:13313: checking if GNATPREP supports -T option" >&5
13314 echo $ECHO_N "checking if GNATPREP supports -T option... $ECHO_C" >&6
13315 if test "${cf_cv_gnatprep_opt_t+set}" = set; then
13316   echo $ECHO_N "(cached) $ECHO_C" >&6
13317 else
13318
13319 cf_cv_gnatprep_opt_t=no
13320 gnatprep -T 2>/dev/null >/dev/null && cf_cv_gnatprep_opt_t=yes
13321
13322 fi
13323 echo "$as_me:13323: result: $cf_cv_gnatprep_opt_t" >&5
13324 echo "${ECHO_T}$cf_cv_gnatprep_opt_t" >&6
13325 test "$cf_cv_gnatprep_opt_t" = yes && GNATPREP_OPTS="-T $GNATPREP_OPTS"
13326
13327 echo "$as_me:13327: checking if GNAT supports generics" >&5
13328 echo $ECHO_N "checking if GNAT supports generics... $ECHO_C" >&6
13329 case $cf_gnat_version in
13330 (3.[1-9]*|[4-9].*)
13331         cf_gnat_generics=yes
13332         ;;
13333 (*)
13334         cf_gnat_generics=no
13335         ;;
13336 esac
13337 echo "$as_me:13337: result: $cf_gnat_generics" >&5
13338 echo "${ECHO_T}$cf_gnat_generics" >&6
13339
13340 if test "$cf_gnat_generics" = yes
13341 then
13342         cf_compile_generics=generics
13343         cf_generic_objects="\${GENOBJS}"
13344 else
13345         cf_compile_generics=
13346         cf_generic_objects=
13347 fi
13348
13349 echo "$as_me:13349: checking if GNAT supports SIGINT" >&5
13350 echo $ECHO_N "checking if GNAT supports SIGINT... $ECHO_C" >&6
13351 if test "${cf_cv_gnat_sigint+set}" = set; then
13352   echo $ECHO_N "(cached) $ECHO_C" >&6
13353 else
13354
13355 rm -rf conftest* *~conftest*
13356 cat >>conftest.ads <<CF_EOF
13357 with Ada.Interrupts.Names;
13358
13359 package ConfTest is
13360
13361    pragma Warnings (Off);  --  the next pragma exists since 3.11p
13362    pragma Unreserve_All_Interrupts;
13363    pragma Warnings (On);
13364
13365    protected Process is
13366       procedure Stop;
13367       function Continue return Boolean;
13368       pragma Attach_Handler (Stop, Ada.Interrupts.Names.SIGINT);
13369    private
13370       Done : Boolean := False;
13371    end Process;
13372
13373 end ConfTest;
13374 CF_EOF
13375 cat >>conftest.adb <<CF_EOF
13376 package body ConfTest is
13377    protected body Process is
13378       procedure Stop is
13379       begin
13380          Done := True;
13381       end Stop;
13382       function Continue return Boolean is
13383       begin
13384          return not Done;
13385       end Continue;
13386    end Process;
13387 end ConfTest;
13388 CF_EOF
13389 if ( $cf_ada_make $ADAFLAGS conftest 1>&5 2>&1 ) ; then
13390       cf_cv_gnat_sigint=yes
13391 else
13392    cf_cv_gnat_sigint=no
13393 fi
13394 rm -rf conftest* *~conftest*
13395
13396 fi
13397 echo "$as_me:13397: result: $cf_cv_gnat_sigint" >&5
13398 echo "${ECHO_T}$cf_cv_gnat_sigint" >&6
13399
13400 if test $cf_cv_gnat_sigint = yes ; then
13401         USE_GNAT_SIGINT=""
13402 else
13403         USE_GNAT_SIGINT="#"
13404 fi
13405
13406 cf_gnat_libraries=no
13407 cf_gnat_projects=no
13408
13409 if test "$enable_gnat_projects" != no ; then
13410 echo "$as_me:13410: checking if GNAT supports project files" >&5
13411 echo $ECHO_N "checking if GNAT supports project files... $ECHO_C" >&6
13412 case $cf_gnat_version in
13413 (3.[0-9]*)
13414         ;;
13415 (*)
13416         case $cf_cv_system_name in
13417         (cygwin*|msys*)
13418                 ;;
13419         (*)
13420                 mkdir conftest.src conftest.bin conftest.lib
13421                 cd conftest.src
13422                 rm -rf conftest* *~conftest*
13423                 cat >>library.gpr <<CF_EOF
13424 project Library is
13425   Kind := External ("LIB_KIND");
13426   for Library_Name use "ConfTest";
13427   for Object_Dir use ".";
13428   for Library_ALI_Dir use External("LIBRARY_DIR");
13429   for Library_Version use External ("SONAME");
13430   for Library_Kind use Kind;
13431   for Library_Dir use External("BUILD_DIR");
13432   Source_Dir := External ("SOURCE_DIR");
13433   for Source_Dirs use (Source_Dir);
13434 end Library;
13435 CF_EOF
13436                 cat >>confpackage.ads <<CF_EOF
13437 package ConfPackage is
13438    procedure conftest;
13439 end ConfPackage;
13440 CF_EOF
13441                 cat >>confpackage.adb <<CF_EOF
13442 with Text_IO;
13443 package body ConfPackage is
13444    procedure conftest is
13445    begin
13446       Text_IO.Put ("Hello World");
13447       Text_IO.New_Line;
13448    end conftest;
13449 end ConfPackage;
13450 CF_EOF
13451                 if ( $cf_ada_make $ADAFLAGS \
13452                                 -Plibrary.gpr \
13453                                 -XBUILD_DIR=`cd ../conftest.bin;pwd` \
13454                                 -XLIBRARY_DIR=`cd ../conftest.lib;pwd` \
13455                                 -XSOURCE_DIR=`pwd` \
13456                                 -XSONAME=libConfTest.so.1 \
13457                                 -XLIB_KIND=static 1>&5 2>&1 ) ; then
13458                         cf_gnat_projects=yes
13459                 fi
13460                 cd ..
13461                 if test -f conftest.lib/confpackage.ali
13462                 then
13463                         cf_gnat_libraries=yes
13464                 fi
13465                 rm -rf conftest* *~conftest*
13466                 ;;
13467         esac
13468         ;;
13469 esac
13470 echo "$as_me:13470: result: $cf_gnat_projects" >&5
13471 echo "${ECHO_T}$cf_gnat_projects" >&6
13472 fi # enable_gnat_projects
13473
13474 if test $cf_gnat_projects = yes
13475 then
13476         echo "$as_me:13476: checking if GNAT supports libraries" >&5
13477 echo $ECHO_N "checking if GNAT supports libraries... $ECHO_C" >&6
13478         echo "$as_me:13478: result: $cf_gnat_libraries" >&5
13479 echo "${ECHO_T}$cf_gnat_libraries" >&6
13480 fi
13481
13482 if test "$cf_gnat_projects" = yes
13483 then
13484         USE_OLD_MAKERULES="#"
13485         USE_GNAT_PROJECTS=""
13486 else
13487         USE_OLD_MAKERULES=""
13488         USE_GNAT_PROJECTS="#"
13489 fi
13490
13491 if test "$cf_gnat_libraries" = yes
13492 then
13493         USE_GNAT_LIBRARIES=""
13494 else
13495         USE_GNAT_LIBRARIES="#"
13496 fi
13497
13498 echo "$as_me:13498: checking for ada-compiler" >&5
13499 echo $ECHO_N "checking for ada-compiler... $ECHO_C" >&6
13500
13501 # Check whether --with-ada-compiler or --without-ada-compiler was given.
13502 if test "${with_ada_compiler+set}" = set; then
13503   withval="$with_ada_compiler"
13504   cf_ada_compiler=$withval
13505 else
13506   cf_ada_compiler=gnatmake
13507 fi;
13508
13509 echo "$as_me:13509: result: $cf_ada_compiler" >&5
13510 echo "${ECHO_T}$cf_ada_compiler" >&6
13511
13512                 cf_ada_package=terminal_interface
13513
13514 echo "$as_me:13514: checking for ada-include" >&5
13515 echo $ECHO_N "checking for ada-include... $ECHO_C" >&6
13516
13517 # Check whether --with-ada-include or --without-ada-include was given.
13518 if test "${with_ada_include+set}" = set; then
13519   withval="$with_ada_include"
13520
13521 else
13522   withval="${ADA_INCLUDE:-$prefix/share/ada/adainclude}"
13523 fi; if test -n "$prefix/share/ada/adainclude" ; then
13524
13525 if test "x$prefix" != xNONE; then
13526         cf_path_syntax="$prefix"
13527 else
13528         cf_path_syntax="$ac_default_prefix"
13529 fi
13530
13531 case ".$withval" in
13532 (.\$\(*\)*|.\'*\'*)
13533         ;;
13534 (..|./*|.\\*)
13535         ;;
13536 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
13537         ;;
13538 (.\${*prefix}*|.\${*dir}*)
13539         eval withval="$withval"
13540         case ".$withval" in
13541         (.NONE/*)
13542                 withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
13543                 ;;
13544         esac
13545         ;;
13546 (.no|.NONE/*)
13547         withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
13548         ;;
13549 (*)
13550         { { echo "$as_me:13550: error: expected a pathname, not \"$withval\"" >&5
13551 echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;}
13552    { (exit 1); exit 1; }; }
13553         ;;
13554 esac
13555
13556 fi
13557 eval ADA_INCLUDE="$withval"
13558
13559 echo "$as_me:13559: result: $ADA_INCLUDE" >&5
13560 echo "${ECHO_T}$ADA_INCLUDE" >&6
13561
13562 echo "$as_me:13562: checking for ada-objects" >&5
13563 echo $ECHO_N "checking for ada-objects... $ECHO_C" >&6
13564
13565 # Check whether --with-ada-objects or --without-ada-objects was given.
13566 if test "${with_ada_objects+set}" = set; then
13567   withval="$with_ada_objects"
13568
13569 else
13570   withval="${ADA_OBJECTS:-$prefix/lib/ada/adalib}"
13571 fi; if test -n "$prefix/lib/ada/adalib" ; then
13572
13573 if test "x$prefix" != xNONE; then
13574         cf_path_syntax="$prefix"
13575 else
13576         cf_path_syntax="$ac_default_prefix"
13577 fi
13578
13579 case ".$withval" in
13580 (.\$\(*\)*|.\'*\'*)
13581         ;;
13582 (..|./*|.\\*)
13583         ;;
13584 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
13585         ;;
13586 (.\${*prefix}*|.\${*dir}*)
13587         eval withval="$withval"
13588         case ".$withval" in
13589         (.NONE/*)
13590                 withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
13591                 ;;
13592         esac
13593         ;;
13594 (.no|.NONE/*)
13595         withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
13596         ;;
13597 (*)
13598         { { echo "$as_me:13598: error: expected a pathname, not \"$withval\"" >&5
13599 echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;}
13600    { (exit 1); exit 1; }; }
13601         ;;
13602 esac
13603
13604 fi
13605 eval ADA_OBJECTS="$withval"
13606
13607 echo "$as_me:13607: result: $ADA_OBJECTS" >&5
13608 echo "${ECHO_T}$ADA_OBJECTS" >&6
13609
13610 echo "$as_me:13610: checking if an Ada95 shared-library should be built" >&5
13611 echo $ECHO_N "checking if an Ada95 shared-library should be built... $ECHO_C" >&6
13612
13613 # Check whether --with-ada-sharedlib or --without-ada-sharedlib was given.
13614 if test "${with_ada_sharedlib+set}" = set; then
13615   withval="$with_ada_sharedlib"
13616   with_ada_sharedlib=$withval
13617 else
13618   with_ada_sharedlib=no
13619 fi;
13620 echo "$as_me:13620: result: $with_ada_sharedlib" >&5
13621 echo "${ECHO_T}$with_ada_sharedlib" >&6
13622
13623 ADA_SHAREDLIB='lib$(LIB_NAME).so.1'
13624 MAKE_ADA_SHAREDLIB="#"
13625
13626 if test "x$with_ada_sharedlib" != xno
13627 then
13628         MAKE_ADA_SHAREDLIB=
13629         if test "x$with_ada_sharedlib" != xyes
13630         then
13631                 ADA_SHAREDLIB="$with_ada_sharedlib"
13632         fi
13633 fi
13634
13635         else
13636                 { { echo "$as_me:13636: error: No usable Ada compiler found" >&5
13637 echo "$as_me: error: No usable Ada compiler found" >&2;}
13638    { (exit 1); exit 1; }; }
13639         fi
13640 else
13641         { { echo "$as_me:13641: error: The Ada compiler is needed for this package" >&5
13642 echo "$as_me: error: The Ada compiler is needed for this package" >&2;}
13643    { (exit 1); exit 1; }; }
13644 fi
13645
13646 ################################################################################
13647
13648 # not needed
13649 TINFO_LDFLAGS2=
13650
13651 TINFO_LIBS=
13652
13653 ### Construct the list of include-directories to be generated
13654
13655 if test "$srcdir" != "."; then
13656         CPPFLAGS="-I\${srcdir}/../include $CPPFLAGS"
13657 fi
13658 CPPFLAGS="-I../include $CPPFLAGS"
13659 if test "$srcdir" != "."; then
13660         CPPFLAGS="-I\${srcdir} $CPPFLAGS"
13661 fi
13662 CPPFLAGS="-I. $CPPFLAGS"
13663
13664 ACPPFLAGS="-I. -I../include -I../../include $ACPPFLAGS"
13665 if test "$srcdir" != "."; then
13666         ACPPFLAGS="-I\${srcdir}/../../include $ACPPFLAGS"
13667 fi
13668 if test "$GCC" != yes; then
13669         ACPPFLAGS="$ACPPFLAGS -I\${includedir}"
13670 elif test "$includedir" != "/usr/include"; then
13671         if test "$includedir" = '${prefix}/include' ; then
13672                 if test x$prefix != x/usr ; then
13673                         ACPPFLAGS="$ACPPFLAGS -I\${includedir}"
13674                 fi
13675         else
13676                 ACPPFLAGS="$ACPPFLAGS -I\${includedir}"
13677         fi
13678 fi
13679
13680 ### Build up pieces for makefile rules
13681 echo "$as_me:13681: checking default library suffix" >&5
13682 echo $ECHO_N "checking default library suffix... $ECHO_C" >&6
13683
13684         case $DFT_LWR_MODEL in
13685         (libtool) DFT_ARG_SUFFIX=''   ;;
13686         (normal)  DFT_ARG_SUFFIX=''   ;;
13687         (debug)   DFT_ARG_SUFFIX='_g' ;;
13688         (profile) DFT_ARG_SUFFIX='_p' ;;
13689         (shared)  DFT_ARG_SUFFIX=''   ;;
13690         esac
13691         test -n "$LIB_SUFFIX" && DFT_ARG_SUFFIX="${LIB_SUFFIX}${DFT_ARG_SUFFIX}"
13692 echo "$as_me:13692: result: $DFT_ARG_SUFFIX" >&5
13693 echo "${ECHO_T}$DFT_ARG_SUFFIX" >&6
13694
13695 echo "$as_me:13695: checking default library-dependency suffix" >&5
13696 echo $ECHO_N "checking default library-dependency suffix... $ECHO_C" >&6
13697
13698         case X$DFT_LWR_MODEL in
13699         (Xlibtool)
13700                 DFT_LIB_SUFFIX='.la'
13701                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
13702                 ;;
13703         (Xdebug)
13704                 DFT_LIB_SUFFIX='_g.a'
13705                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
13706                 ;;
13707         (Xprofile)
13708                 DFT_LIB_SUFFIX='_p.a'
13709                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
13710                 ;;
13711         (Xshared)
13712                 case $cf_cv_system_name in
13713                 (aix[5-7]*)
13714                         DFT_LIB_SUFFIX='.so'
13715                         DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
13716                         ;;
13717                 (cygwin*|msys*|mingw*)
13718                         DFT_LIB_SUFFIX='.dll'
13719                         DFT_DEP_SUFFIX='.dll.a'
13720                         ;;
13721                 (darwin*)
13722                         DFT_LIB_SUFFIX='.dylib'
13723                         DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
13724                         ;;
13725                 (hpux*)
13726                         case $target in
13727                         (ia64*)
13728                                 DFT_LIB_SUFFIX='.so'
13729                                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
13730                                 ;;
13731                         (*)
13732                                 DFT_LIB_SUFFIX='.sl'
13733                                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
13734                                 ;;
13735                         esac
13736                         ;;
13737                 (*)
13738                         DFT_LIB_SUFFIX='.so'
13739                         DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
13740                         ;;
13741                 esac
13742                 ;;
13743         (*)
13744                 DFT_LIB_SUFFIX='.a'
13745                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
13746                 ;;
13747         esac
13748         if test -n "${LIB_SUFFIX}${EXTRA_SUFFIX}"
13749         then
13750                 DFT_LIB_SUFFIX="${LIB_SUFFIX}${EXTRA_SUFFIX}${DFT_LIB_SUFFIX}"
13751                 DFT_DEP_SUFFIX="${LIB_SUFFIX}${EXTRA_SUFFIX}${DFT_DEP_SUFFIX}"
13752         fi
13753 echo "$as_me:13753: result: $DFT_DEP_SUFFIX" >&5
13754 echo "${ECHO_T}$DFT_DEP_SUFFIX" >&6
13755
13756 echo "$as_me:13756: checking default object directory" >&5
13757 echo $ECHO_N "checking default object directory... $ECHO_C" >&6
13758
13759         case $DFT_LWR_MODEL in
13760         (libtool) DFT_OBJ_SUBDIR='obj_lo'  ;;
13761         (normal)  DFT_OBJ_SUBDIR='objects' ;;
13762         (debug)   DFT_OBJ_SUBDIR='obj_g' ;;
13763         (profile) DFT_OBJ_SUBDIR='obj_p' ;;
13764         (shared)
13765                 case $cf_cv_system_name in
13766                 (cygwin|msys)
13767                         DFT_OBJ_SUBDIR='objects' ;;
13768                 (*)
13769                         DFT_OBJ_SUBDIR='obj_s' ;;
13770                 esac
13771         esac
13772 echo "$as_me:13772: result: $DFT_OBJ_SUBDIR" >&5
13773 echo "${ECHO_T}$DFT_OBJ_SUBDIR" >&6
13774
13775 ### Set up low-level terminfo dependencies for makefiles.
13776
13777 if test "$DFT_LWR_MODEL" = shared ; then
13778         case $cf_cv_system_name in
13779         (cygwin*)
13780                 # "lib" files have ".dll.a" suffix, "cyg" files have ".dll"
13781                 ;;
13782         (msys*)
13783                 # "lib" files have ".dll.a" suffix, "msys-" files have ".dll"
13784                 ;;
13785         esac
13786 fi
13787
13788 USE_CFG_SUFFIX=${DFT_ARG_SUFFIX}
13789
13790 ### Construct the list of subdirectories for which we'll customize makefiles
13791 ### with the appropriate compile-rules.
13792
13793 SUB_MAKEFILES="gen/adacurses${USE_ARG_SUFFIX}-config:gen/adacurses-config.in"
13794
13795 cat >>confdefs.h <<EOF
13796 #define NCURSES_PATHSEP '$PATH_SEPARATOR'
13797 EOF
13798
13799 ### Now that we're done running tests, add the compiler-warnings, if any
13800
13801 cf_fix_cppflags=no
13802 cf_new_cflags=
13803 cf_new_cppflags=
13804 cf_new_extra_cppflags=
13805
13806 for cf_add_cflags in $EXTRA_CFLAGS
13807 do
13808 case $cf_fix_cppflags in
13809 (no)
13810         case $cf_add_cflags in
13811         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13812                 case $cf_add_cflags in
13813                 (-D*)
13814                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13815
13816                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13817                                 && test -z "${cf_tst_cflags}" \
13818                                 && cf_fix_cppflags=yes
13819
13820                         if test $cf_fix_cppflags = yes ; then
13821                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
13822                                 continue
13823                         elif test "${cf_tst_cflags}" = "\"'" ; then
13824                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
13825                                 continue
13826                         fi
13827                         ;;
13828                 esac
13829                 case "$CPPFLAGS" in
13830                 (*$cf_add_cflags)
13831                         ;;
13832                 (*)
13833                         case $cf_add_cflags in
13834                         (-D*)
13835                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13836
13837 CPPFLAGS=`echo "$CPPFLAGS" | \
13838         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13839                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13840
13841                                 ;;
13842                         esac
13843                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
13844                         ;;
13845                 esac
13846                 ;;
13847         (*)
13848                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
13849                 ;;
13850         esac
13851         ;;
13852 (yes)
13853         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
13854
13855         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
13856
13857         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13858                 && test -z "${cf_tst_cflags}" \
13859                 && cf_fix_cppflags=no
13860         ;;
13861 esac
13862 done
13863
13864 if test -n "$cf_new_cflags" ; then
13865
13866         CFLAGS="$CFLAGS $cf_new_cflags"
13867 fi
13868
13869 if test -n "$cf_new_cppflags" ; then
13870
13871         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
13872 fi
13873
13874 if test -n "$cf_new_extra_cppflags" ; then
13875
13876         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
13877 fi
13878
13879 ################################################################################
13880
13881 TEST_ARG2=
13882
13883 TEST_LIBS2=
13884
13885 NCURSES_SHLIB2="sh -c"
13886
13887 ADA_SUBDIRS="include gen src doc"
13888 if test "x$cf_with_tests" != "xno" ; then
13889         ADA_SUBDIRS="$ADA_SUBDIRS samples"
13890 fi
13891 for cf_dir in $ADA_SUBDIRS
13892 do
13893         SUB_MAKEFILES="$SUB_MAKEFILES $cf_dir/Makefile"
13894 done
13895
13896 NCURSES_TREE="#"
13897
13898 EXTERNAL_TREE=
13899
13900 # match layout used by make-tar.sh
13901 ADAHTML_DIR=../doc/ada
13902
13903 ac_config_files="$ac_config_files $SUB_MAKEFILES doc/adacurses${DFT_ARG_SUFFIX}-config.1:doc/MKada_config.in Makefile"
13904 ac_config_commands="$ac_config_commands default"
13905 cat >confcache <<\_ACEOF
13906 # This file is a shell script that caches the results of configure
13907 # tests run on this system so they can be shared between configure
13908 # scripts and configure runs, see configure's option --config-cache.
13909 # It is not useful on other systems.  If it contains results you don't
13910 # want to keep, you may remove or edit it.
13911 #
13912 # config.status only pays attention to the cache file if you give it
13913 # the --recheck option to rerun configure.
13914 #
13915 # `ac_cv_env_foo' variables (set or unset) will be overriden when
13916 # loading this file, other *unset* `ac_cv_foo' will be assigned the
13917 # following values.
13918
13919 _ACEOF
13920
13921 # The following way of writing the cache mishandles newlines in values,
13922 # but we know of no workaround that is simple, portable, and efficient.
13923 # So, don't put newlines in cache variables' values.
13924 # Ultrix sh set writes to stderr and can't be redirected directly,
13925 # and sets the high bit in the cache file unless we assign to the vars.
13926 {
13927   (set) 2>&1 |
13928     case `(ac_space=' '; set | grep ac_space) 2>&1` in
13929     *ac_space=\ *)
13930       # `set' does not quote correctly, so add quotes (double-quote
13931       # substitution turns \\\\ into \\, and sed turns \\ into \).
13932       sed -n \
13933         "s/'/'\\\\''/g;
13934           s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
13935       ;;
13936     *)
13937       # `set' quotes correctly as required by POSIX, so do not add quotes.
13938       sed -n \
13939         "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
13940       ;;
13941     esac;
13942 } |
13943   sed '
13944      t clear
13945      : clear
13946      s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
13947      t end
13948      /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
13949      : end' >>confcache
13950 if cmp -s $cache_file confcache; then :; else
13951   if test -w $cache_file; then
13952     test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file"
13953     cat confcache >$cache_file
13954   else
13955     echo "not updating unwritable cache $cache_file"
13956   fi
13957 fi
13958 rm -f confcache
13959
13960 test "x$prefix" = xNONE && prefix=$ac_default_prefix
13961 # Let make expand exec_prefix.
13962 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
13963
13964 # VPATH may cause trouble with some makes, so we remove $(srcdir),
13965 # ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
13966 # trailing colons and then remove the whole line if VPATH becomes empty
13967 # (actually we leave an empty line to preserve line numbers).
13968 if test "x$srcdir" = x.; then
13969   ac_vpsub='/^[         ]*VPATH[        ]*=/{
13970 s/:*\$(srcdir):*/:/;
13971 s/:*\${srcdir}:*/:/;
13972 s/:*@srcdir@:*/:/;
13973 s/^\([^=]*=[    ]*\):*/\1/;
13974 s/:*$//;
13975 s/^[^=]*=[      ]*$//;
13976 }'
13977 fi
13978
13979 DEFS=-DHAVE_CONFIG_H
13980
13981 : ${CONFIG_STATUS=./config.status}
13982 ac_clean_files_save=$ac_clean_files
13983 ac_clean_files="$ac_clean_files $CONFIG_STATUS"
13984 { echo "$as_me:13984: creating $CONFIG_STATUS" >&5
13985 echo "$as_me: creating $CONFIG_STATUS" >&6;}
13986 cat >$CONFIG_STATUS <<_ACEOF
13987 #! $SHELL
13988 # Generated automatically by configure.
13989 # Run this file to recreate the current configuration.
13990 # Compiler output produced by configure, useful for debugging
13991 # configure, is in config.log if it exists.
13992
13993 debug=false
13994 SHELL=\${CONFIG_SHELL-$SHELL}
13995 ac_cs_invocation="\$0 \$@"
13996
13997 _ACEOF
13998
13999 cat >>$CONFIG_STATUS <<\_ACEOF
14000 # Be Bourne compatible
14001 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
14002   emulate sh
14003   NULLCMD=:
14004 elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
14005   set -o posix
14006 fi
14007
14008 # Name of the executable.
14009 as_me=`echo "$0" |sed 's,.*[\\/],,'`
14010
14011 if expr a : '\(a\)' >/dev/null 2>&1; then
14012   as_expr=expr
14013 else
14014   as_expr=false
14015 fi
14016
14017 rm -f conf$$ conf$$.exe conf$$.file
14018 echo >conf$$.file
14019 if ln -s conf$$.file conf$$ 2>/dev/null; then
14020   # We could just check for DJGPP; but this test a) works b) is more generic
14021   # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
14022   if test -f conf$$.exe; then
14023     # Don't use ln at all; we don't have any links
14024     as_ln_s='cp -p'
14025   else
14026     as_ln_s='ln -s'
14027   fi
14028 elif ln conf$$.file conf$$ 2>/dev/null; then
14029   as_ln_s=ln
14030 else
14031   as_ln_s='cp -p'
14032 fi
14033 rm -f conf$$ conf$$.exe conf$$.file
14034
14035 as_executable_p="test -f"
14036
14037 # Support unset when possible.
14038 if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
14039   as_unset=unset
14040 else
14041   as_unset=false
14042 fi
14043
14044 # NLS nuisances.
14045 $as_unset LANG || test "${LANG+set}" != set || { LANG=C; export LANG; }
14046 $as_unset LC_ALL || test "${LC_ALL+set}" != set || { LC_ALL=C; export LC_ALL; }
14047 $as_unset LC_TIME || test "${LC_TIME+set}" != set || { LC_TIME=C; export LC_TIME; }
14048 $as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set || { LC_CTYPE=C; export LC_CTYPE; }
14049 $as_unset LANGUAGE || test "${LANGUAGE+set}" != set || { LANGUAGE=C; export LANGUAGE; }
14050 $as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set || { LC_COLLATE=C; export LC_COLLATE; }
14051 $as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set || { LC_NUMERIC=C; export LC_NUMERIC; }
14052 $as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set || { LC_MESSAGES=C; export LC_MESSAGES; }
14053
14054 # IFS
14055 # We need space, tab and new line, in precisely that order.
14056 as_nl='
14057 '
14058 IFS="   $as_nl"
14059
14060 # CDPATH.
14061 $as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=:; export CDPATH; }
14062
14063 exec 6>&1
14064
14065 _ACEOF
14066
14067 # Files that config.status was made for.
14068 if test -n "$ac_config_files"; then
14069   echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS
14070 fi
14071
14072 if test -n "$ac_config_headers"; then
14073   echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS
14074 fi
14075
14076 if test -n "$ac_config_links"; then
14077   echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS
14078 fi
14079
14080 if test -n "$ac_config_commands"; then
14081   echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS
14082 fi
14083
14084 cat >>$CONFIG_STATUS <<\EOF
14085
14086 ac_cs_usage="\
14087 \`$as_me' instantiates files from templates according to the
14088 current configuration.
14089
14090 Usage: $0 [OPTIONS] [FILE]...
14091
14092   -h, --help       print this help, then exit
14093   -V, --version    print version number, then exit
14094   -d, --debug      don't remove temporary files
14095       --recheck    update $as_me by reconfiguring in the same conditions
14096   --file=FILE[:TEMPLATE]
14097                    instantiate the configuration file FILE
14098   --header=FILE[:TEMPLATE]
14099                    instantiate the configuration header FILE
14100
14101 Configuration files:
14102 $config_files
14103
14104 Configuration headers:
14105 $config_headers
14106
14107 Configuration commands:
14108 $config_commands
14109
14110 Report bugs to <dickey@invisible-island.net>."
14111 EOF
14112
14113 cat >>$CONFIG_STATUS <<EOF
14114 ac_cs_version="\\
14115 config.status
14116 configured by $0, generated by GNU Autoconf 2.52.20141204,
14117   with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
14118
14119 Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
14120 Free Software Foundation, Inc.
14121 This config.status script is free software; the Free Software Foundation
14122 gives unlimited permission to copy, distribute and modify it."
14123 srcdir=$srcdir
14124 INSTALL="$INSTALL"
14125 EOF
14126
14127 cat >>$CONFIG_STATUS <<\EOF
14128 # If no file are specified by the user, then we need to provide default
14129 # value.  By we need to know if files were specified by the user.
14130 ac_need_defaults=:
14131 while test $# != 0
14132 do
14133   case $1 in
14134   --*=*)
14135     ac_option=`expr "x$1" : 'x\([^=]*\)='`
14136     ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'`
14137     shift
14138     set dummy "$ac_option" "$ac_optarg" ${1+"$@"}
14139     shift
14140     ;;
14141   -*);;
14142   *) # This is not an option, so the user has probably given explicit
14143      # arguments.
14144      ac_need_defaults=false;;
14145   esac
14146
14147   case $1 in
14148   # Handling of the options.
14149 EOF
14150 cat >>$CONFIG_STATUS <<EOF
14151   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
14152     echo "running $SHELL $0 " $ac_configure_args " --no-create --no-recursion"
14153     exec $SHELL $0 $ac_configure_args --no-create --no-recursion ;;
14154 EOF
14155 cat >>$CONFIG_STATUS <<\EOF
14156   --version | --vers* | -V )
14157     echo "$ac_cs_version"; exit 0 ;;
14158   --he | --h)
14159     # Conflict between --help and --header
14160     { { echo "$as_me:14160: error: ambiguous option: $1
14161 Try \`$0 --help' for more information." >&5
14162 echo "$as_me: error: ambiguous option: $1
14163 Try \`$0 --help' for more information." >&2;}
14164    { (exit 1); exit 1; }; };;
14165   --help | --hel | -h )
14166     echo "$ac_cs_usage"; exit 0 ;;
14167   --debug | --d* | -d )
14168     debug=: ;;
14169   --file | --fil | --fi | --f )
14170     shift
14171     CONFIG_FILES="$CONFIG_FILES $1"
14172     ac_need_defaults=false;;
14173   --header | --heade | --head | --hea )
14174     shift
14175     CONFIG_HEADERS="$CONFIG_HEADERS $1"
14176     ac_need_defaults=false;;
14177
14178   # This is an error.
14179   -*) { { echo "$as_me:14179: error: unrecognized option: $1
14180 Try \`$0 --help' for more information." >&5
14181 echo "$as_me: error: unrecognized option: $1
14182 Try \`$0 --help' for more information." >&2;}
14183    { (exit 1); exit 1; }; } ;;
14184
14185   *) ac_config_targets="$ac_config_targets $1" ;;
14186
14187   esac
14188   shift
14189 done
14190
14191 exec 5>>config.log
14192 cat >&5 << _ACEOF
14193
14194 ## ----------------------- ##
14195 ## Running config.status.  ##
14196 ## ----------------------- ##
14197
14198 This file was extended by $as_me 2.52.20141204, executed with
14199   CONFIG_FILES    = $CONFIG_FILES
14200   CONFIG_HEADERS  = $CONFIG_HEADERS
14201   CONFIG_LINKS    = $CONFIG_LINKS
14202   CONFIG_COMMANDS = $CONFIG_COMMANDS
14203   > $ac_cs_invocation
14204 on `(hostname || uname -n) 2>/dev/null | sed 1q`
14205
14206 _ACEOF
14207 EOF
14208
14209 cat >>$CONFIG_STATUS <<EOF
14210 #
14211 # INIT-COMMANDS section.
14212 #
14213
14214 ### Special initialization commands, used to pass information from the
14215 ### configuration-run into config.status
14216
14217 AWK="$AWK"
14218 DFT_ARG_SUFFIX="$DFT_ARG_SUFFIX"
14219 DFT_LWR_MODEL="$DFT_LWR_MODEL"
14220 LIB_NAME="$LIB_NAME"
14221 LIB_PREFIX="$LIB_PREFIX"
14222 LIB_SUFFIX="$LIB_SUFFIX"
14223 LN_S="$LN_S"
14224 NCURSES_MAJOR="$NCURSES_MAJOR"
14225 NCURSES_MINOR="$NCURSES_MINOR"
14226 NCURSES_PATCH="$NCURSES_PATCH"
14227 USE_OLD_MAKERULES="$USE_OLD_MAKERULES"
14228 cf_cv_abi_version="$cf_cv_abi_version"
14229 cf_cv_rel_version="$cf_cv_rel_version"
14230 cf_cv_rm_so_locs="$cf_cv_rm_so_locs"
14231 cf_cv_shared_soname='$cf_cv_shared_soname'
14232 cf_cv_shlib_version="$cf_cv_shlib_version"
14233 cf_cv_shlib_version_infix="$cf_cv_shlib_version_infix"
14234 cf_cv_system_name="$cf_cv_system_name"
14235 host="$host"
14236 target="$target"
14237
14238 EOF
14239
14240 cat >>$CONFIG_STATUS <<\EOF
14241 for ac_config_target in $ac_config_targets
14242 do
14243   case "$ac_config_target" in
14244   # Handling of arguments.
14245   "$SUB_MAKEFILES" ) CONFIG_FILES="$CONFIG_FILES $SUB_MAKEFILES" ;;
14246   "doc/adacurses${DFT_ARG_SUFFIX}-config.1" ) CONFIG_FILES="$CONFIG_FILES doc/adacurses${DFT_ARG_SUFFIX}-config.1:doc/MKada_config.in" ;;
14247   "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;;
14248   "default" ) CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;;
14249   "include/ncurses_cfg.h" ) CONFIG_HEADERS="$CONFIG_HEADERS include/ncurses_cfg.h:include/ncurses_cfg.hin" ;;
14250   *) { { echo "$as_me:14250: error: invalid argument: $ac_config_target" >&5
14251 echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
14252    { (exit 1); exit 1; }; };;
14253   esac
14254 done
14255
14256 # If the user did not use the arguments to specify the items to instantiate,
14257 # then the envvar interface is used.  Set only those that are not.
14258 # We use the long form for the default assignment because of an extremely
14259 # bizarre bug on SunOS 4.1.3.
14260 if $ac_need_defaults; then
14261   test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
14262   test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
14263   test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
14264 fi
14265
14266 # Create a temporary directory, and hook for its removal unless debugging.
14267 $debug ||
14268 {
14269   trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0
14270   trap '{ (exit 1); exit 1; }' 1 2 13 15
14271 }
14272
14273 # Create a (secure) tmp directory for tmp files.
14274 : ${TMPDIR=/tmp}
14275 {
14276   tmp=`(umask 077 && mktemp -d -q "$TMPDIR/csXXXXXX") 2>/dev/null` &&
14277   test -n "$tmp" && test -d "$tmp"
14278 }  ||
14279 {
14280   tmp=$TMPDIR/cs$$-$RANDOM
14281   (umask 077 && mkdir $tmp)
14282 } ||
14283 {
14284    echo "$me: cannot create a temporary directory in $TMPDIR" >&2
14285    { (exit 1); exit 1; }
14286 }
14287
14288 EOF
14289
14290 cat >>$CONFIG_STATUS <<EOF
14291
14292 #
14293 # CONFIG_FILES section.
14294 #
14295
14296 # No need to generate the scripts if there are no CONFIG_FILES.
14297 # This happens for instance when ./config.status config.h
14298 if test -n "\$CONFIG_FILES"; then
14299   # Protect against being on the right side of a sed subst in config.status.
14300   sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g;
14301    s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF
14302 s,@SHELL@,$SHELL,;t t
14303 s,@exec_prefix@,$exec_prefix,;t t
14304 s,@prefix@,$prefix,;t t
14305 s,@program_transform_name@,$program_transform_name,;t t
14306 s,@bindir@,$bindir,;t t
14307 s,@sbindir@,$sbindir,;t t
14308 s,@libexecdir@,$libexecdir,;t t
14309 s,@datarootdir@,$datarootdir,;t t
14310 s,@datadir@,$datadir,;t t
14311 s,@sysconfdir@,$sysconfdir,;t t
14312 s,@sharedstatedir@,$sharedstatedir,;t t
14313 s,@localstatedir@,$localstatedir,;t t
14314 s,@libdir@,$libdir,;t t
14315 s,@includedir@,$includedir,;t t
14316 s,@oldincludedir@,$oldincludedir,;t t
14317 s,@infodir@,$infodir,;t t
14318 s,@mandir@,$mandir,;t t
14319 s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t
14320 s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t
14321 s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t
14322 s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t
14323 s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t
14324 s,@build_alias@,$build_alias,;t t
14325 s,@host_alias@,$host_alias,;t t
14326 s,@target_alias@,$target_alias,;t t
14327 s,@ECHO_C@,$ECHO_C,;t t
14328 s,@ECHO_N@,$ECHO_N,;t t
14329 s,@ECHO_T@,$ECHO_T,;t t
14330 s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t
14331 s,@DEFS@,$DEFS,;t t
14332 s,@LIBS@,$LIBS,;t t
14333 s,@top_builddir@,$top_builddir,;t t
14334 s,@build@,$build,;t t
14335 s,@build_cpu@,$build_cpu,;t t
14336 s,@build_vendor@,$build_vendor,;t t
14337 s,@build_os@,$build_os,;t t
14338 s,@host@,$host,;t t
14339 s,@host_cpu@,$host_cpu,;t t
14340 s,@host_vendor@,$host_vendor,;t t
14341 s,@host_os@,$host_os,;t t
14342 s,@target@,$target,;t t
14343 s,@target_cpu@,$target_cpu,;t t
14344 s,@target_vendor@,$target_vendor,;t t
14345 s,@target_os@,$target_os,;t t
14346 s,@CC@,$CC,;t t
14347 s,@CFLAGS@,$CFLAGS,;t t
14348 s,@LDFLAGS@,$LDFLAGS,;t t
14349 s,@CPPFLAGS@,$CPPFLAGS,;t t
14350 s,@ac_ct_CC@,$ac_ct_CC,;t t
14351 s,@EXEEXT@,$EXEEXT,;t t
14352 s,@OBJEXT@,$OBJEXT,;t t
14353 s,@EXTRA_CPPFLAGS@,$EXTRA_CPPFLAGS,;t t
14354 s,@CPP@,$CPP,;t t
14355 s,@AWK@,$AWK,;t t
14356 s,@EGREP@,$EGREP,;t t
14357 s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t
14358 s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t
14359 s,@INSTALL_DATA@,$INSTALL_DATA,;t t
14360 s,@LN_S@,$LN_S,;t t
14361 s,@PKG_CONFIG@,$PKG_CONFIG,;t t
14362 s,@ac_pt_PKG_CONFIG@,$ac_pt_PKG_CONFIG,;t t
14363 s,@PKG_CONFIG_LIBDIR@,$PKG_CONFIG_LIBDIR,;t t
14364 s,@SET_MAKE@,$SET_MAKE,;t t
14365 s,@CTAGS@,$CTAGS,;t t
14366 s,@ETAGS@,$ETAGS,;t t
14367 s,@MAKE_LOWER_TAGS@,$MAKE_LOWER_TAGS,;t t
14368 s,@MAKE_UPPER_TAGS@,$MAKE_UPPER_TAGS,;t t
14369 s,@cf_cv_makeflags@,$cf_cv_makeflags,;t t
14370 s,@RANLIB@,$RANLIB,;t t
14371 s,@ac_ct_RANLIB@,$ac_ct_RANLIB,;t t
14372 s,@LD@,$LD,;t t
14373 s,@ac_ct_LD@,$ac_ct_LD,;t t
14374 s,@AR@,$AR,;t t
14375 s,@ac_ct_AR@,$ac_ct_AR,;t t
14376 s,@ARFLAGS@,$ARFLAGS,;t t
14377 s,@DESTDIR@,$DESTDIR,;t t
14378 s,@BUILD_CC@,$BUILD_CC,;t t
14379 s,@BUILD_CPP@,$BUILD_CPP,;t t
14380 s,@BUILD_CFLAGS@,$BUILD_CFLAGS,;t t
14381 s,@BUILD_CPPFLAGS@,$BUILD_CPPFLAGS,;t t
14382 s,@BUILD_LDFLAGS@,$BUILD_LDFLAGS,;t t
14383 s,@BUILD_LIBS@,$BUILD_LIBS,;t t
14384 s,@BUILD_EXEEXT@,$BUILD_EXEEXT,;t t
14385 s,@BUILD_OBJEXT@,$BUILD_OBJEXT,;t t
14386 s,@DFT_LWR_MODEL@,$DFT_LWR_MODEL,;t t
14387 s,@DFT_UPR_MODEL@,$DFT_UPR_MODEL,;t t
14388 s,@NCURSES_CONFIG@,$NCURSES_CONFIG,;t t
14389 s,@ac_ct_NCURSES_CONFIG@,$ac_ct_NCURSES_CONFIG,;t t
14390 s,@NCURSES_MAJOR@,$NCURSES_MAJOR,;t t
14391 s,@NCURSES_MINOR@,$NCURSES_MINOR,;t t
14392 s,@NCURSES_PATCH@,$NCURSES_PATCH,;t t
14393 s,@cf_cv_rel_version@,$cf_cv_rel_version,;t t
14394 s,@cf_cv_abi_version@,$cf_cv_abi_version,;t t
14395 s,@cf_cv_builtin_bool@,$cf_cv_builtin_bool,;t t
14396 s,@cf_cv_header_stdbool_h@,$cf_cv_header_stdbool_h,;t t
14397 s,@cf_cv_type_of_bool@,$cf_cv_type_of_bool,;t t
14398 s,@LIB_PREFIX@,$LIB_PREFIX,;t t
14399 s,@LIB_SUFFIX@,$LIB_SUFFIX,;t t
14400 s,@CC_G_OPT@,$CC_G_OPT,;t t
14401 s,@LD_MODEL@,$LD_MODEL,;t t
14402 s,@shlibdir@,$shlibdir,;t t
14403 s,@MAKE_DLLS@,$MAKE_DLLS,;t t
14404 s,@CC_SHARED_OPTS@,$CC_SHARED_OPTS,;t t
14405 s,@LD_RPATH_OPT@,$LD_RPATH_OPT,;t t
14406 s,@LD_SHARED_OPTS@,$LD_SHARED_OPTS,;t t
14407 s,@MK_SHARED_LIB@,$MK_SHARED_LIB,;t t
14408 s,@RM_SHARED_OPTS@,$RM_SHARED_OPTS,;t t
14409 s,@LINK_PROGS@,$LINK_PROGS,;t t
14410 s,@LINK_TESTS@,$LINK_TESTS,;t t
14411 s,@EXTRA_LDFLAGS@,$EXTRA_LDFLAGS,;t t
14412 s,@LOCAL_LDFLAGS@,$LOCAL_LDFLAGS,;t t
14413 s,@LOCAL_LDFLAGS2@,$LOCAL_LDFLAGS2,;t t
14414 s,@INSTALL_LIB@,$INSTALL_LIB,;t t
14415 s,@RPATH_LIST@,$RPATH_LIST,;t t
14416 s,@BROKEN_LINKER@,$BROKEN_LINKER,;t t
14417 s,@NCURSES_EXT_FUNCS@,$NCURSES_EXT_FUNCS,;t t
14418 s,@NCURSES_CONST@,$NCURSES_CONST,;t t
14419 s,@PTHREAD@,$PTHREAD,;t t
14420 s,@cf_cv_enable_reentrant@,$cf_cv_enable_reentrant,;t t
14421 s,@NCURSES_WRAP_PREFIX@,$NCURSES_WRAP_PREFIX,;t t
14422 s,@ECHO_LT@,$ECHO_LT,;t t
14423 s,@ECHO_LD@,$ECHO_LD,;t t
14424 s,@RULE_CC@,$RULE_CC,;t t
14425 s,@SHOW_CC@,$SHOW_CC,;t t
14426 s,@ECHO_CC@,$ECHO_CC,;t t
14427 s,@ADAFLAGS@,$ADAFLAGS,;t t
14428 s,@EXTRA_CFLAGS@,$EXTRA_CFLAGS,;t t
14429 s,@ADA_TRACE@,$ADA_TRACE,;t t
14430 s,@gnat_exists@,$gnat_exists,;t t
14431 s,@M4_exists@,$M4_exists,;t t
14432 s,@cf_ada_make@,$cf_ada_make,;t t
14433 s,@GNATPREP_OPTS@,$GNATPREP_OPTS,;t t
14434 s,@cf_compile_generics@,$cf_compile_generics,;t t
14435 s,@cf_generic_objects@,$cf_generic_objects,;t t
14436 s,@USE_GNAT_SIGINT@,$USE_GNAT_SIGINT,;t t
14437 s,@USE_OLD_MAKERULES@,$USE_OLD_MAKERULES,;t t
14438 s,@USE_GNAT_PROJECTS@,$USE_GNAT_PROJECTS,;t t
14439 s,@USE_GNAT_LIBRARIES@,$USE_GNAT_LIBRARIES,;t t
14440 s,@cf_ada_compiler@,$cf_ada_compiler,;t t
14441 s,@cf_ada_package@,$cf_ada_package,;t t
14442 s,@ADA_INCLUDE@,$ADA_INCLUDE,;t t
14443 s,@ADA_OBJECTS@,$ADA_OBJECTS,;t t
14444 s,@ADA_SHAREDLIB@,$ADA_SHAREDLIB,;t t
14445 s,@MAKE_ADA_SHAREDLIB@,$MAKE_ADA_SHAREDLIB,;t t
14446 s,@TINFO_LDFLAGS2@,$TINFO_LDFLAGS2,;t t
14447 s,@TINFO_LIBS@,$TINFO_LIBS,;t t
14448 s,@ACPPFLAGS@,$ACPPFLAGS,;t t
14449 s,@DFT_ARG_SUFFIX@,$DFT_ARG_SUFFIX,;t t
14450 s,@DFT_DEP_SUFFIX@,$DFT_DEP_SUFFIX,;t t
14451 s,@DFT_OBJ_SUBDIR@,$DFT_OBJ_SUBDIR,;t t
14452 s,@USE_CFG_SUFFIX@,$USE_CFG_SUFFIX,;t t
14453 s,@TEST_ARG2@,$TEST_ARG2,;t t
14454 s,@TEST_LIBS2@,$TEST_LIBS2,;t t
14455 s,@NCURSES_SHLIB2@,$NCURSES_SHLIB2,;t t
14456 s,@ADA_SUBDIRS@,$ADA_SUBDIRS,;t t
14457 s,@NCURSES_TREE@,$NCURSES_TREE,;t t
14458 s,@EXTERNAL_TREE@,$EXTERNAL_TREE,;t t
14459 s,@ADAHTML_DIR@,$ADAHTML_DIR,;t t
14460 CEOF
14461
14462 EOF
14463
14464   cat >>$CONFIG_STATUS <<\EOF
14465   # Split the substitutions into bite-sized pieces for seds with
14466   # small command number limits, like on Digital OSF/1 and HP-UX.
14467   ac_max_sed_lines=48
14468   ac_sed_frag=1 # Number of current file.
14469   ac_beg=1 # First line for current file.
14470   ac_end=$ac_max_sed_lines # Line after last line for current file.
14471   ac_more_lines=:
14472   ac_sed_cmds=
14473   while $ac_more_lines; do
14474     if test $ac_beg -gt 1; then
14475       sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
14476     else
14477       sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
14478     fi
14479     if test ! -s $tmp/subs.frag; then
14480       ac_more_lines=false
14481     else
14482       # The purpose of the label and of the branching condition is to
14483       # speed up the sed processing (if there are no `@' at all, there
14484       # is no need to browse any of the substitutions).
14485       # These are the two extra sed commands mentioned above.
14486       (echo ':t
14487   /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed
14488       if test -z "$ac_sed_cmds"; then
14489         ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed"
14490       else
14491         ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed"
14492       fi
14493       ac_sed_frag=`expr $ac_sed_frag + 1`
14494       ac_beg=$ac_end
14495       ac_end=`expr $ac_end + $ac_max_sed_lines`
14496     fi
14497   done
14498   if test -z "$ac_sed_cmds"; then
14499     ac_sed_cmds=cat
14500   fi
14501 fi # test -n "$CONFIG_FILES"
14502
14503 EOF
14504 cat >>$CONFIG_STATUS <<\EOF
14505 for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue
14506   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
14507   case $ac_file in
14508   - | *:- | *:-:* ) # input from stdin
14509         cat >$tmp/stdin
14510         ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
14511         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
14512   *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
14513         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
14514   * )   ac_file_in=$ac_file.in ;;
14515   esac
14516
14517   # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories.
14518   ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
14519          X"$ac_file" : 'X\(//\)[^/]' \| \
14520          X"$ac_file" : 'X\(//\)$' \| \
14521          X"$ac_file" : 'X\(/\)' \| \
14522          .     : '\(.\)' 2>/dev/null ||
14523 echo X"$ac_file" |
14524     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
14525           /^X\(\/\/\)[^/].*/{ s//\1/; q; }
14526           /^X\(\/\/\)$/{ s//\1/; q; }
14527           /^X\(\/\).*/{ s//\1/; q; }
14528           s/.*/./; q'`
14529   if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
14530     { case "$ac_dir" in
14531   [\\/]* | ?:[\\/]* ) as_incr_dir=;;
14532   *)                      as_incr_dir=.;;
14533 esac
14534 as_dummy="$ac_dir"
14535 for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
14536   case $as_mkdir_dir in
14537     # Skip DOS drivespec
14538     ?:) as_incr_dir=$as_mkdir_dir ;;
14539     *)
14540       as_incr_dir=$as_incr_dir/$as_mkdir_dir
14541       test -d "$as_incr_dir" || mkdir "$as_incr_dir"
14542     ;;
14543   esac
14544 done; }
14545
14546     ac_dir_suffix="/`echo $ac_dir|sed 's,^\./,,'`"
14547     # A "../" for each directory in $ac_dir_suffix.
14548     ac_dots=`echo "$ac_dir_suffix" | sed 's,/[^/]*,../,g'`
14549   else
14550     ac_dir_suffix= ac_dots=
14551   fi
14552
14553   case $srcdir in
14554   .)  ac_srcdir=.
14555       if test -z "$ac_dots"; then
14556          ac_top_srcdir=.
14557       else
14558          ac_top_srcdir=`echo $ac_dots | sed 's,/$,,'`
14559       fi ;;
14560   [\\/]* | ?:[\\/]* )
14561       ac_srcdir=$srcdir$ac_dir_suffix;
14562       ac_top_srcdir=$srcdir ;;
14563   *) # Relative path.
14564     ac_srcdir=$ac_dots$srcdir$ac_dir_suffix
14565     ac_top_srcdir=$ac_dots$srcdir ;;
14566   esac
14567
14568   case $INSTALL in
14569   [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
14570   *) ac_INSTALL=$ac_dots$INSTALL ;;
14571   esac
14572
14573   if test x"$ac_file" != x-; then
14574     { echo "$as_me:14574: creating $ac_file" >&5
14575 echo "$as_me: creating $ac_file" >&6;}
14576     rm -f "$ac_file"
14577   fi
14578   # Let's still pretend it is `configure' which instantiates (i.e., don't
14579   # use $as_me), people would be surprised to read:
14580   #    /* config.h.  Generated automatically by config.status.  */
14581   configure_input="Generated automatically from `echo $ac_file_in |
14582                                                  sed 's,.*/,,'` by configure."
14583
14584   # First look for the input files in the build tree, otherwise in the
14585   # src tree.
14586   ac_file_inputs=`IFS=:
14587     for f in $ac_file_in; do
14588       case $f in
14589       -) echo $tmp/stdin ;;
14590       [\\/$]*)
14591          # Absolute (can't be DOS-style, as IFS=:)
14592          test -f "$f" || { { echo "$as_me:14592: error: cannot find input file: $f" >&5
14593 echo "$as_me: error: cannot find input file: $f" >&2;}
14594    { (exit 1); exit 1; }; }
14595          echo $f;;
14596       *) # Relative
14597          if test -f "$f"; then
14598            # Build tree
14599            echo $f
14600          elif test -f "$srcdir/$f"; then
14601            # Source tree
14602            echo $srcdir/$f
14603          else
14604            # /dev/null tree
14605            { { echo "$as_me:14605: error: cannot find input file: $f" >&5
14606 echo "$as_me: error: cannot find input file: $f" >&2;}
14607    { (exit 1); exit 1; }; }
14608          fi;;
14609       esac
14610     done` || { (exit 1); exit 1; }
14611 EOF
14612 cat >>$CONFIG_STATUS <<\EOF
14613   ac_warn_datarootdir=no
14614   if test x"$ac_file" != x-; then
14615     for ac_item in $ac_file_inputs
14616     do
14617       ac_seen=`grep '@\(datadir\|mandir\|infodir\)@' $ac_item`
14618       if test -n "$ac_seen"; then
14619         ac_used=`grep '@datarootdir@' $ac_item`
14620         if test -z "$ac_used"; then
14621           { echo "$as_me:14621: WARNING: datarootdir was used implicitly but not set:
14622 $ac_seen" >&5
14623 echo "$as_me: WARNING: datarootdir was used implicitly but not set:
14624 $ac_seen" >&2;}
14625           ac_warn_datarootdir=yes
14626         fi
14627       fi
14628       ac_seen=`grep '${datarootdir}' $ac_item`
14629       if test -n "$ac_seen"; then
14630         { echo "$as_me:14630: WARNING: datarootdir was used explicitly but not set:
14631 $ac_seen" >&5
14632 echo "$as_me: WARNING: datarootdir was used explicitly but not set:
14633 $ac_seen" >&2;}
14634         ac_warn_datarootdir=yes
14635       fi
14636     done
14637   fi
14638
14639 if test "x$ac_warn_datarootdir" = xyes; then
14640   ac_sed_cmds="$ac_sed_cmds | sed -e 's,@datarootdir@,\${prefix}/share,g' -e 's,\${datarootdir},\${prefix}/share,g'"
14641 fi
14642
14643 EOF
14644 cat >>$CONFIG_STATUS <<EOF
14645   sed "$ac_vpsub
14646 $extrasub
14647 EOF
14648 cat >>$CONFIG_STATUS <<\EOF
14649 :t
14650 /@[a-zA-Z_][a-zA-Z_0-9]*@/!b
14651 s,@configure_input@,$configure_input,;t t
14652 s,@srcdir@,$ac_srcdir,;t t
14653 s,@top_srcdir@,$ac_top_srcdir,;t t
14654 s,@INSTALL@,$ac_INSTALL,;t t
14655 " $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out
14656   rm -f $tmp/stdin
14657   if test x"$ac_file" != x-; then
14658     cp $tmp/out $ac_file
14659
14660     for ac_name in prefix exec_prefix datarootdir
14661     do
14662         ac_seen=`fgrep -n '${'$ac_name'[:=].*}' $ac_file`
14663         if test -n "$ac_seen"; then
14664             ac_init=`egrep '[   ]*'$ac_name'[   ]*=' $ac_file`
14665             if test -z "$ac_init"; then
14666               ac_seen=`echo "$ac_seen" |sed -e 's,^,'$ac_file':,'`
14667               { echo "$as_me:14667: WARNING: Variable $ac_name is used but was not set:
14668 $ac_seen" >&5
14669 echo "$as_me: WARNING: Variable $ac_name is used but was not set:
14670 $ac_seen" >&2;}
14671             fi
14672         fi
14673     done
14674     egrep -n '@[a-z_][a-z_0-9]+@' $ac_file >$tmp/out
14675     egrep -n '@[A-Z_][A-Z_0-9]+@' $ac_file >>$tmp/out
14676     if test -s $tmp/out; then
14677       ac_seen=`sed -e 's,^,'$ac_file':,' < $tmp/out`
14678       { echo "$as_me:14678: WARNING: Some variables may not be substituted:
14679 $ac_seen" >&5
14680 echo "$as_me: WARNING: Some variables may not be substituted:
14681 $ac_seen" >&2;}
14682     fi
14683   else
14684     cat $tmp/out
14685   fi
14686   rm -f $tmp/out
14687
14688 done
14689 EOF
14690 cat >>$CONFIG_STATUS <<\EOF
14691
14692 #
14693 # CONFIG_HEADER section.
14694 #
14695
14696 # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
14697 # NAME is the cpp macro being defined and VALUE is the value it is being given.
14698 #
14699 # ac_d sets the value in "#define NAME VALUE" lines.
14700 ac_dA='s,^\([   ]*\)#\([        ]*define[       ][      ]*\)'
14701 ac_dB='[        ].*$,\1#\2'
14702 ac_dC=' '
14703 ac_dD=',;t'
14704 # ac_i turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
14705 ac_iA='s,^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
14706 ac_iB='\([      ]\),\1#\2define\3'
14707 ac_iC=' '
14708 ac_iD='\4,;t'
14709 # ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
14710 ac_uA='s,^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
14711 ac_uB='$,\1#\2define\3'
14712 ac_uC=' '
14713 ac_uD=',;t'
14714
14715 for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue
14716   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
14717   case $ac_file in
14718   - | *:- | *:-:* ) # input from stdin
14719         cat >$tmp/stdin
14720         ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
14721         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
14722   *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
14723         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
14724   * )   ac_file_in=$ac_file.in ;;
14725   esac
14726
14727   test x"$ac_file" != x- && { echo "$as_me:14727: creating $ac_file" >&5
14728 echo "$as_me: creating $ac_file" >&6;}
14729
14730   # First look for the input files in the build tree, otherwise in the
14731   # src tree.
14732   ac_file_inputs=`IFS=:
14733     for f in $ac_file_in; do
14734       case $f in
14735       -) echo $tmp/stdin ;;
14736       [\\/$]*)
14737          # Absolute (can't be DOS-style, as IFS=:)
14738          test -f "$f" || { { echo "$as_me:14738: error: cannot find input file: $f" >&5
14739 echo "$as_me: error: cannot find input file: $f" >&2;}
14740    { (exit 1); exit 1; }; }
14741          echo $f;;
14742       *) # Relative
14743          if test -f "$f"; then
14744            # Build tree
14745            echo $f
14746          elif test -f "$srcdir/$f"; then
14747            # Source tree
14748            echo $srcdir/$f
14749          else
14750            # /dev/null tree
14751            { { echo "$as_me:14751: error: cannot find input file: $f" >&5
14752 echo "$as_me: error: cannot find input file: $f" >&2;}
14753    { (exit 1); exit 1; }; }
14754          fi;;
14755       esac
14756     done` || { (exit 1); exit 1; }
14757   # Remove the trailing spaces.
14758   sed 's/[      ]*$//' $ac_file_inputs >$tmp/in
14759
14760 EOF
14761
14762 # Transform confdefs.h into a list of #define's.  We won't use it as a sed
14763 # script, but as data to insert where we see @DEFS@.  We expect AC_SAVE_DEFS to
14764 # be either 'cat' or 'sort'.
14765 cat confdefs.h | uniq >conftest.vals
14766
14767 # Break up conftest.vals because some shells have a limit on
14768 # the size of here documents, and old seds have small limits too.
14769
14770 rm -f conftest.tail
14771 echo '  rm -f conftest.frag' >> $CONFIG_STATUS
14772 while grep . conftest.vals >/dev/null
14773 do
14774   # Write chunks of a limited-size here document to conftest.frag.
14775   echo '  cat >> conftest.frag <<CEOF' >> $CONFIG_STATUS
14776   sed ${ac_max_here_lines}q conftest.vals | sed -e 's/#ifdef.*/#if 0/' >> $CONFIG_STATUS
14777   echo 'CEOF' >> $CONFIG_STATUS
14778   sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
14779   rm -f conftest.vals
14780   mv conftest.tail conftest.vals
14781 done
14782 rm -f conftest.vals
14783
14784 # Run sed to substitute the contents of conftest.frag into $tmp/in at the
14785 # marker @DEFS@.
14786 echo '  cat >> conftest.edit <<CEOF
14787 /@DEFS@/r conftest.frag
14788 /@DEFS@/d
14789 CEOF
14790 sed -f conftest.edit $tmp/in > $tmp/out
14791 rm -f $tmp/in
14792 mv $tmp/out $tmp/in
14793 rm -f conftest.edit conftest.frag
14794 ' >> $CONFIG_STATUS
14795
14796 cat >>$CONFIG_STATUS <<\EOF
14797   # Let's still pretend it is `configure' which instantiates (i.e., don't
14798   # use $as_me), people would be surprised to read:
14799   #    /* config.h.  Generated automatically by config.status.  */
14800   if test x"$ac_file" = x-; then
14801     echo "/* Generated automatically by configure.  */" >$tmp/config.h
14802   else
14803     echo "/* $ac_file.  Generated automatically by configure.  */" >$tmp/config.h
14804   fi
14805   cat $tmp/in >>$tmp/config.h
14806   rm -f $tmp/in
14807   if test x"$ac_file" != x-; then
14808     if cmp -s $ac_file $tmp/config.h 2>/dev/null; then
14809       { echo "$as_me:14809: $ac_file is unchanged" >&5
14810 echo "$as_me: $ac_file is unchanged" >&6;}
14811     else
14812       ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
14813          X"$ac_file" : 'X\(//\)[^/]' \| \
14814          X"$ac_file" : 'X\(//\)$' \| \
14815          X"$ac_file" : 'X\(/\)' \| \
14816          .     : '\(.\)' 2>/dev/null ||
14817 echo X"$ac_file" |
14818     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
14819           /^X\(\/\/\)[^/].*/{ s//\1/; q; }
14820           /^X\(\/\/\)$/{ s//\1/; q; }
14821           /^X\(\/\).*/{ s//\1/; q; }
14822           s/.*/./; q'`
14823       if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
14824         { case "$ac_dir" in
14825   [\\/]* | ?:[\\/]* ) as_incr_dir=;;
14826   *)                      as_incr_dir=.;;
14827 esac
14828 as_dummy="$ac_dir"
14829 for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
14830   case $as_mkdir_dir in
14831     # Skip DOS drivespec
14832     ?:) as_incr_dir=$as_mkdir_dir ;;
14833     *)
14834       as_incr_dir=$as_incr_dir/$as_mkdir_dir
14835       test -d "$as_incr_dir" || mkdir "$as_incr_dir"
14836     ;;
14837   esac
14838 done; }
14839
14840       fi
14841       rm -f $ac_file
14842       mv $tmp/config.h $ac_file
14843     fi
14844   else
14845     cat $tmp/config.h
14846     rm -f $tmp/config.h
14847   fi
14848 done
14849 EOF
14850 cat >>$CONFIG_STATUS <<\EOF
14851 #
14852 # CONFIG_COMMANDS section.
14853 #
14854 for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue
14855   ac_dest=`echo "$ac_file" | sed 's,:.*,,'`
14856   ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'`
14857
14858   case $ac_dest in
14859     default )
14860 if test -z "$USE_OLD_MAKERULES" ; then
14861         $AWK -f $srcdir/mk-1st.awk <$srcdir/src/modules >>src/Makefile
14862 fi
14863  ;;
14864   esac
14865 done
14866 EOF
14867
14868 cat >>$CONFIG_STATUS <<\EOF
14869
14870 { (exit 0); exit 0; }
14871 EOF
14872 chmod +x $CONFIG_STATUS
14873 ac_clean_files=$ac_clean_files_save
14874
14875 # configure is writing to config.log, and then calls config.status.
14876 # config.status does its own redirection, appending to config.log.
14877 # Unfortunately, on DOS this fails, as config.log is still kept open
14878 # by configure, so config.status won't be able to write to it; its
14879 # output is simply discarded.  So we exec the FD to /dev/null,
14880 # effectively closing config.log, so it can be properly (re)opened and
14881 # appended to by config.status.  When coming back to configure, we
14882 # need to make the FD available again.
14883 if test "$no_create" != yes; then
14884   ac_cs_success=:
14885   exec 5>/dev/null
14886   $SHELL $CONFIG_STATUS || ac_cs_success=false
14887   exec 5>>config.log
14888   # Use ||, not &&, to avoid exiting from the if with $? = 1, which
14889   # would make configure fail if this is the last instruction.
14890   $ac_cs_success || { (exit 1); exit 1; }
14891 fi
14892 ${MAKE:-make} preinstall