]> ncurses.scripts.mit.edu Git - ncurses.git/blob - Ada95/configure
ncurses 5.9 - patch 20141220
[ncurses.git] / Ada95 / configure
1 #! /bin/sh
2 # From configure.in Revision: 1.56 .
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   --enable-widec          compile with wide-char/UTF-8 code
671   --with-curses-dir=DIR   directory in which (n)curses is installed
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 #(vi
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 #(vi
1817         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
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) #(vi
1837                         ;;
1838                 *) #(vi
1839                         case $cf_add_cflags in #(vi
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 #(vi
2416 no) #(vi
2417         PKG_CONFIG=none
2418         ;;
2419 yes) #(vi
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 #(vi
2521 .\$\(*\)*|.\'*\'*) #(vi
2522   ;;
2523 ..|./*|.\\*) #(vi
2524   ;;
2525 .[a-zA-Z]:[\\/]*) #(vi OS/2 EMX
2526   ;;
2527 .\${*prefix}*|.\${*dir}*) #(vi
2528   eval PKG_CONFIG="$PKG_CONFIG"
2529   case ".$PKG_CONFIG" in #(vi
2530   .NONE/*)
2531     PKG_CONFIG=`echo $PKG_CONFIG | sed -e s%NONE%$cf_path_syntax%`
2532     ;;
2533   esac
2534   ;; #(vi
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 else
2546         { echo "$as_me:2546: WARNING: pkg-config is not installed" >&5
2547 echo "$as_me: WARNING: pkg-config is not installed" >&2;}
2548 fi
2549
2550 echo "$as_me:2550: checking for $PKG_CONFIG library directory" >&5
2551 echo $ECHO_N "checking for $PKG_CONFIG library directory... $ECHO_C" >&6
2552
2553 # Check whether --with-pkg-config-libdir or --without-pkg-config-libdir was given.
2554 if test "${with_pkg_config_libdir+set}" = set; then
2555   withval="$with_pkg_config_libdir"
2556   PKG_CONFIG_LIBDIR=$withval
2557 else
2558   PKG_CONFIG_LIBDIR=yes
2559 fi;
2560
2561 case x$PKG_CONFIG_LIBDIR in #(vi
2562 x/*) #(vi
2563         ;;
2564 xyes) #(vi
2565         # Look for the library directory using the same prefix as the executable
2566         if test "x$PKG_CONFIG" = xnone
2567         then
2568                 cf_path=$prefix
2569         else
2570                 cf_path=`echo "$PKG_CONFIG" | sed -e 's,/[^/]*/[^/]*$,,'`
2571         fi
2572
2573         # If you don't like using the default architecture, you have to specify the
2574         # intended library directory and corresponding compiler/linker options.
2575         #
2576         # This case allows for Debian's 2014-flavor of multiarch, along with the
2577         # most common variations before that point.  Some other variants spell the
2578         # directory differently, e.g., "pkg-config", and put it in unusual places.
2579         # pkg-config has always been poorly standardized, which is ironic...
2580         case x`(arch) 2>/dev/null` in #(vi
2581         *64) #(vi
2582                 cf_search_path="\
2583                         $cf_path/lib/*64-linux-gnu \
2584                         $cf_path/share \
2585                         $cf_path/lib64 \
2586                         $cf_path/lib32 \
2587                         $cf_path/lib"
2588                 ;;
2589         *)
2590                 cf_search_path="\
2591                         $cf_path/lib/*-linux-gnu \
2592                         $cf_path/share \
2593                         $cf_path/lib32 \
2594                         $cf_path/lib"
2595                 ;;
2596         esac
2597
2598         test -n "$verbose" && echo "    list..." 1>&6
2599
2600 echo "${as_me:-configure}:2600: testing list... ..." 1>&5
2601
2602         for cf_config in $cf_search_path
2603         do
2604                 test -n "$verbose" && echo "    checking $cf_config/pkgconfig" 1>&6
2605
2606 echo "${as_me:-configure}:2606: testing checking $cf_config/pkgconfig ..." 1>&5
2607
2608                 if test -d $cf_config/pkgconfig
2609                 then
2610                         PKG_CONFIG_LIBDIR=$cf_config/pkgconfig
2611                         echo "$as_me:2611: checking done" >&5
2612 echo $ECHO_N "checking done... $ECHO_C" >&6
2613                         break
2614                 fi
2615         done
2616         ;;
2617 *)
2618         ;;
2619 esac
2620
2621 echo "$as_me:2621: result: $PKG_CONFIG_LIBDIR" >&5
2622 echo "${ECHO_T}$PKG_CONFIG_LIBDIR" >&6
2623
2624 echo "$as_me:2624: checking if you want to build test-programs" >&5
2625 echo $ECHO_N "checking if you want to build test-programs... $ECHO_C" >&6
2626
2627 # Check whether --with-tests or --without-tests was given.
2628 if test "${with_tests+set}" = set; then
2629   withval="$with_tests"
2630   cf_with_tests=$withval
2631 else
2632   cf_with_tests=yes
2633 fi;
2634 echo "$as_me:2634: result: $cf_with_tests" >&5
2635 echo "${ECHO_T}$cf_with_tests" >&6
2636
2637 echo "$as_me:2637: checking if we should assume mixed-case filenames" >&5
2638 echo $ECHO_N "checking if we should assume mixed-case filenames... $ECHO_C" >&6
2639
2640 # Check whether --enable-mixed-case or --disable-mixed-case was given.
2641 if test "${enable_mixed_case+set}" = set; then
2642   enableval="$enable_mixed_case"
2643   enable_mixedcase=$enableval
2644 else
2645   enable_mixedcase=auto
2646 fi;
2647 echo "$as_me:2647: result: $enable_mixedcase" >&5
2648 echo "${ECHO_T}$enable_mixedcase" >&6
2649 if test "$enable_mixedcase" = "auto" ; then
2650
2651 echo "$as_me:2651: checking if filesystem supports mixed-case filenames" >&5
2652 echo $ECHO_N "checking if filesystem supports mixed-case filenames... $ECHO_C" >&6
2653 if test "${cf_cv_mixedcase+set}" = set; then
2654   echo $ECHO_N "(cached) $ECHO_C" >&6
2655 else
2656
2657 if test "$cross_compiling" = yes ; then
2658         case $target_alias in #(vi
2659         *-os2-emx*|*-msdosdjgpp*|*-cygwin*|*-msys*|*-mingw*|*-uwin*) #(vi
2660                 cf_cv_mixedcase=no
2661                 ;;
2662         *)
2663                 cf_cv_mixedcase=yes
2664                 ;;
2665         esac
2666 else
2667         rm -f conftest CONFTEST
2668         echo test >conftest
2669         if test -f CONFTEST ; then
2670                 cf_cv_mixedcase=no
2671         else
2672                 cf_cv_mixedcase=yes
2673         fi
2674         rm -f conftest CONFTEST
2675 fi
2676
2677 fi
2678 echo "$as_me:2678: result: $cf_cv_mixedcase" >&5
2679 echo "${ECHO_T}$cf_cv_mixedcase" >&6
2680 test "$cf_cv_mixedcase" = yes &&
2681 cat >>confdefs.h <<\EOF
2682 #define MIXEDCASE_FILENAMES 1
2683 EOF
2684
2685 else
2686     cf_cv_mixedcase=$enable_mixedcase
2687     if test "$enable_mixedcase" = "yes" ; then
2688         cat >>confdefs.h <<\EOF
2689 #define MIXEDCASE_FILENAMES 1
2690 EOF
2691
2692     fi
2693 fi
2694
2695 # do this after mixed-case option (tags/TAGS is not as important as tic).
2696 echo "$as_me:2696: checking whether ${MAKE-make} sets \${MAKE}" >&5
2697 echo $ECHO_N "checking whether ${MAKE-make} sets \${MAKE}... $ECHO_C" >&6
2698 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,./+-,__p_,'`
2699 if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then
2700   echo $ECHO_N "(cached) $ECHO_C" >&6
2701 else
2702   cat >conftest.make <<\EOF
2703 all:
2704         @echo 'ac_maketemp="${MAKE}"'
2705 EOF
2706 # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
2707 eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=`
2708 if test -n "$ac_maketemp"; then
2709   eval ac_cv_prog_make_${ac_make}_set=yes
2710 else
2711   eval ac_cv_prog_make_${ac_make}_set=no
2712 fi
2713 rm -f conftest.make
2714 fi
2715 if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
2716   echo "$as_me:2716: result: yes" >&5
2717 echo "${ECHO_T}yes" >&6
2718   SET_MAKE=
2719 else
2720   echo "$as_me:2720: result: no" >&5
2721 echo "${ECHO_T}no" >&6
2722   SET_MAKE="MAKE=${MAKE-make}"
2723 fi
2724
2725 for ac_prog in exctags ctags
2726 do
2727   # Extract the first word of "$ac_prog", so it can be a program name with args.
2728 set dummy $ac_prog; ac_word=$2
2729 echo "$as_me:2729: checking for $ac_word" >&5
2730 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2731 if test "${ac_cv_prog_CTAGS+set}" = set; then
2732   echo $ECHO_N "(cached) $ECHO_C" >&6
2733 else
2734   if test -n "$CTAGS"; then
2735   ac_cv_prog_CTAGS="$CTAGS" # Let the user override the test.
2736 else
2737   ac_save_IFS=$IFS; IFS=$ac_path_separator
2738 ac_dummy="$PATH"
2739 for ac_dir in $ac_dummy; do
2740   IFS=$ac_save_IFS
2741   test -z "$ac_dir" && ac_dir=.
2742   $as_executable_p "$ac_dir/$ac_word" || continue
2743 ac_cv_prog_CTAGS="$ac_prog"
2744 echo "$as_me:2744: found $ac_dir/$ac_word" >&5
2745 break
2746 done
2747
2748 fi
2749 fi
2750 CTAGS=$ac_cv_prog_CTAGS
2751 if test -n "$CTAGS"; then
2752   echo "$as_me:2752: result: $CTAGS" >&5
2753 echo "${ECHO_T}$CTAGS" >&6
2754 else
2755   echo "$as_me:2755: result: no" >&5
2756 echo "${ECHO_T}no" >&6
2757 fi
2758
2759   test -n "$CTAGS" && break
2760 done
2761
2762 for ac_prog in exetags etags
2763 do
2764   # Extract the first word of "$ac_prog", so it can be a program name with args.
2765 set dummy $ac_prog; ac_word=$2
2766 echo "$as_me:2766: checking for $ac_word" >&5
2767 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2768 if test "${ac_cv_prog_ETAGS+set}" = set; then
2769   echo $ECHO_N "(cached) $ECHO_C" >&6
2770 else
2771   if test -n "$ETAGS"; then
2772   ac_cv_prog_ETAGS="$ETAGS" # Let the user override the test.
2773 else
2774   ac_save_IFS=$IFS; IFS=$ac_path_separator
2775 ac_dummy="$PATH"
2776 for ac_dir in $ac_dummy; do
2777   IFS=$ac_save_IFS
2778   test -z "$ac_dir" && ac_dir=.
2779   $as_executable_p "$ac_dir/$ac_word" || continue
2780 ac_cv_prog_ETAGS="$ac_prog"
2781 echo "$as_me:2781: found $ac_dir/$ac_word" >&5
2782 break
2783 done
2784
2785 fi
2786 fi
2787 ETAGS=$ac_cv_prog_ETAGS
2788 if test -n "$ETAGS"; then
2789   echo "$as_me:2789: result: $ETAGS" >&5
2790 echo "${ECHO_T}$ETAGS" >&6
2791 else
2792   echo "$as_me:2792: result: no" >&5
2793 echo "${ECHO_T}no" >&6
2794 fi
2795
2796   test -n "$ETAGS" && break
2797 done
2798
2799 # Extract the first word of "${CTAGS:-ctags}", so it can be a program name with args.
2800 set dummy ${CTAGS:-ctags}; ac_word=$2
2801 echo "$as_me:2801: checking for $ac_word" >&5
2802 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2803 if test "${ac_cv_prog_MAKE_LOWER_TAGS+set}" = set; then
2804   echo $ECHO_N "(cached) $ECHO_C" >&6
2805 else
2806   if test -n "$MAKE_LOWER_TAGS"; then
2807   ac_cv_prog_MAKE_LOWER_TAGS="$MAKE_LOWER_TAGS" # Let the user override the test.
2808 else
2809   ac_save_IFS=$IFS; IFS=$ac_path_separator
2810 ac_dummy="$PATH"
2811 for ac_dir in $ac_dummy; do
2812   IFS=$ac_save_IFS
2813   test -z "$ac_dir" && ac_dir=.
2814   $as_executable_p "$ac_dir/$ac_word" || continue
2815 ac_cv_prog_MAKE_LOWER_TAGS="yes"
2816 echo "$as_me:2816: found $ac_dir/$ac_word" >&5
2817 break
2818 done
2819
2820   test -z "$ac_cv_prog_MAKE_LOWER_TAGS" && ac_cv_prog_MAKE_LOWER_TAGS="no"
2821 fi
2822 fi
2823 MAKE_LOWER_TAGS=$ac_cv_prog_MAKE_LOWER_TAGS
2824 if test -n "$MAKE_LOWER_TAGS"; then
2825   echo "$as_me:2825: result: $MAKE_LOWER_TAGS" >&5
2826 echo "${ECHO_T}$MAKE_LOWER_TAGS" >&6
2827 else
2828   echo "$as_me:2828: result: no" >&5
2829 echo "${ECHO_T}no" >&6
2830 fi
2831
2832 if test "$cf_cv_mixedcase" = yes ; then
2833         # Extract the first word of "${ETAGS:-etags}", so it can be a program name with args.
2834 set dummy ${ETAGS:-etags}; ac_word=$2
2835 echo "$as_me:2835: checking for $ac_word" >&5
2836 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2837 if test "${ac_cv_prog_MAKE_UPPER_TAGS+set}" = set; then
2838   echo $ECHO_N "(cached) $ECHO_C" >&6
2839 else
2840   if test -n "$MAKE_UPPER_TAGS"; then
2841   ac_cv_prog_MAKE_UPPER_TAGS="$MAKE_UPPER_TAGS" # Let the user override the test.
2842 else
2843   ac_save_IFS=$IFS; IFS=$ac_path_separator
2844 ac_dummy="$PATH"
2845 for ac_dir in $ac_dummy; do
2846   IFS=$ac_save_IFS
2847   test -z "$ac_dir" && ac_dir=.
2848   $as_executable_p "$ac_dir/$ac_word" || continue
2849 ac_cv_prog_MAKE_UPPER_TAGS="yes"
2850 echo "$as_me:2850: found $ac_dir/$ac_word" >&5
2851 break
2852 done
2853
2854   test -z "$ac_cv_prog_MAKE_UPPER_TAGS" && ac_cv_prog_MAKE_UPPER_TAGS="no"
2855 fi
2856 fi
2857 MAKE_UPPER_TAGS=$ac_cv_prog_MAKE_UPPER_TAGS
2858 if test -n "$MAKE_UPPER_TAGS"; then
2859   echo "$as_me:2859: result: $MAKE_UPPER_TAGS" >&5
2860 echo "${ECHO_T}$MAKE_UPPER_TAGS" >&6
2861 else
2862   echo "$as_me:2862: result: no" >&5
2863 echo "${ECHO_T}no" >&6
2864 fi
2865
2866 else
2867         MAKE_UPPER_TAGS=no
2868 fi
2869
2870 if test "$MAKE_UPPER_TAGS" = yes ; then
2871         MAKE_UPPER_TAGS=
2872 else
2873         MAKE_UPPER_TAGS="#"
2874 fi
2875
2876 if test "$MAKE_LOWER_TAGS" = yes ; then
2877         MAKE_LOWER_TAGS=
2878 else
2879         MAKE_LOWER_TAGS="#"
2880 fi
2881
2882 echo "$as_me:2882: checking for makeflags variable" >&5
2883 echo $ECHO_N "checking for makeflags variable... $ECHO_C" >&6
2884 if test "${cf_cv_makeflags+set}" = set; then
2885   echo $ECHO_N "(cached) $ECHO_C" >&6
2886 else
2887
2888         cf_cv_makeflags=''
2889         for cf_option in '-${MAKEFLAGS}' '${MFLAGS}'
2890         do
2891                 cat >cf_makeflags.tmp <<CF_EOF
2892 SHELL = /bin/sh
2893 all :
2894         @ echo '.$cf_option'
2895 CF_EOF
2896                 cf_result=`${MAKE:-make} -k -f cf_makeflags.tmp 2>/dev/null | fgrep -v "ing directory" | sed -e 's,[    ]*$,,'`
2897                 case "$cf_result" in
2898                 .*k|.*kw)
2899                         cf_result=`${MAKE:-make} -k -f cf_makeflags.tmp CC=cc 2>/dev/null`
2900                         case "$cf_result" in
2901                         .*CC=*) cf_cv_makeflags=
2902                                 ;;
2903                         *)      cf_cv_makeflags=$cf_option
2904                                 ;;
2905                         esac
2906                         break
2907                         ;;
2908                 .-)     ;;
2909                 *)      echo "given option \"$cf_option\", no match \"$cf_result\""
2910                         ;;
2911                 esac
2912         done
2913         rm -f cf_makeflags.tmp
2914
2915 fi
2916 echo "$as_me:2916: result: $cf_cv_makeflags" >&5
2917 echo "${ECHO_T}$cf_cv_makeflags" >&6
2918
2919 if test -n "$ac_tool_prefix"; then
2920   # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
2921 set dummy ${ac_tool_prefix}ranlib; ac_word=$2
2922 echo "$as_me:2922: checking for $ac_word" >&5
2923 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2924 if test "${ac_cv_prog_RANLIB+set}" = set; then
2925   echo $ECHO_N "(cached) $ECHO_C" >&6
2926 else
2927   if test -n "$RANLIB"; then
2928   ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
2929 else
2930   ac_save_IFS=$IFS; IFS=$ac_path_separator
2931 ac_dummy="$PATH"
2932 for ac_dir in $ac_dummy; do
2933   IFS=$ac_save_IFS
2934   test -z "$ac_dir" && ac_dir=.
2935   $as_executable_p "$ac_dir/$ac_word" || continue
2936 ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
2937 echo "$as_me:2937: found $ac_dir/$ac_word" >&5
2938 break
2939 done
2940
2941 fi
2942 fi
2943 RANLIB=$ac_cv_prog_RANLIB
2944 if test -n "$RANLIB"; then
2945   echo "$as_me:2945: result: $RANLIB" >&5
2946 echo "${ECHO_T}$RANLIB" >&6
2947 else
2948   echo "$as_me:2948: result: no" >&5
2949 echo "${ECHO_T}no" >&6
2950 fi
2951
2952 fi
2953 if test -z "$ac_cv_prog_RANLIB"; then
2954   ac_ct_RANLIB=$RANLIB
2955   # Extract the first word of "ranlib", so it can be a program name with args.
2956 set dummy ranlib; ac_word=$2
2957 echo "$as_me:2957: checking for $ac_word" >&5
2958 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2959 if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then
2960   echo $ECHO_N "(cached) $ECHO_C" >&6
2961 else
2962   if test -n "$ac_ct_RANLIB"; then
2963   ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
2964 else
2965   ac_save_IFS=$IFS; IFS=$ac_path_separator
2966 ac_dummy="$PATH"
2967 for ac_dir in $ac_dummy; do
2968   IFS=$ac_save_IFS
2969   test -z "$ac_dir" && ac_dir=.
2970   $as_executable_p "$ac_dir/$ac_word" || continue
2971 ac_cv_prog_ac_ct_RANLIB="ranlib"
2972 echo "$as_me:2972: found $ac_dir/$ac_word" >&5
2973 break
2974 done
2975
2976   test -z "$ac_cv_prog_ac_ct_RANLIB" && ac_cv_prog_ac_ct_RANLIB="':'"
2977 fi
2978 fi
2979 ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
2980 if test -n "$ac_ct_RANLIB"; then
2981   echo "$as_me:2981: result: $ac_ct_RANLIB" >&5
2982 echo "${ECHO_T}$ac_ct_RANLIB" >&6
2983 else
2984   echo "$as_me:2984: result: no" >&5
2985 echo "${ECHO_T}no" >&6
2986 fi
2987
2988   RANLIB=$ac_ct_RANLIB
2989 else
2990   RANLIB="$ac_cv_prog_RANLIB"
2991 fi
2992
2993 if test -n "$ac_tool_prefix"; then
2994   # Extract the first word of "${ac_tool_prefix}ld", so it can be a program name with args.
2995 set dummy ${ac_tool_prefix}ld; ac_word=$2
2996 echo "$as_me:2996: checking for $ac_word" >&5
2997 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2998 if test "${ac_cv_prog_LD+set}" = set; then
2999   echo $ECHO_N "(cached) $ECHO_C" >&6
3000 else
3001   if test -n "$LD"; then
3002   ac_cv_prog_LD="$LD" # Let the user override the test.
3003 else
3004   ac_save_IFS=$IFS; IFS=$ac_path_separator
3005 ac_dummy="$PATH"
3006 for ac_dir in $ac_dummy; do
3007   IFS=$ac_save_IFS
3008   test -z "$ac_dir" && ac_dir=.
3009   $as_executable_p "$ac_dir/$ac_word" || continue
3010 ac_cv_prog_LD="${ac_tool_prefix}ld"
3011 echo "$as_me:3011: found $ac_dir/$ac_word" >&5
3012 break
3013 done
3014
3015 fi
3016 fi
3017 LD=$ac_cv_prog_LD
3018 if test -n "$LD"; then
3019   echo "$as_me:3019: result: $LD" >&5
3020 echo "${ECHO_T}$LD" >&6
3021 else
3022   echo "$as_me:3022: result: no" >&5
3023 echo "${ECHO_T}no" >&6
3024 fi
3025
3026 fi
3027 if test -z "$ac_cv_prog_LD"; then
3028   ac_ct_LD=$LD
3029   # Extract the first word of "ld", so it can be a program name with args.
3030 set dummy ld; ac_word=$2
3031 echo "$as_me:3031: checking for $ac_word" >&5
3032 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3033 if test "${ac_cv_prog_ac_ct_LD+set}" = set; then
3034   echo $ECHO_N "(cached) $ECHO_C" >&6
3035 else
3036   if test -n "$ac_ct_LD"; then
3037   ac_cv_prog_ac_ct_LD="$ac_ct_LD" # Let the user override the test.
3038 else
3039   ac_save_IFS=$IFS; IFS=$ac_path_separator
3040 ac_dummy="$PATH"
3041 for ac_dir in $ac_dummy; do
3042   IFS=$ac_save_IFS
3043   test -z "$ac_dir" && ac_dir=.
3044   $as_executable_p "$ac_dir/$ac_word" || continue
3045 ac_cv_prog_ac_ct_LD="ld"
3046 echo "$as_me:3046: found $ac_dir/$ac_word" >&5
3047 break
3048 done
3049
3050   test -z "$ac_cv_prog_ac_ct_LD" && ac_cv_prog_ac_ct_LD="ld"
3051 fi
3052 fi
3053 ac_ct_LD=$ac_cv_prog_ac_ct_LD
3054 if test -n "$ac_ct_LD"; then
3055   echo "$as_me:3055: result: $ac_ct_LD" >&5
3056 echo "${ECHO_T}$ac_ct_LD" >&6
3057 else
3058   echo "$as_me:3058: result: no" >&5
3059 echo "${ECHO_T}no" >&6
3060 fi
3061
3062   LD=$ac_ct_LD
3063 else
3064   LD="$ac_cv_prog_LD"
3065 fi
3066
3067 if test -n "$ac_tool_prefix"; then
3068   # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
3069 set dummy ${ac_tool_prefix}ar; ac_word=$2
3070 echo "$as_me:3070: checking for $ac_word" >&5
3071 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3072 if test "${ac_cv_prog_AR+set}" = set; then
3073   echo $ECHO_N "(cached) $ECHO_C" >&6
3074 else
3075   if test -n "$AR"; then
3076   ac_cv_prog_AR="$AR" # Let the user override the test.
3077 else
3078   ac_save_IFS=$IFS; IFS=$ac_path_separator
3079 ac_dummy="$PATH"
3080 for ac_dir in $ac_dummy; do
3081   IFS=$ac_save_IFS
3082   test -z "$ac_dir" && ac_dir=.
3083   $as_executable_p "$ac_dir/$ac_word" || continue
3084 ac_cv_prog_AR="${ac_tool_prefix}ar"
3085 echo "$as_me:3085: found $ac_dir/$ac_word" >&5
3086 break
3087 done
3088
3089 fi
3090 fi
3091 AR=$ac_cv_prog_AR
3092 if test -n "$AR"; then
3093   echo "$as_me:3093: result: $AR" >&5
3094 echo "${ECHO_T}$AR" >&6
3095 else
3096   echo "$as_me:3096: result: no" >&5
3097 echo "${ECHO_T}no" >&6
3098 fi
3099
3100 fi
3101 if test -z "$ac_cv_prog_AR"; then
3102   ac_ct_AR=$AR
3103   # Extract the first word of "ar", so it can be a program name with args.
3104 set dummy ar; ac_word=$2
3105 echo "$as_me:3105: checking for $ac_word" >&5
3106 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3107 if test "${ac_cv_prog_ac_ct_AR+set}" = set; then
3108   echo $ECHO_N "(cached) $ECHO_C" >&6
3109 else
3110   if test -n "$ac_ct_AR"; then
3111   ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test.
3112 else
3113   ac_save_IFS=$IFS; IFS=$ac_path_separator
3114 ac_dummy="$PATH"
3115 for ac_dir in $ac_dummy; do
3116   IFS=$ac_save_IFS
3117   test -z "$ac_dir" && ac_dir=.
3118   $as_executable_p "$ac_dir/$ac_word" || continue
3119 ac_cv_prog_ac_ct_AR="ar"
3120 echo "$as_me:3120: found $ac_dir/$ac_word" >&5
3121 break
3122 done
3123
3124   test -z "$ac_cv_prog_ac_ct_AR" && ac_cv_prog_ac_ct_AR="ar"
3125 fi
3126 fi
3127 ac_ct_AR=$ac_cv_prog_ac_ct_AR
3128 if test -n "$ac_ct_AR"; then
3129   echo "$as_me:3129: result: $ac_ct_AR" >&5
3130 echo "${ECHO_T}$ac_ct_AR" >&6
3131 else
3132   echo "$as_me:3132: result: no" >&5
3133 echo "${ECHO_T}no" >&6
3134 fi
3135
3136   AR=$ac_ct_AR
3137 else
3138   AR="$ac_cv_prog_AR"
3139 fi
3140
3141 if test -n "$ac_tool_prefix"; then
3142   # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
3143 set dummy ${ac_tool_prefix}ar; ac_word=$2
3144 echo "$as_me:3144: checking for $ac_word" >&5
3145 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3146 if test "${ac_cv_prog_AR+set}" = set; then
3147   echo $ECHO_N "(cached) $ECHO_C" >&6
3148 else
3149   if test -n "$AR"; then
3150   ac_cv_prog_AR="$AR" # Let the user override the test.
3151 else
3152   ac_save_IFS=$IFS; IFS=$ac_path_separator
3153 ac_dummy="$PATH"
3154 for ac_dir in $ac_dummy; do
3155   IFS=$ac_save_IFS
3156   test -z "$ac_dir" && ac_dir=.
3157   $as_executable_p "$ac_dir/$ac_word" || continue
3158 ac_cv_prog_AR="${ac_tool_prefix}ar"
3159 echo "$as_me:3159: found $ac_dir/$ac_word" >&5
3160 break
3161 done
3162
3163 fi
3164 fi
3165 AR=$ac_cv_prog_AR
3166 if test -n "$AR"; then
3167   echo "$as_me:3167: result: $AR" >&5
3168 echo "${ECHO_T}$AR" >&6
3169 else
3170   echo "$as_me:3170: result: no" >&5
3171 echo "${ECHO_T}no" >&6
3172 fi
3173
3174 fi
3175 if test -z "$ac_cv_prog_AR"; then
3176   ac_ct_AR=$AR
3177   # Extract the first word of "ar", so it can be a program name with args.
3178 set dummy ar; ac_word=$2
3179 echo "$as_me:3179: checking for $ac_word" >&5
3180 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3181 if test "${ac_cv_prog_ac_ct_AR+set}" = set; then
3182   echo $ECHO_N "(cached) $ECHO_C" >&6
3183 else
3184   if test -n "$ac_ct_AR"; then
3185   ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test.
3186 else
3187   ac_save_IFS=$IFS; IFS=$ac_path_separator
3188 ac_dummy="$PATH"
3189 for ac_dir in $ac_dummy; do
3190   IFS=$ac_save_IFS
3191   test -z "$ac_dir" && ac_dir=.
3192   $as_executable_p "$ac_dir/$ac_word" || continue
3193 ac_cv_prog_ac_ct_AR="ar"
3194 echo "$as_me:3194: found $ac_dir/$ac_word" >&5
3195 break
3196 done
3197
3198   test -z "$ac_cv_prog_ac_ct_AR" && ac_cv_prog_ac_ct_AR="ar"
3199 fi
3200 fi
3201 ac_ct_AR=$ac_cv_prog_ac_ct_AR
3202 if test -n "$ac_ct_AR"; then
3203   echo "$as_me:3203: result: $ac_ct_AR" >&5
3204 echo "${ECHO_T}$ac_ct_AR" >&6
3205 else
3206   echo "$as_me:3206: result: no" >&5
3207 echo "${ECHO_T}no" >&6
3208 fi
3209
3210   AR=$ac_ct_AR
3211 else
3212   AR="$ac_cv_prog_AR"
3213 fi
3214
3215 echo "$as_me:3215: checking for options to update archives" >&5
3216 echo $ECHO_N "checking for options to update archives... $ECHO_C" >&6
3217 if test "${cf_cv_ar_flags+set}" = set; then
3218   echo $ECHO_N "(cached) $ECHO_C" >&6
3219 else
3220
3221         cf_cv_ar_flags=unknown
3222         for cf_ar_flags in -curv curv -crv crv -cqv cqv -rv rv
3223         do
3224
3225                 # check if $ARFLAGS already contains this choice
3226                 if test "x$ARFLAGS" != "x" ; then
3227                         cf_check_ar_flags=`echo "x$ARFLAGS" | sed -e "s/$cf_ar_flags\$//" -e "s/$cf_ar_flags / /"`
3228                         if test "x$ARFLAGS" != "$cf_check_ar_flags" ; then
3229                                 cf_cv_ar_flags=
3230                                 break
3231                         fi
3232                 fi
3233
3234                 rm -f conftest.$ac_cv_objext
3235                 rm -f conftest.a
3236
3237                 cat >conftest.$ac_ext <<EOF
3238 #line 3238 "configure"
3239 int     testdata[3] = { 123, 456, 789 };
3240 EOF
3241                 if { (eval echo "$as_me:3241: \"$ac_compile\"") >&5
3242   (eval $ac_compile) 2>&5
3243   ac_status=$?
3244   echo "$as_me:3244: \$? = $ac_status" >&5
3245   (exit $ac_status); } ; then
3246                         echo "$AR $ARFLAGS $cf_ar_flags conftest.a conftest.$ac_cv_objext" >&5
3247                         $AR $ARFLAGS $cf_ar_flags conftest.a conftest.$ac_cv_objext 2>&5 1>/dev/null
3248                         if test -f conftest.a ; then
3249                                 cf_cv_ar_flags=$cf_ar_flags
3250                                 break
3251                         fi
3252                 else
3253                         test -n "$verbose" && echo "    cannot compile test-program" 1>&6
3254
3255 echo "${as_me:-configure}:3255: testing cannot compile test-program ..." 1>&5
3256
3257                         break
3258                 fi
3259         done
3260         rm -f conftest.a conftest.$ac_ext conftest.$ac_cv_objext
3261
3262 fi
3263 echo "$as_me:3263: result: $cf_cv_ar_flags" >&5
3264 echo "${ECHO_T}$cf_cv_ar_flags" >&6
3265
3266 if test -n "$ARFLAGS" ; then
3267         if test -n "$cf_cv_ar_flags" ; then
3268                 ARFLAGS="$ARFLAGS $cf_cv_ar_flags"
3269         fi
3270 else
3271         ARFLAGS=$cf_cv_ar_flags
3272 fi
3273
3274         echo "$as_me:3274: checking for PATH separator" >&5
3275 echo $ECHO_N "checking for PATH separator... $ECHO_C" >&6
3276         case $cf_cv_system_name in
3277         os2*)   PATH_SEPARATOR=';'  ;;
3278         *)      ${PATH_SEPARATOR:=':'}  ;;
3279         esac
3280
3281         echo "$as_me:3281: result: $PATH_SEPARATOR" >&5
3282 echo "${ECHO_T}$PATH_SEPARATOR" >&6
3283
3284 echo "$as_me:3284: checking if you have specified an install-prefix" >&5
3285 echo $ECHO_N "checking if you have specified an install-prefix... $ECHO_C" >&6
3286
3287 # Check whether --with-install-prefix or --without-install-prefix was given.
3288 if test "${with_install_prefix+set}" = set; then
3289   withval="$with_install_prefix"
3290   case "$withval" in #(vi
3291         yes|no) #(vi
3292                 ;;
3293         *)      DESTDIR="$withval"
3294                 ;;
3295         esac
3296 fi;
3297 echo "$as_me:3297: result: $DESTDIR" >&5
3298 echo "${ECHO_T}$DESTDIR" >&6
3299
3300 ###############################################################################
3301
3302 # If we're cross-compiling, allow the user to override the tools and their
3303 # options.  The configure script is oriented toward identifying the host
3304 # compiler, etc., but we need a build compiler to generate parts of the source.
3305
3306 if test "$cross_compiling" = yes ; then
3307
3308         # defaults that we might want to override
3309         : ${BUILD_CFLAGS:=''}
3310         : ${BUILD_CPPFLAGS:=''}
3311         : ${BUILD_LDFLAGS:=''}
3312         : ${BUILD_LIBS:=''}
3313         : ${BUILD_EXEEXT:='$x'}
3314         : ${BUILD_OBJEXT:='o'}
3315
3316 # Check whether --with-build-cc or --without-build-cc was given.
3317 if test "${with_build_cc+set}" = set; then
3318   withval="$with_build_cc"
3319   BUILD_CC="$withval"
3320 else
3321   for ac_prog in gcc cc cl
3322 do
3323   # Extract the first word of "$ac_prog", so it can be a program name with args.
3324 set dummy $ac_prog; ac_word=$2
3325 echo "$as_me:3325: checking for $ac_word" >&5
3326 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3327 if test "${ac_cv_prog_BUILD_CC+set}" = set; then
3328   echo $ECHO_N "(cached) $ECHO_C" >&6
3329 else
3330   if test -n "$BUILD_CC"; then
3331   ac_cv_prog_BUILD_CC="$BUILD_CC" # Let the user override the test.
3332 else
3333   ac_save_IFS=$IFS; IFS=$ac_path_separator
3334 ac_dummy="$PATH"
3335 for ac_dir in $ac_dummy; do
3336   IFS=$ac_save_IFS
3337   test -z "$ac_dir" && ac_dir=.
3338   $as_executable_p "$ac_dir/$ac_word" || continue
3339 ac_cv_prog_BUILD_CC="$ac_prog"
3340 echo "$as_me:3340: found $ac_dir/$ac_word" >&5
3341 break
3342 done
3343
3344 fi
3345 fi
3346 BUILD_CC=$ac_cv_prog_BUILD_CC
3347 if test -n "$BUILD_CC"; then
3348   echo "$as_me:3348: result: $BUILD_CC" >&5
3349 echo "${ECHO_T}$BUILD_CC" >&6
3350 else
3351   echo "$as_me:3351: result: no" >&5
3352 echo "${ECHO_T}no" >&6
3353 fi
3354
3355   test -n "$BUILD_CC" && break
3356 done
3357
3358 fi;
3359         echo "$as_me:3359: checking for native build C compiler" >&5
3360 echo $ECHO_N "checking for native build C compiler... $ECHO_C" >&6
3361         echo "$as_me:3361: result: $BUILD_CC" >&5
3362 echo "${ECHO_T}$BUILD_CC" >&6
3363
3364         echo "$as_me:3364: checking for native build C preprocessor" >&5
3365 echo $ECHO_N "checking for native build C preprocessor... $ECHO_C" >&6
3366
3367 # Check whether --with-build-cpp or --without-build-cpp was given.
3368 if test "${with_build_cpp+set}" = set; then
3369   withval="$with_build_cpp"
3370   BUILD_CPP="$withval"
3371 else
3372   BUILD_CPP='${BUILD_CC} -E'
3373 fi;
3374         echo "$as_me:3374: result: $BUILD_CPP" >&5
3375 echo "${ECHO_T}$BUILD_CPP" >&6
3376
3377         echo "$as_me:3377: checking for native build C flags" >&5
3378 echo $ECHO_N "checking for native build C flags... $ECHO_C" >&6
3379
3380 # Check whether --with-build-cflags or --without-build-cflags was given.
3381 if test "${with_build_cflags+set}" = set; then
3382   withval="$with_build_cflags"
3383   BUILD_CFLAGS="$withval"
3384 fi;
3385         echo "$as_me:3385: result: $BUILD_CFLAGS" >&5
3386 echo "${ECHO_T}$BUILD_CFLAGS" >&6
3387
3388         echo "$as_me:3388: checking for native build C preprocessor-flags" >&5
3389 echo $ECHO_N "checking for native build C preprocessor-flags... $ECHO_C" >&6
3390
3391 # Check whether --with-build-cppflags or --without-build-cppflags was given.
3392 if test "${with_build_cppflags+set}" = set; then
3393   withval="$with_build_cppflags"
3394   BUILD_CPPFLAGS="$withval"
3395 fi;
3396         echo "$as_me:3396: result: $BUILD_CPPFLAGS" >&5
3397 echo "${ECHO_T}$BUILD_CPPFLAGS" >&6
3398
3399         echo "$as_me:3399: checking for native build linker-flags" >&5
3400 echo $ECHO_N "checking for native build linker-flags... $ECHO_C" >&6
3401
3402 # Check whether --with-build-ldflags or --without-build-ldflags was given.
3403 if test "${with_build_ldflags+set}" = set; then
3404   withval="$with_build_ldflags"
3405   BUILD_LDFLAGS="$withval"
3406 fi;
3407         echo "$as_me:3407: result: $BUILD_LDFLAGS" >&5
3408 echo "${ECHO_T}$BUILD_LDFLAGS" >&6
3409
3410         echo "$as_me:3410: checking for native build linker-libraries" >&5
3411 echo $ECHO_N "checking for native build linker-libraries... $ECHO_C" >&6
3412
3413 # Check whether --with-build-libs or --without-build-libs was given.
3414 if test "${with_build_libs+set}" = set; then
3415   withval="$with_build_libs"
3416   BUILD_LIBS="$withval"
3417 fi;
3418         echo "$as_me:3418: result: $BUILD_LIBS" >&5
3419 echo "${ECHO_T}$BUILD_LIBS" >&6
3420
3421         # this assumes we're on Unix.
3422         BUILD_EXEEXT=
3423         BUILD_OBJEXT=o
3424
3425         : ${BUILD_CC:='${CC}'}
3426
3427         if ( test "$BUILD_CC" = "$CC" || test "$BUILD_CC" = '${CC}' ) ; then
3428                 { { echo "$as_me:3428: error: Cross-build requires two compilers.
3429 Use --with-build-cc to specify the native compiler." >&5
3430 echo "$as_me: error: Cross-build requires two compilers.
3431 Use --with-build-cc to specify the native compiler." >&2;}
3432    { (exit 1); exit 1; }; }
3433         fi
3434
3435 else
3436         : ${BUILD_CC:='${CC}'}
3437         : ${BUILD_CPP:='${CPP}'}
3438         : ${BUILD_CFLAGS:='${CFLAGS}'}
3439         : ${BUILD_CPPFLAGS:='${CPPFLAGS}'}
3440         : ${BUILD_LDFLAGS:='${LDFLAGS}'}
3441         : ${BUILD_LIBS:='${LIBS}'}
3442         : ${BUILD_EXEEXT:='$x'}
3443         : ${BUILD_OBJEXT:='o'}
3444 fi
3445
3446 ###############################################################################
3447
3448 ### Options to allow the user to specify the set of libraries which are used.
3449 ### Use "--without-normal --with-shared" to allow the default model to be
3450 ### shared, for example.
3451 cf_list_models=""
3452
3453 echo "$as_me:3453: checking if you want to build shared C-objects" >&5
3454 echo $ECHO_N "checking if you want to build shared C-objects... $ECHO_C" >&6
3455
3456 # Check whether --with-shared or --without-shared was given.
3457 if test "${with_shared+set}" = set; then
3458   withval="$with_shared"
3459   with_shared=$withval
3460 else
3461   with_shared=no
3462 fi;
3463 echo "$as_me:3463: result: $with_shared" >&5
3464 echo "${ECHO_T}$with_shared" >&6
3465 test "$with_shared" = "yes" && cf_list_models="$cf_list_models shared"
3466
3467 echo "$as_me:3467: checking for specified models" >&5
3468 echo $ECHO_N "checking for specified models... $ECHO_C" >&6
3469 test -z "$cf_list_models" && cf_list_models=normal
3470 echo "$as_me:3470: result: $cf_list_models" >&5
3471 echo "${ECHO_T}$cf_list_models" >&6
3472
3473 ### Use the first model as the default, and save its suffix for use in building
3474 ### up test-applications.
3475 echo "$as_me:3475: checking for default model" >&5
3476 echo $ECHO_N "checking for default model... $ECHO_C" >&6
3477 DFT_LWR_MODEL=`echo "$cf_list_models" | $AWK '{print $1}'`
3478 echo "$as_me:3478: result: $DFT_LWR_MODEL" >&5
3479 echo "${ECHO_T}$DFT_LWR_MODEL" >&6
3480
3481 DFT_UPR_MODEL=`echo "$DFT_LWR_MODEL" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
3482
3483 echo "$as_me:3483: checking for specific curses-directory" >&5
3484 echo $ECHO_N "checking for specific curses-directory... $ECHO_C" >&6
3485
3486 # Check whether --with-curses-dir or --without-curses-dir was given.
3487 if test "${with_curses_dir+set}" = set; then
3488   withval="$with_curses_dir"
3489   cf_cv_curses_dir=$withval
3490 else
3491   cf_cv_curses_dir=no
3492 fi;
3493 echo "$as_me:3493: result: $cf_cv_curses_dir" >&5
3494 echo "${ECHO_T}$cf_cv_curses_dir" >&6
3495
3496 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
3497 then
3498
3499 if test "x$prefix" != xNONE; then
3500   cf_path_syntax="$prefix"
3501 else
3502   cf_path_syntax="$ac_default_prefix"
3503 fi
3504
3505 case ".$withval" in #(vi
3506 .\$\(*\)*|.\'*\'*) #(vi
3507   ;;
3508 ..|./*|.\\*) #(vi
3509   ;;
3510 .[a-zA-Z]:[\\/]*) #(vi OS/2 EMX
3511   ;;
3512 .\${*prefix}*|.\${*dir}*) #(vi
3513   eval withval="$withval"
3514   case ".$withval" in #(vi
3515   .NONE/*)
3516     withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
3517     ;;
3518   esac
3519   ;; #(vi
3520 .no|.NONE/*)
3521   withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
3522   ;;
3523 *)
3524   { { echo "$as_me:3524: error: expected a pathname, not \"$withval\"" >&5
3525 echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;}
3526    { (exit 1); exit 1; }; }
3527   ;;
3528 esac
3529
3530         if test -d "$cf_cv_curses_dir"
3531         then
3532
3533 if test -n "$cf_cv_curses_dir/include" ; then
3534   for cf_add_incdir in $cf_cv_curses_dir/include
3535   do
3536         while test $cf_add_incdir != /usr/include
3537         do
3538           if test -d $cf_add_incdir
3539           then
3540                 cf_have_incdir=no
3541                 if test -n "$CFLAGS$CPPFLAGS" ; then
3542                   # a loop is needed to ensure we can add subdirs of existing dirs
3543                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
3544                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
3545                           cf_have_incdir=yes; break
3546                         fi
3547                   done
3548                 fi
3549
3550                 if test "$cf_have_incdir" = no ; then
3551                   if test "$cf_add_incdir" = /usr/local/include ; then
3552                         if test "$GCC" = yes
3553                         then
3554                           cf_save_CPPFLAGS=$CPPFLAGS
3555                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
3556                           cat >conftest.$ac_ext <<_ACEOF
3557 #line 3557 "configure"
3558 #include "confdefs.h"
3559 #include <stdio.h>
3560 int
3561 main ()
3562 {
3563 printf("Hello")
3564   ;
3565   return 0;
3566 }
3567 _ACEOF
3568 rm -f conftest.$ac_objext
3569 if { (eval echo "$as_me:3569: \"$ac_compile\"") >&5
3570   (eval $ac_compile) 2>&5
3571   ac_status=$?
3572   echo "$as_me:3572: \$? = $ac_status" >&5
3573   (exit $ac_status); } &&
3574          { ac_try='test -s conftest.$ac_objext'
3575   { (eval echo "$as_me:3575: \"$ac_try\"") >&5
3576   (eval $ac_try) 2>&5
3577   ac_status=$?
3578   echo "$as_me:3578: \$? = $ac_status" >&5
3579   (exit $ac_status); }; }; then
3580   :
3581 else
3582   echo "$as_me: failed program was:" >&5
3583 cat conftest.$ac_ext >&5
3584 cf_have_incdir=yes
3585 fi
3586 rm -f conftest.$ac_objext conftest.$ac_ext
3587                           CPPFLAGS=$cf_save_CPPFLAGS
3588                         fi
3589                   fi
3590                 fi
3591
3592                 if test "$cf_have_incdir" = no ; then
3593                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
3594
3595 echo "${as_me:-configure}:3595: testing adding $cf_add_incdir to include-path ..." 1>&5
3596
3597                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
3598
3599                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
3600                   test "$cf_top_incdir" = "$cf_add_incdir" && break
3601                   cf_add_incdir="$cf_top_incdir"
3602                 else
3603                   break
3604                 fi
3605           fi
3606         done
3607   done
3608 fi
3609
3610 if test -n "$cf_cv_curses_dir/lib" ; then
3611   for cf_add_libdir in $cf_cv_curses_dir/lib
3612   do
3613     if test $cf_add_libdir = /usr/lib ; then
3614       :
3615     elif test -d $cf_add_libdir
3616     then
3617       cf_have_libdir=no
3618       if test -n "$LDFLAGS$LIBS" ; then
3619         # a loop is needed to ensure we can add subdirs of existing dirs
3620         for cf_test_libdir in $LDFLAGS $LIBS ; do
3621           if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
3622             cf_have_libdir=yes; break
3623           fi
3624         done
3625       fi
3626       if test "$cf_have_libdir" = no ; then
3627         test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
3628
3629 echo "${as_me:-configure}:3629: testing adding $cf_add_libdir to library-path ..." 1>&5
3630
3631         LDFLAGS="-L$cf_add_libdir $LDFLAGS"
3632       fi
3633     fi
3634   done
3635 fi
3636
3637         fi
3638 fi
3639
3640 echo "$as_me:3640: checking if you want wide-character code" >&5
3641 echo $ECHO_N "checking if you want wide-character code... $ECHO_C" >&6
3642
3643 # Check whether --enable-widec or --disable-widec was given.
3644 if test "${enable_widec+set}" = set; then
3645   enableval="$enable_widec"
3646   with_widec=$enableval
3647 else
3648   with_widec=no
3649 fi;
3650 echo "$as_me:3650: result: $with_widec" >&5
3651 echo "${ECHO_T}$with_widec" >&6
3652 if test "$with_widec" = yes ; then
3653
3654 echo "$as_me:3654: checking for multibyte character support" >&5
3655 echo $ECHO_N "checking for multibyte character support... $ECHO_C" >&6
3656 if test "${cf_cv_utf8_lib+set}" = set; then
3657   echo $ECHO_N "(cached) $ECHO_C" >&6
3658 else
3659
3660         cf_save_LIBS="$LIBS"
3661         cat >conftest.$ac_ext <<_ACEOF
3662 #line 3662 "configure"
3663 #include "confdefs.h"
3664
3665 #include <stdlib.h>
3666 int
3667 main ()
3668 {
3669 putwc(0,0);
3670   ;
3671   return 0;
3672 }
3673 _ACEOF
3674 rm -f conftest.$ac_objext conftest$ac_exeext
3675 if { (eval echo "$as_me:3675: \"$ac_link\"") >&5
3676   (eval $ac_link) 2>&5
3677   ac_status=$?
3678   echo "$as_me:3678: \$? = $ac_status" >&5
3679   (exit $ac_status); } &&
3680          { ac_try='test -s conftest$ac_exeext'
3681   { (eval echo "$as_me:3681: \"$ac_try\"") >&5
3682   (eval $ac_try) 2>&5
3683   ac_status=$?
3684   echo "$as_me:3684: \$? = $ac_status" >&5
3685   (exit $ac_status); }; }; then
3686   cf_cv_utf8_lib=yes
3687 else
3688   echo "$as_me: failed program was:" >&5
3689 cat conftest.$ac_ext >&5
3690
3691 # If the linkage is not already in the $CPPFLAGS/$LDFLAGS configuration, these
3692 # will be set on completion of the AC_TRY_LINK below.
3693 cf_cv_header_path_utf8=
3694 cf_cv_library_path_utf8=
3695
3696 echo "${as_me:-configure}:3696: testing Starting FIND_LINKAGE(utf8,) ..." 1>&5
3697
3698 cf_save_LIBS="$LIBS"
3699
3700 cat >conftest.$ac_ext <<_ACEOF
3701 #line 3701 "configure"
3702 #include "confdefs.h"
3703
3704 #include <libutf8.h>
3705 int
3706 main ()
3707 {
3708 putwc(0,0);
3709   ;
3710   return 0;
3711 }
3712 _ACEOF
3713 rm -f conftest.$ac_objext conftest$ac_exeext
3714 if { (eval echo "$as_me:3714: \"$ac_link\"") >&5
3715   (eval $ac_link) 2>&5
3716   ac_status=$?
3717   echo "$as_me:3717: \$? = $ac_status" >&5
3718   (exit $ac_status); } &&
3719          { ac_try='test -s conftest$ac_exeext'
3720   { (eval echo "$as_me:3720: \"$ac_try\"") >&5
3721   (eval $ac_try) 2>&5
3722   ac_status=$?
3723   echo "$as_me:3723: \$? = $ac_status" >&5
3724   (exit $ac_status); }; }; then
3725
3726         cf_cv_find_linkage_utf8=yes
3727         cf_cv_header_path_utf8=/usr/include
3728         cf_cv_library_path_utf8=/usr/lib
3729
3730 else
3731   echo "$as_me: failed program was:" >&5
3732 cat conftest.$ac_ext >&5
3733
3734 LIBS="-lutf8  $cf_save_LIBS"
3735
3736 cat >conftest.$ac_ext <<_ACEOF
3737 #line 3737 "configure"
3738 #include "confdefs.h"
3739
3740 #include <libutf8.h>
3741 int
3742 main ()
3743 {
3744 putwc(0,0);
3745   ;
3746   return 0;
3747 }
3748 _ACEOF
3749 rm -f conftest.$ac_objext conftest$ac_exeext
3750 if { (eval echo "$as_me:3750: \"$ac_link\"") >&5
3751   (eval $ac_link) 2>&5
3752   ac_status=$?
3753   echo "$as_me:3753: \$? = $ac_status" >&5
3754   (exit $ac_status); } &&
3755          { ac_try='test -s conftest$ac_exeext'
3756   { (eval echo "$as_me:3756: \"$ac_try\"") >&5
3757   (eval $ac_try) 2>&5
3758   ac_status=$?
3759   echo "$as_me:3759: \$? = $ac_status" >&5
3760   (exit $ac_status); }; }; then
3761
3762         cf_cv_find_linkage_utf8=yes
3763         cf_cv_header_path_utf8=/usr/include
3764         cf_cv_library_path_utf8=/usr/lib
3765         cf_cv_library_file_utf8="-lutf8"
3766
3767 else
3768   echo "$as_me: failed program was:" >&5
3769 cat conftest.$ac_ext >&5
3770
3771         cf_cv_find_linkage_utf8=no
3772         LIBS="$cf_save_LIBS"
3773
3774     test -n "$verbose" && echo "        find linkage for utf8 library" 1>&6
3775
3776 echo "${as_me:-configure}:3776: testing find linkage for utf8 library ..." 1>&5
3777
3778 echo "${as_me:-configure}:3778: testing Searching for headers in FIND_LINKAGE(utf8,) ..." 1>&5
3779
3780     cf_save_CPPFLAGS="$CPPFLAGS"
3781     cf_test_CPPFLAGS="$CPPFLAGS"
3782
3783 cf_search=
3784
3785 # collect the current set of include-directories from compiler flags
3786 cf_header_path_list=""
3787 if test -n "${CFLAGS}${CPPFLAGS}" ; then
3788         for cf_header_path in $CPPFLAGS $CFLAGS
3789         do
3790                 case $cf_header_path in #(vi
3791                 -I*)
3792                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
3793
3794 test "x$cf_header_path" != "xNONE" && \
3795 test -d "$cf_header_path" && \
3796  {
3797         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
3798         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
3799         test -d $cf_header_path/include/utf8 &&       cf_search="$cf_search $cf_header_path/include/utf8"
3800         test -d $cf_header_path/include/utf8/include &&    cf_search="$cf_search $cf_header_path/include/utf8/include"
3801         test -d $cf_header_path/utf8/include &&       cf_search="$cf_search $cf_header_path/utf8/include"
3802         test -d $cf_header_path/utf8/include/utf8 &&    cf_search="$cf_search $cf_header_path/utf8/include/utf8"
3803 }
3804
3805                         cf_header_path_list="$cf_header_path_list $cf_search"
3806                         ;;
3807                 esac
3808         done
3809 fi
3810
3811 # add the variations for the package we are looking for
3812
3813 cf_search=
3814
3815 test "x$prefix" != "xNONE" && \
3816 test -d "$prefix" && \
3817  {
3818         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
3819         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
3820         test -d $prefix/include/utf8 &&       cf_search="$cf_search $prefix/include/utf8"
3821         test -d $prefix/include/utf8/include &&    cf_search="$cf_search $prefix/include/utf8/include"
3822         test -d $prefix/utf8/include &&       cf_search="$cf_search $prefix/utf8/include"
3823         test -d $prefix/utf8/include/utf8 &&    cf_search="$cf_search $prefix/utf8/include/utf8"
3824 }
3825
3826 for cf_subdir_prefix in \
3827         /usr \
3828         /usr/local \
3829         /usr/pkg \
3830         /opt \
3831         /opt/local \
3832         $HOME
3833 do
3834
3835 test "x$cf_subdir_prefix" != "x$prefix" && \
3836 test -d "$cf_subdir_prefix" && \
3837 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
3838         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
3839         test -d $cf_subdir_prefix/include &&          cf_search="$cf_search $cf_subdir_prefix/include"
3840         test -d $cf_subdir_prefix/include/utf8 &&       cf_search="$cf_search $cf_subdir_prefix/include/utf8"
3841         test -d $cf_subdir_prefix/include/utf8/include &&    cf_search="$cf_search $cf_subdir_prefix/include/utf8/include"
3842         test -d $cf_subdir_prefix/utf8/include &&       cf_search="$cf_search $cf_subdir_prefix/utf8/include"
3843         test -d $cf_subdir_prefix/utf8/include/utf8 &&    cf_search="$cf_search $cf_subdir_prefix/utf8/include/utf8"
3844 }
3845
3846 done
3847
3848 test "$includedir" != NONE && \
3849 test "$includedir" != "/usr/include" && \
3850 test -d "$includedir" && {
3851         test -d $includedir &&    cf_search="$cf_search $includedir"
3852         test -d $includedir/utf8 && cf_search="$cf_search $includedir/utf8"
3853 }
3854
3855 test "$oldincludedir" != NONE && \
3856 test "$oldincludedir" != "/usr/include" && \
3857 test -d "$oldincludedir" && {
3858         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
3859         test -d $oldincludedir/utf8 && cf_search="$cf_search $oldincludedir/utf8"
3860 }
3861
3862 cf_search="$cf_search $cf_header_path_list"
3863
3864     for cf_cv_header_path_utf8 in $cf_search
3865     do
3866       if test -d $cf_cv_header_path_utf8 ; then
3867         test -n "$verbose" && echo "    ... testing $cf_cv_header_path_utf8" 1>&6
3868
3869 echo "${as_me:-configure}:3869: testing ... testing $cf_cv_header_path_utf8 ..." 1>&5
3870
3871         CPPFLAGS="$cf_save_CPPFLAGS -I$cf_cv_header_path_utf8"
3872         cat >conftest.$ac_ext <<_ACEOF
3873 #line 3873 "configure"
3874 #include "confdefs.h"
3875
3876 #include <libutf8.h>
3877 int
3878 main ()
3879 {
3880 putwc(0,0);
3881   ;
3882   return 0;
3883 }
3884 _ACEOF
3885 rm -f conftest.$ac_objext
3886 if { (eval echo "$as_me:3886: \"$ac_compile\"") >&5
3887   (eval $ac_compile) 2>&5
3888   ac_status=$?
3889   echo "$as_me:3889: \$? = $ac_status" >&5
3890   (exit $ac_status); } &&
3891          { ac_try='test -s conftest.$ac_objext'
3892   { (eval echo "$as_me:3892: \"$ac_try\"") >&5
3893   (eval $ac_try) 2>&5
3894   ac_status=$?
3895   echo "$as_me:3895: \$? = $ac_status" >&5
3896   (exit $ac_status); }; }; then
3897
3898             test -n "$verbose" && echo "        ... found utf8 headers in $cf_cv_header_path_utf8" 1>&6
3899
3900 echo "${as_me:-configure}:3900: testing ... found utf8 headers in $cf_cv_header_path_utf8 ..." 1>&5
3901
3902             cf_cv_find_linkage_utf8=maybe
3903             cf_test_CPPFLAGS="$CPPFLAGS"
3904             break
3905 else
3906   echo "$as_me: failed program was:" >&5
3907 cat conftest.$ac_ext >&5
3908
3909             CPPFLAGS="$cf_save_CPPFLAGS"
3910
3911 fi
3912 rm -f conftest.$ac_objext conftest.$ac_ext
3913       fi
3914     done
3915
3916     if test "$cf_cv_find_linkage_utf8" = maybe ; then
3917
3918 echo "${as_me:-configure}:3918: testing Searching for utf8 library in FIND_LINKAGE(utf8,) ..." 1>&5
3919
3920       cf_save_LIBS="$LIBS"
3921       cf_save_LDFLAGS="$LDFLAGS"
3922
3923       if test "$cf_cv_find_linkage_utf8" != yes ; then
3924
3925 cf_search=
3926 cf_library_path_list=""
3927 if test -n "${LDFLAGS}${LIBS}" ; then
3928         for cf_library_path in $LDFLAGS $LIBS
3929         do
3930                 case $cf_library_path in #(vi
3931                 -L*)
3932                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
3933
3934 test "x$cf_library_path" != "xNONE" && \
3935 test -d "$cf_library_path" && \
3936  {
3937         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
3938         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
3939         test -d $cf_library_path/lib/utf8 &&       cf_search="$cf_search $cf_library_path/lib/utf8"
3940         test -d $cf_library_path/lib/utf8/lib &&    cf_search="$cf_search $cf_library_path/lib/utf8/lib"
3941         test -d $cf_library_path/utf8/lib &&       cf_search="$cf_search $cf_library_path/utf8/lib"
3942         test -d $cf_library_path/utf8/lib/utf8 &&    cf_search="$cf_search $cf_library_path/utf8/lib/utf8"
3943 }
3944
3945                         cf_library_path_list="$cf_library_path_list $cf_search"
3946                         ;;
3947                 esac
3948         done
3949 fi
3950
3951 cf_search=
3952
3953 test "x$prefix" != "xNONE" && \
3954 test -d "$prefix" && \
3955  {
3956         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
3957         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
3958         test -d $prefix/lib/utf8 &&       cf_search="$cf_search $prefix/lib/utf8"
3959         test -d $prefix/lib/utf8/lib &&    cf_search="$cf_search $prefix/lib/utf8/lib"
3960         test -d $prefix/utf8/lib &&       cf_search="$cf_search $prefix/utf8/lib"
3961         test -d $prefix/utf8/lib/utf8 &&    cf_search="$cf_search $prefix/utf8/lib/utf8"
3962 }
3963
3964 for cf_subdir_prefix in \
3965         /usr \
3966         /usr/local \
3967         /usr/pkg \
3968         /opt \
3969         /opt/local \
3970         $HOME
3971 do
3972
3973 test "x$cf_subdir_prefix" != "x$prefix" && \
3974 test -d "$cf_subdir_prefix" && \
3975 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
3976         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
3977         test -d $cf_subdir_prefix/lib &&          cf_search="$cf_search $cf_subdir_prefix/lib"
3978         test -d $cf_subdir_prefix/lib/utf8 &&       cf_search="$cf_search $cf_subdir_prefix/lib/utf8"
3979         test -d $cf_subdir_prefix/lib/utf8/lib &&    cf_search="$cf_search $cf_subdir_prefix/lib/utf8/lib"
3980         test -d $cf_subdir_prefix/utf8/lib &&       cf_search="$cf_search $cf_subdir_prefix/utf8/lib"
3981         test -d $cf_subdir_prefix/utf8/lib/utf8 &&    cf_search="$cf_search $cf_subdir_prefix/utf8/lib/utf8"
3982 }
3983
3984 done
3985
3986 cf_search="$cf_library_path_list $cf_search"
3987
3988         for cf_cv_library_path_utf8 in $cf_search
3989         do
3990           if test -d $cf_cv_library_path_utf8 ; then
3991             test -n "$verbose" && echo "        ... testing $cf_cv_library_path_utf8" 1>&6
3992
3993 echo "${as_me:-configure}:3993: testing ... testing $cf_cv_library_path_utf8 ..." 1>&5
3994
3995             CPPFLAGS="$cf_test_CPPFLAGS"
3996             LIBS="-lutf8  $cf_save_LIBS"
3997             LDFLAGS="$cf_save_LDFLAGS -L$cf_cv_library_path_utf8"
3998             cat >conftest.$ac_ext <<_ACEOF
3999 #line 3999 "configure"
4000 #include "confdefs.h"
4001
4002 #include <libutf8.h>
4003 int
4004 main ()
4005 {
4006 putwc(0,0);
4007   ;
4008   return 0;
4009 }
4010 _ACEOF
4011 rm -f conftest.$ac_objext conftest$ac_exeext
4012 if { (eval echo "$as_me:4012: \"$ac_link\"") >&5
4013   (eval $ac_link) 2>&5
4014   ac_status=$?
4015   echo "$as_me:4015: \$? = $ac_status" >&5
4016   (exit $ac_status); } &&
4017          { ac_try='test -s conftest$ac_exeext'
4018   { (eval echo "$as_me:4018: \"$ac_try\"") >&5
4019   (eval $ac_try) 2>&5
4020   ac_status=$?
4021   echo "$as_me:4021: \$? = $ac_status" >&5
4022   (exit $ac_status); }; }; then
4023
4024                 test -n "$verbose" && echo "    ... found utf8 library in $cf_cv_library_path_utf8" 1>&6
4025
4026 echo "${as_me:-configure}:4026: testing ... found utf8 library in $cf_cv_library_path_utf8 ..." 1>&5
4027
4028                 cf_cv_find_linkage_utf8=yes
4029                 cf_cv_library_file_utf8="-lutf8"
4030                 break
4031 else
4032   echo "$as_me: failed program was:" >&5
4033 cat conftest.$ac_ext >&5
4034
4035                 CPPFLAGS="$cf_save_CPPFLAGS"
4036                 LIBS="$cf_save_LIBS"
4037                 LDFLAGS="$cf_save_LDFLAGS"
4038
4039 fi
4040 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
4041           fi
4042         done
4043         CPPFLAGS="$cf_save_CPPFLAGS"
4044         LDFLAGS="$cf_save_LDFLAGS"
4045       fi
4046
4047     else
4048       cf_cv_find_linkage_utf8=no
4049     fi
4050
4051 fi
4052 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
4053
4054 fi
4055 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
4056
4057 LIBS="$cf_save_LIBS"
4058
4059 if test "$cf_cv_find_linkage_utf8" = yes ; then
4060 cf_cv_utf8_lib=add-on
4061 else
4062 cf_cv_utf8_lib=no
4063 fi
4064
4065 fi
4066 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
4067 fi
4068 echo "$as_me:4068: result: $cf_cv_utf8_lib" >&5
4069 echo "${ECHO_T}$cf_cv_utf8_lib" >&6
4070
4071 # HAVE_LIBUTF8_H is used by ncurses if curses.h is shared between
4072 # ncurses/ncursesw:
4073 if test "$cf_cv_utf8_lib" = "add-on" ; then
4074
4075 cat >>confdefs.h <<\EOF
4076 #define HAVE_LIBUTF8_H 1
4077 EOF
4078
4079 if test -n "$cf_cv_header_path_utf8" ; then
4080   for cf_add_incdir in $cf_cv_header_path_utf8
4081   do
4082         while test $cf_add_incdir != /usr/include
4083         do
4084           if test -d $cf_add_incdir
4085           then
4086                 cf_have_incdir=no
4087                 if test -n "$CFLAGS$CPPFLAGS" ; then
4088                   # a loop is needed to ensure we can add subdirs of existing dirs
4089                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
4090                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
4091                           cf_have_incdir=yes; break
4092                         fi
4093                   done
4094                 fi
4095
4096                 if test "$cf_have_incdir" = no ; then
4097                   if test "$cf_add_incdir" = /usr/local/include ; then
4098                         if test "$GCC" = yes
4099                         then
4100                           cf_save_CPPFLAGS=$CPPFLAGS
4101                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
4102                           cat >conftest.$ac_ext <<_ACEOF
4103 #line 4103 "configure"
4104 #include "confdefs.h"
4105 #include <stdio.h>
4106 int
4107 main ()
4108 {
4109 printf("Hello")
4110   ;
4111   return 0;
4112 }
4113 _ACEOF
4114 rm -f conftest.$ac_objext
4115 if { (eval echo "$as_me:4115: \"$ac_compile\"") >&5
4116   (eval $ac_compile) 2>&5
4117   ac_status=$?
4118   echo "$as_me:4118: \$? = $ac_status" >&5
4119   (exit $ac_status); } &&
4120          { ac_try='test -s conftest.$ac_objext'
4121   { (eval echo "$as_me:4121: \"$ac_try\"") >&5
4122   (eval $ac_try) 2>&5
4123   ac_status=$?
4124   echo "$as_me:4124: \$? = $ac_status" >&5
4125   (exit $ac_status); }; }; then
4126   :
4127 else
4128   echo "$as_me: failed program was:" >&5
4129 cat conftest.$ac_ext >&5
4130 cf_have_incdir=yes
4131 fi
4132 rm -f conftest.$ac_objext conftest.$ac_ext
4133                           CPPFLAGS=$cf_save_CPPFLAGS
4134                         fi
4135                   fi
4136                 fi
4137
4138                 if test "$cf_have_incdir" = no ; then
4139                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
4140
4141 echo "${as_me:-configure}:4141: testing adding $cf_add_incdir to include-path ..." 1>&5
4142
4143                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
4144
4145                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
4146                   test "$cf_top_incdir" = "$cf_add_incdir" && break
4147                   cf_add_incdir="$cf_top_incdir"
4148                 else
4149                   break
4150                 fi
4151           fi
4152         done
4153   done
4154 fi
4155
4156 if test -n "$cf_cv_library_path_utf8" ; then
4157   for cf_add_libdir in $cf_cv_library_path_utf8
4158   do
4159     if test $cf_add_libdir = /usr/lib ; then
4160       :
4161     elif test -d $cf_add_libdir
4162     then
4163       cf_have_libdir=no
4164       if test -n "$LDFLAGS$LIBS" ; then
4165         # a loop is needed to ensure we can add subdirs of existing dirs
4166         for cf_test_libdir in $LDFLAGS $LIBS ; do
4167           if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
4168             cf_have_libdir=yes; break
4169           fi
4170         done
4171       fi
4172       if test "$cf_have_libdir" = no ; then
4173         test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
4174
4175 echo "${as_me:-configure}:4175: testing adding $cf_add_libdir to library-path ..." 1>&5
4176
4177         LDFLAGS="-L$cf_add_libdir $LDFLAGS"
4178       fi
4179     fi
4180   done
4181 fi
4182
4183 cf_add_libs="$cf_cv_library_file_utf8"
4184 # Filter out duplicates - this happens with badly-designed ".pc" files...
4185 for cf_add_1lib in $LIBS
4186 do
4187         for cf_add_2lib in $cf_add_libs
4188         do
4189                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
4190                 then
4191                         cf_add_1lib=
4192                         break
4193                 fi
4194         done
4195         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
4196 done
4197 LIBS="$cf_add_libs"
4198
4199 fi
4200
4201 cf_ncuconfig_root=ncursesw
4202
4203 echo "Looking for ${cf_ncuconfig_root}-config"
4204
4205 if test -n "$ac_tool_prefix"; then
4206   for ac_prog in ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
4207   do
4208     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
4209 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
4210 echo "$as_me:4210: checking for $ac_word" >&5
4211 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
4212 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
4213   echo $ECHO_N "(cached) $ECHO_C" >&6
4214 else
4215   if test -n "$NCURSES_CONFIG"; then
4216   ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
4217 else
4218   ac_save_IFS=$IFS; IFS=$ac_path_separator
4219 ac_dummy="$PATH"
4220 for ac_dir in $ac_dummy; do
4221   IFS=$ac_save_IFS
4222   test -z "$ac_dir" && ac_dir=.
4223   $as_executable_p "$ac_dir/$ac_word" || continue
4224 ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
4225 echo "$as_me:4225: found $ac_dir/$ac_word" >&5
4226 break
4227 done
4228
4229 fi
4230 fi
4231 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
4232 if test -n "$NCURSES_CONFIG"; then
4233   echo "$as_me:4233: result: $NCURSES_CONFIG" >&5
4234 echo "${ECHO_T}$NCURSES_CONFIG" >&6
4235 else
4236   echo "$as_me:4236: result: no" >&5
4237 echo "${ECHO_T}no" >&6
4238 fi
4239
4240     test -n "$NCURSES_CONFIG" && break
4241   done
4242 fi
4243 if test -z "$NCURSES_CONFIG"; then
4244   ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
4245   for ac_prog in ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
4246 do
4247   # Extract the first word of "$ac_prog", so it can be a program name with args.
4248 set dummy $ac_prog; ac_word=$2
4249 echo "$as_me:4249: checking for $ac_word" >&5
4250 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
4251 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
4252   echo $ECHO_N "(cached) $ECHO_C" >&6
4253 else
4254   if test -n "$ac_ct_NCURSES_CONFIG"; then
4255   ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
4256 else
4257   ac_save_IFS=$IFS; IFS=$ac_path_separator
4258 ac_dummy="$PATH"
4259 for ac_dir in $ac_dummy; do
4260   IFS=$ac_save_IFS
4261   test -z "$ac_dir" && ac_dir=.
4262   $as_executable_p "$ac_dir/$ac_word" || continue
4263 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
4264 echo "$as_me:4264: found $ac_dir/$ac_word" >&5
4265 break
4266 done
4267
4268 fi
4269 fi
4270 ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
4271 if test -n "$ac_ct_NCURSES_CONFIG"; then
4272   echo "$as_me:4272: result: $ac_ct_NCURSES_CONFIG" >&5
4273 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
4274 else
4275   echo "$as_me:4275: result: no" >&5
4276 echo "${ECHO_T}no" >&6
4277 fi
4278
4279   test -n "$ac_ct_NCURSES_CONFIG" && break
4280 done
4281 test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
4282
4283   NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
4284 fi
4285
4286 if test "$NCURSES_CONFIG" != none ; then
4287
4288 CPPFLAGS="$CPPFLAGS `$NCURSES_CONFIG --cflags`"
4289
4290 cf_add_libs="`$NCURSES_CONFIG --libs`"
4291 # Filter out duplicates - this happens with badly-designed ".pc" files...
4292 for cf_add_1lib in $LIBS
4293 do
4294         for cf_add_2lib in $cf_add_libs
4295         do
4296                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
4297                 then
4298                         cf_add_1lib=
4299                         break
4300                 fi
4301         done
4302         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
4303 done
4304 LIBS="$cf_add_libs"
4305
4306 # even with config script, some packages use no-override for curses.h
4307
4308 echo "$as_me:4308: checking if we have identified curses headers" >&5
4309 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
4310 if test "${cf_cv_ncurses_header+set}" = set; then
4311   echo $ECHO_N "(cached) $ECHO_C" >&6
4312 else
4313
4314 cf_cv_ncurses_header=none
4315 for cf_header in  \
4316     ncursesw/ncurses.h \
4317         ncursesw/curses.h \
4318         ncurses.h \
4319         curses.h
4320 do
4321 cat >conftest.$ac_ext <<_ACEOF
4322 #line 4322 "configure"
4323 #include "confdefs.h"
4324 #include <${cf_header}>
4325 int
4326 main ()
4327 {
4328 initscr(); tgoto("?", 0,0)
4329   ;
4330   return 0;
4331 }
4332 _ACEOF
4333 rm -f conftest.$ac_objext
4334 if { (eval echo "$as_me:4334: \"$ac_compile\"") >&5
4335   (eval $ac_compile) 2>&5
4336   ac_status=$?
4337   echo "$as_me:4337: \$? = $ac_status" >&5
4338   (exit $ac_status); } &&
4339          { ac_try='test -s conftest.$ac_objext'
4340   { (eval echo "$as_me:4340: \"$ac_try\"") >&5
4341   (eval $ac_try) 2>&5
4342   ac_status=$?
4343   echo "$as_me:4343: \$? = $ac_status" >&5
4344   (exit $ac_status); }; }; then
4345   cf_cv_ncurses_header=$cf_header; break
4346 else
4347   echo "$as_me: failed program was:" >&5
4348 cat conftest.$ac_ext >&5
4349 fi
4350 rm -f conftest.$ac_objext conftest.$ac_ext
4351 done
4352
4353 fi
4354 echo "$as_me:4354: result: $cf_cv_ncurses_header" >&5
4355 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
4356
4357 if test "$cf_cv_ncurses_header" = none ; then
4358         { { echo "$as_me:4358: error: No curses header-files found" >&5
4359 echo "$as_me: error: No curses header-files found" >&2;}
4360    { (exit 1); exit 1; }; }
4361 fi
4362
4363 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
4364
4365 for ac_header in $cf_cv_ncurses_header
4366 do
4367 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
4368 echo "$as_me:4368: checking for $ac_header" >&5
4369 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
4370 if eval "test \"\${$as_ac_Header+set}\" = set"; then
4371   echo $ECHO_N "(cached) $ECHO_C" >&6
4372 else
4373   cat >conftest.$ac_ext <<_ACEOF
4374 #line 4374 "configure"
4375 #include "confdefs.h"
4376 #include <$ac_header>
4377 _ACEOF
4378 if { (eval echo "$as_me:4378: \"$ac_cpp conftest.$ac_ext\"") >&5
4379   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
4380   ac_status=$?
4381   egrep -v '^ *\+' conftest.er1 >conftest.err
4382   rm -f conftest.er1
4383   cat conftest.err >&5
4384   echo "$as_me:4384: \$? = $ac_status" >&5
4385   (exit $ac_status); } >/dev/null; then
4386   if test -s conftest.err; then
4387     ac_cpp_err=$ac_c_preproc_warn_flag
4388   else
4389     ac_cpp_err=
4390   fi
4391 else
4392   ac_cpp_err=yes
4393 fi
4394 if test -z "$ac_cpp_err"; then
4395   eval "$as_ac_Header=yes"
4396 else
4397   echo "$as_me: failed program was:" >&5
4398   cat conftest.$ac_ext >&5
4399   eval "$as_ac_Header=no"
4400 fi
4401 rm -f conftest.err conftest.$ac_ext
4402 fi
4403 echo "$as_me:4403: result: `eval echo '${'$as_ac_Header'}'`" >&5
4404 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
4405 if test `eval echo '${'$as_ac_Header'}'` = yes; then
4406   cat >>confdefs.h <<EOF
4407 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
4408 EOF
4409
4410 fi
4411 done
4412
4413 cat >>confdefs.h <<\EOF
4414 #define NCURSES 1
4415 EOF
4416
4417 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
4418
4419 cat >>confdefs.h <<EOF
4420 #define $cf_nculib_ROOT 1
4421 EOF
4422
4423 cf_cv_ncurses_version=`$NCURSES_CONFIG --version`
4424
4425 else
4426
4427 cf_ncuhdr_root=ncursesw
4428
4429 test -n "$cf_cv_curses_dir" && \
4430 test "$cf_cv_curses_dir" != "no" && { \
4431
4432 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
4433   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
4434   do
4435         while test $cf_add_incdir != /usr/include
4436         do
4437           if test -d $cf_add_incdir
4438           then
4439                 cf_have_incdir=no
4440                 if test -n "$CFLAGS$CPPFLAGS" ; then
4441                   # a loop is needed to ensure we can add subdirs of existing dirs
4442                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
4443                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
4444                           cf_have_incdir=yes; break
4445                         fi
4446                   done
4447                 fi
4448
4449                 if test "$cf_have_incdir" = no ; then
4450                   if test "$cf_add_incdir" = /usr/local/include ; then
4451                         if test "$GCC" = yes
4452                         then
4453                           cf_save_CPPFLAGS=$CPPFLAGS
4454                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
4455                           cat >conftest.$ac_ext <<_ACEOF
4456 #line 4456 "configure"
4457 #include "confdefs.h"
4458 #include <stdio.h>
4459 int
4460 main ()
4461 {
4462 printf("Hello")
4463   ;
4464   return 0;
4465 }
4466 _ACEOF
4467 rm -f conftest.$ac_objext
4468 if { (eval echo "$as_me:4468: \"$ac_compile\"") >&5
4469   (eval $ac_compile) 2>&5
4470   ac_status=$?
4471   echo "$as_me:4471: \$? = $ac_status" >&5
4472   (exit $ac_status); } &&
4473          { ac_try='test -s conftest.$ac_objext'
4474   { (eval echo "$as_me:4474: \"$ac_try\"") >&5
4475   (eval $ac_try) 2>&5
4476   ac_status=$?
4477   echo "$as_me:4477: \$? = $ac_status" >&5
4478   (exit $ac_status); }; }; then
4479   :
4480 else
4481   echo "$as_me: failed program was:" >&5
4482 cat conftest.$ac_ext >&5
4483 cf_have_incdir=yes
4484 fi
4485 rm -f conftest.$ac_objext conftest.$ac_ext
4486                           CPPFLAGS=$cf_save_CPPFLAGS
4487                         fi
4488                   fi
4489                 fi
4490
4491                 if test "$cf_have_incdir" = no ; then
4492                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
4493
4494 echo "${as_me:-configure}:4494: testing adding $cf_add_incdir to include-path ..." 1>&5
4495
4496                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
4497
4498                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
4499                   test "$cf_top_incdir" = "$cf_add_incdir" && break
4500                   cf_add_incdir="$cf_top_incdir"
4501                 else
4502                   break
4503                 fi
4504           fi
4505         done
4506   done
4507 fi
4508
4509 }
4510
4511 echo "$as_me:4511: checking for $cf_ncuhdr_root header in include-path" >&5
4512 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
4513 if test "${cf_cv_ncurses_h+set}" = set; then
4514   echo $ECHO_N "(cached) $ECHO_C" >&6
4515 else
4516
4517         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
4518         ( test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw ) && cf_header_list="$cf_header_list curses.h ncurses.h"
4519         for cf_header in $cf_header_list
4520         do
4521
4522         cat >conftest.$ac_ext <<_ACEOF
4523 #line 4523 "configure"
4524 #include "confdefs.h"
4525
4526 #define _XOPEN_SOURCE_EXTENDED
4527 #undef  HAVE_LIBUTF8_H  /* in case we used CF_UTF8_LIB */
4528 #define HAVE_LIBUTF8_H  /* to force ncurses' header file to use cchar_t */
4529
4530 #include <$cf_header>
4531 int
4532 main ()
4533 {
4534
4535 #ifdef NCURSES_VERSION
4536
4537 #ifndef WACS_BSSB
4538         make an error
4539 #endif
4540
4541 printf("%s\n", NCURSES_VERSION);
4542 #else
4543 #ifdef __NCURSES_H
4544 printf("old\n");
4545 #else
4546         make an error
4547 #endif
4548 #endif
4549
4550   ;
4551   return 0;
4552 }
4553 _ACEOF
4554 rm -f conftest.$ac_objext
4555 if { (eval echo "$as_me:4555: \"$ac_compile\"") >&5
4556   (eval $ac_compile) 2>&5
4557   ac_status=$?
4558   echo "$as_me:4558: \$? = $ac_status" >&5
4559   (exit $ac_status); } &&
4560          { ac_try='test -s conftest.$ac_objext'
4561   { (eval echo "$as_me:4561: \"$ac_try\"") >&5
4562   (eval $ac_try) 2>&5
4563   ac_status=$?
4564   echo "$as_me:4564: \$? = $ac_status" >&5
4565   (exit $ac_status); }; }; then
4566   cf_cv_ncurses_h=$cf_header
4567
4568 else
4569   echo "$as_me: failed program was:" >&5
4570 cat conftest.$ac_ext >&5
4571 cf_cv_ncurses_h=no
4572 fi
4573 rm -f conftest.$ac_objext conftest.$ac_ext
4574
4575                 test "$cf_cv_ncurses_h" != no && break
4576         done
4577
4578 fi
4579 echo "$as_me:4579: result: $cf_cv_ncurses_h" >&5
4580 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
4581
4582 if test "$cf_cv_ncurses_h" != no ; then
4583         cf_cv_ncurses_header=$cf_cv_ncurses_h
4584 else
4585
4586 echo "$as_me:4586: checking for $cf_ncuhdr_root include-path" >&5
4587 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
4588 if test "${cf_cv_ncurses_h2+set}" = set; then
4589   echo $ECHO_N "(cached) $ECHO_C" >&6
4590 else
4591
4592         test -n "$verbose" && echo
4593
4594 cf_search=
4595
4596 # collect the current set of include-directories from compiler flags
4597 cf_header_path_list=""
4598 if test -n "${CFLAGS}${CPPFLAGS}" ; then
4599         for cf_header_path in $CPPFLAGS $CFLAGS
4600         do
4601                 case $cf_header_path in #(vi
4602                 -I*)
4603                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
4604
4605 test "x$cf_header_path" != "xNONE" && \
4606 test -d "$cf_header_path" && \
4607  {
4608         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
4609         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
4610         test -d $cf_header_path/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
4611         test -d $cf_header_path/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
4612         test -d $cf_header_path/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
4613         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"
4614 }
4615
4616                         cf_header_path_list="$cf_header_path_list $cf_search"
4617                         ;;
4618                 esac
4619         done
4620 fi
4621
4622 # add the variations for the package we are looking for
4623
4624 cf_search=
4625
4626 test "x$prefix" != "xNONE" && \
4627 test -d "$prefix" && \
4628  {
4629         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
4630         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
4631         test -d $prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
4632         test -d $prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
4633         test -d $prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
4634         test -d $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
4635 }
4636
4637 for cf_subdir_prefix in \
4638         /usr \
4639         /usr/local \
4640         /usr/pkg \
4641         /opt \
4642         /opt/local \
4643         $HOME
4644 do
4645
4646 test "x$cf_subdir_prefix" != "x$prefix" && \
4647 test -d "$cf_subdir_prefix" && \
4648 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
4649         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
4650         test -d $cf_subdir_prefix/include &&          cf_search="$cf_search $cf_subdir_prefix/include"
4651         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root"
4652         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root/include"
4653         test -d $cf_subdir_prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include"
4654         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"
4655 }
4656
4657 done
4658
4659 test "$includedir" != NONE && \
4660 test "$includedir" != "/usr/include" && \
4661 test -d "$includedir" && {
4662         test -d $includedir &&    cf_search="$cf_search $includedir"
4663         test -d $includedir/$cf_ncuhdr_root && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
4664 }
4665
4666 test "$oldincludedir" != NONE && \
4667 test "$oldincludedir" != "/usr/include" && \
4668 test -d "$oldincludedir" && {
4669         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
4670         test -d $oldincludedir/$cf_ncuhdr_root && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
4671 }
4672
4673 cf_search="$cf_search $cf_header_path_list"
4674
4675         test -n "$verbose" && echo search path $cf_search
4676         cf_save2_CPPFLAGS="$CPPFLAGS"
4677         for cf_incdir in $cf_search
4678         do
4679
4680 if test -n "$cf_incdir" ; then
4681   for cf_add_incdir in $cf_incdir
4682   do
4683         while test $cf_add_incdir != /usr/include
4684         do
4685           if test -d $cf_add_incdir
4686           then
4687                 cf_have_incdir=no
4688                 if test -n "$CFLAGS$CPPFLAGS" ; then
4689                   # a loop is needed to ensure we can add subdirs of existing dirs
4690                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
4691                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
4692                           cf_have_incdir=yes; break
4693                         fi
4694                   done
4695                 fi
4696
4697                 if test "$cf_have_incdir" = no ; then
4698                   if test "$cf_add_incdir" = /usr/local/include ; then
4699                         if test "$GCC" = yes
4700                         then
4701                           cf_save_CPPFLAGS=$CPPFLAGS
4702                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
4703                           cat >conftest.$ac_ext <<_ACEOF
4704 #line 4704 "configure"
4705 #include "confdefs.h"
4706 #include <stdio.h>
4707 int
4708 main ()
4709 {
4710 printf("Hello")
4711   ;
4712   return 0;
4713 }
4714 _ACEOF
4715 rm -f conftest.$ac_objext
4716 if { (eval echo "$as_me:4716: \"$ac_compile\"") >&5
4717   (eval $ac_compile) 2>&5
4718   ac_status=$?
4719   echo "$as_me:4719: \$? = $ac_status" >&5
4720   (exit $ac_status); } &&
4721          { ac_try='test -s conftest.$ac_objext'
4722   { (eval echo "$as_me:4722: \"$ac_try\"") >&5
4723   (eval $ac_try) 2>&5
4724   ac_status=$?
4725   echo "$as_me:4725: \$? = $ac_status" >&5
4726   (exit $ac_status); }; }; then
4727   :
4728 else
4729   echo "$as_me: failed program was:" >&5
4730 cat conftest.$ac_ext >&5
4731 cf_have_incdir=yes
4732 fi
4733 rm -f conftest.$ac_objext conftest.$ac_ext
4734                           CPPFLAGS=$cf_save_CPPFLAGS
4735                         fi
4736                   fi
4737                 fi
4738
4739                 if test "$cf_have_incdir" = no ; then
4740                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
4741
4742 echo "${as_me:-configure}:4742: testing adding $cf_add_incdir to include-path ..." 1>&5
4743
4744                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
4745
4746                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
4747                   test "$cf_top_incdir" = "$cf_add_incdir" && break
4748                   cf_add_incdir="$cf_top_incdir"
4749                 else
4750                   break
4751                 fi
4752           fi
4753         done
4754   done
4755 fi
4756
4757                 for cf_header in \
4758                         ncurses.h \
4759                         curses.h
4760                 do
4761
4762         cat >conftest.$ac_ext <<_ACEOF
4763 #line 4763 "configure"
4764 #include "confdefs.h"
4765
4766 #include <$cf_header>
4767 int
4768 main ()
4769 {
4770
4771 #ifdef NCURSES_VERSION
4772
4773 printf("%s\n", NCURSES_VERSION);
4774 #else
4775 #ifdef __NCURSES_H
4776 printf("old\n");
4777 #else
4778         make an error
4779 #endif
4780 #endif
4781
4782   ;
4783   return 0;
4784 }
4785 _ACEOF
4786 rm -f conftest.$ac_objext
4787 if { (eval echo "$as_me:4787: \"$ac_compile\"") >&5
4788   (eval $ac_compile) 2>&5
4789   ac_status=$?
4790   echo "$as_me:4790: \$? = $ac_status" >&5
4791   (exit $ac_status); } &&
4792          { ac_try='test -s conftest.$ac_objext'
4793   { (eval echo "$as_me:4793: \"$ac_try\"") >&5
4794   (eval $ac_try) 2>&5
4795   ac_status=$?
4796   echo "$as_me:4796: \$? = $ac_status" >&5
4797   (exit $ac_status); }; }; then
4798   cf_cv_ncurses_h2=$cf_header
4799
4800 else
4801   echo "$as_me: failed program was:" >&5
4802 cat conftest.$ac_ext >&5
4803 cf_cv_ncurses_h2=no
4804 fi
4805 rm -f conftest.$ac_objext conftest.$ac_ext
4806
4807                         if test "$cf_cv_ncurses_h2" != no ; then
4808                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
4809                                 test -n "$verbose" && echo $ac_n "      ... found $ac_c" 1>&6
4810                                 break
4811                         fi
4812                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
4813                 done
4814                 CPPFLAGS="$cf_save2_CPPFLAGS"
4815                 test "$cf_cv_ncurses_h2" != no && break
4816         done
4817         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:4817: error: not found" >&5
4818 echo "$as_me: error: not found" >&2;}
4819    { (exit 1); exit 1; }; }
4820
4821 fi
4822 echo "$as_me:4822: result: $cf_cv_ncurses_h2" >&5
4823 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
4824
4825         cf_1st_incdir=`echo $cf_cv_ncurses_h2 | sed -e 's%/[^/]*$%%'`
4826         cf_cv_ncurses_header=`basename $cf_cv_ncurses_h2`
4827         if test `basename $cf_1st_incdir` = $cf_ncuhdr_root ; then
4828                 cf_cv_ncurses_header=$cf_ncuhdr_root/$cf_cv_ncurses_header
4829         fi
4830
4831 if test -n "$cf_1st_incdir" ; then
4832   for cf_add_incdir in $cf_1st_incdir
4833   do
4834         while test $cf_add_incdir != /usr/include
4835         do
4836           if test -d $cf_add_incdir
4837           then
4838                 cf_have_incdir=no
4839                 if test -n "$CFLAGS$CPPFLAGS" ; then
4840                   # a loop is needed to ensure we can add subdirs of existing dirs
4841                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
4842                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
4843                           cf_have_incdir=yes; break
4844                         fi
4845                   done
4846                 fi
4847
4848                 if test "$cf_have_incdir" = no ; then
4849                   if test "$cf_add_incdir" = /usr/local/include ; then
4850                         if test "$GCC" = yes
4851                         then
4852                           cf_save_CPPFLAGS=$CPPFLAGS
4853                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
4854                           cat >conftest.$ac_ext <<_ACEOF
4855 #line 4855 "configure"
4856 #include "confdefs.h"
4857 #include <stdio.h>
4858 int
4859 main ()
4860 {
4861 printf("Hello")
4862   ;
4863   return 0;
4864 }
4865 _ACEOF
4866 rm -f conftest.$ac_objext
4867 if { (eval echo "$as_me:4867: \"$ac_compile\"") >&5
4868   (eval $ac_compile) 2>&5
4869   ac_status=$?
4870   echo "$as_me:4870: \$? = $ac_status" >&5
4871   (exit $ac_status); } &&
4872          { ac_try='test -s conftest.$ac_objext'
4873   { (eval echo "$as_me:4873: \"$ac_try\"") >&5
4874   (eval $ac_try) 2>&5
4875   ac_status=$?
4876   echo "$as_me:4876: \$? = $ac_status" >&5
4877   (exit $ac_status); }; }; then
4878   :
4879 else
4880   echo "$as_me: failed program was:" >&5
4881 cat conftest.$ac_ext >&5
4882 cf_have_incdir=yes
4883 fi
4884 rm -f conftest.$ac_objext conftest.$ac_ext
4885                           CPPFLAGS=$cf_save_CPPFLAGS
4886                         fi
4887                   fi
4888                 fi
4889
4890                 if test "$cf_have_incdir" = no ; then
4891                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
4892
4893 echo "${as_me:-configure}:4893: testing adding $cf_add_incdir to include-path ..." 1>&5
4894
4895                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
4896
4897                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
4898                   test "$cf_top_incdir" = "$cf_add_incdir" && break
4899                   cf_add_incdir="$cf_top_incdir"
4900                 else
4901                   break
4902                 fi
4903           fi
4904         done
4905   done
4906 fi
4907
4908 fi
4909
4910 # Set definitions to allow ifdef'ing for ncurses.h
4911
4912 case $cf_cv_ncurses_header in # (vi
4913 *ncurses.h)
4914
4915 cat >>confdefs.h <<\EOF
4916 #define HAVE_NCURSES_H 1
4917 EOF
4918
4919         ;;
4920 esac
4921
4922 case $cf_cv_ncurses_header in # (vi
4923 ncurses/curses.h|ncurses/ncurses.h)
4924
4925 cat >>confdefs.h <<\EOF
4926 #define HAVE_NCURSES_NCURSES_H 1
4927 EOF
4928
4929         ;;
4930 ncursesw/curses.h|ncursesw/ncurses.h)
4931
4932 cat >>confdefs.h <<\EOF
4933 #define HAVE_NCURSESW_NCURSES_H 1
4934 EOF
4935
4936         ;;
4937 esac
4938
4939 echo "$as_me:4939: checking for terminfo header" >&5
4940 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
4941 if test "${cf_cv_term_header+set}" = set; then
4942   echo $ECHO_N "(cached) $ECHO_C" >&6
4943 else
4944
4945 case ${cf_cv_ncurses_header} in #(vi
4946 */ncurses.h|*/ncursesw.h) #(vi
4947         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
4948         ;;
4949 *)
4950         cf_term_header=term.h
4951         ;;
4952 esac
4953
4954 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
4955 do
4956 cat >conftest.$ac_ext <<_ACEOF
4957 #line 4957 "configure"
4958 #include "confdefs.h"
4959 #include <stdio.h>
4960 #include <${cf_cv_ncurses_header:-curses.h}>
4961 #include <$cf_test>
4962
4963 int
4964 main ()
4965 {
4966 int x = auto_left_margin
4967   ;
4968   return 0;
4969 }
4970 _ACEOF
4971 rm -f conftest.$ac_objext
4972 if { (eval echo "$as_me:4972: \"$ac_compile\"") >&5
4973   (eval $ac_compile) 2>&5
4974   ac_status=$?
4975   echo "$as_me:4975: \$? = $ac_status" >&5
4976   (exit $ac_status); } &&
4977          { ac_try='test -s conftest.$ac_objext'
4978   { (eval echo "$as_me:4978: \"$ac_try\"") >&5
4979   (eval $ac_try) 2>&5
4980   ac_status=$?
4981   echo "$as_me:4981: \$? = $ac_status" >&5
4982   (exit $ac_status); }; }; then
4983
4984         cf_cv_term_header="$cf_test"
4985 else
4986   echo "$as_me: failed program was:" >&5
4987 cat conftest.$ac_ext >&5
4988
4989         cf_cv_term_header=unknown
4990
4991 fi
4992 rm -f conftest.$ac_objext conftest.$ac_ext
4993         test "$cf_cv_term_header" != unknown && break
4994 done
4995
4996 fi
4997 echo "$as_me:4997: result: $cf_cv_term_header" >&5
4998 echo "${ECHO_T}$cf_cv_term_header" >&6
4999
5000 # Set definitions to allow ifdef'ing to accommodate subdirectories
5001
5002 case $cf_cv_term_header in # (vi
5003 *term.h)
5004
5005 cat >>confdefs.h <<\EOF
5006 #define HAVE_TERM_H 1
5007 EOF
5008
5009         ;;
5010 esac
5011
5012 case $cf_cv_term_header in # (vi
5013 ncurses/term.h) #(vi
5014
5015 cat >>confdefs.h <<\EOF
5016 #define HAVE_NCURSES_TERM_H 1
5017 EOF
5018
5019         ;;
5020 ncursesw/term.h)
5021
5022 cat >>confdefs.h <<\EOF
5023 #define HAVE_NCURSESW_TERM_H 1
5024 EOF
5025
5026         ;;
5027 esac
5028
5029 # some applications need this, but should check for NCURSES_VERSION
5030
5031 cat >>confdefs.h <<\EOF
5032 #define NCURSES 1
5033 EOF
5034
5035 echo "$as_me:5035: checking for ncurses version" >&5
5036 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
5037 if test "${cf_cv_ncurses_version+set}" = set; then
5038   echo $ECHO_N "(cached) $ECHO_C" >&6
5039 else
5040
5041         cf_cv_ncurses_version=no
5042         cf_tempfile=out$$
5043         rm -f $cf_tempfile
5044         if test "$cross_compiling" = yes; then
5045
5046         # This will not work if the preprocessor splits the line after the
5047         # Autoconf token.  The 'unproto' program does that.
5048         cat > conftest.$ac_ext <<EOF
5049 #include <${cf_cv_ncurses_header:-curses.h}>
5050 #undef Autoconf
5051 #ifdef NCURSES_VERSION
5052 Autoconf NCURSES_VERSION
5053 #else
5054 #ifdef __NCURSES_H
5055 Autoconf "old"
5056 #endif
5057 ;
5058 #endif
5059 EOF
5060         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
5061         { (eval echo "$as_me:5061: \"$cf_try\"") >&5
5062   (eval $cf_try) 2>&5
5063   ac_status=$?
5064   echo "$as_me:5064: \$? = $ac_status" >&5
5065   (exit $ac_status); }
5066         if test -f conftest.out ; then
5067                 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
5068                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
5069                 rm -f conftest.out
5070         fi
5071
5072 else
5073   cat >conftest.$ac_ext <<_ACEOF
5074 #line 5074 "configure"
5075 #include "confdefs.h"
5076
5077 #include <${cf_cv_ncurses_header:-curses.h}>
5078 #include <stdio.h>
5079 int main()
5080 {
5081         FILE *fp = fopen("$cf_tempfile", "w");
5082 #ifdef NCURSES_VERSION
5083 # ifdef NCURSES_VERSION_PATCH
5084         fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
5085 # else
5086         fprintf(fp, "%s\n", NCURSES_VERSION);
5087 # endif
5088 #else
5089 # ifdef __NCURSES_H
5090         fprintf(fp, "old\n");
5091 # else
5092         make an error
5093 # endif
5094 #endif
5095         ${cf_cv_main_return:-return}(0);
5096 }
5097 _ACEOF
5098 rm -f conftest$ac_exeext
5099 if { (eval echo "$as_me:5099: \"$ac_link\"") >&5
5100   (eval $ac_link) 2>&5
5101   ac_status=$?
5102   echo "$as_me:5102: \$? = $ac_status" >&5
5103   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
5104   { (eval echo "$as_me:5104: \"$ac_try\"") >&5
5105   (eval $ac_try) 2>&5
5106   ac_status=$?
5107   echo "$as_me:5107: \$? = $ac_status" >&5
5108   (exit $ac_status); }; }; then
5109
5110         cf_cv_ncurses_version=`cat $cf_tempfile`
5111 else
5112   echo "$as_me: program exited with status $ac_status" >&5
5113 echo "$as_me: failed program was:" >&5
5114 cat conftest.$ac_ext >&5
5115 fi
5116 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
5117 fi
5118         rm -f $cf_tempfile
5119
5120 fi
5121 echo "$as_me:5121: result: $cf_cv_ncurses_version" >&5
5122 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
5123 test "$cf_cv_ncurses_version" = no ||
5124 cat >>confdefs.h <<\EOF
5125 #define NCURSES 1
5126 EOF
5127
5128 cf_nculib_root=ncursesw
5129         # This works, except for the special case where we find gpm, but
5130         # ncurses is in a nonstandard location via $LIBS, and we really want
5131         # to link gpm.
5132 cf_ncurses_LIBS=""
5133 cf_ncurses_SAVE="$LIBS"
5134 echo "$as_me:5134: checking for Gpm_Open in -lgpm" >&5
5135 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
5136 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
5137   echo $ECHO_N "(cached) $ECHO_C" >&6
5138 else
5139   ac_check_lib_save_LIBS=$LIBS
5140 LIBS="-lgpm  $LIBS"
5141 cat >conftest.$ac_ext <<_ACEOF
5142 #line 5142 "configure"
5143 #include "confdefs.h"
5144
5145 /* Override any gcc2 internal prototype to avoid an error.  */
5146 #ifdef __cplusplus
5147 extern "C"
5148 #endif
5149 /* We use char because int might match the return type of a gcc2
5150    builtin and then its argument prototype would still apply.  */
5151 char Gpm_Open ();
5152 int
5153 main ()
5154 {
5155 Gpm_Open ();
5156   ;
5157   return 0;
5158 }
5159 _ACEOF
5160 rm -f conftest.$ac_objext conftest$ac_exeext
5161 if { (eval echo "$as_me:5161: \"$ac_link\"") >&5
5162   (eval $ac_link) 2>&5
5163   ac_status=$?
5164   echo "$as_me:5164: \$? = $ac_status" >&5
5165   (exit $ac_status); } &&
5166          { ac_try='test -s conftest$ac_exeext'
5167   { (eval echo "$as_me:5167: \"$ac_try\"") >&5
5168   (eval $ac_try) 2>&5
5169   ac_status=$?
5170   echo "$as_me:5170: \$? = $ac_status" >&5
5171   (exit $ac_status); }; }; then
5172   ac_cv_lib_gpm_Gpm_Open=yes
5173 else
5174   echo "$as_me: failed program was:" >&5
5175 cat conftest.$ac_ext >&5
5176 ac_cv_lib_gpm_Gpm_Open=no
5177 fi
5178 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5179 LIBS=$ac_check_lib_save_LIBS
5180 fi
5181 echo "$as_me:5181: result: $ac_cv_lib_gpm_Gpm_Open" >&5
5182 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
5183 if test $ac_cv_lib_gpm_Gpm_Open = yes; then
5184   echo "$as_me:5184: checking for initscr in -lgpm" >&5
5185 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
5186 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
5187   echo $ECHO_N "(cached) $ECHO_C" >&6
5188 else
5189   ac_check_lib_save_LIBS=$LIBS
5190 LIBS="-lgpm  $LIBS"
5191 cat >conftest.$ac_ext <<_ACEOF
5192 #line 5192 "configure"
5193 #include "confdefs.h"
5194
5195 /* Override any gcc2 internal prototype to avoid an error.  */
5196 #ifdef __cplusplus
5197 extern "C"
5198 #endif
5199 /* We use char because int might match the return type of a gcc2
5200    builtin and then its argument prototype would still apply.  */
5201 char initscr ();
5202 int
5203 main ()
5204 {
5205 initscr ();
5206   ;
5207   return 0;
5208 }
5209 _ACEOF
5210 rm -f conftest.$ac_objext conftest$ac_exeext
5211 if { (eval echo "$as_me:5211: \"$ac_link\"") >&5
5212   (eval $ac_link) 2>&5
5213   ac_status=$?
5214   echo "$as_me:5214: \$? = $ac_status" >&5
5215   (exit $ac_status); } &&
5216          { ac_try='test -s conftest$ac_exeext'
5217   { (eval echo "$as_me:5217: \"$ac_try\"") >&5
5218   (eval $ac_try) 2>&5
5219   ac_status=$?
5220   echo "$as_me:5220: \$? = $ac_status" >&5
5221   (exit $ac_status); }; }; then
5222   ac_cv_lib_gpm_initscr=yes
5223 else
5224   echo "$as_me: failed program was:" >&5
5225 cat conftest.$ac_ext >&5
5226 ac_cv_lib_gpm_initscr=no
5227 fi
5228 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5229 LIBS=$ac_check_lib_save_LIBS
5230 fi
5231 echo "$as_me:5231: result: $ac_cv_lib_gpm_initscr" >&5
5232 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
5233 if test $ac_cv_lib_gpm_initscr = yes; then
5234   LIBS="$cf_ncurses_SAVE"
5235 else
5236   cf_ncurses_LIBS="-lgpm"
5237 fi
5238
5239 fi
5240
5241 case $host_os in #(vi
5242 freebsd*)
5243         # This is only necessary if you are linking against an obsolete
5244         # version of ncurses (but it should do no harm, since it's static).
5245         if test "$cf_nculib_root" = ncurses ; then
5246                 echo "$as_me:5246: checking for tgoto in -lmytinfo" >&5
5247 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
5248 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
5249   echo $ECHO_N "(cached) $ECHO_C" >&6
5250 else
5251   ac_check_lib_save_LIBS=$LIBS
5252 LIBS="-lmytinfo  $LIBS"
5253 cat >conftest.$ac_ext <<_ACEOF
5254 #line 5254 "configure"
5255 #include "confdefs.h"
5256
5257 /* Override any gcc2 internal prototype to avoid an error.  */
5258 #ifdef __cplusplus
5259 extern "C"
5260 #endif
5261 /* We use char because int might match the return type of a gcc2
5262    builtin and then its argument prototype would still apply.  */
5263 char tgoto ();
5264 int
5265 main ()
5266 {
5267 tgoto ();
5268   ;
5269   return 0;
5270 }
5271 _ACEOF
5272 rm -f conftest.$ac_objext conftest$ac_exeext
5273 if { (eval echo "$as_me:5273: \"$ac_link\"") >&5
5274   (eval $ac_link) 2>&5
5275   ac_status=$?
5276   echo "$as_me:5276: \$? = $ac_status" >&5
5277   (exit $ac_status); } &&
5278          { ac_try='test -s conftest$ac_exeext'
5279   { (eval echo "$as_me:5279: \"$ac_try\"") >&5
5280   (eval $ac_try) 2>&5
5281   ac_status=$?
5282   echo "$as_me:5282: \$? = $ac_status" >&5
5283   (exit $ac_status); }; }; then
5284   ac_cv_lib_mytinfo_tgoto=yes
5285 else
5286   echo "$as_me: failed program was:" >&5
5287 cat conftest.$ac_ext >&5
5288 ac_cv_lib_mytinfo_tgoto=no
5289 fi
5290 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5291 LIBS=$ac_check_lib_save_LIBS
5292 fi
5293 echo "$as_me:5293: result: $ac_cv_lib_mytinfo_tgoto" >&5
5294 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
5295 if test $ac_cv_lib_mytinfo_tgoto = yes; then
5296   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
5297 fi
5298
5299         fi
5300         ;;
5301 esac
5302
5303 cf_add_libs="$cf_ncurses_LIBS"
5304 # Filter out duplicates - this happens with badly-designed ".pc" files...
5305 for cf_add_1lib in $LIBS
5306 do
5307         for cf_add_2lib in $cf_add_libs
5308         do
5309                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
5310                 then
5311                         cf_add_1lib=
5312                         break
5313                 fi
5314         done
5315         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
5316 done
5317 LIBS="$cf_add_libs"
5318
5319 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
5320 then
5321
5322 cf_add_libs="-l$cf_nculib_root"
5323 # Filter out duplicates - this happens with badly-designed ".pc" files...
5324 for cf_add_1lib in $LIBS
5325 do
5326         for cf_add_2lib in $cf_add_libs
5327         do
5328                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
5329                 then
5330                         cf_add_1lib=
5331                         break
5332                 fi
5333         done
5334         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
5335 done
5336 LIBS="$cf_add_libs"
5337
5338 else
5339
5340         eval 'cf_cv_have_lib_'$cf_nculib_root'=no'
5341         cf_libdir=""
5342         echo "$as_me:5342: checking for initscr" >&5
5343 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
5344 if test "${ac_cv_func_initscr+set}" = set; then
5345   echo $ECHO_N "(cached) $ECHO_C" >&6
5346 else
5347   cat >conftest.$ac_ext <<_ACEOF
5348 #line 5348 "configure"
5349 #include "confdefs.h"
5350 /* System header to define __stub macros and hopefully few prototypes,
5351     which can conflict with char initscr (); below.  */
5352 #include <assert.h>
5353 /* Override any gcc2 internal prototype to avoid an error.  */
5354 #ifdef __cplusplus
5355 extern "C"
5356 #endif
5357 /* We use char because int might match the return type of a gcc2
5358    builtin and then its argument prototype would still apply.  */
5359 char initscr ();
5360 char (*f) ();
5361
5362 int
5363 main ()
5364 {
5365 /* The GNU C library defines this for functions which it implements
5366     to always fail with ENOSYS.  Some functions are actually named
5367     something starting with __ and the normal name is an alias.  */
5368 #if defined (__stub_initscr) || defined (__stub___initscr)
5369 choke me
5370 #else
5371 f = initscr; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
5372 #endif
5373
5374   ;
5375   return 0;
5376 }
5377 _ACEOF
5378 rm -f conftest.$ac_objext conftest$ac_exeext
5379 if { (eval echo "$as_me:5379: \"$ac_link\"") >&5
5380   (eval $ac_link) 2>&5
5381   ac_status=$?
5382   echo "$as_me:5382: \$? = $ac_status" >&5
5383   (exit $ac_status); } &&
5384          { ac_try='test -s conftest$ac_exeext'
5385   { (eval echo "$as_me:5385: \"$ac_try\"") >&5
5386   (eval $ac_try) 2>&5
5387   ac_status=$?
5388   echo "$as_me:5388: \$? = $ac_status" >&5
5389   (exit $ac_status); }; }; then
5390   ac_cv_func_initscr=yes
5391 else
5392   echo "$as_me: failed program was:" >&5
5393 cat conftest.$ac_ext >&5
5394 ac_cv_func_initscr=no
5395 fi
5396 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5397 fi
5398 echo "$as_me:5398: result: $ac_cv_func_initscr" >&5
5399 echo "${ECHO_T}$ac_cv_func_initscr" >&6
5400 if test $ac_cv_func_initscr = yes; then
5401   eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
5402 else
5403
5404                 cf_save_LIBS="$LIBS"
5405                 echo "$as_me:5405: checking for initscr in -l$cf_nculib_root" >&5
5406 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
5407                 LIBS="-l$cf_nculib_root $LIBS"
5408                 cat >conftest.$ac_ext <<_ACEOF
5409 #line 5409 "configure"
5410 #include "confdefs.h"
5411 #include <${cf_cv_ncurses_header:-curses.h}>
5412 int
5413 main ()
5414 {
5415 initscr()
5416   ;
5417   return 0;
5418 }
5419 _ACEOF
5420 rm -f conftest.$ac_objext conftest$ac_exeext
5421 if { (eval echo "$as_me:5421: \"$ac_link\"") >&5
5422   (eval $ac_link) 2>&5
5423   ac_status=$?
5424   echo "$as_me:5424: \$? = $ac_status" >&5
5425   (exit $ac_status); } &&
5426          { ac_try='test -s conftest$ac_exeext'
5427   { (eval echo "$as_me:5427: \"$ac_try\"") >&5
5428   (eval $ac_try) 2>&5
5429   ac_status=$?
5430   echo "$as_me:5430: \$? = $ac_status" >&5
5431   (exit $ac_status); }; }; then
5432   echo "$as_me:5432: result: yes" >&5
5433 echo "${ECHO_T}yes" >&6
5434                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
5435
5436 else
5437   echo "$as_me: failed program was:" >&5
5438 cat conftest.$ac_ext >&5
5439 echo "$as_me:5439: result: no" >&5
5440 echo "${ECHO_T}no" >&6
5441
5442 cf_search=
5443 cf_library_path_list=""
5444 if test -n "${LDFLAGS}${LIBS}" ; then
5445         for cf_library_path in $LDFLAGS $LIBS
5446         do
5447                 case $cf_library_path in #(vi
5448                 -L*)
5449                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
5450
5451 test "x$cf_library_path" != "xNONE" && \
5452 test -d "$cf_library_path" && \
5453  {
5454         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
5455         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
5456         test -d $cf_library_path/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
5457         test -d $cf_library_path/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
5458         test -d $cf_library_path/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
5459         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"
5460 }
5461
5462                         cf_library_path_list="$cf_library_path_list $cf_search"
5463                         ;;
5464                 esac
5465         done
5466 fi
5467
5468 cf_search=
5469
5470 test "x$prefix" != "xNONE" && \
5471 test -d "$prefix" && \
5472  {
5473         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
5474         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
5475         test -d $prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
5476         test -d $prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
5477         test -d $prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
5478         test -d $prefix/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
5479 }
5480
5481 for cf_subdir_prefix in \
5482         /usr \
5483         /usr/local \
5484         /usr/pkg \
5485         /opt \
5486         /opt/local \
5487         $HOME
5488 do
5489
5490 test "x$cf_subdir_prefix" != "x$prefix" && \
5491 test -d "$cf_subdir_prefix" && \
5492 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
5493         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
5494         test -d $cf_subdir_prefix/lib &&          cf_search="$cf_search $cf_subdir_prefix/lib"
5495         test -d $cf_subdir_prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root"
5496         test -d $cf_subdir_prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root/lib"
5497         test -d $cf_subdir_prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib"
5498         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"
5499 }
5500
5501 done
5502
5503 cf_search="$cf_library_path_list $cf_search"
5504
5505                         for cf_libdir in $cf_search
5506                         do
5507                                 echo "$as_me:5507: checking for -l$cf_nculib_root in $cf_libdir" >&5
5508 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
5509                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
5510                                 cat >conftest.$ac_ext <<_ACEOF
5511 #line 5511 "configure"
5512 #include "confdefs.h"
5513 #include <${cf_cv_ncurses_header:-curses.h}>
5514 int
5515 main ()
5516 {
5517 initscr()
5518   ;
5519   return 0;
5520 }
5521 _ACEOF
5522 rm -f conftest.$ac_objext conftest$ac_exeext
5523 if { (eval echo "$as_me:5523: \"$ac_link\"") >&5
5524   (eval $ac_link) 2>&5
5525   ac_status=$?
5526   echo "$as_me:5526: \$? = $ac_status" >&5
5527   (exit $ac_status); } &&
5528          { ac_try='test -s conftest$ac_exeext'
5529   { (eval echo "$as_me:5529: \"$ac_try\"") >&5
5530   (eval $ac_try) 2>&5
5531   ac_status=$?
5532   echo "$as_me:5532: \$? = $ac_status" >&5
5533   (exit $ac_status); }; }; then
5534   echo "$as_me:5534: result: yes" >&5
5535 echo "${ECHO_T}yes" >&6
5536                                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
5537                                          break
5538 else
5539   echo "$as_me: failed program was:" >&5
5540 cat conftest.$ac_ext >&5
5541 echo "$as_me:5541: result: no" >&5
5542 echo "${ECHO_T}no" >&6
5543                                          LIBS="$cf_save_LIBS"
5544 fi
5545 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5546                         done
5547
5548 fi
5549 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5550
5551 fi
5552
5553 eval 'cf_found_library=$cf_cv_have_lib_'$cf_nculib_root
5554
5555 if test $cf_found_library = no ; then
5556         { { echo "$as_me:5556: error: Cannot link $cf_nculib_root library" >&5
5557 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
5558    { (exit 1); exit 1; }; }
5559 fi
5560
5561 fi
5562
5563 if test -n "$cf_ncurses_LIBS" ; then
5564         echo "$as_me:5564: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
5565 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
5566         cf_ncurses_SAVE="$LIBS"
5567         for p in $cf_ncurses_LIBS ; do
5568                 q=`echo $LIBS | sed -e "s%$p %%" -e "s%$p$%%"`
5569                 if test "$q" != "$LIBS" ; then
5570                         LIBS="$q"
5571                 fi
5572         done
5573         cat >conftest.$ac_ext <<_ACEOF
5574 #line 5574 "configure"
5575 #include "confdefs.h"
5576 #include <${cf_cv_ncurses_header:-curses.h}>
5577 int
5578 main ()
5579 {
5580 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
5581   ;
5582   return 0;
5583 }
5584 _ACEOF
5585 rm -f conftest.$ac_objext conftest$ac_exeext
5586 if { (eval echo "$as_me:5586: \"$ac_link\"") >&5
5587   (eval $ac_link) 2>&5
5588   ac_status=$?
5589   echo "$as_me:5589: \$? = $ac_status" >&5
5590   (exit $ac_status); } &&
5591          { ac_try='test -s conftest$ac_exeext'
5592   { (eval echo "$as_me:5592: \"$ac_try\"") >&5
5593   (eval $ac_try) 2>&5
5594   ac_status=$?
5595   echo "$as_me:5595: \$? = $ac_status" >&5
5596   (exit $ac_status); }; }; then
5597   echo "$as_me:5597: result: yes" >&5
5598 echo "${ECHO_T}yes" >&6
5599 else
5600   echo "$as_me: failed program was:" >&5
5601 cat conftest.$ac_ext >&5
5602 echo "$as_me:5602: result: no" >&5
5603 echo "${ECHO_T}no" >&6
5604                  LIBS="$cf_ncurses_SAVE"
5605 fi
5606 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5607 fi
5608
5609 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
5610
5611 cat >>confdefs.h <<EOF
5612 #define $cf_nculib_ROOT 1
5613 EOF
5614
5615 fi
5616
5617 else
5618
5619 cf_ncuconfig_root=ncurses
5620
5621 echo "Looking for ${cf_ncuconfig_root}-config"
5622
5623 if test -n "$ac_tool_prefix"; then
5624   for ac_prog in ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
5625   do
5626     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
5627 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
5628 echo "$as_me:5628: checking for $ac_word" >&5
5629 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
5630 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
5631   echo $ECHO_N "(cached) $ECHO_C" >&6
5632 else
5633   if test -n "$NCURSES_CONFIG"; then
5634   ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
5635 else
5636   ac_save_IFS=$IFS; IFS=$ac_path_separator
5637 ac_dummy="$PATH"
5638 for ac_dir in $ac_dummy; do
5639   IFS=$ac_save_IFS
5640   test -z "$ac_dir" && ac_dir=.
5641   $as_executable_p "$ac_dir/$ac_word" || continue
5642 ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
5643 echo "$as_me:5643: found $ac_dir/$ac_word" >&5
5644 break
5645 done
5646
5647 fi
5648 fi
5649 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
5650 if test -n "$NCURSES_CONFIG"; then
5651   echo "$as_me:5651: result: $NCURSES_CONFIG" >&5
5652 echo "${ECHO_T}$NCURSES_CONFIG" >&6
5653 else
5654   echo "$as_me:5654: result: no" >&5
5655 echo "${ECHO_T}no" >&6
5656 fi
5657
5658     test -n "$NCURSES_CONFIG" && break
5659   done
5660 fi
5661 if test -z "$NCURSES_CONFIG"; then
5662   ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
5663   for ac_prog in ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
5664 do
5665   # Extract the first word of "$ac_prog", so it can be a program name with args.
5666 set dummy $ac_prog; ac_word=$2
5667 echo "$as_me:5667: checking for $ac_word" >&5
5668 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
5669 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
5670   echo $ECHO_N "(cached) $ECHO_C" >&6
5671 else
5672   if test -n "$ac_ct_NCURSES_CONFIG"; then
5673   ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
5674 else
5675   ac_save_IFS=$IFS; IFS=$ac_path_separator
5676 ac_dummy="$PATH"
5677 for ac_dir in $ac_dummy; do
5678   IFS=$ac_save_IFS
5679   test -z "$ac_dir" && ac_dir=.
5680   $as_executable_p "$ac_dir/$ac_word" || continue
5681 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
5682 echo "$as_me:5682: found $ac_dir/$ac_word" >&5
5683 break
5684 done
5685
5686 fi
5687 fi
5688 ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
5689 if test -n "$ac_ct_NCURSES_CONFIG"; then
5690   echo "$as_me:5690: result: $ac_ct_NCURSES_CONFIG" >&5
5691 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
5692 else
5693   echo "$as_me:5693: result: no" >&5
5694 echo "${ECHO_T}no" >&6
5695 fi
5696
5697   test -n "$ac_ct_NCURSES_CONFIG" && break
5698 done
5699 test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
5700
5701   NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
5702 fi
5703
5704 if test "$NCURSES_CONFIG" != none ; then
5705
5706 CPPFLAGS="$CPPFLAGS `$NCURSES_CONFIG --cflags`"
5707
5708 cf_add_libs="`$NCURSES_CONFIG --libs`"
5709 # Filter out duplicates - this happens with badly-designed ".pc" files...
5710 for cf_add_1lib in $LIBS
5711 do
5712         for cf_add_2lib in $cf_add_libs
5713         do
5714                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
5715                 then
5716                         cf_add_1lib=
5717                         break
5718                 fi
5719         done
5720         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
5721 done
5722 LIBS="$cf_add_libs"
5723
5724 # even with config script, some packages use no-override for curses.h
5725
5726 echo "$as_me:5726: checking if we have identified curses headers" >&5
5727 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
5728 if test "${cf_cv_ncurses_header+set}" = set; then
5729   echo $ECHO_N "(cached) $ECHO_C" >&6
5730 else
5731
5732 cf_cv_ncurses_header=none
5733 for cf_header in  \
5734     ncurses/ncurses.h \
5735         ncurses/curses.h \
5736         ncurses.h \
5737         curses.h
5738 do
5739 cat >conftest.$ac_ext <<_ACEOF
5740 #line 5740 "configure"
5741 #include "confdefs.h"
5742 #include <${cf_header}>
5743 int
5744 main ()
5745 {
5746 initscr(); tgoto("?", 0,0)
5747   ;
5748   return 0;
5749 }
5750 _ACEOF
5751 rm -f conftest.$ac_objext
5752 if { (eval echo "$as_me:5752: \"$ac_compile\"") >&5
5753   (eval $ac_compile) 2>&5
5754   ac_status=$?
5755   echo "$as_me:5755: \$? = $ac_status" >&5
5756   (exit $ac_status); } &&
5757          { ac_try='test -s conftest.$ac_objext'
5758   { (eval echo "$as_me:5758: \"$ac_try\"") >&5
5759   (eval $ac_try) 2>&5
5760   ac_status=$?
5761   echo "$as_me:5761: \$? = $ac_status" >&5
5762   (exit $ac_status); }; }; then
5763   cf_cv_ncurses_header=$cf_header; break
5764 else
5765   echo "$as_me: failed program was:" >&5
5766 cat conftest.$ac_ext >&5
5767 fi
5768 rm -f conftest.$ac_objext conftest.$ac_ext
5769 done
5770
5771 fi
5772 echo "$as_me:5772: result: $cf_cv_ncurses_header" >&5
5773 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
5774
5775 if test "$cf_cv_ncurses_header" = none ; then
5776         { { echo "$as_me:5776: error: No curses header-files found" >&5
5777 echo "$as_me: error: No curses header-files found" >&2;}
5778    { (exit 1); exit 1; }; }
5779 fi
5780
5781 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
5782
5783 for ac_header in $cf_cv_ncurses_header
5784 do
5785 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
5786 echo "$as_me:5786: checking for $ac_header" >&5
5787 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
5788 if eval "test \"\${$as_ac_Header+set}\" = set"; then
5789   echo $ECHO_N "(cached) $ECHO_C" >&6
5790 else
5791   cat >conftest.$ac_ext <<_ACEOF
5792 #line 5792 "configure"
5793 #include "confdefs.h"
5794 #include <$ac_header>
5795 _ACEOF
5796 if { (eval echo "$as_me:5796: \"$ac_cpp conftest.$ac_ext\"") >&5
5797   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
5798   ac_status=$?
5799   egrep -v '^ *\+' conftest.er1 >conftest.err
5800   rm -f conftest.er1
5801   cat conftest.err >&5
5802   echo "$as_me:5802: \$? = $ac_status" >&5
5803   (exit $ac_status); } >/dev/null; then
5804   if test -s conftest.err; then
5805     ac_cpp_err=$ac_c_preproc_warn_flag
5806   else
5807     ac_cpp_err=
5808   fi
5809 else
5810   ac_cpp_err=yes
5811 fi
5812 if test -z "$ac_cpp_err"; then
5813   eval "$as_ac_Header=yes"
5814 else
5815   echo "$as_me: failed program was:" >&5
5816   cat conftest.$ac_ext >&5
5817   eval "$as_ac_Header=no"
5818 fi
5819 rm -f conftest.err conftest.$ac_ext
5820 fi
5821 echo "$as_me:5821: result: `eval echo '${'$as_ac_Header'}'`" >&5
5822 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
5823 if test `eval echo '${'$as_ac_Header'}'` = yes; then
5824   cat >>confdefs.h <<EOF
5825 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
5826 EOF
5827
5828 fi
5829 done
5830
5831 cat >>confdefs.h <<\EOF
5832 #define NCURSES 1
5833 EOF
5834
5835 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
5836
5837 cat >>confdefs.h <<EOF
5838 #define $cf_nculib_ROOT 1
5839 EOF
5840
5841 cf_cv_ncurses_version=`$NCURSES_CONFIG --version`
5842
5843 else
5844
5845 cf_ncuhdr_root=ncurses
5846
5847 test -n "$cf_cv_curses_dir" && \
5848 test "$cf_cv_curses_dir" != "no" && { \
5849
5850 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
5851   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
5852   do
5853         while test $cf_add_incdir != /usr/include
5854         do
5855           if test -d $cf_add_incdir
5856           then
5857                 cf_have_incdir=no
5858                 if test -n "$CFLAGS$CPPFLAGS" ; then
5859                   # a loop is needed to ensure we can add subdirs of existing dirs
5860                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
5861                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
5862                           cf_have_incdir=yes; break
5863                         fi
5864                   done
5865                 fi
5866
5867                 if test "$cf_have_incdir" = no ; then
5868                   if test "$cf_add_incdir" = /usr/local/include ; then
5869                         if test "$GCC" = yes
5870                         then
5871                           cf_save_CPPFLAGS=$CPPFLAGS
5872                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
5873                           cat >conftest.$ac_ext <<_ACEOF
5874 #line 5874 "configure"
5875 #include "confdefs.h"
5876 #include <stdio.h>
5877 int
5878 main ()
5879 {
5880 printf("Hello")
5881   ;
5882   return 0;
5883 }
5884 _ACEOF
5885 rm -f conftest.$ac_objext
5886 if { (eval echo "$as_me:5886: \"$ac_compile\"") >&5
5887   (eval $ac_compile) 2>&5
5888   ac_status=$?
5889   echo "$as_me:5889: \$? = $ac_status" >&5
5890   (exit $ac_status); } &&
5891          { ac_try='test -s conftest.$ac_objext'
5892   { (eval echo "$as_me:5892: \"$ac_try\"") >&5
5893   (eval $ac_try) 2>&5
5894   ac_status=$?
5895   echo "$as_me:5895: \$? = $ac_status" >&5
5896   (exit $ac_status); }; }; then
5897   :
5898 else
5899   echo "$as_me: failed program was:" >&5
5900 cat conftest.$ac_ext >&5
5901 cf_have_incdir=yes
5902 fi
5903 rm -f conftest.$ac_objext conftest.$ac_ext
5904                           CPPFLAGS=$cf_save_CPPFLAGS
5905                         fi
5906                   fi
5907                 fi
5908
5909                 if test "$cf_have_incdir" = no ; then
5910                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
5911
5912 echo "${as_me:-configure}:5912: testing adding $cf_add_incdir to include-path ..." 1>&5
5913
5914                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
5915
5916                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
5917                   test "$cf_top_incdir" = "$cf_add_incdir" && break
5918                   cf_add_incdir="$cf_top_incdir"
5919                 else
5920                   break
5921                 fi
5922           fi
5923         done
5924   done
5925 fi
5926
5927 }
5928
5929 echo "$as_me:5929: checking for $cf_ncuhdr_root header in include-path" >&5
5930 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
5931 if test "${cf_cv_ncurses_h+set}" = set; then
5932   echo $ECHO_N "(cached) $ECHO_C" >&6
5933 else
5934
5935         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
5936         ( test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw ) && cf_header_list="$cf_header_list curses.h ncurses.h"
5937         for cf_header in $cf_header_list
5938         do
5939
5940         cat >conftest.$ac_ext <<_ACEOF
5941 #line 5941 "configure"
5942 #include "confdefs.h"
5943
5944 #include <$cf_header>
5945 int
5946 main ()
5947 {
5948
5949 #ifdef NCURSES_VERSION
5950
5951 printf("%s\n", NCURSES_VERSION);
5952 #else
5953 #ifdef __NCURSES_H
5954 printf("old\n");
5955 #else
5956         make an error
5957 #endif
5958 #endif
5959
5960   ;
5961   return 0;
5962 }
5963 _ACEOF
5964 rm -f conftest.$ac_objext
5965 if { (eval echo "$as_me:5965: \"$ac_compile\"") >&5
5966   (eval $ac_compile) 2>&5
5967   ac_status=$?
5968   echo "$as_me:5968: \$? = $ac_status" >&5
5969   (exit $ac_status); } &&
5970          { ac_try='test -s conftest.$ac_objext'
5971   { (eval echo "$as_me:5971: \"$ac_try\"") >&5
5972   (eval $ac_try) 2>&5
5973   ac_status=$?
5974   echo "$as_me:5974: \$? = $ac_status" >&5
5975   (exit $ac_status); }; }; then
5976   cf_cv_ncurses_h=$cf_header
5977
5978 else
5979   echo "$as_me: failed program was:" >&5
5980 cat conftest.$ac_ext >&5
5981 cf_cv_ncurses_h=no
5982 fi
5983 rm -f conftest.$ac_objext conftest.$ac_ext
5984
5985                 test "$cf_cv_ncurses_h" != no && break
5986         done
5987
5988 fi
5989 echo "$as_me:5989: result: $cf_cv_ncurses_h" >&5
5990 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
5991
5992 if test "$cf_cv_ncurses_h" != no ; then
5993         cf_cv_ncurses_header=$cf_cv_ncurses_h
5994 else
5995
5996 echo "$as_me:5996: checking for $cf_ncuhdr_root include-path" >&5
5997 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
5998 if test "${cf_cv_ncurses_h2+set}" = set; then
5999   echo $ECHO_N "(cached) $ECHO_C" >&6
6000 else
6001
6002         test -n "$verbose" && echo
6003
6004 cf_search=
6005
6006 # collect the current set of include-directories from compiler flags
6007 cf_header_path_list=""
6008 if test -n "${CFLAGS}${CPPFLAGS}" ; then
6009         for cf_header_path in $CPPFLAGS $CFLAGS
6010         do
6011                 case $cf_header_path in #(vi
6012                 -I*)
6013                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
6014
6015 test "x$cf_header_path" != "xNONE" && \
6016 test -d "$cf_header_path" && \
6017  {
6018         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
6019         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
6020         test -d $cf_header_path/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
6021         test -d $cf_header_path/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
6022         test -d $cf_header_path/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
6023         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"
6024 }
6025
6026                         cf_header_path_list="$cf_header_path_list $cf_search"
6027                         ;;
6028                 esac
6029         done
6030 fi
6031
6032 # add the variations for the package we are looking for
6033
6034 cf_search=
6035
6036 test "x$prefix" != "xNONE" && \
6037 test -d "$prefix" && \
6038  {
6039         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
6040         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
6041         test -d $prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
6042         test -d $prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
6043         test -d $prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
6044         test -d $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
6045 }
6046
6047 for cf_subdir_prefix in \
6048         /usr \
6049         /usr/local \
6050         /usr/pkg \
6051         /opt \
6052         /opt/local \
6053         $HOME
6054 do
6055
6056 test "x$cf_subdir_prefix" != "x$prefix" && \
6057 test -d "$cf_subdir_prefix" && \
6058 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
6059         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
6060         test -d $cf_subdir_prefix/include &&          cf_search="$cf_search $cf_subdir_prefix/include"
6061         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root"
6062         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root/include"
6063         test -d $cf_subdir_prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include"
6064         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"
6065 }
6066
6067 done
6068
6069 test "$includedir" != NONE && \
6070 test "$includedir" != "/usr/include" && \
6071 test -d "$includedir" && {
6072         test -d $includedir &&    cf_search="$cf_search $includedir"
6073         test -d $includedir/$cf_ncuhdr_root && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
6074 }
6075
6076 test "$oldincludedir" != NONE && \
6077 test "$oldincludedir" != "/usr/include" && \
6078 test -d "$oldincludedir" && {
6079         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
6080         test -d $oldincludedir/$cf_ncuhdr_root && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
6081 }
6082
6083 cf_search="$cf_search $cf_header_path_list"
6084
6085         test -n "$verbose" && echo search path $cf_search
6086         cf_save2_CPPFLAGS="$CPPFLAGS"
6087         for cf_incdir in $cf_search
6088         do
6089
6090 if test -n "$cf_incdir" ; then
6091   for cf_add_incdir in $cf_incdir
6092   do
6093         while test $cf_add_incdir != /usr/include
6094         do
6095           if test -d $cf_add_incdir
6096           then
6097                 cf_have_incdir=no
6098                 if test -n "$CFLAGS$CPPFLAGS" ; then
6099                   # a loop is needed to ensure we can add subdirs of existing dirs
6100                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
6101                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
6102                           cf_have_incdir=yes; break
6103                         fi
6104                   done
6105                 fi
6106
6107                 if test "$cf_have_incdir" = no ; then
6108                   if test "$cf_add_incdir" = /usr/local/include ; then
6109                         if test "$GCC" = yes
6110                         then
6111                           cf_save_CPPFLAGS=$CPPFLAGS
6112                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6113                           cat >conftest.$ac_ext <<_ACEOF
6114 #line 6114 "configure"
6115 #include "confdefs.h"
6116 #include <stdio.h>
6117 int
6118 main ()
6119 {
6120 printf("Hello")
6121   ;
6122   return 0;
6123 }
6124 _ACEOF
6125 rm -f conftest.$ac_objext
6126 if { (eval echo "$as_me:6126: \"$ac_compile\"") >&5
6127   (eval $ac_compile) 2>&5
6128   ac_status=$?
6129   echo "$as_me:6129: \$? = $ac_status" >&5
6130   (exit $ac_status); } &&
6131          { ac_try='test -s conftest.$ac_objext'
6132   { (eval echo "$as_me:6132: \"$ac_try\"") >&5
6133   (eval $ac_try) 2>&5
6134   ac_status=$?
6135   echo "$as_me:6135: \$? = $ac_status" >&5
6136   (exit $ac_status); }; }; then
6137   :
6138 else
6139   echo "$as_me: failed program was:" >&5
6140 cat conftest.$ac_ext >&5
6141 cf_have_incdir=yes
6142 fi
6143 rm -f conftest.$ac_objext conftest.$ac_ext
6144                           CPPFLAGS=$cf_save_CPPFLAGS
6145                         fi
6146                   fi
6147                 fi
6148
6149                 if test "$cf_have_incdir" = no ; then
6150                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
6151
6152 echo "${as_me:-configure}:6152: testing adding $cf_add_incdir to include-path ..." 1>&5
6153
6154                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6155
6156                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
6157                   test "$cf_top_incdir" = "$cf_add_incdir" && break
6158                   cf_add_incdir="$cf_top_incdir"
6159                 else
6160                   break
6161                 fi
6162           fi
6163         done
6164   done
6165 fi
6166
6167                 for cf_header in \
6168                         ncurses.h \
6169                         curses.h
6170                 do
6171
6172         cat >conftest.$ac_ext <<_ACEOF
6173 #line 6173 "configure"
6174 #include "confdefs.h"
6175
6176 #include <$cf_header>
6177 int
6178 main ()
6179 {
6180
6181 #ifdef NCURSES_VERSION
6182
6183 printf("%s\n", NCURSES_VERSION);
6184 #else
6185 #ifdef __NCURSES_H
6186 printf("old\n");
6187 #else
6188         make an error
6189 #endif
6190 #endif
6191
6192   ;
6193   return 0;
6194 }
6195 _ACEOF
6196 rm -f conftest.$ac_objext
6197 if { (eval echo "$as_me:6197: \"$ac_compile\"") >&5
6198   (eval $ac_compile) 2>&5
6199   ac_status=$?
6200   echo "$as_me:6200: \$? = $ac_status" >&5
6201   (exit $ac_status); } &&
6202          { ac_try='test -s conftest.$ac_objext'
6203   { (eval echo "$as_me:6203: \"$ac_try\"") >&5
6204   (eval $ac_try) 2>&5
6205   ac_status=$?
6206   echo "$as_me:6206: \$? = $ac_status" >&5
6207   (exit $ac_status); }; }; then
6208   cf_cv_ncurses_h2=$cf_header
6209
6210 else
6211   echo "$as_me: failed program was:" >&5
6212 cat conftest.$ac_ext >&5
6213 cf_cv_ncurses_h2=no
6214 fi
6215 rm -f conftest.$ac_objext conftest.$ac_ext
6216
6217                         if test "$cf_cv_ncurses_h2" != no ; then
6218                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
6219                                 test -n "$verbose" && echo $ac_n "      ... found $ac_c" 1>&6
6220                                 break
6221                         fi
6222                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
6223                 done
6224                 CPPFLAGS="$cf_save2_CPPFLAGS"
6225                 test "$cf_cv_ncurses_h2" != no && break
6226         done
6227         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:6227: error: not found" >&5
6228 echo "$as_me: error: not found" >&2;}
6229    { (exit 1); exit 1; }; }
6230
6231 fi
6232 echo "$as_me:6232: result: $cf_cv_ncurses_h2" >&5
6233 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
6234
6235         cf_1st_incdir=`echo $cf_cv_ncurses_h2 | sed -e 's%/[^/]*$%%'`
6236         cf_cv_ncurses_header=`basename $cf_cv_ncurses_h2`
6237         if test `basename $cf_1st_incdir` = $cf_ncuhdr_root ; then
6238                 cf_cv_ncurses_header=$cf_ncuhdr_root/$cf_cv_ncurses_header
6239         fi
6240
6241 if test -n "$cf_1st_incdir" ; then
6242   for cf_add_incdir in $cf_1st_incdir
6243   do
6244         while test $cf_add_incdir != /usr/include
6245         do
6246           if test -d $cf_add_incdir
6247           then
6248                 cf_have_incdir=no
6249                 if test -n "$CFLAGS$CPPFLAGS" ; then
6250                   # a loop is needed to ensure we can add subdirs of existing dirs
6251                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
6252                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
6253                           cf_have_incdir=yes; break
6254                         fi
6255                   done
6256                 fi
6257
6258                 if test "$cf_have_incdir" = no ; then
6259                   if test "$cf_add_incdir" = /usr/local/include ; then
6260                         if test "$GCC" = yes
6261                         then
6262                           cf_save_CPPFLAGS=$CPPFLAGS
6263                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6264                           cat >conftest.$ac_ext <<_ACEOF
6265 #line 6265 "configure"
6266 #include "confdefs.h"
6267 #include <stdio.h>
6268 int
6269 main ()
6270 {
6271 printf("Hello")
6272   ;
6273   return 0;
6274 }
6275 _ACEOF
6276 rm -f conftest.$ac_objext
6277 if { (eval echo "$as_me:6277: \"$ac_compile\"") >&5
6278   (eval $ac_compile) 2>&5
6279   ac_status=$?
6280   echo "$as_me:6280: \$? = $ac_status" >&5
6281   (exit $ac_status); } &&
6282          { ac_try='test -s conftest.$ac_objext'
6283   { (eval echo "$as_me:6283: \"$ac_try\"") >&5
6284   (eval $ac_try) 2>&5
6285   ac_status=$?
6286   echo "$as_me:6286: \$? = $ac_status" >&5
6287   (exit $ac_status); }; }; then
6288   :
6289 else
6290   echo "$as_me: failed program was:" >&5
6291 cat conftest.$ac_ext >&5
6292 cf_have_incdir=yes
6293 fi
6294 rm -f conftest.$ac_objext conftest.$ac_ext
6295                           CPPFLAGS=$cf_save_CPPFLAGS
6296                         fi
6297                   fi
6298                 fi
6299
6300                 if test "$cf_have_incdir" = no ; then
6301                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
6302
6303 echo "${as_me:-configure}:6303: testing adding $cf_add_incdir to include-path ..." 1>&5
6304
6305                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6306
6307                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
6308                   test "$cf_top_incdir" = "$cf_add_incdir" && break
6309                   cf_add_incdir="$cf_top_incdir"
6310                 else
6311                   break
6312                 fi
6313           fi
6314         done
6315   done
6316 fi
6317
6318 fi
6319
6320 # Set definitions to allow ifdef'ing for ncurses.h
6321
6322 case $cf_cv_ncurses_header in # (vi
6323 *ncurses.h)
6324
6325 cat >>confdefs.h <<\EOF
6326 #define HAVE_NCURSES_H 1
6327 EOF
6328
6329         ;;
6330 esac
6331
6332 case $cf_cv_ncurses_header in # (vi
6333 ncurses/curses.h|ncurses/ncurses.h)
6334
6335 cat >>confdefs.h <<\EOF
6336 #define HAVE_NCURSES_NCURSES_H 1
6337 EOF
6338
6339         ;;
6340 ncursesw/curses.h|ncursesw/ncurses.h)
6341
6342 cat >>confdefs.h <<\EOF
6343 #define HAVE_NCURSESW_NCURSES_H 1
6344 EOF
6345
6346         ;;
6347 esac
6348
6349 echo "$as_me:6349: checking for terminfo header" >&5
6350 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
6351 if test "${cf_cv_term_header+set}" = set; then
6352   echo $ECHO_N "(cached) $ECHO_C" >&6
6353 else
6354
6355 case ${cf_cv_ncurses_header} in #(vi
6356 */ncurses.h|*/ncursesw.h) #(vi
6357         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
6358         ;;
6359 *)
6360         cf_term_header=term.h
6361         ;;
6362 esac
6363
6364 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
6365 do
6366 cat >conftest.$ac_ext <<_ACEOF
6367 #line 6367 "configure"
6368 #include "confdefs.h"
6369 #include <stdio.h>
6370 #include <${cf_cv_ncurses_header:-curses.h}>
6371 #include <$cf_test>
6372
6373 int
6374 main ()
6375 {
6376 int x = auto_left_margin
6377   ;
6378   return 0;
6379 }
6380 _ACEOF
6381 rm -f conftest.$ac_objext
6382 if { (eval echo "$as_me:6382: \"$ac_compile\"") >&5
6383   (eval $ac_compile) 2>&5
6384   ac_status=$?
6385   echo "$as_me:6385: \$? = $ac_status" >&5
6386   (exit $ac_status); } &&
6387          { ac_try='test -s conftest.$ac_objext'
6388   { (eval echo "$as_me:6388: \"$ac_try\"") >&5
6389   (eval $ac_try) 2>&5
6390   ac_status=$?
6391   echo "$as_me:6391: \$? = $ac_status" >&5
6392   (exit $ac_status); }; }; then
6393
6394         cf_cv_term_header="$cf_test"
6395 else
6396   echo "$as_me: failed program was:" >&5
6397 cat conftest.$ac_ext >&5
6398
6399         cf_cv_term_header=unknown
6400
6401 fi
6402 rm -f conftest.$ac_objext conftest.$ac_ext
6403         test "$cf_cv_term_header" != unknown && break
6404 done
6405
6406 fi
6407 echo "$as_me:6407: result: $cf_cv_term_header" >&5
6408 echo "${ECHO_T}$cf_cv_term_header" >&6
6409
6410 # Set definitions to allow ifdef'ing to accommodate subdirectories
6411
6412 case $cf_cv_term_header in # (vi
6413 *term.h)
6414
6415 cat >>confdefs.h <<\EOF
6416 #define HAVE_TERM_H 1
6417 EOF
6418
6419         ;;
6420 esac
6421
6422 case $cf_cv_term_header in # (vi
6423 ncurses/term.h) #(vi
6424
6425 cat >>confdefs.h <<\EOF
6426 #define HAVE_NCURSES_TERM_H 1
6427 EOF
6428
6429         ;;
6430 ncursesw/term.h)
6431
6432 cat >>confdefs.h <<\EOF
6433 #define HAVE_NCURSESW_TERM_H 1
6434 EOF
6435
6436         ;;
6437 esac
6438
6439 # some applications need this, but should check for NCURSES_VERSION
6440
6441 cat >>confdefs.h <<\EOF
6442 #define NCURSES 1
6443 EOF
6444
6445 echo "$as_me:6445: checking for ncurses version" >&5
6446 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
6447 if test "${cf_cv_ncurses_version+set}" = set; then
6448   echo $ECHO_N "(cached) $ECHO_C" >&6
6449 else
6450
6451         cf_cv_ncurses_version=no
6452         cf_tempfile=out$$
6453         rm -f $cf_tempfile
6454         if test "$cross_compiling" = yes; then
6455
6456         # This will not work if the preprocessor splits the line after the
6457         # Autoconf token.  The 'unproto' program does that.
6458         cat > conftest.$ac_ext <<EOF
6459 #include <${cf_cv_ncurses_header:-curses.h}>
6460 #undef Autoconf
6461 #ifdef NCURSES_VERSION
6462 Autoconf NCURSES_VERSION
6463 #else
6464 #ifdef __NCURSES_H
6465 Autoconf "old"
6466 #endif
6467 ;
6468 #endif
6469 EOF
6470         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
6471         { (eval echo "$as_me:6471: \"$cf_try\"") >&5
6472   (eval $cf_try) 2>&5
6473   ac_status=$?
6474   echo "$as_me:6474: \$? = $ac_status" >&5
6475   (exit $ac_status); }
6476         if test -f conftest.out ; then
6477                 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
6478                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
6479                 rm -f conftest.out
6480         fi
6481
6482 else
6483   cat >conftest.$ac_ext <<_ACEOF
6484 #line 6484 "configure"
6485 #include "confdefs.h"
6486
6487 #include <${cf_cv_ncurses_header:-curses.h}>
6488 #include <stdio.h>
6489 int main()
6490 {
6491         FILE *fp = fopen("$cf_tempfile", "w");
6492 #ifdef NCURSES_VERSION
6493 # ifdef NCURSES_VERSION_PATCH
6494         fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
6495 # else
6496         fprintf(fp, "%s\n", NCURSES_VERSION);
6497 # endif
6498 #else
6499 # ifdef __NCURSES_H
6500         fprintf(fp, "old\n");
6501 # else
6502         make an error
6503 # endif
6504 #endif
6505         ${cf_cv_main_return:-return}(0);
6506 }
6507 _ACEOF
6508 rm -f conftest$ac_exeext
6509 if { (eval echo "$as_me:6509: \"$ac_link\"") >&5
6510   (eval $ac_link) 2>&5
6511   ac_status=$?
6512   echo "$as_me:6512: \$? = $ac_status" >&5
6513   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
6514   { (eval echo "$as_me:6514: \"$ac_try\"") >&5
6515   (eval $ac_try) 2>&5
6516   ac_status=$?
6517   echo "$as_me:6517: \$? = $ac_status" >&5
6518   (exit $ac_status); }; }; then
6519
6520         cf_cv_ncurses_version=`cat $cf_tempfile`
6521 else
6522   echo "$as_me: program exited with status $ac_status" >&5
6523 echo "$as_me: failed program was:" >&5
6524 cat conftest.$ac_ext >&5
6525 fi
6526 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
6527 fi
6528         rm -f $cf_tempfile
6529
6530 fi
6531 echo "$as_me:6531: result: $cf_cv_ncurses_version" >&5
6532 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
6533 test "$cf_cv_ncurses_version" = no ||
6534 cat >>confdefs.h <<\EOF
6535 #define NCURSES 1
6536 EOF
6537
6538 cf_nculib_root=ncurses
6539         # This works, except for the special case where we find gpm, but
6540         # ncurses is in a nonstandard location via $LIBS, and we really want
6541         # to link gpm.
6542 cf_ncurses_LIBS=""
6543 cf_ncurses_SAVE="$LIBS"
6544 echo "$as_me:6544: checking for Gpm_Open in -lgpm" >&5
6545 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
6546 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
6547   echo $ECHO_N "(cached) $ECHO_C" >&6
6548 else
6549   ac_check_lib_save_LIBS=$LIBS
6550 LIBS="-lgpm  $LIBS"
6551 cat >conftest.$ac_ext <<_ACEOF
6552 #line 6552 "configure"
6553 #include "confdefs.h"
6554
6555 /* Override any gcc2 internal prototype to avoid an error.  */
6556 #ifdef __cplusplus
6557 extern "C"
6558 #endif
6559 /* We use char because int might match the return type of a gcc2
6560    builtin and then its argument prototype would still apply.  */
6561 char Gpm_Open ();
6562 int
6563 main ()
6564 {
6565 Gpm_Open ();
6566   ;
6567   return 0;
6568 }
6569 _ACEOF
6570 rm -f conftest.$ac_objext conftest$ac_exeext
6571 if { (eval echo "$as_me:6571: \"$ac_link\"") >&5
6572   (eval $ac_link) 2>&5
6573   ac_status=$?
6574   echo "$as_me:6574: \$? = $ac_status" >&5
6575   (exit $ac_status); } &&
6576          { ac_try='test -s conftest$ac_exeext'
6577   { (eval echo "$as_me:6577: \"$ac_try\"") >&5
6578   (eval $ac_try) 2>&5
6579   ac_status=$?
6580   echo "$as_me:6580: \$? = $ac_status" >&5
6581   (exit $ac_status); }; }; then
6582   ac_cv_lib_gpm_Gpm_Open=yes
6583 else
6584   echo "$as_me: failed program was:" >&5
6585 cat conftest.$ac_ext >&5
6586 ac_cv_lib_gpm_Gpm_Open=no
6587 fi
6588 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6589 LIBS=$ac_check_lib_save_LIBS
6590 fi
6591 echo "$as_me:6591: result: $ac_cv_lib_gpm_Gpm_Open" >&5
6592 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
6593 if test $ac_cv_lib_gpm_Gpm_Open = yes; then
6594   echo "$as_me:6594: checking for initscr in -lgpm" >&5
6595 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
6596 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
6597   echo $ECHO_N "(cached) $ECHO_C" >&6
6598 else
6599   ac_check_lib_save_LIBS=$LIBS
6600 LIBS="-lgpm  $LIBS"
6601 cat >conftest.$ac_ext <<_ACEOF
6602 #line 6602 "configure"
6603 #include "confdefs.h"
6604
6605 /* Override any gcc2 internal prototype to avoid an error.  */
6606 #ifdef __cplusplus
6607 extern "C"
6608 #endif
6609 /* We use char because int might match the return type of a gcc2
6610    builtin and then its argument prototype would still apply.  */
6611 char initscr ();
6612 int
6613 main ()
6614 {
6615 initscr ();
6616   ;
6617   return 0;
6618 }
6619 _ACEOF
6620 rm -f conftest.$ac_objext conftest$ac_exeext
6621 if { (eval echo "$as_me:6621: \"$ac_link\"") >&5
6622   (eval $ac_link) 2>&5
6623   ac_status=$?
6624   echo "$as_me:6624: \$? = $ac_status" >&5
6625   (exit $ac_status); } &&
6626          { ac_try='test -s conftest$ac_exeext'
6627   { (eval echo "$as_me:6627: \"$ac_try\"") >&5
6628   (eval $ac_try) 2>&5
6629   ac_status=$?
6630   echo "$as_me:6630: \$? = $ac_status" >&5
6631   (exit $ac_status); }; }; then
6632   ac_cv_lib_gpm_initscr=yes
6633 else
6634   echo "$as_me: failed program was:" >&5
6635 cat conftest.$ac_ext >&5
6636 ac_cv_lib_gpm_initscr=no
6637 fi
6638 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6639 LIBS=$ac_check_lib_save_LIBS
6640 fi
6641 echo "$as_me:6641: result: $ac_cv_lib_gpm_initscr" >&5
6642 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
6643 if test $ac_cv_lib_gpm_initscr = yes; then
6644   LIBS="$cf_ncurses_SAVE"
6645 else
6646   cf_ncurses_LIBS="-lgpm"
6647 fi
6648
6649 fi
6650
6651 case $host_os in #(vi
6652 freebsd*)
6653         # This is only necessary if you are linking against an obsolete
6654         # version of ncurses (but it should do no harm, since it's static).
6655         if test "$cf_nculib_root" = ncurses ; then
6656                 echo "$as_me:6656: checking for tgoto in -lmytinfo" >&5
6657 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
6658 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
6659   echo $ECHO_N "(cached) $ECHO_C" >&6
6660 else
6661   ac_check_lib_save_LIBS=$LIBS
6662 LIBS="-lmytinfo  $LIBS"
6663 cat >conftest.$ac_ext <<_ACEOF
6664 #line 6664 "configure"
6665 #include "confdefs.h"
6666
6667 /* Override any gcc2 internal prototype to avoid an error.  */
6668 #ifdef __cplusplus
6669 extern "C"
6670 #endif
6671 /* We use char because int might match the return type of a gcc2
6672    builtin and then its argument prototype would still apply.  */
6673 char tgoto ();
6674 int
6675 main ()
6676 {
6677 tgoto ();
6678   ;
6679   return 0;
6680 }
6681 _ACEOF
6682 rm -f conftest.$ac_objext conftest$ac_exeext
6683 if { (eval echo "$as_me:6683: \"$ac_link\"") >&5
6684   (eval $ac_link) 2>&5
6685   ac_status=$?
6686   echo "$as_me:6686: \$? = $ac_status" >&5
6687   (exit $ac_status); } &&
6688          { ac_try='test -s conftest$ac_exeext'
6689   { (eval echo "$as_me:6689: \"$ac_try\"") >&5
6690   (eval $ac_try) 2>&5
6691   ac_status=$?
6692   echo "$as_me:6692: \$? = $ac_status" >&5
6693   (exit $ac_status); }; }; then
6694   ac_cv_lib_mytinfo_tgoto=yes
6695 else
6696   echo "$as_me: failed program was:" >&5
6697 cat conftest.$ac_ext >&5
6698 ac_cv_lib_mytinfo_tgoto=no
6699 fi
6700 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6701 LIBS=$ac_check_lib_save_LIBS
6702 fi
6703 echo "$as_me:6703: result: $ac_cv_lib_mytinfo_tgoto" >&5
6704 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
6705 if test $ac_cv_lib_mytinfo_tgoto = yes; then
6706   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
6707 fi
6708
6709         fi
6710         ;;
6711 esac
6712
6713 cf_add_libs="$cf_ncurses_LIBS"
6714 # Filter out duplicates - this happens with badly-designed ".pc" files...
6715 for cf_add_1lib in $LIBS
6716 do
6717         for cf_add_2lib in $cf_add_libs
6718         do
6719                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
6720                 then
6721                         cf_add_1lib=
6722                         break
6723                 fi
6724         done
6725         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
6726 done
6727 LIBS="$cf_add_libs"
6728
6729 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
6730 then
6731
6732 cf_add_libs="-l$cf_nculib_root"
6733 # Filter out duplicates - this happens with badly-designed ".pc" files...
6734 for cf_add_1lib in $LIBS
6735 do
6736         for cf_add_2lib in $cf_add_libs
6737         do
6738                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
6739                 then
6740                         cf_add_1lib=
6741                         break
6742                 fi
6743         done
6744         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
6745 done
6746 LIBS="$cf_add_libs"
6747
6748 else
6749
6750         eval 'cf_cv_have_lib_'$cf_nculib_root'=no'
6751         cf_libdir=""
6752         echo "$as_me:6752: checking for initscr" >&5
6753 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
6754 if test "${ac_cv_func_initscr+set}" = set; then
6755   echo $ECHO_N "(cached) $ECHO_C" >&6
6756 else
6757   cat >conftest.$ac_ext <<_ACEOF
6758 #line 6758 "configure"
6759 #include "confdefs.h"
6760 /* System header to define __stub macros and hopefully few prototypes,
6761     which can conflict with char initscr (); below.  */
6762 #include <assert.h>
6763 /* Override any gcc2 internal prototype to avoid an error.  */
6764 #ifdef __cplusplus
6765 extern "C"
6766 #endif
6767 /* We use char because int might match the return type of a gcc2
6768    builtin and then its argument prototype would still apply.  */
6769 char initscr ();
6770 char (*f) ();
6771
6772 int
6773 main ()
6774 {
6775 /* The GNU C library defines this for functions which it implements
6776     to always fail with ENOSYS.  Some functions are actually named
6777     something starting with __ and the normal name is an alias.  */
6778 #if defined (__stub_initscr) || defined (__stub___initscr)
6779 choke me
6780 #else
6781 f = initscr; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
6782 #endif
6783
6784   ;
6785   return 0;
6786 }
6787 _ACEOF
6788 rm -f conftest.$ac_objext conftest$ac_exeext
6789 if { (eval echo "$as_me:6789: \"$ac_link\"") >&5
6790   (eval $ac_link) 2>&5
6791   ac_status=$?
6792   echo "$as_me:6792: \$? = $ac_status" >&5
6793   (exit $ac_status); } &&
6794          { ac_try='test -s conftest$ac_exeext'
6795   { (eval echo "$as_me:6795: \"$ac_try\"") >&5
6796   (eval $ac_try) 2>&5
6797   ac_status=$?
6798   echo "$as_me:6798: \$? = $ac_status" >&5
6799   (exit $ac_status); }; }; then
6800   ac_cv_func_initscr=yes
6801 else
6802   echo "$as_me: failed program was:" >&5
6803 cat conftest.$ac_ext >&5
6804 ac_cv_func_initscr=no
6805 fi
6806 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6807 fi
6808 echo "$as_me:6808: result: $ac_cv_func_initscr" >&5
6809 echo "${ECHO_T}$ac_cv_func_initscr" >&6
6810 if test $ac_cv_func_initscr = yes; then
6811   eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
6812 else
6813
6814                 cf_save_LIBS="$LIBS"
6815                 echo "$as_me:6815: checking for initscr in -l$cf_nculib_root" >&5
6816 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
6817                 LIBS="-l$cf_nculib_root $LIBS"
6818                 cat >conftest.$ac_ext <<_ACEOF
6819 #line 6819 "configure"
6820 #include "confdefs.h"
6821 #include <${cf_cv_ncurses_header:-curses.h}>
6822 int
6823 main ()
6824 {
6825 initscr()
6826   ;
6827   return 0;
6828 }
6829 _ACEOF
6830 rm -f conftest.$ac_objext conftest$ac_exeext
6831 if { (eval echo "$as_me:6831: \"$ac_link\"") >&5
6832   (eval $ac_link) 2>&5
6833   ac_status=$?
6834   echo "$as_me:6834: \$? = $ac_status" >&5
6835   (exit $ac_status); } &&
6836          { ac_try='test -s conftest$ac_exeext'
6837   { (eval echo "$as_me:6837: \"$ac_try\"") >&5
6838   (eval $ac_try) 2>&5
6839   ac_status=$?
6840   echo "$as_me:6840: \$? = $ac_status" >&5
6841   (exit $ac_status); }; }; then
6842   echo "$as_me:6842: result: yes" >&5
6843 echo "${ECHO_T}yes" >&6
6844                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
6845
6846 else
6847   echo "$as_me: failed program was:" >&5
6848 cat conftest.$ac_ext >&5
6849 echo "$as_me:6849: result: no" >&5
6850 echo "${ECHO_T}no" >&6
6851
6852 cf_search=
6853 cf_library_path_list=""
6854 if test -n "${LDFLAGS}${LIBS}" ; then
6855         for cf_library_path in $LDFLAGS $LIBS
6856         do
6857                 case $cf_library_path in #(vi
6858                 -L*)
6859                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
6860
6861 test "x$cf_library_path" != "xNONE" && \
6862 test -d "$cf_library_path" && \
6863  {
6864         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
6865         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
6866         test -d $cf_library_path/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
6867         test -d $cf_library_path/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
6868         test -d $cf_library_path/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
6869         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"
6870 }
6871
6872                         cf_library_path_list="$cf_library_path_list $cf_search"
6873                         ;;
6874                 esac
6875         done
6876 fi
6877
6878 cf_search=
6879
6880 test "x$prefix" != "xNONE" && \
6881 test -d "$prefix" && \
6882  {
6883         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
6884         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
6885         test -d $prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
6886         test -d $prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
6887         test -d $prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
6888         test -d $prefix/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
6889 }
6890
6891 for cf_subdir_prefix in \
6892         /usr \
6893         /usr/local \
6894         /usr/pkg \
6895         /opt \
6896         /opt/local \
6897         $HOME
6898 do
6899
6900 test "x$cf_subdir_prefix" != "x$prefix" && \
6901 test -d "$cf_subdir_prefix" && \
6902 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
6903         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
6904         test -d $cf_subdir_prefix/lib &&          cf_search="$cf_search $cf_subdir_prefix/lib"
6905         test -d $cf_subdir_prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root"
6906         test -d $cf_subdir_prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root/lib"
6907         test -d $cf_subdir_prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib"
6908         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"
6909 }
6910
6911 done
6912
6913 cf_search="$cf_library_path_list $cf_search"
6914
6915                         for cf_libdir in $cf_search
6916                         do
6917                                 echo "$as_me:6917: checking for -l$cf_nculib_root in $cf_libdir" >&5
6918 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
6919                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
6920                                 cat >conftest.$ac_ext <<_ACEOF
6921 #line 6921 "configure"
6922 #include "confdefs.h"
6923 #include <${cf_cv_ncurses_header:-curses.h}>
6924 int
6925 main ()
6926 {
6927 initscr()
6928   ;
6929   return 0;
6930 }
6931 _ACEOF
6932 rm -f conftest.$ac_objext conftest$ac_exeext
6933 if { (eval echo "$as_me:6933: \"$ac_link\"") >&5
6934   (eval $ac_link) 2>&5
6935   ac_status=$?
6936   echo "$as_me:6936: \$? = $ac_status" >&5
6937   (exit $ac_status); } &&
6938          { ac_try='test -s conftest$ac_exeext'
6939   { (eval echo "$as_me:6939: \"$ac_try\"") >&5
6940   (eval $ac_try) 2>&5
6941   ac_status=$?
6942   echo "$as_me:6942: \$? = $ac_status" >&5
6943   (exit $ac_status); }; }; then
6944   echo "$as_me:6944: result: yes" >&5
6945 echo "${ECHO_T}yes" >&6
6946                                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
6947                                          break
6948 else
6949   echo "$as_me: failed program was:" >&5
6950 cat conftest.$ac_ext >&5
6951 echo "$as_me:6951: result: no" >&5
6952 echo "${ECHO_T}no" >&6
6953                                          LIBS="$cf_save_LIBS"
6954 fi
6955 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6956                         done
6957
6958 fi
6959 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6960
6961 fi
6962
6963 eval 'cf_found_library=$cf_cv_have_lib_'$cf_nculib_root
6964
6965 if test $cf_found_library = no ; then
6966         { { echo "$as_me:6966: error: Cannot link $cf_nculib_root library" >&5
6967 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
6968    { (exit 1); exit 1; }; }
6969 fi
6970
6971 fi
6972
6973 if test -n "$cf_ncurses_LIBS" ; then
6974         echo "$as_me:6974: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
6975 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
6976         cf_ncurses_SAVE="$LIBS"
6977         for p in $cf_ncurses_LIBS ; do
6978                 q=`echo $LIBS | sed -e "s%$p %%" -e "s%$p$%%"`
6979                 if test "$q" != "$LIBS" ; then
6980                         LIBS="$q"
6981                 fi
6982         done
6983         cat >conftest.$ac_ext <<_ACEOF
6984 #line 6984 "configure"
6985 #include "confdefs.h"
6986 #include <${cf_cv_ncurses_header:-curses.h}>
6987 int
6988 main ()
6989 {
6990 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
6991   ;
6992   return 0;
6993 }
6994 _ACEOF
6995 rm -f conftest.$ac_objext conftest$ac_exeext
6996 if { (eval echo "$as_me:6996: \"$ac_link\"") >&5
6997   (eval $ac_link) 2>&5
6998   ac_status=$?
6999   echo "$as_me:6999: \$? = $ac_status" >&5
7000   (exit $ac_status); } &&
7001          { ac_try='test -s conftest$ac_exeext'
7002   { (eval echo "$as_me:7002: \"$ac_try\"") >&5
7003   (eval $ac_try) 2>&5
7004   ac_status=$?
7005   echo "$as_me:7005: \$? = $ac_status" >&5
7006   (exit $ac_status); }; }; then
7007   echo "$as_me:7007: result: yes" >&5
7008 echo "${ECHO_T}yes" >&6
7009 else
7010   echo "$as_me: failed program was:" >&5
7011 cat conftest.$ac_ext >&5
7012 echo "$as_me:7012: result: no" >&5
7013 echo "${ECHO_T}no" >&6
7014                  LIBS="$cf_ncurses_SAVE"
7015 fi
7016 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7017 fi
7018
7019 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
7020
7021 cat >>confdefs.h <<EOF
7022 #define $cf_nculib_ROOT 1
7023 EOF
7024
7025 fi
7026
7027 fi
7028
7029 if test "$NCURSES_CONFIG" != none ; then
7030
7031 cf_version=`$NCURSES_CONFIG --version`
7032
7033 NCURSES_MAJOR=`echo "$cf_version" | sed -e 's/\..*//'`
7034 NCURSES_MINOR=`echo "$cf_version" | sed -e 's/^[0-9][0-9]*\.//' -e 's/\..*//'`
7035 NCURSES_PATCH=`echo "$cf_version" | sed -e 's/^[0-9][0-9]*\.[0-9][0-9]*\.//'`
7036
7037 # ABI version is not available from headers
7038 cf_cv_abi_version=`$NCURSES_CONFIG --abi-version`
7039
7040 else
7041
7042 for cf_name in MAJOR MINOR PATCH
7043 do
7044 cat >conftest.$ac_ext <<CF_EOF
7045 #include <${cf_cv_ncurses_header:-curses.h}>
7046 AUTOCONF_$cf_name NCURSES_VERSION_$cf_name
7047 CF_EOF
7048         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | fgrep AUTOCONF_$cf_name >conftest.out"
7049         { (eval echo "$as_me:7049: \"$cf_try\"") >&5
7050   (eval $cf_try) 2>&5
7051   ac_status=$?
7052   echo "$as_me:7052: \$? = $ac_status" >&5
7053   (exit $ac_status); }
7054         if test -f conftest.out ; then
7055                 cf_result=`cat conftest.out | sed -e "s/^.*AUTOCONF_$cf_name[   ][      ]*//"`
7056                 eval NCURSES_$cf_name=\"$cf_result\"
7057                 # cat conftest.$ac_ext
7058                 # cat conftest.out
7059         fi
7060 done
7061
7062 cf_cv_abi_version=${NCURSES_MAJOR}
7063
7064 fi
7065
7066 cf_cv_rel_version=${NCURSES_MAJOR}.${NCURSES_MINOR}
7067
7068 cf_cv_timestamp=`date`
7069
7070 echo "$as_me:7070: result: Configuring NCURSES $cf_cv_rel_version ABI $cf_cv_abi_version ($cf_cv_timestamp)" >&5
7071 echo "${ECHO_T}Configuring NCURSES $cf_cv_rel_version ABI $cf_cv_abi_version ($cf_cv_timestamp)" >&6
7072
7073 echo "$as_me:7073: checking if you want to have a library-prefix" >&5
7074 echo $ECHO_N "checking if you want to have a library-prefix... $ECHO_C" >&6
7075
7076 # Check whether --with-lib-prefix or --without-lib-prefix was given.
7077 if test "${with_lib_prefix+set}" = set; then
7078   withval="$with_lib_prefix"
7079   with_lib_prefix=$withval
7080 else
7081   with_lib_prefix=auto
7082 fi;
7083 echo "$as_me:7083: result: $with_lib_prefix" >&5
7084 echo "${ECHO_T}$with_lib_prefix" >&6
7085
7086 if test $with_lib_prefix = auto
7087 then
7088
7089         case $cf_cv_system_name in #(vi
7090         OS/2*|os2*) #(vi
7091         LIB_PREFIX=''
7092         ;;
7093         *)      LIB_PREFIX='lib'
7094         ;;
7095         esac
7096 cf_prefix=$LIB_PREFIX
7097
7098 elif test $with_lib_prefix = no
7099 then
7100         LIB_PREFIX=
7101 else
7102         LIB_PREFIX=$with_lib_prefix
7103 fi
7104
7105 LIB_SUFFIX=
7106
7107 ###############################################################################
7108
7109 if test X"$CC_G_OPT" = X"" ; then
7110         CC_G_OPT='-g'
7111         test -n "$GCC" && test "${ac_cv_prog_cc_g}" != yes && CC_G_OPT=''
7112 fi
7113
7114 echo "$as_me:7114: checking for default loader flags" >&5
7115 echo $ECHO_N "checking for default loader flags... $ECHO_C" >&6
7116 case $DFT_LWR_MODEL in
7117 normal)  LD_MODEL=''   ;;
7118 debug)   LD_MODEL=$CC_G_OPT ;;
7119 profile) LD_MODEL='-pg';;
7120 shared)  LD_MODEL=''   ;;
7121 esac
7122 echo "$as_me:7122: result: $LD_MODEL" >&5
7123 echo "${ECHO_T}$LD_MODEL" >&6
7124
7125 LD_RPATH_OPT=
7126 echo "$as_me:7126: checking for an rpath option" >&5
7127 echo $ECHO_N "checking for an rpath option... $ECHO_C" >&6
7128 case $cf_cv_system_name in #(vi
7129 irix*) #(vi
7130         if test "$GCC" = yes; then
7131                 LD_RPATH_OPT="-Wl,-rpath,"
7132         else
7133                 LD_RPATH_OPT="-rpath "
7134         fi
7135         ;;
7136 linux*|gnu*|k*bsd*-gnu) #(vi
7137         LD_RPATH_OPT="-Wl,-rpath,"
7138         ;;
7139 openbsd[2-9].*|mirbsd*) #(vi
7140         LD_RPATH_OPT="-Wl,-rpath,"
7141         ;;
7142 dragonfly*|freebsd*) #(vi
7143         LD_RPATH_OPT="-rpath "
7144         ;;
7145 netbsd*) #(vi
7146         LD_RPATH_OPT="-Wl,-rpath,"
7147         ;;
7148 osf*|mls+*) #(vi
7149         LD_RPATH_OPT="-rpath "
7150         ;;
7151 solaris2*) #(vi
7152         LD_RPATH_OPT="-R"
7153         ;;
7154 *)
7155         ;;
7156 esac
7157 echo "$as_me:7157: result: $LD_RPATH_OPT" >&5
7158 echo "${ECHO_T}$LD_RPATH_OPT" >&6
7159
7160 case "x$LD_RPATH_OPT" in #(vi
7161 x-R*)
7162         echo "$as_me:7162: checking if we need a space after rpath option" >&5
7163 echo $ECHO_N "checking if we need a space after rpath option... $ECHO_C" >&6
7164         cf_save_LIBS="$LIBS"
7165
7166 cf_add_libs="${LD_RPATH_OPT}$libdir"
7167 # Filter out duplicates - this happens with badly-designed ".pc" files...
7168 for cf_add_1lib in $LIBS
7169 do
7170         for cf_add_2lib in $cf_add_libs
7171         do
7172                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
7173                 then
7174                         cf_add_1lib=
7175                         break
7176                 fi
7177         done
7178         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
7179 done
7180 LIBS="$cf_add_libs"
7181
7182         cat >conftest.$ac_ext <<_ACEOF
7183 #line 7183 "configure"
7184 #include "confdefs.h"
7185
7186 int
7187 main ()
7188 {
7189
7190   ;
7191   return 0;
7192 }
7193 _ACEOF
7194 rm -f conftest.$ac_objext conftest$ac_exeext
7195 if { (eval echo "$as_me:7195: \"$ac_link\"") >&5
7196   (eval $ac_link) 2>&5
7197   ac_status=$?
7198   echo "$as_me:7198: \$? = $ac_status" >&5
7199   (exit $ac_status); } &&
7200          { ac_try='test -s conftest$ac_exeext'
7201   { (eval echo "$as_me:7201: \"$ac_try\"") >&5
7202   (eval $ac_try) 2>&5
7203   ac_status=$?
7204   echo "$as_me:7204: \$? = $ac_status" >&5
7205   (exit $ac_status); }; }; then
7206   cf_rpath_space=no
7207 else
7208   echo "$as_me: failed program was:" >&5
7209 cat conftest.$ac_ext >&5
7210 cf_rpath_space=yes
7211 fi
7212 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7213         LIBS="$cf_save_LIBS"
7214         echo "$as_me:7214: result: $cf_rpath_space" >&5
7215 echo "${ECHO_T}$cf_rpath_space" >&6
7216         test "$cf_rpath_space" = yes && LD_RPATH_OPT="$LD_RPATH_OPT "
7217         ;;
7218 esac
7219
7220         RM_SHARED_OPTS=
7221         LOCAL_LDFLAGS=
7222         LOCAL_LDFLAGS2=
7223         LD_SHARED_OPTS=
7224         INSTALL_LIB="-m 644"
7225         : ${rel_builddir:=.}
7226
7227         shlibdir=$libdir
7228
7229         MAKE_DLLS="#"
7230
7231         cf_cv_do_symlinks=no
7232         cf_ld_rpath_opt=
7233         test "$cf_cv_enable_rpath" = yes && cf_ld_rpath_opt="$LD_RPATH_OPT"
7234
7235         echo "$as_me:7235: checking if release/abi version should be used for shared libs" >&5
7236 echo $ECHO_N "checking if release/abi version should be used for shared libs... $ECHO_C" >&6
7237
7238 # Check whether --with-shlib-version or --without-shlib-version was given.
7239 if test "${with_shlib_version+set}" = set; then
7240   withval="$with_shlib_version"
7241   test -z "$withval" && withval=auto
7242         case $withval in #(vi
7243         yes) #(vi
7244                 cf_cv_shlib_version=auto
7245                 ;;
7246         rel|abi|auto|no) #(vi
7247                 cf_cv_shlib_version=$withval
7248                 ;;
7249         *)
7250                 { { echo "$as_me:7250: error: option value must be one of: rel, abi, auto or no" >&5
7251 echo "$as_me: error: option value must be one of: rel, abi, auto or no" >&2;}
7252    { (exit 1); exit 1; }; }
7253                 ;;
7254         esac
7255
7256 else
7257   cf_cv_shlib_version=auto
7258 fi;
7259         echo "$as_me:7259: result: $cf_cv_shlib_version" >&5
7260 echo "${ECHO_T}$cf_cv_shlib_version" >&6
7261
7262         cf_cv_rm_so_locs=no
7263         cf_try_cflags=
7264
7265         # Some less-capable ports of gcc support only -fpic
7266         CC_SHARED_OPTS=
7267         if test "$GCC" = yes
7268         then
7269                 echo "$as_me:7269: checking which $CC option to use" >&5
7270 echo $ECHO_N "checking which $CC option to use... $ECHO_C" >&6
7271                 cf_save_CFLAGS="$CFLAGS"
7272                 for CC_SHARED_OPTS in -fPIC -fpic ''
7273                 do
7274                         CFLAGS="$cf_save_CFLAGS $CC_SHARED_OPTS"
7275                         cat >conftest.$ac_ext <<_ACEOF
7276 #line 7276 "configure"
7277 #include "confdefs.h"
7278 #include <stdio.h>
7279 int
7280 main ()
7281 {
7282 int x = 1
7283   ;
7284   return 0;
7285 }
7286 _ACEOF
7287 rm -f conftest.$ac_objext
7288 if { (eval echo "$as_me:7288: \"$ac_compile\"") >&5
7289   (eval $ac_compile) 2>&5
7290   ac_status=$?
7291   echo "$as_me:7291: \$? = $ac_status" >&5
7292   (exit $ac_status); } &&
7293          { ac_try='test -s conftest.$ac_objext'
7294   { (eval echo "$as_me:7294: \"$ac_try\"") >&5
7295   (eval $ac_try) 2>&5
7296   ac_status=$?
7297   echo "$as_me:7297: \$? = $ac_status" >&5
7298   (exit $ac_status); }; }; then
7299   break
7300 else
7301   echo "$as_me: failed program was:" >&5
7302 cat conftest.$ac_ext >&5
7303 fi
7304 rm -f conftest.$ac_objext conftest.$ac_ext
7305                 done
7306                 echo "$as_me:7306: result: $CC_SHARED_OPTS" >&5
7307 echo "${ECHO_T}$CC_SHARED_OPTS" >&6
7308                 CFLAGS="$cf_save_CFLAGS"
7309         fi
7310
7311         cf_cv_shlib_version_infix=no
7312
7313         case $cf_cv_system_name in #(vi
7314         aix4.3-9*|aix[5-7]*) #(vi
7315                 if test "$GCC" = yes; then
7316                         CC_SHARED_OPTS=
7317                         MK_SHARED_LIB='${CC} -shared -Wl,-brtl -Wl,-blibpath:${RPATH_LIST}:/usr/lib -o $@'
7318                 else
7319                         # CC_SHARED_OPTS='-qpic=large -G'
7320                         # perhaps "-bM:SRE -bnoentry -bexpall"
7321                         MK_SHARED_LIB='${CC} -G -Wl,-brtl -Wl,-blibpath:${RPATH_LIST}:/usr/lib -o $@'
7322                 fi
7323                 ;;
7324         beos*) #(vi
7325                 MK_SHARED_LIB='${CC} ${CFLAGS} -o $@ -Xlinker -soname=`basename $@` -nostart -e 0'
7326                 ;;
7327         cygwin*) #(vi
7328                 CC_SHARED_OPTS=
7329                 MK_SHARED_LIB='sh '$rel_builddir'/mk_shared_lib.sh $@ ${CC} ${CFLAGS}'
7330                 RM_SHARED_OPTS="$RM_SHARED_OPTS $rel_builddir/mk_shared_lib.sh *.dll.a"
7331                 cf_cv_shlib_version=cygdll
7332                 cf_cv_shlib_version_infix=cygdll
7333                 shlibdir=$bindir
7334                 MAKE_DLLS=
7335                 cat >mk_shared_lib.sh <<-CF_EOF
7336                 #!/bin/sh
7337                 SHARED_LIB=\$1
7338                 IMPORT_LIB=\`echo "\$1" | sed -e 's/cyg/lib/' -e 's/[0-9]*\.dll$/.dll.a/'\`
7339                 shift
7340                 cat <<-EOF
7341                 Linking shared library
7342                 ** SHARED_LIB \$SHARED_LIB
7343                 ** IMPORT_LIB \$IMPORT_LIB
7344 EOF
7345                 exec \$* -shared -Wl,--out-implib=\${IMPORT_LIB} -Wl,--export-all-symbols -o \${SHARED_LIB}
7346 CF_EOF
7347                 chmod +x mk_shared_lib.sh
7348                 ;;
7349         msys*) #(vi
7350                 CC_SHARED_OPTS=
7351                 MK_SHARED_LIB='sh '$rel_builddir'/mk_shared_lib.sh $@ ${CC} ${CFLAGS}'
7352                 RM_SHARED_OPTS="$RM_SHARED_OPTS $rel_builddir/mk_shared_lib.sh *.dll.a"
7353                 cf_cv_shlib_version=msysdll
7354                 cf_cv_shlib_version_infix=msysdll
7355                 shlibdir=$bindir
7356                 MAKE_DLLS=
7357                 cat >mk_shared_lib.sh <<-CF_EOF
7358                 #!/bin/sh
7359                 SHARED_LIB=\$1
7360                 IMPORT_LIB=\`echo "\$1" | sed -e 's/msys-/lib/' -e 's/[0-9]*\.dll$/.dll.a/'\`
7361                 shift
7362                 cat <<-EOF
7363                 Linking shared library
7364                 ** SHARED_LIB \$SHARED_LIB
7365                 ** IMPORT_LIB \$IMPORT_LIB
7366 EOF
7367                 exec \$* -shared -Wl,--out-implib=\${IMPORT_LIB} -Wl,--export-all-symbols -o \${SHARED_LIB}
7368 CF_EOF
7369                 chmod +x mk_shared_lib.sh
7370                 ;;
7371         darwin*) #(vi
7372                 cf_try_cflags="no-cpp-precomp"
7373                 CC_SHARED_OPTS="-dynamic"
7374                 MK_SHARED_LIB='${CC} ${CFLAGS} -dynamiclib -install_name ${libdir}/`basename $@` -compatibility_version ${ABI_VERSION} -current_version ${ABI_VERSION} -o $@'
7375                 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=abi
7376                 cf_cv_shlib_version_infix=yes
7377                 echo "$as_me:7377: checking if ld -search_paths_first works" >&5
7378 echo $ECHO_N "checking if ld -search_paths_first works... $ECHO_C" >&6
7379 if test "${cf_cv_ldflags_search_paths_first+set}" = set; then
7380   echo $ECHO_N "(cached) $ECHO_C" >&6
7381 else
7382
7383                         cf_save_LDFLAGS=$LDFLAGS
7384                         LDFLAGS="$LDFLAGS -Wl,-search_paths_first"
7385                         cat >conftest.$ac_ext <<_ACEOF
7386 #line 7386 "configure"
7387 #include "confdefs.h"
7388
7389 int
7390 main ()
7391 {
7392 int i;
7393   ;
7394   return 0;
7395 }
7396 _ACEOF
7397 rm -f conftest.$ac_objext conftest$ac_exeext
7398 if { (eval echo "$as_me:7398: \"$ac_link\"") >&5
7399   (eval $ac_link) 2>&5
7400   ac_status=$?
7401   echo "$as_me:7401: \$? = $ac_status" >&5
7402   (exit $ac_status); } &&
7403          { ac_try='test -s conftest$ac_exeext'
7404   { (eval echo "$as_me:7404: \"$ac_try\"") >&5
7405   (eval $ac_try) 2>&5
7406   ac_status=$?
7407   echo "$as_me:7407: \$? = $ac_status" >&5
7408   (exit $ac_status); }; }; then
7409   cf_cv_ldflags_search_paths_first=yes
7410 else
7411   echo "$as_me: failed program was:" >&5
7412 cat conftest.$ac_ext >&5
7413 cf_cv_ldflags_search_paths_first=no
7414 fi
7415 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7416                                 LDFLAGS=$cf_save_LDFLAGS
7417 fi
7418 echo "$as_me:7418: result: $cf_cv_ldflags_search_paths_first" >&5
7419 echo "${ECHO_T}$cf_cv_ldflags_search_paths_first" >&6
7420                 if test $cf_cv_ldflags_search_paths_first = yes; then
7421                         LDFLAGS="$LDFLAGS -Wl,-search_paths_first"
7422                 fi
7423                 ;;
7424         hpux[7-8]*) #(vi
7425                 # HP-UX 8.07 ld lacks "+b" option used for libdir search-list
7426                 if test "$GCC" != yes; then
7427                         CC_SHARED_OPTS='+Z'
7428                 fi
7429                 MK_SHARED_LIB='${LD} -b -o $@'
7430                 INSTALL_LIB="-m 555"
7431                 ;;
7432         hpux*) #(vi
7433                 # (tested with gcc 2.7.2 -- I don't have c89)
7434                 if test "$GCC" = yes; then
7435                         LD_SHARED_OPTS='-Xlinker +b -Xlinker ${libdir}'
7436                 else
7437                         CC_SHARED_OPTS='+Z'
7438                         LD_SHARED_OPTS='-Wl,+b,${libdir}'
7439                 fi
7440                 MK_SHARED_LIB='${LD} +b ${libdir} -b -o $@'
7441                 # HP-UX shared libraries must be executable, and should be
7442                 # readonly to exploit a quirk in the memory manager.
7443                 INSTALL_LIB="-m 555"
7444                 ;;
7445         interix*)
7446                 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
7447                 if test "$cf_cv_shlib_version" = rel; then
7448                         cf_shared_soname='`basename  .${REL_VERSION}`.${ABI_VERSION}'
7449                 else
7450                         cf_shared_soname='`basename `'
7451                 fi
7452                 CC_SHARED_OPTS=
7453                 MK_SHARED_LIB='${CC} -shared -Wl,-rpath,${RPATH_LIST} -Wl,-h,'$cf_shared_soname' -o '
7454                 ;;
7455         irix*) #(vi
7456                 if test "$cf_cv_enable_rpath" = yes ; then
7457                         EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
7458                 fi
7459                 # tested with IRIX 5.2 and 'cc'.
7460                 if test "$GCC" != yes; then
7461                         CC_SHARED_OPTS='-KPIC'
7462                         MK_SHARED_LIB='${CC} -shared -rdata_shared -soname `basename $@` -o $@'
7463                 else
7464                         MK_SHARED_LIB='${CC} -shared -Wl,-soname,`basename $@` -o $@'
7465                 fi
7466                 cf_cv_rm_so_locs=yes
7467                 ;;
7468         linux*|gnu*|k*bsd*-gnu) #(vi
7469                 if test "$DFT_LWR_MODEL" = "shared" ; then
7470                         LOCAL_LDFLAGS="${LD_RPATH_OPT}\$(LOCAL_LIBDIR)"
7471                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
7472                 fi
7473                 if test "$cf_cv_enable_rpath" = yes ; then
7474                         EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
7475                 fi
7476
7477         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
7478         if test "$cf_cv_shlib_version" = rel; then
7479                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
7480         else
7481                 cf_cv_shared_soname='`basename $@`'
7482         fi
7483
7484                 MK_SHARED_LIB='${CC} ${CFLAGS} -shared -Wl,-soname,'$cf_cv_shared_soname',-stats,-lc -o $@'
7485                 ;;
7486         mingw*) #(vi
7487                 cf_cv_shlib_version=mingw
7488                 cf_cv_shlib_version_infix=mingw
7489                 shlibdir=$bindir
7490                 MAKE_DLLS=
7491                 if test "$DFT_LWR_MODEL" = "shared" ; then
7492                         LOCAL_LDFLAGS="-Wl,--enable-auto-import"
7493                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
7494                         EXTRA_LDFLAGS="-Wl,--enable-auto-import $EXTRA_LDFLAGS"
7495                 fi
7496                 CC_SHARED_OPTS=
7497                 MK_SHARED_LIB='sh '$rel_builddir'/mk_shared_lib.sh $@ ${CC} ${CFLAGS}'
7498                 RM_SHARED_OPTS="$RM_SHARED_OPTS $rel_builddir/mk_shared_lib.sh *.dll.a"
7499                 cat >mk_shared_lib.sh <<-CF_EOF
7500                 #!/bin/sh
7501                 SHARED_LIB=\$1
7502                 IMPORT_LIB=\`echo "\$1" | sed -e 's/[0-9]*\.dll$/.dll.a/'\`
7503                 shift
7504                 cat <<-EOF
7505                 Linking shared library
7506                 ** SHARED_LIB \$SHARED_LIB
7507                 ** IMPORT_LIB \$IMPORT_LIB
7508 EOF
7509                 exec \$* -shared -Wl,--enable-auto-import,--out-implib=\${IMPORT_LIB} -Wl,--export-all-symbols -o \${SHARED_LIB}
7510 CF_EOF
7511                 chmod +x mk_shared_lib.sh
7512                 ;;
7513         openbsd[2-9].*|mirbsd*) #(vi
7514                 if test "$DFT_LWR_MODEL" = "shared" ; then
7515                         LOCAL_LDFLAGS="${LD_RPATH_OPT}\$(LOCAL_LIBDIR)"
7516                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
7517                 fi
7518                 if test "$cf_cv_enable_rpath" = yes ; then
7519                         EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
7520                 fi
7521                 CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
7522
7523         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
7524         if test "$cf_cv_shlib_version" = rel; then
7525                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
7526         else
7527                 cf_cv_shared_soname='`basename $@`'
7528         fi
7529
7530                 MK_SHARED_LIB='${CC} ${CFLAGS} -shared -Wl,-Bshareable,-soname,'$cf_cv_shared_soname',-stats,-lc -o $@'
7531                 ;;
7532         nto-qnx*|openbsd*|freebsd[12].*) #(vi
7533                 CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
7534                 MK_SHARED_LIB='${LD} -Bshareable -o $@'
7535                 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
7536                 ;;
7537         dragonfly*|freebsd*) #(vi
7538                 CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
7539                 if test "$DFT_LWR_MODEL" = "shared" && test "$cf_cv_enable_rpath" = yes ; then
7540                         LOCAL_LDFLAGS="${cf_ld_rpath_opt}\$(LOCAL_LIBDIR)"
7541                         LOCAL_LDFLAGS2="${cf_ld_rpath_opt}\${RPATH_LIST} $LOCAL_LDFLAGS"
7542                         EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
7543                 fi
7544
7545         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
7546         if test "$cf_cv_shlib_version" = rel; then
7547                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
7548         else
7549                 cf_cv_shared_soname='`basename $@`'
7550         fi
7551
7552                 MK_SHARED_LIB='${LD} -shared -Bshareable -soname=`basename $@` -o $@'
7553                 ;;
7554         netbsd*) #(vi
7555                 CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
7556                 if test "$DFT_LWR_MODEL" = "shared" && test "$cf_cv_enable_rpath" = yes ; then
7557                         LOCAL_LDFLAGS="${cf_ld_rpath_opt}\$(LOCAL_LIBDIR)"
7558                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
7559                         EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
7560                         if test "$cf_cv_shlib_version" = auto; then
7561                         if test -f /usr/libexec/ld.elf_so; then
7562                                 cf_cv_shlib_version=abi
7563                         else
7564                                 cf_cv_shlib_version=rel
7565                         fi
7566                         fi
7567
7568         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
7569         if test "$cf_cv_shlib_version" = rel; then
7570                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
7571         else
7572                 cf_cv_shared_soname='`basename $@`'
7573         fi
7574
7575                         MK_SHARED_LIB='${CC} ${CFLAGS} -shared -Wl,-soname,'$cf_cv_shared_soname' -o $@'
7576                 else
7577                         MK_SHARED_LIB='${CC} -Wl,-shared -Wl,-Bshareable -o $@'
7578                 fi
7579                 ;;
7580         osf*|mls+*) #(vi
7581                 # tested with OSF/1 V3.2 and 'cc'
7582                 # tested with OSF/1 V3.2 and gcc 2.6.3 (but the c++ demo didn't
7583                 # link with shared libs).
7584                 MK_SHARED_LIB='${LD} -set_version ${REL_VERSION}:${ABI_VERSION} -expect_unresolved "*" -shared -soname `basename $@`'
7585                 case $host_os in #(vi
7586                 osf4*)
7587                         MK_SHARED_LIB="${MK_SHARED_LIB} -msym"
7588                         ;;
7589                 esac
7590                 MK_SHARED_LIB="${MK_SHARED_LIB}"' -o $@'
7591                 if test "$DFT_LWR_MODEL" = "shared" ; then
7592                         LOCAL_LDFLAGS="${LD_RPATH_OPT}\$(LOCAL_LIBDIR)"
7593                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
7594                 fi
7595                 cf_cv_rm_so_locs=yes
7596                 ;;
7597         sco3.2v5*)  # (also uw2* and UW7: hops 13-Apr-98
7598                 # tested with osr5.0.5
7599                 if test "$GCC" != yes; then
7600                         CC_SHARED_OPTS='-belf -KPIC'
7601                 fi
7602                 MK_SHARED_LIB='${LD} -dy -G -h `basename $@ .${REL_VERSION}`.${ABI_VERSION} -o $@'
7603                 if test "$cf_cv_enable_rpath" = yes ; then
7604                         # only way is to set LD_RUN_PATH but no switch for it
7605                         RUN_PATH=$libdir
7606                 fi
7607                 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
7608                 LINK_PROGS='LD_RUN_PATH=${libdir}'
7609                 LINK_TESTS='Pwd=`pwd`;LD_RUN_PATH=`dirname $${Pwd}`/lib'
7610                 ;;
7611         sunos4*) #(vi
7612                 # tested with SunOS 4.1.1 and gcc 2.7.0
7613                 if test "$GCC" != yes; then
7614                         CC_SHARED_OPTS='-KPIC'
7615                 fi
7616                 MK_SHARED_LIB='${LD} -assert pure-text -o $@'
7617                 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
7618                 ;;
7619         solaris2*) #(vi
7620                 # tested with SunOS 5.5.1 (solaris 2.5.1) and gcc 2.7.2
7621                 # tested with SunOS 5.10 (solaris 10) and gcc 3.4.3
7622                 if test "$DFT_LWR_MODEL" = "shared" ; then
7623                         LOCAL_LDFLAGS="-R \$(LOCAL_LIBDIR):\${libdir}"
7624                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
7625                 fi
7626                 if test "$cf_cv_enable_rpath" = yes ; then
7627                         EXTRA_LDFLAGS="-R \${libdir} $EXTRA_LDFLAGS"
7628                 fi
7629
7630         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
7631         if test "$cf_cv_shlib_version" = rel; then
7632                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
7633         else
7634                 cf_cv_shared_soname='`basename $@`'
7635         fi
7636
7637                 if test "$GCC" != yes; then
7638                         cf_save_CFLAGS="$CFLAGS"
7639                         for cf_shared_opts in -xcode=pic32 -xcode=pic13 -KPIC -Kpic -O
7640                         do
7641                                 CFLAGS="$cf_shared_opts $cf_save_CFLAGS"
7642                                 cat >conftest.$ac_ext <<_ACEOF
7643 #line 7643 "configure"
7644 #include "confdefs.h"
7645 #include <stdio.h>
7646 int
7647 main ()
7648 {
7649 printf("Hello\n");
7650   ;
7651   return 0;
7652 }
7653 _ACEOF
7654 rm -f conftest.$ac_objext
7655 if { (eval echo "$as_me:7655: \"$ac_compile\"") >&5
7656   (eval $ac_compile) 2>&5
7657   ac_status=$?
7658   echo "$as_me:7658: \$? = $ac_status" >&5
7659   (exit $ac_status); } &&
7660          { ac_try='test -s conftest.$ac_objext'
7661   { (eval echo "$as_me:7661: \"$ac_try\"") >&5
7662   (eval $ac_try) 2>&5
7663   ac_status=$?
7664   echo "$as_me:7664: \$? = $ac_status" >&5
7665   (exit $ac_status); }; }; then
7666   break
7667 else
7668   echo "$as_me: failed program was:" >&5
7669 cat conftest.$ac_ext >&5
7670 fi
7671 rm -f conftest.$ac_objext conftest.$ac_ext
7672                         done
7673                         CFLAGS="$cf_save_CFLAGS"
7674                         CC_SHARED_OPTS=$cf_shared_opts
7675                         MK_SHARED_LIB='${CC} -dy -G -h '$cf_cv_shared_soname' -o $@'
7676                 else
7677                         MK_SHARED_LIB='${CC} -shared -dy -G -h '$cf_cv_shared_soname' -o $@'
7678                 fi
7679                 ;;
7680         sysv5uw7*|unix_sv*) #(vi
7681                 # tested with UnixWare 7.1.0 (gcc 2.95.2 and cc)
7682                 if test "$GCC" != yes; then
7683                         CC_SHARED_OPTS='-KPIC'
7684                 fi
7685                 MK_SHARED_LIB='${LD} -d y -G -o $@'
7686                 ;;
7687         *)
7688                 CC_SHARED_OPTS='unknown'
7689                 MK_SHARED_LIB='echo unknown'
7690                 ;;
7691         esac
7692
7693         # This works if the last tokens in $MK_SHARED_LIB are the -o target.
7694         case "$cf_cv_shlib_version" in #(vi
7695         rel|abi)
7696                 case "$MK_SHARED_LIB" in #(vi
7697                 *'-o $@') #(vi
7698                         test "$cf_cv_do_symlinks" = no && cf_cv_do_symlinks=yes
7699                         ;;
7700                 *)
7701                         { echo "$as_me:7701: WARNING: ignored --with-shlib-version" >&5
7702 echo "$as_me: WARNING: ignored --with-shlib-version" >&2;}
7703                         ;;
7704                 esac
7705                 ;;
7706         esac
7707
7708         if test -n "$cf_try_cflags"
7709         then
7710 cat > conftest.$ac_ext <<EOF
7711 #line 7711 "${as_me:-configure}"
7712 #include <stdio.h>
7713 int main(int argc, char *argv[])
7714 {
7715         printf("hello\n");
7716         return (argv[argc-1] == 0) ;
7717 }
7718 EOF
7719                 cf_save_CFLAGS="$CFLAGS"
7720                 for cf_opt in $cf_try_cflags
7721                 do
7722                         CFLAGS="$cf_save_CFLAGS -$cf_opt"
7723                         echo "$as_me:7723: checking if CFLAGS option -$cf_opt works" >&5
7724 echo $ECHO_N "checking if CFLAGS option -$cf_opt works... $ECHO_C" >&6
7725                         if { (eval echo "$as_me:7725: \"$ac_compile\"") >&5
7726   (eval $ac_compile) 2>&5
7727   ac_status=$?
7728   echo "$as_me:7728: \$? = $ac_status" >&5
7729   (exit $ac_status); }; then
7730                                 echo "$as_me:7730: result: yes" >&5
7731 echo "${ECHO_T}yes" >&6
7732                                 cf_save_CFLAGS="$CFLAGS"
7733                         else
7734                                 echo "$as_me:7734: result: no" >&5
7735 echo "${ECHO_T}no" >&6
7736                         fi
7737                 done
7738                 CFLAGS="$cf_save_CFLAGS"
7739         fi
7740
7741         # RPATH_LIST is a colon-separated list of directories
7742         test -n "$cf_ld_rpath_opt" && MK_SHARED_LIB="$MK_SHARED_LIB $cf_ld_rpath_opt\${RPATH_LIST}"
7743         test -z "$RPATH_LIST" && RPATH_LIST="\${libdir}"
7744
7745         test $cf_cv_rm_so_locs = yes && RM_SHARED_OPTS="$RM_SHARED_OPTS so_locations"
7746
7747         test -n "$verbose" && echo "    CC_SHARED_OPTS: $CC_SHARED_OPTS" 1>&6
7748
7749 echo "${as_me:-configure}:7749: testing CC_SHARED_OPTS: $CC_SHARED_OPTS ..." 1>&5
7750
7751         test -n "$verbose" && echo "    MK_SHARED_LIB:  $MK_SHARED_LIB" 1>&6
7752
7753 echo "${as_me:-configure}:7753: testing MK_SHARED_LIB:  $MK_SHARED_LIB ..." 1>&5
7754
7755 # The test/sample programs in the original tree link using rpath option.
7756 # Make it optional for packagers.
7757 if test -n "$LOCAL_LDFLAGS"
7758 then
7759         echo "$as_me:7759: checking if you want to link sample programs with rpath option" >&5
7760 echo $ECHO_N "checking if you want to link sample programs with rpath option... $ECHO_C" >&6
7761
7762 # Check whether --enable-rpath-link or --disable-rpath-link was given.
7763 if test "${enable_rpath_link+set}" = set; then
7764   enableval="$enable_rpath_link"
7765   with_rpath_link=$enableval
7766 else
7767   with_rpath_link=yes
7768 fi;
7769         echo "$as_me:7769: result: $with_rpath_link" >&5
7770 echo "${ECHO_T}$with_rpath_link" >&6
7771         if test "$with_rpath_link" = no
7772         then
7773                 LOCAL_LDFLAGS=
7774                 LOCAL_LDFLAGS2=
7775         fi
7776 fi
7777
7778 ###############################################################################
7779
7780 ###   use option --enable-broken-linker to force on use of broken-linker support
7781 echo "$as_me:7781: checking if you want broken-linker support code" >&5
7782 echo $ECHO_N "checking if you want broken-linker support code... $ECHO_C" >&6
7783
7784 # Check whether --enable-broken_linker or --disable-broken_linker was given.
7785 if test "${enable_broken_linker+set}" = set; then
7786   enableval="$enable_broken_linker"
7787   with_broken_linker=$enableval
7788 else
7789   with_broken_linker=${BROKEN_LINKER:-no}
7790 fi;
7791 echo "$as_me:7791: result: $with_broken_linker" >&5
7792 echo "${ECHO_T}$with_broken_linker" >&6
7793
7794 BROKEN_LINKER=0
7795 if test "$with_broken_linker" = yes ; then
7796         cat >>confdefs.h <<\EOF
7797 #define BROKEN_LINKER 1
7798 EOF
7799
7800         BROKEN_LINKER=1
7801 elif test "$DFT_LWR_MODEL" = shared ; then
7802         case $cf_cv_system_name in #(vi
7803         cygwin*)
7804                 cat >>confdefs.h <<\EOF
7805 #define BROKEN_LINKER 1
7806 EOF
7807
7808                 BROKEN_LINKER=1
7809                 test -n "$verbose" && echo "    cygwin linker is broken anyway" 1>&6
7810
7811 echo "${as_me:-configure}:7811: testing cygwin linker is broken anyway ..." 1>&5
7812
7813                 ;;
7814         esac
7815 fi
7816
7817 # Check to define _XOPEN_SOURCE "automatically"
7818
7819 cf_XOPEN_SOURCE=500
7820 cf_POSIX_C_SOURCE=199506L
7821 cf_xopen_source=
7822
7823 case $host_os in #(vi
7824 aix[4-7]*) #(vi
7825         cf_xopen_source="-D_ALL_SOURCE"
7826         ;;
7827 cygwin|msys) #(vi
7828         cf_XOPEN_SOURCE=600
7829         ;;
7830 darwin[0-8].*) #(vi
7831         cf_xopen_source="-D_APPLE_C_SOURCE"
7832         ;;
7833 darwin*) #(vi
7834         cf_xopen_source="-D_DARWIN_C_SOURCE"
7835         cf_XOPEN_SOURCE=
7836         ;;
7837 freebsd*|dragonfly*) #(vi
7838         # 5.x headers associate
7839         #       _XOPEN_SOURCE=600 with _POSIX_C_SOURCE=200112L
7840         #       _XOPEN_SOURCE=500 with _POSIX_C_SOURCE=199506L
7841         cf_POSIX_C_SOURCE=200112L
7842         cf_XOPEN_SOURCE=600
7843         cf_xopen_source="-D_BSD_TYPES -D__BSD_VISIBLE -D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
7844         ;;
7845 hpux11*) #(vi
7846         cf_xopen_source="-D_HPUX_SOURCE -D_XOPEN_SOURCE=500"
7847         ;;
7848 hpux*) #(vi
7849         cf_xopen_source="-D_HPUX_SOURCE"
7850         ;;
7851 irix[56].*) #(vi
7852         cf_xopen_source="-D_SGI_SOURCE"
7853         cf_XOPEN_SOURCE=
7854         ;;
7855 linux*|gnu*|mint*|k*bsd*-gnu) #(vi
7856
7857 echo "$as_me:7857: checking if we must define _GNU_SOURCE" >&5
7858 echo $ECHO_N "checking if we must define _GNU_SOURCE... $ECHO_C" >&6
7859 if test "${cf_cv_gnu_source+set}" = set; then
7860   echo $ECHO_N "(cached) $ECHO_C" >&6
7861 else
7862
7863 cat >conftest.$ac_ext <<_ACEOF
7864 #line 7864 "configure"
7865 #include "confdefs.h"
7866 #include <sys/types.h>
7867 int
7868 main ()
7869 {
7870
7871 #ifndef _XOPEN_SOURCE
7872 make an error
7873 #endif
7874   ;
7875   return 0;
7876 }
7877 _ACEOF
7878 rm -f conftest.$ac_objext
7879 if { (eval echo "$as_me:7879: \"$ac_compile\"") >&5
7880   (eval $ac_compile) 2>&5
7881   ac_status=$?
7882   echo "$as_me:7882: \$? = $ac_status" >&5
7883   (exit $ac_status); } &&
7884          { ac_try='test -s conftest.$ac_objext'
7885   { (eval echo "$as_me:7885: \"$ac_try\"") >&5
7886   (eval $ac_try) 2>&5
7887   ac_status=$?
7888   echo "$as_me:7888: \$? = $ac_status" >&5
7889   (exit $ac_status); }; }; then
7890   cf_cv_gnu_source=no
7891 else
7892   echo "$as_me: failed program was:" >&5
7893 cat conftest.$ac_ext >&5
7894 cf_save="$CPPFLAGS"
7895          CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
7896          cat >conftest.$ac_ext <<_ACEOF
7897 #line 7897 "configure"
7898 #include "confdefs.h"
7899 #include <sys/types.h>
7900 int
7901 main ()
7902 {
7903
7904 #ifdef _XOPEN_SOURCE
7905 make an error
7906 #endif
7907   ;
7908   return 0;
7909 }
7910 _ACEOF
7911 rm -f conftest.$ac_objext
7912 if { (eval echo "$as_me:7912: \"$ac_compile\"") >&5
7913   (eval $ac_compile) 2>&5
7914   ac_status=$?
7915   echo "$as_me:7915: \$? = $ac_status" >&5
7916   (exit $ac_status); } &&
7917          { ac_try='test -s conftest.$ac_objext'
7918   { (eval echo "$as_me:7918: \"$ac_try\"") >&5
7919   (eval $ac_try) 2>&5
7920   ac_status=$?
7921   echo "$as_me:7921: \$? = $ac_status" >&5
7922   (exit $ac_status); }; }; then
7923   cf_cv_gnu_source=no
7924 else
7925   echo "$as_me: failed program was:" >&5
7926 cat conftest.$ac_ext >&5
7927 cf_cv_gnu_source=yes
7928 fi
7929 rm -f conftest.$ac_objext conftest.$ac_ext
7930         CPPFLAGS="$cf_save"
7931
7932 fi
7933 rm -f conftest.$ac_objext conftest.$ac_ext
7934
7935 fi
7936 echo "$as_me:7936: result: $cf_cv_gnu_source" >&5
7937 echo "${ECHO_T}$cf_cv_gnu_source" >&6
7938 test "$cf_cv_gnu_source" = yes && CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
7939
7940         ;;
7941 minix*) #(vi
7942         cf_xopen_source="-D_NETBSD_SOURCE" # POSIX.1-2001 features are ifdef'd with this...
7943         ;;
7944 mirbsd*) #(vi
7945         # setting _XOPEN_SOURCE or _POSIX_SOURCE breaks <sys/select.h> and other headers which use u_int / u_short types
7946         cf_XOPEN_SOURCE=
7947
7948 cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE
7949
7950 cf_save_CFLAGS="$CFLAGS"
7951 cf_save_CPPFLAGS="$CPPFLAGS"
7952
7953 cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \
7954         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
7955                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
7956
7957 cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \
7958         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
7959                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
7960
7961 echo "$as_me:7961: checking if we should define _POSIX_C_SOURCE" >&5
7962 echo $ECHO_N "checking if we should define _POSIX_C_SOURCE... $ECHO_C" >&6
7963 if test "${cf_cv_posix_c_source+set}" = set; then
7964   echo $ECHO_N "(cached) $ECHO_C" >&6
7965 else
7966
7967 echo "${as_me:-configure}:7967: testing if the symbol is already defined go no further ..." 1>&5
7968
7969         cat >conftest.$ac_ext <<_ACEOF
7970 #line 7970 "configure"
7971 #include "confdefs.h"
7972 #include <sys/types.h>
7973 int
7974 main ()
7975 {
7976
7977 #ifndef _POSIX_C_SOURCE
7978 make an error
7979 #endif
7980   ;
7981   return 0;
7982 }
7983 _ACEOF
7984 rm -f conftest.$ac_objext
7985 if { (eval echo "$as_me:7985: \"$ac_compile\"") >&5
7986   (eval $ac_compile) 2>&5
7987   ac_status=$?
7988   echo "$as_me:7988: \$? = $ac_status" >&5
7989   (exit $ac_status); } &&
7990          { ac_try='test -s conftest.$ac_objext'
7991   { (eval echo "$as_me:7991: \"$ac_try\"") >&5
7992   (eval $ac_try) 2>&5
7993   ac_status=$?
7994   echo "$as_me:7994: \$? = $ac_status" >&5
7995   (exit $ac_status); }; }; then
7996   cf_cv_posix_c_source=no
7997 else
7998   echo "$as_me: failed program was:" >&5
7999 cat conftest.$ac_ext >&5
8000 cf_want_posix_source=no
8001          case .$cf_POSIX_C_SOURCE in #(vi
8002          .[12]??*) #(vi
8003                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
8004                 ;;
8005          .2) #(vi
8006                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
8007                 cf_want_posix_source=yes
8008                 ;;
8009          .*)
8010                 cf_want_posix_source=yes
8011                 ;;
8012          esac
8013          if test "$cf_want_posix_source" = yes ; then
8014                 cat >conftest.$ac_ext <<_ACEOF
8015 #line 8015 "configure"
8016 #include "confdefs.h"
8017 #include <sys/types.h>
8018 int
8019 main ()
8020 {
8021
8022 #ifdef _POSIX_SOURCE
8023 make an error
8024 #endif
8025   ;
8026   return 0;
8027 }
8028 _ACEOF
8029 rm -f conftest.$ac_objext
8030 if { (eval echo "$as_me:8030: \"$ac_compile\"") >&5
8031   (eval $ac_compile) 2>&5
8032   ac_status=$?
8033   echo "$as_me:8033: \$? = $ac_status" >&5
8034   (exit $ac_status); } &&
8035          { ac_try='test -s conftest.$ac_objext'
8036   { (eval echo "$as_me:8036: \"$ac_try\"") >&5
8037   (eval $ac_try) 2>&5
8038   ac_status=$?
8039   echo "$as_me:8039: \$? = $ac_status" >&5
8040   (exit $ac_status); }; }; then
8041   :
8042 else
8043   echo "$as_me: failed program was:" >&5
8044 cat conftest.$ac_ext >&5
8045 cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE"
8046 fi
8047 rm -f conftest.$ac_objext conftest.$ac_ext
8048          fi
8049
8050 echo "${as_me:-configure}:8050: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
8051
8052          CFLAGS="$cf_trim_CFLAGS"
8053          CPPFLAGS="$cf_trim_CPPFLAGS $cf_cv_posix_c_source"
8054
8055 echo "${as_me:-configure}:8055: testing if the second compile does not leave our definition intact error ..." 1>&5
8056
8057          cat >conftest.$ac_ext <<_ACEOF
8058 #line 8058 "configure"
8059 #include "confdefs.h"
8060 #include <sys/types.h>
8061 int
8062 main ()
8063 {
8064
8065 #ifndef _POSIX_C_SOURCE
8066 make an error
8067 #endif
8068   ;
8069   return 0;
8070 }
8071 _ACEOF
8072 rm -f conftest.$ac_objext
8073 if { (eval echo "$as_me:8073: \"$ac_compile\"") >&5
8074   (eval $ac_compile) 2>&5
8075   ac_status=$?
8076   echo "$as_me:8076: \$? = $ac_status" >&5
8077   (exit $ac_status); } &&
8078          { ac_try='test -s conftest.$ac_objext'
8079   { (eval echo "$as_me:8079: \"$ac_try\"") >&5
8080   (eval $ac_try) 2>&5
8081   ac_status=$?
8082   echo "$as_me:8082: \$? = $ac_status" >&5
8083   (exit $ac_status); }; }; then
8084   :
8085 else
8086   echo "$as_me: failed program was:" >&5
8087 cat conftest.$ac_ext >&5
8088 cf_cv_posix_c_source=no
8089 fi
8090 rm -f conftest.$ac_objext conftest.$ac_ext
8091          CFLAGS="$cf_save_CFLAGS"
8092          CPPFLAGS="$cf_save_CPPFLAGS"
8093
8094 fi
8095 rm -f conftest.$ac_objext conftest.$ac_ext
8096
8097 fi
8098 echo "$as_me:8098: result: $cf_cv_posix_c_source" >&5
8099 echo "${ECHO_T}$cf_cv_posix_c_source" >&6
8100
8101 if test "$cf_cv_posix_c_source" != no ; then
8102         CFLAGS="$cf_trim_CFLAGS"
8103         CPPFLAGS="$cf_trim_CPPFLAGS"
8104
8105 cf_fix_cppflags=no
8106 cf_new_cflags=
8107 cf_new_cppflags=
8108 cf_new_extra_cppflags=
8109
8110 for cf_add_cflags in $cf_cv_posix_c_source
8111 do
8112 case $cf_fix_cppflags in
8113 no)
8114         case $cf_add_cflags in #(vi
8115         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
8116                 case $cf_add_cflags in
8117                 -D*)
8118                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
8119
8120                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
8121                                 && test -z "${cf_tst_cflags}" \
8122                                 && cf_fix_cppflags=yes
8123
8124                         if test $cf_fix_cppflags = yes ; then
8125                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
8126                                 continue
8127                         elif test "${cf_tst_cflags}" = "\"'" ; then
8128                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
8129                                 continue
8130                         fi
8131                         ;;
8132                 esac
8133                 case "$CPPFLAGS" in
8134                 *$cf_add_cflags) #(vi
8135                         ;;
8136                 *) #(vi
8137                         case $cf_add_cflags in #(vi
8138                         -D*)
8139                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
8140
8141 CPPFLAGS=`echo "$CPPFLAGS" | \
8142         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
8143                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
8144
8145                                 ;;
8146                         esac
8147                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
8148                         ;;
8149                 esac
8150                 ;;
8151         *)
8152                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
8153                 ;;
8154         esac
8155         ;;
8156 yes)
8157         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
8158
8159         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
8160
8161         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
8162                 && test -z "${cf_tst_cflags}" \
8163                 && cf_fix_cppflags=no
8164         ;;
8165 esac
8166 done
8167
8168 if test -n "$cf_new_cflags" ; then
8169
8170         CFLAGS="$CFLAGS $cf_new_cflags"
8171 fi
8172
8173 if test -n "$cf_new_cppflags" ; then
8174
8175         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
8176 fi
8177
8178 if test -n "$cf_new_extra_cppflags" ; then
8179
8180         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
8181 fi
8182
8183 fi
8184
8185         ;;
8186 netbsd*) #(vi
8187         cf_xopen_source="-D_NETBSD_SOURCE" # setting _XOPEN_SOURCE breaks IPv6 for lynx on NetBSD 1.6, breaks xterm, is not needed for ncursesw
8188         ;;
8189 openbsd[4-9]*) #(vi
8190         # setting _XOPEN_SOURCE lower than 500 breaks g++ compile with wchar.h, needed for ncursesw
8191         cf_xopen_source="-D_BSD_SOURCE"
8192         cf_XOPEN_SOURCE=600
8193         ;;
8194 openbsd*) #(vi
8195         # setting _XOPEN_SOURCE breaks xterm on OpenBSD 2.8, is not needed for ncursesw
8196         ;;
8197 osf[45]*) #(vi
8198         cf_xopen_source="-D_OSF_SOURCE"
8199         ;;
8200 nto-qnx*) #(vi
8201         cf_xopen_source="-D_QNX_SOURCE"
8202         ;;
8203 sco*) #(vi
8204         # setting _XOPEN_SOURCE breaks Lynx on SCO Unix / OpenServer
8205         ;;
8206 solaris2.*) #(vi
8207         cf_xopen_source="-D__EXTENSIONS__"
8208         cf_cv_xopen_source=broken
8209         ;;
8210 sysv4.2uw2.*) # Novell/SCO UnixWare 2.x (tested on 2.1.2)
8211         cf_XOPEN_SOURCE=
8212         cf_POSIX_C_SOURCE=
8213         ;;
8214 *)
8215
8216 echo "$as_me:8216: checking if we should define _XOPEN_SOURCE" >&5
8217 echo $ECHO_N "checking if we should define _XOPEN_SOURCE... $ECHO_C" >&6
8218 if test "${cf_cv_xopen_source+set}" = set; then
8219   echo $ECHO_N "(cached) $ECHO_C" >&6
8220 else
8221
8222         cat >conftest.$ac_ext <<_ACEOF
8223 #line 8223 "configure"
8224 #include "confdefs.h"
8225
8226 #include <stdlib.h>
8227 #include <string.h>
8228 #include <sys/types.h>
8229
8230 int
8231 main ()
8232 {
8233
8234 #ifndef _XOPEN_SOURCE
8235 make an error
8236 #endif
8237   ;
8238   return 0;
8239 }
8240 _ACEOF
8241 rm -f conftest.$ac_objext
8242 if { (eval echo "$as_me:8242: \"$ac_compile\"") >&5
8243   (eval $ac_compile) 2>&5
8244   ac_status=$?
8245   echo "$as_me:8245: \$? = $ac_status" >&5
8246   (exit $ac_status); } &&
8247          { ac_try='test -s conftest.$ac_objext'
8248   { (eval echo "$as_me:8248: \"$ac_try\"") >&5
8249   (eval $ac_try) 2>&5
8250   ac_status=$?
8251   echo "$as_me:8251: \$? = $ac_status" >&5
8252   (exit $ac_status); }; }; then
8253   cf_cv_xopen_source=no
8254 else
8255   echo "$as_me: failed program was:" >&5
8256 cat conftest.$ac_ext >&5
8257 cf_save="$CPPFLAGS"
8258          CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
8259          cat >conftest.$ac_ext <<_ACEOF
8260 #line 8260 "configure"
8261 #include "confdefs.h"
8262
8263 #include <stdlib.h>
8264 #include <string.h>
8265 #include <sys/types.h>
8266
8267 int
8268 main ()
8269 {
8270
8271 #ifdef _XOPEN_SOURCE
8272 make an error
8273 #endif
8274   ;
8275   return 0;
8276 }
8277 _ACEOF
8278 rm -f conftest.$ac_objext
8279 if { (eval echo "$as_me:8279: \"$ac_compile\"") >&5
8280   (eval $ac_compile) 2>&5
8281   ac_status=$?
8282   echo "$as_me:8282: \$? = $ac_status" >&5
8283   (exit $ac_status); } &&
8284          { ac_try='test -s conftest.$ac_objext'
8285   { (eval echo "$as_me:8285: \"$ac_try\"") >&5
8286   (eval $ac_try) 2>&5
8287   ac_status=$?
8288   echo "$as_me:8288: \$? = $ac_status" >&5
8289   (exit $ac_status); }; }; then
8290   cf_cv_xopen_source=no
8291 else
8292   echo "$as_me: failed program was:" >&5
8293 cat conftest.$ac_ext >&5
8294 cf_cv_xopen_source=$cf_XOPEN_SOURCE
8295 fi
8296 rm -f conftest.$ac_objext conftest.$ac_ext
8297         CPPFLAGS="$cf_save"
8298
8299 fi
8300 rm -f conftest.$ac_objext conftest.$ac_ext
8301
8302 fi
8303 echo "$as_me:8303: result: $cf_cv_xopen_source" >&5
8304 echo "${ECHO_T}$cf_cv_xopen_source" >&6
8305
8306 if test "$cf_cv_xopen_source" != no ; then
8307
8308 CFLAGS=`echo "$CFLAGS" | \
8309         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
8310                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
8311
8312 CPPFLAGS=`echo "$CPPFLAGS" | \
8313         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
8314                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
8315
8316         cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source"
8317
8318 cf_fix_cppflags=no
8319 cf_new_cflags=
8320 cf_new_cppflags=
8321 cf_new_extra_cppflags=
8322
8323 for cf_add_cflags in $cf_temp_xopen_source
8324 do
8325 case $cf_fix_cppflags in
8326 no)
8327         case $cf_add_cflags in #(vi
8328         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
8329                 case $cf_add_cflags in
8330                 -D*)
8331                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
8332
8333                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
8334                                 && test -z "${cf_tst_cflags}" \
8335                                 && cf_fix_cppflags=yes
8336
8337                         if test $cf_fix_cppflags = yes ; then
8338                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
8339                                 continue
8340                         elif test "${cf_tst_cflags}" = "\"'" ; then
8341                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
8342                                 continue
8343                         fi
8344                         ;;
8345                 esac
8346                 case "$CPPFLAGS" in
8347                 *$cf_add_cflags) #(vi
8348                         ;;
8349                 *) #(vi
8350                         case $cf_add_cflags in #(vi
8351                         -D*)
8352                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
8353
8354 CPPFLAGS=`echo "$CPPFLAGS" | \
8355         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
8356                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
8357
8358                                 ;;
8359                         esac
8360                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
8361                         ;;
8362                 esac
8363                 ;;
8364         *)
8365                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
8366                 ;;
8367         esac
8368         ;;
8369 yes)
8370         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
8371
8372         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
8373
8374         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
8375                 && test -z "${cf_tst_cflags}" \
8376                 && cf_fix_cppflags=no
8377         ;;
8378 esac
8379 done
8380
8381 if test -n "$cf_new_cflags" ; then
8382
8383         CFLAGS="$CFLAGS $cf_new_cflags"
8384 fi
8385
8386 if test -n "$cf_new_cppflags" ; then
8387
8388         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
8389 fi
8390
8391 if test -n "$cf_new_extra_cppflags" ; then
8392
8393         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
8394 fi
8395
8396 fi
8397
8398 cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE
8399
8400 cf_save_CFLAGS="$CFLAGS"
8401 cf_save_CPPFLAGS="$CPPFLAGS"
8402
8403 cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \
8404         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
8405                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
8406
8407 cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \
8408         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
8409                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
8410
8411 echo "$as_me:8411: checking if we should define _POSIX_C_SOURCE" >&5
8412 echo $ECHO_N "checking if we should define _POSIX_C_SOURCE... $ECHO_C" >&6
8413 if test "${cf_cv_posix_c_source+set}" = set; then
8414   echo $ECHO_N "(cached) $ECHO_C" >&6
8415 else
8416
8417 echo "${as_me:-configure}:8417: testing if the symbol is already defined go no further ..." 1>&5
8418
8419         cat >conftest.$ac_ext <<_ACEOF
8420 #line 8420 "configure"
8421 #include "confdefs.h"
8422 #include <sys/types.h>
8423 int
8424 main ()
8425 {
8426
8427 #ifndef _POSIX_C_SOURCE
8428 make an error
8429 #endif
8430   ;
8431   return 0;
8432 }
8433 _ACEOF
8434 rm -f conftest.$ac_objext
8435 if { (eval echo "$as_me:8435: \"$ac_compile\"") >&5
8436   (eval $ac_compile) 2>&5
8437   ac_status=$?
8438   echo "$as_me:8438: \$? = $ac_status" >&5
8439   (exit $ac_status); } &&
8440          { ac_try='test -s conftest.$ac_objext'
8441   { (eval echo "$as_me:8441: \"$ac_try\"") >&5
8442   (eval $ac_try) 2>&5
8443   ac_status=$?
8444   echo "$as_me:8444: \$? = $ac_status" >&5
8445   (exit $ac_status); }; }; then
8446   cf_cv_posix_c_source=no
8447 else
8448   echo "$as_me: failed program was:" >&5
8449 cat conftest.$ac_ext >&5
8450 cf_want_posix_source=no
8451          case .$cf_POSIX_C_SOURCE in #(vi
8452          .[12]??*) #(vi
8453                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
8454                 ;;
8455          .2) #(vi
8456                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
8457                 cf_want_posix_source=yes
8458                 ;;
8459          .*)
8460                 cf_want_posix_source=yes
8461                 ;;
8462          esac
8463          if test "$cf_want_posix_source" = yes ; then
8464                 cat >conftest.$ac_ext <<_ACEOF
8465 #line 8465 "configure"
8466 #include "confdefs.h"
8467 #include <sys/types.h>
8468 int
8469 main ()
8470 {
8471
8472 #ifdef _POSIX_SOURCE
8473 make an error
8474 #endif
8475   ;
8476   return 0;
8477 }
8478 _ACEOF
8479 rm -f conftest.$ac_objext
8480 if { (eval echo "$as_me:8480: \"$ac_compile\"") >&5
8481   (eval $ac_compile) 2>&5
8482   ac_status=$?
8483   echo "$as_me:8483: \$? = $ac_status" >&5
8484   (exit $ac_status); } &&
8485          { ac_try='test -s conftest.$ac_objext'
8486   { (eval echo "$as_me:8486: \"$ac_try\"") >&5
8487   (eval $ac_try) 2>&5
8488   ac_status=$?
8489   echo "$as_me:8489: \$? = $ac_status" >&5
8490   (exit $ac_status); }; }; then
8491   :
8492 else
8493   echo "$as_me: failed program was:" >&5
8494 cat conftest.$ac_ext >&5
8495 cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE"
8496 fi
8497 rm -f conftest.$ac_objext conftest.$ac_ext
8498          fi
8499
8500 echo "${as_me:-configure}:8500: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
8501
8502          CFLAGS="$cf_trim_CFLAGS"
8503          CPPFLAGS="$cf_trim_CPPFLAGS $cf_cv_posix_c_source"
8504
8505 echo "${as_me:-configure}:8505: testing if the second compile does not leave our definition intact error ..." 1>&5
8506
8507          cat >conftest.$ac_ext <<_ACEOF
8508 #line 8508 "configure"
8509 #include "confdefs.h"
8510 #include <sys/types.h>
8511 int
8512 main ()
8513 {
8514
8515 #ifndef _POSIX_C_SOURCE
8516 make an error
8517 #endif
8518   ;
8519   return 0;
8520 }
8521 _ACEOF
8522 rm -f conftest.$ac_objext
8523 if { (eval echo "$as_me:8523: \"$ac_compile\"") >&5
8524   (eval $ac_compile) 2>&5
8525   ac_status=$?
8526   echo "$as_me:8526: \$? = $ac_status" >&5
8527   (exit $ac_status); } &&
8528          { ac_try='test -s conftest.$ac_objext'
8529   { (eval echo "$as_me:8529: \"$ac_try\"") >&5
8530   (eval $ac_try) 2>&5
8531   ac_status=$?
8532   echo "$as_me:8532: \$? = $ac_status" >&5
8533   (exit $ac_status); }; }; then
8534   :
8535 else
8536   echo "$as_me: failed program was:" >&5
8537 cat conftest.$ac_ext >&5
8538 cf_cv_posix_c_source=no
8539 fi
8540 rm -f conftest.$ac_objext conftest.$ac_ext
8541          CFLAGS="$cf_save_CFLAGS"
8542          CPPFLAGS="$cf_save_CPPFLAGS"
8543
8544 fi
8545 rm -f conftest.$ac_objext conftest.$ac_ext
8546
8547 fi
8548 echo "$as_me:8548: result: $cf_cv_posix_c_source" >&5
8549 echo "${ECHO_T}$cf_cv_posix_c_source" >&6
8550
8551 if test "$cf_cv_posix_c_source" != no ; then
8552         CFLAGS="$cf_trim_CFLAGS"
8553         CPPFLAGS="$cf_trim_CPPFLAGS"
8554
8555 cf_fix_cppflags=no
8556 cf_new_cflags=
8557 cf_new_cppflags=
8558 cf_new_extra_cppflags=
8559
8560 for cf_add_cflags in $cf_cv_posix_c_source
8561 do
8562 case $cf_fix_cppflags in
8563 no)
8564         case $cf_add_cflags in #(vi
8565         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
8566                 case $cf_add_cflags in
8567                 -D*)
8568                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
8569
8570                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
8571                                 && test -z "${cf_tst_cflags}" \
8572                                 && cf_fix_cppflags=yes
8573
8574                         if test $cf_fix_cppflags = yes ; then
8575                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
8576                                 continue
8577                         elif test "${cf_tst_cflags}" = "\"'" ; then
8578                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
8579                                 continue
8580                         fi
8581                         ;;
8582                 esac
8583                 case "$CPPFLAGS" in
8584                 *$cf_add_cflags) #(vi
8585                         ;;
8586                 *) #(vi
8587                         case $cf_add_cflags in #(vi
8588                         -D*)
8589                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
8590
8591 CPPFLAGS=`echo "$CPPFLAGS" | \
8592         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
8593                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
8594
8595                                 ;;
8596                         esac
8597                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
8598                         ;;
8599                 esac
8600                 ;;
8601         *)
8602                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
8603                 ;;
8604         esac
8605         ;;
8606 yes)
8607         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
8608
8609         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
8610
8611         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
8612                 && test -z "${cf_tst_cflags}" \
8613                 && cf_fix_cppflags=no
8614         ;;
8615 esac
8616 done
8617
8618 if test -n "$cf_new_cflags" ; then
8619
8620         CFLAGS="$CFLAGS $cf_new_cflags"
8621 fi
8622
8623 if test -n "$cf_new_cppflags" ; then
8624
8625         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
8626 fi
8627
8628 if test -n "$cf_new_extra_cppflags" ; then
8629
8630         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
8631 fi
8632
8633 fi
8634
8635         ;;
8636 esac
8637
8638 if test -n "$cf_xopen_source" ; then
8639
8640 cf_fix_cppflags=no
8641 cf_new_cflags=
8642 cf_new_cppflags=
8643 cf_new_extra_cppflags=
8644
8645 for cf_add_cflags in $cf_xopen_source
8646 do
8647 case $cf_fix_cppflags in
8648 no)
8649         case $cf_add_cflags in #(vi
8650         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
8651                 case $cf_add_cflags in
8652                 -D*)
8653                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
8654
8655                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
8656                                 && test -z "${cf_tst_cflags}" \
8657                                 && cf_fix_cppflags=yes
8658
8659                         if test $cf_fix_cppflags = yes ; then
8660                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
8661                                 continue
8662                         elif test "${cf_tst_cflags}" = "\"'" ; then
8663                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
8664                                 continue
8665                         fi
8666                         ;;
8667                 esac
8668                 case "$CPPFLAGS" in
8669                 *$cf_add_cflags) #(vi
8670                         ;;
8671                 *) #(vi
8672                         case $cf_add_cflags in #(vi
8673                         -D*)
8674                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
8675
8676 CPPFLAGS=`echo "$CPPFLAGS" | \
8677         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
8678                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
8679
8680                                 ;;
8681                         esac
8682                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
8683                         ;;
8684                 esac
8685                 ;;
8686         *)
8687                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
8688                 ;;
8689         esac
8690         ;;
8691 yes)
8692         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
8693
8694         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
8695
8696         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
8697                 && test -z "${cf_tst_cflags}" \
8698                 && cf_fix_cppflags=no
8699         ;;
8700 esac
8701 done
8702
8703 if test -n "$cf_new_cflags" ; then
8704         test -n "$verbose" && echo "    add to \$CFLAGS $cf_new_cflags" 1>&6
8705
8706 echo "${as_me:-configure}:8706: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
8707
8708         CFLAGS="$CFLAGS $cf_new_cflags"
8709 fi
8710
8711 if test -n "$cf_new_cppflags" ; then
8712         test -n "$verbose" && echo "    add to \$CPPFLAGS $cf_new_cppflags" 1>&6
8713
8714 echo "${as_me:-configure}:8714: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
8715
8716         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
8717 fi
8718
8719 if test -n "$cf_new_extra_cppflags" ; then
8720         test -n "$verbose" && echo "    add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6
8721
8722 echo "${as_me:-configure}:8722: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
8723
8724         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
8725 fi
8726
8727 fi
8728
8729 if test -n "$cf_XOPEN_SOURCE" && test -z "$cf_cv_xopen_source" ; then
8730         echo "$as_me:8730: checking if _XOPEN_SOURCE really is set" >&5
8731 echo $ECHO_N "checking if _XOPEN_SOURCE really is set... $ECHO_C" >&6
8732         cat >conftest.$ac_ext <<_ACEOF
8733 #line 8733 "configure"
8734 #include "confdefs.h"
8735 #include <stdlib.h>
8736 int
8737 main ()
8738 {
8739
8740 #ifndef _XOPEN_SOURCE
8741 make an error
8742 #endif
8743   ;
8744   return 0;
8745 }
8746 _ACEOF
8747 rm -f conftest.$ac_objext
8748 if { (eval echo "$as_me:8748: \"$ac_compile\"") >&5
8749   (eval $ac_compile) 2>&5
8750   ac_status=$?
8751   echo "$as_me:8751: \$? = $ac_status" >&5
8752   (exit $ac_status); } &&
8753          { ac_try='test -s conftest.$ac_objext'
8754   { (eval echo "$as_me:8754: \"$ac_try\"") >&5
8755   (eval $ac_try) 2>&5
8756   ac_status=$?
8757   echo "$as_me:8757: \$? = $ac_status" >&5
8758   (exit $ac_status); }; }; then
8759   cf_XOPEN_SOURCE_set=yes
8760 else
8761   echo "$as_me: failed program was:" >&5
8762 cat conftest.$ac_ext >&5
8763 cf_XOPEN_SOURCE_set=no
8764 fi
8765 rm -f conftest.$ac_objext conftest.$ac_ext
8766         echo "$as_me:8766: result: $cf_XOPEN_SOURCE_set" >&5
8767 echo "${ECHO_T}$cf_XOPEN_SOURCE_set" >&6
8768         if test $cf_XOPEN_SOURCE_set = yes
8769         then
8770                 cat >conftest.$ac_ext <<_ACEOF
8771 #line 8771 "configure"
8772 #include "confdefs.h"
8773 #include <stdlib.h>
8774 int
8775 main ()
8776 {
8777
8778 #if (_XOPEN_SOURCE - 0) < $cf_XOPEN_SOURCE
8779 make an error
8780 #endif
8781   ;
8782   return 0;
8783 }
8784 _ACEOF
8785 rm -f conftest.$ac_objext
8786 if { (eval echo "$as_me:8786: \"$ac_compile\"") >&5
8787   (eval $ac_compile) 2>&5
8788   ac_status=$?
8789   echo "$as_me:8789: \$? = $ac_status" >&5
8790   (exit $ac_status); } &&
8791          { ac_try='test -s conftest.$ac_objext'
8792   { (eval echo "$as_me:8792: \"$ac_try\"") >&5
8793   (eval $ac_try) 2>&5
8794   ac_status=$?
8795   echo "$as_me:8795: \$? = $ac_status" >&5
8796   (exit $ac_status); }; }; then
8797   cf_XOPEN_SOURCE_set_ok=yes
8798 else
8799   echo "$as_me: failed program was:" >&5
8800 cat conftest.$ac_ext >&5
8801 cf_XOPEN_SOURCE_set_ok=no
8802 fi
8803 rm -f conftest.$ac_objext conftest.$ac_ext
8804                 if test $cf_XOPEN_SOURCE_set_ok = no
8805                 then
8806                         { echo "$as_me:8806: WARNING: _XOPEN_SOURCE is lower than requested" >&5
8807 echo "$as_me: WARNING: _XOPEN_SOURCE is lower than requested" >&2;}
8808                 fi
8809         else
8810
8811 echo "$as_me:8811: checking if we should define _XOPEN_SOURCE" >&5
8812 echo $ECHO_N "checking if we should define _XOPEN_SOURCE... $ECHO_C" >&6
8813 if test "${cf_cv_xopen_source+set}" = set; then
8814   echo $ECHO_N "(cached) $ECHO_C" >&6
8815 else
8816
8817         cat >conftest.$ac_ext <<_ACEOF
8818 #line 8818 "configure"
8819 #include "confdefs.h"
8820
8821 #include <stdlib.h>
8822 #include <string.h>
8823 #include <sys/types.h>
8824
8825 int
8826 main ()
8827 {
8828
8829 #ifndef _XOPEN_SOURCE
8830 make an error
8831 #endif
8832   ;
8833   return 0;
8834 }
8835 _ACEOF
8836 rm -f conftest.$ac_objext
8837 if { (eval echo "$as_me:8837: \"$ac_compile\"") >&5
8838   (eval $ac_compile) 2>&5
8839   ac_status=$?
8840   echo "$as_me:8840: \$? = $ac_status" >&5
8841   (exit $ac_status); } &&
8842          { ac_try='test -s conftest.$ac_objext'
8843   { (eval echo "$as_me:8843: \"$ac_try\"") >&5
8844   (eval $ac_try) 2>&5
8845   ac_status=$?
8846   echo "$as_me:8846: \$? = $ac_status" >&5
8847   (exit $ac_status); }; }; then
8848   cf_cv_xopen_source=no
8849 else
8850   echo "$as_me: failed program was:" >&5
8851 cat conftest.$ac_ext >&5
8852 cf_save="$CPPFLAGS"
8853          CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
8854          cat >conftest.$ac_ext <<_ACEOF
8855 #line 8855 "configure"
8856 #include "confdefs.h"
8857
8858 #include <stdlib.h>
8859 #include <string.h>
8860 #include <sys/types.h>
8861
8862 int
8863 main ()
8864 {
8865
8866 #ifdef _XOPEN_SOURCE
8867 make an error
8868 #endif
8869   ;
8870   return 0;
8871 }
8872 _ACEOF
8873 rm -f conftest.$ac_objext
8874 if { (eval echo "$as_me:8874: \"$ac_compile\"") >&5
8875   (eval $ac_compile) 2>&5
8876   ac_status=$?
8877   echo "$as_me:8877: \$? = $ac_status" >&5
8878   (exit $ac_status); } &&
8879          { ac_try='test -s conftest.$ac_objext'
8880   { (eval echo "$as_me:8880: \"$ac_try\"") >&5
8881   (eval $ac_try) 2>&5
8882   ac_status=$?
8883   echo "$as_me:8883: \$? = $ac_status" >&5
8884   (exit $ac_status); }; }; then
8885   cf_cv_xopen_source=no
8886 else
8887   echo "$as_me: failed program was:" >&5
8888 cat conftest.$ac_ext >&5
8889 cf_cv_xopen_source=$cf_XOPEN_SOURCE
8890 fi
8891 rm -f conftest.$ac_objext conftest.$ac_ext
8892         CPPFLAGS="$cf_save"
8893
8894 fi
8895 rm -f conftest.$ac_objext conftest.$ac_ext
8896
8897 fi
8898 echo "$as_me:8898: result: $cf_cv_xopen_source" >&5
8899 echo "${ECHO_T}$cf_cv_xopen_source" >&6
8900
8901 if test "$cf_cv_xopen_source" != no ; then
8902
8903 CFLAGS=`echo "$CFLAGS" | \
8904         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
8905                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
8906
8907 CPPFLAGS=`echo "$CPPFLAGS" | \
8908         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
8909                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
8910
8911         cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source"
8912
8913 cf_fix_cppflags=no
8914 cf_new_cflags=
8915 cf_new_cppflags=
8916 cf_new_extra_cppflags=
8917
8918 for cf_add_cflags in $cf_temp_xopen_source
8919 do
8920 case $cf_fix_cppflags in
8921 no)
8922         case $cf_add_cflags in #(vi
8923         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
8924                 case $cf_add_cflags in
8925                 -D*)
8926                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
8927
8928                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
8929                                 && test -z "${cf_tst_cflags}" \
8930                                 && cf_fix_cppflags=yes
8931
8932                         if test $cf_fix_cppflags = yes ; then
8933                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
8934                                 continue
8935                         elif test "${cf_tst_cflags}" = "\"'" ; then
8936                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
8937                                 continue
8938                         fi
8939                         ;;
8940                 esac
8941                 case "$CPPFLAGS" in
8942                 *$cf_add_cflags) #(vi
8943                         ;;
8944                 *) #(vi
8945                         case $cf_add_cflags in #(vi
8946                         -D*)
8947                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
8948
8949 CPPFLAGS=`echo "$CPPFLAGS" | \
8950         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
8951                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
8952
8953                                 ;;
8954                         esac
8955                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
8956                         ;;
8957                 esac
8958                 ;;
8959         *)
8960                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
8961                 ;;
8962         esac
8963         ;;
8964 yes)
8965         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
8966
8967         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
8968
8969         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
8970                 && test -z "${cf_tst_cflags}" \
8971                 && cf_fix_cppflags=no
8972         ;;
8973 esac
8974 done
8975
8976 if test -n "$cf_new_cflags" ; then
8977
8978         CFLAGS="$CFLAGS $cf_new_cflags"
8979 fi
8980
8981 if test -n "$cf_new_cppflags" ; then
8982
8983         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
8984 fi
8985
8986 if test -n "$cf_new_extra_cppflags" ; then
8987
8988         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
8989 fi
8990
8991 fi
8992
8993         fi
8994 fi
8995
8996 # Check whether --enable-largefile or --disable-largefile was given.
8997 if test "${enable_largefile+set}" = set; then
8998   enableval="$enable_largefile"
8999
9000 fi;
9001 if test "$enable_largefile" != no; then
9002
9003   echo "$as_me:9003: checking for special C compiler options needed for large files" >&5
9004 echo $ECHO_N "checking for special C compiler options needed for large files... $ECHO_C" >&6
9005 if test "${ac_cv_sys_largefile_CC+set}" = set; then
9006   echo $ECHO_N "(cached) $ECHO_C" >&6
9007 else
9008   ac_cv_sys_largefile_CC=no
9009      if test "$GCC" != yes; then
9010        ac_save_CC=$CC
9011        while :; do
9012          # IRIX 6.2 and later do not support large files by default,
9013          # so use the C compiler's -n32 option if that helps.
9014          cat >conftest.$ac_ext <<_ACEOF
9015 #line 9015 "configure"
9016 #include "confdefs.h"
9017 #include <sys/types.h>
9018  /* Check that off_t can represent 2**63 - 1 correctly.
9019     We can't simply define LARGE_OFF_T to be 9223372036854775807,
9020     since some C++ compilers masquerading as C compilers
9021     incorrectly reject 9223372036854775807.  */
9022 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
9023   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
9024                        && LARGE_OFF_T % 2147483647 == 1)
9025                       ? 1 : -1];
9026 int
9027 main ()
9028 {
9029
9030   ;
9031   return 0;
9032 }
9033 _ACEOF
9034          rm -f conftest.$ac_objext
9035 if { (eval echo "$as_me:9035: \"$ac_compile\"") >&5
9036   (eval $ac_compile) 2>&5
9037   ac_status=$?
9038   echo "$as_me:9038: \$? = $ac_status" >&5
9039   (exit $ac_status); } &&
9040          { ac_try='test -s conftest.$ac_objext'
9041   { (eval echo "$as_me:9041: \"$ac_try\"") >&5
9042   (eval $ac_try) 2>&5
9043   ac_status=$?
9044   echo "$as_me:9044: \$? = $ac_status" >&5
9045   (exit $ac_status); }; }; then
9046   break
9047 else
9048   echo "$as_me: failed program was:" >&5
9049 cat conftest.$ac_ext >&5
9050 fi
9051 rm -f conftest.$ac_objext
9052          CC="$CC -n32"
9053          rm -f conftest.$ac_objext
9054 if { (eval echo "$as_me:9054: \"$ac_compile\"") >&5
9055   (eval $ac_compile) 2>&5
9056   ac_status=$?
9057   echo "$as_me:9057: \$? = $ac_status" >&5
9058   (exit $ac_status); } &&
9059          { ac_try='test -s conftest.$ac_objext'
9060   { (eval echo "$as_me:9060: \"$ac_try\"") >&5
9061   (eval $ac_try) 2>&5
9062   ac_status=$?
9063   echo "$as_me:9063: \$? = $ac_status" >&5
9064   (exit $ac_status); }; }; then
9065   ac_cv_sys_largefile_CC=' -n32'; break
9066 else
9067   echo "$as_me: failed program was:" >&5
9068 cat conftest.$ac_ext >&5
9069 fi
9070 rm -f conftest.$ac_objext
9071          break
9072        done
9073        CC=$ac_save_CC
9074        rm -f conftest.$ac_ext
9075     fi
9076 fi
9077 echo "$as_me:9077: result: $ac_cv_sys_largefile_CC" >&5
9078 echo "${ECHO_T}$ac_cv_sys_largefile_CC" >&6
9079   if test "$ac_cv_sys_largefile_CC" != no; then
9080     CC=$CC$ac_cv_sys_largefile_CC
9081   fi
9082
9083   echo "$as_me:9083: checking for _FILE_OFFSET_BITS value needed for large files" >&5
9084 echo $ECHO_N "checking for _FILE_OFFSET_BITS value needed for large files... $ECHO_C" >&6
9085 if test "${ac_cv_sys_file_offset_bits+set}" = set; then
9086   echo $ECHO_N "(cached) $ECHO_C" >&6
9087 else
9088   while :; do
9089   ac_cv_sys_file_offset_bits=no
9090   cat >conftest.$ac_ext <<_ACEOF
9091 #line 9091 "configure"
9092 #include "confdefs.h"
9093 #include <sys/types.h>
9094  /* Check that off_t can represent 2**63 - 1 correctly.
9095     We can't simply define LARGE_OFF_T to be 9223372036854775807,
9096     since some C++ compilers masquerading as C compilers
9097     incorrectly reject 9223372036854775807.  */
9098 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
9099   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
9100                        && LARGE_OFF_T % 2147483647 == 1)
9101                       ? 1 : -1];
9102 int
9103 main ()
9104 {
9105
9106   ;
9107   return 0;
9108 }
9109 _ACEOF
9110 rm -f conftest.$ac_objext
9111 if { (eval echo "$as_me:9111: \"$ac_compile\"") >&5
9112   (eval $ac_compile) 2>&5
9113   ac_status=$?
9114   echo "$as_me:9114: \$? = $ac_status" >&5
9115   (exit $ac_status); } &&
9116          { ac_try='test -s conftest.$ac_objext'
9117   { (eval echo "$as_me:9117: \"$ac_try\"") >&5
9118   (eval $ac_try) 2>&5
9119   ac_status=$?
9120   echo "$as_me:9120: \$? = $ac_status" >&5
9121   (exit $ac_status); }; }; then
9122   break
9123 else
9124   echo "$as_me: failed program was:" >&5
9125 cat conftest.$ac_ext >&5
9126 fi
9127 rm -f conftest.$ac_objext conftest.$ac_ext
9128   cat >conftest.$ac_ext <<_ACEOF
9129 #line 9129 "configure"
9130 #include "confdefs.h"
9131 #define _FILE_OFFSET_BITS 64
9132 #include <sys/types.h>
9133  /* Check that off_t can represent 2**63 - 1 correctly.
9134     We can't simply define LARGE_OFF_T to be 9223372036854775807,
9135     since some C++ compilers masquerading as C compilers
9136     incorrectly reject 9223372036854775807.  */
9137 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
9138   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
9139                        && LARGE_OFF_T % 2147483647 == 1)
9140                       ? 1 : -1];
9141 int
9142 main ()
9143 {
9144
9145   ;
9146   return 0;
9147 }
9148 _ACEOF
9149 rm -f conftest.$ac_objext
9150 if { (eval echo "$as_me:9150: \"$ac_compile\"") >&5
9151   (eval $ac_compile) 2>&5
9152   ac_status=$?
9153   echo "$as_me:9153: \$? = $ac_status" >&5
9154   (exit $ac_status); } &&
9155          { ac_try='test -s conftest.$ac_objext'
9156   { (eval echo "$as_me:9156: \"$ac_try\"") >&5
9157   (eval $ac_try) 2>&5
9158   ac_status=$?
9159   echo "$as_me:9159: \$? = $ac_status" >&5
9160   (exit $ac_status); }; }; then
9161   ac_cv_sys_file_offset_bits=64; break
9162 else
9163   echo "$as_me: failed program was:" >&5
9164 cat conftest.$ac_ext >&5
9165 fi
9166 rm -f conftest.$ac_objext conftest.$ac_ext
9167   break
9168 done
9169 fi
9170 echo "$as_me:9170: result: $ac_cv_sys_file_offset_bits" >&5
9171 echo "${ECHO_T}$ac_cv_sys_file_offset_bits" >&6
9172 if test "$ac_cv_sys_file_offset_bits" != no; then
9173
9174 cat >>confdefs.h <<EOF
9175 #define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits
9176 EOF
9177
9178 fi
9179 rm -rf conftest*
9180   echo "$as_me:9180: checking for _LARGE_FILES value needed for large files" >&5
9181 echo $ECHO_N "checking for _LARGE_FILES value needed for large files... $ECHO_C" >&6
9182 if test "${ac_cv_sys_large_files+set}" = set; then
9183   echo $ECHO_N "(cached) $ECHO_C" >&6
9184 else
9185   while :; do
9186   ac_cv_sys_large_files=no
9187   cat >conftest.$ac_ext <<_ACEOF
9188 #line 9188 "configure"
9189 #include "confdefs.h"
9190 #include <sys/types.h>
9191  /* Check that off_t can represent 2**63 - 1 correctly.
9192     We can't simply define LARGE_OFF_T to be 9223372036854775807,
9193     since some C++ compilers masquerading as C compilers
9194     incorrectly reject 9223372036854775807.  */
9195 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
9196   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
9197                        && LARGE_OFF_T % 2147483647 == 1)
9198                       ? 1 : -1];
9199 int
9200 main ()
9201 {
9202
9203   ;
9204   return 0;
9205 }
9206 _ACEOF
9207 rm -f conftest.$ac_objext
9208 if { (eval echo "$as_me:9208: \"$ac_compile\"") >&5
9209   (eval $ac_compile) 2>&5
9210   ac_status=$?
9211   echo "$as_me:9211: \$? = $ac_status" >&5
9212   (exit $ac_status); } &&
9213          { ac_try='test -s conftest.$ac_objext'
9214   { (eval echo "$as_me:9214: \"$ac_try\"") >&5
9215   (eval $ac_try) 2>&5
9216   ac_status=$?
9217   echo "$as_me:9217: \$? = $ac_status" >&5
9218   (exit $ac_status); }; }; then
9219   break
9220 else
9221   echo "$as_me: failed program was:" >&5
9222 cat conftest.$ac_ext >&5
9223 fi
9224 rm -f conftest.$ac_objext conftest.$ac_ext
9225   cat >conftest.$ac_ext <<_ACEOF
9226 #line 9226 "configure"
9227 #include "confdefs.h"
9228 #define _LARGE_FILES 1
9229 #include <sys/types.h>
9230  /* Check that off_t can represent 2**63 - 1 correctly.
9231     We can't simply define LARGE_OFF_T to be 9223372036854775807,
9232     since some C++ compilers masquerading as C compilers
9233     incorrectly reject 9223372036854775807.  */
9234 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
9235   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
9236                        && LARGE_OFF_T % 2147483647 == 1)
9237                       ? 1 : -1];
9238 int
9239 main ()
9240 {
9241
9242   ;
9243   return 0;
9244 }
9245 _ACEOF
9246 rm -f conftest.$ac_objext
9247 if { (eval echo "$as_me:9247: \"$ac_compile\"") >&5
9248   (eval $ac_compile) 2>&5
9249   ac_status=$?
9250   echo "$as_me:9250: \$? = $ac_status" >&5
9251   (exit $ac_status); } &&
9252          { ac_try='test -s conftest.$ac_objext'
9253   { (eval echo "$as_me:9253: \"$ac_try\"") >&5
9254   (eval $ac_try) 2>&5
9255   ac_status=$?
9256   echo "$as_me:9256: \$? = $ac_status" >&5
9257   (exit $ac_status); }; }; then
9258   ac_cv_sys_large_files=1; break
9259 else
9260   echo "$as_me: failed program was:" >&5
9261 cat conftest.$ac_ext >&5
9262 fi
9263 rm -f conftest.$ac_objext conftest.$ac_ext
9264   break
9265 done
9266 fi
9267 echo "$as_me:9267: result: $ac_cv_sys_large_files" >&5
9268 echo "${ECHO_T}$ac_cv_sys_large_files" >&6
9269 if test "$ac_cv_sys_large_files" != no; then
9270
9271 cat >>confdefs.h <<EOF
9272 #define _LARGE_FILES $ac_cv_sys_large_files
9273 EOF
9274
9275 fi
9276 rm -rf conftest*
9277 fi
9278
9279     if test "$enable_largefile" != no ; then
9280         echo "$as_me:9280: checking for _LARGEFILE_SOURCE value needed for large files" >&5
9281 echo $ECHO_N "checking for _LARGEFILE_SOURCE value needed for large files... $ECHO_C" >&6
9282 if test "${ac_cv_sys_largefile_source+set}" = set; then
9283   echo $ECHO_N "(cached) $ECHO_C" >&6
9284 else
9285   while :; do
9286   ac_cv_sys_largefile_source=no
9287   cat >conftest.$ac_ext <<_ACEOF
9288 #line 9288 "configure"
9289 #include "confdefs.h"
9290 #include <stdio.h>
9291 int
9292 main ()
9293 {
9294 return !fseeko;
9295   ;
9296   return 0;
9297 }
9298 _ACEOF
9299 rm -f conftest.$ac_objext
9300 if { (eval echo "$as_me:9300: \"$ac_compile\"") >&5
9301   (eval $ac_compile) 2>&5
9302   ac_status=$?
9303   echo "$as_me:9303: \$? = $ac_status" >&5
9304   (exit $ac_status); } &&
9305          { ac_try='test -s conftest.$ac_objext'
9306   { (eval echo "$as_me:9306: \"$ac_try\"") >&5
9307   (eval $ac_try) 2>&5
9308   ac_status=$?
9309   echo "$as_me:9309: \$? = $ac_status" >&5
9310   (exit $ac_status); }; }; then
9311   break
9312 else
9313   echo "$as_me: failed program was:" >&5
9314 cat conftest.$ac_ext >&5
9315 fi
9316 rm -f conftest.$ac_objext conftest.$ac_ext
9317   cat >conftest.$ac_ext <<_ACEOF
9318 #line 9318 "configure"
9319 #include "confdefs.h"
9320 #define _LARGEFILE_SOURCE 1
9321 #include <stdio.h>
9322 int
9323 main ()
9324 {
9325 return !fseeko;
9326   ;
9327   return 0;
9328 }
9329 _ACEOF
9330 rm -f conftest.$ac_objext
9331 if { (eval echo "$as_me:9331: \"$ac_compile\"") >&5
9332   (eval $ac_compile) 2>&5
9333   ac_status=$?
9334   echo "$as_me:9334: \$? = $ac_status" >&5
9335   (exit $ac_status); } &&
9336          { ac_try='test -s conftest.$ac_objext'
9337   { (eval echo "$as_me:9337: \"$ac_try\"") >&5
9338   (eval $ac_try) 2>&5
9339   ac_status=$?
9340   echo "$as_me:9340: \$? = $ac_status" >&5
9341   (exit $ac_status); }; }; then
9342   ac_cv_sys_largefile_source=1; break
9343 else
9344   echo "$as_me: failed program was:" >&5
9345 cat conftest.$ac_ext >&5
9346 fi
9347 rm -f conftest.$ac_objext conftest.$ac_ext
9348   break
9349 done
9350 fi
9351 echo "$as_me:9351: result: $ac_cv_sys_largefile_source" >&5
9352 echo "${ECHO_T}$ac_cv_sys_largefile_source" >&6
9353 if test "$ac_cv_sys_largefile_source" != no; then
9354
9355 cat >>confdefs.h <<EOF
9356 #define _LARGEFILE_SOURCE $ac_cv_sys_largefile_source
9357 EOF
9358
9359 fi
9360 rm -rf conftest*
9361
9362 # We used to try defining _XOPEN_SOURCE=500 too, to work around a bug
9363 # in glibc 2.1.3, but that breaks too many other things.
9364 # If you want fseeko and ftello with glibc, upgrade to a fixed glibc.
9365 echo "$as_me:9365: checking for fseeko" >&5
9366 echo $ECHO_N "checking for fseeko... $ECHO_C" >&6
9367 if test "${ac_cv_func_fseeko+set}" = set; then
9368   echo $ECHO_N "(cached) $ECHO_C" >&6
9369 else
9370   cat >conftest.$ac_ext <<_ACEOF
9371 #line 9371 "configure"
9372 #include "confdefs.h"
9373 #include <stdio.h>
9374 int
9375 main ()
9376 {
9377 return fseeko && fseeko (stdin, 0, 0);
9378   ;
9379   return 0;
9380 }
9381 _ACEOF
9382 rm -f conftest.$ac_objext conftest$ac_exeext
9383 if { (eval echo "$as_me:9383: \"$ac_link\"") >&5
9384   (eval $ac_link) 2>&5
9385   ac_status=$?
9386   echo "$as_me:9386: \$? = $ac_status" >&5
9387   (exit $ac_status); } &&
9388          { ac_try='test -s conftest$ac_exeext'
9389   { (eval echo "$as_me:9389: \"$ac_try\"") >&5
9390   (eval $ac_try) 2>&5
9391   ac_status=$?
9392   echo "$as_me:9392: \$? = $ac_status" >&5
9393   (exit $ac_status); }; }; then
9394   ac_cv_func_fseeko=yes
9395 else
9396   echo "$as_me: failed program was:" >&5
9397 cat conftest.$ac_ext >&5
9398 ac_cv_func_fseeko=no
9399 fi
9400 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9401 fi
9402 echo "$as_me:9402: result: $ac_cv_func_fseeko" >&5
9403 echo "${ECHO_T}$ac_cv_func_fseeko" >&6
9404 if test $ac_cv_func_fseeko = yes; then
9405
9406 cat >>confdefs.h <<\EOF
9407 #define HAVE_FSEEKO 1
9408 EOF
9409
9410 fi
9411
9412         # Normally we would collect these definitions in the config.h,
9413         # but (like _XOPEN_SOURCE), some environments rely on having these
9414         # defined before any of the system headers are included.  Another
9415         # case comes up with C++, e.g., on AIX the compiler compiles the
9416         # header files by themselves before looking at the body files it is
9417         # told to compile.  For ncurses, those header files do not include
9418         # the config.h
9419         test "$ac_cv_sys_large_files"      != no && CPPFLAGS="$CPPFLAGS -D_LARGE_FILES "
9420         test "$ac_cv_sys_largefile_source" != no && CPPFLAGS="$CPPFLAGS -D_LARGEFILE_SOURCE "
9421         test "$ac_cv_sys_file_offset_bits" != no && CPPFLAGS="$CPPFLAGS -D_FILE_OFFSET_BITS=$ac_cv_sys_file_offset_bits "
9422
9423         echo "$as_me:9423: checking whether to use struct dirent64" >&5
9424 echo $ECHO_N "checking whether to use struct dirent64... $ECHO_C" >&6
9425 if test "${cf_cv_struct_dirent64+set}" = set; then
9426   echo $ECHO_N "(cached) $ECHO_C" >&6
9427 else
9428
9429                 cat >conftest.$ac_ext <<_ACEOF
9430 #line 9430 "configure"
9431 #include "confdefs.h"
9432
9433 #include <sys/types.h>
9434 #include <dirent.h>
9435
9436 int
9437 main ()
9438 {
9439
9440                 /* if transitional largefile support is setup, this is true */
9441                 extern struct dirent64 * readdir(DIR *);
9442                 struct dirent64 *x = readdir((DIR *)0);
9443                 struct dirent *y = readdir((DIR *)0);
9444                 int z = x - y;
9445
9446   ;
9447   return 0;
9448 }
9449 _ACEOF
9450 rm -f conftest.$ac_objext
9451 if { (eval echo "$as_me:9451: \"$ac_compile\"") >&5
9452   (eval $ac_compile) 2>&5
9453   ac_status=$?
9454   echo "$as_me:9454: \$? = $ac_status" >&5
9455   (exit $ac_status); } &&
9456          { ac_try='test -s conftest.$ac_objext'
9457   { (eval echo "$as_me:9457: \"$ac_try\"") >&5
9458   (eval $ac_try) 2>&5
9459   ac_status=$?
9460   echo "$as_me:9460: \$? = $ac_status" >&5
9461   (exit $ac_status); }; }; then
9462   cf_cv_struct_dirent64=yes
9463 else
9464   echo "$as_me: failed program was:" >&5
9465 cat conftest.$ac_ext >&5
9466 cf_cv_struct_dirent64=no
9467 fi
9468 rm -f conftest.$ac_objext conftest.$ac_ext
9469
9470 fi
9471 echo "$as_me:9471: result: $cf_cv_struct_dirent64" >&5
9472 echo "${ECHO_T}$cf_cv_struct_dirent64" >&6
9473         test "$cf_cv_struct_dirent64" = yes &&
9474 cat >>confdefs.h <<\EOF
9475 #define HAVE_STRUCT_DIRENT64 1
9476 EOF
9477
9478     fi
9479
9480 ### Enable compiling-in rcs id's
9481 echo "$as_me:9481: checking if RCS identifiers should be compiled-in" >&5
9482 echo $ECHO_N "checking if RCS identifiers should be compiled-in... $ECHO_C" >&6
9483
9484 # Check whether --with-rcs-ids or --without-rcs-ids was given.
9485 if test "${with_rcs_ids+set}" = set; then
9486   withval="$with_rcs_ids"
9487   with_rcs_ids=$withval
9488 else
9489   with_rcs_ids=no
9490 fi;
9491 echo "$as_me:9491: result: $with_rcs_ids" >&5
9492 echo "${ECHO_T}$with_rcs_ids" >&6
9493 test "$with_rcs_ids" = yes &&
9494 cat >>confdefs.h <<\EOF
9495 #define USE_RCS_IDS 1
9496 EOF
9497
9498 ###############################################################################
9499
9500 ### Note that some functions (such as const) are normally disabled anyway.
9501 echo "$as_me:9501: checking if you want to build with function extensions" >&5
9502 echo $ECHO_N "checking if you want to build with function extensions... $ECHO_C" >&6
9503
9504 # Check whether --enable-ext-funcs or --disable-ext-funcs was given.
9505 if test "${enable_ext_funcs+set}" = set; then
9506   enableval="$enable_ext_funcs"
9507   with_ext_funcs=$enableval
9508 else
9509   with_ext_funcs=yes
9510 fi;
9511 echo "$as_me:9511: result: $with_ext_funcs" >&5
9512 echo "${ECHO_T}$with_ext_funcs" >&6
9513 if test "$with_ext_funcs" = yes ; then
9514         NCURSES_EXT_FUNCS=1
9515
9516 cat >>confdefs.h <<\EOF
9517 #define HAVE_USE_DEFAULT_COLORS 1
9518 EOF
9519
9520 cat >>confdefs.h <<\EOF
9521 #define NCURSES_EXT_FUNCS 1
9522 EOF
9523
9524 else
9525         NCURSES_EXT_FUNCS=0
9526 fi
9527
9528 ###   use option --enable-const to turn on use of const beyond that in XSI.
9529 echo "$as_me:9529: checking for extended use of const keyword" >&5
9530 echo $ECHO_N "checking for extended use of const keyword... $ECHO_C" >&6
9531
9532 # Check whether --enable-const or --disable-const was given.
9533 if test "${enable_const+set}" = set; then
9534   enableval="$enable_const"
9535   with_ext_const=$enableval
9536 else
9537   with_ext_const=no
9538 fi;
9539 echo "$as_me:9539: result: $with_ext_const" >&5
9540 echo "${ECHO_T}$with_ext_const" >&6
9541 NCURSES_CONST='/*nothing*/'
9542 if test "$with_ext_const" = yes ; then
9543         NCURSES_CONST=const
9544 fi
9545
9546 ###############################################################################
9547 # These options are relatively safe to experiment with.
9548
9549 echo "$as_me:9549: checking if you want all development code" >&5
9550 echo $ECHO_N "checking if you want all development code... $ECHO_C" >&6
9551
9552 # Check whether --with-develop or --without-develop was given.
9553 if test "${with_develop+set}" = set; then
9554   withval="$with_develop"
9555   with_develop=$withval
9556 else
9557   with_develop=no
9558 fi;
9559 echo "$as_me:9559: result: $with_develop" >&5
9560 echo "${ECHO_T}$with_develop" >&6
9561
9562 ###############################################################################
9563 # These are just experimental, probably should not be in a package:
9564
9565 # This is still experimental (20080329), but should ultimately be moved to
9566 # the script-block --with-normal, etc.
9567
9568 echo "$as_me:9568: checking if you want to link with the pthread library" >&5
9569 echo $ECHO_N "checking if you want to link with the pthread library... $ECHO_C" >&6
9570
9571 # Check whether --with-pthread or --without-pthread was given.
9572 if test "${with_pthread+set}" = set; then
9573   withval="$with_pthread"
9574   with_pthread=$withval
9575 else
9576   with_pthread=no
9577 fi;
9578 echo "$as_me:9578: result: $with_pthread" >&5
9579 echo "${ECHO_T}$with_pthread" >&6
9580
9581 if test "$with_pthread" != no ; then
9582     echo "$as_me:9582: checking for pthread.h" >&5
9583 echo $ECHO_N "checking for pthread.h... $ECHO_C" >&6
9584 if test "${ac_cv_header_pthread_h+set}" = set; then
9585   echo $ECHO_N "(cached) $ECHO_C" >&6
9586 else
9587   cat >conftest.$ac_ext <<_ACEOF
9588 #line 9588 "configure"
9589 #include "confdefs.h"
9590 #include <pthread.h>
9591 _ACEOF
9592 if { (eval echo "$as_me:9592: \"$ac_cpp conftest.$ac_ext\"") >&5
9593   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
9594   ac_status=$?
9595   egrep -v '^ *\+' conftest.er1 >conftest.err
9596   rm -f conftest.er1
9597   cat conftest.err >&5
9598   echo "$as_me:9598: \$? = $ac_status" >&5
9599   (exit $ac_status); } >/dev/null; then
9600   if test -s conftest.err; then
9601     ac_cpp_err=$ac_c_preproc_warn_flag
9602   else
9603     ac_cpp_err=
9604   fi
9605 else
9606   ac_cpp_err=yes
9607 fi
9608 if test -z "$ac_cpp_err"; then
9609   ac_cv_header_pthread_h=yes
9610 else
9611   echo "$as_me: failed program was:" >&5
9612   cat conftest.$ac_ext >&5
9613   ac_cv_header_pthread_h=no
9614 fi
9615 rm -f conftest.err conftest.$ac_ext
9616 fi
9617 echo "$as_me:9617: result: $ac_cv_header_pthread_h" >&5
9618 echo "${ECHO_T}$ac_cv_header_pthread_h" >&6
9619 if test $ac_cv_header_pthread_h = yes; then
9620
9621 cat >>confdefs.h <<\EOF
9622 #define HAVE_PTHREADS_H 1
9623 EOF
9624
9625         for cf_lib_pthread in pthread c_r
9626         do
9627             echo "$as_me:9627: checking if we can link with the $cf_lib_pthread library" >&5
9628 echo $ECHO_N "checking if we can link with the $cf_lib_pthread library... $ECHO_C" >&6
9629             cf_save_LIBS="$LIBS"
9630
9631 cf_add_libs="-l$cf_lib_pthread"
9632 # Filter out duplicates - this happens with badly-designed ".pc" files...
9633 for cf_add_1lib in $LIBS
9634 do
9635         for cf_add_2lib in $cf_add_libs
9636         do
9637                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
9638                 then
9639                         cf_add_1lib=
9640                         break
9641                 fi
9642         done
9643         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
9644 done
9645 LIBS="$cf_add_libs"
9646
9647             cat >conftest.$ac_ext <<_ACEOF
9648 #line 9648 "configure"
9649 #include "confdefs.h"
9650
9651 #include <pthread.h>
9652
9653 int
9654 main ()
9655 {
9656
9657                 int rc = pthread_create(0,0,0,0);
9658                 int r2 = pthread_mutexattr_settype(0, 0);
9659
9660   ;
9661   return 0;
9662 }
9663 _ACEOF
9664 rm -f conftest.$ac_objext conftest$ac_exeext
9665 if { (eval echo "$as_me:9665: \"$ac_link\"") >&5
9666   (eval $ac_link) 2>&5
9667   ac_status=$?
9668   echo "$as_me:9668: \$? = $ac_status" >&5
9669   (exit $ac_status); } &&
9670          { ac_try='test -s conftest$ac_exeext'
9671   { (eval echo "$as_me:9671: \"$ac_try\"") >&5
9672   (eval $ac_try) 2>&5
9673   ac_status=$?
9674   echo "$as_me:9674: \$? = $ac_status" >&5
9675   (exit $ac_status); }; }; then
9676   with_pthread=yes
9677 else
9678   echo "$as_me: failed program was:" >&5
9679 cat conftest.$ac_ext >&5
9680 with_pthread=no
9681 fi
9682 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9683             LIBS="$cf_save_LIBS"
9684             echo "$as_me:9684: result: $with_pthread" >&5
9685 echo "${ECHO_T}$with_pthread" >&6
9686             test "$with_pthread" = yes && break
9687         done
9688
9689         if test "$with_pthread" = yes ; then
9690
9691 cf_add_libs="-l$cf_lib_pthread"
9692 # Filter out duplicates - this happens with badly-designed ".pc" files...
9693 for cf_add_1lib in $LIBS
9694 do
9695         for cf_add_2lib in $cf_add_libs
9696         do
9697                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
9698                 then
9699                         cf_add_1lib=
9700                         break
9701                 fi
9702         done
9703         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
9704 done
9705 LIBS="$cf_add_libs"
9706
9707 cat >>confdefs.h <<\EOF
9708 #define HAVE_LIBPTHREADS 1
9709 EOF
9710
9711         else
9712             { { echo "$as_me:9712: error: Cannot link with pthread library" >&5
9713 echo "$as_me: error: Cannot link with pthread library" >&2;}
9714    { (exit 1); exit 1; }; }
9715         fi
9716
9717 fi
9718
9719 fi
9720
9721 echo "$as_me:9721: checking if you want to use weak-symbols for pthreads" >&5
9722 echo $ECHO_N "checking if you want to use weak-symbols for pthreads... $ECHO_C" >&6
9723
9724 # Check whether --enable-weak-symbols or --disable-weak-symbols was given.
9725 if test "${enable_weak_symbols+set}" = set; then
9726   enableval="$enable_weak_symbols"
9727   use_weak_symbols=$withval
9728 else
9729   use_weak_symbols=no
9730 fi;
9731 echo "$as_me:9731: result: $use_weak_symbols" >&5
9732 echo "${ECHO_T}$use_weak_symbols" >&6
9733 if test "$use_weak_symbols" = yes ; then
9734
9735 echo "$as_me:9735: checking if $CC supports weak symbols" >&5
9736 echo $ECHO_N "checking if $CC supports weak symbols... $ECHO_C" >&6
9737 if test "${cf_cv_weak_symbols+set}" = set; then
9738   echo $ECHO_N "(cached) $ECHO_C" >&6
9739 else
9740
9741 cat >conftest.$ac_ext <<_ACEOF
9742 #line 9742 "configure"
9743 #include "confdefs.h"
9744
9745 #include <stdio.h>
9746 int
9747 main ()
9748 {
9749
9750 #if defined(__GNUC__)
9751 #  if defined __USE_ISOC99
9752 #    define _cat_pragma(exp)    _Pragma(#exp)
9753 #    define _weak_pragma(exp)   _cat_pragma(weak name)
9754 #  else
9755 #    define _weak_pragma(exp)
9756 #  endif
9757 #  define _declare(name)        __extension__ extern __typeof__(name) name
9758 #  define weak_symbol(name)     _weak_pragma(name) _declare(name) __attribute__((weak))
9759 #endif
9760
9761 weak_symbol(fopen);
9762
9763   ;
9764   return 0;
9765 }
9766 _ACEOF
9767 rm -f conftest.$ac_objext
9768 if { (eval echo "$as_me:9768: \"$ac_compile\"") >&5
9769   (eval $ac_compile) 2>&5
9770   ac_status=$?
9771   echo "$as_me:9771: \$? = $ac_status" >&5
9772   (exit $ac_status); } &&
9773          { ac_try='test -s conftest.$ac_objext'
9774   { (eval echo "$as_me:9774: \"$ac_try\"") >&5
9775   (eval $ac_try) 2>&5
9776   ac_status=$?
9777   echo "$as_me:9777: \$? = $ac_status" >&5
9778   (exit $ac_status); }; }; then
9779   cf_cv_weak_symbols=yes
9780 else
9781   echo "$as_me: failed program was:" >&5
9782 cat conftest.$ac_ext >&5
9783 cf_cv_weak_symbols=no
9784 fi
9785 rm -f conftest.$ac_objext conftest.$ac_ext
9786
9787 fi
9788 echo "$as_me:9788: result: $cf_cv_weak_symbols" >&5
9789 echo "${ECHO_T}$cf_cv_weak_symbols" >&6
9790
9791 else
9792     cf_cv_weak_symbols=no
9793 fi
9794
9795 if test $cf_cv_weak_symbols = yes ; then
9796
9797 cat >>confdefs.h <<\EOF
9798 #define USE_WEAK_SYMBOLS 1
9799 EOF
9800
9801 fi
9802
9803 PTHREAD=
9804 if test "$with_pthread" = "yes" ; then
9805
9806 cat >>confdefs.h <<\EOF
9807 #define USE_PTHREADS 1
9808 EOF
9809
9810     enable_reentrant=yes
9811     if test $cf_cv_weak_symbols = yes ; then
9812         PTHREAD=-lpthread
9813     fi
9814 fi
9815
9816 # OpenSUSE is installing ncurses6, using reentrant option.
9817 echo "$as_me:9817: checking for _nc_TABSIZE" >&5
9818 echo $ECHO_N "checking for _nc_TABSIZE... $ECHO_C" >&6
9819 if test "${ac_cv_func__nc_TABSIZE+set}" = set; then
9820   echo $ECHO_N "(cached) $ECHO_C" >&6
9821 else
9822   cat >conftest.$ac_ext <<_ACEOF
9823 #line 9823 "configure"
9824 #include "confdefs.h"
9825 /* System header to define __stub macros and hopefully few prototypes,
9826     which can conflict with char _nc_TABSIZE (); below.  */
9827 #include <assert.h>
9828 /* Override any gcc2 internal prototype to avoid an error.  */
9829 #ifdef __cplusplus
9830 extern "C"
9831 #endif
9832 /* We use char because int might match the return type of a gcc2
9833    builtin and then its argument prototype would still apply.  */
9834 char _nc_TABSIZE ();
9835 char (*f) ();
9836
9837 int
9838 main ()
9839 {
9840 /* The GNU C library defines this for functions which it implements
9841     to always fail with ENOSYS.  Some functions are actually named
9842     something starting with __ and the normal name is an alias.  */
9843 #if defined (__stub__nc_TABSIZE) || defined (__stub____nc_TABSIZE)
9844 choke me
9845 #else
9846 f = _nc_TABSIZE; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
9847 #endif
9848
9849   ;
9850   return 0;
9851 }
9852 _ACEOF
9853 rm -f conftest.$ac_objext conftest$ac_exeext
9854 if { (eval echo "$as_me:9854: \"$ac_link\"") >&5
9855   (eval $ac_link) 2>&5
9856   ac_status=$?
9857   echo "$as_me:9857: \$? = $ac_status" >&5
9858   (exit $ac_status); } &&
9859          { ac_try='test -s conftest$ac_exeext'
9860   { (eval echo "$as_me:9860: \"$ac_try\"") >&5
9861   (eval $ac_try) 2>&5
9862   ac_status=$?
9863   echo "$as_me:9863: \$? = $ac_status" >&5
9864   (exit $ac_status); }; }; then
9865   ac_cv_func__nc_TABSIZE=yes
9866 else
9867   echo "$as_me: failed program was:" >&5
9868 cat conftest.$ac_ext >&5
9869 ac_cv_func__nc_TABSIZE=no
9870 fi
9871 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9872 fi
9873 echo "$as_me:9873: result: $ac_cv_func__nc_TABSIZE" >&5
9874 echo "${ECHO_T}$ac_cv_func__nc_TABSIZE" >&6
9875 if test $ac_cv_func__nc_TABSIZE = yes; then
9876   assume_reentrant=yes
9877 else
9878   assume_reentrant=no
9879 fi
9880
9881 # Reentrant code has to be opaque; there's little advantage to making ncurses
9882 # opaque outside of that, so there is no --enable-opaque option.  We can use
9883 # this option without --with-pthreads, but this will be always set for
9884 # pthreads.
9885 echo "$as_me:9885: checking if you want experimental reentrant code" >&5
9886 echo $ECHO_N "checking if you want experimental reentrant code... $ECHO_C" >&6
9887
9888 # Check whether --enable-reentrant or --disable-reentrant was given.
9889 if test "${enable_reentrant+set}" = set; then
9890   enableval="$enable_reentrant"
9891   with_reentrant=$enableval
9892 else
9893   with_reentrant=$assume_reentrant
9894 fi;
9895 echo "$as_me:9895: result: $with_reentrant" >&5
9896 echo "${ECHO_T}$with_reentrant" >&6
9897 if test "$with_reentrant" = yes ; then
9898         cf_cv_enable_reentrant=1
9899         if test $cf_cv_weak_symbols = yes ; then
9900
9901 # remove pthread library from $LIBS
9902 LIBS=`echo "$LIBS" | sed -e 's/-lpthread[       ]//g' -e 's/-lpthread$//'`
9903
9904         elif test "$assume_reentrant" = no ; then
9905                 LIB_SUFFIX="t${LIB_SUFFIX}"
9906         fi
9907
9908 cat >>confdefs.h <<\EOF
9909 #define USE_REENTRANT 1
9910 EOF
9911
9912 else
9913         cf_cv_enable_reentrant=0
9914 fi
9915
9916 ### Allow using a different wrap-prefix
9917 if test "$cf_cv_enable_reentrant" != 0 || test "$BROKEN_LINKER" = 1 ; then
9918         echo "$as_me:9918: checking for prefix used to wrap public variables" >&5
9919 echo $ECHO_N "checking for prefix used to wrap public variables... $ECHO_C" >&6
9920
9921 # Check whether --with-wrap-prefix or --without-wrap-prefix was given.
9922 if test "${with_wrap_prefix+set}" = set; then
9923   withval="$with_wrap_prefix"
9924   NCURSES_WRAP_PREFIX=$withval
9925 else
9926   NCURSES_WRAP_PREFIX=_nc_
9927 fi;
9928         echo "$as_me:9928: result: $NCURSES_WRAP_PREFIX" >&5
9929 echo "${ECHO_T}$NCURSES_WRAP_PREFIX" >&6
9930 else
9931         NCURSES_WRAP_PREFIX=_nc_
9932 fi
9933
9934 cat >>confdefs.h <<EOF
9935 #define NCURSES_WRAP_PREFIX "$NCURSES_WRAP_PREFIX"
9936 EOF
9937
9938 ###############################################################################
9939
9940 ###     use option --disable-echo to suppress full display compiling commands
9941
9942 echo "$as_me:9942: checking if you want to see long compiling messages" >&5
9943 echo $ECHO_N "checking if you want to see long compiling messages... $ECHO_C" >&6
9944
9945 # Check whether --enable-echo or --disable-echo was given.
9946 if test "${enable_echo+set}" = set; then
9947   enableval="$enable_echo"
9948   test "$enableval" != no && enableval=yes
9949   if test "$enableval" != "yes" ; then
9950
9951     ECHO_LT='--silent'
9952     ECHO_LD='@echo linking $@;'
9953     RULE_CC='@echo compiling $<'
9954     SHOW_CC='@echo compiling $@'
9955     ECHO_CC='@'
9956
9957   else
9958
9959     ECHO_LT=''
9960     ECHO_LD=''
9961     RULE_CC=''
9962     SHOW_CC=''
9963     ECHO_CC=''
9964
9965   fi
9966 else
9967   enableval=yes
9968
9969     ECHO_LT=''
9970     ECHO_LD=''
9971     RULE_CC=''
9972     SHOW_CC=''
9973     ECHO_CC=''
9974
9975 fi;
9976 echo "$as_me:9976: result: $enableval" >&5
9977 echo "${ECHO_T}$enableval" >&6
9978
9979 ###     use option --enable-warnings to turn on all gcc warnings
9980 echo "$as_me:9980: checking if you want to see compiler warnings" >&5
9981 echo $ECHO_N "checking if you want to see compiler warnings... $ECHO_C" >&6
9982
9983 # Check whether --enable-warnings or --disable-warnings was given.
9984 if test "${enable_warnings+set}" = set; then
9985   enableval="$enable_warnings"
9986   with_warnings=$enableval
9987 fi;
9988 echo "$as_me:9988: result: $with_warnings" >&5
9989 echo "${ECHO_T}$with_warnings" >&6
9990
9991 if test "x$with_warnings" = "xyes"; then
9992
9993         ADAFLAGS="$ADAFLAGS -gnatg"
9994
9995 INTEL_COMPILER=no
9996
9997 if test "$GCC" = yes ; then
9998         case $host_os in
9999         linux*|gnu*)
10000                 echo "$as_me:10000: checking if this is really Intel C compiler" >&5
10001 echo $ECHO_N "checking if this is really Intel C compiler... $ECHO_C" >&6
10002                 cf_save_CFLAGS="$CFLAGS"
10003                 CFLAGS="$CFLAGS -no-gcc"
10004                 cat >conftest.$ac_ext <<_ACEOF
10005 #line 10005 "configure"
10006 #include "confdefs.h"
10007
10008 int
10009 main ()
10010 {
10011
10012 #ifdef __INTEL_COMPILER
10013 #else
10014 make an error
10015 #endif
10016
10017   ;
10018   return 0;
10019 }
10020 _ACEOF
10021 rm -f conftest.$ac_objext
10022 if { (eval echo "$as_me:10022: \"$ac_compile\"") >&5
10023   (eval $ac_compile) 2>&5
10024   ac_status=$?
10025   echo "$as_me:10025: \$? = $ac_status" >&5
10026   (exit $ac_status); } &&
10027          { ac_try='test -s conftest.$ac_objext'
10028   { (eval echo "$as_me:10028: \"$ac_try\"") >&5
10029   (eval $ac_try) 2>&5
10030   ac_status=$?
10031   echo "$as_me:10031: \$? = $ac_status" >&5
10032   (exit $ac_status); }; }; then
10033   INTEL_COMPILER=yes
10034 cf_save_CFLAGS="$cf_save_CFLAGS -we147"
10035
10036 else
10037   echo "$as_me: failed program was:" >&5
10038 cat conftest.$ac_ext >&5
10039 fi
10040 rm -f conftest.$ac_objext conftest.$ac_ext
10041                 CFLAGS="$cf_save_CFLAGS"
10042                 echo "$as_me:10042: result: $INTEL_COMPILER" >&5
10043 echo "${ECHO_T}$INTEL_COMPILER" >&6
10044                 ;;
10045         esac
10046 fi
10047
10048 CLANG_COMPILER=no
10049
10050 if test "$GCC" = yes ; then
10051         echo "$as_me:10051: checking if this is really Clang C compiler" >&5
10052 echo $ECHO_N "checking if this is really Clang C compiler... $ECHO_C" >&6
10053         cf_save_CFLAGS="$CFLAGS"
10054         CFLAGS="$CFLAGS -Qunused-arguments"
10055         cat >conftest.$ac_ext <<_ACEOF
10056 #line 10056 "configure"
10057 #include "confdefs.h"
10058
10059 int
10060 main ()
10061 {
10062
10063 #ifdef __clang__
10064 #else
10065 make an error
10066 #endif
10067
10068   ;
10069   return 0;
10070 }
10071 _ACEOF
10072 rm -f conftest.$ac_objext
10073 if { (eval echo "$as_me:10073: \"$ac_compile\"") >&5
10074   (eval $ac_compile) 2>&5
10075   ac_status=$?
10076   echo "$as_me:10076: \$? = $ac_status" >&5
10077   (exit $ac_status); } &&
10078          { ac_try='test -s conftest.$ac_objext'
10079   { (eval echo "$as_me:10079: \"$ac_try\"") >&5
10080   (eval $ac_try) 2>&5
10081   ac_status=$?
10082   echo "$as_me:10082: \$? = $ac_status" >&5
10083   (exit $ac_status); }; }; then
10084   CLANG_COMPILER=yes
10085 cf_save_CFLAGS="$cf_save_CFLAGS -Qunused-arguments"
10086
10087 else
10088   echo "$as_me: failed program was:" >&5
10089 cat conftest.$ac_ext >&5
10090 fi
10091 rm -f conftest.$ac_objext conftest.$ac_ext
10092         CFLAGS="$cf_save_CFLAGS"
10093         echo "$as_me:10093: result: $CLANG_COMPILER" >&5
10094 echo "${ECHO_T}$CLANG_COMPILER" >&6
10095 fi
10096
10097 cat > conftest.$ac_ext <<EOF
10098 #line 10098 "${as_me:-configure}"
10099 int main(int argc, char *argv[]) { return (argv[argc-1] == 0) ; }
10100 EOF
10101
10102 if test "$INTEL_COMPILER" = yes
10103 then
10104 # The "-wdXXX" options suppress warnings:
10105 # remark #1419: external declaration in primary source file
10106 # remark #1683: explicit conversion of a 64-bit integral type to a smaller integral type (potential portability problem)
10107 # remark #1684: conversion from pointer to same-sized integral type (potential portability problem)
10108 # remark #193: zero used for undefined preprocessing identifier
10109 # remark #593: variable "curs_sb_left_arrow" was set but never used
10110 # remark #810: conversion from "int" to "Dimension={unsigned short}" may lose significant bits
10111 # remark #869: parameter "tw" was never referenced
10112 # remark #981: operands are evaluated in unspecified order
10113 # warning #279: controlling expression is constant
10114
10115         { echo "$as_me:10115: checking for $CC warning options..." >&5
10116 echo "$as_me: checking for $CC warning options..." >&6;}
10117         cf_save_CFLAGS="$CFLAGS"
10118         EXTRA_CFLAGS="-Wall"
10119         for cf_opt in \
10120                 wd1419 \
10121                 wd1683 \
10122                 wd1684 \
10123                 wd193 \
10124                 wd593 \
10125                 wd279 \
10126                 wd810 \
10127                 wd869 \
10128                 wd981
10129         do
10130                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
10131                 if { (eval echo "$as_me:10131: \"$ac_compile\"") >&5
10132   (eval $ac_compile) 2>&5
10133   ac_status=$?
10134   echo "$as_me:10134: \$? = $ac_status" >&5
10135   (exit $ac_status); }; then
10136                         test -n "$verbose" && echo "$as_me:10136: result: ... -$cf_opt" >&5
10137 echo "${ECHO_T}... -$cf_opt" >&6
10138                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
10139                 fi
10140         done
10141         CFLAGS="$cf_save_CFLAGS"
10142
10143 elif test "$GCC" = yes
10144 then
10145         { echo "$as_me:10145: checking for $CC warning options..." >&5
10146 echo "$as_me: checking for $CC warning options..." >&6;}
10147         cf_save_CFLAGS="$CFLAGS"
10148         EXTRA_CFLAGS=
10149         cf_warn_CONST=""
10150         test "$with_ext_const" = yes && cf_warn_CONST="Wwrite-strings"
10151         cf_gcc_warnings="Wignored-qualifiers Wlogical-op Wvarargs"
10152         test "x$CLANG_COMPILER" = xyes && cf_gcc_warnings=
10153         for cf_opt in W Wall \
10154                 Wbad-function-cast \
10155                 Wcast-align \
10156                 Wcast-qual \
10157                 Wdeclaration-after-statement \
10158                 Wextra \
10159                 Winline \
10160                 Wmissing-declarations \
10161                 Wmissing-prototypes \
10162                 Wnested-externs \
10163                 Wpointer-arith \
10164                 Wshadow \
10165                 Wstrict-prototypes \
10166                 Wundef $cf_gcc_warnings $cf_warn_CONST Wno-unknown-pragmas Wswitch-enum
10167         do
10168                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
10169                 if { (eval echo "$as_me:10169: \"$ac_compile\"") >&5
10170   (eval $ac_compile) 2>&5
10171   ac_status=$?
10172   echo "$as_me:10172: \$? = $ac_status" >&5
10173   (exit $ac_status); }; then
10174                         test -n "$verbose" && echo "$as_me:10174: result: ... -$cf_opt" >&5
10175 echo "${ECHO_T}... -$cf_opt" >&6
10176                         case $cf_opt in #(vi
10177                         Wcast-qual) #(vi
10178                                 CPPFLAGS="$CPPFLAGS -DXTSTRINGDEFINES"
10179                                 ;;
10180                         Winline) #(vi
10181                                 case $GCC_VERSION in
10182                                 [34].*)
10183                                         test -n "$verbose" && echo "    feature is broken in gcc $GCC_VERSION" 1>&6
10184
10185 echo "${as_me:-configure}:10185: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
10186
10187                                         continue;;
10188                                 esac
10189                                 ;;
10190                         Wpointer-arith) #(vi
10191                                 case $GCC_VERSION in
10192                                 [12].*)
10193                                         test -n "$verbose" && echo "    feature is broken in gcc $GCC_VERSION" 1>&6
10194
10195 echo "${as_me:-configure}:10195: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
10196
10197                                         continue;;
10198                                 esac
10199                                 ;;
10200                         esac
10201                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
10202                 fi
10203         done
10204         CFLAGS="$cf_save_CFLAGS"
10205 fi
10206 rm -rf conftest*
10207
10208 fi
10209
10210 if test "$GCC" = yes
10211 then
10212 cat > conftest.i <<EOF
10213 #ifndef GCC_PRINTF
10214 #define GCC_PRINTF 0
10215 #endif
10216 #ifndef GCC_SCANF
10217 #define GCC_SCANF 0
10218 #endif
10219 #ifndef GCC_NORETURN
10220 #define GCC_NORETURN /* nothing */
10221 #endif
10222 #ifndef GCC_UNUSED
10223 #define GCC_UNUSED /* nothing */
10224 #endif
10225 EOF
10226 if test "$GCC" = yes
10227 then
10228         { echo "$as_me:10228: checking for $CC __attribute__ directives..." >&5
10229 echo "$as_me: checking for $CC __attribute__ directives..." >&6;}
10230 cat > conftest.$ac_ext <<EOF
10231 #line 10231 "${as_me:-configure}"
10232 #include "confdefs.h"
10233 #include "conftest.h"
10234 #include "conftest.i"
10235 #if     GCC_PRINTF
10236 #define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
10237 #else
10238 #define GCC_PRINTFLIKE(fmt,var) /*nothing*/
10239 #endif
10240 #if     GCC_SCANF
10241 #define GCC_SCANFLIKE(fmt,var)  __attribute__((format(scanf,fmt,var)))
10242 #else
10243 #define GCC_SCANFLIKE(fmt,var)  /*nothing*/
10244 #endif
10245 extern void wow(char *,...) GCC_SCANFLIKE(1,2);
10246 extern void oops(char *,...) GCC_PRINTFLIKE(1,2) GCC_NORETURN;
10247 extern void foo(void) GCC_NORETURN;
10248 int main(int argc GCC_UNUSED, char *argv[] GCC_UNUSED) { return 0; }
10249 EOF
10250         cf_printf_attribute=no
10251         cf_scanf_attribute=no
10252         for cf_attribute in scanf printf unused noreturn
10253         do
10254
10255 cf_ATTRIBUTE=`echo "$cf_attribute" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
10256
10257                 cf_directive="__attribute__(($cf_attribute))"
10258                 echo "checking for $CC $cf_directive" 1>&5
10259
10260                 case $cf_attribute in #(vi
10261                 printf) #(vi
10262                         cf_printf_attribute=yes
10263                         cat >conftest.h <<EOF
10264 #define GCC_$cf_ATTRIBUTE 1
10265 EOF
10266                         ;;
10267                 scanf) #(vi
10268                         cf_scanf_attribute=yes
10269                         cat >conftest.h <<EOF
10270 #define GCC_$cf_ATTRIBUTE 1
10271 EOF
10272                         ;;
10273                 *) #(vi
10274                         cat >conftest.h <<EOF
10275 #define GCC_$cf_ATTRIBUTE $cf_directive
10276 EOF
10277                         ;;
10278                 esac
10279
10280                 if { (eval echo "$as_me:10280: \"$ac_compile\"") >&5
10281   (eval $ac_compile) 2>&5
10282   ac_status=$?
10283   echo "$as_me:10283: \$? = $ac_status" >&5
10284   (exit $ac_status); }; then
10285                         test -n "$verbose" && echo "$as_me:10285: result: ... $cf_attribute" >&5
10286 echo "${ECHO_T}... $cf_attribute" >&6
10287                         cat conftest.h >>confdefs.h
10288                         case $cf_attribute in #(vi
10289                         noreturn) #(vi
10290
10291 cat >>confdefs.h <<EOF
10292 #define GCC_NORETURN $cf_directive
10293 EOF
10294
10295                                 ;;
10296                         printf) #(vi
10297                                 cf_value='/* nothing */'
10298                                 if test "$cf_printf_attribute" != no ; then
10299                                         cf_value='__attribute__((format(printf,fmt,var)))'
10300
10301 cat >>confdefs.h <<\EOF
10302 #define GCC_PRINTF 1
10303 EOF
10304
10305                                 fi
10306
10307 cat >>confdefs.h <<EOF
10308 #define GCC_PRINTFLIKE(fmt,var) $cf_value
10309 EOF
10310
10311                                 ;;
10312                         scanf) #(vi
10313                                 cf_value='/* nothing */'
10314                                 if test "$cf_scanf_attribute" != no ; then
10315                                         cf_value='__attribute__((format(scanf,fmt,var)))'
10316
10317 cat >>confdefs.h <<\EOF
10318 #define GCC_SCANF 1
10319 EOF
10320
10321                                 fi
10322
10323 cat >>confdefs.h <<EOF
10324 #define GCC_SCANFLIKE(fmt,var) $cf_value
10325 EOF
10326
10327                                 ;;
10328                         unused) #(vi
10329
10330 cat >>confdefs.h <<EOF
10331 #define GCC_UNUSED $cf_directive
10332 EOF
10333
10334                                 ;;
10335                         esac
10336                 fi
10337         done
10338 else
10339         fgrep define conftest.i >>confdefs.h
10340 fi
10341 rm -rf conftest*
10342 fi
10343
10344 ###     use option --enable-assertions to turn on generation of assertion code
10345 echo "$as_me:10345: checking if you want to enable runtime assertions" >&5
10346 echo $ECHO_N "checking if you want to enable runtime assertions... $ECHO_C" >&6
10347
10348 # Check whether --enable-assertions or --disable-assertions was given.
10349 if test "${enable_assertions+set}" = set; then
10350   enableval="$enable_assertions"
10351   with_assertions=$enableval
10352 else
10353   with_assertions=no
10354 fi;
10355 echo "$as_me:10355: result: $with_assertions" >&5
10356 echo "${ECHO_T}$with_assertions" >&6
10357 if test -n "$GCC"
10358 then
10359         if test "$with_assertions" = no
10360         then
10361                 CPPFLAGS="$CPPFLAGS -DNDEBUG"
10362         else
10363
10364         ADAFLAGS="$ADAFLAGS -gnata"
10365
10366         fi
10367 fi
10368
10369 ###     use option --disable-leaks to suppress "permanent" leaks, for testing
10370
10371 cat >>confdefs.h <<\EOF
10372 #define HAVE_NC_ALLOC_H 1
10373 EOF
10374
10375 ###     use option --enable-expanded to generate certain macros as functions
10376
10377 # Check whether --enable-expanded or --disable-expanded was given.
10378 if test "${enable_expanded+set}" = set; then
10379   enableval="$enable_expanded"
10380   test "$enableval" = yes &&
10381 cat >>confdefs.h <<\EOF
10382 #define NCURSES_EXPANDED 1
10383 EOF
10384
10385 fi;
10386
10387 ###     use option --disable-macros to suppress macros in favor of functions
10388
10389 # Check whether --enable-macros or --disable-macros was given.
10390 if test "${enable_macros+set}" = set; then
10391   enableval="$enable_macros"
10392   test "$enableval" = no &&
10393 cat >>confdefs.h <<\EOF
10394 #define NCURSES_NOMACROS 1
10395 EOF
10396
10397 fi;
10398
10399 # Normally we only add trace() to the debug-library.  Allow this to be
10400 # extended to all models of the ncurses library:
10401 cf_all_traces=no
10402 case "$CFLAGS $CPPFLAGS" in
10403 *-DTRACE*)
10404         cf_all_traces=yes
10405         ;;
10406 esac
10407
10408 echo "$as_me:10408: checking whether to add trace feature to all models" >&5
10409 echo $ECHO_N "checking whether to add trace feature to all models... $ECHO_C" >&6
10410
10411 # Check whether --with-trace or --without-trace was given.
10412 if test "${with_trace+set}" = set; then
10413   withval="$with_trace"
10414   cf_with_trace=$withval
10415 else
10416   cf_with_trace=$cf_all_traces
10417 fi;
10418 echo "$as_me:10418: result: $cf_with_trace" >&5
10419 echo "${ECHO_T}$cf_with_trace" >&6
10420
10421 if test "$cf_with_trace" = yes ; then
10422         ADA_TRACE=TRUE
10423
10424 cf_fix_cppflags=no
10425 cf_new_cflags=
10426 cf_new_cppflags=
10427 cf_new_extra_cppflags=
10428
10429 for cf_add_cflags in -DTRACE
10430 do
10431 case $cf_fix_cppflags in
10432 no)
10433         case $cf_add_cflags in #(vi
10434         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
10435                 case $cf_add_cflags in
10436                 -D*)
10437                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
10438
10439                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10440                                 && test -z "${cf_tst_cflags}" \
10441                                 && cf_fix_cppflags=yes
10442
10443                         if test $cf_fix_cppflags = yes ; then
10444                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10445                                 continue
10446                         elif test "${cf_tst_cflags}" = "\"'" ; then
10447                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10448                                 continue
10449                         fi
10450                         ;;
10451                 esac
10452                 case "$CPPFLAGS" in
10453                 *$cf_add_cflags) #(vi
10454                         ;;
10455                 *) #(vi
10456                         case $cf_add_cflags in #(vi
10457                         -D*)
10458                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
10459
10460 CPPFLAGS=`echo "$CPPFLAGS" | \
10461         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
10462                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
10463
10464                                 ;;
10465                         esac
10466                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
10467                         ;;
10468                 esac
10469                 ;;
10470         *)
10471                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
10472                 ;;
10473         esac
10474         ;;
10475 yes)
10476         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10477
10478         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
10479
10480         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10481                 && test -z "${cf_tst_cflags}" \
10482                 && cf_fix_cppflags=no
10483         ;;
10484 esac
10485 done
10486
10487 if test -n "$cf_new_cflags" ; then
10488
10489         CFLAGS="$CFLAGS $cf_new_cflags"
10490 fi
10491
10492 if test -n "$cf_new_cppflags" ; then
10493
10494         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
10495 fi
10496
10497 if test -n "$cf_new_extra_cppflags" ; then
10498
10499         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
10500 fi
10501
10502 else
10503         ADA_TRACE=FALSE
10504 fi
10505
10506 echo "$as_me:10506: checking if we want to use GNAT projects" >&5
10507 echo $ECHO_N "checking if we want to use GNAT projects... $ECHO_C" >&6
10508
10509 # Check whether --enable-gnat-projects or --disable-gnat-projects was given.
10510 if test "${enable_gnat_projects+set}" = set; then
10511   enableval="$enable_gnat_projects"
10512   test "$enableval" != no && enableval=yes
10513   if test "$enableval" != "yes" ; then
10514     enable_gnat_projects=no
10515   else
10516     enable_gnat_projects=yes
10517   fi
10518 else
10519   enableval=yes
10520   enable_gnat_projects=yes
10521
10522 fi;
10523 echo "$as_me:10523: result: $enable_gnat_projects" >&5
10524 echo "${ECHO_T}$enable_gnat_projects" >&6
10525
10526 ###     Checks for libraries.
10527 case $cf_cv_system_name in #(vi
10528 *mingw32*) #(vi
10529         ;;
10530 *)
10531 echo "$as_me:10531: checking for gettimeofday" >&5
10532 echo $ECHO_N "checking for gettimeofday... $ECHO_C" >&6
10533 if test "${ac_cv_func_gettimeofday+set}" = set; then
10534   echo $ECHO_N "(cached) $ECHO_C" >&6
10535 else
10536   cat >conftest.$ac_ext <<_ACEOF
10537 #line 10537 "configure"
10538 #include "confdefs.h"
10539 /* System header to define __stub macros and hopefully few prototypes,
10540     which can conflict with char gettimeofday (); below.  */
10541 #include <assert.h>
10542 /* Override any gcc2 internal prototype to avoid an error.  */
10543 #ifdef __cplusplus
10544 extern "C"
10545 #endif
10546 /* We use char because int might match the return type of a gcc2
10547    builtin and then its argument prototype would still apply.  */
10548 char gettimeofday ();
10549 char (*f) ();
10550
10551 int
10552 main ()
10553 {
10554 /* The GNU C library defines this for functions which it implements
10555     to always fail with ENOSYS.  Some functions are actually named
10556     something starting with __ and the normal name is an alias.  */
10557 #if defined (__stub_gettimeofday) || defined (__stub___gettimeofday)
10558 choke me
10559 #else
10560 f = gettimeofday; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
10561 #endif
10562
10563   ;
10564   return 0;
10565 }
10566 _ACEOF
10567 rm -f conftest.$ac_objext conftest$ac_exeext
10568 if { (eval echo "$as_me:10568: \"$ac_link\"") >&5
10569   (eval $ac_link) 2>&5
10570   ac_status=$?
10571   echo "$as_me:10571: \$? = $ac_status" >&5
10572   (exit $ac_status); } &&
10573          { ac_try='test -s conftest$ac_exeext'
10574   { (eval echo "$as_me:10574: \"$ac_try\"") >&5
10575   (eval $ac_try) 2>&5
10576   ac_status=$?
10577   echo "$as_me:10577: \$? = $ac_status" >&5
10578   (exit $ac_status); }; }; then
10579   ac_cv_func_gettimeofday=yes
10580 else
10581   echo "$as_me: failed program was:" >&5
10582 cat conftest.$ac_ext >&5
10583 ac_cv_func_gettimeofday=no
10584 fi
10585 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10586 fi
10587 echo "$as_me:10587: result: $ac_cv_func_gettimeofday" >&5
10588 echo "${ECHO_T}$ac_cv_func_gettimeofday" >&6
10589 if test $ac_cv_func_gettimeofday = yes; then
10590   cat >>confdefs.h <<\EOF
10591 #define HAVE_GETTIMEOFDAY 1
10592 EOF
10593
10594 else
10595
10596 echo "$as_me:10596: checking for gettimeofday in -lbsd" >&5
10597 echo $ECHO_N "checking for gettimeofday in -lbsd... $ECHO_C" >&6
10598 if test "${ac_cv_lib_bsd_gettimeofday+set}" = set; then
10599   echo $ECHO_N "(cached) $ECHO_C" >&6
10600 else
10601   ac_check_lib_save_LIBS=$LIBS
10602 LIBS="-lbsd  $LIBS"
10603 cat >conftest.$ac_ext <<_ACEOF
10604 #line 10604 "configure"
10605 #include "confdefs.h"
10606
10607 /* Override any gcc2 internal prototype to avoid an error.  */
10608 #ifdef __cplusplus
10609 extern "C"
10610 #endif
10611 /* We use char because int might match the return type of a gcc2
10612    builtin and then its argument prototype would still apply.  */
10613 char gettimeofday ();
10614 int
10615 main ()
10616 {
10617 gettimeofday ();
10618   ;
10619   return 0;
10620 }
10621 _ACEOF
10622 rm -f conftest.$ac_objext conftest$ac_exeext
10623 if { (eval echo "$as_me:10623: \"$ac_link\"") >&5
10624   (eval $ac_link) 2>&5
10625   ac_status=$?
10626   echo "$as_me:10626: \$? = $ac_status" >&5
10627   (exit $ac_status); } &&
10628          { ac_try='test -s conftest$ac_exeext'
10629   { (eval echo "$as_me:10629: \"$ac_try\"") >&5
10630   (eval $ac_try) 2>&5
10631   ac_status=$?
10632   echo "$as_me:10632: \$? = $ac_status" >&5
10633   (exit $ac_status); }; }; then
10634   ac_cv_lib_bsd_gettimeofday=yes
10635 else
10636   echo "$as_me: failed program was:" >&5
10637 cat conftest.$ac_ext >&5
10638 ac_cv_lib_bsd_gettimeofday=no
10639 fi
10640 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10641 LIBS=$ac_check_lib_save_LIBS
10642 fi
10643 echo "$as_me:10643: result: $ac_cv_lib_bsd_gettimeofday" >&5
10644 echo "${ECHO_T}$ac_cv_lib_bsd_gettimeofday" >&6
10645 if test $ac_cv_lib_bsd_gettimeofday = yes; then
10646
10647 cat >>confdefs.h <<\EOF
10648 #define HAVE_GETTIMEOFDAY 1
10649 EOF
10650
10651         LIBS="$LIBS -lbsd"
10652 fi
10653
10654 fi
10655         ;;
10656 esac
10657
10658 ###     Checks for header files.
10659 echo "$as_me:10659: checking for ANSI C header files" >&5
10660 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
10661 if test "${ac_cv_header_stdc+set}" = set; then
10662   echo $ECHO_N "(cached) $ECHO_C" >&6
10663 else
10664   cat >conftest.$ac_ext <<_ACEOF
10665 #line 10665 "configure"
10666 #include "confdefs.h"
10667 #include <stdlib.h>
10668 #include <stdarg.h>
10669 #include <string.h>
10670 #include <float.h>
10671
10672 _ACEOF
10673 if { (eval echo "$as_me:10673: \"$ac_cpp conftest.$ac_ext\"") >&5
10674   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
10675   ac_status=$?
10676   egrep -v '^ *\+' conftest.er1 >conftest.err
10677   rm -f conftest.er1
10678   cat conftest.err >&5
10679   echo "$as_me:10679: \$? = $ac_status" >&5
10680   (exit $ac_status); } >/dev/null; then
10681   if test -s conftest.err; then
10682     ac_cpp_err=$ac_c_preproc_warn_flag
10683   else
10684     ac_cpp_err=
10685   fi
10686 else
10687   ac_cpp_err=yes
10688 fi
10689 if test -z "$ac_cpp_err"; then
10690   ac_cv_header_stdc=yes
10691 else
10692   echo "$as_me: failed program was:" >&5
10693   cat conftest.$ac_ext >&5
10694   ac_cv_header_stdc=no
10695 fi
10696 rm -f conftest.err conftest.$ac_ext
10697
10698 if test $ac_cv_header_stdc = yes; then
10699   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
10700   cat >conftest.$ac_ext <<_ACEOF
10701 #line 10701 "configure"
10702 #include "confdefs.h"
10703 #include <string.h>
10704
10705 _ACEOF
10706 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
10707   egrep "memchr" >/dev/null 2>&1; then
10708   :
10709 else
10710   ac_cv_header_stdc=no
10711 fi
10712 rm -rf conftest*
10713
10714 fi
10715
10716 if test $ac_cv_header_stdc = yes; then
10717   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
10718   cat >conftest.$ac_ext <<_ACEOF
10719 #line 10719 "configure"
10720 #include "confdefs.h"
10721 #include <stdlib.h>
10722
10723 _ACEOF
10724 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
10725   egrep "free" >/dev/null 2>&1; then
10726   :
10727 else
10728   ac_cv_header_stdc=no
10729 fi
10730 rm -rf conftest*
10731
10732 fi
10733
10734 if test $ac_cv_header_stdc = yes; then
10735   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
10736   if test "$cross_compiling" = yes; then
10737   :
10738 else
10739   cat >conftest.$ac_ext <<_ACEOF
10740 #line 10740 "configure"
10741 #include "confdefs.h"
10742 #include <ctype.h>
10743 #if ((' ' & 0x0FF) == 0x020)
10744 # define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
10745 # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
10746 #else
10747 # define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
10748                      || ('j' <= (c) && (c) <= 'r') \
10749                      || ('s' <= (c) && (c) <= 'z'))
10750 # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
10751 #endif
10752
10753 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
10754 int
10755 main ()
10756 {
10757   int i;
10758   for (i = 0; i < 256; i++)
10759     if (XOR (islower (i), ISLOWER (i))
10760         || toupper (i) != TOUPPER (i))
10761       $ac_main_return(2);
10762   $ac_main_return (0);
10763 }
10764 _ACEOF
10765 rm -f conftest$ac_exeext
10766 if { (eval echo "$as_me:10766: \"$ac_link\"") >&5
10767   (eval $ac_link) 2>&5
10768   ac_status=$?
10769   echo "$as_me:10769: \$? = $ac_status" >&5
10770   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
10771   { (eval echo "$as_me:10771: \"$ac_try\"") >&5
10772   (eval $ac_try) 2>&5
10773   ac_status=$?
10774   echo "$as_me:10774: \$? = $ac_status" >&5
10775   (exit $ac_status); }; }; then
10776   :
10777 else
10778   echo "$as_me: program exited with status $ac_status" >&5
10779 echo "$as_me: failed program was:" >&5
10780 cat conftest.$ac_ext >&5
10781 ac_cv_header_stdc=no
10782 fi
10783 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
10784 fi
10785 fi
10786 fi
10787 echo "$as_me:10787: result: $ac_cv_header_stdc" >&5
10788 echo "${ECHO_T}$ac_cv_header_stdc" >&6
10789 if test $ac_cv_header_stdc = yes; then
10790
10791 cat >>confdefs.h <<\EOF
10792 #define STDC_HEADERS 1
10793 EOF
10794
10795 fi
10796
10797 ac_header_dirent=no
10798 for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h; do
10799   as_ac_Header=`echo "ac_cv_header_dirent_$ac_hdr" | $as_tr_sh`
10800 echo "$as_me:10800: checking for $ac_hdr that defines DIR" >&5
10801 echo $ECHO_N "checking for $ac_hdr that defines DIR... $ECHO_C" >&6
10802 if eval "test \"\${$as_ac_Header+set}\" = set"; then
10803   echo $ECHO_N "(cached) $ECHO_C" >&6
10804 else
10805   cat >conftest.$ac_ext <<_ACEOF
10806 #line 10806 "configure"
10807 #include "confdefs.h"
10808 #include <sys/types.h>
10809 #include <$ac_hdr>
10810
10811 int
10812 main ()
10813 {
10814 if ((DIR *) 0)
10815 return 0;
10816   ;
10817   return 0;
10818 }
10819 _ACEOF
10820 rm -f conftest.$ac_objext
10821 if { (eval echo "$as_me:10821: \"$ac_compile\"") >&5
10822   (eval $ac_compile) 2>&5
10823   ac_status=$?
10824   echo "$as_me:10824: \$? = $ac_status" >&5
10825   (exit $ac_status); } &&
10826          { ac_try='test -s conftest.$ac_objext'
10827   { (eval echo "$as_me:10827: \"$ac_try\"") >&5
10828   (eval $ac_try) 2>&5
10829   ac_status=$?
10830   echo "$as_me:10830: \$? = $ac_status" >&5
10831   (exit $ac_status); }; }; then
10832   eval "$as_ac_Header=yes"
10833 else
10834   echo "$as_me: failed program was:" >&5
10835 cat conftest.$ac_ext >&5
10836 eval "$as_ac_Header=no"
10837 fi
10838 rm -f conftest.$ac_objext conftest.$ac_ext
10839 fi
10840 echo "$as_me:10840: result: `eval echo '${'$as_ac_Header'}'`" >&5
10841 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
10842 if test `eval echo '${'$as_ac_Header'}'` = yes; then
10843   cat >>confdefs.h <<EOF
10844 #define `echo "HAVE_$ac_hdr" | $as_tr_cpp` 1
10845 EOF
10846
10847 ac_header_dirent=$ac_hdr; break
10848 fi
10849
10850 done
10851 # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix.
10852 if test $ac_header_dirent = dirent.h; then
10853   echo "$as_me:10853: checking for opendir in -ldir" >&5
10854 echo $ECHO_N "checking for opendir in -ldir... $ECHO_C" >&6
10855 if test "${ac_cv_lib_dir_opendir+set}" = set; then
10856   echo $ECHO_N "(cached) $ECHO_C" >&6
10857 else
10858   ac_check_lib_save_LIBS=$LIBS
10859 LIBS="-ldir  $LIBS"
10860 cat >conftest.$ac_ext <<_ACEOF
10861 #line 10861 "configure"
10862 #include "confdefs.h"
10863
10864 /* Override any gcc2 internal prototype to avoid an error.  */
10865 #ifdef __cplusplus
10866 extern "C"
10867 #endif
10868 /* We use char because int might match the return type of a gcc2
10869    builtin and then its argument prototype would still apply.  */
10870 char opendir ();
10871 int
10872 main ()
10873 {
10874 opendir ();
10875   ;
10876   return 0;
10877 }
10878 _ACEOF
10879 rm -f conftest.$ac_objext conftest$ac_exeext
10880 if { (eval echo "$as_me:10880: \"$ac_link\"") >&5
10881   (eval $ac_link) 2>&5
10882   ac_status=$?
10883   echo "$as_me:10883: \$? = $ac_status" >&5
10884   (exit $ac_status); } &&
10885          { ac_try='test -s conftest$ac_exeext'
10886   { (eval echo "$as_me:10886: \"$ac_try\"") >&5
10887   (eval $ac_try) 2>&5
10888   ac_status=$?
10889   echo "$as_me:10889: \$? = $ac_status" >&5
10890   (exit $ac_status); }; }; then
10891   ac_cv_lib_dir_opendir=yes
10892 else
10893   echo "$as_me: failed program was:" >&5
10894 cat conftest.$ac_ext >&5
10895 ac_cv_lib_dir_opendir=no
10896 fi
10897 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10898 LIBS=$ac_check_lib_save_LIBS
10899 fi
10900 echo "$as_me:10900: result: $ac_cv_lib_dir_opendir" >&5
10901 echo "${ECHO_T}$ac_cv_lib_dir_opendir" >&6
10902 if test $ac_cv_lib_dir_opendir = yes; then
10903   LIBS="$LIBS -ldir"
10904 fi
10905
10906 else
10907   echo "$as_me:10907: checking for opendir in -lx" >&5
10908 echo $ECHO_N "checking for opendir in -lx... $ECHO_C" >&6
10909 if test "${ac_cv_lib_x_opendir+set}" = set; then
10910   echo $ECHO_N "(cached) $ECHO_C" >&6
10911 else
10912   ac_check_lib_save_LIBS=$LIBS
10913 LIBS="-lx  $LIBS"
10914 cat >conftest.$ac_ext <<_ACEOF
10915 #line 10915 "configure"
10916 #include "confdefs.h"
10917
10918 /* Override any gcc2 internal prototype to avoid an error.  */
10919 #ifdef __cplusplus
10920 extern "C"
10921 #endif
10922 /* We use char because int might match the return type of a gcc2
10923    builtin and then its argument prototype would still apply.  */
10924 char opendir ();
10925 int
10926 main ()
10927 {
10928 opendir ();
10929   ;
10930   return 0;
10931 }
10932 _ACEOF
10933 rm -f conftest.$ac_objext conftest$ac_exeext
10934 if { (eval echo "$as_me:10934: \"$ac_link\"") >&5
10935   (eval $ac_link) 2>&5
10936   ac_status=$?
10937   echo "$as_me:10937: \$? = $ac_status" >&5
10938   (exit $ac_status); } &&
10939          { ac_try='test -s conftest$ac_exeext'
10940   { (eval echo "$as_me:10940: \"$ac_try\"") >&5
10941   (eval $ac_try) 2>&5
10942   ac_status=$?
10943   echo "$as_me:10943: \$? = $ac_status" >&5
10944   (exit $ac_status); }; }; then
10945   ac_cv_lib_x_opendir=yes
10946 else
10947   echo "$as_me: failed program was:" >&5
10948 cat conftest.$ac_ext >&5
10949 ac_cv_lib_x_opendir=no
10950 fi
10951 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10952 LIBS=$ac_check_lib_save_LIBS
10953 fi
10954 echo "$as_me:10954: result: $ac_cv_lib_x_opendir" >&5
10955 echo "${ECHO_T}$ac_cv_lib_x_opendir" >&6
10956 if test $ac_cv_lib_x_opendir = yes; then
10957   LIBS="$LIBS -lx"
10958 fi
10959
10960 fi
10961
10962 echo "$as_me:10962: checking whether time.h and sys/time.h may both be included" >&5
10963 echo $ECHO_N "checking whether time.h and sys/time.h may both be included... $ECHO_C" >&6
10964 if test "${ac_cv_header_time+set}" = set; then
10965   echo $ECHO_N "(cached) $ECHO_C" >&6
10966 else
10967   cat >conftest.$ac_ext <<_ACEOF
10968 #line 10968 "configure"
10969 #include "confdefs.h"
10970 #include <sys/types.h>
10971 #include <sys/time.h>
10972 #include <time.h>
10973
10974 int
10975 main ()
10976 {
10977 if ((struct tm *) 0)
10978 return 0;
10979   ;
10980   return 0;
10981 }
10982 _ACEOF
10983 rm -f conftest.$ac_objext
10984 if { (eval echo "$as_me:10984: \"$ac_compile\"") >&5
10985   (eval $ac_compile) 2>&5
10986   ac_status=$?
10987   echo "$as_me:10987: \$? = $ac_status" >&5
10988   (exit $ac_status); } &&
10989          { ac_try='test -s conftest.$ac_objext'
10990   { (eval echo "$as_me:10990: \"$ac_try\"") >&5
10991   (eval $ac_try) 2>&5
10992   ac_status=$?
10993   echo "$as_me:10993: \$? = $ac_status" >&5
10994   (exit $ac_status); }; }; then
10995   ac_cv_header_time=yes
10996 else
10997   echo "$as_me: failed program was:" >&5
10998 cat conftest.$ac_ext >&5
10999 ac_cv_header_time=no
11000 fi
11001 rm -f conftest.$ac_objext conftest.$ac_ext
11002 fi
11003 echo "$as_me:11003: result: $ac_cv_header_time" >&5
11004 echo "${ECHO_T}$ac_cv_header_time" >&6
11005 if test $ac_cv_header_time = yes; then
11006
11007 cat >>confdefs.h <<\EOF
11008 #define TIME_WITH_SYS_TIME 1
11009 EOF
11010
11011 fi
11012
11013 ###     checks for compiler characteristics
11014 ac_ext=c
11015 ac_cpp='$CPP $CPPFLAGS'
11016 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
11017 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
11018 ac_compiler_gnu=$ac_cv_c_compiler_gnu
11019 ac_main_return=return
11020
11021 echo "$as_me:11021: checking for an ANSI C-conforming const" >&5
11022 echo $ECHO_N "checking for an ANSI C-conforming const... $ECHO_C" >&6
11023 if test "${ac_cv_c_const+set}" = set; then
11024   echo $ECHO_N "(cached) $ECHO_C" >&6
11025 else
11026   cat >conftest.$ac_ext <<_ACEOF
11027 #line 11027 "configure"
11028 #include "confdefs.h"
11029
11030 int
11031 main ()
11032 {
11033 /* FIXME: Include the comments suggested by Paul. */
11034 #ifndef __cplusplus
11035   /* Ultrix mips cc rejects this.  */
11036   typedef int charset[2];
11037   const charset x;
11038   /* SunOS 4.1.1 cc rejects this.  */
11039   char const *const *ccp;
11040   char **p;
11041   /* NEC SVR4.0.2 mips cc rejects this.  */
11042   struct point {int x, y;};
11043   static struct point const zero = {0,0};
11044   /* AIX XL C 1.02.0.0 rejects this.
11045      It does not let you subtract one const X* pointer from another in
11046      an arm of an if-expression whose if-part is not a constant
11047      expression */
11048   const char *g = "string";
11049   ccp = &g + (g ? g-g : 0);
11050   /* HPUX 7.0 cc rejects these. */
11051   ++ccp;
11052   p = (char**) ccp;
11053   ccp = (char const *const *) p;
11054   { /* SCO 3.2v4 cc rejects this.  */
11055     char *t;
11056     char const *s = 0 ? (char *) 0 : (char const *) 0;
11057
11058     *t++ = 0;
11059   }
11060   { /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  */
11061     int x[] = {25, 17};
11062     const int *foo = &x[0];
11063     ++foo;
11064   }
11065   { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
11066     typedef const int *iptr;
11067     iptr p = 0;
11068     ++p;
11069   }
11070   { /* AIX XL C 1.02.0.0 rejects this saying
11071        "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
11072     struct s { int j; const int *ap[3]; };
11073     struct s *b; b->j = 5;
11074   }
11075   { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
11076     const int foo = 10;
11077   }
11078 #endif
11079
11080   ;
11081   return 0;
11082 }
11083 _ACEOF
11084 rm -f conftest.$ac_objext
11085 if { (eval echo "$as_me:11085: \"$ac_compile\"") >&5
11086   (eval $ac_compile) 2>&5
11087   ac_status=$?
11088   echo "$as_me:11088: \$? = $ac_status" >&5
11089   (exit $ac_status); } &&
11090          { ac_try='test -s conftest.$ac_objext'
11091   { (eval echo "$as_me:11091: \"$ac_try\"") >&5
11092   (eval $ac_try) 2>&5
11093   ac_status=$?
11094   echo "$as_me:11094: \$? = $ac_status" >&5
11095   (exit $ac_status); }; }; then
11096   ac_cv_c_const=yes
11097 else
11098   echo "$as_me: failed program was:" >&5
11099 cat conftest.$ac_ext >&5
11100 ac_cv_c_const=no
11101 fi
11102 rm -f conftest.$ac_objext conftest.$ac_ext
11103 fi
11104 echo "$as_me:11104: result: $ac_cv_c_const" >&5
11105 echo "${ECHO_T}$ac_cv_c_const" >&6
11106 if test $ac_cv_c_const = no; then
11107
11108 cat >>confdefs.h <<\EOF
11109 #define const
11110 EOF
11111
11112 fi
11113
11114 ###     Checks for external-data
11115
11116 echo "$as_me:11116: checking if data-only library module links" >&5
11117 echo $ECHO_N "checking if data-only library module links... $ECHO_C" >&6
11118 if test "${cf_cv_link_dataonly+set}" = set; then
11119   echo $ECHO_N "(cached) $ECHO_C" >&6
11120 else
11121
11122         rm -f conftest.a
11123         cat >conftest.$ac_ext <<EOF
11124 #line 11124 "configure"
11125 int     testdata[3] = { 123, 456, 789 };
11126 EOF
11127         if { (eval echo "$as_me:11127: \"$ac_compile\"") >&5
11128   (eval $ac_compile) 2>&5
11129   ac_status=$?
11130   echo "$as_me:11130: \$? = $ac_status" >&5
11131   (exit $ac_status); } ; then
11132                 mv conftest.o data.o && \
11133                 ( $AR $ARFLAGS conftest.a data.o ) 2>&5 1>/dev/null
11134         fi
11135         rm -f conftest.$ac_ext data.o
11136         cat >conftest.$ac_ext <<EOF
11137 #line 11137 "configure"
11138 int     testfunc()
11139 {
11140 #if defined(NeXT)
11141         ${cf_cv_main_return:-return}(1);        /* I'm told this linker is broken */
11142 #else
11143         extern int testdata[3];
11144         return testdata[0] == 123
11145            &&  testdata[1] == 456
11146            &&  testdata[2] == 789;
11147 #endif
11148 }
11149 EOF
11150         if { (eval echo "$as_me:11150: \"$ac_compile\"") >&5
11151   (eval $ac_compile) 2>&5
11152   ac_status=$?
11153   echo "$as_me:11153: \$? = $ac_status" >&5
11154   (exit $ac_status); }; then
11155                 mv conftest.o func.o && \
11156                 ( $AR $ARFLAGS conftest.a func.o ) 2>&5 1>/dev/null
11157         fi
11158         rm -f conftest.$ac_ext func.o
11159         ( eval $RANLIB conftest.a ) 2>&5 >/dev/null
11160         cf_saveLIBS="$LIBS"
11161         LIBS="conftest.a $LIBS"
11162         if test "$cross_compiling" = yes; then
11163   cf_cv_link_dataonly=unknown
11164 else
11165   cat >conftest.$ac_ext <<_ACEOF
11166 #line 11166 "configure"
11167 #include "confdefs.h"
11168
11169         int main()
11170         {
11171                 extern int testfunc();
11172                 ${cf_cv_main_return:-return} (!testfunc());
11173         }
11174
11175 _ACEOF
11176 rm -f conftest$ac_exeext
11177 if { (eval echo "$as_me:11177: \"$ac_link\"") >&5
11178   (eval $ac_link) 2>&5
11179   ac_status=$?
11180   echo "$as_me:11180: \$? = $ac_status" >&5
11181   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
11182   { (eval echo "$as_me:11182: \"$ac_try\"") >&5
11183   (eval $ac_try) 2>&5
11184   ac_status=$?
11185   echo "$as_me:11185: \$? = $ac_status" >&5
11186   (exit $ac_status); }; }; then
11187   cf_cv_link_dataonly=yes
11188 else
11189   echo "$as_me: program exited with status $ac_status" >&5
11190 echo "$as_me: failed program was:" >&5
11191 cat conftest.$ac_ext >&5
11192 cf_cv_link_dataonly=no
11193 fi
11194 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
11195 fi
11196         LIBS="$cf_saveLIBS"
11197
11198 fi
11199
11200 echo "$as_me:11200: result: $cf_cv_link_dataonly" >&5
11201 echo "${ECHO_T}$cf_cv_link_dataonly" >&6
11202
11203 if test "$cf_cv_link_dataonly" = no ; then
11204
11205 cat >>confdefs.h <<\EOF
11206 #define BROKEN_LINKER 1
11207 EOF
11208
11209         BROKEN_LINKER=1
11210 fi
11211
11212 ###     Checks for library functions.
11213
11214 echo "$as_me:11214: checking for working mkstemp" >&5
11215 echo $ECHO_N "checking for working mkstemp... $ECHO_C" >&6
11216 if test "${cf_cv_func_mkstemp+set}" = set; then
11217   echo $ECHO_N "(cached) $ECHO_C" >&6
11218 else
11219
11220 rm -rf conftest*
11221 if test "$cross_compiling" = yes; then
11222   cf_cv_func_mkstemp=maybe
11223 else
11224   cat >conftest.$ac_ext <<_ACEOF
11225 #line 11225 "configure"
11226 #include "confdefs.h"
11227
11228 #include <sys/types.h>
11229 #include <stdlib.h>
11230 #include <stdio.h>
11231 #include <string.h>
11232 #include <sys/stat.h>
11233 int main()
11234 {
11235         char *tmpl = "conftestXXXXXX";
11236         char name[2][80];
11237         int n;
11238         int result = 0;
11239         int fd;
11240         struct stat sb;
11241
11242         umask(077);
11243         for (n = 0; n < 2; ++n) {
11244                 strcpy(name[n], tmpl);
11245                 if ((fd = mkstemp(name[n])) >= 0) {
11246                         if (!strcmp(name[n], tmpl)
11247                          || stat(name[n], &sb) != 0
11248                          || (sb.st_mode & S_IFMT) != S_IFREG
11249                          || (sb.st_mode & 077) != 0) {
11250                                 result = 1;
11251                         }
11252                         close(fd);
11253                 }
11254         }
11255         if (result == 0
11256          && !strcmp(name[0], name[1]))
11257                 result = 1;
11258         ${cf_cv_main_return:-return}(result);
11259 }
11260
11261 _ACEOF
11262 rm -f conftest$ac_exeext
11263 if { (eval echo "$as_me:11263: \"$ac_link\"") >&5
11264   (eval $ac_link) 2>&5
11265   ac_status=$?
11266   echo "$as_me:11266: \$? = $ac_status" >&5
11267   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
11268   { (eval echo "$as_me:11268: \"$ac_try\"") >&5
11269   (eval $ac_try) 2>&5
11270   ac_status=$?
11271   echo "$as_me:11271: \$? = $ac_status" >&5
11272   (exit $ac_status); }; }; then
11273   cf_cv_func_mkstemp=yes
11274
11275 else
11276   echo "$as_me: program exited with status $ac_status" >&5
11277 echo "$as_me: failed program was:" >&5
11278 cat conftest.$ac_ext >&5
11279 cf_cv_func_mkstemp=no
11280
11281 fi
11282 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
11283 fi
11284
11285 fi
11286 echo "$as_me:11286: result: $cf_cv_func_mkstemp" >&5
11287 echo "${ECHO_T}$cf_cv_func_mkstemp" >&6
11288 if test "x$cf_cv_func_mkstemp" = xmaybe ; then
11289         echo "$as_me:11289: checking for mkstemp" >&5
11290 echo $ECHO_N "checking for mkstemp... $ECHO_C" >&6
11291 if test "${ac_cv_func_mkstemp+set}" = set; then
11292   echo $ECHO_N "(cached) $ECHO_C" >&6
11293 else
11294   cat >conftest.$ac_ext <<_ACEOF
11295 #line 11295 "configure"
11296 #include "confdefs.h"
11297 /* System header to define __stub macros and hopefully few prototypes,
11298     which can conflict with char mkstemp (); below.  */
11299 #include <assert.h>
11300 /* Override any gcc2 internal prototype to avoid an error.  */
11301 #ifdef __cplusplus
11302 extern "C"
11303 #endif
11304 /* We use char because int might match the return type of a gcc2
11305    builtin and then its argument prototype would still apply.  */
11306 char mkstemp ();
11307 char (*f) ();
11308
11309 int
11310 main ()
11311 {
11312 /* The GNU C library defines this for functions which it implements
11313     to always fail with ENOSYS.  Some functions are actually named
11314     something starting with __ and the normal name is an alias.  */
11315 #if defined (__stub_mkstemp) || defined (__stub___mkstemp)
11316 choke me
11317 #else
11318 f = mkstemp; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
11319 #endif
11320
11321   ;
11322   return 0;
11323 }
11324 _ACEOF
11325 rm -f conftest.$ac_objext conftest$ac_exeext
11326 if { (eval echo "$as_me:11326: \"$ac_link\"") >&5
11327   (eval $ac_link) 2>&5
11328   ac_status=$?
11329   echo "$as_me:11329: \$? = $ac_status" >&5
11330   (exit $ac_status); } &&
11331          { ac_try='test -s conftest$ac_exeext'
11332   { (eval echo "$as_me:11332: \"$ac_try\"") >&5
11333   (eval $ac_try) 2>&5
11334   ac_status=$?
11335   echo "$as_me:11335: \$? = $ac_status" >&5
11336   (exit $ac_status); }; }; then
11337   ac_cv_func_mkstemp=yes
11338 else
11339   echo "$as_me: failed program was:" >&5
11340 cat conftest.$ac_ext >&5
11341 ac_cv_func_mkstemp=no
11342 fi
11343 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11344 fi
11345 echo "$as_me:11345: result: $ac_cv_func_mkstemp" >&5
11346 echo "${ECHO_T}$ac_cv_func_mkstemp" >&6
11347
11348 fi
11349 if test "x$cf_cv_func_mkstemp" = xyes || test "x$ac_cv_func_mkstemp" = xyes ; then
11350
11351 cat >>confdefs.h <<\EOF
11352 #define HAVE_MKSTEMP 1
11353 EOF
11354
11355 fi
11356
11357 if test -z "$cf_user_CFLAGS" && test "$with_no_leaks" = no ; then
11358         CFLAGS=`echo ${CFLAGS} | sed -e 's%-g %%' -e 's%-g$%%'`
11359         CXXFLAGS=`echo ${CXXFLAGS} | sed -e 's%-g %%' -e 's%-g$%%'`
11360 fi
11361
11362 cf_with_ada=yes
11363 if test "$cf_with_ada" != "no" ; then
11364
11365 cf_ada_make=gnatmake
11366 # Extract the first word of "$cf_ada_make", so it can be a program name with args.
11367 set dummy $cf_ada_make; ac_word=$2
11368 echo "$as_me:11368: checking for $ac_word" >&5
11369 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
11370 if test "${ac_cv_prog_gnat_exists+set}" = set; then
11371   echo $ECHO_N "(cached) $ECHO_C" >&6
11372 else
11373   if test -n "$gnat_exists"; then
11374   ac_cv_prog_gnat_exists="$gnat_exists" # Let the user override the test.
11375 else
11376   ac_save_IFS=$IFS; IFS=$ac_path_separator
11377 ac_dummy="$PATH"
11378 for ac_dir in $ac_dummy; do
11379   IFS=$ac_save_IFS
11380   test -z "$ac_dir" && ac_dir=.
11381   $as_executable_p "$ac_dir/$ac_word" || continue
11382 ac_cv_prog_gnat_exists="yes"
11383 echo "$as_me:11383: found $ac_dir/$ac_word" >&5
11384 break
11385 done
11386
11387   test -z "$ac_cv_prog_gnat_exists" && ac_cv_prog_gnat_exists="no"
11388 fi
11389 fi
11390 gnat_exists=$ac_cv_prog_gnat_exists
11391 if test -n "$gnat_exists"; then
11392   echo "$as_me:11392: result: $gnat_exists" >&5
11393 echo "${ECHO_T}$gnat_exists" >&6
11394 else
11395   echo "$as_me:11395: result: no" >&5
11396 echo "${ECHO_T}no" >&6
11397 fi
11398
11399 if test "$ac_cv_prog_gnat_exists" = no; then
11400    cf_ada_make=
11401    cf_cv_prog_gnat_correct=no
11402 else
11403
11404 echo "$as_me:11404: checking for gnat version" >&5
11405 echo $ECHO_N "checking for gnat version... $ECHO_C" >&6
11406 cf_gnat_version=`${cf_ada_make:-gnatmake} -v 2>&1 | \
11407         grep '[0-9].[0-9][0-9]*' |\
11408     sed -e '2,$d' -e 's/[^0-9 \.]//g' -e 's/^[ ]*//' -e 's/ .*//'`
11409 echo "$as_me:11409: result: $cf_gnat_version" >&5
11410 echo "${ECHO_T}$cf_gnat_version" >&6
11411
11412 case $cf_gnat_version in #(vi
11413 3.1[1-9]*|3.[2-9]*|[4-9].*|20[0-9][0-9]) #(vi
11414         cf_cv_prog_gnat_correct=yes
11415         ;;
11416 *)
11417         { echo "$as_me:11417: WARNING: Unsupported GNAT version $cf_gnat_version. We require 3.11 or better. Disabling Ada95 binding." >&5
11418 echo "$as_me: WARNING: Unsupported GNAT version $cf_gnat_version. We require 3.11 or better. Disabling Ada95 binding." >&2;}
11419         cf_cv_prog_gnat_correct=no
11420         ;;
11421 esac
11422
11423    # Extract the first word of "m4", so it can be a program name with args.
11424 set dummy m4; ac_word=$2
11425 echo "$as_me:11425: checking for $ac_word" >&5
11426 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
11427 if test "${ac_cv_prog_M4_exists+set}" = set; then
11428   echo $ECHO_N "(cached) $ECHO_C" >&6
11429 else
11430   if test -n "$M4_exists"; then
11431   ac_cv_prog_M4_exists="$M4_exists" # Let the user override the test.
11432 else
11433   ac_save_IFS=$IFS; IFS=$ac_path_separator
11434 ac_dummy="$PATH"
11435 for ac_dir in $ac_dummy; do
11436   IFS=$ac_save_IFS
11437   test -z "$ac_dir" && ac_dir=.
11438   $as_executable_p "$ac_dir/$ac_word" || continue
11439 ac_cv_prog_M4_exists="yes"
11440 echo "$as_me:11440: found $ac_dir/$ac_word" >&5
11441 break
11442 done
11443
11444   test -z "$ac_cv_prog_M4_exists" && ac_cv_prog_M4_exists="no"
11445 fi
11446 fi
11447 M4_exists=$ac_cv_prog_M4_exists
11448 if test -n "$M4_exists"; then
11449   echo "$as_me:11449: result: $M4_exists" >&5
11450 echo "${ECHO_T}$M4_exists" >&6
11451 else
11452   echo "$as_me:11452: result: no" >&5
11453 echo "${ECHO_T}no" >&6
11454 fi
11455
11456    if test "$ac_cv_prog_M4_exists" = no; then
11457       cf_cv_prog_gnat_correct=no
11458       echo Ada95 binding required program m4 not found. Ada95 binding disabled.
11459    fi
11460    if test "$cf_cv_prog_gnat_correct" = yes; then
11461       echo "$as_me:11461: checking if GNAT works" >&5
11462 echo $ECHO_N "checking if GNAT works... $ECHO_C" >&6
11463
11464 rm -rf conftest* *~conftest*
11465 cat >>conftest.ads <<CF_EOF
11466 procedure conftest;
11467 CF_EOF
11468 cat >>conftest.adb <<CF_EOF
11469 with Text_IO;
11470 with GNAT.OS_Lib;
11471 procedure conftest is
11472 begin
11473    Text_IO.Put ("Hello World");
11474    Text_IO.New_Line;
11475    GNAT.OS_Lib.OS_Exit (0);
11476 end conftest;
11477 CF_EOF
11478 if ( $cf_ada_make $ADAFLAGS conftest 1>&5 2>&1 ) ; then
11479    if ( ./conftest 1>&5 2>&1 ) ; then
11480       cf_cv_prog_gnat_correct=yes
11481    else
11482       cf_cv_prog_gnat_correct=no
11483    fi
11484 else
11485    cf_cv_prog_gnat_correct=no
11486 fi
11487 rm -rf conftest* *~conftest*
11488
11489       echo "$as_me:11489: result: $cf_cv_prog_gnat_correct" >&5
11490 echo "${ECHO_T}$cf_cv_prog_gnat_correct" >&6
11491    fi
11492 fi
11493
11494         if test "$cf_cv_prog_gnat_correct" = yes; then
11495
11496         echo "$as_me:11496: checking optimization options for ADAFLAGS" >&5
11497 echo $ECHO_N "checking optimization options for ADAFLAGS... $ECHO_C" >&6
11498         case "$CFLAGS" in
11499         *-g*)
11500
11501         ADAFLAGS="$ADAFLAGS -g"
11502
11503                 ;;
11504         esac
11505         case "$CFLAGS" in
11506         *-O*)
11507                 cf_O_flag=`echo "$CFLAGS" |sed -e 's/^.*-O/-O/' -e 's/[         ].*//'`
11508
11509         ADAFLAGS="$ADAFLAGS $cf_O_flag"
11510
11511                 ;;
11512         esac
11513         echo "$as_me:11513: result: $ADAFLAGS" >&5
11514 echo "${ECHO_T}$ADAFLAGS" >&6
11515
11516 echo "$as_me:11516: checking if GNATPREP supports -T option" >&5
11517 echo $ECHO_N "checking if GNATPREP supports -T option... $ECHO_C" >&6
11518 if test "${cf_cv_gnatprep_opt_t+set}" = set; then
11519   echo $ECHO_N "(cached) $ECHO_C" >&6
11520 else
11521
11522 cf_cv_gnatprep_opt_t=no
11523 gnatprep -T 2>/dev/null >/dev/null && cf_cv_gnatprep_opt_t=yes
11524
11525 fi
11526 echo "$as_me:11526: result: $cf_cv_gnatprep_opt_t" >&5
11527 echo "${ECHO_T}$cf_cv_gnatprep_opt_t" >&6
11528 test "$cf_cv_gnatprep_opt_t" = yes && GNATPREP_OPTS="-T $GNATPREP_OPTS"
11529
11530 echo "$as_me:11530: checking if GNAT supports generics" >&5
11531 echo $ECHO_N "checking if GNAT supports generics... $ECHO_C" >&6
11532 case $cf_gnat_version in #(vi
11533 3.[1-9]*|[4-9].*) #(vi
11534         cf_gnat_generics=yes
11535         ;;
11536 *)
11537         cf_gnat_generics=no
11538         ;;
11539 esac
11540 echo "$as_me:11540: result: $cf_gnat_generics" >&5
11541 echo "${ECHO_T}$cf_gnat_generics" >&6
11542
11543 if test "$cf_gnat_generics" = yes
11544 then
11545         cf_compile_generics=generics
11546         cf_generic_objects="\${GENOBJS}"
11547 else
11548         cf_compile_generics=
11549         cf_generic_objects=
11550 fi
11551
11552 echo "$as_me:11552: checking if GNAT supports SIGINT" >&5
11553 echo $ECHO_N "checking if GNAT supports SIGINT... $ECHO_C" >&6
11554 if test "${cf_cv_gnat_sigint+set}" = set; then
11555   echo $ECHO_N "(cached) $ECHO_C" >&6
11556 else
11557
11558 rm -rf conftest* *~conftest*
11559 cat >>conftest.ads <<CF_EOF
11560 with Ada.Interrupts.Names;
11561
11562 package ConfTest is
11563
11564    pragma Warnings (Off);  --  the next pragma exists since 3.11p
11565    pragma Unreserve_All_Interrupts;
11566    pragma Warnings (On);
11567
11568    protected Process is
11569       procedure Stop;
11570       function Continue return Boolean;
11571       pragma Attach_Handler (Stop, Ada.Interrupts.Names.SIGINT);
11572    private
11573       Done : Boolean := False;
11574    end Process;
11575
11576 end ConfTest;
11577 CF_EOF
11578 cat >>conftest.adb <<CF_EOF
11579 package body ConfTest is
11580    protected body Process is
11581       procedure Stop is
11582       begin
11583          Done := True;
11584       end Stop;
11585       function Continue return Boolean is
11586       begin
11587          return not Done;
11588       end Continue;
11589    end Process;
11590 end ConfTest;
11591 CF_EOF
11592 if ( $cf_ada_make $ADAFLAGS conftest 1>&5 2>&1 ) ; then
11593       cf_cv_gnat_sigint=yes
11594 else
11595    cf_cv_gnat_sigint=no
11596 fi
11597 rm -rf conftest* *~conftest*
11598
11599 fi
11600 echo "$as_me:11600: result: $cf_cv_gnat_sigint" >&5
11601 echo "${ECHO_T}$cf_cv_gnat_sigint" >&6
11602
11603 if test $cf_cv_gnat_sigint = yes ; then
11604         USE_GNAT_SIGINT=""
11605 else
11606         USE_GNAT_SIGINT="#"
11607 fi
11608
11609 cf_gnat_libraries=no
11610 cf_gnat_projects=no
11611
11612 if test "$enable_gnat_projects" != no ; then
11613 echo "$as_me:11613: checking if GNAT supports project files" >&5
11614 echo $ECHO_N "checking if GNAT supports project files... $ECHO_C" >&6
11615 case $cf_gnat_version in #(vi
11616 3.[0-9]*) #(vi
11617         ;;
11618 *)
11619         case $cf_cv_system_name in #(vi
11620         cygwin*|msys*) #(vi
11621                 ;;
11622         *)
11623                 mkdir conftest.src conftest.bin conftest.lib
11624                 cd conftest.src
11625                 rm -rf conftest* *~conftest*
11626                 cat >>library.gpr <<CF_EOF
11627 project Library is
11628   Kind := External ("LIB_KIND");
11629   for Library_Name use "ConfTest";
11630   for Object_Dir use ".";
11631   for Library_ALI_Dir use External("LIBRARY_DIR");
11632   for Library_Version use External ("SONAME");
11633   for Library_Kind use Kind;
11634   for Library_Dir use External("BUILD_DIR");
11635   Source_Dir := External ("SOURCE_DIR");
11636   for Source_Dirs use (Source_Dir);
11637 end Library;
11638 CF_EOF
11639                 cat >>confpackage.ads <<CF_EOF
11640 package ConfPackage is
11641    procedure conftest;
11642 end ConfPackage;
11643 CF_EOF
11644                 cat >>confpackage.adb <<CF_EOF
11645 with Text_IO;
11646 package body ConfPackage is
11647    procedure conftest is
11648    begin
11649       Text_IO.Put ("Hello World");
11650       Text_IO.New_Line;
11651    end conftest;
11652 end ConfPackage;
11653 CF_EOF
11654                 if ( $cf_ada_make $ADAFLAGS \
11655                                 -Plibrary.gpr \
11656                                 -XBUILD_DIR=`cd ../conftest.bin;pwd` \
11657                                 -XLIBRARY_DIR=`cd ../conftest.lib;pwd` \
11658                                 -XSOURCE_DIR=`pwd` \
11659                                 -XSONAME=libConfTest.so.1 \
11660                                 -XLIB_KIND=static 1>&5 2>&1 ) ; then
11661                         cf_gnat_projects=yes
11662                 fi
11663                 cd ..
11664                 if test -f conftest.lib/confpackage.ali
11665                 then
11666                         cf_gnat_libraries=yes
11667                 fi
11668                 rm -rf conftest* *~conftest*
11669                 ;;
11670         esac
11671         ;;
11672 esac
11673 echo "$as_me:11673: result: $cf_gnat_projects" >&5
11674 echo "${ECHO_T}$cf_gnat_projects" >&6
11675 fi # enable_gnat_projects
11676
11677 if test $cf_gnat_projects = yes
11678 then
11679         echo "$as_me:11679: checking if GNAT supports libraries" >&5
11680 echo $ECHO_N "checking if GNAT supports libraries... $ECHO_C" >&6
11681         echo "$as_me:11681: result: $cf_gnat_libraries" >&5
11682 echo "${ECHO_T}$cf_gnat_libraries" >&6
11683 fi
11684
11685 if test "$cf_gnat_projects" = yes
11686 then
11687         USE_OLD_MAKERULES="#"
11688         USE_GNAT_PROJECTS=""
11689 else
11690         USE_OLD_MAKERULES=""
11691         USE_GNAT_PROJECTS="#"
11692 fi
11693
11694 if test "$cf_gnat_libraries" = yes
11695 then
11696         USE_GNAT_LIBRARIES=""
11697 else
11698         USE_GNAT_LIBRARIES="#"
11699 fi
11700
11701 echo "$as_me:11701: checking for ada-compiler" >&5
11702 echo $ECHO_N "checking for ada-compiler... $ECHO_C" >&6
11703
11704 # Check whether --with-ada-compiler or --without-ada-compiler was given.
11705 if test "${with_ada_compiler+set}" = set; then
11706   withval="$with_ada_compiler"
11707   cf_ada_compiler=$withval
11708 else
11709   cf_ada_compiler=gnatmake
11710 fi;
11711
11712 echo "$as_me:11712: result: $cf_ada_compiler" >&5
11713 echo "${ECHO_T}$cf_ada_compiler" >&6
11714
11715                 cf_ada_package=terminal_interface
11716
11717 echo "$as_me:11717: checking for ada-include" >&5
11718 echo $ECHO_N "checking for ada-include... $ECHO_C" >&6
11719
11720 # Check whether --with-ada-include or --without-ada-include was given.
11721 if test "${with_ada_include+set}" = set; then
11722   withval="$with_ada_include"
11723
11724 else
11725   withval="${ADA_INCLUDE:-$prefix/share/ada/adainclude}"
11726 fi; if test -n "$prefix/share/ada/adainclude" ; then
11727
11728 if test "x$prefix" != xNONE; then
11729   cf_path_syntax="$prefix"
11730 else
11731   cf_path_syntax="$ac_default_prefix"
11732 fi
11733
11734 case ".$withval" in #(vi
11735 .\$\(*\)*|.\'*\'*) #(vi
11736   ;;
11737 ..|./*|.\\*) #(vi
11738   ;;
11739 .[a-zA-Z]:[\\/]*) #(vi OS/2 EMX
11740   ;;
11741 .\${*prefix}*|.\${*dir}*) #(vi
11742   eval withval="$withval"
11743   case ".$withval" in #(vi
11744   .NONE/*)
11745     withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
11746     ;;
11747   esac
11748   ;; #(vi
11749 .no|.NONE/*)
11750   withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
11751   ;;
11752 *)
11753   { { echo "$as_me:11753: error: expected a pathname, not \"$withval\"" >&5
11754 echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;}
11755    { (exit 1); exit 1; }; }
11756   ;;
11757 esac
11758
11759 fi
11760 eval ADA_INCLUDE="$withval"
11761
11762 echo "$as_me:11762: result: $ADA_INCLUDE" >&5
11763 echo "${ECHO_T}$ADA_INCLUDE" >&6
11764
11765 echo "$as_me:11765: checking for ada-objects" >&5
11766 echo $ECHO_N "checking for ada-objects... $ECHO_C" >&6
11767
11768 # Check whether --with-ada-objects or --without-ada-objects was given.
11769 if test "${with_ada_objects+set}" = set; then
11770   withval="$with_ada_objects"
11771
11772 else
11773   withval="${ADA_OBJECTS:-$prefix/lib/ada/adalib}"
11774 fi; if test -n "$prefix/lib/ada/adalib" ; then
11775
11776 if test "x$prefix" != xNONE; then
11777   cf_path_syntax="$prefix"
11778 else
11779   cf_path_syntax="$ac_default_prefix"
11780 fi
11781
11782 case ".$withval" in #(vi
11783 .\$\(*\)*|.\'*\'*) #(vi
11784   ;;
11785 ..|./*|.\\*) #(vi
11786   ;;
11787 .[a-zA-Z]:[\\/]*) #(vi OS/2 EMX
11788   ;;
11789 .\${*prefix}*|.\${*dir}*) #(vi
11790   eval withval="$withval"
11791   case ".$withval" in #(vi
11792   .NONE/*)
11793     withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
11794     ;;
11795   esac
11796   ;; #(vi
11797 .no|.NONE/*)
11798   withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
11799   ;;
11800 *)
11801   { { echo "$as_me:11801: error: expected a pathname, not \"$withval\"" >&5
11802 echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;}
11803    { (exit 1); exit 1; }; }
11804   ;;
11805 esac
11806
11807 fi
11808 eval ADA_OBJECTS="$withval"
11809
11810 echo "$as_me:11810: result: $ADA_OBJECTS" >&5
11811 echo "${ECHO_T}$ADA_OBJECTS" >&6
11812
11813 echo "$as_me:11813: checking if an Ada95 shared-library should be built" >&5
11814 echo $ECHO_N "checking if an Ada95 shared-library should be built... $ECHO_C" >&6
11815
11816 # Check whether --with-ada-sharedlib or --without-ada-sharedlib was given.
11817 if test "${with_ada_sharedlib+set}" = set; then
11818   withval="$with_ada_sharedlib"
11819   with_ada_sharedlib=$withval
11820 else
11821   with_ada_sharedlib=no
11822 fi;
11823 echo "$as_me:11823: result: $with_ada_sharedlib" >&5
11824 echo "${ECHO_T}$with_ada_sharedlib" >&6
11825
11826 ADA_SHAREDLIB='lib$(LIB_NAME).so.1'
11827 MAKE_ADA_SHAREDLIB="#"
11828
11829 if test "x$with_ada_sharedlib" != xno
11830 then
11831         MAKE_ADA_SHAREDLIB=
11832         if test "x$with_ada_sharedlib" != xyes
11833         then
11834                 ADA_SHAREDLIB="$with_ada_sharedlib"
11835         fi
11836 fi
11837
11838         else
11839                 { { echo "$as_me:11839: error: No usable Ada compiler found" >&5
11840 echo "$as_me: error: No usable Ada compiler found" >&2;}
11841    { (exit 1); exit 1; }; }
11842         fi
11843 else
11844         { { echo "$as_me:11844: error: The Ada compiler is needed for this package" >&5
11845 echo "$as_me: error: The Ada compiler is needed for this package" >&2;}
11846    { (exit 1); exit 1; }; }
11847 fi
11848
11849 ################################################################################
11850
11851 # not needed
11852 TINFO_LDFLAGS2=
11853
11854 TINFO_LIBS=
11855
11856 ### Construct the list of include-directories to be generated
11857
11858 if test "$srcdir" != "."; then
11859         CPPFLAGS="-I\${srcdir}/../include $CPPFLAGS"
11860 fi
11861 CPPFLAGS="-I../include $CPPFLAGS"
11862 if test "$srcdir" != "."; then
11863         CPPFLAGS="-I\${srcdir} $CPPFLAGS"
11864 fi
11865 CPPFLAGS="-I. $CPPFLAGS"
11866
11867 ACPPFLAGS="-I. -I../include -I../../include $ACPPFLAGS"
11868 if test "$srcdir" != "."; then
11869         ACPPFLAGS="-I\${srcdir}/../../include $ACPPFLAGS"
11870 fi
11871 if test "$GCC" != yes; then
11872         ACPPFLAGS="$ACPPFLAGS -I\${includedir}"
11873 elif test "$includedir" != "/usr/include"; then
11874         if test "$includedir" = '${prefix}/include' ; then
11875                 if test x$prefix != x/usr ; then
11876                         ACPPFLAGS="$ACPPFLAGS -I\${includedir}"
11877                 fi
11878         else
11879                 ACPPFLAGS="$ACPPFLAGS -I\${includedir}"
11880         fi
11881 fi
11882
11883 ### Build up pieces for makefile rules
11884 echo "$as_me:11884: checking default library suffix" >&5
11885 echo $ECHO_N "checking default library suffix... $ECHO_C" >&6
11886
11887         case $DFT_LWR_MODEL in
11888         libtool) DFT_ARG_SUFFIX=''   ;;
11889         normal)  DFT_ARG_SUFFIX=''   ;;
11890         debug)   DFT_ARG_SUFFIX='_g' ;;
11891         profile) DFT_ARG_SUFFIX='_p' ;;
11892         shared)  DFT_ARG_SUFFIX=''   ;;
11893         esac
11894         test -n "$LIB_SUFFIX" && DFT_ARG_SUFFIX="${LIB_SUFFIX}${DFT_ARG_SUFFIX}"
11895 echo "$as_me:11895: result: $DFT_ARG_SUFFIX" >&5
11896 echo "${ECHO_T}$DFT_ARG_SUFFIX" >&6
11897
11898 echo "$as_me:11898: checking default library-dependency suffix" >&5
11899 echo $ECHO_N "checking default library-dependency suffix... $ECHO_C" >&6
11900
11901         case X$DFT_LWR_MODEL in #(vi
11902         Xlibtool) #(vi
11903                 DFT_LIB_SUFFIX='.la'
11904                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
11905                 ;;
11906         Xdebug) #(vi
11907                 DFT_LIB_SUFFIX='_g.a'
11908                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
11909                 ;;
11910         Xprofile) #(vi
11911                 DFT_LIB_SUFFIX='_p.a'
11912                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
11913                 ;;
11914         Xshared) #(vi
11915                 case $cf_cv_system_name in
11916                 aix[5-7]*) #(vi
11917                         DFT_LIB_SUFFIX='.so'
11918                         DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
11919                         ;;
11920                 cygwin*|msys*|mingw*) #(vi
11921                         DFT_LIB_SUFFIX='.dll'
11922                         DFT_DEP_SUFFIX='.dll.a'
11923                         ;;
11924                 darwin*) #(vi
11925                         DFT_LIB_SUFFIX='.dylib'
11926                         DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
11927                         ;;
11928                 hpux*) #(vi
11929                         case $target in
11930                         ia64*) #(vi
11931                                 DFT_LIB_SUFFIX='.so'
11932                                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
11933                                 ;;
11934                         *) #(vi
11935                                 DFT_LIB_SUFFIX='.sl'
11936                                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
11937                                 ;;
11938                         esac
11939                         ;;
11940                 *) #(vi
11941                         DFT_LIB_SUFFIX='.so'
11942                         DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
11943                         ;;
11944                 esac
11945                 ;;
11946         *)
11947                 DFT_LIB_SUFFIX='.a'
11948                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
11949                 ;;
11950         esac
11951         test -n "$LIB_SUFFIX" && DFT_LIB_SUFFIX="${LIB_SUFFIX}${DFT_LIB_SUFFIX}"
11952         test -n "$LIB_SUFFIX" && DFT_DEP_SUFFIX="${LIB_SUFFIX}${DFT_DEP_SUFFIX}"
11953 echo "$as_me:11953: result: $DFT_DEP_SUFFIX" >&5
11954 echo "${ECHO_T}$DFT_DEP_SUFFIX" >&6
11955
11956 echo "$as_me:11956: checking default object directory" >&5
11957 echo $ECHO_N "checking default object directory... $ECHO_C" >&6
11958
11959         case $DFT_LWR_MODEL in
11960         libtool) DFT_OBJ_SUBDIR='obj_lo'  ;;
11961         normal)  DFT_OBJ_SUBDIR='objects' ;;
11962         debug)   DFT_OBJ_SUBDIR='obj_g' ;;
11963         profile) DFT_OBJ_SUBDIR='obj_p' ;;
11964         shared)
11965                 case $cf_cv_system_name in #(vi
11966                 cygwin|msys) #(vi
11967                         DFT_OBJ_SUBDIR='objects' ;;
11968                 *)
11969                         DFT_OBJ_SUBDIR='obj_s' ;;
11970                 esac
11971         esac
11972 echo "$as_me:11972: result: $DFT_OBJ_SUBDIR" >&5
11973 echo "${ECHO_T}$DFT_OBJ_SUBDIR" >&6
11974
11975 ### Set up low-level terminfo dependencies for makefiles.
11976
11977 if test "$DFT_LWR_MODEL" = shared ; then
11978         case $cf_cv_system_name in #(vi
11979         cygwin*)
11980                 # "lib" files have ".dll.a" suffix, "cyg" files have ".dll"
11981                 ;;
11982         msys*)
11983                 # "lib" files have ".dll.a" suffix, "msys-" files have ".dll"
11984                 ;;
11985         esac
11986 fi
11987
11988 ### Construct the list of subdirectories for which we'll customize makefiles
11989 ### with the appropriate compile-rules.
11990
11991 SUB_MAKEFILES="gen/adacurses${DFT_ARG_SUFFIX}-config:gen/adacurses-config.in"
11992
11993 cat >>confdefs.h <<EOF
11994 #define NCURSES_PATHSEP '$PATH_SEPARATOR'
11995 EOF
11996
11997 ### Now that we're done running tests, add the compiler-warnings, if any
11998
11999 cf_fix_cppflags=no
12000 cf_new_cflags=
12001 cf_new_cppflags=
12002 cf_new_extra_cppflags=
12003
12004 for cf_add_cflags in $EXTRA_CFLAGS
12005 do
12006 case $cf_fix_cppflags in
12007 no)
12008         case $cf_add_cflags in #(vi
12009         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
12010                 case $cf_add_cflags in
12011                 -D*)
12012                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
12013
12014                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12015                                 && test -z "${cf_tst_cflags}" \
12016                                 && cf_fix_cppflags=yes
12017
12018                         if test $cf_fix_cppflags = yes ; then
12019                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
12020                                 continue
12021                         elif test "${cf_tst_cflags}" = "\"'" ; then
12022                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
12023                                 continue
12024                         fi
12025                         ;;
12026                 esac
12027                 case "$CPPFLAGS" in
12028                 *$cf_add_cflags) #(vi
12029                         ;;
12030                 *) #(vi
12031                         case $cf_add_cflags in #(vi
12032                         -D*)
12033                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
12034
12035 CPPFLAGS=`echo "$CPPFLAGS" | \
12036         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
12037                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
12038
12039                                 ;;
12040                         esac
12041                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
12042                         ;;
12043                 esac
12044                 ;;
12045         *)
12046                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
12047                 ;;
12048         esac
12049         ;;
12050 yes)
12051         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
12052
12053         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
12054
12055         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12056                 && test -z "${cf_tst_cflags}" \
12057                 && cf_fix_cppflags=no
12058         ;;
12059 esac
12060 done
12061
12062 if test -n "$cf_new_cflags" ; then
12063
12064         CFLAGS="$CFLAGS $cf_new_cflags"
12065 fi
12066
12067 if test -n "$cf_new_cppflags" ; then
12068
12069         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
12070 fi
12071
12072 if test -n "$cf_new_extra_cppflags" ; then
12073
12074         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
12075 fi
12076
12077 ################################################################################
12078
12079 TEST_ARG2=
12080
12081 TEST_LIBS2=
12082
12083 NCURSES_SHLIB2="sh -c"
12084
12085 ADA_SUBDIRS="include gen src doc"
12086 if test "x$cf_with_tests" != "xno" ; then
12087         ADA_SUBDIRS="$ADA_SUBDIRS samples"
12088 fi
12089 for cf_dir in $ADA_SUBDIRS
12090 do
12091         SUB_MAKEFILES="$SUB_MAKEFILES $cf_dir/Makefile"
12092 done
12093
12094 NCURSES_TREE="#"
12095
12096 EXTERNAL_TREE=
12097
12098 # match layout used by make-tar.sh
12099 ADAHTML_DIR=../doc/ada
12100
12101 ac_config_files="$ac_config_files $SUB_MAKEFILES doc/adacurses${DFT_ARG_SUFFIX}-config.1:doc/MKada_config.in Makefile"
12102 ac_config_commands="$ac_config_commands default"
12103 cat >confcache <<\_ACEOF
12104 # This file is a shell script that caches the results of configure
12105 # tests run on this system so they can be shared between configure
12106 # scripts and configure runs, see configure's option --config-cache.
12107 # It is not useful on other systems.  If it contains results you don't
12108 # want to keep, you may remove or edit it.
12109 #
12110 # config.status only pays attention to the cache file if you give it
12111 # the --recheck option to rerun configure.
12112 #
12113 # `ac_cv_env_foo' variables (set or unset) will be overriden when
12114 # loading this file, other *unset* `ac_cv_foo' will be assigned the
12115 # following values.
12116
12117 _ACEOF
12118
12119 # The following way of writing the cache mishandles newlines in values,
12120 # but we know of no workaround that is simple, portable, and efficient.
12121 # So, don't put newlines in cache variables' values.
12122 # Ultrix sh set writes to stderr and can't be redirected directly,
12123 # and sets the high bit in the cache file unless we assign to the vars.
12124 {
12125   (set) 2>&1 |
12126     case `(ac_space=' '; set | grep ac_space) 2>&1` in
12127     *ac_space=\ *)
12128       # `set' does not quote correctly, so add quotes (double-quote
12129       # substitution turns \\\\ into \\, and sed turns \\ into \).
12130       sed -n \
12131         "s/'/'\\\\''/g;
12132           s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
12133       ;;
12134     *)
12135       # `set' quotes correctly as required by POSIX, so do not add quotes.
12136       sed -n \
12137         "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
12138       ;;
12139     esac;
12140 } |
12141   sed '
12142      t clear
12143      : clear
12144      s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
12145      t end
12146      /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
12147      : end' >>confcache
12148 if cmp -s $cache_file confcache; then :; else
12149   if test -w $cache_file; then
12150     test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file"
12151     cat confcache >$cache_file
12152   else
12153     echo "not updating unwritable cache $cache_file"
12154   fi
12155 fi
12156 rm -f confcache
12157
12158 test "x$prefix" = xNONE && prefix=$ac_default_prefix
12159 # Let make expand exec_prefix.
12160 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
12161
12162 # VPATH may cause trouble with some makes, so we remove $(srcdir),
12163 # ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
12164 # trailing colons and then remove the whole line if VPATH becomes empty
12165 # (actually we leave an empty line to preserve line numbers).
12166 if test "x$srcdir" = x.; then
12167   ac_vpsub='/^[         ]*VPATH[        ]*=/{
12168 s/:*\$(srcdir):*/:/;
12169 s/:*\${srcdir}:*/:/;
12170 s/:*@srcdir@:*/:/;
12171 s/^\([^=]*=[    ]*\):*/\1/;
12172 s/:*$//;
12173 s/^[^=]*=[      ]*$//;
12174 }'
12175 fi
12176
12177 DEFS=-DHAVE_CONFIG_H
12178
12179 : ${CONFIG_STATUS=./config.status}
12180 ac_clean_files_save=$ac_clean_files
12181 ac_clean_files="$ac_clean_files $CONFIG_STATUS"
12182 { echo "$as_me:12182: creating $CONFIG_STATUS" >&5
12183 echo "$as_me: creating $CONFIG_STATUS" >&6;}
12184 cat >$CONFIG_STATUS <<_ACEOF
12185 #! $SHELL
12186 # Generated automatically by configure.
12187 # Run this file to recreate the current configuration.
12188 # Compiler output produced by configure, useful for debugging
12189 # configure, is in config.log if it exists.
12190
12191 debug=false
12192 SHELL=\${CONFIG_SHELL-$SHELL}
12193 ac_cs_invocation="\$0 \$@"
12194
12195 _ACEOF
12196
12197 cat >>$CONFIG_STATUS <<\_ACEOF
12198 # Be Bourne compatible
12199 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
12200   emulate sh
12201   NULLCMD=:
12202 elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
12203   set -o posix
12204 fi
12205
12206 # Name of the executable.
12207 as_me=`echo "$0" |sed 's,.*[\\/],,'`
12208
12209 if expr a : '\(a\)' >/dev/null 2>&1; then
12210   as_expr=expr
12211 else
12212   as_expr=false
12213 fi
12214
12215 rm -f conf$$ conf$$.exe conf$$.file
12216 echo >conf$$.file
12217 if ln -s conf$$.file conf$$ 2>/dev/null; then
12218   # We could just check for DJGPP; but this test a) works b) is more generic
12219   # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
12220   if test -f conf$$.exe; then
12221     # Don't use ln at all; we don't have any links
12222     as_ln_s='cp -p'
12223   else
12224     as_ln_s='ln -s'
12225   fi
12226 elif ln conf$$.file conf$$ 2>/dev/null; then
12227   as_ln_s=ln
12228 else
12229   as_ln_s='cp -p'
12230 fi
12231 rm -f conf$$ conf$$.exe conf$$.file
12232
12233 as_executable_p="test -f"
12234
12235 # Support unset when possible.
12236 if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
12237   as_unset=unset
12238 else
12239   as_unset=false
12240 fi
12241
12242 # NLS nuisances.
12243 $as_unset LANG || test "${LANG+set}" != set || { LANG=C; export LANG; }
12244 $as_unset LC_ALL || test "${LC_ALL+set}" != set || { LC_ALL=C; export LC_ALL; }
12245 $as_unset LC_TIME || test "${LC_TIME+set}" != set || { LC_TIME=C; export LC_TIME; }
12246 $as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set || { LC_CTYPE=C; export LC_CTYPE; }
12247 $as_unset LANGUAGE || test "${LANGUAGE+set}" != set || { LANGUAGE=C; export LANGUAGE; }
12248 $as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set || { LC_COLLATE=C; export LC_COLLATE; }
12249 $as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set || { LC_NUMERIC=C; export LC_NUMERIC; }
12250 $as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set || { LC_MESSAGES=C; export LC_MESSAGES; }
12251
12252 # IFS
12253 # We need space, tab and new line, in precisely that order.
12254 as_nl='
12255 '
12256 IFS="   $as_nl"
12257
12258 # CDPATH.
12259 $as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=:; export CDPATH; }
12260
12261 exec 6>&1
12262
12263 _ACEOF
12264
12265 # Files that config.status was made for.
12266 if test -n "$ac_config_files"; then
12267   echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS
12268 fi
12269
12270 if test -n "$ac_config_headers"; then
12271   echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS
12272 fi
12273
12274 if test -n "$ac_config_links"; then
12275   echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS
12276 fi
12277
12278 if test -n "$ac_config_commands"; then
12279   echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS
12280 fi
12281
12282 cat >>$CONFIG_STATUS <<\EOF
12283
12284 ac_cs_usage="\
12285 \`$as_me' instantiates files from templates according to the
12286 current configuration.
12287
12288 Usage: $0 [OPTIONS] [FILE]...
12289
12290   -h, --help       print this help, then exit
12291   -V, --version    print version number, then exit
12292   -d, --debug      don't remove temporary files
12293       --recheck    update $as_me by reconfiguring in the same conditions
12294   --file=FILE[:TEMPLATE]
12295                    instantiate the configuration file FILE
12296   --header=FILE[:TEMPLATE]
12297                    instantiate the configuration header FILE
12298
12299 Configuration files:
12300 $config_files
12301
12302 Configuration headers:
12303 $config_headers
12304
12305 Configuration commands:
12306 $config_commands
12307
12308 Report bugs to <dickey@invisible-island.net>."
12309 EOF
12310
12311 cat >>$CONFIG_STATUS <<EOF
12312 ac_cs_version="\\
12313 config.status
12314 configured by $0, generated by GNU Autoconf 2.52.20141204,
12315   with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
12316
12317 Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
12318 Free Software Foundation, Inc.
12319 This config.status script is free software; the Free Software Foundation
12320 gives unlimited permission to copy, distribute and modify it."
12321 srcdir=$srcdir
12322 INSTALL="$INSTALL"
12323 EOF
12324
12325 cat >>$CONFIG_STATUS <<\EOF
12326 # If no file are specified by the user, then we need to provide default
12327 # value.  By we need to know if files were specified by the user.
12328 ac_need_defaults=:
12329 while test $# != 0
12330 do
12331   case $1 in
12332   --*=*)
12333     ac_option=`expr "x$1" : 'x\([^=]*\)='`
12334     ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'`
12335     shift
12336     set dummy "$ac_option" "$ac_optarg" ${1+"$@"}
12337     shift
12338     ;;
12339   -*);;
12340   *) # This is not an option, so the user has probably given explicit
12341      # arguments.
12342      ac_need_defaults=false;;
12343   esac
12344
12345   case $1 in
12346   # Handling of the options.
12347 EOF
12348 cat >>$CONFIG_STATUS <<EOF
12349   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
12350     echo "running $SHELL $0 " $ac_configure_args " --no-create --no-recursion"
12351     exec $SHELL $0 $ac_configure_args --no-create --no-recursion ;;
12352 EOF
12353 cat >>$CONFIG_STATUS <<\EOF
12354   --version | --vers* | -V )
12355     echo "$ac_cs_version"; exit 0 ;;
12356   --he | --h)
12357     # Conflict between --help and --header
12358     { { echo "$as_me:12358: error: ambiguous option: $1
12359 Try \`$0 --help' for more information." >&5
12360 echo "$as_me: error: ambiguous option: $1
12361 Try \`$0 --help' for more information." >&2;}
12362    { (exit 1); exit 1; }; };;
12363   --help | --hel | -h )
12364     echo "$ac_cs_usage"; exit 0 ;;
12365   --debug | --d* | -d )
12366     debug=: ;;
12367   --file | --fil | --fi | --f )
12368     shift
12369     CONFIG_FILES="$CONFIG_FILES $1"
12370     ac_need_defaults=false;;
12371   --header | --heade | --head | --hea )
12372     shift
12373     CONFIG_HEADERS="$CONFIG_HEADERS $1"
12374     ac_need_defaults=false;;
12375
12376   # This is an error.
12377   -*) { { echo "$as_me:12377: error: unrecognized option: $1
12378 Try \`$0 --help' for more information." >&5
12379 echo "$as_me: error: unrecognized option: $1
12380 Try \`$0 --help' for more information." >&2;}
12381    { (exit 1); exit 1; }; } ;;
12382
12383   *) ac_config_targets="$ac_config_targets $1" ;;
12384
12385   esac
12386   shift
12387 done
12388
12389 exec 5>>config.log
12390 cat >&5 << _ACEOF
12391
12392 ## ----------------------- ##
12393 ## Running config.status.  ##
12394 ## ----------------------- ##
12395
12396 This file was extended by $as_me 2.52.20141204, executed with
12397   CONFIG_FILES    = $CONFIG_FILES
12398   CONFIG_HEADERS  = $CONFIG_HEADERS
12399   CONFIG_LINKS    = $CONFIG_LINKS
12400   CONFIG_COMMANDS = $CONFIG_COMMANDS
12401   > $ac_cs_invocation
12402 on `(hostname || uname -n) 2>/dev/null | sed 1q`
12403
12404 _ACEOF
12405 EOF
12406
12407 cat >>$CONFIG_STATUS <<EOF
12408 #
12409 # INIT-COMMANDS section.
12410 #
12411
12412 ### Special initialization commands, used to pass information from the
12413 ### configuration-run into config.status
12414
12415 AWK="$AWK"
12416 DFT_ARG_SUFFIX="$DFT_ARG_SUFFIX"
12417 DFT_LWR_MODEL="$DFT_LWR_MODEL"
12418 LIB_NAME="$LIB_NAME"
12419 LIB_PREFIX="$LIB_PREFIX"
12420 LIB_SUFFIX="$LIB_SUFFIX"
12421 LN_S="$LN_S"
12422 NCURSES_MAJOR="$NCURSES_MAJOR"
12423 NCURSES_MINOR="$NCURSES_MINOR"
12424 NCURSES_PATCH="$NCURSES_PATCH"
12425 USE_OLD_MAKERULES="$USE_OLD_MAKERULES"
12426 cf_cv_abi_version="$cf_cv_abi_version"
12427 cf_cv_rel_version="$cf_cv_rel_version"
12428 cf_cv_rm_so_locs="$cf_cv_rm_so_locs"
12429 cf_cv_shared_soname='$cf_cv_shared_soname'
12430 cf_cv_shlib_version="$cf_cv_shlib_version"
12431 cf_cv_shlib_version_infix="$cf_cv_shlib_version_infix"
12432 cf_cv_system_name="$cf_cv_system_name"
12433 host="$host"
12434 target="$target"
12435
12436 EOF
12437
12438 cat >>$CONFIG_STATUS <<\EOF
12439 for ac_config_target in $ac_config_targets
12440 do
12441   case "$ac_config_target" in
12442   # Handling of arguments.
12443   "$SUB_MAKEFILES" ) CONFIG_FILES="$CONFIG_FILES $SUB_MAKEFILES" ;;
12444   "doc/adacurses${DFT_ARG_SUFFIX}-config.1" ) CONFIG_FILES="$CONFIG_FILES doc/adacurses${DFT_ARG_SUFFIX}-config.1:doc/MKada_config.in" ;;
12445   "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;;
12446   "default" ) CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;;
12447   "include/ncurses_cfg.h" ) CONFIG_HEADERS="$CONFIG_HEADERS include/ncurses_cfg.h:include/ncurses_cfg.hin" ;;
12448   *) { { echo "$as_me:12448: error: invalid argument: $ac_config_target" >&5
12449 echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
12450    { (exit 1); exit 1; }; };;
12451   esac
12452 done
12453
12454 # If the user did not use the arguments to specify the items to instantiate,
12455 # then the envvar interface is used.  Set only those that are not.
12456 # We use the long form for the default assignment because of an extremely
12457 # bizarre bug on SunOS 4.1.3.
12458 if $ac_need_defaults; then
12459   test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
12460   test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
12461   test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
12462 fi
12463
12464 # Create a temporary directory, and hook for its removal unless debugging.
12465 $debug ||
12466 {
12467   trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0
12468   trap '{ (exit 1); exit 1; }' 1 2 13 15
12469 }
12470
12471 # Create a (secure) tmp directory for tmp files.
12472 : ${TMPDIR=/tmp}
12473 {
12474   tmp=`(umask 077 && mktemp -d -q "$TMPDIR/csXXXXXX") 2>/dev/null` &&
12475   test -n "$tmp" && test -d "$tmp"
12476 }  ||
12477 {
12478   tmp=$TMPDIR/cs$$-$RANDOM
12479   (umask 077 && mkdir $tmp)
12480 } ||
12481 {
12482    echo "$me: cannot create a temporary directory in $TMPDIR" >&2
12483    { (exit 1); exit 1; }
12484 }
12485
12486 EOF
12487
12488 cat >>$CONFIG_STATUS <<EOF
12489
12490 #
12491 # CONFIG_FILES section.
12492 #
12493
12494 # No need to generate the scripts if there are no CONFIG_FILES.
12495 # This happens for instance when ./config.status config.h
12496 if test -n "\$CONFIG_FILES"; then
12497   # Protect against being on the right side of a sed subst in config.status.
12498   sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g;
12499    s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF
12500 s,@SHELL@,$SHELL,;t t
12501 s,@exec_prefix@,$exec_prefix,;t t
12502 s,@prefix@,$prefix,;t t
12503 s,@program_transform_name@,$program_transform_name,;t t
12504 s,@bindir@,$bindir,;t t
12505 s,@sbindir@,$sbindir,;t t
12506 s,@libexecdir@,$libexecdir,;t t
12507 s,@datarootdir@,$datarootdir,;t t
12508 s,@datadir@,$datadir,;t t
12509 s,@sysconfdir@,$sysconfdir,;t t
12510 s,@sharedstatedir@,$sharedstatedir,;t t
12511 s,@localstatedir@,$localstatedir,;t t
12512 s,@libdir@,$libdir,;t t
12513 s,@includedir@,$includedir,;t t
12514 s,@oldincludedir@,$oldincludedir,;t t
12515 s,@infodir@,$infodir,;t t
12516 s,@mandir@,$mandir,;t t
12517 s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t
12518 s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t
12519 s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t
12520 s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t
12521 s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t
12522 s,@build_alias@,$build_alias,;t t
12523 s,@host_alias@,$host_alias,;t t
12524 s,@target_alias@,$target_alias,;t t
12525 s,@ECHO_C@,$ECHO_C,;t t
12526 s,@ECHO_N@,$ECHO_N,;t t
12527 s,@ECHO_T@,$ECHO_T,;t t
12528 s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t
12529 s,@DEFS@,$DEFS,;t t
12530 s,@LIBS@,$LIBS,;t t
12531 s,@top_builddir@,$top_builddir,;t t
12532 s,@build@,$build,;t t
12533 s,@build_cpu@,$build_cpu,;t t
12534 s,@build_vendor@,$build_vendor,;t t
12535 s,@build_os@,$build_os,;t t
12536 s,@host@,$host,;t t
12537 s,@host_cpu@,$host_cpu,;t t
12538 s,@host_vendor@,$host_vendor,;t t
12539 s,@host_os@,$host_os,;t t
12540 s,@target@,$target,;t t
12541 s,@target_cpu@,$target_cpu,;t t
12542 s,@target_vendor@,$target_vendor,;t t
12543 s,@target_os@,$target_os,;t t
12544 s,@CC@,$CC,;t t
12545 s,@CFLAGS@,$CFLAGS,;t t
12546 s,@LDFLAGS@,$LDFLAGS,;t t
12547 s,@CPPFLAGS@,$CPPFLAGS,;t t
12548 s,@ac_ct_CC@,$ac_ct_CC,;t t
12549 s,@EXEEXT@,$EXEEXT,;t t
12550 s,@OBJEXT@,$OBJEXT,;t t
12551 s,@EXTRA_CPPFLAGS@,$EXTRA_CPPFLAGS,;t t
12552 s,@CPP@,$CPP,;t t
12553 s,@AWK@,$AWK,;t t
12554 s,@EGREP@,$EGREP,;t t
12555 s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t
12556 s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t
12557 s,@INSTALL_DATA@,$INSTALL_DATA,;t t
12558 s,@LN_S@,$LN_S,;t t
12559 s,@PKG_CONFIG@,$PKG_CONFIG,;t t
12560 s,@ac_pt_PKG_CONFIG@,$ac_pt_PKG_CONFIG,;t t
12561 s,@PKG_CONFIG_LIBDIR@,$PKG_CONFIG_LIBDIR,;t t
12562 s,@SET_MAKE@,$SET_MAKE,;t t
12563 s,@CTAGS@,$CTAGS,;t t
12564 s,@ETAGS@,$ETAGS,;t t
12565 s,@MAKE_LOWER_TAGS@,$MAKE_LOWER_TAGS,;t t
12566 s,@MAKE_UPPER_TAGS@,$MAKE_UPPER_TAGS,;t t
12567 s,@cf_cv_makeflags@,$cf_cv_makeflags,;t t
12568 s,@RANLIB@,$RANLIB,;t t
12569 s,@ac_ct_RANLIB@,$ac_ct_RANLIB,;t t
12570 s,@LD@,$LD,;t t
12571 s,@ac_ct_LD@,$ac_ct_LD,;t t
12572 s,@AR@,$AR,;t t
12573 s,@ac_ct_AR@,$ac_ct_AR,;t t
12574 s,@ARFLAGS@,$ARFLAGS,;t t
12575 s,@DESTDIR@,$DESTDIR,;t t
12576 s,@BUILD_CC@,$BUILD_CC,;t t
12577 s,@BUILD_CPP@,$BUILD_CPP,;t t
12578 s,@BUILD_CFLAGS@,$BUILD_CFLAGS,;t t
12579 s,@BUILD_CPPFLAGS@,$BUILD_CPPFLAGS,;t t
12580 s,@BUILD_LDFLAGS@,$BUILD_LDFLAGS,;t t
12581 s,@BUILD_LIBS@,$BUILD_LIBS,;t t
12582 s,@BUILD_EXEEXT@,$BUILD_EXEEXT,;t t
12583 s,@BUILD_OBJEXT@,$BUILD_OBJEXT,;t t
12584 s,@DFT_LWR_MODEL@,$DFT_LWR_MODEL,;t t
12585 s,@DFT_UPR_MODEL@,$DFT_UPR_MODEL,;t t
12586 s,@NCURSES_CONFIG@,$NCURSES_CONFIG,;t t
12587 s,@ac_ct_NCURSES_CONFIG@,$ac_ct_NCURSES_CONFIG,;t t
12588 s,@NCURSES_MAJOR@,$NCURSES_MAJOR,;t t
12589 s,@NCURSES_MINOR@,$NCURSES_MINOR,;t t
12590 s,@NCURSES_PATCH@,$NCURSES_PATCH,;t t
12591 s,@cf_cv_rel_version@,$cf_cv_rel_version,;t t
12592 s,@cf_cv_abi_version@,$cf_cv_abi_version,;t t
12593 s,@cf_cv_builtin_bool@,$cf_cv_builtin_bool,;t t
12594 s,@cf_cv_header_stdbool_h@,$cf_cv_header_stdbool_h,;t t
12595 s,@cf_cv_type_of_bool@,$cf_cv_type_of_bool,;t t
12596 s,@LIB_PREFIX@,$LIB_PREFIX,;t t
12597 s,@LIB_SUFFIX@,$LIB_SUFFIX,;t t
12598 s,@CC_G_OPT@,$CC_G_OPT,;t t
12599 s,@LD_MODEL@,$LD_MODEL,;t t
12600 s,@shlibdir@,$shlibdir,;t t
12601 s,@MAKE_DLLS@,$MAKE_DLLS,;t t
12602 s,@CC_SHARED_OPTS@,$CC_SHARED_OPTS,;t t
12603 s,@LD_RPATH_OPT@,$LD_RPATH_OPT,;t t
12604 s,@LD_SHARED_OPTS@,$LD_SHARED_OPTS,;t t
12605 s,@MK_SHARED_LIB@,$MK_SHARED_LIB,;t t
12606 s,@RM_SHARED_OPTS@,$RM_SHARED_OPTS,;t t
12607 s,@LINK_PROGS@,$LINK_PROGS,;t t
12608 s,@LINK_TESTS@,$LINK_TESTS,;t t
12609 s,@EXTRA_LDFLAGS@,$EXTRA_LDFLAGS,;t t
12610 s,@LOCAL_LDFLAGS@,$LOCAL_LDFLAGS,;t t
12611 s,@LOCAL_LDFLAGS2@,$LOCAL_LDFLAGS2,;t t
12612 s,@INSTALL_LIB@,$INSTALL_LIB,;t t
12613 s,@RPATH_LIST@,$RPATH_LIST,;t t
12614 s,@BROKEN_LINKER@,$BROKEN_LINKER,;t t
12615 s,@NCURSES_EXT_FUNCS@,$NCURSES_EXT_FUNCS,;t t
12616 s,@NCURSES_CONST@,$NCURSES_CONST,;t t
12617 s,@PTHREAD@,$PTHREAD,;t t
12618 s,@cf_cv_enable_reentrant@,$cf_cv_enable_reentrant,;t t
12619 s,@NCURSES_WRAP_PREFIX@,$NCURSES_WRAP_PREFIX,;t t
12620 s,@ECHO_LT@,$ECHO_LT,;t t
12621 s,@ECHO_LD@,$ECHO_LD,;t t
12622 s,@RULE_CC@,$RULE_CC,;t t
12623 s,@SHOW_CC@,$SHOW_CC,;t t
12624 s,@ECHO_CC@,$ECHO_CC,;t t
12625 s,@ADAFLAGS@,$ADAFLAGS,;t t
12626 s,@EXTRA_CFLAGS@,$EXTRA_CFLAGS,;t t
12627 s,@ADA_TRACE@,$ADA_TRACE,;t t
12628 s,@gnat_exists@,$gnat_exists,;t t
12629 s,@M4_exists@,$M4_exists,;t t
12630 s,@cf_ada_make@,$cf_ada_make,;t t
12631 s,@GNATPREP_OPTS@,$GNATPREP_OPTS,;t t
12632 s,@cf_compile_generics@,$cf_compile_generics,;t t
12633 s,@cf_generic_objects@,$cf_generic_objects,;t t
12634 s,@USE_GNAT_SIGINT@,$USE_GNAT_SIGINT,;t t
12635 s,@USE_OLD_MAKERULES@,$USE_OLD_MAKERULES,;t t
12636 s,@USE_GNAT_PROJECTS@,$USE_GNAT_PROJECTS,;t t
12637 s,@USE_GNAT_LIBRARIES@,$USE_GNAT_LIBRARIES,;t t
12638 s,@cf_ada_compiler@,$cf_ada_compiler,;t t
12639 s,@cf_ada_package@,$cf_ada_package,;t t
12640 s,@ADA_INCLUDE@,$ADA_INCLUDE,;t t
12641 s,@ADA_OBJECTS@,$ADA_OBJECTS,;t t
12642 s,@ADA_SHAREDLIB@,$ADA_SHAREDLIB,;t t
12643 s,@MAKE_ADA_SHAREDLIB@,$MAKE_ADA_SHAREDLIB,;t t
12644 s,@TINFO_LDFLAGS2@,$TINFO_LDFLAGS2,;t t
12645 s,@TINFO_LIBS@,$TINFO_LIBS,;t t
12646 s,@ACPPFLAGS@,$ACPPFLAGS,;t t
12647 s,@DFT_ARG_SUFFIX@,$DFT_ARG_SUFFIX,;t t
12648 s,@DFT_DEP_SUFFIX@,$DFT_DEP_SUFFIX,;t t
12649 s,@DFT_OBJ_SUBDIR@,$DFT_OBJ_SUBDIR,;t t
12650 s,@TEST_ARG2@,$TEST_ARG2,;t t
12651 s,@TEST_LIBS2@,$TEST_LIBS2,;t t
12652 s,@NCURSES_SHLIB2@,$NCURSES_SHLIB2,;t t
12653 s,@ADA_SUBDIRS@,$ADA_SUBDIRS,;t t
12654 s,@NCURSES_TREE@,$NCURSES_TREE,;t t
12655 s,@EXTERNAL_TREE@,$EXTERNAL_TREE,;t t
12656 s,@ADAHTML_DIR@,$ADAHTML_DIR,;t t
12657 CEOF
12658
12659 EOF
12660
12661   cat >>$CONFIG_STATUS <<\EOF
12662   # Split the substitutions into bite-sized pieces for seds with
12663   # small command number limits, like on Digital OSF/1 and HP-UX.
12664   ac_max_sed_lines=48
12665   ac_sed_frag=1 # Number of current file.
12666   ac_beg=1 # First line for current file.
12667   ac_end=$ac_max_sed_lines # Line after last line for current file.
12668   ac_more_lines=:
12669   ac_sed_cmds=
12670   while $ac_more_lines; do
12671     if test $ac_beg -gt 1; then
12672       sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
12673     else
12674       sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
12675     fi
12676     if test ! -s $tmp/subs.frag; then
12677       ac_more_lines=false
12678     else
12679       # The purpose of the label and of the branching condition is to
12680       # speed up the sed processing (if there are no `@' at all, there
12681       # is no need to browse any of the substitutions).
12682       # These are the two extra sed commands mentioned above.
12683       (echo ':t
12684   /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed
12685       if test -z "$ac_sed_cmds"; then
12686         ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed"
12687       else
12688         ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed"
12689       fi
12690       ac_sed_frag=`expr $ac_sed_frag + 1`
12691       ac_beg=$ac_end
12692       ac_end=`expr $ac_end + $ac_max_sed_lines`
12693     fi
12694   done
12695   if test -z "$ac_sed_cmds"; then
12696     ac_sed_cmds=cat
12697   fi
12698 fi # test -n "$CONFIG_FILES"
12699
12700 EOF
12701 cat >>$CONFIG_STATUS <<\EOF
12702 for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue
12703   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
12704   case $ac_file in
12705   - | *:- | *:-:* ) # input from stdin
12706         cat >$tmp/stdin
12707         ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
12708         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
12709   *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
12710         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
12711   * )   ac_file_in=$ac_file.in ;;
12712   esac
12713
12714   # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories.
12715   ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
12716          X"$ac_file" : 'X\(//\)[^/]' \| \
12717          X"$ac_file" : 'X\(//\)$' \| \
12718          X"$ac_file" : 'X\(/\)' \| \
12719          .     : '\(.\)' 2>/dev/null ||
12720 echo X"$ac_file" |
12721     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
12722           /^X\(\/\/\)[^/].*/{ s//\1/; q; }
12723           /^X\(\/\/\)$/{ s//\1/; q; }
12724           /^X\(\/\).*/{ s//\1/; q; }
12725           s/.*/./; q'`
12726   if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
12727     { case "$ac_dir" in
12728   [\\/]* | ?:[\\/]* ) as_incr_dir=;;
12729   *)                      as_incr_dir=.;;
12730 esac
12731 as_dummy="$ac_dir"
12732 for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
12733   case $as_mkdir_dir in
12734     # Skip DOS drivespec
12735     ?:) as_incr_dir=$as_mkdir_dir ;;
12736     *)
12737       as_incr_dir=$as_incr_dir/$as_mkdir_dir
12738       test -d "$as_incr_dir" || mkdir "$as_incr_dir"
12739     ;;
12740   esac
12741 done; }
12742
12743     ac_dir_suffix="/`echo $ac_dir|sed 's,^\./,,'`"
12744     # A "../" for each directory in $ac_dir_suffix.
12745     ac_dots=`echo "$ac_dir_suffix" | sed 's,/[^/]*,../,g'`
12746   else
12747     ac_dir_suffix= ac_dots=
12748   fi
12749
12750   case $srcdir in
12751   .)  ac_srcdir=.
12752       if test -z "$ac_dots"; then
12753          ac_top_srcdir=.
12754       else
12755          ac_top_srcdir=`echo $ac_dots | sed 's,/$,,'`
12756       fi ;;
12757   [\\/]* | ?:[\\/]* )
12758       ac_srcdir=$srcdir$ac_dir_suffix;
12759       ac_top_srcdir=$srcdir ;;
12760   *) # Relative path.
12761     ac_srcdir=$ac_dots$srcdir$ac_dir_suffix
12762     ac_top_srcdir=$ac_dots$srcdir ;;
12763   esac
12764
12765   case $INSTALL in
12766   [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
12767   *) ac_INSTALL=$ac_dots$INSTALL ;;
12768   esac
12769
12770   if test x"$ac_file" != x-; then
12771     { echo "$as_me:12771: creating $ac_file" >&5
12772 echo "$as_me: creating $ac_file" >&6;}
12773     rm -f "$ac_file"
12774   fi
12775   # Let's still pretend it is `configure' which instantiates (i.e., don't
12776   # use $as_me), people would be surprised to read:
12777   #    /* config.h.  Generated automatically by config.status.  */
12778   configure_input="Generated automatically from `echo $ac_file_in |
12779                                                  sed 's,.*/,,'` by configure."
12780
12781   # First look for the input files in the build tree, otherwise in the
12782   # src tree.
12783   ac_file_inputs=`IFS=:
12784     for f in $ac_file_in; do
12785       case $f in
12786       -) echo $tmp/stdin ;;
12787       [\\/$]*)
12788          # Absolute (can't be DOS-style, as IFS=:)
12789          test -f "$f" || { { echo "$as_me:12789: error: cannot find input file: $f" >&5
12790 echo "$as_me: error: cannot find input file: $f" >&2;}
12791    { (exit 1); exit 1; }; }
12792          echo $f;;
12793       *) # Relative
12794          if test -f "$f"; then
12795            # Build tree
12796            echo $f
12797          elif test -f "$srcdir/$f"; then
12798            # Source tree
12799            echo $srcdir/$f
12800          else
12801            # /dev/null tree
12802            { { echo "$as_me:12802: error: cannot find input file: $f" >&5
12803 echo "$as_me: error: cannot find input file: $f" >&2;}
12804    { (exit 1); exit 1; }; }
12805          fi;;
12806       esac
12807     done` || { (exit 1); exit 1; }
12808 EOF
12809 cat >>$CONFIG_STATUS <<\EOF
12810   ac_warn_datarootdir=no
12811   if test x"$ac_file" != x-; then
12812     for ac_item in $ac_file_inputs
12813     do
12814       ac_seen=`grep '@\(datadir\|mandir\|infodir\)@' $ac_item`
12815       if test -n "$ac_seen"; then
12816         ac_used=`grep '@datarootdir@' $ac_item`
12817         if test -z "$ac_used"; then
12818           { echo "$as_me:12818: WARNING: datarootdir was used implicitly but not set:
12819 $ac_seen" >&5
12820 echo "$as_me: WARNING: datarootdir was used implicitly but not set:
12821 $ac_seen" >&2;}
12822           ac_warn_datarootdir=yes
12823         fi
12824       fi
12825       ac_seen=`grep '${datarootdir}' $ac_item`
12826       if test -n "$ac_seen"; then
12827         { echo "$as_me:12827: WARNING: datarootdir was used explicitly but not set:
12828 $ac_seen" >&5
12829 echo "$as_me: WARNING: datarootdir was used explicitly but not set:
12830 $ac_seen" >&2;}
12831         ac_warn_datarootdir=yes
12832       fi
12833     done
12834   fi
12835
12836 if test "x$ac_warn_datarootdir" = xyes; then
12837   ac_sed_cmds="$ac_sed_cmds | sed -e 's,@datarootdir@,\${prefix}/share,g' -e 's,\${datarootdir},\${prefix}/share,g'"
12838 fi
12839
12840 EOF
12841 cat >>$CONFIG_STATUS <<EOF
12842   sed "$ac_vpsub
12843 $extrasub
12844 EOF
12845 cat >>$CONFIG_STATUS <<\EOF
12846 :t
12847 /@[a-zA-Z_][a-zA-Z_0-9]*@/!b
12848 s,@configure_input@,$configure_input,;t t
12849 s,@srcdir@,$ac_srcdir,;t t
12850 s,@top_srcdir@,$ac_top_srcdir,;t t
12851 s,@INSTALL@,$ac_INSTALL,;t t
12852 " $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out
12853   rm -f $tmp/stdin
12854   if test x"$ac_file" != x-; then
12855     cp $tmp/out $ac_file
12856
12857     for ac_name in prefix exec_prefix datarootdir
12858     do
12859         ac_seen=`fgrep -n '${'$ac_name'[:=].*}' $ac_file`
12860         if test -n "$ac_seen"; then
12861             ac_init=`egrep '[   ]*'$ac_name'[   ]*=' $ac_file`
12862             if test -z "$ac_init"; then
12863               ac_seen=`echo "$ac_seen" |sed -e 's,^,'$ac_file':,'`
12864               { echo "$as_me:12864: WARNING: Variable $ac_name is used but was not set:
12865 $ac_seen" >&5
12866 echo "$as_me: WARNING: Variable $ac_name is used but was not set:
12867 $ac_seen" >&2;}
12868             fi
12869         fi
12870     done
12871     egrep -n '@[a-z_][a-z_0-9]+@' $ac_file >$tmp/out
12872     egrep -n '@[A-Z_][A-Z_0-9]+@' $ac_file >>$tmp/out
12873     if test -s $tmp/out; then
12874       ac_seen=`sed -e 's,^,'$ac_file':,' < $tmp/out`
12875       { echo "$as_me:12875: WARNING: Some variables may not be substituted:
12876 $ac_seen" >&5
12877 echo "$as_me: WARNING: Some variables may not be substituted:
12878 $ac_seen" >&2;}
12879     fi
12880   else
12881     cat $tmp/out
12882   fi
12883   rm -f $tmp/out
12884
12885 done
12886 EOF
12887 cat >>$CONFIG_STATUS <<\EOF
12888
12889 #
12890 # CONFIG_HEADER section.
12891 #
12892
12893 # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
12894 # NAME is the cpp macro being defined and VALUE is the value it is being given.
12895 #
12896 # ac_d sets the value in "#define NAME VALUE" lines.
12897 ac_dA='s,^\([   ]*\)#\([        ]*define[       ][      ]*\)'
12898 ac_dB='[        ].*$,\1#\2'
12899 ac_dC=' '
12900 ac_dD=',;t'
12901 # ac_i turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
12902 ac_iA='s,^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
12903 ac_iB='\([      ]\),\1#\2define\3'
12904 ac_iC=' '
12905 ac_iD='\4,;t'
12906 # ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
12907 ac_uA='s,^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
12908 ac_uB='$,\1#\2define\3'
12909 ac_uC=' '
12910 ac_uD=',;t'
12911
12912 for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue
12913   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
12914   case $ac_file in
12915   - | *:- | *:-:* ) # input from stdin
12916         cat >$tmp/stdin
12917         ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
12918         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
12919   *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
12920         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
12921   * )   ac_file_in=$ac_file.in ;;
12922   esac
12923
12924   test x"$ac_file" != x- && { echo "$as_me:12924: creating $ac_file" >&5
12925 echo "$as_me: creating $ac_file" >&6;}
12926
12927   # First look for the input files in the build tree, otherwise in the
12928   # src tree.
12929   ac_file_inputs=`IFS=:
12930     for f in $ac_file_in; do
12931       case $f in
12932       -) echo $tmp/stdin ;;
12933       [\\/$]*)
12934          # Absolute (can't be DOS-style, as IFS=:)
12935          test -f "$f" || { { echo "$as_me:12935: error: cannot find input file: $f" >&5
12936 echo "$as_me: error: cannot find input file: $f" >&2;}
12937    { (exit 1); exit 1; }; }
12938          echo $f;;
12939       *) # Relative
12940          if test -f "$f"; then
12941            # Build tree
12942            echo $f
12943          elif test -f "$srcdir/$f"; then
12944            # Source tree
12945            echo $srcdir/$f
12946          else
12947            # /dev/null tree
12948            { { echo "$as_me:12948: error: cannot find input file: $f" >&5
12949 echo "$as_me: error: cannot find input file: $f" >&2;}
12950    { (exit 1); exit 1; }; }
12951          fi;;
12952       esac
12953     done` || { (exit 1); exit 1; }
12954   # Remove the trailing spaces.
12955   sed 's/[      ]*$//' $ac_file_inputs >$tmp/in
12956
12957 EOF
12958
12959 # Transform confdefs.h into a list of #define's.  We won't use it as a sed
12960 # script, but as data to insert where we see @DEFS@.  We expect AC_SAVE_DEFS to
12961 # be either 'cat' or 'sort'.
12962 cat confdefs.h | uniq >conftest.vals
12963
12964 # Break up conftest.vals because some shells have a limit on
12965 # the size of here documents, and old seds have small limits too.
12966
12967 rm -f conftest.tail
12968 echo '  rm -f conftest.frag' >> $CONFIG_STATUS
12969 while grep . conftest.vals >/dev/null
12970 do
12971   # Write chunks of a limited-size here document to conftest.frag.
12972   echo '  cat >> conftest.frag <<CEOF' >> $CONFIG_STATUS
12973   sed ${ac_max_here_lines}q conftest.vals | sed -e 's/#ifdef.*/#if 0/' >> $CONFIG_STATUS
12974   echo 'CEOF' >> $CONFIG_STATUS
12975   sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
12976   rm -f conftest.vals
12977   mv conftest.tail conftest.vals
12978 done
12979 rm -f conftest.vals
12980
12981 # Run sed to substitute the contents of conftest.frag into $tmp/in at the
12982 # marker @DEFS@.
12983 echo '  cat >> conftest.edit <<CEOF
12984 /@DEFS@/r conftest.frag
12985 /@DEFS@/d
12986 CEOF
12987 sed -f conftest.edit $tmp/in > $tmp/out
12988 rm -f $tmp/in
12989 mv $tmp/out $tmp/in
12990 rm -f conftest.edit conftest.frag
12991 ' >> $CONFIG_STATUS
12992
12993 cat >>$CONFIG_STATUS <<\EOF
12994   # Let's still pretend it is `configure' which instantiates (i.e., don't
12995   # use $as_me), people would be surprised to read:
12996   #    /* config.h.  Generated automatically by config.status.  */
12997   if test x"$ac_file" = x-; then
12998     echo "/* Generated automatically by configure.  */" >$tmp/config.h
12999   else
13000     echo "/* $ac_file.  Generated automatically by configure.  */" >$tmp/config.h
13001   fi
13002   cat $tmp/in >>$tmp/config.h
13003   rm -f $tmp/in
13004   if test x"$ac_file" != x-; then
13005     if cmp -s $ac_file $tmp/config.h 2>/dev/null; then
13006       { echo "$as_me:13006: $ac_file is unchanged" >&5
13007 echo "$as_me: $ac_file is unchanged" >&6;}
13008     else
13009       ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
13010          X"$ac_file" : 'X\(//\)[^/]' \| \
13011          X"$ac_file" : 'X\(//\)$' \| \
13012          X"$ac_file" : 'X\(/\)' \| \
13013          .     : '\(.\)' 2>/dev/null ||
13014 echo X"$ac_file" |
13015     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
13016           /^X\(\/\/\)[^/].*/{ s//\1/; q; }
13017           /^X\(\/\/\)$/{ s//\1/; q; }
13018           /^X\(\/\).*/{ s//\1/; q; }
13019           s/.*/./; q'`
13020       if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
13021         { case "$ac_dir" in
13022   [\\/]* | ?:[\\/]* ) as_incr_dir=;;
13023   *)                      as_incr_dir=.;;
13024 esac
13025 as_dummy="$ac_dir"
13026 for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
13027   case $as_mkdir_dir in
13028     # Skip DOS drivespec
13029     ?:) as_incr_dir=$as_mkdir_dir ;;
13030     *)
13031       as_incr_dir=$as_incr_dir/$as_mkdir_dir
13032       test -d "$as_incr_dir" || mkdir "$as_incr_dir"
13033     ;;
13034   esac
13035 done; }
13036
13037       fi
13038       rm -f $ac_file
13039       mv $tmp/config.h $ac_file
13040     fi
13041   else
13042     cat $tmp/config.h
13043     rm -f $tmp/config.h
13044   fi
13045 done
13046 EOF
13047 cat >>$CONFIG_STATUS <<\EOF
13048 #
13049 # CONFIG_COMMANDS section.
13050 #
13051 for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue
13052   ac_dest=`echo "$ac_file" | sed 's,:.*,,'`
13053   ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'`
13054
13055   case $ac_dest in
13056     default )
13057 if test -z "$USE_OLD_MAKERULES" ; then
13058         $AWK -f $srcdir/mk-1st.awk <$srcdir/src/modules >>src/Makefile
13059 fi
13060  ;;
13061   esac
13062 done
13063 EOF
13064
13065 cat >>$CONFIG_STATUS <<\EOF
13066
13067 { (exit 0); exit 0; }
13068 EOF
13069 chmod +x $CONFIG_STATUS
13070 ac_clean_files=$ac_clean_files_save
13071
13072 # configure is writing to config.log, and then calls config.status.
13073 # config.status does its own redirection, appending to config.log.
13074 # Unfortunately, on DOS this fails, as config.log is still kept open
13075 # by configure, so config.status won't be able to write to it; its
13076 # output is simply discarded.  So we exec the FD to /dev/null,
13077 # effectively closing config.log, so it can be properly (re)opened and
13078 # appended to by config.status.  When coming back to configure, we
13079 # need to make the FD available again.
13080 if test "$no_create" != yes; then
13081   ac_cs_success=:
13082   exec 5>/dev/null
13083   $SHELL $CONFIG_STATUS || ac_cs_success=false
13084   exec 5>>config.log
13085   # Use ||, not &&, to avoid exiting from the if with $? = 1, which
13086   # would make configure fail if this is the last instruction.
13087   $ac_cs_success || { (exit 1); exit 1; }
13088 fi
13089 ${MAKE:-make} preinstall