]> ncurses.scripts.mit.edu Git - ncurses.git/blob - Ada95/configure
18d253b918a10ccd5981ffcc6d803d5dc1454fde
[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 case $PKG_CONFIG in
2551 (no|none|yes)
2552         echo "$as_me:2552: checking for pkg-config library directory" >&5
2553 echo $ECHO_N "checking for pkg-config library directory... $ECHO_C" >&6
2554         ;;
2555 (*)
2556         echo "$as_me:2556: checking for $PKG_CONFIG library directory" >&5
2557 echo $ECHO_N "checking for $PKG_CONFIG library directory... $ECHO_C" >&6
2558         ;;
2559 esac
2560
2561 PKG_CONFIG_LIBDIR=no
2562
2563 # Check whether --with-pkg-config-libdir or --without-pkg-config-libdir was given.
2564 if test "${with_pkg_config_libdir+set}" = set; then
2565   withval="$with_pkg_config_libdir"
2566   PKG_CONFIG_LIBDIR=$withval
2567 else
2568   test "x$PKG_CONFIG" != xnone && PKG_CONFIG_LIBDIR=yes
2569 fi;
2570
2571 case x$PKG_CONFIG_LIBDIR in
2572 (x/*)
2573         ;;
2574 (xyes)
2575         # Look for the library directory using the same prefix as the executable
2576         if test "x$PKG_CONFIG" = xnone
2577         then
2578                 cf_path=$prefix
2579         else
2580                 cf_path=`echo "$PKG_CONFIG" | sed -e 's,/[^/]*/[^/]*$,,'`
2581         fi
2582
2583         # If you don't like using the default architecture, you have to specify the
2584         # intended library directory and corresponding compiler/linker options.
2585         #
2586         # This case allows for Debian's 2014-flavor of multiarch, along with the
2587         # most common variations before that point.  Some other variants spell the
2588         # directory differently, e.g., "pkg-config", and put it in unusual places.
2589         # pkg-config has always been poorly standardized, which is ironic...
2590         case x`(arch) 2>/dev/null` in
2591         (*64)
2592                 cf_search_path="\
2593                         $cf_path/lib/*64-linux-gnu \
2594                         $cf_path/share \
2595                         $cf_path/lib64 \
2596                         $cf_path/lib32 \
2597                         $cf_path/lib"
2598                 ;;
2599         (*)
2600                 cf_search_path="\
2601                         $cf_path/lib/*-linux-gnu \
2602                         $cf_path/share \
2603                         $cf_path/lib32 \
2604                         $cf_path/lib \
2605                         $cf_path/libdata"
2606                 ;;
2607         esac
2608
2609         test -n "$verbose" && echo "    list..." 1>&6
2610
2611 echo "${as_me:-configure}:2611: testing list... ..." 1>&5
2612
2613         for cf_config in $cf_search_path
2614         do
2615                 test -n "$verbose" && echo "    checking $cf_config/pkgconfig" 1>&6
2616
2617 echo "${as_me:-configure}:2617: testing checking $cf_config/pkgconfig ..." 1>&5
2618
2619                 if test -d $cf_config/pkgconfig
2620                 then
2621                         PKG_CONFIG_LIBDIR=$cf_config/pkgconfig
2622                         echo "$as_me:2622: checking done" >&5
2623 echo $ECHO_N "checking done... $ECHO_C" >&6
2624                         break
2625                 fi
2626         done
2627         ;;
2628 (*)
2629         ;;
2630 esac
2631
2632 if test "x$PKG_CONFIG_LIBDIR" != xno ; then
2633         echo "$as_me:2633: result: $PKG_CONFIG_LIBDIR" >&5
2634 echo "${ECHO_T}$PKG_CONFIG_LIBDIR" >&6
2635 fi
2636
2637 echo "$as_me:2637: checking if you want to build test-programs" >&5
2638 echo $ECHO_N "checking if you want to build test-programs... $ECHO_C" >&6
2639
2640 # Check whether --with-tests or --without-tests was given.
2641 if test "${with_tests+set}" = set; then
2642   withval="$with_tests"
2643   cf_with_tests=$withval
2644 else
2645   cf_with_tests=yes
2646 fi;
2647 echo "$as_me:2647: result: $cf_with_tests" >&5
2648 echo "${ECHO_T}$cf_with_tests" >&6
2649
2650 echo "$as_me:2650: checking if we should assume mixed-case filenames" >&5
2651 echo $ECHO_N "checking if we should assume mixed-case filenames... $ECHO_C" >&6
2652
2653 # Check whether --enable-mixed-case or --disable-mixed-case was given.
2654 if test "${enable_mixed_case+set}" = set; then
2655   enableval="$enable_mixed_case"
2656   enable_mixedcase=$enableval
2657 else
2658   enable_mixedcase=auto
2659 fi;
2660 echo "$as_me:2660: result: $enable_mixedcase" >&5
2661 echo "${ECHO_T}$enable_mixedcase" >&6
2662 if test "$enable_mixedcase" = "auto" ; then
2663
2664 echo "$as_me:2664: checking if filesystem supports mixed-case filenames" >&5
2665 echo $ECHO_N "checking if filesystem supports mixed-case filenames... $ECHO_C" >&6
2666 if test "${cf_cv_mixedcase+set}" = set; then
2667   echo $ECHO_N "(cached) $ECHO_C" >&6
2668 else
2669
2670 if test "$cross_compiling" = yes ; then
2671         case $target_alias in
2672         (*-os2-emx*|*-msdosdjgpp*|*-cygwin*|*-msys*|*-mingw*|*-uwin*)
2673                 cf_cv_mixedcase=no
2674                 ;;
2675         (*)
2676                 cf_cv_mixedcase=yes
2677                 ;;
2678         esac
2679 else
2680         rm -f conftest CONFTEST
2681         echo test >conftest
2682         if test -f CONFTEST ; then
2683                 cf_cv_mixedcase=no
2684         else
2685                 cf_cv_mixedcase=yes
2686         fi
2687         rm -f conftest CONFTEST
2688 fi
2689
2690 fi
2691 echo "$as_me:2691: result: $cf_cv_mixedcase" >&5
2692 echo "${ECHO_T}$cf_cv_mixedcase" >&6
2693 test "$cf_cv_mixedcase" = yes &&
2694 cat >>confdefs.h <<\EOF
2695 #define MIXEDCASE_FILENAMES 1
2696 EOF
2697
2698 else
2699         cf_cv_mixedcase=$enable_mixedcase
2700         if test "$enable_mixedcase" = "yes" ; then
2701                 cat >>confdefs.h <<\EOF
2702 #define MIXEDCASE_FILENAMES 1
2703 EOF
2704
2705         fi
2706 fi
2707
2708 # do this after mixed-case option (tags/TAGS is not as important as tic).
2709 echo "$as_me:2709: checking whether ${MAKE-make} sets \${MAKE}" >&5
2710 echo $ECHO_N "checking whether ${MAKE-make} sets \${MAKE}... $ECHO_C" >&6
2711 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,./+-,__p_,'`
2712 if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then
2713   echo $ECHO_N "(cached) $ECHO_C" >&6
2714 else
2715   cat >conftest.make <<\EOF
2716 all:
2717         @echo 'ac_maketemp="${MAKE}"'
2718 EOF
2719 # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
2720 eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=`
2721 if test -n "$ac_maketemp"; then
2722   eval ac_cv_prog_make_${ac_make}_set=yes
2723 else
2724   eval ac_cv_prog_make_${ac_make}_set=no
2725 fi
2726 rm -f conftest.make
2727 fi
2728 if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
2729   echo "$as_me:2729: result: yes" >&5
2730 echo "${ECHO_T}yes" >&6
2731   SET_MAKE=
2732 else
2733   echo "$as_me:2733: result: no" >&5
2734 echo "${ECHO_T}no" >&6
2735   SET_MAKE="MAKE=${MAKE-make}"
2736 fi
2737
2738 for ac_prog in exctags ctags
2739 do
2740   # Extract the first word of "$ac_prog", so it can be a program name with args.
2741 set dummy $ac_prog; ac_word=$2
2742 echo "$as_me:2742: checking for $ac_word" >&5
2743 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2744 if test "${ac_cv_prog_CTAGS+set}" = set; then
2745   echo $ECHO_N "(cached) $ECHO_C" >&6
2746 else
2747   if test -n "$CTAGS"; then
2748   ac_cv_prog_CTAGS="$CTAGS" # Let the user override the test.
2749 else
2750   ac_save_IFS=$IFS; IFS=$ac_path_separator
2751 ac_dummy="$PATH"
2752 for ac_dir in $ac_dummy; do
2753   IFS=$ac_save_IFS
2754   test -z "$ac_dir" && ac_dir=.
2755   $as_executable_p "$ac_dir/$ac_word" || continue
2756 ac_cv_prog_CTAGS="$ac_prog"
2757 echo "$as_me:2757: found $ac_dir/$ac_word" >&5
2758 break
2759 done
2760
2761 fi
2762 fi
2763 CTAGS=$ac_cv_prog_CTAGS
2764 if test -n "$CTAGS"; then
2765   echo "$as_me:2765: result: $CTAGS" >&5
2766 echo "${ECHO_T}$CTAGS" >&6
2767 else
2768   echo "$as_me:2768: result: no" >&5
2769 echo "${ECHO_T}no" >&6
2770 fi
2771
2772   test -n "$CTAGS" && break
2773 done
2774
2775 for ac_prog in exetags etags
2776 do
2777   # Extract the first word of "$ac_prog", so it can be a program name with args.
2778 set dummy $ac_prog; ac_word=$2
2779 echo "$as_me:2779: checking for $ac_word" >&5
2780 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2781 if test "${ac_cv_prog_ETAGS+set}" = set; then
2782   echo $ECHO_N "(cached) $ECHO_C" >&6
2783 else
2784   if test -n "$ETAGS"; then
2785   ac_cv_prog_ETAGS="$ETAGS" # Let the user override the test.
2786 else
2787   ac_save_IFS=$IFS; IFS=$ac_path_separator
2788 ac_dummy="$PATH"
2789 for ac_dir in $ac_dummy; do
2790   IFS=$ac_save_IFS
2791   test -z "$ac_dir" && ac_dir=.
2792   $as_executable_p "$ac_dir/$ac_word" || continue
2793 ac_cv_prog_ETAGS="$ac_prog"
2794 echo "$as_me:2794: found $ac_dir/$ac_word" >&5
2795 break
2796 done
2797
2798 fi
2799 fi
2800 ETAGS=$ac_cv_prog_ETAGS
2801 if test -n "$ETAGS"; then
2802   echo "$as_me:2802: result: $ETAGS" >&5
2803 echo "${ECHO_T}$ETAGS" >&6
2804 else
2805   echo "$as_me:2805: result: no" >&5
2806 echo "${ECHO_T}no" >&6
2807 fi
2808
2809   test -n "$ETAGS" && break
2810 done
2811
2812 # Extract the first word of "${CTAGS:-ctags}", so it can be a program name with args.
2813 set dummy ${CTAGS:-ctags}; ac_word=$2
2814 echo "$as_me:2814: checking for $ac_word" >&5
2815 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2816 if test "${ac_cv_prog_MAKE_LOWER_TAGS+set}" = set; then
2817   echo $ECHO_N "(cached) $ECHO_C" >&6
2818 else
2819   if test -n "$MAKE_LOWER_TAGS"; then
2820   ac_cv_prog_MAKE_LOWER_TAGS="$MAKE_LOWER_TAGS" # Let the user override the test.
2821 else
2822   ac_save_IFS=$IFS; IFS=$ac_path_separator
2823 ac_dummy="$PATH"
2824 for ac_dir in $ac_dummy; do
2825   IFS=$ac_save_IFS
2826   test -z "$ac_dir" && ac_dir=.
2827   $as_executable_p "$ac_dir/$ac_word" || continue
2828 ac_cv_prog_MAKE_LOWER_TAGS="yes"
2829 echo "$as_me:2829: found $ac_dir/$ac_word" >&5
2830 break
2831 done
2832
2833   test -z "$ac_cv_prog_MAKE_LOWER_TAGS" && ac_cv_prog_MAKE_LOWER_TAGS="no"
2834 fi
2835 fi
2836 MAKE_LOWER_TAGS=$ac_cv_prog_MAKE_LOWER_TAGS
2837 if test -n "$MAKE_LOWER_TAGS"; then
2838   echo "$as_me:2838: result: $MAKE_LOWER_TAGS" >&5
2839 echo "${ECHO_T}$MAKE_LOWER_TAGS" >&6
2840 else
2841   echo "$as_me:2841: result: no" >&5
2842 echo "${ECHO_T}no" >&6
2843 fi
2844
2845 if test "$cf_cv_mixedcase" = yes ; then
2846         # Extract the first word of "${ETAGS:-etags}", so it can be a program name with args.
2847 set dummy ${ETAGS:-etags}; ac_word=$2
2848 echo "$as_me:2848: checking for $ac_word" >&5
2849 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2850 if test "${ac_cv_prog_MAKE_UPPER_TAGS+set}" = set; then
2851   echo $ECHO_N "(cached) $ECHO_C" >&6
2852 else
2853   if test -n "$MAKE_UPPER_TAGS"; then
2854   ac_cv_prog_MAKE_UPPER_TAGS="$MAKE_UPPER_TAGS" # Let the user override the test.
2855 else
2856   ac_save_IFS=$IFS; IFS=$ac_path_separator
2857 ac_dummy="$PATH"
2858 for ac_dir in $ac_dummy; do
2859   IFS=$ac_save_IFS
2860   test -z "$ac_dir" && ac_dir=.
2861   $as_executable_p "$ac_dir/$ac_word" || continue
2862 ac_cv_prog_MAKE_UPPER_TAGS="yes"
2863 echo "$as_me:2863: found $ac_dir/$ac_word" >&5
2864 break
2865 done
2866
2867   test -z "$ac_cv_prog_MAKE_UPPER_TAGS" && ac_cv_prog_MAKE_UPPER_TAGS="no"
2868 fi
2869 fi
2870 MAKE_UPPER_TAGS=$ac_cv_prog_MAKE_UPPER_TAGS
2871 if test -n "$MAKE_UPPER_TAGS"; then
2872   echo "$as_me:2872: result: $MAKE_UPPER_TAGS" >&5
2873 echo "${ECHO_T}$MAKE_UPPER_TAGS" >&6
2874 else
2875   echo "$as_me:2875: result: no" >&5
2876 echo "${ECHO_T}no" >&6
2877 fi
2878
2879 else
2880         MAKE_UPPER_TAGS=no
2881 fi
2882
2883 if test "$MAKE_UPPER_TAGS" = yes ; then
2884         MAKE_UPPER_TAGS=
2885 else
2886         MAKE_UPPER_TAGS="#"
2887 fi
2888
2889 if test "$MAKE_LOWER_TAGS" = yes ; then
2890         MAKE_LOWER_TAGS=
2891 else
2892         MAKE_LOWER_TAGS="#"
2893 fi
2894
2895 echo "$as_me:2895: checking for makeflags variable" >&5
2896 echo $ECHO_N "checking for makeflags variable... $ECHO_C" >&6
2897 if test "${cf_cv_makeflags+set}" = set; then
2898   echo $ECHO_N "(cached) $ECHO_C" >&6
2899 else
2900
2901         cf_cv_makeflags=''
2902         for cf_option in '-${MAKEFLAGS}' '${MFLAGS}'
2903         do
2904                 cat >cf_makeflags.tmp <<CF_EOF
2905 SHELL = $SHELL
2906 all :
2907         @ echo '.$cf_option'
2908 CF_EOF
2909                 cf_result=`${MAKE:-make} -k -f cf_makeflags.tmp 2>/dev/null | fgrep -v "ing directory" | sed -e 's,[    ]*$,,'`
2910                 case "$cf_result" in
2911                 (.*k|.*kw)
2912                         cf_result=`${MAKE:-make} -k -f cf_makeflags.tmp CC=cc 2>/dev/null`
2913                         case "$cf_result" in
2914                         (.*CC=*)        cf_cv_makeflags=
2915                                 ;;
2916                         (*)     cf_cv_makeflags=$cf_option
2917                                 ;;
2918                         esac
2919                         break
2920                         ;;
2921                 (.-)    ;;
2922                 (*)     echo "given option \"$cf_option\", no match \"$cf_result\""
2923                         ;;
2924                 esac
2925         done
2926         rm -f cf_makeflags.tmp
2927
2928 fi
2929 echo "$as_me:2929: result: $cf_cv_makeflags" >&5
2930 echo "${ECHO_T}$cf_cv_makeflags" >&6
2931
2932 if test -n "$ac_tool_prefix"; then
2933   # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
2934 set dummy ${ac_tool_prefix}ranlib; ac_word=$2
2935 echo "$as_me:2935: checking for $ac_word" >&5
2936 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2937 if test "${ac_cv_prog_RANLIB+set}" = set; then
2938   echo $ECHO_N "(cached) $ECHO_C" >&6
2939 else
2940   if test -n "$RANLIB"; then
2941   ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
2942 else
2943   ac_save_IFS=$IFS; IFS=$ac_path_separator
2944 ac_dummy="$PATH"
2945 for ac_dir in $ac_dummy; do
2946   IFS=$ac_save_IFS
2947   test -z "$ac_dir" && ac_dir=.
2948   $as_executable_p "$ac_dir/$ac_word" || continue
2949 ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
2950 echo "$as_me:2950: found $ac_dir/$ac_word" >&5
2951 break
2952 done
2953
2954 fi
2955 fi
2956 RANLIB=$ac_cv_prog_RANLIB
2957 if test -n "$RANLIB"; then
2958   echo "$as_me:2958: result: $RANLIB" >&5
2959 echo "${ECHO_T}$RANLIB" >&6
2960 else
2961   echo "$as_me:2961: result: no" >&5
2962 echo "${ECHO_T}no" >&6
2963 fi
2964
2965 fi
2966 if test -z "$ac_cv_prog_RANLIB"; then
2967   ac_ct_RANLIB=$RANLIB
2968   # Extract the first word of "ranlib", so it can be a program name with args.
2969 set dummy ranlib; ac_word=$2
2970 echo "$as_me:2970: checking for $ac_word" >&5
2971 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2972 if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then
2973   echo $ECHO_N "(cached) $ECHO_C" >&6
2974 else
2975   if test -n "$ac_ct_RANLIB"; then
2976   ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
2977 else
2978   ac_save_IFS=$IFS; IFS=$ac_path_separator
2979 ac_dummy="$PATH"
2980 for ac_dir in $ac_dummy; do
2981   IFS=$ac_save_IFS
2982   test -z "$ac_dir" && ac_dir=.
2983   $as_executable_p "$ac_dir/$ac_word" || continue
2984 ac_cv_prog_ac_ct_RANLIB="ranlib"
2985 echo "$as_me:2985: found $ac_dir/$ac_word" >&5
2986 break
2987 done
2988
2989   test -z "$ac_cv_prog_ac_ct_RANLIB" && ac_cv_prog_ac_ct_RANLIB="':'"
2990 fi
2991 fi
2992 ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
2993 if test -n "$ac_ct_RANLIB"; then
2994   echo "$as_me:2994: result: $ac_ct_RANLIB" >&5
2995 echo "${ECHO_T}$ac_ct_RANLIB" >&6
2996 else
2997   echo "$as_me:2997: result: no" >&5
2998 echo "${ECHO_T}no" >&6
2999 fi
3000
3001   RANLIB=$ac_ct_RANLIB
3002 else
3003   RANLIB="$ac_cv_prog_RANLIB"
3004 fi
3005
3006 if test -n "$ac_tool_prefix"; then
3007   # Extract the first word of "${ac_tool_prefix}ld", so it can be a program name with args.
3008 set dummy ${ac_tool_prefix}ld; ac_word=$2
3009 echo "$as_me:3009: checking for $ac_word" >&5
3010 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3011 if test "${ac_cv_prog_LD+set}" = set; then
3012   echo $ECHO_N "(cached) $ECHO_C" >&6
3013 else
3014   if test -n "$LD"; then
3015   ac_cv_prog_LD="$LD" # Let the user override the test.
3016 else
3017   ac_save_IFS=$IFS; IFS=$ac_path_separator
3018 ac_dummy="$PATH"
3019 for ac_dir in $ac_dummy; do
3020   IFS=$ac_save_IFS
3021   test -z "$ac_dir" && ac_dir=.
3022   $as_executable_p "$ac_dir/$ac_word" || continue
3023 ac_cv_prog_LD="${ac_tool_prefix}ld"
3024 echo "$as_me:3024: found $ac_dir/$ac_word" >&5
3025 break
3026 done
3027
3028 fi
3029 fi
3030 LD=$ac_cv_prog_LD
3031 if test -n "$LD"; then
3032   echo "$as_me:3032: result: $LD" >&5
3033 echo "${ECHO_T}$LD" >&6
3034 else
3035   echo "$as_me:3035: result: no" >&5
3036 echo "${ECHO_T}no" >&6
3037 fi
3038
3039 fi
3040 if test -z "$ac_cv_prog_LD"; then
3041   ac_ct_LD=$LD
3042   # Extract the first word of "ld", so it can be a program name with args.
3043 set dummy ld; ac_word=$2
3044 echo "$as_me:3044: checking for $ac_word" >&5
3045 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3046 if test "${ac_cv_prog_ac_ct_LD+set}" = set; then
3047   echo $ECHO_N "(cached) $ECHO_C" >&6
3048 else
3049   if test -n "$ac_ct_LD"; then
3050   ac_cv_prog_ac_ct_LD="$ac_ct_LD" # Let the user override the test.
3051 else
3052   ac_save_IFS=$IFS; IFS=$ac_path_separator
3053 ac_dummy="$PATH"
3054 for ac_dir in $ac_dummy; do
3055   IFS=$ac_save_IFS
3056   test -z "$ac_dir" && ac_dir=.
3057   $as_executable_p "$ac_dir/$ac_word" || continue
3058 ac_cv_prog_ac_ct_LD="ld"
3059 echo "$as_me:3059: found $ac_dir/$ac_word" >&5
3060 break
3061 done
3062
3063   test -z "$ac_cv_prog_ac_ct_LD" && ac_cv_prog_ac_ct_LD="ld"
3064 fi
3065 fi
3066 ac_ct_LD=$ac_cv_prog_ac_ct_LD
3067 if test -n "$ac_ct_LD"; then
3068   echo "$as_me:3068: result: $ac_ct_LD" >&5
3069 echo "${ECHO_T}$ac_ct_LD" >&6
3070 else
3071   echo "$as_me:3071: result: no" >&5
3072 echo "${ECHO_T}no" >&6
3073 fi
3074
3075   LD=$ac_ct_LD
3076 else
3077   LD="$ac_cv_prog_LD"
3078 fi
3079
3080 if test -n "$ac_tool_prefix"; then
3081   # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
3082 set dummy ${ac_tool_prefix}ar; ac_word=$2
3083 echo "$as_me:3083: checking for $ac_word" >&5
3084 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3085 if test "${ac_cv_prog_AR+set}" = set; then
3086   echo $ECHO_N "(cached) $ECHO_C" >&6
3087 else
3088   if test -n "$AR"; then
3089   ac_cv_prog_AR="$AR" # Let the user override the test.
3090 else
3091   ac_save_IFS=$IFS; IFS=$ac_path_separator
3092 ac_dummy="$PATH"
3093 for ac_dir in $ac_dummy; do
3094   IFS=$ac_save_IFS
3095   test -z "$ac_dir" && ac_dir=.
3096   $as_executable_p "$ac_dir/$ac_word" || continue
3097 ac_cv_prog_AR="${ac_tool_prefix}ar"
3098 echo "$as_me:3098: found $ac_dir/$ac_word" >&5
3099 break
3100 done
3101
3102 fi
3103 fi
3104 AR=$ac_cv_prog_AR
3105 if test -n "$AR"; then
3106   echo "$as_me:3106: result: $AR" >&5
3107 echo "${ECHO_T}$AR" >&6
3108 else
3109   echo "$as_me:3109: result: no" >&5
3110 echo "${ECHO_T}no" >&6
3111 fi
3112
3113 fi
3114 if test -z "$ac_cv_prog_AR"; then
3115   ac_ct_AR=$AR
3116   # Extract the first word of "ar", so it can be a program name with args.
3117 set dummy ar; ac_word=$2
3118 echo "$as_me:3118: checking for $ac_word" >&5
3119 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3120 if test "${ac_cv_prog_ac_ct_AR+set}" = set; then
3121   echo $ECHO_N "(cached) $ECHO_C" >&6
3122 else
3123   if test -n "$ac_ct_AR"; then
3124   ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test.
3125 else
3126   ac_save_IFS=$IFS; IFS=$ac_path_separator
3127 ac_dummy="$PATH"
3128 for ac_dir in $ac_dummy; do
3129   IFS=$ac_save_IFS
3130   test -z "$ac_dir" && ac_dir=.
3131   $as_executable_p "$ac_dir/$ac_word" || continue
3132 ac_cv_prog_ac_ct_AR="ar"
3133 echo "$as_me:3133: found $ac_dir/$ac_word" >&5
3134 break
3135 done
3136
3137   test -z "$ac_cv_prog_ac_ct_AR" && ac_cv_prog_ac_ct_AR="ar"
3138 fi
3139 fi
3140 ac_ct_AR=$ac_cv_prog_ac_ct_AR
3141 if test -n "$ac_ct_AR"; then
3142   echo "$as_me:3142: result: $ac_ct_AR" >&5
3143 echo "${ECHO_T}$ac_ct_AR" >&6
3144 else
3145   echo "$as_me:3145: result: no" >&5
3146 echo "${ECHO_T}no" >&6
3147 fi
3148
3149   AR=$ac_ct_AR
3150 else
3151   AR="$ac_cv_prog_AR"
3152 fi
3153
3154 if test -n "$ac_tool_prefix"; then
3155   # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
3156 set dummy ${ac_tool_prefix}ar; ac_word=$2
3157 echo "$as_me:3157: checking for $ac_word" >&5
3158 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3159 if test "${ac_cv_prog_AR+set}" = set; then
3160   echo $ECHO_N "(cached) $ECHO_C" >&6
3161 else
3162   if test -n "$AR"; then
3163   ac_cv_prog_AR="$AR" # Let the user override the test.
3164 else
3165   ac_save_IFS=$IFS; IFS=$ac_path_separator
3166 ac_dummy="$PATH"
3167 for ac_dir in $ac_dummy; do
3168   IFS=$ac_save_IFS
3169   test -z "$ac_dir" && ac_dir=.
3170   $as_executable_p "$ac_dir/$ac_word" || continue
3171 ac_cv_prog_AR="${ac_tool_prefix}ar"
3172 echo "$as_me:3172: found $ac_dir/$ac_word" >&5
3173 break
3174 done
3175
3176 fi
3177 fi
3178 AR=$ac_cv_prog_AR
3179 if test -n "$AR"; then
3180   echo "$as_me:3180: result: $AR" >&5
3181 echo "${ECHO_T}$AR" >&6
3182 else
3183   echo "$as_me:3183: result: no" >&5
3184 echo "${ECHO_T}no" >&6
3185 fi
3186
3187 fi
3188 if test -z "$ac_cv_prog_AR"; then
3189   ac_ct_AR=$AR
3190   # Extract the first word of "ar", so it can be a program name with args.
3191 set dummy ar; ac_word=$2
3192 echo "$as_me:3192: checking for $ac_word" >&5
3193 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3194 if test "${ac_cv_prog_ac_ct_AR+set}" = set; then
3195   echo $ECHO_N "(cached) $ECHO_C" >&6
3196 else
3197   if test -n "$ac_ct_AR"; then
3198   ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test.
3199 else
3200   ac_save_IFS=$IFS; IFS=$ac_path_separator
3201 ac_dummy="$PATH"
3202 for ac_dir in $ac_dummy; do
3203   IFS=$ac_save_IFS
3204   test -z "$ac_dir" && ac_dir=.
3205   $as_executable_p "$ac_dir/$ac_word" || continue
3206 ac_cv_prog_ac_ct_AR="ar"
3207 echo "$as_me:3207: found $ac_dir/$ac_word" >&5
3208 break
3209 done
3210
3211   test -z "$ac_cv_prog_ac_ct_AR" && ac_cv_prog_ac_ct_AR="ar"
3212 fi
3213 fi
3214 ac_ct_AR=$ac_cv_prog_ac_ct_AR
3215 if test -n "$ac_ct_AR"; then
3216   echo "$as_me:3216: result: $ac_ct_AR" >&5
3217 echo "${ECHO_T}$ac_ct_AR" >&6
3218 else
3219   echo "$as_me:3219: result: no" >&5
3220 echo "${ECHO_T}no" >&6
3221 fi
3222
3223   AR=$ac_ct_AR
3224 else
3225   AR="$ac_cv_prog_AR"
3226 fi
3227
3228 echo "$as_me:3228: checking for options to update archives" >&5
3229 echo $ECHO_N "checking for options to update archives... $ECHO_C" >&6
3230 if test "${cf_cv_ar_flags+set}" = set; then
3231   echo $ECHO_N "(cached) $ECHO_C" >&6
3232 else
3233
3234         cf_cv_ar_flags=unknown
3235         for cf_ar_flags in -curv curv -crv crv -cqv cqv -rv rv
3236         do
3237
3238                 # check if $ARFLAGS already contains this choice
3239                 if test "x$ARFLAGS" != "x" ; then
3240                         cf_check_ar_flags=`echo "x$ARFLAGS" | sed -e "s/$cf_ar_flags\$//" -e "s/$cf_ar_flags / /"`
3241                         if test "x$ARFLAGS" != "$cf_check_ar_flags" ; then
3242                                 cf_cv_ar_flags=
3243                                 break
3244                         fi
3245                 fi
3246
3247                 rm -f conftest.$ac_cv_objext
3248                 rm -f conftest.a
3249
3250                 cat >conftest.$ac_ext <<EOF
3251 #line 3251 "configure"
3252 int     testdata[3] = { 123, 456, 789 };
3253 EOF
3254                 if { (eval echo "$as_me:3254: \"$ac_compile\"") >&5
3255   (eval $ac_compile) 2>&5
3256   ac_status=$?
3257   echo "$as_me:3257: \$? = $ac_status" >&5
3258   (exit $ac_status); } ; then
3259                         echo "$AR $ARFLAGS $cf_ar_flags conftest.a conftest.$ac_cv_objext" >&5
3260                         $AR $ARFLAGS $cf_ar_flags conftest.a conftest.$ac_cv_objext 2>&5 1>/dev/null
3261                         if test -f conftest.a ; then
3262                                 cf_cv_ar_flags=$cf_ar_flags
3263                                 break
3264                         fi
3265                 else
3266                         test -n "$verbose" && echo "    cannot compile test-program" 1>&6
3267
3268 echo "${as_me:-configure}:3268: testing cannot compile test-program ..." 1>&5
3269
3270                         break
3271                 fi
3272         done
3273         rm -f conftest.a conftest.$ac_ext conftest.$ac_cv_objext
3274
3275 fi
3276 echo "$as_me:3276: result: $cf_cv_ar_flags" >&5
3277 echo "${ECHO_T}$cf_cv_ar_flags" >&6
3278
3279 if test -n "$ARFLAGS" ; then
3280         if test -n "$cf_cv_ar_flags" ; then
3281                 ARFLAGS="$ARFLAGS $cf_cv_ar_flags"
3282         fi
3283 else
3284         ARFLAGS=$cf_cv_ar_flags
3285 fi
3286
3287         echo "$as_me:3287: checking for PATH separator" >&5
3288 echo $ECHO_N "checking for PATH separator... $ECHO_C" >&6
3289         case $cf_cv_system_name in
3290         (os2*)  PATH_SEPARATOR=';'  ;;
3291         (*)     ${PATH_SEPARATOR:=':'}  ;;
3292         esac
3293
3294         echo "$as_me:3294: result: $PATH_SEPARATOR" >&5
3295 echo "${ECHO_T}$PATH_SEPARATOR" >&6
3296
3297 echo "$as_me:3297: checking if you have specified an install-prefix" >&5
3298 echo $ECHO_N "checking if you have specified an install-prefix... $ECHO_C" >&6
3299
3300 # Check whether --with-install-prefix or --without-install-prefix was given.
3301 if test "${with_install_prefix+set}" = set; then
3302   withval="$with_install_prefix"
3303   case "$withval" in
3304         (yes|no)
3305                 ;;
3306         (*)     DESTDIR="$withval"
3307                 ;;
3308         esac
3309 fi;
3310 echo "$as_me:3310: result: $DESTDIR" >&5
3311 echo "${ECHO_T}$DESTDIR" >&6
3312
3313 ###############################################################################
3314
3315 # If we're cross-compiling, allow the user to override the tools and their
3316 # options.  The configure script is oriented toward identifying the host
3317 # compiler, etc., but we need a build compiler to generate parts of the source.
3318
3319 if test "$cross_compiling" = yes ; then
3320
3321         # defaults that we might want to override
3322         : ${BUILD_CFLAGS:=''}
3323         : ${BUILD_CPPFLAGS:=''}
3324         : ${BUILD_LDFLAGS:=''}
3325         : ${BUILD_LIBS:=''}
3326         : ${BUILD_EXEEXT:='$x'}
3327         : ${BUILD_OBJEXT:='o'}
3328
3329 # Check whether --with-build-cc or --without-build-cc was given.
3330 if test "${with_build_cc+set}" = set; then
3331   withval="$with_build_cc"
3332   BUILD_CC="$withval"
3333 else
3334   for ac_prog in gcc cc cl
3335 do
3336   # Extract the first word of "$ac_prog", so it can be a program name with args.
3337 set dummy $ac_prog; ac_word=$2
3338 echo "$as_me:3338: checking for $ac_word" >&5
3339 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3340 if test "${ac_cv_prog_BUILD_CC+set}" = set; then
3341   echo $ECHO_N "(cached) $ECHO_C" >&6
3342 else
3343   if test -n "$BUILD_CC"; then
3344   ac_cv_prog_BUILD_CC="$BUILD_CC" # Let the user override the test.
3345 else
3346   ac_save_IFS=$IFS; IFS=$ac_path_separator
3347 ac_dummy="$PATH"
3348 for ac_dir in $ac_dummy; do
3349   IFS=$ac_save_IFS
3350   test -z "$ac_dir" && ac_dir=.
3351   $as_executable_p "$ac_dir/$ac_word" || continue
3352 ac_cv_prog_BUILD_CC="$ac_prog"
3353 echo "$as_me:3353: found $ac_dir/$ac_word" >&5
3354 break
3355 done
3356
3357 fi
3358 fi
3359 BUILD_CC=$ac_cv_prog_BUILD_CC
3360 if test -n "$BUILD_CC"; then
3361   echo "$as_me:3361: result: $BUILD_CC" >&5
3362 echo "${ECHO_T}$BUILD_CC" >&6
3363 else
3364   echo "$as_me:3364: result: no" >&5
3365 echo "${ECHO_T}no" >&6
3366 fi
3367
3368   test -n "$BUILD_CC" && break
3369 done
3370
3371 fi;
3372         echo "$as_me:3372: checking for native build C compiler" >&5
3373 echo $ECHO_N "checking for native build C compiler... $ECHO_C" >&6
3374         echo "$as_me:3374: result: $BUILD_CC" >&5
3375 echo "${ECHO_T}$BUILD_CC" >&6
3376
3377         echo "$as_me:3377: checking for native build C preprocessor" >&5
3378 echo $ECHO_N "checking for native build C preprocessor... $ECHO_C" >&6
3379
3380 # Check whether --with-build-cpp or --without-build-cpp was given.
3381 if test "${with_build_cpp+set}" = set; then
3382   withval="$with_build_cpp"
3383   BUILD_CPP="$withval"
3384 else
3385   BUILD_CPP='${BUILD_CC} -E'
3386 fi;
3387         echo "$as_me:3387: result: $BUILD_CPP" >&5
3388 echo "${ECHO_T}$BUILD_CPP" >&6
3389
3390         echo "$as_me:3390: checking for native build C flags" >&5
3391 echo $ECHO_N "checking for native build C flags... $ECHO_C" >&6
3392
3393 # Check whether --with-build-cflags or --without-build-cflags was given.
3394 if test "${with_build_cflags+set}" = set; then
3395   withval="$with_build_cflags"
3396   BUILD_CFLAGS="$withval"
3397 fi;
3398         echo "$as_me:3398: result: $BUILD_CFLAGS" >&5
3399 echo "${ECHO_T}$BUILD_CFLAGS" >&6
3400
3401         echo "$as_me:3401: checking for native build C preprocessor-flags" >&5
3402 echo $ECHO_N "checking for native build C preprocessor-flags... $ECHO_C" >&6
3403
3404 # Check whether --with-build-cppflags or --without-build-cppflags was given.
3405 if test "${with_build_cppflags+set}" = set; then
3406   withval="$with_build_cppflags"
3407   BUILD_CPPFLAGS="$withval"
3408 fi;
3409         echo "$as_me:3409: result: $BUILD_CPPFLAGS" >&5
3410 echo "${ECHO_T}$BUILD_CPPFLAGS" >&6
3411
3412         echo "$as_me:3412: checking for native build linker-flags" >&5
3413 echo $ECHO_N "checking for native build linker-flags... $ECHO_C" >&6
3414
3415 # Check whether --with-build-ldflags or --without-build-ldflags was given.
3416 if test "${with_build_ldflags+set}" = set; then
3417   withval="$with_build_ldflags"
3418   BUILD_LDFLAGS="$withval"
3419 fi;
3420         echo "$as_me:3420: result: $BUILD_LDFLAGS" >&5
3421 echo "${ECHO_T}$BUILD_LDFLAGS" >&6
3422
3423         echo "$as_me:3423: checking for native build linker-libraries" >&5
3424 echo $ECHO_N "checking for native build linker-libraries... $ECHO_C" >&6
3425
3426 # Check whether --with-build-libs or --without-build-libs was given.
3427 if test "${with_build_libs+set}" = set; then
3428   withval="$with_build_libs"
3429   BUILD_LIBS="$withval"
3430 fi;
3431         echo "$as_me:3431: result: $BUILD_LIBS" >&5
3432 echo "${ECHO_T}$BUILD_LIBS" >&6
3433
3434         # this assumes we're on Unix.
3435         BUILD_EXEEXT=
3436         BUILD_OBJEXT=o
3437
3438         : ${BUILD_CC:='${CC}'}
3439
3440         if ( test "$BUILD_CC" = "$CC" || test "$BUILD_CC" = '${CC}' ) ; then
3441                 { { echo "$as_me:3441: error: Cross-build requires two compilers.
3442 Use --with-build-cc to specify the native compiler." >&5
3443 echo "$as_me: error: Cross-build requires two compilers.
3444 Use --with-build-cc to specify the native compiler." >&2;}
3445    { (exit 1); exit 1; }; }
3446         fi
3447
3448 else
3449         : ${BUILD_CC:='${CC}'}
3450         : ${BUILD_CPP:='${CPP}'}
3451         : ${BUILD_CFLAGS:='${CFLAGS}'}
3452         : ${BUILD_CPPFLAGS:='${CPPFLAGS}'}
3453         : ${BUILD_LDFLAGS:='${LDFLAGS}'}
3454         : ${BUILD_LIBS:='${LIBS}'}
3455         : ${BUILD_EXEEXT:='$x'}
3456         : ${BUILD_OBJEXT:='o'}
3457 fi
3458
3459 ###############################################################################
3460
3461 ### Options to allow the user to specify the set of libraries which are used.
3462 ### Use "--without-normal --with-shared" to allow the default model to be
3463 ### shared, for example.
3464 cf_list_models=""
3465
3466 echo "$as_me:3466: checking if you want to build shared C-objects" >&5
3467 echo $ECHO_N "checking if you want to build shared C-objects... $ECHO_C" >&6
3468
3469 # Check whether --with-shared or --without-shared was given.
3470 if test "${with_shared+set}" = set; then
3471   withval="$with_shared"
3472   with_shared=$withval
3473 else
3474   with_shared=no
3475 fi;
3476 echo "$as_me:3476: result: $with_shared" >&5
3477 echo "${ECHO_T}$with_shared" >&6
3478 test "$with_shared" = "yes" && cf_list_models="$cf_list_models shared"
3479
3480 echo "$as_me:3480: checking for specified models" >&5
3481 echo $ECHO_N "checking for specified models... $ECHO_C" >&6
3482 test -z "$cf_list_models" && cf_list_models=normal
3483 echo "$as_me:3483: result: $cf_list_models" >&5
3484 echo "${ECHO_T}$cf_list_models" >&6
3485
3486 ### Use the first model as the default, and save its suffix for use in building
3487 ### up test-applications.
3488 echo "$as_me:3488: checking for default model" >&5
3489 echo $ECHO_N "checking for default model... $ECHO_C" >&6
3490 DFT_LWR_MODEL=`echo "$cf_list_models" | $AWK '{print $1}'`
3491 echo "$as_me:3491: result: $DFT_LWR_MODEL" >&5
3492 echo "${ECHO_T}$DFT_LWR_MODEL" >&6
3493
3494 DFT_UPR_MODEL=`echo "$DFT_LWR_MODEL" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
3495
3496 echo "$as_me:3496: checking for specific curses-directory" >&5
3497 echo $ECHO_N "checking for specific curses-directory... $ECHO_C" >&6
3498
3499 # Check whether --with-curses-dir or --without-curses-dir was given.
3500 if test "${with_curses_dir+set}" = set; then
3501   withval="$with_curses_dir"
3502   cf_cv_curses_dir=$withval
3503 else
3504   cf_cv_curses_dir=no
3505 fi;
3506 echo "$as_me:3506: result: $cf_cv_curses_dir" >&5
3507 echo "${ECHO_T}$cf_cv_curses_dir" >&6
3508
3509 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
3510 then
3511
3512 if test "x$prefix" != xNONE; then
3513         cf_path_syntax="$prefix"
3514 else
3515         cf_path_syntax="$ac_default_prefix"
3516 fi
3517
3518 case ".$withval" in
3519 (.\$\(*\)*|.\'*\'*)
3520         ;;
3521 (..|./*|.\\*)
3522         ;;
3523 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
3524         ;;
3525 (.\${*prefix}*|.\${*dir}*)
3526         eval withval="$withval"
3527         case ".$withval" in
3528         (.NONE/*)
3529                 withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
3530                 ;;
3531         esac
3532         ;;
3533 (.no|.NONE/*)
3534         withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
3535         ;;
3536 (*)
3537         { { echo "$as_me:3537: error: expected a pathname, not \"$withval\"" >&5
3538 echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;}
3539    { (exit 1); exit 1; }; }
3540         ;;
3541 esac
3542
3543         if test -d "$cf_cv_curses_dir"
3544         then
3545
3546 if test -n "$cf_cv_curses_dir/include" ; then
3547   for cf_add_incdir in $cf_cv_curses_dir/include
3548   do
3549         while test $cf_add_incdir != /usr/include
3550         do
3551           if test -d $cf_add_incdir
3552           then
3553                 cf_have_incdir=no
3554                 if test -n "$CFLAGS$CPPFLAGS" ; then
3555                   # a loop is needed to ensure we can add subdirs of existing dirs
3556                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
3557                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
3558                           cf_have_incdir=yes; break
3559                         fi
3560                   done
3561                 fi
3562
3563                 if test "$cf_have_incdir" = no ; then
3564                   if test "$cf_add_incdir" = /usr/local/include ; then
3565                         if test "$GCC" = yes
3566                         then
3567                           cf_save_CPPFLAGS=$CPPFLAGS
3568                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
3569                           cat >conftest.$ac_ext <<_ACEOF
3570 #line 3570 "configure"
3571 #include "confdefs.h"
3572 #include <stdio.h>
3573 int
3574 main ()
3575 {
3576 printf("Hello")
3577   ;
3578   return 0;
3579 }
3580 _ACEOF
3581 rm -f conftest.$ac_objext
3582 if { (eval echo "$as_me:3582: \"$ac_compile\"") >&5
3583   (eval $ac_compile) 2>&5
3584   ac_status=$?
3585   echo "$as_me:3585: \$? = $ac_status" >&5
3586   (exit $ac_status); } &&
3587          { ac_try='test -s conftest.$ac_objext'
3588   { (eval echo "$as_me:3588: \"$ac_try\"") >&5
3589   (eval $ac_try) 2>&5
3590   ac_status=$?
3591   echo "$as_me:3591: \$? = $ac_status" >&5
3592   (exit $ac_status); }; }; then
3593   :
3594 else
3595   echo "$as_me: failed program was:" >&5
3596 cat conftest.$ac_ext >&5
3597 cf_have_incdir=yes
3598 fi
3599 rm -f conftest.$ac_objext conftest.$ac_ext
3600                           CPPFLAGS=$cf_save_CPPFLAGS
3601                         fi
3602                   fi
3603                 fi
3604
3605                 if test "$cf_have_incdir" = no ; then
3606                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
3607
3608 echo "${as_me:-configure}:3608: testing adding $cf_add_incdir to include-path ..." 1>&5
3609
3610                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
3611
3612                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
3613                   test "$cf_top_incdir" = "$cf_add_incdir" && break
3614                   cf_add_incdir="$cf_top_incdir"
3615                 else
3616                   break
3617                 fi
3618           else
3619                 break
3620           fi
3621         done
3622   done
3623 fi
3624
3625 if test -n "$cf_cv_curses_dir/lib" ; then
3626         for cf_add_libdir in $cf_cv_curses_dir/lib
3627         do
3628                 if test $cf_add_libdir = /usr/lib ; then
3629                         :
3630                 elif test -d $cf_add_libdir
3631                 then
3632                         cf_have_libdir=no
3633                         if test -n "$LDFLAGS$LIBS" ; then
3634                                 # a loop is needed to ensure we can add subdirs of existing dirs
3635                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
3636                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
3637                                                 cf_have_libdir=yes; break
3638                                         fi
3639                                 done
3640                         fi
3641                         if test "$cf_have_libdir" = no ; then
3642                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
3643
3644 echo "${as_me:-configure}:3644: testing adding $cf_add_libdir to library-path ..." 1>&5
3645
3646                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
3647                         fi
3648                 fi
3649         done
3650 fi
3651
3652         fi
3653 fi
3654
3655 cf_ncuconfig_root=ncurses
3656 cf_have_ncuconfig=no
3657
3658 if test "x${PKG_CONFIG:=none}" != xnone; then
3659         echo "$as_me:3659: checking pkg-config for $cf_ncuconfig_root" >&5
3660 echo $ECHO_N "checking pkg-config for $cf_ncuconfig_root... $ECHO_C" >&6
3661         if "$PKG_CONFIG" --exists $cf_ncuconfig_root ; then
3662                 echo "$as_me:3662: result: yes" >&5
3663 echo "${ECHO_T}yes" >&6
3664
3665                 echo "$as_me:3665: checking if the $cf_ncuconfig_root package files work" >&5
3666 echo $ECHO_N "checking if the $cf_ncuconfig_root package files work... $ECHO_C" >&6
3667                 cf_have_ncuconfig=unknown
3668
3669                 cf_save_CPPFLAGS="$CPPFLAGS"
3670                 cf_save_LIBS="$LIBS"
3671
3672                 CPPFLAGS="$CPPFLAGS `$PKG_CONFIG --cflags $cf_ncuconfig_root`"
3673
3674 cf_add_libs="`$PKG_CONFIG --libs $cf_ncuconfig_root`"
3675 # Filter out duplicates - this happens with badly-designed ".pc" files...
3676 for cf_add_1lib in $LIBS
3677 do
3678         for cf_add_2lib in $cf_add_libs
3679         do
3680                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
3681                 then
3682                         cf_add_1lib=
3683                         break
3684                 fi
3685         done
3686         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
3687 done
3688 LIBS="$cf_add_libs"
3689
3690                 cat >conftest.$ac_ext <<_ACEOF
3691 #line 3691 "configure"
3692 #include "confdefs.h"
3693 #include <${cf_cv_ncurses_header:-curses.h}>
3694 int
3695 main ()
3696 {
3697 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
3698   ;
3699   return 0;
3700 }
3701 _ACEOF
3702 rm -f conftest.$ac_objext conftest$ac_exeext
3703 if { (eval echo "$as_me:3703: \"$ac_link\"") >&5
3704   (eval $ac_link) 2>&5
3705   ac_status=$?
3706   echo "$as_me:3706: \$? = $ac_status" >&5
3707   (exit $ac_status); } &&
3708          { ac_try='test -s conftest$ac_exeext'
3709   { (eval echo "$as_me:3709: \"$ac_try\"") >&5
3710   (eval $ac_try) 2>&5
3711   ac_status=$?
3712   echo "$as_me:3712: \$? = $ac_status" >&5
3713   (exit $ac_status); }; }; then
3714   if test "$cross_compiling" = yes; then
3715   cf_have_ncuconfig=maybe
3716 else
3717   cat >conftest.$ac_ext <<_ACEOF
3718 #line 3718 "configure"
3719 #include "confdefs.h"
3720 #include <${cf_cv_ncurses_header:-curses.h}>
3721                                 int main(void)
3722                                 { char *xx = curses_version(); return (xx == 0); }
3723 _ACEOF
3724 rm -f conftest$ac_exeext
3725 if { (eval echo "$as_me:3725: \"$ac_link\"") >&5
3726   (eval $ac_link) 2>&5
3727   ac_status=$?
3728   echo "$as_me:3728: \$? = $ac_status" >&5
3729   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
3730   { (eval echo "$as_me:3730: \"$ac_try\"") >&5
3731   (eval $ac_try) 2>&5
3732   ac_status=$?
3733   echo "$as_me:3733: \$? = $ac_status" >&5
3734   (exit $ac_status); }; }; then
3735   cf_have_ncuconfig=yes
3736 else
3737   echo "$as_me: program exited with status $ac_status" >&5
3738 echo "$as_me: failed program was:" >&5
3739 cat conftest.$ac_ext >&5
3740 cf_have_ncuconfig=no
3741 fi
3742 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
3743 fi
3744 else
3745   echo "$as_me: failed program was:" >&5
3746 cat conftest.$ac_ext >&5
3747 cf_have_ncuconfig=no
3748 fi
3749 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
3750                 echo "$as_me:3750: result: $cf_have_ncuconfig" >&5
3751 echo "${ECHO_T}$cf_have_ncuconfig" >&6
3752                 test "$cf_have_ncuconfig" = maybe && cf_have_ncuconfig=yes
3753                 if test "$cf_have_ncuconfig" != "yes"
3754                 then
3755                         CPPFLAGS="$cf_save_CPPFLAGS"
3756                         LIBS="$cf_save_LIBS"
3757                         NCURSES_CONFIG_PKG=none
3758                 else
3759
3760 cat >>confdefs.h <<\EOF
3761 #define NCURSES 1
3762 EOF
3763
3764                         NCURSES_CONFIG_PKG=$cf_ncuconfig_root
3765                 fi
3766
3767         else
3768                 echo "$as_me:3768: result: no" >&5
3769 echo "${ECHO_T}no" >&6
3770                 NCURSES_CONFIG_PKG=none
3771         fi
3772 else
3773         NCURSES_CONFIG_PKG=none
3774 fi
3775
3776 if test "x$cf_have_ncuconfig" = "xno"; then
3777         echo "Looking for ${cf_ncuconfig_root}-config"
3778
3779 if test -n "$ac_tool_prefix"; then
3780   for ac_prog in ${cf_ncuconfig_root}-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
3781   do
3782     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
3783 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
3784 echo "$as_me:3784: checking for $ac_word" >&5
3785 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3786 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
3787   echo $ECHO_N "(cached) $ECHO_C" >&6
3788 else
3789   if test -n "$NCURSES_CONFIG"; then
3790   ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
3791 else
3792   ac_save_IFS=$IFS; IFS=$ac_path_separator
3793 ac_dummy="$PATH"
3794 for ac_dir in $ac_dummy; do
3795   IFS=$ac_save_IFS
3796   test -z "$ac_dir" && ac_dir=.
3797   $as_executable_p "$ac_dir/$ac_word" || continue
3798 ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
3799 echo "$as_me:3799: found $ac_dir/$ac_word" >&5
3800 break
3801 done
3802
3803 fi
3804 fi
3805 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
3806 if test -n "$NCURSES_CONFIG"; then
3807   echo "$as_me:3807: result: $NCURSES_CONFIG" >&5
3808 echo "${ECHO_T}$NCURSES_CONFIG" >&6
3809 else
3810   echo "$as_me:3810: result: no" >&5
3811 echo "${ECHO_T}no" >&6
3812 fi
3813
3814     test -n "$NCURSES_CONFIG" && break
3815   done
3816 fi
3817 if test -z "$NCURSES_CONFIG"; then
3818   ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
3819   for ac_prog in ${cf_ncuconfig_root}-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
3820 do
3821   # Extract the first word of "$ac_prog", so it can be a program name with args.
3822 set dummy $ac_prog; ac_word=$2
3823 echo "$as_me:3823: checking for $ac_word" >&5
3824 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3825 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
3826   echo $ECHO_N "(cached) $ECHO_C" >&6
3827 else
3828   if test -n "$ac_ct_NCURSES_CONFIG"; then
3829   ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
3830 else
3831   ac_save_IFS=$IFS; IFS=$ac_path_separator
3832 ac_dummy="$PATH"
3833 for ac_dir in $ac_dummy; do
3834   IFS=$ac_save_IFS
3835   test -z "$ac_dir" && ac_dir=.
3836   $as_executable_p "$ac_dir/$ac_word" || continue
3837 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
3838 echo "$as_me:3838: found $ac_dir/$ac_word" >&5
3839 break
3840 done
3841
3842 fi
3843 fi
3844 ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
3845 if test -n "$ac_ct_NCURSES_CONFIG"; then
3846   echo "$as_me:3846: result: $ac_ct_NCURSES_CONFIG" >&5
3847 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
3848 else
3849   echo "$as_me:3849: result: no" >&5
3850 echo "${ECHO_T}no" >&6
3851 fi
3852
3853   test -n "$ac_ct_NCURSES_CONFIG" && break
3854 done
3855 test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
3856
3857   NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
3858 fi
3859
3860         if test "$NCURSES_CONFIG" != none ; then
3861
3862                 CPPFLAGS="$CPPFLAGS `$NCURSES_CONFIG --cflags`"
3863
3864 cf_add_libs="`$NCURSES_CONFIG --libs`"
3865 # Filter out duplicates - this happens with badly-designed ".pc" files...
3866 for cf_add_1lib in $LIBS
3867 do
3868         for cf_add_2lib in $cf_add_libs
3869         do
3870                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
3871                 then
3872                         cf_add_1lib=
3873                         break
3874                 fi
3875         done
3876         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
3877 done
3878 LIBS="$cf_add_libs"
3879
3880                 # even with config script, some packages use no-override for curses.h
3881
3882 echo "$as_me:3882: checking if we have identified curses headers" >&5
3883 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
3884 if test "${cf_cv_ncurses_header+set}" = set; then
3885   echo $ECHO_N "(cached) $ECHO_C" >&6
3886 else
3887
3888 cf_cv_ncurses_header=none
3889 for cf_header in \
3890         ncurses.h ncurses/ncurses.h \
3891         curses.h ncurses/curses.h
3892 do
3893 cat >conftest.$ac_ext <<_ACEOF
3894 #line 3894 "configure"
3895 #include "confdefs.h"
3896 #include <${cf_header}>
3897 int
3898 main ()
3899 {
3900 initscr(); tgoto("?", 0,0)
3901   ;
3902   return 0;
3903 }
3904 _ACEOF
3905 rm -f conftest.$ac_objext
3906 if { (eval echo "$as_me:3906: \"$ac_compile\"") >&5
3907   (eval $ac_compile) 2>&5
3908   ac_status=$?
3909   echo "$as_me:3909: \$? = $ac_status" >&5
3910   (exit $ac_status); } &&
3911          { ac_try='test -s conftest.$ac_objext'
3912   { (eval echo "$as_me:3912: \"$ac_try\"") >&5
3913   (eval $ac_try) 2>&5
3914   ac_status=$?
3915   echo "$as_me:3915: \$? = $ac_status" >&5
3916   (exit $ac_status); }; }; then
3917   cf_cv_ncurses_header=$cf_header; break
3918 else
3919   echo "$as_me: failed program was:" >&5
3920 cat conftest.$ac_ext >&5
3921 fi
3922 rm -f conftest.$ac_objext conftest.$ac_ext
3923 done
3924
3925 fi
3926 echo "$as_me:3926: result: $cf_cv_ncurses_header" >&5
3927 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
3928
3929 if test "$cf_cv_ncurses_header" = none ; then
3930         { { echo "$as_me:3930: error: No curses header-files found" >&5
3931 echo "$as_me: error: No curses header-files found" >&2;}
3932    { (exit 1); exit 1; }; }
3933 fi
3934
3935 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
3936
3937 for ac_header in $cf_cv_ncurses_header
3938 do
3939 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
3940 echo "$as_me:3940: checking for $ac_header" >&5
3941 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
3942 if eval "test \"\${$as_ac_Header+set}\" = set"; then
3943   echo $ECHO_N "(cached) $ECHO_C" >&6
3944 else
3945   cat >conftest.$ac_ext <<_ACEOF
3946 #line 3946 "configure"
3947 #include "confdefs.h"
3948 #include <$ac_header>
3949 _ACEOF
3950 if { (eval echo "$as_me:3950: \"$ac_cpp conftest.$ac_ext\"") >&5
3951   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
3952   ac_status=$?
3953   egrep -v '^ *\+' conftest.er1 >conftest.err
3954   rm -f conftest.er1
3955   cat conftest.err >&5
3956   echo "$as_me:3956: \$? = $ac_status" >&5
3957   (exit $ac_status); } >/dev/null; then
3958   if test -s conftest.err; then
3959     ac_cpp_err=$ac_c_preproc_warn_flag
3960   else
3961     ac_cpp_err=
3962   fi
3963 else
3964   ac_cpp_err=yes
3965 fi
3966 if test -z "$ac_cpp_err"; then
3967   eval "$as_ac_Header=yes"
3968 else
3969   echo "$as_me: failed program was:" >&5
3970   cat conftest.$ac_ext >&5
3971   eval "$as_ac_Header=no"
3972 fi
3973 rm -f conftest.err conftest.$ac_ext
3974 fi
3975 echo "$as_me:3975: result: `eval echo '${'$as_ac_Header'}'`" >&5
3976 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
3977 if test `eval echo '${'$as_ac_Header'}'` = yes; then
3978   cat >>confdefs.h <<EOF
3979 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
3980 EOF
3981
3982 fi
3983 done
3984
3985 cat >>confdefs.h <<\EOF
3986 #define NCURSES 1
3987 EOF
3988
3989 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
3990
3991                 cat >>confdefs.h <<EOF
3992 #define $cf_nculib_ROOT 1
3993 EOF
3994
3995                                 cf_cv_ncurses_version=`$NCURSES_CONFIG --version`
3996
3997         else
3998
3999 cf_ncuhdr_root=ncurses
4000
4001 test -n "$cf_cv_curses_dir" && \
4002 test "$cf_cv_curses_dir" != "no" && { \
4003
4004 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
4005   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
4006   do
4007         while test $cf_add_incdir != /usr/include
4008         do
4009           if test -d $cf_add_incdir
4010           then
4011                 cf_have_incdir=no
4012                 if test -n "$CFLAGS$CPPFLAGS" ; then
4013                   # a loop is needed to ensure we can add subdirs of existing dirs
4014                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
4015                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
4016                           cf_have_incdir=yes; break
4017                         fi
4018                   done
4019                 fi
4020
4021                 if test "$cf_have_incdir" = no ; then
4022                   if test "$cf_add_incdir" = /usr/local/include ; then
4023                         if test "$GCC" = yes
4024                         then
4025                           cf_save_CPPFLAGS=$CPPFLAGS
4026                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
4027                           cat >conftest.$ac_ext <<_ACEOF
4028 #line 4028 "configure"
4029 #include "confdefs.h"
4030 #include <stdio.h>
4031 int
4032 main ()
4033 {
4034 printf("Hello")
4035   ;
4036   return 0;
4037 }
4038 _ACEOF
4039 rm -f conftest.$ac_objext
4040 if { (eval echo "$as_me:4040: \"$ac_compile\"") >&5
4041   (eval $ac_compile) 2>&5
4042   ac_status=$?
4043   echo "$as_me:4043: \$? = $ac_status" >&5
4044   (exit $ac_status); } &&
4045          { ac_try='test -s conftest.$ac_objext'
4046   { (eval echo "$as_me:4046: \"$ac_try\"") >&5
4047   (eval $ac_try) 2>&5
4048   ac_status=$?
4049   echo "$as_me:4049: \$? = $ac_status" >&5
4050   (exit $ac_status); }; }; then
4051   :
4052 else
4053   echo "$as_me: failed program was:" >&5
4054 cat conftest.$ac_ext >&5
4055 cf_have_incdir=yes
4056 fi
4057 rm -f conftest.$ac_objext conftest.$ac_ext
4058                           CPPFLAGS=$cf_save_CPPFLAGS
4059                         fi
4060                   fi
4061                 fi
4062
4063                 if test "$cf_have_incdir" = no ; then
4064                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
4065
4066 echo "${as_me:-configure}:4066: testing adding $cf_add_incdir to include-path ..." 1>&5
4067
4068                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
4069
4070                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
4071                   test "$cf_top_incdir" = "$cf_add_incdir" && break
4072                   cf_add_incdir="$cf_top_incdir"
4073                 else
4074                   break
4075                 fi
4076           else
4077                 break
4078           fi
4079         done
4080   done
4081 fi
4082
4083 }
4084
4085 echo "$as_me:4085: checking for $cf_ncuhdr_root header in include-path" >&5
4086 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
4087 if test "${cf_cv_ncurses_h+set}" = set; then
4088   echo $ECHO_N "(cached) $ECHO_C" >&6
4089 else
4090
4091         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
4092         ( test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw ) && cf_header_list="$cf_header_list curses.h ncurses.h"
4093         for cf_header in $cf_header_list
4094         do
4095
4096         cat >conftest.$ac_ext <<_ACEOF
4097 #line 4097 "configure"
4098 #include "confdefs.h"
4099
4100 #include <$cf_header>
4101 int
4102 main ()
4103 {
4104
4105 #ifdef NCURSES_VERSION
4106
4107 printf("%s\n", NCURSES_VERSION);
4108 #else
4109 #ifdef __NCURSES_H
4110 printf("old\n");
4111 #else
4112         make an error
4113 #endif
4114 #endif
4115
4116   ;
4117   return 0;
4118 }
4119 _ACEOF
4120 rm -f conftest.$ac_objext
4121 if { (eval echo "$as_me:4121: \"$ac_compile\"") >&5
4122   (eval $ac_compile) 2>&5
4123   ac_status=$?
4124   echo "$as_me:4124: \$? = $ac_status" >&5
4125   (exit $ac_status); } &&
4126          { ac_try='test -s conftest.$ac_objext'
4127   { (eval echo "$as_me:4127: \"$ac_try\"") >&5
4128   (eval $ac_try) 2>&5
4129   ac_status=$?
4130   echo "$as_me:4130: \$? = $ac_status" >&5
4131   (exit $ac_status); }; }; then
4132   cf_cv_ncurses_h=$cf_header
4133
4134 else
4135   echo "$as_me: failed program was:" >&5
4136 cat conftest.$ac_ext >&5
4137 cf_cv_ncurses_h=no
4138 fi
4139 rm -f conftest.$ac_objext conftest.$ac_ext
4140
4141                 test "$cf_cv_ncurses_h" != no && break
4142         done
4143
4144 fi
4145 echo "$as_me:4145: result: $cf_cv_ncurses_h" >&5
4146 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
4147
4148 if test "$cf_cv_ncurses_h" != no ; then
4149         cf_cv_ncurses_header=$cf_cv_ncurses_h
4150 else
4151
4152 echo "$as_me:4152: checking for $cf_ncuhdr_root include-path" >&5
4153 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
4154 if test "${cf_cv_ncurses_h2+set}" = set; then
4155   echo $ECHO_N "(cached) $ECHO_C" >&6
4156 else
4157
4158         test -n "$verbose" && echo
4159
4160 cf_search=
4161
4162 # collect the current set of include-directories from compiler flags
4163 cf_header_path_list=""
4164 if test -n "${CFLAGS}${CPPFLAGS}" ; then
4165         for cf_header_path in $CPPFLAGS $CFLAGS
4166         do
4167                 case $cf_header_path in
4168                 (-I*)
4169                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
4170
4171 test "x$cf_header_path" != "xNONE" && \
4172 test -d "$cf_header_path" && \
4173  {
4174         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
4175         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
4176         test -d $cf_header_path/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
4177         test -d $cf_header_path/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
4178         test -d $cf_header_path/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
4179         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"
4180 }
4181
4182                         cf_header_path_list="$cf_header_path_list $cf_search"
4183                         ;;
4184                 esac
4185         done
4186 fi
4187
4188 # add the variations for the package we are looking for
4189
4190 cf_search=
4191
4192 test "x$prefix" != "xNONE" && \
4193 test -d "$prefix" && \
4194  {
4195         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
4196         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
4197         test -d $prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
4198         test -d $prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
4199         test -d $prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
4200         test -d $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
4201 }
4202
4203 for cf_subdir_prefix in \
4204         /usr \
4205         /usr/local \
4206         /usr/pkg \
4207         /opt \
4208         /opt/local \
4209         $HOME
4210 do
4211
4212 test "x$cf_subdir_prefix" != "x$prefix" && \
4213 test -d "$cf_subdir_prefix" && \
4214 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
4215         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
4216         test -d $cf_subdir_prefix/include &&          cf_search="$cf_search $cf_subdir_prefix/include"
4217         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root"
4218         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root/include"
4219         test -d $cf_subdir_prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include"
4220         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"
4221 }
4222
4223 done
4224
4225 test "$includedir" != NONE && \
4226 test "$includedir" != "/usr/include" && \
4227 test -d "$includedir" && {
4228         test -d $includedir &&    cf_search="$cf_search $includedir"
4229         test -d $includedir/$cf_ncuhdr_root && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
4230 }
4231
4232 test "$oldincludedir" != NONE && \
4233 test "$oldincludedir" != "/usr/include" && \
4234 test -d "$oldincludedir" && {
4235         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
4236         test -d $oldincludedir/$cf_ncuhdr_root && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
4237 }
4238
4239 cf_search="$cf_search $cf_header_path_list"
4240
4241         test -n "$verbose" && echo search path $cf_search
4242         cf_save2_CPPFLAGS="$CPPFLAGS"
4243         for cf_incdir in $cf_search
4244         do
4245
4246 if test -n "$cf_incdir" ; then
4247   for cf_add_incdir in $cf_incdir
4248   do
4249         while test $cf_add_incdir != /usr/include
4250         do
4251           if test -d $cf_add_incdir
4252           then
4253                 cf_have_incdir=no
4254                 if test -n "$CFLAGS$CPPFLAGS" ; then
4255                   # a loop is needed to ensure we can add subdirs of existing dirs
4256                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
4257                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
4258                           cf_have_incdir=yes; break
4259                         fi
4260                   done
4261                 fi
4262
4263                 if test "$cf_have_incdir" = no ; then
4264                   if test "$cf_add_incdir" = /usr/local/include ; then
4265                         if test "$GCC" = yes
4266                         then
4267                           cf_save_CPPFLAGS=$CPPFLAGS
4268                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
4269                           cat >conftest.$ac_ext <<_ACEOF
4270 #line 4270 "configure"
4271 #include "confdefs.h"
4272 #include <stdio.h>
4273 int
4274 main ()
4275 {
4276 printf("Hello")
4277   ;
4278   return 0;
4279 }
4280 _ACEOF
4281 rm -f conftest.$ac_objext
4282 if { (eval echo "$as_me:4282: \"$ac_compile\"") >&5
4283   (eval $ac_compile) 2>&5
4284   ac_status=$?
4285   echo "$as_me:4285: \$? = $ac_status" >&5
4286   (exit $ac_status); } &&
4287          { ac_try='test -s conftest.$ac_objext'
4288   { (eval echo "$as_me:4288: \"$ac_try\"") >&5
4289   (eval $ac_try) 2>&5
4290   ac_status=$?
4291   echo "$as_me:4291: \$? = $ac_status" >&5
4292   (exit $ac_status); }; }; then
4293   :
4294 else
4295   echo "$as_me: failed program was:" >&5
4296 cat conftest.$ac_ext >&5
4297 cf_have_incdir=yes
4298 fi
4299 rm -f conftest.$ac_objext conftest.$ac_ext
4300                           CPPFLAGS=$cf_save_CPPFLAGS
4301                         fi
4302                   fi
4303                 fi
4304
4305                 if test "$cf_have_incdir" = no ; then
4306                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
4307
4308 echo "${as_me:-configure}:4308: testing adding $cf_add_incdir to include-path ..." 1>&5
4309
4310                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
4311
4312                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
4313                   test "$cf_top_incdir" = "$cf_add_incdir" && break
4314                   cf_add_incdir="$cf_top_incdir"
4315                 else
4316                   break
4317                 fi
4318           else
4319                 break
4320           fi
4321         done
4322   done
4323 fi
4324
4325                 for cf_header in \
4326                         ncurses.h \
4327                         curses.h
4328                 do
4329
4330         cat >conftest.$ac_ext <<_ACEOF
4331 #line 4331 "configure"
4332 #include "confdefs.h"
4333
4334 #include <$cf_header>
4335 int
4336 main ()
4337 {
4338
4339 #ifdef NCURSES_VERSION
4340
4341 printf("%s\n", NCURSES_VERSION);
4342 #else
4343 #ifdef __NCURSES_H
4344 printf("old\n");
4345 #else
4346         make an error
4347 #endif
4348 #endif
4349
4350   ;
4351   return 0;
4352 }
4353 _ACEOF
4354 rm -f conftest.$ac_objext
4355 if { (eval echo "$as_me:4355: \"$ac_compile\"") >&5
4356   (eval $ac_compile) 2>&5
4357   ac_status=$?
4358   echo "$as_me:4358: \$? = $ac_status" >&5
4359   (exit $ac_status); } &&
4360          { ac_try='test -s conftest.$ac_objext'
4361   { (eval echo "$as_me:4361: \"$ac_try\"") >&5
4362   (eval $ac_try) 2>&5
4363   ac_status=$?
4364   echo "$as_me:4364: \$? = $ac_status" >&5
4365   (exit $ac_status); }; }; then
4366   cf_cv_ncurses_h2=$cf_header
4367
4368 else
4369   echo "$as_me: failed program was:" >&5
4370 cat conftest.$ac_ext >&5
4371 cf_cv_ncurses_h2=no
4372 fi
4373 rm -f conftest.$ac_objext conftest.$ac_ext
4374
4375                         if test "$cf_cv_ncurses_h2" != no ; then
4376                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
4377                                 test -n "$verbose" && echo $ac_n "      ... found $ac_c" 1>&6
4378                                 break
4379                         fi
4380                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
4381                 done
4382                 CPPFLAGS="$cf_save2_CPPFLAGS"
4383                 test "$cf_cv_ncurses_h2" != no && break
4384         done
4385         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:4385: error: not found" >&5
4386 echo "$as_me: error: not found" >&2;}
4387    { (exit 1); exit 1; }; }
4388
4389 fi
4390 echo "$as_me:4390: result: $cf_cv_ncurses_h2" >&5
4391 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
4392
4393         cf_1st_incdir=`echo $cf_cv_ncurses_h2 | sed -e 's%/[^/]*$%%'`
4394         cf_cv_ncurses_header=`basename $cf_cv_ncurses_h2`
4395         if test `basename $cf_1st_incdir` = $cf_ncuhdr_root ; then
4396                 cf_cv_ncurses_header=$cf_ncuhdr_root/$cf_cv_ncurses_header
4397         fi
4398
4399 if test -n "$cf_1st_incdir" ; then
4400   for cf_add_incdir in $cf_1st_incdir
4401   do
4402         while test $cf_add_incdir != /usr/include
4403         do
4404           if test -d $cf_add_incdir
4405           then
4406                 cf_have_incdir=no
4407                 if test -n "$CFLAGS$CPPFLAGS" ; then
4408                   # a loop is needed to ensure we can add subdirs of existing dirs
4409                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
4410                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
4411                           cf_have_incdir=yes; break
4412                         fi
4413                   done
4414                 fi
4415
4416                 if test "$cf_have_incdir" = no ; then
4417                   if test "$cf_add_incdir" = /usr/local/include ; then
4418                         if test "$GCC" = yes
4419                         then
4420                           cf_save_CPPFLAGS=$CPPFLAGS
4421                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
4422                           cat >conftest.$ac_ext <<_ACEOF
4423 #line 4423 "configure"
4424 #include "confdefs.h"
4425 #include <stdio.h>
4426 int
4427 main ()
4428 {
4429 printf("Hello")
4430   ;
4431   return 0;
4432 }
4433 _ACEOF
4434 rm -f conftest.$ac_objext
4435 if { (eval echo "$as_me:4435: \"$ac_compile\"") >&5
4436   (eval $ac_compile) 2>&5
4437   ac_status=$?
4438   echo "$as_me:4438: \$? = $ac_status" >&5
4439   (exit $ac_status); } &&
4440          { ac_try='test -s conftest.$ac_objext'
4441   { (eval echo "$as_me:4441: \"$ac_try\"") >&5
4442   (eval $ac_try) 2>&5
4443   ac_status=$?
4444   echo "$as_me:4444: \$? = $ac_status" >&5
4445   (exit $ac_status); }; }; then
4446   :
4447 else
4448   echo "$as_me: failed program was:" >&5
4449 cat conftest.$ac_ext >&5
4450 cf_have_incdir=yes
4451 fi
4452 rm -f conftest.$ac_objext conftest.$ac_ext
4453                           CPPFLAGS=$cf_save_CPPFLAGS
4454                         fi
4455                   fi
4456                 fi
4457
4458                 if test "$cf_have_incdir" = no ; then
4459                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
4460
4461 echo "${as_me:-configure}:4461: testing adding $cf_add_incdir to include-path ..." 1>&5
4462
4463                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
4464
4465                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
4466                   test "$cf_top_incdir" = "$cf_add_incdir" && break
4467                   cf_add_incdir="$cf_top_incdir"
4468                 else
4469                   break
4470                 fi
4471           else
4472                 break
4473           fi
4474         done
4475   done
4476 fi
4477
4478 fi
4479
4480 # Set definitions to allow ifdef'ing for ncurses.h
4481
4482 case $cf_cv_ncurses_header in
4483 (*ncurses.h)
4484
4485 cat >>confdefs.h <<\EOF
4486 #define HAVE_NCURSES_H 1
4487 EOF
4488
4489         ;;
4490 esac
4491
4492 case $cf_cv_ncurses_header in
4493 (ncurses/curses.h|ncurses/ncurses.h)
4494
4495 cat >>confdefs.h <<\EOF
4496 #define HAVE_NCURSES_NCURSES_H 1
4497 EOF
4498
4499         ;;
4500 (ncursesw/curses.h|ncursesw/ncurses.h)
4501
4502 cat >>confdefs.h <<\EOF
4503 #define HAVE_NCURSESW_NCURSES_H 1
4504 EOF
4505
4506         ;;
4507 esac
4508
4509 echo "$as_me:4509: checking for terminfo header" >&5
4510 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
4511 if test "${cf_cv_term_header+set}" = set; then
4512   echo $ECHO_N "(cached) $ECHO_C" >&6
4513 else
4514
4515 case ${cf_cv_ncurses_header} in
4516 (*/ncurses.h|*/ncursesw.h)
4517         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
4518         ;;
4519 (*)
4520         cf_term_header=term.h
4521         ;;
4522 esac
4523
4524 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
4525 do
4526 cat >conftest.$ac_ext <<_ACEOF
4527 #line 4527 "configure"
4528 #include "confdefs.h"
4529 #include <stdio.h>
4530 #include <${cf_cv_ncurses_header:-curses.h}>
4531 #include <$cf_test>
4532
4533 int
4534 main ()
4535 {
4536 int x = auto_left_margin
4537   ;
4538   return 0;
4539 }
4540 _ACEOF
4541 rm -f conftest.$ac_objext
4542 if { (eval echo "$as_me:4542: \"$ac_compile\"") >&5
4543   (eval $ac_compile) 2>&5
4544   ac_status=$?
4545   echo "$as_me:4545: \$? = $ac_status" >&5
4546   (exit $ac_status); } &&
4547          { ac_try='test -s conftest.$ac_objext'
4548   { (eval echo "$as_me:4548: \"$ac_try\"") >&5
4549   (eval $ac_try) 2>&5
4550   ac_status=$?
4551   echo "$as_me:4551: \$? = $ac_status" >&5
4552   (exit $ac_status); }; }; then
4553
4554         cf_cv_term_header="$cf_test"
4555 else
4556   echo "$as_me: failed program was:" >&5
4557 cat conftest.$ac_ext >&5
4558
4559         cf_cv_term_header=unknown
4560
4561 fi
4562 rm -f conftest.$ac_objext conftest.$ac_ext
4563         test "$cf_cv_term_header" != unknown && break
4564 done
4565
4566 fi
4567 echo "$as_me:4567: result: $cf_cv_term_header" >&5
4568 echo "${ECHO_T}$cf_cv_term_header" >&6
4569
4570 # Set definitions to allow ifdef'ing to accommodate subdirectories
4571
4572 case $cf_cv_term_header in
4573 (*term.h)
4574
4575 cat >>confdefs.h <<\EOF
4576 #define HAVE_TERM_H 1
4577 EOF
4578
4579         ;;
4580 esac
4581
4582 case $cf_cv_term_header in
4583 (ncurses/term.h)
4584
4585 cat >>confdefs.h <<\EOF
4586 #define HAVE_NCURSES_TERM_H 1
4587 EOF
4588
4589         ;;
4590 (ncursesw/term.h)
4591
4592 cat >>confdefs.h <<\EOF
4593 #define HAVE_NCURSESW_TERM_H 1
4594 EOF
4595
4596         ;;
4597 esac
4598
4599 # some applications need this, but should check for NCURSES_VERSION
4600
4601 cat >>confdefs.h <<\EOF
4602 #define NCURSES 1
4603 EOF
4604
4605 echo "$as_me:4605: checking for ncurses version" >&5
4606 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
4607 if test "${cf_cv_ncurses_version+set}" = set; then
4608   echo $ECHO_N "(cached) $ECHO_C" >&6
4609 else
4610
4611         cf_cv_ncurses_version=no
4612         cf_tempfile=out$$
4613         rm -f $cf_tempfile
4614         if test "$cross_compiling" = yes; then
4615
4616         # This will not work if the preprocessor splits the line after the
4617         # Autoconf token.  The 'unproto' program does that.
4618         cat > conftest.$ac_ext <<EOF
4619 #include <${cf_cv_ncurses_header:-curses.h}>
4620 #undef Autoconf
4621 #ifdef NCURSES_VERSION
4622 Autoconf NCURSES_VERSION
4623 #else
4624 #ifdef __NCURSES_H
4625 Autoconf "old"
4626 #endif
4627 ;
4628 #endif
4629 EOF
4630         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
4631         { (eval echo "$as_me:4631: \"$cf_try\"") >&5
4632   (eval $cf_try) 2>&5
4633   ac_status=$?
4634   echo "$as_me:4634: \$? = $ac_status" >&5
4635   (exit $ac_status); }
4636         if test -f conftest.out ; then
4637                 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
4638                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
4639                 rm -f conftest.out
4640         fi
4641
4642 else
4643   cat >conftest.$ac_ext <<_ACEOF
4644 #line 4644 "configure"
4645 #include "confdefs.h"
4646
4647 #include <${cf_cv_ncurses_header:-curses.h}>
4648 #include <stdio.h>
4649 int main()
4650 {
4651         FILE *fp = fopen("$cf_tempfile", "w");
4652 #ifdef NCURSES_VERSION
4653 # ifdef NCURSES_VERSION_PATCH
4654         fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
4655 # else
4656         fprintf(fp, "%s\n", NCURSES_VERSION);
4657 # endif
4658 #else
4659 # ifdef __NCURSES_H
4660         fprintf(fp, "old\n");
4661 # else
4662         make an error
4663 # endif
4664 #endif
4665         ${cf_cv_main_return:-return}(0);
4666 }
4667 _ACEOF
4668 rm -f conftest$ac_exeext
4669 if { (eval echo "$as_me:4669: \"$ac_link\"") >&5
4670   (eval $ac_link) 2>&5
4671   ac_status=$?
4672   echo "$as_me:4672: \$? = $ac_status" >&5
4673   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
4674   { (eval echo "$as_me:4674: \"$ac_try\"") >&5
4675   (eval $ac_try) 2>&5
4676   ac_status=$?
4677   echo "$as_me:4677: \$? = $ac_status" >&5
4678   (exit $ac_status); }; }; then
4679
4680         cf_cv_ncurses_version=`cat $cf_tempfile`
4681 else
4682   echo "$as_me: program exited with status $ac_status" >&5
4683 echo "$as_me: failed program was:" >&5
4684 cat conftest.$ac_ext >&5
4685 fi
4686 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
4687 fi
4688         rm -f $cf_tempfile
4689
4690 fi
4691 echo "$as_me:4691: result: $cf_cv_ncurses_version" >&5
4692 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
4693 test "$cf_cv_ncurses_version" = no ||
4694 cat >>confdefs.h <<\EOF
4695 #define NCURSES 1
4696 EOF
4697
4698 cf_nculib_root=ncurses
4699         # This works, except for the special case where we find gpm, but
4700         # ncurses is in a nonstandard location via $LIBS, and we really want
4701         # to link gpm.
4702 cf_ncurses_LIBS=""
4703 cf_ncurses_SAVE="$LIBS"
4704 echo "$as_me:4704: checking for Gpm_Open in -lgpm" >&5
4705 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
4706 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
4707   echo $ECHO_N "(cached) $ECHO_C" >&6
4708 else
4709   ac_check_lib_save_LIBS=$LIBS
4710 LIBS="-lgpm  $LIBS"
4711 cat >conftest.$ac_ext <<_ACEOF
4712 #line 4712 "configure"
4713 #include "confdefs.h"
4714
4715 /* Override any gcc2 internal prototype to avoid an error.  */
4716 #ifdef __cplusplus
4717 extern "C"
4718 #endif
4719 /* We use char because int might match the return type of a gcc2
4720    builtin and then its argument prototype would still apply.  */
4721 char Gpm_Open ();
4722 int
4723 main ()
4724 {
4725 Gpm_Open ();
4726   ;
4727   return 0;
4728 }
4729 _ACEOF
4730 rm -f conftest.$ac_objext conftest$ac_exeext
4731 if { (eval echo "$as_me:4731: \"$ac_link\"") >&5
4732   (eval $ac_link) 2>&5
4733   ac_status=$?
4734   echo "$as_me:4734: \$? = $ac_status" >&5
4735   (exit $ac_status); } &&
4736          { ac_try='test -s conftest$ac_exeext'
4737   { (eval echo "$as_me:4737: \"$ac_try\"") >&5
4738   (eval $ac_try) 2>&5
4739   ac_status=$?
4740   echo "$as_me:4740: \$? = $ac_status" >&5
4741   (exit $ac_status); }; }; then
4742   ac_cv_lib_gpm_Gpm_Open=yes
4743 else
4744   echo "$as_me: failed program was:" >&5
4745 cat conftest.$ac_ext >&5
4746 ac_cv_lib_gpm_Gpm_Open=no
4747 fi
4748 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
4749 LIBS=$ac_check_lib_save_LIBS
4750 fi
4751 echo "$as_me:4751: result: $ac_cv_lib_gpm_Gpm_Open" >&5
4752 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
4753 if test $ac_cv_lib_gpm_Gpm_Open = yes; then
4754   echo "$as_me:4754: checking for initscr in -lgpm" >&5
4755 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
4756 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
4757   echo $ECHO_N "(cached) $ECHO_C" >&6
4758 else
4759   ac_check_lib_save_LIBS=$LIBS
4760 LIBS="-lgpm  $LIBS"
4761 cat >conftest.$ac_ext <<_ACEOF
4762 #line 4762 "configure"
4763 #include "confdefs.h"
4764
4765 /* Override any gcc2 internal prototype to avoid an error.  */
4766 #ifdef __cplusplus
4767 extern "C"
4768 #endif
4769 /* We use char because int might match the return type of a gcc2
4770    builtin and then its argument prototype would still apply.  */
4771 char initscr ();
4772 int
4773 main ()
4774 {
4775 initscr ();
4776   ;
4777   return 0;
4778 }
4779 _ACEOF
4780 rm -f conftest.$ac_objext conftest$ac_exeext
4781 if { (eval echo "$as_me:4781: \"$ac_link\"") >&5
4782   (eval $ac_link) 2>&5
4783   ac_status=$?
4784   echo "$as_me:4784: \$? = $ac_status" >&5
4785   (exit $ac_status); } &&
4786          { ac_try='test -s conftest$ac_exeext'
4787   { (eval echo "$as_me:4787: \"$ac_try\"") >&5
4788   (eval $ac_try) 2>&5
4789   ac_status=$?
4790   echo "$as_me:4790: \$? = $ac_status" >&5
4791   (exit $ac_status); }; }; then
4792   ac_cv_lib_gpm_initscr=yes
4793 else
4794   echo "$as_me: failed program was:" >&5
4795 cat conftest.$ac_ext >&5
4796 ac_cv_lib_gpm_initscr=no
4797 fi
4798 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
4799 LIBS=$ac_check_lib_save_LIBS
4800 fi
4801 echo "$as_me:4801: result: $ac_cv_lib_gpm_initscr" >&5
4802 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
4803 if test $ac_cv_lib_gpm_initscr = yes; then
4804   LIBS="$cf_ncurses_SAVE"
4805 else
4806   cf_ncurses_LIBS="-lgpm"
4807 fi
4808
4809 fi
4810
4811 case $host_os in
4812 (freebsd*)
4813         # This is only necessary if you are linking against an obsolete
4814         # version of ncurses (but it should do no harm, since it's static).
4815         if test "$cf_nculib_root" = ncurses ; then
4816                 echo "$as_me:4816: checking for tgoto in -lmytinfo" >&5
4817 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
4818 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
4819   echo $ECHO_N "(cached) $ECHO_C" >&6
4820 else
4821   ac_check_lib_save_LIBS=$LIBS
4822 LIBS="-lmytinfo  $LIBS"
4823 cat >conftest.$ac_ext <<_ACEOF
4824 #line 4824 "configure"
4825 #include "confdefs.h"
4826
4827 /* Override any gcc2 internal prototype to avoid an error.  */
4828 #ifdef __cplusplus
4829 extern "C"
4830 #endif
4831 /* We use char because int might match the return type of a gcc2
4832    builtin and then its argument prototype would still apply.  */
4833 char tgoto ();
4834 int
4835 main ()
4836 {
4837 tgoto ();
4838   ;
4839   return 0;
4840 }
4841 _ACEOF
4842 rm -f conftest.$ac_objext conftest$ac_exeext
4843 if { (eval echo "$as_me:4843: \"$ac_link\"") >&5
4844   (eval $ac_link) 2>&5
4845   ac_status=$?
4846   echo "$as_me:4846: \$? = $ac_status" >&5
4847   (exit $ac_status); } &&
4848          { ac_try='test -s conftest$ac_exeext'
4849   { (eval echo "$as_me:4849: \"$ac_try\"") >&5
4850   (eval $ac_try) 2>&5
4851   ac_status=$?
4852   echo "$as_me:4852: \$? = $ac_status" >&5
4853   (exit $ac_status); }; }; then
4854   ac_cv_lib_mytinfo_tgoto=yes
4855 else
4856   echo "$as_me: failed program was:" >&5
4857 cat conftest.$ac_ext >&5
4858 ac_cv_lib_mytinfo_tgoto=no
4859 fi
4860 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
4861 LIBS=$ac_check_lib_save_LIBS
4862 fi
4863 echo "$as_me:4863: result: $ac_cv_lib_mytinfo_tgoto" >&5
4864 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
4865 if test $ac_cv_lib_mytinfo_tgoto = yes; then
4866   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
4867 fi
4868
4869         fi
4870         ;;
4871 esac
4872
4873 cf_add_libs="$cf_ncurses_LIBS"
4874 # Filter out duplicates - this happens with badly-designed ".pc" files...
4875 for cf_add_1lib in $LIBS
4876 do
4877         for cf_add_2lib in $cf_add_libs
4878         do
4879                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
4880                 then
4881                         cf_add_1lib=
4882                         break
4883                 fi
4884         done
4885         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
4886 done
4887 LIBS="$cf_add_libs"
4888
4889 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
4890 then
4891
4892 cf_add_libs="-l$cf_nculib_root"
4893 # Filter out duplicates - this happens with badly-designed ".pc" files...
4894 for cf_add_1lib in $LIBS
4895 do
4896         for cf_add_2lib in $cf_add_libs
4897         do
4898                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
4899                 then
4900                         cf_add_1lib=
4901                         break
4902                 fi
4903         done
4904         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
4905 done
4906 LIBS="$cf_add_libs"
4907
4908 else
4909
4910         eval 'cf_cv_have_lib_'$cf_nculib_root'=no'
4911         cf_libdir=""
4912         echo "$as_me:4912: checking for initscr" >&5
4913 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
4914 if test "${ac_cv_func_initscr+set}" = set; then
4915   echo $ECHO_N "(cached) $ECHO_C" >&6
4916 else
4917   cat >conftest.$ac_ext <<_ACEOF
4918 #line 4918 "configure"
4919 #include "confdefs.h"
4920 /* System header to define __stub macros and hopefully few prototypes,
4921     which can conflict with char initscr (); below.  */
4922 #include <assert.h>
4923 /* Override any gcc2 internal prototype to avoid an error.  */
4924 #ifdef __cplusplus
4925 extern "C"
4926 #endif
4927 /* We use char because int might match the return type of a gcc2
4928    builtin and then its argument prototype would still apply.  */
4929 char initscr ();
4930 char (*f) ();
4931
4932 int
4933 main ()
4934 {
4935 /* The GNU C library defines this for functions which it implements
4936     to always fail with ENOSYS.  Some functions are actually named
4937     something starting with __ and the normal name is an alias.  */
4938 #if defined (__stub_initscr) || defined (__stub___initscr)
4939 choke me
4940 #else
4941 f = initscr; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
4942 #endif
4943
4944   ;
4945   return 0;
4946 }
4947 _ACEOF
4948 rm -f conftest.$ac_objext conftest$ac_exeext
4949 if { (eval echo "$as_me:4949: \"$ac_link\"") >&5
4950   (eval $ac_link) 2>&5
4951   ac_status=$?
4952   echo "$as_me:4952: \$? = $ac_status" >&5
4953   (exit $ac_status); } &&
4954          { ac_try='test -s conftest$ac_exeext'
4955   { (eval echo "$as_me:4955: \"$ac_try\"") >&5
4956   (eval $ac_try) 2>&5
4957   ac_status=$?
4958   echo "$as_me:4958: \$? = $ac_status" >&5
4959   (exit $ac_status); }; }; then
4960   ac_cv_func_initscr=yes
4961 else
4962   echo "$as_me: failed program was:" >&5
4963 cat conftest.$ac_ext >&5
4964 ac_cv_func_initscr=no
4965 fi
4966 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
4967 fi
4968 echo "$as_me:4968: result: $ac_cv_func_initscr" >&5
4969 echo "${ECHO_T}$ac_cv_func_initscr" >&6
4970 if test $ac_cv_func_initscr = yes; then
4971   eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
4972 else
4973
4974                 cf_save_LIBS="$LIBS"
4975                 echo "$as_me:4975: checking for initscr in -l$cf_nculib_root" >&5
4976 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
4977                 LIBS="-l$cf_nculib_root $LIBS"
4978                 cat >conftest.$ac_ext <<_ACEOF
4979 #line 4979 "configure"
4980 #include "confdefs.h"
4981 #include <${cf_cv_ncurses_header:-curses.h}>
4982 int
4983 main ()
4984 {
4985 initscr()
4986   ;
4987   return 0;
4988 }
4989 _ACEOF
4990 rm -f conftest.$ac_objext conftest$ac_exeext
4991 if { (eval echo "$as_me:4991: \"$ac_link\"") >&5
4992   (eval $ac_link) 2>&5
4993   ac_status=$?
4994   echo "$as_me:4994: \$? = $ac_status" >&5
4995   (exit $ac_status); } &&
4996          { ac_try='test -s conftest$ac_exeext'
4997   { (eval echo "$as_me:4997: \"$ac_try\"") >&5
4998   (eval $ac_try) 2>&5
4999   ac_status=$?
5000   echo "$as_me:5000: \$? = $ac_status" >&5
5001   (exit $ac_status); }; }; then
5002   echo "$as_me:5002: result: yes" >&5
5003 echo "${ECHO_T}yes" >&6
5004                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
5005
5006 else
5007   echo "$as_me: failed program was:" >&5
5008 cat conftest.$ac_ext >&5
5009 echo "$as_me:5009: result: no" >&5
5010 echo "${ECHO_T}no" >&6
5011
5012 cf_search=
5013 cf_library_path_list=""
5014 if test -n "${LDFLAGS}${LIBS}" ; then
5015         for cf_library_path in $LDFLAGS $LIBS
5016         do
5017                 case $cf_library_path in
5018                 (-L*)
5019                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
5020
5021 test "x$cf_library_path" != "xNONE" && \
5022 test -d "$cf_library_path" && \
5023  {
5024         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
5025         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
5026         test -d $cf_library_path/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
5027         test -d $cf_library_path/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
5028         test -d $cf_library_path/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
5029         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"
5030 }
5031
5032                         cf_library_path_list="$cf_library_path_list $cf_search"
5033                         ;;
5034                 esac
5035         done
5036 fi
5037
5038 cf_search=
5039
5040 test "x$prefix" != "xNONE" && \
5041 test -d "$prefix" && \
5042  {
5043         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
5044         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
5045         test -d $prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
5046         test -d $prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
5047         test -d $prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
5048         test -d $prefix/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
5049 }
5050
5051 for cf_subdir_prefix in \
5052         /usr \
5053         /usr/local \
5054         /usr/pkg \
5055         /opt \
5056         /opt/local \
5057         $HOME
5058 do
5059
5060 test "x$cf_subdir_prefix" != "x$prefix" && \
5061 test -d "$cf_subdir_prefix" && \
5062 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
5063         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
5064         test -d $cf_subdir_prefix/lib &&          cf_search="$cf_search $cf_subdir_prefix/lib"
5065         test -d $cf_subdir_prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root"
5066         test -d $cf_subdir_prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root/lib"
5067         test -d $cf_subdir_prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib"
5068         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"
5069 }
5070
5071 done
5072
5073 cf_search="$cf_library_path_list $cf_search"
5074
5075                         for cf_libdir in $cf_search
5076                         do
5077                                 echo "$as_me:5077: checking for -l$cf_nculib_root in $cf_libdir" >&5
5078 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
5079                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
5080                                 cat >conftest.$ac_ext <<_ACEOF
5081 #line 5081 "configure"
5082 #include "confdefs.h"
5083 #include <${cf_cv_ncurses_header:-curses.h}>
5084 int
5085 main ()
5086 {
5087 initscr()
5088   ;
5089   return 0;
5090 }
5091 _ACEOF
5092 rm -f conftest.$ac_objext conftest$ac_exeext
5093 if { (eval echo "$as_me:5093: \"$ac_link\"") >&5
5094   (eval $ac_link) 2>&5
5095   ac_status=$?
5096   echo "$as_me:5096: \$? = $ac_status" >&5
5097   (exit $ac_status); } &&
5098          { ac_try='test -s conftest$ac_exeext'
5099   { (eval echo "$as_me:5099: \"$ac_try\"") >&5
5100   (eval $ac_try) 2>&5
5101   ac_status=$?
5102   echo "$as_me:5102: \$? = $ac_status" >&5
5103   (exit $ac_status); }; }; then
5104   echo "$as_me:5104: result: yes" >&5
5105 echo "${ECHO_T}yes" >&6
5106                                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
5107                                          break
5108 else
5109   echo "$as_me: failed program was:" >&5
5110 cat conftest.$ac_ext >&5
5111 echo "$as_me:5111: result: no" >&5
5112 echo "${ECHO_T}no" >&6
5113                                          LIBS="$cf_save_LIBS"
5114 fi
5115 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5116                         done
5117
5118 fi
5119 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5120
5121 fi
5122
5123 eval 'cf_found_library=$cf_cv_have_lib_'$cf_nculib_root
5124
5125 if test $cf_found_library = no ; then
5126         { { echo "$as_me:5126: error: Cannot link $cf_nculib_root library" >&5
5127 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
5128    { (exit 1); exit 1; }; }
5129 fi
5130
5131 fi
5132
5133 if test -n "$cf_ncurses_LIBS" ; then
5134         echo "$as_me:5134: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
5135 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
5136         cf_ncurses_SAVE="$LIBS"
5137         for p in $cf_ncurses_LIBS ; do
5138                 q=`echo $LIBS | sed -e "s%$p %%" -e "s%$p$%%"`
5139                 if test "$q" != "$LIBS" ; then
5140                         LIBS="$q"
5141                 fi
5142         done
5143         cat >conftest.$ac_ext <<_ACEOF
5144 #line 5144 "configure"
5145 #include "confdefs.h"
5146 #include <${cf_cv_ncurses_header:-curses.h}>
5147 int
5148 main ()
5149 {
5150 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
5151   ;
5152   return 0;
5153 }
5154 _ACEOF
5155 rm -f conftest.$ac_objext conftest$ac_exeext
5156 if { (eval echo "$as_me:5156: \"$ac_link\"") >&5
5157   (eval $ac_link) 2>&5
5158   ac_status=$?
5159   echo "$as_me:5159: \$? = $ac_status" >&5
5160   (exit $ac_status); } &&
5161          { ac_try='test -s conftest$ac_exeext'
5162   { (eval echo "$as_me:5162: \"$ac_try\"") >&5
5163   (eval $ac_try) 2>&5
5164   ac_status=$?
5165   echo "$as_me:5165: \$? = $ac_status" >&5
5166   (exit $ac_status); }; }; then
5167   echo "$as_me:5167: result: yes" >&5
5168 echo "${ECHO_T}yes" >&6
5169 else
5170   echo "$as_me: failed program was:" >&5
5171 cat conftest.$ac_ext >&5
5172 echo "$as_me:5172: result: no" >&5
5173 echo "${ECHO_T}no" >&6
5174                  LIBS="$cf_ncurses_SAVE"
5175 fi
5176 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5177 fi
5178
5179 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
5180
5181 cat >>confdefs.h <<EOF
5182 #define $cf_nculib_ROOT 1
5183 EOF
5184
5185         fi
5186 else
5187         NCURSES_CONFIG=none
5188 fi
5189
5190 echo "$as_me:5190: checking if you want wide-character code" >&5
5191 echo $ECHO_N "checking if you want wide-character code... $ECHO_C" >&6
5192
5193 # Check whether --enable-widec or --disable-widec was given.
5194 if test "${enable_widec+set}" = set; then
5195   enableval="$enable_widec"
5196   with_widec=$enableval
5197 else
5198   with_widec=no
5199 fi;
5200 echo "$as_me:5200: result: $with_widec" >&5
5201 echo "${ECHO_T}$with_widec" >&6
5202 if test "$with_widec" = yes ; then
5203
5204 echo "$as_me:5204: checking for multibyte character support" >&5
5205 echo $ECHO_N "checking for multibyte character support... $ECHO_C" >&6
5206 if test "${cf_cv_utf8_lib+set}" = set; then
5207   echo $ECHO_N "(cached) $ECHO_C" >&6
5208 else
5209
5210         cf_save_LIBS="$LIBS"
5211         cat >conftest.$ac_ext <<_ACEOF
5212 #line 5212 "configure"
5213 #include "confdefs.h"
5214
5215 #include <stdlib.h>
5216 int
5217 main ()
5218 {
5219 putwc(0,0);
5220   ;
5221   return 0;
5222 }
5223 _ACEOF
5224 rm -f conftest.$ac_objext conftest$ac_exeext
5225 if { (eval echo "$as_me:5225: \"$ac_link\"") >&5
5226   (eval $ac_link) 2>&5
5227   ac_status=$?
5228   echo "$as_me:5228: \$? = $ac_status" >&5
5229   (exit $ac_status); } &&
5230          { ac_try='test -s conftest$ac_exeext'
5231   { (eval echo "$as_me:5231: \"$ac_try\"") >&5
5232   (eval $ac_try) 2>&5
5233   ac_status=$?
5234   echo "$as_me:5234: \$? = $ac_status" >&5
5235   (exit $ac_status); }; }; then
5236   cf_cv_utf8_lib=yes
5237 else
5238   echo "$as_me: failed program was:" >&5
5239 cat conftest.$ac_ext >&5
5240
5241 # If the linkage is not already in the $CPPFLAGS/$LDFLAGS configuration, these
5242 # will be set on completion of the AC_TRY_LINK below.
5243 cf_cv_header_path_utf8=
5244 cf_cv_library_path_utf8=
5245
5246 echo "${as_me:-configure}:5246: testing Starting FIND_LINKAGE(utf8,) ..." 1>&5
5247
5248 cf_save_LIBS="$LIBS"
5249
5250 cat >conftest.$ac_ext <<_ACEOF
5251 #line 5251 "configure"
5252 #include "confdefs.h"
5253
5254 #include <libutf8.h>
5255 int
5256 main ()
5257 {
5258 putwc(0,0);
5259   ;
5260   return 0;
5261 }
5262 _ACEOF
5263 rm -f conftest.$ac_objext conftest$ac_exeext
5264 if { (eval echo "$as_me:5264: \"$ac_link\"") >&5
5265   (eval $ac_link) 2>&5
5266   ac_status=$?
5267   echo "$as_me:5267: \$? = $ac_status" >&5
5268   (exit $ac_status); } &&
5269          { ac_try='test -s conftest$ac_exeext'
5270   { (eval echo "$as_me:5270: \"$ac_try\"") >&5
5271   (eval $ac_try) 2>&5
5272   ac_status=$?
5273   echo "$as_me:5273: \$? = $ac_status" >&5
5274   (exit $ac_status); }; }; then
5275
5276         cf_cv_find_linkage_utf8=yes
5277         cf_cv_header_path_utf8=/usr/include
5278         cf_cv_library_path_utf8=/usr/lib
5279
5280 else
5281   echo "$as_me: failed program was:" >&5
5282 cat conftest.$ac_ext >&5
5283
5284 LIBS="-lutf8  $cf_save_LIBS"
5285
5286 cat >conftest.$ac_ext <<_ACEOF
5287 #line 5287 "configure"
5288 #include "confdefs.h"
5289
5290 #include <libutf8.h>
5291 int
5292 main ()
5293 {
5294 putwc(0,0);
5295   ;
5296   return 0;
5297 }
5298 _ACEOF
5299 rm -f conftest.$ac_objext conftest$ac_exeext
5300 if { (eval echo "$as_me:5300: \"$ac_link\"") >&5
5301   (eval $ac_link) 2>&5
5302   ac_status=$?
5303   echo "$as_me:5303: \$? = $ac_status" >&5
5304   (exit $ac_status); } &&
5305          { ac_try='test -s conftest$ac_exeext'
5306   { (eval echo "$as_me:5306: \"$ac_try\"") >&5
5307   (eval $ac_try) 2>&5
5308   ac_status=$?
5309   echo "$as_me:5309: \$? = $ac_status" >&5
5310   (exit $ac_status); }; }; then
5311
5312         cf_cv_find_linkage_utf8=yes
5313         cf_cv_header_path_utf8=/usr/include
5314         cf_cv_library_path_utf8=/usr/lib
5315         cf_cv_library_file_utf8="-lutf8"
5316
5317 else
5318   echo "$as_me: failed program was:" >&5
5319 cat conftest.$ac_ext >&5
5320
5321         cf_cv_find_linkage_utf8=no
5322         LIBS="$cf_save_LIBS"
5323
5324         test -n "$verbose" && echo "    find linkage for utf8 library" 1>&6
5325
5326 echo "${as_me:-configure}:5326: testing find linkage for utf8 library ..." 1>&5
5327
5328 echo "${as_me:-configure}:5328: testing Searching for headers in FIND_LINKAGE(utf8,) ..." 1>&5
5329
5330         cf_save_CPPFLAGS="$CPPFLAGS"
5331         cf_test_CPPFLAGS="$CPPFLAGS"
5332
5333 cf_search=
5334
5335 # collect the current set of include-directories from compiler flags
5336 cf_header_path_list=""
5337 if test -n "${CFLAGS}${CPPFLAGS}" ; then
5338         for cf_header_path in $CPPFLAGS $CFLAGS
5339         do
5340                 case $cf_header_path in
5341                 (-I*)
5342                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
5343
5344 test "x$cf_header_path" != "xNONE" && \
5345 test -d "$cf_header_path" && \
5346  {
5347         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
5348         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
5349         test -d $cf_header_path/include/utf8 &&       cf_search="$cf_search $cf_header_path/include/utf8"
5350         test -d $cf_header_path/include/utf8/include &&    cf_search="$cf_search $cf_header_path/include/utf8/include"
5351         test -d $cf_header_path/utf8/include &&       cf_search="$cf_search $cf_header_path/utf8/include"
5352         test -d $cf_header_path/utf8/include/utf8 &&    cf_search="$cf_search $cf_header_path/utf8/include/utf8"
5353 }
5354
5355                         cf_header_path_list="$cf_header_path_list $cf_search"
5356                         ;;
5357                 esac
5358         done
5359 fi
5360
5361 # add the variations for the package we are looking for
5362
5363 cf_search=
5364
5365 test "x$prefix" != "xNONE" && \
5366 test -d "$prefix" && \
5367  {
5368         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
5369         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
5370         test -d $prefix/include/utf8 &&       cf_search="$cf_search $prefix/include/utf8"
5371         test -d $prefix/include/utf8/include &&    cf_search="$cf_search $prefix/include/utf8/include"
5372         test -d $prefix/utf8/include &&       cf_search="$cf_search $prefix/utf8/include"
5373         test -d $prefix/utf8/include/utf8 &&    cf_search="$cf_search $prefix/utf8/include/utf8"
5374 }
5375
5376 for cf_subdir_prefix in \
5377         /usr \
5378         /usr/local \
5379         /usr/pkg \
5380         /opt \
5381         /opt/local \
5382         $HOME
5383 do
5384
5385 test "x$cf_subdir_prefix" != "x$prefix" && \
5386 test -d "$cf_subdir_prefix" && \
5387 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
5388         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
5389         test -d $cf_subdir_prefix/include &&          cf_search="$cf_search $cf_subdir_prefix/include"
5390         test -d $cf_subdir_prefix/include/utf8 &&       cf_search="$cf_search $cf_subdir_prefix/include/utf8"
5391         test -d $cf_subdir_prefix/include/utf8/include &&    cf_search="$cf_search $cf_subdir_prefix/include/utf8/include"
5392         test -d $cf_subdir_prefix/utf8/include &&       cf_search="$cf_search $cf_subdir_prefix/utf8/include"
5393         test -d $cf_subdir_prefix/utf8/include/utf8 &&    cf_search="$cf_search $cf_subdir_prefix/utf8/include/utf8"
5394 }
5395
5396 done
5397
5398 test "$includedir" != NONE && \
5399 test "$includedir" != "/usr/include" && \
5400 test -d "$includedir" && {
5401         test -d $includedir &&    cf_search="$cf_search $includedir"
5402         test -d $includedir/utf8 && cf_search="$cf_search $includedir/utf8"
5403 }
5404
5405 test "$oldincludedir" != NONE && \
5406 test "$oldincludedir" != "/usr/include" && \
5407 test -d "$oldincludedir" && {
5408         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
5409         test -d $oldincludedir/utf8 && cf_search="$cf_search $oldincludedir/utf8"
5410 }
5411
5412 cf_search="$cf_search $cf_header_path_list"
5413
5414         for cf_cv_header_path_utf8 in $cf_search
5415         do
5416                 if test -d $cf_cv_header_path_utf8 ; then
5417                         test -n "$verbose" && echo "    ... testing $cf_cv_header_path_utf8" 1>&6
5418
5419 echo "${as_me:-configure}:5419: testing ... testing $cf_cv_header_path_utf8 ..." 1>&5
5420
5421                         CPPFLAGS="$cf_save_CPPFLAGS -I$cf_cv_header_path_utf8"
5422                         cat >conftest.$ac_ext <<_ACEOF
5423 #line 5423 "configure"
5424 #include "confdefs.h"
5425
5426 #include <libutf8.h>
5427 int
5428 main ()
5429 {
5430 putwc(0,0);
5431   ;
5432   return 0;
5433 }
5434 _ACEOF
5435 rm -f conftest.$ac_objext
5436 if { (eval echo "$as_me:5436: \"$ac_compile\"") >&5
5437   (eval $ac_compile) 2>&5
5438   ac_status=$?
5439   echo "$as_me:5439: \$? = $ac_status" >&5
5440   (exit $ac_status); } &&
5441          { ac_try='test -s conftest.$ac_objext'
5442   { (eval echo "$as_me:5442: \"$ac_try\"") >&5
5443   (eval $ac_try) 2>&5
5444   ac_status=$?
5445   echo "$as_me:5445: \$? = $ac_status" >&5
5446   (exit $ac_status); }; }; then
5447
5448                                 test -n "$verbose" && echo "    ... found utf8 headers in $cf_cv_header_path_utf8" 1>&6
5449
5450 echo "${as_me:-configure}:5450: testing ... found utf8 headers in $cf_cv_header_path_utf8 ..." 1>&5
5451
5452                                 cf_cv_find_linkage_utf8=maybe
5453                                 cf_test_CPPFLAGS="$CPPFLAGS"
5454                                 break
5455 else
5456   echo "$as_me: failed program was:" >&5
5457 cat conftest.$ac_ext >&5
5458
5459                                 CPPFLAGS="$cf_save_CPPFLAGS"
5460
5461 fi
5462 rm -f conftest.$ac_objext conftest.$ac_ext
5463                 fi
5464         done
5465
5466         if test "$cf_cv_find_linkage_utf8" = maybe ; then
5467
5468 echo "${as_me:-configure}:5468: testing Searching for utf8 library in FIND_LINKAGE(utf8,) ..." 1>&5
5469
5470                 cf_save_LIBS="$LIBS"
5471                 cf_save_LDFLAGS="$LDFLAGS"
5472
5473                 if test "$cf_cv_find_linkage_utf8" != yes ; then
5474
5475 cf_search=
5476 cf_library_path_list=""
5477 if test -n "${LDFLAGS}${LIBS}" ; then
5478         for cf_library_path in $LDFLAGS $LIBS
5479         do
5480                 case $cf_library_path in
5481                 (-L*)
5482                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
5483
5484 test "x$cf_library_path" != "xNONE" && \
5485 test -d "$cf_library_path" && \
5486  {
5487         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
5488         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
5489         test -d $cf_library_path/lib/utf8 &&       cf_search="$cf_search $cf_library_path/lib/utf8"
5490         test -d $cf_library_path/lib/utf8/lib &&    cf_search="$cf_search $cf_library_path/lib/utf8/lib"
5491         test -d $cf_library_path/utf8/lib &&       cf_search="$cf_search $cf_library_path/utf8/lib"
5492         test -d $cf_library_path/utf8/lib/utf8 &&    cf_search="$cf_search $cf_library_path/utf8/lib/utf8"
5493 }
5494
5495                         cf_library_path_list="$cf_library_path_list $cf_search"
5496                         ;;
5497                 esac
5498         done
5499 fi
5500
5501 cf_search=
5502
5503 test "x$prefix" != "xNONE" && \
5504 test -d "$prefix" && \
5505  {
5506         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
5507         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
5508         test -d $prefix/lib/utf8 &&       cf_search="$cf_search $prefix/lib/utf8"
5509         test -d $prefix/lib/utf8/lib &&    cf_search="$cf_search $prefix/lib/utf8/lib"
5510         test -d $prefix/utf8/lib &&       cf_search="$cf_search $prefix/utf8/lib"
5511         test -d $prefix/utf8/lib/utf8 &&    cf_search="$cf_search $prefix/utf8/lib/utf8"
5512 }
5513
5514 for cf_subdir_prefix in \
5515         /usr \
5516         /usr/local \
5517         /usr/pkg \
5518         /opt \
5519         /opt/local \
5520         $HOME
5521 do
5522
5523 test "x$cf_subdir_prefix" != "x$prefix" && \
5524 test -d "$cf_subdir_prefix" && \
5525 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
5526         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
5527         test -d $cf_subdir_prefix/lib &&          cf_search="$cf_search $cf_subdir_prefix/lib"
5528         test -d $cf_subdir_prefix/lib/utf8 &&       cf_search="$cf_search $cf_subdir_prefix/lib/utf8"
5529         test -d $cf_subdir_prefix/lib/utf8/lib &&    cf_search="$cf_search $cf_subdir_prefix/lib/utf8/lib"
5530         test -d $cf_subdir_prefix/utf8/lib &&       cf_search="$cf_search $cf_subdir_prefix/utf8/lib"
5531         test -d $cf_subdir_prefix/utf8/lib/utf8 &&    cf_search="$cf_search $cf_subdir_prefix/utf8/lib/utf8"
5532 }
5533
5534 done
5535
5536 cf_search="$cf_library_path_list $cf_search"
5537
5538                         for cf_cv_library_path_utf8 in $cf_search
5539                         do
5540                                 if test -d $cf_cv_library_path_utf8 ; then
5541                                         test -n "$verbose" && echo "    ... testing $cf_cv_library_path_utf8" 1>&6
5542
5543 echo "${as_me:-configure}:5543: testing ... testing $cf_cv_library_path_utf8 ..." 1>&5
5544
5545                                         CPPFLAGS="$cf_test_CPPFLAGS"
5546                                         LIBS="-lutf8  $cf_save_LIBS"
5547                                         LDFLAGS="$cf_save_LDFLAGS -L$cf_cv_library_path_utf8"
5548                                         cat >conftest.$ac_ext <<_ACEOF
5549 #line 5549 "configure"
5550 #include "confdefs.h"
5551
5552 #include <libutf8.h>
5553 int
5554 main ()
5555 {
5556 putwc(0,0);
5557   ;
5558   return 0;
5559 }
5560 _ACEOF
5561 rm -f conftest.$ac_objext conftest$ac_exeext
5562 if { (eval echo "$as_me:5562: \"$ac_link\"") >&5
5563   (eval $ac_link) 2>&5
5564   ac_status=$?
5565   echo "$as_me:5565: \$? = $ac_status" >&5
5566   (exit $ac_status); } &&
5567          { ac_try='test -s conftest$ac_exeext'
5568   { (eval echo "$as_me:5568: \"$ac_try\"") >&5
5569   (eval $ac_try) 2>&5
5570   ac_status=$?
5571   echo "$as_me:5571: \$? = $ac_status" >&5
5572   (exit $ac_status); }; }; then
5573
5574                                         test -n "$verbose" && echo "    ... found utf8 library in $cf_cv_library_path_utf8" 1>&6
5575
5576 echo "${as_me:-configure}:5576: testing ... found utf8 library in $cf_cv_library_path_utf8 ..." 1>&5
5577
5578                                         cf_cv_find_linkage_utf8=yes
5579                                         cf_cv_library_file_utf8="-lutf8"
5580                                         break
5581 else
5582   echo "$as_me: failed program was:" >&5
5583 cat conftest.$ac_ext >&5
5584
5585                                         CPPFLAGS="$cf_save_CPPFLAGS"
5586                                         LIBS="$cf_save_LIBS"
5587                                         LDFLAGS="$cf_save_LDFLAGS"
5588
5589 fi
5590 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5591                                 fi
5592                         done
5593                         CPPFLAGS="$cf_save_CPPFLAGS"
5594                         LDFLAGS="$cf_save_LDFLAGS"
5595                 fi
5596
5597         else
5598                 cf_cv_find_linkage_utf8=no
5599         fi
5600
5601 fi
5602 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5603
5604 fi
5605 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5606
5607 LIBS="$cf_save_LIBS"
5608
5609 if test "$cf_cv_find_linkage_utf8" = yes ; then
5610 cf_cv_utf8_lib=add-on
5611 else
5612 cf_cv_utf8_lib=no
5613 fi
5614
5615 fi
5616 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5617 fi
5618 echo "$as_me:5618: result: $cf_cv_utf8_lib" >&5
5619 echo "${ECHO_T}$cf_cv_utf8_lib" >&6
5620
5621 # HAVE_LIBUTF8_H is used by ncurses if curses.h is shared between
5622 # ncurses/ncursesw:
5623 if test "$cf_cv_utf8_lib" = "add-on" ; then
5624
5625 cat >>confdefs.h <<\EOF
5626 #define HAVE_LIBUTF8_H 1
5627 EOF
5628
5629 if test -n "$cf_cv_header_path_utf8" ; then
5630   for cf_add_incdir in $cf_cv_header_path_utf8
5631   do
5632         while test $cf_add_incdir != /usr/include
5633         do
5634           if test -d $cf_add_incdir
5635           then
5636                 cf_have_incdir=no
5637                 if test -n "$CFLAGS$CPPFLAGS" ; then
5638                   # a loop is needed to ensure we can add subdirs of existing dirs
5639                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
5640                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
5641                           cf_have_incdir=yes; break
5642                         fi
5643                   done
5644                 fi
5645
5646                 if test "$cf_have_incdir" = no ; then
5647                   if test "$cf_add_incdir" = /usr/local/include ; then
5648                         if test "$GCC" = yes
5649                         then
5650                           cf_save_CPPFLAGS=$CPPFLAGS
5651                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
5652                           cat >conftest.$ac_ext <<_ACEOF
5653 #line 5653 "configure"
5654 #include "confdefs.h"
5655 #include <stdio.h>
5656 int
5657 main ()
5658 {
5659 printf("Hello")
5660   ;
5661   return 0;
5662 }
5663 _ACEOF
5664 rm -f conftest.$ac_objext
5665 if { (eval echo "$as_me:5665: \"$ac_compile\"") >&5
5666   (eval $ac_compile) 2>&5
5667   ac_status=$?
5668   echo "$as_me:5668: \$? = $ac_status" >&5
5669   (exit $ac_status); } &&
5670          { ac_try='test -s conftest.$ac_objext'
5671   { (eval echo "$as_me:5671: \"$ac_try\"") >&5
5672   (eval $ac_try) 2>&5
5673   ac_status=$?
5674   echo "$as_me:5674: \$? = $ac_status" >&5
5675   (exit $ac_status); }; }; then
5676   :
5677 else
5678   echo "$as_me: failed program was:" >&5
5679 cat conftest.$ac_ext >&5
5680 cf_have_incdir=yes
5681 fi
5682 rm -f conftest.$ac_objext conftest.$ac_ext
5683                           CPPFLAGS=$cf_save_CPPFLAGS
5684                         fi
5685                   fi
5686                 fi
5687
5688                 if test "$cf_have_incdir" = no ; then
5689                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
5690
5691 echo "${as_me:-configure}:5691: testing adding $cf_add_incdir to include-path ..." 1>&5
5692
5693                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
5694
5695                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
5696                   test "$cf_top_incdir" = "$cf_add_incdir" && break
5697                   cf_add_incdir="$cf_top_incdir"
5698                 else
5699                   break
5700                 fi
5701           else
5702                 break
5703           fi
5704         done
5705   done
5706 fi
5707
5708 if test -n "$cf_cv_library_path_utf8" ; then
5709         for cf_add_libdir in $cf_cv_library_path_utf8
5710         do
5711                 if test $cf_add_libdir = /usr/lib ; then
5712                         :
5713                 elif test -d $cf_add_libdir
5714                 then
5715                         cf_have_libdir=no
5716                         if test -n "$LDFLAGS$LIBS" ; then
5717                                 # a loop is needed to ensure we can add subdirs of existing dirs
5718                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
5719                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
5720                                                 cf_have_libdir=yes; break
5721                                         fi
5722                                 done
5723                         fi
5724                         if test "$cf_have_libdir" = no ; then
5725                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
5726
5727 echo "${as_me:-configure}:5727: testing adding $cf_add_libdir to library-path ..." 1>&5
5728
5729                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
5730                         fi
5731                 fi
5732         done
5733 fi
5734
5735 cf_add_libs="$cf_cv_library_file_utf8"
5736 # Filter out duplicates - this happens with badly-designed ".pc" files...
5737 for cf_add_1lib in $LIBS
5738 do
5739         for cf_add_2lib in $cf_add_libs
5740         do
5741                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
5742                 then
5743                         cf_add_1lib=
5744                         break
5745                 fi
5746         done
5747         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
5748 done
5749 LIBS="$cf_add_libs"
5750
5751 fi
5752
5753 cf_ncuconfig_root=ncursesw
5754 cf_have_ncuconfig=no
5755
5756 if test "x${PKG_CONFIG:=none}" != xnone; then
5757         echo "$as_me:5757: checking pkg-config for $cf_ncuconfig_root" >&5
5758 echo $ECHO_N "checking pkg-config for $cf_ncuconfig_root... $ECHO_C" >&6
5759         if "$PKG_CONFIG" --exists $cf_ncuconfig_root ; then
5760                 echo "$as_me:5760: result: yes" >&5
5761 echo "${ECHO_T}yes" >&6
5762
5763                 echo "$as_me:5763: checking if the $cf_ncuconfig_root package files work" >&5
5764 echo $ECHO_N "checking if the $cf_ncuconfig_root package files work... $ECHO_C" >&6
5765                 cf_have_ncuconfig=unknown
5766
5767                 cf_save_CPPFLAGS="$CPPFLAGS"
5768                 cf_save_LIBS="$LIBS"
5769
5770                 CPPFLAGS="$CPPFLAGS `$PKG_CONFIG --cflags $cf_ncuconfig_root`"
5771
5772 cf_add_libs="`$PKG_CONFIG --libs $cf_ncuconfig_root`"
5773 # Filter out duplicates - this happens with badly-designed ".pc" files...
5774 for cf_add_1lib in $LIBS
5775 do
5776         for cf_add_2lib in $cf_add_libs
5777         do
5778                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
5779                 then
5780                         cf_add_1lib=
5781                         break
5782                 fi
5783         done
5784         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
5785 done
5786 LIBS="$cf_add_libs"
5787
5788                 cat >conftest.$ac_ext <<_ACEOF
5789 #line 5789 "configure"
5790 #include "confdefs.h"
5791 #include <${cf_cv_ncurses_header:-curses.h}>
5792 int
5793 main ()
5794 {
5795 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
5796   ;
5797   return 0;
5798 }
5799 _ACEOF
5800 rm -f conftest.$ac_objext conftest$ac_exeext
5801 if { (eval echo "$as_me:5801: \"$ac_link\"") >&5
5802   (eval $ac_link) 2>&5
5803   ac_status=$?
5804   echo "$as_me:5804: \$? = $ac_status" >&5
5805   (exit $ac_status); } &&
5806          { ac_try='test -s conftest$ac_exeext'
5807   { (eval echo "$as_me:5807: \"$ac_try\"") >&5
5808   (eval $ac_try) 2>&5
5809   ac_status=$?
5810   echo "$as_me:5810: \$? = $ac_status" >&5
5811   (exit $ac_status); }; }; then
5812   if test "$cross_compiling" = yes; then
5813   cf_have_ncuconfig=maybe
5814 else
5815   cat >conftest.$ac_ext <<_ACEOF
5816 #line 5816 "configure"
5817 #include "confdefs.h"
5818 #include <${cf_cv_ncurses_header:-curses.h}>
5819                                 int main(void)
5820                                 { char *xx = curses_version(); return (xx == 0); }
5821 _ACEOF
5822 rm -f conftest$ac_exeext
5823 if { (eval echo "$as_me:5823: \"$ac_link\"") >&5
5824   (eval $ac_link) 2>&5
5825   ac_status=$?
5826   echo "$as_me:5826: \$? = $ac_status" >&5
5827   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
5828   { (eval echo "$as_me:5828: \"$ac_try\"") >&5
5829   (eval $ac_try) 2>&5
5830   ac_status=$?
5831   echo "$as_me:5831: \$? = $ac_status" >&5
5832   (exit $ac_status); }; }; then
5833   cf_have_ncuconfig=yes
5834 else
5835   echo "$as_me: program exited with status $ac_status" >&5
5836 echo "$as_me: failed program was:" >&5
5837 cat conftest.$ac_ext >&5
5838 cf_have_ncuconfig=no
5839 fi
5840 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
5841 fi
5842 else
5843   echo "$as_me: failed program was:" >&5
5844 cat conftest.$ac_ext >&5
5845 cf_have_ncuconfig=no
5846 fi
5847 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5848                 echo "$as_me:5848: result: $cf_have_ncuconfig" >&5
5849 echo "${ECHO_T}$cf_have_ncuconfig" >&6
5850                 test "$cf_have_ncuconfig" = maybe && cf_have_ncuconfig=yes
5851                 if test "$cf_have_ncuconfig" != "yes"
5852                 then
5853                         CPPFLAGS="$cf_save_CPPFLAGS"
5854                         LIBS="$cf_save_LIBS"
5855                         NCURSES_CONFIG_PKG=none
5856                 else
5857
5858 cat >>confdefs.h <<\EOF
5859 #define NCURSES 1
5860 EOF
5861
5862                         NCURSES_CONFIG_PKG=$cf_ncuconfig_root
5863                 fi
5864
5865         else
5866                 echo "$as_me:5866: result: no" >&5
5867 echo "${ECHO_T}no" >&6
5868                 NCURSES_CONFIG_PKG=none
5869         fi
5870 else
5871         NCURSES_CONFIG_PKG=none
5872 fi
5873
5874 if test "x$cf_have_ncuconfig" = "xno"; then
5875         echo "Looking for ${cf_ncuconfig_root}-config"
5876
5877 if test -n "$ac_tool_prefix"; then
5878   for ac_prog in ${cf_ncuconfig_root}-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
5879   do
5880     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
5881 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
5882 echo "$as_me:5882: checking for $ac_word" >&5
5883 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
5884 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
5885   echo $ECHO_N "(cached) $ECHO_C" >&6
5886 else
5887   if test -n "$NCURSES_CONFIG"; then
5888   ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
5889 else
5890   ac_save_IFS=$IFS; IFS=$ac_path_separator
5891 ac_dummy="$PATH"
5892 for ac_dir in $ac_dummy; do
5893   IFS=$ac_save_IFS
5894   test -z "$ac_dir" && ac_dir=.
5895   $as_executable_p "$ac_dir/$ac_word" || continue
5896 ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
5897 echo "$as_me:5897: found $ac_dir/$ac_word" >&5
5898 break
5899 done
5900
5901 fi
5902 fi
5903 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
5904 if test -n "$NCURSES_CONFIG"; then
5905   echo "$as_me:5905: result: $NCURSES_CONFIG" >&5
5906 echo "${ECHO_T}$NCURSES_CONFIG" >&6
5907 else
5908   echo "$as_me:5908: result: no" >&5
5909 echo "${ECHO_T}no" >&6
5910 fi
5911
5912     test -n "$NCURSES_CONFIG" && break
5913   done
5914 fi
5915 if test -z "$NCURSES_CONFIG"; then
5916   ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
5917   for ac_prog in ${cf_ncuconfig_root}-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
5918 do
5919   # Extract the first word of "$ac_prog", so it can be a program name with args.
5920 set dummy $ac_prog; ac_word=$2
5921 echo "$as_me:5921: checking for $ac_word" >&5
5922 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
5923 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
5924   echo $ECHO_N "(cached) $ECHO_C" >&6
5925 else
5926   if test -n "$ac_ct_NCURSES_CONFIG"; then
5927   ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
5928 else
5929   ac_save_IFS=$IFS; IFS=$ac_path_separator
5930 ac_dummy="$PATH"
5931 for ac_dir in $ac_dummy; do
5932   IFS=$ac_save_IFS
5933   test -z "$ac_dir" && ac_dir=.
5934   $as_executable_p "$ac_dir/$ac_word" || continue
5935 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
5936 echo "$as_me:5936: found $ac_dir/$ac_word" >&5
5937 break
5938 done
5939
5940 fi
5941 fi
5942 ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
5943 if test -n "$ac_ct_NCURSES_CONFIG"; then
5944   echo "$as_me:5944: result: $ac_ct_NCURSES_CONFIG" >&5
5945 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
5946 else
5947   echo "$as_me:5947: result: no" >&5
5948 echo "${ECHO_T}no" >&6
5949 fi
5950
5951   test -n "$ac_ct_NCURSES_CONFIG" && break
5952 done
5953 test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
5954
5955   NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
5956 fi
5957
5958         if test "$NCURSES_CONFIG" != none ; then
5959
5960                 CPPFLAGS="$CPPFLAGS `$NCURSES_CONFIG --cflags`"
5961
5962 cf_add_libs="`$NCURSES_CONFIG --libs`"
5963 # Filter out duplicates - this happens with badly-designed ".pc" files...
5964 for cf_add_1lib in $LIBS
5965 do
5966         for cf_add_2lib in $cf_add_libs
5967         do
5968                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
5969                 then
5970                         cf_add_1lib=
5971                         break
5972                 fi
5973         done
5974         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
5975 done
5976 LIBS="$cf_add_libs"
5977
5978                 # even with config script, some packages use no-override for curses.h
5979
5980 echo "$as_me:5980: checking if we have identified curses headers" >&5
5981 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
5982 if test "${cf_cv_ncurses_header+set}" = set; then
5983   echo $ECHO_N "(cached) $ECHO_C" >&6
5984 else
5985
5986 cf_cv_ncurses_header=none
5987 for cf_header in \
5988         ncurses.h ncursesw/ncurses.h \
5989         curses.h ncursesw/curses.h
5990 do
5991 cat >conftest.$ac_ext <<_ACEOF
5992 #line 5992 "configure"
5993 #include "confdefs.h"
5994 #include <${cf_header}>
5995 int
5996 main ()
5997 {
5998 initscr(); tgoto("?", 0,0)
5999   ;
6000   return 0;
6001 }
6002 _ACEOF
6003 rm -f conftest.$ac_objext
6004 if { (eval echo "$as_me:6004: \"$ac_compile\"") >&5
6005   (eval $ac_compile) 2>&5
6006   ac_status=$?
6007   echo "$as_me:6007: \$? = $ac_status" >&5
6008   (exit $ac_status); } &&
6009          { ac_try='test -s conftest.$ac_objext'
6010   { (eval echo "$as_me:6010: \"$ac_try\"") >&5
6011   (eval $ac_try) 2>&5
6012   ac_status=$?
6013   echo "$as_me:6013: \$? = $ac_status" >&5
6014   (exit $ac_status); }; }; then
6015   cf_cv_ncurses_header=$cf_header; break
6016 else
6017   echo "$as_me: failed program was:" >&5
6018 cat conftest.$ac_ext >&5
6019 fi
6020 rm -f conftest.$ac_objext conftest.$ac_ext
6021 done
6022
6023 fi
6024 echo "$as_me:6024: result: $cf_cv_ncurses_header" >&5
6025 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
6026
6027 if test "$cf_cv_ncurses_header" = none ; then
6028         { { echo "$as_me:6028: error: No curses header-files found" >&5
6029 echo "$as_me: error: No curses header-files found" >&2;}
6030    { (exit 1); exit 1; }; }
6031 fi
6032
6033 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
6034
6035 for ac_header in $cf_cv_ncurses_header
6036 do
6037 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
6038 echo "$as_me:6038: checking for $ac_header" >&5
6039 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
6040 if eval "test \"\${$as_ac_Header+set}\" = set"; then
6041   echo $ECHO_N "(cached) $ECHO_C" >&6
6042 else
6043   cat >conftest.$ac_ext <<_ACEOF
6044 #line 6044 "configure"
6045 #include "confdefs.h"
6046 #include <$ac_header>
6047 _ACEOF
6048 if { (eval echo "$as_me:6048: \"$ac_cpp conftest.$ac_ext\"") >&5
6049   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
6050   ac_status=$?
6051   egrep -v '^ *\+' conftest.er1 >conftest.err
6052   rm -f conftest.er1
6053   cat conftest.err >&5
6054   echo "$as_me:6054: \$? = $ac_status" >&5
6055   (exit $ac_status); } >/dev/null; then
6056   if test -s conftest.err; then
6057     ac_cpp_err=$ac_c_preproc_warn_flag
6058   else
6059     ac_cpp_err=
6060   fi
6061 else
6062   ac_cpp_err=yes
6063 fi
6064 if test -z "$ac_cpp_err"; then
6065   eval "$as_ac_Header=yes"
6066 else
6067   echo "$as_me: failed program was:" >&5
6068   cat conftest.$ac_ext >&5
6069   eval "$as_ac_Header=no"
6070 fi
6071 rm -f conftest.err conftest.$ac_ext
6072 fi
6073 echo "$as_me:6073: result: `eval echo '${'$as_ac_Header'}'`" >&5
6074 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
6075 if test `eval echo '${'$as_ac_Header'}'` = yes; then
6076   cat >>confdefs.h <<EOF
6077 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
6078 EOF
6079
6080 fi
6081 done
6082
6083 cat >>confdefs.h <<\EOF
6084 #define NCURSES 1
6085 EOF
6086
6087 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
6088
6089                 cat >>confdefs.h <<EOF
6090 #define $cf_nculib_ROOT 1
6091 EOF
6092
6093                                 cf_cv_ncurses_version=`$NCURSES_CONFIG --version`
6094
6095         else
6096
6097 cf_ncuhdr_root=ncursesw
6098
6099 test -n "$cf_cv_curses_dir" && \
6100 test "$cf_cv_curses_dir" != "no" && { \
6101
6102 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
6103   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
6104   do
6105         while test $cf_add_incdir != /usr/include
6106         do
6107           if test -d $cf_add_incdir
6108           then
6109                 cf_have_incdir=no
6110                 if test -n "$CFLAGS$CPPFLAGS" ; then
6111                   # a loop is needed to ensure we can add subdirs of existing dirs
6112                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
6113                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
6114                           cf_have_incdir=yes; break
6115                         fi
6116                   done
6117                 fi
6118
6119                 if test "$cf_have_incdir" = no ; then
6120                   if test "$cf_add_incdir" = /usr/local/include ; then
6121                         if test "$GCC" = yes
6122                         then
6123                           cf_save_CPPFLAGS=$CPPFLAGS
6124                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6125                           cat >conftest.$ac_ext <<_ACEOF
6126 #line 6126 "configure"
6127 #include "confdefs.h"
6128 #include <stdio.h>
6129 int
6130 main ()
6131 {
6132 printf("Hello")
6133   ;
6134   return 0;
6135 }
6136 _ACEOF
6137 rm -f conftest.$ac_objext
6138 if { (eval echo "$as_me:6138: \"$ac_compile\"") >&5
6139   (eval $ac_compile) 2>&5
6140   ac_status=$?
6141   echo "$as_me:6141: \$? = $ac_status" >&5
6142   (exit $ac_status); } &&
6143          { ac_try='test -s conftest.$ac_objext'
6144   { (eval echo "$as_me:6144: \"$ac_try\"") >&5
6145   (eval $ac_try) 2>&5
6146   ac_status=$?
6147   echo "$as_me:6147: \$? = $ac_status" >&5
6148   (exit $ac_status); }; }; then
6149   :
6150 else
6151   echo "$as_me: failed program was:" >&5
6152 cat conftest.$ac_ext >&5
6153 cf_have_incdir=yes
6154 fi
6155 rm -f conftest.$ac_objext conftest.$ac_ext
6156                           CPPFLAGS=$cf_save_CPPFLAGS
6157                         fi
6158                   fi
6159                 fi
6160
6161                 if test "$cf_have_incdir" = no ; then
6162                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
6163
6164 echo "${as_me:-configure}:6164: testing adding $cf_add_incdir to include-path ..." 1>&5
6165
6166                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6167
6168                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
6169                   test "$cf_top_incdir" = "$cf_add_incdir" && break
6170                   cf_add_incdir="$cf_top_incdir"
6171                 else
6172                   break
6173                 fi
6174           else
6175                 break
6176           fi
6177         done
6178   done
6179 fi
6180
6181 }
6182
6183 echo "$as_me:6183: checking for $cf_ncuhdr_root header in include-path" >&5
6184 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
6185 if test "${cf_cv_ncurses_h+set}" = set; then
6186   echo $ECHO_N "(cached) $ECHO_C" >&6
6187 else
6188
6189         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
6190         ( test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw ) && cf_header_list="$cf_header_list curses.h ncurses.h"
6191         for cf_header in $cf_header_list
6192         do
6193
6194         cat >conftest.$ac_ext <<_ACEOF
6195 #line 6195 "configure"
6196 #include "confdefs.h"
6197
6198 #define _XOPEN_SOURCE_EXTENDED
6199 #undef  HAVE_LIBUTF8_H  /* in case we used CF_UTF8_LIB */
6200 #define HAVE_LIBUTF8_H  /* to force ncurses' header file to use cchar_t */
6201
6202 #include <$cf_header>
6203 int
6204 main ()
6205 {
6206
6207 #ifdef NCURSES_VERSION
6208
6209 #ifndef WACS_BSSB
6210         make an error
6211 #endif
6212
6213 printf("%s\n", NCURSES_VERSION);
6214 #else
6215 #ifdef __NCURSES_H
6216 printf("old\n");
6217 #else
6218         make an error
6219 #endif
6220 #endif
6221
6222   ;
6223   return 0;
6224 }
6225 _ACEOF
6226 rm -f conftest.$ac_objext
6227 if { (eval echo "$as_me:6227: \"$ac_compile\"") >&5
6228   (eval $ac_compile) 2>&5
6229   ac_status=$?
6230   echo "$as_me:6230: \$? = $ac_status" >&5
6231   (exit $ac_status); } &&
6232          { ac_try='test -s conftest.$ac_objext'
6233   { (eval echo "$as_me:6233: \"$ac_try\"") >&5
6234   (eval $ac_try) 2>&5
6235   ac_status=$?
6236   echo "$as_me:6236: \$? = $ac_status" >&5
6237   (exit $ac_status); }; }; then
6238   cf_cv_ncurses_h=$cf_header
6239
6240 else
6241   echo "$as_me: failed program was:" >&5
6242 cat conftest.$ac_ext >&5
6243 cf_cv_ncurses_h=no
6244 fi
6245 rm -f conftest.$ac_objext conftest.$ac_ext
6246
6247                 test "$cf_cv_ncurses_h" != no && break
6248         done
6249
6250 fi
6251 echo "$as_me:6251: result: $cf_cv_ncurses_h" >&5
6252 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
6253
6254 if test "$cf_cv_ncurses_h" != no ; then
6255         cf_cv_ncurses_header=$cf_cv_ncurses_h
6256 else
6257
6258 echo "$as_me:6258: checking for $cf_ncuhdr_root include-path" >&5
6259 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
6260 if test "${cf_cv_ncurses_h2+set}" = set; then
6261   echo $ECHO_N "(cached) $ECHO_C" >&6
6262 else
6263
6264         test -n "$verbose" && echo
6265
6266 cf_search=
6267
6268 # collect the current set of include-directories from compiler flags
6269 cf_header_path_list=""
6270 if test -n "${CFLAGS}${CPPFLAGS}" ; then
6271         for cf_header_path in $CPPFLAGS $CFLAGS
6272         do
6273                 case $cf_header_path in
6274                 (-I*)
6275                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
6276
6277 test "x$cf_header_path" != "xNONE" && \
6278 test -d "$cf_header_path" && \
6279  {
6280         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
6281         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
6282         test -d $cf_header_path/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
6283         test -d $cf_header_path/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
6284         test -d $cf_header_path/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
6285         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"
6286 }
6287
6288                         cf_header_path_list="$cf_header_path_list $cf_search"
6289                         ;;
6290                 esac
6291         done
6292 fi
6293
6294 # add the variations for the package we are looking for
6295
6296 cf_search=
6297
6298 test "x$prefix" != "xNONE" && \
6299 test -d "$prefix" && \
6300  {
6301         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
6302         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
6303         test -d $prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
6304         test -d $prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
6305         test -d $prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
6306         test -d $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
6307 }
6308
6309 for cf_subdir_prefix in \
6310         /usr \
6311         /usr/local \
6312         /usr/pkg \
6313         /opt \
6314         /opt/local \
6315         $HOME
6316 do
6317
6318 test "x$cf_subdir_prefix" != "x$prefix" && \
6319 test -d "$cf_subdir_prefix" && \
6320 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
6321         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
6322         test -d $cf_subdir_prefix/include &&          cf_search="$cf_search $cf_subdir_prefix/include"
6323         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root"
6324         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root/include"
6325         test -d $cf_subdir_prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include"
6326         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"
6327 }
6328
6329 done
6330
6331 test "$includedir" != NONE && \
6332 test "$includedir" != "/usr/include" && \
6333 test -d "$includedir" && {
6334         test -d $includedir &&    cf_search="$cf_search $includedir"
6335         test -d $includedir/$cf_ncuhdr_root && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
6336 }
6337
6338 test "$oldincludedir" != NONE && \
6339 test "$oldincludedir" != "/usr/include" && \
6340 test -d "$oldincludedir" && {
6341         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
6342         test -d $oldincludedir/$cf_ncuhdr_root && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
6343 }
6344
6345 cf_search="$cf_search $cf_header_path_list"
6346
6347         test -n "$verbose" && echo search path $cf_search
6348         cf_save2_CPPFLAGS="$CPPFLAGS"
6349         for cf_incdir in $cf_search
6350         do
6351
6352 if test -n "$cf_incdir" ; then
6353   for cf_add_incdir in $cf_incdir
6354   do
6355         while test $cf_add_incdir != /usr/include
6356         do
6357           if test -d $cf_add_incdir
6358           then
6359                 cf_have_incdir=no
6360                 if test -n "$CFLAGS$CPPFLAGS" ; then
6361                   # a loop is needed to ensure we can add subdirs of existing dirs
6362                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
6363                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
6364                           cf_have_incdir=yes; break
6365                         fi
6366                   done
6367                 fi
6368
6369                 if test "$cf_have_incdir" = no ; then
6370                   if test "$cf_add_incdir" = /usr/local/include ; then
6371                         if test "$GCC" = yes
6372                         then
6373                           cf_save_CPPFLAGS=$CPPFLAGS
6374                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6375                           cat >conftest.$ac_ext <<_ACEOF
6376 #line 6376 "configure"
6377 #include "confdefs.h"
6378 #include <stdio.h>
6379 int
6380 main ()
6381 {
6382 printf("Hello")
6383   ;
6384   return 0;
6385 }
6386 _ACEOF
6387 rm -f conftest.$ac_objext
6388 if { (eval echo "$as_me:6388: \"$ac_compile\"") >&5
6389   (eval $ac_compile) 2>&5
6390   ac_status=$?
6391   echo "$as_me:6391: \$? = $ac_status" >&5
6392   (exit $ac_status); } &&
6393          { ac_try='test -s conftest.$ac_objext'
6394   { (eval echo "$as_me:6394: \"$ac_try\"") >&5
6395   (eval $ac_try) 2>&5
6396   ac_status=$?
6397   echo "$as_me:6397: \$? = $ac_status" >&5
6398   (exit $ac_status); }; }; then
6399   :
6400 else
6401   echo "$as_me: failed program was:" >&5
6402 cat conftest.$ac_ext >&5
6403 cf_have_incdir=yes
6404 fi
6405 rm -f conftest.$ac_objext conftest.$ac_ext
6406                           CPPFLAGS=$cf_save_CPPFLAGS
6407                         fi
6408                   fi
6409                 fi
6410
6411                 if test "$cf_have_incdir" = no ; then
6412                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
6413
6414 echo "${as_me:-configure}:6414: testing adding $cf_add_incdir to include-path ..." 1>&5
6415
6416                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6417
6418                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
6419                   test "$cf_top_incdir" = "$cf_add_incdir" && break
6420                   cf_add_incdir="$cf_top_incdir"
6421                 else
6422                   break
6423                 fi
6424           else
6425                 break
6426           fi
6427         done
6428   done
6429 fi
6430
6431                 for cf_header in \
6432                         ncurses.h \
6433                         curses.h
6434                 do
6435
6436         cat >conftest.$ac_ext <<_ACEOF
6437 #line 6437 "configure"
6438 #include "confdefs.h"
6439
6440 #include <$cf_header>
6441 int
6442 main ()
6443 {
6444
6445 #ifdef NCURSES_VERSION
6446
6447 printf("%s\n", NCURSES_VERSION);
6448 #else
6449 #ifdef __NCURSES_H
6450 printf("old\n");
6451 #else
6452         make an error
6453 #endif
6454 #endif
6455
6456   ;
6457   return 0;
6458 }
6459 _ACEOF
6460 rm -f conftest.$ac_objext
6461 if { (eval echo "$as_me:6461: \"$ac_compile\"") >&5
6462   (eval $ac_compile) 2>&5
6463   ac_status=$?
6464   echo "$as_me:6464: \$? = $ac_status" >&5
6465   (exit $ac_status); } &&
6466          { ac_try='test -s conftest.$ac_objext'
6467   { (eval echo "$as_me:6467: \"$ac_try\"") >&5
6468   (eval $ac_try) 2>&5
6469   ac_status=$?
6470   echo "$as_me:6470: \$? = $ac_status" >&5
6471   (exit $ac_status); }; }; then
6472   cf_cv_ncurses_h2=$cf_header
6473
6474 else
6475   echo "$as_me: failed program was:" >&5
6476 cat conftest.$ac_ext >&5
6477 cf_cv_ncurses_h2=no
6478 fi
6479 rm -f conftest.$ac_objext conftest.$ac_ext
6480
6481                         if test "$cf_cv_ncurses_h2" != no ; then
6482                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
6483                                 test -n "$verbose" && echo $ac_n "      ... found $ac_c" 1>&6
6484                                 break
6485                         fi
6486                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
6487                 done
6488                 CPPFLAGS="$cf_save2_CPPFLAGS"
6489                 test "$cf_cv_ncurses_h2" != no && break
6490         done
6491         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:6491: error: not found" >&5
6492 echo "$as_me: error: not found" >&2;}
6493    { (exit 1); exit 1; }; }
6494
6495 fi
6496 echo "$as_me:6496: result: $cf_cv_ncurses_h2" >&5
6497 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
6498
6499         cf_1st_incdir=`echo $cf_cv_ncurses_h2 | sed -e 's%/[^/]*$%%'`
6500         cf_cv_ncurses_header=`basename $cf_cv_ncurses_h2`
6501         if test `basename $cf_1st_incdir` = $cf_ncuhdr_root ; then
6502                 cf_cv_ncurses_header=$cf_ncuhdr_root/$cf_cv_ncurses_header
6503         fi
6504
6505 if test -n "$cf_1st_incdir" ; then
6506   for cf_add_incdir in $cf_1st_incdir
6507   do
6508         while test $cf_add_incdir != /usr/include
6509         do
6510           if test -d $cf_add_incdir
6511           then
6512                 cf_have_incdir=no
6513                 if test -n "$CFLAGS$CPPFLAGS" ; then
6514                   # a loop is needed to ensure we can add subdirs of existing dirs
6515                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
6516                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
6517                           cf_have_incdir=yes; break
6518                         fi
6519                   done
6520                 fi
6521
6522                 if test "$cf_have_incdir" = no ; then
6523                   if test "$cf_add_incdir" = /usr/local/include ; then
6524                         if test "$GCC" = yes
6525                         then
6526                           cf_save_CPPFLAGS=$CPPFLAGS
6527                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6528                           cat >conftest.$ac_ext <<_ACEOF
6529 #line 6529 "configure"
6530 #include "confdefs.h"
6531 #include <stdio.h>
6532 int
6533 main ()
6534 {
6535 printf("Hello")
6536   ;
6537   return 0;
6538 }
6539 _ACEOF
6540 rm -f conftest.$ac_objext
6541 if { (eval echo "$as_me:6541: \"$ac_compile\"") >&5
6542   (eval $ac_compile) 2>&5
6543   ac_status=$?
6544   echo "$as_me:6544: \$? = $ac_status" >&5
6545   (exit $ac_status); } &&
6546          { ac_try='test -s conftest.$ac_objext'
6547   { (eval echo "$as_me:6547: \"$ac_try\"") >&5
6548   (eval $ac_try) 2>&5
6549   ac_status=$?
6550   echo "$as_me:6550: \$? = $ac_status" >&5
6551   (exit $ac_status); }; }; then
6552   :
6553 else
6554   echo "$as_me: failed program was:" >&5
6555 cat conftest.$ac_ext >&5
6556 cf_have_incdir=yes
6557 fi
6558 rm -f conftest.$ac_objext conftest.$ac_ext
6559                           CPPFLAGS=$cf_save_CPPFLAGS
6560                         fi
6561                   fi
6562                 fi
6563
6564                 if test "$cf_have_incdir" = no ; then
6565                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
6566
6567 echo "${as_me:-configure}:6567: testing adding $cf_add_incdir to include-path ..." 1>&5
6568
6569                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6570
6571                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
6572                   test "$cf_top_incdir" = "$cf_add_incdir" && break
6573                   cf_add_incdir="$cf_top_incdir"
6574                 else
6575                   break
6576                 fi
6577           else
6578                 break
6579           fi
6580         done
6581   done
6582 fi
6583
6584 fi
6585
6586 # Set definitions to allow ifdef'ing for ncurses.h
6587
6588 case $cf_cv_ncurses_header in
6589 (*ncurses.h)
6590
6591 cat >>confdefs.h <<\EOF
6592 #define HAVE_NCURSES_H 1
6593 EOF
6594
6595         ;;
6596 esac
6597
6598 case $cf_cv_ncurses_header in
6599 (ncurses/curses.h|ncurses/ncurses.h)
6600
6601 cat >>confdefs.h <<\EOF
6602 #define HAVE_NCURSES_NCURSES_H 1
6603 EOF
6604
6605         ;;
6606 (ncursesw/curses.h|ncursesw/ncurses.h)
6607
6608 cat >>confdefs.h <<\EOF
6609 #define HAVE_NCURSESW_NCURSES_H 1
6610 EOF
6611
6612         ;;
6613 esac
6614
6615 echo "$as_me:6615: checking for terminfo header" >&5
6616 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
6617 if test "${cf_cv_term_header+set}" = set; then
6618   echo $ECHO_N "(cached) $ECHO_C" >&6
6619 else
6620
6621 case ${cf_cv_ncurses_header} in
6622 (*/ncurses.h|*/ncursesw.h)
6623         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
6624         ;;
6625 (*)
6626         cf_term_header=term.h
6627         ;;
6628 esac
6629
6630 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
6631 do
6632 cat >conftest.$ac_ext <<_ACEOF
6633 #line 6633 "configure"
6634 #include "confdefs.h"
6635 #include <stdio.h>
6636 #include <${cf_cv_ncurses_header:-curses.h}>
6637 #include <$cf_test>
6638
6639 int
6640 main ()
6641 {
6642 int x = auto_left_margin
6643   ;
6644   return 0;
6645 }
6646 _ACEOF
6647 rm -f conftest.$ac_objext
6648 if { (eval echo "$as_me:6648: \"$ac_compile\"") >&5
6649   (eval $ac_compile) 2>&5
6650   ac_status=$?
6651   echo "$as_me:6651: \$? = $ac_status" >&5
6652   (exit $ac_status); } &&
6653          { ac_try='test -s conftest.$ac_objext'
6654   { (eval echo "$as_me:6654: \"$ac_try\"") >&5
6655   (eval $ac_try) 2>&5
6656   ac_status=$?
6657   echo "$as_me:6657: \$? = $ac_status" >&5
6658   (exit $ac_status); }; }; then
6659
6660         cf_cv_term_header="$cf_test"
6661 else
6662   echo "$as_me: failed program was:" >&5
6663 cat conftest.$ac_ext >&5
6664
6665         cf_cv_term_header=unknown
6666
6667 fi
6668 rm -f conftest.$ac_objext conftest.$ac_ext
6669         test "$cf_cv_term_header" != unknown && break
6670 done
6671
6672 fi
6673 echo "$as_me:6673: result: $cf_cv_term_header" >&5
6674 echo "${ECHO_T}$cf_cv_term_header" >&6
6675
6676 # Set definitions to allow ifdef'ing to accommodate subdirectories
6677
6678 case $cf_cv_term_header in
6679 (*term.h)
6680
6681 cat >>confdefs.h <<\EOF
6682 #define HAVE_TERM_H 1
6683 EOF
6684
6685         ;;
6686 esac
6687
6688 case $cf_cv_term_header in
6689 (ncurses/term.h)
6690
6691 cat >>confdefs.h <<\EOF
6692 #define HAVE_NCURSES_TERM_H 1
6693 EOF
6694
6695         ;;
6696 (ncursesw/term.h)
6697
6698 cat >>confdefs.h <<\EOF
6699 #define HAVE_NCURSESW_TERM_H 1
6700 EOF
6701
6702         ;;
6703 esac
6704
6705 # some applications need this, but should check for NCURSES_VERSION
6706
6707 cat >>confdefs.h <<\EOF
6708 #define NCURSES 1
6709 EOF
6710
6711 echo "$as_me:6711: checking for ncurses version" >&5
6712 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
6713 if test "${cf_cv_ncurses_version+set}" = set; then
6714   echo $ECHO_N "(cached) $ECHO_C" >&6
6715 else
6716
6717         cf_cv_ncurses_version=no
6718         cf_tempfile=out$$
6719         rm -f $cf_tempfile
6720         if test "$cross_compiling" = yes; then
6721
6722         # This will not work if the preprocessor splits the line after the
6723         # Autoconf token.  The 'unproto' program does that.
6724         cat > conftest.$ac_ext <<EOF
6725 #include <${cf_cv_ncurses_header:-curses.h}>
6726 #undef Autoconf
6727 #ifdef NCURSES_VERSION
6728 Autoconf NCURSES_VERSION
6729 #else
6730 #ifdef __NCURSES_H
6731 Autoconf "old"
6732 #endif
6733 ;
6734 #endif
6735 EOF
6736         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
6737         { (eval echo "$as_me:6737: \"$cf_try\"") >&5
6738   (eval $cf_try) 2>&5
6739   ac_status=$?
6740   echo "$as_me:6740: \$? = $ac_status" >&5
6741   (exit $ac_status); }
6742         if test -f conftest.out ; then
6743                 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
6744                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
6745                 rm -f conftest.out
6746         fi
6747
6748 else
6749   cat >conftest.$ac_ext <<_ACEOF
6750 #line 6750 "configure"
6751 #include "confdefs.h"
6752
6753 #include <${cf_cv_ncurses_header:-curses.h}>
6754 #include <stdio.h>
6755 int main()
6756 {
6757         FILE *fp = fopen("$cf_tempfile", "w");
6758 #ifdef NCURSES_VERSION
6759 # ifdef NCURSES_VERSION_PATCH
6760         fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
6761 # else
6762         fprintf(fp, "%s\n", NCURSES_VERSION);
6763 # endif
6764 #else
6765 # ifdef __NCURSES_H
6766         fprintf(fp, "old\n");
6767 # else
6768         make an error
6769 # endif
6770 #endif
6771         ${cf_cv_main_return:-return}(0);
6772 }
6773 _ACEOF
6774 rm -f conftest$ac_exeext
6775 if { (eval echo "$as_me:6775: \"$ac_link\"") >&5
6776   (eval $ac_link) 2>&5
6777   ac_status=$?
6778   echo "$as_me:6778: \$? = $ac_status" >&5
6779   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
6780   { (eval echo "$as_me:6780: \"$ac_try\"") >&5
6781   (eval $ac_try) 2>&5
6782   ac_status=$?
6783   echo "$as_me:6783: \$? = $ac_status" >&5
6784   (exit $ac_status); }; }; then
6785
6786         cf_cv_ncurses_version=`cat $cf_tempfile`
6787 else
6788   echo "$as_me: program exited with status $ac_status" >&5
6789 echo "$as_me: failed program was:" >&5
6790 cat conftest.$ac_ext >&5
6791 fi
6792 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
6793 fi
6794         rm -f $cf_tempfile
6795
6796 fi
6797 echo "$as_me:6797: result: $cf_cv_ncurses_version" >&5
6798 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
6799 test "$cf_cv_ncurses_version" = no ||
6800 cat >>confdefs.h <<\EOF
6801 #define NCURSES 1
6802 EOF
6803
6804 cf_nculib_root=ncursesw
6805         # This works, except for the special case where we find gpm, but
6806         # ncurses is in a nonstandard location via $LIBS, and we really want
6807         # to link gpm.
6808 cf_ncurses_LIBS=""
6809 cf_ncurses_SAVE="$LIBS"
6810 echo "$as_me:6810: checking for Gpm_Open in -lgpm" >&5
6811 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
6812 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
6813   echo $ECHO_N "(cached) $ECHO_C" >&6
6814 else
6815   ac_check_lib_save_LIBS=$LIBS
6816 LIBS="-lgpm  $LIBS"
6817 cat >conftest.$ac_ext <<_ACEOF
6818 #line 6818 "configure"
6819 #include "confdefs.h"
6820
6821 /* Override any gcc2 internal prototype to avoid an error.  */
6822 #ifdef __cplusplus
6823 extern "C"
6824 #endif
6825 /* We use char because int might match the return type of a gcc2
6826    builtin and then its argument prototype would still apply.  */
6827 char Gpm_Open ();
6828 int
6829 main ()
6830 {
6831 Gpm_Open ();
6832   ;
6833   return 0;
6834 }
6835 _ACEOF
6836 rm -f conftest.$ac_objext conftest$ac_exeext
6837 if { (eval echo "$as_me:6837: \"$ac_link\"") >&5
6838   (eval $ac_link) 2>&5
6839   ac_status=$?
6840   echo "$as_me:6840: \$? = $ac_status" >&5
6841   (exit $ac_status); } &&
6842          { ac_try='test -s conftest$ac_exeext'
6843   { (eval echo "$as_me:6843: \"$ac_try\"") >&5
6844   (eval $ac_try) 2>&5
6845   ac_status=$?
6846   echo "$as_me:6846: \$? = $ac_status" >&5
6847   (exit $ac_status); }; }; then
6848   ac_cv_lib_gpm_Gpm_Open=yes
6849 else
6850   echo "$as_me: failed program was:" >&5
6851 cat conftest.$ac_ext >&5
6852 ac_cv_lib_gpm_Gpm_Open=no
6853 fi
6854 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6855 LIBS=$ac_check_lib_save_LIBS
6856 fi
6857 echo "$as_me:6857: result: $ac_cv_lib_gpm_Gpm_Open" >&5
6858 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
6859 if test $ac_cv_lib_gpm_Gpm_Open = yes; then
6860   echo "$as_me:6860: checking for initscr in -lgpm" >&5
6861 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
6862 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
6863   echo $ECHO_N "(cached) $ECHO_C" >&6
6864 else
6865   ac_check_lib_save_LIBS=$LIBS
6866 LIBS="-lgpm  $LIBS"
6867 cat >conftest.$ac_ext <<_ACEOF
6868 #line 6868 "configure"
6869 #include "confdefs.h"
6870
6871 /* Override any gcc2 internal prototype to avoid an error.  */
6872 #ifdef __cplusplus
6873 extern "C"
6874 #endif
6875 /* We use char because int might match the return type of a gcc2
6876    builtin and then its argument prototype would still apply.  */
6877 char initscr ();
6878 int
6879 main ()
6880 {
6881 initscr ();
6882   ;
6883   return 0;
6884 }
6885 _ACEOF
6886 rm -f conftest.$ac_objext conftest$ac_exeext
6887 if { (eval echo "$as_me:6887: \"$ac_link\"") >&5
6888   (eval $ac_link) 2>&5
6889   ac_status=$?
6890   echo "$as_me:6890: \$? = $ac_status" >&5
6891   (exit $ac_status); } &&
6892          { ac_try='test -s conftest$ac_exeext'
6893   { (eval echo "$as_me:6893: \"$ac_try\"") >&5
6894   (eval $ac_try) 2>&5
6895   ac_status=$?
6896   echo "$as_me:6896: \$? = $ac_status" >&5
6897   (exit $ac_status); }; }; then
6898   ac_cv_lib_gpm_initscr=yes
6899 else
6900   echo "$as_me: failed program was:" >&5
6901 cat conftest.$ac_ext >&5
6902 ac_cv_lib_gpm_initscr=no
6903 fi
6904 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6905 LIBS=$ac_check_lib_save_LIBS
6906 fi
6907 echo "$as_me:6907: result: $ac_cv_lib_gpm_initscr" >&5
6908 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
6909 if test $ac_cv_lib_gpm_initscr = yes; then
6910   LIBS="$cf_ncurses_SAVE"
6911 else
6912   cf_ncurses_LIBS="-lgpm"
6913 fi
6914
6915 fi
6916
6917 case $host_os in
6918 (freebsd*)
6919         # This is only necessary if you are linking against an obsolete
6920         # version of ncurses (but it should do no harm, since it's static).
6921         if test "$cf_nculib_root" = ncurses ; then
6922                 echo "$as_me:6922: checking for tgoto in -lmytinfo" >&5
6923 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
6924 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
6925   echo $ECHO_N "(cached) $ECHO_C" >&6
6926 else
6927   ac_check_lib_save_LIBS=$LIBS
6928 LIBS="-lmytinfo  $LIBS"
6929 cat >conftest.$ac_ext <<_ACEOF
6930 #line 6930 "configure"
6931 #include "confdefs.h"
6932
6933 /* Override any gcc2 internal prototype to avoid an error.  */
6934 #ifdef __cplusplus
6935 extern "C"
6936 #endif
6937 /* We use char because int might match the return type of a gcc2
6938    builtin and then its argument prototype would still apply.  */
6939 char tgoto ();
6940 int
6941 main ()
6942 {
6943 tgoto ();
6944   ;
6945   return 0;
6946 }
6947 _ACEOF
6948 rm -f conftest.$ac_objext conftest$ac_exeext
6949 if { (eval echo "$as_me:6949: \"$ac_link\"") >&5
6950   (eval $ac_link) 2>&5
6951   ac_status=$?
6952   echo "$as_me:6952: \$? = $ac_status" >&5
6953   (exit $ac_status); } &&
6954          { ac_try='test -s conftest$ac_exeext'
6955   { (eval echo "$as_me:6955: \"$ac_try\"") >&5
6956   (eval $ac_try) 2>&5
6957   ac_status=$?
6958   echo "$as_me:6958: \$? = $ac_status" >&5
6959   (exit $ac_status); }; }; then
6960   ac_cv_lib_mytinfo_tgoto=yes
6961 else
6962   echo "$as_me: failed program was:" >&5
6963 cat conftest.$ac_ext >&5
6964 ac_cv_lib_mytinfo_tgoto=no
6965 fi
6966 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6967 LIBS=$ac_check_lib_save_LIBS
6968 fi
6969 echo "$as_me:6969: result: $ac_cv_lib_mytinfo_tgoto" >&5
6970 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
6971 if test $ac_cv_lib_mytinfo_tgoto = yes; then
6972   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
6973 fi
6974
6975         fi
6976         ;;
6977 esac
6978
6979 cf_add_libs="$cf_ncurses_LIBS"
6980 # Filter out duplicates - this happens with badly-designed ".pc" files...
6981 for cf_add_1lib in $LIBS
6982 do
6983         for cf_add_2lib in $cf_add_libs
6984         do
6985                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
6986                 then
6987                         cf_add_1lib=
6988                         break
6989                 fi
6990         done
6991         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
6992 done
6993 LIBS="$cf_add_libs"
6994
6995 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
6996 then
6997
6998 cf_add_libs="-l$cf_nculib_root"
6999 # Filter out duplicates - this happens with badly-designed ".pc" files...
7000 for cf_add_1lib in $LIBS
7001 do
7002         for cf_add_2lib in $cf_add_libs
7003         do
7004                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
7005                 then
7006                         cf_add_1lib=
7007                         break
7008                 fi
7009         done
7010         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
7011 done
7012 LIBS="$cf_add_libs"
7013
7014 else
7015
7016         eval 'cf_cv_have_lib_'$cf_nculib_root'=no'
7017         cf_libdir=""
7018         echo "$as_me:7018: checking for initscr" >&5
7019 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
7020 if test "${ac_cv_func_initscr+set}" = set; then
7021   echo $ECHO_N "(cached) $ECHO_C" >&6
7022 else
7023   cat >conftest.$ac_ext <<_ACEOF
7024 #line 7024 "configure"
7025 #include "confdefs.h"
7026 /* System header to define __stub macros and hopefully few prototypes,
7027     which can conflict with char initscr (); below.  */
7028 #include <assert.h>
7029 /* Override any gcc2 internal prototype to avoid an error.  */
7030 #ifdef __cplusplus
7031 extern "C"
7032 #endif
7033 /* We use char because int might match the return type of a gcc2
7034    builtin and then its argument prototype would still apply.  */
7035 char initscr ();
7036 char (*f) ();
7037
7038 int
7039 main ()
7040 {
7041 /* The GNU C library defines this for functions which it implements
7042     to always fail with ENOSYS.  Some functions are actually named
7043     something starting with __ and the normal name is an alias.  */
7044 #if defined (__stub_initscr) || defined (__stub___initscr)
7045 choke me
7046 #else
7047 f = initscr; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
7048 #endif
7049
7050   ;
7051   return 0;
7052 }
7053 _ACEOF
7054 rm -f conftest.$ac_objext conftest$ac_exeext
7055 if { (eval echo "$as_me:7055: \"$ac_link\"") >&5
7056   (eval $ac_link) 2>&5
7057   ac_status=$?
7058   echo "$as_me:7058: \$? = $ac_status" >&5
7059   (exit $ac_status); } &&
7060          { ac_try='test -s conftest$ac_exeext'
7061   { (eval echo "$as_me:7061: \"$ac_try\"") >&5
7062   (eval $ac_try) 2>&5
7063   ac_status=$?
7064   echo "$as_me:7064: \$? = $ac_status" >&5
7065   (exit $ac_status); }; }; then
7066   ac_cv_func_initscr=yes
7067 else
7068   echo "$as_me: failed program was:" >&5
7069 cat conftest.$ac_ext >&5
7070 ac_cv_func_initscr=no
7071 fi
7072 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7073 fi
7074 echo "$as_me:7074: result: $ac_cv_func_initscr" >&5
7075 echo "${ECHO_T}$ac_cv_func_initscr" >&6
7076 if test $ac_cv_func_initscr = yes; then
7077   eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
7078 else
7079
7080                 cf_save_LIBS="$LIBS"
7081                 echo "$as_me:7081: checking for initscr in -l$cf_nculib_root" >&5
7082 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
7083                 LIBS="-l$cf_nculib_root $LIBS"
7084                 cat >conftest.$ac_ext <<_ACEOF
7085 #line 7085 "configure"
7086 #include "confdefs.h"
7087 #include <${cf_cv_ncurses_header:-curses.h}>
7088 int
7089 main ()
7090 {
7091 initscr()
7092   ;
7093   return 0;
7094 }
7095 _ACEOF
7096 rm -f conftest.$ac_objext conftest$ac_exeext
7097 if { (eval echo "$as_me:7097: \"$ac_link\"") >&5
7098   (eval $ac_link) 2>&5
7099   ac_status=$?
7100   echo "$as_me:7100: \$? = $ac_status" >&5
7101   (exit $ac_status); } &&
7102          { ac_try='test -s conftest$ac_exeext'
7103   { (eval echo "$as_me:7103: \"$ac_try\"") >&5
7104   (eval $ac_try) 2>&5
7105   ac_status=$?
7106   echo "$as_me:7106: \$? = $ac_status" >&5
7107   (exit $ac_status); }; }; then
7108   echo "$as_me:7108: result: yes" >&5
7109 echo "${ECHO_T}yes" >&6
7110                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
7111
7112 else
7113   echo "$as_me: failed program was:" >&5
7114 cat conftest.$ac_ext >&5
7115 echo "$as_me:7115: result: no" >&5
7116 echo "${ECHO_T}no" >&6
7117
7118 cf_search=
7119 cf_library_path_list=""
7120 if test -n "${LDFLAGS}${LIBS}" ; then
7121         for cf_library_path in $LDFLAGS $LIBS
7122         do
7123                 case $cf_library_path in
7124                 (-L*)
7125                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
7126
7127 test "x$cf_library_path" != "xNONE" && \
7128 test -d "$cf_library_path" && \
7129  {
7130         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
7131         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
7132         test -d $cf_library_path/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
7133         test -d $cf_library_path/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
7134         test -d $cf_library_path/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
7135         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"
7136 }
7137
7138                         cf_library_path_list="$cf_library_path_list $cf_search"
7139                         ;;
7140                 esac
7141         done
7142 fi
7143
7144 cf_search=
7145
7146 test "x$prefix" != "xNONE" && \
7147 test -d "$prefix" && \
7148  {
7149         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
7150         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
7151         test -d $prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
7152         test -d $prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
7153         test -d $prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
7154         test -d $prefix/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
7155 }
7156
7157 for cf_subdir_prefix in \
7158         /usr \
7159         /usr/local \
7160         /usr/pkg \
7161         /opt \
7162         /opt/local \
7163         $HOME
7164 do
7165
7166 test "x$cf_subdir_prefix" != "x$prefix" && \
7167 test -d "$cf_subdir_prefix" && \
7168 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
7169         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
7170         test -d $cf_subdir_prefix/lib &&          cf_search="$cf_search $cf_subdir_prefix/lib"
7171         test -d $cf_subdir_prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root"
7172         test -d $cf_subdir_prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root/lib"
7173         test -d $cf_subdir_prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib"
7174         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"
7175 }
7176
7177 done
7178
7179 cf_search="$cf_library_path_list $cf_search"
7180
7181                         for cf_libdir in $cf_search
7182                         do
7183                                 echo "$as_me:7183: checking for -l$cf_nculib_root in $cf_libdir" >&5
7184 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
7185                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
7186                                 cat >conftest.$ac_ext <<_ACEOF
7187 #line 7187 "configure"
7188 #include "confdefs.h"
7189 #include <${cf_cv_ncurses_header:-curses.h}>
7190 int
7191 main ()
7192 {
7193 initscr()
7194   ;
7195   return 0;
7196 }
7197 _ACEOF
7198 rm -f conftest.$ac_objext conftest$ac_exeext
7199 if { (eval echo "$as_me:7199: \"$ac_link\"") >&5
7200   (eval $ac_link) 2>&5
7201   ac_status=$?
7202   echo "$as_me:7202: \$? = $ac_status" >&5
7203   (exit $ac_status); } &&
7204          { ac_try='test -s conftest$ac_exeext'
7205   { (eval echo "$as_me:7205: \"$ac_try\"") >&5
7206   (eval $ac_try) 2>&5
7207   ac_status=$?
7208   echo "$as_me:7208: \$? = $ac_status" >&5
7209   (exit $ac_status); }; }; then
7210   echo "$as_me:7210: result: yes" >&5
7211 echo "${ECHO_T}yes" >&6
7212                                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
7213                                          break
7214 else
7215   echo "$as_me: failed program was:" >&5
7216 cat conftest.$ac_ext >&5
7217 echo "$as_me:7217: result: no" >&5
7218 echo "${ECHO_T}no" >&6
7219                                          LIBS="$cf_save_LIBS"
7220 fi
7221 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7222                         done
7223
7224 fi
7225 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7226
7227 fi
7228
7229 eval 'cf_found_library=$cf_cv_have_lib_'$cf_nculib_root
7230
7231 if test $cf_found_library = no ; then
7232         { { echo "$as_me:7232: error: Cannot link $cf_nculib_root library" >&5
7233 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
7234    { (exit 1); exit 1; }; }
7235 fi
7236
7237 fi
7238
7239 if test -n "$cf_ncurses_LIBS" ; then
7240         echo "$as_me:7240: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
7241 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
7242         cf_ncurses_SAVE="$LIBS"
7243         for p in $cf_ncurses_LIBS ; do
7244                 q=`echo $LIBS | sed -e "s%$p %%" -e "s%$p$%%"`
7245                 if test "$q" != "$LIBS" ; then
7246                         LIBS="$q"
7247                 fi
7248         done
7249         cat >conftest.$ac_ext <<_ACEOF
7250 #line 7250 "configure"
7251 #include "confdefs.h"
7252 #include <${cf_cv_ncurses_header:-curses.h}>
7253 int
7254 main ()
7255 {
7256 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
7257   ;
7258   return 0;
7259 }
7260 _ACEOF
7261 rm -f conftest.$ac_objext conftest$ac_exeext
7262 if { (eval echo "$as_me:7262: \"$ac_link\"") >&5
7263   (eval $ac_link) 2>&5
7264   ac_status=$?
7265   echo "$as_me:7265: \$? = $ac_status" >&5
7266   (exit $ac_status); } &&
7267          { ac_try='test -s conftest$ac_exeext'
7268   { (eval echo "$as_me:7268: \"$ac_try\"") >&5
7269   (eval $ac_try) 2>&5
7270   ac_status=$?
7271   echo "$as_me:7271: \$? = $ac_status" >&5
7272   (exit $ac_status); }; }; then
7273   echo "$as_me:7273: result: yes" >&5
7274 echo "${ECHO_T}yes" >&6
7275 else
7276   echo "$as_me: failed program was:" >&5
7277 cat conftest.$ac_ext >&5
7278 echo "$as_me:7278: result: no" >&5
7279 echo "${ECHO_T}no" >&6
7280                  LIBS="$cf_ncurses_SAVE"
7281 fi
7282 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7283 fi
7284
7285 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
7286
7287 cat >>confdefs.h <<EOF
7288 #define $cf_nculib_ROOT 1
7289 EOF
7290
7291         fi
7292 else
7293         NCURSES_CONFIG=none
7294 fi
7295
7296 else
7297
7298 cf_ncuconfig_root=ncurses
7299 cf_have_ncuconfig=no
7300
7301 if test "x${PKG_CONFIG:=none}" != xnone; then
7302         echo "$as_me:7302: checking pkg-config for $cf_ncuconfig_root" >&5
7303 echo $ECHO_N "checking pkg-config for $cf_ncuconfig_root... $ECHO_C" >&6
7304         if "$PKG_CONFIG" --exists $cf_ncuconfig_root ; then
7305                 echo "$as_me:7305: result: yes" >&5
7306 echo "${ECHO_T}yes" >&6
7307
7308                 echo "$as_me:7308: checking if the $cf_ncuconfig_root package files work" >&5
7309 echo $ECHO_N "checking if the $cf_ncuconfig_root package files work... $ECHO_C" >&6
7310                 cf_have_ncuconfig=unknown
7311
7312                 cf_save_CPPFLAGS="$CPPFLAGS"
7313                 cf_save_LIBS="$LIBS"
7314
7315                 CPPFLAGS="$CPPFLAGS `$PKG_CONFIG --cflags $cf_ncuconfig_root`"
7316
7317 cf_add_libs="`$PKG_CONFIG --libs $cf_ncuconfig_root`"
7318 # Filter out duplicates - this happens with badly-designed ".pc" files...
7319 for cf_add_1lib in $LIBS
7320 do
7321         for cf_add_2lib in $cf_add_libs
7322         do
7323                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
7324                 then
7325                         cf_add_1lib=
7326                         break
7327                 fi
7328         done
7329         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
7330 done
7331 LIBS="$cf_add_libs"
7332
7333                 cat >conftest.$ac_ext <<_ACEOF
7334 #line 7334 "configure"
7335 #include "confdefs.h"
7336 #include <${cf_cv_ncurses_header:-curses.h}>
7337 int
7338 main ()
7339 {
7340 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
7341   ;
7342   return 0;
7343 }
7344 _ACEOF
7345 rm -f conftest.$ac_objext conftest$ac_exeext
7346 if { (eval echo "$as_me:7346: \"$ac_link\"") >&5
7347   (eval $ac_link) 2>&5
7348   ac_status=$?
7349   echo "$as_me:7349: \$? = $ac_status" >&5
7350   (exit $ac_status); } &&
7351          { ac_try='test -s conftest$ac_exeext'
7352   { (eval echo "$as_me:7352: \"$ac_try\"") >&5
7353   (eval $ac_try) 2>&5
7354   ac_status=$?
7355   echo "$as_me:7355: \$? = $ac_status" >&5
7356   (exit $ac_status); }; }; then
7357   if test "$cross_compiling" = yes; then
7358   cf_have_ncuconfig=maybe
7359 else
7360   cat >conftest.$ac_ext <<_ACEOF
7361 #line 7361 "configure"
7362 #include "confdefs.h"
7363 #include <${cf_cv_ncurses_header:-curses.h}>
7364                                 int main(void)
7365                                 { char *xx = curses_version(); return (xx == 0); }
7366 _ACEOF
7367 rm -f conftest$ac_exeext
7368 if { (eval echo "$as_me:7368: \"$ac_link\"") >&5
7369   (eval $ac_link) 2>&5
7370   ac_status=$?
7371   echo "$as_me:7371: \$? = $ac_status" >&5
7372   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
7373   { (eval echo "$as_me:7373: \"$ac_try\"") >&5
7374   (eval $ac_try) 2>&5
7375   ac_status=$?
7376   echo "$as_me:7376: \$? = $ac_status" >&5
7377   (exit $ac_status); }; }; then
7378   cf_have_ncuconfig=yes
7379 else
7380   echo "$as_me: program exited with status $ac_status" >&5
7381 echo "$as_me: failed program was:" >&5
7382 cat conftest.$ac_ext >&5
7383 cf_have_ncuconfig=no
7384 fi
7385 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
7386 fi
7387 else
7388   echo "$as_me: failed program was:" >&5
7389 cat conftest.$ac_ext >&5
7390 cf_have_ncuconfig=no
7391 fi
7392 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7393                 echo "$as_me:7393: result: $cf_have_ncuconfig" >&5
7394 echo "${ECHO_T}$cf_have_ncuconfig" >&6
7395                 test "$cf_have_ncuconfig" = maybe && cf_have_ncuconfig=yes
7396                 if test "$cf_have_ncuconfig" != "yes"
7397                 then
7398                         CPPFLAGS="$cf_save_CPPFLAGS"
7399                         LIBS="$cf_save_LIBS"
7400                         NCURSES_CONFIG_PKG=none
7401                 else
7402
7403 cat >>confdefs.h <<\EOF
7404 #define NCURSES 1
7405 EOF
7406
7407                         NCURSES_CONFIG_PKG=$cf_ncuconfig_root
7408                 fi
7409
7410         else
7411                 echo "$as_me:7411: result: no" >&5
7412 echo "${ECHO_T}no" >&6
7413                 NCURSES_CONFIG_PKG=none
7414         fi
7415 else
7416         NCURSES_CONFIG_PKG=none
7417 fi
7418
7419 if test "x$cf_have_ncuconfig" = "xno"; then
7420         echo "Looking for ${cf_ncuconfig_root}-config"
7421
7422 if test -n "$ac_tool_prefix"; then
7423   for ac_prog in ${cf_ncuconfig_root}-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
7424   do
7425     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
7426 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
7427 echo "$as_me:7427: checking for $ac_word" >&5
7428 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
7429 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
7430   echo $ECHO_N "(cached) $ECHO_C" >&6
7431 else
7432   if test -n "$NCURSES_CONFIG"; then
7433   ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
7434 else
7435   ac_save_IFS=$IFS; IFS=$ac_path_separator
7436 ac_dummy="$PATH"
7437 for ac_dir in $ac_dummy; do
7438   IFS=$ac_save_IFS
7439   test -z "$ac_dir" && ac_dir=.
7440   $as_executable_p "$ac_dir/$ac_word" || continue
7441 ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
7442 echo "$as_me:7442: found $ac_dir/$ac_word" >&5
7443 break
7444 done
7445
7446 fi
7447 fi
7448 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
7449 if test -n "$NCURSES_CONFIG"; then
7450   echo "$as_me:7450: result: $NCURSES_CONFIG" >&5
7451 echo "${ECHO_T}$NCURSES_CONFIG" >&6
7452 else
7453   echo "$as_me:7453: result: no" >&5
7454 echo "${ECHO_T}no" >&6
7455 fi
7456
7457     test -n "$NCURSES_CONFIG" && break
7458   done
7459 fi
7460 if test -z "$NCURSES_CONFIG"; then
7461   ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
7462   for ac_prog in ${cf_ncuconfig_root}-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
7463 do
7464   # Extract the first word of "$ac_prog", so it can be a program name with args.
7465 set dummy $ac_prog; ac_word=$2
7466 echo "$as_me:7466: checking for $ac_word" >&5
7467 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
7468 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
7469   echo $ECHO_N "(cached) $ECHO_C" >&6
7470 else
7471   if test -n "$ac_ct_NCURSES_CONFIG"; then
7472   ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
7473 else
7474   ac_save_IFS=$IFS; IFS=$ac_path_separator
7475 ac_dummy="$PATH"
7476 for ac_dir in $ac_dummy; do
7477   IFS=$ac_save_IFS
7478   test -z "$ac_dir" && ac_dir=.
7479   $as_executable_p "$ac_dir/$ac_word" || continue
7480 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
7481 echo "$as_me:7481: found $ac_dir/$ac_word" >&5
7482 break
7483 done
7484
7485 fi
7486 fi
7487 ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
7488 if test -n "$ac_ct_NCURSES_CONFIG"; then
7489   echo "$as_me:7489: result: $ac_ct_NCURSES_CONFIG" >&5
7490 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
7491 else
7492   echo "$as_me:7492: result: no" >&5
7493 echo "${ECHO_T}no" >&6
7494 fi
7495
7496   test -n "$ac_ct_NCURSES_CONFIG" && break
7497 done
7498 test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
7499
7500   NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
7501 fi
7502
7503         if test "$NCURSES_CONFIG" != none ; then
7504
7505                 CPPFLAGS="$CPPFLAGS `$NCURSES_CONFIG --cflags`"
7506
7507 cf_add_libs="`$NCURSES_CONFIG --libs`"
7508 # Filter out duplicates - this happens with badly-designed ".pc" files...
7509 for cf_add_1lib in $LIBS
7510 do
7511         for cf_add_2lib in $cf_add_libs
7512         do
7513                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
7514                 then
7515                         cf_add_1lib=
7516                         break
7517                 fi
7518         done
7519         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
7520 done
7521 LIBS="$cf_add_libs"
7522
7523                 # even with config script, some packages use no-override for curses.h
7524
7525 echo "$as_me:7525: checking if we have identified curses headers" >&5
7526 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
7527 if test "${cf_cv_ncurses_header+set}" = set; then
7528   echo $ECHO_N "(cached) $ECHO_C" >&6
7529 else
7530
7531 cf_cv_ncurses_header=none
7532 for cf_header in \
7533         ncurses.h ncurses/ncurses.h \
7534         curses.h ncurses/curses.h
7535 do
7536 cat >conftest.$ac_ext <<_ACEOF
7537 #line 7537 "configure"
7538 #include "confdefs.h"
7539 #include <${cf_header}>
7540 int
7541 main ()
7542 {
7543 initscr(); tgoto("?", 0,0)
7544   ;
7545   return 0;
7546 }
7547 _ACEOF
7548 rm -f conftest.$ac_objext
7549 if { (eval echo "$as_me:7549: \"$ac_compile\"") >&5
7550   (eval $ac_compile) 2>&5
7551   ac_status=$?
7552   echo "$as_me:7552: \$? = $ac_status" >&5
7553   (exit $ac_status); } &&
7554          { ac_try='test -s conftest.$ac_objext'
7555   { (eval echo "$as_me:7555: \"$ac_try\"") >&5
7556   (eval $ac_try) 2>&5
7557   ac_status=$?
7558   echo "$as_me:7558: \$? = $ac_status" >&5
7559   (exit $ac_status); }; }; then
7560   cf_cv_ncurses_header=$cf_header; break
7561 else
7562   echo "$as_me: failed program was:" >&5
7563 cat conftest.$ac_ext >&5
7564 fi
7565 rm -f conftest.$ac_objext conftest.$ac_ext
7566 done
7567
7568 fi
7569 echo "$as_me:7569: result: $cf_cv_ncurses_header" >&5
7570 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
7571
7572 if test "$cf_cv_ncurses_header" = none ; then
7573         { { echo "$as_me:7573: error: No curses header-files found" >&5
7574 echo "$as_me: error: No curses header-files found" >&2;}
7575    { (exit 1); exit 1; }; }
7576 fi
7577
7578 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
7579
7580 for ac_header in $cf_cv_ncurses_header
7581 do
7582 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
7583 echo "$as_me:7583: checking for $ac_header" >&5
7584 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
7585 if eval "test \"\${$as_ac_Header+set}\" = set"; then
7586   echo $ECHO_N "(cached) $ECHO_C" >&6
7587 else
7588   cat >conftest.$ac_ext <<_ACEOF
7589 #line 7589 "configure"
7590 #include "confdefs.h"
7591 #include <$ac_header>
7592 _ACEOF
7593 if { (eval echo "$as_me:7593: \"$ac_cpp conftest.$ac_ext\"") >&5
7594   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
7595   ac_status=$?
7596   egrep -v '^ *\+' conftest.er1 >conftest.err
7597   rm -f conftest.er1
7598   cat conftest.err >&5
7599   echo "$as_me:7599: \$? = $ac_status" >&5
7600   (exit $ac_status); } >/dev/null; then
7601   if test -s conftest.err; then
7602     ac_cpp_err=$ac_c_preproc_warn_flag
7603   else
7604     ac_cpp_err=
7605   fi
7606 else
7607   ac_cpp_err=yes
7608 fi
7609 if test -z "$ac_cpp_err"; then
7610   eval "$as_ac_Header=yes"
7611 else
7612   echo "$as_me: failed program was:" >&5
7613   cat conftest.$ac_ext >&5
7614   eval "$as_ac_Header=no"
7615 fi
7616 rm -f conftest.err conftest.$ac_ext
7617 fi
7618 echo "$as_me:7618: result: `eval echo '${'$as_ac_Header'}'`" >&5
7619 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
7620 if test `eval echo '${'$as_ac_Header'}'` = yes; then
7621   cat >>confdefs.h <<EOF
7622 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
7623 EOF
7624
7625 fi
7626 done
7627
7628 cat >>confdefs.h <<\EOF
7629 #define NCURSES 1
7630 EOF
7631
7632 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
7633
7634                 cat >>confdefs.h <<EOF
7635 #define $cf_nculib_ROOT 1
7636 EOF
7637
7638                                 cf_cv_ncurses_version=`$NCURSES_CONFIG --version`
7639
7640         else
7641
7642 cf_ncuhdr_root=ncurses
7643
7644 test -n "$cf_cv_curses_dir" && \
7645 test "$cf_cv_curses_dir" != "no" && { \
7646
7647 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
7648   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
7649   do
7650         while test $cf_add_incdir != /usr/include
7651         do
7652           if test -d $cf_add_incdir
7653           then
7654                 cf_have_incdir=no
7655                 if test -n "$CFLAGS$CPPFLAGS" ; then
7656                   # a loop is needed to ensure we can add subdirs of existing dirs
7657                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
7658                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
7659                           cf_have_incdir=yes; break
7660                         fi
7661                   done
7662                 fi
7663
7664                 if test "$cf_have_incdir" = no ; then
7665                   if test "$cf_add_incdir" = /usr/local/include ; then
7666                         if test "$GCC" = yes
7667                         then
7668                           cf_save_CPPFLAGS=$CPPFLAGS
7669                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
7670                           cat >conftest.$ac_ext <<_ACEOF
7671 #line 7671 "configure"
7672 #include "confdefs.h"
7673 #include <stdio.h>
7674 int
7675 main ()
7676 {
7677 printf("Hello")
7678   ;
7679   return 0;
7680 }
7681 _ACEOF
7682 rm -f conftest.$ac_objext
7683 if { (eval echo "$as_me:7683: \"$ac_compile\"") >&5
7684   (eval $ac_compile) 2>&5
7685   ac_status=$?
7686   echo "$as_me:7686: \$? = $ac_status" >&5
7687   (exit $ac_status); } &&
7688          { ac_try='test -s conftest.$ac_objext'
7689   { (eval echo "$as_me:7689: \"$ac_try\"") >&5
7690   (eval $ac_try) 2>&5
7691   ac_status=$?
7692   echo "$as_me:7692: \$? = $ac_status" >&5
7693   (exit $ac_status); }; }; then
7694   :
7695 else
7696   echo "$as_me: failed program was:" >&5
7697 cat conftest.$ac_ext >&5
7698 cf_have_incdir=yes
7699 fi
7700 rm -f conftest.$ac_objext conftest.$ac_ext
7701                           CPPFLAGS=$cf_save_CPPFLAGS
7702                         fi
7703                   fi
7704                 fi
7705
7706                 if test "$cf_have_incdir" = no ; then
7707                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
7708
7709 echo "${as_me:-configure}:7709: testing adding $cf_add_incdir to include-path ..." 1>&5
7710
7711                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
7712
7713                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
7714                   test "$cf_top_incdir" = "$cf_add_incdir" && break
7715                   cf_add_incdir="$cf_top_incdir"
7716                 else
7717                   break
7718                 fi
7719           else
7720                 break
7721           fi
7722         done
7723   done
7724 fi
7725
7726 }
7727
7728 echo "$as_me:7728: checking for $cf_ncuhdr_root header in include-path" >&5
7729 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
7730 if test "${cf_cv_ncurses_h+set}" = set; then
7731   echo $ECHO_N "(cached) $ECHO_C" >&6
7732 else
7733
7734         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
7735         ( test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw ) && cf_header_list="$cf_header_list curses.h ncurses.h"
7736         for cf_header in $cf_header_list
7737         do
7738
7739         cat >conftest.$ac_ext <<_ACEOF
7740 #line 7740 "configure"
7741 #include "confdefs.h"
7742
7743 #include <$cf_header>
7744 int
7745 main ()
7746 {
7747
7748 #ifdef NCURSES_VERSION
7749
7750 printf("%s\n", NCURSES_VERSION);
7751 #else
7752 #ifdef __NCURSES_H
7753 printf("old\n");
7754 #else
7755         make an error
7756 #endif
7757 #endif
7758
7759   ;
7760   return 0;
7761 }
7762 _ACEOF
7763 rm -f conftest.$ac_objext
7764 if { (eval echo "$as_me:7764: \"$ac_compile\"") >&5
7765   (eval $ac_compile) 2>&5
7766   ac_status=$?
7767   echo "$as_me:7767: \$? = $ac_status" >&5
7768   (exit $ac_status); } &&
7769          { ac_try='test -s conftest.$ac_objext'
7770   { (eval echo "$as_me:7770: \"$ac_try\"") >&5
7771   (eval $ac_try) 2>&5
7772   ac_status=$?
7773   echo "$as_me:7773: \$? = $ac_status" >&5
7774   (exit $ac_status); }; }; then
7775   cf_cv_ncurses_h=$cf_header
7776
7777 else
7778   echo "$as_me: failed program was:" >&5
7779 cat conftest.$ac_ext >&5
7780 cf_cv_ncurses_h=no
7781 fi
7782 rm -f conftest.$ac_objext conftest.$ac_ext
7783
7784                 test "$cf_cv_ncurses_h" != no && break
7785         done
7786
7787 fi
7788 echo "$as_me:7788: result: $cf_cv_ncurses_h" >&5
7789 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
7790
7791 if test "$cf_cv_ncurses_h" != no ; then
7792         cf_cv_ncurses_header=$cf_cv_ncurses_h
7793 else
7794
7795 echo "$as_me:7795: checking for $cf_ncuhdr_root include-path" >&5
7796 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
7797 if test "${cf_cv_ncurses_h2+set}" = set; then
7798   echo $ECHO_N "(cached) $ECHO_C" >&6
7799 else
7800
7801         test -n "$verbose" && echo
7802
7803 cf_search=
7804
7805 # collect the current set of include-directories from compiler flags
7806 cf_header_path_list=""
7807 if test -n "${CFLAGS}${CPPFLAGS}" ; then
7808         for cf_header_path in $CPPFLAGS $CFLAGS
7809         do
7810                 case $cf_header_path in
7811                 (-I*)
7812                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
7813
7814 test "x$cf_header_path" != "xNONE" && \
7815 test -d "$cf_header_path" && \
7816  {
7817         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
7818         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
7819         test -d $cf_header_path/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
7820         test -d $cf_header_path/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
7821         test -d $cf_header_path/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
7822         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"
7823 }
7824
7825                         cf_header_path_list="$cf_header_path_list $cf_search"
7826                         ;;
7827                 esac
7828         done
7829 fi
7830
7831 # add the variations for the package we are looking for
7832
7833 cf_search=
7834
7835 test "x$prefix" != "xNONE" && \
7836 test -d "$prefix" && \
7837  {
7838         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
7839         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
7840         test -d $prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
7841         test -d $prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
7842         test -d $prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
7843         test -d $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
7844 }
7845
7846 for cf_subdir_prefix in \
7847         /usr \
7848         /usr/local \
7849         /usr/pkg \
7850         /opt \
7851         /opt/local \
7852         $HOME
7853 do
7854
7855 test "x$cf_subdir_prefix" != "x$prefix" && \
7856 test -d "$cf_subdir_prefix" && \
7857 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
7858         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
7859         test -d $cf_subdir_prefix/include &&          cf_search="$cf_search $cf_subdir_prefix/include"
7860         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root"
7861         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root/include"
7862         test -d $cf_subdir_prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include"
7863         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"
7864 }
7865
7866 done
7867
7868 test "$includedir" != NONE && \
7869 test "$includedir" != "/usr/include" && \
7870 test -d "$includedir" && {
7871         test -d $includedir &&    cf_search="$cf_search $includedir"
7872         test -d $includedir/$cf_ncuhdr_root && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
7873 }
7874
7875 test "$oldincludedir" != NONE && \
7876 test "$oldincludedir" != "/usr/include" && \
7877 test -d "$oldincludedir" && {
7878         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
7879         test -d $oldincludedir/$cf_ncuhdr_root && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
7880 }
7881
7882 cf_search="$cf_search $cf_header_path_list"
7883
7884         test -n "$verbose" && echo search path $cf_search
7885         cf_save2_CPPFLAGS="$CPPFLAGS"
7886         for cf_incdir in $cf_search
7887         do
7888
7889 if test -n "$cf_incdir" ; then
7890   for cf_add_incdir in $cf_incdir
7891   do
7892         while test $cf_add_incdir != /usr/include
7893         do
7894           if test -d $cf_add_incdir
7895           then
7896                 cf_have_incdir=no
7897                 if test -n "$CFLAGS$CPPFLAGS" ; then
7898                   # a loop is needed to ensure we can add subdirs of existing dirs
7899                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
7900                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
7901                           cf_have_incdir=yes; break
7902                         fi
7903                   done
7904                 fi
7905
7906                 if test "$cf_have_incdir" = no ; then
7907                   if test "$cf_add_incdir" = /usr/local/include ; then
7908                         if test "$GCC" = yes
7909                         then
7910                           cf_save_CPPFLAGS=$CPPFLAGS
7911                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
7912                           cat >conftest.$ac_ext <<_ACEOF
7913 #line 7913 "configure"
7914 #include "confdefs.h"
7915 #include <stdio.h>
7916 int
7917 main ()
7918 {
7919 printf("Hello")
7920   ;
7921   return 0;
7922 }
7923 _ACEOF
7924 rm -f conftest.$ac_objext
7925 if { (eval echo "$as_me:7925: \"$ac_compile\"") >&5
7926   (eval $ac_compile) 2>&5
7927   ac_status=$?
7928   echo "$as_me:7928: \$? = $ac_status" >&5
7929   (exit $ac_status); } &&
7930          { ac_try='test -s conftest.$ac_objext'
7931   { (eval echo "$as_me:7931: \"$ac_try\"") >&5
7932   (eval $ac_try) 2>&5
7933   ac_status=$?
7934   echo "$as_me:7934: \$? = $ac_status" >&5
7935   (exit $ac_status); }; }; then
7936   :
7937 else
7938   echo "$as_me: failed program was:" >&5
7939 cat conftest.$ac_ext >&5
7940 cf_have_incdir=yes
7941 fi
7942 rm -f conftest.$ac_objext conftest.$ac_ext
7943                           CPPFLAGS=$cf_save_CPPFLAGS
7944                         fi
7945                   fi
7946                 fi
7947
7948                 if test "$cf_have_incdir" = no ; then
7949                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
7950
7951 echo "${as_me:-configure}:7951: testing adding $cf_add_incdir to include-path ..." 1>&5
7952
7953                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
7954
7955                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
7956                   test "$cf_top_incdir" = "$cf_add_incdir" && break
7957                   cf_add_incdir="$cf_top_incdir"
7958                 else
7959                   break
7960                 fi
7961           else
7962                 break
7963           fi
7964         done
7965   done
7966 fi
7967
7968                 for cf_header in \
7969                         ncurses.h \
7970                         curses.h
7971                 do
7972
7973         cat >conftest.$ac_ext <<_ACEOF
7974 #line 7974 "configure"
7975 #include "confdefs.h"
7976
7977 #include <$cf_header>
7978 int
7979 main ()
7980 {
7981
7982 #ifdef NCURSES_VERSION
7983
7984 printf("%s\n", NCURSES_VERSION);
7985 #else
7986 #ifdef __NCURSES_H
7987 printf("old\n");
7988 #else
7989         make an error
7990 #endif
7991 #endif
7992
7993   ;
7994   return 0;
7995 }
7996 _ACEOF
7997 rm -f conftest.$ac_objext
7998 if { (eval echo "$as_me:7998: \"$ac_compile\"") >&5
7999   (eval $ac_compile) 2>&5
8000   ac_status=$?
8001   echo "$as_me:8001: \$? = $ac_status" >&5
8002   (exit $ac_status); } &&
8003          { ac_try='test -s conftest.$ac_objext'
8004   { (eval echo "$as_me:8004: \"$ac_try\"") >&5
8005   (eval $ac_try) 2>&5
8006   ac_status=$?
8007   echo "$as_me:8007: \$? = $ac_status" >&5
8008   (exit $ac_status); }; }; then
8009   cf_cv_ncurses_h2=$cf_header
8010
8011 else
8012   echo "$as_me: failed program was:" >&5
8013 cat conftest.$ac_ext >&5
8014 cf_cv_ncurses_h2=no
8015 fi
8016 rm -f conftest.$ac_objext conftest.$ac_ext
8017
8018                         if test "$cf_cv_ncurses_h2" != no ; then
8019                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
8020                                 test -n "$verbose" && echo $ac_n "      ... found $ac_c" 1>&6
8021                                 break
8022                         fi
8023                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
8024                 done
8025                 CPPFLAGS="$cf_save2_CPPFLAGS"
8026                 test "$cf_cv_ncurses_h2" != no && break
8027         done
8028         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:8028: error: not found" >&5
8029 echo "$as_me: error: not found" >&2;}
8030    { (exit 1); exit 1; }; }
8031
8032 fi
8033 echo "$as_me:8033: result: $cf_cv_ncurses_h2" >&5
8034 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
8035
8036         cf_1st_incdir=`echo $cf_cv_ncurses_h2 | sed -e 's%/[^/]*$%%'`
8037         cf_cv_ncurses_header=`basename $cf_cv_ncurses_h2`
8038         if test `basename $cf_1st_incdir` = $cf_ncuhdr_root ; then
8039                 cf_cv_ncurses_header=$cf_ncuhdr_root/$cf_cv_ncurses_header
8040         fi
8041
8042 if test -n "$cf_1st_incdir" ; then
8043   for cf_add_incdir in $cf_1st_incdir
8044   do
8045         while test $cf_add_incdir != /usr/include
8046         do
8047           if test -d $cf_add_incdir
8048           then
8049                 cf_have_incdir=no
8050                 if test -n "$CFLAGS$CPPFLAGS" ; then
8051                   # a loop is needed to ensure we can add subdirs of existing dirs
8052                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
8053                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
8054                           cf_have_incdir=yes; break
8055                         fi
8056                   done
8057                 fi
8058
8059                 if test "$cf_have_incdir" = no ; then
8060                   if test "$cf_add_incdir" = /usr/local/include ; then
8061                         if test "$GCC" = yes
8062                         then
8063                           cf_save_CPPFLAGS=$CPPFLAGS
8064                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8065                           cat >conftest.$ac_ext <<_ACEOF
8066 #line 8066 "configure"
8067 #include "confdefs.h"
8068 #include <stdio.h>
8069 int
8070 main ()
8071 {
8072 printf("Hello")
8073   ;
8074   return 0;
8075 }
8076 _ACEOF
8077 rm -f conftest.$ac_objext
8078 if { (eval echo "$as_me:8078: \"$ac_compile\"") >&5
8079   (eval $ac_compile) 2>&5
8080   ac_status=$?
8081   echo "$as_me:8081: \$? = $ac_status" >&5
8082   (exit $ac_status); } &&
8083          { ac_try='test -s conftest.$ac_objext'
8084   { (eval echo "$as_me:8084: \"$ac_try\"") >&5
8085   (eval $ac_try) 2>&5
8086   ac_status=$?
8087   echo "$as_me:8087: \$? = $ac_status" >&5
8088   (exit $ac_status); }; }; then
8089   :
8090 else
8091   echo "$as_me: failed program was:" >&5
8092 cat conftest.$ac_ext >&5
8093 cf_have_incdir=yes
8094 fi
8095 rm -f conftest.$ac_objext conftest.$ac_ext
8096                           CPPFLAGS=$cf_save_CPPFLAGS
8097                         fi
8098                   fi
8099                 fi
8100
8101                 if test "$cf_have_incdir" = no ; then
8102                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
8103
8104 echo "${as_me:-configure}:8104: testing adding $cf_add_incdir to include-path ..." 1>&5
8105
8106                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8107
8108                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
8109                   test "$cf_top_incdir" = "$cf_add_incdir" && break
8110                   cf_add_incdir="$cf_top_incdir"
8111                 else
8112                   break
8113                 fi
8114           else
8115                 break
8116           fi
8117         done
8118   done
8119 fi
8120
8121 fi
8122
8123 # Set definitions to allow ifdef'ing for ncurses.h
8124
8125 case $cf_cv_ncurses_header in
8126 (*ncurses.h)
8127
8128 cat >>confdefs.h <<\EOF
8129 #define HAVE_NCURSES_H 1
8130 EOF
8131
8132         ;;
8133 esac
8134
8135 case $cf_cv_ncurses_header in
8136 (ncurses/curses.h|ncurses/ncurses.h)
8137
8138 cat >>confdefs.h <<\EOF
8139 #define HAVE_NCURSES_NCURSES_H 1
8140 EOF
8141
8142         ;;
8143 (ncursesw/curses.h|ncursesw/ncurses.h)
8144
8145 cat >>confdefs.h <<\EOF
8146 #define HAVE_NCURSESW_NCURSES_H 1
8147 EOF
8148
8149         ;;
8150 esac
8151
8152 echo "$as_me:8152: checking for terminfo header" >&5
8153 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
8154 if test "${cf_cv_term_header+set}" = set; then
8155   echo $ECHO_N "(cached) $ECHO_C" >&6
8156 else
8157
8158 case ${cf_cv_ncurses_header} in
8159 (*/ncurses.h|*/ncursesw.h)
8160         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
8161         ;;
8162 (*)
8163         cf_term_header=term.h
8164         ;;
8165 esac
8166
8167 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
8168 do
8169 cat >conftest.$ac_ext <<_ACEOF
8170 #line 8170 "configure"
8171 #include "confdefs.h"
8172 #include <stdio.h>
8173 #include <${cf_cv_ncurses_header:-curses.h}>
8174 #include <$cf_test>
8175
8176 int
8177 main ()
8178 {
8179 int x = auto_left_margin
8180   ;
8181   return 0;
8182 }
8183 _ACEOF
8184 rm -f conftest.$ac_objext
8185 if { (eval echo "$as_me:8185: \"$ac_compile\"") >&5
8186   (eval $ac_compile) 2>&5
8187   ac_status=$?
8188   echo "$as_me:8188: \$? = $ac_status" >&5
8189   (exit $ac_status); } &&
8190          { ac_try='test -s conftest.$ac_objext'
8191   { (eval echo "$as_me:8191: \"$ac_try\"") >&5
8192   (eval $ac_try) 2>&5
8193   ac_status=$?
8194   echo "$as_me:8194: \$? = $ac_status" >&5
8195   (exit $ac_status); }; }; then
8196
8197         cf_cv_term_header="$cf_test"
8198 else
8199   echo "$as_me: failed program was:" >&5
8200 cat conftest.$ac_ext >&5
8201
8202         cf_cv_term_header=unknown
8203
8204 fi
8205 rm -f conftest.$ac_objext conftest.$ac_ext
8206         test "$cf_cv_term_header" != unknown && break
8207 done
8208
8209 fi
8210 echo "$as_me:8210: result: $cf_cv_term_header" >&5
8211 echo "${ECHO_T}$cf_cv_term_header" >&6
8212
8213 # Set definitions to allow ifdef'ing to accommodate subdirectories
8214
8215 case $cf_cv_term_header in
8216 (*term.h)
8217
8218 cat >>confdefs.h <<\EOF
8219 #define HAVE_TERM_H 1
8220 EOF
8221
8222         ;;
8223 esac
8224
8225 case $cf_cv_term_header in
8226 (ncurses/term.h)
8227
8228 cat >>confdefs.h <<\EOF
8229 #define HAVE_NCURSES_TERM_H 1
8230 EOF
8231
8232         ;;
8233 (ncursesw/term.h)
8234
8235 cat >>confdefs.h <<\EOF
8236 #define HAVE_NCURSESW_TERM_H 1
8237 EOF
8238
8239         ;;
8240 esac
8241
8242 # some applications need this, but should check for NCURSES_VERSION
8243
8244 cat >>confdefs.h <<\EOF
8245 #define NCURSES 1
8246 EOF
8247
8248 echo "$as_me:8248: checking for ncurses version" >&5
8249 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
8250 if test "${cf_cv_ncurses_version+set}" = set; then
8251   echo $ECHO_N "(cached) $ECHO_C" >&6
8252 else
8253
8254         cf_cv_ncurses_version=no
8255         cf_tempfile=out$$
8256         rm -f $cf_tempfile
8257         if test "$cross_compiling" = yes; then
8258
8259         # This will not work if the preprocessor splits the line after the
8260         # Autoconf token.  The 'unproto' program does that.
8261         cat > conftest.$ac_ext <<EOF
8262 #include <${cf_cv_ncurses_header:-curses.h}>
8263 #undef Autoconf
8264 #ifdef NCURSES_VERSION
8265 Autoconf NCURSES_VERSION
8266 #else
8267 #ifdef __NCURSES_H
8268 Autoconf "old"
8269 #endif
8270 ;
8271 #endif
8272 EOF
8273         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
8274         { (eval echo "$as_me:8274: \"$cf_try\"") >&5
8275   (eval $cf_try) 2>&5
8276   ac_status=$?
8277   echo "$as_me:8277: \$? = $ac_status" >&5
8278   (exit $ac_status); }
8279         if test -f conftest.out ; then
8280                 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
8281                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
8282                 rm -f conftest.out
8283         fi
8284
8285 else
8286   cat >conftest.$ac_ext <<_ACEOF
8287 #line 8287 "configure"
8288 #include "confdefs.h"
8289
8290 #include <${cf_cv_ncurses_header:-curses.h}>
8291 #include <stdio.h>
8292 int main()
8293 {
8294         FILE *fp = fopen("$cf_tempfile", "w");
8295 #ifdef NCURSES_VERSION
8296 # ifdef NCURSES_VERSION_PATCH
8297         fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
8298 # else
8299         fprintf(fp, "%s\n", NCURSES_VERSION);
8300 # endif
8301 #else
8302 # ifdef __NCURSES_H
8303         fprintf(fp, "old\n");
8304 # else
8305         make an error
8306 # endif
8307 #endif
8308         ${cf_cv_main_return:-return}(0);
8309 }
8310 _ACEOF
8311 rm -f conftest$ac_exeext
8312 if { (eval echo "$as_me:8312: \"$ac_link\"") >&5
8313   (eval $ac_link) 2>&5
8314   ac_status=$?
8315   echo "$as_me:8315: \$? = $ac_status" >&5
8316   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
8317   { (eval echo "$as_me:8317: \"$ac_try\"") >&5
8318   (eval $ac_try) 2>&5
8319   ac_status=$?
8320   echo "$as_me:8320: \$? = $ac_status" >&5
8321   (exit $ac_status); }; }; then
8322
8323         cf_cv_ncurses_version=`cat $cf_tempfile`
8324 else
8325   echo "$as_me: program exited with status $ac_status" >&5
8326 echo "$as_me: failed program was:" >&5
8327 cat conftest.$ac_ext >&5
8328 fi
8329 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
8330 fi
8331         rm -f $cf_tempfile
8332
8333 fi
8334 echo "$as_me:8334: result: $cf_cv_ncurses_version" >&5
8335 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
8336 test "$cf_cv_ncurses_version" = no ||
8337 cat >>confdefs.h <<\EOF
8338 #define NCURSES 1
8339 EOF
8340
8341 cf_nculib_root=ncurses
8342         # This works, except for the special case where we find gpm, but
8343         # ncurses is in a nonstandard location via $LIBS, and we really want
8344         # to link gpm.
8345 cf_ncurses_LIBS=""
8346 cf_ncurses_SAVE="$LIBS"
8347 echo "$as_me:8347: checking for Gpm_Open in -lgpm" >&5
8348 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
8349 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
8350   echo $ECHO_N "(cached) $ECHO_C" >&6
8351 else
8352   ac_check_lib_save_LIBS=$LIBS
8353 LIBS="-lgpm  $LIBS"
8354 cat >conftest.$ac_ext <<_ACEOF
8355 #line 8355 "configure"
8356 #include "confdefs.h"
8357
8358 /* Override any gcc2 internal prototype to avoid an error.  */
8359 #ifdef __cplusplus
8360 extern "C"
8361 #endif
8362 /* We use char because int might match the return type of a gcc2
8363    builtin and then its argument prototype would still apply.  */
8364 char Gpm_Open ();
8365 int
8366 main ()
8367 {
8368 Gpm_Open ();
8369   ;
8370   return 0;
8371 }
8372 _ACEOF
8373 rm -f conftest.$ac_objext conftest$ac_exeext
8374 if { (eval echo "$as_me:8374: \"$ac_link\"") >&5
8375   (eval $ac_link) 2>&5
8376   ac_status=$?
8377   echo "$as_me:8377: \$? = $ac_status" >&5
8378   (exit $ac_status); } &&
8379          { ac_try='test -s conftest$ac_exeext'
8380   { (eval echo "$as_me:8380: \"$ac_try\"") >&5
8381   (eval $ac_try) 2>&5
8382   ac_status=$?
8383   echo "$as_me:8383: \$? = $ac_status" >&5
8384   (exit $ac_status); }; }; then
8385   ac_cv_lib_gpm_Gpm_Open=yes
8386 else
8387   echo "$as_me: failed program was:" >&5
8388 cat conftest.$ac_ext >&5
8389 ac_cv_lib_gpm_Gpm_Open=no
8390 fi
8391 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8392 LIBS=$ac_check_lib_save_LIBS
8393 fi
8394 echo "$as_me:8394: result: $ac_cv_lib_gpm_Gpm_Open" >&5
8395 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
8396 if test $ac_cv_lib_gpm_Gpm_Open = yes; then
8397   echo "$as_me:8397: checking for initscr in -lgpm" >&5
8398 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
8399 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
8400   echo $ECHO_N "(cached) $ECHO_C" >&6
8401 else
8402   ac_check_lib_save_LIBS=$LIBS
8403 LIBS="-lgpm  $LIBS"
8404 cat >conftest.$ac_ext <<_ACEOF
8405 #line 8405 "configure"
8406 #include "confdefs.h"
8407
8408 /* Override any gcc2 internal prototype to avoid an error.  */
8409 #ifdef __cplusplus
8410 extern "C"
8411 #endif
8412 /* We use char because int might match the return type of a gcc2
8413    builtin and then its argument prototype would still apply.  */
8414 char initscr ();
8415 int
8416 main ()
8417 {
8418 initscr ();
8419   ;
8420   return 0;
8421 }
8422 _ACEOF
8423 rm -f conftest.$ac_objext conftest$ac_exeext
8424 if { (eval echo "$as_me:8424: \"$ac_link\"") >&5
8425   (eval $ac_link) 2>&5
8426   ac_status=$?
8427   echo "$as_me:8427: \$? = $ac_status" >&5
8428   (exit $ac_status); } &&
8429          { ac_try='test -s conftest$ac_exeext'
8430   { (eval echo "$as_me:8430: \"$ac_try\"") >&5
8431   (eval $ac_try) 2>&5
8432   ac_status=$?
8433   echo "$as_me:8433: \$? = $ac_status" >&5
8434   (exit $ac_status); }; }; then
8435   ac_cv_lib_gpm_initscr=yes
8436 else
8437   echo "$as_me: failed program was:" >&5
8438 cat conftest.$ac_ext >&5
8439 ac_cv_lib_gpm_initscr=no
8440 fi
8441 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8442 LIBS=$ac_check_lib_save_LIBS
8443 fi
8444 echo "$as_me:8444: result: $ac_cv_lib_gpm_initscr" >&5
8445 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
8446 if test $ac_cv_lib_gpm_initscr = yes; then
8447   LIBS="$cf_ncurses_SAVE"
8448 else
8449   cf_ncurses_LIBS="-lgpm"
8450 fi
8451
8452 fi
8453
8454 case $host_os in
8455 (freebsd*)
8456         # This is only necessary if you are linking against an obsolete
8457         # version of ncurses (but it should do no harm, since it's static).
8458         if test "$cf_nculib_root" = ncurses ; then
8459                 echo "$as_me:8459: checking for tgoto in -lmytinfo" >&5
8460 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
8461 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
8462   echo $ECHO_N "(cached) $ECHO_C" >&6
8463 else
8464   ac_check_lib_save_LIBS=$LIBS
8465 LIBS="-lmytinfo  $LIBS"
8466 cat >conftest.$ac_ext <<_ACEOF
8467 #line 8467 "configure"
8468 #include "confdefs.h"
8469
8470 /* Override any gcc2 internal prototype to avoid an error.  */
8471 #ifdef __cplusplus
8472 extern "C"
8473 #endif
8474 /* We use char because int might match the return type of a gcc2
8475    builtin and then its argument prototype would still apply.  */
8476 char tgoto ();
8477 int
8478 main ()
8479 {
8480 tgoto ();
8481   ;
8482   return 0;
8483 }
8484 _ACEOF
8485 rm -f conftest.$ac_objext conftest$ac_exeext
8486 if { (eval echo "$as_me:8486: \"$ac_link\"") >&5
8487   (eval $ac_link) 2>&5
8488   ac_status=$?
8489   echo "$as_me:8489: \$? = $ac_status" >&5
8490   (exit $ac_status); } &&
8491          { ac_try='test -s conftest$ac_exeext'
8492   { (eval echo "$as_me:8492: \"$ac_try\"") >&5
8493   (eval $ac_try) 2>&5
8494   ac_status=$?
8495   echo "$as_me:8495: \$? = $ac_status" >&5
8496   (exit $ac_status); }; }; then
8497   ac_cv_lib_mytinfo_tgoto=yes
8498 else
8499   echo "$as_me: failed program was:" >&5
8500 cat conftest.$ac_ext >&5
8501 ac_cv_lib_mytinfo_tgoto=no
8502 fi
8503 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8504 LIBS=$ac_check_lib_save_LIBS
8505 fi
8506 echo "$as_me:8506: result: $ac_cv_lib_mytinfo_tgoto" >&5
8507 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
8508 if test $ac_cv_lib_mytinfo_tgoto = yes; then
8509   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
8510 fi
8511
8512         fi
8513         ;;
8514 esac
8515
8516 cf_add_libs="$cf_ncurses_LIBS"
8517 # Filter out duplicates - this happens with badly-designed ".pc" files...
8518 for cf_add_1lib in $LIBS
8519 do
8520         for cf_add_2lib in $cf_add_libs
8521         do
8522                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
8523                 then
8524                         cf_add_1lib=
8525                         break
8526                 fi
8527         done
8528         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
8529 done
8530 LIBS="$cf_add_libs"
8531
8532 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
8533 then
8534
8535 cf_add_libs="-l$cf_nculib_root"
8536 # Filter out duplicates - this happens with badly-designed ".pc" files...
8537 for cf_add_1lib in $LIBS
8538 do
8539         for cf_add_2lib in $cf_add_libs
8540         do
8541                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
8542                 then
8543                         cf_add_1lib=
8544                         break
8545                 fi
8546         done
8547         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
8548 done
8549 LIBS="$cf_add_libs"
8550
8551 else
8552
8553         eval 'cf_cv_have_lib_'$cf_nculib_root'=no'
8554         cf_libdir=""
8555         echo "$as_me:8555: checking for initscr" >&5
8556 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
8557 if test "${ac_cv_func_initscr+set}" = set; then
8558   echo $ECHO_N "(cached) $ECHO_C" >&6
8559 else
8560   cat >conftest.$ac_ext <<_ACEOF
8561 #line 8561 "configure"
8562 #include "confdefs.h"
8563 /* System header to define __stub macros and hopefully few prototypes,
8564     which can conflict with char initscr (); below.  */
8565 #include <assert.h>
8566 /* Override any gcc2 internal prototype to avoid an error.  */
8567 #ifdef __cplusplus
8568 extern "C"
8569 #endif
8570 /* We use char because int might match the return type of a gcc2
8571    builtin and then its argument prototype would still apply.  */
8572 char initscr ();
8573 char (*f) ();
8574
8575 int
8576 main ()
8577 {
8578 /* The GNU C library defines this for functions which it implements
8579     to always fail with ENOSYS.  Some functions are actually named
8580     something starting with __ and the normal name is an alias.  */
8581 #if defined (__stub_initscr) || defined (__stub___initscr)
8582 choke me
8583 #else
8584 f = initscr; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
8585 #endif
8586
8587   ;
8588   return 0;
8589 }
8590 _ACEOF
8591 rm -f conftest.$ac_objext conftest$ac_exeext
8592 if { (eval echo "$as_me:8592: \"$ac_link\"") >&5
8593   (eval $ac_link) 2>&5
8594   ac_status=$?
8595   echo "$as_me:8595: \$? = $ac_status" >&5
8596   (exit $ac_status); } &&
8597          { ac_try='test -s conftest$ac_exeext'
8598   { (eval echo "$as_me:8598: \"$ac_try\"") >&5
8599   (eval $ac_try) 2>&5
8600   ac_status=$?
8601   echo "$as_me:8601: \$? = $ac_status" >&5
8602   (exit $ac_status); }; }; then
8603   ac_cv_func_initscr=yes
8604 else
8605   echo "$as_me: failed program was:" >&5
8606 cat conftest.$ac_ext >&5
8607 ac_cv_func_initscr=no
8608 fi
8609 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8610 fi
8611 echo "$as_me:8611: result: $ac_cv_func_initscr" >&5
8612 echo "${ECHO_T}$ac_cv_func_initscr" >&6
8613 if test $ac_cv_func_initscr = yes; then
8614   eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
8615 else
8616
8617                 cf_save_LIBS="$LIBS"
8618                 echo "$as_me:8618: checking for initscr in -l$cf_nculib_root" >&5
8619 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
8620                 LIBS="-l$cf_nculib_root $LIBS"
8621                 cat >conftest.$ac_ext <<_ACEOF
8622 #line 8622 "configure"
8623 #include "confdefs.h"
8624 #include <${cf_cv_ncurses_header:-curses.h}>
8625 int
8626 main ()
8627 {
8628 initscr()
8629   ;
8630   return 0;
8631 }
8632 _ACEOF
8633 rm -f conftest.$ac_objext conftest$ac_exeext
8634 if { (eval echo "$as_me:8634: \"$ac_link\"") >&5
8635   (eval $ac_link) 2>&5
8636   ac_status=$?
8637   echo "$as_me:8637: \$? = $ac_status" >&5
8638   (exit $ac_status); } &&
8639          { ac_try='test -s conftest$ac_exeext'
8640   { (eval echo "$as_me:8640: \"$ac_try\"") >&5
8641   (eval $ac_try) 2>&5
8642   ac_status=$?
8643   echo "$as_me:8643: \$? = $ac_status" >&5
8644   (exit $ac_status); }; }; then
8645   echo "$as_me:8645: result: yes" >&5
8646 echo "${ECHO_T}yes" >&6
8647                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
8648
8649 else
8650   echo "$as_me: failed program was:" >&5
8651 cat conftest.$ac_ext >&5
8652 echo "$as_me:8652: result: no" >&5
8653 echo "${ECHO_T}no" >&6
8654
8655 cf_search=
8656 cf_library_path_list=""
8657 if test -n "${LDFLAGS}${LIBS}" ; then
8658         for cf_library_path in $LDFLAGS $LIBS
8659         do
8660                 case $cf_library_path in
8661                 (-L*)
8662                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
8663
8664 test "x$cf_library_path" != "xNONE" && \
8665 test -d "$cf_library_path" && \
8666  {
8667         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
8668         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
8669         test -d $cf_library_path/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
8670         test -d $cf_library_path/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
8671         test -d $cf_library_path/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
8672         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"
8673 }
8674
8675                         cf_library_path_list="$cf_library_path_list $cf_search"
8676                         ;;
8677                 esac
8678         done
8679 fi
8680
8681 cf_search=
8682
8683 test "x$prefix" != "xNONE" && \
8684 test -d "$prefix" && \
8685  {
8686         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
8687         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
8688         test -d $prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
8689         test -d $prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
8690         test -d $prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
8691         test -d $prefix/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
8692 }
8693
8694 for cf_subdir_prefix in \
8695         /usr \
8696         /usr/local \
8697         /usr/pkg \
8698         /opt \
8699         /opt/local \
8700         $HOME
8701 do
8702
8703 test "x$cf_subdir_prefix" != "x$prefix" && \
8704 test -d "$cf_subdir_prefix" && \
8705 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
8706         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
8707         test -d $cf_subdir_prefix/lib &&          cf_search="$cf_search $cf_subdir_prefix/lib"
8708         test -d $cf_subdir_prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root"
8709         test -d $cf_subdir_prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root/lib"
8710         test -d $cf_subdir_prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib"
8711         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"
8712 }
8713
8714 done
8715
8716 cf_search="$cf_library_path_list $cf_search"
8717
8718                         for cf_libdir in $cf_search
8719                         do
8720                                 echo "$as_me:8720: checking for -l$cf_nculib_root in $cf_libdir" >&5
8721 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
8722                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
8723                                 cat >conftest.$ac_ext <<_ACEOF
8724 #line 8724 "configure"
8725 #include "confdefs.h"
8726 #include <${cf_cv_ncurses_header:-curses.h}>
8727 int
8728 main ()
8729 {
8730 initscr()
8731   ;
8732   return 0;
8733 }
8734 _ACEOF
8735 rm -f conftest.$ac_objext conftest$ac_exeext
8736 if { (eval echo "$as_me:8736: \"$ac_link\"") >&5
8737   (eval $ac_link) 2>&5
8738   ac_status=$?
8739   echo "$as_me:8739: \$? = $ac_status" >&5
8740   (exit $ac_status); } &&
8741          { ac_try='test -s conftest$ac_exeext'
8742   { (eval echo "$as_me:8742: \"$ac_try\"") >&5
8743   (eval $ac_try) 2>&5
8744   ac_status=$?
8745   echo "$as_me:8745: \$? = $ac_status" >&5
8746   (exit $ac_status); }; }; then
8747   echo "$as_me:8747: result: yes" >&5
8748 echo "${ECHO_T}yes" >&6
8749                                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
8750                                          break
8751 else
8752   echo "$as_me: failed program was:" >&5
8753 cat conftest.$ac_ext >&5
8754 echo "$as_me:8754: result: no" >&5
8755 echo "${ECHO_T}no" >&6
8756                                          LIBS="$cf_save_LIBS"
8757 fi
8758 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8759                         done
8760
8761 fi
8762 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8763
8764 fi
8765
8766 eval 'cf_found_library=$cf_cv_have_lib_'$cf_nculib_root
8767
8768 if test $cf_found_library = no ; then
8769         { { echo "$as_me:8769: error: Cannot link $cf_nculib_root library" >&5
8770 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
8771    { (exit 1); exit 1; }; }
8772 fi
8773
8774 fi
8775
8776 if test -n "$cf_ncurses_LIBS" ; then
8777         echo "$as_me:8777: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
8778 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
8779         cf_ncurses_SAVE="$LIBS"
8780         for p in $cf_ncurses_LIBS ; do
8781                 q=`echo $LIBS | sed -e "s%$p %%" -e "s%$p$%%"`
8782                 if test "$q" != "$LIBS" ; then
8783                         LIBS="$q"
8784                 fi
8785         done
8786         cat >conftest.$ac_ext <<_ACEOF
8787 #line 8787 "configure"
8788 #include "confdefs.h"
8789 #include <${cf_cv_ncurses_header:-curses.h}>
8790 int
8791 main ()
8792 {
8793 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
8794   ;
8795   return 0;
8796 }
8797 _ACEOF
8798 rm -f conftest.$ac_objext conftest$ac_exeext
8799 if { (eval echo "$as_me:8799: \"$ac_link\"") >&5
8800   (eval $ac_link) 2>&5
8801   ac_status=$?
8802   echo "$as_me:8802: \$? = $ac_status" >&5
8803   (exit $ac_status); } &&
8804          { ac_try='test -s conftest$ac_exeext'
8805   { (eval echo "$as_me:8805: \"$ac_try\"") >&5
8806   (eval $ac_try) 2>&5
8807   ac_status=$?
8808   echo "$as_me:8808: \$? = $ac_status" >&5
8809   (exit $ac_status); }; }; then
8810   echo "$as_me:8810: result: yes" >&5
8811 echo "${ECHO_T}yes" >&6
8812 else
8813   echo "$as_me: failed program was:" >&5
8814 cat conftest.$ac_ext >&5
8815 echo "$as_me:8815: result: no" >&5
8816 echo "${ECHO_T}no" >&6
8817                  LIBS="$cf_ncurses_SAVE"
8818 fi
8819 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8820 fi
8821
8822 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
8823
8824 cat >>confdefs.h <<EOF
8825 #define $cf_nculib_ROOT 1
8826 EOF
8827
8828         fi
8829 else
8830         NCURSES_CONFIG=none
8831 fi
8832
8833 fi
8834
8835 if test "$NCURSES_CONFIG_PKG" != none ; then
8836         cf_version=`$PKG_CONFIG --modversion $NCURSES_CONFIG_PKG 2>/dev/null`
8837
8838         NCURSES_MAJOR=`echo "$cf_version" | sed -e 's/\..*//'`
8839         NCURSES_MINOR=`echo "$cf_version" | sed -e 's/^[0-9][0-9]*\.//' -e 's/\..*//'`
8840         NCURSES_PATCH=`echo "$cf_version" | sed -e 's/^[0-9][0-9]*\.[0-9][0-9]*\.//'`
8841
8842         cf_cv_abi_version=`$PKG_CONFIG --variable=abi_version $NCURSES_CONFIG_PKG 2>/dev/null`
8843         if test -z "$cf_cv_abi_version"
8844         then
8845                 cf_cv_abi_version=`$PKG_CONFIG --variable=major_version $NCURSES_CONFIG_PKG 2>/dev/null`
8846         fi
8847
8848 elif test "$NCURSES_CONFIG" != none ; then
8849
8850         cf_version=`$NCURSES_CONFIG --version 2>/dev/null`
8851
8852         NCURSES_MAJOR=`echo "$cf_version" | sed -e 's/\..*//'`
8853         NCURSES_MINOR=`echo "$cf_version" | sed -e 's/^[0-9][0-9]*\.//' -e 's/\..*//'`
8854         NCURSES_PATCH=`echo "$cf_version" | sed -e 's/^[0-9][0-9]*\.[0-9][0-9]*\.//'`
8855
8856         # ABI version is not available from headers
8857         cf_cv_abi_version=`$NCURSES_CONFIG --abi-version 2>/dev/null`
8858
8859 else
8860
8861         for cf_name in MAJOR MINOR PATCH
8862         do
8863         cat >conftest.$ac_ext <<CF_EOF
8864         #include <${cf_cv_ncurses_header:-curses.h}>
8865         AUTOCONF_$cf_name NCURSES_VERSION_$cf_name
8866 CF_EOF
8867                 cf_try="$ac_cpp conftest.$ac_ext 2>&5 | fgrep AUTOCONF_$cf_name >conftest.out"
8868                 { (eval echo "$as_me:8868: \"$cf_try\"") >&5
8869   (eval $cf_try) 2>&5
8870   ac_status=$?
8871   echo "$as_me:8871: \$? = $ac_status" >&5
8872   (exit $ac_status); }
8873                 if test -f conftest.out ; then
8874                         cf_result=`cat conftest.out | sed -e "s/^.*AUTOCONF_$cf_name[   ][      ]*//"`
8875                         eval NCURSES_$cf_name=\"$cf_result\"
8876                         # cat conftest.$ac_ext
8877                         # cat conftest.out
8878                 fi
8879         done
8880
8881         cf_cv_abi_version=${NCURSES_MAJOR}
8882
8883 fi
8884
8885 cf_cv_rel_version=${NCURSES_MAJOR}.${NCURSES_MINOR}
8886
8887 cf_cv_timestamp=`date`
8888
8889 echo "$as_me:8889: result: Configuring NCURSES $cf_cv_rel_version ABI $cf_cv_abi_version ($cf_cv_timestamp)" >&5
8890 echo "${ECHO_T}Configuring NCURSES $cf_cv_rel_version ABI $cf_cv_abi_version ($cf_cv_timestamp)" >&6
8891
8892 echo "$as_me:8892: checking if you want to have a library-prefix" >&5
8893 echo $ECHO_N "checking if you want to have a library-prefix... $ECHO_C" >&6
8894
8895 # Check whether --with-lib-prefix or --without-lib-prefix was given.
8896 if test "${with_lib_prefix+set}" = set; then
8897   withval="$with_lib_prefix"
8898   with_lib_prefix=$withval
8899 else
8900   with_lib_prefix=auto
8901 fi;
8902 echo "$as_me:8902: result: $with_lib_prefix" >&5
8903 echo "${ECHO_T}$with_lib_prefix" >&6
8904
8905 if test $with_lib_prefix = auto
8906 then
8907
8908         case $cf_cv_system_name in
8909         (OS/2*|os2*)
8910                 LIB_PREFIX=''
8911                 ;;
8912         (*)     LIB_PREFIX='lib'
8913                 ;;
8914         esac
8915 cf_prefix=$LIB_PREFIX
8916
8917 elif test $with_lib_prefix = no
8918 then
8919         LIB_PREFIX=
8920 else
8921         LIB_PREFIX=$with_lib_prefix
8922 fi
8923
8924 LIB_SUFFIX=
8925
8926 ###############################################################################
8927
8928 if test X"$CC_G_OPT" = X"" ; then
8929         CC_G_OPT='-g'
8930         test -n "$GCC" && test "${ac_cv_prog_cc_g}" != yes && CC_G_OPT=''
8931 fi
8932
8933 echo "$as_me:8933: checking for default loader flags" >&5
8934 echo $ECHO_N "checking for default loader flags... $ECHO_C" >&6
8935 case $DFT_LWR_MODEL in
8936 (normal)  LD_MODEL=''   ;;
8937 (debug)   LD_MODEL=$CC_G_OPT ;;
8938 (profile) LD_MODEL='-pg';;
8939 (shared)  LD_MODEL=''   ;;
8940 esac
8941 echo "$as_me:8941: result: $LD_MODEL" >&5
8942 echo "${ECHO_T}$LD_MODEL" >&6
8943
8944 LD_RPATH_OPT=
8945 echo "$as_me:8945: checking for an rpath option" >&5
8946 echo $ECHO_N "checking for an rpath option... $ECHO_C" >&6
8947 case $cf_cv_system_name in
8948 (irix*)
8949         if test "$GCC" = yes; then
8950                 LD_RPATH_OPT="-Wl,-rpath,"
8951         else
8952                 LD_RPATH_OPT="-rpath "
8953         fi
8954         ;;
8955 (linux*|gnu*|k*bsd*-gnu)
8956         LD_RPATH_OPT="-Wl,-rpath,"
8957         ;;
8958 (openbsd[2-9].*|mirbsd*)
8959         LD_RPATH_OPT="-Wl,-rpath,"
8960         ;;
8961 (dragonfly*|freebsd*)
8962         LD_RPATH_OPT="-rpath "
8963         ;;
8964 (netbsd*)
8965         LD_RPATH_OPT="-Wl,-rpath,"
8966         ;;
8967 (osf*|mls+*)
8968         LD_RPATH_OPT="-rpath "
8969         ;;
8970 (solaris2*)
8971         LD_RPATH_OPT="-R"
8972         ;;
8973 (*)
8974         ;;
8975 esac
8976 echo "$as_me:8976: result: $LD_RPATH_OPT" >&5
8977 echo "${ECHO_T}$LD_RPATH_OPT" >&6
8978
8979 case "x$LD_RPATH_OPT" in
8980 (x-R*)
8981         echo "$as_me:8981: checking if we need a space after rpath option" >&5
8982 echo $ECHO_N "checking if we need a space after rpath option... $ECHO_C" >&6
8983         cf_save_LIBS="$LIBS"
8984
8985 cf_add_libs="${LD_RPATH_OPT}$libdir"
8986 # Filter out duplicates - this happens with badly-designed ".pc" files...
8987 for cf_add_1lib in $LIBS
8988 do
8989         for cf_add_2lib in $cf_add_libs
8990         do
8991                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
8992                 then
8993                         cf_add_1lib=
8994                         break
8995                 fi
8996         done
8997         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
8998 done
8999 LIBS="$cf_add_libs"
9000
9001         cat >conftest.$ac_ext <<_ACEOF
9002 #line 9002 "configure"
9003 #include "confdefs.h"
9004
9005 int
9006 main ()
9007 {
9008
9009   ;
9010   return 0;
9011 }
9012 _ACEOF
9013 rm -f conftest.$ac_objext conftest$ac_exeext
9014 if { (eval echo "$as_me:9014: \"$ac_link\"") >&5
9015   (eval $ac_link) 2>&5
9016   ac_status=$?
9017   echo "$as_me:9017: \$? = $ac_status" >&5
9018   (exit $ac_status); } &&
9019          { ac_try='test -s conftest$ac_exeext'
9020   { (eval echo "$as_me:9020: \"$ac_try\"") >&5
9021   (eval $ac_try) 2>&5
9022   ac_status=$?
9023   echo "$as_me:9023: \$? = $ac_status" >&5
9024   (exit $ac_status); }; }; then
9025   cf_rpath_space=no
9026 else
9027   echo "$as_me: failed program was:" >&5
9028 cat conftest.$ac_ext >&5
9029 cf_rpath_space=yes
9030 fi
9031 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9032         LIBS="$cf_save_LIBS"
9033         echo "$as_me:9033: result: $cf_rpath_space" >&5
9034 echo "${ECHO_T}$cf_rpath_space" >&6
9035         test "$cf_rpath_space" = yes && LD_RPATH_OPT="$LD_RPATH_OPT "
9036         ;;
9037 esac
9038
9039         RM_SHARED_OPTS=
9040         LOCAL_LDFLAGS=
9041         LOCAL_LDFLAGS2=
9042         LD_SHARED_OPTS=
9043         INSTALL_LIB="-m 644"
9044         : ${rel_builddir:=.}
9045
9046         shlibdir=$libdir
9047
9048         MAKE_DLLS="#"
9049
9050         cf_cv_do_symlinks=no
9051         cf_ld_rpath_opt=
9052         test "$cf_cv_enable_rpath" = yes && cf_ld_rpath_opt="$LD_RPATH_OPT"
9053
9054         echo "$as_me:9054: checking if release/abi version should be used for shared libs" >&5
9055 echo $ECHO_N "checking if release/abi version should be used for shared libs... $ECHO_C" >&6
9056
9057 # Check whether --with-shlib-version or --without-shlib-version was given.
9058 if test "${with_shlib_version+set}" = set; then
9059   withval="$with_shlib_version"
9060   test -z "$withval" && withval=auto
9061         case $withval in
9062         (yes)
9063                 cf_cv_shlib_version=auto
9064                 ;;
9065         (rel|abi|auto)
9066                 cf_cv_shlib_version=$withval
9067                 ;;
9068         (*)
9069                 echo "$as_me:9069: result: $withval" >&5
9070 echo "${ECHO_T}$withval" >&6
9071                 { { echo "$as_me:9071: error: option value must be one of: rel, abi, or auto" >&5
9072 echo "$as_me: error: option value must be one of: rel, abi, or auto" >&2;}
9073    { (exit 1); exit 1; }; }
9074                 ;;
9075         esac
9076
9077 else
9078   cf_cv_shlib_version=auto
9079 fi;
9080         echo "$as_me:9080: result: $cf_cv_shlib_version" >&5
9081 echo "${ECHO_T}$cf_cv_shlib_version" >&6
9082
9083         cf_cv_rm_so_locs=no
9084         cf_try_cflags=
9085
9086         # Some less-capable ports of gcc support only -fpic
9087         CC_SHARED_OPTS=
9088         if test "$GCC" = yes
9089         then
9090                 echo "$as_me:9090: checking which $CC option to use" >&5
9091 echo $ECHO_N "checking which $CC option to use... $ECHO_C" >&6
9092                 cf_save_CFLAGS="$CFLAGS"
9093                 for CC_SHARED_OPTS in -fPIC -fpic ''
9094                 do
9095                         CFLAGS="$cf_save_CFLAGS $CC_SHARED_OPTS"
9096                         cat >conftest.$ac_ext <<_ACEOF
9097 #line 9097 "configure"
9098 #include "confdefs.h"
9099 #include <stdio.h>
9100 int
9101 main ()
9102 {
9103 int x = 1
9104   ;
9105   return 0;
9106 }
9107 _ACEOF
9108 rm -f conftest.$ac_objext
9109 if { (eval echo "$as_me:9109: \"$ac_compile\"") >&5
9110   (eval $ac_compile) 2>&5
9111   ac_status=$?
9112   echo "$as_me:9112: \$? = $ac_status" >&5
9113   (exit $ac_status); } &&
9114          { ac_try='test -s conftest.$ac_objext'
9115   { (eval echo "$as_me:9115: \"$ac_try\"") >&5
9116   (eval $ac_try) 2>&5
9117   ac_status=$?
9118   echo "$as_me:9118: \$? = $ac_status" >&5
9119   (exit $ac_status); }; }; then
9120   break
9121 else
9122   echo "$as_me: failed program was:" >&5
9123 cat conftest.$ac_ext >&5
9124 fi
9125 rm -f conftest.$ac_objext conftest.$ac_ext
9126                 done
9127                 echo "$as_me:9127: result: $CC_SHARED_OPTS" >&5
9128 echo "${ECHO_T}$CC_SHARED_OPTS" >&6
9129                 CFLAGS="$cf_save_CFLAGS"
9130         fi
9131
9132         cf_cv_shlib_version_infix=no
9133
9134         case $cf_cv_system_name in
9135         (aix4.3-9*|aix[5-7]*)
9136                 if test "$GCC" = yes; then
9137                         CC_SHARED_OPTS='-Wl,-brtl'
9138                         MK_SHARED_LIB='${CC} -shared -Wl,-brtl -Wl,-blibpath:${RPATH_LIST}:/usr/lib -o $@'
9139                 else
9140                         CC_SHARED_OPTS='-brtl'
9141                         # as well as '-qpic=large -G' or perhaps "-bM:SRE -bnoentry -bexpall"
9142                         MK_SHARED_LIB='${CC} -G -Wl,-brtl -Wl,-blibpath:${RPATH_LIST}:/usr/lib -o $@'
9143                 fi
9144                 ;;
9145         (beos*)
9146                 MK_SHARED_LIB='${CC} ${CFLAGS} -o $@ -Xlinker -soname=`basename $@` -nostart -e 0'
9147                 ;;
9148         (cygwin*)
9149                 CC_SHARED_OPTS=
9150                 MK_SHARED_LIB=$SHELL' '$rel_builddir'/mk_shared_lib.sh $@ ${CC} ${CFLAGS}'
9151                 RM_SHARED_OPTS="$RM_SHARED_OPTS $rel_builddir/mk_shared_lib.sh *.dll.a"
9152                 cf_cv_shlib_version=cygdll
9153                 cf_cv_shlib_version_infix=cygdll
9154                 shlibdir=$bindir
9155                 MAKE_DLLS=
9156                 cat >mk_shared_lib.sh <<-CF_EOF
9157                 #!$SHELL
9158                 SHARED_LIB=\$1
9159                 IMPORT_LIB=\`echo "\$1" | sed -e 's/cyg/lib/' -e 's/[0-9]*\.dll$/.dll.a/'\`
9160                 shift
9161                 cat <<-EOF
9162                 Linking shared library
9163                 ** SHARED_LIB \$SHARED_LIB
9164                 ** IMPORT_LIB \$IMPORT_LIB
9165 EOF
9166                 exec \$* -shared -Wl,--out-implib=\${IMPORT_LIB} -Wl,--export-all-symbols -o \${SHARED_LIB}
9167 CF_EOF
9168                 chmod +x mk_shared_lib.sh
9169                 ;;
9170         (msys*)
9171                 CC_SHARED_OPTS=
9172                 MK_SHARED_LIB=$SHELL' '$rel_builddir'/mk_shared_lib.sh $@ ${CC} ${CFLAGS}'
9173                 RM_SHARED_OPTS="$RM_SHARED_OPTS $rel_builddir/mk_shared_lib.sh *.dll.a"
9174                 cf_cv_shlib_version=msysdll
9175                 cf_cv_shlib_version_infix=msysdll
9176                 shlibdir=$bindir
9177                 MAKE_DLLS=
9178                 cat >mk_shared_lib.sh <<-CF_EOF
9179                 #!$SHELL
9180                 SHARED_LIB=\$1
9181                 IMPORT_LIB=\`echo "\$1" | sed -e 's/msys-/lib/' -e 's/[0-9]*\.dll$/.dll.a/'\`
9182                 shift
9183                 cat <<-EOF
9184                 Linking shared library
9185                 ** SHARED_LIB \$SHARED_LIB
9186                 ** IMPORT_LIB \$IMPORT_LIB
9187 EOF
9188                 exec \$* -shared -Wl,--out-implib=\${IMPORT_LIB} -Wl,--export-all-symbols -o \${SHARED_LIB}
9189 CF_EOF
9190                 chmod +x mk_shared_lib.sh
9191                 ;;
9192         (darwin*)
9193                 cf_try_cflags="no-cpp-precomp"
9194                 CC_SHARED_OPTS="-dynamic"
9195                 MK_SHARED_LIB='${CC} ${CFLAGS} -dynamiclib -install_name ${libdir}/`basename $@` -compatibility_version ${ABI_VERSION} -current_version ${ABI_VERSION} -o $@'
9196                 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=abi
9197                 cf_cv_shlib_version_infix=yes
9198                 echo "$as_me:9198: checking if ld -search_paths_first works" >&5
9199 echo $ECHO_N "checking if ld -search_paths_first works... $ECHO_C" >&6
9200 if test "${cf_cv_ldflags_search_paths_first+set}" = set; then
9201   echo $ECHO_N "(cached) $ECHO_C" >&6
9202 else
9203
9204                         cf_save_LDFLAGS=$LDFLAGS
9205                         LDFLAGS="$LDFLAGS -Wl,-search_paths_first"
9206                         cat >conftest.$ac_ext <<_ACEOF
9207 #line 9207 "configure"
9208 #include "confdefs.h"
9209
9210 int
9211 main ()
9212 {
9213 int i;
9214   ;
9215   return 0;
9216 }
9217 _ACEOF
9218 rm -f conftest.$ac_objext conftest$ac_exeext
9219 if { (eval echo "$as_me:9219: \"$ac_link\"") >&5
9220   (eval $ac_link) 2>&5
9221   ac_status=$?
9222   echo "$as_me:9222: \$? = $ac_status" >&5
9223   (exit $ac_status); } &&
9224          { ac_try='test -s conftest$ac_exeext'
9225   { (eval echo "$as_me:9225: \"$ac_try\"") >&5
9226   (eval $ac_try) 2>&5
9227   ac_status=$?
9228   echo "$as_me:9228: \$? = $ac_status" >&5
9229   (exit $ac_status); }; }; then
9230   cf_cv_ldflags_search_paths_first=yes
9231 else
9232   echo "$as_me: failed program was:" >&5
9233 cat conftest.$ac_ext >&5
9234 cf_cv_ldflags_search_paths_first=no
9235 fi
9236 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9237                                 LDFLAGS=$cf_save_LDFLAGS
9238 fi
9239 echo "$as_me:9239: result: $cf_cv_ldflags_search_paths_first" >&5
9240 echo "${ECHO_T}$cf_cv_ldflags_search_paths_first" >&6
9241                 if test $cf_cv_ldflags_search_paths_first = yes; then
9242                         LDFLAGS="$LDFLAGS -Wl,-search_paths_first"
9243                 fi
9244                 ;;
9245         (hpux[7-8]*)
9246                 # HP-UX 8.07 ld lacks "+b" option used for libdir search-list
9247                 if test "$GCC" != yes; then
9248                         CC_SHARED_OPTS='+Z'
9249                 fi
9250                 MK_SHARED_LIB='${LD} -b -o $@'
9251                 INSTALL_LIB="-m 555"
9252                 ;;
9253         (hpux*)
9254                 # (tested with gcc 2.7.2 -- I don't have c89)
9255                 if test "$GCC" = yes; then
9256                         LD_SHARED_OPTS='-Xlinker +b -Xlinker ${libdir}'
9257                 else
9258                         CC_SHARED_OPTS='+Z'
9259                         LD_SHARED_OPTS='-Wl,+b,${libdir}'
9260                 fi
9261                 MK_SHARED_LIB='${LD} +b ${libdir} -b -o $@'
9262                 # HP-UX shared libraries must be executable, and should be
9263                 # readonly to exploit a quirk in the memory manager.
9264                 INSTALL_LIB="-m 555"
9265                 ;;
9266         (interix*)
9267                 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
9268                 if test "$cf_cv_shlib_version" = rel; then
9269                         cf_shared_soname='`basename  .${REL_VERSION}`.${ABI_VERSION}'
9270                 else
9271                         cf_shared_soname='`basename `'
9272                 fi
9273                 CC_SHARED_OPTS=
9274                 MK_SHARED_LIB='${CC} -shared -Wl,-rpath,${RPATH_LIST} -Wl,-h,'$cf_shared_soname' -o '
9275                 ;;
9276         (irix*)
9277                 if test "$cf_cv_enable_rpath" = yes ; then
9278                         EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
9279                 fi
9280                 # tested with IRIX 5.2 and 'cc'.
9281                 if test "$GCC" != yes; then
9282                         CC_SHARED_OPTS='-KPIC'
9283                         MK_SHARED_LIB='${CC} -shared -rdata_shared -soname `basename $@` -o $@'
9284                 else
9285                         MK_SHARED_LIB='${CC} -shared -Wl,-soname,`basename $@` -o $@'
9286                 fi
9287                 cf_cv_rm_so_locs=yes
9288                 ;;
9289         (linux*|gnu*|k*bsd*-gnu)
9290                 if test "$DFT_LWR_MODEL" = "shared" ; then
9291                         LOCAL_LDFLAGS="${LD_RPATH_OPT}\$(LOCAL_LIBDIR)"
9292                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
9293                 fi
9294                 if test "$cf_cv_enable_rpath" = yes ; then
9295                         EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
9296                 fi
9297
9298         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
9299         if test "$cf_cv_shlib_version" = rel; then
9300                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
9301         else
9302                 cf_cv_shared_soname='`basename $@`'
9303         fi
9304
9305                 MK_SHARED_LIB='${CC} ${CFLAGS} -shared -Wl,-soname,'$cf_cv_shared_soname',-stats,-lc -o $@'
9306                 ;;
9307         (mingw*)
9308                 cf_cv_shlib_version=mingw
9309                 cf_cv_shlib_version_infix=mingw
9310                 shlibdir=$bindir
9311                 MAKE_DLLS=
9312                 if test "$DFT_LWR_MODEL" = "shared" ; then
9313                         LOCAL_LDFLAGS="-Wl,--enable-auto-import"
9314                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
9315                         EXTRA_LDFLAGS="-Wl,--enable-auto-import $EXTRA_LDFLAGS"
9316                 fi
9317                 CC_SHARED_OPTS=
9318                 MK_SHARED_LIB=$SHELL' '$rel_builddir'/mk_shared_lib.sh $@ ${CC} ${CFLAGS}'
9319                 RM_SHARED_OPTS="$RM_SHARED_OPTS $rel_builddir/mk_shared_lib.sh *.dll.a"
9320                 cat >mk_shared_lib.sh <<-CF_EOF
9321                 #!$SHELL
9322                 SHARED_LIB=\$1
9323                 IMPORT_LIB=\`echo "\$1" | sed -e 's/[0-9]*\.dll$/.dll.a/'\`
9324                 shift
9325                 cat <<-EOF
9326                 Linking shared library
9327                 ** SHARED_LIB \$SHARED_LIB
9328                 ** IMPORT_LIB \$IMPORT_LIB
9329 EOF
9330                 exec \$* -shared -Wl,--enable-auto-import,--out-implib=\${IMPORT_LIB} -Wl,--export-all-symbols -o \${SHARED_LIB}
9331 CF_EOF
9332                 chmod +x mk_shared_lib.sh
9333                 ;;
9334         (openbsd[2-9].*|mirbsd*)
9335                 if test "$DFT_LWR_MODEL" = "shared" ; then
9336                         LOCAL_LDFLAGS="${LD_RPATH_OPT}\$(LOCAL_LIBDIR)"
9337                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
9338                 fi
9339                 if test "$cf_cv_enable_rpath" = yes ; then
9340                         EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
9341                 fi
9342                 CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
9343
9344         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
9345         if test "$cf_cv_shlib_version" = rel; then
9346                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
9347         else
9348                 cf_cv_shared_soname='`basename $@`'
9349         fi
9350
9351                 MK_SHARED_LIB='${CC} ${CFLAGS} -shared -Wl,-Bshareable,-soname,'$cf_cv_shared_soname',-stats,-lc -o $@'
9352                 ;;
9353         (nto-qnx*|openbsd*|freebsd[12].*)
9354                 CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
9355                 MK_SHARED_LIB='${LD} -Bshareable -o $@'
9356                 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
9357                 ;;
9358         (dragonfly*|freebsd*)
9359                 CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
9360                 if test "$DFT_LWR_MODEL" = "shared" && test "$cf_cv_enable_rpath" = yes ; then
9361                         LOCAL_LDFLAGS="${cf_ld_rpath_opt}\$(LOCAL_LIBDIR)"
9362                         LOCAL_LDFLAGS2="${cf_ld_rpath_opt}\${RPATH_LIST} $LOCAL_LDFLAGS"
9363                         EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
9364                 fi
9365
9366         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
9367         if test "$cf_cv_shlib_version" = rel; then
9368                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
9369         else
9370                 cf_cv_shared_soname='`basename $@`'
9371         fi
9372
9373                 MK_SHARED_LIB='${CC} ${CFLAGS} -shared -Wl,-soname,'$cf_cv_shared_soname',-stats,-lc -o $@'
9374                 ;;
9375         (netbsd*)
9376                 CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
9377                 if test "$DFT_LWR_MODEL" = "shared" && test "$cf_cv_enable_rpath" = yes ; then
9378                         LOCAL_LDFLAGS="${cf_ld_rpath_opt}\$(LOCAL_LIBDIR)"
9379                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
9380                         EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
9381                         if test "$cf_cv_shlib_version" = auto; then
9382                         if test -f /usr/libexec/ld.elf_so; then
9383                                 cf_cv_shlib_version=abi
9384                         else
9385                                 cf_cv_shlib_version=rel
9386                         fi
9387                         fi
9388
9389         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
9390         if test "$cf_cv_shlib_version" = rel; then
9391                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
9392         else
9393                 cf_cv_shared_soname='`basename $@`'
9394         fi
9395
9396                         MK_SHARED_LIB='${CC} ${CFLAGS} -shared -Wl,-soname,'$cf_cv_shared_soname' -o $@'
9397                 else
9398                         MK_SHARED_LIB='${CC} -Wl,-shared -Wl,-Bshareable -o $@'
9399                 fi
9400                 ;;
9401         (osf*|mls+*)
9402                 # tested with OSF/1 V3.2 and 'cc'
9403                 # tested with OSF/1 V3.2 and gcc 2.6.3 (but the c++ demo didn't
9404                 # link with shared libs).
9405                 MK_SHARED_LIB='${LD} -set_version ${REL_VERSION}:${ABI_VERSION} -expect_unresolved "*" -shared -soname `basename $@`'
9406                 case $host_os in
9407                 (osf4*)
9408                         MK_SHARED_LIB="${MK_SHARED_LIB} -msym"
9409                         ;;
9410                 esac
9411                 MK_SHARED_LIB="${MK_SHARED_LIB}"' -o $@'
9412                 if test "$DFT_LWR_MODEL" = "shared" ; then
9413                         LOCAL_LDFLAGS="${LD_RPATH_OPT}\$(LOCAL_LIBDIR)"
9414                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
9415                 fi
9416                 cf_cv_rm_so_locs=yes
9417                 ;;
9418         (sco3.2v5*)  # also uw2* and UW7: hops 13-Apr-98
9419                 # tested with osr5.0.5
9420                 if test "$GCC" != yes; then
9421                         CC_SHARED_OPTS='-belf -KPIC'
9422                 fi
9423                 MK_SHARED_LIB='${LD} -dy -G -h `basename $@ .${REL_VERSION}`.${ABI_VERSION} -o $@'
9424                 if test "$cf_cv_enable_rpath" = yes ; then
9425                         # only way is to set LD_RUN_PATH but no switch for it
9426                         RUN_PATH=$libdir
9427                 fi
9428                 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
9429                 LINK_PROGS='LD_RUN_PATH=${libdir}'
9430                 LINK_TESTS='Pwd=`pwd`;LD_RUN_PATH=`dirname $${Pwd}`/lib'
9431                 ;;
9432         (sunos4*)
9433                 # tested with SunOS 4.1.1 and gcc 2.7.0
9434                 if test "$GCC" != yes; then
9435                         CC_SHARED_OPTS='-KPIC'
9436                 fi
9437                 MK_SHARED_LIB='${LD} -assert pure-text -o $@'
9438                 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
9439                 ;;
9440         (solaris2*)
9441                 # tested with SunOS 5.5.1 (solaris 2.5.1) and gcc 2.7.2
9442                 # tested with SunOS 5.10 (solaris 10) and gcc 3.4.3
9443                 if test "$DFT_LWR_MODEL" = "shared" ; then
9444                         LOCAL_LDFLAGS="-R \$(LOCAL_LIBDIR):\${libdir}"
9445                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
9446                 fi
9447                 if test "$cf_cv_enable_rpath" = yes ; then
9448                         EXTRA_LDFLAGS="-R \${libdir} $EXTRA_LDFLAGS"
9449                 fi
9450
9451         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
9452         if test "$cf_cv_shlib_version" = rel; then
9453                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
9454         else
9455                 cf_cv_shared_soname='`basename $@`'
9456         fi
9457
9458                 if test "$GCC" != yes; then
9459                         cf_save_CFLAGS="$CFLAGS"
9460                         for cf_shared_opts in -xcode=pic32 -xcode=pic13 -KPIC -Kpic -O
9461                         do
9462                                 CFLAGS="$cf_shared_opts $cf_save_CFLAGS"
9463                                 cat >conftest.$ac_ext <<_ACEOF
9464 #line 9464 "configure"
9465 #include "confdefs.h"
9466 #include <stdio.h>
9467 int
9468 main ()
9469 {
9470 printf("Hello\n");
9471   ;
9472   return 0;
9473 }
9474 _ACEOF
9475 rm -f conftest.$ac_objext
9476 if { (eval echo "$as_me:9476: \"$ac_compile\"") >&5
9477   (eval $ac_compile) 2>&5
9478   ac_status=$?
9479   echo "$as_me:9479: \$? = $ac_status" >&5
9480   (exit $ac_status); } &&
9481          { ac_try='test -s conftest.$ac_objext'
9482   { (eval echo "$as_me:9482: \"$ac_try\"") >&5
9483   (eval $ac_try) 2>&5
9484   ac_status=$?
9485   echo "$as_me:9485: \$? = $ac_status" >&5
9486   (exit $ac_status); }; }; then
9487   break
9488 else
9489   echo "$as_me: failed program was:" >&5
9490 cat conftest.$ac_ext >&5
9491 fi
9492 rm -f conftest.$ac_objext conftest.$ac_ext
9493                         done
9494                         CFLAGS="$cf_save_CFLAGS"
9495                         CC_SHARED_OPTS=$cf_shared_opts
9496                         MK_SHARED_LIB='${CC} -dy -G -h '$cf_cv_shared_soname' -o $@'
9497                 else
9498                         MK_SHARED_LIB='${CC} -shared -dy -G -h '$cf_cv_shared_soname' -o $@'
9499                 fi
9500                 ;;
9501         (sysv5uw7*|unix_sv*)
9502                 # tested with UnixWare 7.1.0 (gcc 2.95.2 and cc)
9503                 if test "$GCC" != yes; then
9504                         CC_SHARED_OPTS='-KPIC'
9505                 fi
9506                 MK_SHARED_LIB='${LD} -d y -G -o $@'
9507                 ;;
9508         (*)
9509                 CC_SHARED_OPTS='unknown'
9510                 MK_SHARED_LIB='echo unknown'
9511                 ;;
9512         esac
9513
9514         # This works if the last tokens in $MK_SHARED_LIB are the -o target.
9515         case "$cf_cv_shlib_version" in
9516         (rel|abi)
9517                 case "$MK_SHARED_LIB" in
9518                 (*'-o $@')
9519                         test "$cf_cv_do_symlinks" = no && cf_cv_do_symlinks=yes
9520                         ;;
9521                 (*)
9522                         { echo "$as_me:9522: WARNING: ignored --with-shlib-version" >&5
9523 echo "$as_me: WARNING: ignored --with-shlib-version" >&2;}
9524                         ;;
9525                 esac
9526                 ;;
9527         esac
9528
9529         if test -n "$cf_try_cflags"
9530         then
9531 cat > conftest.$ac_ext <<EOF
9532 #line 9532 "${as_me:-configure}"
9533 #include <stdio.h>
9534 int main(int argc, char *argv[])
9535 {
9536         printf("hello\n");
9537         return (argv[argc-1] == 0) ;
9538 }
9539 EOF
9540                 cf_save_CFLAGS="$CFLAGS"
9541                 for cf_opt in $cf_try_cflags
9542                 do
9543                         CFLAGS="$cf_save_CFLAGS -$cf_opt"
9544                         echo "$as_me:9544: checking if CFLAGS option -$cf_opt works" >&5
9545 echo $ECHO_N "checking if CFLAGS option -$cf_opt works... $ECHO_C" >&6
9546                         if { (eval echo "$as_me:9546: \"$ac_compile\"") >&5
9547   (eval $ac_compile) 2>&5
9548   ac_status=$?
9549   echo "$as_me:9549: \$? = $ac_status" >&5
9550   (exit $ac_status); }; then
9551                                 echo "$as_me:9551: result: yes" >&5
9552 echo "${ECHO_T}yes" >&6
9553                                 cf_save_CFLAGS="$CFLAGS"
9554                         else
9555                                 echo "$as_me:9555: result: no" >&5
9556 echo "${ECHO_T}no" >&6
9557                         fi
9558                 done
9559                 CFLAGS="$cf_save_CFLAGS"
9560         fi
9561
9562         # RPATH_LIST is a colon-separated list of directories
9563         test -n "$cf_ld_rpath_opt" && MK_SHARED_LIB="$MK_SHARED_LIB $cf_ld_rpath_opt\${RPATH_LIST}"
9564         test -z "$RPATH_LIST" && RPATH_LIST="\${libdir}"
9565
9566         test $cf_cv_rm_so_locs = yes && RM_SHARED_OPTS="$RM_SHARED_OPTS so_locations"
9567
9568         test -n "$verbose" && echo "    CC_SHARED_OPTS: $CC_SHARED_OPTS" 1>&6
9569
9570 echo "${as_me:-configure}:9570: testing CC_SHARED_OPTS: $CC_SHARED_OPTS ..." 1>&5
9571
9572         test -n "$verbose" && echo "    MK_SHARED_LIB:  $MK_SHARED_LIB" 1>&6
9573
9574 echo "${as_me:-configure}:9574: testing MK_SHARED_LIB:  $MK_SHARED_LIB ..." 1>&5
9575
9576 # The test/sample programs in the original tree link using rpath option.
9577 # Make it optional for packagers.
9578 if test -n "$LOCAL_LDFLAGS"
9579 then
9580         echo "$as_me:9580: checking if you want to link sample programs with rpath option" >&5
9581 echo $ECHO_N "checking if you want to link sample programs with rpath option... $ECHO_C" >&6
9582
9583 # Check whether --enable-rpath-link or --disable-rpath-link was given.
9584 if test "${enable_rpath_link+set}" = set; then
9585   enableval="$enable_rpath_link"
9586   with_rpath_link=$enableval
9587 else
9588   with_rpath_link=yes
9589 fi;
9590         echo "$as_me:9590: result: $with_rpath_link" >&5
9591 echo "${ECHO_T}$with_rpath_link" >&6
9592         if test "$with_rpath_link" = no
9593         then
9594                 LOCAL_LDFLAGS=
9595                 LOCAL_LDFLAGS2=
9596         fi
9597 fi
9598
9599 ###############################################################################
9600
9601 ###   use option --enable-broken-linker to force on use of broken-linker support
9602 echo "$as_me:9602: checking if you want broken-linker support code" >&5
9603 echo $ECHO_N "checking if you want broken-linker support code... $ECHO_C" >&6
9604
9605 # Check whether --enable-broken_linker or --disable-broken_linker was given.
9606 if test "${enable_broken_linker+set}" = set; then
9607   enableval="$enable_broken_linker"
9608   with_broken_linker=$enableval
9609 else
9610   with_broken_linker=${BROKEN_LINKER:-no}
9611 fi;
9612 echo "$as_me:9612: result: $with_broken_linker" >&5
9613 echo "${ECHO_T}$with_broken_linker" >&6
9614
9615 BROKEN_LINKER=0
9616 if test "$with_broken_linker" = yes ; then
9617         cat >>confdefs.h <<\EOF
9618 #define BROKEN_LINKER 1
9619 EOF
9620
9621         BROKEN_LINKER=1
9622 elif test "$DFT_LWR_MODEL" = shared ; then
9623         case $cf_cv_system_name in
9624         (cygwin*)
9625                 cat >>confdefs.h <<\EOF
9626 #define BROKEN_LINKER 1
9627 EOF
9628
9629                 BROKEN_LINKER=1
9630                 test -n "$verbose" && echo "    cygwin linker is broken anyway" 1>&6
9631
9632 echo "${as_me:-configure}:9632: testing cygwin linker is broken anyway ..." 1>&5
9633
9634                 ;;
9635         esac
9636 fi
9637
9638 # Check to define _XOPEN_SOURCE "automatically"
9639
9640 cf_XOPEN_SOURCE=500
9641 cf_POSIX_C_SOURCE=199506L
9642 cf_xopen_source=
9643
9644 case $host_os in
9645 (aix[4-7]*)
9646         cf_xopen_source="-D_ALL_SOURCE"
9647         ;;
9648 (cygwin|msys)
9649         cf_XOPEN_SOURCE=600
9650         ;;
9651 (darwin[0-8].*)
9652         cf_xopen_source="-D_APPLE_C_SOURCE"
9653         ;;
9654 (darwin*)
9655         cf_xopen_source="-D_DARWIN_C_SOURCE"
9656         cf_XOPEN_SOURCE=
9657         ;;
9658 (freebsd*|dragonfly*)
9659         # 5.x headers associate
9660         #       _XOPEN_SOURCE=600 with _POSIX_C_SOURCE=200112L
9661         #       _XOPEN_SOURCE=500 with _POSIX_C_SOURCE=199506L
9662         cf_POSIX_C_SOURCE=200112L
9663         cf_XOPEN_SOURCE=600
9664         cf_xopen_source="-D_BSD_TYPES -D__BSD_VISIBLE -D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
9665         ;;
9666 (hpux11*)
9667         cf_xopen_source="-D_HPUX_SOURCE -D_XOPEN_SOURCE=500"
9668         ;;
9669 (hpux*)
9670         cf_xopen_source="-D_HPUX_SOURCE"
9671         ;;
9672 (irix[56].*)
9673         cf_xopen_source="-D_SGI_SOURCE"
9674         cf_XOPEN_SOURCE=
9675         ;;
9676 (linux*|gnu*|mint*|k*bsd*-gnu)
9677
9678 echo "$as_me:9678: checking if we must define _GNU_SOURCE" >&5
9679 echo $ECHO_N "checking if we must define _GNU_SOURCE... $ECHO_C" >&6
9680 if test "${cf_cv_gnu_source+set}" = set; then
9681   echo $ECHO_N "(cached) $ECHO_C" >&6
9682 else
9683
9684 cat >conftest.$ac_ext <<_ACEOF
9685 #line 9685 "configure"
9686 #include "confdefs.h"
9687 #include <sys/types.h>
9688 int
9689 main ()
9690 {
9691
9692 #ifndef _XOPEN_SOURCE
9693 make an error
9694 #endif
9695   ;
9696   return 0;
9697 }
9698 _ACEOF
9699 rm -f conftest.$ac_objext
9700 if { (eval echo "$as_me:9700: \"$ac_compile\"") >&5
9701   (eval $ac_compile) 2>&5
9702   ac_status=$?
9703   echo "$as_me:9703: \$? = $ac_status" >&5
9704   (exit $ac_status); } &&
9705          { ac_try='test -s conftest.$ac_objext'
9706   { (eval echo "$as_me:9706: \"$ac_try\"") >&5
9707   (eval $ac_try) 2>&5
9708   ac_status=$?
9709   echo "$as_me:9709: \$? = $ac_status" >&5
9710   (exit $ac_status); }; }; then
9711   cf_cv_gnu_source=no
9712 else
9713   echo "$as_me: failed program was:" >&5
9714 cat conftest.$ac_ext >&5
9715 cf_save="$CPPFLAGS"
9716          CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
9717          cat >conftest.$ac_ext <<_ACEOF
9718 #line 9718 "configure"
9719 #include "confdefs.h"
9720 #include <sys/types.h>
9721 int
9722 main ()
9723 {
9724
9725 #ifdef _XOPEN_SOURCE
9726 make an error
9727 #endif
9728   ;
9729   return 0;
9730 }
9731 _ACEOF
9732 rm -f conftest.$ac_objext
9733 if { (eval echo "$as_me:9733: \"$ac_compile\"") >&5
9734   (eval $ac_compile) 2>&5
9735   ac_status=$?
9736   echo "$as_me:9736: \$? = $ac_status" >&5
9737   (exit $ac_status); } &&
9738          { ac_try='test -s conftest.$ac_objext'
9739   { (eval echo "$as_me:9739: \"$ac_try\"") >&5
9740   (eval $ac_try) 2>&5
9741   ac_status=$?
9742   echo "$as_me:9742: \$? = $ac_status" >&5
9743   (exit $ac_status); }; }; then
9744   cf_cv_gnu_source=no
9745 else
9746   echo "$as_me: failed program was:" >&5
9747 cat conftest.$ac_ext >&5
9748 cf_cv_gnu_source=yes
9749 fi
9750 rm -f conftest.$ac_objext conftest.$ac_ext
9751         CPPFLAGS="$cf_save"
9752
9753 fi
9754 rm -f conftest.$ac_objext conftest.$ac_ext
9755
9756 fi
9757 echo "$as_me:9757: result: $cf_cv_gnu_source" >&5
9758 echo "${ECHO_T}$cf_cv_gnu_source" >&6
9759 test "$cf_cv_gnu_source" = yes && CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
9760
9761         ;;
9762 (minix*)
9763         cf_xopen_source="-D_NETBSD_SOURCE" # POSIX.1-2001 features are ifdef'd with this...
9764         ;;
9765 (mirbsd*)
9766         # setting _XOPEN_SOURCE or _POSIX_SOURCE breaks <sys/select.h> and other headers which use u_int / u_short types
9767         cf_XOPEN_SOURCE=
9768
9769 cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE
9770
9771 cf_save_CFLAGS="$CFLAGS"
9772 cf_save_CPPFLAGS="$CPPFLAGS"
9773
9774 cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \
9775         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
9776                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
9777
9778 cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \
9779         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
9780                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
9781
9782 echo "$as_me:9782: checking if we should define _POSIX_C_SOURCE" >&5
9783 echo $ECHO_N "checking if we should define _POSIX_C_SOURCE... $ECHO_C" >&6
9784 if test "${cf_cv_posix_c_source+set}" = set; then
9785   echo $ECHO_N "(cached) $ECHO_C" >&6
9786 else
9787
9788 echo "${as_me:-configure}:9788: testing if the symbol is already defined go no further ..." 1>&5
9789
9790         cat >conftest.$ac_ext <<_ACEOF
9791 #line 9791 "configure"
9792 #include "confdefs.h"
9793 #include <sys/types.h>
9794 int
9795 main ()
9796 {
9797
9798 #ifndef _POSIX_C_SOURCE
9799 make an error
9800 #endif
9801   ;
9802   return 0;
9803 }
9804 _ACEOF
9805 rm -f conftest.$ac_objext
9806 if { (eval echo "$as_me:9806: \"$ac_compile\"") >&5
9807   (eval $ac_compile) 2>&5
9808   ac_status=$?
9809   echo "$as_me:9809: \$? = $ac_status" >&5
9810   (exit $ac_status); } &&
9811          { ac_try='test -s conftest.$ac_objext'
9812   { (eval echo "$as_me:9812: \"$ac_try\"") >&5
9813   (eval $ac_try) 2>&5
9814   ac_status=$?
9815   echo "$as_me:9815: \$? = $ac_status" >&5
9816   (exit $ac_status); }; }; then
9817   cf_cv_posix_c_source=no
9818 else
9819   echo "$as_me: failed program was:" >&5
9820 cat conftest.$ac_ext >&5
9821 cf_want_posix_source=no
9822          case .$cf_POSIX_C_SOURCE in
9823          (.[12]??*)
9824                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
9825                 ;;
9826          (.2)
9827                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
9828                 cf_want_posix_source=yes
9829                 ;;
9830          (.*)
9831                 cf_want_posix_source=yes
9832                 ;;
9833          esac
9834          if test "$cf_want_posix_source" = yes ; then
9835                 cat >conftest.$ac_ext <<_ACEOF
9836 #line 9836 "configure"
9837 #include "confdefs.h"
9838 #include <sys/types.h>
9839 int
9840 main ()
9841 {
9842
9843 #ifdef _POSIX_SOURCE
9844 make an error
9845 #endif
9846   ;
9847   return 0;
9848 }
9849 _ACEOF
9850 rm -f conftest.$ac_objext
9851 if { (eval echo "$as_me:9851: \"$ac_compile\"") >&5
9852   (eval $ac_compile) 2>&5
9853   ac_status=$?
9854   echo "$as_me:9854: \$? = $ac_status" >&5
9855   (exit $ac_status); } &&
9856          { ac_try='test -s conftest.$ac_objext'
9857   { (eval echo "$as_me:9857: \"$ac_try\"") >&5
9858   (eval $ac_try) 2>&5
9859   ac_status=$?
9860   echo "$as_me:9860: \$? = $ac_status" >&5
9861   (exit $ac_status); }; }; then
9862   :
9863 else
9864   echo "$as_me: failed program was:" >&5
9865 cat conftest.$ac_ext >&5
9866 cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE"
9867 fi
9868 rm -f conftest.$ac_objext conftest.$ac_ext
9869          fi
9870
9871 echo "${as_me:-configure}:9871: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
9872
9873          CFLAGS="$cf_trim_CFLAGS"
9874          CPPFLAGS="$cf_trim_CPPFLAGS $cf_cv_posix_c_source"
9875
9876 echo "${as_me:-configure}:9876: testing if the second compile does not leave our definition intact error ..." 1>&5
9877
9878          cat >conftest.$ac_ext <<_ACEOF
9879 #line 9879 "configure"
9880 #include "confdefs.h"
9881 #include <sys/types.h>
9882 int
9883 main ()
9884 {
9885
9886 #ifndef _POSIX_C_SOURCE
9887 make an error
9888 #endif
9889   ;
9890   return 0;
9891 }
9892 _ACEOF
9893 rm -f conftest.$ac_objext
9894 if { (eval echo "$as_me:9894: \"$ac_compile\"") >&5
9895   (eval $ac_compile) 2>&5
9896   ac_status=$?
9897   echo "$as_me:9897: \$? = $ac_status" >&5
9898   (exit $ac_status); } &&
9899          { ac_try='test -s conftest.$ac_objext'
9900   { (eval echo "$as_me:9900: \"$ac_try\"") >&5
9901   (eval $ac_try) 2>&5
9902   ac_status=$?
9903   echo "$as_me:9903: \$? = $ac_status" >&5
9904   (exit $ac_status); }; }; then
9905   :
9906 else
9907   echo "$as_me: failed program was:" >&5
9908 cat conftest.$ac_ext >&5
9909 cf_cv_posix_c_source=no
9910 fi
9911 rm -f conftest.$ac_objext conftest.$ac_ext
9912          CFLAGS="$cf_save_CFLAGS"
9913          CPPFLAGS="$cf_save_CPPFLAGS"
9914
9915 fi
9916 rm -f conftest.$ac_objext conftest.$ac_ext
9917
9918 fi
9919 echo "$as_me:9919: result: $cf_cv_posix_c_source" >&5
9920 echo "${ECHO_T}$cf_cv_posix_c_source" >&6
9921
9922 if test "$cf_cv_posix_c_source" != no ; then
9923         CFLAGS="$cf_trim_CFLAGS"
9924         CPPFLAGS="$cf_trim_CPPFLAGS"
9925
9926 cf_fix_cppflags=no
9927 cf_new_cflags=
9928 cf_new_cppflags=
9929 cf_new_extra_cppflags=
9930
9931 for cf_add_cflags in $cf_cv_posix_c_source
9932 do
9933 case $cf_fix_cppflags in
9934 (no)
9935         case $cf_add_cflags in
9936         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
9937                 case $cf_add_cflags in
9938                 (-D*)
9939                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
9940
9941                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
9942                                 && test -z "${cf_tst_cflags}" \
9943                                 && cf_fix_cppflags=yes
9944
9945                         if test $cf_fix_cppflags = yes ; then
9946                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
9947                                 continue
9948                         elif test "${cf_tst_cflags}" = "\"'" ; then
9949                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
9950                                 continue
9951                         fi
9952                         ;;
9953                 esac
9954                 case "$CPPFLAGS" in
9955                 (*$cf_add_cflags)
9956                         ;;
9957                 (*)
9958                         case $cf_add_cflags in
9959                         (-D*)
9960                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
9961
9962 CPPFLAGS=`echo "$CPPFLAGS" | \
9963         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
9964                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
9965
9966                                 ;;
9967                         esac
9968                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
9969                         ;;
9970                 esac
9971                 ;;
9972         (*)
9973                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
9974                 ;;
9975         esac
9976         ;;
9977 (yes)
9978         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
9979
9980         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
9981
9982         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
9983                 && test -z "${cf_tst_cflags}" \
9984                 && cf_fix_cppflags=no
9985         ;;
9986 esac
9987 done
9988
9989 if test -n "$cf_new_cflags" ; then
9990
9991         CFLAGS="$CFLAGS $cf_new_cflags"
9992 fi
9993
9994 if test -n "$cf_new_cppflags" ; then
9995
9996         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
9997 fi
9998
9999 if test -n "$cf_new_extra_cppflags" ; then
10000
10001         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
10002 fi
10003
10004 fi
10005
10006         ;;
10007 (netbsd*)
10008         cf_xopen_source="-D_NETBSD_SOURCE" # setting _XOPEN_SOURCE breaks IPv6 for lynx on NetBSD 1.6, breaks xterm, is not needed for ncursesw
10009         ;;
10010 (openbsd[4-9]*)
10011         # setting _XOPEN_SOURCE lower than 500 breaks g++ compile with wchar.h, needed for ncursesw
10012         cf_xopen_source="-D_BSD_SOURCE"
10013         cf_XOPEN_SOURCE=600
10014         ;;
10015 (openbsd*)
10016         # setting _XOPEN_SOURCE breaks xterm on OpenBSD 2.8, is not needed for ncursesw
10017         ;;
10018 (osf[45]*)
10019         cf_xopen_source="-D_OSF_SOURCE"
10020         ;;
10021 (nto-qnx*)
10022         cf_xopen_source="-D_QNX_SOURCE"
10023         ;;
10024 (sco*)
10025         # setting _XOPEN_SOURCE breaks Lynx on SCO Unix / OpenServer
10026         ;;
10027 (solaris2.*)
10028         cf_xopen_source="-D__EXTENSIONS__"
10029         cf_cv_xopen_source=broken
10030         ;;
10031 (sysv4.2uw2.*) # Novell/SCO UnixWare 2.x (tested on 2.1.2)
10032         cf_XOPEN_SOURCE=
10033         cf_POSIX_C_SOURCE=
10034         ;;
10035 (*)
10036
10037 echo "$as_me:10037: checking if we should define _XOPEN_SOURCE" >&5
10038 echo $ECHO_N "checking if we should define _XOPEN_SOURCE... $ECHO_C" >&6
10039 if test "${cf_cv_xopen_source+set}" = set; then
10040   echo $ECHO_N "(cached) $ECHO_C" >&6
10041 else
10042
10043         cat >conftest.$ac_ext <<_ACEOF
10044 #line 10044 "configure"
10045 #include "confdefs.h"
10046
10047 #include <stdlib.h>
10048 #include <string.h>
10049 #include <sys/types.h>
10050
10051 int
10052 main ()
10053 {
10054
10055 #ifndef _XOPEN_SOURCE
10056 make an error
10057 #endif
10058   ;
10059   return 0;
10060 }
10061 _ACEOF
10062 rm -f conftest.$ac_objext
10063 if { (eval echo "$as_me:10063: \"$ac_compile\"") >&5
10064   (eval $ac_compile) 2>&5
10065   ac_status=$?
10066   echo "$as_me:10066: \$? = $ac_status" >&5
10067   (exit $ac_status); } &&
10068          { ac_try='test -s conftest.$ac_objext'
10069   { (eval echo "$as_me:10069: \"$ac_try\"") >&5
10070   (eval $ac_try) 2>&5
10071   ac_status=$?
10072   echo "$as_me:10072: \$? = $ac_status" >&5
10073   (exit $ac_status); }; }; then
10074   cf_cv_xopen_source=no
10075 else
10076   echo "$as_me: failed program was:" >&5
10077 cat conftest.$ac_ext >&5
10078 cf_save="$CPPFLAGS"
10079          CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
10080          cat >conftest.$ac_ext <<_ACEOF
10081 #line 10081 "configure"
10082 #include "confdefs.h"
10083
10084 #include <stdlib.h>
10085 #include <string.h>
10086 #include <sys/types.h>
10087
10088 int
10089 main ()
10090 {
10091
10092 #ifdef _XOPEN_SOURCE
10093 make an error
10094 #endif
10095   ;
10096   return 0;
10097 }
10098 _ACEOF
10099 rm -f conftest.$ac_objext
10100 if { (eval echo "$as_me:10100: \"$ac_compile\"") >&5
10101   (eval $ac_compile) 2>&5
10102   ac_status=$?
10103   echo "$as_me:10103: \$? = $ac_status" >&5
10104   (exit $ac_status); } &&
10105          { ac_try='test -s conftest.$ac_objext'
10106   { (eval echo "$as_me:10106: \"$ac_try\"") >&5
10107   (eval $ac_try) 2>&5
10108   ac_status=$?
10109   echo "$as_me:10109: \$? = $ac_status" >&5
10110   (exit $ac_status); }; }; then
10111   cf_cv_xopen_source=no
10112 else
10113   echo "$as_me: failed program was:" >&5
10114 cat conftest.$ac_ext >&5
10115 cf_cv_xopen_source=$cf_XOPEN_SOURCE
10116 fi
10117 rm -f conftest.$ac_objext conftest.$ac_ext
10118         CPPFLAGS="$cf_save"
10119
10120 fi
10121 rm -f conftest.$ac_objext conftest.$ac_ext
10122
10123 fi
10124 echo "$as_me:10124: result: $cf_cv_xopen_source" >&5
10125 echo "${ECHO_T}$cf_cv_xopen_source" >&6
10126
10127 if test "$cf_cv_xopen_source" != no ; then
10128
10129 CFLAGS=`echo "$CFLAGS" | \
10130         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
10131                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
10132
10133 CPPFLAGS=`echo "$CPPFLAGS" | \
10134         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
10135                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
10136
10137         cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source"
10138
10139 cf_fix_cppflags=no
10140 cf_new_cflags=
10141 cf_new_cppflags=
10142 cf_new_extra_cppflags=
10143
10144 for cf_add_cflags in $cf_temp_xopen_source
10145 do
10146 case $cf_fix_cppflags in
10147 (no)
10148         case $cf_add_cflags in
10149         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
10150                 case $cf_add_cflags in
10151                 (-D*)
10152                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
10153
10154                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10155                                 && test -z "${cf_tst_cflags}" \
10156                                 && cf_fix_cppflags=yes
10157
10158                         if test $cf_fix_cppflags = yes ; then
10159                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10160                                 continue
10161                         elif test "${cf_tst_cflags}" = "\"'" ; then
10162                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10163                                 continue
10164                         fi
10165                         ;;
10166                 esac
10167                 case "$CPPFLAGS" in
10168                 (*$cf_add_cflags)
10169                         ;;
10170                 (*)
10171                         case $cf_add_cflags in
10172                         (-D*)
10173                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
10174
10175 CPPFLAGS=`echo "$CPPFLAGS" | \
10176         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
10177                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
10178
10179                                 ;;
10180                         esac
10181                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
10182                         ;;
10183                 esac
10184                 ;;
10185         (*)
10186                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
10187                 ;;
10188         esac
10189         ;;
10190 (yes)
10191         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10192
10193         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
10194
10195         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10196                 && test -z "${cf_tst_cflags}" \
10197                 && cf_fix_cppflags=no
10198         ;;
10199 esac
10200 done
10201
10202 if test -n "$cf_new_cflags" ; then
10203
10204         CFLAGS="$CFLAGS $cf_new_cflags"
10205 fi
10206
10207 if test -n "$cf_new_cppflags" ; then
10208
10209         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
10210 fi
10211
10212 if test -n "$cf_new_extra_cppflags" ; then
10213
10214         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
10215 fi
10216
10217 fi
10218
10219 cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE
10220
10221 cf_save_CFLAGS="$CFLAGS"
10222 cf_save_CPPFLAGS="$CPPFLAGS"
10223
10224 cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \
10225         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
10226                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
10227
10228 cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \
10229         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
10230                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
10231
10232 echo "$as_me:10232: checking if we should define _POSIX_C_SOURCE" >&5
10233 echo $ECHO_N "checking if we should define _POSIX_C_SOURCE... $ECHO_C" >&6
10234 if test "${cf_cv_posix_c_source+set}" = set; then
10235   echo $ECHO_N "(cached) $ECHO_C" >&6
10236 else
10237
10238 echo "${as_me:-configure}:10238: testing if the symbol is already defined go no further ..." 1>&5
10239
10240         cat >conftest.$ac_ext <<_ACEOF
10241 #line 10241 "configure"
10242 #include "confdefs.h"
10243 #include <sys/types.h>
10244 int
10245 main ()
10246 {
10247
10248 #ifndef _POSIX_C_SOURCE
10249 make an error
10250 #endif
10251   ;
10252   return 0;
10253 }
10254 _ACEOF
10255 rm -f conftest.$ac_objext
10256 if { (eval echo "$as_me:10256: \"$ac_compile\"") >&5
10257   (eval $ac_compile) 2>&5
10258   ac_status=$?
10259   echo "$as_me:10259: \$? = $ac_status" >&5
10260   (exit $ac_status); } &&
10261          { ac_try='test -s conftest.$ac_objext'
10262   { (eval echo "$as_me:10262: \"$ac_try\"") >&5
10263   (eval $ac_try) 2>&5
10264   ac_status=$?
10265   echo "$as_me:10265: \$? = $ac_status" >&5
10266   (exit $ac_status); }; }; then
10267   cf_cv_posix_c_source=no
10268 else
10269   echo "$as_me: failed program was:" >&5
10270 cat conftest.$ac_ext >&5
10271 cf_want_posix_source=no
10272          case .$cf_POSIX_C_SOURCE in
10273          (.[12]??*)
10274                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
10275                 ;;
10276          (.2)
10277                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
10278                 cf_want_posix_source=yes
10279                 ;;
10280          (.*)
10281                 cf_want_posix_source=yes
10282                 ;;
10283          esac
10284          if test "$cf_want_posix_source" = yes ; then
10285                 cat >conftest.$ac_ext <<_ACEOF
10286 #line 10286 "configure"
10287 #include "confdefs.h"
10288 #include <sys/types.h>
10289 int
10290 main ()
10291 {
10292
10293 #ifdef _POSIX_SOURCE
10294 make an error
10295 #endif
10296   ;
10297   return 0;
10298 }
10299 _ACEOF
10300 rm -f conftest.$ac_objext
10301 if { (eval echo "$as_me:10301: \"$ac_compile\"") >&5
10302   (eval $ac_compile) 2>&5
10303   ac_status=$?
10304   echo "$as_me:10304: \$? = $ac_status" >&5
10305   (exit $ac_status); } &&
10306          { ac_try='test -s conftest.$ac_objext'
10307   { (eval echo "$as_me:10307: \"$ac_try\"") >&5
10308   (eval $ac_try) 2>&5
10309   ac_status=$?
10310   echo "$as_me:10310: \$? = $ac_status" >&5
10311   (exit $ac_status); }; }; then
10312   :
10313 else
10314   echo "$as_me: failed program was:" >&5
10315 cat conftest.$ac_ext >&5
10316 cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE"
10317 fi
10318 rm -f conftest.$ac_objext conftest.$ac_ext
10319          fi
10320
10321 echo "${as_me:-configure}:10321: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
10322
10323          CFLAGS="$cf_trim_CFLAGS"
10324          CPPFLAGS="$cf_trim_CPPFLAGS $cf_cv_posix_c_source"
10325
10326 echo "${as_me:-configure}:10326: testing if the second compile does not leave our definition intact error ..." 1>&5
10327
10328          cat >conftest.$ac_ext <<_ACEOF
10329 #line 10329 "configure"
10330 #include "confdefs.h"
10331 #include <sys/types.h>
10332 int
10333 main ()
10334 {
10335
10336 #ifndef _POSIX_C_SOURCE
10337 make an error
10338 #endif
10339   ;
10340   return 0;
10341 }
10342 _ACEOF
10343 rm -f conftest.$ac_objext
10344 if { (eval echo "$as_me:10344: \"$ac_compile\"") >&5
10345   (eval $ac_compile) 2>&5
10346   ac_status=$?
10347   echo "$as_me:10347: \$? = $ac_status" >&5
10348   (exit $ac_status); } &&
10349          { ac_try='test -s conftest.$ac_objext'
10350   { (eval echo "$as_me:10350: \"$ac_try\"") >&5
10351   (eval $ac_try) 2>&5
10352   ac_status=$?
10353   echo "$as_me:10353: \$? = $ac_status" >&5
10354   (exit $ac_status); }; }; then
10355   :
10356 else
10357   echo "$as_me: failed program was:" >&5
10358 cat conftest.$ac_ext >&5
10359 cf_cv_posix_c_source=no
10360 fi
10361 rm -f conftest.$ac_objext conftest.$ac_ext
10362          CFLAGS="$cf_save_CFLAGS"
10363          CPPFLAGS="$cf_save_CPPFLAGS"
10364
10365 fi
10366 rm -f conftest.$ac_objext conftest.$ac_ext
10367
10368 fi
10369 echo "$as_me:10369: result: $cf_cv_posix_c_source" >&5
10370 echo "${ECHO_T}$cf_cv_posix_c_source" >&6
10371
10372 if test "$cf_cv_posix_c_source" != no ; then
10373         CFLAGS="$cf_trim_CFLAGS"
10374         CPPFLAGS="$cf_trim_CPPFLAGS"
10375
10376 cf_fix_cppflags=no
10377 cf_new_cflags=
10378 cf_new_cppflags=
10379 cf_new_extra_cppflags=
10380
10381 for cf_add_cflags in $cf_cv_posix_c_source
10382 do
10383 case $cf_fix_cppflags in
10384 (no)
10385         case $cf_add_cflags in
10386         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
10387                 case $cf_add_cflags in
10388                 (-D*)
10389                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
10390
10391                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10392                                 && test -z "${cf_tst_cflags}" \
10393                                 && cf_fix_cppflags=yes
10394
10395                         if test $cf_fix_cppflags = yes ; then
10396                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10397                                 continue
10398                         elif test "${cf_tst_cflags}" = "\"'" ; then
10399                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10400                                 continue
10401                         fi
10402                         ;;
10403                 esac
10404                 case "$CPPFLAGS" in
10405                 (*$cf_add_cflags)
10406                         ;;
10407                 (*)
10408                         case $cf_add_cflags in
10409                         (-D*)
10410                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
10411
10412 CPPFLAGS=`echo "$CPPFLAGS" | \
10413         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
10414                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
10415
10416                                 ;;
10417                         esac
10418                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
10419                         ;;
10420                 esac
10421                 ;;
10422         (*)
10423                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
10424                 ;;
10425         esac
10426         ;;
10427 (yes)
10428         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10429
10430         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
10431
10432         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10433                 && test -z "${cf_tst_cflags}" \
10434                 && cf_fix_cppflags=no
10435         ;;
10436 esac
10437 done
10438
10439 if test -n "$cf_new_cflags" ; then
10440
10441         CFLAGS="$CFLAGS $cf_new_cflags"
10442 fi
10443
10444 if test -n "$cf_new_cppflags" ; then
10445
10446         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
10447 fi
10448
10449 if test -n "$cf_new_extra_cppflags" ; then
10450
10451         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
10452 fi
10453
10454 fi
10455
10456         ;;
10457 esac
10458
10459 if test -n "$cf_xopen_source" ; then
10460
10461 cf_fix_cppflags=no
10462 cf_new_cflags=
10463 cf_new_cppflags=
10464 cf_new_extra_cppflags=
10465
10466 for cf_add_cflags in $cf_xopen_source
10467 do
10468 case $cf_fix_cppflags in
10469 (no)
10470         case $cf_add_cflags in
10471         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
10472                 case $cf_add_cflags in
10473                 (-D*)
10474                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
10475
10476                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10477                                 && test -z "${cf_tst_cflags}" \
10478                                 && cf_fix_cppflags=yes
10479
10480                         if test $cf_fix_cppflags = yes ; then
10481                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10482                                 continue
10483                         elif test "${cf_tst_cflags}" = "\"'" ; then
10484                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10485                                 continue
10486                         fi
10487                         ;;
10488                 esac
10489                 case "$CPPFLAGS" in
10490                 (*$cf_add_cflags)
10491                         ;;
10492                 (*)
10493                         case $cf_add_cflags in
10494                         (-D*)
10495                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
10496
10497 CPPFLAGS=`echo "$CPPFLAGS" | \
10498         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
10499                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
10500
10501                                 ;;
10502                         esac
10503                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
10504                         ;;
10505                 esac
10506                 ;;
10507         (*)
10508                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
10509                 ;;
10510         esac
10511         ;;
10512 (yes)
10513         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10514
10515         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
10516
10517         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10518                 && test -z "${cf_tst_cflags}" \
10519                 && cf_fix_cppflags=no
10520         ;;
10521 esac
10522 done
10523
10524 if test -n "$cf_new_cflags" ; then
10525         test -n "$verbose" && echo "    add to \$CFLAGS $cf_new_cflags" 1>&6
10526
10527 echo "${as_me:-configure}:10527: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
10528
10529         CFLAGS="$CFLAGS $cf_new_cflags"
10530 fi
10531
10532 if test -n "$cf_new_cppflags" ; then
10533         test -n "$verbose" && echo "    add to \$CPPFLAGS $cf_new_cppflags" 1>&6
10534
10535 echo "${as_me:-configure}:10535: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
10536
10537         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
10538 fi
10539
10540 if test -n "$cf_new_extra_cppflags" ; then
10541         test -n "$verbose" && echo "    add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6
10542
10543 echo "${as_me:-configure}:10543: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
10544
10545         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
10546 fi
10547
10548 fi
10549
10550 if test -n "$cf_XOPEN_SOURCE" && test -z "$cf_cv_xopen_source" ; then
10551         echo "$as_me:10551: checking if _XOPEN_SOURCE really is set" >&5
10552 echo $ECHO_N "checking if _XOPEN_SOURCE really is set... $ECHO_C" >&6
10553         cat >conftest.$ac_ext <<_ACEOF
10554 #line 10554 "configure"
10555 #include "confdefs.h"
10556 #include <stdlib.h>
10557 int
10558 main ()
10559 {
10560
10561 #ifndef _XOPEN_SOURCE
10562 make an error
10563 #endif
10564   ;
10565   return 0;
10566 }
10567 _ACEOF
10568 rm -f conftest.$ac_objext
10569 if { (eval echo "$as_me:10569: \"$ac_compile\"") >&5
10570   (eval $ac_compile) 2>&5
10571   ac_status=$?
10572   echo "$as_me:10572: \$? = $ac_status" >&5
10573   (exit $ac_status); } &&
10574          { ac_try='test -s conftest.$ac_objext'
10575   { (eval echo "$as_me:10575: \"$ac_try\"") >&5
10576   (eval $ac_try) 2>&5
10577   ac_status=$?
10578   echo "$as_me:10578: \$? = $ac_status" >&5
10579   (exit $ac_status); }; }; then
10580   cf_XOPEN_SOURCE_set=yes
10581 else
10582   echo "$as_me: failed program was:" >&5
10583 cat conftest.$ac_ext >&5
10584 cf_XOPEN_SOURCE_set=no
10585 fi
10586 rm -f conftest.$ac_objext conftest.$ac_ext
10587         echo "$as_me:10587: result: $cf_XOPEN_SOURCE_set" >&5
10588 echo "${ECHO_T}$cf_XOPEN_SOURCE_set" >&6
10589         if test $cf_XOPEN_SOURCE_set = yes
10590         then
10591                 cat >conftest.$ac_ext <<_ACEOF
10592 #line 10592 "configure"
10593 #include "confdefs.h"
10594 #include <stdlib.h>
10595 int
10596 main ()
10597 {
10598
10599 #if (_XOPEN_SOURCE - 0) < $cf_XOPEN_SOURCE
10600 make an error
10601 #endif
10602   ;
10603   return 0;
10604 }
10605 _ACEOF
10606 rm -f conftest.$ac_objext
10607 if { (eval echo "$as_me:10607: \"$ac_compile\"") >&5
10608   (eval $ac_compile) 2>&5
10609   ac_status=$?
10610   echo "$as_me:10610: \$? = $ac_status" >&5
10611   (exit $ac_status); } &&
10612          { ac_try='test -s conftest.$ac_objext'
10613   { (eval echo "$as_me:10613: \"$ac_try\"") >&5
10614   (eval $ac_try) 2>&5
10615   ac_status=$?
10616   echo "$as_me:10616: \$? = $ac_status" >&5
10617   (exit $ac_status); }; }; then
10618   cf_XOPEN_SOURCE_set_ok=yes
10619 else
10620   echo "$as_me: failed program was:" >&5
10621 cat conftest.$ac_ext >&5
10622 cf_XOPEN_SOURCE_set_ok=no
10623 fi
10624 rm -f conftest.$ac_objext conftest.$ac_ext
10625                 if test $cf_XOPEN_SOURCE_set_ok = no
10626                 then
10627                         { echo "$as_me:10627: WARNING: _XOPEN_SOURCE is lower than requested" >&5
10628 echo "$as_me: WARNING: _XOPEN_SOURCE is lower than requested" >&2;}
10629                 fi
10630         else
10631
10632 echo "$as_me:10632: checking if we should define _XOPEN_SOURCE" >&5
10633 echo $ECHO_N "checking if we should define _XOPEN_SOURCE... $ECHO_C" >&6
10634 if test "${cf_cv_xopen_source+set}" = set; then
10635   echo $ECHO_N "(cached) $ECHO_C" >&6
10636 else
10637
10638         cat >conftest.$ac_ext <<_ACEOF
10639 #line 10639 "configure"
10640 #include "confdefs.h"
10641
10642 #include <stdlib.h>
10643 #include <string.h>
10644 #include <sys/types.h>
10645
10646 int
10647 main ()
10648 {
10649
10650 #ifndef _XOPEN_SOURCE
10651 make an error
10652 #endif
10653   ;
10654   return 0;
10655 }
10656 _ACEOF
10657 rm -f conftest.$ac_objext
10658 if { (eval echo "$as_me:10658: \"$ac_compile\"") >&5
10659   (eval $ac_compile) 2>&5
10660   ac_status=$?
10661   echo "$as_me:10661: \$? = $ac_status" >&5
10662   (exit $ac_status); } &&
10663          { ac_try='test -s conftest.$ac_objext'
10664   { (eval echo "$as_me:10664: \"$ac_try\"") >&5
10665   (eval $ac_try) 2>&5
10666   ac_status=$?
10667   echo "$as_me:10667: \$? = $ac_status" >&5
10668   (exit $ac_status); }; }; then
10669   cf_cv_xopen_source=no
10670 else
10671   echo "$as_me: failed program was:" >&5
10672 cat conftest.$ac_ext >&5
10673 cf_save="$CPPFLAGS"
10674          CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
10675          cat >conftest.$ac_ext <<_ACEOF
10676 #line 10676 "configure"
10677 #include "confdefs.h"
10678
10679 #include <stdlib.h>
10680 #include <string.h>
10681 #include <sys/types.h>
10682
10683 int
10684 main ()
10685 {
10686
10687 #ifdef _XOPEN_SOURCE
10688 make an error
10689 #endif
10690   ;
10691   return 0;
10692 }
10693 _ACEOF
10694 rm -f conftest.$ac_objext
10695 if { (eval echo "$as_me:10695: \"$ac_compile\"") >&5
10696   (eval $ac_compile) 2>&5
10697   ac_status=$?
10698   echo "$as_me:10698: \$? = $ac_status" >&5
10699   (exit $ac_status); } &&
10700          { ac_try='test -s conftest.$ac_objext'
10701   { (eval echo "$as_me:10701: \"$ac_try\"") >&5
10702   (eval $ac_try) 2>&5
10703   ac_status=$?
10704   echo "$as_me:10704: \$? = $ac_status" >&5
10705   (exit $ac_status); }; }; then
10706   cf_cv_xopen_source=no
10707 else
10708   echo "$as_me: failed program was:" >&5
10709 cat conftest.$ac_ext >&5
10710 cf_cv_xopen_source=$cf_XOPEN_SOURCE
10711 fi
10712 rm -f conftest.$ac_objext conftest.$ac_ext
10713         CPPFLAGS="$cf_save"
10714
10715 fi
10716 rm -f conftest.$ac_objext conftest.$ac_ext
10717
10718 fi
10719 echo "$as_me:10719: result: $cf_cv_xopen_source" >&5
10720 echo "${ECHO_T}$cf_cv_xopen_source" >&6
10721
10722 if test "$cf_cv_xopen_source" != no ; then
10723
10724 CFLAGS=`echo "$CFLAGS" | \
10725         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
10726                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
10727
10728 CPPFLAGS=`echo "$CPPFLAGS" | \
10729         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
10730                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
10731
10732         cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source"
10733
10734 cf_fix_cppflags=no
10735 cf_new_cflags=
10736 cf_new_cppflags=
10737 cf_new_extra_cppflags=
10738
10739 for cf_add_cflags in $cf_temp_xopen_source
10740 do
10741 case $cf_fix_cppflags in
10742 (no)
10743         case $cf_add_cflags in
10744         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
10745                 case $cf_add_cflags in
10746                 (-D*)
10747                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
10748
10749                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10750                                 && test -z "${cf_tst_cflags}" \
10751                                 && cf_fix_cppflags=yes
10752
10753                         if test $cf_fix_cppflags = yes ; then
10754                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10755                                 continue
10756                         elif test "${cf_tst_cflags}" = "\"'" ; then
10757                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10758                                 continue
10759                         fi
10760                         ;;
10761                 esac
10762                 case "$CPPFLAGS" in
10763                 (*$cf_add_cflags)
10764                         ;;
10765                 (*)
10766                         case $cf_add_cflags in
10767                         (-D*)
10768                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
10769
10770 CPPFLAGS=`echo "$CPPFLAGS" | \
10771         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
10772                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
10773
10774                                 ;;
10775                         esac
10776                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
10777                         ;;
10778                 esac
10779                 ;;
10780         (*)
10781                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
10782                 ;;
10783         esac
10784         ;;
10785 (yes)
10786         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10787
10788         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
10789
10790         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10791                 && test -z "${cf_tst_cflags}" \
10792                 && cf_fix_cppflags=no
10793         ;;
10794 esac
10795 done
10796
10797 if test -n "$cf_new_cflags" ; then
10798
10799         CFLAGS="$CFLAGS $cf_new_cflags"
10800 fi
10801
10802 if test -n "$cf_new_cppflags" ; then
10803
10804         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
10805 fi
10806
10807 if test -n "$cf_new_extra_cppflags" ; then
10808
10809         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
10810 fi
10811
10812 fi
10813
10814         fi
10815 fi
10816
10817 # Check whether --enable-largefile or --disable-largefile was given.
10818 if test "${enable_largefile+set}" = set; then
10819   enableval="$enable_largefile"
10820
10821 fi;
10822 if test "$enable_largefile" != no; then
10823
10824   echo "$as_me:10824: checking for special C compiler options needed for large files" >&5
10825 echo $ECHO_N "checking for special C compiler options needed for large files... $ECHO_C" >&6
10826 if test "${ac_cv_sys_largefile_CC+set}" = set; then
10827   echo $ECHO_N "(cached) $ECHO_C" >&6
10828 else
10829   ac_cv_sys_largefile_CC=no
10830      if test "$GCC" != yes; then
10831        ac_save_CC=$CC
10832        while :; do
10833          # IRIX 6.2 and later do not support large files by default,
10834          # so use the C compiler's -n32 option if that helps.
10835          cat >conftest.$ac_ext <<_ACEOF
10836 #line 10836 "configure"
10837 #include "confdefs.h"
10838 #include <sys/types.h>
10839  /* Check that off_t can represent 2**63 - 1 correctly.
10840     We can't simply define LARGE_OFF_T to be 9223372036854775807,
10841     since some C++ compilers masquerading as C compilers
10842     incorrectly reject 9223372036854775807.  */
10843 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
10844   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
10845                        && LARGE_OFF_T % 2147483647 == 1)
10846                       ? 1 : -1];
10847 int
10848 main ()
10849 {
10850
10851   ;
10852   return 0;
10853 }
10854 _ACEOF
10855          rm -f conftest.$ac_objext
10856 if { (eval echo "$as_me:10856: \"$ac_compile\"") >&5
10857   (eval $ac_compile) 2>&5
10858   ac_status=$?
10859   echo "$as_me:10859: \$? = $ac_status" >&5
10860   (exit $ac_status); } &&
10861          { ac_try='test -s conftest.$ac_objext'
10862   { (eval echo "$as_me:10862: \"$ac_try\"") >&5
10863   (eval $ac_try) 2>&5
10864   ac_status=$?
10865   echo "$as_me:10865: \$? = $ac_status" >&5
10866   (exit $ac_status); }; }; then
10867   break
10868 else
10869   echo "$as_me: failed program was:" >&5
10870 cat conftest.$ac_ext >&5
10871 fi
10872 rm -f conftest.$ac_objext
10873          CC="$CC -n32"
10874          rm -f conftest.$ac_objext
10875 if { (eval echo "$as_me:10875: \"$ac_compile\"") >&5
10876   (eval $ac_compile) 2>&5
10877   ac_status=$?
10878   echo "$as_me:10878: \$? = $ac_status" >&5
10879   (exit $ac_status); } &&
10880          { ac_try='test -s conftest.$ac_objext'
10881   { (eval echo "$as_me:10881: \"$ac_try\"") >&5
10882   (eval $ac_try) 2>&5
10883   ac_status=$?
10884   echo "$as_me:10884: \$? = $ac_status" >&5
10885   (exit $ac_status); }; }; then
10886   ac_cv_sys_largefile_CC=' -n32'; break
10887 else
10888   echo "$as_me: failed program was:" >&5
10889 cat conftest.$ac_ext >&5
10890 fi
10891 rm -f conftest.$ac_objext
10892          break
10893        done
10894        CC=$ac_save_CC
10895        rm -f conftest.$ac_ext
10896     fi
10897 fi
10898 echo "$as_me:10898: result: $ac_cv_sys_largefile_CC" >&5
10899 echo "${ECHO_T}$ac_cv_sys_largefile_CC" >&6
10900   if test "$ac_cv_sys_largefile_CC" != no; then
10901     CC=$CC$ac_cv_sys_largefile_CC
10902   fi
10903
10904   echo "$as_me:10904: checking for _FILE_OFFSET_BITS value needed for large files" >&5
10905 echo $ECHO_N "checking for _FILE_OFFSET_BITS value needed for large files... $ECHO_C" >&6
10906 if test "${ac_cv_sys_file_offset_bits+set}" = set; then
10907   echo $ECHO_N "(cached) $ECHO_C" >&6
10908 else
10909   while :; do
10910   ac_cv_sys_file_offset_bits=no
10911   cat >conftest.$ac_ext <<_ACEOF
10912 #line 10912 "configure"
10913 #include "confdefs.h"
10914 #include <sys/types.h>
10915  /* Check that off_t can represent 2**63 - 1 correctly.
10916     We can't simply define LARGE_OFF_T to be 9223372036854775807,
10917     since some C++ compilers masquerading as C compilers
10918     incorrectly reject 9223372036854775807.  */
10919 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
10920   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
10921                        && LARGE_OFF_T % 2147483647 == 1)
10922                       ? 1 : -1];
10923 int
10924 main ()
10925 {
10926
10927   ;
10928   return 0;
10929 }
10930 _ACEOF
10931 rm -f conftest.$ac_objext
10932 if { (eval echo "$as_me:10932: \"$ac_compile\"") >&5
10933   (eval $ac_compile) 2>&5
10934   ac_status=$?
10935   echo "$as_me:10935: \$? = $ac_status" >&5
10936   (exit $ac_status); } &&
10937          { ac_try='test -s conftest.$ac_objext'
10938   { (eval echo "$as_me:10938: \"$ac_try\"") >&5
10939   (eval $ac_try) 2>&5
10940   ac_status=$?
10941   echo "$as_me:10941: \$? = $ac_status" >&5
10942   (exit $ac_status); }; }; then
10943   break
10944 else
10945   echo "$as_me: failed program was:" >&5
10946 cat conftest.$ac_ext >&5
10947 fi
10948 rm -f conftest.$ac_objext conftest.$ac_ext
10949   cat >conftest.$ac_ext <<_ACEOF
10950 #line 10950 "configure"
10951 #include "confdefs.h"
10952 #define _FILE_OFFSET_BITS 64
10953 #include <sys/types.h>
10954  /* Check that off_t can represent 2**63 - 1 correctly.
10955     We can't simply define LARGE_OFF_T to be 9223372036854775807,
10956     since some C++ compilers masquerading as C compilers
10957     incorrectly reject 9223372036854775807.  */
10958 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
10959   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
10960                        && LARGE_OFF_T % 2147483647 == 1)
10961                       ? 1 : -1];
10962 int
10963 main ()
10964 {
10965
10966   ;
10967   return 0;
10968 }
10969 _ACEOF
10970 rm -f conftest.$ac_objext
10971 if { (eval echo "$as_me:10971: \"$ac_compile\"") >&5
10972   (eval $ac_compile) 2>&5
10973   ac_status=$?
10974   echo "$as_me:10974: \$? = $ac_status" >&5
10975   (exit $ac_status); } &&
10976          { ac_try='test -s conftest.$ac_objext'
10977   { (eval echo "$as_me:10977: \"$ac_try\"") >&5
10978   (eval $ac_try) 2>&5
10979   ac_status=$?
10980   echo "$as_me:10980: \$? = $ac_status" >&5
10981   (exit $ac_status); }; }; then
10982   ac_cv_sys_file_offset_bits=64; break
10983 else
10984   echo "$as_me: failed program was:" >&5
10985 cat conftest.$ac_ext >&5
10986 fi
10987 rm -f conftest.$ac_objext conftest.$ac_ext
10988   break
10989 done
10990 fi
10991 echo "$as_me:10991: result: $ac_cv_sys_file_offset_bits" >&5
10992 echo "${ECHO_T}$ac_cv_sys_file_offset_bits" >&6
10993 if test "$ac_cv_sys_file_offset_bits" != no; then
10994
10995 cat >>confdefs.h <<EOF
10996 #define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits
10997 EOF
10998
10999 fi
11000 rm -rf conftest*
11001   echo "$as_me:11001: checking for _LARGE_FILES value needed for large files" >&5
11002 echo $ECHO_N "checking for _LARGE_FILES value needed for large files... $ECHO_C" >&6
11003 if test "${ac_cv_sys_large_files+set}" = set; then
11004   echo $ECHO_N "(cached) $ECHO_C" >&6
11005 else
11006   while :; do
11007   ac_cv_sys_large_files=no
11008   cat >conftest.$ac_ext <<_ACEOF
11009 #line 11009 "configure"
11010 #include "confdefs.h"
11011 #include <sys/types.h>
11012  /* Check that off_t can represent 2**63 - 1 correctly.
11013     We can't simply define LARGE_OFF_T to be 9223372036854775807,
11014     since some C++ compilers masquerading as C compilers
11015     incorrectly reject 9223372036854775807.  */
11016 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
11017   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
11018                        && LARGE_OFF_T % 2147483647 == 1)
11019                       ? 1 : -1];
11020 int
11021 main ()
11022 {
11023
11024   ;
11025   return 0;
11026 }
11027 _ACEOF
11028 rm -f conftest.$ac_objext
11029 if { (eval echo "$as_me:11029: \"$ac_compile\"") >&5
11030   (eval $ac_compile) 2>&5
11031   ac_status=$?
11032   echo "$as_me:11032: \$? = $ac_status" >&5
11033   (exit $ac_status); } &&
11034          { ac_try='test -s conftest.$ac_objext'
11035   { (eval echo "$as_me:11035: \"$ac_try\"") >&5
11036   (eval $ac_try) 2>&5
11037   ac_status=$?
11038   echo "$as_me:11038: \$? = $ac_status" >&5
11039   (exit $ac_status); }; }; then
11040   break
11041 else
11042   echo "$as_me: failed program was:" >&5
11043 cat conftest.$ac_ext >&5
11044 fi
11045 rm -f conftest.$ac_objext conftest.$ac_ext
11046   cat >conftest.$ac_ext <<_ACEOF
11047 #line 11047 "configure"
11048 #include "confdefs.h"
11049 #define _LARGE_FILES 1
11050 #include <sys/types.h>
11051  /* Check that off_t can represent 2**63 - 1 correctly.
11052     We can't simply define LARGE_OFF_T to be 9223372036854775807,
11053     since some C++ compilers masquerading as C compilers
11054     incorrectly reject 9223372036854775807.  */
11055 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
11056   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
11057                        && LARGE_OFF_T % 2147483647 == 1)
11058                       ? 1 : -1];
11059 int
11060 main ()
11061 {
11062
11063   ;
11064   return 0;
11065 }
11066 _ACEOF
11067 rm -f conftest.$ac_objext
11068 if { (eval echo "$as_me:11068: \"$ac_compile\"") >&5
11069   (eval $ac_compile) 2>&5
11070   ac_status=$?
11071   echo "$as_me:11071: \$? = $ac_status" >&5
11072   (exit $ac_status); } &&
11073          { ac_try='test -s conftest.$ac_objext'
11074   { (eval echo "$as_me:11074: \"$ac_try\"") >&5
11075   (eval $ac_try) 2>&5
11076   ac_status=$?
11077   echo "$as_me:11077: \$? = $ac_status" >&5
11078   (exit $ac_status); }; }; then
11079   ac_cv_sys_large_files=1; break
11080 else
11081   echo "$as_me: failed program was:" >&5
11082 cat conftest.$ac_ext >&5
11083 fi
11084 rm -f conftest.$ac_objext conftest.$ac_ext
11085   break
11086 done
11087 fi
11088 echo "$as_me:11088: result: $ac_cv_sys_large_files" >&5
11089 echo "${ECHO_T}$ac_cv_sys_large_files" >&6
11090 if test "$ac_cv_sys_large_files" != no; then
11091
11092 cat >>confdefs.h <<EOF
11093 #define _LARGE_FILES $ac_cv_sys_large_files
11094 EOF
11095
11096 fi
11097 rm -rf conftest*
11098 fi
11099
11100         if test "$enable_largefile" != no ; then
11101         echo "$as_me:11101: checking for _LARGEFILE_SOURCE value needed for large files" >&5
11102 echo $ECHO_N "checking for _LARGEFILE_SOURCE value needed for large files... $ECHO_C" >&6
11103 if test "${ac_cv_sys_largefile_source+set}" = set; then
11104   echo $ECHO_N "(cached) $ECHO_C" >&6
11105 else
11106   while :; do
11107   ac_cv_sys_largefile_source=no
11108   cat >conftest.$ac_ext <<_ACEOF
11109 #line 11109 "configure"
11110 #include "confdefs.h"
11111 #include <stdio.h>
11112 int
11113 main ()
11114 {
11115 return !fseeko;
11116   ;
11117   return 0;
11118 }
11119 _ACEOF
11120 rm -f conftest.$ac_objext
11121 if { (eval echo "$as_me:11121: \"$ac_compile\"") >&5
11122   (eval $ac_compile) 2>&5
11123   ac_status=$?
11124   echo "$as_me:11124: \$? = $ac_status" >&5
11125   (exit $ac_status); } &&
11126          { ac_try='test -s conftest.$ac_objext'
11127   { (eval echo "$as_me:11127: \"$ac_try\"") >&5
11128   (eval $ac_try) 2>&5
11129   ac_status=$?
11130   echo "$as_me:11130: \$? = $ac_status" >&5
11131   (exit $ac_status); }; }; then
11132   break
11133 else
11134   echo "$as_me: failed program was:" >&5
11135 cat conftest.$ac_ext >&5
11136 fi
11137 rm -f conftest.$ac_objext conftest.$ac_ext
11138   cat >conftest.$ac_ext <<_ACEOF
11139 #line 11139 "configure"
11140 #include "confdefs.h"
11141 #define _LARGEFILE_SOURCE 1
11142 #include <stdio.h>
11143 int
11144 main ()
11145 {
11146 return !fseeko;
11147   ;
11148   return 0;
11149 }
11150 _ACEOF
11151 rm -f conftest.$ac_objext
11152 if { (eval echo "$as_me:11152: \"$ac_compile\"") >&5
11153   (eval $ac_compile) 2>&5
11154   ac_status=$?
11155   echo "$as_me:11155: \$? = $ac_status" >&5
11156   (exit $ac_status); } &&
11157          { ac_try='test -s conftest.$ac_objext'
11158   { (eval echo "$as_me:11158: \"$ac_try\"") >&5
11159   (eval $ac_try) 2>&5
11160   ac_status=$?
11161   echo "$as_me:11161: \$? = $ac_status" >&5
11162   (exit $ac_status); }; }; then
11163   ac_cv_sys_largefile_source=1; break
11164 else
11165   echo "$as_me: failed program was:" >&5
11166 cat conftest.$ac_ext >&5
11167 fi
11168 rm -f conftest.$ac_objext conftest.$ac_ext
11169   break
11170 done
11171 fi
11172 echo "$as_me:11172: result: $ac_cv_sys_largefile_source" >&5
11173 echo "${ECHO_T}$ac_cv_sys_largefile_source" >&6
11174 if test "$ac_cv_sys_largefile_source" != no; then
11175
11176 cat >>confdefs.h <<EOF
11177 #define _LARGEFILE_SOURCE $ac_cv_sys_largefile_source
11178 EOF
11179
11180 fi
11181 rm -rf conftest*
11182
11183 # We used to try defining _XOPEN_SOURCE=500 too, to work around a bug
11184 # in glibc 2.1.3, but that breaks too many other things.
11185 # If you want fseeko and ftello with glibc, upgrade to a fixed glibc.
11186 echo "$as_me:11186: checking for fseeko" >&5
11187 echo $ECHO_N "checking for fseeko... $ECHO_C" >&6
11188 if test "${ac_cv_func_fseeko+set}" = set; then
11189   echo $ECHO_N "(cached) $ECHO_C" >&6
11190 else
11191   cat >conftest.$ac_ext <<_ACEOF
11192 #line 11192 "configure"
11193 #include "confdefs.h"
11194 #include <stdio.h>
11195 int
11196 main ()
11197 {
11198 return fseeko && fseeko (stdin, 0, 0);
11199   ;
11200   return 0;
11201 }
11202 _ACEOF
11203 rm -f conftest.$ac_objext conftest$ac_exeext
11204 if { (eval echo "$as_me:11204: \"$ac_link\"") >&5
11205   (eval $ac_link) 2>&5
11206   ac_status=$?
11207   echo "$as_me:11207: \$? = $ac_status" >&5
11208   (exit $ac_status); } &&
11209          { ac_try='test -s conftest$ac_exeext'
11210   { (eval echo "$as_me:11210: \"$ac_try\"") >&5
11211   (eval $ac_try) 2>&5
11212   ac_status=$?
11213   echo "$as_me:11213: \$? = $ac_status" >&5
11214   (exit $ac_status); }; }; then
11215   ac_cv_func_fseeko=yes
11216 else
11217   echo "$as_me: failed program was:" >&5
11218 cat conftest.$ac_ext >&5
11219 ac_cv_func_fseeko=no
11220 fi
11221 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11222 fi
11223 echo "$as_me:11223: result: $ac_cv_func_fseeko" >&5
11224 echo "${ECHO_T}$ac_cv_func_fseeko" >&6
11225 if test $ac_cv_func_fseeko = yes; then
11226
11227 cat >>confdefs.h <<\EOF
11228 #define HAVE_FSEEKO 1
11229 EOF
11230
11231 fi
11232
11233         # Normally we would collect these definitions in the config.h,
11234         # but (like _XOPEN_SOURCE), some environments rely on having these
11235         # defined before any of the system headers are included.  Another
11236         # case comes up with C++, e.g., on AIX the compiler compiles the
11237         # header files by themselves before looking at the body files it is
11238         # told to compile.  For ncurses, those header files do not include
11239         # the config.h
11240         test "$ac_cv_sys_large_files"      != no && CPPFLAGS="$CPPFLAGS -D_LARGE_FILES "
11241         test "$ac_cv_sys_largefile_source" != no && CPPFLAGS="$CPPFLAGS -D_LARGEFILE_SOURCE "
11242         test "$ac_cv_sys_file_offset_bits" != no && CPPFLAGS="$CPPFLAGS -D_FILE_OFFSET_BITS=$ac_cv_sys_file_offset_bits "
11243
11244         echo "$as_me:11244: checking whether to use struct dirent64" >&5
11245 echo $ECHO_N "checking whether to use struct dirent64... $ECHO_C" >&6
11246 if test "${cf_cv_struct_dirent64+set}" = set; then
11247   echo $ECHO_N "(cached) $ECHO_C" >&6
11248 else
11249
11250                 cat >conftest.$ac_ext <<_ACEOF
11251 #line 11251 "configure"
11252 #include "confdefs.h"
11253
11254 #include <sys/types.h>
11255 #include <dirent.h>
11256
11257 int
11258 main ()
11259 {
11260
11261                 /* if transitional largefile support is setup, this is true */
11262                 extern struct dirent64 * readdir(DIR *);
11263                 struct dirent64 *x = readdir((DIR *)0);
11264                 struct dirent *y = readdir((DIR *)0);
11265                 int z = x - y;
11266
11267   ;
11268   return 0;
11269 }
11270 _ACEOF
11271 rm -f conftest.$ac_objext
11272 if { (eval echo "$as_me:11272: \"$ac_compile\"") >&5
11273   (eval $ac_compile) 2>&5
11274   ac_status=$?
11275   echo "$as_me:11275: \$? = $ac_status" >&5
11276   (exit $ac_status); } &&
11277          { ac_try='test -s conftest.$ac_objext'
11278   { (eval echo "$as_me:11278: \"$ac_try\"") >&5
11279   (eval $ac_try) 2>&5
11280   ac_status=$?
11281   echo "$as_me:11281: \$? = $ac_status" >&5
11282   (exit $ac_status); }; }; then
11283   cf_cv_struct_dirent64=yes
11284 else
11285   echo "$as_me: failed program was:" >&5
11286 cat conftest.$ac_ext >&5
11287 cf_cv_struct_dirent64=no
11288 fi
11289 rm -f conftest.$ac_objext conftest.$ac_ext
11290
11291 fi
11292 echo "$as_me:11292: result: $cf_cv_struct_dirent64" >&5
11293 echo "${ECHO_T}$cf_cv_struct_dirent64" >&6
11294         test "$cf_cv_struct_dirent64" = yes &&
11295 cat >>confdefs.h <<\EOF
11296 #define HAVE_STRUCT_DIRENT64 1
11297 EOF
11298
11299         fi
11300
11301 ### Enable compiling-in rcs id's
11302 echo "$as_me:11302: checking if RCS identifiers should be compiled-in" >&5
11303 echo $ECHO_N "checking if RCS identifiers should be compiled-in... $ECHO_C" >&6
11304
11305 # Check whether --with-rcs-ids or --without-rcs-ids was given.
11306 if test "${with_rcs_ids+set}" = set; then
11307   withval="$with_rcs_ids"
11308   with_rcs_ids=$withval
11309 else
11310   with_rcs_ids=no
11311 fi;
11312 echo "$as_me:11312: result: $with_rcs_ids" >&5
11313 echo "${ECHO_T}$with_rcs_ids" >&6
11314 test "$with_rcs_ids" = yes &&
11315 cat >>confdefs.h <<\EOF
11316 #define USE_RCS_IDS 1
11317 EOF
11318
11319 ###############################################################################
11320
11321 ### Note that some functions (such as const) are normally disabled anyway.
11322 echo "$as_me:11322: checking if you want to build with function extensions" >&5
11323 echo $ECHO_N "checking if you want to build with function extensions... $ECHO_C" >&6
11324
11325 # Check whether --enable-ext-funcs or --disable-ext-funcs was given.
11326 if test "${enable_ext_funcs+set}" = set; then
11327   enableval="$enable_ext_funcs"
11328   with_ext_funcs=$enableval
11329 else
11330   with_ext_funcs=yes
11331 fi;
11332 echo "$as_me:11332: result: $with_ext_funcs" >&5
11333 echo "${ECHO_T}$with_ext_funcs" >&6
11334 if test "$with_ext_funcs" = yes ; then
11335         NCURSES_EXT_FUNCS=1
11336
11337 cat >>confdefs.h <<\EOF
11338 #define HAVE_USE_DEFAULT_COLORS 1
11339 EOF
11340
11341 cat >>confdefs.h <<\EOF
11342 #define NCURSES_EXT_FUNCS 1
11343 EOF
11344
11345 else
11346         NCURSES_EXT_FUNCS=0
11347 fi
11348
11349 ###   use option --enable-const to turn on use of const beyond that in XSI.
11350 echo "$as_me:11350: checking for extended use of const keyword" >&5
11351 echo $ECHO_N "checking for extended use of const keyword... $ECHO_C" >&6
11352
11353 # Check whether --enable-const or --disable-const was given.
11354 if test "${enable_const+set}" = set; then
11355   enableval="$enable_const"
11356   with_ext_const=$enableval
11357 else
11358   with_ext_const=no
11359 fi;
11360 echo "$as_me:11360: result: $with_ext_const" >&5
11361 echo "${ECHO_T}$with_ext_const" >&6
11362 NCURSES_CONST='/*nothing*/'
11363 if test "$with_ext_const" = yes ; then
11364         NCURSES_CONST=const
11365 fi
11366
11367 ###############################################################################
11368 # These options are relatively safe to experiment with.
11369
11370 echo "$as_me:11370: checking if you want all development code" >&5
11371 echo $ECHO_N "checking if you want all development code... $ECHO_C" >&6
11372
11373 # Check whether --with-develop or --without-develop was given.
11374 if test "${with_develop+set}" = set; then
11375   withval="$with_develop"
11376   with_develop=$withval
11377 else
11378   with_develop=no
11379 fi;
11380 echo "$as_me:11380: result: $with_develop" >&5
11381 echo "${ECHO_T}$with_develop" >&6
11382
11383 ###############################################################################
11384 # These are just experimental, probably should not be in a package:
11385
11386 # This is still experimental (20080329), but should ultimately be moved to
11387 # the script-block --with-normal, etc.
11388
11389 echo "$as_me:11389: checking if you want to link with the pthread library" >&5
11390 echo $ECHO_N "checking if you want to link with the pthread library... $ECHO_C" >&6
11391
11392 # Check whether --with-pthread or --without-pthread was given.
11393 if test "${with_pthread+set}" = set; then
11394   withval="$with_pthread"
11395   with_pthread=$withval
11396 else
11397   with_pthread=no
11398 fi;
11399 echo "$as_me:11399: result: $with_pthread" >&5
11400 echo "${ECHO_T}$with_pthread" >&6
11401
11402 if test "$with_pthread" != no ; then
11403         echo "$as_me:11403: checking for pthread.h" >&5
11404 echo $ECHO_N "checking for pthread.h... $ECHO_C" >&6
11405 if test "${ac_cv_header_pthread_h+set}" = set; then
11406   echo $ECHO_N "(cached) $ECHO_C" >&6
11407 else
11408   cat >conftest.$ac_ext <<_ACEOF
11409 #line 11409 "configure"
11410 #include "confdefs.h"
11411 #include <pthread.h>
11412 _ACEOF
11413 if { (eval echo "$as_me:11413: \"$ac_cpp conftest.$ac_ext\"") >&5
11414   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
11415   ac_status=$?
11416   egrep -v '^ *\+' conftest.er1 >conftest.err
11417   rm -f conftest.er1
11418   cat conftest.err >&5
11419   echo "$as_me:11419: \$? = $ac_status" >&5
11420   (exit $ac_status); } >/dev/null; then
11421   if test -s conftest.err; then
11422     ac_cpp_err=$ac_c_preproc_warn_flag
11423   else
11424     ac_cpp_err=
11425   fi
11426 else
11427   ac_cpp_err=yes
11428 fi
11429 if test -z "$ac_cpp_err"; then
11430   ac_cv_header_pthread_h=yes
11431 else
11432   echo "$as_me: failed program was:" >&5
11433   cat conftest.$ac_ext >&5
11434   ac_cv_header_pthread_h=no
11435 fi
11436 rm -f conftest.err conftest.$ac_ext
11437 fi
11438 echo "$as_me:11438: result: $ac_cv_header_pthread_h" >&5
11439 echo "${ECHO_T}$ac_cv_header_pthread_h" >&6
11440 if test $ac_cv_header_pthread_h = yes; then
11441
11442 cat >>confdefs.h <<\EOF
11443 #define HAVE_PTHREADS_H 1
11444 EOF
11445
11446         for cf_lib_pthread in pthread c_r
11447         do
11448             echo "$as_me:11448: checking if we can link with the $cf_lib_pthread library" >&5
11449 echo $ECHO_N "checking if we can link with the $cf_lib_pthread library... $ECHO_C" >&6
11450             cf_save_LIBS="$LIBS"
11451
11452 cf_add_libs="-l$cf_lib_pthread"
11453 # Filter out duplicates - this happens with badly-designed ".pc" files...
11454 for cf_add_1lib in $LIBS
11455 do
11456         for cf_add_2lib in $cf_add_libs
11457         do
11458                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
11459                 then
11460                         cf_add_1lib=
11461                         break
11462                 fi
11463         done
11464         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
11465 done
11466 LIBS="$cf_add_libs"
11467
11468             cat >conftest.$ac_ext <<_ACEOF
11469 #line 11469 "configure"
11470 #include "confdefs.h"
11471
11472 #include <pthread.h>
11473
11474 int
11475 main ()
11476 {
11477
11478                 int rc = pthread_create(0,0,0,0);
11479                 int r2 = pthread_mutexattr_settype(0, 0);
11480
11481   ;
11482   return 0;
11483 }
11484 _ACEOF
11485 rm -f conftest.$ac_objext conftest$ac_exeext
11486 if { (eval echo "$as_me:11486: \"$ac_link\"") >&5
11487   (eval $ac_link) 2>&5
11488   ac_status=$?
11489   echo "$as_me:11489: \$? = $ac_status" >&5
11490   (exit $ac_status); } &&
11491          { ac_try='test -s conftest$ac_exeext'
11492   { (eval echo "$as_me:11492: \"$ac_try\"") >&5
11493   (eval $ac_try) 2>&5
11494   ac_status=$?
11495   echo "$as_me:11495: \$? = $ac_status" >&5
11496   (exit $ac_status); }; }; then
11497   with_pthread=yes
11498 else
11499   echo "$as_me: failed program was:" >&5
11500 cat conftest.$ac_ext >&5
11501 with_pthread=no
11502 fi
11503 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11504             LIBS="$cf_save_LIBS"
11505             echo "$as_me:11505: result: $with_pthread" >&5
11506 echo "${ECHO_T}$with_pthread" >&6
11507             test "$with_pthread" = yes && break
11508         done
11509
11510         if test "$with_pthread" = yes ; then
11511
11512 cf_add_libs="-l$cf_lib_pthread"
11513 # Filter out duplicates - this happens with badly-designed ".pc" files...
11514 for cf_add_1lib in $LIBS
11515 do
11516         for cf_add_2lib in $cf_add_libs
11517         do
11518                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
11519                 then
11520                         cf_add_1lib=
11521                         break
11522                 fi
11523         done
11524         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
11525 done
11526 LIBS="$cf_add_libs"
11527
11528 cat >>confdefs.h <<\EOF
11529 #define HAVE_LIBPTHREADS 1
11530 EOF
11531
11532         else
11533             { { echo "$as_me:11533: error: Cannot link with pthread library" >&5
11534 echo "$as_me: error: Cannot link with pthread library" >&2;}
11535    { (exit 1); exit 1; }; }
11536         fi
11537
11538 fi
11539
11540 fi
11541
11542 echo "$as_me:11542: checking if you want to use weak-symbols for pthreads" >&5
11543 echo $ECHO_N "checking if you want to use weak-symbols for pthreads... $ECHO_C" >&6
11544
11545 # Check whether --enable-weak-symbols or --disable-weak-symbols was given.
11546 if test "${enable_weak_symbols+set}" = set; then
11547   enableval="$enable_weak_symbols"
11548   use_weak_symbols=$withval
11549 else
11550   use_weak_symbols=no
11551 fi;
11552 echo "$as_me:11552: result: $use_weak_symbols" >&5
11553 echo "${ECHO_T}$use_weak_symbols" >&6
11554 if test "$use_weak_symbols" = yes ; then
11555
11556 echo "$as_me:11556: checking if $CC supports weak symbols" >&5
11557 echo $ECHO_N "checking if $CC supports weak symbols... $ECHO_C" >&6
11558 if test "${cf_cv_weak_symbols+set}" = set; then
11559   echo $ECHO_N "(cached) $ECHO_C" >&6
11560 else
11561
11562 cat >conftest.$ac_ext <<_ACEOF
11563 #line 11563 "configure"
11564 #include "confdefs.h"
11565
11566 #include <stdio.h>
11567 int
11568 main ()
11569 {
11570
11571 #if defined(__GNUC__)
11572 #  if defined __USE_ISOC99
11573 #    define _cat_pragma(exp)    _Pragma(#exp)
11574 #    define _weak_pragma(exp)   _cat_pragma(weak name)
11575 #  else
11576 #    define _weak_pragma(exp)
11577 #  endif
11578 #  define _declare(name)        __extension__ extern __typeof__(name) name
11579 #  define weak_symbol(name)     _weak_pragma(name) _declare(name) __attribute__((weak))
11580 #endif
11581
11582 weak_symbol(fopen);
11583
11584   ;
11585   return 0;
11586 }
11587 _ACEOF
11588 rm -f conftest.$ac_objext
11589 if { (eval echo "$as_me:11589: \"$ac_compile\"") >&5
11590   (eval $ac_compile) 2>&5
11591   ac_status=$?
11592   echo "$as_me:11592: \$? = $ac_status" >&5
11593   (exit $ac_status); } &&
11594          { ac_try='test -s conftest.$ac_objext'
11595   { (eval echo "$as_me:11595: \"$ac_try\"") >&5
11596   (eval $ac_try) 2>&5
11597   ac_status=$?
11598   echo "$as_me:11598: \$? = $ac_status" >&5
11599   (exit $ac_status); }; }; then
11600   cf_cv_weak_symbols=yes
11601 else
11602   echo "$as_me: failed program was:" >&5
11603 cat conftest.$ac_ext >&5
11604 cf_cv_weak_symbols=no
11605 fi
11606 rm -f conftest.$ac_objext conftest.$ac_ext
11607
11608 fi
11609 echo "$as_me:11609: result: $cf_cv_weak_symbols" >&5
11610 echo "${ECHO_T}$cf_cv_weak_symbols" >&6
11611
11612 else
11613         cf_cv_weak_symbols=no
11614 fi
11615
11616 if test $cf_cv_weak_symbols = yes ; then
11617
11618 cat >>confdefs.h <<\EOF
11619 #define USE_WEAK_SYMBOLS 1
11620 EOF
11621
11622 fi
11623
11624 PTHREAD=
11625 if test "$with_pthread" = "yes" ; then
11626
11627 cat >>confdefs.h <<\EOF
11628 #define USE_PTHREADS 1
11629 EOF
11630
11631         enable_reentrant=yes
11632         if test $cf_cv_weak_symbols = yes ; then
11633                 PTHREAD=-lpthread
11634         fi
11635 fi
11636
11637 # OpenSUSE is installing ncurses6, using reentrant option.
11638 echo "$as_me:11638: checking for _nc_TABSIZE" >&5
11639 echo $ECHO_N "checking for _nc_TABSIZE... $ECHO_C" >&6
11640 if test "${ac_cv_func__nc_TABSIZE+set}" = set; then
11641   echo $ECHO_N "(cached) $ECHO_C" >&6
11642 else
11643   cat >conftest.$ac_ext <<_ACEOF
11644 #line 11644 "configure"
11645 #include "confdefs.h"
11646 /* System header to define __stub macros and hopefully few prototypes,
11647     which can conflict with char _nc_TABSIZE (); below.  */
11648 #include <assert.h>
11649 /* Override any gcc2 internal prototype to avoid an error.  */
11650 #ifdef __cplusplus
11651 extern "C"
11652 #endif
11653 /* We use char because int might match the return type of a gcc2
11654    builtin and then its argument prototype would still apply.  */
11655 char _nc_TABSIZE ();
11656 char (*f) ();
11657
11658 int
11659 main ()
11660 {
11661 /* The GNU C library defines this for functions which it implements
11662     to always fail with ENOSYS.  Some functions are actually named
11663     something starting with __ and the normal name is an alias.  */
11664 #if defined (__stub__nc_TABSIZE) || defined (__stub____nc_TABSIZE)
11665 choke me
11666 #else
11667 f = _nc_TABSIZE; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
11668 #endif
11669
11670   ;
11671   return 0;
11672 }
11673 _ACEOF
11674 rm -f conftest.$ac_objext conftest$ac_exeext
11675 if { (eval echo "$as_me:11675: \"$ac_link\"") >&5
11676   (eval $ac_link) 2>&5
11677   ac_status=$?
11678   echo "$as_me:11678: \$? = $ac_status" >&5
11679   (exit $ac_status); } &&
11680          { ac_try='test -s conftest$ac_exeext'
11681   { (eval echo "$as_me:11681: \"$ac_try\"") >&5
11682   (eval $ac_try) 2>&5
11683   ac_status=$?
11684   echo "$as_me:11684: \$? = $ac_status" >&5
11685   (exit $ac_status); }; }; then
11686   ac_cv_func__nc_TABSIZE=yes
11687 else
11688   echo "$as_me: failed program was:" >&5
11689 cat conftest.$ac_ext >&5
11690 ac_cv_func__nc_TABSIZE=no
11691 fi
11692 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11693 fi
11694 echo "$as_me:11694: result: $ac_cv_func__nc_TABSIZE" >&5
11695 echo "${ECHO_T}$ac_cv_func__nc_TABSIZE" >&6
11696 if test $ac_cv_func__nc_TABSIZE = yes; then
11697   assume_reentrant=yes
11698 else
11699   assume_reentrant=no
11700 fi
11701
11702 # Reentrant code has to be opaque; there's little advantage to making ncurses
11703 # opaque outside of that, so there is no --enable-opaque option.  We can use
11704 # this option without --with-pthreads, but this will be always set for
11705 # pthreads.
11706 echo "$as_me:11706: checking if you want experimental reentrant code" >&5
11707 echo $ECHO_N "checking if you want experimental reentrant code... $ECHO_C" >&6
11708
11709 # Check whether --enable-reentrant or --disable-reentrant was given.
11710 if test "${enable_reentrant+set}" = set; then
11711   enableval="$enable_reentrant"
11712   with_reentrant=$enableval
11713 else
11714   with_reentrant=$assume_reentrant
11715 fi;
11716 echo "$as_me:11716: result: $with_reentrant" >&5
11717 echo "${ECHO_T}$with_reentrant" >&6
11718 if test "$with_reentrant" = yes ; then
11719         cf_cv_enable_reentrant=1
11720         if test $cf_cv_weak_symbols = yes ; then
11721
11722 # remove pthread library from $LIBS
11723 LIBS=`echo "$LIBS" | sed -e 's/-lpthread[       ]//g' -e 's/-lpthread$//'`
11724
11725         elif test "$assume_reentrant" = no ; then
11726                 LIB_SUFFIX="t${LIB_SUFFIX}"
11727         fi
11728
11729 cat >>confdefs.h <<\EOF
11730 #define USE_REENTRANT 1
11731 EOF
11732
11733 else
11734         cf_cv_enable_reentrant=0
11735 fi
11736
11737 ### Allow using a different wrap-prefix
11738 if test "$cf_cv_enable_reentrant" != 0 || test "$BROKEN_LINKER" = 1 ; then
11739         echo "$as_me:11739: checking for prefix used to wrap public variables" >&5
11740 echo $ECHO_N "checking for prefix used to wrap public variables... $ECHO_C" >&6
11741
11742 # Check whether --with-wrap-prefix or --without-wrap-prefix was given.
11743 if test "${with_wrap_prefix+set}" = set; then
11744   withval="$with_wrap_prefix"
11745   NCURSES_WRAP_PREFIX=$withval
11746 else
11747   NCURSES_WRAP_PREFIX=_nc_
11748 fi;
11749         echo "$as_me:11749: result: $NCURSES_WRAP_PREFIX" >&5
11750 echo "${ECHO_T}$NCURSES_WRAP_PREFIX" >&6
11751 else
11752         NCURSES_WRAP_PREFIX=_nc_
11753 fi
11754
11755 cat >>confdefs.h <<EOF
11756 #define NCURSES_WRAP_PREFIX "$NCURSES_WRAP_PREFIX"
11757 EOF
11758
11759 ###############################################################################
11760
11761 ###     use option --disable-echo to suppress full display compiling commands
11762
11763 echo "$as_me:11763: checking if you want to see long compiling messages" >&5
11764 echo $ECHO_N "checking if you want to see long compiling messages... $ECHO_C" >&6
11765
11766 # Check whether --enable-echo or --disable-echo was given.
11767 if test "${enable_echo+set}" = set; then
11768   enableval="$enable_echo"
11769   test "$enableval" != no && enableval=yes
11770         if test "$enableval" != "yes" ; then
11771
11772         ECHO_LT='--silent'
11773         ECHO_LD='@echo linking $@;'
11774         RULE_CC='@echo compiling $<'
11775         SHOW_CC='@echo compiling $@'
11776         ECHO_CC='@'
11777
11778         else
11779
11780         ECHO_LT=''
11781         ECHO_LD=''
11782         RULE_CC=''
11783         SHOW_CC=''
11784         ECHO_CC=''
11785
11786         fi
11787 else
11788   enableval=yes
11789
11790         ECHO_LT=''
11791         ECHO_LD=''
11792         RULE_CC=''
11793         SHOW_CC=''
11794         ECHO_CC=''
11795
11796 fi;
11797 echo "$as_me:11797: result: $enableval" >&5
11798 echo "${ECHO_T}$enableval" >&6
11799
11800 ###     use option --enable-warnings to turn on all gcc warnings
11801 echo "$as_me:11801: checking if you want to see compiler warnings" >&5
11802 echo $ECHO_N "checking if you want to see compiler warnings... $ECHO_C" >&6
11803
11804 # Check whether --enable-warnings or --disable-warnings was given.
11805 if test "${enable_warnings+set}" = set; then
11806   enableval="$enable_warnings"
11807   with_warnings=$enableval
11808 fi;
11809 echo "$as_me:11809: result: $with_warnings" >&5
11810 echo "${ECHO_T}$with_warnings" >&6
11811
11812 if test "x$with_warnings" = "xyes"; then
11813
11814         ADAFLAGS="$ADAFLAGS -gnatg"
11815
11816 INTEL_COMPILER=no
11817
11818 if test "$GCC" = yes ; then
11819         case $host_os in
11820         (linux*|gnu*)
11821                 echo "$as_me:11821: checking if this is really Intel C compiler" >&5
11822 echo $ECHO_N "checking if this is really Intel C compiler... $ECHO_C" >&6
11823                 cf_save_CFLAGS="$CFLAGS"
11824                 CFLAGS="$CFLAGS -no-gcc"
11825                 cat >conftest.$ac_ext <<_ACEOF
11826 #line 11826 "configure"
11827 #include "confdefs.h"
11828
11829 int
11830 main ()
11831 {
11832
11833 #ifdef __INTEL_COMPILER
11834 #else
11835 make an error
11836 #endif
11837
11838   ;
11839   return 0;
11840 }
11841 _ACEOF
11842 rm -f conftest.$ac_objext
11843 if { (eval echo "$as_me:11843: \"$ac_compile\"") >&5
11844   (eval $ac_compile) 2>&5
11845   ac_status=$?
11846   echo "$as_me:11846: \$? = $ac_status" >&5
11847   (exit $ac_status); } &&
11848          { ac_try='test -s conftest.$ac_objext'
11849   { (eval echo "$as_me:11849: \"$ac_try\"") >&5
11850   (eval $ac_try) 2>&5
11851   ac_status=$?
11852   echo "$as_me:11852: \$? = $ac_status" >&5
11853   (exit $ac_status); }; }; then
11854   INTEL_COMPILER=yes
11855 cf_save_CFLAGS="$cf_save_CFLAGS -we147"
11856
11857 else
11858   echo "$as_me: failed program was:" >&5
11859 cat conftest.$ac_ext >&5
11860 fi
11861 rm -f conftest.$ac_objext conftest.$ac_ext
11862                 CFLAGS="$cf_save_CFLAGS"
11863                 echo "$as_me:11863: result: $INTEL_COMPILER" >&5
11864 echo "${ECHO_T}$INTEL_COMPILER" >&6
11865                 ;;
11866         esac
11867 fi
11868
11869 CLANG_COMPILER=no
11870
11871 if test "$GCC" = yes ; then
11872         echo "$as_me:11872: checking if this is really Clang C compiler" >&5
11873 echo $ECHO_N "checking if this is really Clang C compiler... $ECHO_C" >&6
11874         cf_save_CFLAGS="$CFLAGS"
11875         CFLAGS="$CFLAGS -Qunused-arguments"
11876         cat >conftest.$ac_ext <<_ACEOF
11877 #line 11877 "configure"
11878 #include "confdefs.h"
11879
11880 int
11881 main ()
11882 {
11883
11884 #ifdef __clang__
11885 #else
11886 make an error
11887 #endif
11888
11889   ;
11890   return 0;
11891 }
11892 _ACEOF
11893 rm -f conftest.$ac_objext
11894 if { (eval echo "$as_me:11894: \"$ac_compile\"") >&5
11895   (eval $ac_compile) 2>&5
11896   ac_status=$?
11897   echo "$as_me:11897: \$? = $ac_status" >&5
11898   (exit $ac_status); } &&
11899          { ac_try='test -s conftest.$ac_objext'
11900   { (eval echo "$as_me:11900: \"$ac_try\"") >&5
11901   (eval $ac_try) 2>&5
11902   ac_status=$?
11903   echo "$as_me:11903: \$? = $ac_status" >&5
11904   (exit $ac_status); }; }; then
11905   CLANG_COMPILER=yes
11906 cf_save_CFLAGS="$cf_save_CFLAGS -Qunused-arguments"
11907
11908 else
11909   echo "$as_me: failed program was:" >&5
11910 cat conftest.$ac_ext >&5
11911 fi
11912 rm -f conftest.$ac_objext conftest.$ac_ext
11913         CFLAGS="$cf_save_CFLAGS"
11914         echo "$as_me:11914: result: $CLANG_COMPILER" >&5
11915 echo "${ECHO_T}$CLANG_COMPILER" >&6
11916 fi
11917
11918 cat > conftest.$ac_ext <<EOF
11919 #line 11919 "${as_me:-configure}"
11920 int main(int argc, char *argv[]) { return (argv[argc-1] == 0) ; }
11921 EOF
11922
11923 if test "$INTEL_COMPILER" = yes
11924 then
11925 # The "-wdXXX" options suppress warnings:
11926 # remark #1419: external declaration in primary source file
11927 # remark #1683: explicit conversion of a 64-bit integral type to a smaller integral type (potential portability problem)
11928 # remark #1684: conversion from pointer to same-sized integral type (potential portability problem)
11929 # remark #193: zero used for undefined preprocessing identifier
11930 # remark #593: variable "curs_sb_left_arrow" was set but never used
11931 # remark #810: conversion from "int" to "Dimension={unsigned short}" may lose significant bits
11932 # remark #869: parameter "tw" was never referenced
11933 # remark #981: operands are evaluated in unspecified order
11934 # warning #279: controlling expression is constant
11935
11936         { echo "$as_me:11936: checking for $CC warning options..." >&5
11937 echo "$as_me: checking for $CC warning options..." >&6;}
11938         cf_save_CFLAGS="$CFLAGS"
11939         EXTRA_CFLAGS="-Wall"
11940         for cf_opt in \
11941                 wd1419 \
11942                 wd1683 \
11943                 wd1684 \
11944                 wd193 \
11945                 wd593 \
11946                 wd279 \
11947                 wd810 \
11948                 wd869 \
11949                 wd981
11950         do
11951                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
11952                 if { (eval echo "$as_me:11952: \"$ac_compile\"") >&5
11953   (eval $ac_compile) 2>&5
11954   ac_status=$?
11955   echo "$as_me:11955: \$? = $ac_status" >&5
11956   (exit $ac_status); }; then
11957                         test -n "$verbose" && echo "$as_me:11957: result: ... -$cf_opt" >&5
11958 echo "${ECHO_T}... -$cf_opt" >&6
11959                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
11960                 fi
11961         done
11962         CFLAGS="$cf_save_CFLAGS"
11963
11964 elif test "$GCC" = yes
11965 then
11966         { echo "$as_me:11966: checking for $CC warning options..." >&5
11967 echo "$as_me: checking for $CC warning options..." >&6;}
11968         cf_save_CFLAGS="$CFLAGS"
11969         EXTRA_CFLAGS=
11970         cf_warn_CONST=""
11971         test "$with_ext_const" = yes && cf_warn_CONST="Wwrite-strings"
11972         cf_gcc_warnings="Wignored-qualifiers Wlogical-op Wvarargs"
11973         test "x$CLANG_COMPILER" = xyes && cf_gcc_warnings=
11974         for cf_opt in W Wall \
11975                 Wbad-function-cast \
11976                 Wcast-align \
11977                 Wcast-qual \
11978                 Wdeclaration-after-statement \
11979                 Wextra \
11980                 Winline \
11981                 Wmissing-declarations \
11982                 Wmissing-prototypes \
11983                 Wnested-externs \
11984                 Wpointer-arith \
11985                 Wshadow \
11986                 Wstrict-prototypes \
11987                 Wundef $cf_gcc_warnings $cf_warn_CONST Wno-unknown-pragmas Wswitch-enum
11988         do
11989                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
11990                 if { (eval echo "$as_me:11990: \"$ac_compile\"") >&5
11991   (eval $ac_compile) 2>&5
11992   ac_status=$?
11993   echo "$as_me:11993: \$? = $ac_status" >&5
11994   (exit $ac_status); }; then
11995                         test -n "$verbose" && echo "$as_me:11995: result: ... -$cf_opt" >&5
11996 echo "${ECHO_T}... -$cf_opt" >&6
11997                         case $cf_opt in
11998                         (Wcast-qual)
11999                                 CPPFLAGS="$CPPFLAGS -DXTSTRINGDEFINES"
12000                                 ;;
12001                         (Winline)
12002                                 case $GCC_VERSION in
12003                                 ([34].*)
12004                                         test -n "$verbose" && echo "    feature is broken in gcc $GCC_VERSION" 1>&6
12005
12006 echo "${as_me:-configure}:12006: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
12007
12008                                         continue;;
12009                                 esac
12010                                 ;;
12011                         (Wpointer-arith)
12012                                 case $GCC_VERSION in
12013                                 ([12].*)
12014                                         test -n "$verbose" && echo "    feature is broken in gcc $GCC_VERSION" 1>&6
12015
12016 echo "${as_me:-configure}:12016: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
12017
12018                                         continue;;
12019                                 esac
12020                                 ;;
12021                         esac
12022                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
12023                 fi
12024         done
12025         CFLAGS="$cf_save_CFLAGS"
12026 fi
12027 rm -rf conftest*
12028
12029 fi
12030
12031 if test "$GCC" = yes
12032 then
12033 cat > conftest.i <<EOF
12034 #ifndef GCC_PRINTF
12035 #define GCC_PRINTF 0
12036 #endif
12037 #ifndef GCC_SCANF
12038 #define GCC_SCANF 0
12039 #endif
12040 #ifndef GCC_NORETURN
12041 #define GCC_NORETURN /* nothing */
12042 #endif
12043 #ifndef GCC_UNUSED
12044 #define GCC_UNUSED /* nothing */
12045 #endif
12046 EOF
12047 if test "$GCC" = yes
12048 then
12049         { echo "$as_me:12049: checking for $CC __attribute__ directives..." >&5
12050 echo "$as_me: checking for $CC __attribute__ directives..." >&6;}
12051 cat > conftest.$ac_ext <<EOF
12052 #line 12052 "${as_me:-configure}"
12053 #include "confdefs.h"
12054 #include "conftest.h"
12055 #include "conftest.i"
12056 #if     GCC_PRINTF
12057 #define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
12058 #else
12059 #define GCC_PRINTFLIKE(fmt,var) /*nothing*/
12060 #endif
12061 #if     GCC_SCANF
12062 #define GCC_SCANFLIKE(fmt,var)  __attribute__((format(scanf,fmt,var)))
12063 #else
12064 #define GCC_SCANFLIKE(fmt,var)  /*nothing*/
12065 #endif
12066 extern void wow(char *,...) GCC_SCANFLIKE(1,2);
12067 extern void oops(char *,...) GCC_PRINTFLIKE(1,2) GCC_NORETURN;
12068 extern void foo(void) GCC_NORETURN;
12069 int main(int argc GCC_UNUSED, char *argv[] GCC_UNUSED) { return 0; }
12070 EOF
12071         cf_printf_attribute=no
12072         cf_scanf_attribute=no
12073         for cf_attribute in scanf printf unused noreturn
12074         do
12075
12076 cf_ATTRIBUTE=`echo "$cf_attribute" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
12077
12078                 cf_directive="__attribute__(($cf_attribute))"
12079                 echo "checking for $CC $cf_directive" 1>&5
12080
12081                 case $cf_attribute in
12082                 (printf)
12083                         cf_printf_attribute=yes
12084                         cat >conftest.h <<EOF
12085 #define GCC_$cf_ATTRIBUTE 1
12086 EOF
12087                         ;;
12088                 (scanf)
12089                         cf_scanf_attribute=yes
12090                         cat >conftest.h <<EOF
12091 #define GCC_$cf_ATTRIBUTE 1
12092 EOF
12093                         ;;
12094                 (*)
12095                         cat >conftest.h <<EOF
12096 #define GCC_$cf_ATTRIBUTE $cf_directive
12097 EOF
12098                         ;;
12099                 esac
12100
12101                 if { (eval echo "$as_me:12101: \"$ac_compile\"") >&5
12102   (eval $ac_compile) 2>&5
12103   ac_status=$?
12104   echo "$as_me:12104: \$? = $ac_status" >&5
12105   (exit $ac_status); }; then
12106                         test -n "$verbose" && echo "$as_me:12106: result: ... $cf_attribute" >&5
12107 echo "${ECHO_T}... $cf_attribute" >&6
12108                         cat conftest.h >>confdefs.h
12109                         case $cf_attribute in
12110                         (noreturn)
12111
12112 cat >>confdefs.h <<EOF
12113 #define GCC_NORETURN $cf_directive
12114 EOF
12115
12116                                 ;;
12117                         (printf)
12118                                 cf_value='/* nothing */'
12119                                 if test "$cf_printf_attribute" != no ; then
12120                                         cf_value='__attribute__((format(printf,fmt,var)))'
12121
12122 cat >>confdefs.h <<\EOF
12123 #define GCC_PRINTF 1
12124 EOF
12125
12126                                 fi
12127
12128 cat >>confdefs.h <<EOF
12129 #define GCC_PRINTFLIKE(fmt,var) $cf_value
12130 EOF
12131
12132                                 ;;
12133                         (scanf)
12134                                 cf_value='/* nothing */'
12135                                 if test "$cf_scanf_attribute" != no ; then
12136                                         cf_value='__attribute__((format(scanf,fmt,var)))'
12137
12138 cat >>confdefs.h <<\EOF
12139 #define GCC_SCANF 1
12140 EOF
12141
12142                                 fi
12143
12144 cat >>confdefs.h <<EOF
12145 #define GCC_SCANFLIKE(fmt,var) $cf_value
12146 EOF
12147
12148                                 ;;
12149                         (unused)
12150
12151 cat >>confdefs.h <<EOF
12152 #define GCC_UNUSED $cf_directive
12153 EOF
12154
12155                                 ;;
12156                         esac
12157                 fi
12158         done
12159 else
12160         fgrep define conftest.i >>confdefs.h
12161 fi
12162 rm -rf conftest*
12163 fi
12164
12165 ###     use option --enable-assertions to turn on generation of assertion code
12166 echo "$as_me:12166: checking if you want to enable runtime assertions" >&5
12167 echo $ECHO_N "checking if you want to enable runtime assertions... $ECHO_C" >&6
12168
12169 # Check whether --enable-assertions or --disable-assertions was given.
12170 if test "${enable_assertions+set}" = set; then
12171   enableval="$enable_assertions"
12172   with_assertions=$enableval
12173 else
12174   with_assertions=no
12175 fi;
12176 echo "$as_me:12176: result: $with_assertions" >&5
12177 echo "${ECHO_T}$with_assertions" >&6
12178 if test -n "$GCC"
12179 then
12180         if test "$with_assertions" = no
12181         then
12182                 CPPFLAGS="$CPPFLAGS -DNDEBUG"
12183         else
12184
12185         ADAFLAGS="$ADAFLAGS -gnata"
12186
12187         fi
12188 fi
12189
12190 ###     use option --disable-leaks to suppress "permanent" leaks, for testing
12191
12192 cat >>confdefs.h <<\EOF
12193 #define HAVE_NC_ALLOC_H 1
12194 EOF
12195
12196 ###     use option --enable-expanded to generate certain macros as functions
12197
12198 # Check whether --enable-expanded or --disable-expanded was given.
12199 if test "${enable_expanded+set}" = set; then
12200   enableval="$enable_expanded"
12201   test "$enableval" = yes &&
12202 cat >>confdefs.h <<\EOF
12203 #define NCURSES_EXPANDED 1
12204 EOF
12205
12206 fi;
12207
12208 ###     use option --disable-macros to suppress macros in favor of functions
12209
12210 # Check whether --enable-macros or --disable-macros was given.
12211 if test "${enable_macros+set}" = set; then
12212   enableval="$enable_macros"
12213   test "$enableval" = no &&
12214 cat >>confdefs.h <<\EOF
12215 #define NCURSES_NOMACROS 1
12216 EOF
12217
12218 fi;
12219
12220 # Normally we only add trace() to the debug-library.  Allow this to be
12221 # extended to all models of the ncurses library:
12222 cf_all_traces=no
12223 case "$CFLAGS $CPPFLAGS" in
12224 (*-DTRACE*)
12225         cf_all_traces=yes
12226         ;;
12227 esac
12228
12229 echo "$as_me:12229: checking whether to add trace feature to all models" >&5
12230 echo $ECHO_N "checking whether to add trace feature to all models... $ECHO_C" >&6
12231
12232 # Check whether --with-trace or --without-trace was given.
12233 if test "${with_trace+set}" = set; then
12234   withval="$with_trace"
12235   cf_with_trace=$withval
12236 else
12237   cf_with_trace=$cf_all_traces
12238 fi;
12239 echo "$as_me:12239: result: $cf_with_trace" >&5
12240 echo "${ECHO_T}$cf_with_trace" >&6
12241
12242 if test "$cf_with_trace" = yes ; then
12243         ADA_TRACE=TRUE
12244
12245 cf_fix_cppflags=no
12246 cf_new_cflags=
12247 cf_new_cppflags=
12248 cf_new_extra_cppflags=
12249
12250 for cf_add_cflags in -DTRACE
12251 do
12252 case $cf_fix_cppflags in
12253 (no)
12254         case $cf_add_cflags in
12255         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
12256                 case $cf_add_cflags in
12257                 (-D*)
12258                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
12259
12260                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12261                                 && test -z "${cf_tst_cflags}" \
12262                                 && cf_fix_cppflags=yes
12263
12264                         if test $cf_fix_cppflags = yes ; then
12265                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
12266                                 continue
12267                         elif test "${cf_tst_cflags}" = "\"'" ; then
12268                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
12269                                 continue
12270                         fi
12271                         ;;
12272                 esac
12273                 case "$CPPFLAGS" in
12274                 (*$cf_add_cflags)
12275                         ;;
12276                 (*)
12277                         case $cf_add_cflags in
12278                         (-D*)
12279                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
12280
12281 CPPFLAGS=`echo "$CPPFLAGS" | \
12282         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
12283                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
12284
12285                                 ;;
12286                         esac
12287                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
12288                         ;;
12289                 esac
12290                 ;;
12291         (*)
12292                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
12293                 ;;
12294         esac
12295         ;;
12296 (yes)
12297         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
12298
12299         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
12300
12301         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12302                 && test -z "${cf_tst_cflags}" \
12303                 && cf_fix_cppflags=no
12304         ;;
12305 esac
12306 done
12307
12308 if test -n "$cf_new_cflags" ; then
12309
12310         CFLAGS="$CFLAGS $cf_new_cflags"
12311 fi
12312
12313 if test -n "$cf_new_cppflags" ; then
12314
12315         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
12316 fi
12317
12318 if test -n "$cf_new_extra_cppflags" ; then
12319
12320         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
12321 fi
12322
12323 else
12324         ADA_TRACE=FALSE
12325 fi
12326
12327 echo "$as_me:12327: checking if we want to use GNAT projects" >&5
12328 echo $ECHO_N "checking if we want to use GNAT projects... $ECHO_C" >&6
12329
12330 # Check whether --enable-gnat-projects or --disable-gnat-projects was given.
12331 if test "${enable_gnat_projects+set}" = set; then
12332   enableval="$enable_gnat_projects"
12333   test "$enableval" != no && enableval=yes
12334         if test "$enableval" != "yes" ; then
12335     enable_gnat_projects=no
12336         else
12337                 enable_gnat_projects=yes
12338         fi
12339 else
12340   enableval=yes
12341         enable_gnat_projects=yes
12342
12343 fi;
12344 echo "$as_me:12344: result: $enable_gnat_projects" >&5
12345 echo "${ECHO_T}$enable_gnat_projects" >&6
12346
12347 ###     Checks for libraries.
12348 case $cf_cv_system_name in
12349 (*mingw32*)
12350         ;;
12351 (*)
12352 echo "$as_me:12352: checking for gettimeofday" >&5
12353 echo $ECHO_N "checking for gettimeofday... $ECHO_C" >&6
12354 if test "${ac_cv_func_gettimeofday+set}" = set; then
12355   echo $ECHO_N "(cached) $ECHO_C" >&6
12356 else
12357   cat >conftest.$ac_ext <<_ACEOF
12358 #line 12358 "configure"
12359 #include "confdefs.h"
12360 /* System header to define __stub macros and hopefully few prototypes,
12361     which can conflict with char gettimeofday (); below.  */
12362 #include <assert.h>
12363 /* Override any gcc2 internal prototype to avoid an error.  */
12364 #ifdef __cplusplus
12365 extern "C"
12366 #endif
12367 /* We use char because int might match the return type of a gcc2
12368    builtin and then its argument prototype would still apply.  */
12369 char gettimeofday ();
12370 char (*f) ();
12371
12372 int
12373 main ()
12374 {
12375 /* The GNU C library defines this for functions which it implements
12376     to always fail with ENOSYS.  Some functions are actually named
12377     something starting with __ and the normal name is an alias.  */
12378 #if defined (__stub_gettimeofday) || defined (__stub___gettimeofday)
12379 choke me
12380 #else
12381 f = gettimeofday; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
12382 #endif
12383
12384   ;
12385   return 0;
12386 }
12387 _ACEOF
12388 rm -f conftest.$ac_objext conftest$ac_exeext
12389 if { (eval echo "$as_me:12389: \"$ac_link\"") >&5
12390   (eval $ac_link) 2>&5
12391   ac_status=$?
12392   echo "$as_me:12392: \$? = $ac_status" >&5
12393   (exit $ac_status); } &&
12394          { ac_try='test -s conftest$ac_exeext'
12395   { (eval echo "$as_me:12395: \"$ac_try\"") >&5
12396   (eval $ac_try) 2>&5
12397   ac_status=$?
12398   echo "$as_me:12398: \$? = $ac_status" >&5
12399   (exit $ac_status); }; }; then
12400   ac_cv_func_gettimeofday=yes
12401 else
12402   echo "$as_me: failed program was:" >&5
12403 cat conftest.$ac_ext >&5
12404 ac_cv_func_gettimeofday=no
12405 fi
12406 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12407 fi
12408 echo "$as_me:12408: result: $ac_cv_func_gettimeofday" >&5
12409 echo "${ECHO_T}$ac_cv_func_gettimeofday" >&6
12410 if test $ac_cv_func_gettimeofday = yes; then
12411   cat >>confdefs.h <<\EOF
12412 #define HAVE_GETTIMEOFDAY 1
12413 EOF
12414
12415 else
12416
12417 echo "$as_me:12417: checking for gettimeofday in -lbsd" >&5
12418 echo $ECHO_N "checking for gettimeofday in -lbsd... $ECHO_C" >&6
12419 if test "${ac_cv_lib_bsd_gettimeofday+set}" = set; then
12420   echo $ECHO_N "(cached) $ECHO_C" >&6
12421 else
12422   ac_check_lib_save_LIBS=$LIBS
12423 LIBS="-lbsd  $LIBS"
12424 cat >conftest.$ac_ext <<_ACEOF
12425 #line 12425 "configure"
12426 #include "confdefs.h"
12427
12428 /* Override any gcc2 internal prototype to avoid an error.  */
12429 #ifdef __cplusplus
12430 extern "C"
12431 #endif
12432 /* We use char because int might match the return type of a gcc2
12433    builtin and then its argument prototype would still apply.  */
12434 char gettimeofday ();
12435 int
12436 main ()
12437 {
12438 gettimeofday ();
12439   ;
12440   return 0;
12441 }
12442 _ACEOF
12443 rm -f conftest.$ac_objext conftest$ac_exeext
12444 if { (eval echo "$as_me:12444: \"$ac_link\"") >&5
12445   (eval $ac_link) 2>&5
12446   ac_status=$?
12447   echo "$as_me:12447: \$? = $ac_status" >&5
12448   (exit $ac_status); } &&
12449          { ac_try='test -s conftest$ac_exeext'
12450   { (eval echo "$as_me:12450: \"$ac_try\"") >&5
12451   (eval $ac_try) 2>&5
12452   ac_status=$?
12453   echo "$as_me:12453: \$? = $ac_status" >&5
12454   (exit $ac_status); }; }; then
12455   ac_cv_lib_bsd_gettimeofday=yes
12456 else
12457   echo "$as_me: failed program was:" >&5
12458 cat conftest.$ac_ext >&5
12459 ac_cv_lib_bsd_gettimeofday=no
12460 fi
12461 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12462 LIBS=$ac_check_lib_save_LIBS
12463 fi
12464 echo "$as_me:12464: result: $ac_cv_lib_bsd_gettimeofday" >&5
12465 echo "${ECHO_T}$ac_cv_lib_bsd_gettimeofday" >&6
12466 if test $ac_cv_lib_bsd_gettimeofday = yes; then
12467
12468 cat >>confdefs.h <<\EOF
12469 #define HAVE_GETTIMEOFDAY 1
12470 EOF
12471
12472         LIBS="$LIBS -lbsd"
12473 fi
12474
12475 fi
12476         ;;
12477 esac
12478
12479 ###     Checks for header files.
12480 echo "$as_me:12480: checking for ANSI C header files" >&5
12481 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
12482 if test "${ac_cv_header_stdc+set}" = set; then
12483   echo $ECHO_N "(cached) $ECHO_C" >&6
12484 else
12485   cat >conftest.$ac_ext <<_ACEOF
12486 #line 12486 "configure"
12487 #include "confdefs.h"
12488 #include <stdlib.h>
12489 #include <stdarg.h>
12490 #include <string.h>
12491 #include <float.h>
12492
12493 _ACEOF
12494 if { (eval echo "$as_me:12494: \"$ac_cpp conftest.$ac_ext\"") >&5
12495   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
12496   ac_status=$?
12497   egrep -v '^ *\+' conftest.er1 >conftest.err
12498   rm -f conftest.er1
12499   cat conftest.err >&5
12500   echo "$as_me:12500: \$? = $ac_status" >&5
12501   (exit $ac_status); } >/dev/null; then
12502   if test -s conftest.err; then
12503     ac_cpp_err=$ac_c_preproc_warn_flag
12504   else
12505     ac_cpp_err=
12506   fi
12507 else
12508   ac_cpp_err=yes
12509 fi
12510 if test -z "$ac_cpp_err"; then
12511   ac_cv_header_stdc=yes
12512 else
12513   echo "$as_me: failed program was:" >&5
12514   cat conftest.$ac_ext >&5
12515   ac_cv_header_stdc=no
12516 fi
12517 rm -f conftest.err conftest.$ac_ext
12518
12519 if test $ac_cv_header_stdc = yes; then
12520   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
12521   cat >conftest.$ac_ext <<_ACEOF
12522 #line 12522 "configure"
12523 #include "confdefs.h"
12524 #include <string.h>
12525
12526 _ACEOF
12527 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
12528   egrep "memchr" >/dev/null 2>&1; then
12529   :
12530 else
12531   ac_cv_header_stdc=no
12532 fi
12533 rm -rf conftest*
12534
12535 fi
12536
12537 if test $ac_cv_header_stdc = yes; then
12538   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
12539   cat >conftest.$ac_ext <<_ACEOF
12540 #line 12540 "configure"
12541 #include "confdefs.h"
12542 #include <stdlib.h>
12543
12544 _ACEOF
12545 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
12546   egrep "free" >/dev/null 2>&1; then
12547   :
12548 else
12549   ac_cv_header_stdc=no
12550 fi
12551 rm -rf conftest*
12552
12553 fi
12554
12555 if test $ac_cv_header_stdc = yes; then
12556   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
12557   if test "$cross_compiling" = yes; then
12558   :
12559 else
12560   cat >conftest.$ac_ext <<_ACEOF
12561 #line 12561 "configure"
12562 #include "confdefs.h"
12563 #include <ctype.h>
12564 #if ((' ' & 0x0FF) == 0x020)
12565 # define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
12566 # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
12567 #else
12568 # define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
12569                      || ('j' <= (c) && (c) <= 'r') \
12570                      || ('s' <= (c) && (c) <= 'z'))
12571 # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
12572 #endif
12573
12574 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
12575 int
12576 main ()
12577 {
12578   int i;
12579   for (i = 0; i < 256; i++)
12580     if (XOR (islower (i), ISLOWER (i))
12581         || toupper (i) != TOUPPER (i))
12582       $ac_main_return(2);
12583   $ac_main_return (0);
12584 }
12585 _ACEOF
12586 rm -f conftest$ac_exeext
12587 if { (eval echo "$as_me:12587: \"$ac_link\"") >&5
12588   (eval $ac_link) 2>&5
12589   ac_status=$?
12590   echo "$as_me:12590: \$? = $ac_status" >&5
12591   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
12592   { (eval echo "$as_me:12592: \"$ac_try\"") >&5
12593   (eval $ac_try) 2>&5
12594   ac_status=$?
12595   echo "$as_me:12595: \$? = $ac_status" >&5
12596   (exit $ac_status); }; }; then
12597   :
12598 else
12599   echo "$as_me: program exited with status $ac_status" >&5
12600 echo "$as_me: failed program was:" >&5
12601 cat conftest.$ac_ext >&5
12602 ac_cv_header_stdc=no
12603 fi
12604 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
12605 fi
12606 fi
12607 fi
12608 echo "$as_me:12608: result: $ac_cv_header_stdc" >&5
12609 echo "${ECHO_T}$ac_cv_header_stdc" >&6
12610 if test $ac_cv_header_stdc = yes; then
12611
12612 cat >>confdefs.h <<\EOF
12613 #define STDC_HEADERS 1
12614 EOF
12615
12616 fi
12617
12618 ac_header_dirent=no
12619 for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h; do
12620   as_ac_Header=`echo "ac_cv_header_dirent_$ac_hdr" | $as_tr_sh`
12621 echo "$as_me:12621: checking for $ac_hdr that defines DIR" >&5
12622 echo $ECHO_N "checking for $ac_hdr that defines DIR... $ECHO_C" >&6
12623 if eval "test \"\${$as_ac_Header+set}\" = set"; then
12624   echo $ECHO_N "(cached) $ECHO_C" >&6
12625 else
12626   cat >conftest.$ac_ext <<_ACEOF
12627 #line 12627 "configure"
12628 #include "confdefs.h"
12629 #include <sys/types.h>
12630 #include <$ac_hdr>
12631
12632 int
12633 main ()
12634 {
12635 if ((DIR *) 0)
12636 return 0;
12637   ;
12638   return 0;
12639 }
12640 _ACEOF
12641 rm -f conftest.$ac_objext
12642 if { (eval echo "$as_me:12642: \"$ac_compile\"") >&5
12643   (eval $ac_compile) 2>&5
12644   ac_status=$?
12645   echo "$as_me:12645: \$? = $ac_status" >&5
12646   (exit $ac_status); } &&
12647          { ac_try='test -s conftest.$ac_objext'
12648   { (eval echo "$as_me:12648: \"$ac_try\"") >&5
12649   (eval $ac_try) 2>&5
12650   ac_status=$?
12651   echo "$as_me:12651: \$? = $ac_status" >&5
12652   (exit $ac_status); }; }; then
12653   eval "$as_ac_Header=yes"
12654 else
12655   echo "$as_me: failed program was:" >&5
12656 cat conftest.$ac_ext >&5
12657 eval "$as_ac_Header=no"
12658 fi
12659 rm -f conftest.$ac_objext conftest.$ac_ext
12660 fi
12661 echo "$as_me:12661: result: `eval echo '${'$as_ac_Header'}'`" >&5
12662 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
12663 if test `eval echo '${'$as_ac_Header'}'` = yes; then
12664   cat >>confdefs.h <<EOF
12665 #define `echo "HAVE_$ac_hdr" | $as_tr_cpp` 1
12666 EOF
12667
12668 ac_header_dirent=$ac_hdr; break
12669 fi
12670
12671 done
12672 # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix.
12673 if test $ac_header_dirent = dirent.h; then
12674   echo "$as_me:12674: checking for opendir in -ldir" >&5
12675 echo $ECHO_N "checking for opendir in -ldir... $ECHO_C" >&6
12676 if test "${ac_cv_lib_dir_opendir+set}" = set; then
12677   echo $ECHO_N "(cached) $ECHO_C" >&6
12678 else
12679   ac_check_lib_save_LIBS=$LIBS
12680 LIBS="-ldir  $LIBS"
12681 cat >conftest.$ac_ext <<_ACEOF
12682 #line 12682 "configure"
12683 #include "confdefs.h"
12684
12685 /* Override any gcc2 internal prototype to avoid an error.  */
12686 #ifdef __cplusplus
12687 extern "C"
12688 #endif
12689 /* We use char because int might match the return type of a gcc2
12690    builtin and then its argument prototype would still apply.  */
12691 char opendir ();
12692 int
12693 main ()
12694 {
12695 opendir ();
12696   ;
12697   return 0;
12698 }
12699 _ACEOF
12700 rm -f conftest.$ac_objext conftest$ac_exeext
12701 if { (eval echo "$as_me:12701: \"$ac_link\"") >&5
12702   (eval $ac_link) 2>&5
12703   ac_status=$?
12704   echo "$as_me:12704: \$? = $ac_status" >&5
12705   (exit $ac_status); } &&
12706          { ac_try='test -s conftest$ac_exeext'
12707   { (eval echo "$as_me:12707: \"$ac_try\"") >&5
12708   (eval $ac_try) 2>&5
12709   ac_status=$?
12710   echo "$as_me:12710: \$? = $ac_status" >&5
12711   (exit $ac_status); }; }; then
12712   ac_cv_lib_dir_opendir=yes
12713 else
12714   echo "$as_me: failed program was:" >&5
12715 cat conftest.$ac_ext >&5
12716 ac_cv_lib_dir_opendir=no
12717 fi
12718 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12719 LIBS=$ac_check_lib_save_LIBS
12720 fi
12721 echo "$as_me:12721: result: $ac_cv_lib_dir_opendir" >&5
12722 echo "${ECHO_T}$ac_cv_lib_dir_opendir" >&6
12723 if test $ac_cv_lib_dir_opendir = yes; then
12724   LIBS="$LIBS -ldir"
12725 fi
12726
12727 else
12728   echo "$as_me:12728: checking for opendir in -lx" >&5
12729 echo $ECHO_N "checking for opendir in -lx... $ECHO_C" >&6
12730 if test "${ac_cv_lib_x_opendir+set}" = set; then
12731   echo $ECHO_N "(cached) $ECHO_C" >&6
12732 else
12733   ac_check_lib_save_LIBS=$LIBS
12734 LIBS="-lx  $LIBS"
12735 cat >conftest.$ac_ext <<_ACEOF
12736 #line 12736 "configure"
12737 #include "confdefs.h"
12738
12739 /* Override any gcc2 internal prototype to avoid an error.  */
12740 #ifdef __cplusplus
12741 extern "C"
12742 #endif
12743 /* We use char because int might match the return type of a gcc2
12744    builtin and then its argument prototype would still apply.  */
12745 char opendir ();
12746 int
12747 main ()
12748 {
12749 opendir ();
12750   ;
12751   return 0;
12752 }
12753 _ACEOF
12754 rm -f conftest.$ac_objext conftest$ac_exeext
12755 if { (eval echo "$as_me:12755: \"$ac_link\"") >&5
12756   (eval $ac_link) 2>&5
12757   ac_status=$?
12758   echo "$as_me:12758: \$? = $ac_status" >&5
12759   (exit $ac_status); } &&
12760          { ac_try='test -s conftest$ac_exeext'
12761   { (eval echo "$as_me:12761: \"$ac_try\"") >&5
12762   (eval $ac_try) 2>&5
12763   ac_status=$?
12764   echo "$as_me:12764: \$? = $ac_status" >&5
12765   (exit $ac_status); }; }; then
12766   ac_cv_lib_x_opendir=yes
12767 else
12768   echo "$as_me: failed program was:" >&5
12769 cat conftest.$ac_ext >&5
12770 ac_cv_lib_x_opendir=no
12771 fi
12772 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12773 LIBS=$ac_check_lib_save_LIBS
12774 fi
12775 echo "$as_me:12775: result: $ac_cv_lib_x_opendir" >&5
12776 echo "${ECHO_T}$ac_cv_lib_x_opendir" >&6
12777 if test $ac_cv_lib_x_opendir = yes; then
12778   LIBS="$LIBS -lx"
12779 fi
12780
12781 fi
12782
12783 echo "$as_me:12783: checking whether time.h and sys/time.h may both be included" >&5
12784 echo $ECHO_N "checking whether time.h and sys/time.h may both be included... $ECHO_C" >&6
12785 if test "${ac_cv_header_time+set}" = set; then
12786   echo $ECHO_N "(cached) $ECHO_C" >&6
12787 else
12788   cat >conftest.$ac_ext <<_ACEOF
12789 #line 12789 "configure"
12790 #include "confdefs.h"
12791 #include <sys/types.h>
12792 #include <sys/time.h>
12793 #include <time.h>
12794
12795 int
12796 main ()
12797 {
12798 if ((struct tm *) 0)
12799 return 0;
12800   ;
12801   return 0;
12802 }
12803 _ACEOF
12804 rm -f conftest.$ac_objext
12805 if { (eval echo "$as_me:12805: \"$ac_compile\"") >&5
12806   (eval $ac_compile) 2>&5
12807   ac_status=$?
12808   echo "$as_me:12808: \$? = $ac_status" >&5
12809   (exit $ac_status); } &&
12810          { ac_try='test -s conftest.$ac_objext'
12811   { (eval echo "$as_me:12811: \"$ac_try\"") >&5
12812   (eval $ac_try) 2>&5
12813   ac_status=$?
12814   echo "$as_me:12814: \$? = $ac_status" >&5
12815   (exit $ac_status); }; }; then
12816   ac_cv_header_time=yes
12817 else
12818   echo "$as_me: failed program was:" >&5
12819 cat conftest.$ac_ext >&5
12820 ac_cv_header_time=no
12821 fi
12822 rm -f conftest.$ac_objext conftest.$ac_ext
12823 fi
12824 echo "$as_me:12824: result: $ac_cv_header_time" >&5
12825 echo "${ECHO_T}$ac_cv_header_time" >&6
12826 if test $ac_cv_header_time = yes; then
12827
12828 cat >>confdefs.h <<\EOF
12829 #define TIME_WITH_SYS_TIME 1
12830 EOF
12831
12832 fi
12833
12834 ###     checks for compiler characteristics
12835 ac_ext=c
12836 ac_cpp='$CPP $CPPFLAGS'
12837 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
12838 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
12839 ac_compiler_gnu=$ac_cv_c_compiler_gnu
12840 ac_main_return=return
12841
12842 echo "$as_me:12842: checking for an ANSI C-conforming const" >&5
12843 echo $ECHO_N "checking for an ANSI C-conforming const... $ECHO_C" >&6
12844 if test "${ac_cv_c_const+set}" = set; then
12845   echo $ECHO_N "(cached) $ECHO_C" >&6
12846 else
12847   cat >conftest.$ac_ext <<_ACEOF
12848 #line 12848 "configure"
12849 #include "confdefs.h"
12850
12851 int
12852 main ()
12853 {
12854 /* FIXME: Include the comments suggested by Paul. */
12855 #ifndef __cplusplus
12856   /* Ultrix mips cc rejects this.  */
12857   typedef int charset[2];
12858   const charset x;
12859   /* SunOS 4.1.1 cc rejects this.  */
12860   char const *const *ccp;
12861   char **p;
12862   /* NEC SVR4.0.2 mips cc rejects this.  */
12863   struct point {int x, y;};
12864   static struct point const zero = {0,0};
12865   /* AIX XL C 1.02.0.0 rejects this.
12866      It does not let you subtract one const X* pointer from another in
12867      an arm of an if-expression whose if-part is not a constant
12868      expression */
12869   const char *g = "string";
12870   ccp = &g + (g ? g-g : 0);
12871   /* HPUX 7.0 cc rejects these. */
12872   ++ccp;
12873   p = (char**) ccp;
12874   ccp = (char const *const *) p;
12875   { /* SCO 3.2v4 cc rejects this.  */
12876     char *t;
12877     char const *s = 0 ? (char *) 0 : (char const *) 0;
12878
12879     *t++ = 0;
12880   }
12881   { /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  */
12882     int x[] = {25, 17};
12883     const int *foo = &x[0];
12884     ++foo;
12885   }
12886   { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
12887     typedef const int *iptr;
12888     iptr p = 0;
12889     ++p;
12890   }
12891   { /* AIX XL C 1.02.0.0 rejects this saying
12892        "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
12893     struct s { int j; const int *ap[3]; };
12894     struct s *b; b->j = 5;
12895   }
12896   { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
12897     const int foo = 10;
12898   }
12899 #endif
12900
12901   ;
12902   return 0;
12903 }
12904 _ACEOF
12905 rm -f conftest.$ac_objext
12906 if { (eval echo "$as_me:12906: \"$ac_compile\"") >&5
12907   (eval $ac_compile) 2>&5
12908   ac_status=$?
12909   echo "$as_me:12909: \$? = $ac_status" >&5
12910   (exit $ac_status); } &&
12911          { ac_try='test -s conftest.$ac_objext'
12912   { (eval echo "$as_me:12912: \"$ac_try\"") >&5
12913   (eval $ac_try) 2>&5
12914   ac_status=$?
12915   echo "$as_me:12915: \$? = $ac_status" >&5
12916   (exit $ac_status); }; }; then
12917   ac_cv_c_const=yes
12918 else
12919   echo "$as_me: failed program was:" >&5
12920 cat conftest.$ac_ext >&5
12921 ac_cv_c_const=no
12922 fi
12923 rm -f conftest.$ac_objext conftest.$ac_ext
12924 fi
12925 echo "$as_me:12925: result: $ac_cv_c_const" >&5
12926 echo "${ECHO_T}$ac_cv_c_const" >&6
12927 if test $ac_cv_c_const = no; then
12928
12929 cat >>confdefs.h <<\EOF
12930 #define const
12931 EOF
12932
12933 fi
12934
12935 ###     Checks for external-data
12936
12937 echo "$as_me:12937: checking if data-only library module links" >&5
12938 echo $ECHO_N "checking if data-only library module links... $ECHO_C" >&6
12939 if test "${cf_cv_link_dataonly+set}" = set; then
12940   echo $ECHO_N "(cached) $ECHO_C" >&6
12941 else
12942
12943         rm -f conftest.a
12944         cat >conftest.$ac_ext <<EOF
12945 #line 12945 "configure"
12946 int     testdata[3] = { 123, 456, 789 };
12947 EOF
12948         if { (eval echo "$as_me:12948: \"$ac_compile\"") >&5
12949   (eval $ac_compile) 2>&5
12950   ac_status=$?
12951   echo "$as_me:12951: \$? = $ac_status" >&5
12952   (exit $ac_status); } ; then
12953                 mv conftest.o data.o && \
12954                 ( $AR $ARFLAGS conftest.a data.o ) 2>&5 1>/dev/null
12955         fi
12956         rm -f conftest.$ac_ext data.o
12957         cat >conftest.$ac_ext <<EOF
12958 #line 12958 "configure"
12959 int     testfunc()
12960 {
12961 #if defined(NeXT)
12962         ${cf_cv_main_return:-return}(1);        /* I'm told this linker is broken */
12963 #else
12964         extern int testdata[3];
12965         return testdata[0] == 123
12966            &&  testdata[1] == 456
12967            &&  testdata[2] == 789;
12968 #endif
12969 }
12970 EOF
12971         if { (eval echo "$as_me:12971: \"$ac_compile\"") >&5
12972   (eval $ac_compile) 2>&5
12973   ac_status=$?
12974   echo "$as_me:12974: \$? = $ac_status" >&5
12975   (exit $ac_status); }; then
12976                 mv conftest.o func.o && \
12977                 ( $AR $ARFLAGS conftest.a func.o ) 2>&5 1>/dev/null
12978         fi
12979         rm -f conftest.$ac_ext func.o
12980         ( eval $RANLIB conftest.a ) 2>&5 >/dev/null
12981         cf_saveLIBS="$LIBS"
12982         LIBS="conftest.a $LIBS"
12983         if test "$cross_compiling" = yes; then
12984   cf_cv_link_dataonly=unknown
12985 else
12986   cat >conftest.$ac_ext <<_ACEOF
12987 #line 12987 "configure"
12988 #include "confdefs.h"
12989
12990         int main()
12991         {
12992                 extern int testfunc();
12993                 ${cf_cv_main_return:-return} (!testfunc());
12994         }
12995
12996 _ACEOF
12997 rm -f conftest$ac_exeext
12998 if { (eval echo "$as_me:12998: \"$ac_link\"") >&5
12999   (eval $ac_link) 2>&5
13000   ac_status=$?
13001   echo "$as_me:13001: \$? = $ac_status" >&5
13002   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
13003   { (eval echo "$as_me:13003: \"$ac_try\"") >&5
13004   (eval $ac_try) 2>&5
13005   ac_status=$?
13006   echo "$as_me:13006: \$? = $ac_status" >&5
13007   (exit $ac_status); }; }; then
13008   cf_cv_link_dataonly=yes
13009 else
13010   echo "$as_me: program exited with status $ac_status" >&5
13011 echo "$as_me: failed program was:" >&5
13012 cat conftest.$ac_ext >&5
13013 cf_cv_link_dataonly=no
13014 fi
13015 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
13016 fi
13017         LIBS="$cf_saveLIBS"
13018
13019 fi
13020
13021 echo "$as_me:13021: result: $cf_cv_link_dataonly" >&5
13022 echo "${ECHO_T}$cf_cv_link_dataonly" >&6
13023
13024 if test "$cf_cv_link_dataonly" = no ; then
13025
13026 cat >>confdefs.h <<\EOF
13027 #define BROKEN_LINKER 1
13028 EOF
13029
13030         BROKEN_LINKER=1
13031 fi
13032
13033 ###     Checks for library functions.
13034
13035 echo "$as_me:13035: checking for working mkstemp" >&5
13036 echo $ECHO_N "checking for working mkstemp... $ECHO_C" >&6
13037 if test "${cf_cv_func_mkstemp+set}" = set; then
13038   echo $ECHO_N "(cached) $ECHO_C" >&6
13039 else
13040
13041 rm -rf conftest*
13042 if test "$cross_compiling" = yes; then
13043   cf_cv_func_mkstemp=maybe
13044 else
13045   cat >conftest.$ac_ext <<_ACEOF
13046 #line 13046 "configure"
13047 #include "confdefs.h"
13048
13049 #include <sys/types.h>
13050 #include <stdlib.h>
13051 #include <stdio.h>
13052 #include <string.h>
13053 #include <sys/stat.h>
13054 int main()
13055 {
13056         char *tmpl = "conftestXXXXXX";
13057         char name[2][80];
13058         int n;
13059         int result = 0;
13060         int fd;
13061         struct stat sb;
13062
13063         umask(077);
13064         for (n = 0; n < 2; ++n) {
13065                 strcpy(name[n], tmpl);
13066                 if ((fd = mkstemp(name[n])) >= 0) {
13067                         if (!strcmp(name[n], tmpl)
13068                          || stat(name[n], &sb) != 0
13069                          || (sb.st_mode & S_IFMT) != S_IFREG
13070                          || (sb.st_mode & 077) != 0) {
13071                                 result = 1;
13072                         }
13073                         close(fd);
13074                 }
13075         }
13076         if (result == 0
13077          && !strcmp(name[0], name[1]))
13078                 result = 1;
13079         ${cf_cv_main_return:-return}(result);
13080 }
13081
13082 _ACEOF
13083 rm -f conftest$ac_exeext
13084 if { (eval echo "$as_me:13084: \"$ac_link\"") >&5
13085   (eval $ac_link) 2>&5
13086   ac_status=$?
13087   echo "$as_me:13087: \$? = $ac_status" >&5
13088   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
13089   { (eval echo "$as_me:13089: \"$ac_try\"") >&5
13090   (eval $ac_try) 2>&5
13091   ac_status=$?
13092   echo "$as_me:13092: \$? = $ac_status" >&5
13093   (exit $ac_status); }; }; then
13094   cf_cv_func_mkstemp=yes
13095
13096 else
13097   echo "$as_me: program exited with status $ac_status" >&5
13098 echo "$as_me: failed program was:" >&5
13099 cat conftest.$ac_ext >&5
13100 cf_cv_func_mkstemp=no
13101
13102 fi
13103 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
13104 fi
13105
13106 fi
13107 echo "$as_me:13107: result: $cf_cv_func_mkstemp" >&5
13108 echo "${ECHO_T}$cf_cv_func_mkstemp" >&6
13109 if test "x$cf_cv_func_mkstemp" = xmaybe ; then
13110         echo "$as_me:13110: checking for mkstemp" >&5
13111 echo $ECHO_N "checking for mkstemp... $ECHO_C" >&6
13112 if test "${ac_cv_func_mkstemp+set}" = set; then
13113   echo $ECHO_N "(cached) $ECHO_C" >&6
13114 else
13115   cat >conftest.$ac_ext <<_ACEOF
13116 #line 13116 "configure"
13117 #include "confdefs.h"
13118 /* System header to define __stub macros and hopefully few prototypes,
13119     which can conflict with char mkstemp (); below.  */
13120 #include <assert.h>
13121 /* Override any gcc2 internal prototype to avoid an error.  */
13122 #ifdef __cplusplus
13123 extern "C"
13124 #endif
13125 /* We use char because int might match the return type of a gcc2
13126    builtin and then its argument prototype would still apply.  */
13127 char mkstemp ();
13128 char (*f) ();
13129
13130 int
13131 main ()
13132 {
13133 /* The GNU C library defines this for functions which it implements
13134     to always fail with ENOSYS.  Some functions are actually named
13135     something starting with __ and the normal name is an alias.  */
13136 #if defined (__stub_mkstemp) || defined (__stub___mkstemp)
13137 choke me
13138 #else
13139 f = mkstemp; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
13140 #endif
13141
13142   ;
13143   return 0;
13144 }
13145 _ACEOF
13146 rm -f conftest.$ac_objext conftest$ac_exeext
13147 if { (eval echo "$as_me:13147: \"$ac_link\"") >&5
13148   (eval $ac_link) 2>&5
13149   ac_status=$?
13150   echo "$as_me:13150: \$? = $ac_status" >&5
13151   (exit $ac_status); } &&
13152          { ac_try='test -s conftest$ac_exeext'
13153   { (eval echo "$as_me:13153: \"$ac_try\"") >&5
13154   (eval $ac_try) 2>&5
13155   ac_status=$?
13156   echo "$as_me:13156: \$? = $ac_status" >&5
13157   (exit $ac_status); }; }; then
13158   ac_cv_func_mkstemp=yes
13159 else
13160   echo "$as_me: failed program was:" >&5
13161 cat conftest.$ac_ext >&5
13162 ac_cv_func_mkstemp=no
13163 fi
13164 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13165 fi
13166 echo "$as_me:13166: result: $ac_cv_func_mkstemp" >&5
13167 echo "${ECHO_T}$ac_cv_func_mkstemp" >&6
13168
13169 fi
13170 if test "x$cf_cv_func_mkstemp" = xyes || test "x$ac_cv_func_mkstemp" = xyes ; then
13171
13172 cat >>confdefs.h <<\EOF
13173 #define HAVE_MKSTEMP 1
13174 EOF
13175
13176 fi
13177
13178 if test -z "$cf_user_CFLAGS" && test "$with_no_leaks" = no ; then
13179         CFLAGS=`echo ${CFLAGS} | sed -e 's%-g %%' -e 's%-g$%%'`
13180         CXXFLAGS=`echo ${CXXFLAGS} | sed -e 's%-g %%' -e 's%-g$%%'`
13181 fi
13182
13183 cf_with_ada=yes
13184 if test "$cf_with_ada" != "no" ; then
13185
13186 cf_ada_make=gnatmake
13187 # Extract the first word of "$cf_ada_make", so it can be a program name with args.
13188 set dummy $cf_ada_make; ac_word=$2
13189 echo "$as_me:13189: checking for $ac_word" >&5
13190 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
13191 if test "${ac_cv_prog_gnat_exists+set}" = set; then
13192   echo $ECHO_N "(cached) $ECHO_C" >&6
13193 else
13194   if test -n "$gnat_exists"; then
13195   ac_cv_prog_gnat_exists="$gnat_exists" # Let the user override the test.
13196 else
13197   ac_save_IFS=$IFS; IFS=$ac_path_separator
13198 ac_dummy="$PATH"
13199 for ac_dir in $ac_dummy; do
13200   IFS=$ac_save_IFS
13201   test -z "$ac_dir" && ac_dir=.
13202   $as_executable_p "$ac_dir/$ac_word" || continue
13203 ac_cv_prog_gnat_exists="yes"
13204 echo "$as_me:13204: found $ac_dir/$ac_word" >&5
13205 break
13206 done
13207
13208   test -z "$ac_cv_prog_gnat_exists" && ac_cv_prog_gnat_exists="no"
13209 fi
13210 fi
13211 gnat_exists=$ac_cv_prog_gnat_exists
13212 if test -n "$gnat_exists"; then
13213   echo "$as_me:13213: result: $gnat_exists" >&5
13214 echo "${ECHO_T}$gnat_exists" >&6
13215 else
13216   echo "$as_me:13216: result: no" >&5
13217 echo "${ECHO_T}no" >&6
13218 fi
13219
13220 if test "$ac_cv_prog_gnat_exists" = no; then
13221         cf_ada_make=
13222         cf_cv_prog_gnat_correct=no
13223 else
13224
13225 echo "$as_me:13225: checking for gnat version" >&5
13226 echo $ECHO_N "checking for gnat version... $ECHO_C" >&6
13227 cf_gnat_version=`${cf_ada_make:-gnatmake} -v 2>&1 | \
13228         grep '[0-9].[0-9][0-9]*' |\
13229         sed -e '2,$d' -e 's/[^0-9 \.]//g' -e 's/^[ ]*//' -e 's/ .*//'`
13230 echo "$as_me:13230: result: $cf_gnat_version" >&5
13231 echo "${ECHO_T}$cf_gnat_version" >&6
13232
13233 case $cf_gnat_version in
13234 (3.1[1-9]*|3.[2-9]*|[4-9].*|20[0-9][0-9])
13235         cf_cv_prog_gnat_correct=yes
13236         ;;
13237 (*)
13238         { echo "$as_me:13238: WARNING: Unsupported GNAT version $cf_gnat_version. We require 3.11 or better. Disabling Ada95 binding." >&5
13239 echo "$as_me: WARNING: Unsupported GNAT version $cf_gnat_version. We require 3.11 or better. Disabling Ada95 binding." >&2;}
13240         cf_cv_prog_gnat_correct=no
13241         ;;
13242 esac
13243
13244         # Extract the first word of "m4", so it can be a program name with args.
13245 set dummy m4; ac_word=$2
13246 echo "$as_me:13246: checking for $ac_word" >&5
13247 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
13248 if test "${ac_cv_prog_M4_exists+set}" = set; then
13249   echo $ECHO_N "(cached) $ECHO_C" >&6
13250 else
13251   if test -n "$M4_exists"; then
13252   ac_cv_prog_M4_exists="$M4_exists" # Let the user override the test.
13253 else
13254   ac_save_IFS=$IFS; IFS=$ac_path_separator
13255 ac_dummy="$PATH"
13256 for ac_dir in $ac_dummy; do
13257   IFS=$ac_save_IFS
13258   test -z "$ac_dir" && ac_dir=.
13259   $as_executable_p "$ac_dir/$ac_word" || continue
13260 ac_cv_prog_M4_exists="yes"
13261 echo "$as_me:13261: found $ac_dir/$ac_word" >&5
13262 break
13263 done
13264
13265   test -z "$ac_cv_prog_M4_exists" && ac_cv_prog_M4_exists="no"
13266 fi
13267 fi
13268 M4_exists=$ac_cv_prog_M4_exists
13269 if test -n "$M4_exists"; then
13270   echo "$as_me:13270: result: $M4_exists" >&5
13271 echo "${ECHO_T}$M4_exists" >&6
13272 else
13273   echo "$as_me:13273: result: no" >&5
13274 echo "${ECHO_T}no" >&6
13275 fi
13276
13277         if test "$ac_cv_prog_M4_exists" = no; then
13278                 cf_cv_prog_gnat_correct=no
13279                 echo Ada95 binding required program m4 not found. Ada95 binding disabled.
13280         fi
13281         if test "$cf_cv_prog_gnat_correct" = yes; then
13282                 echo "$as_me:13282: checking if GNAT works" >&5
13283 echo $ECHO_N "checking if GNAT works... $ECHO_C" >&6
13284
13285 rm -rf conftest* *~conftest*
13286 cat >>conftest.ads <<CF_EOF
13287 procedure conftest;
13288 CF_EOF
13289 cat >>conftest.adb <<CF_EOF
13290 with Text_IO;
13291 with GNAT.OS_Lib;
13292 procedure conftest is
13293 begin
13294    Text_IO.Put ("Hello World");
13295    Text_IO.New_Line;
13296    GNAT.OS_Lib.OS_Exit (0);
13297 end conftest;
13298 CF_EOF
13299 if ( $cf_ada_make $ADAFLAGS conftest 1>&5 2>&1 ) ; then
13300    if ( ./conftest 1>&5 2>&1 ) ; then
13301       cf_cv_prog_gnat_correct=yes
13302    else
13303       cf_cv_prog_gnat_correct=no
13304    fi
13305 else
13306    cf_cv_prog_gnat_correct=no
13307 fi
13308 rm -rf conftest* *~conftest*
13309
13310                 echo "$as_me:13310: result: $cf_cv_prog_gnat_correct" >&5
13311 echo "${ECHO_T}$cf_cv_prog_gnat_correct" >&6
13312         fi
13313 fi
13314
13315         if test "$cf_cv_prog_gnat_correct" = yes; then
13316
13317         echo "$as_me:13317: checking optimization options for ADAFLAGS" >&5
13318 echo $ECHO_N "checking optimization options for ADAFLAGS... $ECHO_C" >&6
13319         case "$CFLAGS" in
13320         (*-g*)
13321
13322         ADAFLAGS="$ADAFLAGS -g"
13323
13324                 ;;
13325         esac
13326         case "$CFLAGS" in
13327         (*-O*)
13328                 cf_O_flag=`echo "$CFLAGS" |sed -e 's/^.*-O/-O/' -e 's/[         ].*//'`
13329
13330         ADAFLAGS="$ADAFLAGS $cf_O_flag"
13331
13332                 ;;
13333         esac
13334         echo "$as_me:13334: result: $ADAFLAGS" >&5
13335 echo "${ECHO_T}$ADAFLAGS" >&6
13336
13337 echo "$as_me:13337: checking if GNATPREP supports -T option" >&5
13338 echo $ECHO_N "checking if GNATPREP supports -T option... $ECHO_C" >&6
13339 if test "${cf_cv_gnatprep_opt_t+set}" = set; then
13340   echo $ECHO_N "(cached) $ECHO_C" >&6
13341 else
13342
13343 cf_cv_gnatprep_opt_t=no
13344 gnatprep -T 2>/dev/null >/dev/null && cf_cv_gnatprep_opt_t=yes
13345
13346 fi
13347 echo "$as_me:13347: result: $cf_cv_gnatprep_opt_t" >&5
13348 echo "${ECHO_T}$cf_cv_gnatprep_opt_t" >&6
13349 test "$cf_cv_gnatprep_opt_t" = yes && GNATPREP_OPTS="-T $GNATPREP_OPTS"
13350
13351 echo "$as_me:13351: checking if GNAT supports generics" >&5
13352 echo $ECHO_N "checking if GNAT supports generics... $ECHO_C" >&6
13353 case $cf_gnat_version in
13354 (3.[1-9]*|[4-9].*)
13355         cf_gnat_generics=yes
13356         ;;
13357 (*)
13358         cf_gnat_generics=no
13359         ;;
13360 esac
13361 echo "$as_me:13361: result: $cf_gnat_generics" >&5
13362 echo "${ECHO_T}$cf_gnat_generics" >&6
13363
13364 if test "$cf_gnat_generics" = yes
13365 then
13366         cf_compile_generics=generics
13367         cf_generic_objects="\${GENOBJS}"
13368 else
13369         cf_compile_generics=
13370         cf_generic_objects=
13371 fi
13372
13373 echo "$as_me:13373: checking if GNAT supports SIGINT" >&5
13374 echo $ECHO_N "checking if GNAT supports SIGINT... $ECHO_C" >&6
13375 if test "${cf_cv_gnat_sigint+set}" = set; then
13376   echo $ECHO_N "(cached) $ECHO_C" >&6
13377 else
13378
13379 rm -rf conftest* *~conftest*
13380 cat >>conftest.ads <<CF_EOF
13381 with Ada.Interrupts.Names;
13382
13383 package ConfTest is
13384
13385    pragma Warnings (Off);  --  the next pragma exists since 3.11p
13386    pragma Unreserve_All_Interrupts;
13387    pragma Warnings (On);
13388
13389    protected Process is
13390       procedure Stop;
13391       function Continue return Boolean;
13392       pragma Attach_Handler (Stop, Ada.Interrupts.Names.SIGINT);
13393    private
13394       Done : Boolean := False;
13395    end Process;
13396
13397 end ConfTest;
13398 CF_EOF
13399 cat >>conftest.adb <<CF_EOF
13400 package body ConfTest is
13401    protected body Process is
13402       procedure Stop is
13403       begin
13404          Done := True;
13405       end Stop;
13406       function Continue return Boolean is
13407       begin
13408          return not Done;
13409       end Continue;
13410    end Process;
13411 end ConfTest;
13412 CF_EOF
13413 if ( $cf_ada_make $ADAFLAGS conftest 1>&5 2>&1 ) ; then
13414       cf_cv_gnat_sigint=yes
13415 else
13416    cf_cv_gnat_sigint=no
13417 fi
13418 rm -rf conftest* *~conftest*
13419
13420 fi
13421 echo "$as_me:13421: result: $cf_cv_gnat_sigint" >&5
13422 echo "${ECHO_T}$cf_cv_gnat_sigint" >&6
13423
13424 if test $cf_cv_gnat_sigint = yes ; then
13425         USE_GNAT_SIGINT=""
13426 else
13427         USE_GNAT_SIGINT="#"
13428 fi
13429
13430 cf_gnat_libraries=no
13431 cf_gnat_projects=no
13432
13433 if test "$enable_gnat_projects" != no ; then
13434 echo "$as_me:13434: checking if GNAT supports project files" >&5
13435 echo $ECHO_N "checking if GNAT supports project files... $ECHO_C" >&6
13436 case $cf_gnat_version in
13437 (3.[0-9]*)
13438         ;;
13439 (*)
13440         case $cf_cv_system_name in
13441         (cygwin*|msys*)
13442                 ;;
13443         (*)
13444                 mkdir conftest.src conftest.bin conftest.lib
13445                 cd conftest.src
13446                 rm -rf conftest* *~conftest*
13447                 cat >>library.gpr <<CF_EOF
13448 project Library is
13449   Kind := External ("LIB_KIND");
13450   for Library_Name use "ConfTest";
13451   for Object_Dir use ".";
13452   for Library_ALI_Dir use External("LIBRARY_DIR");
13453   for Library_Version use External ("SONAME");
13454   for Library_Kind use Kind;
13455   for Library_Dir use External("BUILD_DIR");
13456   Source_Dir := External ("SOURCE_DIR");
13457   for Source_Dirs use (Source_Dir);
13458 end Library;
13459 CF_EOF
13460                 cat >>confpackage.ads <<CF_EOF
13461 package ConfPackage is
13462    procedure conftest;
13463 end ConfPackage;
13464 CF_EOF
13465                 cat >>confpackage.adb <<CF_EOF
13466 with Text_IO;
13467 package body ConfPackage is
13468    procedure conftest is
13469    begin
13470       Text_IO.Put ("Hello World");
13471       Text_IO.New_Line;
13472    end conftest;
13473 end ConfPackage;
13474 CF_EOF
13475                 if ( $cf_ada_make $ADAFLAGS \
13476                                 -Plibrary.gpr \
13477                                 -XBUILD_DIR=`cd ../conftest.bin;pwd` \
13478                                 -XLIBRARY_DIR=`cd ../conftest.lib;pwd` \
13479                                 -XSOURCE_DIR=`pwd` \
13480                                 -XSONAME=libConfTest.so.1 \
13481                                 -XLIB_KIND=static 1>&5 2>&1 ) ; then
13482                         cf_gnat_projects=yes
13483                 fi
13484                 cd ..
13485                 if test -f conftest.lib/confpackage.ali
13486                 then
13487                         cf_gnat_libraries=yes
13488                 fi
13489                 rm -rf conftest* *~conftest*
13490                 ;;
13491         esac
13492         ;;
13493 esac
13494 echo "$as_me:13494: result: $cf_gnat_projects" >&5
13495 echo "${ECHO_T}$cf_gnat_projects" >&6
13496 fi # enable_gnat_projects
13497
13498 if test $cf_gnat_projects = yes
13499 then
13500         echo "$as_me:13500: checking if GNAT supports libraries" >&5
13501 echo $ECHO_N "checking if GNAT supports libraries... $ECHO_C" >&6
13502         echo "$as_me:13502: result: $cf_gnat_libraries" >&5
13503 echo "${ECHO_T}$cf_gnat_libraries" >&6
13504 fi
13505
13506 if test "$cf_gnat_projects" = yes
13507 then
13508         USE_OLD_MAKERULES="#"
13509         USE_GNAT_PROJECTS=""
13510 else
13511         USE_OLD_MAKERULES=""
13512         USE_GNAT_PROJECTS="#"
13513 fi
13514
13515 if test "$cf_gnat_libraries" = yes
13516 then
13517         USE_GNAT_LIBRARIES=""
13518 else
13519         USE_GNAT_LIBRARIES="#"
13520 fi
13521
13522 echo "$as_me:13522: checking for ada-compiler" >&5
13523 echo $ECHO_N "checking for ada-compiler... $ECHO_C" >&6
13524
13525 # Check whether --with-ada-compiler or --without-ada-compiler was given.
13526 if test "${with_ada_compiler+set}" = set; then
13527   withval="$with_ada_compiler"
13528   cf_ada_compiler=$withval
13529 else
13530   cf_ada_compiler=gnatmake
13531 fi;
13532
13533 echo "$as_me:13533: result: $cf_ada_compiler" >&5
13534 echo "${ECHO_T}$cf_ada_compiler" >&6
13535
13536                 cf_ada_package=terminal_interface
13537
13538 echo "$as_me:13538: checking for ada-include" >&5
13539 echo $ECHO_N "checking for ada-include... $ECHO_C" >&6
13540
13541 # Check whether --with-ada-include or --without-ada-include was given.
13542 if test "${with_ada_include+set}" = set; then
13543   withval="$with_ada_include"
13544
13545 else
13546   withval="${ADA_INCLUDE:-$prefix/share/ada/adainclude}"
13547 fi; if test -n "$prefix/share/ada/adainclude" ; then
13548
13549 if test "x$prefix" != xNONE; then
13550         cf_path_syntax="$prefix"
13551 else
13552         cf_path_syntax="$ac_default_prefix"
13553 fi
13554
13555 case ".$withval" in
13556 (.\$\(*\)*|.\'*\'*)
13557         ;;
13558 (..|./*|.\\*)
13559         ;;
13560 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
13561         ;;
13562 (.\${*prefix}*|.\${*dir}*)
13563         eval withval="$withval"
13564         case ".$withval" in
13565         (.NONE/*)
13566                 withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
13567                 ;;
13568         esac
13569         ;;
13570 (.no|.NONE/*)
13571         withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
13572         ;;
13573 (*)
13574         { { echo "$as_me:13574: error: expected a pathname, not \"$withval\"" >&5
13575 echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;}
13576    { (exit 1); exit 1; }; }
13577         ;;
13578 esac
13579
13580 fi
13581 eval ADA_INCLUDE="$withval"
13582
13583 echo "$as_me:13583: result: $ADA_INCLUDE" >&5
13584 echo "${ECHO_T}$ADA_INCLUDE" >&6
13585
13586 echo "$as_me:13586: checking for ada-objects" >&5
13587 echo $ECHO_N "checking for ada-objects... $ECHO_C" >&6
13588
13589 # Check whether --with-ada-objects or --without-ada-objects was given.
13590 if test "${with_ada_objects+set}" = set; then
13591   withval="$with_ada_objects"
13592
13593 else
13594   withval="${ADA_OBJECTS:-$prefix/lib/ada/adalib}"
13595 fi; if test -n "$prefix/lib/ada/adalib" ; then
13596
13597 if test "x$prefix" != xNONE; then
13598         cf_path_syntax="$prefix"
13599 else
13600         cf_path_syntax="$ac_default_prefix"
13601 fi
13602
13603 case ".$withval" in
13604 (.\$\(*\)*|.\'*\'*)
13605         ;;
13606 (..|./*|.\\*)
13607         ;;
13608 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
13609         ;;
13610 (.\${*prefix}*|.\${*dir}*)
13611         eval withval="$withval"
13612         case ".$withval" in
13613         (.NONE/*)
13614                 withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
13615                 ;;
13616         esac
13617         ;;
13618 (.no|.NONE/*)
13619         withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
13620         ;;
13621 (*)
13622         { { echo "$as_me:13622: error: expected a pathname, not \"$withval\"" >&5
13623 echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;}
13624    { (exit 1); exit 1; }; }
13625         ;;
13626 esac
13627
13628 fi
13629 eval ADA_OBJECTS="$withval"
13630
13631 echo "$as_me:13631: result: $ADA_OBJECTS" >&5
13632 echo "${ECHO_T}$ADA_OBJECTS" >&6
13633
13634 echo "$as_me:13634: checking if an Ada95 shared-library should be built" >&5
13635 echo $ECHO_N "checking if an Ada95 shared-library should be built... $ECHO_C" >&6
13636
13637 # Check whether --with-ada-sharedlib or --without-ada-sharedlib was given.
13638 if test "${with_ada_sharedlib+set}" = set; then
13639   withval="$with_ada_sharedlib"
13640   with_ada_sharedlib=$withval
13641 else
13642   with_ada_sharedlib=no
13643 fi;
13644 echo "$as_me:13644: result: $with_ada_sharedlib" >&5
13645 echo "${ECHO_T}$with_ada_sharedlib" >&6
13646
13647 ADA_SHAREDLIB='lib$(LIB_NAME).so.1'
13648 MAKE_ADA_SHAREDLIB="#"
13649
13650 if test "x$with_ada_sharedlib" != xno
13651 then
13652         MAKE_ADA_SHAREDLIB=
13653         if test "x$with_ada_sharedlib" != xyes
13654         then
13655                 ADA_SHAREDLIB="$with_ada_sharedlib"
13656         fi
13657 fi
13658
13659         else
13660                 { { echo "$as_me:13660: error: No usable Ada compiler found" >&5
13661 echo "$as_me: error: No usable Ada compiler found" >&2;}
13662    { (exit 1); exit 1; }; }
13663         fi
13664 else
13665         { { echo "$as_me:13665: error: The Ada compiler is needed for this package" >&5
13666 echo "$as_me: error: The Ada compiler is needed for this package" >&2;}
13667    { (exit 1); exit 1; }; }
13668 fi
13669
13670 ################################################################################
13671
13672 # not needed
13673 TINFO_LDFLAGS2=
13674
13675 TINFO_LIBS=
13676
13677 ### Construct the list of include-directories to be generated
13678
13679 if test "$srcdir" != "."; then
13680         CPPFLAGS="-I\${srcdir}/../include $CPPFLAGS"
13681 fi
13682 CPPFLAGS="-I../include $CPPFLAGS"
13683 if test "$srcdir" != "."; then
13684         CPPFLAGS="-I\${srcdir} $CPPFLAGS"
13685 fi
13686 CPPFLAGS="-I. $CPPFLAGS"
13687
13688 ACPPFLAGS="-I. -I../include -I../../include $ACPPFLAGS"
13689 if test "$srcdir" != "."; then
13690         ACPPFLAGS="-I\${srcdir}/../../include $ACPPFLAGS"
13691 fi
13692 if test "$GCC" != yes; then
13693         ACPPFLAGS="$ACPPFLAGS -I\${includedir}"
13694 elif test "$includedir" != "/usr/include"; then
13695         if test "$includedir" = '${prefix}/include' ; then
13696                 if test x$prefix != x/usr ; then
13697                         ACPPFLAGS="$ACPPFLAGS -I\${includedir}"
13698                 fi
13699         else
13700                 ACPPFLAGS="$ACPPFLAGS -I\${includedir}"
13701         fi
13702 fi
13703
13704 ### Build up pieces for makefile rules
13705 echo "$as_me:13705: checking default library suffix" >&5
13706 echo $ECHO_N "checking default library suffix... $ECHO_C" >&6
13707
13708         case $DFT_LWR_MODEL in
13709         (libtool) DFT_ARG_SUFFIX=''   ;;
13710         (normal)  DFT_ARG_SUFFIX=''   ;;
13711         (debug)   DFT_ARG_SUFFIX='_g' ;;
13712         (profile) DFT_ARG_SUFFIX='_p' ;;
13713         (shared)  DFT_ARG_SUFFIX=''   ;;
13714         esac
13715         test -n "$LIB_SUFFIX" && DFT_ARG_SUFFIX="${LIB_SUFFIX}${DFT_ARG_SUFFIX}"
13716 echo "$as_me:13716: result: $DFT_ARG_SUFFIX" >&5
13717 echo "${ECHO_T}$DFT_ARG_SUFFIX" >&6
13718
13719 echo "$as_me:13719: checking default library-dependency suffix" >&5
13720 echo $ECHO_N "checking default library-dependency suffix... $ECHO_C" >&6
13721
13722         case X$DFT_LWR_MODEL in
13723         (Xlibtool)
13724                 DFT_LIB_SUFFIX='.la'
13725                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
13726                 ;;
13727         (Xdebug)
13728                 DFT_LIB_SUFFIX='_g.a'
13729                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
13730                 ;;
13731         (Xprofile)
13732                 DFT_LIB_SUFFIX='_p.a'
13733                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
13734                 ;;
13735         (Xshared)
13736                 case $cf_cv_system_name in
13737                 (aix[5-7]*)
13738                         DFT_LIB_SUFFIX='.so'
13739                         DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
13740                         ;;
13741                 (cygwin*|msys*|mingw*)
13742                         DFT_LIB_SUFFIX='.dll'
13743                         DFT_DEP_SUFFIX='.dll.a'
13744                         ;;
13745                 (darwin*)
13746                         DFT_LIB_SUFFIX='.dylib'
13747                         DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
13748                         ;;
13749                 (hpux*)
13750                         case $target in
13751                         (ia64*)
13752                                 DFT_LIB_SUFFIX='.so'
13753                                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
13754                                 ;;
13755                         (*)
13756                                 DFT_LIB_SUFFIX='.sl'
13757                                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
13758                                 ;;
13759                         esac
13760                         ;;
13761                 (*)
13762                         DFT_LIB_SUFFIX='.so'
13763                         DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
13764                         ;;
13765                 esac
13766                 ;;
13767         (*)
13768                 DFT_LIB_SUFFIX='.a'
13769                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
13770                 ;;
13771         esac
13772         if test -n "${LIB_SUFFIX}${EXTRA_SUFFIX}"
13773         then
13774                 DFT_LIB_SUFFIX="${LIB_SUFFIX}${EXTRA_SUFFIX}${DFT_LIB_SUFFIX}"
13775                 DFT_DEP_SUFFIX="${LIB_SUFFIX}${EXTRA_SUFFIX}${DFT_DEP_SUFFIX}"
13776         fi
13777 echo "$as_me:13777: result: $DFT_DEP_SUFFIX" >&5
13778 echo "${ECHO_T}$DFT_DEP_SUFFIX" >&6
13779
13780 echo "$as_me:13780: checking default object directory" >&5
13781 echo $ECHO_N "checking default object directory... $ECHO_C" >&6
13782
13783         case $DFT_LWR_MODEL in
13784         (libtool) DFT_OBJ_SUBDIR='obj_lo'  ;;
13785         (normal)  DFT_OBJ_SUBDIR='objects' ;;
13786         (debug)   DFT_OBJ_SUBDIR='obj_g' ;;
13787         (profile) DFT_OBJ_SUBDIR='obj_p' ;;
13788         (shared)
13789                 case $cf_cv_system_name in
13790                 (cygwin|msys)
13791                         DFT_OBJ_SUBDIR='objects' ;;
13792                 (*)
13793                         DFT_OBJ_SUBDIR='obj_s' ;;
13794                 esac
13795         esac
13796 echo "$as_me:13796: result: $DFT_OBJ_SUBDIR" >&5
13797 echo "${ECHO_T}$DFT_OBJ_SUBDIR" >&6
13798
13799 ### Set up low-level terminfo dependencies for makefiles.
13800
13801 if test "$DFT_LWR_MODEL" = shared ; then
13802         case $cf_cv_system_name in
13803         (cygwin*)
13804                 # "lib" files have ".dll.a" suffix, "cyg" files have ".dll"
13805                 ;;
13806         (msys*)
13807                 # "lib" files have ".dll.a" suffix, "msys-" files have ".dll"
13808                 ;;
13809         esac
13810 fi
13811
13812 USE_CFG_SUFFIX=${DFT_ARG_SUFFIX}
13813
13814 ### Construct the list of subdirectories for which we'll customize makefiles
13815 ### with the appropriate compile-rules.
13816
13817 SUB_MAKEFILES="gen/adacurses${USE_ARG_SUFFIX}-config:gen/adacurses-config.in"
13818
13819 cat >>confdefs.h <<EOF
13820 #define NCURSES_PATHSEP '$PATH_SEPARATOR'
13821 EOF
13822
13823 ### Now that we're done running tests, add the compiler-warnings, if any
13824
13825 cf_fix_cppflags=no
13826 cf_new_cflags=
13827 cf_new_cppflags=
13828 cf_new_extra_cppflags=
13829
13830 for cf_add_cflags in $EXTRA_CFLAGS
13831 do
13832 case $cf_fix_cppflags in
13833 (no)
13834         case $cf_add_cflags in
13835         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13836                 case $cf_add_cflags in
13837                 (-D*)
13838                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13839
13840                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13841                                 && test -z "${cf_tst_cflags}" \
13842                                 && cf_fix_cppflags=yes
13843
13844                         if test $cf_fix_cppflags = yes ; then
13845                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
13846                                 continue
13847                         elif test "${cf_tst_cflags}" = "\"'" ; then
13848                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
13849                                 continue
13850                         fi
13851                         ;;
13852                 esac
13853                 case "$CPPFLAGS" in
13854                 (*$cf_add_cflags)
13855                         ;;
13856                 (*)
13857                         case $cf_add_cflags in
13858                         (-D*)
13859                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13860
13861 CPPFLAGS=`echo "$CPPFLAGS" | \
13862         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13863                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13864
13865                                 ;;
13866                         esac
13867                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
13868                         ;;
13869                 esac
13870                 ;;
13871         (*)
13872                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
13873                 ;;
13874         esac
13875         ;;
13876 (yes)
13877         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
13878
13879         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
13880
13881         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13882                 && test -z "${cf_tst_cflags}" \
13883                 && cf_fix_cppflags=no
13884         ;;
13885 esac
13886 done
13887
13888 if test -n "$cf_new_cflags" ; then
13889
13890         CFLAGS="$CFLAGS $cf_new_cflags"
13891 fi
13892
13893 if test -n "$cf_new_cppflags" ; then
13894
13895         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
13896 fi
13897
13898 if test -n "$cf_new_extra_cppflags" ; then
13899
13900         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
13901 fi
13902
13903 ################################################################################
13904
13905 TEST_ARG2=
13906
13907 TEST_LIBS2=
13908
13909 NCURSES_SHLIB2="sh -c"
13910
13911 ADA_SUBDIRS="include gen src doc"
13912 if test "x$cf_with_tests" != "xno" ; then
13913         ADA_SUBDIRS="$ADA_SUBDIRS samples"
13914 fi
13915 for cf_dir in $ADA_SUBDIRS
13916 do
13917         SUB_MAKEFILES="$SUB_MAKEFILES $cf_dir/Makefile"
13918 done
13919
13920 NCURSES_TREE="#"
13921
13922 EXTERNAL_TREE=
13923
13924 # match layout used by make-tar.sh
13925 ADAHTML_DIR=../doc/ada
13926
13927 ac_config_files="$ac_config_files $SUB_MAKEFILES doc/adacurses${DFT_ARG_SUFFIX}-config.1:doc/MKada_config.in Makefile"
13928 ac_config_commands="$ac_config_commands default"
13929 cat >confcache <<\_ACEOF
13930 # This file is a shell script that caches the results of configure
13931 # tests run on this system so they can be shared between configure
13932 # scripts and configure runs, see configure's option --config-cache.
13933 # It is not useful on other systems.  If it contains results you don't
13934 # want to keep, you may remove or edit it.
13935 #
13936 # config.status only pays attention to the cache file if you give it
13937 # the --recheck option to rerun configure.
13938 #
13939 # `ac_cv_env_foo' variables (set or unset) will be overriden when
13940 # loading this file, other *unset* `ac_cv_foo' will be assigned the
13941 # following values.
13942
13943 _ACEOF
13944
13945 # The following way of writing the cache mishandles newlines in values,
13946 # but we know of no workaround that is simple, portable, and efficient.
13947 # So, don't put newlines in cache variables' values.
13948 # Ultrix sh set writes to stderr and can't be redirected directly,
13949 # and sets the high bit in the cache file unless we assign to the vars.
13950 {
13951   (set) 2>&1 |
13952     case `(ac_space=' '; set | grep ac_space) 2>&1` in
13953     *ac_space=\ *)
13954       # `set' does not quote correctly, so add quotes (double-quote
13955       # substitution turns \\\\ into \\, and sed turns \\ into \).
13956       sed -n \
13957         "s/'/'\\\\''/g;
13958           s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
13959       ;;
13960     *)
13961       # `set' quotes correctly as required by POSIX, so do not add quotes.
13962       sed -n \
13963         "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
13964       ;;
13965     esac;
13966 } |
13967   sed '
13968      t clear
13969      : clear
13970      s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
13971      t end
13972      /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
13973      : end' >>confcache
13974 if cmp -s $cache_file confcache; then :; else
13975   if test -w $cache_file; then
13976     test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file"
13977     cat confcache >$cache_file
13978   else
13979     echo "not updating unwritable cache $cache_file"
13980   fi
13981 fi
13982 rm -f confcache
13983
13984 test "x$prefix" = xNONE && prefix=$ac_default_prefix
13985 # Let make expand exec_prefix.
13986 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
13987
13988 # VPATH may cause trouble with some makes, so we remove $(srcdir),
13989 # ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
13990 # trailing colons and then remove the whole line if VPATH becomes empty
13991 # (actually we leave an empty line to preserve line numbers).
13992 if test "x$srcdir" = x.; then
13993   ac_vpsub='/^[         ]*VPATH[        ]*=/{
13994 s/:*\$(srcdir):*/:/;
13995 s/:*\${srcdir}:*/:/;
13996 s/:*@srcdir@:*/:/;
13997 s/^\([^=]*=[    ]*\):*/\1/;
13998 s/:*$//;
13999 s/^[^=]*=[      ]*$//;
14000 }'
14001 fi
14002
14003 DEFS=-DHAVE_CONFIG_H
14004
14005 : ${CONFIG_STATUS=./config.status}
14006 ac_clean_files_save=$ac_clean_files
14007 ac_clean_files="$ac_clean_files $CONFIG_STATUS"
14008 { echo "$as_me:14008: creating $CONFIG_STATUS" >&5
14009 echo "$as_me: creating $CONFIG_STATUS" >&6;}
14010 cat >$CONFIG_STATUS <<_ACEOF
14011 #! $SHELL
14012 # Generated automatically by configure.
14013 # Run this file to recreate the current configuration.
14014 # Compiler output produced by configure, useful for debugging
14015 # configure, is in config.log if it exists.
14016
14017 debug=false
14018 SHELL=\${CONFIG_SHELL-$SHELL}
14019 ac_cs_invocation="\$0 \$@"
14020
14021 _ACEOF
14022
14023 cat >>$CONFIG_STATUS <<\_ACEOF
14024 # Be Bourne compatible
14025 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
14026   emulate sh
14027   NULLCMD=:
14028 elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
14029   set -o posix
14030 fi
14031
14032 # Name of the executable.
14033 as_me=`echo "$0" |sed 's,.*[\\/],,'`
14034
14035 if expr a : '\(a\)' >/dev/null 2>&1; then
14036   as_expr=expr
14037 else
14038   as_expr=false
14039 fi
14040
14041 rm -f conf$$ conf$$.exe conf$$.file
14042 echo >conf$$.file
14043 if ln -s conf$$.file conf$$ 2>/dev/null; then
14044   # We could just check for DJGPP; but this test a) works b) is more generic
14045   # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
14046   if test -f conf$$.exe; then
14047     # Don't use ln at all; we don't have any links
14048     as_ln_s='cp -p'
14049   else
14050     as_ln_s='ln -s'
14051   fi
14052 elif ln conf$$.file conf$$ 2>/dev/null; then
14053   as_ln_s=ln
14054 else
14055   as_ln_s='cp -p'
14056 fi
14057 rm -f conf$$ conf$$.exe conf$$.file
14058
14059 as_executable_p="test -f"
14060
14061 # Support unset when possible.
14062 if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
14063   as_unset=unset
14064 else
14065   as_unset=false
14066 fi
14067
14068 # NLS nuisances.
14069 $as_unset LANG || test "${LANG+set}" != set || { LANG=C; export LANG; }
14070 $as_unset LC_ALL || test "${LC_ALL+set}" != set || { LC_ALL=C; export LC_ALL; }
14071 $as_unset LC_TIME || test "${LC_TIME+set}" != set || { LC_TIME=C; export LC_TIME; }
14072 $as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set || { LC_CTYPE=C; export LC_CTYPE; }
14073 $as_unset LANGUAGE || test "${LANGUAGE+set}" != set || { LANGUAGE=C; export LANGUAGE; }
14074 $as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set || { LC_COLLATE=C; export LC_COLLATE; }
14075 $as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set || { LC_NUMERIC=C; export LC_NUMERIC; }
14076 $as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set || { LC_MESSAGES=C; export LC_MESSAGES; }
14077
14078 # IFS
14079 # We need space, tab and new line, in precisely that order.
14080 as_nl='
14081 '
14082 IFS="   $as_nl"
14083
14084 # CDPATH.
14085 $as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=:; export CDPATH; }
14086
14087 exec 6>&1
14088
14089 _ACEOF
14090
14091 # Files that config.status was made for.
14092 if test -n "$ac_config_files"; then
14093   echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS
14094 fi
14095
14096 if test -n "$ac_config_headers"; then
14097   echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS
14098 fi
14099
14100 if test -n "$ac_config_links"; then
14101   echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS
14102 fi
14103
14104 if test -n "$ac_config_commands"; then
14105   echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS
14106 fi
14107
14108 cat >>$CONFIG_STATUS <<\EOF
14109
14110 ac_cs_usage="\
14111 \`$as_me' instantiates files from templates according to the
14112 current configuration.
14113
14114 Usage: $0 [OPTIONS] [FILE]...
14115
14116   -h, --help       print this help, then exit
14117   -V, --version    print version number, then exit
14118   -d, --debug      don't remove temporary files
14119       --recheck    update $as_me by reconfiguring in the same conditions
14120   --file=FILE[:TEMPLATE]
14121                    instantiate the configuration file FILE
14122   --header=FILE[:TEMPLATE]
14123                    instantiate the configuration header FILE
14124
14125 Configuration files:
14126 $config_files
14127
14128 Configuration headers:
14129 $config_headers
14130
14131 Configuration commands:
14132 $config_commands
14133
14134 Report bugs to <dickey@invisible-island.net>."
14135 EOF
14136
14137 cat >>$CONFIG_STATUS <<EOF
14138 ac_cs_version="\\
14139 config.status
14140 configured by $0, generated by GNU Autoconf 2.52.20141204,
14141   with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
14142
14143 Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
14144 Free Software Foundation, Inc.
14145 This config.status script is free software; the Free Software Foundation
14146 gives unlimited permission to copy, distribute and modify it."
14147 srcdir=$srcdir
14148 INSTALL="$INSTALL"
14149 EOF
14150
14151 cat >>$CONFIG_STATUS <<\EOF
14152 # If no file are specified by the user, then we need to provide default
14153 # value.  By we need to know if files were specified by the user.
14154 ac_need_defaults=:
14155 while test $# != 0
14156 do
14157   case $1 in
14158   --*=*)
14159     ac_option=`expr "x$1" : 'x\([^=]*\)='`
14160     ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'`
14161     shift
14162     set dummy "$ac_option" "$ac_optarg" ${1+"$@"}
14163     shift
14164     ;;
14165   -*);;
14166   *) # This is not an option, so the user has probably given explicit
14167      # arguments.
14168      ac_need_defaults=false;;
14169   esac
14170
14171   case $1 in
14172   # Handling of the options.
14173 EOF
14174 cat >>$CONFIG_STATUS <<EOF
14175   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
14176     echo "running $SHELL $0 " $ac_configure_args " --no-create --no-recursion"
14177     exec $SHELL $0 $ac_configure_args --no-create --no-recursion ;;
14178 EOF
14179 cat >>$CONFIG_STATUS <<\EOF
14180   --version | --vers* | -V )
14181     echo "$ac_cs_version"; exit 0 ;;
14182   --he | --h)
14183     # Conflict between --help and --header
14184     { { echo "$as_me:14184: error: ambiguous option: $1
14185 Try \`$0 --help' for more information." >&5
14186 echo "$as_me: error: ambiguous option: $1
14187 Try \`$0 --help' for more information." >&2;}
14188    { (exit 1); exit 1; }; };;
14189   --help | --hel | -h )
14190     echo "$ac_cs_usage"; exit 0 ;;
14191   --debug | --d* | -d )
14192     debug=: ;;
14193   --file | --fil | --fi | --f )
14194     shift
14195     CONFIG_FILES="$CONFIG_FILES $1"
14196     ac_need_defaults=false;;
14197   --header | --heade | --head | --hea )
14198     shift
14199     CONFIG_HEADERS="$CONFIG_HEADERS $1"
14200     ac_need_defaults=false;;
14201
14202   # This is an error.
14203   -*) { { echo "$as_me:14203: error: unrecognized option: $1
14204 Try \`$0 --help' for more information." >&5
14205 echo "$as_me: error: unrecognized option: $1
14206 Try \`$0 --help' for more information." >&2;}
14207    { (exit 1); exit 1; }; } ;;
14208
14209   *) ac_config_targets="$ac_config_targets $1" ;;
14210
14211   esac
14212   shift
14213 done
14214
14215 exec 5>>config.log
14216 cat >&5 << _ACEOF
14217
14218 ## ----------------------- ##
14219 ## Running config.status.  ##
14220 ## ----------------------- ##
14221
14222 This file was extended by $as_me 2.52.20141204, executed with
14223   CONFIG_FILES    = $CONFIG_FILES
14224   CONFIG_HEADERS  = $CONFIG_HEADERS
14225   CONFIG_LINKS    = $CONFIG_LINKS
14226   CONFIG_COMMANDS = $CONFIG_COMMANDS
14227   > $ac_cs_invocation
14228 on `(hostname || uname -n) 2>/dev/null | sed 1q`
14229
14230 _ACEOF
14231 EOF
14232
14233 cat >>$CONFIG_STATUS <<EOF
14234 #
14235 # INIT-COMMANDS section.
14236 #
14237
14238 ### Special initialization commands, used to pass information from the
14239 ### configuration-run into config.status
14240
14241 AWK="$AWK"
14242 DFT_ARG_SUFFIX="$DFT_ARG_SUFFIX"
14243 DFT_LWR_MODEL="$DFT_LWR_MODEL"
14244 LIB_NAME="$LIB_NAME"
14245 LIB_PREFIX="$LIB_PREFIX"
14246 LIB_SUFFIX="$LIB_SUFFIX"
14247 LN_S="$LN_S"
14248 NCURSES_MAJOR="$NCURSES_MAJOR"
14249 NCURSES_MINOR="$NCURSES_MINOR"
14250 NCURSES_PATCH="$NCURSES_PATCH"
14251 USE_OLD_MAKERULES="$USE_OLD_MAKERULES"
14252 cf_cv_abi_version="$cf_cv_abi_version"
14253 cf_cv_rel_version="$cf_cv_rel_version"
14254 cf_cv_rm_so_locs="$cf_cv_rm_so_locs"
14255 cf_cv_shared_soname='$cf_cv_shared_soname'
14256 cf_cv_shlib_version="$cf_cv_shlib_version"
14257 cf_cv_shlib_version_infix="$cf_cv_shlib_version_infix"
14258 cf_cv_system_name="$cf_cv_system_name"
14259 host="$host"
14260 target="$target"
14261
14262 EOF
14263
14264 cat >>$CONFIG_STATUS <<\EOF
14265 for ac_config_target in $ac_config_targets
14266 do
14267   case "$ac_config_target" in
14268   # Handling of arguments.
14269   "$SUB_MAKEFILES" ) CONFIG_FILES="$CONFIG_FILES $SUB_MAKEFILES" ;;
14270   "doc/adacurses${DFT_ARG_SUFFIX}-config.1" ) CONFIG_FILES="$CONFIG_FILES doc/adacurses${DFT_ARG_SUFFIX}-config.1:doc/MKada_config.in" ;;
14271   "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;;
14272   "default" ) CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;;
14273   "include/ncurses_cfg.h" ) CONFIG_HEADERS="$CONFIG_HEADERS include/ncurses_cfg.h:include/ncurses_cfg.hin" ;;
14274   *) { { echo "$as_me:14274: error: invalid argument: $ac_config_target" >&5
14275 echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
14276    { (exit 1); exit 1; }; };;
14277   esac
14278 done
14279
14280 # If the user did not use the arguments to specify the items to instantiate,
14281 # then the envvar interface is used.  Set only those that are not.
14282 # We use the long form for the default assignment because of an extremely
14283 # bizarre bug on SunOS 4.1.3.
14284 if $ac_need_defaults; then
14285   test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
14286   test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
14287   test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
14288 fi
14289
14290 # Create a temporary directory, and hook for its removal unless debugging.
14291 $debug ||
14292 {
14293   trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0
14294   trap '{ (exit 1); exit 1; }' 1 2 13 15
14295 }
14296
14297 # Create a (secure) tmp directory for tmp files.
14298 : ${TMPDIR=/tmp}
14299 {
14300   tmp=`(umask 077 && mktemp -d -q "$TMPDIR/csXXXXXX") 2>/dev/null` &&
14301   test -n "$tmp" && test -d "$tmp"
14302 }  ||
14303 {
14304   tmp=$TMPDIR/cs$$-$RANDOM
14305   (umask 077 && mkdir $tmp)
14306 } ||
14307 {
14308    echo "$me: cannot create a temporary directory in $TMPDIR" >&2
14309    { (exit 1); exit 1; }
14310 }
14311
14312 EOF
14313
14314 cat >>$CONFIG_STATUS <<EOF
14315
14316 #
14317 # CONFIG_FILES section.
14318 #
14319
14320 # No need to generate the scripts if there are no CONFIG_FILES.
14321 # This happens for instance when ./config.status config.h
14322 if test -n "\$CONFIG_FILES"; then
14323   # Protect against being on the right side of a sed subst in config.status.
14324   sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g;
14325    s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF
14326 s,@SHELL@,$SHELL,;t t
14327 s,@exec_prefix@,$exec_prefix,;t t
14328 s,@prefix@,$prefix,;t t
14329 s,@program_transform_name@,$program_transform_name,;t t
14330 s,@bindir@,$bindir,;t t
14331 s,@sbindir@,$sbindir,;t t
14332 s,@libexecdir@,$libexecdir,;t t
14333 s,@datarootdir@,$datarootdir,;t t
14334 s,@datadir@,$datadir,;t t
14335 s,@sysconfdir@,$sysconfdir,;t t
14336 s,@sharedstatedir@,$sharedstatedir,;t t
14337 s,@localstatedir@,$localstatedir,;t t
14338 s,@libdir@,$libdir,;t t
14339 s,@includedir@,$includedir,;t t
14340 s,@oldincludedir@,$oldincludedir,;t t
14341 s,@infodir@,$infodir,;t t
14342 s,@mandir@,$mandir,;t t
14343 s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t
14344 s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t
14345 s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t
14346 s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t
14347 s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t
14348 s,@build_alias@,$build_alias,;t t
14349 s,@host_alias@,$host_alias,;t t
14350 s,@target_alias@,$target_alias,;t t
14351 s,@ECHO_C@,$ECHO_C,;t t
14352 s,@ECHO_N@,$ECHO_N,;t t
14353 s,@ECHO_T@,$ECHO_T,;t t
14354 s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t
14355 s,@DEFS@,$DEFS,;t t
14356 s,@LIBS@,$LIBS,;t t
14357 s,@top_builddir@,$top_builddir,;t t
14358 s,@build@,$build,;t t
14359 s,@build_cpu@,$build_cpu,;t t
14360 s,@build_vendor@,$build_vendor,;t t
14361 s,@build_os@,$build_os,;t t
14362 s,@host@,$host,;t t
14363 s,@host_cpu@,$host_cpu,;t t
14364 s,@host_vendor@,$host_vendor,;t t
14365 s,@host_os@,$host_os,;t t
14366 s,@target@,$target,;t t
14367 s,@target_cpu@,$target_cpu,;t t
14368 s,@target_vendor@,$target_vendor,;t t
14369 s,@target_os@,$target_os,;t t
14370 s,@CC@,$CC,;t t
14371 s,@CFLAGS@,$CFLAGS,;t t
14372 s,@LDFLAGS@,$LDFLAGS,;t t
14373 s,@CPPFLAGS@,$CPPFLAGS,;t t
14374 s,@ac_ct_CC@,$ac_ct_CC,;t t
14375 s,@EXEEXT@,$EXEEXT,;t t
14376 s,@OBJEXT@,$OBJEXT,;t t
14377 s,@EXTRA_CPPFLAGS@,$EXTRA_CPPFLAGS,;t t
14378 s,@CPP@,$CPP,;t t
14379 s,@AWK@,$AWK,;t t
14380 s,@EGREP@,$EGREP,;t t
14381 s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t
14382 s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t
14383 s,@INSTALL_DATA@,$INSTALL_DATA,;t t
14384 s,@LN_S@,$LN_S,;t t
14385 s,@PKG_CONFIG@,$PKG_CONFIG,;t t
14386 s,@ac_pt_PKG_CONFIG@,$ac_pt_PKG_CONFIG,;t t
14387 s,@PKG_CONFIG_LIBDIR@,$PKG_CONFIG_LIBDIR,;t t
14388 s,@SET_MAKE@,$SET_MAKE,;t t
14389 s,@CTAGS@,$CTAGS,;t t
14390 s,@ETAGS@,$ETAGS,;t t
14391 s,@MAKE_LOWER_TAGS@,$MAKE_LOWER_TAGS,;t t
14392 s,@MAKE_UPPER_TAGS@,$MAKE_UPPER_TAGS,;t t
14393 s,@cf_cv_makeflags@,$cf_cv_makeflags,;t t
14394 s,@RANLIB@,$RANLIB,;t t
14395 s,@ac_ct_RANLIB@,$ac_ct_RANLIB,;t t
14396 s,@LD@,$LD,;t t
14397 s,@ac_ct_LD@,$ac_ct_LD,;t t
14398 s,@AR@,$AR,;t t
14399 s,@ac_ct_AR@,$ac_ct_AR,;t t
14400 s,@ARFLAGS@,$ARFLAGS,;t t
14401 s,@DESTDIR@,$DESTDIR,;t t
14402 s,@BUILD_CC@,$BUILD_CC,;t t
14403 s,@BUILD_CPP@,$BUILD_CPP,;t t
14404 s,@BUILD_CFLAGS@,$BUILD_CFLAGS,;t t
14405 s,@BUILD_CPPFLAGS@,$BUILD_CPPFLAGS,;t t
14406 s,@BUILD_LDFLAGS@,$BUILD_LDFLAGS,;t t
14407 s,@BUILD_LIBS@,$BUILD_LIBS,;t t
14408 s,@BUILD_EXEEXT@,$BUILD_EXEEXT,;t t
14409 s,@BUILD_OBJEXT@,$BUILD_OBJEXT,;t t
14410 s,@DFT_LWR_MODEL@,$DFT_LWR_MODEL,;t t
14411 s,@DFT_UPR_MODEL@,$DFT_UPR_MODEL,;t t
14412 s,@NCURSES_CONFIG@,$NCURSES_CONFIG,;t t
14413 s,@ac_ct_NCURSES_CONFIG@,$ac_ct_NCURSES_CONFIG,;t t
14414 s,@NCURSES_MAJOR@,$NCURSES_MAJOR,;t t
14415 s,@NCURSES_MINOR@,$NCURSES_MINOR,;t t
14416 s,@NCURSES_PATCH@,$NCURSES_PATCH,;t t
14417 s,@cf_cv_rel_version@,$cf_cv_rel_version,;t t
14418 s,@cf_cv_abi_version@,$cf_cv_abi_version,;t t
14419 s,@cf_cv_builtin_bool@,$cf_cv_builtin_bool,;t t
14420 s,@cf_cv_header_stdbool_h@,$cf_cv_header_stdbool_h,;t t
14421 s,@cf_cv_type_of_bool@,$cf_cv_type_of_bool,;t t
14422 s,@LIB_PREFIX@,$LIB_PREFIX,;t t
14423 s,@LIB_SUFFIX@,$LIB_SUFFIX,;t t
14424 s,@CC_G_OPT@,$CC_G_OPT,;t t
14425 s,@LD_MODEL@,$LD_MODEL,;t t
14426 s,@shlibdir@,$shlibdir,;t t
14427 s,@MAKE_DLLS@,$MAKE_DLLS,;t t
14428 s,@CC_SHARED_OPTS@,$CC_SHARED_OPTS,;t t
14429 s,@LD_RPATH_OPT@,$LD_RPATH_OPT,;t t
14430 s,@LD_SHARED_OPTS@,$LD_SHARED_OPTS,;t t
14431 s,@MK_SHARED_LIB@,$MK_SHARED_LIB,;t t
14432 s,@RM_SHARED_OPTS@,$RM_SHARED_OPTS,;t t
14433 s,@LINK_PROGS@,$LINK_PROGS,;t t
14434 s,@LINK_TESTS@,$LINK_TESTS,;t t
14435 s,@EXTRA_LDFLAGS@,$EXTRA_LDFLAGS,;t t
14436 s,@LOCAL_LDFLAGS@,$LOCAL_LDFLAGS,;t t
14437 s,@LOCAL_LDFLAGS2@,$LOCAL_LDFLAGS2,;t t
14438 s,@INSTALL_LIB@,$INSTALL_LIB,;t t
14439 s,@RPATH_LIST@,$RPATH_LIST,;t t
14440 s,@BROKEN_LINKER@,$BROKEN_LINKER,;t t
14441 s,@NCURSES_EXT_FUNCS@,$NCURSES_EXT_FUNCS,;t t
14442 s,@NCURSES_CONST@,$NCURSES_CONST,;t t
14443 s,@PTHREAD@,$PTHREAD,;t t
14444 s,@cf_cv_enable_reentrant@,$cf_cv_enable_reentrant,;t t
14445 s,@NCURSES_WRAP_PREFIX@,$NCURSES_WRAP_PREFIX,;t t
14446 s,@ECHO_LT@,$ECHO_LT,;t t
14447 s,@ECHO_LD@,$ECHO_LD,;t t
14448 s,@RULE_CC@,$RULE_CC,;t t
14449 s,@SHOW_CC@,$SHOW_CC,;t t
14450 s,@ECHO_CC@,$ECHO_CC,;t t
14451 s,@ADAFLAGS@,$ADAFLAGS,;t t
14452 s,@EXTRA_CFLAGS@,$EXTRA_CFLAGS,;t t
14453 s,@ADA_TRACE@,$ADA_TRACE,;t t
14454 s,@gnat_exists@,$gnat_exists,;t t
14455 s,@M4_exists@,$M4_exists,;t t
14456 s,@cf_ada_make@,$cf_ada_make,;t t
14457 s,@GNATPREP_OPTS@,$GNATPREP_OPTS,;t t
14458 s,@cf_compile_generics@,$cf_compile_generics,;t t
14459 s,@cf_generic_objects@,$cf_generic_objects,;t t
14460 s,@USE_GNAT_SIGINT@,$USE_GNAT_SIGINT,;t t
14461 s,@USE_OLD_MAKERULES@,$USE_OLD_MAKERULES,;t t
14462 s,@USE_GNAT_PROJECTS@,$USE_GNAT_PROJECTS,;t t
14463 s,@USE_GNAT_LIBRARIES@,$USE_GNAT_LIBRARIES,;t t
14464 s,@cf_ada_compiler@,$cf_ada_compiler,;t t
14465 s,@cf_ada_package@,$cf_ada_package,;t t
14466 s,@ADA_INCLUDE@,$ADA_INCLUDE,;t t
14467 s,@ADA_OBJECTS@,$ADA_OBJECTS,;t t
14468 s,@ADA_SHAREDLIB@,$ADA_SHAREDLIB,;t t
14469 s,@MAKE_ADA_SHAREDLIB@,$MAKE_ADA_SHAREDLIB,;t t
14470 s,@TINFO_LDFLAGS2@,$TINFO_LDFLAGS2,;t t
14471 s,@TINFO_LIBS@,$TINFO_LIBS,;t t
14472 s,@ACPPFLAGS@,$ACPPFLAGS,;t t
14473 s,@DFT_ARG_SUFFIX@,$DFT_ARG_SUFFIX,;t t
14474 s,@DFT_DEP_SUFFIX@,$DFT_DEP_SUFFIX,;t t
14475 s,@DFT_OBJ_SUBDIR@,$DFT_OBJ_SUBDIR,;t t
14476 s,@USE_CFG_SUFFIX@,$USE_CFG_SUFFIX,;t t
14477 s,@TEST_ARG2@,$TEST_ARG2,;t t
14478 s,@TEST_LIBS2@,$TEST_LIBS2,;t t
14479 s,@NCURSES_SHLIB2@,$NCURSES_SHLIB2,;t t
14480 s,@ADA_SUBDIRS@,$ADA_SUBDIRS,;t t
14481 s,@NCURSES_TREE@,$NCURSES_TREE,;t t
14482 s,@EXTERNAL_TREE@,$EXTERNAL_TREE,;t t
14483 s,@ADAHTML_DIR@,$ADAHTML_DIR,;t t
14484 CEOF
14485
14486 EOF
14487
14488   cat >>$CONFIG_STATUS <<\EOF
14489   # Split the substitutions into bite-sized pieces for seds with
14490   # small command number limits, like on Digital OSF/1 and HP-UX.
14491   ac_max_sed_lines=48
14492   ac_sed_frag=1 # Number of current file.
14493   ac_beg=1 # First line for current file.
14494   ac_end=$ac_max_sed_lines # Line after last line for current file.
14495   ac_more_lines=:
14496   ac_sed_cmds=
14497   while $ac_more_lines; do
14498     if test $ac_beg -gt 1; then
14499       sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
14500     else
14501       sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
14502     fi
14503     if test ! -s $tmp/subs.frag; then
14504       ac_more_lines=false
14505     else
14506       # The purpose of the label and of the branching condition is to
14507       # speed up the sed processing (if there are no `@' at all, there
14508       # is no need to browse any of the substitutions).
14509       # These are the two extra sed commands mentioned above.
14510       (echo ':t
14511   /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed
14512       if test -z "$ac_sed_cmds"; then
14513         ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed"
14514       else
14515         ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed"
14516       fi
14517       ac_sed_frag=`expr $ac_sed_frag + 1`
14518       ac_beg=$ac_end
14519       ac_end=`expr $ac_end + $ac_max_sed_lines`
14520     fi
14521   done
14522   if test -z "$ac_sed_cmds"; then
14523     ac_sed_cmds=cat
14524   fi
14525 fi # test -n "$CONFIG_FILES"
14526
14527 EOF
14528 cat >>$CONFIG_STATUS <<\EOF
14529 for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue
14530   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
14531   case $ac_file in
14532   - | *:- | *:-:* ) # input from stdin
14533         cat >$tmp/stdin
14534         ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
14535         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
14536   *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
14537         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
14538   * )   ac_file_in=$ac_file.in ;;
14539   esac
14540
14541   # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories.
14542   ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
14543          X"$ac_file" : 'X\(//\)[^/]' \| \
14544          X"$ac_file" : 'X\(//\)$' \| \
14545          X"$ac_file" : 'X\(/\)' \| \
14546          .     : '\(.\)' 2>/dev/null ||
14547 echo X"$ac_file" |
14548     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
14549           /^X\(\/\/\)[^/].*/{ s//\1/; q; }
14550           /^X\(\/\/\)$/{ s//\1/; q; }
14551           /^X\(\/\).*/{ s//\1/; q; }
14552           s/.*/./; q'`
14553   if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
14554     { case "$ac_dir" in
14555   [\\/]* | ?:[\\/]* ) as_incr_dir=;;
14556   *)                      as_incr_dir=.;;
14557 esac
14558 as_dummy="$ac_dir"
14559 for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
14560   case $as_mkdir_dir in
14561     # Skip DOS drivespec
14562     ?:) as_incr_dir=$as_mkdir_dir ;;
14563     *)
14564       as_incr_dir=$as_incr_dir/$as_mkdir_dir
14565       test -d "$as_incr_dir" || mkdir "$as_incr_dir"
14566     ;;
14567   esac
14568 done; }
14569
14570     ac_dir_suffix="/`echo $ac_dir|sed 's,^\./,,'`"
14571     # A "../" for each directory in $ac_dir_suffix.
14572     ac_dots=`echo "$ac_dir_suffix" | sed 's,/[^/]*,../,g'`
14573   else
14574     ac_dir_suffix= ac_dots=
14575   fi
14576
14577   case $srcdir in
14578   .)  ac_srcdir=.
14579       if test -z "$ac_dots"; then
14580          ac_top_srcdir=.
14581       else
14582          ac_top_srcdir=`echo $ac_dots | sed 's,/$,,'`
14583       fi ;;
14584   [\\/]* | ?:[\\/]* )
14585       ac_srcdir=$srcdir$ac_dir_suffix;
14586       ac_top_srcdir=$srcdir ;;
14587   *) # Relative path.
14588     ac_srcdir=$ac_dots$srcdir$ac_dir_suffix
14589     ac_top_srcdir=$ac_dots$srcdir ;;
14590   esac
14591
14592   case $INSTALL in
14593   [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
14594   *) ac_INSTALL=$ac_dots$INSTALL ;;
14595   esac
14596
14597   if test x"$ac_file" != x-; then
14598     { echo "$as_me:14598: creating $ac_file" >&5
14599 echo "$as_me: creating $ac_file" >&6;}
14600     rm -f "$ac_file"
14601   fi
14602   # Let's still pretend it is `configure' which instantiates (i.e., don't
14603   # use $as_me), people would be surprised to read:
14604   #    /* config.h.  Generated automatically by config.status.  */
14605   configure_input="Generated automatically from `echo $ac_file_in |
14606                                                  sed 's,.*/,,'` by configure."
14607
14608   # First look for the input files in the build tree, otherwise in the
14609   # src tree.
14610   ac_file_inputs=`IFS=:
14611     for f in $ac_file_in; do
14612       case $f in
14613       -) echo $tmp/stdin ;;
14614       [\\/$]*)
14615          # Absolute (can't be DOS-style, as IFS=:)
14616          test -f "$f" || { { echo "$as_me:14616: error: cannot find input file: $f" >&5
14617 echo "$as_me: error: cannot find input file: $f" >&2;}
14618    { (exit 1); exit 1; }; }
14619          echo $f;;
14620       *) # Relative
14621          if test -f "$f"; then
14622            # Build tree
14623            echo $f
14624          elif test -f "$srcdir/$f"; then
14625            # Source tree
14626            echo $srcdir/$f
14627          else
14628            # /dev/null tree
14629            { { echo "$as_me:14629: error: cannot find input file: $f" >&5
14630 echo "$as_me: error: cannot find input file: $f" >&2;}
14631    { (exit 1); exit 1; }; }
14632          fi;;
14633       esac
14634     done` || { (exit 1); exit 1; }
14635 EOF
14636 cat >>$CONFIG_STATUS <<\EOF
14637   ac_warn_datarootdir=no
14638   if test x"$ac_file" != x-; then
14639     for ac_item in $ac_file_inputs
14640     do
14641       ac_seen=`grep '@\(datadir\|mandir\|infodir\)@' $ac_item`
14642       if test -n "$ac_seen"; then
14643         ac_used=`grep '@datarootdir@' $ac_item`
14644         if test -z "$ac_used"; then
14645           { echo "$as_me:14645: WARNING: datarootdir was used implicitly but not set:
14646 $ac_seen" >&5
14647 echo "$as_me: WARNING: datarootdir was used implicitly but not set:
14648 $ac_seen" >&2;}
14649           ac_warn_datarootdir=yes
14650         fi
14651       fi
14652       ac_seen=`grep '${datarootdir}' $ac_item`
14653       if test -n "$ac_seen"; then
14654         { echo "$as_me:14654: WARNING: datarootdir was used explicitly but not set:
14655 $ac_seen" >&5
14656 echo "$as_me: WARNING: datarootdir was used explicitly but not set:
14657 $ac_seen" >&2;}
14658         ac_warn_datarootdir=yes
14659       fi
14660     done
14661   fi
14662
14663 if test "x$ac_warn_datarootdir" = xyes; then
14664   ac_sed_cmds="$ac_sed_cmds | sed -e 's,@datarootdir@,\${prefix}/share,g' -e 's,\${datarootdir},\${prefix}/share,g'"
14665 fi
14666
14667 EOF
14668 cat >>$CONFIG_STATUS <<EOF
14669   sed "$ac_vpsub
14670 $extrasub
14671 EOF
14672 cat >>$CONFIG_STATUS <<\EOF
14673 :t
14674 /@[a-zA-Z_][a-zA-Z_0-9]*@/!b
14675 s,@configure_input@,$configure_input,;t t
14676 s,@srcdir@,$ac_srcdir,;t t
14677 s,@top_srcdir@,$ac_top_srcdir,;t t
14678 s,@INSTALL@,$ac_INSTALL,;t t
14679 " $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out
14680   rm -f $tmp/stdin
14681   if test x"$ac_file" != x-; then
14682     cp $tmp/out $ac_file
14683
14684     for ac_name in prefix exec_prefix datarootdir
14685     do
14686         ac_seen=`fgrep -n '${'$ac_name'[:=].*}' $ac_file`
14687         if test -n "$ac_seen"; then
14688             ac_init=`egrep '[   ]*'$ac_name'[   ]*=' $ac_file`
14689             if test -z "$ac_init"; then
14690               ac_seen=`echo "$ac_seen" |sed -e 's,^,'$ac_file':,'`
14691               { echo "$as_me:14691: WARNING: Variable $ac_name is used but was not set:
14692 $ac_seen" >&5
14693 echo "$as_me: WARNING: Variable $ac_name is used but was not set:
14694 $ac_seen" >&2;}
14695             fi
14696         fi
14697     done
14698     egrep -n '@[a-z_][a-z_0-9]+@' $ac_file >$tmp/out
14699     egrep -n '@[A-Z_][A-Z_0-9]+@' $ac_file >>$tmp/out
14700     if test -s $tmp/out; then
14701       ac_seen=`sed -e 's,^,'$ac_file':,' < $tmp/out`
14702       { echo "$as_me:14702: WARNING: Some variables may not be substituted:
14703 $ac_seen" >&5
14704 echo "$as_me: WARNING: Some variables may not be substituted:
14705 $ac_seen" >&2;}
14706     fi
14707   else
14708     cat $tmp/out
14709   fi
14710   rm -f $tmp/out
14711
14712 done
14713 EOF
14714 cat >>$CONFIG_STATUS <<\EOF
14715
14716 #
14717 # CONFIG_HEADER section.
14718 #
14719
14720 # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
14721 # NAME is the cpp macro being defined and VALUE is the value it is being given.
14722 #
14723 # ac_d sets the value in "#define NAME VALUE" lines.
14724 ac_dA='s,^\([   ]*\)#\([        ]*define[       ][      ]*\)'
14725 ac_dB='[        ].*$,\1#\2'
14726 ac_dC=' '
14727 ac_dD=',;t'
14728 # ac_i turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
14729 ac_iA='s,^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
14730 ac_iB='\([      ]\),\1#\2define\3'
14731 ac_iC=' '
14732 ac_iD='\4,;t'
14733 # ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
14734 ac_uA='s,^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
14735 ac_uB='$,\1#\2define\3'
14736 ac_uC=' '
14737 ac_uD=',;t'
14738
14739 for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue
14740   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
14741   case $ac_file in
14742   - | *:- | *:-:* ) # input from stdin
14743         cat >$tmp/stdin
14744         ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
14745         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
14746   *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
14747         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
14748   * )   ac_file_in=$ac_file.in ;;
14749   esac
14750
14751   test x"$ac_file" != x- && { echo "$as_me:14751: creating $ac_file" >&5
14752 echo "$as_me: creating $ac_file" >&6;}
14753
14754   # First look for the input files in the build tree, otherwise in the
14755   # src tree.
14756   ac_file_inputs=`IFS=:
14757     for f in $ac_file_in; do
14758       case $f in
14759       -) echo $tmp/stdin ;;
14760       [\\/$]*)
14761          # Absolute (can't be DOS-style, as IFS=:)
14762          test -f "$f" || { { echo "$as_me:14762: error: cannot find input file: $f" >&5
14763 echo "$as_me: error: cannot find input file: $f" >&2;}
14764    { (exit 1); exit 1; }; }
14765          echo $f;;
14766       *) # Relative
14767          if test -f "$f"; then
14768            # Build tree
14769            echo $f
14770          elif test -f "$srcdir/$f"; then
14771            # Source tree
14772            echo $srcdir/$f
14773          else
14774            # /dev/null tree
14775            { { echo "$as_me:14775: error: cannot find input file: $f" >&5
14776 echo "$as_me: error: cannot find input file: $f" >&2;}
14777    { (exit 1); exit 1; }; }
14778          fi;;
14779       esac
14780     done` || { (exit 1); exit 1; }
14781   # Remove the trailing spaces.
14782   sed 's/[      ]*$//' $ac_file_inputs >$tmp/in
14783
14784 EOF
14785
14786 # Transform confdefs.h into a list of #define's.  We won't use it as a sed
14787 # script, but as data to insert where we see @DEFS@.  We expect AC_SAVE_DEFS to
14788 # be either 'cat' or 'sort'.
14789 cat confdefs.h | uniq >conftest.vals
14790
14791 # Break up conftest.vals because some shells have a limit on
14792 # the size of here documents, and old seds have small limits too.
14793
14794 rm -f conftest.tail
14795 echo '  rm -f conftest.frag' >> $CONFIG_STATUS
14796 while grep . conftest.vals >/dev/null
14797 do
14798   # Write chunks of a limited-size here document to conftest.frag.
14799   echo '  cat >> conftest.frag <<CEOF' >> $CONFIG_STATUS
14800   sed ${ac_max_here_lines}q conftest.vals | sed -e 's/#ifdef.*/#if 0/' >> $CONFIG_STATUS
14801   echo 'CEOF' >> $CONFIG_STATUS
14802   sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
14803   rm -f conftest.vals
14804   mv conftest.tail conftest.vals
14805 done
14806 rm -f conftest.vals
14807
14808 # Run sed to substitute the contents of conftest.frag into $tmp/in at the
14809 # marker @DEFS@.
14810 echo '  cat >> conftest.edit <<CEOF
14811 /@DEFS@/r conftest.frag
14812 /@DEFS@/d
14813 CEOF
14814 sed -f conftest.edit $tmp/in > $tmp/out
14815 rm -f $tmp/in
14816 mv $tmp/out $tmp/in
14817 rm -f conftest.edit conftest.frag
14818 ' >> $CONFIG_STATUS
14819
14820 cat >>$CONFIG_STATUS <<\EOF
14821   # Let's still pretend it is `configure' which instantiates (i.e., don't
14822   # use $as_me), people would be surprised to read:
14823   #    /* config.h.  Generated automatically by config.status.  */
14824   if test x"$ac_file" = x-; then
14825     echo "/* Generated automatically by configure.  */" >$tmp/config.h
14826   else
14827     echo "/* $ac_file.  Generated automatically by configure.  */" >$tmp/config.h
14828   fi
14829   cat $tmp/in >>$tmp/config.h
14830   rm -f $tmp/in
14831   if test x"$ac_file" != x-; then
14832     if cmp -s $ac_file $tmp/config.h 2>/dev/null; then
14833       { echo "$as_me:14833: $ac_file is unchanged" >&5
14834 echo "$as_me: $ac_file is unchanged" >&6;}
14835     else
14836       ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
14837          X"$ac_file" : 'X\(//\)[^/]' \| \
14838          X"$ac_file" : 'X\(//\)$' \| \
14839          X"$ac_file" : 'X\(/\)' \| \
14840          .     : '\(.\)' 2>/dev/null ||
14841 echo X"$ac_file" |
14842     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
14843           /^X\(\/\/\)[^/].*/{ s//\1/; q; }
14844           /^X\(\/\/\)$/{ s//\1/; q; }
14845           /^X\(\/\).*/{ s//\1/; q; }
14846           s/.*/./; q'`
14847       if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
14848         { case "$ac_dir" in
14849   [\\/]* | ?:[\\/]* ) as_incr_dir=;;
14850   *)                      as_incr_dir=.;;
14851 esac
14852 as_dummy="$ac_dir"
14853 for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
14854   case $as_mkdir_dir in
14855     # Skip DOS drivespec
14856     ?:) as_incr_dir=$as_mkdir_dir ;;
14857     *)
14858       as_incr_dir=$as_incr_dir/$as_mkdir_dir
14859       test -d "$as_incr_dir" || mkdir "$as_incr_dir"
14860     ;;
14861   esac
14862 done; }
14863
14864       fi
14865       rm -f $ac_file
14866       mv $tmp/config.h $ac_file
14867     fi
14868   else
14869     cat $tmp/config.h
14870     rm -f $tmp/config.h
14871   fi
14872 done
14873 EOF
14874 cat >>$CONFIG_STATUS <<\EOF
14875 #
14876 # CONFIG_COMMANDS section.
14877 #
14878 for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue
14879   ac_dest=`echo "$ac_file" | sed 's,:.*,,'`
14880   ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'`
14881
14882   case $ac_dest in
14883     default )
14884 if test -z "$USE_OLD_MAKERULES" ; then
14885         $AWK -f $srcdir/mk-1st.awk <$srcdir/src/modules >>src/Makefile
14886 fi
14887  ;;
14888   esac
14889 done
14890 EOF
14891
14892 cat >>$CONFIG_STATUS <<\EOF
14893
14894 { (exit 0); exit 0; }
14895 EOF
14896 chmod +x $CONFIG_STATUS
14897 ac_clean_files=$ac_clean_files_save
14898
14899 # configure is writing to config.log, and then calls config.status.
14900 # config.status does its own redirection, appending to config.log.
14901 # Unfortunately, on DOS this fails, as config.log is still kept open
14902 # by configure, so config.status won't be able to write to it; its
14903 # output is simply discarded.  So we exec the FD to /dev/null,
14904 # effectively closing config.log, so it can be properly (re)opened and
14905 # appended to by config.status.  When coming back to configure, we
14906 # need to make the FD available again.
14907 if test "$no_create" != yes; then
14908   ac_cs_success=:
14909   exec 5>/dev/null
14910   $SHELL $CONFIG_STATUS || ac_cs_success=false
14911   exec 5>>config.log
14912   # Use ||, not &&, to avoid exiting from the if with $? = 1, which
14913   # would make configure fail if this is the last instruction.
14914   $ac_cs_success || { (exit 1); exit 1; }
14915 fi
14916 ${MAKE:-make} preinstall