]> ncurses.scripts.mit.edu Git - ncurses.git/blob - Ada95/configure
ncurses 5.9 - patch 20150418
[ncurses.git] / Ada95 / configure
1 #! /bin/sh
2 # From configure.in Revision: 1.60 .
3 # Guess values for system-dependent variables and create Makefiles.
4 # Generated by Autoconf 2.52.20141204.
5 #
6 # Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
7 # Free Software Foundation, Inc.
8 # This configure script is free software; the Free Software Foundation
9 # gives unlimited permission to copy, distribute and modify it.
10
11 # Avoid depending upon Character Ranges.
12 as_cr_letters='abcdefghijklmnopqrstuvwxyz'
13 as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
14 as_cr_Letters=$as_cr_letters$as_cr_LETTERS
15 as_cr_digits='0123456789'
16 as_cr_alnum=$as_cr_Letters$as_cr_digits
17
18 # Sed expression to map a string onto a valid variable name.
19 as_tr_sh="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g"
20
21 # Sed expression to map a string onto a valid CPP name.
22 as_tr_cpp="sed y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g"
23
24 # Be Bourne compatible
25 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
26   emulate sh
27   NULLCMD=:
28 elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
29   set -o posix
30 fi
31
32 # Name of the executable.
33 as_me=`echo "$0" |sed 's,.*[\\/],,'`
34
35 if expr a : '\(a\)' >/dev/null 2>&1; then
36   as_expr=expr
37 else
38   as_expr=false
39 fi
40
41 rm -f conf$$ conf$$.exe conf$$.file
42 echo >conf$$.file
43 if ln -s conf$$.file conf$$ 2>/dev/null; then
44   # We could just check for DJGPP; but this test a) works b) is more generic
45   # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
46   if test -f conf$$.exe; then
47     # Don't use ln at all; we don't have any links
48     as_ln_s='cp -p'
49   else
50     as_ln_s='ln -s'
51   fi
52 elif ln conf$$.file conf$$ 2>/dev/null; then
53   as_ln_s=ln
54 else
55   as_ln_s='cp -p'
56 fi
57 rm -f conf$$ conf$$.exe conf$$.file
58
59 as_executable_p="test -f"
60
61 # Support unset when possible.
62 if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
63   as_unset=unset
64 else
65   as_unset=false
66 fi
67
68 # NLS nuisances.
69 $as_unset LANG || test "${LANG+set}" != set || { LANG=C; export LANG; }
70 $as_unset LC_ALL || test "${LC_ALL+set}" != set || { LC_ALL=C; export LC_ALL; }
71 $as_unset LC_TIME || test "${LC_TIME+set}" != set || { LC_TIME=C; export LC_TIME; }
72 $as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set || { LC_CTYPE=C; export LC_CTYPE; }
73 $as_unset LANGUAGE || test "${LANGUAGE+set}" != set || { LANGUAGE=C; export LANGUAGE; }
74 $as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set || { LC_COLLATE=C; export LC_COLLATE; }
75 $as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set || { LC_NUMERIC=C; export LC_NUMERIC; }
76 $as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set || { LC_MESSAGES=C; export LC_MESSAGES; }
77
78 # IFS
79 # We need space, tab and new line, in precisely that order.
80 as_nl='
81 '
82 IFS="   $as_nl"
83
84 # CDPATH.
85 $as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=:; export CDPATH; }
86
87 # Name of the host.
88 # hostname on some systems (SVR3.2, Linux) returns a bogus exit status,
89 # so uname gets run too.
90 ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
91
92 exec 6>&1
93
94 #
95 # Initializations.
96 #
97 ac_default_prefix=/usr/local
98 cross_compiling=no
99 subdirs=
100 MFLAGS= MAKEFLAGS=
101 SHELL=${CONFIG_SHELL-/bin/sh}
102
103 # Maximum number of lines to put in a shell here document.
104 # This variable seems obsolete.  It should probably be removed, and
105 # only ac_max_sed_lines should be used.
106 : ${ac_max_here_lines=38}
107
108 ac_unique_file="gen/gen.c"
109
110 # Initialize some variables set by options.
111 ac_init_help=
112 ac_init_version=false
113 # The variables have the same names as the options, with
114 # dashes changed to underlines.
115 cache_file=/dev/null
116 exec_prefix=NONE
117 no_create=
118 no_recursion=
119 prefix=NONE
120 program_prefix=NONE
121 program_suffix=NONE
122 program_transform_name=s,x,x,
123 silent=
124 site=
125 srcdir=
126 verbose=
127 x_includes=NONE
128 x_libraries=NONE
129
130 # Installation directory options.
131 # These are left unexpanded so users can "make install exec_prefix=/foo"
132 # and all the variables that are supposed to be based on exec_prefix
133 # by default will actually change.
134 # Use braces instead of parens because sh, perl, etc. also accept them.
135 bindir='${exec_prefix}/bin'
136 sbindir='${exec_prefix}/sbin'
137 libexecdir='${exec_prefix}/libexec'
138 datarootdir='${prefix}/share'
139 datadir='${datarootdir}'
140 sysconfdir='${prefix}/etc'
141 sharedstatedir='${prefix}/com'
142 localstatedir='${prefix}/var'
143 libdir='${exec_prefix}/lib'
144 includedir='${prefix}/include'
145 oldincludedir='/usr/include'
146 infodir='${datarootdir}/info'
147 mandir='${datarootdir}/man'
148
149 # Identity of this package.
150 PACKAGE_NAME=
151 PACKAGE_TARNAME=
152 PACKAGE_VERSION=
153 PACKAGE_STRING=
154 PACKAGE_BUGREPORT=
155
156 ac_prev=
157 for ac_option
158 do
159   # If the previous option needs an argument, assign it.
160   if test -n "$ac_prev"; then
161     eval "$ac_prev=\$ac_option"
162     ac_prev=
163     continue
164   fi
165
166   ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'`
167
168   # Accept the important Cygnus configure options, so we can diagnose typos.
169
170   case $ac_option in
171
172   -bindir | --bindir | --bindi | --bind | --bin | --bi)
173     ac_prev=bindir ;;
174   -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
175     bindir=$ac_optarg ;;
176
177   -build | --build | --buil | --bui | --bu)
178     ac_prev=build_alias ;;
179   -build=* | --build=* | --buil=* | --bui=* | --bu=*)
180     build_alias=$ac_optarg ;;
181
182   -cache-file | --cache-file | --cache-fil | --cache-fi \
183   | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
184     ac_prev=cache_file ;;
185   -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
186   | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
187     cache_file=$ac_optarg ;;
188
189   --config-cache | -C)
190     cache_file=config.cache ;;
191
192   -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
193     ac_prev=datadir ;;
194   -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
195   | --da=*)
196     datadir=$ac_optarg ;;
197
198   -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \
199   | --dataroo | --dataro | --datar)
200     ac_prev=datarootdir ;;
201   -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \
202   | --dataroot=* | --dataroo=* | --dataro=* | --datar=*)
203     datarootdir=$ac_optarg ;;
204
205   -disable-* | --disable-*)
206     ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
207     # Reject names that are not valid shell variable names.
208     expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
209       { echo "$as_me: error: invalid feature name: $ac_feature" >&2
210    { (exit 1); exit 1; }; }
211     ac_feature=`echo $ac_feature | sed 's/-/_/g'`
212     eval "enable_$ac_feature=no" ;;
213
214   -enable-* | --enable-*)
215     ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
216     # Reject names that are not valid shell variable names.
217     expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
218       { echo "$as_me: error: invalid feature name: $ac_feature" >&2
219    { (exit 1); exit 1; }; }
220     ac_feature=`echo $ac_feature | sed 's/-/_/g'`
221     case $ac_option in
222       *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
223       *) ac_optarg=yes ;;
224     esac
225     eval "enable_$ac_feature='$ac_optarg'" ;;
226
227   -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
228   | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
229   | --exec | --exe | --ex)
230     ac_prev=exec_prefix ;;
231   -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
232   | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
233   | --exec=* | --exe=* | --ex=*)
234     exec_prefix=$ac_optarg ;;
235
236   -gas | --gas | --ga | --g)
237     # Obsolete; use --with-gas.
238     with_gas=yes ;;
239
240   -help | --help | --hel | --he | -h)
241     ac_init_help=long ;;
242   -help=r* | --help=r* | --hel=r* | --he=r* | -hr*)
243     ac_init_help=recursive ;;
244   -help=s* | --help=s* | --hel=s* | --he=s* | -hs*)
245     ac_init_help=short ;;
246
247   -host | --host | --hos | --ho)
248     ac_prev=host_alias ;;
249   -host=* | --host=* | --hos=* | --ho=*)
250     host_alias=$ac_optarg ;;
251
252   -includedir | --includedir | --includedi | --included | --include \
253   | --includ | --inclu | --incl | --inc)
254     ac_prev=includedir ;;
255   -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
256   | --includ=* | --inclu=* | --incl=* | --inc=*)
257     includedir=$ac_optarg ;;
258
259   -infodir | --infodir | --infodi | --infod | --info | --inf)
260     ac_prev=infodir ;;
261   -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
262     infodir=$ac_optarg ;;
263
264   -libdir | --libdir | --libdi | --libd)
265     ac_prev=libdir ;;
266   -libdir=* | --libdir=* | --libdi=* | --libd=*)
267     libdir=$ac_optarg ;;
268
269   -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
270   | --libexe | --libex | --libe)
271     ac_prev=libexecdir ;;
272   -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
273   | --libexe=* | --libex=* | --libe=*)
274     libexecdir=$ac_optarg ;;
275
276   -localstatedir | --localstatedir | --localstatedi | --localstated \
277   | --localstate | --localstat | --localsta | --localst \
278   | --locals | --local | --loca | --loc | --lo)
279     ac_prev=localstatedir ;;
280   -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
281   | --localstate=* | --localstat=* | --localsta=* | --localst=* \
282   | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
283     localstatedir=$ac_optarg ;;
284
285   -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
286     ac_prev=mandir ;;
287   -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
288     mandir=$ac_optarg ;;
289
290   -nfp | --nfp | --nf)
291     # Obsolete; use --without-fp.
292     with_fp=no ;;
293
294   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
295   | --no-cr | --no-c)
296     no_create=yes ;;
297
298   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
299   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
300     no_recursion=yes ;;
301
302   -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
303   | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
304   | --oldin | --oldi | --old | --ol | --o)
305     ac_prev=oldincludedir ;;
306   -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
307   | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
308   | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
309     oldincludedir=$ac_optarg ;;
310
311   -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
312     ac_prev=prefix ;;
313   -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
314     prefix=$ac_optarg ;;
315
316   -program-prefix | --program-prefix | --program-prefi | --program-pref \
317   | --program-pre | --program-pr | --program-p)
318     ac_prev=program_prefix ;;
319   -program-prefix=* | --program-prefix=* | --program-prefi=* \
320   | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
321     program_prefix=$ac_optarg ;;
322
323   -program-suffix | --program-suffix | --program-suffi | --program-suff \
324   | --program-suf | --program-su | --program-s)
325     ac_prev=program_suffix ;;
326   -program-suffix=* | --program-suffix=* | --program-suffi=* \
327   | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
328     program_suffix=$ac_optarg ;;
329
330   -program-transform-name | --program-transform-name \
331   | --program-transform-nam | --program-transform-na \
332   | --program-transform-n | --program-transform- \
333   | --program-transform | --program-transfor \
334   | --program-transfo | --program-transf \
335   | --program-trans | --program-tran \
336   | --progr-tra | --program-tr | --program-t)
337     ac_prev=program_transform_name ;;
338   -program-transform-name=* | --program-transform-name=* \
339   | --program-transform-nam=* | --program-transform-na=* \
340   | --program-transform-n=* | --program-transform-=* \
341   | --program-transform=* | --program-transfor=* \
342   | --program-transfo=* | --program-transf=* \
343   | --program-trans=* | --program-tran=* \
344   | --progr-tra=* | --program-tr=* | --program-t=*)
345     program_transform_name=$ac_optarg ;;
346
347   -q | -quiet | --quiet | --quie | --qui | --qu | --q \
348   | -silent | --silent | --silen | --sile | --sil)
349     silent=yes ;;
350
351   -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
352     ac_prev=sbindir ;;
353   -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
354   | --sbi=* | --sb=*)
355     sbindir=$ac_optarg ;;
356
357   -sharedstatedir | --sharedstatedir | --sharedstatedi \
358   | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
359   | --sharedst | --shareds | --shared | --share | --shar \
360   | --sha | --sh)
361     ac_prev=sharedstatedir ;;
362   -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
363   | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
364   | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
365   | --sha=* | --sh=*)
366     sharedstatedir=$ac_optarg ;;
367
368   -site | --site | --sit)
369     ac_prev=site ;;
370   -site=* | --site=* | --sit=*)
371     site=$ac_optarg ;;
372
373   -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
374     ac_prev=srcdir ;;
375   -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
376     srcdir=$ac_optarg ;;
377
378   -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
379   | --syscon | --sysco | --sysc | --sys | --sy)
380     ac_prev=sysconfdir ;;
381   -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
382   | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
383     sysconfdir=$ac_optarg ;;
384
385   -target | --target | --targe | --targ | --tar | --ta | --t)
386     ac_prev=target_alias ;;
387   -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
388     target_alias=$ac_optarg ;;
389
390   -v | -verbose | --verbose | --verbos | --verbo | --verb)
391     verbose=yes ;;
392
393   -version | --version | --versio | --versi | --vers | -V)
394     ac_init_version=: ;;
395
396   -with-* | --with-*)
397     ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
398     # Reject names that are not valid shell variable names.
399     expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
400       { echo "$as_me: error: invalid package name: $ac_package" >&2
401    { (exit 1); exit 1; }; }
402     ac_package=`echo $ac_package| sed 's/-/_/g'`
403     case $ac_option in
404       *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
405       *) ac_optarg=yes ;;
406     esac
407     eval "with_$ac_package='$ac_optarg'" ;;
408
409   -without-* | --without-*)
410     ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'`
411     # Reject names that are not valid shell variable names.
412     expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
413       { echo "$as_me: error: invalid package name: $ac_package" >&2
414    { (exit 1); exit 1; }; }
415     ac_package=`echo $ac_package | sed 's/-/_/g'`
416     eval "with_$ac_package=no" ;;
417
418   --x)
419     # Obsolete; use --with-x.
420     with_x=yes ;;
421
422   -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
423   | --x-incl | --x-inc | --x-in | --x-i)
424     ac_prev=x_includes ;;
425   -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
426   | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
427     x_includes=$ac_optarg ;;
428
429   -x-libraries | --x-libraries | --x-librarie | --x-librari \
430   | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
431     ac_prev=x_libraries ;;
432   -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
433   | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
434     x_libraries=$ac_optarg ;;
435
436   -*) { echo "$as_me: error: unrecognized option: $ac_option
437 Try \`$0 --help' for more information." >&2
438    { (exit 1); exit 1; }; }
439     ;;
440
441   *=*)
442     ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
443     # Reject names that are not valid shell variable names.
444     expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null &&
445       { echo "$as_me: error: invalid variable name: $ac_envvar" >&2
446    { (exit 1); exit 1; }; }
447     ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`
448     eval "$ac_envvar='$ac_optarg'"
449     export $ac_envvar ;;
450
451   *)
452     # FIXME: should be removed in autoconf 3.0.
453     echo "$as_me: WARNING: you should use --build, --host, --target" >&2
454     expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
455       echo "$as_me: WARNING: invalid host type: $ac_option" >&2
456     : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}
457     ;;
458
459   esac
460 done
461
462 if test -n "$ac_prev"; then
463   ac_option=--`echo $ac_prev | sed 's/_/-/g'`
464   { echo "$as_me: error: missing argument to $ac_option" >&2
465    { (exit 1); exit 1; }; }
466 fi
467
468 # Be sure to have absolute paths.
469 for ac_var in exec_prefix prefix
470 do
471   eval ac_val=$`echo $ac_var`
472   case $ac_val in
473     [\\/$]* | ?:[\\/]* | NONE | '' ) ;;
474     *)  { echo "$as_me: error: expected an absolute path for --$ac_var: $ac_val" >&2
475    { (exit 1); exit 1; }; };;
476   esac
477 done
478
479 # Be sure to have absolute paths.
480 for ac_var in bindir sbindir libexecdir datarootdir datadir sysconfdir sharedstatedir \
481               localstatedir libdir includedir oldincludedir infodir mandir
482 do
483   eval ac_val=$`echo $ac_var`
484   case $ac_val in
485     [\\/$]* | ?:[\\/]* ) ;;
486     *)  { echo "$as_me: error: expected an absolute path for --$ac_var: $ac_val" >&2
487    { (exit 1); exit 1; }; };;
488   esac
489 done
490
491 # There might be people who depend on the old broken behavior: `$host'
492 # used to hold the argument of --host etc.
493 build=$build_alias
494 host=$host_alias
495 target=$target_alias
496
497 # FIXME: should be removed in autoconf 3.0.
498 if test "x$host_alias" != x; then
499   if test "x$build_alias" = x; then
500     cross_compiling=maybe
501     echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host.
502     If a cross compiler is detected then cross compile mode will be used." >&2
503   elif test "x$build_alias" != "x$host_alias"; then
504     cross_compiling=yes
505   fi
506 fi
507
508 ac_tool_prefix=
509 test -n "$host_alias" && ac_tool_prefix=$host_alias-
510
511 test "$silent" = yes && exec 6>/dev/null
512
513 # Find the source files, if location was not specified.
514 if test -z "$srcdir"; then
515   ac_srcdir_defaulted=yes
516   # Try the directory containing this script, then its parent.
517   ac_prog=$0
518   ac_confdir=`echo "$ac_prog" | sed 's%[\\/][^\\/][^\\/]*$%%'`
519   test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
520   srcdir=$ac_confdir
521   if test ! -r $srcdir/$ac_unique_file; then
522     srcdir=..
523   fi
524 else
525   ac_srcdir_defaulted=no
526 fi
527 if test ! -r $srcdir/$ac_unique_file; then
528   if test "$ac_srcdir_defaulted" = yes; then
529     { echo "$as_me: error: cannot find sources in $ac_confdir or .." >&2
530    { (exit 1); exit 1; }; }
531   else
532     { echo "$as_me: error: cannot find sources in $srcdir" >&2
533    { (exit 1); exit 1; }; }
534   fi
535 fi
536 srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'`
537 ac_env_build_alias_set=${build_alias+set}
538 ac_env_build_alias_value=$build_alias
539 ac_cv_env_build_alias_set=${build_alias+set}
540 ac_cv_env_build_alias_value=$build_alias
541 ac_env_host_alias_set=${host_alias+set}
542 ac_env_host_alias_value=$host_alias
543 ac_cv_env_host_alias_set=${host_alias+set}
544 ac_cv_env_host_alias_value=$host_alias
545 ac_env_target_alias_set=${target_alias+set}
546 ac_env_target_alias_value=$target_alias
547 ac_cv_env_target_alias_set=${target_alias+set}
548 ac_cv_env_target_alias_value=$target_alias
549 ac_env_CC_set=${CC+set}
550 ac_env_CC_value=$CC
551 ac_cv_env_CC_set=${CC+set}
552 ac_cv_env_CC_value=$CC
553 ac_env_CFLAGS_set=${CFLAGS+set}
554 ac_env_CFLAGS_value=$CFLAGS
555 ac_cv_env_CFLAGS_set=${CFLAGS+set}
556 ac_cv_env_CFLAGS_value=$CFLAGS
557 ac_env_LDFLAGS_set=${LDFLAGS+set}
558 ac_env_LDFLAGS_value=$LDFLAGS
559 ac_cv_env_LDFLAGS_set=${LDFLAGS+set}
560 ac_cv_env_LDFLAGS_value=$LDFLAGS
561 ac_env_CPPFLAGS_set=${CPPFLAGS+set}
562 ac_env_CPPFLAGS_value=$CPPFLAGS
563 ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set}
564 ac_cv_env_CPPFLAGS_value=$CPPFLAGS
565 ac_env_CPP_set=${CPP+set}
566 ac_env_CPP_value=$CPP
567 ac_cv_env_CPP_set=${CPP+set}
568 ac_cv_env_CPP_value=$CPP
569
570 #
571 # Report the --help message.
572 #
573 if test "$ac_init_help" = "long"; then
574   # Omit some internal or obsolete options to make the list less imposing.
575   # This message is too long to be a string in the A/UX 3.1 sh.
576   cat <<EOF
577 \`configure' configures this package to adapt to many kinds of systems.
578
579 Usage: $0 [OPTION]... [VAR=VALUE]...
580
581 To assign environment variables (e.g., CC, CFLAGS...), specify them as
582 VAR=VALUE.  See below for descriptions of some of the useful variables.
583
584 Defaults for the options are specified in brackets.
585
586 Configuration:
587   -h, --help              display this help and exit
588       --help=short        display options specific to this package
589       --help=recursive    display the short help of all the included packages
590   -V, --version           display version information and exit
591   -q, --quiet, --silent   do not print \`checking...' messages
592       --cache-file=FILE   cache test results in FILE [disabled]
593   -C, --config-cache      alias for \`--cache-file=config.cache'
594   -n, --no-create         do not create output files
595       --srcdir=DIR        find the sources in DIR [configure dir or \`..']
596
597 EOF
598
599   cat <<EOF
600 Installation directories:
601   --prefix=PREFIX         install architecture-independent files in PREFIX
602                           [$ac_default_prefix]
603   --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
604                           [PREFIX]
605
606 By default, \`make install' will install all the files in
607 \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc.  You can specify
608 an installation prefix other than \`$ac_default_prefix' using \`--prefix',
609 for instance \`--prefix=\$HOME'.
610
611 For better control, use the options below.
612
613 Fine tuning of the installation directories:
614   --bindir=DIR            user executables [EPREFIX/bin]
615   --sbindir=DIR           system admin executables [EPREFIX/sbin]
616   --libexecdir=DIR        program executables [EPREFIX/libexec]
617   --datarootdir=DIR       read-only architecture-independent data [PREFIX/share]
618   --datadir=DIR           read-only architecture-independent data [DATAROOTDIR]
619   --sysconfdir=DIR        read-only single-machine data [PREFIX/etc]
620   --sharedstatedir=DIR    modifiable architecture-independent data [PREFIX/com]
621   --localstatedir=DIR     modifiable single-machine data [PREFIX/var]
622   --libdir=DIR            object code libraries [EPREFIX/lib]
623   --includedir=DIR        C header files [PREFIX/include]
624   --oldincludedir=DIR     C header files for non-gcc [/usr/include]
625   --infodir=DIR           info documentation [DATAROOTDIR/info]
626   --mandir=DIR            man documentation [DATAROOTDIR/man]
627 EOF
628
629   cat <<\EOF
630
631 Program names:
632   --program-prefix=PREFIX            prepend PREFIX to installed program names
633   --program-suffix=SUFFIX            append SUFFIX to installed program names
634   --program-transform-name=PROGRAM   run sed PROGRAM on installed program names
635
636 System types:
637   --build=BUILD           configure for building on BUILD [guessed]
638   --host=HOST       build programs to run on HOST [BUILD]
639   --target=TARGET   configure for building compilers for TARGET [HOST]
640 EOF
641 fi
642
643 if test -n "$ac_init_help"; then
644
645   cat <<\EOF
646
647 Optional Packages:
648   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
649   --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
650
651 Optional Features:
652   --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
653   --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
654
655   --with-system-type=XXX  test: override derived host system-type
656   --with-pkg-config{=path} enable/disable use of pkg-config
657   --with-pkg-config-libdir=XXX use given directory for installing pc-files
658   --without-tests         suppress build with test-programs
659   --enable-mixed-case     tic should assume mixed-case filenames
660   --with-install-prefix   prefixes actual install-location ($DESTDIR)
661 Build-Tools Needed to Compile Temporary Applications for Cross-compiling:
662   --with-build-cc=XXX     the build C compiler ($BUILD_CC)
663   --with-build-cpp=XXX    the build C preprocessor ($BUILD_CPP)
664   --with-build-cflags=XXX the build C compiler-flags ($BUILD_CFLAGS)
665   --with-build-cppflags=XXX the build C preprocessor-flags ($BUILD_CPPFLAGS)
666   --with-build-ldflags=XXX the build linker-flags ($BUILD_LDFLAGS)
667   --with-build-libs=XXX   the build libraries (${BUILD_LIBS})
668 Options to Specify the Libraries Built/Used:
669   --with-shared           generate shared C-objects (needed for --with-ada-sharedlib)
670   --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
1798 (*[\ \  ]-[IUD]*)
1799         echo "$as_me:1799: result: broken" >&5
1800 echo "${ECHO_T}broken" >&6
1801         { echo "$as_me:1801: WARNING: your environment misuses the CC variable to hold CFLAGS/CPPFLAGS options" >&5
1802 echo "$as_me: WARNING: your environment misuses the CC variable to hold CFLAGS/CPPFLAGS options" >&2;}
1803         # humor him...
1804         cf_flags=`echo "$CC" | sed -e 's/^[^    ]*[     ]//'`
1805         CC=`echo "$CC" | sed -e 's/[    ].*//'`
1806
1807 cf_fix_cppflags=no
1808 cf_new_cflags=
1809 cf_new_cppflags=
1810 cf_new_extra_cppflags=
1811
1812 for cf_add_cflags in $cf_flags
1813 do
1814 case $cf_fix_cppflags in
1815 (no)
1816         case $cf_add_cflags in
1817         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
1818                 case $cf_add_cflags in
1819                 (-D*)
1820                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
1821
1822                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
1823                                 && test -z "${cf_tst_cflags}" \
1824                                 && cf_fix_cppflags=yes
1825
1826                         if test $cf_fix_cppflags = yes ; then
1827                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
1828                                 continue
1829                         elif test "${cf_tst_cflags}" = "\"'" ; then
1830                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
1831                                 continue
1832                         fi
1833                         ;;
1834                 esac
1835                 case "$CPPFLAGS" in
1836                 (*$cf_add_cflags)
1837                         ;;
1838                 (*)
1839                         case $cf_add_cflags in
1840                         (-D*)
1841                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
1842
1843 CPPFLAGS=`echo "$CPPFLAGS" | \
1844         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
1845                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
1846
1847                                 ;;
1848                         esac
1849                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
1850                         ;;
1851                 esac
1852                 ;;
1853         (*)
1854                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
1855                 ;;
1856         esac
1857         ;;
1858 (yes)
1859         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
1860
1861         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
1862
1863         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
1864                 && test -z "${cf_tst_cflags}" \
1865                 && cf_fix_cppflags=no
1866         ;;
1867 esac
1868 done
1869
1870 if test -n "$cf_new_cflags" ; then
1871
1872         CFLAGS="$CFLAGS $cf_new_cflags"
1873 fi
1874
1875 if test -n "$cf_new_cppflags" ; then
1876
1877         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
1878 fi
1879
1880 if test -n "$cf_new_extra_cppflags" ; then
1881
1882         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
1883 fi
1884
1885         ;;
1886 (*)
1887         echo "$as_me:1887: result: ok" >&5
1888 echo "${ECHO_T}ok" >&6
1889         ;;
1890 esac
1891
1892 ac_ext=c
1893 ac_cpp='$CPP $CPPFLAGS'
1894 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
1895 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
1896 ac_compiler_gnu=$ac_cv_c_compiler_gnu
1897 ac_main_return=return
1898 echo "$as_me:1898: checking how to run the C preprocessor" >&5
1899 echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6
1900 # On Suns, sometimes $CPP names a directory.
1901 if test -n "$CPP" && test -d "$CPP"; then
1902   CPP=
1903 fi
1904 if test -z "$CPP"; then
1905   if test "${ac_cv_prog_CPP+set}" = set; then
1906   echo $ECHO_N "(cached) $ECHO_C" >&6
1907 else
1908       # Double quotes because CPP needs to be expanded
1909     for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
1910     do
1911       ac_preproc_ok=false
1912 for ac_c_preproc_warn_flag in '' yes
1913 do
1914   # Use a header file that comes with gcc, so configuring glibc
1915   # with a fresh cross-compiler works.
1916   # On the NeXT, cc -E runs the code through the compiler's parser,
1917   # not just through cpp. "Syntax error" is here to catch this case.
1918   cat >conftest.$ac_ext <<_ACEOF
1919 #line 1919 "configure"
1920 #include "confdefs.h"
1921 #include <assert.h>
1922                      Syntax error
1923 _ACEOF
1924 if { (eval echo "$as_me:1924: \"$ac_cpp conftest.$ac_ext\"") >&5
1925   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
1926   ac_status=$?
1927   egrep -v '^ *\+' conftest.er1 >conftest.err
1928   rm -f conftest.er1
1929   cat conftest.err >&5
1930   echo "$as_me:1930: \$? = $ac_status" >&5
1931   (exit $ac_status); } >/dev/null; then
1932   if test -s conftest.err; then
1933     ac_cpp_err=$ac_c_preproc_warn_flag
1934   else
1935     ac_cpp_err=
1936   fi
1937 else
1938   ac_cpp_err=yes
1939 fi
1940 if test -z "$ac_cpp_err"; then
1941   :
1942 else
1943   echo "$as_me: failed program was:" >&5
1944   cat conftest.$ac_ext >&5
1945   # Broken: fails on valid input.
1946 continue
1947 fi
1948 rm -f conftest.err conftest.$ac_ext
1949
1950   # OK, works on sane cases.  Now check whether non-existent headers
1951   # can be detected and how.
1952   cat >conftest.$ac_ext <<_ACEOF
1953 #line 1953 "configure"
1954 #include "confdefs.h"
1955 #include <ac_nonexistent.h>
1956 _ACEOF
1957 if { (eval echo "$as_me:1957: \"$ac_cpp conftest.$ac_ext\"") >&5
1958   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
1959   ac_status=$?
1960   egrep -v '^ *\+' conftest.er1 >conftest.err
1961   rm -f conftest.er1
1962   cat conftest.err >&5
1963   echo "$as_me:1963: \$? = $ac_status" >&5
1964   (exit $ac_status); } >/dev/null; then
1965   if test -s conftest.err; then
1966     ac_cpp_err=$ac_c_preproc_warn_flag
1967   else
1968     ac_cpp_err=
1969   fi
1970 else
1971   ac_cpp_err=yes
1972 fi
1973 if test -z "$ac_cpp_err"; then
1974   # Broken: success on invalid input.
1975 continue
1976 else
1977   echo "$as_me: failed program was:" >&5
1978   cat conftest.$ac_ext >&5
1979   # Passes both tests.
1980 ac_preproc_ok=:
1981 break
1982 fi
1983 rm -f conftest.err conftest.$ac_ext
1984
1985 done
1986 # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
1987 rm -f conftest.err conftest.$ac_ext
1988 if $ac_preproc_ok; then
1989   break
1990 fi
1991
1992     done
1993     ac_cv_prog_CPP=$CPP
1994
1995 fi
1996   CPP=$ac_cv_prog_CPP
1997 else
1998   ac_cv_prog_CPP=$CPP
1999 fi
2000 echo "$as_me:2000: result: $CPP" >&5
2001 echo "${ECHO_T}$CPP" >&6
2002 ac_preproc_ok=false
2003 for ac_c_preproc_warn_flag in '' yes
2004 do
2005   # Use a header file that comes with gcc, so configuring glibc
2006   # with a fresh cross-compiler works.
2007   # On the NeXT, cc -E runs the code through the compiler's parser,
2008   # not just through cpp. "Syntax error" is here to catch this case.
2009   cat >conftest.$ac_ext <<_ACEOF
2010 #line 2010 "configure"
2011 #include "confdefs.h"
2012 #include <assert.h>
2013                      Syntax error
2014 _ACEOF
2015 if { (eval echo "$as_me:2015: \"$ac_cpp conftest.$ac_ext\"") >&5
2016   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
2017   ac_status=$?
2018   egrep -v '^ *\+' conftest.er1 >conftest.err
2019   rm -f conftest.er1
2020   cat conftest.err >&5
2021   echo "$as_me:2021: \$? = $ac_status" >&5
2022   (exit $ac_status); } >/dev/null; then
2023   if test -s conftest.err; then
2024     ac_cpp_err=$ac_c_preproc_warn_flag
2025   else
2026     ac_cpp_err=
2027   fi
2028 else
2029   ac_cpp_err=yes
2030 fi
2031 if test -z "$ac_cpp_err"; then
2032   :
2033 else
2034   echo "$as_me: failed program was:" >&5
2035   cat conftest.$ac_ext >&5
2036   # Broken: fails on valid input.
2037 continue
2038 fi
2039 rm -f conftest.err conftest.$ac_ext
2040
2041   # OK, works on sane cases.  Now check whether non-existent headers
2042   # can be detected and how.
2043   cat >conftest.$ac_ext <<_ACEOF
2044 #line 2044 "configure"
2045 #include "confdefs.h"
2046 #include <ac_nonexistent.h>
2047 _ACEOF
2048 if { (eval echo "$as_me:2048: \"$ac_cpp conftest.$ac_ext\"") >&5
2049   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
2050   ac_status=$?
2051   egrep -v '^ *\+' conftest.er1 >conftest.err
2052   rm -f conftest.er1
2053   cat conftest.err >&5
2054   echo "$as_me:2054: \$? = $ac_status" >&5
2055   (exit $ac_status); } >/dev/null; then
2056   if test -s conftest.err; then
2057     ac_cpp_err=$ac_c_preproc_warn_flag
2058   else
2059     ac_cpp_err=
2060   fi
2061 else
2062   ac_cpp_err=yes
2063 fi
2064 if test -z "$ac_cpp_err"; then
2065   # Broken: success on invalid input.
2066 continue
2067 else
2068   echo "$as_me: failed program was:" >&5
2069   cat conftest.$ac_ext >&5
2070   # Passes both tests.
2071 ac_preproc_ok=:
2072 break
2073 fi
2074 rm -f conftest.err conftest.$ac_ext
2075
2076 done
2077 # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
2078 rm -f conftest.err conftest.$ac_ext
2079 if $ac_preproc_ok; then
2080   :
2081 else
2082   { { echo "$as_me:2082: error: C preprocessor \"$CPP\" fails sanity check" >&5
2083 echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check" >&2;}
2084    { (exit 1); exit 1; }; }
2085 fi
2086
2087 ac_ext=c
2088 ac_cpp='$CPP $CPPFLAGS'
2089 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
2090 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
2091 ac_compiler_gnu=$ac_cv_c_compiler_gnu
2092 ac_main_return=return
2093
2094 if test $ac_cv_c_compiler_gnu = yes; then
2095     echo "$as_me:2095: checking whether $CC needs -traditional" >&5
2096 echo $ECHO_N "checking whether $CC needs -traditional... $ECHO_C" >&6
2097 if test "${ac_cv_prog_gcc_traditional+set}" = set; then
2098   echo $ECHO_N "(cached) $ECHO_C" >&6
2099 else
2100     ac_pattern="Autoconf.*'x'"
2101   cat >conftest.$ac_ext <<_ACEOF
2102 #line 2102 "configure"
2103 #include "confdefs.h"
2104 #include <sgtty.h>
2105 int Autoconf = TIOCGETP;
2106 _ACEOF
2107 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
2108   egrep "$ac_pattern" >/dev/null 2>&1; then
2109   ac_cv_prog_gcc_traditional=yes
2110 else
2111   ac_cv_prog_gcc_traditional=no
2112 fi
2113 rm -rf conftest*
2114
2115   if test $ac_cv_prog_gcc_traditional = no; then
2116     cat >conftest.$ac_ext <<_ACEOF
2117 #line 2117 "configure"
2118 #include "confdefs.h"
2119 #include <termio.h>
2120 int Autoconf = TCGETA;
2121 _ACEOF
2122 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
2123   egrep "$ac_pattern" >/dev/null 2>&1; then
2124   ac_cv_prog_gcc_traditional=yes
2125 fi
2126 rm -rf conftest*
2127
2128   fi
2129 fi
2130 echo "$as_me:2130: result: $ac_cv_prog_gcc_traditional" >&5
2131 echo "${ECHO_T}$ac_cv_prog_gcc_traditional" >&6
2132   if test $ac_cv_prog_gcc_traditional = yes; then
2133     CC="$CC -traditional"
2134   fi
2135 fi
2136
2137 echo "$as_me:2137: checking whether $CC understands -c and -o together" >&5
2138 echo $ECHO_N "checking whether $CC understands -c and -o together... $ECHO_C" >&6
2139 if test "${cf_cv_prog_CC_c_o+set}" = set; then
2140   echo $ECHO_N "(cached) $ECHO_C" >&6
2141 else
2142
2143 cat > conftest.$ac_ext <<CF_EOF
2144 #include <stdio.h>
2145 int main()
2146 {
2147         ${cf_cv_main_return:-return}(0);
2148 }
2149 CF_EOF
2150 # We do the test twice because some compilers refuse to overwrite an
2151 # existing .o file with -o, though they will create one.
2152 ac_try='$CC -c conftest.$ac_ext -o conftest2.$ac_objext >&5'
2153 if { (eval echo "$as_me:2153: \"$ac_try\"") >&5
2154   (eval $ac_try) 2>&5
2155   ac_status=$?
2156   echo "$as_me:2156: \$? = $ac_status" >&5
2157   (exit $ac_status); } &&
2158   test -f conftest2.$ac_objext && { (eval echo "$as_me:2158: \"$ac_try\"") >&5
2159   (eval $ac_try) 2>&5
2160   ac_status=$?
2161   echo "$as_me:2161: \$? = $ac_status" >&5
2162   (exit $ac_status); };
2163 then
2164   eval cf_cv_prog_CC_c_o=yes
2165 else
2166   eval cf_cv_prog_CC_c_o=no
2167 fi
2168 rm -rf conftest*
2169
2170 fi
2171 if test $cf_cv_prog_CC_c_o = yes; then
2172   echo "$as_me:2172: result: yes" >&5
2173 echo "${ECHO_T}yes" >&6
2174 else
2175   echo "$as_me:2175: result: no" >&5
2176 echo "${ECHO_T}no" >&6
2177 fi
2178
2179 test "$program_prefix" != NONE &&
2180   program_transform_name="s,^,$program_prefix,;$program_transform_name"
2181 # Use a double $ so make ignores it.
2182 test "$program_suffix" != NONE &&
2183   program_transform_name="s,\$,$program_suffix,;$program_transform_name"
2184 # Double any \ or $.  echo might interpret backslashes.
2185 # By default was `s,x,x', remove it if useless.
2186 cat <<\_ACEOF >conftest.sed
2187 s/[\\$]/&&/g;s/;s,x,x,$//
2188 _ACEOF
2189 program_transform_name=`echo $program_transform_name | sed -f conftest.sed`
2190 rm conftest.sed
2191
2192 for ac_prog in mawk gawk nawk awk
2193 do
2194   # Extract the first word of "$ac_prog", so it can be a program name with args.
2195 set dummy $ac_prog; ac_word=$2
2196 echo "$as_me:2196: checking for $ac_word" >&5
2197 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2198 if test "${ac_cv_prog_AWK+set}" = set; then
2199   echo $ECHO_N "(cached) $ECHO_C" >&6
2200 else
2201   if test -n "$AWK"; then
2202   ac_cv_prog_AWK="$AWK" # Let the user override the test.
2203 else
2204   ac_save_IFS=$IFS; IFS=$ac_path_separator
2205 ac_dummy="$PATH"
2206 for ac_dir in $ac_dummy; do
2207   IFS=$ac_save_IFS
2208   test -z "$ac_dir" && ac_dir=.
2209   $as_executable_p "$ac_dir/$ac_word" || continue
2210 ac_cv_prog_AWK="$ac_prog"
2211 echo "$as_me:2211: found $ac_dir/$ac_word" >&5
2212 break
2213 done
2214
2215 fi
2216 fi
2217 AWK=$ac_cv_prog_AWK
2218 if test -n "$AWK"; then
2219   echo "$as_me:2219: result: $AWK" >&5
2220 echo "${ECHO_T}$AWK" >&6
2221 else
2222   echo "$as_me:2222: result: no" >&5
2223 echo "${ECHO_T}no" >&6
2224 fi
2225
2226   test -n "$AWK" && break
2227 done
2228
2229 test -z "$AWK" && { { echo "$as_me:2229: error: No awk program found" >&5
2230 echo "$as_me: error: No awk program found" >&2;}
2231    { (exit 1); exit 1; }; }
2232
2233 echo "$as_me:2233: checking for egrep" >&5
2234 echo $ECHO_N "checking for egrep... $ECHO_C" >&6
2235 if test "${ac_cv_prog_egrep+set}" = set; then
2236   echo $ECHO_N "(cached) $ECHO_C" >&6
2237 else
2238   if echo a | (grep -E '(a|b)') >/dev/null 2>&1
2239                 then ac_cv_prog_egrep='grep -E'
2240                 else ac_cv_prog_egrep='egrep'
2241         fi
2242 fi
2243 echo "$as_me:2243: result: $ac_cv_prog_egrep" >&5
2244 echo "${ECHO_T}$ac_cv_prog_egrep" >&6
2245         EGREP=$ac_cv_prog_egrep
2246
2247         test -z "$EGREP" && { { echo "$as_me:2247: error: No egrep program found" >&5
2248 echo "$as_me: error: No egrep program found" >&2;}
2249    { (exit 1); exit 1; }; }
2250
2251 # Find a good install program.  We prefer a C program (faster),
2252 # so one script is as good as another.  But avoid the broken or
2253 # incompatible versions:
2254 # SysV /etc/install, /usr/sbin/install
2255 # SunOS /usr/etc/install
2256 # IRIX /sbin/install
2257 # AIX /bin/install
2258 # AmigaOS /C/install, which installs bootblocks on floppy discs
2259 # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
2260 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
2261 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
2262 # ./install, which can be erroneously created by make from ./install.sh.
2263 echo "$as_me:2263: checking for a BSD compatible install" >&5
2264 echo $ECHO_N "checking for a BSD compatible install... $ECHO_C" >&6
2265 if test -z "$INSTALL"; then
2266 if test "${ac_cv_path_install+set}" = set; then
2267   echo $ECHO_N "(cached) $ECHO_C" >&6
2268 else
2269     ac_save_IFS=$IFS; IFS=$ac_path_separator
2270   for ac_dir in $PATH; do
2271     IFS=$ac_save_IFS
2272     # Account for people who put trailing slashes in PATH elements.
2273     case $ac_dir/ in
2274     / | ./ | .// | /cC/* \
2275     | /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* \
2276     | /usr/ucb/* ) ;;
2277     *)
2278       # OSF1 and SCO ODT 3.0 have their own names for install.
2279       # Don't use installbsd from OSF since it installs stuff as root
2280       # by default.
2281       for ac_prog in ginstall scoinst install; do
2282         if $as_executable_p "$ac_dir/$ac_prog"; then
2283           if test $ac_prog = install &&
2284             grep dspmsg "$ac_dir/$ac_prog" >/dev/null 2>&1; then
2285             # AIX install.  It has an incompatible calling convention.
2286             :
2287           elif test $ac_prog = install &&
2288             grep pwplus "$ac_dir/$ac_prog" >/dev/null 2>&1; then
2289             # program-specific install script used by HP pwplus--don't use.
2290             :
2291           else
2292             ac_cv_path_install="$ac_dir/$ac_prog -c"
2293             break 2
2294           fi
2295         fi
2296       done
2297       ;;
2298     esac
2299   done
2300
2301 fi
2302   if test "${ac_cv_path_install+set}" = set; then
2303     INSTALL=$ac_cv_path_install
2304   else
2305     # As a last resort, use the slow shell script.  We don't cache a
2306     # path for INSTALL within a source directory, because that will
2307     # break other packages using the cache if that directory is
2308     # removed, or if the path is relative.
2309     INSTALL=$ac_install_sh
2310   fi
2311 fi
2312 echo "$as_me:2312: result: $INSTALL" >&5
2313 echo "${ECHO_T}$INSTALL" >&6
2314
2315 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
2316 # It thinks the first close brace ends the variable substitution.
2317 test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
2318
2319 test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
2320
2321 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
2322
2323 echo "$as_me:2323: checking whether ln -s works" >&5
2324 echo $ECHO_N "checking whether ln -s works... $ECHO_C" >&6
2325 LN_S=$as_ln_s
2326 if test "$LN_S" = "ln -s"; then
2327   echo "$as_me:2327: result: yes" >&5
2328 echo "${ECHO_T}yes" >&6
2329 else
2330   echo "$as_me:2330: result: no, using $LN_S" >&5
2331 echo "${ECHO_T}no, using $LN_S" >&6
2332 fi
2333
2334 echo "$as_me:2334: checking if $LN_S -f options work" >&5
2335 echo $ECHO_N "checking if $LN_S -f options work... $ECHO_C" >&6
2336
2337 rm -f conf$$.src conf$$dst
2338 echo >conf$$.dst
2339 echo first >conf$$.src
2340 if $LN_S -f conf$$.src conf$$.dst 2>/dev/null; then
2341         cf_prog_ln_sf=yes
2342 else
2343         cf_prog_ln_sf=no
2344 fi
2345 rm -f conf$$.dst conf$$src
2346 echo "$as_me:2346: result: $cf_prog_ln_sf" >&5
2347 echo "${ECHO_T}$cf_prog_ln_sf" >&6
2348
2349 test "$cf_prog_ln_sf" = yes && LN_S="$LN_S -f"
2350
2351 echo "$as_me:2351: checking for long file names" >&5
2352 echo $ECHO_N "checking for long file names... $ECHO_C" >&6
2353 if test "${ac_cv_sys_long_file_names+set}" = set; then
2354   echo $ECHO_N "(cached) $ECHO_C" >&6
2355 else
2356   ac_cv_sys_long_file_names=yes
2357 # Test for long file names in all the places we know might matter:
2358 #      .                the current directory, where building will happen
2359 #      $prefix/lib      where we will be installing things
2360 #      $exec_prefix/lib likewise
2361 # eval it to expand exec_prefix.
2362 #      $TMPDIR          if set, where it might want to write temporary files
2363 # if $TMPDIR is not set:
2364 #      /tmp             where it might want to write temporary files
2365 #      /var/tmp         likewise
2366 #      /usr/tmp         likewise
2367 if test -n "$TMPDIR" && test -d "$TMPDIR" && test -w "$TMPDIR"; then
2368   ac_tmpdirs=$TMPDIR
2369 else
2370   ac_tmpdirs='/tmp /var/tmp /usr/tmp'
2371 fi
2372 for ac_dir in  . $ac_tmpdirs `eval echo $prefix/lib $exec_prefix/lib` ; do
2373   test -d $ac_dir || continue
2374   test -w $ac_dir || continue # It is less confusing to not echo anything here.
2375   ac_xdir=$ac_dir/cf$$
2376   (umask 077 && mkdir $ac_xdir 2>/dev/null) || continue
2377   ac_tf1=$ac_xdir/conftest9012345
2378   ac_tf2=$ac_xdir/conftest9012346
2379   (echo 1 >$ac_tf1) 2>/dev/null
2380   (echo 2 >$ac_tf2) 2>/dev/null
2381   ac_val=`cat $ac_tf1 2>/dev/null`
2382   if test ! -f $ac_tf1 || test "$ac_val" != 1; then
2383     ac_cv_sys_long_file_names=no
2384     rm -rf $ac_xdir 2>/dev/null
2385     break
2386   fi
2387   rm -rf $ac_xdir 2>/dev/null
2388 done
2389 fi
2390 echo "$as_me:2390: result: $ac_cv_sys_long_file_names" >&5
2391 echo "${ECHO_T}$ac_cv_sys_long_file_names" >&6
2392 if test $ac_cv_sys_long_file_names = yes; then
2393
2394 cat >>confdefs.h <<\EOF
2395 #define HAVE_LONG_FILE_NAMES 1
2396 EOF
2397
2398 fi
2399
2400 # if we find pkg-config, check if we should install the ".pc" files.
2401
2402 echo "$as_me:2402: checking if you want to use pkg-config" >&5
2403 echo $ECHO_N "checking if you want to use pkg-config... $ECHO_C" >&6
2404
2405 # Check whether --with-pkg-config or --without-pkg-config was given.
2406 if test "${with_pkg_config+set}" = set; then
2407   withval="$with_pkg_config"
2408   cf_pkg_config=$withval
2409 else
2410   cf_pkg_config=yes
2411 fi;
2412 echo "$as_me:2412: result: $cf_pkg_config" >&5
2413 echo "${ECHO_T}$cf_pkg_config" >&6
2414
2415 case $cf_pkg_config in
2416 (no)
2417         PKG_CONFIG=none
2418         ;;
2419 (yes)
2420
2421 if test -n "$ac_tool_prefix"; then
2422   # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
2423 set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
2424 echo "$as_me:2424: checking for $ac_word" >&5
2425 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2426 if test "${ac_cv_path_PKG_CONFIG+set}" = set; then
2427   echo $ECHO_N "(cached) $ECHO_C" >&6
2428 else
2429   case $PKG_CONFIG in
2430   [\\/]* | ?:[\\/]*)
2431   ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
2432   ;;
2433   *)
2434   ac_save_IFS=$IFS; IFS=$ac_path_separator
2435 ac_dummy="$PATH"
2436 for ac_dir in $ac_dummy; do
2437   IFS=$ac_save_IFS
2438   test -z "$ac_dir" && ac_dir=.
2439   if $as_executable_p "$ac_dir/$ac_word"; then
2440    ac_cv_path_PKG_CONFIG="$ac_dir/$ac_word"
2441    echo "$as_me:2441: found $ac_dir/$ac_word" >&5
2442    break
2443 fi
2444 done
2445
2446   ;;
2447 esac
2448 fi
2449 PKG_CONFIG=$ac_cv_path_PKG_CONFIG
2450
2451 if test -n "$PKG_CONFIG"; then
2452   echo "$as_me:2452: result: $PKG_CONFIG" >&5
2453 echo "${ECHO_T}$PKG_CONFIG" >&6
2454 else
2455   echo "$as_me:2455: result: no" >&5
2456 echo "${ECHO_T}no" >&6
2457 fi
2458
2459 fi
2460 if test -z "$ac_cv_path_PKG_CONFIG"; then
2461   ac_pt_PKG_CONFIG=$PKG_CONFIG
2462   # Extract the first word of "pkg-config", so it can be a program name with args.
2463 set dummy pkg-config; ac_word=$2
2464 echo "$as_me:2464: checking for $ac_word" >&5
2465 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2466 if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then
2467   echo $ECHO_N "(cached) $ECHO_C" >&6
2468 else
2469   case $ac_pt_PKG_CONFIG in
2470   [\\/]* | ?:[\\/]*)
2471   ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path.
2472   ;;
2473   *)
2474   ac_save_IFS=$IFS; IFS=$ac_path_separator
2475 ac_dummy="$PATH"
2476 for ac_dir in $ac_dummy; do
2477   IFS=$ac_save_IFS
2478   test -z "$ac_dir" && ac_dir=.
2479   if $as_executable_p "$ac_dir/$ac_word"; then
2480    ac_cv_path_ac_pt_PKG_CONFIG="$ac_dir/$ac_word"
2481    echo "$as_me:2481: found $ac_dir/$ac_word" >&5
2482    break
2483 fi
2484 done
2485
2486   test -z "$ac_cv_path_ac_pt_PKG_CONFIG" && ac_cv_path_ac_pt_PKG_CONFIG="none"
2487   ;;
2488 esac
2489 fi
2490 ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
2491
2492 if test -n "$ac_pt_PKG_CONFIG"; then
2493   echo "$as_me:2493: result: $ac_pt_PKG_CONFIG" >&5
2494 echo "${ECHO_T}$ac_pt_PKG_CONFIG" >&6
2495 else
2496   echo "$as_me:2496: result: no" >&5
2497 echo "${ECHO_T}no" >&6
2498 fi
2499
2500   PKG_CONFIG=$ac_pt_PKG_CONFIG
2501 else
2502   PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
2503 fi
2504
2505         ;;
2506 (*)
2507         PKG_CONFIG=$withval
2508         ;;
2509 esac
2510
2511 test -z "$PKG_CONFIG" && PKG_CONFIG=none
2512 if test "$PKG_CONFIG" != none ; then
2513
2514 if test "x$prefix" != xNONE; then
2515         cf_path_syntax="$prefix"
2516 else
2517         cf_path_syntax="$ac_default_prefix"
2518 fi
2519
2520 case ".$PKG_CONFIG" in
2521 (.\$\(*\)*|.\'*\'*)
2522         ;;
2523 (..|./*|.\\*)
2524         ;;
2525 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
2526         ;;
2527 (.\${*prefix}*|.\${*dir}*)
2528         eval PKG_CONFIG="$PKG_CONFIG"
2529         case ".$PKG_CONFIG" in
2530         (.NONE/*)
2531                 PKG_CONFIG=`echo $PKG_CONFIG | sed -e s%NONE%$cf_path_syntax%`
2532                 ;;
2533         esac
2534         ;;
2535 (.no|.NONE/*)
2536         PKG_CONFIG=`echo $PKG_CONFIG | sed -e s%NONE%$cf_path_syntax%`
2537         ;;
2538 (*)
2539         { { echo "$as_me:2539: error: expected a pathname, not \"$PKG_CONFIG\"" >&5
2540 echo "$as_me: error: expected a pathname, not \"$PKG_CONFIG\"" >&2;}
2541    { (exit 1); exit 1; }; }
2542         ;;
2543 esac
2544
2545 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
2562 (x/*)
2563         ;;
2564 (xyes)
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
2581         (*64)
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                         $cf_path/libdata"
2596                 ;;
2597         esac
2598
2599         test -n "$verbose" && echo "    list..." 1>&6
2600
2601 echo "${as_me:-configure}:2601: testing list... ..." 1>&5
2602
2603         for cf_config in $cf_search_path
2604         do
2605                 test -n "$verbose" && echo "    checking $cf_config/pkgconfig" 1>&6
2606
2607 echo "${as_me:-configure}:2607: testing checking $cf_config/pkgconfig ..." 1>&5
2608
2609                 if test -d $cf_config/pkgconfig
2610                 then
2611                         PKG_CONFIG_LIBDIR=$cf_config/pkgconfig
2612                         echo "$as_me:2612: checking done" >&5
2613 echo $ECHO_N "checking done... $ECHO_C" >&6
2614                         break
2615                 fi
2616         done
2617         ;;
2618 (*)
2619         ;;
2620 esac
2621
2622 echo "$as_me:2622: result: $PKG_CONFIG_LIBDIR" >&5
2623 echo "${ECHO_T}$PKG_CONFIG_LIBDIR" >&6
2624
2625 echo "$as_me:2625: checking if you want to build test-programs" >&5
2626 echo $ECHO_N "checking if you want to build test-programs... $ECHO_C" >&6
2627
2628 # Check whether --with-tests or --without-tests was given.
2629 if test "${with_tests+set}" = set; then
2630   withval="$with_tests"
2631   cf_with_tests=$withval
2632 else
2633   cf_with_tests=yes
2634 fi;
2635 echo "$as_me:2635: result: $cf_with_tests" >&5
2636 echo "${ECHO_T}$cf_with_tests" >&6
2637
2638 echo "$as_me:2638: checking if we should assume mixed-case filenames" >&5
2639 echo $ECHO_N "checking if we should assume mixed-case filenames... $ECHO_C" >&6
2640
2641 # Check whether --enable-mixed-case or --disable-mixed-case was given.
2642 if test "${enable_mixed_case+set}" = set; then
2643   enableval="$enable_mixed_case"
2644   enable_mixedcase=$enableval
2645 else
2646   enable_mixedcase=auto
2647 fi;
2648 echo "$as_me:2648: result: $enable_mixedcase" >&5
2649 echo "${ECHO_T}$enable_mixedcase" >&6
2650 if test "$enable_mixedcase" = "auto" ; then
2651
2652 echo "$as_me:2652: checking if filesystem supports mixed-case filenames" >&5
2653 echo $ECHO_N "checking if filesystem supports mixed-case filenames... $ECHO_C" >&6
2654 if test "${cf_cv_mixedcase+set}" = set; then
2655   echo $ECHO_N "(cached) $ECHO_C" >&6
2656 else
2657
2658 if test "$cross_compiling" = yes ; then
2659         case $target_alias in
2660         (*-os2-emx*|*-msdosdjgpp*|*-cygwin*|*-msys*|*-mingw*|*-uwin*)
2661                 cf_cv_mixedcase=no
2662                 ;;
2663         (*)
2664                 cf_cv_mixedcase=yes
2665                 ;;
2666         esac
2667 else
2668         rm -f conftest CONFTEST
2669         echo test >conftest
2670         if test -f CONFTEST ; then
2671                 cf_cv_mixedcase=no
2672         else
2673                 cf_cv_mixedcase=yes
2674         fi
2675         rm -f conftest CONFTEST
2676 fi
2677
2678 fi
2679 echo "$as_me:2679: result: $cf_cv_mixedcase" >&5
2680 echo "${ECHO_T}$cf_cv_mixedcase" >&6
2681 test "$cf_cv_mixedcase" = yes &&
2682 cat >>confdefs.h <<\EOF
2683 #define MIXEDCASE_FILENAMES 1
2684 EOF
2685
2686 else
2687         cf_cv_mixedcase=$enable_mixedcase
2688         if test "$enable_mixedcase" = "yes" ; then
2689                 cat >>confdefs.h <<\EOF
2690 #define MIXEDCASE_FILENAMES 1
2691 EOF
2692
2693         fi
2694 fi
2695
2696 # do this after mixed-case option (tags/TAGS is not as important as tic).
2697 echo "$as_me:2697: checking whether ${MAKE-make} sets \${MAKE}" >&5
2698 echo $ECHO_N "checking whether ${MAKE-make} sets \${MAKE}... $ECHO_C" >&6
2699 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,./+-,__p_,'`
2700 if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then
2701   echo $ECHO_N "(cached) $ECHO_C" >&6
2702 else
2703   cat >conftest.make <<\EOF
2704 all:
2705         @echo 'ac_maketemp="${MAKE}"'
2706 EOF
2707 # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
2708 eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=`
2709 if test -n "$ac_maketemp"; then
2710   eval ac_cv_prog_make_${ac_make}_set=yes
2711 else
2712   eval ac_cv_prog_make_${ac_make}_set=no
2713 fi
2714 rm -f conftest.make
2715 fi
2716 if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
2717   echo "$as_me:2717: result: yes" >&5
2718 echo "${ECHO_T}yes" >&6
2719   SET_MAKE=
2720 else
2721   echo "$as_me:2721: result: no" >&5
2722 echo "${ECHO_T}no" >&6
2723   SET_MAKE="MAKE=${MAKE-make}"
2724 fi
2725
2726 for ac_prog in exctags ctags
2727 do
2728   # Extract the first word of "$ac_prog", so it can be a program name with args.
2729 set dummy $ac_prog; ac_word=$2
2730 echo "$as_me:2730: checking for $ac_word" >&5
2731 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2732 if test "${ac_cv_prog_CTAGS+set}" = set; then
2733   echo $ECHO_N "(cached) $ECHO_C" >&6
2734 else
2735   if test -n "$CTAGS"; then
2736   ac_cv_prog_CTAGS="$CTAGS" # Let the user override the test.
2737 else
2738   ac_save_IFS=$IFS; IFS=$ac_path_separator
2739 ac_dummy="$PATH"
2740 for ac_dir in $ac_dummy; do
2741   IFS=$ac_save_IFS
2742   test -z "$ac_dir" && ac_dir=.
2743   $as_executable_p "$ac_dir/$ac_word" || continue
2744 ac_cv_prog_CTAGS="$ac_prog"
2745 echo "$as_me:2745: found $ac_dir/$ac_word" >&5
2746 break
2747 done
2748
2749 fi
2750 fi
2751 CTAGS=$ac_cv_prog_CTAGS
2752 if test -n "$CTAGS"; then
2753   echo "$as_me:2753: result: $CTAGS" >&5
2754 echo "${ECHO_T}$CTAGS" >&6
2755 else
2756   echo "$as_me:2756: result: no" >&5
2757 echo "${ECHO_T}no" >&6
2758 fi
2759
2760   test -n "$CTAGS" && break
2761 done
2762
2763 for ac_prog in exetags etags
2764 do
2765   # Extract the first word of "$ac_prog", so it can be a program name with args.
2766 set dummy $ac_prog; ac_word=$2
2767 echo "$as_me:2767: checking for $ac_word" >&5
2768 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2769 if test "${ac_cv_prog_ETAGS+set}" = set; then
2770   echo $ECHO_N "(cached) $ECHO_C" >&6
2771 else
2772   if test -n "$ETAGS"; then
2773   ac_cv_prog_ETAGS="$ETAGS" # Let the user override the test.
2774 else
2775   ac_save_IFS=$IFS; IFS=$ac_path_separator
2776 ac_dummy="$PATH"
2777 for ac_dir in $ac_dummy; do
2778   IFS=$ac_save_IFS
2779   test -z "$ac_dir" && ac_dir=.
2780   $as_executable_p "$ac_dir/$ac_word" || continue
2781 ac_cv_prog_ETAGS="$ac_prog"
2782 echo "$as_me:2782: found $ac_dir/$ac_word" >&5
2783 break
2784 done
2785
2786 fi
2787 fi
2788 ETAGS=$ac_cv_prog_ETAGS
2789 if test -n "$ETAGS"; then
2790   echo "$as_me:2790: result: $ETAGS" >&5
2791 echo "${ECHO_T}$ETAGS" >&6
2792 else
2793   echo "$as_me:2793: result: no" >&5
2794 echo "${ECHO_T}no" >&6
2795 fi
2796
2797   test -n "$ETAGS" && break
2798 done
2799
2800 # Extract the first word of "${CTAGS:-ctags}", so it can be a program name with args.
2801 set dummy ${CTAGS:-ctags}; ac_word=$2
2802 echo "$as_me:2802: checking for $ac_word" >&5
2803 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2804 if test "${ac_cv_prog_MAKE_LOWER_TAGS+set}" = set; then
2805   echo $ECHO_N "(cached) $ECHO_C" >&6
2806 else
2807   if test -n "$MAKE_LOWER_TAGS"; then
2808   ac_cv_prog_MAKE_LOWER_TAGS="$MAKE_LOWER_TAGS" # Let the user override the test.
2809 else
2810   ac_save_IFS=$IFS; IFS=$ac_path_separator
2811 ac_dummy="$PATH"
2812 for ac_dir in $ac_dummy; do
2813   IFS=$ac_save_IFS
2814   test -z "$ac_dir" && ac_dir=.
2815   $as_executable_p "$ac_dir/$ac_word" || continue
2816 ac_cv_prog_MAKE_LOWER_TAGS="yes"
2817 echo "$as_me:2817: found $ac_dir/$ac_word" >&5
2818 break
2819 done
2820
2821   test -z "$ac_cv_prog_MAKE_LOWER_TAGS" && ac_cv_prog_MAKE_LOWER_TAGS="no"
2822 fi
2823 fi
2824 MAKE_LOWER_TAGS=$ac_cv_prog_MAKE_LOWER_TAGS
2825 if test -n "$MAKE_LOWER_TAGS"; then
2826   echo "$as_me:2826: result: $MAKE_LOWER_TAGS" >&5
2827 echo "${ECHO_T}$MAKE_LOWER_TAGS" >&6
2828 else
2829   echo "$as_me:2829: result: no" >&5
2830 echo "${ECHO_T}no" >&6
2831 fi
2832
2833 if test "$cf_cv_mixedcase" = yes ; then
2834         # Extract the first word of "${ETAGS:-etags}", so it can be a program name with args.
2835 set dummy ${ETAGS:-etags}; ac_word=$2
2836 echo "$as_me:2836: checking for $ac_word" >&5
2837 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2838 if test "${ac_cv_prog_MAKE_UPPER_TAGS+set}" = set; then
2839   echo $ECHO_N "(cached) $ECHO_C" >&6
2840 else
2841   if test -n "$MAKE_UPPER_TAGS"; then
2842   ac_cv_prog_MAKE_UPPER_TAGS="$MAKE_UPPER_TAGS" # Let the user override the test.
2843 else
2844   ac_save_IFS=$IFS; IFS=$ac_path_separator
2845 ac_dummy="$PATH"
2846 for ac_dir in $ac_dummy; do
2847   IFS=$ac_save_IFS
2848   test -z "$ac_dir" && ac_dir=.
2849   $as_executable_p "$ac_dir/$ac_word" || continue
2850 ac_cv_prog_MAKE_UPPER_TAGS="yes"
2851 echo "$as_me:2851: found $ac_dir/$ac_word" >&5
2852 break
2853 done
2854
2855   test -z "$ac_cv_prog_MAKE_UPPER_TAGS" && ac_cv_prog_MAKE_UPPER_TAGS="no"
2856 fi
2857 fi
2858 MAKE_UPPER_TAGS=$ac_cv_prog_MAKE_UPPER_TAGS
2859 if test -n "$MAKE_UPPER_TAGS"; then
2860   echo "$as_me:2860: result: $MAKE_UPPER_TAGS" >&5
2861 echo "${ECHO_T}$MAKE_UPPER_TAGS" >&6
2862 else
2863   echo "$as_me:2863: result: no" >&5
2864 echo "${ECHO_T}no" >&6
2865 fi
2866
2867 else
2868         MAKE_UPPER_TAGS=no
2869 fi
2870
2871 if test "$MAKE_UPPER_TAGS" = yes ; then
2872         MAKE_UPPER_TAGS=
2873 else
2874         MAKE_UPPER_TAGS="#"
2875 fi
2876
2877 if test "$MAKE_LOWER_TAGS" = yes ; then
2878         MAKE_LOWER_TAGS=
2879 else
2880         MAKE_LOWER_TAGS="#"
2881 fi
2882
2883 echo "$as_me:2883: checking for makeflags variable" >&5
2884 echo $ECHO_N "checking for makeflags variable... $ECHO_C" >&6
2885 if test "${cf_cv_makeflags+set}" = set; then
2886   echo $ECHO_N "(cached) $ECHO_C" >&6
2887 else
2888
2889         cf_cv_makeflags=''
2890         for cf_option in '-${MAKEFLAGS}' '${MFLAGS}'
2891         do
2892                 cat >cf_makeflags.tmp <<CF_EOF
2893 SHELL = /bin/sh
2894 all :
2895         @ echo '.$cf_option'
2896 CF_EOF
2897                 cf_result=`${MAKE:-make} -k -f cf_makeflags.tmp 2>/dev/null | fgrep -v "ing directory" | sed -e 's,[    ]*$,,'`
2898                 case "$cf_result" in
2899                 (.*k|.*kw)
2900                         cf_result=`${MAKE:-make} -k -f cf_makeflags.tmp CC=cc 2>/dev/null`
2901                         case "$cf_result" in
2902                         (.*CC=*)        cf_cv_makeflags=
2903                                 ;;
2904                         (*)     cf_cv_makeflags=$cf_option
2905                                 ;;
2906                         esac
2907                         break
2908                         ;;
2909                 (.-)    ;;
2910                 (*)     echo "given option \"$cf_option\", no match \"$cf_result\""
2911                         ;;
2912                 esac
2913         done
2914         rm -f cf_makeflags.tmp
2915
2916 fi
2917 echo "$as_me:2917: result: $cf_cv_makeflags" >&5
2918 echo "${ECHO_T}$cf_cv_makeflags" >&6
2919
2920 if test -n "$ac_tool_prefix"; then
2921   # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
2922 set dummy ${ac_tool_prefix}ranlib; ac_word=$2
2923 echo "$as_me:2923: checking for $ac_word" >&5
2924 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2925 if test "${ac_cv_prog_RANLIB+set}" = set; then
2926   echo $ECHO_N "(cached) $ECHO_C" >&6
2927 else
2928   if test -n "$RANLIB"; then
2929   ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
2930 else
2931   ac_save_IFS=$IFS; IFS=$ac_path_separator
2932 ac_dummy="$PATH"
2933 for ac_dir in $ac_dummy; do
2934   IFS=$ac_save_IFS
2935   test -z "$ac_dir" && ac_dir=.
2936   $as_executable_p "$ac_dir/$ac_word" || continue
2937 ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
2938 echo "$as_me:2938: found $ac_dir/$ac_word" >&5
2939 break
2940 done
2941
2942 fi
2943 fi
2944 RANLIB=$ac_cv_prog_RANLIB
2945 if test -n "$RANLIB"; then
2946   echo "$as_me:2946: result: $RANLIB" >&5
2947 echo "${ECHO_T}$RANLIB" >&6
2948 else
2949   echo "$as_me:2949: result: no" >&5
2950 echo "${ECHO_T}no" >&6
2951 fi
2952
2953 fi
2954 if test -z "$ac_cv_prog_RANLIB"; then
2955   ac_ct_RANLIB=$RANLIB
2956   # Extract the first word of "ranlib", so it can be a program name with args.
2957 set dummy ranlib; ac_word=$2
2958 echo "$as_me:2958: checking for $ac_word" >&5
2959 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2960 if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then
2961   echo $ECHO_N "(cached) $ECHO_C" >&6
2962 else
2963   if test -n "$ac_ct_RANLIB"; then
2964   ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
2965 else
2966   ac_save_IFS=$IFS; IFS=$ac_path_separator
2967 ac_dummy="$PATH"
2968 for ac_dir in $ac_dummy; do
2969   IFS=$ac_save_IFS
2970   test -z "$ac_dir" && ac_dir=.
2971   $as_executable_p "$ac_dir/$ac_word" || continue
2972 ac_cv_prog_ac_ct_RANLIB="ranlib"
2973 echo "$as_me:2973: found $ac_dir/$ac_word" >&5
2974 break
2975 done
2976
2977   test -z "$ac_cv_prog_ac_ct_RANLIB" && ac_cv_prog_ac_ct_RANLIB="':'"
2978 fi
2979 fi
2980 ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
2981 if test -n "$ac_ct_RANLIB"; then
2982   echo "$as_me:2982: result: $ac_ct_RANLIB" >&5
2983 echo "${ECHO_T}$ac_ct_RANLIB" >&6
2984 else
2985   echo "$as_me:2985: result: no" >&5
2986 echo "${ECHO_T}no" >&6
2987 fi
2988
2989   RANLIB=$ac_ct_RANLIB
2990 else
2991   RANLIB="$ac_cv_prog_RANLIB"
2992 fi
2993
2994 if test -n "$ac_tool_prefix"; then
2995   # Extract the first word of "${ac_tool_prefix}ld", so it can be a program name with args.
2996 set dummy ${ac_tool_prefix}ld; ac_word=$2
2997 echo "$as_me:2997: checking for $ac_word" >&5
2998 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2999 if test "${ac_cv_prog_LD+set}" = set; then
3000   echo $ECHO_N "(cached) $ECHO_C" >&6
3001 else
3002   if test -n "$LD"; then
3003   ac_cv_prog_LD="$LD" # Let the user override the test.
3004 else
3005   ac_save_IFS=$IFS; IFS=$ac_path_separator
3006 ac_dummy="$PATH"
3007 for ac_dir in $ac_dummy; do
3008   IFS=$ac_save_IFS
3009   test -z "$ac_dir" && ac_dir=.
3010   $as_executable_p "$ac_dir/$ac_word" || continue
3011 ac_cv_prog_LD="${ac_tool_prefix}ld"
3012 echo "$as_me:3012: found $ac_dir/$ac_word" >&5
3013 break
3014 done
3015
3016 fi
3017 fi
3018 LD=$ac_cv_prog_LD
3019 if test -n "$LD"; then
3020   echo "$as_me:3020: result: $LD" >&5
3021 echo "${ECHO_T}$LD" >&6
3022 else
3023   echo "$as_me:3023: result: no" >&5
3024 echo "${ECHO_T}no" >&6
3025 fi
3026
3027 fi
3028 if test -z "$ac_cv_prog_LD"; then
3029   ac_ct_LD=$LD
3030   # Extract the first word of "ld", so it can be a program name with args.
3031 set dummy ld; ac_word=$2
3032 echo "$as_me:3032: checking for $ac_word" >&5
3033 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3034 if test "${ac_cv_prog_ac_ct_LD+set}" = set; then
3035   echo $ECHO_N "(cached) $ECHO_C" >&6
3036 else
3037   if test -n "$ac_ct_LD"; then
3038   ac_cv_prog_ac_ct_LD="$ac_ct_LD" # Let the user override the test.
3039 else
3040   ac_save_IFS=$IFS; IFS=$ac_path_separator
3041 ac_dummy="$PATH"
3042 for ac_dir in $ac_dummy; do
3043   IFS=$ac_save_IFS
3044   test -z "$ac_dir" && ac_dir=.
3045   $as_executable_p "$ac_dir/$ac_word" || continue
3046 ac_cv_prog_ac_ct_LD="ld"
3047 echo "$as_me:3047: found $ac_dir/$ac_word" >&5
3048 break
3049 done
3050
3051   test -z "$ac_cv_prog_ac_ct_LD" && ac_cv_prog_ac_ct_LD="ld"
3052 fi
3053 fi
3054 ac_ct_LD=$ac_cv_prog_ac_ct_LD
3055 if test -n "$ac_ct_LD"; then
3056   echo "$as_me:3056: result: $ac_ct_LD" >&5
3057 echo "${ECHO_T}$ac_ct_LD" >&6
3058 else
3059   echo "$as_me:3059: result: no" >&5
3060 echo "${ECHO_T}no" >&6
3061 fi
3062
3063   LD=$ac_ct_LD
3064 else
3065   LD="$ac_cv_prog_LD"
3066 fi
3067
3068 if test -n "$ac_tool_prefix"; then
3069   # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
3070 set dummy ${ac_tool_prefix}ar; ac_word=$2
3071 echo "$as_me:3071: checking for $ac_word" >&5
3072 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3073 if test "${ac_cv_prog_AR+set}" = set; then
3074   echo $ECHO_N "(cached) $ECHO_C" >&6
3075 else
3076   if test -n "$AR"; then
3077   ac_cv_prog_AR="$AR" # Let the user override the test.
3078 else
3079   ac_save_IFS=$IFS; IFS=$ac_path_separator
3080 ac_dummy="$PATH"
3081 for ac_dir in $ac_dummy; do
3082   IFS=$ac_save_IFS
3083   test -z "$ac_dir" && ac_dir=.
3084   $as_executable_p "$ac_dir/$ac_word" || continue
3085 ac_cv_prog_AR="${ac_tool_prefix}ar"
3086 echo "$as_me:3086: found $ac_dir/$ac_word" >&5
3087 break
3088 done
3089
3090 fi
3091 fi
3092 AR=$ac_cv_prog_AR
3093 if test -n "$AR"; then
3094   echo "$as_me:3094: result: $AR" >&5
3095 echo "${ECHO_T}$AR" >&6
3096 else
3097   echo "$as_me:3097: result: no" >&5
3098 echo "${ECHO_T}no" >&6
3099 fi
3100
3101 fi
3102 if test -z "$ac_cv_prog_AR"; then
3103   ac_ct_AR=$AR
3104   # Extract the first word of "ar", so it can be a program name with args.
3105 set dummy ar; ac_word=$2
3106 echo "$as_me:3106: checking for $ac_word" >&5
3107 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3108 if test "${ac_cv_prog_ac_ct_AR+set}" = set; then
3109   echo $ECHO_N "(cached) $ECHO_C" >&6
3110 else
3111   if test -n "$ac_ct_AR"; then
3112   ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test.
3113 else
3114   ac_save_IFS=$IFS; IFS=$ac_path_separator
3115 ac_dummy="$PATH"
3116 for ac_dir in $ac_dummy; do
3117   IFS=$ac_save_IFS
3118   test -z "$ac_dir" && ac_dir=.
3119   $as_executable_p "$ac_dir/$ac_word" || continue
3120 ac_cv_prog_ac_ct_AR="ar"
3121 echo "$as_me:3121: found $ac_dir/$ac_word" >&5
3122 break
3123 done
3124
3125   test -z "$ac_cv_prog_ac_ct_AR" && ac_cv_prog_ac_ct_AR="ar"
3126 fi
3127 fi
3128 ac_ct_AR=$ac_cv_prog_ac_ct_AR
3129 if test -n "$ac_ct_AR"; then
3130   echo "$as_me:3130: result: $ac_ct_AR" >&5
3131 echo "${ECHO_T}$ac_ct_AR" >&6
3132 else
3133   echo "$as_me:3133: result: no" >&5
3134 echo "${ECHO_T}no" >&6
3135 fi
3136
3137   AR=$ac_ct_AR
3138 else
3139   AR="$ac_cv_prog_AR"
3140 fi
3141
3142 if test -n "$ac_tool_prefix"; then
3143   # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
3144 set dummy ${ac_tool_prefix}ar; ac_word=$2
3145 echo "$as_me:3145: checking for $ac_word" >&5
3146 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3147 if test "${ac_cv_prog_AR+set}" = set; then
3148   echo $ECHO_N "(cached) $ECHO_C" >&6
3149 else
3150   if test -n "$AR"; then
3151   ac_cv_prog_AR="$AR" # Let the user override the test.
3152 else
3153   ac_save_IFS=$IFS; IFS=$ac_path_separator
3154 ac_dummy="$PATH"
3155 for ac_dir in $ac_dummy; do
3156   IFS=$ac_save_IFS
3157   test -z "$ac_dir" && ac_dir=.
3158   $as_executable_p "$ac_dir/$ac_word" || continue
3159 ac_cv_prog_AR="${ac_tool_prefix}ar"
3160 echo "$as_me:3160: found $ac_dir/$ac_word" >&5
3161 break
3162 done
3163
3164 fi
3165 fi
3166 AR=$ac_cv_prog_AR
3167 if test -n "$AR"; then
3168   echo "$as_me:3168: result: $AR" >&5
3169 echo "${ECHO_T}$AR" >&6
3170 else
3171   echo "$as_me:3171: result: no" >&5
3172 echo "${ECHO_T}no" >&6
3173 fi
3174
3175 fi
3176 if test -z "$ac_cv_prog_AR"; then
3177   ac_ct_AR=$AR
3178   # Extract the first word of "ar", so it can be a program name with args.
3179 set dummy ar; ac_word=$2
3180 echo "$as_me:3180: checking for $ac_word" >&5
3181 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3182 if test "${ac_cv_prog_ac_ct_AR+set}" = set; then
3183   echo $ECHO_N "(cached) $ECHO_C" >&6
3184 else
3185   if test -n "$ac_ct_AR"; then
3186   ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test.
3187 else
3188   ac_save_IFS=$IFS; IFS=$ac_path_separator
3189 ac_dummy="$PATH"
3190 for ac_dir in $ac_dummy; do
3191   IFS=$ac_save_IFS
3192   test -z "$ac_dir" && ac_dir=.
3193   $as_executable_p "$ac_dir/$ac_word" || continue
3194 ac_cv_prog_ac_ct_AR="ar"
3195 echo "$as_me:3195: found $ac_dir/$ac_word" >&5
3196 break
3197 done
3198
3199   test -z "$ac_cv_prog_ac_ct_AR" && ac_cv_prog_ac_ct_AR="ar"
3200 fi
3201 fi
3202 ac_ct_AR=$ac_cv_prog_ac_ct_AR
3203 if test -n "$ac_ct_AR"; then
3204   echo "$as_me:3204: result: $ac_ct_AR" >&5
3205 echo "${ECHO_T}$ac_ct_AR" >&6
3206 else
3207   echo "$as_me:3207: result: no" >&5
3208 echo "${ECHO_T}no" >&6
3209 fi
3210
3211   AR=$ac_ct_AR
3212 else
3213   AR="$ac_cv_prog_AR"
3214 fi
3215
3216 echo "$as_me:3216: checking for options to update archives" >&5
3217 echo $ECHO_N "checking for options to update archives... $ECHO_C" >&6
3218 if test "${cf_cv_ar_flags+set}" = set; then
3219   echo $ECHO_N "(cached) $ECHO_C" >&6
3220 else
3221
3222         cf_cv_ar_flags=unknown
3223         for cf_ar_flags in -curv curv -crv crv -cqv cqv -rv rv
3224         do
3225
3226                 # check if $ARFLAGS already contains this choice
3227                 if test "x$ARFLAGS" != "x" ; then
3228                         cf_check_ar_flags=`echo "x$ARFLAGS" | sed -e "s/$cf_ar_flags\$//" -e "s/$cf_ar_flags / /"`
3229                         if test "x$ARFLAGS" != "$cf_check_ar_flags" ; then
3230                                 cf_cv_ar_flags=
3231                                 break
3232                         fi
3233                 fi
3234
3235                 rm -f conftest.$ac_cv_objext
3236                 rm -f conftest.a
3237
3238                 cat >conftest.$ac_ext <<EOF
3239 #line 3239 "configure"
3240 int     testdata[3] = { 123, 456, 789 };
3241 EOF
3242                 if { (eval echo "$as_me:3242: \"$ac_compile\"") >&5
3243   (eval $ac_compile) 2>&5
3244   ac_status=$?
3245   echo "$as_me:3245: \$? = $ac_status" >&5
3246   (exit $ac_status); } ; then
3247                         echo "$AR $ARFLAGS $cf_ar_flags conftest.a conftest.$ac_cv_objext" >&5
3248                         $AR $ARFLAGS $cf_ar_flags conftest.a conftest.$ac_cv_objext 2>&5 1>/dev/null
3249                         if test -f conftest.a ; then
3250                                 cf_cv_ar_flags=$cf_ar_flags
3251                                 break
3252                         fi
3253                 else
3254                         test -n "$verbose" && echo "    cannot compile test-program" 1>&6
3255
3256 echo "${as_me:-configure}:3256: testing cannot compile test-program ..." 1>&5
3257
3258                         break
3259                 fi
3260         done
3261         rm -f conftest.a conftest.$ac_ext conftest.$ac_cv_objext
3262
3263 fi
3264 echo "$as_me:3264: result: $cf_cv_ar_flags" >&5
3265 echo "${ECHO_T}$cf_cv_ar_flags" >&6
3266
3267 if test -n "$ARFLAGS" ; then
3268         if test -n "$cf_cv_ar_flags" ; then
3269                 ARFLAGS="$ARFLAGS $cf_cv_ar_flags"
3270         fi
3271 else
3272         ARFLAGS=$cf_cv_ar_flags
3273 fi
3274
3275         echo "$as_me:3275: checking for PATH separator" >&5
3276 echo $ECHO_N "checking for PATH separator... $ECHO_C" >&6
3277         case $cf_cv_system_name in
3278         (os2*)  PATH_SEPARATOR=';'  ;;
3279         (*)     ${PATH_SEPARATOR:=':'}  ;;
3280         esac
3281
3282         echo "$as_me:3282: result: $PATH_SEPARATOR" >&5
3283 echo "${ECHO_T}$PATH_SEPARATOR" >&6
3284
3285 echo "$as_me:3285: checking if you have specified an install-prefix" >&5
3286 echo $ECHO_N "checking if you have specified an install-prefix... $ECHO_C" >&6
3287
3288 # Check whether --with-install-prefix or --without-install-prefix was given.
3289 if test "${with_install_prefix+set}" = set; then
3290   withval="$with_install_prefix"
3291   case "$withval" in
3292         (yes|no)
3293                 ;;
3294         (*)     DESTDIR="$withval"
3295                 ;;
3296         esac
3297 fi;
3298 echo "$as_me:3298: result: $DESTDIR" >&5
3299 echo "${ECHO_T}$DESTDIR" >&6
3300
3301 ###############################################################################
3302
3303 # If we're cross-compiling, allow the user to override the tools and their
3304 # options.  The configure script is oriented toward identifying the host
3305 # compiler, etc., but we need a build compiler to generate parts of the source.
3306
3307 if test "$cross_compiling" = yes ; then
3308
3309         # defaults that we might want to override
3310         : ${BUILD_CFLAGS:=''}
3311         : ${BUILD_CPPFLAGS:=''}
3312         : ${BUILD_LDFLAGS:=''}
3313         : ${BUILD_LIBS:=''}
3314         : ${BUILD_EXEEXT:='$x'}
3315         : ${BUILD_OBJEXT:='o'}
3316
3317 # Check whether --with-build-cc or --without-build-cc was given.
3318 if test "${with_build_cc+set}" = set; then
3319   withval="$with_build_cc"
3320   BUILD_CC="$withval"
3321 else
3322   for ac_prog in gcc cc cl
3323 do
3324   # Extract the first word of "$ac_prog", so it can be a program name with args.
3325 set dummy $ac_prog; ac_word=$2
3326 echo "$as_me:3326: checking for $ac_word" >&5
3327 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3328 if test "${ac_cv_prog_BUILD_CC+set}" = set; then
3329   echo $ECHO_N "(cached) $ECHO_C" >&6
3330 else
3331   if test -n "$BUILD_CC"; then
3332   ac_cv_prog_BUILD_CC="$BUILD_CC" # Let the user override the test.
3333 else
3334   ac_save_IFS=$IFS; IFS=$ac_path_separator
3335 ac_dummy="$PATH"
3336 for ac_dir in $ac_dummy; do
3337   IFS=$ac_save_IFS
3338   test -z "$ac_dir" && ac_dir=.
3339   $as_executable_p "$ac_dir/$ac_word" || continue
3340 ac_cv_prog_BUILD_CC="$ac_prog"
3341 echo "$as_me:3341: found $ac_dir/$ac_word" >&5
3342 break
3343 done
3344
3345 fi
3346 fi
3347 BUILD_CC=$ac_cv_prog_BUILD_CC
3348 if test -n "$BUILD_CC"; then
3349   echo "$as_me:3349: result: $BUILD_CC" >&5
3350 echo "${ECHO_T}$BUILD_CC" >&6
3351 else
3352   echo "$as_me:3352: result: no" >&5
3353 echo "${ECHO_T}no" >&6
3354 fi
3355
3356   test -n "$BUILD_CC" && break
3357 done
3358
3359 fi;
3360         echo "$as_me:3360: checking for native build C compiler" >&5
3361 echo $ECHO_N "checking for native build C compiler... $ECHO_C" >&6
3362         echo "$as_me:3362: result: $BUILD_CC" >&5
3363 echo "${ECHO_T}$BUILD_CC" >&6
3364
3365         echo "$as_me:3365: checking for native build C preprocessor" >&5
3366 echo $ECHO_N "checking for native build C preprocessor... $ECHO_C" >&6
3367
3368 # Check whether --with-build-cpp or --without-build-cpp was given.
3369 if test "${with_build_cpp+set}" = set; then
3370   withval="$with_build_cpp"
3371   BUILD_CPP="$withval"
3372 else
3373   BUILD_CPP='${BUILD_CC} -E'
3374 fi;
3375         echo "$as_me:3375: result: $BUILD_CPP" >&5
3376 echo "${ECHO_T}$BUILD_CPP" >&6
3377
3378         echo "$as_me:3378: checking for native build C flags" >&5
3379 echo $ECHO_N "checking for native build C flags... $ECHO_C" >&6
3380
3381 # Check whether --with-build-cflags or --without-build-cflags was given.
3382 if test "${with_build_cflags+set}" = set; then
3383   withval="$with_build_cflags"
3384   BUILD_CFLAGS="$withval"
3385 fi;
3386         echo "$as_me:3386: result: $BUILD_CFLAGS" >&5
3387 echo "${ECHO_T}$BUILD_CFLAGS" >&6
3388
3389         echo "$as_me:3389: checking for native build C preprocessor-flags" >&5
3390 echo $ECHO_N "checking for native build C preprocessor-flags... $ECHO_C" >&6
3391
3392 # Check whether --with-build-cppflags or --without-build-cppflags was given.
3393 if test "${with_build_cppflags+set}" = set; then
3394   withval="$with_build_cppflags"
3395   BUILD_CPPFLAGS="$withval"
3396 fi;
3397         echo "$as_me:3397: result: $BUILD_CPPFLAGS" >&5
3398 echo "${ECHO_T}$BUILD_CPPFLAGS" >&6
3399
3400         echo "$as_me:3400: checking for native build linker-flags" >&5
3401 echo $ECHO_N "checking for native build linker-flags... $ECHO_C" >&6
3402
3403 # Check whether --with-build-ldflags or --without-build-ldflags was given.
3404 if test "${with_build_ldflags+set}" = set; then
3405   withval="$with_build_ldflags"
3406   BUILD_LDFLAGS="$withval"
3407 fi;
3408         echo "$as_me:3408: result: $BUILD_LDFLAGS" >&5
3409 echo "${ECHO_T}$BUILD_LDFLAGS" >&6
3410
3411         echo "$as_me:3411: checking for native build linker-libraries" >&5
3412 echo $ECHO_N "checking for native build linker-libraries... $ECHO_C" >&6
3413
3414 # Check whether --with-build-libs or --without-build-libs was given.
3415 if test "${with_build_libs+set}" = set; then
3416   withval="$with_build_libs"
3417   BUILD_LIBS="$withval"
3418 fi;
3419         echo "$as_me:3419: result: $BUILD_LIBS" >&5
3420 echo "${ECHO_T}$BUILD_LIBS" >&6
3421
3422         # this assumes we're on Unix.
3423         BUILD_EXEEXT=
3424         BUILD_OBJEXT=o
3425
3426         : ${BUILD_CC:='${CC}'}
3427
3428         if ( test "$BUILD_CC" = "$CC" || test "$BUILD_CC" = '${CC}' ) ; then
3429                 { { echo "$as_me:3429: error: Cross-build requires two compilers.
3430 Use --with-build-cc to specify the native compiler." >&5
3431 echo "$as_me: error: Cross-build requires two compilers.
3432 Use --with-build-cc to specify the native compiler." >&2;}
3433    { (exit 1); exit 1; }; }
3434         fi
3435
3436 else
3437         : ${BUILD_CC:='${CC}'}
3438         : ${BUILD_CPP:='${CPP}'}
3439         : ${BUILD_CFLAGS:='${CFLAGS}'}
3440         : ${BUILD_CPPFLAGS:='${CPPFLAGS}'}
3441         : ${BUILD_LDFLAGS:='${LDFLAGS}'}
3442         : ${BUILD_LIBS:='${LIBS}'}
3443         : ${BUILD_EXEEXT:='$x'}
3444         : ${BUILD_OBJEXT:='o'}
3445 fi
3446
3447 ###############################################################################
3448
3449 ### Options to allow the user to specify the set of libraries which are used.
3450 ### Use "--without-normal --with-shared" to allow the default model to be
3451 ### shared, for example.
3452 cf_list_models=""
3453
3454 echo "$as_me:3454: checking if you want to build shared C-objects" >&5
3455 echo $ECHO_N "checking if you want to build shared C-objects... $ECHO_C" >&6
3456
3457 # Check whether --with-shared or --without-shared was given.
3458 if test "${with_shared+set}" = set; then
3459   withval="$with_shared"
3460   with_shared=$withval
3461 else
3462   with_shared=no
3463 fi;
3464 echo "$as_me:3464: result: $with_shared" >&5
3465 echo "${ECHO_T}$with_shared" >&6
3466 test "$with_shared" = "yes" && cf_list_models="$cf_list_models shared"
3467
3468 echo "$as_me:3468: checking for specified models" >&5
3469 echo $ECHO_N "checking for specified models... $ECHO_C" >&6
3470 test -z "$cf_list_models" && cf_list_models=normal
3471 echo "$as_me:3471: result: $cf_list_models" >&5
3472 echo "${ECHO_T}$cf_list_models" >&6
3473
3474 ### Use the first model as the default, and save its suffix for use in building
3475 ### up test-applications.
3476 echo "$as_me:3476: checking for default model" >&5
3477 echo $ECHO_N "checking for default model... $ECHO_C" >&6
3478 DFT_LWR_MODEL=`echo "$cf_list_models" | $AWK '{print $1}'`
3479 echo "$as_me:3479: result: $DFT_LWR_MODEL" >&5
3480 echo "${ECHO_T}$DFT_LWR_MODEL" >&6
3481
3482 DFT_UPR_MODEL=`echo "$DFT_LWR_MODEL" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
3483
3484 echo "$as_me:3484: checking for specific curses-directory" >&5
3485 echo $ECHO_N "checking for specific curses-directory... $ECHO_C" >&6
3486
3487 # Check whether --with-curses-dir or --without-curses-dir was given.
3488 if test "${with_curses_dir+set}" = set; then
3489   withval="$with_curses_dir"
3490   cf_cv_curses_dir=$withval
3491 else
3492   cf_cv_curses_dir=no
3493 fi;
3494 echo "$as_me:3494: result: $cf_cv_curses_dir" >&5
3495 echo "${ECHO_T}$cf_cv_curses_dir" >&6
3496
3497 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
3498 then
3499
3500 if test "x$prefix" != xNONE; then
3501         cf_path_syntax="$prefix"
3502 else
3503         cf_path_syntax="$ac_default_prefix"
3504 fi
3505
3506 case ".$withval" in
3507 (.\$\(*\)*|.\'*\'*)
3508         ;;
3509 (..|./*|.\\*)
3510         ;;
3511 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
3512         ;;
3513 (.\${*prefix}*|.\${*dir}*)
3514         eval withval="$withval"
3515         case ".$withval" in
3516         (.NONE/*)
3517                 withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
3518                 ;;
3519         esac
3520         ;;
3521 (.no|.NONE/*)
3522         withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
3523         ;;
3524 (*)
3525         { { echo "$as_me:3525: error: expected a pathname, not \"$withval\"" >&5
3526 echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;}
3527    { (exit 1); exit 1; }; }
3528         ;;
3529 esac
3530
3531         if test -d "$cf_cv_curses_dir"
3532         then
3533
3534 if test -n "$cf_cv_curses_dir/include" ; then
3535   for cf_add_incdir in $cf_cv_curses_dir/include
3536   do
3537         while test $cf_add_incdir != /usr/include
3538         do
3539           if test -d $cf_add_incdir
3540           then
3541                 cf_have_incdir=no
3542                 if test -n "$CFLAGS$CPPFLAGS" ; then
3543                   # a loop is needed to ensure we can add subdirs of existing dirs
3544                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
3545                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
3546                           cf_have_incdir=yes; break
3547                         fi
3548                   done
3549                 fi
3550
3551                 if test "$cf_have_incdir" = no ; then
3552                   if test "$cf_add_incdir" = /usr/local/include ; then
3553                         if test "$GCC" = yes
3554                         then
3555                           cf_save_CPPFLAGS=$CPPFLAGS
3556                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
3557                           cat >conftest.$ac_ext <<_ACEOF
3558 #line 3558 "configure"
3559 #include "confdefs.h"
3560 #include <stdio.h>
3561 int
3562 main ()
3563 {
3564 printf("Hello")
3565   ;
3566   return 0;
3567 }
3568 _ACEOF
3569 rm -f conftest.$ac_objext
3570 if { (eval echo "$as_me:3570: \"$ac_compile\"") >&5
3571   (eval $ac_compile) 2>&5
3572   ac_status=$?
3573   echo "$as_me:3573: \$? = $ac_status" >&5
3574   (exit $ac_status); } &&
3575          { ac_try='test -s conftest.$ac_objext'
3576   { (eval echo "$as_me:3576: \"$ac_try\"") >&5
3577   (eval $ac_try) 2>&5
3578   ac_status=$?
3579   echo "$as_me:3579: \$? = $ac_status" >&5
3580   (exit $ac_status); }; }; then
3581   :
3582 else
3583   echo "$as_me: failed program was:" >&5
3584 cat conftest.$ac_ext >&5
3585 cf_have_incdir=yes
3586 fi
3587 rm -f conftest.$ac_objext conftest.$ac_ext
3588                           CPPFLAGS=$cf_save_CPPFLAGS
3589                         fi
3590                   fi
3591                 fi
3592
3593                 if test "$cf_have_incdir" = no ; then
3594                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
3595
3596 echo "${as_me:-configure}:3596: testing adding $cf_add_incdir to include-path ..." 1>&5
3597
3598                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
3599
3600                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
3601                   test "$cf_top_incdir" = "$cf_add_incdir" && break
3602                   cf_add_incdir="$cf_top_incdir"
3603                 else
3604                   break
3605                 fi
3606           fi
3607         done
3608   done
3609 fi
3610
3611 if test -n "$cf_cv_curses_dir/lib" ; then
3612         for cf_add_libdir in $cf_cv_curses_dir/lib
3613         do
3614                 if test $cf_add_libdir = /usr/lib ; then
3615                         :
3616                 elif test -d $cf_add_libdir
3617                 then
3618                         cf_have_libdir=no
3619                         if test -n "$LDFLAGS$LIBS" ; then
3620                                 # a loop is needed to ensure we can add subdirs of existing dirs
3621                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
3622                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
3623                                                 cf_have_libdir=yes; break
3624                                         fi
3625                                 done
3626                         fi
3627                         if test "$cf_have_libdir" = no ; then
3628                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
3629
3630 echo "${as_me:-configure}:3630: testing adding $cf_add_libdir to library-path ..." 1>&5
3631
3632                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
3633                         fi
3634                 fi
3635         done
3636 fi
3637
3638         fi
3639 fi
3640
3641 echo "$as_me:3641: checking if you want wide-character code" >&5
3642 echo $ECHO_N "checking if you want wide-character code... $ECHO_C" >&6
3643
3644 # Check whether --enable-widec or --disable-widec was given.
3645 if test "${enable_widec+set}" = set; then
3646   enableval="$enable_widec"
3647   with_widec=$enableval
3648 else
3649   with_widec=no
3650 fi;
3651 echo "$as_me:3651: result: $with_widec" >&5
3652 echo "${ECHO_T}$with_widec" >&6
3653 if test "$with_widec" = yes ; then
3654
3655 echo "$as_me:3655: checking for multibyte character support" >&5
3656 echo $ECHO_N "checking for multibyte character support... $ECHO_C" >&6
3657 if test "${cf_cv_utf8_lib+set}" = set; then
3658   echo $ECHO_N "(cached) $ECHO_C" >&6
3659 else
3660
3661         cf_save_LIBS="$LIBS"
3662         cat >conftest.$ac_ext <<_ACEOF
3663 #line 3663 "configure"
3664 #include "confdefs.h"
3665
3666 #include <stdlib.h>
3667 int
3668 main ()
3669 {
3670 putwc(0,0);
3671   ;
3672   return 0;
3673 }
3674 _ACEOF
3675 rm -f conftest.$ac_objext conftest$ac_exeext
3676 if { (eval echo "$as_me:3676: \"$ac_link\"") >&5
3677   (eval $ac_link) 2>&5
3678   ac_status=$?
3679   echo "$as_me:3679: \$? = $ac_status" >&5
3680   (exit $ac_status); } &&
3681          { ac_try='test -s conftest$ac_exeext'
3682   { (eval echo "$as_me:3682: \"$ac_try\"") >&5
3683   (eval $ac_try) 2>&5
3684   ac_status=$?
3685   echo "$as_me:3685: \$? = $ac_status" >&5
3686   (exit $ac_status); }; }; then
3687   cf_cv_utf8_lib=yes
3688 else
3689   echo "$as_me: failed program was:" >&5
3690 cat conftest.$ac_ext >&5
3691
3692 # If the linkage is not already in the $CPPFLAGS/$LDFLAGS configuration, these
3693 # will be set on completion of the AC_TRY_LINK below.
3694 cf_cv_header_path_utf8=
3695 cf_cv_library_path_utf8=
3696
3697 echo "${as_me:-configure}:3697: testing Starting FIND_LINKAGE(utf8,) ..." 1>&5
3698
3699 cf_save_LIBS="$LIBS"
3700
3701 cat >conftest.$ac_ext <<_ACEOF
3702 #line 3702 "configure"
3703 #include "confdefs.h"
3704
3705 #include <libutf8.h>
3706 int
3707 main ()
3708 {
3709 putwc(0,0);
3710   ;
3711   return 0;
3712 }
3713 _ACEOF
3714 rm -f conftest.$ac_objext conftest$ac_exeext
3715 if { (eval echo "$as_me:3715: \"$ac_link\"") >&5
3716   (eval $ac_link) 2>&5
3717   ac_status=$?
3718   echo "$as_me:3718: \$? = $ac_status" >&5
3719   (exit $ac_status); } &&
3720          { ac_try='test -s conftest$ac_exeext'
3721   { (eval echo "$as_me:3721: \"$ac_try\"") >&5
3722   (eval $ac_try) 2>&5
3723   ac_status=$?
3724   echo "$as_me:3724: \$? = $ac_status" >&5
3725   (exit $ac_status); }; }; then
3726
3727         cf_cv_find_linkage_utf8=yes
3728         cf_cv_header_path_utf8=/usr/include
3729         cf_cv_library_path_utf8=/usr/lib
3730
3731 else
3732   echo "$as_me: failed program was:" >&5
3733 cat conftest.$ac_ext >&5
3734
3735 LIBS="-lutf8  $cf_save_LIBS"
3736
3737 cat >conftest.$ac_ext <<_ACEOF
3738 #line 3738 "configure"
3739 #include "confdefs.h"
3740
3741 #include <libutf8.h>
3742 int
3743 main ()
3744 {
3745 putwc(0,0);
3746   ;
3747   return 0;
3748 }
3749 _ACEOF
3750 rm -f conftest.$ac_objext conftest$ac_exeext
3751 if { (eval echo "$as_me:3751: \"$ac_link\"") >&5
3752   (eval $ac_link) 2>&5
3753   ac_status=$?
3754   echo "$as_me:3754: \$? = $ac_status" >&5
3755   (exit $ac_status); } &&
3756          { ac_try='test -s conftest$ac_exeext'
3757   { (eval echo "$as_me:3757: \"$ac_try\"") >&5
3758   (eval $ac_try) 2>&5
3759   ac_status=$?
3760   echo "$as_me:3760: \$? = $ac_status" >&5
3761   (exit $ac_status); }; }; then
3762
3763         cf_cv_find_linkage_utf8=yes
3764         cf_cv_header_path_utf8=/usr/include
3765         cf_cv_library_path_utf8=/usr/lib
3766         cf_cv_library_file_utf8="-lutf8"
3767
3768 else
3769   echo "$as_me: failed program was:" >&5
3770 cat conftest.$ac_ext >&5
3771
3772         cf_cv_find_linkage_utf8=no
3773         LIBS="$cf_save_LIBS"
3774
3775         test -n "$verbose" && echo "    find linkage for utf8 library" 1>&6
3776
3777 echo "${as_me:-configure}:3777: testing find linkage for utf8 library ..." 1>&5
3778
3779 echo "${as_me:-configure}:3779: testing Searching for headers in FIND_LINKAGE(utf8,) ..." 1>&5
3780
3781         cf_save_CPPFLAGS="$CPPFLAGS"
3782         cf_test_CPPFLAGS="$CPPFLAGS"
3783
3784 cf_search=
3785
3786 # collect the current set of include-directories from compiler flags
3787 cf_header_path_list=""
3788 if test -n "${CFLAGS}${CPPFLAGS}" ; then
3789         for cf_header_path in $CPPFLAGS $CFLAGS
3790         do
3791                 case $cf_header_path in
3792                 (-I*)
3793                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
3794
3795 test "x$cf_header_path" != "xNONE" && \
3796 test -d "$cf_header_path" && \
3797  {
3798         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
3799         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
3800         test -d $cf_header_path/include/utf8 &&       cf_search="$cf_search $cf_header_path/include/utf8"
3801         test -d $cf_header_path/include/utf8/include &&    cf_search="$cf_search $cf_header_path/include/utf8/include"
3802         test -d $cf_header_path/utf8/include &&       cf_search="$cf_search $cf_header_path/utf8/include"
3803         test -d $cf_header_path/utf8/include/utf8 &&    cf_search="$cf_search $cf_header_path/utf8/include/utf8"
3804 }
3805
3806                         cf_header_path_list="$cf_header_path_list $cf_search"
3807                         ;;
3808                 esac
3809         done
3810 fi
3811
3812 # add the variations for the package we are looking for
3813
3814 cf_search=
3815
3816 test "x$prefix" != "xNONE" && \
3817 test -d "$prefix" && \
3818  {
3819         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
3820         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
3821         test -d $prefix/include/utf8 &&       cf_search="$cf_search $prefix/include/utf8"
3822         test -d $prefix/include/utf8/include &&    cf_search="$cf_search $prefix/include/utf8/include"
3823         test -d $prefix/utf8/include &&       cf_search="$cf_search $prefix/utf8/include"
3824         test -d $prefix/utf8/include/utf8 &&    cf_search="$cf_search $prefix/utf8/include/utf8"
3825 }
3826
3827 for cf_subdir_prefix in \
3828         /usr \
3829         /usr/local \
3830         /usr/pkg \
3831         /opt \
3832         /opt/local \
3833         $HOME
3834 do
3835
3836 test "x$cf_subdir_prefix" != "x$prefix" && \
3837 test -d "$cf_subdir_prefix" && \
3838 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
3839         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
3840         test -d $cf_subdir_prefix/include &&          cf_search="$cf_search $cf_subdir_prefix/include"
3841         test -d $cf_subdir_prefix/include/utf8 &&       cf_search="$cf_search $cf_subdir_prefix/include/utf8"
3842         test -d $cf_subdir_prefix/include/utf8/include &&    cf_search="$cf_search $cf_subdir_prefix/include/utf8/include"
3843         test -d $cf_subdir_prefix/utf8/include &&       cf_search="$cf_search $cf_subdir_prefix/utf8/include"
3844         test -d $cf_subdir_prefix/utf8/include/utf8 &&    cf_search="$cf_search $cf_subdir_prefix/utf8/include/utf8"
3845 }
3846
3847 done
3848
3849 test "$includedir" != NONE && \
3850 test "$includedir" != "/usr/include" && \
3851 test -d "$includedir" && {
3852         test -d $includedir &&    cf_search="$cf_search $includedir"
3853         test -d $includedir/utf8 && cf_search="$cf_search $includedir/utf8"
3854 }
3855
3856 test "$oldincludedir" != NONE && \
3857 test "$oldincludedir" != "/usr/include" && \
3858 test -d "$oldincludedir" && {
3859         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
3860         test -d $oldincludedir/utf8 && cf_search="$cf_search $oldincludedir/utf8"
3861 }
3862
3863 cf_search="$cf_search $cf_header_path_list"
3864
3865         for cf_cv_header_path_utf8 in $cf_search
3866         do
3867                 if test -d $cf_cv_header_path_utf8 ; then
3868                         test -n "$verbose" && echo "    ... testing $cf_cv_header_path_utf8" 1>&6
3869
3870 echo "${as_me:-configure}:3870: testing ... testing $cf_cv_header_path_utf8 ..." 1>&5
3871
3872                         CPPFLAGS="$cf_save_CPPFLAGS -I$cf_cv_header_path_utf8"
3873                         cat >conftest.$ac_ext <<_ACEOF
3874 #line 3874 "configure"
3875 #include "confdefs.h"
3876
3877 #include <libutf8.h>
3878 int
3879 main ()
3880 {
3881 putwc(0,0);
3882   ;
3883   return 0;
3884 }
3885 _ACEOF
3886 rm -f conftest.$ac_objext
3887 if { (eval echo "$as_me:3887: \"$ac_compile\"") >&5
3888   (eval $ac_compile) 2>&5
3889   ac_status=$?
3890   echo "$as_me:3890: \$? = $ac_status" >&5
3891   (exit $ac_status); } &&
3892          { ac_try='test -s conftest.$ac_objext'
3893   { (eval echo "$as_me:3893: \"$ac_try\"") >&5
3894   (eval $ac_try) 2>&5
3895   ac_status=$?
3896   echo "$as_me:3896: \$? = $ac_status" >&5
3897   (exit $ac_status); }; }; then
3898
3899                                 test -n "$verbose" && echo "    ... found utf8 headers in $cf_cv_header_path_utf8" 1>&6
3900
3901 echo "${as_me:-configure}:3901: testing ... found utf8 headers in $cf_cv_header_path_utf8 ..." 1>&5
3902
3903                                 cf_cv_find_linkage_utf8=maybe
3904                                 cf_test_CPPFLAGS="$CPPFLAGS"
3905                                 break
3906 else
3907   echo "$as_me: failed program was:" >&5
3908 cat conftest.$ac_ext >&5
3909
3910                                 CPPFLAGS="$cf_save_CPPFLAGS"
3911
3912 fi
3913 rm -f conftest.$ac_objext conftest.$ac_ext
3914                 fi
3915         done
3916
3917         if test "$cf_cv_find_linkage_utf8" = maybe ; then
3918
3919 echo "${as_me:-configure}:3919: testing Searching for utf8 library in FIND_LINKAGE(utf8,) ..." 1>&5
3920
3921                 cf_save_LIBS="$LIBS"
3922                 cf_save_LDFLAGS="$LDFLAGS"
3923
3924                 if test "$cf_cv_find_linkage_utf8" != yes ; then
3925
3926 cf_search=
3927 cf_library_path_list=""
3928 if test -n "${LDFLAGS}${LIBS}" ; then
3929         for cf_library_path in $LDFLAGS $LIBS
3930         do
3931                 case $cf_library_path in
3932                 (-L*)
3933                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
3934
3935 test "x$cf_library_path" != "xNONE" && \
3936 test -d "$cf_library_path" && \
3937  {
3938         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
3939         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
3940         test -d $cf_library_path/lib/utf8 &&       cf_search="$cf_search $cf_library_path/lib/utf8"
3941         test -d $cf_library_path/lib/utf8/lib &&    cf_search="$cf_search $cf_library_path/lib/utf8/lib"
3942         test -d $cf_library_path/utf8/lib &&       cf_search="$cf_search $cf_library_path/utf8/lib"
3943         test -d $cf_library_path/utf8/lib/utf8 &&    cf_search="$cf_search $cf_library_path/utf8/lib/utf8"
3944 }
3945
3946                         cf_library_path_list="$cf_library_path_list $cf_search"
3947                         ;;
3948                 esac
3949         done
3950 fi
3951
3952 cf_search=
3953
3954 test "x$prefix" != "xNONE" && \
3955 test -d "$prefix" && \
3956  {
3957         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
3958         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
3959         test -d $prefix/lib/utf8 &&       cf_search="$cf_search $prefix/lib/utf8"
3960         test -d $prefix/lib/utf8/lib &&    cf_search="$cf_search $prefix/lib/utf8/lib"
3961         test -d $prefix/utf8/lib &&       cf_search="$cf_search $prefix/utf8/lib"
3962         test -d $prefix/utf8/lib/utf8 &&    cf_search="$cf_search $prefix/utf8/lib/utf8"
3963 }
3964
3965 for cf_subdir_prefix in \
3966         /usr \
3967         /usr/local \
3968         /usr/pkg \
3969         /opt \
3970         /opt/local \
3971         $HOME
3972 do
3973
3974 test "x$cf_subdir_prefix" != "x$prefix" && \
3975 test -d "$cf_subdir_prefix" && \
3976 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
3977         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
3978         test -d $cf_subdir_prefix/lib &&          cf_search="$cf_search $cf_subdir_prefix/lib"
3979         test -d $cf_subdir_prefix/lib/utf8 &&       cf_search="$cf_search $cf_subdir_prefix/lib/utf8"
3980         test -d $cf_subdir_prefix/lib/utf8/lib &&    cf_search="$cf_search $cf_subdir_prefix/lib/utf8/lib"
3981         test -d $cf_subdir_prefix/utf8/lib &&       cf_search="$cf_search $cf_subdir_prefix/utf8/lib"
3982         test -d $cf_subdir_prefix/utf8/lib/utf8 &&    cf_search="$cf_search $cf_subdir_prefix/utf8/lib/utf8"
3983 }
3984
3985 done
3986
3987 cf_search="$cf_library_path_list $cf_search"
3988
3989                         for cf_cv_library_path_utf8 in $cf_search
3990                         do
3991                                 if test -d $cf_cv_library_path_utf8 ; then
3992                                         test -n "$verbose" && echo "    ... testing $cf_cv_library_path_utf8" 1>&6
3993
3994 echo "${as_me:-configure}:3994: testing ... testing $cf_cv_library_path_utf8 ..." 1>&5
3995
3996                                         CPPFLAGS="$cf_test_CPPFLAGS"
3997                                         LIBS="-lutf8  $cf_save_LIBS"
3998                                         LDFLAGS="$cf_save_LDFLAGS -L$cf_cv_library_path_utf8"
3999                                         cat >conftest.$ac_ext <<_ACEOF
4000 #line 4000 "configure"
4001 #include "confdefs.h"
4002
4003 #include <libutf8.h>
4004 int
4005 main ()
4006 {
4007 putwc(0,0);
4008   ;
4009   return 0;
4010 }
4011 _ACEOF
4012 rm -f conftest.$ac_objext conftest$ac_exeext
4013 if { (eval echo "$as_me:4013: \"$ac_link\"") >&5
4014   (eval $ac_link) 2>&5
4015   ac_status=$?
4016   echo "$as_me:4016: \$? = $ac_status" >&5
4017   (exit $ac_status); } &&
4018          { ac_try='test -s conftest$ac_exeext'
4019   { (eval echo "$as_me:4019: \"$ac_try\"") >&5
4020   (eval $ac_try) 2>&5
4021   ac_status=$?
4022   echo "$as_me:4022: \$? = $ac_status" >&5
4023   (exit $ac_status); }; }; then
4024
4025                                         test -n "$verbose" && echo "    ... found utf8 library in $cf_cv_library_path_utf8" 1>&6
4026
4027 echo "${as_me:-configure}:4027: testing ... found utf8 library in $cf_cv_library_path_utf8 ..." 1>&5
4028
4029                                         cf_cv_find_linkage_utf8=yes
4030                                         cf_cv_library_file_utf8="-lutf8"
4031                                         break
4032 else
4033   echo "$as_me: failed program was:" >&5
4034 cat conftest.$ac_ext >&5
4035
4036                                         CPPFLAGS="$cf_save_CPPFLAGS"
4037                                         LIBS="$cf_save_LIBS"
4038                                         LDFLAGS="$cf_save_LDFLAGS"
4039
4040 fi
4041 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
4042                                 fi
4043                         done
4044                         CPPFLAGS="$cf_save_CPPFLAGS"
4045                         LDFLAGS="$cf_save_LDFLAGS"
4046                 fi
4047
4048         else
4049                 cf_cv_find_linkage_utf8=no
4050         fi
4051
4052 fi
4053 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
4054
4055 fi
4056 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
4057
4058 LIBS="$cf_save_LIBS"
4059
4060 if test "$cf_cv_find_linkage_utf8" = yes ; then
4061 cf_cv_utf8_lib=add-on
4062 else
4063 cf_cv_utf8_lib=no
4064 fi
4065
4066 fi
4067 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
4068 fi
4069 echo "$as_me:4069: result: $cf_cv_utf8_lib" >&5
4070 echo "${ECHO_T}$cf_cv_utf8_lib" >&6
4071
4072 # HAVE_LIBUTF8_H is used by ncurses if curses.h is shared between
4073 # ncurses/ncursesw:
4074 if test "$cf_cv_utf8_lib" = "add-on" ; then
4075
4076 cat >>confdefs.h <<\EOF
4077 #define HAVE_LIBUTF8_H 1
4078 EOF
4079
4080 if test -n "$cf_cv_header_path_utf8" ; then
4081   for cf_add_incdir in $cf_cv_header_path_utf8
4082   do
4083         while test $cf_add_incdir != /usr/include
4084         do
4085           if test -d $cf_add_incdir
4086           then
4087                 cf_have_incdir=no
4088                 if test -n "$CFLAGS$CPPFLAGS" ; then
4089                   # a loop is needed to ensure we can add subdirs of existing dirs
4090                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
4091                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
4092                           cf_have_incdir=yes; break
4093                         fi
4094                   done
4095                 fi
4096
4097                 if test "$cf_have_incdir" = no ; then
4098                   if test "$cf_add_incdir" = /usr/local/include ; then
4099                         if test "$GCC" = yes
4100                         then
4101                           cf_save_CPPFLAGS=$CPPFLAGS
4102                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
4103                           cat >conftest.$ac_ext <<_ACEOF
4104 #line 4104 "configure"
4105 #include "confdefs.h"
4106 #include <stdio.h>
4107 int
4108 main ()
4109 {
4110 printf("Hello")
4111   ;
4112   return 0;
4113 }
4114 _ACEOF
4115 rm -f conftest.$ac_objext
4116 if { (eval echo "$as_me:4116: \"$ac_compile\"") >&5
4117   (eval $ac_compile) 2>&5
4118   ac_status=$?
4119   echo "$as_me:4119: \$? = $ac_status" >&5
4120   (exit $ac_status); } &&
4121          { ac_try='test -s conftest.$ac_objext'
4122   { (eval echo "$as_me:4122: \"$ac_try\"") >&5
4123   (eval $ac_try) 2>&5
4124   ac_status=$?
4125   echo "$as_me:4125: \$? = $ac_status" >&5
4126   (exit $ac_status); }; }; then
4127   :
4128 else
4129   echo "$as_me: failed program was:" >&5
4130 cat conftest.$ac_ext >&5
4131 cf_have_incdir=yes
4132 fi
4133 rm -f conftest.$ac_objext conftest.$ac_ext
4134                           CPPFLAGS=$cf_save_CPPFLAGS
4135                         fi
4136                   fi
4137                 fi
4138
4139                 if test "$cf_have_incdir" = no ; then
4140                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
4141
4142 echo "${as_me:-configure}:4142: testing adding $cf_add_incdir to include-path ..." 1>&5
4143
4144                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
4145
4146                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
4147                   test "$cf_top_incdir" = "$cf_add_incdir" && break
4148                   cf_add_incdir="$cf_top_incdir"
4149                 else
4150                   break
4151                 fi
4152           fi
4153         done
4154   done
4155 fi
4156
4157 if test -n "$cf_cv_library_path_utf8" ; then
4158         for cf_add_libdir in $cf_cv_library_path_utf8
4159         do
4160                 if test $cf_add_libdir = /usr/lib ; then
4161                         :
4162                 elif test -d $cf_add_libdir
4163                 then
4164                         cf_have_libdir=no
4165                         if test -n "$LDFLAGS$LIBS" ; then
4166                                 # a loop is needed to ensure we can add subdirs of existing dirs
4167                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
4168                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
4169                                                 cf_have_libdir=yes; break
4170                                         fi
4171                                 done
4172                         fi
4173                         if test "$cf_have_libdir" = no ; then
4174                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
4175
4176 echo "${as_me:-configure}:4176: testing adding $cf_add_libdir to library-path ..." 1>&5
4177
4178                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
4179                         fi
4180                 fi
4181         done
4182 fi
4183
4184 cf_add_libs="$cf_cv_library_file_utf8"
4185 # Filter out duplicates - this happens with badly-designed ".pc" files...
4186 for cf_add_1lib in $LIBS
4187 do
4188         for cf_add_2lib in $cf_add_libs
4189         do
4190                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
4191                 then
4192                         cf_add_1lib=
4193                         break
4194                 fi
4195         done
4196         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
4197 done
4198 LIBS="$cf_add_libs"
4199
4200 fi
4201
4202 cf_ncuconfig_root=ncursesw
4203
4204 echo "Looking for ${cf_ncuconfig_root}-config"
4205
4206 if test -n "$ac_tool_prefix"; then
4207   for ac_prog in ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
4208   do
4209     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
4210 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
4211 echo "$as_me:4211: checking for $ac_word" >&5
4212 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
4213 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
4214   echo $ECHO_N "(cached) $ECHO_C" >&6
4215 else
4216   if test -n "$NCURSES_CONFIG"; then
4217   ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
4218 else
4219   ac_save_IFS=$IFS; IFS=$ac_path_separator
4220 ac_dummy="$PATH"
4221 for ac_dir in $ac_dummy; do
4222   IFS=$ac_save_IFS
4223   test -z "$ac_dir" && ac_dir=.
4224   $as_executable_p "$ac_dir/$ac_word" || continue
4225 ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
4226 echo "$as_me:4226: found $ac_dir/$ac_word" >&5
4227 break
4228 done
4229
4230 fi
4231 fi
4232 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
4233 if test -n "$NCURSES_CONFIG"; then
4234   echo "$as_me:4234: result: $NCURSES_CONFIG" >&5
4235 echo "${ECHO_T}$NCURSES_CONFIG" >&6
4236 else
4237   echo "$as_me:4237: result: no" >&5
4238 echo "${ECHO_T}no" >&6
4239 fi
4240
4241     test -n "$NCURSES_CONFIG" && break
4242   done
4243 fi
4244 if test -z "$NCURSES_CONFIG"; then
4245   ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
4246   for ac_prog in ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
4247 do
4248   # Extract the first word of "$ac_prog", so it can be a program name with args.
4249 set dummy $ac_prog; ac_word=$2
4250 echo "$as_me:4250: checking for $ac_word" >&5
4251 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
4252 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
4253   echo $ECHO_N "(cached) $ECHO_C" >&6
4254 else
4255   if test -n "$ac_ct_NCURSES_CONFIG"; then
4256   ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
4257 else
4258   ac_save_IFS=$IFS; IFS=$ac_path_separator
4259 ac_dummy="$PATH"
4260 for ac_dir in $ac_dummy; do
4261   IFS=$ac_save_IFS
4262   test -z "$ac_dir" && ac_dir=.
4263   $as_executable_p "$ac_dir/$ac_word" || continue
4264 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
4265 echo "$as_me:4265: found $ac_dir/$ac_word" >&5
4266 break
4267 done
4268
4269 fi
4270 fi
4271 ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
4272 if test -n "$ac_ct_NCURSES_CONFIG"; then
4273   echo "$as_me:4273: result: $ac_ct_NCURSES_CONFIG" >&5
4274 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
4275 else
4276   echo "$as_me:4276: result: no" >&5
4277 echo "${ECHO_T}no" >&6
4278 fi
4279
4280   test -n "$ac_ct_NCURSES_CONFIG" && break
4281 done
4282 test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
4283
4284   NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
4285 fi
4286
4287 if test "$NCURSES_CONFIG" != none ; then
4288
4289 CPPFLAGS="$CPPFLAGS `$NCURSES_CONFIG --cflags`"
4290
4291 cf_add_libs="`$NCURSES_CONFIG --libs`"
4292 # Filter out duplicates - this happens with badly-designed ".pc" files...
4293 for cf_add_1lib in $LIBS
4294 do
4295         for cf_add_2lib in $cf_add_libs
4296         do
4297                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
4298                 then
4299                         cf_add_1lib=
4300                         break
4301                 fi
4302         done
4303         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
4304 done
4305 LIBS="$cf_add_libs"
4306
4307 # even with config script, some packages use no-override for curses.h
4308
4309 echo "$as_me:4309: checking if we have identified curses headers" >&5
4310 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
4311 if test "${cf_cv_ncurses_header+set}" = set; then
4312   echo $ECHO_N "(cached) $ECHO_C" >&6
4313 else
4314
4315 cf_cv_ncurses_header=none
4316 for cf_header in  \
4317         ncursesw/ncurses.h \
4318         ncursesw/curses.h \
4319         ncurses.h \
4320         curses.h
4321 do
4322 cat >conftest.$ac_ext <<_ACEOF
4323 #line 4323 "configure"
4324 #include "confdefs.h"
4325 #include <${cf_header}>
4326 int
4327 main ()
4328 {
4329 initscr(); tgoto("?", 0,0)
4330   ;
4331   return 0;
4332 }
4333 _ACEOF
4334 rm -f conftest.$ac_objext
4335 if { (eval echo "$as_me:4335: \"$ac_compile\"") >&5
4336   (eval $ac_compile) 2>&5
4337   ac_status=$?
4338   echo "$as_me:4338: \$? = $ac_status" >&5
4339   (exit $ac_status); } &&
4340          { ac_try='test -s conftest.$ac_objext'
4341   { (eval echo "$as_me:4341: \"$ac_try\"") >&5
4342   (eval $ac_try) 2>&5
4343   ac_status=$?
4344   echo "$as_me:4344: \$? = $ac_status" >&5
4345   (exit $ac_status); }; }; then
4346   cf_cv_ncurses_header=$cf_header; break
4347 else
4348   echo "$as_me: failed program was:" >&5
4349 cat conftest.$ac_ext >&5
4350 fi
4351 rm -f conftest.$ac_objext conftest.$ac_ext
4352 done
4353
4354 fi
4355 echo "$as_me:4355: result: $cf_cv_ncurses_header" >&5
4356 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
4357
4358 if test "$cf_cv_ncurses_header" = none ; then
4359         { { echo "$as_me:4359: error: No curses header-files found" >&5
4360 echo "$as_me: error: No curses header-files found" >&2;}
4361    { (exit 1); exit 1; }; }
4362 fi
4363
4364 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
4365
4366 for ac_header in $cf_cv_ncurses_header
4367 do
4368 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
4369 echo "$as_me:4369: checking for $ac_header" >&5
4370 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
4371 if eval "test \"\${$as_ac_Header+set}\" = set"; then
4372   echo $ECHO_N "(cached) $ECHO_C" >&6
4373 else
4374   cat >conftest.$ac_ext <<_ACEOF
4375 #line 4375 "configure"
4376 #include "confdefs.h"
4377 #include <$ac_header>
4378 _ACEOF
4379 if { (eval echo "$as_me:4379: \"$ac_cpp conftest.$ac_ext\"") >&5
4380   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
4381   ac_status=$?
4382   egrep -v '^ *\+' conftest.er1 >conftest.err
4383   rm -f conftest.er1
4384   cat conftest.err >&5
4385   echo "$as_me:4385: \$? = $ac_status" >&5
4386   (exit $ac_status); } >/dev/null; then
4387   if test -s conftest.err; then
4388     ac_cpp_err=$ac_c_preproc_warn_flag
4389   else
4390     ac_cpp_err=
4391   fi
4392 else
4393   ac_cpp_err=yes
4394 fi
4395 if test -z "$ac_cpp_err"; then
4396   eval "$as_ac_Header=yes"
4397 else
4398   echo "$as_me: failed program was:" >&5
4399   cat conftest.$ac_ext >&5
4400   eval "$as_ac_Header=no"
4401 fi
4402 rm -f conftest.err conftest.$ac_ext
4403 fi
4404 echo "$as_me:4404: result: `eval echo '${'$as_ac_Header'}'`" >&5
4405 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
4406 if test `eval echo '${'$as_ac_Header'}'` = yes; then
4407   cat >>confdefs.h <<EOF
4408 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
4409 EOF
4410
4411 fi
4412 done
4413
4414 cat >>confdefs.h <<\EOF
4415 #define NCURSES 1
4416 EOF
4417
4418 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
4419
4420 cat >>confdefs.h <<EOF
4421 #define $cf_nculib_ROOT 1
4422 EOF
4423
4424 cf_cv_ncurses_version=`$NCURSES_CONFIG --version`
4425
4426 else
4427
4428 cf_ncuhdr_root=ncursesw
4429
4430 test -n "$cf_cv_curses_dir" && \
4431 test "$cf_cv_curses_dir" != "no" && { \
4432
4433 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
4434   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
4435   do
4436         while test $cf_add_incdir != /usr/include
4437         do
4438           if test -d $cf_add_incdir
4439           then
4440                 cf_have_incdir=no
4441                 if test -n "$CFLAGS$CPPFLAGS" ; then
4442                   # a loop is needed to ensure we can add subdirs of existing dirs
4443                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
4444                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
4445                           cf_have_incdir=yes; break
4446                         fi
4447                   done
4448                 fi
4449
4450                 if test "$cf_have_incdir" = no ; then
4451                   if test "$cf_add_incdir" = /usr/local/include ; then
4452                         if test "$GCC" = yes
4453                         then
4454                           cf_save_CPPFLAGS=$CPPFLAGS
4455                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
4456                           cat >conftest.$ac_ext <<_ACEOF
4457 #line 4457 "configure"
4458 #include "confdefs.h"
4459 #include <stdio.h>
4460 int
4461 main ()
4462 {
4463 printf("Hello")
4464   ;
4465   return 0;
4466 }
4467 _ACEOF
4468 rm -f conftest.$ac_objext
4469 if { (eval echo "$as_me:4469: \"$ac_compile\"") >&5
4470   (eval $ac_compile) 2>&5
4471   ac_status=$?
4472   echo "$as_me:4472: \$? = $ac_status" >&5
4473   (exit $ac_status); } &&
4474          { ac_try='test -s conftest.$ac_objext'
4475   { (eval echo "$as_me:4475: \"$ac_try\"") >&5
4476   (eval $ac_try) 2>&5
4477   ac_status=$?
4478   echo "$as_me:4478: \$? = $ac_status" >&5
4479   (exit $ac_status); }; }; then
4480   :
4481 else
4482   echo "$as_me: failed program was:" >&5
4483 cat conftest.$ac_ext >&5
4484 cf_have_incdir=yes
4485 fi
4486 rm -f conftest.$ac_objext conftest.$ac_ext
4487                           CPPFLAGS=$cf_save_CPPFLAGS
4488                         fi
4489                   fi
4490                 fi
4491
4492                 if test "$cf_have_incdir" = no ; then
4493                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
4494
4495 echo "${as_me:-configure}:4495: testing adding $cf_add_incdir to include-path ..." 1>&5
4496
4497                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
4498
4499                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
4500                   test "$cf_top_incdir" = "$cf_add_incdir" && break
4501                   cf_add_incdir="$cf_top_incdir"
4502                 else
4503                   break
4504                 fi
4505           fi
4506         done
4507   done
4508 fi
4509
4510 }
4511
4512 echo "$as_me:4512: checking for $cf_ncuhdr_root header in include-path" >&5
4513 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
4514 if test "${cf_cv_ncurses_h+set}" = set; then
4515   echo $ECHO_N "(cached) $ECHO_C" >&6
4516 else
4517
4518         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
4519         ( test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw ) && cf_header_list="$cf_header_list curses.h ncurses.h"
4520         for cf_header in $cf_header_list
4521         do
4522
4523         cat >conftest.$ac_ext <<_ACEOF
4524 #line 4524 "configure"
4525 #include "confdefs.h"
4526
4527 #define _XOPEN_SOURCE_EXTENDED
4528 #undef  HAVE_LIBUTF8_H  /* in case we used CF_UTF8_LIB */
4529 #define HAVE_LIBUTF8_H  /* to force ncurses' header file to use cchar_t */
4530
4531 #include <$cf_header>
4532 int
4533 main ()
4534 {
4535
4536 #ifdef NCURSES_VERSION
4537
4538 #ifndef WACS_BSSB
4539         make an error
4540 #endif
4541
4542 printf("%s\n", NCURSES_VERSION);
4543 #else
4544 #ifdef __NCURSES_H
4545 printf("old\n");
4546 #else
4547         make an error
4548 #endif
4549 #endif
4550
4551   ;
4552   return 0;
4553 }
4554 _ACEOF
4555 rm -f conftest.$ac_objext
4556 if { (eval echo "$as_me:4556: \"$ac_compile\"") >&5
4557   (eval $ac_compile) 2>&5
4558   ac_status=$?
4559   echo "$as_me:4559: \$? = $ac_status" >&5
4560   (exit $ac_status); } &&
4561          { ac_try='test -s conftest.$ac_objext'
4562   { (eval echo "$as_me:4562: \"$ac_try\"") >&5
4563   (eval $ac_try) 2>&5
4564   ac_status=$?
4565   echo "$as_me:4565: \$? = $ac_status" >&5
4566   (exit $ac_status); }; }; then
4567   cf_cv_ncurses_h=$cf_header
4568
4569 else
4570   echo "$as_me: failed program was:" >&5
4571 cat conftest.$ac_ext >&5
4572 cf_cv_ncurses_h=no
4573 fi
4574 rm -f conftest.$ac_objext conftest.$ac_ext
4575
4576                 test "$cf_cv_ncurses_h" != no && break
4577         done
4578
4579 fi
4580 echo "$as_me:4580: result: $cf_cv_ncurses_h" >&5
4581 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
4582
4583 if test "$cf_cv_ncurses_h" != no ; then
4584         cf_cv_ncurses_header=$cf_cv_ncurses_h
4585 else
4586
4587 echo "$as_me:4587: checking for $cf_ncuhdr_root include-path" >&5
4588 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
4589 if test "${cf_cv_ncurses_h2+set}" = set; then
4590   echo $ECHO_N "(cached) $ECHO_C" >&6
4591 else
4592
4593         test -n "$verbose" && echo
4594
4595 cf_search=
4596
4597 # collect the current set of include-directories from compiler flags
4598 cf_header_path_list=""
4599 if test -n "${CFLAGS}${CPPFLAGS}" ; then
4600         for cf_header_path in $CPPFLAGS $CFLAGS
4601         do
4602                 case $cf_header_path in
4603                 (-I*)
4604                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
4605
4606 test "x$cf_header_path" != "xNONE" && \
4607 test -d "$cf_header_path" && \
4608  {
4609         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
4610         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
4611         test -d $cf_header_path/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
4612         test -d $cf_header_path/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
4613         test -d $cf_header_path/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
4614         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"
4615 }
4616
4617                         cf_header_path_list="$cf_header_path_list $cf_search"
4618                         ;;
4619                 esac
4620         done
4621 fi
4622
4623 # add the variations for the package we are looking for
4624
4625 cf_search=
4626
4627 test "x$prefix" != "xNONE" && \
4628 test -d "$prefix" && \
4629  {
4630         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
4631         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
4632         test -d $prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
4633         test -d $prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
4634         test -d $prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
4635         test -d $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
4636 }
4637
4638 for cf_subdir_prefix in \
4639         /usr \
4640         /usr/local \
4641         /usr/pkg \
4642         /opt \
4643         /opt/local \
4644         $HOME
4645 do
4646
4647 test "x$cf_subdir_prefix" != "x$prefix" && \
4648 test -d "$cf_subdir_prefix" && \
4649 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
4650         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
4651         test -d $cf_subdir_prefix/include &&          cf_search="$cf_search $cf_subdir_prefix/include"
4652         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root"
4653         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root/include"
4654         test -d $cf_subdir_prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include"
4655         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"
4656 }
4657
4658 done
4659
4660 test "$includedir" != NONE && \
4661 test "$includedir" != "/usr/include" && \
4662 test -d "$includedir" && {
4663         test -d $includedir &&    cf_search="$cf_search $includedir"
4664         test -d $includedir/$cf_ncuhdr_root && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
4665 }
4666
4667 test "$oldincludedir" != NONE && \
4668 test "$oldincludedir" != "/usr/include" && \
4669 test -d "$oldincludedir" && {
4670         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
4671         test -d $oldincludedir/$cf_ncuhdr_root && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
4672 }
4673
4674 cf_search="$cf_search $cf_header_path_list"
4675
4676         test -n "$verbose" && echo search path $cf_search
4677         cf_save2_CPPFLAGS="$CPPFLAGS"
4678         for cf_incdir in $cf_search
4679         do
4680
4681 if test -n "$cf_incdir" ; then
4682   for cf_add_incdir in $cf_incdir
4683   do
4684         while test $cf_add_incdir != /usr/include
4685         do
4686           if test -d $cf_add_incdir
4687           then
4688                 cf_have_incdir=no
4689                 if test -n "$CFLAGS$CPPFLAGS" ; then
4690                   # a loop is needed to ensure we can add subdirs of existing dirs
4691                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
4692                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
4693                           cf_have_incdir=yes; break
4694                         fi
4695                   done
4696                 fi
4697
4698                 if test "$cf_have_incdir" = no ; then
4699                   if test "$cf_add_incdir" = /usr/local/include ; then
4700                         if test "$GCC" = yes
4701                         then
4702                           cf_save_CPPFLAGS=$CPPFLAGS
4703                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
4704                           cat >conftest.$ac_ext <<_ACEOF
4705 #line 4705 "configure"
4706 #include "confdefs.h"
4707 #include <stdio.h>
4708 int
4709 main ()
4710 {
4711 printf("Hello")
4712   ;
4713   return 0;
4714 }
4715 _ACEOF
4716 rm -f conftest.$ac_objext
4717 if { (eval echo "$as_me:4717: \"$ac_compile\"") >&5
4718   (eval $ac_compile) 2>&5
4719   ac_status=$?
4720   echo "$as_me:4720: \$? = $ac_status" >&5
4721   (exit $ac_status); } &&
4722          { ac_try='test -s conftest.$ac_objext'
4723   { (eval echo "$as_me:4723: \"$ac_try\"") >&5
4724   (eval $ac_try) 2>&5
4725   ac_status=$?
4726   echo "$as_me:4726: \$? = $ac_status" >&5
4727   (exit $ac_status); }; }; then
4728   :
4729 else
4730   echo "$as_me: failed program was:" >&5
4731 cat conftest.$ac_ext >&5
4732 cf_have_incdir=yes
4733 fi
4734 rm -f conftest.$ac_objext conftest.$ac_ext
4735                           CPPFLAGS=$cf_save_CPPFLAGS
4736                         fi
4737                   fi
4738                 fi
4739
4740                 if test "$cf_have_incdir" = no ; then
4741                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
4742
4743 echo "${as_me:-configure}:4743: testing adding $cf_add_incdir to include-path ..." 1>&5
4744
4745                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
4746
4747                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
4748                   test "$cf_top_incdir" = "$cf_add_incdir" && break
4749                   cf_add_incdir="$cf_top_incdir"
4750                 else
4751                   break
4752                 fi
4753           fi
4754         done
4755   done
4756 fi
4757
4758                 for cf_header in \
4759                         ncurses.h \
4760                         curses.h
4761                 do
4762
4763         cat >conftest.$ac_ext <<_ACEOF
4764 #line 4764 "configure"
4765 #include "confdefs.h"
4766
4767 #include <$cf_header>
4768 int
4769 main ()
4770 {
4771
4772 #ifdef NCURSES_VERSION
4773
4774 printf("%s\n", NCURSES_VERSION);
4775 #else
4776 #ifdef __NCURSES_H
4777 printf("old\n");
4778 #else
4779         make an error
4780 #endif
4781 #endif
4782
4783   ;
4784   return 0;
4785 }
4786 _ACEOF
4787 rm -f conftest.$ac_objext
4788 if { (eval echo "$as_me:4788: \"$ac_compile\"") >&5
4789   (eval $ac_compile) 2>&5
4790   ac_status=$?
4791   echo "$as_me:4791: \$? = $ac_status" >&5
4792   (exit $ac_status); } &&
4793          { ac_try='test -s conftest.$ac_objext'
4794   { (eval echo "$as_me:4794: \"$ac_try\"") >&5
4795   (eval $ac_try) 2>&5
4796   ac_status=$?
4797   echo "$as_me:4797: \$? = $ac_status" >&5
4798   (exit $ac_status); }; }; then
4799   cf_cv_ncurses_h2=$cf_header
4800
4801 else
4802   echo "$as_me: failed program was:" >&5
4803 cat conftest.$ac_ext >&5
4804 cf_cv_ncurses_h2=no
4805 fi
4806 rm -f conftest.$ac_objext conftest.$ac_ext
4807
4808                         if test "$cf_cv_ncurses_h2" != no ; then
4809                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
4810                                 test -n "$verbose" && echo $ac_n "      ... found $ac_c" 1>&6
4811                                 break
4812                         fi
4813                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
4814                 done
4815                 CPPFLAGS="$cf_save2_CPPFLAGS"
4816                 test "$cf_cv_ncurses_h2" != no && break
4817         done
4818         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:4818: error: not found" >&5
4819 echo "$as_me: error: not found" >&2;}
4820    { (exit 1); exit 1; }; }
4821
4822 fi
4823 echo "$as_me:4823: result: $cf_cv_ncurses_h2" >&5
4824 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
4825
4826         cf_1st_incdir=`echo $cf_cv_ncurses_h2 | sed -e 's%/[^/]*$%%'`
4827         cf_cv_ncurses_header=`basename $cf_cv_ncurses_h2`
4828         if test `basename $cf_1st_incdir` = $cf_ncuhdr_root ; then
4829                 cf_cv_ncurses_header=$cf_ncuhdr_root/$cf_cv_ncurses_header
4830         fi
4831
4832 if test -n "$cf_1st_incdir" ; then
4833   for cf_add_incdir in $cf_1st_incdir
4834   do
4835         while test $cf_add_incdir != /usr/include
4836         do
4837           if test -d $cf_add_incdir
4838           then
4839                 cf_have_incdir=no
4840                 if test -n "$CFLAGS$CPPFLAGS" ; then
4841                   # a loop is needed to ensure we can add subdirs of existing dirs
4842                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
4843                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
4844                           cf_have_incdir=yes; break
4845                         fi
4846                   done
4847                 fi
4848
4849                 if test "$cf_have_incdir" = no ; then
4850                   if test "$cf_add_incdir" = /usr/local/include ; then
4851                         if test "$GCC" = yes
4852                         then
4853                           cf_save_CPPFLAGS=$CPPFLAGS
4854                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
4855                           cat >conftest.$ac_ext <<_ACEOF
4856 #line 4856 "configure"
4857 #include "confdefs.h"
4858 #include <stdio.h>
4859 int
4860 main ()
4861 {
4862 printf("Hello")
4863   ;
4864   return 0;
4865 }
4866 _ACEOF
4867 rm -f conftest.$ac_objext
4868 if { (eval echo "$as_me:4868: \"$ac_compile\"") >&5
4869   (eval $ac_compile) 2>&5
4870   ac_status=$?
4871   echo "$as_me:4871: \$? = $ac_status" >&5
4872   (exit $ac_status); } &&
4873          { ac_try='test -s conftest.$ac_objext'
4874   { (eval echo "$as_me:4874: \"$ac_try\"") >&5
4875   (eval $ac_try) 2>&5
4876   ac_status=$?
4877   echo "$as_me:4877: \$? = $ac_status" >&5
4878   (exit $ac_status); }; }; then
4879   :
4880 else
4881   echo "$as_me: failed program was:" >&5
4882 cat conftest.$ac_ext >&5
4883 cf_have_incdir=yes
4884 fi
4885 rm -f conftest.$ac_objext conftest.$ac_ext
4886                           CPPFLAGS=$cf_save_CPPFLAGS
4887                         fi
4888                   fi
4889                 fi
4890
4891                 if test "$cf_have_incdir" = no ; then
4892                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
4893
4894 echo "${as_me:-configure}:4894: testing adding $cf_add_incdir to include-path ..." 1>&5
4895
4896                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
4897
4898                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
4899                   test "$cf_top_incdir" = "$cf_add_incdir" && break
4900                   cf_add_incdir="$cf_top_incdir"
4901                 else
4902                   break
4903                 fi
4904           fi
4905         done
4906   done
4907 fi
4908
4909 fi
4910
4911 # Set definitions to allow ifdef'ing for ncurses.h
4912
4913 case $cf_cv_ncurses_header in
4914 (*ncurses.h)
4915
4916 cat >>confdefs.h <<\EOF
4917 #define HAVE_NCURSES_H 1
4918 EOF
4919
4920         ;;
4921 esac
4922
4923 case $cf_cv_ncurses_header in
4924 (ncurses/curses.h|ncurses/ncurses.h)
4925
4926 cat >>confdefs.h <<\EOF
4927 #define HAVE_NCURSES_NCURSES_H 1
4928 EOF
4929
4930         ;;
4931 (ncursesw/curses.h|ncursesw/ncurses.h)
4932
4933 cat >>confdefs.h <<\EOF
4934 #define HAVE_NCURSESW_NCURSES_H 1
4935 EOF
4936
4937         ;;
4938 esac
4939
4940 echo "$as_me:4940: checking for terminfo header" >&5
4941 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
4942 if test "${cf_cv_term_header+set}" = set; then
4943   echo $ECHO_N "(cached) $ECHO_C" >&6
4944 else
4945
4946 case ${cf_cv_ncurses_header} in
4947 (*/ncurses.h|*/ncursesw.h)
4948         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
4949         ;;
4950 (*)
4951         cf_term_header=term.h
4952         ;;
4953 esac
4954
4955 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
4956 do
4957 cat >conftest.$ac_ext <<_ACEOF
4958 #line 4958 "configure"
4959 #include "confdefs.h"
4960 #include <stdio.h>
4961 #include <${cf_cv_ncurses_header:-curses.h}>
4962 #include <$cf_test>
4963
4964 int
4965 main ()
4966 {
4967 int x = auto_left_margin
4968   ;
4969   return 0;
4970 }
4971 _ACEOF
4972 rm -f conftest.$ac_objext
4973 if { (eval echo "$as_me:4973: \"$ac_compile\"") >&5
4974   (eval $ac_compile) 2>&5
4975   ac_status=$?
4976   echo "$as_me:4976: \$? = $ac_status" >&5
4977   (exit $ac_status); } &&
4978          { ac_try='test -s conftest.$ac_objext'
4979   { (eval echo "$as_me:4979: \"$ac_try\"") >&5
4980   (eval $ac_try) 2>&5
4981   ac_status=$?
4982   echo "$as_me:4982: \$? = $ac_status" >&5
4983   (exit $ac_status); }; }; then
4984
4985         cf_cv_term_header="$cf_test"
4986 else
4987   echo "$as_me: failed program was:" >&5
4988 cat conftest.$ac_ext >&5
4989
4990         cf_cv_term_header=unknown
4991
4992 fi
4993 rm -f conftest.$ac_objext conftest.$ac_ext
4994         test "$cf_cv_term_header" != unknown && break
4995 done
4996
4997 fi
4998 echo "$as_me:4998: result: $cf_cv_term_header" >&5
4999 echo "${ECHO_T}$cf_cv_term_header" >&6
5000
5001 # Set definitions to allow ifdef'ing to accommodate subdirectories
5002
5003 case $cf_cv_term_header in
5004 (*term.h)
5005
5006 cat >>confdefs.h <<\EOF
5007 #define HAVE_TERM_H 1
5008 EOF
5009
5010         ;;
5011 esac
5012
5013 case $cf_cv_term_header in
5014 (ncurses/term.h)
5015
5016 cat >>confdefs.h <<\EOF
5017 #define HAVE_NCURSES_TERM_H 1
5018 EOF
5019
5020         ;;
5021 (ncursesw/term.h)
5022
5023 cat >>confdefs.h <<\EOF
5024 #define HAVE_NCURSESW_TERM_H 1
5025 EOF
5026
5027         ;;
5028 esac
5029
5030 # some applications need this, but should check for NCURSES_VERSION
5031
5032 cat >>confdefs.h <<\EOF
5033 #define NCURSES 1
5034 EOF
5035
5036 echo "$as_me:5036: checking for ncurses version" >&5
5037 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
5038 if test "${cf_cv_ncurses_version+set}" = set; then
5039   echo $ECHO_N "(cached) $ECHO_C" >&6
5040 else
5041
5042         cf_cv_ncurses_version=no
5043         cf_tempfile=out$$
5044         rm -f $cf_tempfile
5045         if test "$cross_compiling" = yes; then
5046
5047         # This will not work if the preprocessor splits the line after the
5048         # Autoconf token.  The 'unproto' program does that.
5049         cat > conftest.$ac_ext <<EOF
5050 #include <${cf_cv_ncurses_header:-curses.h}>
5051 #undef Autoconf
5052 #ifdef NCURSES_VERSION
5053 Autoconf NCURSES_VERSION
5054 #else
5055 #ifdef __NCURSES_H
5056 Autoconf "old"
5057 #endif
5058 ;
5059 #endif
5060 EOF
5061         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
5062         { (eval echo "$as_me:5062: \"$cf_try\"") >&5
5063   (eval $cf_try) 2>&5
5064   ac_status=$?
5065   echo "$as_me:5065: \$? = $ac_status" >&5
5066   (exit $ac_status); }
5067         if test -f conftest.out ; then
5068                 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
5069                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
5070                 rm -f conftest.out
5071         fi
5072
5073 else
5074   cat >conftest.$ac_ext <<_ACEOF
5075 #line 5075 "configure"
5076 #include "confdefs.h"
5077
5078 #include <${cf_cv_ncurses_header:-curses.h}>
5079 #include <stdio.h>
5080 int main()
5081 {
5082         FILE *fp = fopen("$cf_tempfile", "w");
5083 #ifdef NCURSES_VERSION
5084 # ifdef NCURSES_VERSION_PATCH
5085         fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
5086 # else
5087         fprintf(fp, "%s\n", NCURSES_VERSION);
5088 # endif
5089 #else
5090 # ifdef __NCURSES_H
5091         fprintf(fp, "old\n");
5092 # else
5093         make an error
5094 # endif
5095 #endif
5096         ${cf_cv_main_return:-return}(0);
5097 }
5098 _ACEOF
5099 rm -f conftest$ac_exeext
5100 if { (eval echo "$as_me:5100: \"$ac_link\"") >&5
5101   (eval $ac_link) 2>&5
5102   ac_status=$?
5103   echo "$as_me:5103: \$? = $ac_status" >&5
5104   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
5105   { (eval echo "$as_me:5105: \"$ac_try\"") >&5
5106   (eval $ac_try) 2>&5
5107   ac_status=$?
5108   echo "$as_me:5108: \$? = $ac_status" >&5
5109   (exit $ac_status); }; }; then
5110
5111         cf_cv_ncurses_version=`cat $cf_tempfile`
5112 else
5113   echo "$as_me: program exited with status $ac_status" >&5
5114 echo "$as_me: failed program was:" >&5
5115 cat conftest.$ac_ext >&5
5116 fi
5117 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
5118 fi
5119         rm -f $cf_tempfile
5120
5121 fi
5122 echo "$as_me:5122: result: $cf_cv_ncurses_version" >&5
5123 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
5124 test "$cf_cv_ncurses_version" = no ||
5125 cat >>confdefs.h <<\EOF
5126 #define NCURSES 1
5127 EOF
5128
5129 cf_nculib_root=ncursesw
5130         # This works, except for the special case where we find gpm, but
5131         # ncurses is in a nonstandard location via $LIBS, and we really want
5132         # to link gpm.
5133 cf_ncurses_LIBS=""
5134 cf_ncurses_SAVE="$LIBS"
5135 echo "$as_me:5135: checking for Gpm_Open in -lgpm" >&5
5136 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
5137 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
5138   echo $ECHO_N "(cached) $ECHO_C" >&6
5139 else
5140   ac_check_lib_save_LIBS=$LIBS
5141 LIBS="-lgpm  $LIBS"
5142 cat >conftest.$ac_ext <<_ACEOF
5143 #line 5143 "configure"
5144 #include "confdefs.h"
5145
5146 /* Override any gcc2 internal prototype to avoid an error.  */
5147 #ifdef __cplusplus
5148 extern "C"
5149 #endif
5150 /* We use char because int might match the return type of a gcc2
5151    builtin and then its argument prototype would still apply.  */
5152 char Gpm_Open ();
5153 int
5154 main ()
5155 {
5156 Gpm_Open ();
5157   ;
5158   return 0;
5159 }
5160 _ACEOF
5161 rm -f conftest.$ac_objext conftest$ac_exeext
5162 if { (eval echo "$as_me:5162: \"$ac_link\"") >&5
5163   (eval $ac_link) 2>&5
5164   ac_status=$?
5165   echo "$as_me:5165: \$? = $ac_status" >&5
5166   (exit $ac_status); } &&
5167          { ac_try='test -s conftest$ac_exeext'
5168   { (eval echo "$as_me:5168: \"$ac_try\"") >&5
5169   (eval $ac_try) 2>&5
5170   ac_status=$?
5171   echo "$as_me:5171: \$? = $ac_status" >&5
5172   (exit $ac_status); }; }; then
5173   ac_cv_lib_gpm_Gpm_Open=yes
5174 else
5175   echo "$as_me: failed program was:" >&5
5176 cat conftest.$ac_ext >&5
5177 ac_cv_lib_gpm_Gpm_Open=no
5178 fi
5179 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5180 LIBS=$ac_check_lib_save_LIBS
5181 fi
5182 echo "$as_me:5182: result: $ac_cv_lib_gpm_Gpm_Open" >&5
5183 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
5184 if test $ac_cv_lib_gpm_Gpm_Open = yes; then
5185   echo "$as_me:5185: checking for initscr in -lgpm" >&5
5186 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
5187 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
5188   echo $ECHO_N "(cached) $ECHO_C" >&6
5189 else
5190   ac_check_lib_save_LIBS=$LIBS
5191 LIBS="-lgpm  $LIBS"
5192 cat >conftest.$ac_ext <<_ACEOF
5193 #line 5193 "configure"
5194 #include "confdefs.h"
5195
5196 /* Override any gcc2 internal prototype to avoid an error.  */
5197 #ifdef __cplusplus
5198 extern "C"
5199 #endif
5200 /* We use char because int might match the return type of a gcc2
5201    builtin and then its argument prototype would still apply.  */
5202 char initscr ();
5203 int
5204 main ()
5205 {
5206 initscr ();
5207   ;
5208   return 0;
5209 }
5210 _ACEOF
5211 rm -f conftest.$ac_objext conftest$ac_exeext
5212 if { (eval echo "$as_me:5212: \"$ac_link\"") >&5
5213   (eval $ac_link) 2>&5
5214   ac_status=$?
5215   echo "$as_me:5215: \$? = $ac_status" >&5
5216   (exit $ac_status); } &&
5217          { ac_try='test -s conftest$ac_exeext'
5218   { (eval echo "$as_me:5218: \"$ac_try\"") >&5
5219   (eval $ac_try) 2>&5
5220   ac_status=$?
5221   echo "$as_me:5221: \$? = $ac_status" >&5
5222   (exit $ac_status); }; }; then
5223   ac_cv_lib_gpm_initscr=yes
5224 else
5225   echo "$as_me: failed program was:" >&5
5226 cat conftest.$ac_ext >&5
5227 ac_cv_lib_gpm_initscr=no
5228 fi
5229 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5230 LIBS=$ac_check_lib_save_LIBS
5231 fi
5232 echo "$as_me:5232: result: $ac_cv_lib_gpm_initscr" >&5
5233 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
5234 if test $ac_cv_lib_gpm_initscr = yes; then
5235   LIBS="$cf_ncurses_SAVE"
5236 else
5237   cf_ncurses_LIBS="-lgpm"
5238 fi
5239
5240 fi
5241
5242 case $host_os in
5243 (freebsd*)
5244         # This is only necessary if you are linking against an obsolete
5245         # version of ncurses (but it should do no harm, since it's static).
5246         if test "$cf_nculib_root" = ncurses ; then
5247                 echo "$as_me:5247: checking for tgoto in -lmytinfo" >&5
5248 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
5249 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
5250   echo $ECHO_N "(cached) $ECHO_C" >&6
5251 else
5252   ac_check_lib_save_LIBS=$LIBS
5253 LIBS="-lmytinfo  $LIBS"
5254 cat >conftest.$ac_ext <<_ACEOF
5255 #line 5255 "configure"
5256 #include "confdefs.h"
5257
5258 /* Override any gcc2 internal prototype to avoid an error.  */
5259 #ifdef __cplusplus
5260 extern "C"
5261 #endif
5262 /* We use char because int might match the return type of a gcc2
5263    builtin and then its argument prototype would still apply.  */
5264 char tgoto ();
5265 int
5266 main ()
5267 {
5268 tgoto ();
5269   ;
5270   return 0;
5271 }
5272 _ACEOF
5273 rm -f conftest.$ac_objext conftest$ac_exeext
5274 if { (eval echo "$as_me:5274: \"$ac_link\"") >&5
5275   (eval $ac_link) 2>&5
5276   ac_status=$?
5277   echo "$as_me:5277: \$? = $ac_status" >&5
5278   (exit $ac_status); } &&
5279          { ac_try='test -s conftest$ac_exeext'
5280   { (eval echo "$as_me:5280: \"$ac_try\"") >&5
5281   (eval $ac_try) 2>&5
5282   ac_status=$?
5283   echo "$as_me:5283: \$? = $ac_status" >&5
5284   (exit $ac_status); }; }; then
5285   ac_cv_lib_mytinfo_tgoto=yes
5286 else
5287   echo "$as_me: failed program was:" >&5
5288 cat conftest.$ac_ext >&5
5289 ac_cv_lib_mytinfo_tgoto=no
5290 fi
5291 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5292 LIBS=$ac_check_lib_save_LIBS
5293 fi
5294 echo "$as_me:5294: result: $ac_cv_lib_mytinfo_tgoto" >&5
5295 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
5296 if test $ac_cv_lib_mytinfo_tgoto = yes; then
5297   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
5298 fi
5299
5300         fi
5301         ;;
5302 esac
5303
5304 cf_add_libs="$cf_ncurses_LIBS"
5305 # Filter out duplicates - this happens with badly-designed ".pc" files...
5306 for cf_add_1lib in $LIBS
5307 do
5308         for cf_add_2lib in $cf_add_libs
5309         do
5310                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
5311                 then
5312                         cf_add_1lib=
5313                         break
5314                 fi
5315         done
5316         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
5317 done
5318 LIBS="$cf_add_libs"
5319
5320 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
5321 then
5322
5323 cf_add_libs="-l$cf_nculib_root"
5324 # Filter out duplicates - this happens with badly-designed ".pc" files...
5325 for cf_add_1lib in $LIBS
5326 do
5327         for cf_add_2lib in $cf_add_libs
5328         do
5329                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
5330                 then
5331                         cf_add_1lib=
5332                         break
5333                 fi
5334         done
5335         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
5336 done
5337 LIBS="$cf_add_libs"
5338
5339 else
5340
5341         eval 'cf_cv_have_lib_'$cf_nculib_root'=no'
5342         cf_libdir=""
5343         echo "$as_me:5343: checking for initscr" >&5
5344 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
5345 if test "${ac_cv_func_initscr+set}" = set; then
5346   echo $ECHO_N "(cached) $ECHO_C" >&6
5347 else
5348   cat >conftest.$ac_ext <<_ACEOF
5349 #line 5349 "configure"
5350 #include "confdefs.h"
5351 /* System header to define __stub macros and hopefully few prototypes,
5352     which can conflict with char initscr (); below.  */
5353 #include <assert.h>
5354 /* Override any gcc2 internal prototype to avoid an error.  */
5355 #ifdef __cplusplus
5356 extern "C"
5357 #endif
5358 /* We use char because int might match the return type of a gcc2
5359    builtin and then its argument prototype would still apply.  */
5360 char initscr ();
5361 char (*f) ();
5362
5363 int
5364 main ()
5365 {
5366 /* The GNU C library defines this for functions which it implements
5367     to always fail with ENOSYS.  Some functions are actually named
5368     something starting with __ and the normal name is an alias.  */
5369 #if defined (__stub_initscr) || defined (__stub___initscr)
5370 choke me
5371 #else
5372 f = initscr; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
5373 #endif
5374
5375   ;
5376   return 0;
5377 }
5378 _ACEOF
5379 rm -f conftest.$ac_objext conftest$ac_exeext
5380 if { (eval echo "$as_me:5380: \"$ac_link\"") >&5
5381   (eval $ac_link) 2>&5
5382   ac_status=$?
5383   echo "$as_me:5383: \$? = $ac_status" >&5
5384   (exit $ac_status); } &&
5385          { ac_try='test -s conftest$ac_exeext'
5386   { (eval echo "$as_me:5386: \"$ac_try\"") >&5
5387   (eval $ac_try) 2>&5
5388   ac_status=$?
5389   echo "$as_me:5389: \$? = $ac_status" >&5
5390   (exit $ac_status); }; }; then
5391   ac_cv_func_initscr=yes
5392 else
5393   echo "$as_me: failed program was:" >&5
5394 cat conftest.$ac_ext >&5
5395 ac_cv_func_initscr=no
5396 fi
5397 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5398 fi
5399 echo "$as_me:5399: result: $ac_cv_func_initscr" >&5
5400 echo "${ECHO_T}$ac_cv_func_initscr" >&6
5401 if test $ac_cv_func_initscr = yes; then
5402   eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
5403 else
5404
5405                 cf_save_LIBS="$LIBS"
5406                 echo "$as_me:5406: checking for initscr in -l$cf_nculib_root" >&5
5407 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
5408                 LIBS="-l$cf_nculib_root $LIBS"
5409                 cat >conftest.$ac_ext <<_ACEOF
5410 #line 5410 "configure"
5411 #include "confdefs.h"
5412 #include <${cf_cv_ncurses_header:-curses.h}>
5413 int
5414 main ()
5415 {
5416 initscr()
5417   ;
5418   return 0;
5419 }
5420 _ACEOF
5421 rm -f conftest.$ac_objext conftest$ac_exeext
5422 if { (eval echo "$as_me:5422: \"$ac_link\"") >&5
5423   (eval $ac_link) 2>&5
5424   ac_status=$?
5425   echo "$as_me:5425: \$? = $ac_status" >&5
5426   (exit $ac_status); } &&
5427          { ac_try='test -s conftest$ac_exeext'
5428   { (eval echo "$as_me:5428: \"$ac_try\"") >&5
5429   (eval $ac_try) 2>&5
5430   ac_status=$?
5431   echo "$as_me:5431: \$? = $ac_status" >&5
5432   (exit $ac_status); }; }; then
5433   echo "$as_me:5433: result: yes" >&5
5434 echo "${ECHO_T}yes" >&6
5435                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
5436
5437 else
5438   echo "$as_me: failed program was:" >&5
5439 cat conftest.$ac_ext >&5
5440 echo "$as_me:5440: result: no" >&5
5441 echo "${ECHO_T}no" >&6
5442
5443 cf_search=
5444 cf_library_path_list=""
5445 if test -n "${LDFLAGS}${LIBS}" ; then
5446         for cf_library_path in $LDFLAGS $LIBS
5447         do
5448                 case $cf_library_path in
5449                 (-L*)
5450                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
5451
5452 test "x$cf_library_path" != "xNONE" && \
5453 test -d "$cf_library_path" && \
5454  {
5455         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
5456         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
5457         test -d $cf_library_path/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
5458         test -d $cf_library_path/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
5459         test -d $cf_library_path/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
5460         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"
5461 }
5462
5463                         cf_library_path_list="$cf_library_path_list $cf_search"
5464                         ;;
5465                 esac
5466         done
5467 fi
5468
5469 cf_search=
5470
5471 test "x$prefix" != "xNONE" && \
5472 test -d "$prefix" && \
5473  {
5474         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
5475         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
5476         test -d $prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
5477         test -d $prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
5478         test -d $prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
5479         test -d $prefix/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
5480 }
5481
5482 for cf_subdir_prefix in \
5483         /usr \
5484         /usr/local \
5485         /usr/pkg \
5486         /opt \
5487         /opt/local \
5488         $HOME
5489 do
5490
5491 test "x$cf_subdir_prefix" != "x$prefix" && \
5492 test -d "$cf_subdir_prefix" && \
5493 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
5494         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
5495         test -d $cf_subdir_prefix/lib &&          cf_search="$cf_search $cf_subdir_prefix/lib"
5496         test -d $cf_subdir_prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root"
5497         test -d $cf_subdir_prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root/lib"
5498         test -d $cf_subdir_prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib"
5499         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"
5500 }
5501
5502 done
5503
5504 cf_search="$cf_library_path_list $cf_search"
5505
5506                         for cf_libdir in $cf_search
5507                         do
5508                                 echo "$as_me:5508: checking for -l$cf_nculib_root in $cf_libdir" >&5
5509 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
5510                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
5511                                 cat >conftest.$ac_ext <<_ACEOF
5512 #line 5512 "configure"
5513 #include "confdefs.h"
5514 #include <${cf_cv_ncurses_header:-curses.h}>
5515 int
5516 main ()
5517 {
5518 initscr()
5519   ;
5520   return 0;
5521 }
5522 _ACEOF
5523 rm -f conftest.$ac_objext conftest$ac_exeext
5524 if { (eval echo "$as_me:5524: \"$ac_link\"") >&5
5525   (eval $ac_link) 2>&5
5526   ac_status=$?
5527   echo "$as_me:5527: \$? = $ac_status" >&5
5528   (exit $ac_status); } &&
5529          { ac_try='test -s conftest$ac_exeext'
5530   { (eval echo "$as_me:5530: \"$ac_try\"") >&5
5531   (eval $ac_try) 2>&5
5532   ac_status=$?
5533   echo "$as_me:5533: \$? = $ac_status" >&5
5534   (exit $ac_status); }; }; then
5535   echo "$as_me:5535: result: yes" >&5
5536 echo "${ECHO_T}yes" >&6
5537                                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
5538                                          break
5539 else
5540   echo "$as_me: failed program was:" >&5
5541 cat conftest.$ac_ext >&5
5542 echo "$as_me:5542: result: no" >&5
5543 echo "${ECHO_T}no" >&6
5544                                          LIBS="$cf_save_LIBS"
5545 fi
5546 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5547                         done
5548
5549 fi
5550 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5551
5552 fi
5553
5554 eval 'cf_found_library=$cf_cv_have_lib_'$cf_nculib_root
5555
5556 if test $cf_found_library = no ; then
5557         { { echo "$as_me:5557: error: Cannot link $cf_nculib_root library" >&5
5558 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
5559    { (exit 1); exit 1; }; }
5560 fi
5561
5562 fi
5563
5564 if test -n "$cf_ncurses_LIBS" ; then
5565         echo "$as_me:5565: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
5566 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
5567         cf_ncurses_SAVE="$LIBS"
5568         for p in $cf_ncurses_LIBS ; do
5569                 q=`echo $LIBS | sed -e "s%$p %%" -e "s%$p$%%"`
5570                 if test "$q" != "$LIBS" ; then
5571                         LIBS="$q"
5572                 fi
5573         done
5574         cat >conftest.$ac_ext <<_ACEOF
5575 #line 5575 "configure"
5576 #include "confdefs.h"
5577 #include <${cf_cv_ncurses_header:-curses.h}>
5578 int
5579 main ()
5580 {
5581 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
5582   ;
5583   return 0;
5584 }
5585 _ACEOF
5586 rm -f conftest.$ac_objext conftest$ac_exeext
5587 if { (eval echo "$as_me:5587: \"$ac_link\"") >&5
5588   (eval $ac_link) 2>&5
5589   ac_status=$?
5590   echo "$as_me:5590: \$? = $ac_status" >&5
5591   (exit $ac_status); } &&
5592          { ac_try='test -s conftest$ac_exeext'
5593   { (eval echo "$as_me:5593: \"$ac_try\"") >&5
5594   (eval $ac_try) 2>&5
5595   ac_status=$?
5596   echo "$as_me:5596: \$? = $ac_status" >&5
5597   (exit $ac_status); }; }; then
5598   echo "$as_me:5598: result: yes" >&5
5599 echo "${ECHO_T}yes" >&6
5600 else
5601   echo "$as_me: failed program was:" >&5
5602 cat conftest.$ac_ext >&5
5603 echo "$as_me:5603: result: no" >&5
5604 echo "${ECHO_T}no" >&6
5605                  LIBS="$cf_ncurses_SAVE"
5606 fi
5607 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5608 fi
5609
5610 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
5611
5612 cat >>confdefs.h <<EOF
5613 #define $cf_nculib_ROOT 1
5614 EOF
5615
5616 fi
5617
5618 else
5619
5620 cf_ncuconfig_root=ncurses
5621
5622 echo "Looking for ${cf_ncuconfig_root}-config"
5623
5624 if test -n "$ac_tool_prefix"; then
5625   for ac_prog in ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
5626   do
5627     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
5628 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
5629 echo "$as_me:5629: checking for $ac_word" >&5
5630 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
5631 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
5632   echo $ECHO_N "(cached) $ECHO_C" >&6
5633 else
5634   if test -n "$NCURSES_CONFIG"; then
5635   ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
5636 else
5637   ac_save_IFS=$IFS; IFS=$ac_path_separator
5638 ac_dummy="$PATH"
5639 for ac_dir in $ac_dummy; do
5640   IFS=$ac_save_IFS
5641   test -z "$ac_dir" && ac_dir=.
5642   $as_executable_p "$ac_dir/$ac_word" || continue
5643 ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
5644 echo "$as_me:5644: found $ac_dir/$ac_word" >&5
5645 break
5646 done
5647
5648 fi
5649 fi
5650 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
5651 if test -n "$NCURSES_CONFIG"; then
5652   echo "$as_me:5652: result: $NCURSES_CONFIG" >&5
5653 echo "${ECHO_T}$NCURSES_CONFIG" >&6
5654 else
5655   echo "$as_me:5655: result: no" >&5
5656 echo "${ECHO_T}no" >&6
5657 fi
5658
5659     test -n "$NCURSES_CONFIG" && break
5660   done
5661 fi
5662 if test -z "$NCURSES_CONFIG"; then
5663   ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
5664   for ac_prog in ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
5665 do
5666   # Extract the first word of "$ac_prog", so it can be a program name with args.
5667 set dummy $ac_prog; ac_word=$2
5668 echo "$as_me:5668: checking for $ac_word" >&5
5669 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
5670 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
5671   echo $ECHO_N "(cached) $ECHO_C" >&6
5672 else
5673   if test -n "$ac_ct_NCURSES_CONFIG"; then
5674   ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
5675 else
5676   ac_save_IFS=$IFS; IFS=$ac_path_separator
5677 ac_dummy="$PATH"
5678 for ac_dir in $ac_dummy; do
5679   IFS=$ac_save_IFS
5680   test -z "$ac_dir" && ac_dir=.
5681   $as_executable_p "$ac_dir/$ac_word" || continue
5682 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
5683 echo "$as_me:5683: found $ac_dir/$ac_word" >&5
5684 break
5685 done
5686
5687 fi
5688 fi
5689 ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
5690 if test -n "$ac_ct_NCURSES_CONFIG"; then
5691   echo "$as_me:5691: result: $ac_ct_NCURSES_CONFIG" >&5
5692 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
5693 else
5694   echo "$as_me:5694: result: no" >&5
5695 echo "${ECHO_T}no" >&6
5696 fi
5697
5698   test -n "$ac_ct_NCURSES_CONFIG" && break
5699 done
5700 test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
5701
5702   NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
5703 fi
5704
5705 if test "$NCURSES_CONFIG" != none ; then
5706
5707 CPPFLAGS="$CPPFLAGS `$NCURSES_CONFIG --cflags`"
5708
5709 cf_add_libs="`$NCURSES_CONFIG --libs`"
5710 # Filter out duplicates - this happens with badly-designed ".pc" files...
5711 for cf_add_1lib in $LIBS
5712 do
5713         for cf_add_2lib in $cf_add_libs
5714         do
5715                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
5716                 then
5717                         cf_add_1lib=
5718                         break
5719                 fi
5720         done
5721         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
5722 done
5723 LIBS="$cf_add_libs"
5724
5725 # even with config script, some packages use no-override for curses.h
5726
5727 echo "$as_me:5727: checking if we have identified curses headers" >&5
5728 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
5729 if test "${cf_cv_ncurses_header+set}" = set; then
5730   echo $ECHO_N "(cached) $ECHO_C" >&6
5731 else
5732
5733 cf_cv_ncurses_header=none
5734 for cf_header in  \
5735         ncurses/ncurses.h \
5736         ncurses/curses.h \
5737         ncurses.h \
5738         curses.h
5739 do
5740 cat >conftest.$ac_ext <<_ACEOF
5741 #line 5741 "configure"
5742 #include "confdefs.h"
5743 #include <${cf_header}>
5744 int
5745 main ()
5746 {
5747 initscr(); tgoto("?", 0,0)
5748   ;
5749   return 0;
5750 }
5751 _ACEOF
5752 rm -f conftest.$ac_objext
5753 if { (eval echo "$as_me:5753: \"$ac_compile\"") >&5
5754   (eval $ac_compile) 2>&5
5755   ac_status=$?
5756   echo "$as_me:5756: \$? = $ac_status" >&5
5757   (exit $ac_status); } &&
5758          { ac_try='test -s conftest.$ac_objext'
5759   { (eval echo "$as_me:5759: \"$ac_try\"") >&5
5760   (eval $ac_try) 2>&5
5761   ac_status=$?
5762   echo "$as_me:5762: \$? = $ac_status" >&5
5763   (exit $ac_status); }; }; then
5764   cf_cv_ncurses_header=$cf_header; break
5765 else
5766   echo "$as_me: failed program was:" >&5
5767 cat conftest.$ac_ext >&5
5768 fi
5769 rm -f conftest.$ac_objext conftest.$ac_ext
5770 done
5771
5772 fi
5773 echo "$as_me:5773: result: $cf_cv_ncurses_header" >&5
5774 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
5775
5776 if test "$cf_cv_ncurses_header" = none ; then
5777         { { echo "$as_me:5777: error: No curses header-files found" >&5
5778 echo "$as_me: error: No curses header-files found" >&2;}
5779    { (exit 1); exit 1; }; }
5780 fi
5781
5782 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
5783
5784 for ac_header in $cf_cv_ncurses_header
5785 do
5786 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
5787 echo "$as_me:5787: checking for $ac_header" >&5
5788 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
5789 if eval "test \"\${$as_ac_Header+set}\" = set"; then
5790   echo $ECHO_N "(cached) $ECHO_C" >&6
5791 else
5792   cat >conftest.$ac_ext <<_ACEOF
5793 #line 5793 "configure"
5794 #include "confdefs.h"
5795 #include <$ac_header>
5796 _ACEOF
5797 if { (eval echo "$as_me:5797: \"$ac_cpp conftest.$ac_ext\"") >&5
5798   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
5799   ac_status=$?
5800   egrep -v '^ *\+' conftest.er1 >conftest.err
5801   rm -f conftest.er1
5802   cat conftest.err >&5
5803   echo "$as_me:5803: \$? = $ac_status" >&5
5804   (exit $ac_status); } >/dev/null; then
5805   if test -s conftest.err; then
5806     ac_cpp_err=$ac_c_preproc_warn_flag
5807   else
5808     ac_cpp_err=
5809   fi
5810 else
5811   ac_cpp_err=yes
5812 fi
5813 if test -z "$ac_cpp_err"; then
5814   eval "$as_ac_Header=yes"
5815 else
5816   echo "$as_me: failed program was:" >&5
5817   cat conftest.$ac_ext >&5
5818   eval "$as_ac_Header=no"
5819 fi
5820 rm -f conftest.err conftest.$ac_ext
5821 fi
5822 echo "$as_me:5822: result: `eval echo '${'$as_ac_Header'}'`" >&5
5823 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
5824 if test `eval echo '${'$as_ac_Header'}'` = yes; then
5825   cat >>confdefs.h <<EOF
5826 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
5827 EOF
5828
5829 fi
5830 done
5831
5832 cat >>confdefs.h <<\EOF
5833 #define NCURSES 1
5834 EOF
5835
5836 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
5837
5838 cat >>confdefs.h <<EOF
5839 #define $cf_nculib_ROOT 1
5840 EOF
5841
5842 cf_cv_ncurses_version=`$NCURSES_CONFIG --version`
5843
5844 else
5845
5846 cf_ncuhdr_root=ncurses
5847
5848 test -n "$cf_cv_curses_dir" && \
5849 test "$cf_cv_curses_dir" != "no" && { \
5850
5851 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
5852   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
5853   do
5854         while test $cf_add_incdir != /usr/include
5855         do
5856           if test -d $cf_add_incdir
5857           then
5858                 cf_have_incdir=no
5859                 if test -n "$CFLAGS$CPPFLAGS" ; then
5860                   # a loop is needed to ensure we can add subdirs of existing dirs
5861                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
5862                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
5863                           cf_have_incdir=yes; break
5864                         fi
5865                   done
5866                 fi
5867
5868                 if test "$cf_have_incdir" = no ; then
5869                   if test "$cf_add_incdir" = /usr/local/include ; then
5870                         if test "$GCC" = yes
5871                         then
5872                           cf_save_CPPFLAGS=$CPPFLAGS
5873                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
5874                           cat >conftest.$ac_ext <<_ACEOF
5875 #line 5875 "configure"
5876 #include "confdefs.h"
5877 #include <stdio.h>
5878 int
5879 main ()
5880 {
5881 printf("Hello")
5882   ;
5883   return 0;
5884 }
5885 _ACEOF
5886 rm -f conftest.$ac_objext
5887 if { (eval echo "$as_me:5887: \"$ac_compile\"") >&5
5888   (eval $ac_compile) 2>&5
5889   ac_status=$?
5890   echo "$as_me:5890: \$? = $ac_status" >&5
5891   (exit $ac_status); } &&
5892          { ac_try='test -s conftest.$ac_objext'
5893   { (eval echo "$as_me:5893: \"$ac_try\"") >&5
5894   (eval $ac_try) 2>&5
5895   ac_status=$?
5896   echo "$as_me:5896: \$? = $ac_status" >&5
5897   (exit $ac_status); }; }; then
5898   :
5899 else
5900   echo "$as_me: failed program was:" >&5
5901 cat conftest.$ac_ext >&5
5902 cf_have_incdir=yes
5903 fi
5904 rm -f conftest.$ac_objext conftest.$ac_ext
5905                           CPPFLAGS=$cf_save_CPPFLAGS
5906                         fi
5907                   fi
5908                 fi
5909
5910                 if test "$cf_have_incdir" = no ; then
5911                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
5912
5913 echo "${as_me:-configure}:5913: testing adding $cf_add_incdir to include-path ..." 1>&5
5914
5915                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
5916
5917                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
5918                   test "$cf_top_incdir" = "$cf_add_incdir" && break
5919                   cf_add_incdir="$cf_top_incdir"
5920                 else
5921                   break
5922                 fi
5923           fi
5924         done
5925   done
5926 fi
5927
5928 }
5929
5930 echo "$as_me:5930: checking for $cf_ncuhdr_root header in include-path" >&5
5931 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
5932 if test "${cf_cv_ncurses_h+set}" = set; then
5933   echo $ECHO_N "(cached) $ECHO_C" >&6
5934 else
5935
5936         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
5937         ( test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw ) && cf_header_list="$cf_header_list curses.h ncurses.h"
5938         for cf_header in $cf_header_list
5939         do
5940
5941         cat >conftest.$ac_ext <<_ACEOF
5942 #line 5942 "configure"
5943 #include "confdefs.h"
5944
5945 #include <$cf_header>
5946 int
5947 main ()
5948 {
5949
5950 #ifdef NCURSES_VERSION
5951
5952 printf("%s\n", NCURSES_VERSION);
5953 #else
5954 #ifdef __NCURSES_H
5955 printf("old\n");
5956 #else
5957         make an error
5958 #endif
5959 #endif
5960
5961   ;
5962   return 0;
5963 }
5964 _ACEOF
5965 rm -f conftest.$ac_objext
5966 if { (eval echo "$as_me:5966: \"$ac_compile\"") >&5
5967   (eval $ac_compile) 2>&5
5968   ac_status=$?
5969   echo "$as_me:5969: \$? = $ac_status" >&5
5970   (exit $ac_status); } &&
5971          { ac_try='test -s conftest.$ac_objext'
5972   { (eval echo "$as_me:5972: \"$ac_try\"") >&5
5973   (eval $ac_try) 2>&5
5974   ac_status=$?
5975   echo "$as_me:5975: \$? = $ac_status" >&5
5976   (exit $ac_status); }; }; then
5977   cf_cv_ncurses_h=$cf_header
5978
5979 else
5980   echo "$as_me: failed program was:" >&5
5981 cat conftest.$ac_ext >&5
5982 cf_cv_ncurses_h=no
5983 fi
5984 rm -f conftest.$ac_objext conftest.$ac_ext
5985
5986                 test "$cf_cv_ncurses_h" != no && break
5987         done
5988
5989 fi
5990 echo "$as_me:5990: result: $cf_cv_ncurses_h" >&5
5991 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
5992
5993 if test "$cf_cv_ncurses_h" != no ; then
5994         cf_cv_ncurses_header=$cf_cv_ncurses_h
5995 else
5996
5997 echo "$as_me:5997: checking for $cf_ncuhdr_root include-path" >&5
5998 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
5999 if test "${cf_cv_ncurses_h2+set}" = set; then
6000   echo $ECHO_N "(cached) $ECHO_C" >&6
6001 else
6002
6003         test -n "$verbose" && echo
6004
6005 cf_search=
6006
6007 # collect the current set of include-directories from compiler flags
6008 cf_header_path_list=""
6009 if test -n "${CFLAGS}${CPPFLAGS}" ; then
6010         for cf_header_path in $CPPFLAGS $CFLAGS
6011         do
6012                 case $cf_header_path in
6013                 (-I*)
6014                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
6015
6016 test "x$cf_header_path" != "xNONE" && \
6017 test -d "$cf_header_path" && \
6018  {
6019         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
6020         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
6021         test -d $cf_header_path/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
6022         test -d $cf_header_path/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
6023         test -d $cf_header_path/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
6024         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"
6025 }
6026
6027                         cf_header_path_list="$cf_header_path_list $cf_search"
6028                         ;;
6029                 esac
6030         done
6031 fi
6032
6033 # add the variations for the package we are looking for
6034
6035 cf_search=
6036
6037 test "x$prefix" != "xNONE" && \
6038 test -d "$prefix" && \
6039  {
6040         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
6041         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
6042         test -d $prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
6043         test -d $prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
6044         test -d $prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
6045         test -d $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
6046 }
6047
6048 for cf_subdir_prefix in \
6049         /usr \
6050         /usr/local \
6051         /usr/pkg \
6052         /opt \
6053         /opt/local \
6054         $HOME
6055 do
6056
6057 test "x$cf_subdir_prefix" != "x$prefix" && \
6058 test -d "$cf_subdir_prefix" && \
6059 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
6060         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
6061         test -d $cf_subdir_prefix/include &&          cf_search="$cf_search $cf_subdir_prefix/include"
6062         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root"
6063         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root/include"
6064         test -d $cf_subdir_prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include"
6065         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"
6066 }
6067
6068 done
6069
6070 test "$includedir" != NONE && \
6071 test "$includedir" != "/usr/include" && \
6072 test -d "$includedir" && {
6073         test -d $includedir &&    cf_search="$cf_search $includedir"
6074         test -d $includedir/$cf_ncuhdr_root && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
6075 }
6076
6077 test "$oldincludedir" != NONE && \
6078 test "$oldincludedir" != "/usr/include" && \
6079 test -d "$oldincludedir" && {
6080         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
6081         test -d $oldincludedir/$cf_ncuhdr_root && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
6082 }
6083
6084 cf_search="$cf_search $cf_header_path_list"
6085
6086         test -n "$verbose" && echo search path $cf_search
6087         cf_save2_CPPFLAGS="$CPPFLAGS"
6088         for cf_incdir in $cf_search
6089         do
6090
6091 if test -n "$cf_incdir" ; then
6092   for cf_add_incdir in $cf_incdir
6093   do
6094         while test $cf_add_incdir != /usr/include
6095         do
6096           if test -d $cf_add_incdir
6097           then
6098                 cf_have_incdir=no
6099                 if test -n "$CFLAGS$CPPFLAGS" ; then
6100                   # a loop is needed to ensure we can add subdirs of existing dirs
6101                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
6102                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
6103                           cf_have_incdir=yes; break
6104                         fi
6105                   done
6106                 fi
6107
6108                 if test "$cf_have_incdir" = no ; then
6109                   if test "$cf_add_incdir" = /usr/local/include ; then
6110                         if test "$GCC" = yes
6111                         then
6112                           cf_save_CPPFLAGS=$CPPFLAGS
6113                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6114                           cat >conftest.$ac_ext <<_ACEOF
6115 #line 6115 "configure"
6116 #include "confdefs.h"
6117 #include <stdio.h>
6118 int
6119 main ()
6120 {
6121 printf("Hello")
6122   ;
6123   return 0;
6124 }
6125 _ACEOF
6126 rm -f conftest.$ac_objext
6127 if { (eval echo "$as_me:6127: \"$ac_compile\"") >&5
6128   (eval $ac_compile) 2>&5
6129   ac_status=$?
6130   echo "$as_me:6130: \$? = $ac_status" >&5
6131   (exit $ac_status); } &&
6132          { ac_try='test -s conftest.$ac_objext'
6133   { (eval echo "$as_me:6133: \"$ac_try\"") >&5
6134   (eval $ac_try) 2>&5
6135   ac_status=$?
6136   echo "$as_me:6136: \$? = $ac_status" >&5
6137   (exit $ac_status); }; }; then
6138   :
6139 else
6140   echo "$as_me: failed program was:" >&5
6141 cat conftest.$ac_ext >&5
6142 cf_have_incdir=yes
6143 fi
6144 rm -f conftest.$ac_objext conftest.$ac_ext
6145                           CPPFLAGS=$cf_save_CPPFLAGS
6146                         fi
6147                   fi
6148                 fi
6149
6150                 if test "$cf_have_incdir" = no ; then
6151                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
6152
6153 echo "${as_me:-configure}:6153: testing adding $cf_add_incdir to include-path ..." 1>&5
6154
6155                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6156
6157                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
6158                   test "$cf_top_incdir" = "$cf_add_incdir" && break
6159                   cf_add_incdir="$cf_top_incdir"
6160                 else
6161                   break
6162                 fi
6163           fi
6164         done
6165   done
6166 fi
6167
6168                 for cf_header in \
6169                         ncurses.h \
6170                         curses.h
6171                 do
6172
6173         cat >conftest.$ac_ext <<_ACEOF
6174 #line 6174 "configure"
6175 #include "confdefs.h"
6176
6177 #include <$cf_header>
6178 int
6179 main ()
6180 {
6181
6182 #ifdef NCURSES_VERSION
6183
6184 printf("%s\n", NCURSES_VERSION);
6185 #else
6186 #ifdef __NCURSES_H
6187 printf("old\n");
6188 #else
6189         make an error
6190 #endif
6191 #endif
6192
6193   ;
6194   return 0;
6195 }
6196 _ACEOF
6197 rm -f conftest.$ac_objext
6198 if { (eval echo "$as_me:6198: \"$ac_compile\"") >&5
6199   (eval $ac_compile) 2>&5
6200   ac_status=$?
6201   echo "$as_me:6201: \$? = $ac_status" >&5
6202   (exit $ac_status); } &&
6203          { ac_try='test -s conftest.$ac_objext'
6204   { (eval echo "$as_me:6204: \"$ac_try\"") >&5
6205   (eval $ac_try) 2>&5
6206   ac_status=$?
6207   echo "$as_me:6207: \$? = $ac_status" >&5
6208   (exit $ac_status); }; }; then
6209   cf_cv_ncurses_h2=$cf_header
6210
6211 else
6212   echo "$as_me: failed program was:" >&5
6213 cat conftest.$ac_ext >&5
6214 cf_cv_ncurses_h2=no
6215 fi
6216 rm -f conftest.$ac_objext conftest.$ac_ext
6217
6218                         if test "$cf_cv_ncurses_h2" != no ; then
6219                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
6220                                 test -n "$verbose" && echo $ac_n "      ... found $ac_c" 1>&6
6221                                 break
6222                         fi
6223                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
6224                 done
6225                 CPPFLAGS="$cf_save2_CPPFLAGS"
6226                 test "$cf_cv_ncurses_h2" != no && break
6227         done
6228         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:6228: error: not found" >&5
6229 echo "$as_me: error: not found" >&2;}
6230    { (exit 1); exit 1; }; }
6231
6232 fi
6233 echo "$as_me:6233: result: $cf_cv_ncurses_h2" >&5
6234 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
6235
6236         cf_1st_incdir=`echo $cf_cv_ncurses_h2 | sed -e 's%/[^/]*$%%'`
6237         cf_cv_ncurses_header=`basename $cf_cv_ncurses_h2`
6238         if test `basename $cf_1st_incdir` = $cf_ncuhdr_root ; then
6239                 cf_cv_ncurses_header=$cf_ncuhdr_root/$cf_cv_ncurses_header
6240         fi
6241
6242 if test -n "$cf_1st_incdir" ; then
6243   for cf_add_incdir in $cf_1st_incdir
6244   do
6245         while test $cf_add_incdir != /usr/include
6246         do
6247           if test -d $cf_add_incdir
6248           then
6249                 cf_have_incdir=no
6250                 if test -n "$CFLAGS$CPPFLAGS" ; then
6251                   # a loop is needed to ensure we can add subdirs of existing dirs
6252                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
6253                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
6254                           cf_have_incdir=yes; break
6255                         fi
6256                   done
6257                 fi
6258
6259                 if test "$cf_have_incdir" = no ; then
6260                   if test "$cf_add_incdir" = /usr/local/include ; then
6261                         if test "$GCC" = yes
6262                         then
6263                           cf_save_CPPFLAGS=$CPPFLAGS
6264                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6265                           cat >conftest.$ac_ext <<_ACEOF
6266 #line 6266 "configure"
6267 #include "confdefs.h"
6268 #include <stdio.h>
6269 int
6270 main ()
6271 {
6272 printf("Hello")
6273   ;
6274   return 0;
6275 }
6276 _ACEOF
6277 rm -f conftest.$ac_objext
6278 if { (eval echo "$as_me:6278: \"$ac_compile\"") >&5
6279   (eval $ac_compile) 2>&5
6280   ac_status=$?
6281   echo "$as_me:6281: \$? = $ac_status" >&5
6282   (exit $ac_status); } &&
6283          { ac_try='test -s conftest.$ac_objext'
6284   { (eval echo "$as_me:6284: \"$ac_try\"") >&5
6285   (eval $ac_try) 2>&5
6286   ac_status=$?
6287   echo "$as_me:6287: \$? = $ac_status" >&5
6288   (exit $ac_status); }; }; then
6289   :
6290 else
6291   echo "$as_me: failed program was:" >&5
6292 cat conftest.$ac_ext >&5
6293 cf_have_incdir=yes
6294 fi
6295 rm -f conftest.$ac_objext conftest.$ac_ext
6296                           CPPFLAGS=$cf_save_CPPFLAGS
6297                         fi
6298                   fi
6299                 fi
6300
6301                 if test "$cf_have_incdir" = no ; then
6302                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
6303
6304 echo "${as_me:-configure}:6304: testing adding $cf_add_incdir to include-path ..." 1>&5
6305
6306                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6307
6308                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
6309                   test "$cf_top_incdir" = "$cf_add_incdir" && break
6310                   cf_add_incdir="$cf_top_incdir"
6311                 else
6312                   break
6313                 fi
6314           fi
6315         done
6316   done
6317 fi
6318
6319 fi
6320
6321 # Set definitions to allow ifdef'ing for ncurses.h
6322
6323 case $cf_cv_ncurses_header in
6324 (*ncurses.h)
6325
6326 cat >>confdefs.h <<\EOF
6327 #define HAVE_NCURSES_H 1
6328 EOF
6329
6330         ;;
6331 esac
6332
6333 case $cf_cv_ncurses_header in
6334 (ncurses/curses.h|ncurses/ncurses.h)
6335
6336 cat >>confdefs.h <<\EOF
6337 #define HAVE_NCURSES_NCURSES_H 1
6338 EOF
6339
6340         ;;
6341 (ncursesw/curses.h|ncursesw/ncurses.h)
6342
6343 cat >>confdefs.h <<\EOF
6344 #define HAVE_NCURSESW_NCURSES_H 1
6345 EOF
6346
6347         ;;
6348 esac
6349
6350 echo "$as_me:6350: checking for terminfo header" >&5
6351 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
6352 if test "${cf_cv_term_header+set}" = set; then
6353   echo $ECHO_N "(cached) $ECHO_C" >&6
6354 else
6355
6356 case ${cf_cv_ncurses_header} in
6357 (*/ncurses.h|*/ncursesw.h)
6358         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
6359         ;;
6360 (*)
6361         cf_term_header=term.h
6362         ;;
6363 esac
6364
6365 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
6366 do
6367 cat >conftest.$ac_ext <<_ACEOF
6368 #line 6368 "configure"
6369 #include "confdefs.h"
6370 #include <stdio.h>
6371 #include <${cf_cv_ncurses_header:-curses.h}>
6372 #include <$cf_test>
6373
6374 int
6375 main ()
6376 {
6377 int x = auto_left_margin
6378   ;
6379   return 0;
6380 }
6381 _ACEOF
6382 rm -f conftest.$ac_objext
6383 if { (eval echo "$as_me:6383: \"$ac_compile\"") >&5
6384   (eval $ac_compile) 2>&5
6385   ac_status=$?
6386   echo "$as_me:6386: \$? = $ac_status" >&5
6387   (exit $ac_status); } &&
6388          { ac_try='test -s conftest.$ac_objext'
6389   { (eval echo "$as_me:6389: \"$ac_try\"") >&5
6390   (eval $ac_try) 2>&5
6391   ac_status=$?
6392   echo "$as_me:6392: \$? = $ac_status" >&5
6393   (exit $ac_status); }; }; then
6394
6395         cf_cv_term_header="$cf_test"
6396 else
6397   echo "$as_me: failed program was:" >&5
6398 cat conftest.$ac_ext >&5
6399
6400         cf_cv_term_header=unknown
6401
6402 fi
6403 rm -f conftest.$ac_objext conftest.$ac_ext
6404         test "$cf_cv_term_header" != unknown && break
6405 done
6406
6407 fi
6408 echo "$as_me:6408: result: $cf_cv_term_header" >&5
6409 echo "${ECHO_T}$cf_cv_term_header" >&6
6410
6411 # Set definitions to allow ifdef'ing to accommodate subdirectories
6412
6413 case $cf_cv_term_header in
6414 (*term.h)
6415
6416 cat >>confdefs.h <<\EOF
6417 #define HAVE_TERM_H 1
6418 EOF
6419
6420         ;;
6421 esac
6422
6423 case $cf_cv_term_header in
6424 (ncurses/term.h)
6425
6426 cat >>confdefs.h <<\EOF
6427 #define HAVE_NCURSES_TERM_H 1
6428 EOF
6429
6430         ;;
6431 (ncursesw/term.h)
6432
6433 cat >>confdefs.h <<\EOF
6434 #define HAVE_NCURSESW_TERM_H 1
6435 EOF
6436
6437         ;;
6438 esac
6439
6440 # some applications need this, but should check for NCURSES_VERSION
6441
6442 cat >>confdefs.h <<\EOF
6443 #define NCURSES 1
6444 EOF
6445
6446 echo "$as_me:6446: checking for ncurses version" >&5
6447 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
6448 if test "${cf_cv_ncurses_version+set}" = set; then
6449   echo $ECHO_N "(cached) $ECHO_C" >&6
6450 else
6451
6452         cf_cv_ncurses_version=no
6453         cf_tempfile=out$$
6454         rm -f $cf_tempfile
6455         if test "$cross_compiling" = yes; then
6456
6457         # This will not work if the preprocessor splits the line after the
6458         # Autoconf token.  The 'unproto' program does that.
6459         cat > conftest.$ac_ext <<EOF
6460 #include <${cf_cv_ncurses_header:-curses.h}>
6461 #undef Autoconf
6462 #ifdef NCURSES_VERSION
6463 Autoconf NCURSES_VERSION
6464 #else
6465 #ifdef __NCURSES_H
6466 Autoconf "old"
6467 #endif
6468 ;
6469 #endif
6470 EOF
6471         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
6472         { (eval echo "$as_me:6472: \"$cf_try\"") >&5
6473   (eval $cf_try) 2>&5
6474   ac_status=$?
6475   echo "$as_me:6475: \$? = $ac_status" >&5
6476   (exit $ac_status); }
6477         if test -f conftest.out ; then
6478                 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
6479                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
6480                 rm -f conftest.out
6481         fi
6482
6483 else
6484   cat >conftest.$ac_ext <<_ACEOF
6485 #line 6485 "configure"
6486 #include "confdefs.h"
6487
6488 #include <${cf_cv_ncurses_header:-curses.h}>
6489 #include <stdio.h>
6490 int main()
6491 {
6492         FILE *fp = fopen("$cf_tempfile", "w");
6493 #ifdef NCURSES_VERSION
6494 # ifdef NCURSES_VERSION_PATCH
6495         fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
6496 # else
6497         fprintf(fp, "%s\n", NCURSES_VERSION);
6498 # endif
6499 #else
6500 # ifdef __NCURSES_H
6501         fprintf(fp, "old\n");
6502 # else
6503         make an error
6504 # endif
6505 #endif
6506         ${cf_cv_main_return:-return}(0);
6507 }
6508 _ACEOF
6509 rm -f conftest$ac_exeext
6510 if { (eval echo "$as_me:6510: \"$ac_link\"") >&5
6511   (eval $ac_link) 2>&5
6512   ac_status=$?
6513   echo "$as_me:6513: \$? = $ac_status" >&5
6514   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
6515   { (eval echo "$as_me:6515: \"$ac_try\"") >&5
6516   (eval $ac_try) 2>&5
6517   ac_status=$?
6518   echo "$as_me:6518: \$? = $ac_status" >&5
6519   (exit $ac_status); }; }; then
6520
6521         cf_cv_ncurses_version=`cat $cf_tempfile`
6522 else
6523   echo "$as_me: program exited with status $ac_status" >&5
6524 echo "$as_me: failed program was:" >&5
6525 cat conftest.$ac_ext >&5
6526 fi
6527 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
6528 fi
6529         rm -f $cf_tempfile
6530
6531 fi
6532 echo "$as_me:6532: result: $cf_cv_ncurses_version" >&5
6533 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
6534 test "$cf_cv_ncurses_version" = no ||
6535 cat >>confdefs.h <<\EOF
6536 #define NCURSES 1
6537 EOF
6538
6539 cf_nculib_root=ncurses
6540         # This works, except for the special case where we find gpm, but
6541         # ncurses is in a nonstandard location via $LIBS, and we really want
6542         # to link gpm.
6543 cf_ncurses_LIBS=""
6544 cf_ncurses_SAVE="$LIBS"
6545 echo "$as_me:6545: checking for Gpm_Open in -lgpm" >&5
6546 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
6547 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
6548   echo $ECHO_N "(cached) $ECHO_C" >&6
6549 else
6550   ac_check_lib_save_LIBS=$LIBS
6551 LIBS="-lgpm  $LIBS"
6552 cat >conftest.$ac_ext <<_ACEOF
6553 #line 6553 "configure"
6554 #include "confdefs.h"
6555
6556 /* Override any gcc2 internal prototype to avoid an error.  */
6557 #ifdef __cplusplus
6558 extern "C"
6559 #endif
6560 /* We use char because int might match the return type of a gcc2
6561    builtin and then its argument prototype would still apply.  */
6562 char Gpm_Open ();
6563 int
6564 main ()
6565 {
6566 Gpm_Open ();
6567   ;
6568   return 0;
6569 }
6570 _ACEOF
6571 rm -f conftest.$ac_objext conftest$ac_exeext
6572 if { (eval echo "$as_me:6572: \"$ac_link\"") >&5
6573   (eval $ac_link) 2>&5
6574   ac_status=$?
6575   echo "$as_me:6575: \$? = $ac_status" >&5
6576   (exit $ac_status); } &&
6577          { ac_try='test -s conftest$ac_exeext'
6578   { (eval echo "$as_me:6578: \"$ac_try\"") >&5
6579   (eval $ac_try) 2>&5
6580   ac_status=$?
6581   echo "$as_me:6581: \$? = $ac_status" >&5
6582   (exit $ac_status); }; }; then
6583   ac_cv_lib_gpm_Gpm_Open=yes
6584 else
6585   echo "$as_me: failed program was:" >&5
6586 cat conftest.$ac_ext >&5
6587 ac_cv_lib_gpm_Gpm_Open=no
6588 fi
6589 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6590 LIBS=$ac_check_lib_save_LIBS
6591 fi
6592 echo "$as_me:6592: result: $ac_cv_lib_gpm_Gpm_Open" >&5
6593 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
6594 if test $ac_cv_lib_gpm_Gpm_Open = yes; then
6595   echo "$as_me:6595: checking for initscr in -lgpm" >&5
6596 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
6597 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
6598   echo $ECHO_N "(cached) $ECHO_C" >&6
6599 else
6600   ac_check_lib_save_LIBS=$LIBS
6601 LIBS="-lgpm  $LIBS"
6602 cat >conftest.$ac_ext <<_ACEOF
6603 #line 6603 "configure"
6604 #include "confdefs.h"
6605
6606 /* Override any gcc2 internal prototype to avoid an error.  */
6607 #ifdef __cplusplus
6608 extern "C"
6609 #endif
6610 /* We use char because int might match the return type of a gcc2
6611    builtin and then its argument prototype would still apply.  */
6612 char initscr ();
6613 int
6614 main ()
6615 {
6616 initscr ();
6617   ;
6618   return 0;
6619 }
6620 _ACEOF
6621 rm -f conftest.$ac_objext conftest$ac_exeext
6622 if { (eval echo "$as_me:6622: \"$ac_link\"") >&5
6623   (eval $ac_link) 2>&5
6624   ac_status=$?
6625   echo "$as_me:6625: \$? = $ac_status" >&5
6626   (exit $ac_status); } &&
6627          { ac_try='test -s conftest$ac_exeext'
6628   { (eval echo "$as_me:6628: \"$ac_try\"") >&5
6629   (eval $ac_try) 2>&5
6630   ac_status=$?
6631   echo "$as_me:6631: \$? = $ac_status" >&5
6632   (exit $ac_status); }; }; then
6633   ac_cv_lib_gpm_initscr=yes
6634 else
6635   echo "$as_me: failed program was:" >&5
6636 cat conftest.$ac_ext >&5
6637 ac_cv_lib_gpm_initscr=no
6638 fi
6639 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6640 LIBS=$ac_check_lib_save_LIBS
6641 fi
6642 echo "$as_me:6642: result: $ac_cv_lib_gpm_initscr" >&5
6643 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
6644 if test $ac_cv_lib_gpm_initscr = yes; then
6645   LIBS="$cf_ncurses_SAVE"
6646 else
6647   cf_ncurses_LIBS="-lgpm"
6648 fi
6649
6650 fi
6651
6652 case $host_os in
6653 (freebsd*)
6654         # This is only necessary if you are linking against an obsolete
6655         # version of ncurses (but it should do no harm, since it's static).
6656         if test "$cf_nculib_root" = ncurses ; then
6657                 echo "$as_me:6657: checking for tgoto in -lmytinfo" >&5
6658 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
6659 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
6660   echo $ECHO_N "(cached) $ECHO_C" >&6
6661 else
6662   ac_check_lib_save_LIBS=$LIBS
6663 LIBS="-lmytinfo  $LIBS"
6664 cat >conftest.$ac_ext <<_ACEOF
6665 #line 6665 "configure"
6666 #include "confdefs.h"
6667
6668 /* Override any gcc2 internal prototype to avoid an error.  */
6669 #ifdef __cplusplus
6670 extern "C"
6671 #endif
6672 /* We use char because int might match the return type of a gcc2
6673    builtin and then its argument prototype would still apply.  */
6674 char tgoto ();
6675 int
6676 main ()
6677 {
6678 tgoto ();
6679   ;
6680   return 0;
6681 }
6682 _ACEOF
6683 rm -f conftest.$ac_objext conftest$ac_exeext
6684 if { (eval echo "$as_me:6684: \"$ac_link\"") >&5
6685   (eval $ac_link) 2>&5
6686   ac_status=$?
6687   echo "$as_me:6687: \$? = $ac_status" >&5
6688   (exit $ac_status); } &&
6689          { ac_try='test -s conftest$ac_exeext'
6690   { (eval echo "$as_me:6690: \"$ac_try\"") >&5
6691   (eval $ac_try) 2>&5
6692   ac_status=$?
6693   echo "$as_me:6693: \$? = $ac_status" >&5
6694   (exit $ac_status); }; }; then
6695   ac_cv_lib_mytinfo_tgoto=yes
6696 else
6697   echo "$as_me: failed program was:" >&5
6698 cat conftest.$ac_ext >&5
6699 ac_cv_lib_mytinfo_tgoto=no
6700 fi
6701 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6702 LIBS=$ac_check_lib_save_LIBS
6703 fi
6704 echo "$as_me:6704: result: $ac_cv_lib_mytinfo_tgoto" >&5
6705 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
6706 if test $ac_cv_lib_mytinfo_tgoto = yes; then
6707   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
6708 fi
6709
6710         fi
6711         ;;
6712 esac
6713
6714 cf_add_libs="$cf_ncurses_LIBS"
6715 # Filter out duplicates - this happens with badly-designed ".pc" files...
6716 for cf_add_1lib in $LIBS
6717 do
6718         for cf_add_2lib in $cf_add_libs
6719         do
6720                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
6721                 then
6722                         cf_add_1lib=
6723                         break
6724                 fi
6725         done
6726         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
6727 done
6728 LIBS="$cf_add_libs"
6729
6730 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
6731 then
6732
6733 cf_add_libs="-l$cf_nculib_root"
6734 # Filter out duplicates - this happens with badly-designed ".pc" files...
6735 for cf_add_1lib in $LIBS
6736 do
6737         for cf_add_2lib in $cf_add_libs
6738         do
6739                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
6740                 then
6741                         cf_add_1lib=
6742                         break
6743                 fi
6744         done
6745         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
6746 done
6747 LIBS="$cf_add_libs"
6748
6749 else
6750
6751         eval 'cf_cv_have_lib_'$cf_nculib_root'=no'
6752         cf_libdir=""
6753         echo "$as_me:6753: checking for initscr" >&5
6754 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
6755 if test "${ac_cv_func_initscr+set}" = set; then
6756   echo $ECHO_N "(cached) $ECHO_C" >&6
6757 else
6758   cat >conftest.$ac_ext <<_ACEOF
6759 #line 6759 "configure"
6760 #include "confdefs.h"
6761 /* System header to define __stub macros and hopefully few prototypes,
6762     which can conflict with char initscr (); below.  */
6763 #include <assert.h>
6764 /* Override any gcc2 internal prototype to avoid an error.  */
6765 #ifdef __cplusplus
6766 extern "C"
6767 #endif
6768 /* We use char because int might match the return type of a gcc2
6769    builtin and then its argument prototype would still apply.  */
6770 char initscr ();
6771 char (*f) ();
6772
6773 int
6774 main ()
6775 {
6776 /* The GNU C library defines this for functions which it implements
6777     to always fail with ENOSYS.  Some functions are actually named
6778     something starting with __ and the normal name is an alias.  */
6779 #if defined (__stub_initscr) || defined (__stub___initscr)
6780 choke me
6781 #else
6782 f = initscr; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
6783 #endif
6784
6785   ;
6786   return 0;
6787 }
6788 _ACEOF
6789 rm -f conftest.$ac_objext conftest$ac_exeext
6790 if { (eval echo "$as_me:6790: \"$ac_link\"") >&5
6791   (eval $ac_link) 2>&5
6792   ac_status=$?
6793   echo "$as_me:6793: \$? = $ac_status" >&5
6794   (exit $ac_status); } &&
6795          { ac_try='test -s conftest$ac_exeext'
6796   { (eval echo "$as_me:6796: \"$ac_try\"") >&5
6797   (eval $ac_try) 2>&5
6798   ac_status=$?
6799   echo "$as_me:6799: \$? = $ac_status" >&5
6800   (exit $ac_status); }; }; then
6801   ac_cv_func_initscr=yes
6802 else
6803   echo "$as_me: failed program was:" >&5
6804 cat conftest.$ac_ext >&5
6805 ac_cv_func_initscr=no
6806 fi
6807 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6808 fi
6809 echo "$as_me:6809: result: $ac_cv_func_initscr" >&5
6810 echo "${ECHO_T}$ac_cv_func_initscr" >&6
6811 if test $ac_cv_func_initscr = yes; then
6812   eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
6813 else
6814
6815                 cf_save_LIBS="$LIBS"
6816                 echo "$as_me:6816: checking for initscr in -l$cf_nculib_root" >&5
6817 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
6818                 LIBS="-l$cf_nculib_root $LIBS"
6819                 cat >conftest.$ac_ext <<_ACEOF
6820 #line 6820 "configure"
6821 #include "confdefs.h"
6822 #include <${cf_cv_ncurses_header:-curses.h}>
6823 int
6824 main ()
6825 {
6826 initscr()
6827   ;
6828   return 0;
6829 }
6830 _ACEOF
6831 rm -f conftest.$ac_objext conftest$ac_exeext
6832 if { (eval echo "$as_me:6832: \"$ac_link\"") >&5
6833   (eval $ac_link) 2>&5
6834   ac_status=$?
6835   echo "$as_me:6835: \$? = $ac_status" >&5
6836   (exit $ac_status); } &&
6837          { ac_try='test -s conftest$ac_exeext'
6838   { (eval echo "$as_me:6838: \"$ac_try\"") >&5
6839   (eval $ac_try) 2>&5
6840   ac_status=$?
6841   echo "$as_me:6841: \$? = $ac_status" >&5
6842   (exit $ac_status); }; }; then
6843   echo "$as_me:6843: result: yes" >&5
6844 echo "${ECHO_T}yes" >&6
6845                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
6846
6847 else
6848   echo "$as_me: failed program was:" >&5
6849 cat conftest.$ac_ext >&5
6850 echo "$as_me:6850: result: no" >&5
6851 echo "${ECHO_T}no" >&6
6852
6853 cf_search=
6854 cf_library_path_list=""
6855 if test -n "${LDFLAGS}${LIBS}" ; then
6856         for cf_library_path in $LDFLAGS $LIBS
6857         do
6858                 case $cf_library_path in
6859                 (-L*)
6860                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
6861
6862 test "x$cf_library_path" != "xNONE" && \
6863 test -d "$cf_library_path" && \
6864  {
6865         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
6866         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
6867         test -d $cf_library_path/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
6868         test -d $cf_library_path/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
6869         test -d $cf_library_path/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
6870         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"
6871 }
6872
6873                         cf_library_path_list="$cf_library_path_list $cf_search"
6874                         ;;
6875                 esac
6876         done
6877 fi
6878
6879 cf_search=
6880
6881 test "x$prefix" != "xNONE" && \
6882 test -d "$prefix" && \
6883  {
6884         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
6885         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
6886         test -d $prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
6887         test -d $prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
6888         test -d $prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
6889         test -d $prefix/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
6890 }
6891
6892 for cf_subdir_prefix in \
6893         /usr \
6894         /usr/local \
6895         /usr/pkg \
6896         /opt \
6897         /opt/local \
6898         $HOME
6899 do
6900
6901 test "x$cf_subdir_prefix" != "x$prefix" && \
6902 test -d "$cf_subdir_prefix" && \
6903 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
6904         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
6905         test -d $cf_subdir_prefix/lib &&          cf_search="$cf_search $cf_subdir_prefix/lib"
6906         test -d $cf_subdir_prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root"
6907         test -d $cf_subdir_prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root/lib"
6908         test -d $cf_subdir_prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib"
6909         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"
6910 }
6911
6912 done
6913
6914 cf_search="$cf_library_path_list $cf_search"
6915
6916                         for cf_libdir in $cf_search
6917                         do
6918                                 echo "$as_me:6918: checking for -l$cf_nculib_root in $cf_libdir" >&5
6919 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
6920                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
6921                                 cat >conftest.$ac_ext <<_ACEOF
6922 #line 6922 "configure"
6923 #include "confdefs.h"
6924 #include <${cf_cv_ncurses_header:-curses.h}>
6925 int
6926 main ()
6927 {
6928 initscr()
6929   ;
6930   return 0;
6931 }
6932 _ACEOF
6933 rm -f conftest.$ac_objext conftest$ac_exeext
6934 if { (eval echo "$as_me:6934: \"$ac_link\"") >&5
6935   (eval $ac_link) 2>&5
6936   ac_status=$?
6937   echo "$as_me:6937: \$? = $ac_status" >&5
6938   (exit $ac_status); } &&
6939          { ac_try='test -s conftest$ac_exeext'
6940   { (eval echo "$as_me:6940: \"$ac_try\"") >&5
6941   (eval $ac_try) 2>&5
6942   ac_status=$?
6943   echo "$as_me:6943: \$? = $ac_status" >&5
6944   (exit $ac_status); }; }; then
6945   echo "$as_me:6945: result: yes" >&5
6946 echo "${ECHO_T}yes" >&6
6947                                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
6948                                          break
6949 else
6950   echo "$as_me: failed program was:" >&5
6951 cat conftest.$ac_ext >&5
6952 echo "$as_me:6952: result: no" >&5
6953 echo "${ECHO_T}no" >&6
6954                                          LIBS="$cf_save_LIBS"
6955 fi
6956 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6957                         done
6958
6959 fi
6960 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6961
6962 fi
6963
6964 eval 'cf_found_library=$cf_cv_have_lib_'$cf_nculib_root
6965
6966 if test $cf_found_library = no ; then
6967         { { echo "$as_me:6967: error: Cannot link $cf_nculib_root library" >&5
6968 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
6969    { (exit 1); exit 1; }; }
6970 fi
6971
6972 fi
6973
6974 if test -n "$cf_ncurses_LIBS" ; then
6975         echo "$as_me:6975: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
6976 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
6977         cf_ncurses_SAVE="$LIBS"
6978         for p in $cf_ncurses_LIBS ; do
6979                 q=`echo $LIBS | sed -e "s%$p %%" -e "s%$p$%%"`
6980                 if test "$q" != "$LIBS" ; then
6981                         LIBS="$q"
6982                 fi
6983         done
6984         cat >conftest.$ac_ext <<_ACEOF
6985 #line 6985 "configure"
6986 #include "confdefs.h"
6987 #include <${cf_cv_ncurses_header:-curses.h}>
6988 int
6989 main ()
6990 {
6991 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
6992   ;
6993   return 0;
6994 }
6995 _ACEOF
6996 rm -f conftest.$ac_objext conftest$ac_exeext
6997 if { (eval echo "$as_me:6997: \"$ac_link\"") >&5
6998   (eval $ac_link) 2>&5
6999   ac_status=$?
7000   echo "$as_me:7000: \$? = $ac_status" >&5
7001   (exit $ac_status); } &&
7002          { ac_try='test -s conftest$ac_exeext'
7003   { (eval echo "$as_me:7003: \"$ac_try\"") >&5
7004   (eval $ac_try) 2>&5
7005   ac_status=$?
7006   echo "$as_me:7006: \$? = $ac_status" >&5
7007   (exit $ac_status); }; }; then
7008   echo "$as_me:7008: result: yes" >&5
7009 echo "${ECHO_T}yes" >&6
7010 else
7011   echo "$as_me: failed program was:" >&5
7012 cat conftest.$ac_ext >&5
7013 echo "$as_me:7013: result: no" >&5
7014 echo "${ECHO_T}no" >&6
7015                  LIBS="$cf_ncurses_SAVE"
7016 fi
7017 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7018 fi
7019
7020 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
7021
7022 cat >>confdefs.h <<EOF
7023 #define $cf_nculib_ROOT 1
7024 EOF
7025
7026 fi
7027
7028 fi
7029
7030 if test "$NCURSES_CONFIG" != none ; then
7031
7032 cf_version=`$NCURSES_CONFIG --version`
7033
7034 NCURSES_MAJOR=`echo "$cf_version" | sed -e 's/\..*//'`
7035 NCURSES_MINOR=`echo "$cf_version" | sed -e 's/^[0-9][0-9]*\.//' -e 's/\..*//'`
7036 NCURSES_PATCH=`echo "$cf_version" | sed -e 's/^[0-9][0-9]*\.[0-9][0-9]*\.//'`
7037
7038 # ABI version is not available from headers
7039 cf_cv_abi_version=`$NCURSES_CONFIG --abi-version`
7040
7041 else
7042
7043 for cf_name in MAJOR MINOR PATCH
7044 do
7045 cat >conftest.$ac_ext <<CF_EOF
7046 #include <${cf_cv_ncurses_header:-curses.h}>
7047 AUTOCONF_$cf_name NCURSES_VERSION_$cf_name
7048 CF_EOF
7049         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | fgrep AUTOCONF_$cf_name >conftest.out"
7050         { (eval echo "$as_me:7050: \"$cf_try\"") >&5
7051   (eval $cf_try) 2>&5
7052   ac_status=$?
7053   echo "$as_me:7053: \$? = $ac_status" >&5
7054   (exit $ac_status); }
7055         if test -f conftest.out ; then
7056                 cf_result=`cat conftest.out | sed -e "s/^.*AUTOCONF_$cf_name[   ][      ]*//"`
7057                 eval NCURSES_$cf_name=\"$cf_result\"
7058                 # cat conftest.$ac_ext
7059                 # cat conftest.out
7060         fi
7061 done
7062
7063 cf_cv_abi_version=${NCURSES_MAJOR}
7064
7065 fi
7066
7067 cf_cv_rel_version=${NCURSES_MAJOR}.${NCURSES_MINOR}
7068
7069 cf_cv_timestamp=`date`
7070
7071 echo "$as_me:7071: result: Configuring NCURSES $cf_cv_rel_version ABI $cf_cv_abi_version ($cf_cv_timestamp)" >&5
7072 echo "${ECHO_T}Configuring NCURSES $cf_cv_rel_version ABI $cf_cv_abi_version ($cf_cv_timestamp)" >&6
7073
7074 echo "$as_me:7074: checking if you want to have a library-prefix" >&5
7075 echo $ECHO_N "checking if you want to have a library-prefix... $ECHO_C" >&6
7076
7077 # Check whether --with-lib-prefix or --without-lib-prefix was given.
7078 if test "${with_lib_prefix+set}" = set; then
7079   withval="$with_lib_prefix"
7080   with_lib_prefix=$withval
7081 else
7082   with_lib_prefix=auto
7083 fi;
7084 echo "$as_me:7084: result: $with_lib_prefix" >&5
7085 echo "${ECHO_T}$with_lib_prefix" >&6
7086
7087 if test $with_lib_prefix = auto
7088 then
7089
7090         case $cf_cv_system_name in
7091         (OS/2*|os2*)
7092                 LIB_PREFIX=''
7093                 ;;
7094         (*)     LIB_PREFIX='lib'
7095                 ;;
7096         esac
7097 cf_prefix=$LIB_PREFIX
7098
7099 elif test $with_lib_prefix = no
7100 then
7101         LIB_PREFIX=
7102 else
7103         LIB_PREFIX=$with_lib_prefix
7104 fi
7105
7106 LIB_SUFFIX=
7107
7108 ###############################################################################
7109
7110 if test X"$CC_G_OPT" = X"" ; then
7111         CC_G_OPT='-g'
7112         test -n "$GCC" && test "${ac_cv_prog_cc_g}" != yes && CC_G_OPT=''
7113 fi
7114
7115 echo "$as_me:7115: checking for default loader flags" >&5
7116 echo $ECHO_N "checking for default loader flags... $ECHO_C" >&6
7117 case $DFT_LWR_MODEL in
7118 (normal)  LD_MODEL=''   ;;
7119 (debug)   LD_MODEL=$CC_G_OPT ;;
7120 (profile) LD_MODEL='-pg';;
7121 (shared)  LD_MODEL=''   ;;
7122 esac
7123 echo "$as_me:7123: result: $LD_MODEL" >&5
7124 echo "${ECHO_T}$LD_MODEL" >&6
7125
7126 LD_RPATH_OPT=
7127 echo "$as_me:7127: checking for an rpath option" >&5
7128 echo $ECHO_N "checking for an rpath option... $ECHO_C" >&6
7129 case $cf_cv_system_name in
7130 (irix*)
7131         if test "$GCC" = yes; then
7132                 LD_RPATH_OPT="-Wl,-rpath,"
7133         else
7134                 LD_RPATH_OPT="-rpath "
7135         fi
7136         ;;
7137 (linux*|gnu*|k*bsd*-gnu)
7138         LD_RPATH_OPT="-Wl,-rpath,"
7139         ;;
7140 (openbsd[2-9].*|mirbsd*)
7141         LD_RPATH_OPT="-Wl,-rpath,"
7142         ;;
7143 (dragonfly*|freebsd*)
7144         LD_RPATH_OPT="-rpath "
7145         ;;
7146 (netbsd*)
7147         LD_RPATH_OPT="-Wl,-rpath,"
7148         ;;
7149 (osf*|mls+*)
7150         LD_RPATH_OPT="-rpath "
7151         ;;
7152 (solaris2*)
7153         LD_RPATH_OPT="-R"
7154         ;;
7155 (*)
7156         ;;
7157 esac
7158 echo "$as_me:7158: result: $LD_RPATH_OPT" >&5
7159 echo "${ECHO_T}$LD_RPATH_OPT" >&6
7160
7161 case "x$LD_RPATH_OPT" in
7162 (x-R*)
7163         echo "$as_me:7163: checking if we need a space after rpath option" >&5
7164 echo $ECHO_N "checking if we need a space after rpath option... $ECHO_C" >&6
7165         cf_save_LIBS="$LIBS"
7166
7167 cf_add_libs="${LD_RPATH_OPT}$libdir"
7168 # Filter out duplicates - this happens with badly-designed ".pc" files...
7169 for cf_add_1lib in $LIBS
7170 do
7171         for cf_add_2lib in $cf_add_libs
7172         do
7173                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
7174                 then
7175                         cf_add_1lib=
7176                         break
7177                 fi
7178         done
7179         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
7180 done
7181 LIBS="$cf_add_libs"
7182
7183         cat >conftest.$ac_ext <<_ACEOF
7184 #line 7184 "configure"
7185 #include "confdefs.h"
7186
7187 int
7188 main ()
7189 {
7190
7191   ;
7192   return 0;
7193 }
7194 _ACEOF
7195 rm -f conftest.$ac_objext conftest$ac_exeext
7196 if { (eval echo "$as_me:7196: \"$ac_link\"") >&5
7197   (eval $ac_link) 2>&5
7198   ac_status=$?
7199   echo "$as_me:7199: \$? = $ac_status" >&5
7200   (exit $ac_status); } &&
7201          { ac_try='test -s conftest$ac_exeext'
7202   { (eval echo "$as_me:7202: \"$ac_try\"") >&5
7203   (eval $ac_try) 2>&5
7204   ac_status=$?
7205   echo "$as_me:7205: \$? = $ac_status" >&5
7206   (exit $ac_status); }; }; then
7207   cf_rpath_space=no
7208 else
7209   echo "$as_me: failed program was:" >&5
7210 cat conftest.$ac_ext >&5
7211 cf_rpath_space=yes
7212 fi
7213 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7214         LIBS="$cf_save_LIBS"
7215         echo "$as_me:7215: result: $cf_rpath_space" >&5
7216 echo "${ECHO_T}$cf_rpath_space" >&6
7217         test "$cf_rpath_space" = yes && LD_RPATH_OPT="$LD_RPATH_OPT "
7218         ;;
7219 esac
7220
7221         RM_SHARED_OPTS=
7222         LOCAL_LDFLAGS=
7223         LOCAL_LDFLAGS2=
7224         LD_SHARED_OPTS=
7225         INSTALL_LIB="-m 644"
7226         : ${rel_builddir:=.}
7227
7228         shlibdir=$libdir
7229
7230         MAKE_DLLS="#"
7231
7232         cf_cv_do_symlinks=no
7233         cf_ld_rpath_opt=
7234         test "$cf_cv_enable_rpath" = yes && cf_ld_rpath_opt="$LD_RPATH_OPT"
7235
7236         echo "$as_me:7236: checking if release/abi version should be used for shared libs" >&5
7237 echo $ECHO_N "checking if release/abi version should be used for shared libs... $ECHO_C" >&6
7238
7239 # Check whether --with-shlib-version or --without-shlib-version was given.
7240 if test "${with_shlib_version+set}" = set; then
7241   withval="$with_shlib_version"
7242   test -z "$withval" && withval=auto
7243         case $withval in
7244         (yes)
7245                 cf_cv_shlib_version=auto
7246                 ;;
7247         (rel|abi|auto|no)
7248                 cf_cv_shlib_version=$withval
7249                 ;;
7250         (*)
7251                 { { echo "$as_me:7251: error: option value must be one of: rel, abi, auto or no" >&5
7252 echo "$as_me: error: option value must be one of: rel, abi, auto or no" >&2;}
7253    { (exit 1); exit 1; }; }
7254                 ;;
7255         esac
7256
7257 else
7258   cf_cv_shlib_version=auto
7259 fi;
7260         echo "$as_me:7260: result: $cf_cv_shlib_version" >&5
7261 echo "${ECHO_T}$cf_cv_shlib_version" >&6
7262
7263         cf_cv_rm_so_locs=no
7264         cf_try_cflags=
7265
7266         # Some less-capable ports of gcc support only -fpic
7267         CC_SHARED_OPTS=
7268         if test "$GCC" = yes
7269         then
7270                 echo "$as_me:7270: checking which $CC option to use" >&5
7271 echo $ECHO_N "checking which $CC option to use... $ECHO_C" >&6
7272                 cf_save_CFLAGS="$CFLAGS"
7273                 for CC_SHARED_OPTS in -fPIC -fpic ''
7274                 do
7275                         CFLAGS="$cf_save_CFLAGS $CC_SHARED_OPTS"
7276                         cat >conftest.$ac_ext <<_ACEOF
7277 #line 7277 "configure"
7278 #include "confdefs.h"
7279 #include <stdio.h>
7280 int
7281 main ()
7282 {
7283 int x = 1
7284   ;
7285   return 0;
7286 }
7287 _ACEOF
7288 rm -f conftest.$ac_objext
7289 if { (eval echo "$as_me:7289: \"$ac_compile\"") >&5
7290   (eval $ac_compile) 2>&5
7291   ac_status=$?
7292   echo "$as_me:7292: \$? = $ac_status" >&5
7293   (exit $ac_status); } &&
7294          { ac_try='test -s conftest.$ac_objext'
7295   { (eval echo "$as_me:7295: \"$ac_try\"") >&5
7296   (eval $ac_try) 2>&5
7297   ac_status=$?
7298   echo "$as_me:7298: \$? = $ac_status" >&5
7299   (exit $ac_status); }; }; then
7300   break
7301 else
7302   echo "$as_me: failed program was:" >&5
7303 cat conftest.$ac_ext >&5
7304 fi
7305 rm -f conftest.$ac_objext conftest.$ac_ext
7306                 done
7307                 echo "$as_me:7307: result: $CC_SHARED_OPTS" >&5
7308 echo "${ECHO_T}$CC_SHARED_OPTS" >&6
7309                 CFLAGS="$cf_save_CFLAGS"
7310         fi
7311
7312         cf_cv_shlib_version_infix=no
7313
7314         case $cf_cv_system_name in
7315         (aix4.3-9*|aix[5-7]*)
7316                 if test "$GCC" = yes; then
7317                         CC_SHARED_OPTS='-Wl,-brtl'
7318                         MK_SHARED_LIB='${CC} -shared -Wl,-brtl -Wl,-blibpath:${RPATH_LIST}:/usr/lib -o $@'
7319                 else
7320                         CC_SHARED_OPTS='-brtl'
7321                         # as well as '-qpic=large -G' or perhaps "-bM:SRE -bnoentry -bexpall"
7322                         MK_SHARED_LIB='${CC} -G -Wl,-brtl -Wl,-blibpath:${RPATH_LIST}:/usr/lib -o $@'
7323                 fi
7324                 ;;
7325         (beos*)
7326                 MK_SHARED_LIB='${CC} ${CFLAGS} -o $@ -Xlinker -soname=`basename $@` -nostart -e 0'
7327                 ;;
7328         (cygwin*)
7329                 CC_SHARED_OPTS=
7330                 MK_SHARED_LIB='sh '$rel_builddir'/mk_shared_lib.sh $@ ${CC} ${CFLAGS}'
7331                 RM_SHARED_OPTS="$RM_SHARED_OPTS $rel_builddir/mk_shared_lib.sh *.dll.a"
7332                 cf_cv_shlib_version=cygdll
7333                 cf_cv_shlib_version_infix=cygdll
7334                 shlibdir=$bindir
7335                 MAKE_DLLS=
7336                 cat >mk_shared_lib.sh <<-CF_EOF
7337                 #!/bin/sh
7338                 SHARED_LIB=\$1
7339                 IMPORT_LIB=\`echo "\$1" | sed -e 's/cyg/lib/' -e 's/[0-9]*\.dll$/.dll.a/'\`
7340                 shift
7341                 cat <<-EOF
7342                 Linking shared library
7343                 ** SHARED_LIB \$SHARED_LIB
7344                 ** IMPORT_LIB \$IMPORT_LIB
7345 EOF
7346                 exec \$* -shared -Wl,--out-implib=\${IMPORT_LIB} -Wl,--export-all-symbols -o \${SHARED_LIB}
7347 CF_EOF
7348                 chmod +x mk_shared_lib.sh
7349                 ;;
7350         (msys*)
7351                 CC_SHARED_OPTS=
7352                 MK_SHARED_LIB='sh '$rel_builddir'/mk_shared_lib.sh $@ ${CC} ${CFLAGS}'
7353                 RM_SHARED_OPTS="$RM_SHARED_OPTS $rel_builddir/mk_shared_lib.sh *.dll.a"
7354                 cf_cv_shlib_version=msysdll
7355                 cf_cv_shlib_version_infix=msysdll
7356                 shlibdir=$bindir
7357                 MAKE_DLLS=
7358                 cat >mk_shared_lib.sh <<-CF_EOF
7359                 #!/bin/sh
7360                 SHARED_LIB=\$1
7361                 IMPORT_LIB=\`echo "\$1" | sed -e 's/msys-/lib/' -e 's/[0-9]*\.dll$/.dll.a/'\`
7362                 shift
7363                 cat <<-EOF
7364                 Linking shared library
7365                 ** SHARED_LIB \$SHARED_LIB
7366                 ** IMPORT_LIB \$IMPORT_LIB
7367 EOF
7368                 exec \$* -shared -Wl,--out-implib=\${IMPORT_LIB} -Wl,--export-all-symbols -o \${SHARED_LIB}
7369 CF_EOF
7370                 chmod +x mk_shared_lib.sh
7371                 ;;
7372         (darwin*)
7373                 cf_try_cflags="no-cpp-precomp"
7374                 CC_SHARED_OPTS="-dynamic"
7375                 MK_SHARED_LIB='${CC} ${CFLAGS} -dynamiclib -install_name ${libdir}/`basename $@` -compatibility_version ${ABI_VERSION} -current_version ${ABI_VERSION} -o $@'
7376                 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=abi
7377                 cf_cv_shlib_version_infix=yes
7378                 echo "$as_me:7378: checking if ld -search_paths_first works" >&5
7379 echo $ECHO_N "checking if ld -search_paths_first works... $ECHO_C" >&6
7380 if test "${cf_cv_ldflags_search_paths_first+set}" = set; then
7381   echo $ECHO_N "(cached) $ECHO_C" >&6
7382 else
7383
7384                         cf_save_LDFLAGS=$LDFLAGS
7385                         LDFLAGS="$LDFLAGS -Wl,-search_paths_first"
7386                         cat >conftest.$ac_ext <<_ACEOF
7387 #line 7387 "configure"
7388 #include "confdefs.h"
7389
7390 int
7391 main ()
7392 {
7393 int i;
7394   ;
7395   return 0;
7396 }
7397 _ACEOF
7398 rm -f conftest.$ac_objext conftest$ac_exeext
7399 if { (eval echo "$as_me:7399: \"$ac_link\"") >&5
7400   (eval $ac_link) 2>&5
7401   ac_status=$?
7402   echo "$as_me:7402: \$? = $ac_status" >&5
7403   (exit $ac_status); } &&
7404          { ac_try='test -s conftest$ac_exeext'
7405   { (eval echo "$as_me:7405: \"$ac_try\"") >&5
7406   (eval $ac_try) 2>&5
7407   ac_status=$?
7408   echo "$as_me:7408: \$? = $ac_status" >&5
7409   (exit $ac_status); }; }; then
7410   cf_cv_ldflags_search_paths_first=yes
7411 else
7412   echo "$as_me: failed program was:" >&5
7413 cat conftest.$ac_ext >&5
7414 cf_cv_ldflags_search_paths_first=no
7415 fi
7416 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7417                                 LDFLAGS=$cf_save_LDFLAGS
7418 fi
7419 echo "$as_me:7419: result: $cf_cv_ldflags_search_paths_first" >&5
7420 echo "${ECHO_T}$cf_cv_ldflags_search_paths_first" >&6
7421                 if test $cf_cv_ldflags_search_paths_first = yes; then
7422                         LDFLAGS="$LDFLAGS -Wl,-search_paths_first"
7423                 fi
7424                 ;;
7425         (hpux[7-8]*)
7426                 # HP-UX 8.07 ld lacks "+b" option used for libdir search-list
7427                 if test "$GCC" != yes; then
7428                         CC_SHARED_OPTS='+Z'
7429                 fi
7430                 MK_SHARED_LIB='${LD} -b -o $@'
7431                 INSTALL_LIB="-m 555"
7432                 ;;
7433         (hpux*)
7434                 # (tested with gcc 2.7.2 -- I don't have c89)
7435                 if test "$GCC" = yes; then
7436                         LD_SHARED_OPTS='-Xlinker +b -Xlinker ${libdir}'
7437                 else
7438                         CC_SHARED_OPTS='+Z'
7439                         LD_SHARED_OPTS='-Wl,+b,${libdir}'
7440                 fi
7441                 MK_SHARED_LIB='${LD} +b ${libdir} -b -o $@'
7442                 # HP-UX shared libraries must be executable, and should be
7443                 # readonly to exploit a quirk in the memory manager.
7444                 INSTALL_LIB="-m 555"
7445                 ;;
7446         (interix*)
7447                 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
7448                 if test "$cf_cv_shlib_version" = rel; then
7449                         cf_shared_soname='`basename  .${REL_VERSION}`.${ABI_VERSION}'
7450                 else
7451                         cf_shared_soname='`basename `'
7452                 fi
7453                 CC_SHARED_OPTS=
7454                 MK_SHARED_LIB='${CC} -shared -Wl,-rpath,${RPATH_LIST} -Wl,-h,'$cf_shared_soname' -o '
7455                 ;;
7456         (irix*)
7457                 if test "$cf_cv_enable_rpath" = yes ; then
7458                         EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
7459                 fi
7460                 # tested with IRIX 5.2 and 'cc'.
7461                 if test "$GCC" != yes; then
7462                         CC_SHARED_OPTS='-KPIC'
7463                         MK_SHARED_LIB='${CC} -shared -rdata_shared -soname `basename $@` -o $@'
7464                 else
7465                         MK_SHARED_LIB='${CC} -shared -Wl,-soname,`basename $@` -o $@'
7466                 fi
7467                 cf_cv_rm_so_locs=yes
7468                 ;;
7469         (linux*|gnu*|k*bsd*-gnu)
7470                 if test "$DFT_LWR_MODEL" = "shared" ; then
7471                         LOCAL_LDFLAGS="${LD_RPATH_OPT}\$(LOCAL_LIBDIR)"
7472                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
7473                 fi
7474                 if test "$cf_cv_enable_rpath" = yes ; then
7475                         EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
7476                 fi
7477
7478         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
7479         if test "$cf_cv_shlib_version" = rel; then
7480                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
7481         else
7482                 cf_cv_shared_soname='`basename $@`'
7483         fi
7484
7485                 MK_SHARED_LIB='${CC} ${CFLAGS} -shared -Wl,-soname,'$cf_cv_shared_soname',-stats,-lc -o $@'
7486                 ;;
7487         (mingw*)
7488                 cf_cv_shlib_version=mingw
7489                 cf_cv_shlib_version_infix=mingw
7490                 shlibdir=$bindir
7491                 MAKE_DLLS=
7492                 if test "$DFT_LWR_MODEL" = "shared" ; then
7493                         LOCAL_LDFLAGS="-Wl,--enable-auto-import"
7494                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
7495                         EXTRA_LDFLAGS="-Wl,--enable-auto-import $EXTRA_LDFLAGS"
7496                 fi
7497                 CC_SHARED_OPTS=
7498                 MK_SHARED_LIB='sh '$rel_builddir'/mk_shared_lib.sh $@ ${CC} ${CFLAGS}'
7499                 RM_SHARED_OPTS="$RM_SHARED_OPTS $rel_builddir/mk_shared_lib.sh *.dll.a"
7500                 cat >mk_shared_lib.sh <<-CF_EOF
7501                 #!/bin/sh
7502                 SHARED_LIB=\$1
7503                 IMPORT_LIB=\`echo "\$1" | sed -e 's/[0-9]*\.dll$/.dll.a/'\`
7504                 shift
7505                 cat <<-EOF
7506                 Linking shared library
7507                 ** SHARED_LIB \$SHARED_LIB
7508                 ** IMPORT_LIB \$IMPORT_LIB
7509 EOF
7510                 exec \$* -shared -Wl,--enable-auto-import,--out-implib=\${IMPORT_LIB} -Wl,--export-all-symbols -o \${SHARED_LIB}
7511 CF_EOF
7512                 chmod +x mk_shared_lib.sh
7513                 ;;
7514         (openbsd[2-9].*|mirbsd*)
7515                 if test "$DFT_LWR_MODEL" = "shared" ; then
7516                         LOCAL_LDFLAGS="${LD_RPATH_OPT}\$(LOCAL_LIBDIR)"
7517                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
7518                 fi
7519                 if test "$cf_cv_enable_rpath" = yes ; then
7520                         EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
7521                 fi
7522                 CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
7523
7524         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
7525         if test "$cf_cv_shlib_version" = rel; then
7526                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
7527         else
7528                 cf_cv_shared_soname='`basename $@`'
7529         fi
7530
7531                 MK_SHARED_LIB='${CC} ${CFLAGS} -shared -Wl,-Bshareable,-soname,'$cf_cv_shared_soname',-stats,-lc -o $@'
7532                 ;;
7533         (nto-qnx*|openbsd*|freebsd[12].*)
7534                 CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
7535                 MK_SHARED_LIB='${LD} -Bshareable -o $@'
7536                 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
7537                 ;;
7538         (dragonfly*|freebsd*)
7539                 CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
7540                 if test "$DFT_LWR_MODEL" = "shared" && test "$cf_cv_enable_rpath" = yes ; then
7541                         LOCAL_LDFLAGS="${cf_ld_rpath_opt}\$(LOCAL_LIBDIR)"
7542                         LOCAL_LDFLAGS2="${cf_ld_rpath_opt}\${RPATH_LIST} $LOCAL_LDFLAGS"
7543                         EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
7544                 fi
7545
7546         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
7547         if test "$cf_cv_shlib_version" = rel; then
7548                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
7549         else
7550                 cf_cv_shared_soname='`basename $@`'
7551         fi
7552
7553                 MK_SHARED_LIB='${CC} ${CFLAGS} -shared -Wl,-soname,'$cf_cv_shared_soname',-stats,-lc -o $@'
7554                 ;;
7555         (netbsd*)
7556                 CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
7557                 if test "$DFT_LWR_MODEL" = "shared" && test "$cf_cv_enable_rpath" = yes ; then
7558                         LOCAL_LDFLAGS="${cf_ld_rpath_opt}\$(LOCAL_LIBDIR)"
7559                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
7560                         EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
7561                         if test "$cf_cv_shlib_version" = auto; then
7562                         if test -f /usr/libexec/ld.elf_so; then
7563                                 cf_cv_shlib_version=abi
7564                         else
7565                                 cf_cv_shlib_version=rel
7566                         fi
7567                         fi
7568
7569         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
7570         if test "$cf_cv_shlib_version" = rel; then
7571                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
7572         else
7573                 cf_cv_shared_soname='`basename $@`'
7574         fi
7575
7576                         MK_SHARED_LIB='${CC} ${CFLAGS} -shared -Wl,-soname,'$cf_cv_shared_soname' -o $@'
7577                 else
7578                         MK_SHARED_LIB='${CC} -Wl,-shared -Wl,-Bshareable -o $@'
7579                 fi
7580                 ;;
7581         (osf*|mls+*)
7582                 # tested with OSF/1 V3.2 and 'cc'
7583                 # tested with OSF/1 V3.2 and gcc 2.6.3 (but the c++ demo didn't
7584                 # link with shared libs).
7585                 MK_SHARED_LIB='${LD} -set_version ${REL_VERSION}:${ABI_VERSION} -expect_unresolved "*" -shared -soname `basename $@`'
7586                 case $host_os in
7587                 (osf4*)
7588                         MK_SHARED_LIB="${MK_SHARED_LIB} -msym"
7589                         ;;
7590                 esac
7591                 MK_SHARED_LIB="${MK_SHARED_LIB}"' -o $@'
7592                 if test "$DFT_LWR_MODEL" = "shared" ; then
7593                         LOCAL_LDFLAGS="${LD_RPATH_OPT}\$(LOCAL_LIBDIR)"
7594                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
7595                 fi
7596                 cf_cv_rm_so_locs=yes
7597                 ;;
7598         (sco3.2v5*)  # also uw2* and UW7: hops 13-Apr-98
7599                 # tested with osr5.0.5
7600                 if test "$GCC" != yes; then
7601                         CC_SHARED_OPTS='-belf -KPIC'
7602                 fi
7603                 MK_SHARED_LIB='${LD} -dy -G -h `basename $@ .${REL_VERSION}`.${ABI_VERSION} -o $@'
7604                 if test "$cf_cv_enable_rpath" = yes ; then
7605                         # only way is to set LD_RUN_PATH but no switch for it
7606                         RUN_PATH=$libdir
7607                 fi
7608                 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
7609                 LINK_PROGS='LD_RUN_PATH=${libdir}'
7610                 LINK_TESTS='Pwd=`pwd`;LD_RUN_PATH=`dirname $${Pwd}`/lib'
7611                 ;;
7612         (sunos4*)
7613                 # tested with SunOS 4.1.1 and gcc 2.7.0
7614                 if test "$GCC" != yes; then
7615                         CC_SHARED_OPTS='-KPIC'
7616                 fi
7617                 MK_SHARED_LIB='${LD} -assert pure-text -o $@'
7618                 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
7619                 ;;
7620         (solaris2*)
7621                 # tested with SunOS 5.5.1 (solaris 2.5.1) and gcc 2.7.2
7622                 # tested with SunOS 5.10 (solaris 10) and gcc 3.4.3
7623                 if test "$DFT_LWR_MODEL" = "shared" ; then
7624                         LOCAL_LDFLAGS="-R \$(LOCAL_LIBDIR):\${libdir}"
7625                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
7626                 fi
7627                 if test "$cf_cv_enable_rpath" = yes ; then
7628                         EXTRA_LDFLAGS="-R \${libdir} $EXTRA_LDFLAGS"
7629                 fi
7630
7631         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
7632         if test "$cf_cv_shlib_version" = rel; then
7633                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
7634         else
7635                 cf_cv_shared_soname='`basename $@`'
7636         fi
7637
7638                 if test "$GCC" != yes; then
7639                         cf_save_CFLAGS="$CFLAGS"
7640                         for cf_shared_opts in -xcode=pic32 -xcode=pic13 -KPIC -Kpic -O
7641                         do
7642                                 CFLAGS="$cf_shared_opts $cf_save_CFLAGS"
7643                                 cat >conftest.$ac_ext <<_ACEOF
7644 #line 7644 "configure"
7645 #include "confdefs.h"
7646 #include <stdio.h>
7647 int
7648 main ()
7649 {
7650 printf("Hello\n");
7651   ;
7652   return 0;
7653 }
7654 _ACEOF
7655 rm -f conftest.$ac_objext
7656 if { (eval echo "$as_me:7656: \"$ac_compile\"") >&5
7657   (eval $ac_compile) 2>&5
7658   ac_status=$?
7659   echo "$as_me:7659: \$? = $ac_status" >&5
7660   (exit $ac_status); } &&
7661          { ac_try='test -s conftest.$ac_objext'
7662   { (eval echo "$as_me:7662: \"$ac_try\"") >&5
7663   (eval $ac_try) 2>&5
7664   ac_status=$?
7665   echo "$as_me:7665: \$? = $ac_status" >&5
7666   (exit $ac_status); }; }; then
7667   break
7668 else
7669   echo "$as_me: failed program was:" >&5
7670 cat conftest.$ac_ext >&5
7671 fi
7672 rm -f conftest.$ac_objext conftest.$ac_ext
7673                         done
7674                         CFLAGS="$cf_save_CFLAGS"
7675                         CC_SHARED_OPTS=$cf_shared_opts
7676                         MK_SHARED_LIB='${CC} -dy -G -h '$cf_cv_shared_soname' -o $@'
7677                 else
7678                         MK_SHARED_LIB='${CC} -shared -dy -G -h '$cf_cv_shared_soname' -o $@'
7679                 fi
7680                 ;;
7681         (sysv5uw7*|unix_sv*)
7682                 # tested with UnixWare 7.1.0 (gcc 2.95.2 and cc)
7683                 if test "$GCC" != yes; then
7684                         CC_SHARED_OPTS='-KPIC'
7685                 fi
7686                 MK_SHARED_LIB='${LD} -d y -G -o $@'
7687                 ;;
7688         (*)
7689                 CC_SHARED_OPTS='unknown'
7690                 MK_SHARED_LIB='echo unknown'
7691                 ;;
7692         esac
7693
7694         # This works if the last tokens in $MK_SHARED_LIB are the -o target.
7695         case "$cf_cv_shlib_version" in
7696         (rel|abi)
7697                 case "$MK_SHARED_LIB" in
7698                 (*'-o $@')
7699                         test "$cf_cv_do_symlinks" = no && cf_cv_do_symlinks=yes
7700                         ;;
7701                 (*)
7702                         { echo "$as_me:7702: WARNING: ignored --with-shlib-version" >&5
7703 echo "$as_me: WARNING: ignored --with-shlib-version" >&2;}
7704                         ;;
7705                 esac
7706                 ;;
7707         esac
7708
7709         if test -n "$cf_try_cflags"
7710         then
7711 cat > conftest.$ac_ext <<EOF
7712 #line 7712 "${as_me:-configure}"
7713 #include <stdio.h>
7714 int main(int argc, char *argv[])
7715 {
7716         printf("hello\n");
7717         return (argv[argc-1] == 0) ;
7718 }
7719 EOF
7720                 cf_save_CFLAGS="$CFLAGS"
7721                 for cf_opt in $cf_try_cflags
7722                 do
7723                         CFLAGS="$cf_save_CFLAGS -$cf_opt"
7724                         echo "$as_me:7724: checking if CFLAGS option -$cf_opt works" >&5
7725 echo $ECHO_N "checking if CFLAGS option -$cf_opt works... $ECHO_C" >&6
7726                         if { (eval echo "$as_me:7726: \"$ac_compile\"") >&5
7727   (eval $ac_compile) 2>&5
7728   ac_status=$?
7729   echo "$as_me:7729: \$? = $ac_status" >&5
7730   (exit $ac_status); }; then
7731                                 echo "$as_me:7731: result: yes" >&5
7732 echo "${ECHO_T}yes" >&6
7733                                 cf_save_CFLAGS="$CFLAGS"
7734                         else
7735                                 echo "$as_me:7735: result: no" >&5
7736 echo "${ECHO_T}no" >&6
7737                         fi
7738                 done
7739                 CFLAGS="$cf_save_CFLAGS"
7740         fi
7741
7742         # RPATH_LIST is a colon-separated list of directories
7743         test -n "$cf_ld_rpath_opt" && MK_SHARED_LIB="$MK_SHARED_LIB $cf_ld_rpath_opt\${RPATH_LIST}"
7744         test -z "$RPATH_LIST" && RPATH_LIST="\${libdir}"
7745
7746         test $cf_cv_rm_so_locs = yes && RM_SHARED_OPTS="$RM_SHARED_OPTS so_locations"
7747
7748         test -n "$verbose" && echo "    CC_SHARED_OPTS: $CC_SHARED_OPTS" 1>&6
7749
7750 echo "${as_me:-configure}:7750: testing CC_SHARED_OPTS: $CC_SHARED_OPTS ..." 1>&5
7751
7752         test -n "$verbose" && echo "    MK_SHARED_LIB:  $MK_SHARED_LIB" 1>&6
7753
7754 echo "${as_me:-configure}:7754: testing MK_SHARED_LIB:  $MK_SHARED_LIB ..." 1>&5
7755
7756 # The test/sample programs in the original tree link using rpath option.
7757 # Make it optional for packagers.
7758 if test -n "$LOCAL_LDFLAGS"
7759 then
7760         echo "$as_me:7760: checking if you want to link sample programs with rpath option" >&5
7761 echo $ECHO_N "checking if you want to link sample programs with rpath option... $ECHO_C" >&6
7762
7763 # Check whether --enable-rpath-link or --disable-rpath-link was given.
7764 if test "${enable_rpath_link+set}" = set; then
7765   enableval="$enable_rpath_link"
7766   with_rpath_link=$enableval
7767 else
7768   with_rpath_link=yes
7769 fi;
7770         echo "$as_me:7770: result: $with_rpath_link" >&5
7771 echo "${ECHO_T}$with_rpath_link" >&6
7772         if test "$with_rpath_link" = no
7773         then
7774                 LOCAL_LDFLAGS=
7775                 LOCAL_LDFLAGS2=
7776         fi
7777 fi
7778
7779 ###############################################################################
7780
7781 ###   use option --enable-broken-linker to force on use of broken-linker support
7782 echo "$as_me:7782: checking if you want broken-linker support code" >&5
7783 echo $ECHO_N "checking if you want broken-linker support code... $ECHO_C" >&6
7784
7785 # Check whether --enable-broken_linker or --disable-broken_linker was given.
7786 if test "${enable_broken_linker+set}" = set; then
7787   enableval="$enable_broken_linker"
7788   with_broken_linker=$enableval
7789 else
7790   with_broken_linker=${BROKEN_LINKER:-no}
7791 fi;
7792 echo "$as_me:7792: result: $with_broken_linker" >&5
7793 echo "${ECHO_T}$with_broken_linker" >&6
7794
7795 BROKEN_LINKER=0
7796 if test "$with_broken_linker" = yes ; then
7797         cat >>confdefs.h <<\EOF
7798 #define BROKEN_LINKER 1
7799 EOF
7800
7801         BROKEN_LINKER=1
7802 elif test "$DFT_LWR_MODEL" = shared ; then
7803         case $cf_cv_system_name in
7804         (cygwin*)
7805                 cat >>confdefs.h <<\EOF
7806 #define BROKEN_LINKER 1
7807 EOF
7808
7809                 BROKEN_LINKER=1
7810                 test -n "$verbose" && echo "    cygwin linker is broken anyway" 1>&6
7811
7812 echo "${as_me:-configure}:7812: testing cygwin linker is broken anyway ..." 1>&5
7813
7814                 ;;
7815         esac
7816 fi
7817
7818 # Check to define _XOPEN_SOURCE "automatically"
7819
7820 cf_XOPEN_SOURCE=500
7821 cf_POSIX_C_SOURCE=199506L
7822 cf_xopen_source=
7823
7824 case $host_os in
7825 (aix[4-7]*)
7826         cf_xopen_source="-D_ALL_SOURCE"
7827         ;;
7828 (cygwin|msys)
7829         cf_XOPEN_SOURCE=600
7830         ;;
7831 (darwin[0-8].*)
7832         cf_xopen_source="-D_APPLE_C_SOURCE"
7833         ;;
7834 (darwin*)
7835         cf_xopen_source="-D_DARWIN_C_SOURCE"
7836         cf_XOPEN_SOURCE=
7837         ;;
7838 (freebsd*|dragonfly*)
7839         # 5.x headers associate
7840         #       _XOPEN_SOURCE=600 with _POSIX_C_SOURCE=200112L
7841         #       _XOPEN_SOURCE=500 with _POSIX_C_SOURCE=199506L
7842         cf_POSIX_C_SOURCE=200112L
7843         cf_XOPEN_SOURCE=600
7844         cf_xopen_source="-D_BSD_TYPES -D__BSD_VISIBLE -D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
7845         ;;
7846 (hpux11*)
7847         cf_xopen_source="-D_HPUX_SOURCE -D_XOPEN_SOURCE=500"
7848         ;;
7849 (hpux*)
7850         cf_xopen_source="-D_HPUX_SOURCE"
7851         ;;
7852 (irix[56].*)
7853         cf_xopen_source="-D_SGI_SOURCE"
7854         cf_XOPEN_SOURCE=
7855         ;;
7856 (linux*|gnu*|mint*|k*bsd*-gnu)
7857
7858 echo "$as_me:7858: checking if we must define _GNU_SOURCE" >&5
7859 echo $ECHO_N "checking if we must define _GNU_SOURCE... $ECHO_C" >&6
7860 if test "${cf_cv_gnu_source+set}" = set; then
7861   echo $ECHO_N "(cached) $ECHO_C" >&6
7862 else
7863
7864 cat >conftest.$ac_ext <<_ACEOF
7865 #line 7865 "configure"
7866 #include "confdefs.h"
7867 #include <sys/types.h>
7868 int
7869 main ()
7870 {
7871
7872 #ifndef _XOPEN_SOURCE
7873 make an error
7874 #endif
7875   ;
7876   return 0;
7877 }
7878 _ACEOF
7879 rm -f conftest.$ac_objext
7880 if { (eval echo "$as_me:7880: \"$ac_compile\"") >&5
7881   (eval $ac_compile) 2>&5
7882   ac_status=$?
7883   echo "$as_me:7883: \$? = $ac_status" >&5
7884   (exit $ac_status); } &&
7885          { ac_try='test -s conftest.$ac_objext'
7886   { (eval echo "$as_me:7886: \"$ac_try\"") >&5
7887   (eval $ac_try) 2>&5
7888   ac_status=$?
7889   echo "$as_me:7889: \$? = $ac_status" >&5
7890   (exit $ac_status); }; }; then
7891   cf_cv_gnu_source=no
7892 else
7893   echo "$as_me: failed program was:" >&5
7894 cat conftest.$ac_ext >&5
7895 cf_save="$CPPFLAGS"
7896          CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
7897          cat >conftest.$ac_ext <<_ACEOF
7898 #line 7898 "configure"
7899 #include "confdefs.h"
7900 #include <sys/types.h>
7901 int
7902 main ()
7903 {
7904
7905 #ifdef _XOPEN_SOURCE
7906 make an error
7907 #endif
7908   ;
7909   return 0;
7910 }
7911 _ACEOF
7912 rm -f conftest.$ac_objext
7913 if { (eval echo "$as_me:7913: \"$ac_compile\"") >&5
7914   (eval $ac_compile) 2>&5
7915   ac_status=$?
7916   echo "$as_me:7916: \$? = $ac_status" >&5
7917   (exit $ac_status); } &&
7918          { ac_try='test -s conftest.$ac_objext'
7919   { (eval echo "$as_me:7919: \"$ac_try\"") >&5
7920   (eval $ac_try) 2>&5
7921   ac_status=$?
7922   echo "$as_me:7922: \$? = $ac_status" >&5
7923   (exit $ac_status); }; }; then
7924   cf_cv_gnu_source=no
7925 else
7926   echo "$as_me: failed program was:" >&5
7927 cat conftest.$ac_ext >&5
7928 cf_cv_gnu_source=yes
7929 fi
7930 rm -f conftest.$ac_objext conftest.$ac_ext
7931         CPPFLAGS="$cf_save"
7932
7933 fi
7934 rm -f conftest.$ac_objext conftest.$ac_ext
7935
7936 fi
7937 echo "$as_me:7937: result: $cf_cv_gnu_source" >&5
7938 echo "${ECHO_T}$cf_cv_gnu_source" >&6
7939 test "$cf_cv_gnu_source" = yes && CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
7940
7941         ;;
7942 (minix*)
7943         cf_xopen_source="-D_NETBSD_SOURCE" # POSIX.1-2001 features are ifdef'd with this...
7944         ;;
7945 (mirbsd*)
7946         # setting _XOPEN_SOURCE or _POSIX_SOURCE breaks <sys/select.h> and other headers which use u_int / u_short types
7947         cf_XOPEN_SOURCE=
7948
7949 cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE
7950
7951 cf_save_CFLAGS="$CFLAGS"
7952 cf_save_CPPFLAGS="$CPPFLAGS"
7953
7954 cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \
7955         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
7956                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
7957
7958 cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \
7959         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
7960                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
7961
7962 echo "$as_me:7962: checking if we should define _POSIX_C_SOURCE" >&5
7963 echo $ECHO_N "checking if we should define _POSIX_C_SOURCE... $ECHO_C" >&6
7964 if test "${cf_cv_posix_c_source+set}" = set; then
7965   echo $ECHO_N "(cached) $ECHO_C" >&6
7966 else
7967
7968 echo "${as_me:-configure}:7968: testing if the symbol is already defined go no further ..." 1>&5
7969
7970         cat >conftest.$ac_ext <<_ACEOF
7971 #line 7971 "configure"
7972 #include "confdefs.h"
7973 #include <sys/types.h>
7974 int
7975 main ()
7976 {
7977
7978 #ifndef _POSIX_C_SOURCE
7979 make an error
7980 #endif
7981   ;
7982   return 0;
7983 }
7984 _ACEOF
7985 rm -f conftest.$ac_objext
7986 if { (eval echo "$as_me:7986: \"$ac_compile\"") >&5
7987   (eval $ac_compile) 2>&5
7988   ac_status=$?
7989   echo "$as_me:7989: \$? = $ac_status" >&5
7990   (exit $ac_status); } &&
7991          { ac_try='test -s conftest.$ac_objext'
7992   { (eval echo "$as_me:7992: \"$ac_try\"") >&5
7993   (eval $ac_try) 2>&5
7994   ac_status=$?
7995   echo "$as_me:7995: \$? = $ac_status" >&5
7996   (exit $ac_status); }; }; then
7997   cf_cv_posix_c_source=no
7998 else
7999   echo "$as_me: failed program was:" >&5
8000 cat conftest.$ac_ext >&5
8001 cf_want_posix_source=no
8002          case .$cf_POSIX_C_SOURCE in
8003          (.[12]??*)
8004                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
8005                 ;;
8006          (.2)
8007                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
8008                 cf_want_posix_source=yes
8009                 ;;
8010          (.*)
8011                 cf_want_posix_source=yes
8012                 ;;
8013          esac
8014          if test "$cf_want_posix_source" = yes ; then
8015                 cat >conftest.$ac_ext <<_ACEOF
8016 #line 8016 "configure"
8017 #include "confdefs.h"
8018 #include <sys/types.h>
8019 int
8020 main ()
8021 {
8022
8023 #ifdef _POSIX_SOURCE
8024 make an error
8025 #endif
8026   ;
8027   return 0;
8028 }
8029 _ACEOF
8030 rm -f conftest.$ac_objext
8031 if { (eval echo "$as_me:8031: \"$ac_compile\"") >&5
8032   (eval $ac_compile) 2>&5
8033   ac_status=$?
8034   echo "$as_me:8034: \$? = $ac_status" >&5
8035   (exit $ac_status); } &&
8036          { ac_try='test -s conftest.$ac_objext'
8037   { (eval echo "$as_me:8037: \"$ac_try\"") >&5
8038   (eval $ac_try) 2>&5
8039   ac_status=$?
8040   echo "$as_me:8040: \$? = $ac_status" >&5
8041   (exit $ac_status); }; }; then
8042   :
8043 else
8044   echo "$as_me: failed program was:" >&5
8045 cat conftest.$ac_ext >&5
8046 cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE"
8047 fi
8048 rm -f conftest.$ac_objext conftest.$ac_ext
8049          fi
8050
8051 echo "${as_me:-configure}:8051: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
8052
8053          CFLAGS="$cf_trim_CFLAGS"
8054          CPPFLAGS="$cf_trim_CPPFLAGS $cf_cv_posix_c_source"
8055
8056 echo "${as_me:-configure}:8056: testing if the second compile does not leave our definition intact error ..." 1>&5
8057
8058          cat >conftest.$ac_ext <<_ACEOF
8059 #line 8059 "configure"
8060 #include "confdefs.h"
8061 #include <sys/types.h>
8062 int
8063 main ()
8064 {
8065
8066 #ifndef _POSIX_C_SOURCE
8067 make an error
8068 #endif
8069   ;
8070   return 0;
8071 }
8072 _ACEOF
8073 rm -f conftest.$ac_objext
8074 if { (eval echo "$as_me:8074: \"$ac_compile\"") >&5
8075   (eval $ac_compile) 2>&5
8076   ac_status=$?
8077   echo "$as_me:8077: \$? = $ac_status" >&5
8078   (exit $ac_status); } &&
8079          { ac_try='test -s conftest.$ac_objext'
8080   { (eval echo "$as_me:8080: \"$ac_try\"") >&5
8081   (eval $ac_try) 2>&5
8082   ac_status=$?
8083   echo "$as_me:8083: \$? = $ac_status" >&5
8084   (exit $ac_status); }; }; then
8085   :
8086 else
8087   echo "$as_me: failed program was:" >&5
8088 cat conftest.$ac_ext >&5
8089 cf_cv_posix_c_source=no
8090 fi
8091 rm -f conftest.$ac_objext conftest.$ac_ext
8092          CFLAGS="$cf_save_CFLAGS"
8093          CPPFLAGS="$cf_save_CPPFLAGS"
8094
8095 fi
8096 rm -f conftest.$ac_objext conftest.$ac_ext
8097
8098 fi
8099 echo "$as_me:8099: result: $cf_cv_posix_c_source" >&5
8100 echo "${ECHO_T}$cf_cv_posix_c_source" >&6
8101
8102 if test "$cf_cv_posix_c_source" != no ; then
8103         CFLAGS="$cf_trim_CFLAGS"
8104         CPPFLAGS="$cf_trim_CPPFLAGS"
8105
8106 cf_fix_cppflags=no
8107 cf_new_cflags=
8108 cf_new_cppflags=
8109 cf_new_extra_cppflags=
8110
8111 for cf_add_cflags in $cf_cv_posix_c_source
8112 do
8113 case $cf_fix_cppflags in
8114 (no)
8115         case $cf_add_cflags in
8116         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
8117                 case $cf_add_cflags in
8118                 (-D*)
8119                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
8120
8121                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
8122                                 && test -z "${cf_tst_cflags}" \
8123                                 && cf_fix_cppflags=yes
8124
8125                         if test $cf_fix_cppflags = yes ; then
8126                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
8127                                 continue
8128                         elif test "${cf_tst_cflags}" = "\"'" ; then
8129                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
8130                                 continue
8131                         fi
8132                         ;;
8133                 esac
8134                 case "$CPPFLAGS" in
8135                 (*$cf_add_cflags)
8136                         ;;
8137                 (*)
8138                         case $cf_add_cflags in
8139                         (-D*)
8140                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
8141
8142 CPPFLAGS=`echo "$CPPFLAGS" | \
8143         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
8144                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
8145
8146                                 ;;
8147                         esac
8148                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
8149                         ;;
8150                 esac
8151                 ;;
8152         (*)
8153                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
8154                 ;;
8155         esac
8156         ;;
8157 (yes)
8158         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
8159
8160         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
8161
8162         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
8163                 && test -z "${cf_tst_cflags}" \
8164                 && cf_fix_cppflags=no
8165         ;;
8166 esac
8167 done
8168
8169 if test -n "$cf_new_cflags" ; then
8170
8171         CFLAGS="$CFLAGS $cf_new_cflags"
8172 fi
8173
8174 if test -n "$cf_new_cppflags" ; then
8175
8176         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
8177 fi
8178
8179 if test -n "$cf_new_extra_cppflags" ; then
8180
8181         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
8182 fi
8183
8184 fi
8185
8186         ;;
8187 (netbsd*)
8188         cf_xopen_source="-D_NETBSD_SOURCE" # setting _XOPEN_SOURCE breaks IPv6 for lynx on NetBSD 1.6, breaks xterm, is not needed for ncursesw
8189         ;;
8190 (openbsd[4-9]*)
8191         # setting _XOPEN_SOURCE lower than 500 breaks g++ compile with wchar.h, needed for ncursesw
8192         cf_xopen_source="-D_BSD_SOURCE"
8193         cf_XOPEN_SOURCE=600
8194         ;;
8195 (openbsd*)
8196         # setting _XOPEN_SOURCE breaks xterm on OpenBSD 2.8, is not needed for ncursesw
8197         ;;
8198 (osf[45]*)
8199         cf_xopen_source="-D_OSF_SOURCE"
8200         ;;
8201 (nto-qnx*)
8202         cf_xopen_source="-D_QNX_SOURCE"
8203         ;;
8204 (sco*)
8205         # setting _XOPEN_SOURCE breaks Lynx on SCO Unix / OpenServer
8206         ;;
8207 (solaris2.*)
8208         cf_xopen_source="-D__EXTENSIONS__"
8209         cf_cv_xopen_source=broken
8210         ;;
8211 (sysv4.2uw2.*) # Novell/SCO UnixWare 2.x (tested on 2.1.2)
8212         cf_XOPEN_SOURCE=
8213         cf_POSIX_C_SOURCE=
8214         ;;
8215 (*)
8216
8217 echo "$as_me:8217: checking if we should define _XOPEN_SOURCE" >&5
8218 echo $ECHO_N "checking if we should define _XOPEN_SOURCE... $ECHO_C" >&6
8219 if test "${cf_cv_xopen_source+set}" = set; then
8220   echo $ECHO_N "(cached) $ECHO_C" >&6
8221 else
8222
8223         cat >conftest.$ac_ext <<_ACEOF
8224 #line 8224 "configure"
8225 #include "confdefs.h"
8226
8227 #include <stdlib.h>
8228 #include <string.h>
8229 #include <sys/types.h>
8230
8231 int
8232 main ()
8233 {
8234
8235 #ifndef _XOPEN_SOURCE
8236 make an error
8237 #endif
8238   ;
8239   return 0;
8240 }
8241 _ACEOF
8242 rm -f conftest.$ac_objext
8243 if { (eval echo "$as_me:8243: \"$ac_compile\"") >&5
8244   (eval $ac_compile) 2>&5
8245   ac_status=$?
8246   echo "$as_me:8246: \$? = $ac_status" >&5
8247   (exit $ac_status); } &&
8248          { ac_try='test -s conftest.$ac_objext'
8249   { (eval echo "$as_me:8249: \"$ac_try\"") >&5
8250   (eval $ac_try) 2>&5
8251   ac_status=$?
8252   echo "$as_me:8252: \$? = $ac_status" >&5
8253   (exit $ac_status); }; }; then
8254   cf_cv_xopen_source=no
8255 else
8256   echo "$as_me: failed program was:" >&5
8257 cat conftest.$ac_ext >&5
8258 cf_save="$CPPFLAGS"
8259          CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
8260          cat >conftest.$ac_ext <<_ACEOF
8261 #line 8261 "configure"
8262 #include "confdefs.h"
8263
8264 #include <stdlib.h>
8265 #include <string.h>
8266 #include <sys/types.h>
8267
8268 int
8269 main ()
8270 {
8271
8272 #ifdef _XOPEN_SOURCE
8273 make an error
8274 #endif
8275   ;
8276   return 0;
8277 }
8278 _ACEOF
8279 rm -f conftest.$ac_objext
8280 if { (eval echo "$as_me:8280: \"$ac_compile\"") >&5
8281   (eval $ac_compile) 2>&5
8282   ac_status=$?
8283   echo "$as_me:8283: \$? = $ac_status" >&5
8284   (exit $ac_status); } &&
8285          { ac_try='test -s conftest.$ac_objext'
8286   { (eval echo "$as_me:8286: \"$ac_try\"") >&5
8287   (eval $ac_try) 2>&5
8288   ac_status=$?
8289   echo "$as_me:8289: \$? = $ac_status" >&5
8290   (exit $ac_status); }; }; then
8291   cf_cv_xopen_source=no
8292 else
8293   echo "$as_me: failed program was:" >&5
8294 cat conftest.$ac_ext >&5
8295 cf_cv_xopen_source=$cf_XOPEN_SOURCE
8296 fi
8297 rm -f conftest.$ac_objext conftest.$ac_ext
8298         CPPFLAGS="$cf_save"
8299
8300 fi
8301 rm -f conftest.$ac_objext conftest.$ac_ext
8302
8303 fi
8304 echo "$as_me:8304: result: $cf_cv_xopen_source" >&5
8305 echo "${ECHO_T}$cf_cv_xopen_source" >&6
8306
8307 if test "$cf_cv_xopen_source" != no ; then
8308
8309 CFLAGS=`echo "$CFLAGS" | \
8310         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
8311                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
8312
8313 CPPFLAGS=`echo "$CPPFLAGS" | \
8314         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
8315                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
8316
8317         cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source"
8318
8319 cf_fix_cppflags=no
8320 cf_new_cflags=
8321 cf_new_cppflags=
8322 cf_new_extra_cppflags=
8323
8324 for cf_add_cflags in $cf_temp_xopen_source
8325 do
8326 case $cf_fix_cppflags in
8327 (no)
8328         case $cf_add_cflags in
8329         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
8330                 case $cf_add_cflags in
8331                 (-D*)
8332                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
8333
8334                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
8335                                 && test -z "${cf_tst_cflags}" \
8336                                 && cf_fix_cppflags=yes
8337
8338                         if test $cf_fix_cppflags = yes ; then
8339                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
8340                                 continue
8341                         elif test "${cf_tst_cflags}" = "\"'" ; then
8342                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
8343                                 continue
8344                         fi
8345                         ;;
8346                 esac
8347                 case "$CPPFLAGS" in
8348                 (*$cf_add_cflags)
8349                         ;;
8350                 (*)
8351                         case $cf_add_cflags in
8352                         (-D*)
8353                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
8354
8355 CPPFLAGS=`echo "$CPPFLAGS" | \
8356         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
8357                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
8358
8359                                 ;;
8360                         esac
8361                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
8362                         ;;
8363                 esac
8364                 ;;
8365         (*)
8366                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
8367                 ;;
8368         esac
8369         ;;
8370 (yes)
8371         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
8372
8373         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
8374
8375         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
8376                 && test -z "${cf_tst_cflags}" \
8377                 && cf_fix_cppflags=no
8378         ;;
8379 esac
8380 done
8381
8382 if test -n "$cf_new_cflags" ; then
8383
8384         CFLAGS="$CFLAGS $cf_new_cflags"
8385 fi
8386
8387 if test -n "$cf_new_cppflags" ; then
8388
8389         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
8390 fi
8391
8392 if test -n "$cf_new_extra_cppflags" ; then
8393
8394         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
8395 fi
8396
8397 fi
8398
8399 cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE
8400
8401 cf_save_CFLAGS="$CFLAGS"
8402 cf_save_CPPFLAGS="$CPPFLAGS"
8403
8404 cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \
8405         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
8406                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
8407
8408 cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \
8409         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
8410                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
8411
8412 echo "$as_me:8412: checking if we should define _POSIX_C_SOURCE" >&5
8413 echo $ECHO_N "checking if we should define _POSIX_C_SOURCE... $ECHO_C" >&6
8414 if test "${cf_cv_posix_c_source+set}" = set; then
8415   echo $ECHO_N "(cached) $ECHO_C" >&6
8416 else
8417
8418 echo "${as_me:-configure}:8418: testing if the symbol is already defined go no further ..." 1>&5
8419
8420         cat >conftest.$ac_ext <<_ACEOF
8421 #line 8421 "configure"
8422 #include "confdefs.h"
8423 #include <sys/types.h>
8424 int
8425 main ()
8426 {
8427
8428 #ifndef _POSIX_C_SOURCE
8429 make an error
8430 #endif
8431   ;
8432   return 0;
8433 }
8434 _ACEOF
8435 rm -f conftest.$ac_objext
8436 if { (eval echo "$as_me:8436: \"$ac_compile\"") >&5
8437   (eval $ac_compile) 2>&5
8438   ac_status=$?
8439   echo "$as_me:8439: \$? = $ac_status" >&5
8440   (exit $ac_status); } &&
8441          { ac_try='test -s conftest.$ac_objext'
8442   { (eval echo "$as_me:8442: \"$ac_try\"") >&5
8443   (eval $ac_try) 2>&5
8444   ac_status=$?
8445   echo "$as_me:8445: \$? = $ac_status" >&5
8446   (exit $ac_status); }; }; then
8447   cf_cv_posix_c_source=no
8448 else
8449   echo "$as_me: failed program was:" >&5
8450 cat conftest.$ac_ext >&5
8451 cf_want_posix_source=no
8452          case .$cf_POSIX_C_SOURCE in
8453          (.[12]??*)
8454                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
8455                 ;;
8456          (.2)
8457                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
8458                 cf_want_posix_source=yes
8459                 ;;
8460          (.*)
8461                 cf_want_posix_source=yes
8462                 ;;
8463          esac
8464          if test "$cf_want_posix_source" = yes ; then
8465                 cat >conftest.$ac_ext <<_ACEOF
8466 #line 8466 "configure"
8467 #include "confdefs.h"
8468 #include <sys/types.h>
8469 int
8470 main ()
8471 {
8472
8473 #ifdef _POSIX_SOURCE
8474 make an error
8475 #endif
8476   ;
8477   return 0;
8478 }
8479 _ACEOF
8480 rm -f conftest.$ac_objext
8481 if { (eval echo "$as_me:8481: \"$ac_compile\"") >&5
8482   (eval $ac_compile) 2>&5
8483   ac_status=$?
8484   echo "$as_me:8484: \$? = $ac_status" >&5
8485   (exit $ac_status); } &&
8486          { ac_try='test -s conftest.$ac_objext'
8487   { (eval echo "$as_me:8487: \"$ac_try\"") >&5
8488   (eval $ac_try) 2>&5
8489   ac_status=$?
8490   echo "$as_me:8490: \$? = $ac_status" >&5
8491   (exit $ac_status); }; }; then
8492   :
8493 else
8494   echo "$as_me: failed program was:" >&5
8495 cat conftest.$ac_ext >&5
8496 cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE"
8497 fi
8498 rm -f conftest.$ac_objext conftest.$ac_ext
8499          fi
8500
8501 echo "${as_me:-configure}:8501: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
8502
8503          CFLAGS="$cf_trim_CFLAGS"
8504          CPPFLAGS="$cf_trim_CPPFLAGS $cf_cv_posix_c_source"
8505
8506 echo "${as_me:-configure}:8506: testing if the second compile does not leave our definition intact error ..." 1>&5
8507
8508          cat >conftest.$ac_ext <<_ACEOF
8509 #line 8509 "configure"
8510 #include "confdefs.h"
8511 #include <sys/types.h>
8512 int
8513 main ()
8514 {
8515
8516 #ifndef _POSIX_C_SOURCE
8517 make an error
8518 #endif
8519   ;
8520   return 0;
8521 }
8522 _ACEOF
8523 rm -f conftest.$ac_objext
8524 if { (eval echo "$as_me:8524: \"$ac_compile\"") >&5
8525   (eval $ac_compile) 2>&5
8526   ac_status=$?
8527   echo "$as_me:8527: \$? = $ac_status" >&5
8528   (exit $ac_status); } &&
8529          { ac_try='test -s conftest.$ac_objext'
8530   { (eval echo "$as_me:8530: \"$ac_try\"") >&5
8531   (eval $ac_try) 2>&5
8532   ac_status=$?
8533   echo "$as_me:8533: \$? = $ac_status" >&5
8534   (exit $ac_status); }; }; then
8535   :
8536 else
8537   echo "$as_me: failed program was:" >&5
8538 cat conftest.$ac_ext >&5
8539 cf_cv_posix_c_source=no
8540 fi
8541 rm -f conftest.$ac_objext conftest.$ac_ext
8542          CFLAGS="$cf_save_CFLAGS"
8543          CPPFLAGS="$cf_save_CPPFLAGS"
8544
8545 fi
8546 rm -f conftest.$ac_objext conftest.$ac_ext
8547
8548 fi
8549 echo "$as_me:8549: result: $cf_cv_posix_c_source" >&5
8550 echo "${ECHO_T}$cf_cv_posix_c_source" >&6
8551
8552 if test "$cf_cv_posix_c_source" != no ; then
8553         CFLAGS="$cf_trim_CFLAGS"
8554         CPPFLAGS="$cf_trim_CPPFLAGS"
8555
8556 cf_fix_cppflags=no
8557 cf_new_cflags=
8558 cf_new_cppflags=
8559 cf_new_extra_cppflags=
8560
8561 for cf_add_cflags in $cf_cv_posix_c_source
8562 do
8563 case $cf_fix_cppflags in
8564 (no)
8565         case $cf_add_cflags in
8566         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
8567                 case $cf_add_cflags in
8568                 (-D*)
8569                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
8570
8571                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
8572                                 && test -z "${cf_tst_cflags}" \
8573                                 && cf_fix_cppflags=yes
8574
8575                         if test $cf_fix_cppflags = yes ; then
8576                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
8577                                 continue
8578                         elif test "${cf_tst_cflags}" = "\"'" ; then
8579                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
8580                                 continue
8581                         fi
8582                         ;;
8583                 esac
8584                 case "$CPPFLAGS" in
8585                 (*$cf_add_cflags)
8586                         ;;
8587                 (*)
8588                         case $cf_add_cflags in
8589                         (-D*)
8590                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
8591
8592 CPPFLAGS=`echo "$CPPFLAGS" | \
8593         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
8594                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
8595
8596                                 ;;
8597                         esac
8598                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
8599                         ;;
8600                 esac
8601                 ;;
8602         (*)
8603                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
8604                 ;;
8605         esac
8606         ;;
8607 (yes)
8608         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
8609
8610         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
8611
8612         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
8613                 && test -z "${cf_tst_cflags}" \
8614                 && cf_fix_cppflags=no
8615         ;;
8616 esac
8617 done
8618
8619 if test -n "$cf_new_cflags" ; then
8620
8621         CFLAGS="$CFLAGS $cf_new_cflags"
8622 fi
8623
8624 if test -n "$cf_new_cppflags" ; then
8625
8626         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
8627 fi
8628
8629 if test -n "$cf_new_extra_cppflags" ; then
8630
8631         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
8632 fi
8633
8634 fi
8635
8636         ;;
8637 esac
8638
8639 if test -n "$cf_xopen_source" ; then
8640
8641 cf_fix_cppflags=no
8642 cf_new_cflags=
8643 cf_new_cppflags=
8644 cf_new_extra_cppflags=
8645
8646 for cf_add_cflags in $cf_xopen_source
8647 do
8648 case $cf_fix_cppflags in
8649 (no)
8650         case $cf_add_cflags in
8651         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
8652                 case $cf_add_cflags in
8653                 (-D*)
8654                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
8655
8656                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
8657                                 && test -z "${cf_tst_cflags}" \
8658                                 && cf_fix_cppflags=yes
8659
8660                         if test $cf_fix_cppflags = yes ; then
8661                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
8662                                 continue
8663                         elif test "${cf_tst_cflags}" = "\"'" ; then
8664                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
8665                                 continue
8666                         fi
8667                         ;;
8668                 esac
8669                 case "$CPPFLAGS" in
8670                 (*$cf_add_cflags)
8671                         ;;
8672                 (*)
8673                         case $cf_add_cflags in
8674                         (-D*)
8675                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
8676
8677 CPPFLAGS=`echo "$CPPFLAGS" | \
8678         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
8679                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
8680
8681                                 ;;
8682                         esac
8683                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
8684                         ;;
8685                 esac
8686                 ;;
8687         (*)
8688                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
8689                 ;;
8690         esac
8691         ;;
8692 (yes)
8693         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
8694
8695         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
8696
8697         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
8698                 && test -z "${cf_tst_cflags}" \
8699                 && cf_fix_cppflags=no
8700         ;;
8701 esac
8702 done
8703
8704 if test -n "$cf_new_cflags" ; then
8705         test -n "$verbose" && echo "    add to \$CFLAGS $cf_new_cflags" 1>&6
8706
8707 echo "${as_me:-configure}:8707: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
8708
8709         CFLAGS="$CFLAGS $cf_new_cflags"
8710 fi
8711
8712 if test -n "$cf_new_cppflags" ; then
8713         test -n "$verbose" && echo "    add to \$CPPFLAGS $cf_new_cppflags" 1>&6
8714
8715 echo "${as_me:-configure}:8715: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
8716
8717         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
8718 fi
8719
8720 if test -n "$cf_new_extra_cppflags" ; then
8721         test -n "$verbose" && echo "    add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6
8722
8723 echo "${as_me:-configure}:8723: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
8724
8725         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
8726 fi
8727
8728 fi
8729
8730 if test -n "$cf_XOPEN_SOURCE" && test -z "$cf_cv_xopen_source" ; then
8731         echo "$as_me:8731: checking if _XOPEN_SOURCE really is set" >&5
8732 echo $ECHO_N "checking if _XOPEN_SOURCE really is set... $ECHO_C" >&6
8733         cat >conftest.$ac_ext <<_ACEOF
8734 #line 8734 "configure"
8735 #include "confdefs.h"
8736 #include <stdlib.h>
8737 int
8738 main ()
8739 {
8740
8741 #ifndef _XOPEN_SOURCE
8742 make an error
8743 #endif
8744   ;
8745   return 0;
8746 }
8747 _ACEOF
8748 rm -f conftest.$ac_objext
8749 if { (eval echo "$as_me:8749: \"$ac_compile\"") >&5
8750   (eval $ac_compile) 2>&5
8751   ac_status=$?
8752   echo "$as_me:8752: \$? = $ac_status" >&5
8753   (exit $ac_status); } &&
8754          { ac_try='test -s conftest.$ac_objext'
8755   { (eval echo "$as_me:8755: \"$ac_try\"") >&5
8756   (eval $ac_try) 2>&5
8757   ac_status=$?
8758   echo "$as_me:8758: \$? = $ac_status" >&5
8759   (exit $ac_status); }; }; then
8760   cf_XOPEN_SOURCE_set=yes
8761 else
8762   echo "$as_me: failed program was:" >&5
8763 cat conftest.$ac_ext >&5
8764 cf_XOPEN_SOURCE_set=no
8765 fi
8766 rm -f conftest.$ac_objext conftest.$ac_ext
8767         echo "$as_me:8767: result: $cf_XOPEN_SOURCE_set" >&5
8768 echo "${ECHO_T}$cf_XOPEN_SOURCE_set" >&6
8769         if test $cf_XOPEN_SOURCE_set = yes
8770         then
8771                 cat >conftest.$ac_ext <<_ACEOF
8772 #line 8772 "configure"
8773 #include "confdefs.h"
8774 #include <stdlib.h>
8775 int
8776 main ()
8777 {
8778
8779 #if (_XOPEN_SOURCE - 0) < $cf_XOPEN_SOURCE
8780 make an error
8781 #endif
8782   ;
8783   return 0;
8784 }
8785 _ACEOF
8786 rm -f conftest.$ac_objext
8787 if { (eval echo "$as_me:8787: \"$ac_compile\"") >&5
8788   (eval $ac_compile) 2>&5
8789   ac_status=$?
8790   echo "$as_me:8790: \$? = $ac_status" >&5
8791   (exit $ac_status); } &&
8792          { ac_try='test -s conftest.$ac_objext'
8793   { (eval echo "$as_me:8793: \"$ac_try\"") >&5
8794   (eval $ac_try) 2>&5
8795   ac_status=$?
8796   echo "$as_me:8796: \$? = $ac_status" >&5
8797   (exit $ac_status); }; }; then
8798   cf_XOPEN_SOURCE_set_ok=yes
8799 else
8800   echo "$as_me: failed program was:" >&5
8801 cat conftest.$ac_ext >&5
8802 cf_XOPEN_SOURCE_set_ok=no
8803 fi
8804 rm -f conftest.$ac_objext conftest.$ac_ext
8805                 if test $cf_XOPEN_SOURCE_set_ok = no
8806                 then
8807                         { echo "$as_me:8807: WARNING: _XOPEN_SOURCE is lower than requested" >&5
8808 echo "$as_me: WARNING: _XOPEN_SOURCE is lower than requested" >&2;}
8809                 fi
8810         else
8811
8812 echo "$as_me:8812: checking if we should define _XOPEN_SOURCE" >&5
8813 echo $ECHO_N "checking if we should define _XOPEN_SOURCE... $ECHO_C" >&6
8814 if test "${cf_cv_xopen_source+set}" = set; then
8815   echo $ECHO_N "(cached) $ECHO_C" >&6
8816 else
8817
8818         cat >conftest.$ac_ext <<_ACEOF
8819 #line 8819 "configure"
8820 #include "confdefs.h"
8821
8822 #include <stdlib.h>
8823 #include <string.h>
8824 #include <sys/types.h>
8825
8826 int
8827 main ()
8828 {
8829
8830 #ifndef _XOPEN_SOURCE
8831 make an error
8832 #endif
8833   ;
8834   return 0;
8835 }
8836 _ACEOF
8837 rm -f conftest.$ac_objext
8838 if { (eval echo "$as_me:8838: \"$ac_compile\"") >&5
8839   (eval $ac_compile) 2>&5
8840   ac_status=$?
8841   echo "$as_me:8841: \$? = $ac_status" >&5
8842   (exit $ac_status); } &&
8843          { ac_try='test -s conftest.$ac_objext'
8844   { (eval echo "$as_me:8844: \"$ac_try\"") >&5
8845   (eval $ac_try) 2>&5
8846   ac_status=$?
8847   echo "$as_me:8847: \$? = $ac_status" >&5
8848   (exit $ac_status); }; }; then
8849   cf_cv_xopen_source=no
8850 else
8851   echo "$as_me: failed program was:" >&5
8852 cat conftest.$ac_ext >&5
8853 cf_save="$CPPFLAGS"
8854          CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
8855          cat >conftest.$ac_ext <<_ACEOF
8856 #line 8856 "configure"
8857 #include "confdefs.h"
8858
8859 #include <stdlib.h>
8860 #include <string.h>
8861 #include <sys/types.h>
8862
8863 int
8864 main ()
8865 {
8866
8867 #ifdef _XOPEN_SOURCE
8868 make an error
8869 #endif
8870   ;
8871   return 0;
8872 }
8873 _ACEOF
8874 rm -f conftest.$ac_objext
8875 if { (eval echo "$as_me:8875: \"$ac_compile\"") >&5
8876   (eval $ac_compile) 2>&5
8877   ac_status=$?
8878   echo "$as_me:8878: \$? = $ac_status" >&5
8879   (exit $ac_status); } &&
8880          { ac_try='test -s conftest.$ac_objext'
8881   { (eval echo "$as_me:8881: \"$ac_try\"") >&5
8882   (eval $ac_try) 2>&5
8883   ac_status=$?
8884   echo "$as_me:8884: \$? = $ac_status" >&5
8885   (exit $ac_status); }; }; then
8886   cf_cv_xopen_source=no
8887 else
8888   echo "$as_me: failed program was:" >&5
8889 cat conftest.$ac_ext >&5
8890 cf_cv_xopen_source=$cf_XOPEN_SOURCE
8891 fi
8892 rm -f conftest.$ac_objext conftest.$ac_ext
8893         CPPFLAGS="$cf_save"
8894
8895 fi
8896 rm -f conftest.$ac_objext conftest.$ac_ext
8897
8898 fi
8899 echo "$as_me:8899: result: $cf_cv_xopen_source" >&5
8900 echo "${ECHO_T}$cf_cv_xopen_source" >&6
8901
8902 if test "$cf_cv_xopen_source" != no ; then
8903
8904 CFLAGS=`echo "$CFLAGS" | \
8905         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
8906                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
8907
8908 CPPFLAGS=`echo "$CPPFLAGS" | \
8909         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
8910                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
8911
8912         cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source"
8913
8914 cf_fix_cppflags=no
8915 cf_new_cflags=
8916 cf_new_cppflags=
8917 cf_new_extra_cppflags=
8918
8919 for cf_add_cflags in $cf_temp_xopen_source
8920 do
8921 case $cf_fix_cppflags in
8922 (no)
8923         case $cf_add_cflags in
8924         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
8925                 case $cf_add_cflags in
8926                 (-D*)
8927                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
8928
8929                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
8930                                 && test -z "${cf_tst_cflags}" \
8931                                 && cf_fix_cppflags=yes
8932
8933                         if test $cf_fix_cppflags = yes ; then
8934                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
8935                                 continue
8936                         elif test "${cf_tst_cflags}" = "\"'" ; then
8937                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
8938                                 continue
8939                         fi
8940                         ;;
8941                 esac
8942                 case "$CPPFLAGS" in
8943                 (*$cf_add_cflags)
8944                         ;;
8945                 (*)
8946                         case $cf_add_cflags in
8947                         (-D*)
8948                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
8949
8950 CPPFLAGS=`echo "$CPPFLAGS" | \
8951         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
8952                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
8953
8954                                 ;;
8955                         esac
8956                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
8957                         ;;
8958                 esac
8959                 ;;
8960         (*)
8961                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
8962                 ;;
8963         esac
8964         ;;
8965 (yes)
8966         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
8967
8968         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
8969
8970         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
8971                 && test -z "${cf_tst_cflags}" \
8972                 && cf_fix_cppflags=no
8973         ;;
8974 esac
8975 done
8976
8977 if test -n "$cf_new_cflags" ; then
8978
8979         CFLAGS="$CFLAGS $cf_new_cflags"
8980 fi
8981
8982 if test -n "$cf_new_cppflags" ; then
8983
8984         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
8985 fi
8986
8987 if test -n "$cf_new_extra_cppflags" ; then
8988
8989         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
8990 fi
8991
8992 fi
8993
8994         fi
8995 fi
8996
8997 # Check whether --enable-largefile or --disable-largefile was given.
8998 if test "${enable_largefile+set}" = set; then
8999   enableval="$enable_largefile"
9000
9001 fi;
9002 if test "$enable_largefile" != no; then
9003
9004   echo "$as_me:9004: checking for special C compiler options needed for large files" >&5
9005 echo $ECHO_N "checking for special C compiler options needed for large files... $ECHO_C" >&6
9006 if test "${ac_cv_sys_largefile_CC+set}" = set; then
9007   echo $ECHO_N "(cached) $ECHO_C" >&6
9008 else
9009   ac_cv_sys_largefile_CC=no
9010      if test "$GCC" != yes; then
9011        ac_save_CC=$CC
9012        while :; do
9013          # IRIX 6.2 and later do not support large files by default,
9014          # so use the C compiler's -n32 option if that helps.
9015          cat >conftest.$ac_ext <<_ACEOF
9016 #line 9016 "configure"
9017 #include "confdefs.h"
9018 #include <sys/types.h>
9019  /* Check that off_t can represent 2**63 - 1 correctly.
9020     We can't simply define LARGE_OFF_T to be 9223372036854775807,
9021     since some C++ compilers masquerading as C compilers
9022     incorrectly reject 9223372036854775807.  */
9023 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
9024   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
9025                        && LARGE_OFF_T % 2147483647 == 1)
9026                       ? 1 : -1];
9027 int
9028 main ()
9029 {
9030
9031   ;
9032   return 0;
9033 }
9034 _ACEOF
9035          rm -f conftest.$ac_objext
9036 if { (eval echo "$as_me:9036: \"$ac_compile\"") >&5
9037   (eval $ac_compile) 2>&5
9038   ac_status=$?
9039   echo "$as_me:9039: \$? = $ac_status" >&5
9040   (exit $ac_status); } &&
9041          { ac_try='test -s conftest.$ac_objext'
9042   { (eval echo "$as_me:9042: \"$ac_try\"") >&5
9043   (eval $ac_try) 2>&5
9044   ac_status=$?
9045   echo "$as_me:9045: \$? = $ac_status" >&5
9046   (exit $ac_status); }; }; then
9047   break
9048 else
9049   echo "$as_me: failed program was:" >&5
9050 cat conftest.$ac_ext >&5
9051 fi
9052 rm -f conftest.$ac_objext
9053          CC="$CC -n32"
9054          rm -f conftest.$ac_objext
9055 if { (eval echo "$as_me:9055: \"$ac_compile\"") >&5
9056   (eval $ac_compile) 2>&5
9057   ac_status=$?
9058   echo "$as_me:9058: \$? = $ac_status" >&5
9059   (exit $ac_status); } &&
9060          { ac_try='test -s conftest.$ac_objext'
9061   { (eval echo "$as_me:9061: \"$ac_try\"") >&5
9062   (eval $ac_try) 2>&5
9063   ac_status=$?
9064   echo "$as_me:9064: \$? = $ac_status" >&5
9065   (exit $ac_status); }; }; then
9066   ac_cv_sys_largefile_CC=' -n32'; break
9067 else
9068   echo "$as_me: failed program was:" >&5
9069 cat conftest.$ac_ext >&5
9070 fi
9071 rm -f conftest.$ac_objext
9072          break
9073        done
9074        CC=$ac_save_CC
9075        rm -f conftest.$ac_ext
9076     fi
9077 fi
9078 echo "$as_me:9078: result: $ac_cv_sys_largefile_CC" >&5
9079 echo "${ECHO_T}$ac_cv_sys_largefile_CC" >&6
9080   if test "$ac_cv_sys_largefile_CC" != no; then
9081     CC=$CC$ac_cv_sys_largefile_CC
9082   fi
9083
9084   echo "$as_me:9084: checking for _FILE_OFFSET_BITS value needed for large files" >&5
9085 echo $ECHO_N "checking for _FILE_OFFSET_BITS value needed for large files... $ECHO_C" >&6
9086 if test "${ac_cv_sys_file_offset_bits+set}" = set; then
9087   echo $ECHO_N "(cached) $ECHO_C" >&6
9088 else
9089   while :; do
9090   ac_cv_sys_file_offset_bits=no
9091   cat >conftest.$ac_ext <<_ACEOF
9092 #line 9092 "configure"
9093 #include "confdefs.h"
9094 #include <sys/types.h>
9095  /* Check that off_t can represent 2**63 - 1 correctly.
9096     We can't simply define LARGE_OFF_T to be 9223372036854775807,
9097     since some C++ compilers masquerading as C compilers
9098     incorrectly reject 9223372036854775807.  */
9099 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
9100   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
9101                        && LARGE_OFF_T % 2147483647 == 1)
9102                       ? 1 : -1];
9103 int
9104 main ()
9105 {
9106
9107   ;
9108   return 0;
9109 }
9110 _ACEOF
9111 rm -f conftest.$ac_objext
9112 if { (eval echo "$as_me:9112: \"$ac_compile\"") >&5
9113   (eval $ac_compile) 2>&5
9114   ac_status=$?
9115   echo "$as_me:9115: \$? = $ac_status" >&5
9116   (exit $ac_status); } &&
9117          { ac_try='test -s conftest.$ac_objext'
9118   { (eval echo "$as_me:9118: \"$ac_try\"") >&5
9119   (eval $ac_try) 2>&5
9120   ac_status=$?
9121   echo "$as_me:9121: \$? = $ac_status" >&5
9122   (exit $ac_status); }; }; then
9123   break
9124 else
9125   echo "$as_me: failed program was:" >&5
9126 cat conftest.$ac_ext >&5
9127 fi
9128 rm -f conftest.$ac_objext conftest.$ac_ext
9129   cat >conftest.$ac_ext <<_ACEOF
9130 #line 9130 "configure"
9131 #include "confdefs.h"
9132 #define _FILE_OFFSET_BITS 64
9133 #include <sys/types.h>
9134  /* Check that off_t can represent 2**63 - 1 correctly.
9135     We can't simply define LARGE_OFF_T to be 9223372036854775807,
9136     since some C++ compilers masquerading as C compilers
9137     incorrectly reject 9223372036854775807.  */
9138 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
9139   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
9140                        && LARGE_OFF_T % 2147483647 == 1)
9141                       ? 1 : -1];
9142 int
9143 main ()
9144 {
9145
9146   ;
9147   return 0;
9148 }
9149 _ACEOF
9150 rm -f conftest.$ac_objext
9151 if { (eval echo "$as_me:9151: \"$ac_compile\"") >&5
9152   (eval $ac_compile) 2>&5
9153   ac_status=$?
9154   echo "$as_me:9154: \$? = $ac_status" >&5
9155   (exit $ac_status); } &&
9156          { ac_try='test -s conftest.$ac_objext'
9157   { (eval echo "$as_me:9157: \"$ac_try\"") >&5
9158   (eval $ac_try) 2>&5
9159   ac_status=$?
9160   echo "$as_me:9160: \$? = $ac_status" >&5
9161   (exit $ac_status); }; }; then
9162   ac_cv_sys_file_offset_bits=64; break
9163 else
9164   echo "$as_me: failed program was:" >&5
9165 cat conftest.$ac_ext >&5
9166 fi
9167 rm -f conftest.$ac_objext conftest.$ac_ext
9168   break
9169 done
9170 fi
9171 echo "$as_me:9171: result: $ac_cv_sys_file_offset_bits" >&5
9172 echo "${ECHO_T}$ac_cv_sys_file_offset_bits" >&6
9173 if test "$ac_cv_sys_file_offset_bits" != no; then
9174
9175 cat >>confdefs.h <<EOF
9176 #define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits
9177 EOF
9178
9179 fi
9180 rm -rf conftest*
9181   echo "$as_me:9181: checking for _LARGE_FILES value needed for large files" >&5
9182 echo $ECHO_N "checking for _LARGE_FILES value needed for large files... $ECHO_C" >&6
9183 if test "${ac_cv_sys_large_files+set}" = set; then
9184   echo $ECHO_N "(cached) $ECHO_C" >&6
9185 else
9186   while :; do
9187   ac_cv_sys_large_files=no
9188   cat >conftest.$ac_ext <<_ACEOF
9189 #line 9189 "configure"
9190 #include "confdefs.h"
9191 #include <sys/types.h>
9192  /* Check that off_t can represent 2**63 - 1 correctly.
9193     We can't simply define LARGE_OFF_T to be 9223372036854775807,
9194     since some C++ compilers masquerading as C compilers
9195     incorrectly reject 9223372036854775807.  */
9196 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
9197   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
9198                        && LARGE_OFF_T % 2147483647 == 1)
9199                       ? 1 : -1];
9200 int
9201 main ()
9202 {
9203
9204   ;
9205   return 0;
9206 }
9207 _ACEOF
9208 rm -f conftest.$ac_objext
9209 if { (eval echo "$as_me:9209: \"$ac_compile\"") >&5
9210   (eval $ac_compile) 2>&5
9211   ac_status=$?
9212   echo "$as_me:9212: \$? = $ac_status" >&5
9213   (exit $ac_status); } &&
9214          { ac_try='test -s conftest.$ac_objext'
9215   { (eval echo "$as_me:9215: \"$ac_try\"") >&5
9216   (eval $ac_try) 2>&5
9217   ac_status=$?
9218   echo "$as_me:9218: \$? = $ac_status" >&5
9219   (exit $ac_status); }; }; then
9220   break
9221 else
9222   echo "$as_me: failed program was:" >&5
9223 cat conftest.$ac_ext >&5
9224 fi
9225 rm -f conftest.$ac_objext conftest.$ac_ext
9226   cat >conftest.$ac_ext <<_ACEOF
9227 #line 9227 "configure"
9228 #include "confdefs.h"
9229 #define _LARGE_FILES 1
9230 #include <sys/types.h>
9231  /* Check that off_t can represent 2**63 - 1 correctly.
9232     We can't simply define LARGE_OFF_T to be 9223372036854775807,
9233     since some C++ compilers masquerading as C compilers
9234     incorrectly reject 9223372036854775807.  */
9235 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
9236   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
9237                        && LARGE_OFF_T % 2147483647 == 1)
9238                       ? 1 : -1];
9239 int
9240 main ()
9241 {
9242
9243   ;
9244   return 0;
9245 }
9246 _ACEOF
9247 rm -f conftest.$ac_objext
9248 if { (eval echo "$as_me:9248: \"$ac_compile\"") >&5
9249   (eval $ac_compile) 2>&5
9250   ac_status=$?
9251   echo "$as_me:9251: \$? = $ac_status" >&5
9252   (exit $ac_status); } &&
9253          { ac_try='test -s conftest.$ac_objext'
9254   { (eval echo "$as_me:9254: \"$ac_try\"") >&5
9255   (eval $ac_try) 2>&5
9256   ac_status=$?
9257   echo "$as_me:9257: \$? = $ac_status" >&5
9258   (exit $ac_status); }; }; then
9259   ac_cv_sys_large_files=1; break
9260 else
9261   echo "$as_me: failed program was:" >&5
9262 cat conftest.$ac_ext >&5
9263 fi
9264 rm -f conftest.$ac_objext conftest.$ac_ext
9265   break
9266 done
9267 fi
9268 echo "$as_me:9268: result: $ac_cv_sys_large_files" >&5
9269 echo "${ECHO_T}$ac_cv_sys_large_files" >&6
9270 if test "$ac_cv_sys_large_files" != no; then
9271
9272 cat >>confdefs.h <<EOF
9273 #define _LARGE_FILES $ac_cv_sys_large_files
9274 EOF
9275
9276 fi
9277 rm -rf conftest*
9278 fi
9279
9280         if test "$enable_largefile" != no ; then
9281         echo "$as_me:9281: checking for _LARGEFILE_SOURCE value needed for large files" >&5
9282 echo $ECHO_N "checking for _LARGEFILE_SOURCE value needed for large files... $ECHO_C" >&6
9283 if test "${ac_cv_sys_largefile_source+set}" = set; then
9284   echo $ECHO_N "(cached) $ECHO_C" >&6
9285 else
9286   while :; do
9287   ac_cv_sys_largefile_source=no
9288   cat >conftest.$ac_ext <<_ACEOF
9289 #line 9289 "configure"
9290 #include "confdefs.h"
9291 #include <stdio.h>
9292 int
9293 main ()
9294 {
9295 return !fseeko;
9296   ;
9297   return 0;
9298 }
9299 _ACEOF
9300 rm -f conftest.$ac_objext
9301 if { (eval echo "$as_me:9301: \"$ac_compile\"") >&5
9302   (eval $ac_compile) 2>&5
9303   ac_status=$?
9304   echo "$as_me:9304: \$? = $ac_status" >&5
9305   (exit $ac_status); } &&
9306          { ac_try='test -s conftest.$ac_objext'
9307   { (eval echo "$as_me:9307: \"$ac_try\"") >&5
9308   (eval $ac_try) 2>&5
9309   ac_status=$?
9310   echo "$as_me:9310: \$? = $ac_status" >&5
9311   (exit $ac_status); }; }; then
9312   break
9313 else
9314   echo "$as_me: failed program was:" >&5
9315 cat conftest.$ac_ext >&5
9316 fi
9317 rm -f conftest.$ac_objext conftest.$ac_ext
9318   cat >conftest.$ac_ext <<_ACEOF
9319 #line 9319 "configure"
9320 #include "confdefs.h"
9321 #define _LARGEFILE_SOURCE 1
9322 #include <stdio.h>
9323 int
9324 main ()
9325 {
9326 return !fseeko;
9327   ;
9328   return 0;
9329 }
9330 _ACEOF
9331 rm -f conftest.$ac_objext
9332 if { (eval echo "$as_me:9332: \"$ac_compile\"") >&5
9333   (eval $ac_compile) 2>&5
9334   ac_status=$?
9335   echo "$as_me:9335: \$? = $ac_status" >&5
9336   (exit $ac_status); } &&
9337          { ac_try='test -s conftest.$ac_objext'
9338   { (eval echo "$as_me:9338: \"$ac_try\"") >&5
9339   (eval $ac_try) 2>&5
9340   ac_status=$?
9341   echo "$as_me:9341: \$? = $ac_status" >&5
9342   (exit $ac_status); }; }; then
9343   ac_cv_sys_largefile_source=1; break
9344 else
9345   echo "$as_me: failed program was:" >&5
9346 cat conftest.$ac_ext >&5
9347 fi
9348 rm -f conftest.$ac_objext conftest.$ac_ext
9349   break
9350 done
9351 fi
9352 echo "$as_me:9352: result: $ac_cv_sys_largefile_source" >&5
9353 echo "${ECHO_T}$ac_cv_sys_largefile_source" >&6
9354 if test "$ac_cv_sys_largefile_source" != no; then
9355
9356 cat >>confdefs.h <<EOF
9357 #define _LARGEFILE_SOURCE $ac_cv_sys_largefile_source
9358 EOF
9359
9360 fi
9361 rm -rf conftest*
9362
9363 # We used to try defining _XOPEN_SOURCE=500 too, to work around a bug
9364 # in glibc 2.1.3, but that breaks too many other things.
9365 # If you want fseeko and ftello with glibc, upgrade to a fixed glibc.
9366 echo "$as_me:9366: checking for fseeko" >&5
9367 echo $ECHO_N "checking for fseeko... $ECHO_C" >&6
9368 if test "${ac_cv_func_fseeko+set}" = set; then
9369   echo $ECHO_N "(cached) $ECHO_C" >&6
9370 else
9371   cat >conftest.$ac_ext <<_ACEOF
9372 #line 9372 "configure"
9373 #include "confdefs.h"
9374 #include <stdio.h>
9375 int
9376 main ()
9377 {
9378 return fseeko && fseeko (stdin, 0, 0);
9379   ;
9380   return 0;
9381 }
9382 _ACEOF
9383 rm -f conftest.$ac_objext conftest$ac_exeext
9384 if { (eval echo "$as_me:9384: \"$ac_link\"") >&5
9385   (eval $ac_link) 2>&5
9386   ac_status=$?
9387   echo "$as_me:9387: \$? = $ac_status" >&5
9388   (exit $ac_status); } &&
9389          { ac_try='test -s conftest$ac_exeext'
9390   { (eval echo "$as_me:9390: \"$ac_try\"") >&5
9391   (eval $ac_try) 2>&5
9392   ac_status=$?
9393   echo "$as_me:9393: \$? = $ac_status" >&5
9394   (exit $ac_status); }; }; then
9395   ac_cv_func_fseeko=yes
9396 else
9397   echo "$as_me: failed program was:" >&5
9398 cat conftest.$ac_ext >&5
9399 ac_cv_func_fseeko=no
9400 fi
9401 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9402 fi
9403 echo "$as_me:9403: result: $ac_cv_func_fseeko" >&5
9404 echo "${ECHO_T}$ac_cv_func_fseeko" >&6
9405 if test $ac_cv_func_fseeko = yes; then
9406
9407 cat >>confdefs.h <<\EOF
9408 #define HAVE_FSEEKO 1
9409 EOF
9410
9411 fi
9412
9413         # Normally we would collect these definitions in the config.h,
9414         # but (like _XOPEN_SOURCE), some environments rely on having these
9415         # defined before any of the system headers are included.  Another
9416         # case comes up with C++, e.g., on AIX the compiler compiles the
9417         # header files by themselves before looking at the body files it is
9418         # told to compile.  For ncurses, those header files do not include
9419         # the config.h
9420         test "$ac_cv_sys_large_files"      != no && CPPFLAGS="$CPPFLAGS -D_LARGE_FILES "
9421         test "$ac_cv_sys_largefile_source" != no && CPPFLAGS="$CPPFLAGS -D_LARGEFILE_SOURCE "
9422         test "$ac_cv_sys_file_offset_bits" != no && CPPFLAGS="$CPPFLAGS -D_FILE_OFFSET_BITS=$ac_cv_sys_file_offset_bits "
9423
9424         echo "$as_me:9424: checking whether to use struct dirent64" >&5
9425 echo $ECHO_N "checking whether to use struct dirent64... $ECHO_C" >&6
9426 if test "${cf_cv_struct_dirent64+set}" = set; then
9427   echo $ECHO_N "(cached) $ECHO_C" >&6
9428 else
9429
9430                 cat >conftest.$ac_ext <<_ACEOF
9431 #line 9431 "configure"
9432 #include "confdefs.h"
9433
9434 #include <sys/types.h>
9435 #include <dirent.h>
9436
9437 int
9438 main ()
9439 {
9440
9441                 /* if transitional largefile support is setup, this is true */
9442                 extern struct dirent64 * readdir(DIR *);
9443                 struct dirent64 *x = readdir((DIR *)0);
9444                 struct dirent *y = readdir((DIR *)0);
9445                 int z = x - y;
9446
9447   ;
9448   return 0;
9449 }
9450 _ACEOF
9451 rm -f conftest.$ac_objext
9452 if { (eval echo "$as_me:9452: \"$ac_compile\"") >&5
9453   (eval $ac_compile) 2>&5
9454   ac_status=$?
9455   echo "$as_me:9455: \$? = $ac_status" >&5
9456   (exit $ac_status); } &&
9457          { ac_try='test -s conftest.$ac_objext'
9458   { (eval echo "$as_me:9458: \"$ac_try\"") >&5
9459   (eval $ac_try) 2>&5
9460   ac_status=$?
9461   echo "$as_me:9461: \$? = $ac_status" >&5
9462   (exit $ac_status); }; }; then
9463   cf_cv_struct_dirent64=yes
9464 else
9465   echo "$as_me: failed program was:" >&5
9466 cat conftest.$ac_ext >&5
9467 cf_cv_struct_dirent64=no
9468 fi
9469 rm -f conftest.$ac_objext conftest.$ac_ext
9470
9471 fi
9472 echo "$as_me:9472: result: $cf_cv_struct_dirent64" >&5
9473 echo "${ECHO_T}$cf_cv_struct_dirent64" >&6
9474         test "$cf_cv_struct_dirent64" = yes &&
9475 cat >>confdefs.h <<\EOF
9476 #define HAVE_STRUCT_DIRENT64 1
9477 EOF
9478
9479         fi
9480
9481 ### Enable compiling-in rcs id's
9482 echo "$as_me:9482: checking if RCS identifiers should be compiled-in" >&5
9483 echo $ECHO_N "checking if RCS identifiers should be compiled-in... $ECHO_C" >&6
9484
9485 # Check whether --with-rcs-ids or --without-rcs-ids was given.
9486 if test "${with_rcs_ids+set}" = set; then
9487   withval="$with_rcs_ids"
9488   with_rcs_ids=$withval
9489 else
9490   with_rcs_ids=no
9491 fi;
9492 echo "$as_me:9492: result: $with_rcs_ids" >&5
9493 echo "${ECHO_T}$with_rcs_ids" >&6
9494 test "$with_rcs_ids" = yes &&
9495 cat >>confdefs.h <<\EOF
9496 #define USE_RCS_IDS 1
9497 EOF
9498
9499 ###############################################################################
9500
9501 ### Note that some functions (such as const) are normally disabled anyway.
9502 echo "$as_me:9502: checking if you want to build with function extensions" >&5
9503 echo $ECHO_N "checking if you want to build with function extensions... $ECHO_C" >&6
9504
9505 # Check whether --enable-ext-funcs or --disable-ext-funcs was given.
9506 if test "${enable_ext_funcs+set}" = set; then
9507   enableval="$enable_ext_funcs"
9508   with_ext_funcs=$enableval
9509 else
9510   with_ext_funcs=yes
9511 fi;
9512 echo "$as_me:9512: result: $with_ext_funcs" >&5
9513 echo "${ECHO_T}$with_ext_funcs" >&6
9514 if test "$with_ext_funcs" = yes ; then
9515         NCURSES_EXT_FUNCS=1
9516
9517 cat >>confdefs.h <<\EOF
9518 #define HAVE_USE_DEFAULT_COLORS 1
9519 EOF
9520
9521 cat >>confdefs.h <<\EOF
9522 #define NCURSES_EXT_FUNCS 1
9523 EOF
9524
9525 else
9526         NCURSES_EXT_FUNCS=0
9527 fi
9528
9529 ###   use option --enable-const to turn on use of const beyond that in XSI.
9530 echo "$as_me:9530: checking for extended use of const keyword" >&5
9531 echo $ECHO_N "checking for extended use of const keyword... $ECHO_C" >&6
9532
9533 # Check whether --enable-const or --disable-const was given.
9534 if test "${enable_const+set}" = set; then
9535   enableval="$enable_const"
9536   with_ext_const=$enableval
9537 else
9538   with_ext_const=no
9539 fi;
9540 echo "$as_me:9540: result: $with_ext_const" >&5
9541 echo "${ECHO_T}$with_ext_const" >&6
9542 NCURSES_CONST='/*nothing*/'
9543 if test "$with_ext_const" = yes ; then
9544         NCURSES_CONST=const
9545 fi
9546
9547 ###############################################################################
9548 # These options are relatively safe to experiment with.
9549
9550 echo "$as_me:9550: checking if you want all development code" >&5
9551 echo $ECHO_N "checking if you want all development code... $ECHO_C" >&6
9552
9553 # Check whether --with-develop or --without-develop was given.
9554 if test "${with_develop+set}" = set; then
9555   withval="$with_develop"
9556   with_develop=$withval
9557 else
9558   with_develop=no
9559 fi;
9560 echo "$as_me:9560: result: $with_develop" >&5
9561 echo "${ECHO_T}$with_develop" >&6
9562
9563 ###############################################################################
9564 # These are just experimental, probably should not be in a package:
9565
9566 # This is still experimental (20080329), but should ultimately be moved to
9567 # the script-block --with-normal, etc.
9568
9569 echo "$as_me:9569: checking if you want to link with the pthread library" >&5
9570 echo $ECHO_N "checking if you want to link with the pthread library... $ECHO_C" >&6
9571
9572 # Check whether --with-pthread or --without-pthread was given.
9573 if test "${with_pthread+set}" = set; then
9574   withval="$with_pthread"
9575   with_pthread=$withval
9576 else
9577   with_pthread=no
9578 fi;
9579 echo "$as_me:9579: result: $with_pthread" >&5
9580 echo "${ECHO_T}$with_pthread" >&6
9581
9582 if test "$with_pthread" != no ; then
9583         echo "$as_me:9583: checking for pthread.h" >&5
9584 echo $ECHO_N "checking for pthread.h... $ECHO_C" >&6
9585 if test "${ac_cv_header_pthread_h+set}" = set; then
9586   echo $ECHO_N "(cached) $ECHO_C" >&6
9587 else
9588   cat >conftest.$ac_ext <<_ACEOF
9589 #line 9589 "configure"
9590 #include "confdefs.h"
9591 #include <pthread.h>
9592 _ACEOF
9593 if { (eval echo "$as_me:9593: \"$ac_cpp conftest.$ac_ext\"") >&5
9594   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
9595   ac_status=$?
9596   egrep -v '^ *\+' conftest.er1 >conftest.err
9597   rm -f conftest.er1
9598   cat conftest.err >&5
9599   echo "$as_me:9599: \$? = $ac_status" >&5
9600   (exit $ac_status); } >/dev/null; then
9601   if test -s conftest.err; then
9602     ac_cpp_err=$ac_c_preproc_warn_flag
9603   else
9604     ac_cpp_err=
9605   fi
9606 else
9607   ac_cpp_err=yes
9608 fi
9609 if test -z "$ac_cpp_err"; then
9610   ac_cv_header_pthread_h=yes
9611 else
9612   echo "$as_me: failed program was:" >&5
9613   cat conftest.$ac_ext >&5
9614   ac_cv_header_pthread_h=no
9615 fi
9616 rm -f conftest.err conftest.$ac_ext
9617 fi
9618 echo "$as_me:9618: result: $ac_cv_header_pthread_h" >&5
9619 echo "${ECHO_T}$ac_cv_header_pthread_h" >&6
9620 if test $ac_cv_header_pthread_h = yes; then
9621
9622 cat >>confdefs.h <<\EOF
9623 #define HAVE_PTHREADS_H 1
9624 EOF
9625
9626         for cf_lib_pthread in pthread c_r
9627         do
9628             echo "$as_me:9628: checking if we can link with the $cf_lib_pthread library" >&5
9629 echo $ECHO_N "checking if we can link with the $cf_lib_pthread library... $ECHO_C" >&6
9630             cf_save_LIBS="$LIBS"
9631
9632 cf_add_libs="-l$cf_lib_pthread"
9633 # Filter out duplicates - this happens with badly-designed ".pc" files...
9634 for cf_add_1lib in $LIBS
9635 do
9636         for cf_add_2lib in $cf_add_libs
9637         do
9638                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
9639                 then
9640                         cf_add_1lib=
9641                         break
9642                 fi
9643         done
9644         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
9645 done
9646 LIBS="$cf_add_libs"
9647
9648             cat >conftest.$ac_ext <<_ACEOF
9649 #line 9649 "configure"
9650 #include "confdefs.h"
9651
9652 #include <pthread.h>
9653
9654 int
9655 main ()
9656 {
9657
9658                 int rc = pthread_create(0,0,0,0);
9659                 int r2 = pthread_mutexattr_settype(0, 0);
9660
9661   ;
9662   return 0;
9663 }
9664 _ACEOF
9665 rm -f conftest.$ac_objext conftest$ac_exeext
9666 if { (eval echo "$as_me:9666: \"$ac_link\"") >&5
9667   (eval $ac_link) 2>&5
9668   ac_status=$?
9669   echo "$as_me:9669: \$? = $ac_status" >&5
9670   (exit $ac_status); } &&
9671          { ac_try='test -s conftest$ac_exeext'
9672   { (eval echo "$as_me:9672: \"$ac_try\"") >&5
9673   (eval $ac_try) 2>&5
9674   ac_status=$?
9675   echo "$as_me:9675: \$? = $ac_status" >&5
9676   (exit $ac_status); }; }; then
9677   with_pthread=yes
9678 else
9679   echo "$as_me: failed program was:" >&5
9680 cat conftest.$ac_ext >&5
9681 with_pthread=no
9682 fi
9683 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9684             LIBS="$cf_save_LIBS"
9685             echo "$as_me:9685: result: $with_pthread" >&5
9686 echo "${ECHO_T}$with_pthread" >&6
9687             test "$with_pthread" = yes && break
9688         done
9689
9690         if test "$with_pthread" = yes ; then
9691
9692 cf_add_libs="-l$cf_lib_pthread"
9693 # Filter out duplicates - this happens with badly-designed ".pc" files...
9694 for cf_add_1lib in $LIBS
9695 do
9696         for cf_add_2lib in $cf_add_libs
9697         do
9698                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
9699                 then
9700                         cf_add_1lib=
9701                         break
9702                 fi
9703         done
9704         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
9705 done
9706 LIBS="$cf_add_libs"
9707
9708 cat >>confdefs.h <<\EOF
9709 #define HAVE_LIBPTHREADS 1
9710 EOF
9711
9712         else
9713             { { echo "$as_me:9713: error: Cannot link with pthread library" >&5
9714 echo "$as_me: error: Cannot link with pthread library" >&2;}
9715    { (exit 1); exit 1; }; }
9716         fi
9717
9718 fi
9719
9720 fi
9721
9722 echo "$as_me:9722: checking if you want to use weak-symbols for pthreads" >&5
9723 echo $ECHO_N "checking if you want to use weak-symbols for pthreads... $ECHO_C" >&6
9724
9725 # Check whether --enable-weak-symbols or --disable-weak-symbols was given.
9726 if test "${enable_weak_symbols+set}" = set; then
9727   enableval="$enable_weak_symbols"
9728   use_weak_symbols=$withval
9729 else
9730   use_weak_symbols=no
9731 fi;
9732 echo "$as_me:9732: result: $use_weak_symbols" >&5
9733 echo "${ECHO_T}$use_weak_symbols" >&6
9734 if test "$use_weak_symbols" = yes ; then
9735
9736 echo "$as_me:9736: checking if $CC supports weak symbols" >&5
9737 echo $ECHO_N "checking if $CC supports weak symbols... $ECHO_C" >&6
9738 if test "${cf_cv_weak_symbols+set}" = set; then
9739   echo $ECHO_N "(cached) $ECHO_C" >&6
9740 else
9741
9742 cat >conftest.$ac_ext <<_ACEOF
9743 #line 9743 "configure"
9744 #include "confdefs.h"
9745
9746 #include <stdio.h>
9747 int
9748 main ()
9749 {
9750
9751 #if defined(__GNUC__)
9752 #  if defined __USE_ISOC99
9753 #    define _cat_pragma(exp)    _Pragma(#exp)
9754 #    define _weak_pragma(exp)   _cat_pragma(weak name)
9755 #  else
9756 #    define _weak_pragma(exp)
9757 #  endif
9758 #  define _declare(name)        __extension__ extern __typeof__(name) name
9759 #  define weak_symbol(name)     _weak_pragma(name) _declare(name) __attribute__((weak))
9760 #endif
9761
9762 weak_symbol(fopen);
9763
9764   ;
9765   return 0;
9766 }
9767 _ACEOF
9768 rm -f conftest.$ac_objext
9769 if { (eval echo "$as_me:9769: \"$ac_compile\"") >&5
9770   (eval $ac_compile) 2>&5
9771   ac_status=$?
9772   echo "$as_me:9772: \$? = $ac_status" >&5
9773   (exit $ac_status); } &&
9774          { ac_try='test -s conftest.$ac_objext'
9775   { (eval echo "$as_me:9775: \"$ac_try\"") >&5
9776   (eval $ac_try) 2>&5
9777   ac_status=$?
9778   echo "$as_me:9778: \$? = $ac_status" >&5
9779   (exit $ac_status); }; }; then
9780   cf_cv_weak_symbols=yes
9781 else
9782   echo "$as_me: failed program was:" >&5
9783 cat conftest.$ac_ext >&5
9784 cf_cv_weak_symbols=no
9785 fi
9786 rm -f conftest.$ac_objext conftest.$ac_ext
9787
9788 fi
9789 echo "$as_me:9789: result: $cf_cv_weak_symbols" >&5
9790 echo "${ECHO_T}$cf_cv_weak_symbols" >&6
9791
9792 else
9793         cf_cv_weak_symbols=no
9794 fi
9795
9796 if test $cf_cv_weak_symbols = yes ; then
9797
9798 cat >>confdefs.h <<\EOF
9799 #define USE_WEAK_SYMBOLS 1
9800 EOF
9801
9802 fi
9803
9804 PTHREAD=
9805 if test "$with_pthread" = "yes" ; then
9806
9807 cat >>confdefs.h <<\EOF
9808 #define USE_PTHREADS 1
9809 EOF
9810
9811         enable_reentrant=yes
9812         if test $cf_cv_weak_symbols = yes ; then
9813                 PTHREAD=-lpthread
9814         fi
9815 fi
9816
9817 # OpenSUSE is installing ncurses6, using reentrant option.
9818 echo "$as_me:9818: checking for _nc_TABSIZE" >&5
9819 echo $ECHO_N "checking for _nc_TABSIZE... $ECHO_C" >&6
9820 if test "${ac_cv_func__nc_TABSIZE+set}" = set; then
9821   echo $ECHO_N "(cached) $ECHO_C" >&6
9822 else
9823   cat >conftest.$ac_ext <<_ACEOF
9824 #line 9824 "configure"
9825 #include "confdefs.h"
9826 /* System header to define __stub macros and hopefully few prototypes,
9827     which can conflict with char _nc_TABSIZE (); below.  */
9828 #include <assert.h>
9829 /* Override any gcc2 internal prototype to avoid an error.  */
9830 #ifdef __cplusplus
9831 extern "C"
9832 #endif
9833 /* We use char because int might match the return type of a gcc2
9834    builtin and then its argument prototype would still apply.  */
9835 char _nc_TABSIZE ();
9836 char (*f) ();
9837
9838 int
9839 main ()
9840 {
9841 /* The GNU C library defines this for functions which it implements
9842     to always fail with ENOSYS.  Some functions are actually named
9843     something starting with __ and the normal name is an alias.  */
9844 #if defined (__stub__nc_TABSIZE) || defined (__stub____nc_TABSIZE)
9845 choke me
9846 #else
9847 f = _nc_TABSIZE; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
9848 #endif
9849
9850   ;
9851   return 0;
9852 }
9853 _ACEOF
9854 rm -f conftest.$ac_objext conftest$ac_exeext
9855 if { (eval echo "$as_me:9855: \"$ac_link\"") >&5
9856   (eval $ac_link) 2>&5
9857   ac_status=$?
9858   echo "$as_me:9858: \$? = $ac_status" >&5
9859   (exit $ac_status); } &&
9860          { ac_try='test -s conftest$ac_exeext'
9861   { (eval echo "$as_me:9861: \"$ac_try\"") >&5
9862   (eval $ac_try) 2>&5
9863   ac_status=$?
9864   echo "$as_me:9864: \$? = $ac_status" >&5
9865   (exit $ac_status); }; }; then
9866   ac_cv_func__nc_TABSIZE=yes
9867 else
9868   echo "$as_me: failed program was:" >&5
9869 cat conftest.$ac_ext >&5
9870 ac_cv_func__nc_TABSIZE=no
9871 fi
9872 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9873 fi
9874 echo "$as_me:9874: result: $ac_cv_func__nc_TABSIZE" >&5
9875 echo "${ECHO_T}$ac_cv_func__nc_TABSIZE" >&6
9876 if test $ac_cv_func__nc_TABSIZE = yes; then
9877   assume_reentrant=yes
9878 else
9879   assume_reentrant=no
9880 fi
9881
9882 # Reentrant code has to be opaque; there's little advantage to making ncurses
9883 # opaque outside of that, so there is no --enable-opaque option.  We can use
9884 # this option without --with-pthreads, but this will be always set for
9885 # pthreads.
9886 echo "$as_me:9886: checking if you want experimental reentrant code" >&5
9887 echo $ECHO_N "checking if you want experimental reentrant code... $ECHO_C" >&6
9888
9889 # Check whether --enable-reentrant or --disable-reentrant was given.
9890 if test "${enable_reentrant+set}" = set; then
9891   enableval="$enable_reentrant"
9892   with_reentrant=$enableval
9893 else
9894   with_reentrant=$assume_reentrant
9895 fi;
9896 echo "$as_me:9896: result: $with_reentrant" >&5
9897 echo "${ECHO_T}$with_reentrant" >&6
9898 if test "$with_reentrant" = yes ; then
9899         cf_cv_enable_reentrant=1
9900         if test $cf_cv_weak_symbols = yes ; then
9901
9902 # remove pthread library from $LIBS
9903 LIBS=`echo "$LIBS" | sed -e 's/-lpthread[       ]//g' -e 's/-lpthread$//'`
9904
9905         elif test "$assume_reentrant" = no ; then
9906                 LIB_SUFFIX="t${LIB_SUFFIX}"
9907         fi
9908
9909 cat >>confdefs.h <<\EOF
9910 #define USE_REENTRANT 1
9911 EOF
9912
9913 else
9914         cf_cv_enable_reentrant=0
9915 fi
9916
9917 ### Allow using a different wrap-prefix
9918 if test "$cf_cv_enable_reentrant" != 0 || test "$BROKEN_LINKER" = 1 ; then
9919         echo "$as_me:9919: checking for prefix used to wrap public variables" >&5
9920 echo $ECHO_N "checking for prefix used to wrap public variables... $ECHO_C" >&6
9921
9922 # Check whether --with-wrap-prefix or --without-wrap-prefix was given.
9923 if test "${with_wrap_prefix+set}" = set; then
9924   withval="$with_wrap_prefix"
9925   NCURSES_WRAP_PREFIX=$withval
9926 else
9927   NCURSES_WRAP_PREFIX=_nc_
9928 fi;
9929         echo "$as_me:9929: result: $NCURSES_WRAP_PREFIX" >&5
9930 echo "${ECHO_T}$NCURSES_WRAP_PREFIX" >&6
9931 else
9932         NCURSES_WRAP_PREFIX=_nc_
9933 fi
9934
9935 cat >>confdefs.h <<EOF
9936 #define NCURSES_WRAP_PREFIX "$NCURSES_WRAP_PREFIX"
9937 EOF
9938
9939 ###############################################################################
9940
9941 ###     use option --disable-echo to suppress full display compiling commands
9942
9943 echo "$as_me:9943: checking if you want to see long compiling messages" >&5
9944 echo $ECHO_N "checking if you want to see long compiling messages... $ECHO_C" >&6
9945
9946 # Check whether --enable-echo or --disable-echo was given.
9947 if test "${enable_echo+set}" = set; then
9948   enableval="$enable_echo"
9949   test "$enableval" != no && enableval=yes
9950   if test "$enableval" != "yes" ; then
9951
9952         ECHO_LT='--silent'
9953         ECHO_LD='@echo linking $@;'
9954         RULE_CC='@echo compiling $<'
9955         SHOW_CC='@echo compiling $@'
9956         ECHO_CC='@'
9957
9958   else
9959
9960         ECHO_LT=''
9961         ECHO_LD=''
9962         RULE_CC=''
9963         SHOW_CC=''
9964         ECHO_CC=''
9965
9966   fi
9967 else
9968   enableval=yes
9969
9970         ECHO_LT=''
9971         ECHO_LD=''
9972         RULE_CC=''
9973         SHOW_CC=''
9974         ECHO_CC=''
9975
9976 fi;
9977 echo "$as_me:9977: result: $enableval" >&5
9978 echo "${ECHO_T}$enableval" >&6
9979
9980 ###     use option --enable-warnings to turn on all gcc warnings
9981 echo "$as_me:9981: checking if you want to see compiler warnings" >&5
9982 echo $ECHO_N "checking if you want to see compiler warnings... $ECHO_C" >&6
9983
9984 # Check whether --enable-warnings or --disable-warnings was given.
9985 if test "${enable_warnings+set}" = set; then
9986   enableval="$enable_warnings"
9987   with_warnings=$enableval
9988 fi;
9989 echo "$as_me:9989: result: $with_warnings" >&5
9990 echo "${ECHO_T}$with_warnings" >&6
9991
9992 if test "x$with_warnings" = "xyes"; then
9993
9994         ADAFLAGS="$ADAFLAGS -gnatg"
9995
9996 INTEL_COMPILER=no
9997
9998 if test "$GCC" = yes ; then
9999         case $host_os in
10000         (linux*|gnu*)
10001                 echo "$as_me:10001: checking if this is really Intel C compiler" >&5
10002 echo $ECHO_N "checking if this is really Intel C compiler... $ECHO_C" >&6
10003                 cf_save_CFLAGS="$CFLAGS"
10004                 CFLAGS="$CFLAGS -no-gcc"
10005                 cat >conftest.$ac_ext <<_ACEOF
10006 #line 10006 "configure"
10007 #include "confdefs.h"
10008
10009 int
10010 main ()
10011 {
10012
10013 #ifdef __INTEL_COMPILER
10014 #else
10015 make an error
10016 #endif
10017
10018   ;
10019   return 0;
10020 }
10021 _ACEOF
10022 rm -f conftest.$ac_objext
10023 if { (eval echo "$as_me:10023: \"$ac_compile\"") >&5
10024   (eval $ac_compile) 2>&5
10025   ac_status=$?
10026   echo "$as_me:10026: \$? = $ac_status" >&5
10027   (exit $ac_status); } &&
10028          { ac_try='test -s conftest.$ac_objext'
10029   { (eval echo "$as_me:10029: \"$ac_try\"") >&5
10030   (eval $ac_try) 2>&5
10031   ac_status=$?
10032   echo "$as_me:10032: \$? = $ac_status" >&5
10033   (exit $ac_status); }; }; then
10034   INTEL_COMPILER=yes
10035 cf_save_CFLAGS="$cf_save_CFLAGS -we147"
10036
10037 else
10038   echo "$as_me: failed program was:" >&5
10039 cat conftest.$ac_ext >&5
10040 fi
10041 rm -f conftest.$ac_objext conftest.$ac_ext
10042                 CFLAGS="$cf_save_CFLAGS"
10043                 echo "$as_me:10043: result: $INTEL_COMPILER" >&5
10044 echo "${ECHO_T}$INTEL_COMPILER" >&6
10045                 ;;
10046         esac
10047 fi
10048
10049 CLANG_COMPILER=no
10050
10051 if test "$GCC" = yes ; then
10052         echo "$as_me:10052: checking if this is really Clang C compiler" >&5
10053 echo $ECHO_N "checking if this is really Clang C compiler... $ECHO_C" >&6
10054         cf_save_CFLAGS="$CFLAGS"
10055         CFLAGS="$CFLAGS -Qunused-arguments"
10056         cat >conftest.$ac_ext <<_ACEOF
10057 #line 10057 "configure"
10058 #include "confdefs.h"
10059
10060 int
10061 main ()
10062 {
10063
10064 #ifdef __clang__
10065 #else
10066 make an error
10067 #endif
10068
10069   ;
10070   return 0;
10071 }
10072 _ACEOF
10073 rm -f conftest.$ac_objext
10074 if { (eval echo "$as_me:10074: \"$ac_compile\"") >&5
10075   (eval $ac_compile) 2>&5
10076   ac_status=$?
10077   echo "$as_me:10077: \$? = $ac_status" >&5
10078   (exit $ac_status); } &&
10079          { ac_try='test -s conftest.$ac_objext'
10080   { (eval echo "$as_me:10080: \"$ac_try\"") >&5
10081   (eval $ac_try) 2>&5
10082   ac_status=$?
10083   echo "$as_me:10083: \$? = $ac_status" >&5
10084   (exit $ac_status); }; }; then
10085   CLANG_COMPILER=yes
10086 cf_save_CFLAGS="$cf_save_CFLAGS -Qunused-arguments"
10087
10088 else
10089   echo "$as_me: failed program was:" >&5
10090 cat conftest.$ac_ext >&5
10091 fi
10092 rm -f conftest.$ac_objext conftest.$ac_ext
10093         CFLAGS="$cf_save_CFLAGS"
10094         echo "$as_me:10094: result: $CLANG_COMPILER" >&5
10095 echo "${ECHO_T}$CLANG_COMPILER" >&6
10096 fi
10097
10098 cat > conftest.$ac_ext <<EOF
10099 #line 10099 "${as_me:-configure}"
10100 int main(int argc, char *argv[]) { return (argv[argc-1] == 0) ; }
10101 EOF
10102
10103 if test "$INTEL_COMPILER" = yes
10104 then
10105 # The "-wdXXX" options suppress warnings:
10106 # remark #1419: external declaration in primary source file
10107 # remark #1683: explicit conversion of a 64-bit integral type to a smaller integral type (potential portability problem)
10108 # remark #1684: conversion from pointer to same-sized integral type (potential portability problem)
10109 # remark #193: zero used for undefined preprocessing identifier
10110 # remark #593: variable "curs_sb_left_arrow" was set but never used
10111 # remark #810: conversion from "int" to "Dimension={unsigned short}" may lose significant bits
10112 # remark #869: parameter "tw" was never referenced
10113 # remark #981: operands are evaluated in unspecified order
10114 # warning #279: controlling expression is constant
10115
10116         { echo "$as_me:10116: checking for $CC warning options..." >&5
10117 echo "$as_me: checking for $CC warning options..." >&6;}
10118         cf_save_CFLAGS="$CFLAGS"
10119         EXTRA_CFLAGS="-Wall"
10120         for cf_opt in \
10121                 wd1419 \
10122                 wd1683 \
10123                 wd1684 \
10124                 wd193 \
10125                 wd593 \
10126                 wd279 \
10127                 wd810 \
10128                 wd869 \
10129                 wd981
10130         do
10131                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
10132                 if { (eval echo "$as_me:10132: \"$ac_compile\"") >&5
10133   (eval $ac_compile) 2>&5
10134   ac_status=$?
10135   echo "$as_me:10135: \$? = $ac_status" >&5
10136   (exit $ac_status); }; then
10137                         test -n "$verbose" && echo "$as_me:10137: result: ... -$cf_opt" >&5
10138 echo "${ECHO_T}... -$cf_opt" >&6
10139                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
10140                 fi
10141         done
10142         CFLAGS="$cf_save_CFLAGS"
10143
10144 elif test "$GCC" = yes
10145 then
10146         { echo "$as_me:10146: checking for $CC warning options..." >&5
10147 echo "$as_me: checking for $CC warning options..." >&6;}
10148         cf_save_CFLAGS="$CFLAGS"
10149         EXTRA_CFLAGS=
10150         cf_warn_CONST=""
10151         test "$with_ext_const" = yes && cf_warn_CONST="Wwrite-strings"
10152         cf_gcc_warnings="Wignored-qualifiers Wlogical-op Wvarargs"
10153         test "x$CLANG_COMPILER" = xyes && cf_gcc_warnings=
10154         for cf_opt in W Wall \
10155                 Wbad-function-cast \
10156                 Wcast-align \
10157                 Wcast-qual \
10158                 Wdeclaration-after-statement \
10159                 Wextra \
10160                 Winline \
10161                 Wmissing-declarations \
10162                 Wmissing-prototypes \
10163                 Wnested-externs \
10164                 Wpointer-arith \
10165                 Wshadow \
10166                 Wstrict-prototypes \
10167                 Wundef $cf_gcc_warnings $cf_warn_CONST Wno-unknown-pragmas Wswitch-enum
10168         do
10169                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
10170                 if { (eval echo "$as_me:10170: \"$ac_compile\"") >&5
10171   (eval $ac_compile) 2>&5
10172   ac_status=$?
10173   echo "$as_me:10173: \$? = $ac_status" >&5
10174   (exit $ac_status); }; then
10175                         test -n "$verbose" && echo "$as_me:10175: result: ... -$cf_opt" >&5
10176 echo "${ECHO_T}... -$cf_opt" >&6
10177                         case $cf_opt in
10178                         (Wcast-qual)
10179                                 CPPFLAGS="$CPPFLAGS -DXTSTRINGDEFINES"
10180                                 ;;
10181                         (Winline)
10182                                 case $GCC_VERSION in
10183                                 ([34].*)
10184                                         test -n "$verbose" && echo "    feature is broken in gcc $GCC_VERSION" 1>&6
10185
10186 echo "${as_me:-configure}:10186: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
10187
10188                                         continue;;
10189                                 esac
10190                                 ;;
10191                         (Wpointer-arith)
10192                                 case $GCC_VERSION in
10193                                 ([12].*)
10194                                         test -n "$verbose" && echo "    feature is broken in gcc $GCC_VERSION" 1>&6
10195
10196 echo "${as_me:-configure}:10196: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
10197
10198                                         continue;;
10199                                 esac
10200                                 ;;
10201                         esac
10202                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
10203                 fi
10204         done
10205         CFLAGS="$cf_save_CFLAGS"
10206 fi
10207 rm -rf conftest*
10208
10209 fi
10210
10211 if test "$GCC" = yes
10212 then
10213 cat > conftest.i <<EOF
10214 #ifndef GCC_PRINTF
10215 #define GCC_PRINTF 0
10216 #endif
10217 #ifndef GCC_SCANF
10218 #define GCC_SCANF 0
10219 #endif
10220 #ifndef GCC_NORETURN
10221 #define GCC_NORETURN /* nothing */
10222 #endif
10223 #ifndef GCC_UNUSED
10224 #define GCC_UNUSED /* nothing */
10225 #endif
10226 EOF
10227 if test "$GCC" = yes
10228 then
10229         { echo "$as_me:10229: checking for $CC __attribute__ directives..." >&5
10230 echo "$as_me: checking for $CC __attribute__ directives..." >&6;}
10231 cat > conftest.$ac_ext <<EOF
10232 #line 10232 "${as_me:-configure}"
10233 #include "confdefs.h"
10234 #include "conftest.h"
10235 #include "conftest.i"
10236 #if     GCC_PRINTF
10237 #define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
10238 #else
10239 #define GCC_PRINTFLIKE(fmt,var) /*nothing*/
10240 #endif
10241 #if     GCC_SCANF
10242 #define GCC_SCANFLIKE(fmt,var)  __attribute__((format(scanf,fmt,var)))
10243 #else
10244 #define GCC_SCANFLIKE(fmt,var)  /*nothing*/
10245 #endif
10246 extern void wow(char *,...) GCC_SCANFLIKE(1,2);
10247 extern void oops(char *,...) GCC_PRINTFLIKE(1,2) GCC_NORETURN;
10248 extern void foo(void) GCC_NORETURN;
10249 int main(int argc GCC_UNUSED, char *argv[] GCC_UNUSED) { return 0; }
10250 EOF
10251         cf_printf_attribute=no
10252         cf_scanf_attribute=no
10253         for cf_attribute in scanf printf unused noreturn
10254         do
10255
10256 cf_ATTRIBUTE=`echo "$cf_attribute" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
10257
10258                 cf_directive="__attribute__(($cf_attribute))"
10259                 echo "checking for $CC $cf_directive" 1>&5
10260
10261                 case $cf_attribute in
10262                 (printf)
10263                         cf_printf_attribute=yes
10264                         cat >conftest.h <<EOF
10265 #define GCC_$cf_ATTRIBUTE 1
10266 EOF
10267                         ;;
10268                 (scanf)
10269                         cf_scanf_attribute=yes
10270                         cat >conftest.h <<EOF
10271 #define GCC_$cf_ATTRIBUTE 1
10272 EOF
10273                         ;;
10274                 (*)
10275                         cat >conftest.h <<EOF
10276 #define GCC_$cf_ATTRIBUTE $cf_directive
10277 EOF
10278                         ;;
10279                 esac
10280
10281                 if { (eval echo "$as_me:10281: \"$ac_compile\"") >&5
10282   (eval $ac_compile) 2>&5
10283   ac_status=$?
10284   echo "$as_me:10284: \$? = $ac_status" >&5
10285   (exit $ac_status); }; then
10286                         test -n "$verbose" && echo "$as_me:10286: result: ... $cf_attribute" >&5
10287 echo "${ECHO_T}... $cf_attribute" >&6
10288                         cat conftest.h >>confdefs.h
10289                         case $cf_attribute in
10290                         (noreturn)
10291
10292 cat >>confdefs.h <<EOF
10293 #define GCC_NORETURN $cf_directive
10294 EOF
10295
10296                                 ;;
10297                         (printf)
10298                                 cf_value='/* nothing */'
10299                                 if test "$cf_printf_attribute" != no ; then
10300                                         cf_value='__attribute__((format(printf,fmt,var)))'
10301
10302 cat >>confdefs.h <<\EOF
10303 #define GCC_PRINTF 1
10304 EOF
10305
10306                                 fi
10307
10308 cat >>confdefs.h <<EOF
10309 #define GCC_PRINTFLIKE(fmt,var) $cf_value
10310 EOF
10311
10312                                 ;;
10313                         (scanf)
10314                                 cf_value='/* nothing */'
10315                                 if test "$cf_scanf_attribute" != no ; then
10316                                         cf_value='__attribute__((format(scanf,fmt,var)))'
10317
10318 cat >>confdefs.h <<\EOF
10319 #define GCC_SCANF 1
10320 EOF
10321
10322                                 fi
10323
10324 cat >>confdefs.h <<EOF
10325 #define GCC_SCANFLIKE(fmt,var) $cf_value
10326 EOF
10327
10328                                 ;;
10329                         (unused)
10330
10331 cat >>confdefs.h <<EOF
10332 #define GCC_UNUSED $cf_directive
10333 EOF
10334
10335                                 ;;
10336                         esac
10337                 fi
10338         done
10339 else
10340         fgrep define conftest.i >>confdefs.h
10341 fi
10342 rm -rf conftest*
10343 fi
10344
10345 ###     use option --enable-assertions to turn on generation of assertion code
10346 echo "$as_me:10346: checking if you want to enable runtime assertions" >&5
10347 echo $ECHO_N "checking if you want to enable runtime assertions... $ECHO_C" >&6
10348
10349 # Check whether --enable-assertions or --disable-assertions was given.
10350 if test "${enable_assertions+set}" = set; then
10351   enableval="$enable_assertions"
10352   with_assertions=$enableval
10353 else
10354   with_assertions=no
10355 fi;
10356 echo "$as_me:10356: result: $with_assertions" >&5
10357 echo "${ECHO_T}$with_assertions" >&6
10358 if test -n "$GCC"
10359 then
10360         if test "$with_assertions" = no
10361         then
10362                 CPPFLAGS="$CPPFLAGS -DNDEBUG"
10363         else
10364
10365         ADAFLAGS="$ADAFLAGS -gnata"
10366
10367         fi
10368 fi
10369
10370 ###     use option --disable-leaks to suppress "permanent" leaks, for testing
10371
10372 cat >>confdefs.h <<\EOF
10373 #define HAVE_NC_ALLOC_H 1
10374 EOF
10375
10376 ###     use option --enable-expanded to generate certain macros as functions
10377
10378 # Check whether --enable-expanded or --disable-expanded was given.
10379 if test "${enable_expanded+set}" = set; then
10380   enableval="$enable_expanded"
10381   test "$enableval" = yes &&
10382 cat >>confdefs.h <<\EOF
10383 #define NCURSES_EXPANDED 1
10384 EOF
10385
10386 fi;
10387
10388 ###     use option --disable-macros to suppress macros in favor of functions
10389
10390 # Check whether --enable-macros or --disable-macros was given.
10391 if test "${enable_macros+set}" = set; then
10392   enableval="$enable_macros"
10393   test "$enableval" = no &&
10394 cat >>confdefs.h <<\EOF
10395 #define NCURSES_NOMACROS 1
10396 EOF
10397
10398 fi;
10399
10400 # Normally we only add trace() to the debug-library.  Allow this to be
10401 # extended to all models of the ncurses library:
10402 cf_all_traces=no
10403 case "$CFLAGS $CPPFLAGS" in
10404 (*-DTRACE*)
10405         cf_all_traces=yes
10406         ;;
10407 esac
10408
10409 echo "$as_me:10409: checking whether to add trace feature to all models" >&5
10410 echo $ECHO_N "checking whether to add trace feature to all models... $ECHO_C" >&6
10411
10412 # Check whether --with-trace or --without-trace was given.
10413 if test "${with_trace+set}" = set; then
10414   withval="$with_trace"
10415   cf_with_trace=$withval
10416 else
10417   cf_with_trace=$cf_all_traces
10418 fi;
10419 echo "$as_me:10419: result: $cf_with_trace" >&5
10420 echo "${ECHO_T}$cf_with_trace" >&6
10421
10422 if test "$cf_with_trace" = yes ; then
10423         ADA_TRACE=TRUE
10424
10425 cf_fix_cppflags=no
10426 cf_new_cflags=
10427 cf_new_cppflags=
10428 cf_new_extra_cppflags=
10429
10430 for cf_add_cflags in -DTRACE
10431 do
10432 case $cf_fix_cppflags in
10433 (no)
10434         case $cf_add_cflags in
10435         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
10436                 case $cf_add_cflags in
10437                 (-D*)
10438                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
10439
10440                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10441                                 && test -z "${cf_tst_cflags}" \
10442                                 && cf_fix_cppflags=yes
10443
10444                         if test $cf_fix_cppflags = yes ; then
10445                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10446                                 continue
10447                         elif test "${cf_tst_cflags}" = "\"'" ; then
10448                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10449                                 continue
10450                         fi
10451                         ;;
10452                 esac
10453                 case "$CPPFLAGS" in
10454                 (*$cf_add_cflags)
10455                         ;;
10456                 (*)
10457                         case $cf_add_cflags in
10458                         (-D*)
10459                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
10460
10461 CPPFLAGS=`echo "$CPPFLAGS" | \
10462         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
10463                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
10464
10465                                 ;;
10466                         esac
10467                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
10468                         ;;
10469                 esac
10470                 ;;
10471         (*)
10472                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
10473                 ;;
10474         esac
10475         ;;
10476 (yes)
10477         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10478
10479         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
10480
10481         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10482                 && test -z "${cf_tst_cflags}" \
10483                 && cf_fix_cppflags=no
10484         ;;
10485 esac
10486 done
10487
10488 if test -n "$cf_new_cflags" ; then
10489
10490         CFLAGS="$CFLAGS $cf_new_cflags"
10491 fi
10492
10493 if test -n "$cf_new_cppflags" ; then
10494
10495         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
10496 fi
10497
10498 if test -n "$cf_new_extra_cppflags" ; then
10499
10500         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
10501 fi
10502
10503 else
10504         ADA_TRACE=FALSE
10505 fi
10506
10507 echo "$as_me:10507: checking if we want to use GNAT projects" >&5
10508 echo $ECHO_N "checking if we want to use GNAT projects... $ECHO_C" >&6
10509
10510 # Check whether --enable-gnat-projects or --disable-gnat-projects was given.
10511 if test "${enable_gnat_projects+set}" = set; then
10512   enableval="$enable_gnat_projects"
10513   test "$enableval" != no && enableval=yes
10514   if test "$enableval" != "yes" ; then
10515     enable_gnat_projects=no
10516   else
10517     enable_gnat_projects=yes
10518   fi
10519 else
10520   enableval=yes
10521   enable_gnat_projects=yes
10522
10523 fi;
10524 echo "$as_me:10524: result: $enable_gnat_projects" >&5
10525 echo "${ECHO_T}$enable_gnat_projects" >&6
10526
10527 ###     Checks for libraries.
10528 case $cf_cv_system_name in
10529 (*mingw32*)
10530         ;;
10531 (*)
10532 echo "$as_me:10532: checking for gettimeofday" >&5
10533 echo $ECHO_N "checking for gettimeofday... $ECHO_C" >&6
10534 if test "${ac_cv_func_gettimeofday+set}" = set; then
10535   echo $ECHO_N "(cached) $ECHO_C" >&6
10536 else
10537   cat >conftest.$ac_ext <<_ACEOF
10538 #line 10538 "configure"
10539 #include "confdefs.h"
10540 /* System header to define __stub macros and hopefully few prototypes,
10541     which can conflict with char gettimeofday (); below.  */
10542 #include <assert.h>
10543 /* Override any gcc2 internal prototype to avoid an error.  */
10544 #ifdef __cplusplus
10545 extern "C"
10546 #endif
10547 /* We use char because int might match the return type of a gcc2
10548    builtin and then its argument prototype would still apply.  */
10549 char gettimeofday ();
10550 char (*f) ();
10551
10552 int
10553 main ()
10554 {
10555 /* The GNU C library defines this for functions which it implements
10556     to always fail with ENOSYS.  Some functions are actually named
10557     something starting with __ and the normal name is an alias.  */
10558 #if defined (__stub_gettimeofday) || defined (__stub___gettimeofday)
10559 choke me
10560 #else
10561 f = gettimeofday; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
10562 #endif
10563
10564   ;
10565   return 0;
10566 }
10567 _ACEOF
10568 rm -f conftest.$ac_objext conftest$ac_exeext
10569 if { (eval echo "$as_me:10569: \"$ac_link\"") >&5
10570   (eval $ac_link) 2>&5
10571   ac_status=$?
10572   echo "$as_me:10572: \$? = $ac_status" >&5
10573   (exit $ac_status); } &&
10574          { ac_try='test -s conftest$ac_exeext'
10575   { (eval echo "$as_me:10575: \"$ac_try\"") >&5
10576   (eval $ac_try) 2>&5
10577   ac_status=$?
10578   echo "$as_me:10578: \$? = $ac_status" >&5
10579   (exit $ac_status); }; }; then
10580   ac_cv_func_gettimeofday=yes
10581 else
10582   echo "$as_me: failed program was:" >&5
10583 cat conftest.$ac_ext >&5
10584 ac_cv_func_gettimeofday=no
10585 fi
10586 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10587 fi
10588 echo "$as_me:10588: result: $ac_cv_func_gettimeofday" >&5
10589 echo "${ECHO_T}$ac_cv_func_gettimeofday" >&6
10590 if test $ac_cv_func_gettimeofday = yes; then
10591   cat >>confdefs.h <<\EOF
10592 #define HAVE_GETTIMEOFDAY 1
10593 EOF
10594
10595 else
10596
10597 echo "$as_me:10597: checking for gettimeofday in -lbsd" >&5
10598 echo $ECHO_N "checking for gettimeofday in -lbsd... $ECHO_C" >&6
10599 if test "${ac_cv_lib_bsd_gettimeofday+set}" = set; then
10600   echo $ECHO_N "(cached) $ECHO_C" >&6
10601 else
10602   ac_check_lib_save_LIBS=$LIBS
10603 LIBS="-lbsd  $LIBS"
10604 cat >conftest.$ac_ext <<_ACEOF
10605 #line 10605 "configure"
10606 #include "confdefs.h"
10607
10608 /* Override any gcc2 internal prototype to avoid an error.  */
10609 #ifdef __cplusplus
10610 extern "C"
10611 #endif
10612 /* We use char because int might match the return type of a gcc2
10613    builtin and then its argument prototype would still apply.  */
10614 char gettimeofday ();
10615 int
10616 main ()
10617 {
10618 gettimeofday ();
10619   ;
10620   return 0;
10621 }
10622 _ACEOF
10623 rm -f conftest.$ac_objext conftest$ac_exeext
10624 if { (eval echo "$as_me:10624: \"$ac_link\"") >&5
10625   (eval $ac_link) 2>&5
10626   ac_status=$?
10627   echo "$as_me:10627: \$? = $ac_status" >&5
10628   (exit $ac_status); } &&
10629          { ac_try='test -s conftest$ac_exeext'
10630   { (eval echo "$as_me:10630: \"$ac_try\"") >&5
10631   (eval $ac_try) 2>&5
10632   ac_status=$?
10633   echo "$as_me:10633: \$? = $ac_status" >&5
10634   (exit $ac_status); }; }; then
10635   ac_cv_lib_bsd_gettimeofday=yes
10636 else
10637   echo "$as_me: failed program was:" >&5
10638 cat conftest.$ac_ext >&5
10639 ac_cv_lib_bsd_gettimeofday=no
10640 fi
10641 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10642 LIBS=$ac_check_lib_save_LIBS
10643 fi
10644 echo "$as_me:10644: result: $ac_cv_lib_bsd_gettimeofday" >&5
10645 echo "${ECHO_T}$ac_cv_lib_bsd_gettimeofday" >&6
10646 if test $ac_cv_lib_bsd_gettimeofday = yes; then
10647
10648 cat >>confdefs.h <<\EOF
10649 #define HAVE_GETTIMEOFDAY 1
10650 EOF
10651
10652         LIBS="$LIBS -lbsd"
10653 fi
10654
10655 fi
10656         ;;
10657 esac
10658
10659 ###     Checks for header files.
10660 echo "$as_me:10660: checking for ANSI C header files" >&5
10661 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
10662 if test "${ac_cv_header_stdc+set}" = set; then
10663   echo $ECHO_N "(cached) $ECHO_C" >&6
10664 else
10665   cat >conftest.$ac_ext <<_ACEOF
10666 #line 10666 "configure"
10667 #include "confdefs.h"
10668 #include <stdlib.h>
10669 #include <stdarg.h>
10670 #include <string.h>
10671 #include <float.h>
10672
10673 _ACEOF
10674 if { (eval echo "$as_me:10674: \"$ac_cpp conftest.$ac_ext\"") >&5
10675   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
10676   ac_status=$?
10677   egrep -v '^ *\+' conftest.er1 >conftest.err
10678   rm -f conftest.er1
10679   cat conftest.err >&5
10680   echo "$as_me:10680: \$? = $ac_status" >&5
10681   (exit $ac_status); } >/dev/null; then
10682   if test -s conftest.err; then
10683     ac_cpp_err=$ac_c_preproc_warn_flag
10684   else
10685     ac_cpp_err=
10686   fi
10687 else
10688   ac_cpp_err=yes
10689 fi
10690 if test -z "$ac_cpp_err"; then
10691   ac_cv_header_stdc=yes
10692 else
10693   echo "$as_me: failed program was:" >&5
10694   cat conftest.$ac_ext >&5
10695   ac_cv_header_stdc=no
10696 fi
10697 rm -f conftest.err conftest.$ac_ext
10698
10699 if test $ac_cv_header_stdc = yes; then
10700   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
10701   cat >conftest.$ac_ext <<_ACEOF
10702 #line 10702 "configure"
10703 #include "confdefs.h"
10704 #include <string.h>
10705
10706 _ACEOF
10707 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
10708   egrep "memchr" >/dev/null 2>&1; then
10709   :
10710 else
10711   ac_cv_header_stdc=no
10712 fi
10713 rm -rf conftest*
10714
10715 fi
10716
10717 if test $ac_cv_header_stdc = yes; then
10718   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
10719   cat >conftest.$ac_ext <<_ACEOF
10720 #line 10720 "configure"
10721 #include "confdefs.h"
10722 #include <stdlib.h>
10723
10724 _ACEOF
10725 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
10726   egrep "free" >/dev/null 2>&1; then
10727   :
10728 else
10729   ac_cv_header_stdc=no
10730 fi
10731 rm -rf conftest*
10732
10733 fi
10734
10735 if test $ac_cv_header_stdc = yes; then
10736   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
10737   if test "$cross_compiling" = yes; then
10738   :
10739 else
10740   cat >conftest.$ac_ext <<_ACEOF
10741 #line 10741 "configure"
10742 #include "confdefs.h"
10743 #include <ctype.h>
10744 #if ((' ' & 0x0FF) == 0x020)
10745 # define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
10746 # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
10747 #else
10748 # define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
10749                      || ('j' <= (c) && (c) <= 'r') \
10750                      || ('s' <= (c) && (c) <= 'z'))
10751 # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
10752 #endif
10753
10754 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
10755 int
10756 main ()
10757 {
10758   int i;
10759   for (i = 0; i < 256; i++)
10760     if (XOR (islower (i), ISLOWER (i))
10761         || toupper (i) != TOUPPER (i))
10762       $ac_main_return(2);
10763   $ac_main_return (0);
10764 }
10765 _ACEOF
10766 rm -f conftest$ac_exeext
10767 if { (eval echo "$as_me:10767: \"$ac_link\"") >&5
10768   (eval $ac_link) 2>&5
10769   ac_status=$?
10770   echo "$as_me:10770: \$? = $ac_status" >&5
10771   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
10772   { (eval echo "$as_me:10772: \"$ac_try\"") >&5
10773   (eval $ac_try) 2>&5
10774   ac_status=$?
10775   echo "$as_me:10775: \$? = $ac_status" >&5
10776   (exit $ac_status); }; }; then
10777   :
10778 else
10779   echo "$as_me: program exited with status $ac_status" >&5
10780 echo "$as_me: failed program was:" >&5
10781 cat conftest.$ac_ext >&5
10782 ac_cv_header_stdc=no
10783 fi
10784 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
10785 fi
10786 fi
10787 fi
10788 echo "$as_me:10788: result: $ac_cv_header_stdc" >&5
10789 echo "${ECHO_T}$ac_cv_header_stdc" >&6
10790 if test $ac_cv_header_stdc = yes; then
10791
10792 cat >>confdefs.h <<\EOF
10793 #define STDC_HEADERS 1
10794 EOF
10795
10796 fi
10797
10798 ac_header_dirent=no
10799 for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h; do
10800   as_ac_Header=`echo "ac_cv_header_dirent_$ac_hdr" | $as_tr_sh`
10801 echo "$as_me:10801: checking for $ac_hdr that defines DIR" >&5
10802 echo $ECHO_N "checking for $ac_hdr that defines DIR... $ECHO_C" >&6
10803 if eval "test \"\${$as_ac_Header+set}\" = set"; then
10804   echo $ECHO_N "(cached) $ECHO_C" >&6
10805 else
10806   cat >conftest.$ac_ext <<_ACEOF
10807 #line 10807 "configure"
10808 #include "confdefs.h"
10809 #include <sys/types.h>
10810 #include <$ac_hdr>
10811
10812 int
10813 main ()
10814 {
10815 if ((DIR *) 0)
10816 return 0;
10817   ;
10818   return 0;
10819 }
10820 _ACEOF
10821 rm -f conftest.$ac_objext
10822 if { (eval echo "$as_me:10822: \"$ac_compile\"") >&5
10823   (eval $ac_compile) 2>&5
10824   ac_status=$?
10825   echo "$as_me:10825: \$? = $ac_status" >&5
10826   (exit $ac_status); } &&
10827          { ac_try='test -s conftest.$ac_objext'
10828   { (eval echo "$as_me:10828: \"$ac_try\"") >&5
10829   (eval $ac_try) 2>&5
10830   ac_status=$?
10831   echo "$as_me:10831: \$? = $ac_status" >&5
10832   (exit $ac_status); }; }; then
10833   eval "$as_ac_Header=yes"
10834 else
10835   echo "$as_me: failed program was:" >&5
10836 cat conftest.$ac_ext >&5
10837 eval "$as_ac_Header=no"
10838 fi
10839 rm -f conftest.$ac_objext conftest.$ac_ext
10840 fi
10841 echo "$as_me:10841: result: `eval echo '${'$as_ac_Header'}'`" >&5
10842 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
10843 if test `eval echo '${'$as_ac_Header'}'` = yes; then
10844   cat >>confdefs.h <<EOF
10845 #define `echo "HAVE_$ac_hdr" | $as_tr_cpp` 1
10846 EOF
10847
10848 ac_header_dirent=$ac_hdr; break
10849 fi
10850
10851 done
10852 # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix.
10853 if test $ac_header_dirent = dirent.h; then
10854   echo "$as_me:10854: checking for opendir in -ldir" >&5
10855 echo $ECHO_N "checking for opendir in -ldir... $ECHO_C" >&6
10856 if test "${ac_cv_lib_dir_opendir+set}" = set; then
10857   echo $ECHO_N "(cached) $ECHO_C" >&6
10858 else
10859   ac_check_lib_save_LIBS=$LIBS
10860 LIBS="-ldir  $LIBS"
10861 cat >conftest.$ac_ext <<_ACEOF
10862 #line 10862 "configure"
10863 #include "confdefs.h"
10864
10865 /* Override any gcc2 internal prototype to avoid an error.  */
10866 #ifdef __cplusplus
10867 extern "C"
10868 #endif
10869 /* We use char because int might match the return type of a gcc2
10870    builtin and then its argument prototype would still apply.  */
10871 char opendir ();
10872 int
10873 main ()
10874 {
10875 opendir ();
10876   ;
10877   return 0;
10878 }
10879 _ACEOF
10880 rm -f conftest.$ac_objext conftest$ac_exeext
10881 if { (eval echo "$as_me:10881: \"$ac_link\"") >&5
10882   (eval $ac_link) 2>&5
10883   ac_status=$?
10884   echo "$as_me:10884: \$? = $ac_status" >&5
10885   (exit $ac_status); } &&
10886          { ac_try='test -s conftest$ac_exeext'
10887   { (eval echo "$as_me:10887: \"$ac_try\"") >&5
10888   (eval $ac_try) 2>&5
10889   ac_status=$?
10890   echo "$as_me:10890: \$? = $ac_status" >&5
10891   (exit $ac_status); }; }; then
10892   ac_cv_lib_dir_opendir=yes
10893 else
10894   echo "$as_me: failed program was:" >&5
10895 cat conftest.$ac_ext >&5
10896 ac_cv_lib_dir_opendir=no
10897 fi
10898 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10899 LIBS=$ac_check_lib_save_LIBS
10900 fi
10901 echo "$as_me:10901: result: $ac_cv_lib_dir_opendir" >&5
10902 echo "${ECHO_T}$ac_cv_lib_dir_opendir" >&6
10903 if test $ac_cv_lib_dir_opendir = yes; then
10904   LIBS="$LIBS -ldir"
10905 fi
10906
10907 else
10908   echo "$as_me:10908: checking for opendir in -lx" >&5
10909 echo $ECHO_N "checking for opendir in -lx... $ECHO_C" >&6
10910 if test "${ac_cv_lib_x_opendir+set}" = set; then
10911   echo $ECHO_N "(cached) $ECHO_C" >&6
10912 else
10913   ac_check_lib_save_LIBS=$LIBS
10914 LIBS="-lx  $LIBS"
10915 cat >conftest.$ac_ext <<_ACEOF
10916 #line 10916 "configure"
10917 #include "confdefs.h"
10918
10919 /* Override any gcc2 internal prototype to avoid an error.  */
10920 #ifdef __cplusplus
10921 extern "C"
10922 #endif
10923 /* We use char because int might match the return type of a gcc2
10924    builtin and then its argument prototype would still apply.  */
10925 char opendir ();
10926 int
10927 main ()
10928 {
10929 opendir ();
10930   ;
10931   return 0;
10932 }
10933 _ACEOF
10934 rm -f conftest.$ac_objext conftest$ac_exeext
10935 if { (eval echo "$as_me:10935: \"$ac_link\"") >&5
10936   (eval $ac_link) 2>&5
10937   ac_status=$?
10938   echo "$as_me:10938: \$? = $ac_status" >&5
10939   (exit $ac_status); } &&
10940          { ac_try='test -s conftest$ac_exeext'
10941   { (eval echo "$as_me:10941: \"$ac_try\"") >&5
10942   (eval $ac_try) 2>&5
10943   ac_status=$?
10944   echo "$as_me:10944: \$? = $ac_status" >&5
10945   (exit $ac_status); }; }; then
10946   ac_cv_lib_x_opendir=yes
10947 else
10948   echo "$as_me: failed program was:" >&5
10949 cat conftest.$ac_ext >&5
10950 ac_cv_lib_x_opendir=no
10951 fi
10952 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10953 LIBS=$ac_check_lib_save_LIBS
10954 fi
10955 echo "$as_me:10955: result: $ac_cv_lib_x_opendir" >&5
10956 echo "${ECHO_T}$ac_cv_lib_x_opendir" >&6
10957 if test $ac_cv_lib_x_opendir = yes; then
10958   LIBS="$LIBS -lx"
10959 fi
10960
10961 fi
10962
10963 echo "$as_me:10963: checking whether time.h and sys/time.h may both be included" >&5
10964 echo $ECHO_N "checking whether time.h and sys/time.h may both be included... $ECHO_C" >&6
10965 if test "${ac_cv_header_time+set}" = set; then
10966   echo $ECHO_N "(cached) $ECHO_C" >&6
10967 else
10968   cat >conftest.$ac_ext <<_ACEOF
10969 #line 10969 "configure"
10970 #include "confdefs.h"
10971 #include <sys/types.h>
10972 #include <sys/time.h>
10973 #include <time.h>
10974
10975 int
10976 main ()
10977 {
10978 if ((struct tm *) 0)
10979 return 0;
10980   ;
10981   return 0;
10982 }
10983 _ACEOF
10984 rm -f conftest.$ac_objext
10985 if { (eval echo "$as_me:10985: \"$ac_compile\"") >&5
10986   (eval $ac_compile) 2>&5
10987   ac_status=$?
10988   echo "$as_me:10988: \$? = $ac_status" >&5
10989   (exit $ac_status); } &&
10990          { ac_try='test -s conftest.$ac_objext'
10991   { (eval echo "$as_me:10991: \"$ac_try\"") >&5
10992   (eval $ac_try) 2>&5
10993   ac_status=$?
10994   echo "$as_me:10994: \$? = $ac_status" >&5
10995   (exit $ac_status); }; }; then
10996   ac_cv_header_time=yes
10997 else
10998   echo "$as_me: failed program was:" >&5
10999 cat conftest.$ac_ext >&5
11000 ac_cv_header_time=no
11001 fi
11002 rm -f conftest.$ac_objext conftest.$ac_ext
11003 fi
11004 echo "$as_me:11004: result: $ac_cv_header_time" >&5
11005 echo "${ECHO_T}$ac_cv_header_time" >&6
11006 if test $ac_cv_header_time = yes; then
11007
11008 cat >>confdefs.h <<\EOF
11009 #define TIME_WITH_SYS_TIME 1
11010 EOF
11011
11012 fi
11013
11014 ###     checks for compiler characteristics
11015 ac_ext=c
11016 ac_cpp='$CPP $CPPFLAGS'
11017 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
11018 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
11019 ac_compiler_gnu=$ac_cv_c_compiler_gnu
11020 ac_main_return=return
11021
11022 echo "$as_me:11022: checking for an ANSI C-conforming const" >&5
11023 echo $ECHO_N "checking for an ANSI C-conforming const... $ECHO_C" >&6
11024 if test "${ac_cv_c_const+set}" = set; then
11025   echo $ECHO_N "(cached) $ECHO_C" >&6
11026 else
11027   cat >conftest.$ac_ext <<_ACEOF
11028 #line 11028 "configure"
11029 #include "confdefs.h"
11030
11031 int
11032 main ()
11033 {
11034 /* FIXME: Include the comments suggested by Paul. */
11035 #ifndef __cplusplus
11036   /* Ultrix mips cc rejects this.  */
11037   typedef int charset[2];
11038   const charset x;
11039   /* SunOS 4.1.1 cc rejects this.  */
11040   char const *const *ccp;
11041   char **p;
11042   /* NEC SVR4.0.2 mips cc rejects this.  */
11043   struct point {int x, y;};
11044   static struct point const zero = {0,0};
11045   /* AIX XL C 1.02.0.0 rejects this.
11046      It does not let you subtract one const X* pointer from another in
11047      an arm of an if-expression whose if-part is not a constant
11048      expression */
11049   const char *g = "string";
11050   ccp = &g + (g ? g-g : 0);
11051   /* HPUX 7.0 cc rejects these. */
11052   ++ccp;
11053   p = (char**) ccp;
11054   ccp = (char const *const *) p;
11055   { /* SCO 3.2v4 cc rejects this.  */
11056     char *t;
11057     char const *s = 0 ? (char *) 0 : (char const *) 0;
11058
11059     *t++ = 0;
11060   }
11061   { /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  */
11062     int x[] = {25, 17};
11063     const int *foo = &x[0];
11064     ++foo;
11065   }
11066   { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
11067     typedef const int *iptr;
11068     iptr p = 0;
11069     ++p;
11070   }
11071   { /* AIX XL C 1.02.0.0 rejects this saying
11072        "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
11073     struct s { int j; const int *ap[3]; };
11074     struct s *b; b->j = 5;
11075   }
11076   { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
11077     const int foo = 10;
11078   }
11079 #endif
11080
11081   ;
11082   return 0;
11083 }
11084 _ACEOF
11085 rm -f conftest.$ac_objext
11086 if { (eval echo "$as_me:11086: \"$ac_compile\"") >&5
11087   (eval $ac_compile) 2>&5
11088   ac_status=$?
11089   echo "$as_me:11089: \$? = $ac_status" >&5
11090   (exit $ac_status); } &&
11091          { ac_try='test -s conftest.$ac_objext'
11092   { (eval echo "$as_me:11092: \"$ac_try\"") >&5
11093   (eval $ac_try) 2>&5
11094   ac_status=$?
11095   echo "$as_me:11095: \$? = $ac_status" >&5
11096   (exit $ac_status); }; }; then
11097   ac_cv_c_const=yes
11098 else
11099   echo "$as_me: failed program was:" >&5
11100 cat conftest.$ac_ext >&5
11101 ac_cv_c_const=no
11102 fi
11103 rm -f conftest.$ac_objext conftest.$ac_ext
11104 fi
11105 echo "$as_me:11105: result: $ac_cv_c_const" >&5
11106 echo "${ECHO_T}$ac_cv_c_const" >&6
11107 if test $ac_cv_c_const = no; then
11108
11109 cat >>confdefs.h <<\EOF
11110 #define const
11111 EOF
11112
11113 fi
11114
11115 ###     Checks for external-data
11116
11117 echo "$as_me:11117: checking if data-only library module links" >&5
11118 echo $ECHO_N "checking if data-only library module links... $ECHO_C" >&6
11119 if test "${cf_cv_link_dataonly+set}" = set; then
11120   echo $ECHO_N "(cached) $ECHO_C" >&6
11121 else
11122
11123         rm -f conftest.a
11124         cat >conftest.$ac_ext <<EOF
11125 #line 11125 "configure"
11126 int     testdata[3] = { 123, 456, 789 };
11127 EOF
11128         if { (eval echo "$as_me:11128: \"$ac_compile\"") >&5
11129   (eval $ac_compile) 2>&5
11130   ac_status=$?
11131   echo "$as_me:11131: \$? = $ac_status" >&5
11132   (exit $ac_status); } ; then
11133                 mv conftest.o data.o && \
11134                 ( $AR $ARFLAGS conftest.a data.o ) 2>&5 1>/dev/null
11135         fi
11136         rm -f conftest.$ac_ext data.o
11137         cat >conftest.$ac_ext <<EOF
11138 #line 11138 "configure"
11139 int     testfunc()
11140 {
11141 #if defined(NeXT)
11142         ${cf_cv_main_return:-return}(1);        /* I'm told this linker is broken */
11143 #else
11144         extern int testdata[3];
11145         return testdata[0] == 123
11146            &&  testdata[1] == 456
11147            &&  testdata[2] == 789;
11148 #endif
11149 }
11150 EOF
11151         if { (eval echo "$as_me:11151: \"$ac_compile\"") >&5
11152   (eval $ac_compile) 2>&5
11153   ac_status=$?
11154   echo "$as_me:11154: \$? = $ac_status" >&5
11155   (exit $ac_status); }; then
11156                 mv conftest.o func.o && \
11157                 ( $AR $ARFLAGS conftest.a func.o ) 2>&5 1>/dev/null
11158         fi
11159         rm -f conftest.$ac_ext func.o
11160         ( eval $RANLIB conftest.a ) 2>&5 >/dev/null
11161         cf_saveLIBS="$LIBS"
11162         LIBS="conftest.a $LIBS"
11163         if test "$cross_compiling" = yes; then
11164   cf_cv_link_dataonly=unknown
11165 else
11166   cat >conftest.$ac_ext <<_ACEOF
11167 #line 11167 "configure"
11168 #include "confdefs.h"
11169
11170         int main()
11171         {
11172                 extern int testfunc();
11173                 ${cf_cv_main_return:-return} (!testfunc());
11174         }
11175
11176 _ACEOF
11177 rm -f conftest$ac_exeext
11178 if { (eval echo "$as_me:11178: \"$ac_link\"") >&5
11179   (eval $ac_link) 2>&5
11180   ac_status=$?
11181   echo "$as_me:11181: \$? = $ac_status" >&5
11182   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
11183   { (eval echo "$as_me:11183: \"$ac_try\"") >&5
11184   (eval $ac_try) 2>&5
11185   ac_status=$?
11186   echo "$as_me:11186: \$? = $ac_status" >&5
11187   (exit $ac_status); }; }; then
11188   cf_cv_link_dataonly=yes
11189 else
11190   echo "$as_me: program exited with status $ac_status" >&5
11191 echo "$as_me: failed program was:" >&5
11192 cat conftest.$ac_ext >&5
11193 cf_cv_link_dataonly=no
11194 fi
11195 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
11196 fi
11197         LIBS="$cf_saveLIBS"
11198
11199 fi
11200
11201 echo "$as_me:11201: result: $cf_cv_link_dataonly" >&5
11202 echo "${ECHO_T}$cf_cv_link_dataonly" >&6
11203
11204 if test "$cf_cv_link_dataonly" = no ; then
11205
11206 cat >>confdefs.h <<\EOF
11207 #define BROKEN_LINKER 1
11208 EOF
11209
11210         BROKEN_LINKER=1
11211 fi
11212
11213 ###     Checks for library functions.
11214
11215 echo "$as_me:11215: checking for working mkstemp" >&5
11216 echo $ECHO_N "checking for working mkstemp... $ECHO_C" >&6
11217 if test "${cf_cv_func_mkstemp+set}" = set; then
11218   echo $ECHO_N "(cached) $ECHO_C" >&6
11219 else
11220
11221 rm -rf conftest*
11222 if test "$cross_compiling" = yes; then
11223   cf_cv_func_mkstemp=maybe
11224 else
11225   cat >conftest.$ac_ext <<_ACEOF
11226 #line 11226 "configure"
11227 #include "confdefs.h"
11228
11229 #include <sys/types.h>
11230 #include <stdlib.h>
11231 #include <stdio.h>
11232 #include <string.h>
11233 #include <sys/stat.h>
11234 int main()
11235 {
11236         char *tmpl = "conftestXXXXXX";
11237         char name[2][80];
11238         int n;
11239         int result = 0;
11240         int fd;
11241         struct stat sb;
11242
11243         umask(077);
11244         for (n = 0; n < 2; ++n) {
11245                 strcpy(name[n], tmpl);
11246                 if ((fd = mkstemp(name[n])) >= 0) {
11247                         if (!strcmp(name[n], tmpl)
11248                          || stat(name[n], &sb) != 0
11249                          || (sb.st_mode & S_IFMT) != S_IFREG
11250                          || (sb.st_mode & 077) != 0) {
11251                                 result = 1;
11252                         }
11253                         close(fd);
11254                 }
11255         }
11256         if (result == 0
11257          && !strcmp(name[0], name[1]))
11258                 result = 1;
11259         ${cf_cv_main_return:-return}(result);
11260 }
11261
11262 _ACEOF
11263 rm -f conftest$ac_exeext
11264 if { (eval echo "$as_me:11264: \"$ac_link\"") >&5
11265   (eval $ac_link) 2>&5
11266   ac_status=$?
11267   echo "$as_me:11267: \$? = $ac_status" >&5
11268   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
11269   { (eval echo "$as_me:11269: \"$ac_try\"") >&5
11270   (eval $ac_try) 2>&5
11271   ac_status=$?
11272   echo "$as_me:11272: \$? = $ac_status" >&5
11273   (exit $ac_status); }; }; then
11274   cf_cv_func_mkstemp=yes
11275
11276 else
11277   echo "$as_me: program exited with status $ac_status" >&5
11278 echo "$as_me: failed program was:" >&5
11279 cat conftest.$ac_ext >&5
11280 cf_cv_func_mkstemp=no
11281
11282 fi
11283 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
11284 fi
11285
11286 fi
11287 echo "$as_me:11287: result: $cf_cv_func_mkstemp" >&5
11288 echo "${ECHO_T}$cf_cv_func_mkstemp" >&6
11289 if test "x$cf_cv_func_mkstemp" = xmaybe ; then
11290         echo "$as_me:11290: checking for mkstemp" >&5
11291 echo $ECHO_N "checking for mkstemp... $ECHO_C" >&6
11292 if test "${ac_cv_func_mkstemp+set}" = set; then
11293   echo $ECHO_N "(cached) $ECHO_C" >&6
11294 else
11295   cat >conftest.$ac_ext <<_ACEOF
11296 #line 11296 "configure"
11297 #include "confdefs.h"
11298 /* System header to define __stub macros and hopefully few prototypes,
11299     which can conflict with char mkstemp (); below.  */
11300 #include <assert.h>
11301 /* Override any gcc2 internal prototype to avoid an error.  */
11302 #ifdef __cplusplus
11303 extern "C"
11304 #endif
11305 /* We use char because int might match the return type of a gcc2
11306    builtin and then its argument prototype would still apply.  */
11307 char mkstemp ();
11308 char (*f) ();
11309
11310 int
11311 main ()
11312 {
11313 /* The GNU C library defines this for functions which it implements
11314     to always fail with ENOSYS.  Some functions are actually named
11315     something starting with __ and the normal name is an alias.  */
11316 #if defined (__stub_mkstemp) || defined (__stub___mkstemp)
11317 choke me
11318 #else
11319 f = mkstemp; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
11320 #endif
11321
11322   ;
11323   return 0;
11324 }
11325 _ACEOF
11326 rm -f conftest.$ac_objext conftest$ac_exeext
11327 if { (eval echo "$as_me:11327: \"$ac_link\"") >&5
11328   (eval $ac_link) 2>&5
11329   ac_status=$?
11330   echo "$as_me:11330: \$? = $ac_status" >&5
11331   (exit $ac_status); } &&
11332          { ac_try='test -s conftest$ac_exeext'
11333   { (eval echo "$as_me:11333: \"$ac_try\"") >&5
11334   (eval $ac_try) 2>&5
11335   ac_status=$?
11336   echo "$as_me:11336: \$? = $ac_status" >&5
11337   (exit $ac_status); }; }; then
11338   ac_cv_func_mkstemp=yes
11339 else
11340   echo "$as_me: failed program was:" >&5
11341 cat conftest.$ac_ext >&5
11342 ac_cv_func_mkstemp=no
11343 fi
11344 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11345 fi
11346 echo "$as_me:11346: result: $ac_cv_func_mkstemp" >&5
11347 echo "${ECHO_T}$ac_cv_func_mkstemp" >&6
11348
11349 fi
11350 if test "x$cf_cv_func_mkstemp" = xyes || test "x$ac_cv_func_mkstemp" = xyes ; then
11351
11352 cat >>confdefs.h <<\EOF
11353 #define HAVE_MKSTEMP 1
11354 EOF
11355
11356 fi
11357
11358 if test -z "$cf_user_CFLAGS" && test "$with_no_leaks" = no ; then
11359         CFLAGS=`echo ${CFLAGS} | sed -e 's%-g %%' -e 's%-g$%%'`
11360         CXXFLAGS=`echo ${CXXFLAGS} | sed -e 's%-g %%' -e 's%-g$%%'`
11361 fi
11362
11363 cf_with_ada=yes
11364 if test "$cf_with_ada" != "no" ; then
11365
11366 cf_ada_make=gnatmake
11367 # Extract the first word of "$cf_ada_make", so it can be a program name with args.
11368 set dummy $cf_ada_make; ac_word=$2
11369 echo "$as_me:11369: checking for $ac_word" >&5
11370 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
11371 if test "${ac_cv_prog_gnat_exists+set}" = set; then
11372   echo $ECHO_N "(cached) $ECHO_C" >&6
11373 else
11374   if test -n "$gnat_exists"; then
11375   ac_cv_prog_gnat_exists="$gnat_exists" # Let the user override the test.
11376 else
11377   ac_save_IFS=$IFS; IFS=$ac_path_separator
11378 ac_dummy="$PATH"
11379 for ac_dir in $ac_dummy; do
11380   IFS=$ac_save_IFS
11381   test -z "$ac_dir" && ac_dir=.
11382   $as_executable_p "$ac_dir/$ac_word" || continue
11383 ac_cv_prog_gnat_exists="yes"
11384 echo "$as_me:11384: found $ac_dir/$ac_word" >&5
11385 break
11386 done
11387
11388   test -z "$ac_cv_prog_gnat_exists" && ac_cv_prog_gnat_exists="no"
11389 fi
11390 fi
11391 gnat_exists=$ac_cv_prog_gnat_exists
11392 if test -n "$gnat_exists"; then
11393   echo "$as_me:11393: result: $gnat_exists" >&5
11394 echo "${ECHO_T}$gnat_exists" >&6
11395 else
11396   echo "$as_me:11396: result: no" >&5
11397 echo "${ECHO_T}no" >&6
11398 fi
11399
11400 if test "$ac_cv_prog_gnat_exists" = no; then
11401         cf_ada_make=
11402         cf_cv_prog_gnat_correct=no
11403 else
11404
11405 echo "$as_me:11405: checking for gnat version" >&5
11406 echo $ECHO_N "checking for gnat version... $ECHO_C" >&6
11407 cf_gnat_version=`${cf_ada_make:-gnatmake} -v 2>&1 | \
11408         grep '[0-9].[0-9][0-9]*' |\
11409         sed -e '2,$d' -e 's/[^0-9 \.]//g' -e 's/^[ ]*//' -e 's/ .*//'`
11410 echo "$as_me:11410: result: $cf_gnat_version" >&5
11411 echo "${ECHO_T}$cf_gnat_version" >&6
11412
11413 case $cf_gnat_version in
11414 (3.1[1-9]*|3.[2-9]*|[4-9].*|20[0-9][0-9])
11415         cf_cv_prog_gnat_correct=yes
11416         ;;
11417 (*)
11418         { echo "$as_me:11418: WARNING: Unsupported GNAT version $cf_gnat_version. We require 3.11 or better. Disabling Ada95 binding." >&5
11419 echo "$as_me: WARNING: Unsupported GNAT version $cf_gnat_version. We require 3.11 or better. Disabling Ada95 binding." >&2;}
11420         cf_cv_prog_gnat_correct=no
11421         ;;
11422 esac
11423
11424         # Extract the first word of "m4", so it can be a program name with args.
11425 set dummy m4; ac_word=$2
11426 echo "$as_me:11426: checking for $ac_word" >&5
11427 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
11428 if test "${ac_cv_prog_M4_exists+set}" = set; then
11429   echo $ECHO_N "(cached) $ECHO_C" >&6
11430 else
11431   if test -n "$M4_exists"; then
11432   ac_cv_prog_M4_exists="$M4_exists" # Let the user override the test.
11433 else
11434   ac_save_IFS=$IFS; IFS=$ac_path_separator
11435 ac_dummy="$PATH"
11436 for ac_dir in $ac_dummy; do
11437   IFS=$ac_save_IFS
11438   test -z "$ac_dir" && ac_dir=.
11439   $as_executable_p "$ac_dir/$ac_word" || continue
11440 ac_cv_prog_M4_exists="yes"
11441 echo "$as_me:11441: found $ac_dir/$ac_word" >&5
11442 break
11443 done
11444
11445   test -z "$ac_cv_prog_M4_exists" && ac_cv_prog_M4_exists="no"
11446 fi
11447 fi
11448 M4_exists=$ac_cv_prog_M4_exists
11449 if test -n "$M4_exists"; then
11450   echo "$as_me:11450: result: $M4_exists" >&5
11451 echo "${ECHO_T}$M4_exists" >&6
11452 else
11453   echo "$as_me:11453: result: no" >&5
11454 echo "${ECHO_T}no" >&6
11455 fi
11456
11457         if test "$ac_cv_prog_M4_exists" = no; then
11458                 cf_cv_prog_gnat_correct=no
11459                 echo Ada95 binding required program m4 not found. Ada95 binding disabled.
11460         fi
11461         if test "$cf_cv_prog_gnat_correct" = yes; then
11462                 echo "$as_me:11462: checking if GNAT works" >&5
11463 echo $ECHO_N "checking if GNAT works... $ECHO_C" >&6
11464
11465 rm -rf conftest* *~conftest*
11466 cat >>conftest.ads <<CF_EOF
11467 procedure conftest;
11468 CF_EOF
11469 cat >>conftest.adb <<CF_EOF
11470 with Text_IO;
11471 with GNAT.OS_Lib;
11472 procedure conftest is
11473 begin
11474    Text_IO.Put ("Hello World");
11475    Text_IO.New_Line;
11476    GNAT.OS_Lib.OS_Exit (0);
11477 end conftest;
11478 CF_EOF
11479 if ( $cf_ada_make $ADAFLAGS conftest 1>&5 2>&1 ) ; then
11480    if ( ./conftest 1>&5 2>&1 ) ; then
11481       cf_cv_prog_gnat_correct=yes
11482    else
11483       cf_cv_prog_gnat_correct=no
11484    fi
11485 else
11486    cf_cv_prog_gnat_correct=no
11487 fi
11488 rm -rf conftest* *~conftest*
11489
11490                 echo "$as_me:11490: result: $cf_cv_prog_gnat_correct" >&5
11491 echo "${ECHO_T}$cf_cv_prog_gnat_correct" >&6
11492         fi
11493 fi
11494
11495         if test "$cf_cv_prog_gnat_correct" = yes; then
11496
11497         echo "$as_me:11497: checking optimization options for ADAFLAGS" >&5
11498 echo $ECHO_N "checking optimization options for ADAFLAGS... $ECHO_C" >&6
11499         case "$CFLAGS" in
11500         (*-g*)
11501
11502         ADAFLAGS="$ADAFLAGS -g"
11503
11504                 ;;
11505         esac
11506         case "$CFLAGS" in
11507         (*-O*)
11508                 cf_O_flag=`echo "$CFLAGS" |sed -e 's/^.*-O/-O/' -e 's/[         ].*//'`
11509
11510         ADAFLAGS="$ADAFLAGS $cf_O_flag"
11511
11512                 ;;
11513         esac
11514         echo "$as_me:11514: result: $ADAFLAGS" >&5
11515 echo "${ECHO_T}$ADAFLAGS" >&6
11516
11517 echo "$as_me:11517: checking if GNATPREP supports -T option" >&5
11518 echo $ECHO_N "checking if GNATPREP supports -T option... $ECHO_C" >&6
11519 if test "${cf_cv_gnatprep_opt_t+set}" = set; then
11520   echo $ECHO_N "(cached) $ECHO_C" >&6
11521 else
11522
11523 cf_cv_gnatprep_opt_t=no
11524 gnatprep -T 2>/dev/null >/dev/null && cf_cv_gnatprep_opt_t=yes
11525
11526 fi
11527 echo "$as_me:11527: result: $cf_cv_gnatprep_opt_t" >&5
11528 echo "${ECHO_T}$cf_cv_gnatprep_opt_t" >&6
11529 test "$cf_cv_gnatprep_opt_t" = yes && GNATPREP_OPTS="-T $GNATPREP_OPTS"
11530
11531 echo "$as_me:11531: checking if GNAT supports generics" >&5
11532 echo $ECHO_N "checking if GNAT supports generics... $ECHO_C" >&6
11533 case $cf_gnat_version in
11534 (3.[1-9]*|[4-9].*)
11535         cf_gnat_generics=yes
11536         ;;
11537 (*)
11538         cf_gnat_generics=no
11539         ;;
11540 esac
11541 echo "$as_me:11541: result: $cf_gnat_generics" >&5
11542 echo "${ECHO_T}$cf_gnat_generics" >&6
11543
11544 if test "$cf_gnat_generics" = yes
11545 then
11546         cf_compile_generics=generics
11547         cf_generic_objects="\${GENOBJS}"
11548 else
11549         cf_compile_generics=
11550         cf_generic_objects=
11551 fi
11552
11553 echo "$as_me:11553: checking if GNAT supports SIGINT" >&5
11554 echo $ECHO_N "checking if GNAT supports SIGINT... $ECHO_C" >&6
11555 if test "${cf_cv_gnat_sigint+set}" = set; then
11556   echo $ECHO_N "(cached) $ECHO_C" >&6
11557 else
11558
11559 rm -rf conftest* *~conftest*
11560 cat >>conftest.ads <<CF_EOF
11561 with Ada.Interrupts.Names;
11562
11563 package ConfTest is
11564
11565    pragma Warnings (Off);  --  the next pragma exists since 3.11p
11566    pragma Unreserve_All_Interrupts;
11567    pragma Warnings (On);
11568
11569    protected Process is
11570       procedure Stop;
11571       function Continue return Boolean;
11572       pragma Attach_Handler (Stop, Ada.Interrupts.Names.SIGINT);
11573    private
11574       Done : Boolean := False;
11575    end Process;
11576
11577 end ConfTest;
11578 CF_EOF
11579 cat >>conftest.adb <<CF_EOF
11580 package body ConfTest is
11581    protected body Process is
11582       procedure Stop is
11583       begin
11584          Done := True;
11585       end Stop;
11586       function Continue return Boolean is
11587       begin
11588          return not Done;
11589       end Continue;
11590    end Process;
11591 end ConfTest;
11592 CF_EOF
11593 if ( $cf_ada_make $ADAFLAGS conftest 1>&5 2>&1 ) ; then
11594       cf_cv_gnat_sigint=yes
11595 else
11596    cf_cv_gnat_sigint=no
11597 fi
11598 rm -rf conftest* *~conftest*
11599
11600 fi
11601 echo "$as_me:11601: result: $cf_cv_gnat_sigint" >&5
11602 echo "${ECHO_T}$cf_cv_gnat_sigint" >&6
11603
11604 if test $cf_cv_gnat_sigint = yes ; then
11605         USE_GNAT_SIGINT=""
11606 else
11607         USE_GNAT_SIGINT="#"
11608 fi
11609
11610 cf_gnat_libraries=no
11611 cf_gnat_projects=no
11612
11613 if test "$enable_gnat_projects" != no ; then
11614 echo "$as_me:11614: checking if GNAT supports project files" >&5
11615 echo $ECHO_N "checking if GNAT supports project files... $ECHO_C" >&6
11616 case $cf_gnat_version in
11617 (3.[0-9]*)
11618         ;;
11619 (*)
11620         case $cf_cv_system_name in
11621         (cygwin*|msys*)
11622                 ;;
11623         (*)
11624                 mkdir conftest.src conftest.bin conftest.lib
11625                 cd conftest.src
11626                 rm -rf conftest* *~conftest*
11627                 cat >>library.gpr <<CF_EOF
11628 project Library is
11629   Kind := External ("LIB_KIND");
11630   for Library_Name use "ConfTest";
11631   for Object_Dir use ".";
11632   for Library_ALI_Dir use External("LIBRARY_DIR");
11633   for Library_Version use External ("SONAME");
11634   for Library_Kind use Kind;
11635   for Library_Dir use External("BUILD_DIR");
11636   Source_Dir := External ("SOURCE_DIR");
11637   for Source_Dirs use (Source_Dir);
11638 end Library;
11639 CF_EOF
11640                 cat >>confpackage.ads <<CF_EOF
11641 package ConfPackage is
11642    procedure conftest;
11643 end ConfPackage;
11644 CF_EOF
11645                 cat >>confpackage.adb <<CF_EOF
11646 with Text_IO;
11647 package body ConfPackage is
11648    procedure conftest is
11649    begin
11650       Text_IO.Put ("Hello World");
11651       Text_IO.New_Line;
11652    end conftest;
11653 end ConfPackage;
11654 CF_EOF
11655                 if ( $cf_ada_make $ADAFLAGS \
11656                                 -Plibrary.gpr \
11657                                 -XBUILD_DIR=`cd ../conftest.bin;pwd` \
11658                                 -XLIBRARY_DIR=`cd ../conftest.lib;pwd` \
11659                                 -XSOURCE_DIR=`pwd` \
11660                                 -XSONAME=libConfTest.so.1 \
11661                                 -XLIB_KIND=static 1>&5 2>&1 ) ; then
11662                         cf_gnat_projects=yes
11663                 fi
11664                 cd ..
11665                 if test -f conftest.lib/confpackage.ali
11666                 then
11667                         cf_gnat_libraries=yes
11668                 fi
11669                 rm -rf conftest* *~conftest*
11670                 ;;
11671         esac
11672         ;;
11673 esac
11674 echo "$as_me:11674: result: $cf_gnat_projects" >&5
11675 echo "${ECHO_T}$cf_gnat_projects" >&6
11676 fi # enable_gnat_projects
11677
11678 if test $cf_gnat_projects = yes
11679 then
11680         echo "$as_me:11680: checking if GNAT supports libraries" >&5
11681 echo $ECHO_N "checking if GNAT supports libraries... $ECHO_C" >&6
11682         echo "$as_me:11682: result: $cf_gnat_libraries" >&5
11683 echo "${ECHO_T}$cf_gnat_libraries" >&6
11684 fi
11685
11686 if test "$cf_gnat_projects" = yes
11687 then
11688         USE_OLD_MAKERULES="#"
11689         USE_GNAT_PROJECTS=""
11690 else
11691         USE_OLD_MAKERULES=""
11692         USE_GNAT_PROJECTS="#"
11693 fi
11694
11695 if test "$cf_gnat_libraries" = yes
11696 then
11697         USE_GNAT_LIBRARIES=""
11698 else
11699         USE_GNAT_LIBRARIES="#"
11700 fi
11701
11702 echo "$as_me:11702: checking for ada-compiler" >&5
11703 echo $ECHO_N "checking for ada-compiler... $ECHO_C" >&6
11704
11705 # Check whether --with-ada-compiler or --without-ada-compiler was given.
11706 if test "${with_ada_compiler+set}" = set; then
11707   withval="$with_ada_compiler"
11708   cf_ada_compiler=$withval
11709 else
11710   cf_ada_compiler=gnatmake
11711 fi;
11712
11713 echo "$as_me:11713: result: $cf_ada_compiler" >&5
11714 echo "${ECHO_T}$cf_ada_compiler" >&6
11715
11716                 cf_ada_package=terminal_interface
11717
11718 echo "$as_me:11718: checking for ada-include" >&5
11719 echo $ECHO_N "checking for ada-include... $ECHO_C" >&6
11720
11721 # Check whether --with-ada-include or --without-ada-include was given.
11722 if test "${with_ada_include+set}" = set; then
11723   withval="$with_ada_include"
11724
11725 else
11726   withval="${ADA_INCLUDE:-$prefix/share/ada/adainclude}"
11727 fi; if test -n "$prefix/share/ada/adainclude" ; then
11728
11729 if test "x$prefix" != xNONE; then
11730         cf_path_syntax="$prefix"
11731 else
11732         cf_path_syntax="$ac_default_prefix"
11733 fi
11734
11735 case ".$withval" in
11736 (.\$\(*\)*|.\'*\'*)
11737         ;;
11738 (..|./*|.\\*)
11739         ;;
11740 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
11741         ;;
11742 (.\${*prefix}*|.\${*dir}*)
11743         eval withval="$withval"
11744         case ".$withval" in
11745         (.NONE/*)
11746                 withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
11747                 ;;
11748         esac
11749         ;;
11750 (.no|.NONE/*)
11751         withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
11752         ;;
11753 (*)
11754         { { echo "$as_me:11754: error: expected a pathname, not \"$withval\"" >&5
11755 echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;}
11756    { (exit 1); exit 1; }; }
11757         ;;
11758 esac
11759
11760 fi
11761 eval ADA_INCLUDE="$withval"
11762
11763 echo "$as_me:11763: result: $ADA_INCLUDE" >&5
11764 echo "${ECHO_T}$ADA_INCLUDE" >&6
11765
11766 echo "$as_me:11766: checking for ada-objects" >&5
11767 echo $ECHO_N "checking for ada-objects... $ECHO_C" >&6
11768
11769 # Check whether --with-ada-objects or --without-ada-objects was given.
11770 if test "${with_ada_objects+set}" = set; then
11771   withval="$with_ada_objects"
11772
11773 else
11774   withval="${ADA_OBJECTS:-$prefix/lib/ada/adalib}"
11775 fi; if test -n "$prefix/lib/ada/adalib" ; then
11776
11777 if test "x$prefix" != xNONE; then
11778         cf_path_syntax="$prefix"
11779 else
11780         cf_path_syntax="$ac_default_prefix"
11781 fi
11782
11783 case ".$withval" in
11784 (.\$\(*\)*|.\'*\'*)
11785         ;;
11786 (..|./*|.\\*)
11787         ;;
11788 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
11789         ;;
11790 (.\${*prefix}*|.\${*dir}*)
11791         eval withval="$withval"
11792         case ".$withval" in
11793         (.NONE/*)
11794                 withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
11795                 ;;
11796         esac
11797         ;;
11798 (.no|.NONE/*)
11799         withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
11800         ;;
11801 (*)
11802         { { echo "$as_me:11802: error: expected a pathname, not \"$withval\"" >&5
11803 echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;}
11804    { (exit 1); exit 1; }; }
11805         ;;
11806 esac
11807
11808 fi
11809 eval ADA_OBJECTS="$withval"
11810
11811 echo "$as_me:11811: result: $ADA_OBJECTS" >&5
11812 echo "${ECHO_T}$ADA_OBJECTS" >&6
11813
11814 echo "$as_me:11814: checking if an Ada95 shared-library should be built" >&5
11815 echo $ECHO_N "checking if an Ada95 shared-library should be built... $ECHO_C" >&6
11816
11817 # Check whether --with-ada-sharedlib or --without-ada-sharedlib was given.
11818 if test "${with_ada_sharedlib+set}" = set; then
11819   withval="$with_ada_sharedlib"
11820   with_ada_sharedlib=$withval
11821 else
11822   with_ada_sharedlib=no
11823 fi;
11824 echo "$as_me:11824: result: $with_ada_sharedlib" >&5
11825 echo "${ECHO_T}$with_ada_sharedlib" >&6
11826
11827 ADA_SHAREDLIB='lib$(LIB_NAME).so.1'
11828 MAKE_ADA_SHAREDLIB="#"
11829
11830 if test "x$with_ada_sharedlib" != xno
11831 then
11832         MAKE_ADA_SHAREDLIB=
11833         if test "x$with_ada_sharedlib" != xyes
11834         then
11835                 ADA_SHAREDLIB="$with_ada_sharedlib"
11836         fi
11837 fi
11838
11839         else
11840                 { { echo "$as_me:11840: error: No usable Ada compiler found" >&5
11841 echo "$as_me: error: No usable Ada compiler found" >&2;}
11842    { (exit 1); exit 1; }; }
11843         fi
11844 else
11845         { { echo "$as_me:11845: error: The Ada compiler is needed for this package" >&5
11846 echo "$as_me: error: The Ada compiler is needed for this package" >&2;}
11847    { (exit 1); exit 1; }; }
11848 fi
11849
11850 ################################################################################
11851
11852 # not needed
11853 TINFO_LDFLAGS2=
11854
11855 TINFO_LIBS=
11856
11857 ### Construct the list of include-directories to be generated
11858
11859 if test "$srcdir" != "."; then
11860         CPPFLAGS="-I\${srcdir}/../include $CPPFLAGS"
11861 fi
11862 CPPFLAGS="-I../include $CPPFLAGS"
11863 if test "$srcdir" != "."; then
11864         CPPFLAGS="-I\${srcdir} $CPPFLAGS"
11865 fi
11866 CPPFLAGS="-I. $CPPFLAGS"
11867
11868 ACPPFLAGS="-I. -I../include -I../../include $ACPPFLAGS"
11869 if test "$srcdir" != "."; then
11870         ACPPFLAGS="-I\${srcdir}/../../include $ACPPFLAGS"
11871 fi
11872 if test "$GCC" != yes; then
11873         ACPPFLAGS="$ACPPFLAGS -I\${includedir}"
11874 elif test "$includedir" != "/usr/include"; then
11875         if test "$includedir" = '${prefix}/include' ; then
11876                 if test x$prefix != x/usr ; then
11877                         ACPPFLAGS="$ACPPFLAGS -I\${includedir}"
11878                 fi
11879         else
11880                 ACPPFLAGS="$ACPPFLAGS -I\${includedir}"
11881         fi
11882 fi
11883
11884 ### Build up pieces for makefile rules
11885 echo "$as_me:11885: checking default library suffix" >&5
11886 echo $ECHO_N "checking default library suffix... $ECHO_C" >&6
11887
11888         case $DFT_LWR_MODEL in
11889         (libtool) DFT_ARG_SUFFIX=''   ;;
11890         (normal)  DFT_ARG_SUFFIX=''   ;;
11891         (debug)   DFT_ARG_SUFFIX='_g' ;;
11892         (profile) DFT_ARG_SUFFIX='_p' ;;
11893         (shared)  DFT_ARG_SUFFIX=''   ;;
11894         esac
11895         test -n "$LIB_SUFFIX" && DFT_ARG_SUFFIX="${LIB_SUFFIX}${DFT_ARG_SUFFIX}"
11896 echo "$as_me:11896: result: $DFT_ARG_SUFFIX" >&5
11897 echo "${ECHO_T}$DFT_ARG_SUFFIX" >&6
11898
11899 echo "$as_me:11899: checking default library-dependency suffix" >&5
11900 echo $ECHO_N "checking default library-dependency suffix... $ECHO_C" >&6
11901
11902         case X$DFT_LWR_MODEL in
11903         (Xlibtool)
11904                 DFT_LIB_SUFFIX='.la'
11905                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
11906                 ;;
11907         (Xdebug)
11908                 DFT_LIB_SUFFIX='_g.a'
11909                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
11910                 ;;
11911         (Xprofile)
11912                 DFT_LIB_SUFFIX='_p.a'
11913                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
11914                 ;;
11915         (Xshared)
11916                 case $cf_cv_system_name in
11917                 (aix[5-7]*)
11918                         DFT_LIB_SUFFIX='.so'
11919                         DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
11920                         ;;
11921                 (cygwin*|msys*|mingw*)
11922                         DFT_LIB_SUFFIX='.dll'
11923                         DFT_DEP_SUFFIX='.dll.a'
11924                         ;;
11925                 (darwin*)
11926                         DFT_LIB_SUFFIX='.dylib'
11927                         DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
11928                         ;;
11929                 (hpux*)
11930                         case $target in
11931                         (ia64*)
11932                                 DFT_LIB_SUFFIX='.so'
11933                                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
11934                                 ;;
11935                         (*)
11936                                 DFT_LIB_SUFFIX='.sl'
11937                                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
11938                                 ;;
11939                         esac
11940                         ;;
11941                 (*)
11942                         DFT_LIB_SUFFIX='.so'
11943                         DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
11944                         ;;
11945                 esac
11946                 ;;
11947         (*)
11948                 DFT_LIB_SUFFIX='.a'
11949                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
11950                 ;;
11951         esac
11952         if test -n "${LIB_SUFFIX}${EXTRA_SUFFIX}"
11953         then
11954                 DFT_LIB_SUFFIX="${LIB_SUFFIX}${EXTRA_SUFFIX}${DFT_LIB_SUFFIX}"
11955                 DFT_DEP_SUFFIX="${LIB_SUFFIX}${EXTRA_SUFFIX}${DFT_DEP_SUFFIX}"
11956         fi
11957 echo "$as_me:11957: result: $DFT_DEP_SUFFIX" >&5
11958 echo "${ECHO_T}$DFT_DEP_SUFFIX" >&6
11959
11960 echo "$as_me:11960: checking default object directory" >&5
11961 echo $ECHO_N "checking default object directory... $ECHO_C" >&6
11962
11963         case $DFT_LWR_MODEL in
11964         (libtool) DFT_OBJ_SUBDIR='obj_lo'  ;;
11965         (normal)  DFT_OBJ_SUBDIR='objects' ;;
11966         (debug)   DFT_OBJ_SUBDIR='obj_g' ;;
11967         (profile) DFT_OBJ_SUBDIR='obj_p' ;;
11968         (shared)
11969                 case $cf_cv_system_name in
11970                 (cygwin|msys)
11971                         DFT_OBJ_SUBDIR='objects' ;;
11972                 (*)
11973                         DFT_OBJ_SUBDIR='obj_s' ;;
11974                 esac
11975         esac
11976 echo "$as_me:11976: result: $DFT_OBJ_SUBDIR" >&5
11977 echo "${ECHO_T}$DFT_OBJ_SUBDIR" >&6
11978
11979 ### Set up low-level terminfo dependencies for makefiles.
11980
11981 if test "$DFT_LWR_MODEL" = shared ; then
11982         case $cf_cv_system_name in
11983         (cygwin*)
11984                 # "lib" files have ".dll.a" suffix, "cyg" files have ".dll"
11985                 ;;
11986         (msys*)
11987                 # "lib" files have ".dll.a" suffix, "msys-" files have ".dll"
11988                 ;;
11989         esac
11990 fi
11991
11992 USE_CFG_SUFFIX=${DFT_ARG_SUFFIX}
11993
11994 ### Construct the list of subdirectories for which we'll customize makefiles
11995 ### with the appropriate compile-rules.
11996
11997 SUB_MAKEFILES="gen/adacurses${USE_ARG_SUFFIX}-config:gen/adacurses-config.in"
11998
11999 cat >>confdefs.h <<EOF
12000 #define NCURSES_PATHSEP '$PATH_SEPARATOR'
12001 EOF
12002
12003 ### Now that we're done running tests, add the compiler-warnings, if any
12004
12005 cf_fix_cppflags=no
12006 cf_new_cflags=
12007 cf_new_cppflags=
12008 cf_new_extra_cppflags=
12009
12010 for cf_add_cflags in $EXTRA_CFLAGS
12011 do
12012 case $cf_fix_cppflags in
12013 (no)
12014         case $cf_add_cflags in
12015         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
12016                 case $cf_add_cflags in
12017                 (-D*)
12018                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
12019
12020                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12021                                 && test -z "${cf_tst_cflags}" \
12022                                 && cf_fix_cppflags=yes
12023
12024                         if test $cf_fix_cppflags = yes ; then
12025                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
12026                                 continue
12027                         elif test "${cf_tst_cflags}" = "\"'" ; then
12028                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
12029                                 continue
12030                         fi
12031                         ;;
12032                 esac
12033                 case "$CPPFLAGS" in
12034                 (*$cf_add_cflags)
12035                         ;;
12036                 (*)
12037                         case $cf_add_cflags in
12038                         (-D*)
12039                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
12040
12041 CPPFLAGS=`echo "$CPPFLAGS" | \
12042         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
12043                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
12044
12045                                 ;;
12046                         esac
12047                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
12048                         ;;
12049                 esac
12050                 ;;
12051         (*)
12052                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
12053                 ;;
12054         esac
12055         ;;
12056 (yes)
12057         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
12058
12059         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
12060
12061         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12062                 && test -z "${cf_tst_cflags}" \
12063                 && cf_fix_cppflags=no
12064         ;;
12065 esac
12066 done
12067
12068 if test -n "$cf_new_cflags" ; then
12069
12070         CFLAGS="$CFLAGS $cf_new_cflags"
12071 fi
12072
12073 if test -n "$cf_new_cppflags" ; then
12074
12075         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
12076 fi
12077
12078 if test -n "$cf_new_extra_cppflags" ; then
12079
12080         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
12081 fi
12082
12083 ################################################################################
12084
12085 TEST_ARG2=
12086
12087 TEST_LIBS2=
12088
12089 NCURSES_SHLIB2="sh -c"
12090
12091 ADA_SUBDIRS="include gen src doc"
12092 if test "x$cf_with_tests" != "xno" ; then
12093         ADA_SUBDIRS="$ADA_SUBDIRS samples"
12094 fi
12095 for cf_dir in $ADA_SUBDIRS
12096 do
12097         SUB_MAKEFILES="$SUB_MAKEFILES $cf_dir/Makefile"
12098 done
12099
12100 NCURSES_TREE="#"
12101
12102 EXTERNAL_TREE=
12103
12104 # match layout used by make-tar.sh
12105 ADAHTML_DIR=../doc/ada
12106
12107 ac_config_files="$ac_config_files $SUB_MAKEFILES doc/adacurses${DFT_ARG_SUFFIX}-config.1:doc/MKada_config.in Makefile"
12108 ac_config_commands="$ac_config_commands default"
12109 cat >confcache <<\_ACEOF
12110 # This file is a shell script that caches the results of configure
12111 # tests run on this system so they can be shared between configure
12112 # scripts and configure runs, see configure's option --config-cache.
12113 # It is not useful on other systems.  If it contains results you don't
12114 # want to keep, you may remove or edit it.
12115 #
12116 # config.status only pays attention to the cache file if you give it
12117 # the --recheck option to rerun configure.
12118 #
12119 # `ac_cv_env_foo' variables (set or unset) will be overriden when
12120 # loading this file, other *unset* `ac_cv_foo' will be assigned the
12121 # following values.
12122
12123 _ACEOF
12124
12125 # The following way of writing the cache mishandles newlines in values,
12126 # but we know of no workaround that is simple, portable, and efficient.
12127 # So, don't put newlines in cache variables' values.
12128 # Ultrix sh set writes to stderr and can't be redirected directly,
12129 # and sets the high bit in the cache file unless we assign to the vars.
12130 {
12131   (set) 2>&1 |
12132     case `(ac_space=' '; set | grep ac_space) 2>&1` in
12133     *ac_space=\ *)
12134       # `set' does not quote correctly, so add quotes (double-quote
12135       # substitution turns \\\\ into \\, and sed turns \\ into \).
12136       sed -n \
12137         "s/'/'\\\\''/g;
12138           s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
12139       ;;
12140     *)
12141       # `set' quotes correctly as required by POSIX, so do not add quotes.
12142       sed -n \
12143         "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
12144       ;;
12145     esac;
12146 } |
12147   sed '
12148      t clear
12149      : clear
12150      s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
12151      t end
12152      /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
12153      : end' >>confcache
12154 if cmp -s $cache_file confcache; then :; else
12155   if test -w $cache_file; then
12156     test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file"
12157     cat confcache >$cache_file
12158   else
12159     echo "not updating unwritable cache $cache_file"
12160   fi
12161 fi
12162 rm -f confcache
12163
12164 test "x$prefix" = xNONE && prefix=$ac_default_prefix
12165 # Let make expand exec_prefix.
12166 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
12167
12168 # VPATH may cause trouble with some makes, so we remove $(srcdir),
12169 # ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
12170 # trailing colons and then remove the whole line if VPATH becomes empty
12171 # (actually we leave an empty line to preserve line numbers).
12172 if test "x$srcdir" = x.; then
12173   ac_vpsub='/^[         ]*VPATH[        ]*=/{
12174 s/:*\$(srcdir):*/:/;
12175 s/:*\${srcdir}:*/:/;
12176 s/:*@srcdir@:*/:/;
12177 s/^\([^=]*=[    ]*\):*/\1/;
12178 s/:*$//;
12179 s/^[^=]*=[      ]*$//;
12180 }'
12181 fi
12182
12183 DEFS=-DHAVE_CONFIG_H
12184
12185 : ${CONFIG_STATUS=./config.status}
12186 ac_clean_files_save=$ac_clean_files
12187 ac_clean_files="$ac_clean_files $CONFIG_STATUS"
12188 { echo "$as_me:12188: creating $CONFIG_STATUS" >&5
12189 echo "$as_me: creating $CONFIG_STATUS" >&6;}
12190 cat >$CONFIG_STATUS <<_ACEOF
12191 #! $SHELL
12192 # Generated automatically by configure.
12193 # Run this file to recreate the current configuration.
12194 # Compiler output produced by configure, useful for debugging
12195 # configure, is in config.log if it exists.
12196
12197 debug=false
12198 SHELL=\${CONFIG_SHELL-$SHELL}
12199 ac_cs_invocation="\$0 \$@"
12200
12201 _ACEOF
12202
12203 cat >>$CONFIG_STATUS <<\_ACEOF
12204 # Be Bourne compatible
12205 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
12206   emulate sh
12207   NULLCMD=:
12208 elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
12209   set -o posix
12210 fi
12211
12212 # Name of the executable.
12213 as_me=`echo "$0" |sed 's,.*[\\/],,'`
12214
12215 if expr a : '\(a\)' >/dev/null 2>&1; then
12216   as_expr=expr
12217 else
12218   as_expr=false
12219 fi
12220
12221 rm -f conf$$ conf$$.exe conf$$.file
12222 echo >conf$$.file
12223 if ln -s conf$$.file conf$$ 2>/dev/null; then
12224   # We could just check for DJGPP; but this test a) works b) is more generic
12225   # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
12226   if test -f conf$$.exe; then
12227     # Don't use ln at all; we don't have any links
12228     as_ln_s='cp -p'
12229   else
12230     as_ln_s='ln -s'
12231   fi
12232 elif ln conf$$.file conf$$ 2>/dev/null; then
12233   as_ln_s=ln
12234 else
12235   as_ln_s='cp -p'
12236 fi
12237 rm -f conf$$ conf$$.exe conf$$.file
12238
12239 as_executable_p="test -f"
12240
12241 # Support unset when possible.
12242 if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
12243   as_unset=unset
12244 else
12245   as_unset=false
12246 fi
12247
12248 # NLS nuisances.
12249 $as_unset LANG || test "${LANG+set}" != set || { LANG=C; export LANG; }
12250 $as_unset LC_ALL || test "${LC_ALL+set}" != set || { LC_ALL=C; export LC_ALL; }
12251 $as_unset LC_TIME || test "${LC_TIME+set}" != set || { LC_TIME=C; export LC_TIME; }
12252 $as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set || { LC_CTYPE=C; export LC_CTYPE; }
12253 $as_unset LANGUAGE || test "${LANGUAGE+set}" != set || { LANGUAGE=C; export LANGUAGE; }
12254 $as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set || { LC_COLLATE=C; export LC_COLLATE; }
12255 $as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set || { LC_NUMERIC=C; export LC_NUMERIC; }
12256 $as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set || { LC_MESSAGES=C; export LC_MESSAGES; }
12257
12258 # IFS
12259 # We need space, tab and new line, in precisely that order.
12260 as_nl='
12261 '
12262 IFS="   $as_nl"
12263
12264 # CDPATH.
12265 $as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=:; export CDPATH; }
12266
12267 exec 6>&1
12268
12269 _ACEOF
12270
12271 # Files that config.status was made for.
12272 if test -n "$ac_config_files"; then
12273   echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS
12274 fi
12275
12276 if test -n "$ac_config_headers"; then
12277   echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS
12278 fi
12279
12280 if test -n "$ac_config_links"; then
12281   echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS
12282 fi
12283
12284 if test -n "$ac_config_commands"; then
12285   echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS
12286 fi
12287
12288 cat >>$CONFIG_STATUS <<\EOF
12289
12290 ac_cs_usage="\
12291 \`$as_me' instantiates files from templates according to the
12292 current configuration.
12293
12294 Usage: $0 [OPTIONS] [FILE]...
12295
12296   -h, --help       print this help, then exit
12297   -V, --version    print version number, then exit
12298   -d, --debug      don't remove temporary files
12299       --recheck    update $as_me by reconfiguring in the same conditions
12300   --file=FILE[:TEMPLATE]
12301                    instantiate the configuration file FILE
12302   --header=FILE[:TEMPLATE]
12303                    instantiate the configuration header FILE
12304
12305 Configuration files:
12306 $config_files
12307
12308 Configuration headers:
12309 $config_headers
12310
12311 Configuration commands:
12312 $config_commands
12313
12314 Report bugs to <dickey@invisible-island.net>."
12315 EOF
12316
12317 cat >>$CONFIG_STATUS <<EOF
12318 ac_cs_version="\\
12319 config.status
12320 configured by $0, generated by GNU Autoconf 2.52.20141204,
12321   with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
12322
12323 Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
12324 Free Software Foundation, Inc.
12325 This config.status script is free software; the Free Software Foundation
12326 gives unlimited permission to copy, distribute and modify it."
12327 srcdir=$srcdir
12328 INSTALL="$INSTALL"
12329 EOF
12330
12331 cat >>$CONFIG_STATUS <<\EOF
12332 # If no file are specified by the user, then we need to provide default
12333 # value.  By we need to know if files were specified by the user.
12334 ac_need_defaults=:
12335 while test $# != 0
12336 do
12337   case $1 in
12338   --*=*)
12339     ac_option=`expr "x$1" : 'x\([^=]*\)='`
12340     ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'`
12341     shift
12342     set dummy "$ac_option" "$ac_optarg" ${1+"$@"}
12343     shift
12344     ;;
12345   -*);;
12346   *) # This is not an option, so the user has probably given explicit
12347      # arguments.
12348      ac_need_defaults=false;;
12349   esac
12350
12351   case $1 in
12352   # Handling of the options.
12353 EOF
12354 cat >>$CONFIG_STATUS <<EOF
12355   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
12356     echo "running $SHELL $0 " $ac_configure_args " --no-create --no-recursion"
12357     exec $SHELL $0 $ac_configure_args --no-create --no-recursion ;;
12358 EOF
12359 cat >>$CONFIG_STATUS <<\EOF
12360   --version | --vers* | -V )
12361     echo "$ac_cs_version"; exit 0 ;;
12362   --he | --h)
12363     # Conflict between --help and --header
12364     { { echo "$as_me:12364: error: ambiguous option: $1
12365 Try \`$0 --help' for more information." >&5
12366 echo "$as_me: error: ambiguous option: $1
12367 Try \`$0 --help' for more information." >&2;}
12368    { (exit 1); exit 1; }; };;
12369   --help | --hel | -h )
12370     echo "$ac_cs_usage"; exit 0 ;;
12371   --debug | --d* | -d )
12372     debug=: ;;
12373   --file | --fil | --fi | --f )
12374     shift
12375     CONFIG_FILES="$CONFIG_FILES $1"
12376     ac_need_defaults=false;;
12377   --header | --heade | --head | --hea )
12378     shift
12379     CONFIG_HEADERS="$CONFIG_HEADERS $1"
12380     ac_need_defaults=false;;
12381
12382   # This is an error.
12383   -*) { { echo "$as_me:12383: error: unrecognized option: $1
12384 Try \`$0 --help' for more information." >&5
12385 echo "$as_me: error: unrecognized option: $1
12386 Try \`$0 --help' for more information." >&2;}
12387    { (exit 1); exit 1; }; } ;;
12388
12389   *) ac_config_targets="$ac_config_targets $1" ;;
12390
12391   esac
12392   shift
12393 done
12394
12395 exec 5>>config.log
12396 cat >&5 << _ACEOF
12397
12398 ## ----------------------- ##
12399 ## Running config.status.  ##
12400 ## ----------------------- ##
12401
12402 This file was extended by $as_me 2.52.20141204, executed with
12403   CONFIG_FILES    = $CONFIG_FILES
12404   CONFIG_HEADERS  = $CONFIG_HEADERS
12405   CONFIG_LINKS    = $CONFIG_LINKS
12406   CONFIG_COMMANDS = $CONFIG_COMMANDS
12407   > $ac_cs_invocation
12408 on `(hostname || uname -n) 2>/dev/null | sed 1q`
12409
12410 _ACEOF
12411 EOF
12412
12413 cat >>$CONFIG_STATUS <<EOF
12414 #
12415 # INIT-COMMANDS section.
12416 #
12417
12418 ### Special initialization commands, used to pass information from the
12419 ### configuration-run into config.status
12420
12421 AWK="$AWK"
12422 DFT_ARG_SUFFIX="$DFT_ARG_SUFFIX"
12423 DFT_LWR_MODEL="$DFT_LWR_MODEL"
12424 LIB_NAME="$LIB_NAME"
12425 LIB_PREFIX="$LIB_PREFIX"
12426 LIB_SUFFIX="$LIB_SUFFIX"
12427 LN_S="$LN_S"
12428 NCURSES_MAJOR="$NCURSES_MAJOR"
12429 NCURSES_MINOR="$NCURSES_MINOR"
12430 NCURSES_PATCH="$NCURSES_PATCH"
12431 USE_OLD_MAKERULES="$USE_OLD_MAKERULES"
12432 cf_cv_abi_version="$cf_cv_abi_version"
12433 cf_cv_rel_version="$cf_cv_rel_version"
12434 cf_cv_rm_so_locs="$cf_cv_rm_so_locs"
12435 cf_cv_shared_soname='$cf_cv_shared_soname'
12436 cf_cv_shlib_version="$cf_cv_shlib_version"
12437 cf_cv_shlib_version_infix="$cf_cv_shlib_version_infix"
12438 cf_cv_system_name="$cf_cv_system_name"
12439 host="$host"
12440 target="$target"
12441
12442 EOF
12443
12444 cat >>$CONFIG_STATUS <<\EOF
12445 for ac_config_target in $ac_config_targets
12446 do
12447   case "$ac_config_target" in
12448   # Handling of arguments.
12449   "$SUB_MAKEFILES" ) CONFIG_FILES="$CONFIG_FILES $SUB_MAKEFILES" ;;
12450   "doc/adacurses${DFT_ARG_SUFFIX}-config.1" ) CONFIG_FILES="$CONFIG_FILES doc/adacurses${DFT_ARG_SUFFIX}-config.1:doc/MKada_config.in" ;;
12451   "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;;
12452   "default" ) CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;;
12453   "include/ncurses_cfg.h" ) CONFIG_HEADERS="$CONFIG_HEADERS include/ncurses_cfg.h:include/ncurses_cfg.hin" ;;
12454   *) { { echo "$as_me:12454: error: invalid argument: $ac_config_target" >&5
12455 echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
12456    { (exit 1); exit 1; }; };;
12457   esac
12458 done
12459
12460 # If the user did not use the arguments to specify the items to instantiate,
12461 # then the envvar interface is used.  Set only those that are not.
12462 # We use the long form for the default assignment because of an extremely
12463 # bizarre bug on SunOS 4.1.3.
12464 if $ac_need_defaults; then
12465   test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
12466   test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
12467   test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
12468 fi
12469
12470 # Create a temporary directory, and hook for its removal unless debugging.
12471 $debug ||
12472 {
12473   trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0
12474   trap '{ (exit 1); exit 1; }' 1 2 13 15
12475 }
12476
12477 # Create a (secure) tmp directory for tmp files.
12478 : ${TMPDIR=/tmp}
12479 {
12480   tmp=`(umask 077 && mktemp -d -q "$TMPDIR/csXXXXXX") 2>/dev/null` &&
12481   test -n "$tmp" && test -d "$tmp"
12482 }  ||
12483 {
12484   tmp=$TMPDIR/cs$$-$RANDOM
12485   (umask 077 && mkdir $tmp)
12486 } ||
12487 {
12488    echo "$me: cannot create a temporary directory in $TMPDIR" >&2
12489    { (exit 1); exit 1; }
12490 }
12491
12492 EOF
12493
12494 cat >>$CONFIG_STATUS <<EOF
12495
12496 #
12497 # CONFIG_FILES section.
12498 #
12499
12500 # No need to generate the scripts if there are no CONFIG_FILES.
12501 # This happens for instance when ./config.status config.h
12502 if test -n "\$CONFIG_FILES"; then
12503   # Protect against being on the right side of a sed subst in config.status.
12504   sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g;
12505    s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF
12506 s,@SHELL@,$SHELL,;t t
12507 s,@exec_prefix@,$exec_prefix,;t t
12508 s,@prefix@,$prefix,;t t
12509 s,@program_transform_name@,$program_transform_name,;t t
12510 s,@bindir@,$bindir,;t t
12511 s,@sbindir@,$sbindir,;t t
12512 s,@libexecdir@,$libexecdir,;t t
12513 s,@datarootdir@,$datarootdir,;t t
12514 s,@datadir@,$datadir,;t t
12515 s,@sysconfdir@,$sysconfdir,;t t
12516 s,@sharedstatedir@,$sharedstatedir,;t t
12517 s,@localstatedir@,$localstatedir,;t t
12518 s,@libdir@,$libdir,;t t
12519 s,@includedir@,$includedir,;t t
12520 s,@oldincludedir@,$oldincludedir,;t t
12521 s,@infodir@,$infodir,;t t
12522 s,@mandir@,$mandir,;t t
12523 s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t
12524 s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t
12525 s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t
12526 s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t
12527 s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t
12528 s,@build_alias@,$build_alias,;t t
12529 s,@host_alias@,$host_alias,;t t
12530 s,@target_alias@,$target_alias,;t t
12531 s,@ECHO_C@,$ECHO_C,;t t
12532 s,@ECHO_N@,$ECHO_N,;t t
12533 s,@ECHO_T@,$ECHO_T,;t t
12534 s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t
12535 s,@DEFS@,$DEFS,;t t
12536 s,@LIBS@,$LIBS,;t t
12537 s,@top_builddir@,$top_builddir,;t t
12538 s,@build@,$build,;t t
12539 s,@build_cpu@,$build_cpu,;t t
12540 s,@build_vendor@,$build_vendor,;t t
12541 s,@build_os@,$build_os,;t t
12542 s,@host@,$host,;t t
12543 s,@host_cpu@,$host_cpu,;t t
12544 s,@host_vendor@,$host_vendor,;t t
12545 s,@host_os@,$host_os,;t t
12546 s,@target@,$target,;t t
12547 s,@target_cpu@,$target_cpu,;t t
12548 s,@target_vendor@,$target_vendor,;t t
12549 s,@target_os@,$target_os,;t t
12550 s,@CC@,$CC,;t t
12551 s,@CFLAGS@,$CFLAGS,;t t
12552 s,@LDFLAGS@,$LDFLAGS,;t t
12553 s,@CPPFLAGS@,$CPPFLAGS,;t t
12554 s,@ac_ct_CC@,$ac_ct_CC,;t t
12555 s,@EXEEXT@,$EXEEXT,;t t
12556 s,@OBJEXT@,$OBJEXT,;t t
12557 s,@EXTRA_CPPFLAGS@,$EXTRA_CPPFLAGS,;t t
12558 s,@CPP@,$CPP,;t t
12559 s,@AWK@,$AWK,;t t
12560 s,@EGREP@,$EGREP,;t t
12561 s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t
12562 s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t
12563 s,@INSTALL_DATA@,$INSTALL_DATA,;t t
12564 s,@LN_S@,$LN_S,;t t
12565 s,@PKG_CONFIG@,$PKG_CONFIG,;t t
12566 s,@ac_pt_PKG_CONFIG@,$ac_pt_PKG_CONFIG,;t t
12567 s,@PKG_CONFIG_LIBDIR@,$PKG_CONFIG_LIBDIR,;t t
12568 s,@SET_MAKE@,$SET_MAKE,;t t
12569 s,@CTAGS@,$CTAGS,;t t
12570 s,@ETAGS@,$ETAGS,;t t
12571 s,@MAKE_LOWER_TAGS@,$MAKE_LOWER_TAGS,;t t
12572 s,@MAKE_UPPER_TAGS@,$MAKE_UPPER_TAGS,;t t
12573 s,@cf_cv_makeflags@,$cf_cv_makeflags,;t t
12574 s,@RANLIB@,$RANLIB,;t t
12575 s,@ac_ct_RANLIB@,$ac_ct_RANLIB,;t t
12576 s,@LD@,$LD,;t t
12577 s,@ac_ct_LD@,$ac_ct_LD,;t t
12578 s,@AR@,$AR,;t t
12579 s,@ac_ct_AR@,$ac_ct_AR,;t t
12580 s,@ARFLAGS@,$ARFLAGS,;t t
12581 s,@DESTDIR@,$DESTDIR,;t t
12582 s,@BUILD_CC@,$BUILD_CC,;t t
12583 s,@BUILD_CPP@,$BUILD_CPP,;t t
12584 s,@BUILD_CFLAGS@,$BUILD_CFLAGS,;t t
12585 s,@BUILD_CPPFLAGS@,$BUILD_CPPFLAGS,;t t
12586 s,@BUILD_LDFLAGS@,$BUILD_LDFLAGS,;t t
12587 s,@BUILD_LIBS@,$BUILD_LIBS,;t t
12588 s,@BUILD_EXEEXT@,$BUILD_EXEEXT,;t t
12589 s,@BUILD_OBJEXT@,$BUILD_OBJEXT,;t t
12590 s,@DFT_LWR_MODEL@,$DFT_LWR_MODEL,;t t
12591 s,@DFT_UPR_MODEL@,$DFT_UPR_MODEL,;t t
12592 s,@NCURSES_CONFIG@,$NCURSES_CONFIG,;t t
12593 s,@ac_ct_NCURSES_CONFIG@,$ac_ct_NCURSES_CONFIG,;t t
12594 s,@NCURSES_MAJOR@,$NCURSES_MAJOR,;t t
12595 s,@NCURSES_MINOR@,$NCURSES_MINOR,;t t
12596 s,@NCURSES_PATCH@,$NCURSES_PATCH,;t t
12597 s,@cf_cv_rel_version@,$cf_cv_rel_version,;t t
12598 s,@cf_cv_abi_version@,$cf_cv_abi_version,;t t
12599 s,@cf_cv_builtin_bool@,$cf_cv_builtin_bool,;t t
12600 s,@cf_cv_header_stdbool_h@,$cf_cv_header_stdbool_h,;t t
12601 s,@cf_cv_type_of_bool@,$cf_cv_type_of_bool,;t t
12602 s,@LIB_PREFIX@,$LIB_PREFIX,;t t
12603 s,@LIB_SUFFIX@,$LIB_SUFFIX,;t t
12604 s,@CC_G_OPT@,$CC_G_OPT,;t t
12605 s,@LD_MODEL@,$LD_MODEL,;t t
12606 s,@shlibdir@,$shlibdir,;t t
12607 s,@MAKE_DLLS@,$MAKE_DLLS,;t t
12608 s,@CC_SHARED_OPTS@,$CC_SHARED_OPTS,;t t
12609 s,@LD_RPATH_OPT@,$LD_RPATH_OPT,;t t
12610 s,@LD_SHARED_OPTS@,$LD_SHARED_OPTS,;t t
12611 s,@MK_SHARED_LIB@,$MK_SHARED_LIB,;t t
12612 s,@RM_SHARED_OPTS@,$RM_SHARED_OPTS,;t t
12613 s,@LINK_PROGS@,$LINK_PROGS,;t t
12614 s,@LINK_TESTS@,$LINK_TESTS,;t t
12615 s,@EXTRA_LDFLAGS@,$EXTRA_LDFLAGS,;t t
12616 s,@LOCAL_LDFLAGS@,$LOCAL_LDFLAGS,;t t
12617 s,@LOCAL_LDFLAGS2@,$LOCAL_LDFLAGS2,;t t
12618 s,@INSTALL_LIB@,$INSTALL_LIB,;t t
12619 s,@RPATH_LIST@,$RPATH_LIST,;t t
12620 s,@BROKEN_LINKER@,$BROKEN_LINKER,;t t
12621 s,@NCURSES_EXT_FUNCS@,$NCURSES_EXT_FUNCS,;t t
12622 s,@NCURSES_CONST@,$NCURSES_CONST,;t t
12623 s,@PTHREAD@,$PTHREAD,;t t
12624 s,@cf_cv_enable_reentrant@,$cf_cv_enable_reentrant,;t t
12625 s,@NCURSES_WRAP_PREFIX@,$NCURSES_WRAP_PREFIX,;t t
12626 s,@ECHO_LT@,$ECHO_LT,;t t
12627 s,@ECHO_LD@,$ECHO_LD,;t t
12628 s,@RULE_CC@,$RULE_CC,;t t
12629 s,@SHOW_CC@,$SHOW_CC,;t t
12630 s,@ECHO_CC@,$ECHO_CC,;t t
12631 s,@ADAFLAGS@,$ADAFLAGS,;t t
12632 s,@EXTRA_CFLAGS@,$EXTRA_CFLAGS,;t t
12633 s,@ADA_TRACE@,$ADA_TRACE,;t t
12634 s,@gnat_exists@,$gnat_exists,;t t
12635 s,@M4_exists@,$M4_exists,;t t
12636 s,@cf_ada_make@,$cf_ada_make,;t t
12637 s,@GNATPREP_OPTS@,$GNATPREP_OPTS,;t t
12638 s,@cf_compile_generics@,$cf_compile_generics,;t t
12639 s,@cf_generic_objects@,$cf_generic_objects,;t t
12640 s,@USE_GNAT_SIGINT@,$USE_GNAT_SIGINT,;t t
12641 s,@USE_OLD_MAKERULES@,$USE_OLD_MAKERULES,;t t
12642 s,@USE_GNAT_PROJECTS@,$USE_GNAT_PROJECTS,;t t
12643 s,@USE_GNAT_LIBRARIES@,$USE_GNAT_LIBRARIES,;t t
12644 s,@cf_ada_compiler@,$cf_ada_compiler,;t t
12645 s,@cf_ada_package@,$cf_ada_package,;t t
12646 s,@ADA_INCLUDE@,$ADA_INCLUDE,;t t
12647 s,@ADA_OBJECTS@,$ADA_OBJECTS,;t t
12648 s,@ADA_SHAREDLIB@,$ADA_SHAREDLIB,;t t
12649 s,@MAKE_ADA_SHAREDLIB@,$MAKE_ADA_SHAREDLIB,;t t
12650 s,@TINFO_LDFLAGS2@,$TINFO_LDFLAGS2,;t t
12651 s,@TINFO_LIBS@,$TINFO_LIBS,;t t
12652 s,@ACPPFLAGS@,$ACPPFLAGS,;t t
12653 s,@DFT_ARG_SUFFIX@,$DFT_ARG_SUFFIX,;t t
12654 s,@DFT_DEP_SUFFIX@,$DFT_DEP_SUFFIX,;t t
12655 s,@DFT_OBJ_SUBDIR@,$DFT_OBJ_SUBDIR,;t t
12656 s,@USE_CFG_SUFFIX@,$USE_CFG_SUFFIX,;t t
12657 s,@TEST_ARG2@,$TEST_ARG2,;t t
12658 s,@TEST_LIBS2@,$TEST_LIBS2,;t t
12659 s,@NCURSES_SHLIB2@,$NCURSES_SHLIB2,;t t
12660 s,@ADA_SUBDIRS@,$ADA_SUBDIRS,;t t
12661 s,@NCURSES_TREE@,$NCURSES_TREE,;t t
12662 s,@EXTERNAL_TREE@,$EXTERNAL_TREE,;t t
12663 s,@ADAHTML_DIR@,$ADAHTML_DIR,;t t
12664 CEOF
12665
12666 EOF
12667
12668   cat >>$CONFIG_STATUS <<\EOF
12669   # Split the substitutions into bite-sized pieces for seds with
12670   # small command number limits, like on Digital OSF/1 and HP-UX.
12671   ac_max_sed_lines=48
12672   ac_sed_frag=1 # Number of current file.
12673   ac_beg=1 # First line for current file.
12674   ac_end=$ac_max_sed_lines # Line after last line for current file.
12675   ac_more_lines=:
12676   ac_sed_cmds=
12677   while $ac_more_lines; do
12678     if test $ac_beg -gt 1; then
12679       sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
12680     else
12681       sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
12682     fi
12683     if test ! -s $tmp/subs.frag; then
12684       ac_more_lines=false
12685     else
12686       # The purpose of the label and of the branching condition is to
12687       # speed up the sed processing (if there are no `@' at all, there
12688       # is no need to browse any of the substitutions).
12689       # These are the two extra sed commands mentioned above.
12690       (echo ':t
12691   /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed
12692       if test -z "$ac_sed_cmds"; then
12693         ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed"
12694       else
12695         ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed"
12696       fi
12697       ac_sed_frag=`expr $ac_sed_frag + 1`
12698       ac_beg=$ac_end
12699       ac_end=`expr $ac_end + $ac_max_sed_lines`
12700     fi
12701   done
12702   if test -z "$ac_sed_cmds"; then
12703     ac_sed_cmds=cat
12704   fi
12705 fi # test -n "$CONFIG_FILES"
12706
12707 EOF
12708 cat >>$CONFIG_STATUS <<\EOF
12709 for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue
12710   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
12711   case $ac_file in
12712   - | *:- | *:-:* ) # input from stdin
12713         cat >$tmp/stdin
12714         ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
12715         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
12716   *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
12717         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
12718   * )   ac_file_in=$ac_file.in ;;
12719   esac
12720
12721   # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories.
12722   ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
12723          X"$ac_file" : 'X\(//\)[^/]' \| \
12724          X"$ac_file" : 'X\(//\)$' \| \
12725          X"$ac_file" : 'X\(/\)' \| \
12726          .     : '\(.\)' 2>/dev/null ||
12727 echo X"$ac_file" |
12728     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
12729           /^X\(\/\/\)[^/].*/{ s//\1/; q; }
12730           /^X\(\/\/\)$/{ s//\1/; q; }
12731           /^X\(\/\).*/{ s//\1/; q; }
12732           s/.*/./; q'`
12733   if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
12734     { case "$ac_dir" in
12735   [\\/]* | ?:[\\/]* ) as_incr_dir=;;
12736   *)                      as_incr_dir=.;;
12737 esac
12738 as_dummy="$ac_dir"
12739 for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
12740   case $as_mkdir_dir in
12741     # Skip DOS drivespec
12742     ?:) as_incr_dir=$as_mkdir_dir ;;
12743     *)
12744       as_incr_dir=$as_incr_dir/$as_mkdir_dir
12745       test -d "$as_incr_dir" || mkdir "$as_incr_dir"
12746     ;;
12747   esac
12748 done; }
12749
12750     ac_dir_suffix="/`echo $ac_dir|sed 's,^\./,,'`"
12751     # A "../" for each directory in $ac_dir_suffix.
12752     ac_dots=`echo "$ac_dir_suffix" | sed 's,/[^/]*,../,g'`
12753   else
12754     ac_dir_suffix= ac_dots=
12755   fi
12756
12757   case $srcdir in
12758   .)  ac_srcdir=.
12759       if test -z "$ac_dots"; then
12760          ac_top_srcdir=.
12761       else
12762          ac_top_srcdir=`echo $ac_dots | sed 's,/$,,'`
12763       fi ;;
12764   [\\/]* | ?:[\\/]* )
12765       ac_srcdir=$srcdir$ac_dir_suffix;
12766       ac_top_srcdir=$srcdir ;;
12767   *) # Relative path.
12768     ac_srcdir=$ac_dots$srcdir$ac_dir_suffix
12769     ac_top_srcdir=$ac_dots$srcdir ;;
12770   esac
12771
12772   case $INSTALL in
12773   [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
12774   *) ac_INSTALL=$ac_dots$INSTALL ;;
12775   esac
12776
12777   if test x"$ac_file" != x-; then
12778     { echo "$as_me:12778: creating $ac_file" >&5
12779 echo "$as_me: creating $ac_file" >&6;}
12780     rm -f "$ac_file"
12781   fi
12782   # Let's still pretend it is `configure' which instantiates (i.e., don't
12783   # use $as_me), people would be surprised to read:
12784   #    /* config.h.  Generated automatically by config.status.  */
12785   configure_input="Generated automatically from `echo $ac_file_in |
12786                                                  sed 's,.*/,,'` by configure."
12787
12788   # First look for the input files in the build tree, otherwise in the
12789   # src tree.
12790   ac_file_inputs=`IFS=:
12791     for f in $ac_file_in; do
12792       case $f in
12793       -) echo $tmp/stdin ;;
12794       [\\/$]*)
12795          # Absolute (can't be DOS-style, as IFS=:)
12796          test -f "$f" || { { echo "$as_me:12796: error: cannot find input file: $f" >&5
12797 echo "$as_me: error: cannot find input file: $f" >&2;}
12798    { (exit 1); exit 1; }; }
12799          echo $f;;
12800       *) # Relative
12801          if test -f "$f"; then
12802            # Build tree
12803            echo $f
12804          elif test -f "$srcdir/$f"; then
12805            # Source tree
12806            echo $srcdir/$f
12807          else
12808            # /dev/null tree
12809            { { echo "$as_me:12809: error: cannot find input file: $f" >&5
12810 echo "$as_me: error: cannot find input file: $f" >&2;}
12811    { (exit 1); exit 1; }; }
12812          fi;;
12813       esac
12814     done` || { (exit 1); exit 1; }
12815 EOF
12816 cat >>$CONFIG_STATUS <<\EOF
12817   ac_warn_datarootdir=no
12818   if test x"$ac_file" != x-; then
12819     for ac_item in $ac_file_inputs
12820     do
12821       ac_seen=`grep '@\(datadir\|mandir\|infodir\)@' $ac_item`
12822       if test -n "$ac_seen"; then
12823         ac_used=`grep '@datarootdir@' $ac_item`
12824         if test -z "$ac_used"; then
12825           { echo "$as_me:12825: WARNING: datarootdir was used implicitly but not set:
12826 $ac_seen" >&5
12827 echo "$as_me: WARNING: datarootdir was used implicitly but not set:
12828 $ac_seen" >&2;}
12829           ac_warn_datarootdir=yes
12830         fi
12831       fi
12832       ac_seen=`grep '${datarootdir}' $ac_item`
12833       if test -n "$ac_seen"; then
12834         { echo "$as_me:12834: WARNING: datarootdir was used explicitly but not set:
12835 $ac_seen" >&5
12836 echo "$as_me: WARNING: datarootdir was used explicitly but not set:
12837 $ac_seen" >&2;}
12838         ac_warn_datarootdir=yes
12839       fi
12840     done
12841   fi
12842
12843 if test "x$ac_warn_datarootdir" = xyes; then
12844   ac_sed_cmds="$ac_sed_cmds | sed -e 's,@datarootdir@,\${prefix}/share,g' -e 's,\${datarootdir},\${prefix}/share,g'"
12845 fi
12846
12847 EOF
12848 cat >>$CONFIG_STATUS <<EOF
12849   sed "$ac_vpsub
12850 $extrasub
12851 EOF
12852 cat >>$CONFIG_STATUS <<\EOF
12853 :t
12854 /@[a-zA-Z_][a-zA-Z_0-9]*@/!b
12855 s,@configure_input@,$configure_input,;t t
12856 s,@srcdir@,$ac_srcdir,;t t
12857 s,@top_srcdir@,$ac_top_srcdir,;t t
12858 s,@INSTALL@,$ac_INSTALL,;t t
12859 " $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out
12860   rm -f $tmp/stdin
12861   if test x"$ac_file" != x-; then
12862     cp $tmp/out $ac_file
12863
12864     for ac_name in prefix exec_prefix datarootdir
12865     do
12866         ac_seen=`fgrep -n '${'$ac_name'[:=].*}' $ac_file`
12867         if test -n "$ac_seen"; then
12868             ac_init=`egrep '[   ]*'$ac_name'[   ]*=' $ac_file`
12869             if test -z "$ac_init"; then
12870               ac_seen=`echo "$ac_seen" |sed -e 's,^,'$ac_file':,'`
12871               { echo "$as_me:12871: WARNING: Variable $ac_name is used but was not set:
12872 $ac_seen" >&5
12873 echo "$as_me: WARNING: Variable $ac_name is used but was not set:
12874 $ac_seen" >&2;}
12875             fi
12876         fi
12877     done
12878     egrep -n '@[a-z_][a-z_0-9]+@' $ac_file >$tmp/out
12879     egrep -n '@[A-Z_][A-Z_0-9]+@' $ac_file >>$tmp/out
12880     if test -s $tmp/out; then
12881       ac_seen=`sed -e 's,^,'$ac_file':,' < $tmp/out`
12882       { echo "$as_me:12882: WARNING: Some variables may not be substituted:
12883 $ac_seen" >&5
12884 echo "$as_me: WARNING: Some variables may not be substituted:
12885 $ac_seen" >&2;}
12886     fi
12887   else
12888     cat $tmp/out
12889   fi
12890   rm -f $tmp/out
12891
12892 done
12893 EOF
12894 cat >>$CONFIG_STATUS <<\EOF
12895
12896 #
12897 # CONFIG_HEADER section.
12898 #
12899
12900 # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
12901 # NAME is the cpp macro being defined and VALUE is the value it is being given.
12902 #
12903 # ac_d sets the value in "#define NAME VALUE" lines.
12904 ac_dA='s,^\([   ]*\)#\([        ]*define[       ][      ]*\)'
12905 ac_dB='[        ].*$,\1#\2'
12906 ac_dC=' '
12907 ac_dD=',;t'
12908 # ac_i turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
12909 ac_iA='s,^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
12910 ac_iB='\([      ]\),\1#\2define\3'
12911 ac_iC=' '
12912 ac_iD='\4,;t'
12913 # ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
12914 ac_uA='s,^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
12915 ac_uB='$,\1#\2define\3'
12916 ac_uC=' '
12917 ac_uD=',;t'
12918
12919 for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue
12920   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
12921   case $ac_file in
12922   - | *:- | *:-:* ) # input from stdin
12923         cat >$tmp/stdin
12924         ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
12925         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
12926   *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
12927         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
12928   * )   ac_file_in=$ac_file.in ;;
12929   esac
12930
12931   test x"$ac_file" != x- && { echo "$as_me:12931: creating $ac_file" >&5
12932 echo "$as_me: creating $ac_file" >&6;}
12933
12934   # First look for the input files in the build tree, otherwise in the
12935   # src tree.
12936   ac_file_inputs=`IFS=:
12937     for f in $ac_file_in; do
12938       case $f in
12939       -) echo $tmp/stdin ;;
12940       [\\/$]*)
12941          # Absolute (can't be DOS-style, as IFS=:)
12942          test -f "$f" || { { echo "$as_me:12942: error: cannot find input file: $f" >&5
12943 echo "$as_me: error: cannot find input file: $f" >&2;}
12944    { (exit 1); exit 1; }; }
12945          echo $f;;
12946       *) # Relative
12947          if test -f "$f"; then
12948            # Build tree
12949            echo $f
12950          elif test -f "$srcdir/$f"; then
12951            # Source tree
12952            echo $srcdir/$f
12953          else
12954            # /dev/null tree
12955            { { echo "$as_me:12955: error: cannot find input file: $f" >&5
12956 echo "$as_me: error: cannot find input file: $f" >&2;}
12957    { (exit 1); exit 1; }; }
12958          fi;;
12959       esac
12960     done` || { (exit 1); exit 1; }
12961   # Remove the trailing spaces.
12962   sed 's/[      ]*$//' $ac_file_inputs >$tmp/in
12963
12964 EOF
12965
12966 # Transform confdefs.h into a list of #define's.  We won't use it as a sed
12967 # script, but as data to insert where we see @DEFS@.  We expect AC_SAVE_DEFS to
12968 # be either 'cat' or 'sort'.
12969 cat confdefs.h | uniq >conftest.vals
12970
12971 # Break up conftest.vals because some shells have a limit on
12972 # the size of here documents, and old seds have small limits too.
12973
12974 rm -f conftest.tail
12975 echo '  rm -f conftest.frag' >> $CONFIG_STATUS
12976 while grep . conftest.vals >/dev/null
12977 do
12978   # Write chunks of a limited-size here document to conftest.frag.
12979   echo '  cat >> conftest.frag <<CEOF' >> $CONFIG_STATUS
12980   sed ${ac_max_here_lines}q conftest.vals | sed -e 's/#ifdef.*/#if 0/' >> $CONFIG_STATUS
12981   echo 'CEOF' >> $CONFIG_STATUS
12982   sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
12983   rm -f conftest.vals
12984   mv conftest.tail conftest.vals
12985 done
12986 rm -f conftest.vals
12987
12988 # Run sed to substitute the contents of conftest.frag into $tmp/in at the
12989 # marker @DEFS@.
12990 echo '  cat >> conftest.edit <<CEOF
12991 /@DEFS@/r conftest.frag
12992 /@DEFS@/d
12993 CEOF
12994 sed -f conftest.edit $tmp/in > $tmp/out
12995 rm -f $tmp/in
12996 mv $tmp/out $tmp/in
12997 rm -f conftest.edit conftest.frag
12998 ' >> $CONFIG_STATUS
12999
13000 cat >>$CONFIG_STATUS <<\EOF
13001   # Let's still pretend it is `configure' which instantiates (i.e., don't
13002   # use $as_me), people would be surprised to read:
13003   #    /* config.h.  Generated automatically by config.status.  */
13004   if test x"$ac_file" = x-; then
13005     echo "/* Generated automatically by configure.  */" >$tmp/config.h
13006   else
13007     echo "/* $ac_file.  Generated automatically by configure.  */" >$tmp/config.h
13008   fi
13009   cat $tmp/in >>$tmp/config.h
13010   rm -f $tmp/in
13011   if test x"$ac_file" != x-; then
13012     if cmp -s $ac_file $tmp/config.h 2>/dev/null; then
13013       { echo "$as_me:13013: $ac_file is unchanged" >&5
13014 echo "$as_me: $ac_file is unchanged" >&6;}
13015     else
13016       ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
13017          X"$ac_file" : 'X\(//\)[^/]' \| \
13018          X"$ac_file" : 'X\(//\)$' \| \
13019          X"$ac_file" : 'X\(/\)' \| \
13020          .     : '\(.\)' 2>/dev/null ||
13021 echo X"$ac_file" |
13022     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
13023           /^X\(\/\/\)[^/].*/{ s//\1/; q; }
13024           /^X\(\/\/\)$/{ s//\1/; q; }
13025           /^X\(\/\).*/{ s//\1/; q; }
13026           s/.*/./; q'`
13027       if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
13028         { case "$ac_dir" in
13029   [\\/]* | ?:[\\/]* ) as_incr_dir=;;
13030   *)                      as_incr_dir=.;;
13031 esac
13032 as_dummy="$ac_dir"
13033 for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
13034   case $as_mkdir_dir in
13035     # Skip DOS drivespec
13036     ?:) as_incr_dir=$as_mkdir_dir ;;
13037     *)
13038       as_incr_dir=$as_incr_dir/$as_mkdir_dir
13039       test -d "$as_incr_dir" || mkdir "$as_incr_dir"
13040     ;;
13041   esac
13042 done; }
13043
13044       fi
13045       rm -f $ac_file
13046       mv $tmp/config.h $ac_file
13047     fi
13048   else
13049     cat $tmp/config.h
13050     rm -f $tmp/config.h
13051   fi
13052 done
13053 EOF
13054 cat >>$CONFIG_STATUS <<\EOF
13055 #
13056 # CONFIG_COMMANDS section.
13057 #
13058 for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue
13059   ac_dest=`echo "$ac_file" | sed 's,:.*,,'`
13060   ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'`
13061
13062   case $ac_dest in
13063     default )
13064 if test -z "$USE_OLD_MAKERULES" ; then
13065         $AWK -f $srcdir/mk-1st.awk <$srcdir/src/modules >>src/Makefile
13066 fi
13067  ;;
13068   esac
13069 done
13070 EOF
13071
13072 cat >>$CONFIG_STATUS <<\EOF
13073
13074 { (exit 0); exit 0; }
13075 EOF
13076 chmod +x $CONFIG_STATUS
13077 ac_clean_files=$ac_clean_files_save
13078
13079 # configure is writing to config.log, and then calls config.status.
13080 # config.status does its own redirection, appending to config.log.
13081 # Unfortunately, on DOS this fails, as config.log is still kept open
13082 # by configure, so config.status won't be able to write to it; its
13083 # output is simply discarded.  So we exec the FD to /dev/null,
13084 # effectively closing config.log, so it can be properly (re)opened and
13085 # appended to by config.status.  When coming back to configure, we
13086 # need to make the FD available again.
13087 if test "$no_create" != yes; then
13088   ac_cs_success=:
13089   exec 5>/dev/null
13090   $SHELL $CONFIG_STATUS || ac_cs_success=false
13091   exec 5>>config.log
13092   # Use ||, not &&, to avoid exiting from the if with $? = 1, which
13093   # would make configure fail if this is the last instruction.
13094   $ac_cs_success || { (exit 1); exit 1; }
13095 fi
13096 ${MAKE:-make} preinstall