]> ncurses.scripts.mit.edu Git - ncurses.git/blob - Ada95/configure
33b067abf506af238f29f5f7457402bdf6ad8579
[ncurses.git] / Ada95 / configure
1 #! /bin/sh
2 # From configure.in Revision: 1.60 .
3 # Guess values for system-dependent variables and create Makefiles.
4 # Generated by Autoconf 2.52.20141204.
5 #
6 # Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
7 # Free Software Foundation, Inc.
8 # This configure script is free software; the Free Software Foundation
9 # gives unlimited permission to copy, distribute and modify it.
10
11 # Avoid depending upon Character Ranges.
12 as_cr_letters='abcdefghijklmnopqrstuvwxyz'
13 as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
14 as_cr_Letters=$as_cr_letters$as_cr_LETTERS
15 as_cr_digits='0123456789'
16 as_cr_alnum=$as_cr_Letters$as_cr_digits
17
18 # Sed expression to map a string onto a valid variable name.
19 as_tr_sh="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g"
20
21 # Sed expression to map a string onto a valid CPP name.
22 as_tr_cpp="sed y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g"
23
24 # Be Bourne compatible
25 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
26   emulate sh
27   NULLCMD=:
28 elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
29   set -o posix
30 fi
31
32 # Name of the executable.
33 as_me=`echo "$0" |sed 's,.*[\\/],,'`
34
35 if expr a : '\(a\)' >/dev/null 2>&1; then
36   as_expr=expr
37 else
38   as_expr=false
39 fi
40
41 rm -f conf$$ conf$$.exe conf$$.file
42 echo >conf$$.file
43 if ln -s conf$$.file conf$$ 2>/dev/null; then
44   # We could just check for DJGPP; but this test a) works b) is more generic
45   # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
46   if test -f conf$$.exe; then
47     # Don't use ln at all; we don't have any links
48     as_ln_s='cp -p'
49   else
50     as_ln_s='ln -s'
51   fi
52 elif ln conf$$.file conf$$ 2>/dev/null; then
53   as_ln_s=ln
54 else
55   as_ln_s='cp -p'
56 fi
57 rm -f conf$$ conf$$.exe conf$$.file
58
59 as_executable_p="test -f"
60
61 # Support unset when possible.
62 if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
63   as_unset=unset
64 else
65   as_unset=false
66 fi
67
68 # NLS nuisances.
69 $as_unset LANG || test "${LANG+set}" != set || { LANG=C; export LANG; }
70 $as_unset LC_ALL || test "${LC_ALL+set}" != set || { LC_ALL=C; export LC_ALL; }
71 $as_unset LC_TIME || test "${LC_TIME+set}" != set || { LC_TIME=C; export LC_TIME; }
72 $as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set || { LC_CTYPE=C; export LC_CTYPE; }
73 $as_unset LANGUAGE || test "${LANGUAGE+set}" != set || { LANGUAGE=C; export LANGUAGE; }
74 $as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set || { LC_COLLATE=C; export LC_COLLATE; }
75 $as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set || { LC_NUMERIC=C; export LC_NUMERIC; }
76 $as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set || { LC_MESSAGES=C; export LC_MESSAGES; }
77
78 # IFS
79 # We need space, tab and new line, in precisely that order.
80 as_nl='
81 '
82 IFS="   $as_nl"
83
84 # CDPATH.
85 $as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=:; export CDPATH; }
86
87 # Name of the host.
88 # hostname on some systems (SVR3.2, Linux) returns a bogus exit status,
89 # so uname gets run too.
90 ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
91
92 exec 6>&1
93
94 #
95 # Initializations.
96 #
97 ac_default_prefix=/usr/local
98 cross_compiling=no
99 subdirs=
100 MFLAGS= MAKEFLAGS=
101 SHELL=${CONFIG_SHELL-/bin/sh}
102
103 # Maximum number of lines to put in a shell here document.
104 # This variable seems obsolete.  It should probably be removed, and
105 # only ac_max_sed_lines should be used.
106 : ${ac_max_here_lines=38}
107
108 ac_unique_file="gen/gen.c"
109
110 # Initialize some variables set by options.
111 ac_init_help=
112 ac_init_version=false
113 # The variables have the same names as the options, with
114 # dashes changed to underlines.
115 cache_file=/dev/null
116 exec_prefix=NONE
117 no_create=
118 no_recursion=
119 prefix=NONE
120 program_prefix=NONE
121 program_suffix=NONE
122 program_transform_name=s,x,x,
123 silent=
124 site=
125 srcdir=
126 verbose=
127 x_includes=NONE
128 x_libraries=NONE
129
130 # Installation directory options.
131 # These are left unexpanded so users can "make install exec_prefix=/foo"
132 # and all the variables that are supposed to be based on exec_prefix
133 # by default will actually change.
134 # Use braces instead of parens because sh, perl, etc. also accept them.
135 bindir='${exec_prefix}/bin'
136 sbindir='${exec_prefix}/sbin'
137 libexecdir='${exec_prefix}/libexec'
138 datarootdir='${prefix}/share'
139 datadir='${datarootdir}'
140 sysconfdir='${prefix}/etc'
141 sharedstatedir='${prefix}/com'
142 localstatedir='${prefix}/var'
143 libdir='${exec_prefix}/lib'
144 includedir='${prefix}/include'
145 oldincludedir='/usr/include'
146 infodir='${datarootdir}/info'
147 mandir='${datarootdir}/man'
148
149 # Identity of this package.
150 PACKAGE_NAME=
151 PACKAGE_TARNAME=
152 PACKAGE_VERSION=
153 PACKAGE_STRING=
154 PACKAGE_BUGREPORT=
155
156 ac_prev=
157 for ac_option
158 do
159   # If the previous option needs an argument, assign it.
160   if test -n "$ac_prev"; then
161     eval "$ac_prev=\$ac_option"
162     ac_prev=
163     continue
164   fi
165
166   ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'`
167
168   # Accept the important Cygnus configure options, so we can diagnose typos.
169
170   case $ac_option in
171
172   -bindir | --bindir | --bindi | --bind | --bin | --bi)
173     ac_prev=bindir ;;
174   -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
175     bindir=$ac_optarg ;;
176
177   -build | --build | --buil | --bui | --bu)
178     ac_prev=build_alias ;;
179   -build=* | --build=* | --buil=* | --bui=* | --bu=*)
180     build_alias=$ac_optarg ;;
181
182   -cache-file | --cache-file | --cache-fil | --cache-fi \
183   | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
184     ac_prev=cache_file ;;
185   -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
186   | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
187     cache_file=$ac_optarg ;;
188
189   --config-cache | -C)
190     cache_file=config.cache ;;
191
192   -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
193     ac_prev=datadir ;;
194   -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
195   | --da=*)
196     datadir=$ac_optarg ;;
197
198   -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \
199   | --dataroo | --dataro | --datar)
200     ac_prev=datarootdir ;;
201   -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \
202   | --dataroot=* | --dataroo=* | --dataro=* | --datar=*)
203     datarootdir=$ac_optarg ;;
204
205   -disable-* | --disable-*)
206     ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
207     # Reject names that are not valid shell variable names.
208     expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
209       { echo "$as_me: error: invalid feature name: $ac_feature" >&2
210    { (exit 1); exit 1; }; }
211     ac_feature=`echo $ac_feature | sed 's/-/_/g'`
212     eval "enable_$ac_feature=no" ;;
213
214   -enable-* | --enable-*)
215     ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
216     # Reject names that are not valid shell variable names.
217     expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
218       { echo "$as_me: error: invalid feature name: $ac_feature" >&2
219    { (exit 1); exit 1; }; }
220     ac_feature=`echo $ac_feature | sed 's/-/_/g'`
221     case $ac_option in
222       *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
223       *) ac_optarg=yes ;;
224     esac
225     eval "enable_$ac_feature='$ac_optarg'" ;;
226
227   -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
228   | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
229   | --exec | --exe | --ex)
230     ac_prev=exec_prefix ;;
231   -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
232   | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
233   | --exec=* | --exe=* | --ex=*)
234     exec_prefix=$ac_optarg ;;
235
236   -gas | --gas | --ga | --g)
237     # Obsolete; use --with-gas.
238     with_gas=yes ;;
239
240   -help | --help | --hel | --he | -h)
241     ac_init_help=long ;;
242   -help=r* | --help=r* | --hel=r* | --he=r* | -hr*)
243     ac_init_help=recursive ;;
244   -help=s* | --help=s* | --hel=s* | --he=s* | -hs*)
245     ac_init_help=short ;;
246
247   -host | --host | --hos | --ho)
248     ac_prev=host_alias ;;
249   -host=* | --host=* | --hos=* | --ho=*)
250     host_alias=$ac_optarg ;;
251
252   -includedir | --includedir | --includedi | --included | --include \
253   | --includ | --inclu | --incl | --inc)
254     ac_prev=includedir ;;
255   -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
256   | --includ=* | --inclu=* | --incl=* | --inc=*)
257     includedir=$ac_optarg ;;
258
259   -infodir | --infodir | --infodi | --infod | --info | --inf)
260     ac_prev=infodir ;;
261   -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
262     infodir=$ac_optarg ;;
263
264   -libdir | --libdir | --libdi | --libd)
265     ac_prev=libdir ;;
266   -libdir=* | --libdir=* | --libdi=* | --libd=*)
267     libdir=$ac_optarg ;;
268
269   -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
270   | --libexe | --libex | --libe)
271     ac_prev=libexecdir ;;
272   -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
273   | --libexe=* | --libex=* | --libe=*)
274     libexecdir=$ac_optarg ;;
275
276   -localstatedir | --localstatedir | --localstatedi | --localstated \
277   | --localstate | --localstat | --localsta | --localst \
278   | --locals | --local | --loca | --loc | --lo)
279     ac_prev=localstatedir ;;
280   -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
281   | --localstate=* | --localstat=* | --localsta=* | --localst=* \
282   | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
283     localstatedir=$ac_optarg ;;
284
285   -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
286     ac_prev=mandir ;;
287   -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
288     mandir=$ac_optarg ;;
289
290   -nfp | --nfp | --nf)
291     # Obsolete; use --without-fp.
292     with_fp=no ;;
293
294   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
295   | --no-cr | --no-c)
296     no_create=yes ;;
297
298   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
299   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
300     no_recursion=yes ;;
301
302   -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
303   | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
304   | --oldin | --oldi | --old | --ol | --o)
305     ac_prev=oldincludedir ;;
306   -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
307   | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
308   | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
309     oldincludedir=$ac_optarg ;;
310
311   -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
312     ac_prev=prefix ;;
313   -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
314     prefix=$ac_optarg ;;
315
316   -program-prefix | --program-prefix | --program-prefi | --program-pref \
317   | --program-pre | --program-pr | --program-p)
318     ac_prev=program_prefix ;;
319   -program-prefix=* | --program-prefix=* | --program-prefi=* \
320   | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
321     program_prefix=$ac_optarg ;;
322
323   -program-suffix | --program-suffix | --program-suffi | --program-suff \
324   | --program-suf | --program-su | --program-s)
325     ac_prev=program_suffix ;;
326   -program-suffix=* | --program-suffix=* | --program-suffi=* \
327   | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
328     program_suffix=$ac_optarg ;;
329
330   -program-transform-name | --program-transform-name \
331   | --program-transform-nam | --program-transform-na \
332   | --program-transform-n | --program-transform- \
333   | --program-transform | --program-transfor \
334   | --program-transfo | --program-transf \
335   | --program-trans | --program-tran \
336   | --progr-tra | --program-tr | --program-t)
337     ac_prev=program_transform_name ;;
338   -program-transform-name=* | --program-transform-name=* \
339   | --program-transform-nam=* | --program-transform-na=* \
340   | --program-transform-n=* | --program-transform-=* \
341   | --program-transform=* | --program-transfor=* \
342   | --program-transfo=* | --program-transf=* \
343   | --program-trans=* | --program-tran=* \
344   | --progr-tra=* | --program-tr=* | --program-t=*)
345     program_transform_name=$ac_optarg ;;
346
347   -q | -quiet | --quiet | --quie | --qui | --qu | --q \
348   | -silent | --silent | --silen | --sile | --sil)
349     silent=yes ;;
350
351   -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
352     ac_prev=sbindir ;;
353   -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
354   | --sbi=* | --sb=*)
355     sbindir=$ac_optarg ;;
356
357   -sharedstatedir | --sharedstatedir | --sharedstatedi \
358   | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
359   | --sharedst | --shareds | --shared | --share | --shar \
360   | --sha | --sh)
361     ac_prev=sharedstatedir ;;
362   -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
363   | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
364   | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
365   | --sha=* | --sh=*)
366     sharedstatedir=$ac_optarg ;;
367
368   -site | --site | --sit)
369     ac_prev=site ;;
370   -site=* | --site=* | --sit=*)
371     site=$ac_optarg ;;
372
373   -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
374     ac_prev=srcdir ;;
375   -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
376     srcdir=$ac_optarg ;;
377
378   -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
379   | --syscon | --sysco | --sysc | --sys | --sy)
380     ac_prev=sysconfdir ;;
381   -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
382   | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
383     sysconfdir=$ac_optarg ;;
384
385   -target | --target | --targe | --targ | --tar | --ta | --t)
386     ac_prev=target_alias ;;
387   -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
388     target_alias=$ac_optarg ;;
389
390   -v | -verbose | --verbose | --verbos | --verbo | --verb)
391     verbose=yes ;;
392
393   -version | --version | --versio | --versi | --vers | -V)
394     ac_init_version=: ;;
395
396   -with-* | --with-*)
397     ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
398     # Reject names that are not valid shell variable names.
399     expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
400       { echo "$as_me: error: invalid package name: $ac_package" >&2
401    { (exit 1); exit 1; }; }
402     ac_package=`echo $ac_package| sed 's/-/_/g'`
403     case $ac_option in
404       *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
405       *) ac_optarg=yes ;;
406     esac
407     eval "with_$ac_package='$ac_optarg'" ;;
408
409   -without-* | --without-*)
410     ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'`
411     # Reject names that are not valid shell variable names.
412     expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
413       { echo "$as_me: error: invalid package name: $ac_package" >&2
414    { (exit 1); exit 1; }; }
415     ac_package=`echo $ac_package | sed 's/-/_/g'`
416     eval "with_$ac_package=no" ;;
417
418   --x)
419     # Obsolete; use --with-x.
420     with_x=yes ;;
421
422   -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
423   | --x-incl | --x-inc | --x-in | --x-i)
424     ac_prev=x_includes ;;
425   -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
426   | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
427     x_includes=$ac_optarg ;;
428
429   -x-libraries | --x-libraries | --x-librarie | --x-librari \
430   | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
431     ac_prev=x_libraries ;;
432   -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
433   | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
434     x_libraries=$ac_optarg ;;
435
436   -*) { echo "$as_me: error: unrecognized option: $ac_option
437 Try \`$0 --help' for more information." >&2
438    { (exit 1); exit 1; }; }
439     ;;
440
441   *=*)
442     ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
443     # Reject names that are not valid shell variable names.
444     expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null &&
445       { echo "$as_me: error: invalid variable name: $ac_envvar" >&2
446    { (exit 1); exit 1; }; }
447     ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`
448     eval "$ac_envvar='$ac_optarg'"
449     export $ac_envvar ;;
450
451   *)
452     # FIXME: should be removed in autoconf 3.0.
453     echo "$as_me: WARNING: you should use --build, --host, --target" >&2
454     expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
455       echo "$as_me: WARNING: invalid host type: $ac_option" >&2
456     : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}
457     ;;
458
459   esac
460 done
461
462 if test -n "$ac_prev"; then
463   ac_option=--`echo $ac_prev | sed 's/_/-/g'`
464   { echo "$as_me: error: missing argument to $ac_option" >&2
465    { (exit 1); exit 1; }; }
466 fi
467
468 # Be sure to have absolute paths.
469 for ac_var in exec_prefix prefix
470 do
471   eval ac_val=$`echo $ac_var`
472   case $ac_val in
473     [\\/$]* | ?:[\\/]* | NONE | '' ) ;;
474     *)  { echo "$as_me: error: expected an absolute path for --$ac_var: $ac_val" >&2
475    { (exit 1); exit 1; }; };;
476   esac
477 done
478
479 # Be sure to have absolute paths.
480 for ac_var in bindir sbindir libexecdir datarootdir datadir sysconfdir sharedstatedir \
481               localstatedir libdir includedir oldincludedir infodir mandir
482 do
483   eval ac_val=$`echo $ac_var`
484   case $ac_val in
485     [\\/$]* | ?:[\\/]* ) ;;
486     *)  { echo "$as_me: error: expected an absolute path for --$ac_var: $ac_val" >&2
487    { (exit 1); exit 1; }; };;
488   esac
489 done
490
491 # There might be people who depend on the old broken behavior: `$host'
492 # used to hold the argument of --host etc.
493 build=$build_alias
494 host=$host_alias
495 target=$target_alias
496
497 # FIXME: should be removed in autoconf 3.0.
498 if test "x$host_alias" != x; then
499   if test "x$build_alias" = x; then
500     cross_compiling=maybe
501     echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host.
502     If a cross compiler is detected then cross compile mode will be used." >&2
503   elif test "x$build_alias" != "x$host_alias"; then
504     cross_compiling=yes
505   fi
506 fi
507
508 ac_tool_prefix=
509 test -n "$host_alias" && ac_tool_prefix=$host_alias-
510
511 test "$silent" = yes && exec 6>/dev/null
512
513 # Find the source files, if location was not specified.
514 if test -z "$srcdir"; then
515   ac_srcdir_defaulted=yes
516   # Try the directory containing this script, then its parent.
517   ac_prog=$0
518   ac_confdir=`echo "$ac_prog" | sed 's%[\\/][^\\/][^\\/]*$%%'`
519   test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
520   srcdir=$ac_confdir
521   if test ! -r $srcdir/$ac_unique_file; then
522     srcdir=..
523   fi
524 else
525   ac_srcdir_defaulted=no
526 fi
527 if test ! -r $srcdir/$ac_unique_file; then
528   if test "$ac_srcdir_defaulted" = yes; then
529     { echo "$as_me: error: cannot find sources in $ac_confdir or .." >&2
530    { (exit 1); exit 1; }; }
531   else
532     { echo "$as_me: error: cannot find sources in $srcdir" >&2
533    { (exit 1); exit 1; }; }
534   fi
535 fi
536 srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'`
537 ac_env_build_alias_set=${build_alias+set}
538 ac_env_build_alias_value=$build_alias
539 ac_cv_env_build_alias_set=${build_alias+set}
540 ac_cv_env_build_alias_value=$build_alias
541 ac_env_host_alias_set=${host_alias+set}
542 ac_env_host_alias_value=$host_alias
543 ac_cv_env_host_alias_set=${host_alias+set}
544 ac_cv_env_host_alias_value=$host_alias
545 ac_env_target_alias_set=${target_alias+set}
546 ac_env_target_alias_value=$target_alias
547 ac_cv_env_target_alias_set=${target_alias+set}
548 ac_cv_env_target_alias_value=$target_alias
549 ac_env_CC_set=${CC+set}
550 ac_env_CC_value=$CC
551 ac_cv_env_CC_set=${CC+set}
552 ac_cv_env_CC_value=$CC
553 ac_env_CFLAGS_set=${CFLAGS+set}
554 ac_env_CFLAGS_value=$CFLAGS
555 ac_cv_env_CFLAGS_set=${CFLAGS+set}
556 ac_cv_env_CFLAGS_value=$CFLAGS
557 ac_env_LDFLAGS_set=${LDFLAGS+set}
558 ac_env_LDFLAGS_value=$LDFLAGS
559 ac_cv_env_LDFLAGS_set=${LDFLAGS+set}
560 ac_cv_env_LDFLAGS_value=$LDFLAGS
561 ac_env_CPPFLAGS_set=${CPPFLAGS+set}
562 ac_env_CPPFLAGS_value=$CPPFLAGS
563 ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set}
564 ac_cv_env_CPPFLAGS_value=$CPPFLAGS
565 ac_env_CPP_set=${CPP+set}
566 ac_env_CPP_value=$CPP
567 ac_cv_env_CPP_set=${CPP+set}
568 ac_cv_env_CPP_value=$CPP
569
570 #
571 # Report the --help message.
572 #
573 if test "$ac_init_help" = "long"; then
574   # Omit some internal or obsolete options to make the list less imposing.
575   # This message is too long to be a string in the A/UX 3.1 sh.
576   cat <<EOF
577 \`configure' configures this package to adapt to many kinds of systems.
578
579 Usage: $0 [OPTION]... [VAR=VALUE]...
580
581 To assign environment variables (e.g., CC, CFLAGS...), specify them as
582 VAR=VALUE.  See below for descriptions of some of the useful variables.
583
584 Defaults for the options are specified in brackets.
585
586 Configuration:
587   -h, --help              display this help and exit
588       --help=short        display options specific to this package
589       --help=recursive    display the short help of all the included packages
590   -V, --version           display version information and exit
591   -q, --quiet, --silent   do not print \`checking...' messages
592       --cache-file=FILE   cache test results in FILE [disabled]
593   -C, --config-cache      alias for \`--cache-file=config.cache'
594   -n, --no-create         do not create output files
595       --srcdir=DIR        find the sources in DIR [configure dir or \`..']
596
597 EOF
598
599   cat <<EOF
600 Installation directories:
601   --prefix=PREFIX         install architecture-independent files in PREFIX
602                           [$ac_default_prefix]
603   --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
604                           [PREFIX]
605
606 By default, \`make install' will install all the files in
607 \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc.  You can specify
608 an installation prefix other than \`$ac_default_prefix' using \`--prefix',
609 for instance \`--prefix=\$HOME'.
610
611 For better control, use the options below.
612
613 Fine tuning of the installation directories:
614   --bindir=DIR            user executables [EPREFIX/bin]
615   --sbindir=DIR           system admin executables [EPREFIX/sbin]
616   --libexecdir=DIR        program executables [EPREFIX/libexec]
617   --datarootdir=DIR       read-only architecture-independent data [PREFIX/share]
618   --datadir=DIR           read-only architecture-independent data [DATAROOTDIR]
619   --sysconfdir=DIR        read-only single-machine data [PREFIX/etc]
620   --sharedstatedir=DIR    modifiable architecture-independent data [PREFIX/com]
621   --localstatedir=DIR     modifiable single-machine data [PREFIX/var]
622   --libdir=DIR            object code libraries [EPREFIX/lib]
623   --includedir=DIR        C header files [PREFIX/include]
624   --oldincludedir=DIR     C header files for non-gcc [/usr/include]
625   --infodir=DIR           info documentation [DATAROOTDIR/info]
626   --mandir=DIR            man documentation [DATAROOTDIR/man]
627 EOF
628
629   cat <<\EOF
630
631 Program names:
632   --program-prefix=PREFIX            prepend PREFIX to installed program names
633   --program-suffix=SUFFIX            append SUFFIX to installed program names
634   --program-transform-name=PROGRAM   run sed PROGRAM on installed program names
635
636 System types:
637   --build=BUILD           configure for building on BUILD [guessed]
638   --host=HOST       build programs to run on HOST [BUILD]
639   --target=TARGET   configure for building compilers for TARGET [HOST]
640 EOF
641 fi
642
643 if test -n "$ac_init_help"; then
644
645   cat <<\EOF
646
647 Optional Packages:
648   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
649   --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
650
651 Optional Features:
652   --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
653   --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
654
655   --with-system-type=XXX  test: override derived host system-type
656   --with-pkg-config{=path} enable/disable use of pkg-config
657   --with-pkg-config-libdir=XXX use given directory for installing pc-files
658   --without-tests         suppress build with test-programs
659   --enable-mixed-case     tic should assume mixed-case filenames
660   --with-install-prefix   prefixes actual install-location ($DESTDIR)
661 Build-Tools Needed to Compile Temporary Applications for Cross-compiling:
662   --with-build-cc=XXX     the build C compiler ($BUILD_CC)
663   --with-build-cpp=XXX    the build C preprocessor ($BUILD_CPP)
664   --with-build-cflags=XXX the build C compiler-flags ($BUILD_CFLAGS)
665   --with-build-cppflags=XXX the build C preprocessor-flags ($BUILD_CPPFLAGS)
666   --with-build-ldflags=XXX the build linker-flags ($BUILD_LDFLAGS)
667   --with-build-libs=XXX   the build libraries (${BUILD_LIBS})
668 Options to Specify the Libraries Built/Used:
669   --with-shared           generate shared C-objects (needed for --with-ada-sharedlib)
670   --with-curses-dir=DIR   directory in which (n)curses is installed
671   --enable-widec          compile with wide-char/UTF-8 code
672   --with-lib-prefix       override library-prefix
673   --with-shlib-version=X  Specify rel or abi version for shared libs
674   --enable-rpath-link     link sample programs with rpath option
675 Fine-Tuning Your Configuration:
676   --enable-broken_linker  compile with broken-linker support code
677   --disable-largefile     omit support for large files
678   --with-rcs-ids          compile-in RCS identifiers
679 Extensions:
680   --disable-ext-funcs     disable function-extensions
681   --enable-const          compile with extra/non-standard const
682 Development Code:
683   --without-develop       disable development options
684 Experimental Code:
685   --with-pthread          use POSIX thread library
686   --enable-weak-symbols   enable weak-symbols for pthreads
687   --enable-reentrant      compile with experimental reentrant code
688   --with-wrap-prefix=XXX  override prefix used for public variables
689 Testing/development Options:
690   --disable-echo          do not display "compiling" commands
691   --enable-warnings       build: turn on GCC compiler warnings
692   --enable-assertions     test: turn on generation of assertion code
693   --enable-expanded       test: generate functions for certain macros
694   --disable-macros        test: use functions rather than macros
695   --with-trace            test: add trace() function to all models of ncurses
696   --disable-gnat-projects test: disable GNAT projects even if usable
697 Ada95 Binding Options:
698   --with-ada-compiler=CMD specify Ada95 compiler command (default gnatmake)
699   --with-ada-include=DIR  Ada includes are in DIR (default: PREFIX/share/ada/adainclude)
700   --with-ada-objects=DIR  Ada objects are in DIR (default: PREFIX/lib/ada/adalib)
701   --with-ada-sharedlib=soname build shared-library (requires GNAT projects)
702
703 Some influential environment variables:
704   CC          C compiler command
705   CFLAGS      C compiler flags
706   LDFLAGS     linker flags, e.g. -L<lib dir> if you have libraries in a
707               nonstandard directory <lib dir>
708   CPPFLAGS    C/C++ preprocessor flags, e.g. -I<include dir> if you have
709               headers in a nonstandard directory <include dir>
710   CPP         C preprocessor
711
712 Use these variables to override the choices made by `configure' or to help
713 it to find libraries and programs with nonstandard names/locations.
714
715 EOF
716 fi
717
718 if test "$ac_init_help" = "recursive"; then
719   # If there are subdirs, report their specific --help.
720   ac_popdir=`pwd`
721   for ac_subdir in : $ac_subdirs_all; do test "x$ac_subdir" = x: && continue
722     cd $ac_subdir
723     # A "../" for each directory in /$ac_subdir.
724     ac_dots=`echo $ac_subdir |
725              sed 's,^\./,,;s,[^/]$,&/,;s,[^/]*/,../,g'`
726
727     case $srcdir in
728     .) # No --srcdir option.  We are building in place.
729       ac_sub_srcdir=$srcdir ;;
730     [\\/]* | ?:[\\/]* ) # Absolute path.
731       ac_sub_srcdir=$srcdir/$ac_subdir ;;
732     *) # Relative path.
733       ac_sub_srcdir=$ac_dots$srcdir/$ac_subdir ;;
734     esac
735
736     # Check for guested configure; otherwise get Cygnus style configure.
737     if test -f $ac_sub_srcdir/configure.gnu; then
738       echo
739       $SHELL $ac_sub_srcdir/configure.gnu  --help=recursive
740     elif test -f $ac_sub_srcdir/configure; then
741       echo
742       $SHELL $ac_sub_srcdir/configure  --help=recursive
743     elif test -f $ac_sub_srcdir/configure.ac ||
744            test -f $ac_sub_srcdir/configure.in; then
745       echo
746       $ac_configure --help
747     else
748       echo "$as_me: WARNING: no configuration information is in $ac_subdir" >&2
749     fi
750     cd $ac_popdir
751   done
752 fi
753
754 test -n "$ac_init_help" && exit 0
755 if $ac_init_version; then
756   cat <<\EOF
757
758 Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
759 Free Software Foundation, Inc.
760 This configure script is free software; the Free Software Foundation
761 gives unlimited permission to copy, distribute and modify it.
762 EOF
763   exit 0
764 fi
765 exec 5>config.log
766 cat >&5 <<EOF
767 This file contains any messages produced by compilers while
768 running configure, to aid debugging if configure makes a mistake.
769
770 It was created by $as_me, which was
771 generated by GNU Autoconf 2.52.20141204.  Invocation command line was
772
773   $ $0 $@
774
775 EOF
776 {
777 cat <<_ASUNAME
778 ## ---------- ##
779 ## Platform.  ##
780 ## ---------- ##
781
782 hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
783 uname -m = `(uname -m) 2>/dev/null || echo unknown`
784 uname -r = `(uname -r) 2>/dev/null || echo unknown`
785 uname -s = `(uname -s) 2>/dev/null || echo unknown`
786 uname -v = `(uname -v) 2>/dev/null || echo unknown`
787
788 /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
789 /bin/uname -X     = `(/bin/uname -X) 2>/dev/null     || echo unknown`
790
791 /bin/arch              = `(/bin/arch) 2>/dev/null              || echo unknown`
792 /usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null       || echo unknown`
793 /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
794 hostinfo               = `(hostinfo) 2>/dev/null               || echo unknown`
795 /bin/machine           = `(/bin/machine) 2>/dev/null           || echo unknown`
796 /usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null       || echo unknown`
797 /bin/universe          = `(/bin/universe) 2>/dev/null          || echo unknown`
798
799 PATH = $PATH
800
801 _ASUNAME
802 } >&5
803
804 cat >&5 <<EOF
805 ## ------------ ##
806 ## Core tests.  ##
807 ## ------------ ##
808
809 EOF
810
811 # Keep a trace of the command line.
812 # Strip out --no-create and --no-recursion so they do not pile up.
813 # Also quote any args containing shell meta-characters.
814 ac_configure_args=
815 ac_sep=
816 for ac_arg
817 do
818   case $ac_arg in
819   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
820   | --no-cr | --no-c) ;;
821   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
822   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
823   *" "*|*"      "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
824     ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"`
825     ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'"
826     ac_sep=" " ;;
827   *) ac_configure_args="$ac_configure_args$ac_sep$ac_arg"
828      ac_sep=" " ;;
829   esac
830   # Get rid of the leading space.
831 done
832
833 # When interrupted or exit'd, cleanup temporary files, and complete
834 # config.log.  We remove comments because anyway the quotes in there
835 # would cause problems or look ugly.
836 trap 'exit_status=$?
837   # Save into config.log some information that might help in debugging.
838   echo >&5
839   echo "## ----------------- ##" >&5
840   echo "## Cache variables.  ##" >&5
841   echo "## ----------------- ##" >&5
842   echo >&5
843   # The following way of writing the cache mishandles newlines in values,
844 {
845   (set) 2>&1 |
846     case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in
847     *ac_space=\ *)
848       sed -n \
849         "s/'"'"'/'"'"'\\\\'"'"''"'"'/g;
850           s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p"
851       ;;
852     *)
853       sed -n \
854         "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
855       ;;
856     esac;
857 } >&5
858   sed "/^$/d" confdefs.h >conftest.log
859   if test -s conftest.log; then
860     echo >&5
861     echo "## ------------ ##" >&5
862     echo "## confdefs.h.  ##" >&5
863     echo "## ------------ ##" >&5
864     echo >&5
865     cat conftest.log >&5
866   fi
867   (echo; echo) >&5
868   test "$ac_signal" != 0 &&
869     echo "$as_me: caught signal $ac_signal" >&5
870   echo "$as_me: exit $exit_status" >&5
871   rm -rf conftest* confdefs* core core.* *.core conf$$* $ac_clean_files &&
872     exit $exit_status
873      ' 0
874 for ac_signal in 1 2 13 15; do
875   trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal
876 done
877 ac_signal=0
878
879 # confdefs.h avoids OS command line length limits that DEFS can exceed.
880 rm -rf conftest* confdefs.h
881 # AIX cpp loses on an empty file, so make sure it contains at least a newline.
882 echo >confdefs.h
883
884 # Let the site file select an alternate cache file if it wants to.
885 # Prefer explicitly selected file to automatically selected ones.
886 if test -z "$CONFIG_SITE"; then
887   if test "x$prefix" != xNONE; then
888     CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
889   else
890     CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
891   fi
892 fi
893 for ac_site_file in $CONFIG_SITE; do
894   if test -r "$ac_site_file"; then
895     { echo "$as_me:895: loading site script $ac_site_file" >&5
896 echo "$as_me: loading site script $ac_site_file" >&6;}
897     cat "$ac_site_file" >&5
898     . "$ac_site_file"
899   fi
900 done
901
902 if test -r "$cache_file"; then
903   # Some versions of bash will fail to source /dev/null (special
904   # files actually), so we avoid doing that.
905   if test -f "$cache_file"; then
906     { echo "$as_me:906: loading cache $cache_file" >&5
907 echo "$as_me: loading cache $cache_file" >&6;}
908     case $cache_file in
909       [\\/]* | ?:[\\/]* ) . $cache_file;;
910       *)                      . ./$cache_file;;
911     esac
912   fi
913 else
914   { echo "$as_me:914: creating cache $cache_file" >&5
915 echo "$as_me: creating cache $cache_file" >&6;}
916   >$cache_file
917 fi
918
919 # Check that the precious variables saved in the cache have kept the same
920 # value.
921 ac_cache_corrupted=false
922 for ac_var in `(set) 2>&1 |
923                sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do
924   eval ac_old_set=\$ac_cv_env_${ac_var}_set
925   eval ac_new_set=\$ac_env_${ac_var}_set
926   eval ac_old_val="\$ac_cv_env_${ac_var}_value"
927   eval ac_new_val="\$ac_env_${ac_var}_value"
928   case $ac_old_set,$ac_new_set in
929     set,)
930       { echo "$as_me:930: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
931 echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
932       ac_cache_corrupted=: ;;
933     ,set)
934       { echo "$as_me:934: error: \`$ac_var' was not set in the previous run" >&5
935 echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
936       ac_cache_corrupted=: ;;
937     ,);;
938     *)
939       if test "x$ac_old_val" != "x$ac_new_val"; then
940         { echo "$as_me:940: error: \`$ac_var' has changed since the previous run:" >&5
941 echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
942         { echo "$as_me:942:   former value:  $ac_old_val" >&5
943 echo "$as_me:   former value:  $ac_old_val" >&2;}
944         { echo "$as_me:944:   current value: $ac_new_val" >&5
945 echo "$as_me:   current value: $ac_new_val" >&2;}
946         ac_cache_corrupted=:
947       fi;;
948   esac
949   # Pass precious variables to config.status.  It doesn't matter if
950   # we pass some twice (in addition to the command line arguments).
951   if test "$ac_new_set" = set; then
952     case $ac_new_val in
953     *" "*|*"    "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
954       ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"`
955       ac_configure_args="$ac_configure_args '$ac_arg'"
956       ;;
957     *) ac_configure_args="$ac_configure_args $ac_var=$ac_new_val"
958        ;;
959     esac
960   fi
961 done
962 if $ac_cache_corrupted; then
963   { echo "$as_me:963: error: changes in the environment can compromise the build" >&5
964 echo "$as_me: error: changes in the environment can compromise the build" >&2;}
965   { { echo "$as_me:965: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5
966 echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;}
967    { (exit 1); exit 1; }; }
968 fi
969
970 ac_ext=c
971 ac_cpp='$CPP $CPPFLAGS'
972 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
973 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
974 ac_compiler_gnu=$ac_cv_c_compiler_gnu
975 ac_main_return=return
976
977 case `echo "testing\c" 2>/dev/null; echo 1,2,3`,`echo -n testing 2>/dev/null; echo 1,2,3` in
978   *c*,-n*) ECHO_N= ECHO_C=      # newlines do not sed ;-) only broken shells would use this case anyway
979                    ECHO_T='     ' ;;
980   *c*,*  ) ECHO_N=-n ECHO_C= ECHO_T= ;;
981   *)      ECHO_N= ECHO_C='\c' ECHO_T= ;;
982 esac
983 echo "#! $SHELL" >conftest.sh
984 echo  "exit 0"   >>conftest.sh
985 chmod +x conftest.sh
986 if { (echo "$as_me:986: PATH=\".;.\"; conftest.sh") >&5
987   (PATH=".;."; conftest.sh) 2>&5
988   ac_status=$?
989   echo "$as_me:989: \$? = $ac_status" >&5
990   (exit $ac_status); }; then
991   ac_path_separator=';'
992 else
993   ac_path_separator=:
994 fi
995 PATH_SEPARATOR="$ac_path_separator"
996 rm -f conftest.sh
997
998 ac_config_headers="$ac_config_headers include/ncurses_cfg.h:include/ncurses_cfg.hin"
999
1000 top_builddir=`pwd`
1001
1002 ac_aux_dir=
1003 for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
1004   if test -f $ac_dir/install-sh; then
1005     ac_aux_dir=$ac_dir
1006     ac_install_sh="$ac_aux_dir/install-sh -c"
1007     break
1008   elif test -f $ac_dir/install.sh; then
1009     ac_aux_dir=$ac_dir
1010     ac_install_sh="$ac_aux_dir/install.sh -c"
1011     break
1012   elif test -f $ac_dir/shtool; then
1013     ac_aux_dir=$ac_dir
1014     ac_install_sh="$ac_aux_dir/shtool install -c"
1015     break
1016   fi
1017 done
1018 if test -z "$ac_aux_dir"; then
1019   { { echo "$as_me:1019: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5
1020 echo "$as_me: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&2;}
1021    { (exit 1); exit 1; }; }
1022 fi
1023 ac_config_guess="$SHELL $ac_aux_dir/config.guess"
1024 ac_config_sub="$SHELL $ac_aux_dir/config.sub"
1025 ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure.
1026
1027 # Make sure we can run config.sub.
1028 $ac_config_sub sun4 >/dev/null 2>&1 ||
1029   { { echo "$as_me:1029: error: cannot run $ac_config_sub" >&5
1030 echo "$as_me: error: cannot run $ac_config_sub" >&2;}
1031    { (exit 1); exit 1; }; }
1032
1033 echo "$as_me:1033: checking build system type" >&5
1034 echo $ECHO_N "checking build system type... $ECHO_C" >&6
1035 if test "${ac_cv_build+set}" = set; then
1036   echo $ECHO_N "(cached) $ECHO_C" >&6
1037 else
1038   ac_cv_build_alias=$build_alias
1039 test -z "$ac_cv_build_alias" &&
1040   ac_cv_build_alias=`$ac_config_guess`
1041 test -z "$ac_cv_build_alias" &&
1042   { { echo "$as_me:1042: error: cannot guess build type; you must specify one" >&5
1043 echo "$as_me: error: cannot guess build type; you must specify one" >&2;}
1044    { (exit 1); exit 1; }; }
1045 ac_cv_build=`$ac_config_sub $ac_cv_build_alias` ||
1046   { { echo "$as_me:1046: error: $ac_config_sub $ac_cv_build_alias failed." >&5
1047 echo "$as_me: error: $ac_config_sub $ac_cv_build_alias failed." >&2;}
1048    { (exit 1); exit 1; }; }
1049
1050 fi
1051 echo "$as_me:1051: result: $ac_cv_build" >&5
1052 echo "${ECHO_T}$ac_cv_build" >&6
1053 build=$ac_cv_build
1054 build_cpu=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
1055 build_vendor=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
1056 build_os=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
1057
1058 echo "$as_me:1058: checking host system type" >&5
1059 echo $ECHO_N "checking host system type... $ECHO_C" >&6
1060 if test "${ac_cv_host+set}" = set; then
1061   echo $ECHO_N "(cached) $ECHO_C" >&6
1062 else
1063   ac_cv_host_alias=$host_alias
1064 test -z "$ac_cv_host_alias" &&
1065   ac_cv_host_alias=$ac_cv_build_alias
1066 ac_cv_host=`$ac_config_sub $ac_cv_host_alias` ||
1067   { { echo "$as_me:1067: error: $ac_config_sub $ac_cv_host_alias failed" >&5
1068 echo "$as_me: error: $ac_config_sub $ac_cv_host_alias failed" >&2;}
1069    { (exit 1); exit 1; }; }
1070
1071 fi
1072 echo "$as_me:1072: result: $ac_cv_host" >&5
1073 echo "${ECHO_T}$ac_cv_host" >&6
1074 host=$ac_cv_host
1075 host_cpu=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
1076 host_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
1077 host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
1078
1079 if test -f $srcdir/config.guess || test -f $ac_aux_dir/config.guess ; then
1080         echo "$as_me:1080: checking target system type" >&5
1081 echo $ECHO_N "checking target system type... $ECHO_C" >&6
1082 if test "${ac_cv_target+set}" = set; then
1083   echo $ECHO_N "(cached) $ECHO_C" >&6
1084 else
1085   ac_cv_target_alias=$target_alias
1086 test "x$ac_cv_target_alias" = "x" &&
1087   ac_cv_target_alias=$ac_cv_host_alias
1088 ac_cv_target=`$ac_config_sub $ac_cv_target_alias` ||
1089   { { echo "$as_me:1089: error: $ac_config_sub $ac_cv_target_alias failed" >&5
1090 echo "$as_me: error: $ac_config_sub $ac_cv_target_alias failed" >&2;}
1091    { (exit 1); exit 1; }; }
1092
1093 fi
1094 echo "$as_me:1094: result: $ac_cv_target" >&5
1095 echo "${ECHO_T}$ac_cv_target" >&6
1096 target=$ac_cv_target
1097 target_cpu=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
1098 target_vendor=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
1099 target_os=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
1100
1101 # The aliases save the names the user supplied, while $host etc.
1102 # will get canonicalized.
1103 test -n "$target_alias" &&
1104   test "$program_prefix$program_suffix$program_transform_name" = \
1105     NONENONEs,x,x, &&
1106   program_prefix=${target_alias}-
1107         system_name="$host_os"
1108 else
1109         system_name="`(uname -s -r) 2>/dev/null`"
1110         if test -z "$system_name" ; then
1111                 system_name="`(hostname) 2>/dev/null`"
1112         fi
1113 fi
1114 test -n "$system_name" &&
1115 cat >>confdefs.h <<EOF
1116 #define SYSTEM_NAME "$system_name"
1117 EOF
1118
1119 if test "${cf_cv_system_name+set}" = set; then
1120   echo $ECHO_N "(cached) $ECHO_C" >&6
1121 else
1122   cf_cv_system_name="$system_name"
1123 fi
1124
1125 test -z "$system_name" && system_name="$cf_cv_system_name"
1126 test -n "$cf_cv_system_name" && echo "$as_me:1126: result: Configuring for $cf_cv_system_name" >&5
1127 echo "${ECHO_T}Configuring for $cf_cv_system_name" >&6
1128
1129 if test ".$system_name" != ".$cf_cv_system_name" ; then
1130         echo "$as_me:1130: result: Cached system name ($system_name) does not agree with actual ($cf_cv_system_name)" >&5
1131 echo "${ECHO_T}Cached system name ($system_name) does not agree with actual ($cf_cv_system_name)" >&6
1132         { { echo "$as_me:1132: error: \"Please remove config.cache and try again.\"" >&5
1133 echo "$as_me: error: \"Please remove config.cache and try again.\"" >&2;}
1134    { (exit 1); exit 1; }; }
1135 fi
1136
1137 # Check whether --with-system-type or --without-system-type was given.
1138 if test "${with_system_type+set}" = set; then
1139   withval="$with_system_type"
1140   { echo "$as_me:1140: WARNING: overriding system type to $withval" >&5
1141 echo "$as_me: WARNING: overriding system type to $withval" >&2;}
1142         cf_cv_system_name=$withval
1143         host_os=$withval
1144
1145 fi;
1146
1147 ###     Save the given $CFLAGS to allow user-override.
1148 cf_user_CFLAGS="$CFLAGS"
1149
1150 ###     Default install-location
1151
1152 echo "$as_me:1152: checking for prefix" >&5
1153 echo $ECHO_N "checking for prefix... $ECHO_C" >&6
1154 if test "x$prefix" = "xNONE" ; then
1155         case "$cf_cv_system_name" in
1156                 # non-vendor systems don't have a conflict
1157         (openbsd*|freebsd*|mirbsd*|linux*|cygwin*|msys*|k*bsd*-gnu|mingw*)
1158                 prefix=/usr
1159                 ;;
1160         (*)     prefix=$ac_default_prefix
1161                 ;;
1162         esac
1163 fi
1164 echo "$as_me:1164: result: $prefix" >&5
1165 echo "${ECHO_T}$prefix" >&6
1166
1167 if test "x$prefix" = "xNONE" ; then
1168 echo "$as_me:1168: checking for default include-directory" >&5
1169 echo $ECHO_N "checking for default include-directory... $ECHO_C" >&6
1170 test -n "$verbose" && echo 1>&6
1171 for cf_symbol in \
1172         $includedir \
1173         $includedir/ncurses \
1174         $prefix/include \
1175         $prefix/include/ncurses \
1176         /usr/local/include \
1177         /usr/local/include/ncurses \
1178         /usr/include \
1179         /usr/include/ncurses
1180 do
1181         cf_dir=`eval echo $cf_symbol`
1182         if test -f $cf_dir/curses.h ; then
1183         if ( fgrep NCURSES_VERSION $cf_dir/curses.h 2>&1 >/dev/null ) ; then
1184                 includedir="$cf_symbol"
1185                 test -n "$verbose"  && echo $ac_n "     found " 1>&6
1186                 break
1187         fi
1188         fi
1189         test -n "$verbose"  && echo "   tested $cf_dir" 1>&6
1190 done
1191 echo "$as_me:1191: result: $includedir" >&5
1192 echo "${ECHO_T}$includedir" >&6
1193 fi
1194
1195 ###     Checks for programs.
1196
1197 ac_ext=c
1198 ac_cpp='$CPP $CPPFLAGS'
1199 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
1200 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
1201 ac_compiler_gnu=$ac_cv_c_compiler_gnu
1202 ac_main_return=return
1203 if test -n "$ac_tool_prefix"; then
1204   for ac_prog in gnatgcc gcc cc
1205   do
1206     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
1207 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
1208 echo "$as_me:1208: checking for $ac_word" >&5
1209 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1210 if test "${ac_cv_prog_CC+set}" = set; then
1211   echo $ECHO_N "(cached) $ECHO_C" >&6
1212 else
1213   if test -n "$CC"; then
1214   ac_cv_prog_CC="$CC" # Let the user override the test.
1215 else
1216   ac_save_IFS=$IFS; IFS=$ac_path_separator
1217 ac_dummy="$PATH"
1218 for ac_dir in $ac_dummy; do
1219   IFS=$ac_save_IFS
1220   test -z "$ac_dir" && ac_dir=.
1221   $as_executable_p "$ac_dir/$ac_word" || continue
1222 ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
1223 echo "$as_me:1223: found $ac_dir/$ac_word" >&5
1224 break
1225 done
1226
1227 fi
1228 fi
1229 CC=$ac_cv_prog_CC
1230 if test -n "$CC"; then
1231   echo "$as_me:1231: result: $CC" >&5
1232 echo "${ECHO_T}$CC" >&6
1233 else
1234   echo "$as_me:1234: result: no" >&5
1235 echo "${ECHO_T}no" >&6
1236 fi
1237
1238     test -n "$CC" && break
1239   done
1240 fi
1241 if test -z "$CC"; then
1242   ac_ct_CC=$CC
1243   for ac_prog in gnatgcc gcc cc
1244 do
1245   # Extract the first word of "$ac_prog", so it can be a program name with args.
1246 set dummy $ac_prog; ac_word=$2
1247 echo "$as_me:1247: checking for $ac_word" >&5
1248 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1249 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
1250   echo $ECHO_N "(cached) $ECHO_C" >&6
1251 else
1252   if test -n "$ac_ct_CC"; then
1253   ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
1254 else
1255   ac_save_IFS=$IFS; IFS=$ac_path_separator
1256 ac_dummy="$PATH"
1257 for ac_dir in $ac_dummy; do
1258   IFS=$ac_save_IFS
1259   test -z "$ac_dir" && ac_dir=.
1260   $as_executable_p "$ac_dir/$ac_word" || continue
1261 ac_cv_prog_ac_ct_CC="$ac_prog"
1262 echo "$as_me:1262: found $ac_dir/$ac_word" >&5
1263 break
1264 done
1265
1266 fi
1267 fi
1268 ac_ct_CC=$ac_cv_prog_ac_ct_CC
1269 if test -n "$ac_ct_CC"; then
1270   echo "$as_me:1270: result: $ac_ct_CC" >&5
1271 echo "${ECHO_T}$ac_ct_CC" >&6
1272 else
1273   echo "$as_me:1273: result: no" >&5
1274 echo "${ECHO_T}no" >&6
1275 fi
1276
1277   test -n "$ac_ct_CC" && break
1278 done
1279
1280   CC=$ac_ct_CC
1281 fi
1282
1283 test -z "$CC" && { { echo "$as_me:1283: error: no acceptable cc found in \$PATH" >&5
1284 echo "$as_me: error: no acceptable cc found in \$PATH" >&2;}
1285    { (exit 1); exit 1; }; }
1286
1287 # Provide some information about the compiler.
1288 echo "$as_me:1288:" \
1289      "checking for C compiler version" >&5
1290 ac_compiler=`set X $ac_compile; echo $2`
1291 { (eval echo "$as_me:1291: \"$ac_compiler --version </dev/null >&5\"") >&5
1292   (eval $ac_compiler --version </dev/null >&5) 2>&5
1293   ac_status=$?
1294   echo "$as_me:1294: \$? = $ac_status" >&5
1295   (exit $ac_status); }
1296 { (eval echo "$as_me:1296: \"$ac_compiler -v </dev/null >&5\"") >&5
1297   (eval $ac_compiler -v </dev/null >&5) 2>&5
1298   ac_status=$?
1299   echo "$as_me:1299: \$? = $ac_status" >&5
1300   (exit $ac_status); }
1301 { (eval echo "$as_me:1301: \"$ac_compiler -V </dev/null >&5\"") >&5
1302   (eval $ac_compiler -V </dev/null >&5) 2>&5
1303   ac_status=$?
1304   echo "$as_me:1304: \$? = $ac_status" >&5
1305   (exit $ac_status); }
1306
1307 cat >conftest.$ac_ext <<_ACEOF
1308 #line 1308 "configure"
1309 #include "confdefs.h"
1310
1311 int
1312 main ()
1313 {
1314
1315   ;
1316   return 0;
1317 }
1318 _ACEOF
1319 ac_clean_files_save=$ac_clean_files
1320 ac_clean_files="$ac_clean_files a.out a.exe"
1321 # Try to create an executable without -o first, disregard a.out.
1322 # It will help us diagnose broken compilers, and finding out an intuition
1323 # of exeext.
1324 echo "$as_me:1324: checking for C compiler default output" >&5
1325 echo $ECHO_N "checking for C compiler default output... $ECHO_C" >&6
1326 ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
1327 if { (eval echo "$as_me:1327: \"$ac_link_default\"") >&5
1328   (eval $ac_link_default) 2>&5
1329   ac_status=$?
1330   echo "$as_me:1330: \$? = $ac_status" >&5
1331   (exit $ac_status); }; then
1332   # Find the output, starting from the most likely.  This scheme is
1333 # not robust to junk in `.', hence go to wildcards (a.*) only as a last
1334 # resort.
1335 for ac_file in `ls a.exe conftest.exe 2>/dev/null;
1336                 ls a.out conftest 2>/dev/null;
1337                 ls a.* conftest.* 2>/dev/null`; do
1338   case $ac_file in
1339     *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;;
1340     a.out ) # We found the default executable, but exeext='' is most
1341             # certainly right.
1342             break;;
1343     *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
1344           # FIXME: I believe we export ac_cv_exeext for Libtool --akim.
1345           export ac_cv_exeext
1346           break;;
1347     * ) break;;
1348   esac
1349 done
1350 else
1351   echo "$as_me: failed program was:" >&5
1352 cat conftest.$ac_ext >&5
1353 { { echo "$as_me:1353: error: C compiler cannot create executables" >&5
1354 echo "$as_me: error: C compiler cannot create executables" >&2;}
1355    { (exit 77); exit 77; }; }
1356 fi
1357
1358 ac_exeext=$ac_cv_exeext
1359 echo "$as_me:1359: result: $ac_file" >&5
1360 echo "${ECHO_T}$ac_file" >&6
1361
1362 # Check the compiler produces executables we can run.  If not, either
1363 # the compiler is broken, or we cross compile.
1364 echo "$as_me:1364: checking whether the C compiler works" >&5
1365 echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6
1366 # FIXME: These cross compiler hacks should be removed for Autoconf 3.0
1367 # If not cross compiling, check that we can run a simple program.
1368 if test "$cross_compiling" != yes; then
1369   if { ac_try='./$ac_file'
1370   { (eval echo "$as_me:1370: \"$ac_try\"") >&5
1371   (eval $ac_try) 2>&5
1372   ac_status=$?
1373   echo "$as_me:1373: \$? = $ac_status" >&5
1374   (exit $ac_status); }; }; then
1375     cross_compiling=no
1376   else
1377     if test "$cross_compiling" = maybe; then
1378         cross_compiling=yes
1379     else
1380         { { echo "$as_me:1380: error: cannot run C compiled programs.
1381 If you meant to cross compile, use \`--host'." >&5
1382 echo "$as_me: error: cannot run C compiled programs.
1383 If you meant to cross compile, use \`--host'." >&2;}
1384    { (exit 1); exit 1; }; }
1385     fi
1386   fi
1387 fi
1388 echo "$as_me:1388: result: yes" >&5
1389 echo "${ECHO_T}yes" >&6
1390
1391 rm -f a.out a.exe conftest$ac_cv_exeext
1392 ac_clean_files=$ac_clean_files_save
1393 # Check the compiler produces executables we can run.  If not, either
1394 # the compiler is broken, or we cross compile.
1395 echo "$as_me:1395: checking whether we are cross compiling" >&5
1396 echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6
1397 echo "$as_me:1397: result: $cross_compiling" >&5
1398 echo "${ECHO_T}$cross_compiling" >&6
1399
1400 echo "$as_me:1400: checking for executable suffix" >&5
1401 echo $ECHO_N "checking for executable suffix... $ECHO_C" >&6
1402 if { (eval echo "$as_me:1402: \"$ac_link\"") >&5
1403   (eval $ac_link) 2>&5
1404   ac_status=$?
1405   echo "$as_me:1405: \$? = $ac_status" >&5
1406   (exit $ac_status); }; then
1407   # If both `conftest.exe' and `conftest' are `present' (well, observable)
1408 # catch `conftest.exe'.  For instance with Cygwin, `ls conftest' will
1409 # work properly (i.e., refer to `conftest.exe'), while it won't with
1410 # `rm'.
1411 for ac_file in `(ls conftest.exe; ls conftest; ls conftest.*) 2>/dev/null`; do
1412   case $ac_file in
1413     *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;;
1414     *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
1415           export ac_cv_exeext
1416           break;;
1417     * ) break;;
1418   esac
1419 done
1420 else
1421   { { echo "$as_me:1421: error: cannot compute EXEEXT: cannot compile and link" >&5
1422 echo "$as_me: error: cannot compute EXEEXT: cannot compile and link" >&2;}
1423    { (exit 1); exit 1; }; }
1424 fi
1425
1426 rm -f conftest$ac_cv_exeext
1427 echo "$as_me:1427: result: $ac_cv_exeext" >&5
1428 echo "${ECHO_T}$ac_cv_exeext" >&6
1429
1430 rm -f conftest.$ac_ext
1431 EXEEXT=$ac_cv_exeext
1432 ac_exeext=$EXEEXT
1433 echo "$as_me:1433: checking for object suffix" >&5
1434 echo $ECHO_N "checking for object suffix... $ECHO_C" >&6
1435 if test "${ac_cv_objext+set}" = set; then
1436   echo $ECHO_N "(cached) $ECHO_C" >&6
1437 else
1438   cat >conftest.$ac_ext <<_ACEOF
1439 #line 1439 "configure"
1440 #include "confdefs.h"
1441
1442 int
1443 main ()
1444 {
1445
1446   ;
1447   return 0;
1448 }
1449 _ACEOF
1450 rm -f conftest.o conftest.obj
1451 if { (eval echo "$as_me:1451: \"$ac_compile\"") >&5
1452   (eval $ac_compile) 2>&5
1453   ac_status=$?
1454   echo "$as_me:1454: \$? = $ac_status" >&5
1455   (exit $ac_status); }; then
1456   for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do
1457   case $ac_file in
1458     *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.map | *.inf ) ;;
1459     *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
1460        break;;
1461   esac
1462 done
1463 else
1464   echo "$as_me: failed program was:" >&5
1465 cat conftest.$ac_ext >&5
1466 { { echo "$as_me:1466: error: cannot compute OBJEXT: cannot compile" >&5
1467 echo "$as_me: error: cannot compute OBJEXT: cannot compile" >&2;}
1468    { (exit 1); exit 1; }; }
1469 fi
1470
1471 rm -f conftest.$ac_cv_objext conftest.$ac_ext
1472 fi
1473 echo "$as_me:1473: result: $ac_cv_objext" >&5
1474 echo "${ECHO_T}$ac_cv_objext" >&6
1475 OBJEXT=$ac_cv_objext
1476 ac_objext=$OBJEXT
1477 echo "$as_me:1477: checking whether we are using the GNU C compiler" >&5
1478 echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6
1479 if test "${ac_cv_c_compiler_gnu+set}" = set; then
1480   echo $ECHO_N "(cached) $ECHO_C" >&6
1481 else
1482   cat >conftest.$ac_ext <<_ACEOF
1483 #line 1483 "configure"
1484 #include "confdefs.h"
1485
1486 int
1487 main ()
1488 {
1489 #ifndef __GNUC__
1490        choke me
1491 #endif
1492
1493   ;
1494   return 0;
1495 }
1496 _ACEOF
1497 rm -f conftest.$ac_objext
1498 if { (eval echo "$as_me:1498: \"$ac_compile\"") >&5
1499   (eval $ac_compile) 2>&5
1500   ac_status=$?
1501   echo "$as_me:1501: \$? = $ac_status" >&5
1502   (exit $ac_status); } &&
1503          { ac_try='test -s conftest.$ac_objext'
1504   { (eval echo "$as_me:1504: \"$ac_try\"") >&5
1505   (eval $ac_try) 2>&5
1506   ac_status=$?
1507   echo "$as_me:1507: \$? = $ac_status" >&5
1508   (exit $ac_status); }; }; then
1509   ac_compiler_gnu=yes
1510 else
1511   echo "$as_me: failed program was:" >&5
1512 cat conftest.$ac_ext >&5
1513 ac_compiler_gnu=no
1514 fi
1515 rm -f conftest.$ac_objext conftest.$ac_ext
1516 ac_cv_c_compiler_gnu=$ac_compiler_gnu
1517
1518 fi
1519 echo "$as_me:1519: result: $ac_cv_c_compiler_gnu" >&5
1520 echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6
1521 GCC=`test $ac_compiler_gnu = yes && echo yes`
1522 ac_test_CFLAGS=${CFLAGS+set}
1523 ac_save_CFLAGS=$CFLAGS
1524 CFLAGS="-g"
1525 echo "$as_me:1525: checking whether $CC accepts -g" >&5
1526 echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6
1527 if test "${ac_cv_prog_cc_g+set}" = set; then
1528   echo $ECHO_N "(cached) $ECHO_C" >&6
1529 else
1530   cat >conftest.$ac_ext <<_ACEOF
1531 #line 1531 "configure"
1532 #include "confdefs.h"
1533
1534 int
1535 main ()
1536 {
1537
1538   ;
1539   return 0;
1540 }
1541 _ACEOF
1542 rm -f conftest.$ac_objext
1543 if { (eval echo "$as_me:1543: \"$ac_compile\"") >&5
1544   (eval $ac_compile) 2>&5
1545   ac_status=$?
1546   echo "$as_me:1546: \$? = $ac_status" >&5
1547   (exit $ac_status); } &&
1548          { ac_try='test -s conftest.$ac_objext'
1549   { (eval echo "$as_me:1549: \"$ac_try\"") >&5
1550   (eval $ac_try) 2>&5
1551   ac_status=$?
1552   echo "$as_me:1552: \$? = $ac_status" >&5
1553   (exit $ac_status); }; }; then
1554   ac_cv_prog_cc_g=yes
1555 else
1556   echo "$as_me: failed program was:" >&5
1557 cat conftest.$ac_ext >&5
1558 ac_cv_prog_cc_g=no
1559 fi
1560 rm -f conftest.$ac_objext conftest.$ac_ext
1561 fi
1562 echo "$as_me:1562: result: $ac_cv_prog_cc_g" >&5
1563 echo "${ECHO_T}$ac_cv_prog_cc_g" >&6
1564 if test "$ac_test_CFLAGS" = set; then
1565   CFLAGS=$ac_save_CFLAGS
1566 elif test $ac_cv_prog_cc_g = yes; then
1567   if test "$GCC" = yes; then
1568     CFLAGS="-g -O2"
1569   else
1570     CFLAGS="-g"
1571   fi
1572 else
1573   if test "$GCC" = yes; then
1574     CFLAGS="-O2"
1575   else
1576     CFLAGS=
1577   fi
1578 fi
1579 # Some people use a C++ compiler to compile C.  Since we use `exit',
1580 # in C++ we need to declare it.  In case someone uses the same compiler
1581 # for both compiling C and C++ we need to have the C++ compiler decide
1582 # the declaration of exit, since it's the most demanding environment.
1583 cat >conftest.$ac_ext <<_ACEOF
1584 #ifndef __cplusplus
1585   choke me
1586 #endif
1587 _ACEOF
1588 rm -f conftest.$ac_objext
1589 if { (eval echo "$as_me:1589: \"$ac_compile\"") >&5
1590   (eval $ac_compile) 2>&5
1591   ac_status=$?
1592   echo "$as_me:1592: \$? = $ac_status" >&5
1593   (exit $ac_status); } &&
1594          { ac_try='test -s conftest.$ac_objext'
1595   { (eval echo "$as_me:1595: \"$ac_try\"") >&5
1596   (eval $ac_try) 2>&5
1597   ac_status=$?
1598   echo "$as_me:1598: \$? = $ac_status" >&5
1599   (exit $ac_status); }; }; then
1600   for ac_declaration in \
1601    ''\
1602    '#include <stdlib.h>' \
1603    'extern "C" void std::exit (int) throw (); using std::exit;' \
1604    'extern "C" void std::exit (int); using std::exit;' \
1605    'extern "C" void exit (int) throw ();' \
1606    'extern "C" void exit (int);' \
1607    'void exit (int);'
1608 do
1609   cat >conftest.$ac_ext <<_ACEOF
1610 #line 1610 "configure"
1611 #include "confdefs.h"
1612 #include <stdlib.h>
1613 $ac_declaration
1614 int
1615 main ()
1616 {
1617 exit (42);
1618   ;
1619   return 0;
1620 }
1621 _ACEOF
1622 rm -f conftest.$ac_objext
1623 if { (eval echo "$as_me:1623: \"$ac_compile\"") >&5
1624   (eval $ac_compile) 2>&5
1625   ac_status=$?
1626   echo "$as_me:1626: \$? = $ac_status" >&5
1627   (exit $ac_status); } &&
1628          { ac_try='test -s conftest.$ac_objext'
1629   { (eval echo "$as_me:1629: \"$ac_try\"") >&5
1630   (eval $ac_try) 2>&5
1631   ac_status=$?
1632   echo "$as_me:1632: \$? = $ac_status" >&5
1633   (exit $ac_status); }; }; then
1634   :
1635 else
1636   echo "$as_me: failed program was:" >&5
1637 cat conftest.$ac_ext >&5
1638 continue
1639 fi
1640 rm -f conftest.$ac_objext conftest.$ac_ext
1641   cat >conftest.$ac_ext <<_ACEOF
1642 #line 1642 "configure"
1643 #include "confdefs.h"
1644 $ac_declaration
1645 int
1646 main ()
1647 {
1648 exit (42);
1649   ;
1650   return 0;
1651 }
1652 _ACEOF
1653 rm -f conftest.$ac_objext
1654 if { (eval echo "$as_me:1654: \"$ac_compile\"") >&5
1655   (eval $ac_compile) 2>&5
1656   ac_status=$?
1657   echo "$as_me:1657: \$? = $ac_status" >&5
1658   (exit $ac_status); } &&
1659          { ac_try='test -s conftest.$ac_objext'
1660   { (eval echo "$as_me:1660: \"$ac_try\"") >&5
1661   (eval $ac_try) 2>&5
1662   ac_status=$?
1663   echo "$as_me:1663: \$? = $ac_status" >&5
1664   (exit $ac_status); }; }; then
1665   break
1666 else
1667   echo "$as_me: failed program was:" >&5
1668 cat conftest.$ac_ext >&5
1669 fi
1670 rm -f conftest.$ac_objext conftest.$ac_ext
1671 done
1672 rm -rf conftest*
1673 if test -n "$ac_declaration"; then
1674   echo '#ifdef __cplusplus' >>confdefs.h
1675   echo $ac_declaration      >>confdefs.h
1676   echo '#endif'             >>confdefs.h
1677 fi
1678
1679 else
1680   echo "$as_me: failed program was:" >&5
1681 cat conftest.$ac_ext >&5
1682 fi
1683 rm -f conftest.$ac_objext conftest.$ac_ext
1684 ac_ext=c
1685 ac_cpp='$CPP $CPPFLAGS'
1686 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
1687 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
1688 ac_compiler_gnu=$ac_cv_c_compiler_gnu
1689 ac_main_return=return
1690
1691 GCC_VERSION=none
1692 if test "$GCC" = yes ; then
1693         echo "$as_me:1693: checking version of $CC" >&5
1694 echo $ECHO_N "checking version of $CC... $ECHO_C" >&6
1695         GCC_VERSION="`${CC} --version 2>/dev/null | sed -e '2,$d' -e 's/^.*(GCC[^)]*) //' -e 's/^.*(Debian[^)]*) //' -e 's/^[^0-9.]*//' -e 's/[^0-9.].*//'`"
1696         test -z "$GCC_VERSION" && GCC_VERSION=unknown
1697         echo "$as_me:1697: result: $GCC_VERSION" >&5
1698 echo "${ECHO_T}$GCC_VERSION" >&6
1699 fi
1700
1701 echo "$as_me:1701: checking for $CC option to accept ANSI C" >&5
1702 echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6
1703 if test "${ac_cv_prog_cc_stdc+set}" = set; then
1704   echo $ECHO_N "(cached) $ECHO_C" >&6
1705 else
1706   ac_cv_prog_cc_stdc=no
1707 ac_save_CC=$CC
1708 cat >conftest.$ac_ext <<_ACEOF
1709 #line 1709 "configure"
1710 #include "confdefs.h"
1711 #include <stdarg.h>
1712 #include <stdio.h>
1713 #include <sys/types.h>
1714 #include <sys/stat.h>
1715 /* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
1716 struct buf { int x; };
1717 FILE * (*rcsopen) (struct buf *, struct stat *, int);
1718 static char *e (p, i)
1719      char **p;
1720      int i;
1721 {
1722   return p[i];
1723 }
1724 static char *f (char * (*g) (char **, int), char **p, ...)
1725 {
1726   char *s;
1727   va_list v;
1728   va_start (v,p);
1729   s = g (p, va_arg (v,int));
1730   va_end (v);
1731   return s;
1732 }
1733 int test (int i, double x);
1734 struct s1 {int (*f) (int a);};
1735 struct s2 {int (*f) (double a);};
1736 int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
1737 int argc;
1738 char **argv;
1739 int
1740 main ()
1741 {
1742 return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
1743   ;
1744   return 0;
1745 }
1746 _ACEOF
1747 # Don't try gcc -ansi; that turns off useful extensions and
1748 # breaks some systems' header files.
1749 # AIX                   -qlanglvl=ansi
1750 # Ultrix and OSF/1      -std1
1751 # HP-UX 10.20 and later -Ae
1752 # HP-UX older versions  -Aa -D_HPUX_SOURCE
1753 # SVR4                  -Xc -D__EXTENSIONS__
1754 for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
1755 do
1756   CC="$ac_save_CC $ac_arg"
1757   rm -f conftest.$ac_objext
1758 if { (eval echo "$as_me:1758: \"$ac_compile\"") >&5
1759   (eval $ac_compile) 2>&5
1760   ac_status=$?
1761   echo "$as_me:1761: \$? = $ac_status" >&5
1762   (exit $ac_status); } &&
1763          { ac_try='test -s conftest.$ac_objext'
1764   { (eval echo "$as_me:1764: \"$ac_try\"") >&5
1765   (eval $ac_try) 2>&5
1766   ac_status=$?
1767   echo "$as_me:1767: \$? = $ac_status" >&5
1768   (exit $ac_status); }; }; then
1769   ac_cv_prog_cc_stdc=$ac_arg
1770 break
1771 else
1772   echo "$as_me: failed program was:" >&5
1773 cat conftest.$ac_ext >&5
1774 fi
1775 rm -f conftest.$ac_objext
1776 done
1777 rm -f conftest.$ac_ext conftest.$ac_objext
1778 CC=$ac_save_CC
1779
1780 fi
1781
1782 case "x$ac_cv_prog_cc_stdc" in
1783   x|xno)
1784     echo "$as_me:1784: result: none needed" >&5
1785 echo "${ECHO_T}none needed" >&6 ;;
1786   *)
1787     echo "$as_me:1787: result: $ac_cv_prog_cc_stdc" >&5
1788 echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6
1789     CC="$CC $ac_cv_prog_cc_stdc" ;;
1790 esac
1791
1792 # This should have been defined by AC_PROG_CC
1793 : ${CC:=cc}
1794
1795 echo "$as_me:1795: checking \$CC variable" >&5
1796 echo $ECHO_N "checking \$CC variable... $ECHO_C" >&6
1797 case "$CC" in
1798 (*[\ \  ]-[IUD]*)
1799         echo "$as_me:1799: result: broken" >&5
1800 echo "${ECHO_T}broken" >&6
1801         { echo "$as_me:1801: WARNING: your environment misuses the CC variable to hold CFLAGS/CPPFLAGS options" >&5
1802 echo "$as_me: WARNING: your environment misuses the CC variable to hold CFLAGS/CPPFLAGS options" >&2;}
1803         # humor him...
1804         cf_flags=`echo "$CC" | sed -e 's/^[^    ]*[     ]//'`
1805         CC=`echo "$CC" | sed -e 's/[    ].*//'`
1806
1807 cf_fix_cppflags=no
1808 cf_new_cflags=
1809 cf_new_cppflags=
1810 cf_new_extra_cppflags=
1811
1812 for cf_add_cflags in $cf_flags
1813 do
1814 case $cf_fix_cppflags in
1815 (no)
1816         case $cf_add_cflags in
1817         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
1818                 case $cf_add_cflags in
1819                 (-D*)
1820                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
1821
1822                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
1823                                 && test -z "${cf_tst_cflags}" \
1824                                 && cf_fix_cppflags=yes
1825
1826                         if test $cf_fix_cppflags = yes ; then
1827                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
1828                                 continue
1829                         elif test "${cf_tst_cflags}" = "\"'" ; then
1830                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
1831                                 continue
1832                         fi
1833                         ;;
1834                 esac
1835                 case "$CPPFLAGS" in
1836                 (*$cf_add_cflags)
1837                         ;;
1838                 (*)
1839                         case $cf_add_cflags in
1840                         (-D*)
1841                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
1842
1843 CPPFLAGS=`echo "$CPPFLAGS" | \
1844         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
1845                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
1846
1847                                 ;;
1848                         esac
1849                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
1850                         ;;
1851                 esac
1852                 ;;
1853         (*)
1854                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
1855                 ;;
1856         esac
1857         ;;
1858 (yes)
1859         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
1860
1861         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
1862
1863         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
1864                 && test -z "${cf_tst_cflags}" \
1865                 && cf_fix_cppflags=no
1866         ;;
1867 esac
1868 done
1869
1870 if test -n "$cf_new_cflags" ; then
1871
1872         CFLAGS="$CFLAGS $cf_new_cflags"
1873 fi
1874
1875 if test -n "$cf_new_cppflags" ; then
1876
1877         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
1878 fi
1879
1880 if test -n "$cf_new_extra_cppflags" ; then
1881
1882         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
1883 fi
1884
1885         ;;
1886 (*)
1887         echo "$as_me:1887: result: ok" >&5
1888 echo "${ECHO_T}ok" >&6
1889         ;;
1890 esac
1891
1892 ac_ext=c
1893 ac_cpp='$CPP $CPPFLAGS'
1894 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
1895 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
1896 ac_compiler_gnu=$ac_cv_c_compiler_gnu
1897 ac_main_return=return
1898 echo "$as_me:1898: checking how to run the C preprocessor" >&5
1899 echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6
1900 # On Suns, sometimes $CPP names a directory.
1901 if test -n "$CPP" && test -d "$CPP"; then
1902   CPP=
1903 fi
1904 if test -z "$CPP"; then
1905   if test "${ac_cv_prog_CPP+set}" = set; then
1906   echo $ECHO_N "(cached) $ECHO_C" >&6
1907 else
1908       # Double quotes because CPP needs to be expanded
1909     for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
1910     do
1911       ac_preproc_ok=false
1912 for ac_c_preproc_warn_flag in '' yes
1913 do
1914   # Use a header file that comes with gcc, so configuring glibc
1915   # with a fresh cross-compiler works.
1916   # On the NeXT, cc -E runs the code through the compiler's parser,
1917   # not just through cpp. "Syntax error" is here to catch this case.
1918   cat >conftest.$ac_ext <<_ACEOF
1919 #line 1919 "configure"
1920 #include "confdefs.h"
1921 #include <assert.h>
1922                      Syntax error
1923 _ACEOF
1924 if { (eval echo "$as_me:1924: \"$ac_cpp conftest.$ac_ext\"") >&5
1925   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
1926   ac_status=$?
1927   egrep -v '^ *\+' conftest.er1 >conftest.err
1928   rm -f conftest.er1
1929   cat conftest.err >&5
1930   echo "$as_me:1930: \$? = $ac_status" >&5
1931   (exit $ac_status); } >/dev/null; then
1932   if test -s conftest.err; then
1933     ac_cpp_err=$ac_c_preproc_warn_flag
1934   else
1935     ac_cpp_err=
1936   fi
1937 else
1938   ac_cpp_err=yes
1939 fi
1940 if test -z "$ac_cpp_err"; then
1941   :
1942 else
1943   echo "$as_me: failed program was:" >&5
1944   cat conftest.$ac_ext >&5
1945   # Broken: fails on valid input.
1946 continue
1947 fi
1948 rm -f conftest.err conftest.$ac_ext
1949
1950   # OK, works on sane cases.  Now check whether non-existent headers
1951   # can be detected and how.
1952   cat >conftest.$ac_ext <<_ACEOF
1953 #line 1953 "configure"
1954 #include "confdefs.h"
1955 #include <ac_nonexistent.h>
1956 _ACEOF
1957 if { (eval echo "$as_me:1957: \"$ac_cpp conftest.$ac_ext\"") >&5
1958   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
1959   ac_status=$?
1960   egrep -v '^ *\+' conftest.er1 >conftest.err
1961   rm -f conftest.er1
1962   cat conftest.err >&5
1963   echo "$as_me:1963: \$? = $ac_status" >&5
1964   (exit $ac_status); } >/dev/null; then
1965   if test -s conftest.err; then
1966     ac_cpp_err=$ac_c_preproc_warn_flag
1967   else
1968     ac_cpp_err=
1969   fi
1970 else
1971   ac_cpp_err=yes
1972 fi
1973 if test -z "$ac_cpp_err"; then
1974   # Broken: success on invalid input.
1975 continue
1976 else
1977   echo "$as_me: failed program was:" >&5
1978   cat conftest.$ac_ext >&5
1979   # Passes both tests.
1980 ac_preproc_ok=:
1981 break
1982 fi
1983 rm -f conftest.err conftest.$ac_ext
1984
1985 done
1986 # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
1987 rm -f conftest.err conftest.$ac_ext
1988 if $ac_preproc_ok; then
1989   break
1990 fi
1991
1992     done
1993     ac_cv_prog_CPP=$CPP
1994
1995 fi
1996   CPP=$ac_cv_prog_CPP
1997 else
1998   ac_cv_prog_CPP=$CPP
1999 fi
2000 echo "$as_me:2000: result: $CPP" >&5
2001 echo "${ECHO_T}$CPP" >&6
2002 ac_preproc_ok=false
2003 for ac_c_preproc_warn_flag in '' yes
2004 do
2005   # Use a header file that comes with gcc, so configuring glibc
2006   # with a fresh cross-compiler works.
2007   # On the NeXT, cc -E runs the code through the compiler's parser,
2008   # not just through cpp. "Syntax error" is here to catch this case.
2009   cat >conftest.$ac_ext <<_ACEOF
2010 #line 2010 "configure"
2011 #include "confdefs.h"
2012 #include <assert.h>
2013                      Syntax error
2014 _ACEOF
2015 if { (eval echo "$as_me:2015: \"$ac_cpp conftest.$ac_ext\"") >&5
2016   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
2017   ac_status=$?
2018   egrep -v '^ *\+' conftest.er1 >conftest.err
2019   rm -f conftest.er1
2020   cat conftest.err >&5
2021   echo "$as_me:2021: \$? = $ac_status" >&5
2022   (exit $ac_status); } >/dev/null; then
2023   if test -s conftest.err; then
2024     ac_cpp_err=$ac_c_preproc_warn_flag
2025   else
2026     ac_cpp_err=
2027   fi
2028 else
2029   ac_cpp_err=yes
2030 fi
2031 if test -z "$ac_cpp_err"; then
2032   :
2033 else
2034   echo "$as_me: failed program was:" >&5
2035   cat conftest.$ac_ext >&5
2036   # Broken: fails on valid input.
2037 continue
2038 fi
2039 rm -f conftest.err conftest.$ac_ext
2040
2041   # OK, works on sane cases.  Now check whether non-existent headers
2042   # can be detected and how.
2043   cat >conftest.$ac_ext <<_ACEOF
2044 #line 2044 "configure"
2045 #include "confdefs.h"
2046 #include <ac_nonexistent.h>
2047 _ACEOF
2048 if { (eval echo "$as_me:2048: \"$ac_cpp conftest.$ac_ext\"") >&5
2049   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
2050   ac_status=$?
2051   egrep -v '^ *\+' conftest.er1 >conftest.err
2052   rm -f conftest.er1
2053   cat conftest.err >&5
2054   echo "$as_me:2054: \$? = $ac_status" >&5
2055   (exit $ac_status); } >/dev/null; then
2056   if test -s conftest.err; then
2057     ac_cpp_err=$ac_c_preproc_warn_flag
2058   else
2059     ac_cpp_err=
2060   fi
2061 else
2062   ac_cpp_err=yes
2063 fi
2064 if test -z "$ac_cpp_err"; then
2065   # Broken: success on invalid input.
2066 continue
2067 else
2068   echo "$as_me: failed program was:" >&5
2069   cat conftest.$ac_ext >&5
2070   # Passes both tests.
2071 ac_preproc_ok=:
2072 break
2073 fi
2074 rm -f conftest.err conftest.$ac_ext
2075
2076 done
2077 # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
2078 rm -f conftest.err conftest.$ac_ext
2079 if $ac_preproc_ok; then
2080   :
2081 else
2082   { { echo "$as_me:2082: error: C preprocessor \"$CPP\" fails sanity check" >&5
2083 echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check" >&2;}
2084    { (exit 1); exit 1; }; }
2085 fi
2086
2087 ac_ext=c
2088 ac_cpp='$CPP $CPPFLAGS'
2089 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
2090 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
2091 ac_compiler_gnu=$ac_cv_c_compiler_gnu
2092 ac_main_return=return
2093
2094 if test $ac_cv_c_compiler_gnu = yes; then
2095     echo "$as_me:2095: checking whether $CC needs -traditional" >&5
2096 echo $ECHO_N "checking whether $CC needs -traditional... $ECHO_C" >&6
2097 if test "${ac_cv_prog_gcc_traditional+set}" = set; then
2098   echo $ECHO_N "(cached) $ECHO_C" >&6
2099 else
2100     ac_pattern="Autoconf.*'x'"
2101   cat >conftest.$ac_ext <<_ACEOF
2102 #line 2102 "configure"
2103 #include "confdefs.h"
2104 #include <sgtty.h>
2105 int Autoconf = TIOCGETP;
2106 _ACEOF
2107 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
2108   egrep "$ac_pattern" >/dev/null 2>&1; then
2109   ac_cv_prog_gcc_traditional=yes
2110 else
2111   ac_cv_prog_gcc_traditional=no
2112 fi
2113 rm -rf conftest*
2114
2115   if test $ac_cv_prog_gcc_traditional = no; then
2116     cat >conftest.$ac_ext <<_ACEOF
2117 #line 2117 "configure"
2118 #include "confdefs.h"
2119 #include <termio.h>
2120 int Autoconf = TCGETA;
2121 _ACEOF
2122 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
2123   egrep "$ac_pattern" >/dev/null 2>&1; then
2124   ac_cv_prog_gcc_traditional=yes
2125 fi
2126 rm -rf conftest*
2127
2128   fi
2129 fi
2130 echo "$as_me:2130: result: $ac_cv_prog_gcc_traditional" >&5
2131 echo "${ECHO_T}$ac_cv_prog_gcc_traditional" >&6
2132   if test $ac_cv_prog_gcc_traditional = yes; then
2133     CC="$CC -traditional"
2134   fi
2135 fi
2136
2137 echo "$as_me:2137: checking whether $CC understands -c and -o together" >&5
2138 echo $ECHO_N "checking whether $CC understands -c and -o together... $ECHO_C" >&6
2139 if test "${cf_cv_prog_CC_c_o+set}" = set; then
2140   echo $ECHO_N "(cached) $ECHO_C" >&6
2141 else
2142
2143 cat > conftest.$ac_ext <<CF_EOF
2144 #include <stdio.h>
2145 int main()
2146 {
2147         ${cf_cv_main_return:-return}(0);
2148 }
2149 CF_EOF
2150 # We do the test twice because some compilers refuse to overwrite an
2151 # existing .o file with -o, though they will create one.
2152 ac_try='$CC -c conftest.$ac_ext -o conftest2.$ac_objext >&5'
2153 if { (eval echo "$as_me:2153: \"$ac_try\"") >&5
2154   (eval $ac_try) 2>&5
2155   ac_status=$?
2156   echo "$as_me:2156: \$? = $ac_status" >&5
2157   (exit $ac_status); } &&
2158   test -f conftest2.$ac_objext && { (eval echo "$as_me:2158: \"$ac_try\"") >&5
2159   (eval $ac_try) 2>&5
2160   ac_status=$?
2161   echo "$as_me:2161: \$? = $ac_status" >&5
2162   (exit $ac_status); };
2163 then
2164   eval cf_cv_prog_CC_c_o=yes
2165 else
2166   eval cf_cv_prog_CC_c_o=no
2167 fi
2168 rm -rf conftest*
2169
2170 fi
2171 if test $cf_cv_prog_CC_c_o = yes; then
2172   echo "$as_me:2172: result: yes" >&5
2173 echo "${ECHO_T}yes" >&6
2174 else
2175   echo "$as_me:2175: result: no" >&5
2176 echo "${ECHO_T}no" >&6
2177 fi
2178
2179 test "$program_prefix" != NONE &&
2180   program_transform_name="s,^,$program_prefix,;$program_transform_name"
2181 # Use a double $ so make ignores it.
2182 test "$program_suffix" != NONE &&
2183   program_transform_name="s,\$,$program_suffix,;$program_transform_name"
2184 # Double any \ or $.  echo might interpret backslashes.
2185 # By default was `s,x,x', remove it if useless.
2186 cat <<\_ACEOF >conftest.sed
2187 s/[\\$]/&&/g;s/;s,x,x,$//
2188 _ACEOF
2189 program_transform_name=`echo $program_transform_name | sed -f conftest.sed`
2190 rm conftest.sed
2191
2192 for ac_prog in mawk gawk nawk awk
2193 do
2194   # Extract the first word of "$ac_prog", so it can be a program name with args.
2195 set dummy $ac_prog; ac_word=$2
2196 echo "$as_me:2196: checking for $ac_word" >&5
2197 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2198 if test "${ac_cv_prog_AWK+set}" = set; then
2199   echo $ECHO_N "(cached) $ECHO_C" >&6
2200 else
2201   if test -n "$AWK"; then
2202   ac_cv_prog_AWK="$AWK" # Let the user override the test.
2203 else
2204   ac_save_IFS=$IFS; IFS=$ac_path_separator
2205 ac_dummy="$PATH"
2206 for ac_dir in $ac_dummy; do
2207   IFS=$ac_save_IFS
2208   test -z "$ac_dir" && ac_dir=.
2209   $as_executable_p "$ac_dir/$ac_word" || continue
2210 ac_cv_prog_AWK="$ac_prog"
2211 echo "$as_me:2211: found $ac_dir/$ac_word" >&5
2212 break
2213 done
2214
2215 fi
2216 fi
2217 AWK=$ac_cv_prog_AWK
2218 if test -n "$AWK"; then
2219   echo "$as_me:2219: result: $AWK" >&5
2220 echo "${ECHO_T}$AWK" >&6
2221 else
2222   echo "$as_me:2222: result: no" >&5
2223 echo "${ECHO_T}no" >&6
2224 fi
2225
2226   test -n "$AWK" && break
2227 done
2228
2229 test -z "$AWK" && { { echo "$as_me:2229: error: No awk program found" >&5
2230 echo "$as_me: error: No awk program found" >&2;}
2231    { (exit 1); exit 1; }; }
2232
2233 echo "$as_me:2233: checking for egrep" >&5
2234 echo $ECHO_N "checking for egrep... $ECHO_C" >&6
2235 if test "${ac_cv_prog_egrep+set}" = set; then
2236   echo $ECHO_N "(cached) $ECHO_C" >&6
2237 else
2238   if echo a | (grep -E '(a|b)') >/dev/null 2>&1
2239                 then ac_cv_prog_egrep='grep -E'
2240                 else ac_cv_prog_egrep='egrep'
2241         fi
2242 fi
2243 echo "$as_me:2243: result: $ac_cv_prog_egrep" >&5
2244 echo "${ECHO_T}$ac_cv_prog_egrep" >&6
2245         EGREP=$ac_cv_prog_egrep
2246
2247         test -z "$EGREP" && { { echo "$as_me:2247: error: No egrep program found" >&5
2248 echo "$as_me: error: No egrep program found" >&2;}
2249    { (exit 1); exit 1; }; }
2250
2251 # Find a good install program.  We prefer a C program (faster),
2252 # so one script is as good as another.  But avoid the broken or
2253 # incompatible versions:
2254 # SysV /etc/install, /usr/sbin/install
2255 # SunOS /usr/etc/install
2256 # IRIX /sbin/install
2257 # AIX /bin/install
2258 # AmigaOS /C/install, which installs bootblocks on floppy discs
2259 # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
2260 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
2261 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
2262 # ./install, which can be erroneously created by make from ./install.sh.
2263 echo "$as_me:2263: checking for a BSD compatible install" >&5
2264 echo $ECHO_N "checking for a BSD compatible install... $ECHO_C" >&6
2265 if test -z "$INSTALL"; then
2266 if test "${ac_cv_path_install+set}" = set; then
2267   echo $ECHO_N "(cached) $ECHO_C" >&6
2268 else
2269     ac_save_IFS=$IFS; IFS=$ac_path_separator
2270   for ac_dir in $PATH; do
2271     IFS=$ac_save_IFS
2272     # Account for people who put trailing slashes in PATH elements.
2273     case $ac_dir/ in
2274     / | ./ | .// | /cC/* \
2275     | /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* \
2276     | /usr/ucb/* ) ;;
2277     *)
2278       # OSF1 and SCO ODT 3.0 have their own names for install.
2279       # Don't use installbsd from OSF since it installs stuff as root
2280       # by default.
2281       for ac_prog in ginstall scoinst install; do
2282         if $as_executable_p "$ac_dir/$ac_prog"; then
2283           if test $ac_prog = install &&
2284             grep dspmsg "$ac_dir/$ac_prog" >/dev/null 2>&1; then
2285             # AIX install.  It has an incompatible calling convention.
2286             :
2287           elif test $ac_prog = install &&
2288             grep pwplus "$ac_dir/$ac_prog" >/dev/null 2>&1; then
2289             # program-specific install script used by HP pwplus--don't use.
2290             :
2291           else
2292             ac_cv_path_install="$ac_dir/$ac_prog -c"
2293             break 2
2294           fi
2295         fi
2296       done
2297       ;;
2298     esac
2299   done
2300
2301 fi
2302   if test "${ac_cv_path_install+set}" = set; then
2303     INSTALL=$ac_cv_path_install
2304   else
2305     # As a last resort, use the slow shell script.  We don't cache a
2306     # path for INSTALL within a source directory, because that will
2307     # break other packages using the cache if that directory is
2308     # removed, or if the path is relative.
2309     INSTALL=$ac_install_sh
2310   fi
2311 fi
2312 echo "$as_me:2312: result: $INSTALL" >&5
2313 echo "${ECHO_T}$INSTALL" >&6
2314
2315 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
2316 # It thinks the first close brace ends the variable substitution.
2317 test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
2318
2319 test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
2320
2321 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
2322
2323 echo "$as_me:2323: checking whether ln -s works" >&5
2324 echo $ECHO_N "checking whether ln -s works... $ECHO_C" >&6
2325 LN_S=$as_ln_s
2326 if test "$LN_S" = "ln -s"; then
2327   echo "$as_me:2327: result: yes" >&5
2328 echo "${ECHO_T}yes" >&6
2329 else
2330   echo "$as_me:2330: result: no, using $LN_S" >&5
2331 echo "${ECHO_T}no, using $LN_S" >&6
2332 fi
2333
2334 echo "$as_me:2334: checking if $LN_S -f options work" >&5
2335 echo $ECHO_N "checking if $LN_S -f options work... $ECHO_C" >&6
2336
2337 rm -f conf$$.src conf$$dst
2338 echo >conf$$.dst
2339 echo first >conf$$.src
2340 if $LN_S -f conf$$.src conf$$.dst 2>/dev/null; then
2341         cf_prog_ln_sf=yes
2342 else
2343         cf_prog_ln_sf=no
2344 fi
2345 rm -f conf$$.dst conf$$src
2346 echo "$as_me:2346: result: $cf_prog_ln_sf" >&5
2347 echo "${ECHO_T}$cf_prog_ln_sf" >&6
2348
2349 test "$cf_prog_ln_sf" = yes && LN_S="$LN_S -f"
2350
2351 echo "$as_me:2351: checking for long file names" >&5
2352 echo $ECHO_N "checking for long file names... $ECHO_C" >&6
2353 if test "${ac_cv_sys_long_file_names+set}" = set; then
2354   echo $ECHO_N "(cached) $ECHO_C" >&6
2355 else
2356   ac_cv_sys_long_file_names=yes
2357 # Test for long file names in all the places we know might matter:
2358 #      .                the current directory, where building will happen
2359 #      $prefix/lib      where we will be installing things
2360 #      $exec_prefix/lib likewise
2361 # eval it to expand exec_prefix.
2362 #      $TMPDIR          if set, where it might want to write temporary files
2363 # if $TMPDIR is not set:
2364 #      /tmp             where it might want to write temporary files
2365 #      /var/tmp         likewise
2366 #      /usr/tmp         likewise
2367 if test -n "$TMPDIR" && test -d "$TMPDIR" && test -w "$TMPDIR"; then
2368   ac_tmpdirs=$TMPDIR
2369 else
2370   ac_tmpdirs='/tmp /var/tmp /usr/tmp'
2371 fi
2372 for ac_dir in  . $ac_tmpdirs `eval echo $prefix/lib $exec_prefix/lib` ; do
2373   test -d $ac_dir || continue
2374   test -w $ac_dir || continue # It is less confusing to not echo anything here.
2375   ac_xdir=$ac_dir/cf$$
2376   (umask 077 && mkdir $ac_xdir 2>/dev/null) || continue
2377   ac_tf1=$ac_xdir/conftest9012345
2378   ac_tf2=$ac_xdir/conftest9012346
2379   (echo 1 >$ac_tf1) 2>/dev/null
2380   (echo 2 >$ac_tf2) 2>/dev/null
2381   ac_val=`cat $ac_tf1 2>/dev/null`
2382   if test ! -f $ac_tf1 || test "$ac_val" != 1; then
2383     ac_cv_sys_long_file_names=no
2384     rm -rf $ac_xdir 2>/dev/null
2385     break
2386   fi
2387   rm -rf $ac_xdir 2>/dev/null
2388 done
2389 fi
2390 echo "$as_me:2390: result: $ac_cv_sys_long_file_names" >&5
2391 echo "${ECHO_T}$ac_cv_sys_long_file_names" >&6
2392 if test $ac_cv_sys_long_file_names = yes; then
2393
2394 cat >>confdefs.h <<\EOF
2395 #define HAVE_LONG_FILE_NAMES 1
2396 EOF
2397
2398 fi
2399
2400 # if we find pkg-config, check if we should install the ".pc" files.
2401
2402 echo "$as_me:2402: checking if you want to use pkg-config" >&5
2403 echo $ECHO_N "checking if you want to use pkg-config... $ECHO_C" >&6
2404
2405 # Check whether --with-pkg-config or --without-pkg-config was given.
2406 if test "${with_pkg_config+set}" = set; then
2407   withval="$with_pkg_config"
2408   cf_pkg_config=$withval
2409 else
2410   cf_pkg_config=yes
2411 fi;
2412 echo "$as_me:2412: result: $cf_pkg_config" >&5
2413 echo "${ECHO_T}$cf_pkg_config" >&6
2414
2415 case $cf_pkg_config in
2416 (no)
2417         PKG_CONFIG=none
2418         ;;
2419 (yes)
2420
2421 if test -n "$ac_tool_prefix"; then
2422   # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
2423 set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
2424 echo "$as_me:2424: checking for $ac_word" >&5
2425 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2426 if test "${ac_cv_path_PKG_CONFIG+set}" = set; then
2427   echo $ECHO_N "(cached) $ECHO_C" >&6
2428 else
2429   case $PKG_CONFIG in
2430   [\\/]* | ?:[\\/]*)
2431   ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
2432   ;;
2433   *)
2434   ac_save_IFS=$IFS; IFS=$ac_path_separator
2435 ac_dummy="$PATH"
2436 for ac_dir in $ac_dummy; do
2437   IFS=$ac_save_IFS
2438   test -z "$ac_dir" && ac_dir=.
2439   if $as_executable_p "$ac_dir/$ac_word"; then
2440    ac_cv_path_PKG_CONFIG="$ac_dir/$ac_word"
2441    echo "$as_me:2441: found $ac_dir/$ac_word" >&5
2442    break
2443 fi
2444 done
2445
2446   ;;
2447 esac
2448 fi
2449 PKG_CONFIG=$ac_cv_path_PKG_CONFIG
2450
2451 if test -n "$PKG_CONFIG"; then
2452   echo "$as_me:2452: result: $PKG_CONFIG" >&5
2453 echo "${ECHO_T}$PKG_CONFIG" >&6
2454 else
2455   echo "$as_me:2455: result: no" >&5
2456 echo "${ECHO_T}no" >&6
2457 fi
2458
2459 fi
2460 if test -z "$ac_cv_path_PKG_CONFIG"; then
2461   ac_pt_PKG_CONFIG=$PKG_CONFIG
2462   # Extract the first word of "pkg-config", so it can be a program name with args.
2463 set dummy pkg-config; ac_word=$2
2464 echo "$as_me:2464: checking for $ac_word" >&5
2465 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2466 if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then
2467   echo $ECHO_N "(cached) $ECHO_C" >&6
2468 else
2469   case $ac_pt_PKG_CONFIG in
2470   [\\/]* | ?:[\\/]*)
2471   ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path.
2472   ;;
2473   *)
2474   ac_save_IFS=$IFS; IFS=$ac_path_separator
2475 ac_dummy="$PATH"
2476 for ac_dir in $ac_dummy; do
2477   IFS=$ac_save_IFS
2478   test -z "$ac_dir" && ac_dir=.
2479   if $as_executable_p "$ac_dir/$ac_word"; then
2480    ac_cv_path_ac_pt_PKG_CONFIG="$ac_dir/$ac_word"
2481    echo "$as_me:2481: found $ac_dir/$ac_word" >&5
2482    break
2483 fi
2484 done
2485
2486   test -z "$ac_cv_path_ac_pt_PKG_CONFIG" && ac_cv_path_ac_pt_PKG_CONFIG="none"
2487   ;;
2488 esac
2489 fi
2490 ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
2491
2492 if test -n "$ac_pt_PKG_CONFIG"; then
2493   echo "$as_me:2493: result: $ac_pt_PKG_CONFIG" >&5
2494 echo "${ECHO_T}$ac_pt_PKG_CONFIG" >&6
2495 else
2496   echo "$as_me:2496: result: no" >&5
2497 echo "${ECHO_T}no" >&6
2498 fi
2499
2500   PKG_CONFIG=$ac_pt_PKG_CONFIG
2501 else
2502   PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
2503 fi
2504
2505         ;;
2506 (*)
2507         PKG_CONFIG=$withval
2508         ;;
2509 esac
2510
2511 test -z "$PKG_CONFIG" && PKG_CONFIG=none
2512 if test "$PKG_CONFIG" != none ; then
2513
2514 if test "x$prefix" != xNONE; then
2515         cf_path_syntax="$prefix"
2516 else
2517         cf_path_syntax="$ac_default_prefix"
2518 fi
2519
2520 case ".$PKG_CONFIG" in
2521 (.\$\(*\)*|.\'*\'*)
2522         ;;
2523 (..|./*|.\\*)
2524         ;;
2525 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
2526         ;;
2527 (.\${*prefix}*|.\${*dir}*)
2528         eval PKG_CONFIG="$PKG_CONFIG"
2529         case ".$PKG_CONFIG" in
2530         (.NONE/*)
2531                 PKG_CONFIG=`echo $PKG_CONFIG | sed -e s%NONE%$cf_path_syntax%`
2532                 ;;
2533         esac
2534         ;;
2535 (.no|.NONE/*)
2536         PKG_CONFIG=`echo $PKG_CONFIG | sed -e s%NONE%$cf_path_syntax%`
2537         ;;
2538 (*)
2539         { { echo "$as_me:2539: error: expected a pathname, not \"$PKG_CONFIG\"" >&5
2540 echo "$as_me: error: expected a pathname, not \"$PKG_CONFIG\"" >&2;}
2541    { (exit 1); exit 1; }; }
2542         ;;
2543 esac
2544
2545 elif test "x$cf_pkg_config" != xno ; then
2546         { echo "$as_me:2546: WARNING: pkg-config is not installed" >&5
2547 echo "$as_me: WARNING: pkg-config is not installed" >&2;}
2548 fi
2549
2550 echo "$as_me:2550: checking for $PKG_CONFIG library directory" >&5
2551 echo $ECHO_N "checking for $PKG_CONFIG library directory... $ECHO_C" >&6
2552 if test "x$PKG_CONFIG" = xnone ; then
2553         PKG_CONFIG_LIBDIR=none
2554 else
2555
2556 # Check whether --with-pkg-config-libdir or --without-pkg-config-libdir was given.
2557 if test "${with_pkg_config_libdir+set}" = set; then
2558   withval="$with_pkg_config_libdir"
2559   PKG_CONFIG_LIBDIR=$withval
2560 else
2561   PKG_CONFIG_LIBDIR=yes
2562 fi;
2563 fi
2564
2565 case x$PKG_CONFIG_LIBDIR in
2566 (x/*)
2567         ;;
2568 (xyes)
2569         # Look for the library directory using the same prefix as the executable
2570         if test "x$PKG_CONFIG" = xnone
2571         then
2572                 cf_path=$prefix
2573         else
2574                 cf_path=`echo "$PKG_CONFIG" | sed -e 's,/[^/]*/[^/]*$,,'`
2575         fi
2576
2577         # If you don't like using the default architecture, you have to specify the
2578         # intended library directory and corresponding compiler/linker options.
2579         #
2580         # This case allows for Debian's 2014-flavor of multiarch, along with the
2581         # most common variations before that point.  Some other variants spell the
2582         # directory differently, e.g., "pkg-config", and put it in unusual places.
2583         # pkg-config has always been poorly standardized, which is ironic...
2584         case x`(arch) 2>/dev/null` in
2585         (*64)
2586                 cf_search_path="\
2587                         $cf_path/lib/*64-linux-gnu \
2588                         $cf_path/share \
2589                         $cf_path/lib64 \
2590                         $cf_path/lib32 \
2591                         $cf_path/lib"
2592                 ;;
2593         (*)
2594                 cf_search_path="\
2595                         $cf_path/lib/*-linux-gnu \
2596                         $cf_path/share \
2597                         $cf_path/lib32 \
2598                         $cf_path/lib \
2599                         $cf_path/libdata"
2600                 ;;
2601         esac
2602
2603         test -n "$verbose" && echo "    list..." 1>&6
2604
2605 echo "${as_me:-configure}:2605: testing list... ..." 1>&5
2606
2607         for cf_config in $cf_search_path
2608         do
2609                 test -n "$verbose" && echo "    checking $cf_config/pkgconfig" 1>&6
2610
2611 echo "${as_me:-configure}:2611: testing checking $cf_config/pkgconfig ..." 1>&5
2612
2613                 if test -d $cf_config/pkgconfig
2614                 then
2615                         PKG_CONFIG_LIBDIR=$cf_config/pkgconfig
2616                         echo "$as_me:2616: checking done" >&5
2617 echo $ECHO_N "checking done... $ECHO_C" >&6
2618                         break
2619                 fi
2620         done
2621         ;;
2622 (*)
2623         ;;
2624 esac
2625
2626 if test "x$PKG_CONFIG" != xnone ; then
2627         echo "$as_me:2627: result: $PKG_CONFIG_LIBDIR" >&5
2628 echo "${ECHO_T}$PKG_CONFIG_LIBDIR" >&6
2629 fi
2630
2631 echo "$as_me:2631: checking if you want to build test-programs" >&5
2632 echo $ECHO_N "checking if you want to build test-programs... $ECHO_C" >&6
2633
2634 # Check whether --with-tests or --without-tests was given.
2635 if test "${with_tests+set}" = set; then
2636   withval="$with_tests"
2637   cf_with_tests=$withval
2638 else
2639   cf_with_tests=yes
2640 fi;
2641 echo "$as_me:2641: result: $cf_with_tests" >&5
2642 echo "${ECHO_T}$cf_with_tests" >&6
2643
2644 echo "$as_me:2644: checking if we should assume mixed-case filenames" >&5
2645 echo $ECHO_N "checking if we should assume mixed-case filenames... $ECHO_C" >&6
2646
2647 # Check whether --enable-mixed-case or --disable-mixed-case was given.
2648 if test "${enable_mixed_case+set}" = set; then
2649   enableval="$enable_mixed_case"
2650   enable_mixedcase=$enableval
2651 else
2652   enable_mixedcase=auto
2653 fi;
2654 echo "$as_me:2654: result: $enable_mixedcase" >&5
2655 echo "${ECHO_T}$enable_mixedcase" >&6
2656 if test "$enable_mixedcase" = "auto" ; then
2657
2658 echo "$as_me:2658: checking if filesystem supports mixed-case filenames" >&5
2659 echo $ECHO_N "checking if filesystem supports mixed-case filenames... $ECHO_C" >&6
2660 if test "${cf_cv_mixedcase+set}" = set; then
2661   echo $ECHO_N "(cached) $ECHO_C" >&6
2662 else
2663
2664 if test "$cross_compiling" = yes ; then
2665         case $target_alias in
2666         (*-os2-emx*|*-msdosdjgpp*|*-cygwin*|*-msys*|*-mingw*|*-uwin*)
2667                 cf_cv_mixedcase=no
2668                 ;;
2669         (*)
2670                 cf_cv_mixedcase=yes
2671                 ;;
2672         esac
2673 else
2674         rm -f conftest CONFTEST
2675         echo test >conftest
2676         if test -f CONFTEST ; then
2677                 cf_cv_mixedcase=no
2678         else
2679                 cf_cv_mixedcase=yes
2680         fi
2681         rm -f conftest CONFTEST
2682 fi
2683
2684 fi
2685 echo "$as_me:2685: result: $cf_cv_mixedcase" >&5
2686 echo "${ECHO_T}$cf_cv_mixedcase" >&6
2687 test "$cf_cv_mixedcase" = yes &&
2688 cat >>confdefs.h <<\EOF
2689 #define MIXEDCASE_FILENAMES 1
2690 EOF
2691
2692 else
2693         cf_cv_mixedcase=$enable_mixedcase
2694         if test "$enable_mixedcase" = "yes" ; then
2695                 cat >>confdefs.h <<\EOF
2696 #define MIXEDCASE_FILENAMES 1
2697 EOF
2698
2699         fi
2700 fi
2701
2702 # do this after mixed-case option (tags/TAGS is not as important as tic).
2703 echo "$as_me:2703: checking whether ${MAKE-make} sets \${MAKE}" >&5
2704 echo $ECHO_N "checking whether ${MAKE-make} sets \${MAKE}... $ECHO_C" >&6
2705 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,./+-,__p_,'`
2706 if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then
2707   echo $ECHO_N "(cached) $ECHO_C" >&6
2708 else
2709   cat >conftest.make <<\EOF
2710 all:
2711         @echo 'ac_maketemp="${MAKE}"'
2712 EOF
2713 # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
2714 eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=`
2715 if test -n "$ac_maketemp"; then
2716   eval ac_cv_prog_make_${ac_make}_set=yes
2717 else
2718   eval ac_cv_prog_make_${ac_make}_set=no
2719 fi
2720 rm -f conftest.make
2721 fi
2722 if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
2723   echo "$as_me:2723: result: yes" >&5
2724 echo "${ECHO_T}yes" >&6
2725   SET_MAKE=
2726 else
2727   echo "$as_me:2727: result: no" >&5
2728 echo "${ECHO_T}no" >&6
2729   SET_MAKE="MAKE=${MAKE-make}"
2730 fi
2731
2732 for ac_prog in exctags ctags
2733 do
2734   # Extract the first word of "$ac_prog", so it can be a program name with args.
2735 set dummy $ac_prog; ac_word=$2
2736 echo "$as_me:2736: checking for $ac_word" >&5
2737 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2738 if test "${ac_cv_prog_CTAGS+set}" = set; then
2739   echo $ECHO_N "(cached) $ECHO_C" >&6
2740 else
2741   if test -n "$CTAGS"; then
2742   ac_cv_prog_CTAGS="$CTAGS" # Let the user override the test.
2743 else
2744   ac_save_IFS=$IFS; IFS=$ac_path_separator
2745 ac_dummy="$PATH"
2746 for ac_dir in $ac_dummy; do
2747   IFS=$ac_save_IFS
2748   test -z "$ac_dir" && ac_dir=.
2749   $as_executable_p "$ac_dir/$ac_word" || continue
2750 ac_cv_prog_CTAGS="$ac_prog"
2751 echo "$as_me:2751: found $ac_dir/$ac_word" >&5
2752 break
2753 done
2754
2755 fi
2756 fi
2757 CTAGS=$ac_cv_prog_CTAGS
2758 if test -n "$CTAGS"; then
2759   echo "$as_me:2759: result: $CTAGS" >&5
2760 echo "${ECHO_T}$CTAGS" >&6
2761 else
2762   echo "$as_me:2762: result: no" >&5
2763 echo "${ECHO_T}no" >&6
2764 fi
2765
2766   test -n "$CTAGS" && break
2767 done
2768
2769 for ac_prog in exetags etags
2770 do
2771   # Extract the first word of "$ac_prog", so it can be a program name with args.
2772 set dummy $ac_prog; ac_word=$2
2773 echo "$as_me:2773: checking for $ac_word" >&5
2774 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2775 if test "${ac_cv_prog_ETAGS+set}" = set; then
2776   echo $ECHO_N "(cached) $ECHO_C" >&6
2777 else
2778   if test -n "$ETAGS"; then
2779   ac_cv_prog_ETAGS="$ETAGS" # Let the user override the test.
2780 else
2781   ac_save_IFS=$IFS; IFS=$ac_path_separator
2782 ac_dummy="$PATH"
2783 for ac_dir in $ac_dummy; do
2784   IFS=$ac_save_IFS
2785   test -z "$ac_dir" && ac_dir=.
2786   $as_executable_p "$ac_dir/$ac_word" || continue
2787 ac_cv_prog_ETAGS="$ac_prog"
2788 echo "$as_me:2788: found $ac_dir/$ac_word" >&5
2789 break
2790 done
2791
2792 fi
2793 fi
2794 ETAGS=$ac_cv_prog_ETAGS
2795 if test -n "$ETAGS"; then
2796   echo "$as_me:2796: result: $ETAGS" >&5
2797 echo "${ECHO_T}$ETAGS" >&6
2798 else
2799   echo "$as_me:2799: result: no" >&5
2800 echo "${ECHO_T}no" >&6
2801 fi
2802
2803   test -n "$ETAGS" && break
2804 done
2805
2806 # Extract the first word of "${CTAGS:-ctags}", so it can be a program name with args.
2807 set dummy ${CTAGS:-ctags}; ac_word=$2
2808 echo "$as_me:2808: checking for $ac_word" >&5
2809 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2810 if test "${ac_cv_prog_MAKE_LOWER_TAGS+set}" = set; then
2811   echo $ECHO_N "(cached) $ECHO_C" >&6
2812 else
2813   if test -n "$MAKE_LOWER_TAGS"; then
2814   ac_cv_prog_MAKE_LOWER_TAGS="$MAKE_LOWER_TAGS" # Let the user override the test.
2815 else
2816   ac_save_IFS=$IFS; IFS=$ac_path_separator
2817 ac_dummy="$PATH"
2818 for ac_dir in $ac_dummy; do
2819   IFS=$ac_save_IFS
2820   test -z "$ac_dir" && ac_dir=.
2821   $as_executable_p "$ac_dir/$ac_word" || continue
2822 ac_cv_prog_MAKE_LOWER_TAGS="yes"
2823 echo "$as_me:2823: found $ac_dir/$ac_word" >&5
2824 break
2825 done
2826
2827   test -z "$ac_cv_prog_MAKE_LOWER_TAGS" && ac_cv_prog_MAKE_LOWER_TAGS="no"
2828 fi
2829 fi
2830 MAKE_LOWER_TAGS=$ac_cv_prog_MAKE_LOWER_TAGS
2831 if test -n "$MAKE_LOWER_TAGS"; then
2832   echo "$as_me:2832: result: $MAKE_LOWER_TAGS" >&5
2833 echo "${ECHO_T}$MAKE_LOWER_TAGS" >&6
2834 else
2835   echo "$as_me:2835: result: no" >&5
2836 echo "${ECHO_T}no" >&6
2837 fi
2838
2839 if test "$cf_cv_mixedcase" = yes ; then
2840         # Extract the first word of "${ETAGS:-etags}", so it can be a program name with args.
2841 set dummy ${ETAGS:-etags}; ac_word=$2
2842 echo "$as_me:2842: checking for $ac_word" >&5
2843 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2844 if test "${ac_cv_prog_MAKE_UPPER_TAGS+set}" = set; then
2845   echo $ECHO_N "(cached) $ECHO_C" >&6
2846 else
2847   if test -n "$MAKE_UPPER_TAGS"; then
2848   ac_cv_prog_MAKE_UPPER_TAGS="$MAKE_UPPER_TAGS" # Let the user override the test.
2849 else
2850   ac_save_IFS=$IFS; IFS=$ac_path_separator
2851 ac_dummy="$PATH"
2852 for ac_dir in $ac_dummy; do
2853   IFS=$ac_save_IFS
2854   test -z "$ac_dir" && ac_dir=.
2855   $as_executable_p "$ac_dir/$ac_word" || continue
2856 ac_cv_prog_MAKE_UPPER_TAGS="yes"
2857 echo "$as_me:2857: found $ac_dir/$ac_word" >&5
2858 break
2859 done
2860
2861   test -z "$ac_cv_prog_MAKE_UPPER_TAGS" && ac_cv_prog_MAKE_UPPER_TAGS="no"
2862 fi
2863 fi
2864 MAKE_UPPER_TAGS=$ac_cv_prog_MAKE_UPPER_TAGS
2865 if test -n "$MAKE_UPPER_TAGS"; then
2866   echo "$as_me:2866: result: $MAKE_UPPER_TAGS" >&5
2867 echo "${ECHO_T}$MAKE_UPPER_TAGS" >&6
2868 else
2869   echo "$as_me:2869: result: no" >&5
2870 echo "${ECHO_T}no" >&6
2871 fi
2872
2873 else
2874         MAKE_UPPER_TAGS=no
2875 fi
2876
2877 if test "$MAKE_UPPER_TAGS" = yes ; then
2878         MAKE_UPPER_TAGS=
2879 else
2880         MAKE_UPPER_TAGS="#"
2881 fi
2882
2883 if test "$MAKE_LOWER_TAGS" = yes ; then
2884         MAKE_LOWER_TAGS=
2885 else
2886         MAKE_LOWER_TAGS="#"
2887 fi
2888
2889 echo "$as_me:2889: checking for makeflags variable" >&5
2890 echo $ECHO_N "checking for makeflags variable... $ECHO_C" >&6
2891 if test "${cf_cv_makeflags+set}" = set; then
2892   echo $ECHO_N "(cached) $ECHO_C" >&6
2893 else
2894
2895         cf_cv_makeflags=''
2896         for cf_option in '-${MAKEFLAGS}' '${MFLAGS}'
2897         do
2898                 cat >cf_makeflags.tmp <<CF_EOF
2899 SHELL = /bin/sh
2900 all :
2901         @ echo '.$cf_option'
2902 CF_EOF
2903                 cf_result=`${MAKE:-make} -k -f cf_makeflags.tmp 2>/dev/null | fgrep -v "ing directory" | sed -e 's,[    ]*$,,'`
2904                 case "$cf_result" in
2905                 (.*k|.*kw)
2906                         cf_result=`${MAKE:-make} -k -f cf_makeflags.tmp CC=cc 2>/dev/null`
2907                         case "$cf_result" in
2908                         (.*CC=*)        cf_cv_makeflags=
2909                                 ;;
2910                         (*)     cf_cv_makeflags=$cf_option
2911                                 ;;
2912                         esac
2913                         break
2914                         ;;
2915                 (.-)    ;;
2916                 (*)     echo "given option \"$cf_option\", no match \"$cf_result\""
2917                         ;;
2918                 esac
2919         done
2920         rm -f cf_makeflags.tmp
2921
2922 fi
2923 echo "$as_me:2923: result: $cf_cv_makeflags" >&5
2924 echo "${ECHO_T}$cf_cv_makeflags" >&6
2925
2926 if test -n "$ac_tool_prefix"; then
2927   # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
2928 set dummy ${ac_tool_prefix}ranlib; ac_word=$2
2929 echo "$as_me:2929: checking for $ac_word" >&5
2930 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2931 if test "${ac_cv_prog_RANLIB+set}" = set; then
2932   echo $ECHO_N "(cached) $ECHO_C" >&6
2933 else
2934   if test -n "$RANLIB"; then
2935   ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
2936 else
2937   ac_save_IFS=$IFS; IFS=$ac_path_separator
2938 ac_dummy="$PATH"
2939 for ac_dir in $ac_dummy; do
2940   IFS=$ac_save_IFS
2941   test -z "$ac_dir" && ac_dir=.
2942   $as_executable_p "$ac_dir/$ac_word" || continue
2943 ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
2944 echo "$as_me:2944: found $ac_dir/$ac_word" >&5
2945 break
2946 done
2947
2948 fi
2949 fi
2950 RANLIB=$ac_cv_prog_RANLIB
2951 if test -n "$RANLIB"; then
2952   echo "$as_me:2952: result: $RANLIB" >&5
2953 echo "${ECHO_T}$RANLIB" >&6
2954 else
2955   echo "$as_me:2955: result: no" >&5
2956 echo "${ECHO_T}no" >&6
2957 fi
2958
2959 fi
2960 if test -z "$ac_cv_prog_RANLIB"; then
2961   ac_ct_RANLIB=$RANLIB
2962   # Extract the first word of "ranlib", so it can be a program name with args.
2963 set dummy ranlib; ac_word=$2
2964 echo "$as_me:2964: checking for $ac_word" >&5
2965 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2966 if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then
2967   echo $ECHO_N "(cached) $ECHO_C" >&6
2968 else
2969   if test -n "$ac_ct_RANLIB"; then
2970   ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
2971 else
2972   ac_save_IFS=$IFS; IFS=$ac_path_separator
2973 ac_dummy="$PATH"
2974 for ac_dir in $ac_dummy; do
2975   IFS=$ac_save_IFS
2976   test -z "$ac_dir" && ac_dir=.
2977   $as_executable_p "$ac_dir/$ac_word" || continue
2978 ac_cv_prog_ac_ct_RANLIB="ranlib"
2979 echo "$as_me:2979: found $ac_dir/$ac_word" >&5
2980 break
2981 done
2982
2983   test -z "$ac_cv_prog_ac_ct_RANLIB" && ac_cv_prog_ac_ct_RANLIB="':'"
2984 fi
2985 fi
2986 ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
2987 if test -n "$ac_ct_RANLIB"; then
2988   echo "$as_me:2988: result: $ac_ct_RANLIB" >&5
2989 echo "${ECHO_T}$ac_ct_RANLIB" >&6
2990 else
2991   echo "$as_me:2991: result: no" >&5
2992 echo "${ECHO_T}no" >&6
2993 fi
2994
2995   RANLIB=$ac_ct_RANLIB
2996 else
2997   RANLIB="$ac_cv_prog_RANLIB"
2998 fi
2999
3000 if test -n "$ac_tool_prefix"; then
3001   # Extract the first word of "${ac_tool_prefix}ld", so it can be a program name with args.
3002 set dummy ${ac_tool_prefix}ld; ac_word=$2
3003 echo "$as_me:3003: checking for $ac_word" >&5
3004 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3005 if test "${ac_cv_prog_LD+set}" = set; then
3006   echo $ECHO_N "(cached) $ECHO_C" >&6
3007 else
3008   if test -n "$LD"; then
3009   ac_cv_prog_LD="$LD" # Let the user override the test.
3010 else
3011   ac_save_IFS=$IFS; IFS=$ac_path_separator
3012 ac_dummy="$PATH"
3013 for ac_dir in $ac_dummy; do
3014   IFS=$ac_save_IFS
3015   test -z "$ac_dir" && ac_dir=.
3016   $as_executable_p "$ac_dir/$ac_word" || continue
3017 ac_cv_prog_LD="${ac_tool_prefix}ld"
3018 echo "$as_me:3018: found $ac_dir/$ac_word" >&5
3019 break
3020 done
3021
3022 fi
3023 fi
3024 LD=$ac_cv_prog_LD
3025 if test -n "$LD"; then
3026   echo "$as_me:3026: result: $LD" >&5
3027 echo "${ECHO_T}$LD" >&6
3028 else
3029   echo "$as_me:3029: result: no" >&5
3030 echo "${ECHO_T}no" >&6
3031 fi
3032
3033 fi
3034 if test -z "$ac_cv_prog_LD"; then
3035   ac_ct_LD=$LD
3036   # Extract the first word of "ld", so it can be a program name with args.
3037 set dummy ld; ac_word=$2
3038 echo "$as_me:3038: checking for $ac_word" >&5
3039 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3040 if test "${ac_cv_prog_ac_ct_LD+set}" = set; then
3041   echo $ECHO_N "(cached) $ECHO_C" >&6
3042 else
3043   if test -n "$ac_ct_LD"; then
3044   ac_cv_prog_ac_ct_LD="$ac_ct_LD" # Let the user override the test.
3045 else
3046   ac_save_IFS=$IFS; IFS=$ac_path_separator
3047 ac_dummy="$PATH"
3048 for ac_dir in $ac_dummy; do
3049   IFS=$ac_save_IFS
3050   test -z "$ac_dir" && ac_dir=.
3051   $as_executable_p "$ac_dir/$ac_word" || continue
3052 ac_cv_prog_ac_ct_LD="ld"
3053 echo "$as_me:3053: found $ac_dir/$ac_word" >&5
3054 break
3055 done
3056
3057   test -z "$ac_cv_prog_ac_ct_LD" && ac_cv_prog_ac_ct_LD="ld"
3058 fi
3059 fi
3060 ac_ct_LD=$ac_cv_prog_ac_ct_LD
3061 if test -n "$ac_ct_LD"; then
3062   echo "$as_me:3062: result: $ac_ct_LD" >&5
3063 echo "${ECHO_T}$ac_ct_LD" >&6
3064 else
3065   echo "$as_me:3065: result: no" >&5
3066 echo "${ECHO_T}no" >&6
3067 fi
3068
3069   LD=$ac_ct_LD
3070 else
3071   LD="$ac_cv_prog_LD"
3072 fi
3073
3074 if test -n "$ac_tool_prefix"; then
3075   # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
3076 set dummy ${ac_tool_prefix}ar; ac_word=$2
3077 echo "$as_me:3077: checking for $ac_word" >&5
3078 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3079 if test "${ac_cv_prog_AR+set}" = set; then
3080   echo $ECHO_N "(cached) $ECHO_C" >&6
3081 else
3082   if test -n "$AR"; then
3083   ac_cv_prog_AR="$AR" # Let the user override the test.
3084 else
3085   ac_save_IFS=$IFS; IFS=$ac_path_separator
3086 ac_dummy="$PATH"
3087 for ac_dir in $ac_dummy; do
3088   IFS=$ac_save_IFS
3089   test -z "$ac_dir" && ac_dir=.
3090   $as_executable_p "$ac_dir/$ac_word" || continue
3091 ac_cv_prog_AR="${ac_tool_prefix}ar"
3092 echo "$as_me:3092: found $ac_dir/$ac_word" >&5
3093 break
3094 done
3095
3096 fi
3097 fi
3098 AR=$ac_cv_prog_AR
3099 if test -n "$AR"; then
3100   echo "$as_me:3100: result: $AR" >&5
3101 echo "${ECHO_T}$AR" >&6
3102 else
3103   echo "$as_me:3103: result: no" >&5
3104 echo "${ECHO_T}no" >&6
3105 fi
3106
3107 fi
3108 if test -z "$ac_cv_prog_AR"; then
3109   ac_ct_AR=$AR
3110   # Extract the first word of "ar", so it can be a program name with args.
3111 set dummy ar; ac_word=$2
3112 echo "$as_me:3112: checking for $ac_word" >&5
3113 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3114 if test "${ac_cv_prog_ac_ct_AR+set}" = set; then
3115   echo $ECHO_N "(cached) $ECHO_C" >&6
3116 else
3117   if test -n "$ac_ct_AR"; then
3118   ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test.
3119 else
3120   ac_save_IFS=$IFS; IFS=$ac_path_separator
3121 ac_dummy="$PATH"
3122 for ac_dir in $ac_dummy; do
3123   IFS=$ac_save_IFS
3124   test -z "$ac_dir" && ac_dir=.
3125   $as_executable_p "$ac_dir/$ac_word" || continue
3126 ac_cv_prog_ac_ct_AR="ar"
3127 echo "$as_me:3127: found $ac_dir/$ac_word" >&5
3128 break
3129 done
3130
3131   test -z "$ac_cv_prog_ac_ct_AR" && ac_cv_prog_ac_ct_AR="ar"
3132 fi
3133 fi
3134 ac_ct_AR=$ac_cv_prog_ac_ct_AR
3135 if test -n "$ac_ct_AR"; then
3136   echo "$as_me:3136: result: $ac_ct_AR" >&5
3137 echo "${ECHO_T}$ac_ct_AR" >&6
3138 else
3139   echo "$as_me:3139: result: no" >&5
3140 echo "${ECHO_T}no" >&6
3141 fi
3142
3143   AR=$ac_ct_AR
3144 else
3145   AR="$ac_cv_prog_AR"
3146 fi
3147
3148 if test -n "$ac_tool_prefix"; then
3149   # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
3150 set dummy ${ac_tool_prefix}ar; ac_word=$2
3151 echo "$as_me:3151: checking for $ac_word" >&5
3152 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3153 if test "${ac_cv_prog_AR+set}" = set; then
3154   echo $ECHO_N "(cached) $ECHO_C" >&6
3155 else
3156   if test -n "$AR"; then
3157   ac_cv_prog_AR="$AR" # Let the user override the test.
3158 else
3159   ac_save_IFS=$IFS; IFS=$ac_path_separator
3160 ac_dummy="$PATH"
3161 for ac_dir in $ac_dummy; do
3162   IFS=$ac_save_IFS
3163   test -z "$ac_dir" && ac_dir=.
3164   $as_executable_p "$ac_dir/$ac_word" || continue
3165 ac_cv_prog_AR="${ac_tool_prefix}ar"
3166 echo "$as_me:3166: found $ac_dir/$ac_word" >&5
3167 break
3168 done
3169
3170 fi
3171 fi
3172 AR=$ac_cv_prog_AR
3173 if test -n "$AR"; then
3174   echo "$as_me:3174: result: $AR" >&5
3175 echo "${ECHO_T}$AR" >&6
3176 else
3177   echo "$as_me:3177: result: no" >&5
3178 echo "${ECHO_T}no" >&6
3179 fi
3180
3181 fi
3182 if test -z "$ac_cv_prog_AR"; then
3183   ac_ct_AR=$AR
3184   # Extract the first word of "ar", so it can be a program name with args.
3185 set dummy ar; ac_word=$2
3186 echo "$as_me:3186: checking for $ac_word" >&5
3187 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3188 if test "${ac_cv_prog_ac_ct_AR+set}" = set; then
3189   echo $ECHO_N "(cached) $ECHO_C" >&6
3190 else
3191   if test -n "$ac_ct_AR"; then
3192   ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test.
3193 else
3194   ac_save_IFS=$IFS; IFS=$ac_path_separator
3195 ac_dummy="$PATH"
3196 for ac_dir in $ac_dummy; do
3197   IFS=$ac_save_IFS
3198   test -z "$ac_dir" && ac_dir=.
3199   $as_executable_p "$ac_dir/$ac_word" || continue
3200 ac_cv_prog_ac_ct_AR="ar"
3201 echo "$as_me:3201: found $ac_dir/$ac_word" >&5
3202 break
3203 done
3204
3205   test -z "$ac_cv_prog_ac_ct_AR" && ac_cv_prog_ac_ct_AR="ar"
3206 fi
3207 fi
3208 ac_ct_AR=$ac_cv_prog_ac_ct_AR
3209 if test -n "$ac_ct_AR"; then
3210   echo "$as_me:3210: result: $ac_ct_AR" >&5
3211 echo "${ECHO_T}$ac_ct_AR" >&6
3212 else
3213   echo "$as_me:3213: result: no" >&5
3214 echo "${ECHO_T}no" >&6
3215 fi
3216
3217   AR=$ac_ct_AR
3218 else
3219   AR="$ac_cv_prog_AR"
3220 fi
3221
3222 echo "$as_me:3222: checking for options to update archives" >&5
3223 echo $ECHO_N "checking for options to update archives... $ECHO_C" >&6
3224 if test "${cf_cv_ar_flags+set}" = set; then
3225   echo $ECHO_N "(cached) $ECHO_C" >&6
3226 else
3227
3228         cf_cv_ar_flags=unknown
3229         for cf_ar_flags in -curv curv -crv crv -cqv cqv -rv rv
3230         do
3231
3232                 # check if $ARFLAGS already contains this choice
3233                 if test "x$ARFLAGS" != "x" ; then
3234                         cf_check_ar_flags=`echo "x$ARFLAGS" | sed -e "s/$cf_ar_flags\$//" -e "s/$cf_ar_flags / /"`
3235                         if test "x$ARFLAGS" != "$cf_check_ar_flags" ; then
3236                                 cf_cv_ar_flags=
3237                                 break
3238                         fi
3239                 fi
3240
3241                 rm -f conftest.$ac_cv_objext
3242                 rm -f conftest.a
3243
3244                 cat >conftest.$ac_ext <<EOF
3245 #line 3245 "configure"
3246 int     testdata[3] = { 123, 456, 789 };
3247 EOF
3248                 if { (eval echo "$as_me:3248: \"$ac_compile\"") >&5
3249   (eval $ac_compile) 2>&5
3250   ac_status=$?
3251   echo "$as_me:3251: \$? = $ac_status" >&5
3252   (exit $ac_status); } ; then
3253                         echo "$AR $ARFLAGS $cf_ar_flags conftest.a conftest.$ac_cv_objext" >&5
3254                         $AR $ARFLAGS $cf_ar_flags conftest.a conftest.$ac_cv_objext 2>&5 1>/dev/null
3255                         if test -f conftest.a ; then
3256                                 cf_cv_ar_flags=$cf_ar_flags
3257                                 break
3258                         fi
3259                 else
3260                         test -n "$verbose" && echo "    cannot compile test-program" 1>&6
3261
3262 echo "${as_me:-configure}:3262: testing cannot compile test-program ..." 1>&5
3263
3264                         break
3265                 fi
3266         done
3267         rm -f conftest.a conftest.$ac_ext conftest.$ac_cv_objext
3268
3269 fi
3270 echo "$as_me:3270: result: $cf_cv_ar_flags" >&5
3271 echo "${ECHO_T}$cf_cv_ar_flags" >&6
3272
3273 if test -n "$ARFLAGS" ; then
3274         if test -n "$cf_cv_ar_flags" ; then
3275                 ARFLAGS="$ARFLAGS $cf_cv_ar_flags"
3276         fi
3277 else
3278         ARFLAGS=$cf_cv_ar_flags
3279 fi
3280
3281         echo "$as_me:3281: checking for PATH separator" >&5
3282 echo $ECHO_N "checking for PATH separator... $ECHO_C" >&6
3283         case $cf_cv_system_name in
3284         (os2*)  PATH_SEPARATOR=';'  ;;
3285         (*)     ${PATH_SEPARATOR:=':'}  ;;
3286         esac
3287
3288         echo "$as_me:3288: result: $PATH_SEPARATOR" >&5
3289 echo "${ECHO_T}$PATH_SEPARATOR" >&6
3290
3291 echo "$as_me:3291: checking if you have specified an install-prefix" >&5
3292 echo $ECHO_N "checking if you have specified an install-prefix... $ECHO_C" >&6
3293
3294 # Check whether --with-install-prefix or --without-install-prefix was given.
3295 if test "${with_install_prefix+set}" = set; then
3296   withval="$with_install_prefix"
3297   case "$withval" in
3298         (yes|no)
3299                 ;;
3300         (*)     DESTDIR="$withval"
3301                 ;;
3302         esac
3303 fi;
3304 echo "$as_me:3304: result: $DESTDIR" >&5
3305 echo "${ECHO_T}$DESTDIR" >&6
3306
3307 ###############################################################################
3308
3309 # If we're cross-compiling, allow the user to override the tools and their
3310 # options.  The configure script is oriented toward identifying the host
3311 # compiler, etc., but we need a build compiler to generate parts of the source.
3312
3313 if test "$cross_compiling" = yes ; then
3314
3315         # defaults that we might want to override
3316         : ${BUILD_CFLAGS:=''}
3317         : ${BUILD_CPPFLAGS:=''}
3318         : ${BUILD_LDFLAGS:=''}
3319         : ${BUILD_LIBS:=''}
3320         : ${BUILD_EXEEXT:='$x'}
3321         : ${BUILD_OBJEXT:='o'}
3322
3323 # Check whether --with-build-cc or --without-build-cc was given.
3324 if test "${with_build_cc+set}" = set; then
3325   withval="$with_build_cc"
3326   BUILD_CC="$withval"
3327 else
3328   for ac_prog in gcc cc cl
3329 do
3330   # Extract the first word of "$ac_prog", so it can be a program name with args.
3331 set dummy $ac_prog; ac_word=$2
3332 echo "$as_me:3332: checking for $ac_word" >&5
3333 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3334 if test "${ac_cv_prog_BUILD_CC+set}" = set; then
3335   echo $ECHO_N "(cached) $ECHO_C" >&6
3336 else
3337   if test -n "$BUILD_CC"; then
3338   ac_cv_prog_BUILD_CC="$BUILD_CC" # Let the user override the test.
3339 else
3340   ac_save_IFS=$IFS; IFS=$ac_path_separator
3341 ac_dummy="$PATH"
3342 for ac_dir in $ac_dummy; do
3343   IFS=$ac_save_IFS
3344   test -z "$ac_dir" && ac_dir=.
3345   $as_executable_p "$ac_dir/$ac_word" || continue
3346 ac_cv_prog_BUILD_CC="$ac_prog"
3347 echo "$as_me:3347: found $ac_dir/$ac_word" >&5
3348 break
3349 done
3350
3351 fi
3352 fi
3353 BUILD_CC=$ac_cv_prog_BUILD_CC
3354 if test -n "$BUILD_CC"; then
3355   echo "$as_me:3355: result: $BUILD_CC" >&5
3356 echo "${ECHO_T}$BUILD_CC" >&6
3357 else
3358   echo "$as_me:3358: result: no" >&5
3359 echo "${ECHO_T}no" >&6
3360 fi
3361
3362   test -n "$BUILD_CC" && break
3363 done
3364
3365 fi;
3366         echo "$as_me:3366: checking for native build C compiler" >&5
3367 echo $ECHO_N "checking for native build C compiler... $ECHO_C" >&6
3368         echo "$as_me:3368: result: $BUILD_CC" >&5
3369 echo "${ECHO_T}$BUILD_CC" >&6
3370
3371         echo "$as_me:3371: checking for native build C preprocessor" >&5
3372 echo $ECHO_N "checking for native build C preprocessor... $ECHO_C" >&6
3373
3374 # Check whether --with-build-cpp or --without-build-cpp was given.
3375 if test "${with_build_cpp+set}" = set; then
3376   withval="$with_build_cpp"
3377   BUILD_CPP="$withval"
3378 else
3379   BUILD_CPP='${BUILD_CC} -E'
3380 fi;
3381         echo "$as_me:3381: result: $BUILD_CPP" >&5
3382 echo "${ECHO_T}$BUILD_CPP" >&6
3383
3384         echo "$as_me:3384: checking for native build C flags" >&5
3385 echo $ECHO_N "checking for native build C flags... $ECHO_C" >&6
3386
3387 # Check whether --with-build-cflags or --without-build-cflags was given.
3388 if test "${with_build_cflags+set}" = set; then
3389   withval="$with_build_cflags"
3390   BUILD_CFLAGS="$withval"
3391 fi;
3392         echo "$as_me:3392: result: $BUILD_CFLAGS" >&5
3393 echo "${ECHO_T}$BUILD_CFLAGS" >&6
3394
3395         echo "$as_me:3395: checking for native build C preprocessor-flags" >&5
3396 echo $ECHO_N "checking for native build C preprocessor-flags... $ECHO_C" >&6
3397
3398 # Check whether --with-build-cppflags or --without-build-cppflags was given.
3399 if test "${with_build_cppflags+set}" = set; then
3400   withval="$with_build_cppflags"
3401   BUILD_CPPFLAGS="$withval"
3402 fi;
3403         echo "$as_me:3403: result: $BUILD_CPPFLAGS" >&5
3404 echo "${ECHO_T}$BUILD_CPPFLAGS" >&6
3405
3406         echo "$as_me:3406: checking for native build linker-flags" >&5
3407 echo $ECHO_N "checking for native build linker-flags... $ECHO_C" >&6
3408
3409 # Check whether --with-build-ldflags or --without-build-ldflags was given.
3410 if test "${with_build_ldflags+set}" = set; then
3411   withval="$with_build_ldflags"
3412   BUILD_LDFLAGS="$withval"
3413 fi;
3414         echo "$as_me:3414: result: $BUILD_LDFLAGS" >&5
3415 echo "${ECHO_T}$BUILD_LDFLAGS" >&6
3416
3417         echo "$as_me:3417: checking for native build linker-libraries" >&5
3418 echo $ECHO_N "checking for native build linker-libraries... $ECHO_C" >&6
3419
3420 # Check whether --with-build-libs or --without-build-libs was given.
3421 if test "${with_build_libs+set}" = set; then
3422   withval="$with_build_libs"
3423   BUILD_LIBS="$withval"
3424 fi;
3425         echo "$as_me:3425: result: $BUILD_LIBS" >&5
3426 echo "${ECHO_T}$BUILD_LIBS" >&6
3427
3428         # this assumes we're on Unix.
3429         BUILD_EXEEXT=
3430         BUILD_OBJEXT=o
3431
3432         : ${BUILD_CC:='${CC}'}
3433
3434         if ( test "$BUILD_CC" = "$CC" || test "$BUILD_CC" = '${CC}' ) ; then
3435                 { { echo "$as_me:3435: error: Cross-build requires two compilers.
3436 Use --with-build-cc to specify the native compiler." >&5
3437 echo "$as_me: error: Cross-build requires two compilers.
3438 Use --with-build-cc to specify the native compiler." >&2;}
3439    { (exit 1); exit 1; }; }
3440         fi
3441
3442 else
3443         : ${BUILD_CC:='${CC}'}
3444         : ${BUILD_CPP:='${CPP}'}
3445         : ${BUILD_CFLAGS:='${CFLAGS}'}
3446         : ${BUILD_CPPFLAGS:='${CPPFLAGS}'}
3447         : ${BUILD_LDFLAGS:='${LDFLAGS}'}
3448         : ${BUILD_LIBS:='${LIBS}'}
3449         : ${BUILD_EXEEXT:='$x'}
3450         : ${BUILD_OBJEXT:='o'}
3451 fi
3452
3453 ###############################################################################
3454
3455 ### Options to allow the user to specify the set of libraries which are used.
3456 ### Use "--without-normal --with-shared" to allow the default model to be
3457 ### shared, for example.
3458 cf_list_models=""
3459
3460 echo "$as_me:3460: checking if you want to build shared C-objects" >&5
3461 echo $ECHO_N "checking if you want to build shared C-objects... $ECHO_C" >&6
3462
3463 # Check whether --with-shared or --without-shared was given.
3464 if test "${with_shared+set}" = set; then
3465   withval="$with_shared"
3466   with_shared=$withval
3467 else
3468   with_shared=no
3469 fi;
3470 echo "$as_me:3470: result: $with_shared" >&5
3471 echo "${ECHO_T}$with_shared" >&6
3472 test "$with_shared" = "yes" && cf_list_models="$cf_list_models shared"
3473
3474 echo "$as_me:3474: checking for specified models" >&5
3475 echo $ECHO_N "checking for specified models... $ECHO_C" >&6
3476 test -z "$cf_list_models" && cf_list_models=normal
3477 echo "$as_me:3477: result: $cf_list_models" >&5
3478 echo "${ECHO_T}$cf_list_models" >&6
3479
3480 ### Use the first model as the default, and save its suffix for use in building
3481 ### up test-applications.
3482 echo "$as_me:3482: checking for default model" >&5
3483 echo $ECHO_N "checking for default model... $ECHO_C" >&6
3484 DFT_LWR_MODEL=`echo "$cf_list_models" | $AWK '{print $1}'`
3485 echo "$as_me:3485: result: $DFT_LWR_MODEL" >&5
3486 echo "${ECHO_T}$DFT_LWR_MODEL" >&6
3487
3488 DFT_UPR_MODEL=`echo "$DFT_LWR_MODEL" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
3489
3490 echo "$as_me:3490: checking for specific curses-directory" >&5
3491 echo $ECHO_N "checking for specific curses-directory... $ECHO_C" >&6
3492
3493 # Check whether --with-curses-dir or --without-curses-dir was given.
3494 if test "${with_curses_dir+set}" = set; then
3495   withval="$with_curses_dir"
3496   cf_cv_curses_dir=$withval
3497 else
3498   cf_cv_curses_dir=no
3499 fi;
3500 echo "$as_me:3500: result: $cf_cv_curses_dir" >&5
3501 echo "${ECHO_T}$cf_cv_curses_dir" >&6
3502
3503 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
3504 then
3505
3506 if test "x$prefix" != xNONE; then
3507         cf_path_syntax="$prefix"
3508 else
3509         cf_path_syntax="$ac_default_prefix"
3510 fi
3511
3512 case ".$withval" in
3513 (.\$\(*\)*|.\'*\'*)
3514         ;;
3515 (..|./*|.\\*)
3516         ;;
3517 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
3518         ;;
3519 (.\${*prefix}*|.\${*dir}*)
3520         eval withval="$withval"
3521         case ".$withval" in
3522         (.NONE/*)
3523                 withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
3524                 ;;
3525         esac
3526         ;;
3527 (.no|.NONE/*)
3528         withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
3529         ;;
3530 (*)
3531         { { echo "$as_me:3531: error: expected a pathname, not \"$withval\"" >&5
3532 echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;}
3533    { (exit 1); exit 1; }; }
3534         ;;
3535 esac
3536
3537         if test -d "$cf_cv_curses_dir"
3538         then
3539
3540 if test -n "$cf_cv_curses_dir/include" ; then
3541   for cf_add_incdir in $cf_cv_curses_dir/include
3542   do
3543         while test $cf_add_incdir != /usr/include
3544         do
3545           if test -d $cf_add_incdir
3546           then
3547                 cf_have_incdir=no
3548                 if test -n "$CFLAGS$CPPFLAGS" ; then
3549                   # a loop is needed to ensure we can add subdirs of existing dirs
3550                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
3551                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
3552                           cf_have_incdir=yes; break
3553                         fi
3554                   done
3555                 fi
3556
3557                 if test "$cf_have_incdir" = no ; then
3558                   if test "$cf_add_incdir" = /usr/local/include ; then
3559                         if test "$GCC" = yes
3560                         then
3561                           cf_save_CPPFLAGS=$CPPFLAGS
3562                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
3563                           cat >conftest.$ac_ext <<_ACEOF
3564 #line 3564 "configure"
3565 #include "confdefs.h"
3566 #include <stdio.h>
3567 int
3568 main ()
3569 {
3570 printf("Hello")
3571   ;
3572   return 0;
3573 }
3574 _ACEOF
3575 rm -f conftest.$ac_objext
3576 if { (eval echo "$as_me:3576: \"$ac_compile\"") >&5
3577   (eval $ac_compile) 2>&5
3578   ac_status=$?
3579   echo "$as_me:3579: \$? = $ac_status" >&5
3580   (exit $ac_status); } &&
3581          { ac_try='test -s conftest.$ac_objext'
3582   { (eval echo "$as_me:3582: \"$ac_try\"") >&5
3583   (eval $ac_try) 2>&5
3584   ac_status=$?
3585   echo "$as_me:3585: \$? = $ac_status" >&5
3586   (exit $ac_status); }; }; then
3587   :
3588 else
3589   echo "$as_me: failed program was:" >&5
3590 cat conftest.$ac_ext >&5
3591 cf_have_incdir=yes
3592 fi
3593 rm -f conftest.$ac_objext conftest.$ac_ext
3594                           CPPFLAGS=$cf_save_CPPFLAGS
3595                         fi
3596                   fi
3597                 fi
3598
3599                 if test "$cf_have_incdir" = no ; then
3600                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
3601
3602 echo "${as_me:-configure}:3602: testing adding $cf_add_incdir to include-path ..." 1>&5
3603
3604                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
3605
3606                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
3607                   test "$cf_top_incdir" = "$cf_add_incdir" && break
3608                   cf_add_incdir="$cf_top_incdir"
3609                 else
3610                   break
3611                 fi
3612           else
3613                 break
3614           fi
3615         done
3616   done
3617 fi
3618
3619 if test -n "$cf_cv_curses_dir/lib" ; then
3620         for cf_add_libdir in $cf_cv_curses_dir/lib
3621         do
3622                 if test $cf_add_libdir = /usr/lib ; then
3623                         :
3624                 elif test -d $cf_add_libdir
3625                 then
3626                         cf_have_libdir=no
3627                         if test -n "$LDFLAGS$LIBS" ; then
3628                                 # a loop is needed to ensure we can add subdirs of existing dirs
3629                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
3630                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
3631                                                 cf_have_libdir=yes; break
3632                                         fi
3633                                 done
3634                         fi
3635                         if test "$cf_have_libdir" = no ; then
3636                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
3637
3638 echo "${as_me:-configure}:3638: testing adding $cf_add_libdir to library-path ..." 1>&5
3639
3640                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
3641                         fi
3642                 fi
3643         done
3644 fi
3645
3646         fi
3647 fi
3648
3649 cf_ncuconfig_root=ncurses
3650 cf_have_ncuconfig=no
3651
3652 if test "x$PKG_CONFIG" != xnone; then
3653         echo "$as_me:3653: checking pkg-config for $cf_ncuconfig_root" >&5
3654 echo $ECHO_N "checking pkg-config for $cf_ncuconfig_root... $ECHO_C" >&6
3655         if "$PKG_CONFIG" --exists $cf_ncuconfig_root ; then
3656                 echo "$as_me:3656: result: yes" >&5
3657 echo "${ECHO_T}yes" >&6
3658
3659                 echo "$as_me:3659: checking if the $cf_ncuconfig_root package files work" >&5
3660 echo $ECHO_N "checking if the $cf_ncuconfig_root package files work... $ECHO_C" >&6
3661                 cf_have_ncuconfig=unknown
3662
3663                 cf_save_CPPFLAGS="$CPPFLAGS"
3664                 cf_save_LIBS="$LIBS"
3665
3666                 CPPFLAGS="$CPPFLAGS `$PKG_CONFIG --cflags $cf_ncuconfig_root`"
3667
3668 cf_add_libs="`$PKG_CONFIG --libs $cf_ncuconfig_root`"
3669 # Filter out duplicates - this happens with badly-designed ".pc" files...
3670 for cf_add_1lib in $LIBS
3671 do
3672         for cf_add_2lib in $cf_add_libs
3673         do
3674                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
3675                 then
3676                         cf_add_1lib=
3677                         break
3678                 fi
3679         done
3680         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
3681 done
3682 LIBS="$cf_add_libs"
3683
3684                 cat >conftest.$ac_ext <<_ACEOF
3685 #line 3685 "configure"
3686 #include "confdefs.h"
3687 #include <${cf_cv_ncurses_header:-curses.h}>
3688 int
3689 main ()
3690 {
3691 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
3692   ;
3693   return 0;
3694 }
3695 _ACEOF
3696 rm -f conftest.$ac_objext conftest$ac_exeext
3697 if { (eval echo "$as_me:3697: \"$ac_link\"") >&5
3698   (eval $ac_link) 2>&5
3699   ac_status=$?
3700   echo "$as_me:3700: \$? = $ac_status" >&5
3701   (exit $ac_status); } &&
3702          { ac_try='test -s conftest$ac_exeext'
3703   { (eval echo "$as_me:3703: \"$ac_try\"") >&5
3704   (eval $ac_try) 2>&5
3705   ac_status=$?
3706   echo "$as_me:3706: \$? = $ac_status" >&5
3707   (exit $ac_status); }; }; then
3708   if test "$cross_compiling" = yes; then
3709   cf_have_ncuconfig=unknown
3710 else
3711   cat >conftest.$ac_ext <<_ACEOF
3712 #line 3712 "configure"
3713 #include "confdefs.h"
3714 #include <${cf_cv_ncurses_header:-curses.h}>
3715                                 int main(void)
3716                                 { char *xx = curses_version(); return (xx == 0); }
3717 _ACEOF
3718 rm -f conftest$ac_exeext
3719 if { (eval echo "$as_me:3719: \"$ac_link\"") >&5
3720   (eval $ac_link) 2>&5
3721   ac_status=$?
3722   echo "$as_me:3722: \$? = $ac_status" >&5
3723   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
3724   { (eval echo "$as_me:3724: \"$ac_try\"") >&5
3725   (eval $ac_try) 2>&5
3726   ac_status=$?
3727   echo "$as_me:3727: \$? = $ac_status" >&5
3728   (exit $ac_status); }; }; then
3729   cf_have_ncuconfig=yes
3730 else
3731   echo "$as_me: program exited with status $ac_status" >&5
3732 echo "$as_me: failed program was:" >&5
3733 cat conftest.$ac_ext >&5
3734 cf_have_ncuconfig=no
3735 fi
3736 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
3737 fi
3738 else
3739   echo "$as_me: failed program was:" >&5
3740 cat conftest.$ac_ext >&5
3741 cf_have_ncuconfig=no
3742 fi
3743 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
3744
3745                 echo "$as_me:3745: result: $cf_have_ncuconfig" >&5
3746 echo "${ECHO_T}$cf_have_ncuconfig" >&6
3747                 if test "$cf_have_ncuconfig" != "yes"
3748                 then
3749                         CPPFLAGS="$cf_save_CPPFLAGS"
3750                         LIBS="$cf_save_LIBS"
3751                         NCURSES_CONFIG_PKG=none
3752                 else
3753
3754 cat >>confdefs.h <<\EOF
3755 #define NCURSES 1
3756 EOF
3757
3758                         NCURSES_CONFIG_PKG=$cf_ncuconfig_root
3759                 fi
3760
3761         else
3762                 echo "$as_me:3762: result: no" >&5
3763 echo "${ECHO_T}no" >&6
3764                 NCURSES_CONFIG_PKG=none
3765         fi
3766 else
3767         NCURSES_CONFIG_PKG=none
3768 fi
3769
3770 if test "x$cf_have_ncuconfig" = "xno"; then
3771         echo "Looking for ${cf_ncuconfig_root}-config"
3772
3773 if test -n "$ac_tool_prefix"; then
3774   for ac_prog in ${cf_ncuconfig_root}-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
3775   do
3776     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
3777 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
3778 echo "$as_me:3778: checking for $ac_word" >&5
3779 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3780 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
3781   echo $ECHO_N "(cached) $ECHO_C" >&6
3782 else
3783   if test -n "$NCURSES_CONFIG"; then
3784   ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
3785 else
3786   ac_save_IFS=$IFS; IFS=$ac_path_separator
3787 ac_dummy="$PATH"
3788 for ac_dir in $ac_dummy; do
3789   IFS=$ac_save_IFS
3790   test -z "$ac_dir" && ac_dir=.
3791   $as_executable_p "$ac_dir/$ac_word" || continue
3792 ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
3793 echo "$as_me:3793: found $ac_dir/$ac_word" >&5
3794 break
3795 done
3796
3797 fi
3798 fi
3799 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
3800 if test -n "$NCURSES_CONFIG"; then
3801   echo "$as_me:3801: result: $NCURSES_CONFIG" >&5
3802 echo "${ECHO_T}$NCURSES_CONFIG" >&6
3803 else
3804   echo "$as_me:3804: result: no" >&5
3805 echo "${ECHO_T}no" >&6
3806 fi
3807
3808     test -n "$NCURSES_CONFIG" && break
3809   done
3810 fi
3811 if test -z "$NCURSES_CONFIG"; then
3812   ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
3813   for ac_prog in ${cf_ncuconfig_root}-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
3814 do
3815   # Extract the first word of "$ac_prog", so it can be a program name with args.
3816 set dummy $ac_prog; ac_word=$2
3817 echo "$as_me:3817: checking for $ac_word" >&5
3818 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3819 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
3820   echo $ECHO_N "(cached) $ECHO_C" >&6
3821 else
3822   if test -n "$ac_ct_NCURSES_CONFIG"; then
3823   ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
3824 else
3825   ac_save_IFS=$IFS; IFS=$ac_path_separator
3826 ac_dummy="$PATH"
3827 for ac_dir in $ac_dummy; do
3828   IFS=$ac_save_IFS
3829   test -z "$ac_dir" && ac_dir=.
3830   $as_executable_p "$ac_dir/$ac_word" || continue
3831 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
3832 echo "$as_me:3832: found $ac_dir/$ac_word" >&5
3833 break
3834 done
3835
3836 fi
3837 fi
3838 ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
3839 if test -n "$ac_ct_NCURSES_CONFIG"; then
3840   echo "$as_me:3840: result: $ac_ct_NCURSES_CONFIG" >&5
3841 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
3842 else
3843   echo "$as_me:3843: result: no" >&5
3844 echo "${ECHO_T}no" >&6
3845 fi
3846
3847   test -n "$ac_ct_NCURSES_CONFIG" && break
3848 done
3849 test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
3850
3851   NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
3852 fi
3853
3854         if test "$NCURSES_CONFIG" != none ; then
3855
3856                 CPPFLAGS="$CPPFLAGS `$NCURSES_CONFIG --cflags`"
3857
3858 cf_add_libs="`$NCURSES_CONFIG --libs`"
3859 # Filter out duplicates - this happens with badly-designed ".pc" files...
3860 for cf_add_1lib in $LIBS
3861 do
3862         for cf_add_2lib in $cf_add_libs
3863         do
3864                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
3865                 then
3866                         cf_add_1lib=
3867                         break
3868                 fi
3869         done
3870         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
3871 done
3872 LIBS="$cf_add_libs"
3873
3874                 # even with config script, some packages use no-override for curses.h
3875
3876 echo "$as_me:3876: checking if we have identified curses headers" >&5
3877 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
3878 if test "${cf_cv_ncurses_header+set}" = set; then
3879   echo $ECHO_N "(cached) $ECHO_C" >&6
3880 else
3881
3882 cf_cv_ncurses_header=none
3883 for cf_header in \
3884         ncurses.h ncurses/ncurses.h \
3885         curses.h ncurses/curses.h
3886 do
3887 cat >conftest.$ac_ext <<_ACEOF
3888 #line 3888 "configure"
3889 #include "confdefs.h"
3890 #include <${cf_header}>
3891 int
3892 main ()
3893 {
3894 initscr(); tgoto("?", 0,0)
3895   ;
3896   return 0;
3897 }
3898 _ACEOF
3899 rm -f conftest.$ac_objext
3900 if { (eval echo "$as_me:3900: \"$ac_compile\"") >&5
3901   (eval $ac_compile) 2>&5
3902   ac_status=$?
3903   echo "$as_me:3903: \$? = $ac_status" >&5
3904   (exit $ac_status); } &&
3905          { ac_try='test -s conftest.$ac_objext'
3906   { (eval echo "$as_me:3906: \"$ac_try\"") >&5
3907   (eval $ac_try) 2>&5
3908   ac_status=$?
3909   echo "$as_me:3909: \$? = $ac_status" >&5
3910   (exit $ac_status); }; }; then
3911   cf_cv_ncurses_header=$cf_header; break
3912 else
3913   echo "$as_me: failed program was:" >&5
3914 cat conftest.$ac_ext >&5
3915 fi
3916 rm -f conftest.$ac_objext conftest.$ac_ext
3917 done
3918
3919 fi
3920 echo "$as_me:3920: result: $cf_cv_ncurses_header" >&5
3921 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
3922
3923 if test "$cf_cv_ncurses_header" = none ; then
3924         { { echo "$as_me:3924: error: No curses header-files found" >&5
3925 echo "$as_me: error: No curses header-files found" >&2;}
3926    { (exit 1); exit 1; }; }
3927 fi
3928
3929 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
3930
3931 for ac_header in $cf_cv_ncurses_header
3932 do
3933 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
3934 echo "$as_me:3934: checking for $ac_header" >&5
3935 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
3936 if eval "test \"\${$as_ac_Header+set}\" = set"; then
3937   echo $ECHO_N "(cached) $ECHO_C" >&6
3938 else
3939   cat >conftest.$ac_ext <<_ACEOF
3940 #line 3940 "configure"
3941 #include "confdefs.h"
3942 #include <$ac_header>
3943 _ACEOF
3944 if { (eval echo "$as_me:3944: \"$ac_cpp conftest.$ac_ext\"") >&5
3945   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
3946   ac_status=$?
3947   egrep -v '^ *\+' conftest.er1 >conftest.err
3948   rm -f conftest.er1
3949   cat conftest.err >&5
3950   echo "$as_me:3950: \$? = $ac_status" >&5
3951   (exit $ac_status); } >/dev/null; then
3952   if test -s conftest.err; then
3953     ac_cpp_err=$ac_c_preproc_warn_flag
3954   else
3955     ac_cpp_err=
3956   fi
3957 else
3958   ac_cpp_err=yes
3959 fi
3960 if test -z "$ac_cpp_err"; then
3961   eval "$as_ac_Header=yes"
3962 else
3963   echo "$as_me: failed program was:" >&5
3964   cat conftest.$ac_ext >&5
3965   eval "$as_ac_Header=no"
3966 fi
3967 rm -f conftest.err conftest.$ac_ext
3968 fi
3969 echo "$as_me:3969: result: `eval echo '${'$as_ac_Header'}'`" >&5
3970 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
3971 if test `eval echo '${'$as_ac_Header'}'` = yes; then
3972   cat >>confdefs.h <<EOF
3973 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
3974 EOF
3975
3976 fi
3977 done
3978
3979 cat >>confdefs.h <<\EOF
3980 #define NCURSES 1
3981 EOF
3982
3983 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
3984
3985                 cat >>confdefs.h <<EOF
3986 #define $cf_nculib_ROOT 1
3987 EOF
3988
3989                                 cf_cv_ncurses_version=`$NCURSES_CONFIG --version`
3990
3991         else
3992
3993 cf_ncuhdr_root=ncurses
3994
3995 test -n "$cf_cv_curses_dir" && \
3996 test "$cf_cv_curses_dir" != "no" && { \
3997
3998 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
3999   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
4000   do
4001         while test $cf_add_incdir != /usr/include
4002         do
4003           if test -d $cf_add_incdir
4004           then
4005                 cf_have_incdir=no
4006                 if test -n "$CFLAGS$CPPFLAGS" ; then
4007                   # a loop is needed to ensure we can add subdirs of existing dirs
4008                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
4009                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
4010                           cf_have_incdir=yes; break
4011                         fi
4012                   done
4013                 fi
4014
4015                 if test "$cf_have_incdir" = no ; then
4016                   if test "$cf_add_incdir" = /usr/local/include ; then
4017                         if test "$GCC" = yes
4018                         then
4019                           cf_save_CPPFLAGS=$CPPFLAGS
4020                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
4021                           cat >conftest.$ac_ext <<_ACEOF
4022 #line 4022 "configure"
4023 #include "confdefs.h"
4024 #include <stdio.h>
4025 int
4026 main ()
4027 {
4028 printf("Hello")
4029   ;
4030   return 0;
4031 }
4032 _ACEOF
4033 rm -f conftest.$ac_objext
4034 if { (eval echo "$as_me:4034: \"$ac_compile\"") >&5
4035   (eval $ac_compile) 2>&5
4036   ac_status=$?
4037   echo "$as_me:4037: \$? = $ac_status" >&5
4038   (exit $ac_status); } &&
4039          { ac_try='test -s conftest.$ac_objext'
4040   { (eval echo "$as_me:4040: \"$ac_try\"") >&5
4041   (eval $ac_try) 2>&5
4042   ac_status=$?
4043   echo "$as_me:4043: \$? = $ac_status" >&5
4044   (exit $ac_status); }; }; then
4045   :
4046 else
4047   echo "$as_me: failed program was:" >&5
4048 cat conftest.$ac_ext >&5
4049 cf_have_incdir=yes
4050 fi
4051 rm -f conftest.$ac_objext conftest.$ac_ext
4052                           CPPFLAGS=$cf_save_CPPFLAGS
4053                         fi
4054                   fi
4055                 fi
4056
4057                 if test "$cf_have_incdir" = no ; then
4058                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
4059
4060 echo "${as_me:-configure}:4060: testing adding $cf_add_incdir to include-path ..." 1>&5
4061
4062                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
4063
4064                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
4065                   test "$cf_top_incdir" = "$cf_add_incdir" && break
4066                   cf_add_incdir="$cf_top_incdir"
4067                 else
4068                   break
4069                 fi
4070           else
4071                 break
4072           fi
4073         done
4074   done
4075 fi
4076
4077 }
4078
4079 echo "$as_me:4079: checking for $cf_ncuhdr_root header in include-path" >&5
4080 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
4081 if test "${cf_cv_ncurses_h+set}" = set; then
4082   echo $ECHO_N "(cached) $ECHO_C" >&6
4083 else
4084
4085         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
4086         ( test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw ) && cf_header_list="$cf_header_list curses.h ncurses.h"
4087         for cf_header in $cf_header_list
4088         do
4089
4090         cat >conftest.$ac_ext <<_ACEOF
4091 #line 4091 "configure"
4092 #include "confdefs.h"
4093
4094 #include <$cf_header>
4095 int
4096 main ()
4097 {
4098
4099 #ifdef NCURSES_VERSION
4100
4101 printf("%s\n", NCURSES_VERSION);
4102 #else
4103 #ifdef __NCURSES_H
4104 printf("old\n");
4105 #else
4106         make an error
4107 #endif
4108 #endif
4109
4110   ;
4111   return 0;
4112 }
4113 _ACEOF
4114 rm -f conftest.$ac_objext
4115 if { (eval echo "$as_me:4115: \"$ac_compile\"") >&5
4116   (eval $ac_compile) 2>&5
4117   ac_status=$?
4118   echo "$as_me:4118: \$? = $ac_status" >&5
4119   (exit $ac_status); } &&
4120          { ac_try='test -s conftest.$ac_objext'
4121   { (eval echo "$as_me:4121: \"$ac_try\"") >&5
4122   (eval $ac_try) 2>&5
4123   ac_status=$?
4124   echo "$as_me:4124: \$? = $ac_status" >&5
4125   (exit $ac_status); }; }; then
4126   cf_cv_ncurses_h=$cf_header
4127
4128 else
4129   echo "$as_me: failed program was:" >&5
4130 cat conftest.$ac_ext >&5
4131 cf_cv_ncurses_h=no
4132 fi
4133 rm -f conftest.$ac_objext conftest.$ac_ext
4134
4135                 test "$cf_cv_ncurses_h" != no && break
4136         done
4137
4138 fi
4139 echo "$as_me:4139: result: $cf_cv_ncurses_h" >&5
4140 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
4141
4142 if test "$cf_cv_ncurses_h" != no ; then
4143         cf_cv_ncurses_header=$cf_cv_ncurses_h
4144 else
4145
4146 echo "$as_me:4146: checking for $cf_ncuhdr_root include-path" >&5
4147 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
4148 if test "${cf_cv_ncurses_h2+set}" = set; then
4149   echo $ECHO_N "(cached) $ECHO_C" >&6
4150 else
4151
4152         test -n "$verbose" && echo
4153
4154 cf_search=
4155
4156 # collect the current set of include-directories from compiler flags
4157 cf_header_path_list=""
4158 if test -n "${CFLAGS}${CPPFLAGS}" ; then
4159         for cf_header_path in $CPPFLAGS $CFLAGS
4160         do
4161                 case $cf_header_path in
4162                 (-I*)
4163                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
4164
4165 test "x$cf_header_path" != "xNONE" && \
4166 test -d "$cf_header_path" && \
4167  {
4168         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
4169         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
4170         test -d $cf_header_path/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
4171         test -d $cf_header_path/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
4172         test -d $cf_header_path/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
4173         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"
4174 }
4175
4176                         cf_header_path_list="$cf_header_path_list $cf_search"
4177                         ;;
4178                 esac
4179         done
4180 fi
4181
4182 # add the variations for the package we are looking for
4183
4184 cf_search=
4185
4186 test "x$prefix" != "xNONE" && \
4187 test -d "$prefix" && \
4188  {
4189         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
4190         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
4191         test -d $prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
4192         test -d $prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
4193         test -d $prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
4194         test -d $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
4195 }
4196
4197 for cf_subdir_prefix in \
4198         /usr \
4199         /usr/local \
4200         /usr/pkg \
4201         /opt \
4202         /opt/local \
4203         $HOME
4204 do
4205
4206 test "x$cf_subdir_prefix" != "x$prefix" && \
4207 test -d "$cf_subdir_prefix" && \
4208 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
4209         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
4210         test -d $cf_subdir_prefix/include &&          cf_search="$cf_search $cf_subdir_prefix/include"
4211         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root"
4212         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root/include"
4213         test -d $cf_subdir_prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include"
4214         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"
4215 }
4216
4217 done
4218
4219 test "$includedir" != NONE && \
4220 test "$includedir" != "/usr/include" && \
4221 test -d "$includedir" && {
4222         test -d $includedir &&    cf_search="$cf_search $includedir"
4223         test -d $includedir/$cf_ncuhdr_root && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
4224 }
4225
4226 test "$oldincludedir" != NONE && \
4227 test "$oldincludedir" != "/usr/include" && \
4228 test -d "$oldincludedir" && {
4229         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
4230         test -d $oldincludedir/$cf_ncuhdr_root && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
4231 }
4232
4233 cf_search="$cf_search $cf_header_path_list"
4234
4235         test -n "$verbose" && echo search path $cf_search
4236         cf_save2_CPPFLAGS="$CPPFLAGS"
4237         for cf_incdir in $cf_search
4238         do
4239
4240 if test -n "$cf_incdir" ; then
4241   for cf_add_incdir in $cf_incdir
4242   do
4243         while test $cf_add_incdir != /usr/include
4244         do
4245           if test -d $cf_add_incdir
4246           then
4247                 cf_have_incdir=no
4248                 if test -n "$CFLAGS$CPPFLAGS" ; then
4249                   # a loop is needed to ensure we can add subdirs of existing dirs
4250                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
4251                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
4252                           cf_have_incdir=yes; break
4253                         fi
4254                   done
4255                 fi
4256
4257                 if test "$cf_have_incdir" = no ; then
4258                   if test "$cf_add_incdir" = /usr/local/include ; then
4259                         if test "$GCC" = yes
4260                         then
4261                           cf_save_CPPFLAGS=$CPPFLAGS
4262                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
4263                           cat >conftest.$ac_ext <<_ACEOF
4264 #line 4264 "configure"
4265 #include "confdefs.h"
4266 #include <stdio.h>
4267 int
4268 main ()
4269 {
4270 printf("Hello")
4271   ;
4272   return 0;
4273 }
4274 _ACEOF
4275 rm -f conftest.$ac_objext
4276 if { (eval echo "$as_me:4276: \"$ac_compile\"") >&5
4277   (eval $ac_compile) 2>&5
4278   ac_status=$?
4279   echo "$as_me:4279: \$? = $ac_status" >&5
4280   (exit $ac_status); } &&
4281          { ac_try='test -s conftest.$ac_objext'
4282   { (eval echo "$as_me:4282: \"$ac_try\"") >&5
4283   (eval $ac_try) 2>&5
4284   ac_status=$?
4285   echo "$as_me:4285: \$? = $ac_status" >&5
4286   (exit $ac_status); }; }; then
4287   :
4288 else
4289   echo "$as_me: failed program was:" >&5
4290 cat conftest.$ac_ext >&5
4291 cf_have_incdir=yes
4292 fi
4293 rm -f conftest.$ac_objext conftest.$ac_ext
4294                           CPPFLAGS=$cf_save_CPPFLAGS
4295                         fi
4296                   fi
4297                 fi
4298
4299                 if test "$cf_have_incdir" = no ; then
4300                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
4301
4302 echo "${as_me:-configure}:4302: testing adding $cf_add_incdir to include-path ..." 1>&5
4303
4304                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
4305
4306                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
4307                   test "$cf_top_incdir" = "$cf_add_incdir" && break
4308                   cf_add_incdir="$cf_top_incdir"
4309                 else
4310                   break
4311                 fi
4312           else
4313                 break
4314           fi
4315         done
4316   done
4317 fi
4318
4319                 for cf_header in \
4320                         ncurses.h \
4321                         curses.h
4322                 do
4323
4324         cat >conftest.$ac_ext <<_ACEOF
4325 #line 4325 "configure"
4326 #include "confdefs.h"
4327
4328 #include <$cf_header>
4329 int
4330 main ()
4331 {
4332
4333 #ifdef NCURSES_VERSION
4334
4335 printf("%s\n", NCURSES_VERSION);
4336 #else
4337 #ifdef __NCURSES_H
4338 printf("old\n");
4339 #else
4340         make an error
4341 #endif
4342 #endif
4343
4344   ;
4345   return 0;
4346 }
4347 _ACEOF
4348 rm -f conftest.$ac_objext
4349 if { (eval echo "$as_me:4349: \"$ac_compile\"") >&5
4350   (eval $ac_compile) 2>&5
4351   ac_status=$?
4352   echo "$as_me:4352: \$? = $ac_status" >&5
4353   (exit $ac_status); } &&
4354          { ac_try='test -s conftest.$ac_objext'
4355   { (eval echo "$as_me:4355: \"$ac_try\"") >&5
4356   (eval $ac_try) 2>&5
4357   ac_status=$?
4358   echo "$as_me:4358: \$? = $ac_status" >&5
4359   (exit $ac_status); }; }; then
4360   cf_cv_ncurses_h2=$cf_header
4361
4362 else
4363   echo "$as_me: failed program was:" >&5
4364 cat conftest.$ac_ext >&5
4365 cf_cv_ncurses_h2=no
4366 fi
4367 rm -f conftest.$ac_objext conftest.$ac_ext
4368
4369                         if test "$cf_cv_ncurses_h2" != no ; then
4370                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
4371                                 test -n "$verbose" && echo $ac_n "      ... found $ac_c" 1>&6
4372                                 break
4373                         fi
4374                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
4375                 done
4376                 CPPFLAGS="$cf_save2_CPPFLAGS"
4377                 test "$cf_cv_ncurses_h2" != no && break
4378         done
4379         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:4379: error: not found" >&5
4380 echo "$as_me: error: not found" >&2;}
4381    { (exit 1); exit 1; }; }
4382
4383 fi
4384 echo "$as_me:4384: result: $cf_cv_ncurses_h2" >&5
4385 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
4386
4387         cf_1st_incdir=`echo $cf_cv_ncurses_h2 | sed -e 's%/[^/]*$%%'`
4388         cf_cv_ncurses_header=`basename $cf_cv_ncurses_h2`
4389         if test `basename $cf_1st_incdir` = $cf_ncuhdr_root ; then
4390                 cf_cv_ncurses_header=$cf_ncuhdr_root/$cf_cv_ncurses_header
4391         fi
4392
4393 if test -n "$cf_1st_incdir" ; then
4394   for cf_add_incdir in $cf_1st_incdir
4395   do
4396         while test $cf_add_incdir != /usr/include
4397         do
4398           if test -d $cf_add_incdir
4399           then
4400                 cf_have_incdir=no
4401                 if test -n "$CFLAGS$CPPFLAGS" ; then
4402                   # a loop is needed to ensure we can add subdirs of existing dirs
4403                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
4404                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
4405                           cf_have_incdir=yes; break
4406                         fi
4407                   done
4408                 fi
4409
4410                 if test "$cf_have_incdir" = no ; then
4411                   if test "$cf_add_incdir" = /usr/local/include ; then
4412                         if test "$GCC" = yes
4413                         then
4414                           cf_save_CPPFLAGS=$CPPFLAGS
4415                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
4416                           cat >conftest.$ac_ext <<_ACEOF
4417 #line 4417 "configure"
4418 #include "confdefs.h"
4419 #include <stdio.h>
4420 int
4421 main ()
4422 {
4423 printf("Hello")
4424   ;
4425   return 0;
4426 }
4427 _ACEOF
4428 rm -f conftest.$ac_objext
4429 if { (eval echo "$as_me:4429: \"$ac_compile\"") >&5
4430   (eval $ac_compile) 2>&5
4431   ac_status=$?
4432   echo "$as_me:4432: \$? = $ac_status" >&5
4433   (exit $ac_status); } &&
4434          { ac_try='test -s conftest.$ac_objext'
4435   { (eval echo "$as_me:4435: \"$ac_try\"") >&5
4436   (eval $ac_try) 2>&5
4437   ac_status=$?
4438   echo "$as_me:4438: \$? = $ac_status" >&5
4439   (exit $ac_status); }; }; then
4440   :
4441 else
4442   echo "$as_me: failed program was:" >&5
4443 cat conftest.$ac_ext >&5
4444 cf_have_incdir=yes
4445 fi
4446 rm -f conftest.$ac_objext conftest.$ac_ext
4447                           CPPFLAGS=$cf_save_CPPFLAGS
4448                         fi
4449                   fi
4450                 fi
4451
4452                 if test "$cf_have_incdir" = no ; then
4453                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
4454
4455 echo "${as_me:-configure}:4455: testing adding $cf_add_incdir to include-path ..." 1>&5
4456
4457                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
4458
4459                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
4460                   test "$cf_top_incdir" = "$cf_add_incdir" && break
4461                   cf_add_incdir="$cf_top_incdir"
4462                 else
4463                   break
4464                 fi
4465           else
4466                 break
4467           fi
4468         done
4469   done
4470 fi
4471
4472 fi
4473
4474 # Set definitions to allow ifdef'ing for ncurses.h
4475
4476 case $cf_cv_ncurses_header in
4477 (*ncurses.h)
4478
4479 cat >>confdefs.h <<\EOF
4480 #define HAVE_NCURSES_H 1
4481 EOF
4482
4483         ;;
4484 esac
4485
4486 case $cf_cv_ncurses_header in
4487 (ncurses/curses.h|ncurses/ncurses.h)
4488
4489 cat >>confdefs.h <<\EOF
4490 #define HAVE_NCURSES_NCURSES_H 1
4491 EOF
4492
4493         ;;
4494 (ncursesw/curses.h|ncursesw/ncurses.h)
4495
4496 cat >>confdefs.h <<\EOF
4497 #define HAVE_NCURSESW_NCURSES_H 1
4498 EOF
4499
4500         ;;
4501 esac
4502
4503 echo "$as_me:4503: checking for terminfo header" >&5
4504 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
4505 if test "${cf_cv_term_header+set}" = set; then
4506   echo $ECHO_N "(cached) $ECHO_C" >&6
4507 else
4508
4509 case ${cf_cv_ncurses_header} in
4510 (*/ncurses.h|*/ncursesw.h)
4511         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
4512         ;;
4513 (*)
4514         cf_term_header=term.h
4515         ;;
4516 esac
4517
4518 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
4519 do
4520 cat >conftest.$ac_ext <<_ACEOF
4521 #line 4521 "configure"
4522 #include "confdefs.h"
4523 #include <stdio.h>
4524 #include <${cf_cv_ncurses_header:-curses.h}>
4525 #include <$cf_test>
4526
4527 int
4528 main ()
4529 {
4530 int x = auto_left_margin
4531   ;
4532   return 0;
4533 }
4534 _ACEOF
4535 rm -f conftest.$ac_objext
4536 if { (eval echo "$as_me:4536: \"$ac_compile\"") >&5
4537   (eval $ac_compile) 2>&5
4538   ac_status=$?
4539   echo "$as_me:4539: \$? = $ac_status" >&5
4540   (exit $ac_status); } &&
4541          { ac_try='test -s conftest.$ac_objext'
4542   { (eval echo "$as_me:4542: \"$ac_try\"") >&5
4543   (eval $ac_try) 2>&5
4544   ac_status=$?
4545   echo "$as_me:4545: \$? = $ac_status" >&5
4546   (exit $ac_status); }; }; then
4547
4548         cf_cv_term_header="$cf_test"
4549 else
4550   echo "$as_me: failed program was:" >&5
4551 cat conftest.$ac_ext >&5
4552
4553         cf_cv_term_header=unknown
4554
4555 fi
4556 rm -f conftest.$ac_objext conftest.$ac_ext
4557         test "$cf_cv_term_header" != unknown && break
4558 done
4559
4560 fi
4561 echo "$as_me:4561: result: $cf_cv_term_header" >&5
4562 echo "${ECHO_T}$cf_cv_term_header" >&6
4563
4564 # Set definitions to allow ifdef'ing to accommodate subdirectories
4565
4566 case $cf_cv_term_header in
4567 (*term.h)
4568
4569 cat >>confdefs.h <<\EOF
4570 #define HAVE_TERM_H 1
4571 EOF
4572
4573         ;;
4574 esac
4575
4576 case $cf_cv_term_header in
4577 (ncurses/term.h)
4578
4579 cat >>confdefs.h <<\EOF
4580 #define HAVE_NCURSES_TERM_H 1
4581 EOF
4582
4583         ;;
4584 (ncursesw/term.h)
4585
4586 cat >>confdefs.h <<\EOF
4587 #define HAVE_NCURSESW_TERM_H 1
4588 EOF
4589
4590         ;;
4591 esac
4592
4593 # some applications need this, but should check for NCURSES_VERSION
4594
4595 cat >>confdefs.h <<\EOF
4596 #define NCURSES 1
4597 EOF
4598
4599 echo "$as_me:4599: checking for ncurses version" >&5
4600 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
4601 if test "${cf_cv_ncurses_version+set}" = set; then
4602   echo $ECHO_N "(cached) $ECHO_C" >&6
4603 else
4604
4605         cf_cv_ncurses_version=no
4606         cf_tempfile=out$$
4607         rm -f $cf_tempfile
4608         if test "$cross_compiling" = yes; then
4609
4610         # This will not work if the preprocessor splits the line after the
4611         # Autoconf token.  The 'unproto' program does that.
4612         cat > conftest.$ac_ext <<EOF
4613 #include <${cf_cv_ncurses_header:-curses.h}>
4614 #undef Autoconf
4615 #ifdef NCURSES_VERSION
4616 Autoconf NCURSES_VERSION
4617 #else
4618 #ifdef __NCURSES_H
4619 Autoconf "old"
4620 #endif
4621 ;
4622 #endif
4623 EOF
4624         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
4625         { (eval echo "$as_me:4625: \"$cf_try\"") >&5
4626   (eval $cf_try) 2>&5
4627   ac_status=$?
4628   echo "$as_me:4628: \$? = $ac_status" >&5
4629   (exit $ac_status); }
4630         if test -f conftest.out ; then
4631                 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
4632                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
4633                 rm -f conftest.out
4634         fi
4635
4636 else
4637   cat >conftest.$ac_ext <<_ACEOF
4638 #line 4638 "configure"
4639 #include "confdefs.h"
4640
4641 #include <${cf_cv_ncurses_header:-curses.h}>
4642 #include <stdio.h>
4643 int main()
4644 {
4645         FILE *fp = fopen("$cf_tempfile", "w");
4646 #ifdef NCURSES_VERSION
4647 # ifdef NCURSES_VERSION_PATCH
4648         fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
4649 # else
4650         fprintf(fp, "%s\n", NCURSES_VERSION);
4651 # endif
4652 #else
4653 # ifdef __NCURSES_H
4654         fprintf(fp, "old\n");
4655 # else
4656         make an error
4657 # endif
4658 #endif
4659         ${cf_cv_main_return:-return}(0);
4660 }
4661 _ACEOF
4662 rm -f conftest$ac_exeext
4663 if { (eval echo "$as_me:4663: \"$ac_link\"") >&5
4664   (eval $ac_link) 2>&5
4665   ac_status=$?
4666   echo "$as_me:4666: \$? = $ac_status" >&5
4667   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
4668   { (eval echo "$as_me:4668: \"$ac_try\"") >&5
4669   (eval $ac_try) 2>&5
4670   ac_status=$?
4671   echo "$as_me:4671: \$? = $ac_status" >&5
4672   (exit $ac_status); }; }; then
4673
4674         cf_cv_ncurses_version=`cat $cf_tempfile`
4675 else
4676   echo "$as_me: program exited with status $ac_status" >&5
4677 echo "$as_me: failed program was:" >&5
4678 cat conftest.$ac_ext >&5
4679 fi
4680 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
4681 fi
4682         rm -f $cf_tempfile
4683
4684 fi
4685 echo "$as_me:4685: result: $cf_cv_ncurses_version" >&5
4686 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
4687 test "$cf_cv_ncurses_version" = no ||
4688 cat >>confdefs.h <<\EOF
4689 #define NCURSES 1
4690 EOF
4691
4692 cf_nculib_root=ncurses
4693         # This works, except for the special case where we find gpm, but
4694         # ncurses is in a nonstandard location via $LIBS, and we really want
4695         # to link gpm.
4696 cf_ncurses_LIBS=""
4697 cf_ncurses_SAVE="$LIBS"
4698 echo "$as_me:4698: checking for Gpm_Open in -lgpm" >&5
4699 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
4700 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
4701   echo $ECHO_N "(cached) $ECHO_C" >&6
4702 else
4703   ac_check_lib_save_LIBS=$LIBS
4704 LIBS="-lgpm  $LIBS"
4705 cat >conftest.$ac_ext <<_ACEOF
4706 #line 4706 "configure"
4707 #include "confdefs.h"
4708
4709 /* Override any gcc2 internal prototype to avoid an error.  */
4710 #ifdef __cplusplus
4711 extern "C"
4712 #endif
4713 /* We use char because int might match the return type of a gcc2
4714    builtin and then its argument prototype would still apply.  */
4715 char Gpm_Open ();
4716 int
4717 main ()
4718 {
4719 Gpm_Open ();
4720   ;
4721   return 0;
4722 }
4723 _ACEOF
4724 rm -f conftest.$ac_objext conftest$ac_exeext
4725 if { (eval echo "$as_me:4725: \"$ac_link\"") >&5
4726   (eval $ac_link) 2>&5
4727   ac_status=$?
4728   echo "$as_me:4728: \$? = $ac_status" >&5
4729   (exit $ac_status); } &&
4730          { ac_try='test -s conftest$ac_exeext'
4731   { (eval echo "$as_me:4731: \"$ac_try\"") >&5
4732   (eval $ac_try) 2>&5
4733   ac_status=$?
4734   echo "$as_me:4734: \$? = $ac_status" >&5
4735   (exit $ac_status); }; }; then
4736   ac_cv_lib_gpm_Gpm_Open=yes
4737 else
4738   echo "$as_me: failed program was:" >&5
4739 cat conftest.$ac_ext >&5
4740 ac_cv_lib_gpm_Gpm_Open=no
4741 fi
4742 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
4743 LIBS=$ac_check_lib_save_LIBS
4744 fi
4745 echo "$as_me:4745: result: $ac_cv_lib_gpm_Gpm_Open" >&5
4746 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
4747 if test $ac_cv_lib_gpm_Gpm_Open = yes; then
4748   echo "$as_me:4748: checking for initscr in -lgpm" >&5
4749 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
4750 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
4751   echo $ECHO_N "(cached) $ECHO_C" >&6
4752 else
4753   ac_check_lib_save_LIBS=$LIBS
4754 LIBS="-lgpm  $LIBS"
4755 cat >conftest.$ac_ext <<_ACEOF
4756 #line 4756 "configure"
4757 #include "confdefs.h"
4758
4759 /* Override any gcc2 internal prototype to avoid an error.  */
4760 #ifdef __cplusplus
4761 extern "C"
4762 #endif
4763 /* We use char because int might match the return type of a gcc2
4764    builtin and then its argument prototype would still apply.  */
4765 char initscr ();
4766 int
4767 main ()
4768 {
4769 initscr ();
4770   ;
4771   return 0;
4772 }
4773 _ACEOF
4774 rm -f conftest.$ac_objext conftest$ac_exeext
4775 if { (eval echo "$as_me:4775: \"$ac_link\"") >&5
4776   (eval $ac_link) 2>&5
4777   ac_status=$?
4778   echo "$as_me:4778: \$? = $ac_status" >&5
4779   (exit $ac_status); } &&
4780          { ac_try='test -s conftest$ac_exeext'
4781   { (eval echo "$as_me:4781: \"$ac_try\"") >&5
4782   (eval $ac_try) 2>&5
4783   ac_status=$?
4784   echo "$as_me:4784: \$? = $ac_status" >&5
4785   (exit $ac_status); }; }; then
4786   ac_cv_lib_gpm_initscr=yes
4787 else
4788   echo "$as_me: failed program was:" >&5
4789 cat conftest.$ac_ext >&5
4790 ac_cv_lib_gpm_initscr=no
4791 fi
4792 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
4793 LIBS=$ac_check_lib_save_LIBS
4794 fi
4795 echo "$as_me:4795: result: $ac_cv_lib_gpm_initscr" >&5
4796 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
4797 if test $ac_cv_lib_gpm_initscr = yes; then
4798   LIBS="$cf_ncurses_SAVE"
4799 else
4800   cf_ncurses_LIBS="-lgpm"
4801 fi
4802
4803 fi
4804
4805 case $host_os in
4806 (freebsd*)
4807         # This is only necessary if you are linking against an obsolete
4808         # version of ncurses (but it should do no harm, since it's static).
4809         if test "$cf_nculib_root" = ncurses ; then
4810                 echo "$as_me:4810: checking for tgoto in -lmytinfo" >&5
4811 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
4812 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
4813   echo $ECHO_N "(cached) $ECHO_C" >&6
4814 else
4815   ac_check_lib_save_LIBS=$LIBS
4816 LIBS="-lmytinfo  $LIBS"
4817 cat >conftest.$ac_ext <<_ACEOF
4818 #line 4818 "configure"
4819 #include "confdefs.h"
4820
4821 /* Override any gcc2 internal prototype to avoid an error.  */
4822 #ifdef __cplusplus
4823 extern "C"
4824 #endif
4825 /* We use char because int might match the return type of a gcc2
4826    builtin and then its argument prototype would still apply.  */
4827 char tgoto ();
4828 int
4829 main ()
4830 {
4831 tgoto ();
4832   ;
4833   return 0;
4834 }
4835 _ACEOF
4836 rm -f conftest.$ac_objext conftest$ac_exeext
4837 if { (eval echo "$as_me:4837: \"$ac_link\"") >&5
4838   (eval $ac_link) 2>&5
4839   ac_status=$?
4840   echo "$as_me:4840: \$? = $ac_status" >&5
4841   (exit $ac_status); } &&
4842          { ac_try='test -s conftest$ac_exeext'
4843   { (eval echo "$as_me:4843: \"$ac_try\"") >&5
4844   (eval $ac_try) 2>&5
4845   ac_status=$?
4846   echo "$as_me:4846: \$? = $ac_status" >&5
4847   (exit $ac_status); }; }; then
4848   ac_cv_lib_mytinfo_tgoto=yes
4849 else
4850   echo "$as_me: failed program was:" >&5
4851 cat conftest.$ac_ext >&5
4852 ac_cv_lib_mytinfo_tgoto=no
4853 fi
4854 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
4855 LIBS=$ac_check_lib_save_LIBS
4856 fi
4857 echo "$as_me:4857: result: $ac_cv_lib_mytinfo_tgoto" >&5
4858 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
4859 if test $ac_cv_lib_mytinfo_tgoto = yes; then
4860   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
4861 fi
4862
4863         fi
4864         ;;
4865 esac
4866
4867 cf_add_libs="$cf_ncurses_LIBS"
4868 # Filter out duplicates - this happens with badly-designed ".pc" files...
4869 for cf_add_1lib in $LIBS
4870 do
4871         for cf_add_2lib in $cf_add_libs
4872         do
4873                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
4874                 then
4875                         cf_add_1lib=
4876                         break
4877                 fi
4878         done
4879         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
4880 done
4881 LIBS="$cf_add_libs"
4882
4883 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
4884 then
4885
4886 cf_add_libs="-l$cf_nculib_root"
4887 # Filter out duplicates - this happens with badly-designed ".pc" files...
4888 for cf_add_1lib in $LIBS
4889 do
4890         for cf_add_2lib in $cf_add_libs
4891         do
4892                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
4893                 then
4894                         cf_add_1lib=
4895                         break
4896                 fi
4897         done
4898         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
4899 done
4900 LIBS="$cf_add_libs"
4901
4902 else
4903
4904         eval 'cf_cv_have_lib_'$cf_nculib_root'=no'
4905         cf_libdir=""
4906         echo "$as_me:4906: checking for initscr" >&5
4907 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
4908 if test "${ac_cv_func_initscr+set}" = set; then
4909   echo $ECHO_N "(cached) $ECHO_C" >&6
4910 else
4911   cat >conftest.$ac_ext <<_ACEOF
4912 #line 4912 "configure"
4913 #include "confdefs.h"
4914 /* System header to define __stub macros and hopefully few prototypes,
4915     which can conflict with char initscr (); below.  */
4916 #include <assert.h>
4917 /* Override any gcc2 internal prototype to avoid an error.  */
4918 #ifdef __cplusplus
4919 extern "C"
4920 #endif
4921 /* We use char because int might match the return type of a gcc2
4922    builtin and then its argument prototype would still apply.  */
4923 char initscr ();
4924 char (*f) ();
4925
4926 int
4927 main ()
4928 {
4929 /* The GNU C library defines this for functions which it implements
4930     to always fail with ENOSYS.  Some functions are actually named
4931     something starting with __ and the normal name is an alias.  */
4932 #if defined (__stub_initscr) || defined (__stub___initscr)
4933 choke me
4934 #else
4935 f = initscr; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
4936 #endif
4937
4938   ;
4939   return 0;
4940 }
4941 _ACEOF
4942 rm -f conftest.$ac_objext conftest$ac_exeext
4943 if { (eval echo "$as_me:4943: \"$ac_link\"") >&5
4944   (eval $ac_link) 2>&5
4945   ac_status=$?
4946   echo "$as_me:4946: \$? = $ac_status" >&5
4947   (exit $ac_status); } &&
4948          { ac_try='test -s conftest$ac_exeext'
4949   { (eval echo "$as_me:4949: \"$ac_try\"") >&5
4950   (eval $ac_try) 2>&5
4951   ac_status=$?
4952   echo "$as_me:4952: \$? = $ac_status" >&5
4953   (exit $ac_status); }; }; then
4954   ac_cv_func_initscr=yes
4955 else
4956   echo "$as_me: failed program was:" >&5
4957 cat conftest.$ac_ext >&5
4958 ac_cv_func_initscr=no
4959 fi
4960 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
4961 fi
4962 echo "$as_me:4962: result: $ac_cv_func_initscr" >&5
4963 echo "${ECHO_T}$ac_cv_func_initscr" >&6
4964 if test $ac_cv_func_initscr = yes; then
4965   eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
4966 else
4967
4968                 cf_save_LIBS="$LIBS"
4969                 echo "$as_me:4969: checking for initscr in -l$cf_nculib_root" >&5
4970 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
4971                 LIBS="-l$cf_nculib_root $LIBS"
4972                 cat >conftest.$ac_ext <<_ACEOF
4973 #line 4973 "configure"
4974 #include "confdefs.h"
4975 #include <${cf_cv_ncurses_header:-curses.h}>
4976 int
4977 main ()
4978 {
4979 initscr()
4980   ;
4981   return 0;
4982 }
4983 _ACEOF
4984 rm -f conftest.$ac_objext conftest$ac_exeext
4985 if { (eval echo "$as_me:4985: \"$ac_link\"") >&5
4986   (eval $ac_link) 2>&5
4987   ac_status=$?
4988   echo "$as_me:4988: \$? = $ac_status" >&5
4989   (exit $ac_status); } &&
4990          { ac_try='test -s conftest$ac_exeext'
4991   { (eval echo "$as_me:4991: \"$ac_try\"") >&5
4992   (eval $ac_try) 2>&5
4993   ac_status=$?
4994   echo "$as_me:4994: \$? = $ac_status" >&5
4995   (exit $ac_status); }; }; then
4996   echo "$as_me:4996: result: yes" >&5
4997 echo "${ECHO_T}yes" >&6
4998                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
4999
5000 else
5001   echo "$as_me: failed program was:" >&5
5002 cat conftest.$ac_ext >&5
5003 echo "$as_me:5003: result: no" >&5
5004 echo "${ECHO_T}no" >&6
5005
5006 cf_search=
5007 cf_library_path_list=""
5008 if test -n "${LDFLAGS}${LIBS}" ; then
5009         for cf_library_path in $LDFLAGS $LIBS
5010         do
5011                 case $cf_library_path in
5012                 (-L*)
5013                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
5014
5015 test "x$cf_library_path" != "xNONE" && \
5016 test -d "$cf_library_path" && \
5017  {
5018         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
5019         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
5020         test -d $cf_library_path/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
5021         test -d $cf_library_path/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
5022         test -d $cf_library_path/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
5023         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"
5024 }
5025
5026                         cf_library_path_list="$cf_library_path_list $cf_search"
5027                         ;;
5028                 esac
5029         done
5030 fi
5031
5032 cf_search=
5033
5034 test "x$prefix" != "xNONE" && \
5035 test -d "$prefix" && \
5036  {
5037         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
5038         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
5039         test -d $prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
5040         test -d $prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
5041         test -d $prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
5042         test -d $prefix/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
5043 }
5044
5045 for cf_subdir_prefix in \
5046         /usr \
5047         /usr/local \
5048         /usr/pkg \
5049         /opt \
5050         /opt/local \
5051         $HOME
5052 do
5053
5054 test "x$cf_subdir_prefix" != "x$prefix" && \
5055 test -d "$cf_subdir_prefix" && \
5056 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
5057         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
5058         test -d $cf_subdir_prefix/lib &&          cf_search="$cf_search $cf_subdir_prefix/lib"
5059         test -d $cf_subdir_prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root"
5060         test -d $cf_subdir_prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root/lib"
5061         test -d $cf_subdir_prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib"
5062         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"
5063 }
5064
5065 done
5066
5067 cf_search="$cf_library_path_list $cf_search"
5068
5069                         for cf_libdir in $cf_search
5070                         do
5071                                 echo "$as_me:5071: checking for -l$cf_nculib_root in $cf_libdir" >&5
5072 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
5073                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
5074                                 cat >conftest.$ac_ext <<_ACEOF
5075 #line 5075 "configure"
5076 #include "confdefs.h"
5077 #include <${cf_cv_ncurses_header:-curses.h}>
5078 int
5079 main ()
5080 {
5081 initscr()
5082   ;
5083   return 0;
5084 }
5085 _ACEOF
5086 rm -f conftest.$ac_objext conftest$ac_exeext
5087 if { (eval echo "$as_me:5087: \"$ac_link\"") >&5
5088   (eval $ac_link) 2>&5
5089   ac_status=$?
5090   echo "$as_me:5090: \$? = $ac_status" >&5
5091   (exit $ac_status); } &&
5092          { ac_try='test -s conftest$ac_exeext'
5093   { (eval echo "$as_me:5093: \"$ac_try\"") >&5
5094   (eval $ac_try) 2>&5
5095   ac_status=$?
5096   echo "$as_me:5096: \$? = $ac_status" >&5
5097   (exit $ac_status); }; }; then
5098   echo "$as_me:5098: result: yes" >&5
5099 echo "${ECHO_T}yes" >&6
5100                                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
5101                                          break
5102 else
5103   echo "$as_me: failed program was:" >&5
5104 cat conftest.$ac_ext >&5
5105 echo "$as_me:5105: result: no" >&5
5106 echo "${ECHO_T}no" >&6
5107                                          LIBS="$cf_save_LIBS"
5108 fi
5109 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5110                         done
5111
5112 fi
5113 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5114
5115 fi
5116
5117 eval 'cf_found_library=$cf_cv_have_lib_'$cf_nculib_root
5118
5119 if test $cf_found_library = no ; then
5120         { { echo "$as_me:5120: error: Cannot link $cf_nculib_root library" >&5
5121 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
5122    { (exit 1); exit 1; }; }
5123 fi
5124
5125 fi
5126
5127 if test -n "$cf_ncurses_LIBS" ; then
5128         echo "$as_me:5128: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
5129 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
5130         cf_ncurses_SAVE="$LIBS"
5131         for p in $cf_ncurses_LIBS ; do
5132                 q=`echo $LIBS | sed -e "s%$p %%" -e "s%$p$%%"`
5133                 if test "$q" != "$LIBS" ; then
5134                         LIBS="$q"
5135                 fi
5136         done
5137         cat >conftest.$ac_ext <<_ACEOF
5138 #line 5138 "configure"
5139 #include "confdefs.h"
5140 #include <${cf_cv_ncurses_header:-curses.h}>
5141 int
5142 main ()
5143 {
5144 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
5145   ;
5146   return 0;
5147 }
5148 _ACEOF
5149 rm -f conftest.$ac_objext conftest$ac_exeext
5150 if { (eval echo "$as_me:5150: \"$ac_link\"") >&5
5151   (eval $ac_link) 2>&5
5152   ac_status=$?
5153   echo "$as_me:5153: \$? = $ac_status" >&5
5154   (exit $ac_status); } &&
5155          { ac_try='test -s conftest$ac_exeext'
5156   { (eval echo "$as_me:5156: \"$ac_try\"") >&5
5157   (eval $ac_try) 2>&5
5158   ac_status=$?
5159   echo "$as_me:5159: \$? = $ac_status" >&5
5160   (exit $ac_status); }; }; then
5161   echo "$as_me:5161: result: yes" >&5
5162 echo "${ECHO_T}yes" >&6
5163 else
5164   echo "$as_me: failed program was:" >&5
5165 cat conftest.$ac_ext >&5
5166 echo "$as_me:5166: result: no" >&5
5167 echo "${ECHO_T}no" >&6
5168                  LIBS="$cf_ncurses_SAVE"
5169 fi
5170 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5171 fi
5172
5173 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
5174
5175 cat >>confdefs.h <<EOF
5176 #define $cf_nculib_ROOT 1
5177 EOF
5178
5179         fi
5180 else
5181         NCURSES_CONFIG=none
5182 fi
5183
5184 echo "$as_me:5184: checking if you want wide-character code" >&5
5185 echo $ECHO_N "checking if you want wide-character code... $ECHO_C" >&6
5186
5187 # Check whether --enable-widec or --disable-widec was given.
5188 if test "${enable_widec+set}" = set; then
5189   enableval="$enable_widec"
5190   with_widec=$enableval
5191 else
5192   with_widec=no
5193 fi;
5194 echo "$as_me:5194: result: $with_widec" >&5
5195 echo "${ECHO_T}$with_widec" >&6
5196 if test "$with_widec" = yes ; then
5197
5198 echo "$as_me:5198: checking for multibyte character support" >&5
5199 echo $ECHO_N "checking for multibyte character support... $ECHO_C" >&6
5200 if test "${cf_cv_utf8_lib+set}" = set; then
5201   echo $ECHO_N "(cached) $ECHO_C" >&6
5202 else
5203
5204         cf_save_LIBS="$LIBS"
5205         cat >conftest.$ac_ext <<_ACEOF
5206 #line 5206 "configure"
5207 #include "confdefs.h"
5208
5209 #include <stdlib.h>
5210 int
5211 main ()
5212 {
5213 putwc(0,0);
5214   ;
5215   return 0;
5216 }
5217 _ACEOF
5218 rm -f conftest.$ac_objext conftest$ac_exeext
5219 if { (eval echo "$as_me:5219: \"$ac_link\"") >&5
5220   (eval $ac_link) 2>&5
5221   ac_status=$?
5222   echo "$as_me:5222: \$? = $ac_status" >&5
5223   (exit $ac_status); } &&
5224          { ac_try='test -s conftest$ac_exeext'
5225   { (eval echo "$as_me:5225: \"$ac_try\"") >&5
5226   (eval $ac_try) 2>&5
5227   ac_status=$?
5228   echo "$as_me:5228: \$? = $ac_status" >&5
5229   (exit $ac_status); }; }; then
5230   cf_cv_utf8_lib=yes
5231 else
5232   echo "$as_me: failed program was:" >&5
5233 cat conftest.$ac_ext >&5
5234
5235 # If the linkage is not already in the $CPPFLAGS/$LDFLAGS configuration, these
5236 # will be set on completion of the AC_TRY_LINK below.
5237 cf_cv_header_path_utf8=
5238 cf_cv_library_path_utf8=
5239
5240 echo "${as_me:-configure}:5240: testing Starting FIND_LINKAGE(utf8,) ..." 1>&5
5241
5242 cf_save_LIBS="$LIBS"
5243
5244 cat >conftest.$ac_ext <<_ACEOF
5245 #line 5245 "configure"
5246 #include "confdefs.h"
5247
5248 #include <libutf8.h>
5249 int
5250 main ()
5251 {
5252 putwc(0,0);
5253   ;
5254   return 0;
5255 }
5256 _ACEOF
5257 rm -f conftest.$ac_objext conftest$ac_exeext
5258 if { (eval echo "$as_me:5258: \"$ac_link\"") >&5
5259   (eval $ac_link) 2>&5
5260   ac_status=$?
5261   echo "$as_me:5261: \$? = $ac_status" >&5
5262   (exit $ac_status); } &&
5263          { ac_try='test -s conftest$ac_exeext'
5264   { (eval echo "$as_me:5264: \"$ac_try\"") >&5
5265   (eval $ac_try) 2>&5
5266   ac_status=$?
5267   echo "$as_me:5267: \$? = $ac_status" >&5
5268   (exit $ac_status); }; }; then
5269
5270         cf_cv_find_linkage_utf8=yes
5271         cf_cv_header_path_utf8=/usr/include
5272         cf_cv_library_path_utf8=/usr/lib
5273
5274 else
5275   echo "$as_me: failed program was:" >&5
5276 cat conftest.$ac_ext >&5
5277
5278 LIBS="-lutf8  $cf_save_LIBS"
5279
5280 cat >conftest.$ac_ext <<_ACEOF
5281 #line 5281 "configure"
5282 #include "confdefs.h"
5283
5284 #include <libutf8.h>
5285 int
5286 main ()
5287 {
5288 putwc(0,0);
5289   ;
5290   return 0;
5291 }
5292 _ACEOF
5293 rm -f conftest.$ac_objext conftest$ac_exeext
5294 if { (eval echo "$as_me:5294: \"$ac_link\"") >&5
5295   (eval $ac_link) 2>&5
5296   ac_status=$?
5297   echo "$as_me:5297: \$? = $ac_status" >&5
5298   (exit $ac_status); } &&
5299          { ac_try='test -s conftest$ac_exeext'
5300   { (eval echo "$as_me:5300: \"$ac_try\"") >&5
5301   (eval $ac_try) 2>&5
5302   ac_status=$?
5303   echo "$as_me:5303: \$? = $ac_status" >&5
5304   (exit $ac_status); }; }; then
5305
5306         cf_cv_find_linkage_utf8=yes
5307         cf_cv_header_path_utf8=/usr/include
5308         cf_cv_library_path_utf8=/usr/lib
5309         cf_cv_library_file_utf8="-lutf8"
5310
5311 else
5312   echo "$as_me: failed program was:" >&5
5313 cat conftest.$ac_ext >&5
5314
5315         cf_cv_find_linkage_utf8=no
5316         LIBS="$cf_save_LIBS"
5317
5318         test -n "$verbose" && echo "    find linkage for utf8 library" 1>&6
5319
5320 echo "${as_me:-configure}:5320: testing find linkage for utf8 library ..." 1>&5
5321
5322 echo "${as_me:-configure}:5322: testing Searching for headers in FIND_LINKAGE(utf8,) ..." 1>&5
5323
5324         cf_save_CPPFLAGS="$CPPFLAGS"
5325         cf_test_CPPFLAGS="$CPPFLAGS"
5326
5327 cf_search=
5328
5329 # collect the current set of include-directories from compiler flags
5330 cf_header_path_list=""
5331 if test -n "${CFLAGS}${CPPFLAGS}" ; then
5332         for cf_header_path in $CPPFLAGS $CFLAGS
5333         do
5334                 case $cf_header_path in
5335                 (-I*)
5336                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
5337
5338 test "x$cf_header_path" != "xNONE" && \
5339 test -d "$cf_header_path" && \
5340  {
5341         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
5342         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
5343         test -d $cf_header_path/include/utf8 &&       cf_search="$cf_search $cf_header_path/include/utf8"
5344         test -d $cf_header_path/include/utf8/include &&    cf_search="$cf_search $cf_header_path/include/utf8/include"
5345         test -d $cf_header_path/utf8/include &&       cf_search="$cf_search $cf_header_path/utf8/include"
5346         test -d $cf_header_path/utf8/include/utf8 &&    cf_search="$cf_search $cf_header_path/utf8/include/utf8"
5347 }
5348
5349                         cf_header_path_list="$cf_header_path_list $cf_search"
5350                         ;;
5351                 esac
5352         done
5353 fi
5354
5355 # add the variations for the package we are looking for
5356
5357 cf_search=
5358
5359 test "x$prefix" != "xNONE" && \
5360 test -d "$prefix" && \
5361  {
5362         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
5363         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
5364         test -d $prefix/include/utf8 &&       cf_search="$cf_search $prefix/include/utf8"
5365         test -d $prefix/include/utf8/include &&    cf_search="$cf_search $prefix/include/utf8/include"
5366         test -d $prefix/utf8/include &&       cf_search="$cf_search $prefix/utf8/include"
5367         test -d $prefix/utf8/include/utf8 &&    cf_search="$cf_search $prefix/utf8/include/utf8"
5368 }
5369
5370 for cf_subdir_prefix in \
5371         /usr \
5372         /usr/local \
5373         /usr/pkg \
5374         /opt \
5375         /opt/local \
5376         $HOME
5377 do
5378
5379 test "x$cf_subdir_prefix" != "x$prefix" && \
5380 test -d "$cf_subdir_prefix" && \
5381 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
5382         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
5383         test -d $cf_subdir_prefix/include &&          cf_search="$cf_search $cf_subdir_prefix/include"
5384         test -d $cf_subdir_prefix/include/utf8 &&       cf_search="$cf_search $cf_subdir_prefix/include/utf8"
5385         test -d $cf_subdir_prefix/include/utf8/include &&    cf_search="$cf_search $cf_subdir_prefix/include/utf8/include"
5386         test -d $cf_subdir_prefix/utf8/include &&       cf_search="$cf_search $cf_subdir_prefix/utf8/include"
5387         test -d $cf_subdir_prefix/utf8/include/utf8 &&    cf_search="$cf_search $cf_subdir_prefix/utf8/include/utf8"
5388 }
5389
5390 done
5391
5392 test "$includedir" != NONE && \
5393 test "$includedir" != "/usr/include" && \
5394 test -d "$includedir" && {
5395         test -d $includedir &&    cf_search="$cf_search $includedir"
5396         test -d $includedir/utf8 && cf_search="$cf_search $includedir/utf8"
5397 }
5398
5399 test "$oldincludedir" != NONE && \
5400 test "$oldincludedir" != "/usr/include" && \
5401 test -d "$oldincludedir" && {
5402         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
5403         test -d $oldincludedir/utf8 && cf_search="$cf_search $oldincludedir/utf8"
5404 }
5405
5406 cf_search="$cf_search $cf_header_path_list"
5407
5408         for cf_cv_header_path_utf8 in $cf_search
5409         do
5410                 if test -d $cf_cv_header_path_utf8 ; then
5411                         test -n "$verbose" && echo "    ... testing $cf_cv_header_path_utf8" 1>&6
5412
5413 echo "${as_me:-configure}:5413: testing ... testing $cf_cv_header_path_utf8 ..." 1>&5
5414
5415                         CPPFLAGS="$cf_save_CPPFLAGS -I$cf_cv_header_path_utf8"
5416                         cat >conftest.$ac_ext <<_ACEOF
5417 #line 5417 "configure"
5418 #include "confdefs.h"
5419
5420 #include <libutf8.h>
5421 int
5422 main ()
5423 {
5424 putwc(0,0);
5425   ;
5426   return 0;
5427 }
5428 _ACEOF
5429 rm -f conftest.$ac_objext
5430 if { (eval echo "$as_me:5430: \"$ac_compile\"") >&5
5431   (eval $ac_compile) 2>&5
5432   ac_status=$?
5433   echo "$as_me:5433: \$? = $ac_status" >&5
5434   (exit $ac_status); } &&
5435          { ac_try='test -s conftest.$ac_objext'
5436   { (eval echo "$as_me:5436: \"$ac_try\"") >&5
5437   (eval $ac_try) 2>&5
5438   ac_status=$?
5439   echo "$as_me:5439: \$? = $ac_status" >&5
5440   (exit $ac_status); }; }; then
5441
5442                                 test -n "$verbose" && echo "    ... found utf8 headers in $cf_cv_header_path_utf8" 1>&6
5443
5444 echo "${as_me:-configure}:5444: testing ... found utf8 headers in $cf_cv_header_path_utf8 ..." 1>&5
5445
5446                                 cf_cv_find_linkage_utf8=maybe
5447                                 cf_test_CPPFLAGS="$CPPFLAGS"
5448                                 break
5449 else
5450   echo "$as_me: failed program was:" >&5
5451 cat conftest.$ac_ext >&5
5452
5453                                 CPPFLAGS="$cf_save_CPPFLAGS"
5454
5455 fi
5456 rm -f conftest.$ac_objext conftest.$ac_ext
5457                 fi
5458         done
5459
5460         if test "$cf_cv_find_linkage_utf8" = maybe ; then
5461
5462 echo "${as_me:-configure}:5462: testing Searching for utf8 library in FIND_LINKAGE(utf8,) ..." 1>&5
5463
5464                 cf_save_LIBS="$LIBS"
5465                 cf_save_LDFLAGS="$LDFLAGS"
5466
5467                 if test "$cf_cv_find_linkage_utf8" != yes ; then
5468
5469 cf_search=
5470 cf_library_path_list=""
5471 if test -n "${LDFLAGS}${LIBS}" ; then
5472         for cf_library_path in $LDFLAGS $LIBS
5473         do
5474                 case $cf_library_path in
5475                 (-L*)
5476                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
5477
5478 test "x$cf_library_path" != "xNONE" && \
5479 test -d "$cf_library_path" && \
5480  {
5481         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
5482         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
5483         test -d $cf_library_path/lib/utf8 &&       cf_search="$cf_search $cf_library_path/lib/utf8"
5484         test -d $cf_library_path/lib/utf8/lib &&    cf_search="$cf_search $cf_library_path/lib/utf8/lib"
5485         test -d $cf_library_path/utf8/lib &&       cf_search="$cf_search $cf_library_path/utf8/lib"
5486         test -d $cf_library_path/utf8/lib/utf8 &&    cf_search="$cf_search $cf_library_path/utf8/lib/utf8"
5487 }
5488
5489                         cf_library_path_list="$cf_library_path_list $cf_search"
5490                         ;;
5491                 esac
5492         done
5493 fi
5494
5495 cf_search=
5496
5497 test "x$prefix" != "xNONE" && \
5498 test -d "$prefix" && \
5499  {
5500         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
5501         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
5502         test -d $prefix/lib/utf8 &&       cf_search="$cf_search $prefix/lib/utf8"
5503         test -d $prefix/lib/utf8/lib &&    cf_search="$cf_search $prefix/lib/utf8/lib"
5504         test -d $prefix/utf8/lib &&       cf_search="$cf_search $prefix/utf8/lib"
5505         test -d $prefix/utf8/lib/utf8 &&    cf_search="$cf_search $prefix/utf8/lib/utf8"
5506 }
5507
5508 for cf_subdir_prefix in \
5509         /usr \
5510         /usr/local \
5511         /usr/pkg \
5512         /opt \
5513         /opt/local \
5514         $HOME
5515 do
5516
5517 test "x$cf_subdir_prefix" != "x$prefix" && \
5518 test -d "$cf_subdir_prefix" && \
5519 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
5520         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
5521         test -d $cf_subdir_prefix/lib &&          cf_search="$cf_search $cf_subdir_prefix/lib"
5522         test -d $cf_subdir_prefix/lib/utf8 &&       cf_search="$cf_search $cf_subdir_prefix/lib/utf8"
5523         test -d $cf_subdir_prefix/lib/utf8/lib &&    cf_search="$cf_search $cf_subdir_prefix/lib/utf8/lib"
5524         test -d $cf_subdir_prefix/utf8/lib &&       cf_search="$cf_search $cf_subdir_prefix/utf8/lib"
5525         test -d $cf_subdir_prefix/utf8/lib/utf8 &&    cf_search="$cf_search $cf_subdir_prefix/utf8/lib/utf8"
5526 }
5527
5528 done
5529
5530 cf_search="$cf_library_path_list $cf_search"
5531
5532                         for cf_cv_library_path_utf8 in $cf_search
5533                         do
5534                                 if test -d $cf_cv_library_path_utf8 ; then
5535                                         test -n "$verbose" && echo "    ... testing $cf_cv_library_path_utf8" 1>&6
5536
5537 echo "${as_me:-configure}:5537: testing ... testing $cf_cv_library_path_utf8 ..." 1>&5
5538
5539                                         CPPFLAGS="$cf_test_CPPFLAGS"
5540                                         LIBS="-lutf8  $cf_save_LIBS"
5541                                         LDFLAGS="$cf_save_LDFLAGS -L$cf_cv_library_path_utf8"
5542                                         cat >conftest.$ac_ext <<_ACEOF
5543 #line 5543 "configure"
5544 #include "confdefs.h"
5545
5546 #include <libutf8.h>
5547 int
5548 main ()
5549 {
5550 putwc(0,0);
5551   ;
5552   return 0;
5553 }
5554 _ACEOF
5555 rm -f conftest.$ac_objext conftest$ac_exeext
5556 if { (eval echo "$as_me:5556: \"$ac_link\"") >&5
5557   (eval $ac_link) 2>&5
5558   ac_status=$?
5559   echo "$as_me:5559: \$? = $ac_status" >&5
5560   (exit $ac_status); } &&
5561          { ac_try='test -s conftest$ac_exeext'
5562   { (eval echo "$as_me:5562: \"$ac_try\"") >&5
5563   (eval $ac_try) 2>&5
5564   ac_status=$?
5565   echo "$as_me:5565: \$? = $ac_status" >&5
5566   (exit $ac_status); }; }; then
5567
5568                                         test -n "$verbose" && echo "    ... found utf8 library in $cf_cv_library_path_utf8" 1>&6
5569
5570 echo "${as_me:-configure}:5570: testing ... found utf8 library in $cf_cv_library_path_utf8 ..." 1>&5
5571
5572                                         cf_cv_find_linkage_utf8=yes
5573                                         cf_cv_library_file_utf8="-lutf8"
5574                                         break
5575 else
5576   echo "$as_me: failed program was:" >&5
5577 cat conftest.$ac_ext >&5
5578
5579                                         CPPFLAGS="$cf_save_CPPFLAGS"
5580                                         LIBS="$cf_save_LIBS"
5581                                         LDFLAGS="$cf_save_LDFLAGS"
5582
5583 fi
5584 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5585                                 fi
5586                         done
5587                         CPPFLAGS="$cf_save_CPPFLAGS"
5588                         LDFLAGS="$cf_save_LDFLAGS"
5589                 fi
5590
5591         else
5592                 cf_cv_find_linkage_utf8=no
5593         fi
5594
5595 fi
5596 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5597
5598 fi
5599 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5600
5601 LIBS="$cf_save_LIBS"
5602
5603 if test "$cf_cv_find_linkage_utf8" = yes ; then
5604 cf_cv_utf8_lib=add-on
5605 else
5606 cf_cv_utf8_lib=no
5607 fi
5608
5609 fi
5610 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5611 fi
5612 echo "$as_me:5612: result: $cf_cv_utf8_lib" >&5
5613 echo "${ECHO_T}$cf_cv_utf8_lib" >&6
5614
5615 # HAVE_LIBUTF8_H is used by ncurses if curses.h is shared between
5616 # ncurses/ncursesw:
5617 if test "$cf_cv_utf8_lib" = "add-on" ; then
5618
5619 cat >>confdefs.h <<\EOF
5620 #define HAVE_LIBUTF8_H 1
5621 EOF
5622
5623 if test -n "$cf_cv_header_path_utf8" ; then
5624   for cf_add_incdir in $cf_cv_header_path_utf8
5625   do
5626         while test $cf_add_incdir != /usr/include
5627         do
5628           if test -d $cf_add_incdir
5629           then
5630                 cf_have_incdir=no
5631                 if test -n "$CFLAGS$CPPFLAGS" ; then
5632                   # a loop is needed to ensure we can add subdirs of existing dirs
5633                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
5634                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
5635                           cf_have_incdir=yes; break
5636                         fi
5637                   done
5638                 fi
5639
5640                 if test "$cf_have_incdir" = no ; then
5641                   if test "$cf_add_incdir" = /usr/local/include ; then
5642                         if test "$GCC" = yes
5643                         then
5644                           cf_save_CPPFLAGS=$CPPFLAGS
5645                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
5646                           cat >conftest.$ac_ext <<_ACEOF
5647 #line 5647 "configure"
5648 #include "confdefs.h"
5649 #include <stdio.h>
5650 int
5651 main ()
5652 {
5653 printf("Hello")
5654   ;
5655   return 0;
5656 }
5657 _ACEOF
5658 rm -f conftest.$ac_objext
5659 if { (eval echo "$as_me:5659: \"$ac_compile\"") >&5
5660   (eval $ac_compile) 2>&5
5661   ac_status=$?
5662   echo "$as_me:5662: \$? = $ac_status" >&5
5663   (exit $ac_status); } &&
5664          { ac_try='test -s conftest.$ac_objext'
5665   { (eval echo "$as_me:5665: \"$ac_try\"") >&5
5666   (eval $ac_try) 2>&5
5667   ac_status=$?
5668   echo "$as_me:5668: \$? = $ac_status" >&5
5669   (exit $ac_status); }; }; then
5670   :
5671 else
5672   echo "$as_me: failed program was:" >&5
5673 cat conftest.$ac_ext >&5
5674 cf_have_incdir=yes
5675 fi
5676 rm -f conftest.$ac_objext conftest.$ac_ext
5677                           CPPFLAGS=$cf_save_CPPFLAGS
5678                         fi
5679                   fi
5680                 fi
5681
5682                 if test "$cf_have_incdir" = no ; then
5683                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
5684
5685 echo "${as_me:-configure}:5685: testing adding $cf_add_incdir to include-path ..." 1>&5
5686
5687                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
5688
5689                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
5690                   test "$cf_top_incdir" = "$cf_add_incdir" && break
5691                   cf_add_incdir="$cf_top_incdir"
5692                 else
5693                   break
5694                 fi
5695           else
5696                 break
5697           fi
5698         done
5699   done
5700 fi
5701
5702 if test -n "$cf_cv_library_path_utf8" ; then
5703         for cf_add_libdir in $cf_cv_library_path_utf8
5704         do
5705                 if test $cf_add_libdir = /usr/lib ; then
5706                         :
5707                 elif test -d $cf_add_libdir
5708                 then
5709                         cf_have_libdir=no
5710                         if test -n "$LDFLAGS$LIBS" ; then
5711                                 # a loop is needed to ensure we can add subdirs of existing dirs
5712                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
5713                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
5714                                                 cf_have_libdir=yes; break
5715                                         fi
5716                                 done
5717                         fi
5718                         if test "$cf_have_libdir" = no ; then
5719                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
5720
5721 echo "${as_me:-configure}:5721: testing adding $cf_add_libdir to library-path ..." 1>&5
5722
5723                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
5724                         fi
5725                 fi
5726         done
5727 fi
5728
5729 cf_add_libs="$cf_cv_library_file_utf8"
5730 # Filter out duplicates - this happens with badly-designed ".pc" files...
5731 for cf_add_1lib in $LIBS
5732 do
5733         for cf_add_2lib in $cf_add_libs
5734         do
5735                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
5736                 then
5737                         cf_add_1lib=
5738                         break
5739                 fi
5740         done
5741         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
5742 done
5743 LIBS="$cf_add_libs"
5744
5745 fi
5746
5747 cf_ncuconfig_root=ncursesw
5748 cf_have_ncuconfig=no
5749
5750 if test "x$PKG_CONFIG" != xnone; then
5751         echo "$as_me:5751: checking pkg-config for $cf_ncuconfig_root" >&5
5752 echo $ECHO_N "checking pkg-config for $cf_ncuconfig_root... $ECHO_C" >&6
5753         if "$PKG_CONFIG" --exists $cf_ncuconfig_root ; then
5754                 echo "$as_me:5754: result: yes" >&5
5755 echo "${ECHO_T}yes" >&6
5756
5757                 echo "$as_me:5757: checking if the $cf_ncuconfig_root package files work" >&5
5758 echo $ECHO_N "checking if the $cf_ncuconfig_root package files work... $ECHO_C" >&6
5759                 cf_have_ncuconfig=unknown
5760
5761                 cf_save_CPPFLAGS="$CPPFLAGS"
5762                 cf_save_LIBS="$LIBS"
5763
5764                 CPPFLAGS="$CPPFLAGS `$PKG_CONFIG --cflags $cf_ncuconfig_root`"
5765
5766 cf_add_libs="`$PKG_CONFIG --libs $cf_ncuconfig_root`"
5767 # Filter out duplicates - this happens with badly-designed ".pc" files...
5768 for cf_add_1lib in $LIBS
5769 do
5770         for cf_add_2lib in $cf_add_libs
5771         do
5772                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
5773                 then
5774                         cf_add_1lib=
5775                         break
5776                 fi
5777         done
5778         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
5779 done
5780 LIBS="$cf_add_libs"
5781
5782                 cat >conftest.$ac_ext <<_ACEOF
5783 #line 5783 "configure"
5784 #include "confdefs.h"
5785 #include <${cf_cv_ncurses_header:-curses.h}>
5786 int
5787 main ()
5788 {
5789 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
5790   ;
5791   return 0;
5792 }
5793 _ACEOF
5794 rm -f conftest.$ac_objext conftest$ac_exeext
5795 if { (eval echo "$as_me:5795: \"$ac_link\"") >&5
5796   (eval $ac_link) 2>&5
5797   ac_status=$?
5798   echo "$as_me:5798: \$? = $ac_status" >&5
5799   (exit $ac_status); } &&
5800          { ac_try='test -s conftest$ac_exeext'
5801   { (eval echo "$as_me:5801: \"$ac_try\"") >&5
5802   (eval $ac_try) 2>&5
5803   ac_status=$?
5804   echo "$as_me:5804: \$? = $ac_status" >&5
5805   (exit $ac_status); }; }; then
5806   if test "$cross_compiling" = yes; then
5807   cf_have_ncuconfig=unknown
5808 else
5809   cat >conftest.$ac_ext <<_ACEOF
5810 #line 5810 "configure"
5811 #include "confdefs.h"
5812 #include <${cf_cv_ncurses_header:-curses.h}>
5813                                 int main(void)
5814                                 { char *xx = curses_version(); return (xx == 0); }
5815 _ACEOF
5816 rm -f conftest$ac_exeext
5817 if { (eval echo "$as_me:5817: \"$ac_link\"") >&5
5818   (eval $ac_link) 2>&5
5819   ac_status=$?
5820   echo "$as_me:5820: \$? = $ac_status" >&5
5821   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
5822   { (eval echo "$as_me:5822: \"$ac_try\"") >&5
5823   (eval $ac_try) 2>&5
5824   ac_status=$?
5825   echo "$as_me:5825: \$? = $ac_status" >&5
5826   (exit $ac_status); }; }; then
5827   cf_have_ncuconfig=yes
5828 else
5829   echo "$as_me: program exited with status $ac_status" >&5
5830 echo "$as_me: failed program was:" >&5
5831 cat conftest.$ac_ext >&5
5832 cf_have_ncuconfig=no
5833 fi
5834 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
5835 fi
5836 else
5837   echo "$as_me: failed program was:" >&5
5838 cat conftest.$ac_ext >&5
5839 cf_have_ncuconfig=no
5840 fi
5841 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5842
5843                 echo "$as_me:5843: result: $cf_have_ncuconfig" >&5
5844 echo "${ECHO_T}$cf_have_ncuconfig" >&6
5845                 if test "$cf_have_ncuconfig" != "yes"
5846                 then
5847                         CPPFLAGS="$cf_save_CPPFLAGS"
5848                         LIBS="$cf_save_LIBS"
5849                         NCURSES_CONFIG_PKG=none
5850                 else
5851
5852 cat >>confdefs.h <<\EOF
5853 #define NCURSES 1
5854 EOF
5855
5856                         NCURSES_CONFIG_PKG=$cf_ncuconfig_root
5857                 fi
5858
5859         else
5860                 echo "$as_me:5860: result: no" >&5
5861 echo "${ECHO_T}no" >&6
5862                 NCURSES_CONFIG_PKG=none
5863         fi
5864 else
5865         NCURSES_CONFIG_PKG=none
5866 fi
5867
5868 if test "x$cf_have_ncuconfig" = "xno"; then
5869         echo "Looking for ${cf_ncuconfig_root}-config"
5870
5871 if test -n "$ac_tool_prefix"; then
5872   for ac_prog in ${cf_ncuconfig_root}-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
5873   do
5874     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
5875 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
5876 echo "$as_me:5876: checking for $ac_word" >&5
5877 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
5878 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
5879   echo $ECHO_N "(cached) $ECHO_C" >&6
5880 else
5881   if test -n "$NCURSES_CONFIG"; then
5882   ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
5883 else
5884   ac_save_IFS=$IFS; IFS=$ac_path_separator
5885 ac_dummy="$PATH"
5886 for ac_dir in $ac_dummy; do
5887   IFS=$ac_save_IFS
5888   test -z "$ac_dir" && ac_dir=.
5889   $as_executable_p "$ac_dir/$ac_word" || continue
5890 ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
5891 echo "$as_me:5891: found $ac_dir/$ac_word" >&5
5892 break
5893 done
5894
5895 fi
5896 fi
5897 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
5898 if test -n "$NCURSES_CONFIG"; then
5899   echo "$as_me:5899: result: $NCURSES_CONFIG" >&5
5900 echo "${ECHO_T}$NCURSES_CONFIG" >&6
5901 else
5902   echo "$as_me:5902: result: no" >&5
5903 echo "${ECHO_T}no" >&6
5904 fi
5905
5906     test -n "$NCURSES_CONFIG" && break
5907   done
5908 fi
5909 if test -z "$NCURSES_CONFIG"; then
5910   ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
5911   for ac_prog in ${cf_ncuconfig_root}-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
5912 do
5913   # Extract the first word of "$ac_prog", so it can be a program name with args.
5914 set dummy $ac_prog; ac_word=$2
5915 echo "$as_me:5915: checking for $ac_word" >&5
5916 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
5917 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
5918   echo $ECHO_N "(cached) $ECHO_C" >&6
5919 else
5920   if test -n "$ac_ct_NCURSES_CONFIG"; then
5921   ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
5922 else
5923   ac_save_IFS=$IFS; IFS=$ac_path_separator
5924 ac_dummy="$PATH"
5925 for ac_dir in $ac_dummy; do
5926   IFS=$ac_save_IFS
5927   test -z "$ac_dir" && ac_dir=.
5928   $as_executable_p "$ac_dir/$ac_word" || continue
5929 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
5930 echo "$as_me:5930: found $ac_dir/$ac_word" >&5
5931 break
5932 done
5933
5934 fi
5935 fi
5936 ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
5937 if test -n "$ac_ct_NCURSES_CONFIG"; then
5938   echo "$as_me:5938: result: $ac_ct_NCURSES_CONFIG" >&5
5939 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
5940 else
5941   echo "$as_me:5941: result: no" >&5
5942 echo "${ECHO_T}no" >&6
5943 fi
5944
5945   test -n "$ac_ct_NCURSES_CONFIG" && break
5946 done
5947 test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
5948
5949   NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
5950 fi
5951
5952         if test "$NCURSES_CONFIG" != none ; then
5953
5954                 CPPFLAGS="$CPPFLAGS `$NCURSES_CONFIG --cflags`"
5955
5956 cf_add_libs="`$NCURSES_CONFIG --libs`"
5957 # Filter out duplicates - this happens with badly-designed ".pc" files...
5958 for cf_add_1lib in $LIBS
5959 do
5960         for cf_add_2lib in $cf_add_libs
5961         do
5962                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
5963                 then
5964                         cf_add_1lib=
5965                         break
5966                 fi
5967         done
5968         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
5969 done
5970 LIBS="$cf_add_libs"
5971
5972                 # even with config script, some packages use no-override for curses.h
5973
5974 echo "$as_me:5974: checking if we have identified curses headers" >&5
5975 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
5976 if test "${cf_cv_ncurses_header+set}" = set; then
5977   echo $ECHO_N "(cached) $ECHO_C" >&6
5978 else
5979
5980 cf_cv_ncurses_header=none
5981 for cf_header in \
5982         ncurses.h ncursesw/ncurses.h \
5983         curses.h ncursesw/curses.h
5984 do
5985 cat >conftest.$ac_ext <<_ACEOF
5986 #line 5986 "configure"
5987 #include "confdefs.h"
5988 #include <${cf_header}>
5989 int
5990 main ()
5991 {
5992 initscr(); tgoto("?", 0,0)
5993   ;
5994   return 0;
5995 }
5996 _ACEOF
5997 rm -f conftest.$ac_objext
5998 if { (eval echo "$as_me:5998: \"$ac_compile\"") >&5
5999   (eval $ac_compile) 2>&5
6000   ac_status=$?
6001   echo "$as_me:6001: \$? = $ac_status" >&5
6002   (exit $ac_status); } &&
6003          { ac_try='test -s conftest.$ac_objext'
6004   { (eval echo "$as_me:6004: \"$ac_try\"") >&5
6005   (eval $ac_try) 2>&5
6006   ac_status=$?
6007   echo "$as_me:6007: \$? = $ac_status" >&5
6008   (exit $ac_status); }; }; then
6009   cf_cv_ncurses_header=$cf_header; break
6010 else
6011   echo "$as_me: failed program was:" >&5
6012 cat conftest.$ac_ext >&5
6013 fi
6014 rm -f conftest.$ac_objext conftest.$ac_ext
6015 done
6016
6017 fi
6018 echo "$as_me:6018: result: $cf_cv_ncurses_header" >&5
6019 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
6020
6021 if test "$cf_cv_ncurses_header" = none ; then
6022         { { echo "$as_me:6022: error: No curses header-files found" >&5
6023 echo "$as_me: error: No curses header-files found" >&2;}
6024    { (exit 1); exit 1; }; }
6025 fi
6026
6027 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
6028
6029 for ac_header in $cf_cv_ncurses_header
6030 do
6031 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
6032 echo "$as_me:6032: checking for $ac_header" >&5
6033 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
6034 if eval "test \"\${$as_ac_Header+set}\" = set"; then
6035   echo $ECHO_N "(cached) $ECHO_C" >&6
6036 else
6037   cat >conftest.$ac_ext <<_ACEOF
6038 #line 6038 "configure"
6039 #include "confdefs.h"
6040 #include <$ac_header>
6041 _ACEOF
6042 if { (eval echo "$as_me:6042: \"$ac_cpp conftest.$ac_ext\"") >&5
6043   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
6044   ac_status=$?
6045   egrep -v '^ *\+' conftest.er1 >conftest.err
6046   rm -f conftest.er1
6047   cat conftest.err >&5
6048   echo "$as_me:6048: \$? = $ac_status" >&5
6049   (exit $ac_status); } >/dev/null; then
6050   if test -s conftest.err; then
6051     ac_cpp_err=$ac_c_preproc_warn_flag
6052   else
6053     ac_cpp_err=
6054   fi
6055 else
6056   ac_cpp_err=yes
6057 fi
6058 if test -z "$ac_cpp_err"; then
6059   eval "$as_ac_Header=yes"
6060 else
6061   echo "$as_me: failed program was:" >&5
6062   cat conftest.$ac_ext >&5
6063   eval "$as_ac_Header=no"
6064 fi
6065 rm -f conftest.err conftest.$ac_ext
6066 fi
6067 echo "$as_me:6067: result: `eval echo '${'$as_ac_Header'}'`" >&5
6068 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
6069 if test `eval echo '${'$as_ac_Header'}'` = yes; then
6070   cat >>confdefs.h <<EOF
6071 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
6072 EOF
6073
6074 fi
6075 done
6076
6077 cat >>confdefs.h <<\EOF
6078 #define NCURSES 1
6079 EOF
6080
6081 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
6082
6083                 cat >>confdefs.h <<EOF
6084 #define $cf_nculib_ROOT 1
6085 EOF
6086
6087                                 cf_cv_ncurses_version=`$NCURSES_CONFIG --version`
6088
6089         else
6090
6091 cf_ncuhdr_root=ncursesw
6092
6093 test -n "$cf_cv_curses_dir" && \
6094 test "$cf_cv_curses_dir" != "no" && { \
6095
6096 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
6097   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
6098   do
6099         while test $cf_add_incdir != /usr/include
6100         do
6101           if test -d $cf_add_incdir
6102           then
6103                 cf_have_incdir=no
6104                 if test -n "$CFLAGS$CPPFLAGS" ; then
6105                   # a loop is needed to ensure we can add subdirs of existing dirs
6106                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
6107                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
6108                           cf_have_incdir=yes; break
6109                         fi
6110                   done
6111                 fi
6112
6113                 if test "$cf_have_incdir" = no ; then
6114                   if test "$cf_add_incdir" = /usr/local/include ; then
6115                         if test "$GCC" = yes
6116                         then
6117                           cf_save_CPPFLAGS=$CPPFLAGS
6118                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6119                           cat >conftest.$ac_ext <<_ACEOF
6120 #line 6120 "configure"
6121 #include "confdefs.h"
6122 #include <stdio.h>
6123 int
6124 main ()
6125 {
6126 printf("Hello")
6127   ;
6128   return 0;
6129 }
6130 _ACEOF
6131 rm -f conftest.$ac_objext
6132 if { (eval echo "$as_me:6132: \"$ac_compile\"") >&5
6133   (eval $ac_compile) 2>&5
6134   ac_status=$?
6135   echo "$as_me:6135: \$? = $ac_status" >&5
6136   (exit $ac_status); } &&
6137          { ac_try='test -s conftest.$ac_objext'
6138   { (eval echo "$as_me:6138: \"$ac_try\"") >&5
6139   (eval $ac_try) 2>&5
6140   ac_status=$?
6141   echo "$as_me:6141: \$? = $ac_status" >&5
6142   (exit $ac_status); }; }; then
6143   :
6144 else
6145   echo "$as_me: failed program was:" >&5
6146 cat conftest.$ac_ext >&5
6147 cf_have_incdir=yes
6148 fi
6149 rm -f conftest.$ac_objext conftest.$ac_ext
6150                           CPPFLAGS=$cf_save_CPPFLAGS
6151                         fi
6152                   fi
6153                 fi
6154
6155                 if test "$cf_have_incdir" = no ; then
6156                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
6157
6158 echo "${as_me:-configure}:6158: testing adding $cf_add_incdir to include-path ..." 1>&5
6159
6160                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6161
6162                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
6163                   test "$cf_top_incdir" = "$cf_add_incdir" && break
6164                   cf_add_incdir="$cf_top_incdir"
6165                 else
6166                   break
6167                 fi
6168           else
6169                 break
6170           fi
6171         done
6172   done
6173 fi
6174
6175 }
6176
6177 echo "$as_me:6177: checking for $cf_ncuhdr_root header in include-path" >&5
6178 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
6179 if test "${cf_cv_ncurses_h+set}" = set; then
6180   echo $ECHO_N "(cached) $ECHO_C" >&6
6181 else
6182
6183         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
6184         ( test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw ) && cf_header_list="$cf_header_list curses.h ncurses.h"
6185         for cf_header in $cf_header_list
6186         do
6187
6188         cat >conftest.$ac_ext <<_ACEOF
6189 #line 6189 "configure"
6190 #include "confdefs.h"
6191
6192 #define _XOPEN_SOURCE_EXTENDED
6193 #undef  HAVE_LIBUTF8_H  /* in case we used CF_UTF8_LIB */
6194 #define HAVE_LIBUTF8_H  /* to force ncurses' header file to use cchar_t */
6195
6196 #include <$cf_header>
6197 int
6198 main ()
6199 {
6200
6201 #ifdef NCURSES_VERSION
6202
6203 #ifndef WACS_BSSB
6204         make an error
6205 #endif
6206
6207 printf("%s\n", NCURSES_VERSION);
6208 #else
6209 #ifdef __NCURSES_H
6210 printf("old\n");
6211 #else
6212         make an error
6213 #endif
6214 #endif
6215
6216   ;
6217   return 0;
6218 }
6219 _ACEOF
6220 rm -f conftest.$ac_objext
6221 if { (eval echo "$as_me:6221: \"$ac_compile\"") >&5
6222   (eval $ac_compile) 2>&5
6223   ac_status=$?
6224   echo "$as_me:6224: \$? = $ac_status" >&5
6225   (exit $ac_status); } &&
6226          { ac_try='test -s conftest.$ac_objext'
6227   { (eval echo "$as_me:6227: \"$ac_try\"") >&5
6228   (eval $ac_try) 2>&5
6229   ac_status=$?
6230   echo "$as_me:6230: \$? = $ac_status" >&5
6231   (exit $ac_status); }; }; then
6232   cf_cv_ncurses_h=$cf_header
6233
6234 else
6235   echo "$as_me: failed program was:" >&5
6236 cat conftest.$ac_ext >&5
6237 cf_cv_ncurses_h=no
6238 fi
6239 rm -f conftest.$ac_objext conftest.$ac_ext
6240
6241                 test "$cf_cv_ncurses_h" != no && break
6242         done
6243
6244 fi
6245 echo "$as_me:6245: result: $cf_cv_ncurses_h" >&5
6246 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
6247
6248 if test "$cf_cv_ncurses_h" != no ; then
6249         cf_cv_ncurses_header=$cf_cv_ncurses_h
6250 else
6251
6252 echo "$as_me:6252: checking for $cf_ncuhdr_root include-path" >&5
6253 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
6254 if test "${cf_cv_ncurses_h2+set}" = set; then
6255   echo $ECHO_N "(cached) $ECHO_C" >&6
6256 else
6257
6258         test -n "$verbose" && echo
6259
6260 cf_search=
6261
6262 # collect the current set of include-directories from compiler flags
6263 cf_header_path_list=""
6264 if test -n "${CFLAGS}${CPPFLAGS}" ; then
6265         for cf_header_path in $CPPFLAGS $CFLAGS
6266         do
6267                 case $cf_header_path in
6268                 (-I*)
6269                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
6270
6271 test "x$cf_header_path" != "xNONE" && \
6272 test -d "$cf_header_path" && \
6273  {
6274         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
6275         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
6276         test -d $cf_header_path/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
6277         test -d $cf_header_path/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
6278         test -d $cf_header_path/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
6279         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"
6280 }
6281
6282                         cf_header_path_list="$cf_header_path_list $cf_search"
6283                         ;;
6284                 esac
6285         done
6286 fi
6287
6288 # add the variations for the package we are looking for
6289
6290 cf_search=
6291
6292 test "x$prefix" != "xNONE" && \
6293 test -d "$prefix" && \
6294  {
6295         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
6296         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
6297         test -d $prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
6298         test -d $prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
6299         test -d $prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
6300         test -d $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
6301 }
6302
6303 for cf_subdir_prefix in \
6304         /usr \
6305         /usr/local \
6306         /usr/pkg \
6307         /opt \
6308         /opt/local \
6309         $HOME
6310 do
6311
6312 test "x$cf_subdir_prefix" != "x$prefix" && \
6313 test -d "$cf_subdir_prefix" && \
6314 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
6315         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
6316         test -d $cf_subdir_prefix/include &&          cf_search="$cf_search $cf_subdir_prefix/include"
6317         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root"
6318         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root/include"
6319         test -d $cf_subdir_prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include"
6320         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"
6321 }
6322
6323 done
6324
6325 test "$includedir" != NONE && \
6326 test "$includedir" != "/usr/include" && \
6327 test -d "$includedir" && {
6328         test -d $includedir &&    cf_search="$cf_search $includedir"
6329         test -d $includedir/$cf_ncuhdr_root && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
6330 }
6331
6332 test "$oldincludedir" != NONE && \
6333 test "$oldincludedir" != "/usr/include" && \
6334 test -d "$oldincludedir" && {
6335         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
6336         test -d $oldincludedir/$cf_ncuhdr_root && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
6337 }
6338
6339 cf_search="$cf_search $cf_header_path_list"
6340
6341         test -n "$verbose" && echo search path $cf_search
6342         cf_save2_CPPFLAGS="$CPPFLAGS"
6343         for cf_incdir in $cf_search
6344         do
6345
6346 if test -n "$cf_incdir" ; then
6347   for cf_add_incdir in $cf_incdir
6348   do
6349         while test $cf_add_incdir != /usr/include
6350         do
6351           if test -d $cf_add_incdir
6352           then
6353                 cf_have_incdir=no
6354                 if test -n "$CFLAGS$CPPFLAGS" ; then
6355                   # a loop is needed to ensure we can add subdirs of existing dirs
6356                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
6357                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
6358                           cf_have_incdir=yes; break
6359                         fi
6360                   done
6361                 fi
6362
6363                 if test "$cf_have_incdir" = no ; then
6364                   if test "$cf_add_incdir" = /usr/local/include ; then
6365                         if test "$GCC" = yes
6366                         then
6367                           cf_save_CPPFLAGS=$CPPFLAGS
6368                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6369                           cat >conftest.$ac_ext <<_ACEOF
6370 #line 6370 "configure"
6371 #include "confdefs.h"
6372 #include <stdio.h>
6373 int
6374 main ()
6375 {
6376 printf("Hello")
6377   ;
6378   return 0;
6379 }
6380 _ACEOF
6381 rm -f conftest.$ac_objext
6382 if { (eval echo "$as_me:6382: \"$ac_compile\"") >&5
6383   (eval $ac_compile) 2>&5
6384   ac_status=$?
6385   echo "$as_me:6385: \$? = $ac_status" >&5
6386   (exit $ac_status); } &&
6387          { ac_try='test -s conftest.$ac_objext'
6388   { (eval echo "$as_me:6388: \"$ac_try\"") >&5
6389   (eval $ac_try) 2>&5
6390   ac_status=$?
6391   echo "$as_me:6391: \$? = $ac_status" >&5
6392   (exit $ac_status); }; }; then
6393   :
6394 else
6395   echo "$as_me: failed program was:" >&5
6396 cat conftest.$ac_ext >&5
6397 cf_have_incdir=yes
6398 fi
6399 rm -f conftest.$ac_objext conftest.$ac_ext
6400                           CPPFLAGS=$cf_save_CPPFLAGS
6401                         fi
6402                   fi
6403                 fi
6404
6405                 if test "$cf_have_incdir" = no ; then
6406                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
6407
6408 echo "${as_me:-configure}:6408: testing adding $cf_add_incdir to include-path ..." 1>&5
6409
6410                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6411
6412                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
6413                   test "$cf_top_incdir" = "$cf_add_incdir" && break
6414                   cf_add_incdir="$cf_top_incdir"
6415                 else
6416                   break
6417                 fi
6418           else
6419                 break
6420           fi
6421         done
6422   done
6423 fi
6424
6425                 for cf_header in \
6426                         ncurses.h \
6427                         curses.h
6428                 do
6429
6430         cat >conftest.$ac_ext <<_ACEOF
6431 #line 6431 "configure"
6432 #include "confdefs.h"
6433
6434 #include <$cf_header>
6435 int
6436 main ()
6437 {
6438
6439 #ifdef NCURSES_VERSION
6440
6441 printf("%s\n", NCURSES_VERSION);
6442 #else
6443 #ifdef __NCURSES_H
6444 printf("old\n");
6445 #else
6446         make an error
6447 #endif
6448 #endif
6449
6450   ;
6451   return 0;
6452 }
6453 _ACEOF
6454 rm -f conftest.$ac_objext
6455 if { (eval echo "$as_me:6455: \"$ac_compile\"") >&5
6456   (eval $ac_compile) 2>&5
6457   ac_status=$?
6458   echo "$as_me:6458: \$? = $ac_status" >&5
6459   (exit $ac_status); } &&
6460          { ac_try='test -s conftest.$ac_objext'
6461   { (eval echo "$as_me:6461: \"$ac_try\"") >&5
6462   (eval $ac_try) 2>&5
6463   ac_status=$?
6464   echo "$as_me:6464: \$? = $ac_status" >&5
6465   (exit $ac_status); }; }; then
6466   cf_cv_ncurses_h2=$cf_header
6467
6468 else
6469   echo "$as_me: failed program was:" >&5
6470 cat conftest.$ac_ext >&5
6471 cf_cv_ncurses_h2=no
6472 fi
6473 rm -f conftest.$ac_objext conftest.$ac_ext
6474
6475                         if test "$cf_cv_ncurses_h2" != no ; then
6476                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
6477                                 test -n "$verbose" && echo $ac_n "      ... found $ac_c" 1>&6
6478                                 break
6479                         fi
6480                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
6481                 done
6482                 CPPFLAGS="$cf_save2_CPPFLAGS"
6483                 test "$cf_cv_ncurses_h2" != no && break
6484         done
6485         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:6485: error: not found" >&5
6486 echo "$as_me: error: not found" >&2;}
6487    { (exit 1); exit 1; }; }
6488
6489 fi
6490 echo "$as_me:6490: result: $cf_cv_ncurses_h2" >&5
6491 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
6492
6493         cf_1st_incdir=`echo $cf_cv_ncurses_h2 | sed -e 's%/[^/]*$%%'`
6494         cf_cv_ncurses_header=`basename $cf_cv_ncurses_h2`
6495         if test `basename $cf_1st_incdir` = $cf_ncuhdr_root ; then
6496                 cf_cv_ncurses_header=$cf_ncuhdr_root/$cf_cv_ncurses_header
6497         fi
6498
6499 if test -n "$cf_1st_incdir" ; then
6500   for cf_add_incdir in $cf_1st_incdir
6501   do
6502         while test $cf_add_incdir != /usr/include
6503         do
6504           if test -d $cf_add_incdir
6505           then
6506                 cf_have_incdir=no
6507                 if test -n "$CFLAGS$CPPFLAGS" ; then
6508                   # a loop is needed to ensure we can add subdirs of existing dirs
6509                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
6510                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
6511                           cf_have_incdir=yes; break
6512                         fi
6513                   done
6514                 fi
6515
6516                 if test "$cf_have_incdir" = no ; then
6517                   if test "$cf_add_incdir" = /usr/local/include ; then
6518                         if test "$GCC" = yes
6519                         then
6520                           cf_save_CPPFLAGS=$CPPFLAGS
6521                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6522                           cat >conftest.$ac_ext <<_ACEOF
6523 #line 6523 "configure"
6524 #include "confdefs.h"
6525 #include <stdio.h>
6526 int
6527 main ()
6528 {
6529 printf("Hello")
6530   ;
6531   return 0;
6532 }
6533 _ACEOF
6534 rm -f conftest.$ac_objext
6535 if { (eval echo "$as_me:6535: \"$ac_compile\"") >&5
6536   (eval $ac_compile) 2>&5
6537   ac_status=$?
6538   echo "$as_me:6538: \$? = $ac_status" >&5
6539   (exit $ac_status); } &&
6540          { ac_try='test -s conftest.$ac_objext'
6541   { (eval echo "$as_me:6541: \"$ac_try\"") >&5
6542   (eval $ac_try) 2>&5
6543   ac_status=$?
6544   echo "$as_me:6544: \$? = $ac_status" >&5
6545   (exit $ac_status); }; }; then
6546   :
6547 else
6548   echo "$as_me: failed program was:" >&5
6549 cat conftest.$ac_ext >&5
6550 cf_have_incdir=yes
6551 fi
6552 rm -f conftest.$ac_objext conftest.$ac_ext
6553                           CPPFLAGS=$cf_save_CPPFLAGS
6554                         fi
6555                   fi
6556                 fi
6557
6558                 if test "$cf_have_incdir" = no ; then
6559                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
6560
6561 echo "${as_me:-configure}:6561: testing adding $cf_add_incdir to include-path ..." 1>&5
6562
6563                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6564
6565                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
6566                   test "$cf_top_incdir" = "$cf_add_incdir" && break
6567                   cf_add_incdir="$cf_top_incdir"
6568                 else
6569                   break
6570                 fi
6571           else
6572                 break
6573           fi
6574         done
6575   done
6576 fi
6577
6578 fi
6579
6580 # Set definitions to allow ifdef'ing for ncurses.h
6581
6582 case $cf_cv_ncurses_header in
6583 (*ncurses.h)
6584
6585 cat >>confdefs.h <<\EOF
6586 #define HAVE_NCURSES_H 1
6587 EOF
6588
6589         ;;
6590 esac
6591
6592 case $cf_cv_ncurses_header in
6593 (ncurses/curses.h|ncurses/ncurses.h)
6594
6595 cat >>confdefs.h <<\EOF
6596 #define HAVE_NCURSES_NCURSES_H 1
6597 EOF
6598
6599         ;;
6600 (ncursesw/curses.h|ncursesw/ncurses.h)
6601
6602 cat >>confdefs.h <<\EOF
6603 #define HAVE_NCURSESW_NCURSES_H 1
6604 EOF
6605
6606         ;;
6607 esac
6608
6609 echo "$as_me:6609: checking for terminfo header" >&5
6610 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
6611 if test "${cf_cv_term_header+set}" = set; then
6612   echo $ECHO_N "(cached) $ECHO_C" >&6
6613 else
6614
6615 case ${cf_cv_ncurses_header} in
6616 (*/ncurses.h|*/ncursesw.h)
6617         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
6618         ;;
6619 (*)
6620         cf_term_header=term.h
6621         ;;
6622 esac
6623
6624 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
6625 do
6626 cat >conftest.$ac_ext <<_ACEOF
6627 #line 6627 "configure"
6628 #include "confdefs.h"
6629 #include <stdio.h>
6630 #include <${cf_cv_ncurses_header:-curses.h}>
6631 #include <$cf_test>
6632
6633 int
6634 main ()
6635 {
6636 int x = auto_left_margin
6637   ;
6638   return 0;
6639 }
6640 _ACEOF
6641 rm -f conftest.$ac_objext
6642 if { (eval echo "$as_me:6642: \"$ac_compile\"") >&5
6643   (eval $ac_compile) 2>&5
6644   ac_status=$?
6645   echo "$as_me:6645: \$? = $ac_status" >&5
6646   (exit $ac_status); } &&
6647          { ac_try='test -s conftest.$ac_objext'
6648   { (eval echo "$as_me:6648: \"$ac_try\"") >&5
6649   (eval $ac_try) 2>&5
6650   ac_status=$?
6651   echo "$as_me:6651: \$? = $ac_status" >&5
6652   (exit $ac_status); }; }; then
6653
6654         cf_cv_term_header="$cf_test"
6655 else
6656   echo "$as_me: failed program was:" >&5
6657 cat conftest.$ac_ext >&5
6658
6659         cf_cv_term_header=unknown
6660
6661 fi
6662 rm -f conftest.$ac_objext conftest.$ac_ext
6663         test "$cf_cv_term_header" != unknown && break
6664 done
6665
6666 fi
6667 echo "$as_me:6667: result: $cf_cv_term_header" >&5
6668 echo "${ECHO_T}$cf_cv_term_header" >&6
6669
6670 # Set definitions to allow ifdef'ing to accommodate subdirectories
6671
6672 case $cf_cv_term_header in
6673 (*term.h)
6674
6675 cat >>confdefs.h <<\EOF
6676 #define HAVE_TERM_H 1
6677 EOF
6678
6679         ;;
6680 esac
6681
6682 case $cf_cv_term_header in
6683 (ncurses/term.h)
6684
6685 cat >>confdefs.h <<\EOF
6686 #define HAVE_NCURSES_TERM_H 1
6687 EOF
6688
6689         ;;
6690 (ncursesw/term.h)
6691
6692 cat >>confdefs.h <<\EOF
6693 #define HAVE_NCURSESW_TERM_H 1
6694 EOF
6695
6696         ;;
6697 esac
6698
6699 # some applications need this, but should check for NCURSES_VERSION
6700
6701 cat >>confdefs.h <<\EOF
6702 #define NCURSES 1
6703 EOF
6704
6705 echo "$as_me:6705: checking for ncurses version" >&5
6706 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
6707 if test "${cf_cv_ncurses_version+set}" = set; then
6708   echo $ECHO_N "(cached) $ECHO_C" >&6
6709 else
6710
6711         cf_cv_ncurses_version=no
6712         cf_tempfile=out$$
6713         rm -f $cf_tempfile
6714         if test "$cross_compiling" = yes; then
6715
6716         # This will not work if the preprocessor splits the line after the
6717         # Autoconf token.  The 'unproto' program does that.
6718         cat > conftest.$ac_ext <<EOF
6719 #include <${cf_cv_ncurses_header:-curses.h}>
6720 #undef Autoconf
6721 #ifdef NCURSES_VERSION
6722 Autoconf NCURSES_VERSION
6723 #else
6724 #ifdef __NCURSES_H
6725 Autoconf "old"
6726 #endif
6727 ;
6728 #endif
6729 EOF
6730         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
6731         { (eval echo "$as_me:6731: \"$cf_try\"") >&5
6732   (eval $cf_try) 2>&5
6733   ac_status=$?
6734   echo "$as_me:6734: \$? = $ac_status" >&5
6735   (exit $ac_status); }
6736         if test -f conftest.out ; then
6737                 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
6738                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
6739                 rm -f conftest.out
6740         fi
6741
6742 else
6743   cat >conftest.$ac_ext <<_ACEOF
6744 #line 6744 "configure"
6745 #include "confdefs.h"
6746
6747 #include <${cf_cv_ncurses_header:-curses.h}>
6748 #include <stdio.h>
6749 int main()
6750 {
6751         FILE *fp = fopen("$cf_tempfile", "w");
6752 #ifdef NCURSES_VERSION
6753 # ifdef NCURSES_VERSION_PATCH
6754         fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
6755 # else
6756         fprintf(fp, "%s\n", NCURSES_VERSION);
6757 # endif
6758 #else
6759 # ifdef __NCURSES_H
6760         fprintf(fp, "old\n");
6761 # else
6762         make an error
6763 # endif
6764 #endif
6765         ${cf_cv_main_return:-return}(0);
6766 }
6767 _ACEOF
6768 rm -f conftest$ac_exeext
6769 if { (eval echo "$as_me:6769: \"$ac_link\"") >&5
6770   (eval $ac_link) 2>&5
6771   ac_status=$?
6772   echo "$as_me:6772: \$? = $ac_status" >&5
6773   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
6774   { (eval echo "$as_me:6774: \"$ac_try\"") >&5
6775   (eval $ac_try) 2>&5
6776   ac_status=$?
6777   echo "$as_me:6777: \$? = $ac_status" >&5
6778   (exit $ac_status); }; }; then
6779
6780         cf_cv_ncurses_version=`cat $cf_tempfile`
6781 else
6782   echo "$as_me: program exited with status $ac_status" >&5
6783 echo "$as_me: failed program was:" >&5
6784 cat conftest.$ac_ext >&5
6785 fi
6786 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
6787 fi
6788         rm -f $cf_tempfile
6789
6790 fi
6791 echo "$as_me:6791: result: $cf_cv_ncurses_version" >&5
6792 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
6793 test "$cf_cv_ncurses_version" = no ||
6794 cat >>confdefs.h <<\EOF
6795 #define NCURSES 1
6796 EOF
6797
6798 cf_nculib_root=ncursesw
6799         # This works, except for the special case where we find gpm, but
6800         # ncurses is in a nonstandard location via $LIBS, and we really want
6801         # to link gpm.
6802 cf_ncurses_LIBS=""
6803 cf_ncurses_SAVE="$LIBS"
6804 echo "$as_me:6804: checking for Gpm_Open in -lgpm" >&5
6805 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
6806 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
6807   echo $ECHO_N "(cached) $ECHO_C" >&6
6808 else
6809   ac_check_lib_save_LIBS=$LIBS
6810 LIBS="-lgpm  $LIBS"
6811 cat >conftest.$ac_ext <<_ACEOF
6812 #line 6812 "configure"
6813 #include "confdefs.h"
6814
6815 /* Override any gcc2 internal prototype to avoid an error.  */
6816 #ifdef __cplusplus
6817 extern "C"
6818 #endif
6819 /* We use char because int might match the return type of a gcc2
6820    builtin and then its argument prototype would still apply.  */
6821 char Gpm_Open ();
6822 int
6823 main ()
6824 {
6825 Gpm_Open ();
6826   ;
6827   return 0;
6828 }
6829 _ACEOF
6830 rm -f conftest.$ac_objext conftest$ac_exeext
6831 if { (eval echo "$as_me:6831: \"$ac_link\"") >&5
6832   (eval $ac_link) 2>&5
6833   ac_status=$?
6834   echo "$as_me:6834: \$? = $ac_status" >&5
6835   (exit $ac_status); } &&
6836          { ac_try='test -s conftest$ac_exeext'
6837   { (eval echo "$as_me:6837: \"$ac_try\"") >&5
6838   (eval $ac_try) 2>&5
6839   ac_status=$?
6840   echo "$as_me:6840: \$? = $ac_status" >&5
6841   (exit $ac_status); }; }; then
6842   ac_cv_lib_gpm_Gpm_Open=yes
6843 else
6844   echo "$as_me: failed program was:" >&5
6845 cat conftest.$ac_ext >&5
6846 ac_cv_lib_gpm_Gpm_Open=no
6847 fi
6848 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6849 LIBS=$ac_check_lib_save_LIBS
6850 fi
6851 echo "$as_me:6851: result: $ac_cv_lib_gpm_Gpm_Open" >&5
6852 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
6853 if test $ac_cv_lib_gpm_Gpm_Open = yes; then
6854   echo "$as_me:6854: checking for initscr in -lgpm" >&5
6855 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
6856 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
6857   echo $ECHO_N "(cached) $ECHO_C" >&6
6858 else
6859   ac_check_lib_save_LIBS=$LIBS
6860 LIBS="-lgpm  $LIBS"
6861 cat >conftest.$ac_ext <<_ACEOF
6862 #line 6862 "configure"
6863 #include "confdefs.h"
6864
6865 /* Override any gcc2 internal prototype to avoid an error.  */
6866 #ifdef __cplusplus
6867 extern "C"
6868 #endif
6869 /* We use char because int might match the return type of a gcc2
6870    builtin and then its argument prototype would still apply.  */
6871 char initscr ();
6872 int
6873 main ()
6874 {
6875 initscr ();
6876   ;
6877   return 0;
6878 }
6879 _ACEOF
6880 rm -f conftest.$ac_objext conftest$ac_exeext
6881 if { (eval echo "$as_me:6881: \"$ac_link\"") >&5
6882   (eval $ac_link) 2>&5
6883   ac_status=$?
6884   echo "$as_me:6884: \$? = $ac_status" >&5
6885   (exit $ac_status); } &&
6886          { ac_try='test -s conftest$ac_exeext'
6887   { (eval echo "$as_me:6887: \"$ac_try\"") >&5
6888   (eval $ac_try) 2>&5
6889   ac_status=$?
6890   echo "$as_me:6890: \$? = $ac_status" >&5
6891   (exit $ac_status); }; }; then
6892   ac_cv_lib_gpm_initscr=yes
6893 else
6894   echo "$as_me: failed program was:" >&5
6895 cat conftest.$ac_ext >&5
6896 ac_cv_lib_gpm_initscr=no
6897 fi
6898 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6899 LIBS=$ac_check_lib_save_LIBS
6900 fi
6901 echo "$as_me:6901: result: $ac_cv_lib_gpm_initscr" >&5
6902 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
6903 if test $ac_cv_lib_gpm_initscr = yes; then
6904   LIBS="$cf_ncurses_SAVE"
6905 else
6906   cf_ncurses_LIBS="-lgpm"
6907 fi
6908
6909 fi
6910
6911 case $host_os in
6912 (freebsd*)
6913         # This is only necessary if you are linking against an obsolete
6914         # version of ncurses (but it should do no harm, since it's static).
6915         if test "$cf_nculib_root" = ncurses ; then
6916                 echo "$as_me:6916: checking for tgoto in -lmytinfo" >&5
6917 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
6918 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
6919   echo $ECHO_N "(cached) $ECHO_C" >&6
6920 else
6921   ac_check_lib_save_LIBS=$LIBS
6922 LIBS="-lmytinfo  $LIBS"
6923 cat >conftest.$ac_ext <<_ACEOF
6924 #line 6924 "configure"
6925 #include "confdefs.h"
6926
6927 /* Override any gcc2 internal prototype to avoid an error.  */
6928 #ifdef __cplusplus
6929 extern "C"
6930 #endif
6931 /* We use char because int might match the return type of a gcc2
6932    builtin and then its argument prototype would still apply.  */
6933 char tgoto ();
6934 int
6935 main ()
6936 {
6937 tgoto ();
6938   ;
6939   return 0;
6940 }
6941 _ACEOF
6942 rm -f conftest.$ac_objext conftest$ac_exeext
6943 if { (eval echo "$as_me:6943: \"$ac_link\"") >&5
6944   (eval $ac_link) 2>&5
6945   ac_status=$?
6946   echo "$as_me:6946: \$? = $ac_status" >&5
6947   (exit $ac_status); } &&
6948          { ac_try='test -s conftest$ac_exeext'
6949   { (eval echo "$as_me:6949: \"$ac_try\"") >&5
6950   (eval $ac_try) 2>&5
6951   ac_status=$?
6952   echo "$as_me:6952: \$? = $ac_status" >&5
6953   (exit $ac_status); }; }; then
6954   ac_cv_lib_mytinfo_tgoto=yes
6955 else
6956   echo "$as_me: failed program was:" >&5
6957 cat conftest.$ac_ext >&5
6958 ac_cv_lib_mytinfo_tgoto=no
6959 fi
6960 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6961 LIBS=$ac_check_lib_save_LIBS
6962 fi
6963 echo "$as_me:6963: result: $ac_cv_lib_mytinfo_tgoto" >&5
6964 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
6965 if test $ac_cv_lib_mytinfo_tgoto = yes; then
6966   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
6967 fi
6968
6969         fi
6970         ;;
6971 esac
6972
6973 cf_add_libs="$cf_ncurses_LIBS"
6974 # Filter out duplicates - this happens with badly-designed ".pc" files...
6975 for cf_add_1lib in $LIBS
6976 do
6977         for cf_add_2lib in $cf_add_libs
6978         do
6979                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
6980                 then
6981                         cf_add_1lib=
6982                         break
6983                 fi
6984         done
6985         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
6986 done
6987 LIBS="$cf_add_libs"
6988
6989 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
6990 then
6991
6992 cf_add_libs="-l$cf_nculib_root"
6993 # Filter out duplicates - this happens with badly-designed ".pc" files...
6994 for cf_add_1lib in $LIBS
6995 do
6996         for cf_add_2lib in $cf_add_libs
6997         do
6998                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
6999                 then
7000                         cf_add_1lib=
7001                         break
7002                 fi
7003         done
7004         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
7005 done
7006 LIBS="$cf_add_libs"
7007
7008 else
7009
7010         eval 'cf_cv_have_lib_'$cf_nculib_root'=no'
7011         cf_libdir=""
7012         echo "$as_me:7012: checking for initscr" >&5
7013 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
7014 if test "${ac_cv_func_initscr+set}" = set; then
7015   echo $ECHO_N "(cached) $ECHO_C" >&6
7016 else
7017   cat >conftest.$ac_ext <<_ACEOF
7018 #line 7018 "configure"
7019 #include "confdefs.h"
7020 /* System header to define __stub macros and hopefully few prototypes,
7021     which can conflict with char initscr (); below.  */
7022 #include <assert.h>
7023 /* Override any gcc2 internal prototype to avoid an error.  */
7024 #ifdef __cplusplus
7025 extern "C"
7026 #endif
7027 /* We use char because int might match the return type of a gcc2
7028    builtin and then its argument prototype would still apply.  */
7029 char initscr ();
7030 char (*f) ();
7031
7032 int
7033 main ()
7034 {
7035 /* The GNU C library defines this for functions which it implements
7036     to always fail with ENOSYS.  Some functions are actually named
7037     something starting with __ and the normal name is an alias.  */
7038 #if defined (__stub_initscr) || defined (__stub___initscr)
7039 choke me
7040 #else
7041 f = initscr; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
7042 #endif
7043
7044   ;
7045   return 0;
7046 }
7047 _ACEOF
7048 rm -f conftest.$ac_objext conftest$ac_exeext
7049 if { (eval echo "$as_me:7049: \"$ac_link\"") >&5
7050   (eval $ac_link) 2>&5
7051   ac_status=$?
7052   echo "$as_me:7052: \$? = $ac_status" >&5
7053   (exit $ac_status); } &&
7054          { ac_try='test -s conftest$ac_exeext'
7055   { (eval echo "$as_me:7055: \"$ac_try\"") >&5
7056   (eval $ac_try) 2>&5
7057   ac_status=$?
7058   echo "$as_me:7058: \$? = $ac_status" >&5
7059   (exit $ac_status); }; }; then
7060   ac_cv_func_initscr=yes
7061 else
7062   echo "$as_me: failed program was:" >&5
7063 cat conftest.$ac_ext >&5
7064 ac_cv_func_initscr=no
7065 fi
7066 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7067 fi
7068 echo "$as_me:7068: result: $ac_cv_func_initscr" >&5
7069 echo "${ECHO_T}$ac_cv_func_initscr" >&6
7070 if test $ac_cv_func_initscr = yes; then
7071   eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
7072 else
7073
7074                 cf_save_LIBS="$LIBS"
7075                 echo "$as_me:7075: checking for initscr in -l$cf_nculib_root" >&5
7076 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
7077                 LIBS="-l$cf_nculib_root $LIBS"
7078                 cat >conftest.$ac_ext <<_ACEOF
7079 #line 7079 "configure"
7080 #include "confdefs.h"
7081 #include <${cf_cv_ncurses_header:-curses.h}>
7082 int
7083 main ()
7084 {
7085 initscr()
7086   ;
7087   return 0;
7088 }
7089 _ACEOF
7090 rm -f conftest.$ac_objext conftest$ac_exeext
7091 if { (eval echo "$as_me:7091: \"$ac_link\"") >&5
7092   (eval $ac_link) 2>&5
7093   ac_status=$?
7094   echo "$as_me:7094: \$? = $ac_status" >&5
7095   (exit $ac_status); } &&
7096          { ac_try='test -s conftest$ac_exeext'
7097   { (eval echo "$as_me:7097: \"$ac_try\"") >&5
7098   (eval $ac_try) 2>&5
7099   ac_status=$?
7100   echo "$as_me:7100: \$? = $ac_status" >&5
7101   (exit $ac_status); }; }; then
7102   echo "$as_me:7102: result: yes" >&5
7103 echo "${ECHO_T}yes" >&6
7104                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
7105
7106 else
7107   echo "$as_me: failed program was:" >&5
7108 cat conftest.$ac_ext >&5
7109 echo "$as_me:7109: result: no" >&5
7110 echo "${ECHO_T}no" >&6
7111
7112 cf_search=
7113 cf_library_path_list=""
7114 if test -n "${LDFLAGS}${LIBS}" ; then
7115         for cf_library_path in $LDFLAGS $LIBS
7116         do
7117                 case $cf_library_path in
7118                 (-L*)
7119                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
7120
7121 test "x$cf_library_path" != "xNONE" && \
7122 test -d "$cf_library_path" && \
7123  {
7124         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
7125         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
7126         test -d $cf_library_path/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
7127         test -d $cf_library_path/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
7128         test -d $cf_library_path/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
7129         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"
7130 }
7131
7132                         cf_library_path_list="$cf_library_path_list $cf_search"
7133                         ;;
7134                 esac
7135         done
7136 fi
7137
7138 cf_search=
7139
7140 test "x$prefix" != "xNONE" && \
7141 test -d "$prefix" && \
7142  {
7143         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
7144         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
7145         test -d $prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
7146         test -d $prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
7147         test -d $prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
7148         test -d $prefix/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
7149 }
7150
7151 for cf_subdir_prefix in \
7152         /usr \
7153         /usr/local \
7154         /usr/pkg \
7155         /opt \
7156         /opt/local \
7157         $HOME
7158 do
7159
7160 test "x$cf_subdir_prefix" != "x$prefix" && \
7161 test -d "$cf_subdir_prefix" && \
7162 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
7163         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
7164         test -d $cf_subdir_prefix/lib &&          cf_search="$cf_search $cf_subdir_prefix/lib"
7165         test -d $cf_subdir_prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root"
7166         test -d $cf_subdir_prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root/lib"
7167         test -d $cf_subdir_prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib"
7168         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"
7169 }
7170
7171 done
7172
7173 cf_search="$cf_library_path_list $cf_search"
7174
7175                         for cf_libdir in $cf_search
7176                         do
7177                                 echo "$as_me:7177: checking for -l$cf_nculib_root in $cf_libdir" >&5
7178 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
7179                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
7180                                 cat >conftest.$ac_ext <<_ACEOF
7181 #line 7181 "configure"
7182 #include "confdefs.h"
7183 #include <${cf_cv_ncurses_header:-curses.h}>
7184 int
7185 main ()
7186 {
7187 initscr()
7188   ;
7189   return 0;
7190 }
7191 _ACEOF
7192 rm -f conftest.$ac_objext conftest$ac_exeext
7193 if { (eval echo "$as_me:7193: \"$ac_link\"") >&5
7194   (eval $ac_link) 2>&5
7195   ac_status=$?
7196   echo "$as_me:7196: \$? = $ac_status" >&5
7197   (exit $ac_status); } &&
7198          { ac_try='test -s conftest$ac_exeext'
7199   { (eval echo "$as_me:7199: \"$ac_try\"") >&5
7200   (eval $ac_try) 2>&5
7201   ac_status=$?
7202   echo "$as_me:7202: \$? = $ac_status" >&5
7203   (exit $ac_status); }; }; then
7204   echo "$as_me:7204: result: yes" >&5
7205 echo "${ECHO_T}yes" >&6
7206                                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
7207                                          break
7208 else
7209   echo "$as_me: failed program was:" >&5
7210 cat conftest.$ac_ext >&5
7211 echo "$as_me:7211: result: no" >&5
7212 echo "${ECHO_T}no" >&6
7213                                          LIBS="$cf_save_LIBS"
7214 fi
7215 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7216                         done
7217
7218 fi
7219 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7220
7221 fi
7222
7223 eval 'cf_found_library=$cf_cv_have_lib_'$cf_nculib_root
7224
7225 if test $cf_found_library = no ; then
7226         { { echo "$as_me:7226: error: Cannot link $cf_nculib_root library" >&5
7227 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
7228    { (exit 1); exit 1; }; }
7229 fi
7230
7231 fi
7232
7233 if test -n "$cf_ncurses_LIBS" ; then
7234         echo "$as_me:7234: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
7235 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
7236         cf_ncurses_SAVE="$LIBS"
7237         for p in $cf_ncurses_LIBS ; do
7238                 q=`echo $LIBS | sed -e "s%$p %%" -e "s%$p$%%"`
7239                 if test "$q" != "$LIBS" ; then
7240                         LIBS="$q"
7241                 fi
7242         done
7243         cat >conftest.$ac_ext <<_ACEOF
7244 #line 7244 "configure"
7245 #include "confdefs.h"
7246 #include <${cf_cv_ncurses_header:-curses.h}>
7247 int
7248 main ()
7249 {
7250 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
7251   ;
7252   return 0;
7253 }
7254 _ACEOF
7255 rm -f conftest.$ac_objext conftest$ac_exeext
7256 if { (eval echo "$as_me:7256: \"$ac_link\"") >&5
7257   (eval $ac_link) 2>&5
7258   ac_status=$?
7259   echo "$as_me:7259: \$? = $ac_status" >&5
7260   (exit $ac_status); } &&
7261          { ac_try='test -s conftest$ac_exeext'
7262   { (eval echo "$as_me:7262: \"$ac_try\"") >&5
7263   (eval $ac_try) 2>&5
7264   ac_status=$?
7265   echo "$as_me:7265: \$? = $ac_status" >&5
7266   (exit $ac_status); }; }; then
7267   echo "$as_me:7267: result: yes" >&5
7268 echo "${ECHO_T}yes" >&6
7269 else
7270   echo "$as_me: failed program was:" >&5
7271 cat conftest.$ac_ext >&5
7272 echo "$as_me:7272: result: no" >&5
7273 echo "${ECHO_T}no" >&6
7274                  LIBS="$cf_ncurses_SAVE"
7275 fi
7276 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7277 fi
7278
7279 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
7280
7281 cat >>confdefs.h <<EOF
7282 #define $cf_nculib_ROOT 1
7283 EOF
7284
7285         fi
7286 else
7287         NCURSES_CONFIG=none
7288 fi
7289
7290 else
7291
7292 cf_ncuconfig_root=ncurses
7293 cf_have_ncuconfig=no
7294
7295 if test "x$PKG_CONFIG" != xnone; then
7296         echo "$as_me:7296: checking pkg-config for $cf_ncuconfig_root" >&5
7297 echo $ECHO_N "checking pkg-config for $cf_ncuconfig_root... $ECHO_C" >&6
7298         if "$PKG_CONFIG" --exists $cf_ncuconfig_root ; then
7299                 echo "$as_me:7299: result: yes" >&5
7300 echo "${ECHO_T}yes" >&6
7301
7302                 echo "$as_me:7302: checking if the $cf_ncuconfig_root package files work" >&5
7303 echo $ECHO_N "checking if the $cf_ncuconfig_root package files work... $ECHO_C" >&6
7304                 cf_have_ncuconfig=unknown
7305
7306                 cf_save_CPPFLAGS="$CPPFLAGS"
7307                 cf_save_LIBS="$LIBS"
7308
7309                 CPPFLAGS="$CPPFLAGS `$PKG_CONFIG --cflags $cf_ncuconfig_root`"
7310
7311 cf_add_libs="`$PKG_CONFIG --libs $cf_ncuconfig_root`"
7312 # Filter out duplicates - this happens with badly-designed ".pc" files...
7313 for cf_add_1lib in $LIBS
7314 do
7315         for cf_add_2lib in $cf_add_libs
7316         do
7317                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
7318                 then
7319                         cf_add_1lib=
7320                         break
7321                 fi
7322         done
7323         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
7324 done
7325 LIBS="$cf_add_libs"
7326
7327                 cat >conftest.$ac_ext <<_ACEOF
7328 #line 7328 "configure"
7329 #include "confdefs.h"
7330 #include <${cf_cv_ncurses_header:-curses.h}>
7331 int
7332 main ()
7333 {
7334 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
7335   ;
7336   return 0;
7337 }
7338 _ACEOF
7339 rm -f conftest.$ac_objext conftest$ac_exeext
7340 if { (eval echo "$as_me:7340: \"$ac_link\"") >&5
7341   (eval $ac_link) 2>&5
7342   ac_status=$?
7343   echo "$as_me:7343: \$? = $ac_status" >&5
7344   (exit $ac_status); } &&
7345          { ac_try='test -s conftest$ac_exeext'
7346   { (eval echo "$as_me:7346: \"$ac_try\"") >&5
7347   (eval $ac_try) 2>&5
7348   ac_status=$?
7349   echo "$as_me:7349: \$? = $ac_status" >&5
7350   (exit $ac_status); }; }; then
7351   if test "$cross_compiling" = yes; then
7352   cf_have_ncuconfig=unknown
7353 else
7354   cat >conftest.$ac_ext <<_ACEOF
7355 #line 7355 "configure"
7356 #include "confdefs.h"
7357 #include <${cf_cv_ncurses_header:-curses.h}>
7358                                 int main(void)
7359                                 { char *xx = curses_version(); return (xx == 0); }
7360 _ACEOF
7361 rm -f conftest$ac_exeext
7362 if { (eval echo "$as_me:7362: \"$ac_link\"") >&5
7363   (eval $ac_link) 2>&5
7364   ac_status=$?
7365   echo "$as_me:7365: \$? = $ac_status" >&5
7366   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
7367   { (eval echo "$as_me:7367: \"$ac_try\"") >&5
7368   (eval $ac_try) 2>&5
7369   ac_status=$?
7370   echo "$as_me:7370: \$? = $ac_status" >&5
7371   (exit $ac_status); }; }; then
7372   cf_have_ncuconfig=yes
7373 else
7374   echo "$as_me: program exited with status $ac_status" >&5
7375 echo "$as_me: failed program was:" >&5
7376 cat conftest.$ac_ext >&5
7377 cf_have_ncuconfig=no
7378 fi
7379 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
7380 fi
7381 else
7382   echo "$as_me: failed program was:" >&5
7383 cat conftest.$ac_ext >&5
7384 cf_have_ncuconfig=no
7385 fi
7386 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7387
7388                 echo "$as_me:7388: result: $cf_have_ncuconfig" >&5
7389 echo "${ECHO_T}$cf_have_ncuconfig" >&6
7390                 if test "$cf_have_ncuconfig" != "yes"
7391                 then
7392                         CPPFLAGS="$cf_save_CPPFLAGS"
7393                         LIBS="$cf_save_LIBS"
7394                         NCURSES_CONFIG_PKG=none
7395                 else
7396
7397 cat >>confdefs.h <<\EOF
7398 #define NCURSES 1
7399 EOF
7400
7401                         NCURSES_CONFIG_PKG=$cf_ncuconfig_root
7402                 fi
7403
7404         else
7405                 echo "$as_me:7405: result: no" >&5
7406 echo "${ECHO_T}no" >&6
7407                 NCURSES_CONFIG_PKG=none
7408         fi
7409 else
7410         NCURSES_CONFIG_PKG=none
7411 fi
7412
7413 if test "x$cf_have_ncuconfig" = "xno"; then
7414         echo "Looking for ${cf_ncuconfig_root}-config"
7415
7416 if test -n "$ac_tool_prefix"; then
7417   for ac_prog in ${cf_ncuconfig_root}-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
7418   do
7419     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
7420 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
7421 echo "$as_me:7421: checking for $ac_word" >&5
7422 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
7423 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
7424   echo $ECHO_N "(cached) $ECHO_C" >&6
7425 else
7426   if test -n "$NCURSES_CONFIG"; then
7427   ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
7428 else
7429   ac_save_IFS=$IFS; IFS=$ac_path_separator
7430 ac_dummy="$PATH"
7431 for ac_dir in $ac_dummy; do
7432   IFS=$ac_save_IFS
7433   test -z "$ac_dir" && ac_dir=.
7434   $as_executable_p "$ac_dir/$ac_word" || continue
7435 ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
7436 echo "$as_me:7436: found $ac_dir/$ac_word" >&5
7437 break
7438 done
7439
7440 fi
7441 fi
7442 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
7443 if test -n "$NCURSES_CONFIG"; then
7444   echo "$as_me:7444: result: $NCURSES_CONFIG" >&5
7445 echo "${ECHO_T}$NCURSES_CONFIG" >&6
7446 else
7447   echo "$as_me:7447: result: no" >&5
7448 echo "${ECHO_T}no" >&6
7449 fi
7450
7451     test -n "$NCURSES_CONFIG" && break
7452   done
7453 fi
7454 if test -z "$NCURSES_CONFIG"; then
7455   ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
7456   for ac_prog in ${cf_ncuconfig_root}-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
7457 do
7458   # Extract the first word of "$ac_prog", so it can be a program name with args.
7459 set dummy $ac_prog; ac_word=$2
7460 echo "$as_me:7460: checking for $ac_word" >&5
7461 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
7462 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
7463   echo $ECHO_N "(cached) $ECHO_C" >&6
7464 else
7465   if test -n "$ac_ct_NCURSES_CONFIG"; then
7466   ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
7467 else
7468   ac_save_IFS=$IFS; IFS=$ac_path_separator
7469 ac_dummy="$PATH"
7470 for ac_dir in $ac_dummy; do
7471   IFS=$ac_save_IFS
7472   test -z "$ac_dir" && ac_dir=.
7473   $as_executable_p "$ac_dir/$ac_word" || continue
7474 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
7475 echo "$as_me:7475: found $ac_dir/$ac_word" >&5
7476 break
7477 done
7478
7479 fi
7480 fi
7481 ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
7482 if test -n "$ac_ct_NCURSES_CONFIG"; then
7483   echo "$as_me:7483: result: $ac_ct_NCURSES_CONFIG" >&5
7484 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
7485 else
7486   echo "$as_me:7486: result: no" >&5
7487 echo "${ECHO_T}no" >&6
7488 fi
7489
7490   test -n "$ac_ct_NCURSES_CONFIG" && break
7491 done
7492 test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
7493
7494   NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
7495 fi
7496
7497         if test "$NCURSES_CONFIG" != none ; then
7498
7499                 CPPFLAGS="$CPPFLAGS `$NCURSES_CONFIG --cflags`"
7500
7501 cf_add_libs="`$NCURSES_CONFIG --libs`"
7502 # Filter out duplicates - this happens with badly-designed ".pc" files...
7503 for cf_add_1lib in $LIBS
7504 do
7505         for cf_add_2lib in $cf_add_libs
7506         do
7507                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
7508                 then
7509                         cf_add_1lib=
7510                         break
7511                 fi
7512         done
7513         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
7514 done
7515 LIBS="$cf_add_libs"
7516
7517                 # even with config script, some packages use no-override for curses.h
7518
7519 echo "$as_me:7519: checking if we have identified curses headers" >&5
7520 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
7521 if test "${cf_cv_ncurses_header+set}" = set; then
7522   echo $ECHO_N "(cached) $ECHO_C" >&6
7523 else
7524
7525 cf_cv_ncurses_header=none
7526 for cf_header in \
7527         ncurses.h ncurses/ncurses.h \
7528         curses.h ncurses/curses.h
7529 do
7530 cat >conftest.$ac_ext <<_ACEOF
7531 #line 7531 "configure"
7532 #include "confdefs.h"
7533 #include <${cf_header}>
7534 int
7535 main ()
7536 {
7537 initscr(); tgoto("?", 0,0)
7538   ;
7539   return 0;
7540 }
7541 _ACEOF
7542 rm -f conftest.$ac_objext
7543 if { (eval echo "$as_me:7543: \"$ac_compile\"") >&5
7544   (eval $ac_compile) 2>&5
7545   ac_status=$?
7546   echo "$as_me:7546: \$? = $ac_status" >&5
7547   (exit $ac_status); } &&
7548          { ac_try='test -s conftest.$ac_objext'
7549   { (eval echo "$as_me:7549: \"$ac_try\"") >&5
7550   (eval $ac_try) 2>&5
7551   ac_status=$?
7552   echo "$as_me:7552: \$? = $ac_status" >&5
7553   (exit $ac_status); }; }; then
7554   cf_cv_ncurses_header=$cf_header; break
7555 else
7556   echo "$as_me: failed program was:" >&5
7557 cat conftest.$ac_ext >&5
7558 fi
7559 rm -f conftest.$ac_objext conftest.$ac_ext
7560 done
7561
7562 fi
7563 echo "$as_me:7563: result: $cf_cv_ncurses_header" >&5
7564 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
7565
7566 if test "$cf_cv_ncurses_header" = none ; then
7567         { { echo "$as_me:7567: error: No curses header-files found" >&5
7568 echo "$as_me: error: No curses header-files found" >&2;}
7569    { (exit 1); exit 1; }; }
7570 fi
7571
7572 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
7573
7574 for ac_header in $cf_cv_ncurses_header
7575 do
7576 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
7577 echo "$as_me:7577: checking for $ac_header" >&5
7578 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
7579 if eval "test \"\${$as_ac_Header+set}\" = set"; then
7580   echo $ECHO_N "(cached) $ECHO_C" >&6
7581 else
7582   cat >conftest.$ac_ext <<_ACEOF
7583 #line 7583 "configure"
7584 #include "confdefs.h"
7585 #include <$ac_header>
7586 _ACEOF
7587 if { (eval echo "$as_me:7587: \"$ac_cpp conftest.$ac_ext\"") >&5
7588   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
7589   ac_status=$?
7590   egrep -v '^ *\+' conftest.er1 >conftest.err
7591   rm -f conftest.er1
7592   cat conftest.err >&5
7593   echo "$as_me:7593: \$? = $ac_status" >&5
7594   (exit $ac_status); } >/dev/null; then
7595   if test -s conftest.err; then
7596     ac_cpp_err=$ac_c_preproc_warn_flag
7597   else
7598     ac_cpp_err=
7599   fi
7600 else
7601   ac_cpp_err=yes
7602 fi
7603 if test -z "$ac_cpp_err"; then
7604   eval "$as_ac_Header=yes"
7605 else
7606   echo "$as_me: failed program was:" >&5
7607   cat conftest.$ac_ext >&5
7608   eval "$as_ac_Header=no"
7609 fi
7610 rm -f conftest.err conftest.$ac_ext
7611 fi
7612 echo "$as_me:7612: result: `eval echo '${'$as_ac_Header'}'`" >&5
7613 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
7614 if test `eval echo '${'$as_ac_Header'}'` = yes; then
7615   cat >>confdefs.h <<EOF
7616 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
7617 EOF
7618
7619 fi
7620 done
7621
7622 cat >>confdefs.h <<\EOF
7623 #define NCURSES 1
7624 EOF
7625
7626 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
7627
7628                 cat >>confdefs.h <<EOF
7629 #define $cf_nculib_ROOT 1
7630 EOF
7631
7632                                 cf_cv_ncurses_version=`$NCURSES_CONFIG --version`
7633
7634         else
7635
7636 cf_ncuhdr_root=ncurses
7637
7638 test -n "$cf_cv_curses_dir" && \
7639 test "$cf_cv_curses_dir" != "no" && { \
7640
7641 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
7642   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
7643   do
7644         while test $cf_add_incdir != /usr/include
7645         do
7646           if test -d $cf_add_incdir
7647           then
7648                 cf_have_incdir=no
7649                 if test -n "$CFLAGS$CPPFLAGS" ; then
7650                   # a loop is needed to ensure we can add subdirs of existing dirs
7651                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
7652                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
7653                           cf_have_incdir=yes; break
7654                         fi
7655                   done
7656                 fi
7657
7658                 if test "$cf_have_incdir" = no ; then
7659                   if test "$cf_add_incdir" = /usr/local/include ; then
7660                         if test "$GCC" = yes
7661                         then
7662                           cf_save_CPPFLAGS=$CPPFLAGS
7663                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
7664                           cat >conftest.$ac_ext <<_ACEOF
7665 #line 7665 "configure"
7666 #include "confdefs.h"
7667 #include <stdio.h>
7668 int
7669 main ()
7670 {
7671 printf("Hello")
7672   ;
7673   return 0;
7674 }
7675 _ACEOF
7676 rm -f conftest.$ac_objext
7677 if { (eval echo "$as_me:7677: \"$ac_compile\"") >&5
7678   (eval $ac_compile) 2>&5
7679   ac_status=$?
7680   echo "$as_me:7680: \$? = $ac_status" >&5
7681   (exit $ac_status); } &&
7682          { ac_try='test -s conftest.$ac_objext'
7683   { (eval echo "$as_me:7683: \"$ac_try\"") >&5
7684   (eval $ac_try) 2>&5
7685   ac_status=$?
7686   echo "$as_me:7686: \$? = $ac_status" >&5
7687   (exit $ac_status); }; }; then
7688   :
7689 else
7690   echo "$as_me: failed program was:" >&5
7691 cat conftest.$ac_ext >&5
7692 cf_have_incdir=yes
7693 fi
7694 rm -f conftest.$ac_objext conftest.$ac_ext
7695                           CPPFLAGS=$cf_save_CPPFLAGS
7696                         fi
7697                   fi
7698                 fi
7699
7700                 if test "$cf_have_incdir" = no ; then
7701                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
7702
7703 echo "${as_me:-configure}:7703: testing adding $cf_add_incdir to include-path ..." 1>&5
7704
7705                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
7706
7707                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
7708                   test "$cf_top_incdir" = "$cf_add_incdir" && break
7709                   cf_add_incdir="$cf_top_incdir"
7710                 else
7711                   break
7712                 fi
7713           else
7714                 break
7715           fi
7716         done
7717   done
7718 fi
7719
7720 }
7721
7722 echo "$as_me:7722: checking for $cf_ncuhdr_root header in include-path" >&5
7723 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
7724 if test "${cf_cv_ncurses_h+set}" = set; then
7725   echo $ECHO_N "(cached) $ECHO_C" >&6
7726 else
7727
7728         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
7729         ( test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw ) && cf_header_list="$cf_header_list curses.h ncurses.h"
7730         for cf_header in $cf_header_list
7731         do
7732
7733         cat >conftest.$ac_ext <<_ACEOF
7734 #line 7734 "configure"
7735 #include "confdefs.h"
7736
7737 #include <$cf_header>
7738 int
7739 main ()
7740 {
7741
7742 #ifdef NCURSES_VERSION
7743
7744 printf("%s\n", NCURSES_VERSION);
7745 #else
7746 #ifdef __NCURSES_H
7747 printf("old\n");
7748 #else
7749         make an error
7750 #endif
7751 #endif
7752
7753   ;
7754   return 0;
7755 }
7756 _ACEOF
7757 rm -f conftest.$ac_objext
7758 if { (eval echo "$as_me:7758: \"$ac_compile\"") >&5
7759   (eval $ac_compile) 2>&5
7760   ac_status=$?
7761   echo "$as_me:7761: \$? = $ac_status" >&5
7762   (exit $ac_status); } &&
7763          { ac_try='test -s conftest.$ac_objext'
7764   { (eval echo "$as_me:7764: \"$ac_try\"") >&5
7765   (eval $ac_try) 2>&5
7766   ac_status=$?
7767   echo "$as_me:7767: \$? = $ac_status" >&5
7768   (exit $ac_status); }; }; then
7769   cf_cv_ncurses_h=$cf_header
7770
7771 else
7772   echo "$as_me: failed program was:" >&5
7773 cat conftest.$ac_ext >&5
7774 cf_cv_ncurses_h=no
7775 fi
7776 rm -f conftest.$ac_objext conftest.$ac_ext
7777
7778                 test "$cf_cv_ncurses_h" != no && break
7779         done
7780
7781 fi
7782 echo "$as_me:7782: result: $cf_cv_ncurses_h" >&5
7783 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
7784
7785 if test "$cf_cv_ncurses_h" != no ; then
7786         cf_cv_ncurses_header=$cf_cv_ncurses_h
7787 else
7788
7789 echo "$as_me:7789: checking for $cf_ncuhdr_root include-path" >&5
7790 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
7791 if test "${cf_cv_ncurses_h2+set}" = set; then
7792   echo $ECHO_N "(cached) $ECHO_C" >&6
7793 else
7794
7795         test -n "$verbose" && echo
7796
7797 cf_search=
7798
7799 # collect the current set of include-directories from compiler flags
7800 cf_header_path_list=""
7801 if test -n "${CFLAGS}${CPPFLAGS}" ; then
7802         for cf_header_path in $CPPFLAGS $CFLAGS
7803         do
7804                 case $cf_header_path in
7805                 (-I*)
7806                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
7807
7808 test "x$cf_header_path" != "xNONE" && \
7809 test -d "$cf_header_path" && \
7810  {
7811         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
7812         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
7813         test -d $cf_header_path/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
7814         test -d $cf_header_path/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
7815         test -d $cf_header_path/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
7816         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"
7817 }
7818
7819                         cf_header_path_list="$cf_header_path_list $cf_search"
7820                         ;;
7821                 esac
7822         done
7823 fi
7824
7825 # add the variations for the package we are looking for
7826
7827 cf_search=
7828
7829 test "x$prefix" != "xNONE" && \
7830 test -d "$prefix" && \
7831  {
7832         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
7833         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
7834         test -d $prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
7835         test -d $prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
7836         test -d $prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
7837         test -d $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
7838 }
7839
7840 for cf_subdir_prefix in \
7841         /usr \
7842         /usr/local \
7843         /usr/pkg \
7844         /opt \
7845         /opt/local \
7846         $HOME
7847 do
7848
7849 test "x$cf_subdir_prefix" != "x$prefix" && \
7850 test -d "$cf_subdir_prefix" && \
7851 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
7852         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
7853         test -d $cf_subdir_prefix/include &&          cf_search="$cf_search $cf_subdir_prefix/include"
7854         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root"
7855         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root/include"
7856         test -d $cf_subdir_prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include"
7857         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"
7858 }
7859
7860 done
7861
7862 test "$includedir" != NONE && \
7863 test "$includedir" != "/usr/include" && \
7864 test -d "$includedir" && {
7865         test -d $includedir &&    cf_search="$cf_search $includedir"
7866         test -d $includedir/$cf_ncuhdr_root && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
7867 }
7868
7869 test "$oldincludedir" != NONE && \
7870 test "$oldincludedir" != "/usr/include" && \
7871 test -d "$oldincludedir" && {
7872         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
7873         test -d $oldincludedir/$cf_ncuhdr_root && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
7874 }
7875
7876 cf_search="$cf_search $cf_header_path_list"
7877
7878         test -n "$verbose" && echo search path $cf_search
7879         cf_save2_CPPFLAGS="$CPPFLAGS"
7880         for cf_incdir in $cf_search
7881         do
7882
7883 if test -n "$cf_incdir" ; then
7884   for cf_add_incdir in $cf_incdir
7885   do
7886         while test $cf_add_incdir != /usr/include
7887         do
7888           if test -d $cf_add_incdir
7889           then
7890                 cf_have_incdir=no
7891                 if test -n "$CFLAGS$CPPFLAGS" ; then
7892                   # a loop is needed to ensure we can add subdirs of existing dirs
7893                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
7894                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
7895                           cf_have_incdir=yes; break
7896                         fi
7897                   done
7898                 fi
7899
7900                 if test "$cf_have_incdir" = no ; then
7901                   if test "$cf_add_incdir" = /usr/local/include ; then
7902                         if test "$GCC" = yes
7903                         then
7904                           cf_save_CPPFLAGS=$CPPFLAGS
7905                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
7906                           cat >conftest.$ac_ext <<_ACEOF
7907 #line 7907 "configure"
7908 #include "confdefs.h"
7909 #include <stdio.h>
7910 int
7911 main ()
7912 {
7913 printf("Hello")
7914   ;
7915   return 0;
7916 }
7917 _ACEOF
7918 rm -f conftest.$ac_objext
7919 if { (eval echo "$as_me:7919: \"$ac_compile\"") >&5
7920   (eval $ac_compile) 2>&5
7921   ac_status=$?
7922   echo "$as_me:7922: \$? = $ac_status" >&5
7923   (exit $ac_status); } &&
7924          { ac_try='test -s conftest.$ac_objext'
7925   { (eval echo "$as_me:7925: \"$ac_try\"") >&5
7926   (eval $ac_try) 2>&5
7927   ac_status=$?
7928   echo "$as_me:7928: \$? = $ac_status" >&5
7929   (exit $ac_status); }; }; then
7930   :
7931 else
7932   echo "$as_me: failed program was:" >&5
7933 cat conftest.$ac_ext >&5
7934 cf_have_incdir=yes
7935 fi
7936 rm -f conftest.$ac_objext conftest.$ac_ext
7937                           CPPFLAGS=$cf_save_CPPFLAGS
7938                         fi
7939                   fi
7940                 fi
7941
7942                 if test "$cf_have_incdir" = no ; then
7943                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
7944
7945 echo "${as_me:-configure}:7945: testing adding $cf_add_incdir to include-path ..." 1>&5
7946
7947                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
7948
7949                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
7950                   test "$cf_top_incdir" = "$cf_add_incdir" && break
7951                   cf_add_incdir="$cf_top_incdir"
7952                 else
7953                   break
7954                 fi
7955           else
7956                 break
7957           fi
7958         done
7959   done
7960 fi
7961
7962                 for cf_header in \
7963                         ncurses.h \
7964                         curses.h
7965                 do
7966
7967         cat >conftest.$ac_ext <<_ACEOF
7968 #line 7968 "configure"
7969 #include "confdefs.h"
7970
7971 #include <$cf_header>
7972 int
7973 main ()
7974 {
7975
7976 #ifdef NCURSES_VERSION
7977
7978 printf("%s\n", NCURSES_VERSION);
7979 #else
7980 #ifdef __NCURSES_H
7981 printf("old\n");
7982 #else
7983         make an error
7984 #endif
7985 #endif
7986
7987   ;
7988   return 0;
7989 }
7990 _ACEOF
7991 rm -f conftest.$ac_objext
7992 if { (eval echo "$as_me:7992: \"$ac_compile\"") >&5
7993   (eval $ac_compile) 2>&5
7994   ac_status=$?
7995   echo "$as_me:7995: \$? = $ac_status" >&5
7996   (exit $ac_status); } &&
7997          { ac_try='test -s conftest.$ac_objext'
7998   { (eval echo "$as_me:7998: \"$ac_try\"") >&5
7999   (eval $ac_try) 2>&5
8000   ac_status=$?
8001   echo "$as_me:8001: \$? = $ac_status" >&5
8002   (exit $ac_status); }; }; then
8003   cf_cv_ncurses_h2=$cf_header
8004
8005 else
8006   echo "$as_me: failed program was:" >&5
8007 cat conftest.$ac_ext >&5
8008 cf_cv_ncurses_h2=no
8009 fi
8010 rm -f conftest.$ac_objext conftest.$ac_ext
8011
8012                         if test "$cf_cv_ncurses_h2" != no ; then
8013                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
8014                                 test -n "$verbose" && echo $ac_n "      ... found $ac_c" 1>&6
8015                                 break
8016                         fi
8017                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
8018                 done
8019                 CPPFLAGS="$cf_save2_CPPFLAGS"
8020                 test "$cf_cv_ncurses_h2" != no && break
8021         done
8022         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:8022: error: not found" >&5
8023 echo "$as_me: error: not found" >&2;}
8024    { (exit 1); exit 1; }; }
8025
8026 fi
8027 echo "$as_me:8027: result: $cf_cv_ncurses_h2" >&5
8028 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
8029
8030         cf_1st_incdir=`echo $cf_cv_ncurses_h2 | sed -e 's%/[^/]*$%%'`
8031         cf_cv_ncurses_header=`basename $cf_cv_ncurses_h2`
8032         if test `basename $cf_1st_incdir` = $cf_ncuhdr_root ; then
8033                 cf_cv_ncurses_header=$cf_ncuhdr_root/$cf_cv_ncurses_header
8034         fi
8035
8036 if test -n "$cf_1st_incdir" ; then
8037   for cf_add_incdir in $cf_1st_incdir
8038   do
8039         while test $cf_add_incdir != /usr/include
8040         do
8041           if test -d $cf_add_incdir
8042           then
8043                 cf_have_incdir=no
8044                 if test -n "$CFLAGS$CPPFLAGS" ; then
8045                   # a loop is needed to ensure we can add subdirs of existing dirs
8046                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
8047                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
8048                           cf_have_incdir=yes; break
8049                         fi
8050                   done
8051                 fi
8052
8053                 if test "$cf_have_incdir" = no ; then
8054                   if test "$cf_add_incdir" = /usr/local/include ; then
8055                         if test "$GCC" = yes
8056                         then
8057                           cf_save_CPPFLAGS=$CPPFLAGS
8058                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8059                           cat >conftest.$ac_ext <<_ACEOF
8060 #line 8060 "configure"
8061 #include "confdefs.h"
8062 #include <stdio.h>
8063 int
8064 main ()
8065 {
8066 printf("Hello")
8067   ;
8068   return 0;
8069 }
8070 _ACEOF
8071 rm -f conftest.$ac_objext
8072 if { (eval echo "$as_me:8072: \"$ac_compile\"") >&5
8073   (eval $ac_compile) 2>&5
8074   ac_status=$?
8075   echo "$as_me:8075: \$? = $ac_status" >&5
8076   (exit $ac_status); } &&
8077          { ac_try='test -s conftest.$ac_objext'
8078   { (eval echo "$as_me:8078: \"$ac_try\"") >&5
8079   (eval $ac_try) 2>&5
8080   ac_status=$?
8081   echo "$as_me:8081: \$? = $ac_status" >&5
8082   (exit $ac_status); }; }; then
8083   :
8084 else
8085   echo "$as_me: failed program was:" >&5
8086 cat conftest.$ac_ext >&5
8087 cf_have_incdir=yes
8088 fi
8089 rm -f conftest.$ac_objext conftest.$ac_ext
8090                           CPPFLAGS=$cf_save_CPPFLAGS
8091                         fi
8092                   fi
8093                 fi
8094
8095                 if test "$cf_have_incdir" = no ; then
8096                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
8097
8098 echo "${as_me:-configure}:8098: testing adding $cf_add_incdir to include-path ..." 1>&5
8099
8100                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8101
8102                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
8103                   test "$cf_top_incdir" = "$cf_add_incdir" && break
8104                   cf_add_incdir="$cf_top_incdir"
8105                 else
8106                   break
8107                 fi
8108           else
8109                 break
8110           fi
8111         done
8112   done
8113 fi
8114
8115 fi
8116
8117 # Set definitions to allow ifdef'ing for ncurses.h
8118
8119 case $cf_cv_ncurses_header in
8120 (*ncurses.h)
8121
8122 cat >>confdefs.h <<\EOF
8123 #define HAVE_NCURSES_H 1
8124 EOF
8125
8126         ;;
8127 esac
8128
8129 case $cf_cv_ncurses_header in
8130 (ncurses/curses.h|ncurses/ncurses.h)
8131
8132 cat >>confdefs.h <<\EOF
8133 #define HAVE_NCURSES_NCURSES_H 1
8134 EOF
8135
8136         ;;
8137 (ncursesw/curses.h|ncursesw/ncurses.h)
8138
8139 cat >>confdefs.h <<\EOF
8140 #define HAVE_NCURSESW_NCURSES_H 1
8141 EOF
8142
8143         ;;
8144 esac
8145
8146 echo "$as_me:8146: checking for terminfo header" >&5
8147 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
8148 if test "${cf_cv_term_header+set}" = set; then
8149   echo $ECHO_N "(cached) $ECHO_C" >&6
8150 else
8151
8152 case ${cf_cv_ncurses_header} in
8153 (*/ncurses.h|*/ncursesw.h)
8154         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
8155         ;;
8156 (*)
8157         cf_term_header=term.h
8158         ;;
8159 esac
8160
8161 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
8162 do
8163 cat >conftest.$ac_ext <<_ACEOF
8164 #line 8164 "configure"
8165 #include "confdefs.h"
8166 #include <stdio.h>
8167 #include <${cf_cv_ncurses_header:-curses.h}>
8168 #include <$cf_test>
8169
8170 int
8171 main ()
8172 {
8173 int x = auto_left_margin
8174   ;
8175   return 0;
8176 }
8177 _ACEOF
8178 rm -f conftest.$ac_objext
8179 if { (eval echo "$as_me:8179: \"$ac_compile\"") >&5
8180   (eval $ac_compile) 2>&5
8181   ac_status=$?
8182   echo "$as_me:8182: \$? = $ac_status" >&5
8183   (exit $ac_status); } &&
8184          { ac_try='test -s conftest.$ac_objext'
8185   { (eval echo "$as_me:8185: \"$ac_try\"") >&5
8186   (eval $ac_try) 2>&5
8187   ac_status=$?
8188   echo "$as_me:8188: \$? = $ac_status" >&5
8189   (exit $ac_status); }; }; then
8190
8191         cf_cv_term_header="$cf_test"
8192 else
8193   echo "$as_me: failed program was:" >&5
8194 cat conftest.$ac_ext >&5
8195
8196         cf_cv_term_header=unknown
8197
8198 fi
8199 rm -f conftest.$ac_objext conftest.$ac_ext
8200         test "$cf_cv_term_header" != unknown && break
8201 done
8202
8203 fi
8204 echo "$as_me:8204: result: $cf_cv_term_header" >&5
8205 echo "${ECHO_T}$cf_cv_term_header" >&6
8206
8207 # Set definitions to allow ifdef'ing to accommodate subdirectories
8208
8209 case $cf_cv_term_header in
8210 (*term.h)
8211
8212 cat >>confdefs.h <<\EOF
8213 #define HAVE_TERM_H 1
8214 EOF
8215
8216         ;;
8217 esac
8218
8219 case $cf_cv_term_header in
8220 (ncurses/term.h)
8221
8222 cat >>confdefs.h <<\EOF
8223 #define HAVE_NCURSES_TERM_H 1
8224 EOF
8225
8226         ;;
8227 (ncursesw/term.h)
8228
8229 cat >>confdefs.h <<\EOF
8230 #define HAVE_NCURSESW_TERM_H 1
8231 EOF
8232
8233         ;;
8234 esac
8235
8236 # some applications need this, but should check for NCURSES_VERSION
8237
8238 cat >>confdefs.h <<\EOF
8239 #define NCURSES 1
8240 EOF
8241
8242 echo "$as_me:8242: checking for ncurses version" >&5
8243 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
8244 if test "${cf_cv_ncurses_version+set}" = set; then
8245   echo $ECHO_N "(cached) $ECHO_C" >&6
8246 else
8247
8248         cf_cv_ncurses_version=no
8249         cf_tempfile=out$$
8250         rm -f $cf_tempfile
8251         if test "$cross_compiling" = yes; then
8252
8253         # This will not work if the preprocessor splits the line after the
8254         # Autoconf token.  The 'unproto' program does that.
8255         cat > conftest.$ac_ext <<EOF
8256 #include <${cf_cv_ncurses_header:-curses.h}>
8257 #undef Autoconf
8258 #ifdef NCURSES_VERSION
8259 Autoconf NCURSES_VERSION
8260 #else
8261 #ifdef __NCURSES_H
8262 Autoconf "old"
8263 #endif
8264 ;
8265 #endif
8266 EOF
8267         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
8268         { (eval echo "$as_me:8268: \"$cf_try\"") >&5
8269   (eval $cf_try) 2>&5
8270   ac_status=$?
8271   echo "$as_me:8271: \$? = $ac_status" >&5
8272   (exit $ac_status); }
8273         if test -f conftest.out ; then
8274                 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
8275                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
8276                 rm -f conftest.out
8277         fi
8278
8279 else
8280   cat >conftest.$ac_ext <<_ACEOF
8281 #line 8281 "configure"
8282 #include "confdefs.h"
8283
8284 #include <${cf_cv_ncurses_header:-curses.h}>
8285 #include <stdio.h>
8286 int main()
8287 {
8288         FILE *fp = fopen("$cf_tempfile", "w");
8289 #ifdef NCURSES_VERSION
8290 # ifdef NCURSES_VERSION_PATCH
8291         fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
8292 # else
8293         fprintf(fp, "%s\n", NCURSES_VERSION);
8294 # endif
8295 #else
8296 # ifdef __NCURSES_H
8297         fprintf(fp, "old\n");
8298 # else
8299         make an error
8300 # endif
8301 #endif
8302         ${cf_cv_main_return:-return}(0);
8303 }
8304 _ACEOF
8305 rm -f conftest$ac_exeext
8306 if { (eval echo "$as_me:8306: \"$ac_link\"") >&5
8307   (eval $ac_link) 2>&5
8308   ac_status=$?
8309   echo "$as_me:8309: \$? = $ac_status" >&5
8310   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
8311   { (eval echo "$as_me:8311: \"$ac_try\"") >&5
8312   (eval $ac_try) 2>&5
8313   ac_status=$?
8314   echo "$as_me:8314: \$? = $ac_status" >&5
8315   (exit $ac_status); }; }; then
8316
8317         cf_cv_ncurses_version=`cat $cf_tempfile`
8318 else
8319   echo "$as_me: program exited with status $ac_status" >&5
8320 echo "$as_me: failed program was:" >&5
8321 cat conftest.$ac_ext >&5
8322 fi
8323 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
8324 fi
8325         rm -f $cf_tempfile
8326
8327 fi
8328 echo "$as_me:8328: result: $cf_cv_ncurses_version" >&5
8329 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
8330 test "$cf_cv_ncurses_version" = no ||
8331 cat >>confdefs.h <<\EOF
8332 #define NCURSES 1
8333 EOF
8334
8335 cf_nculib_root=ncurses
8336         # This works, except for the special case where we find gpm, but
8337         # ncurses is in a nonstandard location via $LIBS, and we really want
8338         # to link gpm.
8339 cf_ncurses_LIBS=""
8340 cf_ncurses_SAVE="$LIBS"
8341 echo "$as_me:8341: checking for Gpm_Open in -lgpm" >&5
8342 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
8343 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
8344   echo $ECHO_N "(cached) $ECHO_C" >&6
8345 else
8346   ac_check_lib_save_LIBS=$LIBS
8347 LIBS="-lgpm  $LIBS"
8348 cat >conftest.$ac_ext <<_ACEOF
8349 #line 8349 "configure"
8350 #include "confdefs.h"
8351
8352 /* Override any gcc2 internal prototype to avoid an error.  */
8353 #ifdef __cplusplus
8354 extern "C"
8355 #endif
8356 /* We use char because int might match the return type of a gcc2
8357    builtin and then its argument prototype would still apply.  */
8358 char Gpm_Open ();
8359 int
8360 main ()
8361 {
8362 Gpm_Open ();
8363   ;
8364   return 0;
8365 }
8366 _ACEOF
8367 rm -f conftest.$ac_objext conftest$ac_exeext
8368 if { (eval echo "$as_me:8368: \"$ac_link\"") >&5
8369   (eval $ac_link) 2>&5
8370   ac_status=$?
8371   echo "$as_me:8371: \$? = $ac_status" >&5
8372   (exit $ac_status); } &&
8373          { ac_try='test -s conftest$ac_exeext'
8374   { (eval echo "$as_me:8374: \"$ac_try\"") >&5
8375   (eval $ac_try) 2>&5
8376   ac_status=$?
8377   echo "$as_me:8377: \$? = $ac_status" >&5
8378   (exit $ac_status); }; }; then
8379   ac_cv_lib_gpm_Gpm_Open=yes
8380 else
8381   echo "$as_me: failed program was:" >&5
8382 cat conftest.$ac_ext >&5
8383 ac_cv_lib_gpm_Gpm_Open=no
8384 fi
8385 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8386 LIBS=$ac_check_lib_save_LIBS
8387 fi
8388 echo "$as_me:8388: result: $ac_cv_lib_gpm_Gpm_Open" >&5
8389 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
8390 if test $ac_cv_lib_gpm_Gpm_Open = yes; then
8391   echo "$as_me:8391: checking for initscr in -lgpm" >&5
8392 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
8393 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
8394   echo $ECHO_N "(cached) $ECHO_C" >&6
8395 else
8396   ac_check_lib_save_LIBS=$LIBS
8397 LIBS="-lgpm  $LIBS"
8398 cat >conftest.$ac_ext <<_ACEOF
8399 #line 8399 "configure"
8400 #include "confdefs.h"
8401
8402 /* Override any gcc2 internal prototype to avoid an error.  */
8403 #ifdef __cplusplus
8404 extern "C"
8405 #endif
8406 /* We use char because int might match the return type of a gcc2
8407    builtin and then its argument prototype would still apply.  */
8408 char initscr ();
8409 int
8410 main ()
8411 {
8412 initscr ();
8413   ;
8414   return 0;
8415 }
8416 _ACEOF
8417 rm -f conftest.$ac_objext conftest$ac_exeext
8418 if { (eval echo "$as_me:8418: \"$ac_link\"") >&5
8419   (eval $ac_link) 2>&5
8420   ac_status=$?
8421   echo "$as_me:8421: \$? = $ac_status" >&5
8422   (exit $ac_status); } &&
8423          { ac_try='test -s conftest$ac_exeext'
8424   { (eval echo "$as_me:8424: \"$ac_try\"") >&5
8425   (eval $ac_try) 2>&5
8426   ac_status=$?
8427   echo "$as_me:8427: \$? = $ac_status" >&5
8428   (exit $ac_status); }; }; then
8429   ac_cv_lib_gpm_initscr=yes
8430 else
8431   echo "$as_me: failed program was:" >&5
8432 cat conftest.$ac_ext >&5
8433 ac_cv_lib_gpm_initscr=no
8434 fi
8435 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8436 LIBS=$ac_check_lib_save_LIBS
8437 fi
8438 echo "$as_me:8438: result: $ac_cv_lib_gpm_initscr" >&5
8439 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
8440 if test $ac_cv_lib_gpm_initscr = yes; then
8441   LIBS="$cf_ncurses_SAVE"
8442 else
8443   cf_ncurses_LIBS="-lgpm"
8444 fi
8445
8446 fi
8447
8448 case $host_os in
8449 (freebsd*)
8450         # This is only necessary if you are linking against an obsolete
8451         # version of ncurses (but it should do no harm, since it's static).
8452         if test "$cf_nculib_root" = ncurses ; then
8453                 echo "$as_me:8453: checking for tgoto in -lmytinfo" >&5
8454 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
8455 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
8456   echo $ECHO_N "(cached) $ECHO_C" >&6
8457 else
8458   ac_check_lib_save_LIBS=$LIBS
8459 LIBS="-lmytinfo  $LIBS"
8460 cat >conftest.$ac_ext <<_ACEOF
8461 #line 8461 "configure"
8462 #include "confdefs.h"
8463
8464 /* Override any gcc2 internal prototype to avoid an error.  */
8465 #ifdef __cplusplus
8466 extern "C"
8467 #endif
8468 /* We use char because int might match the return type of a gcc2
8469    builtin and then its argument prototype would still apply.  */
8470 char tgoto ();
8471 int
8472 main ()
8473 {
8474 tgoto ();
8475   ;
8476   return 0;
8477 }
8478 _ACEOF
8479 rm -f conftest.$ac_objext conftest$ac_exeext
8480 if { (eval echo "$as_me:8480: \"$ac_link\"") >&5
8481   (eval $ac_link) 2>&5
8482   ac_status=$?
8483   echo "$as_me:8483: \$? = $ac_status" >&5
8484   (exit $ac_status); } &&
8485          { ac_try='test -s conftest$ac_exeext'
8486   { (eval echo "$as_me:8486: \"$ac_try\"") >&5
8487   (eval $ac_try) 2>&5
8488   ac_status=$?
8489   echo "$as_me:8489: \$? = $ac_status" >&5
8490   (exit $ac_status); }; }; then
8491   ac_cv_lib_mytinfo_tgoto=yes
8492 else
8493   echo "$as_me: failed program was:" >&5
8494 cat conftest.$ac_ext >&5
8495 ac_cv_lib_mytinfo_tgoto=no
8496 fi
8497 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8498 LIBS=$ac_check_lib_save_LIBS
8499 fi
8500 echo "$as_me:8500: result: $ac_cv_lib_mytinfo_tgoto" >&5
8501 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
8502 if test $ac_cv_lib_mytinfo_tgoto = yes; then
8503   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
8504 fi
8505
8506         fi
8507         ;;
8508 esac
8509
8510 cf_add_libs="$cf_ncurses_LIBS"
8511 # Filter out duplicates - this happens with badly-designed ".pc" files...
8512 for cf_add_1lib in $LIBS
8513 do
8514         for cf_add_2lib in $cf_add_libs
8515         do
8516                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
8517                 then
8518                         cf_add_1lib=
8519                         break
8520                 fi
8521         done
8522         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
8523 done
8524 LIBS="$cf_add_libs"
8525
8526 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
8527 then
8528
8529 cf_add_libs="-l$cf_nculib_root"
8530 # Filter out duplicates - this happens with badly-designed ".pc" files...
8531 for cf_add_1lib in $LIBS
8532 do
8533         for cf_add_2lib in $cf_add_libs
8534         do
8535                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
8536                 then
8537                         cf_add_1lib=
8538                         break
8539                 fi
8540         done
8541         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
8542 done
8543 LIBS="$cf_add_libs"
8544
8545 else
8546
8547         eval 'cf_cv_have_lib_'$cf_nculib_root'=no'
8548         cf_libdir=""
8549         echo "$as_me:8549: checking for initscr" >&5
8550 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
8551 if test "${ac_cv_func_initscr+set}" = set; then
8552   echo $ECHO_N "(cached) $ECHO_C" >&6
8553 else
8554   cat >conftest.$ac_ext <<_ACEOF
8555 #line 8555 "configure"
8556 #include "confdefs.h"
8557 /* System header to define __stub macros and hopefully few prototypes,
8558     which can conflict with char initscr (); below.  */
8559 #include <assert.h>
8560 /* Override any gcc2 internal prototype to avoid an error.  */
8561 #ifdef __cplusplus
8562 extern "C"
8563 #endif
8564 /* We use char because int might match the return type of a gcc2
8565    builtin and then its argument prototype would still apply.  */
8566 char initscr ();
8567 char (*f) ();
8568
8569 int
8570 main ()
8571 {
8572 /* The GNU C library defines this for functions which it implements
8573     to always fail with ENOSYS.  Some functions are actually named
8574     something starting with __ and the normal name is an alias.  */
8575 #if defined (__stub_initscr) || defined (__stub___initscr)
8576 choke me
8577 #else
8578 f = initscr; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
8579 #endif
8580
8581   ;
8582   return 0;
8583 }
8584 _ACEOF
8585 rm -f conftest.$ac_objext conftest$ac_exeext
8586 if { (eval echo "$as_me:8586: \"$ac_link\"") >&5
8587   (eval $ac_link) 2>&5
8588   ac_status=$?
8589   echo "$as_me:8589: \$? = $ac_status" >&5
8590   (exit $ac_status); } &&
8591          { ac_try='test -s conftest$ac_exeext'
8592   { (eval echo "$as_me:8592: \"$ac_try\"") >&5
8593   (eval $ac_try) 2>&5
8594   ac_status=$?
8595   echo "$as_me:8595: \$? = $ac_status" >&5
8596   (exit $ac_status); }; }; then
8597   ac_cv_func_initscr=yes
8598 else
8599   echo "$as_me: failed program was:" >&5
8600 cat conftest.$ac_ext >&5
8601 ac_cv_func_initscr=no
8602 fi
8603 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8604 fi
8605 echo "$as_me:8605: result: $ac_cv_func_initscr" >&5
8606 echo "${ECHO_T}$ac_cv_func_initscr" >&6
8607 if test $ac_cv_func_initscr = yes; then
8608   eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
8609 else
8610
8611                 cf_save_LIBS="$LIBS"
8612                 echo "$as_me:8612: checking for initscr in -l$cf_nculib_root" >&5
8613 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
8614                 LIBS="-l$cf_nculib_root $LIBS"
8615                 cat >conftest.$ac_ext <<_ACEOF
8616 #line 8616 "configure"
8617 #include "confdefs.h"
8618 #include <${cf_cv_ncurses_header:-curses.h}>
8619 int
8620 main ()
8621 {
8622 initscr()
8623   ;
8624   return 0;
8625 }
8626 _ACEOF
8627 rm -f conftest.$ac_objext conftest$ac_exeext
8628 if { (eval echo "$as_me:8628: \"$ac_link\"") >&5
8629   (eval $ac_link) 2>&5
8630   ac_status=$?
8631   echo "$as_me:8631: \$? = $ac_status" >&5
8632   (exit $ac_status); } &&
8633          { ac_try='test -s conftest$ac_exeext'
8634   { (eval echo "$as_me:8634: \"$ac_try\"") >&5
8635   (eval $ac_try) 2>&5
8636   ac_status=$?
8637   echo "$as_me:8637: \$? = $ac_status" >&5
8638   (exit $ac_status); }; }; then
8639   echo "$as_me:8639: result: yes" >&5
8640 echo "${ECHO_T}yes" >&6
8641                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
8642
8643 else
8644   echo "$as_me: failed program was:" >&5
8645 cat conftest.$ac_ext >&5
8646 echo "$as_me:8646: result: no" >&5
8647 echo "${ECHO_T}no" >&6
8648
8649 cf_search=
8650 cf_library_path_list=""
8651 if test -n "${LDFLAGS}${LIBS}" ; then
8652         for cf_library_path in $LDFLAGS $LIBS
8653         do
8654                 case $cf_library_path in
8655                 (-L*)
8656                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
8657
8658 test "x$cf_library_path" != "xNONE" && \
8659 test -d "$cf_library_path" && \
8660  {
8661         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
8662         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
8663         test -d $cf_library_path/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
8664         test -d $cf_library_path/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
8665         test -d $cf_library_path/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
8666         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"
8667 }
8668
8669                         cf_library_path_list="$cf_library_path_list $cf_search"
8670                         ;;
8671                 esac
8672         done
8673 fi
8674
8675 cf_search=
8676
8677 test "x$prefix" != "xNONE" && \
8678 test -d "$prefix" && \
8679  {
8680         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
8681         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
8682         test -d $prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
8683         test -d $prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
8684         test -d $prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
8685         test -d $prefix/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
8686 }
8687
8688 for cf_subdir_prefix in \
8689         /usr \
8690         /usr/local \
8691         /usr/pkg \
8692         /opt \
8693         /opt/local \
8694         $HOME
8695 do
8696
8697 test "x$cf_subdir_prefix" != "x$prefix" && \
8698 test -d "$cf_subdir_prefix" && \
8699 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
8700         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
8701         test -d $cf_subdir_prefix/lib &&          cf_search="$cf_search $cf_subdir_prefix/lib"
8702         test -d $cf_subdir_prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root"
8703         test -d $cf_subdir_prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root/lib"
8704         test -d $cf_subdir_prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib"
8705         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"
8706 }
8707
8708 done
8709
8710 cf_search="$cf_library_path_list $cf_search"
8711
8712                         for cf_libdir in $cf_search
8713                         do
8714                                 echo "$as_me:8714: checking for -l$cf_nculib_root in $cf_libdir" >&5
8715 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
8716                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
8717                                 cat >conftest.$ac_ext <<_ACEOF
8718 #line 8718 "configure"
8719 #include "confdefs.h"
8720 #include <${cf_cv_ncurses_header:-curses.h}>
8721 int
8722 main ()
8723 {
8724 initscr()
8725   ;
8726   return 0;
8727 }
8728 _ACEOF
8729 rm -f conftest.$ac_objext conftest$ac_exeext
8730 if { (eval echo "$as_me:8730: \"$ac_link\"") >&5
8731   (eval $ac_link) 2>&5
8732   ac_status=$?
8733   echo "$as_me:8733: \$? = $ac_status" >&5
8734   (exit $ac_status); } &&
8735          { ac_try='test -s conftest$ac_exeext'
8736   { (eval echo "$as_me:8736: \"$ac_try\"") >&5
8737   (eval $ac_try) 2>&5
8738   ac_status=$?
8739   echo "$as_me:8739: \$? = $ac_status" >&5
8740   (exit $ac_status); }; }; then
8741   echo "$as_me:8741: result: yes" >&5
8742 echo "${ECHO_T}yes" >&6
8743                                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
8744                                          break
8745 else
8746   echo "$as_me: failed program was:" >&5
8747 cat conftest.$ac_ext >&5
8748 echo "$as_me:8748: result: no" >&5
8749 echo "${ECHO_T}no" >&6
8750                                          LIBS="$cf_save_LIBS"
8751 fi
8752 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8753                         done
8754
8755 fi
8756 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8757
8758 fi
8759
8760 eval 'cf_found_library=$cf_cv_have_lib_'$cf_nculib_root
8761
8762 if test $cf_found_library = no ; then
8763         { { echo "$as_me:8763: error: Cannot link $cf_nculib_root library" >&5
8764 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
8765    { (exit 1); exit 1; }; }
8766 fi
8767
8768 fi
8769
8770 if test -n "$cf_ncurses_LIBS" ; then
8771         echo "$as_me:8771: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
8772 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
8773         cf_ncurses_SAVE="$LIBS"
8774         for p in $cf_ncurses_LIBS ; do
8775                 q=`echo $LIBS | sed -e "s%$p %%" -e "s%$p$%%"`
8776                 if test "$q" != "$LIBS" ; then
8777                         LIBS="$q"
8778                 fi
8779         done
8780         cat >conftest.$ac_ext <<_ACEOF
8781 #line 8781 "configure"
8782 #include "confdefs.h"
8783 #include <${cf_cv_ncurses_header:-curses.h}>
8784 int
8785 main ()
8786 {
8787 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
8788   ;
8789   return 0;
8790 }
8791 _ACEOF
8792 rm -f conftest.$ac_objext conftest$ac_exeext
8793 if { (eval echo "$as_me:8793: \"$ac_link\"") >&5
8794   (eval $ac_link) 2>&5
8795   ac_status=$?
8796   echo "$as_me:8796: \$? = $ac_status" >&5
8797   (exit $ac_status); } &&
8798          { ac_try='test -s conftest$ac_exeext'
8799   { (eval echo "$as_me:8799: \"$ac_try\"") >&5
8800   (eval $ac_try) 2>&5
8801   ac_status=$?
8802   echo "$as_me:8802: \$? = $ac_status" >&5
8803   (exit $ac_status); }; }; then
8804   echo "$as_me:8804: result: yes" >&5
8805 echo "${ECHO_T}yes" >&6
8806 else
8807   echo "$as_me: failed program was:" >&5
8808 cat conftest.$ac_ext >&5
8809 echo "$as_me:8809: result: no" >&5
8810 echo "${ECHO_T}no" >&6
8811                  LIBS="$cf_ncurses_SAVE"
8812 fi
8813 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8814 fi
8815
8816 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
8817
8818 cat >>confdefs.h <<EOF
8819 #define $cf_nculib_ROOT 1
8820 EOF
8821
8822         fi
8823 else
8824         NCURSES_CONFIG=none
8825 fi
8826
8827 fi
8828
8829 if test "$NCURSES_CONFIG_PKG" != none ; then
8830         cf_version=`$PKG_CONFIG --modversion $NCURSES_CONFIG_PKG 2>/dev/null`
8831
8832         NCURSES_MAJOR=`echo "$cf_version" | sed -e 's/\..*//'`
8833         NCURSES_MINOR=`echo "$cf_version" | sed -e 's/^[0-9][0-9]*\.//' -e 's/\..*//'`
8834         NCURSES_PATCH=`echo "$cf_version" | sed -e 's/^[0-9][0-9]*\.[0-9][0-9]*\.//'`
8835
8836         cf_cv_abi_version=`$PKG_CONFIG --variable=abi_version $NCURSES_CONFIG_PKG 2>/dev/null`
8837         if test -z "$cf_cv_abi_version"
8838         then
8839                 cf_cv_abi_version=`$PKG_CONFIG --variable=major_version $NCURSES_CONFIG_PKG 2>/dev/null`
8840         fi
8841
8842 elif test "$NCURSES_CONFIG" != none ; then
8843
8844         cf_version=`$NCURSES_CONFIG --version 2>/dev/null`
8845
8846         NCURSES_MAJOR=`echo "$cf_version" | sed -e 's/\..*//'`
8847         NCURSES_MINOR=`echo "$cf_version" | sed -e 's/^[0-9][0-9]*\.//' -e 's/\..*//'`
8848         NCURSES_PATCH=`echo "$cf_version" | sed -e 's/^[0-9][0-9]*\.[0-9][0-9]*\.//'`
8849
8850         # ABI version is not available from headers
8851         cf_cv_abi_version=`$NCURSES_CONFIG --abi-version 2>/dev/null`
8852
8853 else
8854
8855         for cf_name in MAJOR MINOR PATCH
8856         do
8857         cat >conftest.$ac_ext <<CF_EOF
8858         #include <${cf_cv_ncurses_header:-curses.h}>
8859         AUTOCONF_$cf_name NCURSES_VERSION_$cf_name
8860 CF_EOF
8861                 cf_try="$ac_cpp conftest.$ac_ext 2>&5 | fgrep AUTOCONF_$cf_name >conftest.out"
8862                 { (eval echo "$as_me:8862: \"$cf_try\"") >&5
8863   (eval $cf_try) 2>&5
8864   ac_status=$?
8865   echo "$as_me:8865: \$? = $ac_status" >&5
8866   (exit $ac_status); }
8867                 if test -f conftest.out ; then
8868                         cf_result=`cat conftest.out | sed -e "s/^.*AUTOCONF_$cf_name[   ][      ]*//"`
8869                         eval NCURSES_$cf_name=\"$cf_result\"
8870                         # cat conftest.$ac_ext
8871                         # cat conftest.out
8872                 fi
8873         done
8874
8875         cf_cv_abi_version=${NCURSES_MAJOR}
8876
8877 fi
8878
8879 cf_cv_rel_version=${NCURSES_MAJOR}.${NCURSES_MINOR}
8880
8881 cf_cv_timestamp=`date`
8882
8883 echo "$as_me:8883: result: Configuring NCURSES $cf_cv_rel_version ABI $cf_cv_abi_version ($cf_cv_timestamp)" >&5
8884 echo "${ECHO_T}Configuring NCURSES $cf_cv_rel_version ABI $cf_cv_abi_version ($cf_cv_timestamp)" >&6
8885
8886 echo "$as_me:8886: checking if you want to have a library-prefix" >&5
8887 echo $ECHO_N "checking if you want to have a library-prefix... $ECHO_C" >&6
8888
8889 # Check whether --with-lib-prefix or --without-lib-prefix was given.
8890 if test "${with_lib_prefix+set}" = set; then
8891   withval="$with_lib_prefix"
8892   with_lib_prefix=$withval
8893 else
8894   with_lib_prefix=auto
8895 fi;
8896 echo "$as_me:8896: result: $with_lib_prefix" >&5
8897 echo "${ECHO_T}$with_lib_prefix" >&6
8898
8899 if test $with_lib_prefix = auto
8900 then
8901
8902         case $cf_cv_system_name in
8903         (OS/2*|os2*)
8904                 LIB_PREFIX=''
8905                 ;;
8906         (*)     LIB_PREFIX='lib'
8907                 ;;
8908         esac
8909 cf_prefix=$LIB_PREFIX
8910
8911 elif test $with_lib_prefix = no
8912 then
8913         LIB_PREFIX=
8914 else
8915         LIB_PREFIX=$with_lib_prefix
8916 fi
8917
8918 LIB_SUFFIX=
8919
8920 ###############################################################################
8921
8922 if test X"$CC_G_OPT" = X"" ; then
8923         CC_G_OPT='-g'
8924         test -n "$GCC" && test "${ac_cv_prog_cc_g}" != yes && CC_G_OPT=''
8925 fi
8926
8927 echo "$as_me:8927: checking for default loader flags" >&5
8928 echo $ECHO_N "checking for default loader flags... $ECHO_C" >&6
8929 case $DFT_LWR_MODEL in
8930 (normal)  LD_MODEL=''   ;;
8931 (debug)   LD_MODEL=$CC_G_OPT ;;
8932 (profile) LD_MODEL='-pg';;
8933 (shared)  LD_MODEL=''   ;;
8934 esac
8935 echo "$as_me:8935: result: $LD_MODEL" >&5
8936 echo "${ECHO_T}$LD_MODEL" >&6
8937
8938 LD_RPATH_OPT=
8939 echo "$as_me:8939: checking for an rpath option" >&5
8940 echo $ECHO_N "checking for an rpath option... $ECHO_C" >&6
8941 case $cf_cv_system_name in
8942 (irix*)
8943         if test "$GCC" = yes; then
8944                 LD_RPATH_OPT="-Wl,-rpath,"
8945         else
8946                 LD_RPATH_OPT="-rpath "
8947         fi
8948         ;;
8949 (linux*|gnu*|k*bsd*-gnu)
8950         LD_RPATH_OPT="-Wl,-rpath,"
8951         ;;
8952 (openbsd[2-9].*|mirbsd*)
8953         LD_RPATH_OPT="-Wl,-rpath,"
8954         ;;
8955 (dragonfly*|freebsd*)
8956         LD_RPATH_OPT="-rpath "
8957         ;;
8958 (netbsd*)
8959         LD_RPATH_OPT="-Wl,-rpath,"
8960         ;;
8961 (osf*|mls+*)
8962         LD_RPATH_OPT="-rpath "
8963         ;;
8964 (solaris2*)
8965         LD_RPATH_OPT="-R"
8966         ;;
8967 (*)
8968         ;;
8969 esac
8970 echo "$as_me:8970: result: $LD_RPATH_OPT" >&5
8971 echo "${ECHO_T}$LD_RPATH_OPT" >&6
8972
8973 case "x$LD_RPATH_OPT" in
8974 (x-R*)
8975         echo "$as_me:8975: checking if we need a space after rpath option" >&5
8976 echo $ECHO_N "checking if we need a space after rpath option... $ECHO_C" >&6
8977         cf_save_LIBS="$LIBS"
8978
8979 cf_add_libs="${LD_RPATH_OPT}$libdir"
8980 # Filter out duplicates - this happens with badly-designed ".pc" files...
8981 for cf_add_1lib in $LIBS
8982 do
8983         for cf_add_2lib in $cf_add_libs
8984         do
8985                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
8986                 then
8987                         cf_add_1lib=
8988                         break
8989                 fi
8990         done
8991         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
8992 done
8993 LIBS="$cf_add_libs"
8994
8995         cat >conftest.$ac_ext <<_ACEOF
8996 #line 8996 "configure"
8997 #include "confdefs.h"
8998
8999 int
9000 main ()
9001 {
9002
9003   ;
9004   return 0;
9005 }
9006 _ACEOF
9007 rm -f conftest.$ac_objext conftest$ac_exeext
9008 if { (eval echo "$as_me:9008: \"$ac_link\"") >&5
9009   (eval $ac_link) 2>&5
9010   ac_status=$?
9011   echo "$as_me:9011: \$? = $ac_status" >&5
9012   (exit $ac_status); } &&
9013          { ac_try='test -s conftest$ac_exeext'
9014   { (eval echo "$as_me:9014: \"$ac_try\"") >&5
9015   (eval $ac_try) 2>&5
9016   ac_status=$?
9017   echo "$as_me:9017: \$? = $ac_status" >&5
9018   (exit $ac_status); }; }; then
9019   cf_rpath_space=no
9020 else
9021   echo "$as_me: failed program was:" >&5
9022 cat conftest.$ac_ext >&5
9023 cf_rpath_space=yes
9024 fi
9025 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9026         LIBS="$cf_save_LIBS"
9027         echo "$as_me:9027: result: $cf_rpath_space" >&5
9028 echo "${ECHO_T}$cf_rpath_space" >&6
9029         test "$cf_rpath_space" = yes && LD_RPATH_OPT="$LD_RPATH_OPT "
9030         ;;
9031 esac
9032
9033         RM_SHARED_OPTS=
9034         LOCAL_LDFLAGS=
9035         LOCAL_LDFLAGS2=
9036         LD_SHARED_OPTS=
9037         INSTALL_LIB="-m 644"
9038         : ${rel_builddir:=.}
9039
9040         shlibdir=$libdir
9041
9042         MAKE_DLLS="#"
9043
9044         cf_cv_do_symlinks=no
9045         cf_ld_rpath_opt=
9046         test "$cf_cv_enable_rpath" = yes && cf_ld_rpath_opt="$LD_RPATH_OPT"
9047
9048         echo "$as_me:9048: checking if release/abi version should be used for shared libs" >&5
9049 echo $ECHO_N "checking if release/abi version should be used for shared libs... $ECHO_C" >&6
9050
9051 # Check whether --with-shlib-version or --without-shlib-version was given.
9052 if test "${with_shlib_version+set}" = set; then
9053   withval="$with_shlib_version"
9054   test -z "$withval" && withval=auto
9055         case $withval in
9056         (yes)
9057                 cf_cv_shlib_version=auto
9058                 ;;
9059         (rel|abi|auto|no)
9060                 cf_cv_shlib_version=$withval
9061                 ;;
9062         (*)
9063                 { { echo "$as_me:9063: error: option value must be one of: rel, abi, auto or no" >&5
9064 echo "$as_me: error: option value must be one of: rel, abi, auto or no" >&2;}
9065    { (exit 1); exit 1; }; }
9066                 ;;
9067         esac
9068
9069 else
9070   cf_cv_shlib_version=auto
9071 fi;
9072         echo "$as_me:9072: result: $cf_cv_shlib_version" >&5
9073 echo "${ECHO_T}$cf_cv_shlib_version" >&6
9074
9075         cf_cv_rm_so_locs=no
9076         cf_try_cflags=
9077
9078         # Some less-capable ports of gcc support only -fpic
9079         CC_SHARED_OPTS=
9080         if test "$GCC" = yes
9081         then
9082                 echo "$as_me:9082: checking which $CC option to use" >&5
9083 echo $ECHO_N "checking which $CC option to use... $ECHO_C" >&6
9084                 cf_save_CFLAGS="$CFLAGS"
9085                 for CC_SHARED_OPTS in -fPIC -fpic ''
9086                 do
9087                         CFLAGS="$cf_save_CFLAGS $CC_SHARED_OPTS"
9088                         cat >conftest.$ac_ext <<_ACEOF
9089 #line 9089 "configure"
9090 #include "confdefs.h"
9091 #include <stdio.h>
9092 int
9093 main ()
9094 {
9095 int x = 1
9096   ;
9097   return 0;
9098 }
9099 _ACEOF
9100 rm -f conftest.$ac_objext
9101 if { (eval echo "$as_me:9101: \"$ac_compile\"") >&5
9102   (eval $ac_compile) 2>&5
9103   ac_status=$?
9104   echo "$as_me:9104: \$? = $ac_status" >&5
9105   (exit $ac_status); } &&
9106          { ac_try='test -s conftest.$ac_objext'
9107   { (eval echo "$as_me:9107: \"$ac_try\"") >&5
9108   (eval $ac_try) 2>&5
9109   ac_status=$?
9110   echo "$as_me:9110: \$? = $ac_status" >&5
9111   (exit $ac_status); }; }; then
9112   break
9113 else
9114   echo "$as_me: failed program was:" >&5
9115 cat conftest.$ac_ext >&5
9116 fi
9117 rm -f conftest.$ac_objext conftest.$ac_ext
9118                 done
9119                 echo "$as_me:9119: result: $CC_SHARED_OPTS" >&5
9120 echo "${ECHO_T}$CC_SHARED_OPTS" >&6
9121                 CFLAGS="$cf_save_CFLAGS"
9122         fi
9123
9124         cf_cv_shlib_version_infix=no
9125
9126         case $cf_cv_system_name in
9127         (aix4.3-9*|aix[5-7]*)
9128                 if test "$GCC" = yes; then
9129                         CC_SHARED_OPTS='-Wl,-brtl'
9130                         MK_SHARED_LIB='${CC} -shared -Wl,-brtl -Wl,-blibpath:${RPATH_LIST}:/usr/lib -o $@'
9131                 else
9132                         CC_SHARED_OPTS='-brtl'
9133                         # as well as '-qpic=large -G' or perhaps "-bM:SRE -bnoentry -bexpall"
9134                         MK_SHARED_LIB='${CC} -G -Wl,-brtl -Wl,-blibpath:${RPATH_LIST}:/usr/lib -o $@'
9135                 fi
9136                 ;;
9137         (beos*)
9138                 MK_SHARED_LIB='${CC} ${CFLAGS} -o $@ -Xlinker -soname=`basename $@` -nostart -e 0'
9139                 ;;
9140         (cygwin*)
9141                 CC_SHARED_OPTS=
9142                 MK_SHARED_LIB='sh '$rel_builddir'/mk_shared_lib.sh $@ ${CC} ${CFLAGS}'
9143                 RM_SHARED_OPTS="$RM_SHARED_OPTS $rel_builddir/mk_shared_lib.sh *.dll.a"
9144                 cf_cv_shlib_version=cygdll
9145                 cf_cv_shlib_version_infix=cygdll
9146                 shlibdir=$bindir
9147                 MAKE_DLLS=
9148                 cat >mk_shared_lib.sh <<-CF_EOF
9149                 #!/bin/sh
9150                 SHARED_LIB=\$1
9151                 IMPORT_LIB=\`echo "\$1" | sed -e 's/cyg/lib/' -e 's/[0-9]*\.dll$/.dll.a/'\`
9152                 shift
9153                 cat <<-EOF
9154                 Linking shared library
9155                 ** SHARED_LIB \$SHARED_LIB
9156                 ** IMPORT_LIB \$IMPORT_LIB
9157 EOF
9158                 exec \$* -shared -Wl,--out-implib=\${IMPORT_LIB} -Wl,--export-all-symbols -o \${SHARED_LIB}
9159 CF_EOF
9160                 chmod +x mk_shared_lib.sh
9161                 ;;
9162         (msys*)
9163                 CC_SHARED_OPTS=
9164                 MK_SHARED_LIB='sh '$rel_builddir'/mk_shared_lib.sh $@ ${CC} ${CFLAGS}'
9165                 RM_SHARED_OPTS="$RM_SHARED_OPTS $rel_builddir/mk_shared_lib.sh *.dll.a"
9166                 cf_cv_shlib_version=msysdll
9167                 cf_cv_shlib_version_infix=msysdll
9168                 shlibdir=$bindir
9169                 MAKE_DLLS=
9170                 cat >mk_shared_lib.sh <<-CF_EOF
9171                 #!/bin/sh
9172                 SHARED_LIB=\$1
9173                 IMPORT_LIB=\`echo "\$1" | sed -e 's/msys-/lib/' -e 's/[0-9]*\.dll$/.dll.a/'\`
9174                 shift
9175                 cat <<-EOF
9176                 Linking shared library
9177                 ** SHARED_LIB \$SHARED_LIB
9178                 ** IMPORT_LIB \$IMPORT_LIB
9179 EOF
9180                 exec \$* -shared -Wl,--out-implib=\${IMPORT_LIB} -Wl,--export-all-symbols -o \${SHARED_LIB}
9181 CF_EOF
9182                 chmod +x mk_shared_lib.sh
9183                 ;;
9184         (darwin*)
9185                 cf_try_cflags="no-cpp-precomp"
9186                 CC_SHARED_OPTS="-dynamic"
9187                 MK_SHARED_LIB='${CC} ${CFLAGS} -dynamiclib -install_name ${libdir}/`basename $@` -compatibility_version ${ABI_VERSION} -current_version ${ABI_VERSION} -o $@'
9188                 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=abi
9189                 cf_cv_shlib_version_infix=yes
9190                 echo "$as_me:9190: checking if ld -search_paths_first works" >&5
9191 echo $ECHO_N "checking if ld -search_paths_first works... $ECHO_C" >&6
9192 if test "${cf_cv_ldflags_search_paths_first+set}" = set; then
9193   echo $ECHO_N "(cached) $ECHO_C" >&6
9194 else
9195
9196                         cf_save_LDFLAGS=$LDFLAGS
9197                         LDFLAGS="$LDFLAGS -Wl,-search_paths_first"
9198                         cat >conftest.$ac_ext <<_ACEOF
9199 #line 9199 "configure"
9200 #include "confdefs.h"
9201
9202 int
9203 main ()
9204 {
9205 int i;
9206   ;
9207   return 0;
9208 }
9209 _ACEOF
9210 rm -f conftest.$ac_objext conftest$ac_exeext
9211 if { (eval echo "$as_me:9211: \"$ac_link\"") >&5
9212   (eval $ac_link) 2>&5
9213   ac_status=$?
9214   echo "$as_me:9214: \$? = $ac_status" >&5
9215   (exit $ac_status); } &&
9216          { ac_try='test -s conftest$ac_exeext'
9217   { (eval echo "$as_me:9217: \"$ac_try\"") >&5
9218   (eval $ac_try) 2>&5
9219   ac_status=$?
9220   echo "$as_me:9220: \$? = $ac_status" >&5
9221   (exit $ac_status); }; }; then
9222   cf_cv_ldflags_search_paths_first=yes
9223 else
9224   echo "$as_me: failed program was:" >&5
9225 cat conftest.$ac_ext >&5
9226 cf_cv_ldflags_search_paths_first=no
9227 fi
9228 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9229                                 LDFLAGS=$cf_save_LDFLAGS
9230 fi
9231 echo "$as_me:9231: result: $cf_cv_ldflags_search_paths_first" >&5
9232 echo "${ECHO_T}$cf_cv_ldflags_search_paths_first" >&6
9233                 if test $cf_cv_ldflags_search_paths_first = yes; then
9234                         LDFLAGS="$LDFLAGS -Wl,-search_paths_first"
9235                 fi
9236                 ;;
9237         (hpux[7-8]*)
9238                 # HP-UX 8.07 ld lacks "+b" option used for libdir search-list
9239                 if test "$GCC" != yes; then
9240                         CC_SHARED_OPTS='+Z'
9241                 fi
9242                 MK_SHARED_LIB='${LD} -b -o $@'
9243                 INSTALL_LIB="-m 555"
9244                 ;;
9245         (hpux*)
9246                 # (tested with gcc 2.7.2 -- I don't have c89)
9247                 if test "$GCC" = yes; then
9248                         LD_SHARED_OPTS='-Xlinker +b -Xlinker ${libdir}'
9249                 else
9250                         CC_SHARED_OPTS='+Z'
9251                         LD_SHARED_OPTS='-Wl,+b,${libdir}'
9252                 fi
9253                 MK_SHARED_LIB='${LD} +b ${libdir} -b -o $@'
9254                 # HP-UX shared libraries must be executable, and should be
9255                 # readonly to exploit a quirk in the memory manager.
9256                 INSTALL_LIB="-m 555"
9257                 ;;
9258         (interix*)
9259                 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
9260                 if test "$cf_cv_shlib_version" = rel; then
9261                         cf_shared_soname='`basename  .${REL_VERSION}`.${ABI_VERSION}'
9262                 else
9263                         cf_shared_soname='`basename `'
9264                 fi
9265                 CC_SHARED_OPTS=
9266                 MK_SHARED_LIB='${CC} -shared -Wl,-rpath,${RPATH_LIST} -Wl,-h,'$cf_shared_soname' -o '
9267                 ;;
9268         (irix*)
9269                 if test "$cf_cv_enable_rpath" = yes ; then
9270                         EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
9271                 fi
9272                 # tested with IRIX 5.2 and 'cc'.
9273                 if test "$GCC" != yes; then
9274                         CC_SHARED_OPTS='-KPIC'
9275                         MK_SHARED_LIB='${CC} -shared -rdata_shared -soname `basename $@` -o $@'
9276                 else
9277                         MK_SHARED_LIB='${CC} -shared -Wl,-soname,`basename $@` -o $@'
9278                 fi
9279                 cf_cv_rm_so_locs=yes
9280                 ;;
9281         (linux*|gnu*|k*bsd*-gnu)
9282                 if test "$DFT_LWR_MODEL" = "shared" ; then
9283                         LOCAL_LDFLAGS="${LD_RPATH_OPT}\$(LOCAL_LIBDIR)"
9284                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
9285                 fi
9286                 if test "$cf_cv_enable_rpath" = yes ; then
9287                         EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
9288                 fi
9289
9290         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
9291         if test "$cf_cv_shlib_version" = rel; then
9292                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
9293         else
9294                 cf_cv_shared_soname='`basename $@`'
9295         fi
9296
9297                 MK_SHARED_LIB='${CC} ${CFLAGS} -shared -Wl,-soname,'$cf_cv_shared_soname',-stats,-lc -o $@'
9298                 ;;
9299         (mingw*)
9300                 cf_cv_shlib_version=mingw
9301                 cf_cv_shlib_version_infix=mingw
9302                 shlibdir=$bindir
9303                 MAKE_DLLS=
9304                 if test "$DFT_LWR_MODEL" = "shared" ; then
9305                         LOCAL_LDFLAGS="-Wl,--enable-auto-import"
9306                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
9307                         EXTRA_LDFLAGS="-Wl,--enable-auto-import $EXTRA_LDFLAGS"
9308                 fi
9309                 CC_SHARED_OPTS=
9310                 MK_SHARED_LIB='sh '$rel_builddir'/mk_shared_lib.sh $@ ${CC} ${CFLAGS}'
9311                 RM_SHARED_OPTS="$RM_SHARED_OPTS $rel_builddir/mk_shared_lib.sh *.dll.a"
9312                 cat >mk_shared_lib.sh <<-CF_EOF
9313                 #!/bin/sh
9314                 SHARED_LIB=\$1
9315                 IMPORT_LIB=\`echo "\$1" | sed -e 's/[0-9]*\.dll$/.dll.a/'\`
9316                 shift
9317                 cat <<-EOF
9318                 Linking shared library
9319                 ** SHARED_LIB \$SHARED_LIB
9320                 ** IMPORT_LIB \$IMPORT_LIB
9321 EOF
9322                 exec \$* -shared -Wl,--enable-auto-import,--out-implib=\${IMPORT_LIB} -Wl,--export-all-symbols -o \${SHARED_LIB}
9323 CF_EOF
9324                 chmod +x mk_shared_lib.sh
9325                 ;;
9326         (openbsd[2-9].*|mirbsd*)
9327                 if test "$DFT_LWR_MODEL" = "shared" ; then
9328                         LOCAL_LDFLAGS="${LD_RPATH_OPT}\$(LOCAL_LIBDIR)"
9329                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
9330                 fi
9331                 if test "$cf_cv_enable_rpath" = yes ; then
9332                         EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
9333                 fi
9334                 CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
9335
9336         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
9337         if test "$cf_cv_shlib_version" = rel; then
9338                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
9339         else
9340                 cf_cv_shared_soname='`basename $@`'
9341         fi
9342
9343                 MK_SHARED_LIB='${CC} ${CFLAGS} -shared -Wl,-Bshareable,-soname,'$cf_cv_shared_soname',-stats,-lc -o $@'
9344                 ;;
9345         (nto-qnx*|openbsd*|freebsd[12].*)
9346                 CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
9347                 MK_SHARED_LIB='${LD} -Bshareable -o $@'
9348                 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
9349                 ;;
9350         (dragonfly*|freebsd*)
9351                 CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
9352                 if test "$DFT_LWR_MODEL" = "shared" && test "$cf_cv_enable_rpath" = yes ; then
9353                         LOCAL_LDFLAGS="${cf_ld_rpath_opt}\$(LOCAL_LIBDIR)"
9354                         LOCAL_LDFLAGS2="${cf_ld_rpath_opt}\${RPATH_LIST} $LOCAL_LDFLAGS"
9355                         EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
9356                 fi
9357
9358         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
9359         if test "$cf_cv_shlib_version" = rel; then
9360                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
9361         else
9362                 cf_cv_shared_soname='`basename $@`'
9363         fi
9364
9365                 MK_SHARED_LIB='${CC} ${CFLAGS} -shared -Wl,-soname,'$cf_cv_shared_soname',-stats,-lc -o $@'
9366                 ;;
9367         (netbsd*)
9368                 CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
9369                 if test "$DFT_LWR_MODEL" = "shared" && test "$cf_cv_enable_rpath" = yes ; then
9370                         LOCAL_LDFLAGS="${cf_ld_rpath_opt}\$(LOCAL_LIBDIR)"
9371                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
9372                         EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
9373                         if test "$cf_cv_shlib_version" = auto; then
9374                         if test -f /usr/libexec/ld.elf_so; then
9375                                 cf_cv_shlib_version=abi
9376                         else
9377                                 cf_cv_shlib_version=rel
9378                         fi
9379                         fi
9380
9381         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
9382         if test "$cf_cv_shlib_version" = rel; then
9383                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
9384         else
9385                 cf_cv_shared_soname='`basename $@`'
9386         fi
9387
9388                         MK_SHARED_LIB='${CC} ${CFLAGS} -shared -Wl,-soname,'$cf_cv_shared_soname' -o $@'
9389                 else
9390                         MK_SHARED_LIB='${CC} -Wl,-shared -Wl,-Bshareable -o $@'
9391                 fi
9392                 ;;
9393         (osf*|mls+*)
9394                 # tested with OSF/1 V3.2 and 'cc'
9395                 # tested with OSF/1 V3.2 and gcc 2.6.3 (but the c++ demo didn't
9396                 # link with shared libs).
9397                 MK_SHARED_LIB='${LD} -set_version ${REL_VERSION}:${ABI_VERSION} -expect_unresolved "*" -shared -soname `basename $@`'
9398                 case $host_os in
9399                 (osf4*)
9400                         MK_SHARED_LIB="${MK_SHARED_LIB} -msym"
9401                         ;;
9402                 esac
9403                 MK_SHARED_LIB="${MK_SHARED_LIB}"' -o $@'
9404                 if test "$DFT_LWR_MODEL" = "shared" ; then
9405                         LOCAL_LDFLAGS="${LD_RPATH_OPT}\$(LOCAL_LIBDIR)"
9406                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
9407                 fi
9408                 cf_cv_rm_so_locs=yes
9409                 ;;
9410         (sco3.2v5*)  # also uw2* and UW7: hops 13-Apr-98
9411                 # tested with osr5.0.5
9412                 if test "$GCC" != yes; then
9413                         CC_SHARED_OPTS='-belf -KPIC'
9414                 fi
9415                 MK_SHARED_LIB='${LD} -dy -G -h `basename $@ .${REL_VERSION}`.${ABI_VERSION} -o $@'
9416                 if test "$cf_cv_enable_rpath" = yes ; then
9417                         # only way is to set LD_RUN_PATH but no switch for it
9418                         RUN_PATH=$libdir
9419                 fi
9420                 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
9421                 LINK_PROGS='LD_RUN_PATH=${libdir}'
9422                 LINK_TESTS='Pwd=`pwd`;LD_RUN_PATH=`dirname $${Pwd}`/lib'
9423                 ;;
9424         (sunos4*)
9425                 # tested with SunOS 4.1.1 and gcc 2.7.0
9426                 if test "$GCC" != yes; then
9427                         CC_SHARED_OPTS='-KPIC'
9428                 fi
9429                 MK_SHARED_LIB='${LD} -assert pure-text -o $@'
9430                 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
9431                 ;;
9432         (solaris2*)
9433                 # tested with SunOS 5.5.1 (solaris 2.5.1) and gcc 2.7.2
9434                 # tested with SunOS 5.10 (solaris 10) and gcc 3.4.3
9435                 if test "$DFT_LWR_MODEL" = "shared" ; then
9436                         LOCAL_LDFLAGS="-R \$(LOCAL_LIBDIR):\${libdir}"
9437                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
9438                 fi
9439                 if test "$cf_cv_enable_rpath" = yes ; then
9440                         EXTRA_LDFLAGS="-R \${libdir} $EXTRA_LDFLAGS"
9441                 fi
9442
9443         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
9444         if test "$cf_cv_shlib_version" = rel; then
9445                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
9446         else
9447                 cf_cv_shared_soname='`basename $@`'
9448         fi
9449
9450                 if test "$GCC" != yes; then
9451                         cf_save_CFLAGS="$CFLAGS"
9452                         for cf_shared_opts in -xcode=pic32 -xcode=pic13 -KPIC -Kpic -O
9453                         do
9454                                 CFLAGS="$cf_shared_opts $cf_save_CFLAGS"
9455                                 cat >conftest.$ac_ext <<_ACEOF
9456 #line 9456 "configure"
9457 #include "confdefs.h"
9458 #include <stdio.h>
9459 int
9460 main ()
9461 {
9462 printf("Hello\n");
9463   ;
9464   return 0;
9465 }
9466 _ACEOF
9467 rm -f conftest.$ac_objext
9468 if { (eval echo "$as_me:9468: \"$ac_compile\"") >&5
9469   (eval $ac_compile) 2>&5
9470   ac_status=$?
9471   echo "$as_me:9471: \$? = $ac_status" >&5
9472   (exit $ac_status); } &&
9473          { ac_try='test -s conftest.$ac_objext'
9474   { (eval echo "$as_me:9474: \"$ac_try\"") >&5
9475   (eval $ac_try) 2>&5
9476   ac_status=$?
9477   echo "$as_me:9477: \$? = $ac_status" >&5
9478   (exit $ac_status); }; }; then
9479   break
9480 else
9481   echo "$as_me: failed program was:" >&5
9482 cat conftest.$ac_ext >&5
9483 fi
9484 rm -f conftest.$ac_objext conftest.$ac_ext
9485                         done
9486                         CFLAGS="$cf_save_CFLAGS"
9487                         CC_SHARED_OPTS=$cf_shared_opts
9488                         MK_SHARED_LIB='${CC} -dy -G -h '$cf_cv_shared_soname' -o $@'
9489                 else
9490                         MK_SHARED_LIB='${CC} -shared -dy -G -h '$cf_cv_shared_soname' -o $@'
9491                 fi
9492                 ;;
9493         (sysv5uw7*|unix_sv*)
9494                 # tested with UnixWare 7.1.0 (gcc 2.95.2 and cc)
9495                 if test "$GCC" != yes; then
9496                         CC_SHARED_OPTS='-KPIC'
9497                 fi
9498                 MK_SHARED_LIB='${LD} -d y -G -o $@'
9499                 ;;
9500         (*)
9501                 CC_SHARED_OPTS='unknown'
9502                 MK_SHARED_LIB='echo unknown'
9503                 ;;
9504         esac
9505
9506         # This works if the last tokens in $MK_SHARED_LIB are the -o target.
9507         case "$cf_cv_shlib_version" in
9508         (rel|abi)
9509                 case "$MK_SHARED_LIB" in
9510                 (*'-o $@')
9511                         test "$cf_cv_do_symlinks" = no && cf_cv_do_symlinks=yes
9512                         ;;
9513                 (*)
9514                         { echo "$as_me:9514: WARNING: ignored --with-shlib-version" >&5
9515 echo "$as_me: WARNING: ignored --with-shlib-version" >&2;}
9516                         ;;
9517                 esac
9518                 ;;
9519         esac
9520
9521         if test -n "$cf_try_cflags"
9522         then
9523 cat > conftest.$ac_ext <<EOF
9524 #line 9524 "${as_me:-configure}"
9525 #include <stdio.h>
9526 int main(int argc, char *argv[])
9527 {
9528         printf("hello\n");
9529         return (argv[argc-1] == 0) ;
9530 }
9531 EOF
9532                 cf_save_CFLAGS="$CFLAGS"
9533                 for cf_opt in $cf_try_cflags
9534                 do
9535                         CFLAGS="$cf_save_CFLAGS -$cf_opt"
9536                         echo "$as_me:9536: checking if CFLAGS option -$cf_opt works" >&5
9537 echo $ECHO_N "checking if CFLAGS option -$cf_opt works... $ECHO_C" >&6
9538                         if { (eval echo "$as_me:9538: \"$ac_compile\"") >&5
9539   (eval $ac_compile) 2>&5
9540   ac_status=$?
9541   echo "$as_me:9541: \$? = $ac_status" >&5
9542   (exit $ac_status); }; then
9543                                 echo "$as_me:9543: result: yes" >&5
9544 echo "${ECHO_T}yes" >&6
9545                                 cf_save_CFLAGS="$CFLAGS"
9546                         else
9547                                 echo "$as_me:9547: result: no" >&5
9548 echo "${ECHO_T}no" >&6
9549                         fi
9550                 done
9551                 CFLAGS="$cf_save_CFLAGS"
9552         fi
9553
9554         # RPATH_LIST is a colon-separated list of directories
9555         test -n "$cf_ld_rpath_opt" && MK_SHARED_LIB="$MK_SHARED_LIB $cf_ld_rpath_opt\${RPATH_LIST}"
9556         test -z "$RPATH_LIST" && RPATH_LIST="\${libdir}"
9557
9558         test $cf_cv_rm_so_locs = yes && RM_SHARED_OPTS="$RM_SHARED_OPTS so_locations"
9559
9560         test -n "$verbose" && echo "    CC_SHARED_OPTS: $CC_SHARED_OPTS" 1>&6
9561
9562 echo "${as_me:-configure}:9562: testing CC_SHARED_OPTS: $CC_SHARED_OPTS ..." 1>&5
9563
9564         test -n "$verbose" && echo "    MK_SHARED_LIB:  $MK_SHARED_LIB" 1>&6
9565
9566 echo "${as_me:-configure}:9566: testing MK_SHARED_LIB:  $MK_SHARED_LIB ..." 1>&5
9567
9568 # The test/sample programs in the original tree link using rpath option.
9569 # Make it optional for packagers.
9570 if test -n "$LOCAL_LDFLAGS"
9571 then
9572         echo "$as_me:9572: checking if you want to link sample programs with rpath option" >&5
9573 echo $ECHO_N "checking if you want to link sample programs with rpath option... $ECHO_C" >&6
9574
9575 # Check whether --enable-rpath-link or --disable-rpath-link was given.
9576 if test "${enable_rpath_link+set}" = set; then
9577   enableval="$enable_rpath_link"
9578   with_rpath_link=$enableval
9579 else
9580   with_rpath_link=yes
9581 fi;
9582         echo "$as_me:9582: result: $with_rpath_link" >&5
9583 echo "${ECHO_T}$with_rpath_link" >&6
9584         if test "$with_rpath_link" = no
9585         then
9586                 LOCAL_LDFLAGS=
9587                 LOCAL_LDFLAGS2=
9588         fi
9589 fi
9590
9591 ###############################################################################
9592
9593 ###   use option --enable-broken-linker to force on use of broken-linker support
9594 echo "$as_me:9594: checking if you want broken-linker support code" >&5
9595 echo $ECHO_N "checking if you want broken-linker support code... $ECHO_C" >&6
9596
9597 # Check whether --enable-broken_linker or --disable-broken_linker was given.
9598 if test "${enable_broken_linker+set}" = set; then
9599   enableval="$enable_broken_linker"
9600   with_broken_linker=$enableval
9601 else
9602   with_broken_linker=${BROKEN_LINKER:-no}
9603 fi;
9604 echo "$as_me:9604: result: $with_broken_linker" >&5
9605 echo "${ECHO_T}$with_broken_linker" >&6
9606
9607 BROKEN_LINKER=0
9608 if test "$with_broken_linker" = yes ; then
9609         cat >>confdefs.h <<\EOF
9610 #define BROKEN_LINKER 1
9611 EOF
9612
9613         BROKEN_LINKER=1
9614 elif test "$DFT_LWR_MODEL" = shared ; then
9615         case $cf_cv_system_name in
9616         (cygwin*)
9617                 cat >>confdefs.h <<\EOF
9618 #define BROKEN_LINKER 1
9619 EOF
9620
9621                 BROKEN_LINKER=1
9622                 test -n "$verbose" && echo "    cygwin linker is broken anyway" 1>&6
9623
9624 echo "${as_me:-configure}:9624: testing cygwin linker is broken anyway ..." 1>&5
9625
9626                 ;;
9627         esac
9628 fi
9629
9630 # Check to define _XOPEN_SOURCE "automatically"
9631
9632 cf_XOPEN_SOURCE=500
9633 cf_POSIX_C_SOURCE=199506L
9634 cf_xopen_source=
9635
9636 case $host_os in
9637 (aix[4-7]*)
9638         cf_xopen_source="-D_ALL_SOURCE"
9639         ;;
9640 (cygwin|msys)
9641         cf_XOPEN_SOURCE=600
9642         ;;
9643 (darwin[0-8].*)
9644         cf_xopen_source="-D_APPLE_C_SOURCE"
9645         ;;
9646 (darwin*)
9647         cf_xopen_source="-D_DARWIN_C_SOURCE"
9648         cf_XOPEN_SOURCE=
9649         ;;
9650 (freebsd*|dragonfly*)
9651         # 5.x headers associate
9652         #       _XOPEN_SOURCE=600 with _POSIX_C_SOURCE=200112L
9653         #       _XOPEN_SOURCE=500 with _POSIX_C_SOURCE=199506L
9654         cf_POSIX_C_SOURCE=200112L
9655         cf_XOPEN_SOURCE=600
9656         cf_xopen_source="-D_BSD_TYPES -D__BSD_VISIBLE -D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
9657         ;;
9658 (hpux11*)
9659         cf_xopen_source="-D_HPUX_SOURCE -D_XOPEN_SOURCE=500"
9660         ;;
9661 (hpux*)
9662         cf_xopen_source="-D_HPUX_SOURCE"
9663         ;;
9664 (irix[56].*)
9665         cf_xopen_source="-D_SGI_SOURCE"
9666         cf_XOPEN_SOURCE=
9667         ;;
9668 (linux*|gnu*|mint*|k*bsd*-gnu)
9669
9670 echo "$as_me:9670: checking if we must define _GNU_SOURCE" >&5
9671 echo $ECHO_N "checking if we must define _GNU_SOURCE... $ECHO_C" >&6
9672 if test "${cf_cv_gnu_source+set}" = set; then
9673   echo $ECHO_N "(cached) $ECHO_C" >&6
9674 else
9675
9676 cat >conftest.$ac_ext <<_ACEOF
9677 #line 9677 "configure"
9678 #include "confdefs.h"
9679 #include <sys/types.h>
9680 int
9681 main ()
9682 {
9683
9684 #ifndef _XOPEN_SOURCE
9685 make an error
9686 #endif
9687   ;
9688   return 0;
9689 }
9690 _ACEOF
9691 rm -f conftest.$ac_objext
9692 if { (eval echo "$as_me:9692: \"$ac_compile\"") >&5
9693   (eval $ac_compile) 2>&5
9694   ac_status=$?
9695   echo "$as_me:9695: \$? = $ac_status" >&5
9696   (exit $ac_status); } &&
9697          { ac_try='test -s conftest.$ac_objext'
9698   { (eval echo "$as_me:9698: \"$ac_try\"") >&5
9699   (eval $ac_try) 2>&5
9700   ac_status=$?
9701   echo "$as_me:9701: \$? = $ac_status" >&5
9702   (exit $ac_status); }; }; then
9703   cf_cv_gnu_source=no
9704 else
9705   echo "$as_me: failed program was:" >&5
9706 cat conftest.$ac_ext >&5
9707 cf_save="$CPPFLAGS"
9708          CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
9709          cat >conftest.$ac_ext <<_ACEOF
9710 #line 9710 "configure"
9711 #include "confdefs.h"
9712 #include <sys/types.h>
9713 int
9714 main ()
9715 {
9716
9717 #ifdef _XOPEN_SOURCE
9718 make an error
9719 #endif
9720   ;
9721   return 0;
9722 }
9723 _ACEOF
9724 rm -f conftest.$ac_objext
9725 if { (eval echo "$as_me:9725: \"$ac_compile\"") >&5
9726   (eval $ac_compile) 2>&5
9727   ac_status=$?
9728   echo "$as_me:9728: \$? = $ac_status" >&5
9729   (exit $ac_status); } &&
9730          { ac_try='test -s conftest.$ac_objext'
9731   { (eval echo "$as_me:9731: \"$ac_try\"") >&5
9732   (eval $ac_try) 2>&5
9733   ac_status=$?
9734   echo "$as_me:9734: \$? = $ac_status" >&5
9735   (exit $ac_status); }; }; then
9736   cf_cv_gnu_source=no
9737 else
9738   echo "$as_me: failed program was:" >&5
9739 cat conftest.$ac_ext >&5
9740 cf_cv_gnu_source=yes
9741 fi
9742 rm -f conftest.$ac_objext conftest.$ac_ext
9743         CPPFLAGS="$cf_save"
9744
9745 fi
9746 rm -f conftest.$ac_objext conftest.$ac_ext
9747
9748 fi
9749 echo "$as_me:9749: result: $cf_cv_gnu_source" >&5
9750 echo "${ECHO_T}$cf_cv_gnu_source" >&6
9751 test "$cf_cv_gnu_source" = yes && CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
9752
9753         ;;
9754 (minix*)
9755         cf_xopen_source="-D_NETBSD_SOURCE" # POSIX.1-2001 features are ifdef'd with this...
9756         ;;
9757 (mirbsd*)
9758         # setting _XOPEN_SOURCE or _POSIX_SOURCE breaks <sys/select.h> and other headers which use u_int / u_short types
9759         cf_XOPEN_SOURCE=
9760
9761 cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE
9762
9763 cf_save_CFLAGS="$CFLAGS"
9764 cf_save_CPPFLAGS="$CPPFLAGS"
9765
9766 cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \
9767         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
9768                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
9769
9770 cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \
9771         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
9772                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
9773
9774 echo "$as_me:9774: checking if we should define _POSIX_C_SOURCE" >&5
9775 echo $ECHO_N "checking if we should define _POSIX_C_SOURCE... $ECHO_C" >&6
9776 if test "${cf_cv_posix_c_source+set}" = set; then
9777   echo $ECHO_N "(cached) $ECHO_C" >&6
9778 else
9779
9780 echo "${as_me:-configure}:9780: testing if the symbol is already defined go no further ..." 1>&5
9781
9782         cat >conftest.$ac_ext <<_ACEOF
9783 #line 9783 "configure"
9784 #include "confdefs.h"
9785 #include <sys/types.h>
9786 int
9787 main ()
9788 {
9789
9790 #ifndef _POSIX_C_SOURCE
9791 make an error
9792 #endif
9793   ;
9794   return 0;
9795 }
9796 _ACEOF
9797 rm -f conftest.$ac_objext
9798 if { (eval echo "$as_me:9798: \"$ac_compile\"") >&5
9799   (eval $ac_compile) 2>&5
9800   ac_status=$?
9801   echo "$as_me:9801: \$? = $ac_status" >&5
9802   (exit $ac_status); } &&
9803          { ac_try='test -s conftest.$ac_objext'
9804   { (eval echo "$as_me:9804: \"$ac_try\"") >&5
9805   (eval $ac_try) 2>&5
9806   ac_status=$?
9807   echo "$as_me:9807: \$? = $ac_status" >&5
9808   (exit $ac_status); }; }; then
9809   cf_cv_posix_c_source=no
9810 else
9811   echo "$as_me: failed program was:" >&5
9812 cat conftest.$ac_ext >&5
9813 cf_want_posix_source=no
9814          case .$cf_POSIX_C_SOURCE in
9815          (.[12]??*)
9816                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
9817                 ;;
9818          (.2)
9819                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
9820                 cf_want_posix_source=yes
9821                 ;;
9822          (.*)
9823                 cf_want_posix_source=yes
9824                 ;;
9825          esac
9826          if test "$cf_want_posix_source" = yes ; then
9827                 cat >conftest.$ac_ext <<_ACEOF
9828 #line 9828 "configure"
9829 #include "confdefs.h"
9830 #include <sys/types.h>
9831 int
9832 main ()
9833 {
9834
9835 #ifdef _POSIX_SOURCE
9836 make an error
9837 #endif
9838   ;
9839   return 0;
9840 }
9841 _ACEOF
9842 rm -f conftest.$ac_objext
9843 if { (eval echo "$as_me:9843: \"$ac_compile\"") >&5
9844   (eval $ac_compile) 2>&5
9845   ac_status=$?
9846   echo "$as_me:9846: \$? = $ac_status" >&5
9847   (exit $ac_status); } &&
9848          { ac_try='test -s conftest.$ac_objext'
9849   { (eval echo "$as_me:9849: \"$ac_try\"") >&5
9850   (eval $ac_try) 2>&5
9851   ac_status=$?
9852   echo "$as_me:9852: \$? = $ac_status" >&5
9853   (exit $ac_status); }; }; then
9854   :
9855 else
9856   echo "$as_me: failed program was:" >&5
9857 cat conftest.$ac_ext >&5
9858 cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE"
9859 fi
9860 rm -f conftest.$ac_objext conftest.$ac_ext
9861          fi
9862
9863 echo "${as_me:-configure}:9863: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
9864
9865          CFLAGS="$cf_trim_CFLAGS"
9866          CPPFLAGS="$cf_trim_CPPFLAGS $cf_cv_posix_c_source"
9867
9868 echo "${as_me:-configure}:9868: testing if the second compile does not leave our definition intact error ..." 1>&5
9869
9870          cat >conftest.$ac_ext <<_ACEOF
9871 #line 9871 "configure"
9872 #include "confdefs.h"
9873 #include <sys/types.h>
9874 int
9875 main ()
9876 {
9877
9878 #ifndef _POSIX_C_SOURCE
9879 make an error
9880 #endif
9881   ;
9882   return 0;
9883 }
9884 _ACEOF
9885 rm -f conftest.$ac_objext
9886 if { (eval echo "$as_me:9886: \"$ac_compile\"") >&5
9887   (eval $ac_compile) 2>&5
9888   ac_status=$?
9889   echo "$as_me:9889: \$? = $ac_status" >&5
9890   (exit $ac_status); } &&
9891          { ac_try='test -s conftest.$ac_objext'
9892   { (eval echo "$as_me:9892: \"$ac_try\"") >&5
9893   (eval $ac_try) 2>&5
9894   ac_status=$?
9895   echo "$as_me:9895: \$? = $ac_status" >&5
9896   (exit $ac_status); }; }; then
9897   :
9898 else
9899   echo "$as_me: failed program was:" >&5
9900 cat conftest.$ac_ext >&5
9901 cf_cv_posix_c_source=no
9902 fi
9903 rm -f conftest.$ac_objext conftest.$ac_ext
9904          CFLAGS="$cf_save_CFLAGS"
9905          CPPFLAGS="$cf_save_CPPFLAGS"
9906
9907 fi
9908 rm -f conftest.$ac_objext conftest.$ac_ext
9909
9910 fi
9911 echo "$as_me:9911: result: $cf_cv_posix_c_source" >&5
9912 echo "${ECHO_T}$cf_cv_posix_c_source" >&6
9913
9914 if test "$cf_cv_posix_c_source" != no ; then
9915         CFLAGS="$cf_trim_CFLAGS"
9916         CPPFLAGS="$cf_trim_CPPFLAGS"
9917
9918 cf_fix_cppflags=no
9919 cf_new_cflags=
9920 cf_new_cppflags=
9921 cf_new_extra_cppflags=
9922
9923 for cf_add_cflags in $cf_cv_posix_c_source
9924 do
9925 case $cf_fix_cppflags in
9926 (no)
9927         case $cf_add_cflags in
9928         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
9929                 case $cf_add_cflags in
9930                 (-D*)
9931                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
9932
9933                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
9934                                 && test -z "${cf_tst_cflags}" \
9935                                 && cf_fix_cppflags=yes
9936
9937                         if test $cf_fix_cppflags = yes ; then
9938                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
9939                                 continue
9940                         elif test "${cf_tst_cflags}" = "\"'" ; then
9941                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
9942                                 continue
9943                         fi
9944                         ;;
9945                 esac
9946                 case "$CPPFLAGS" in
9947                 (*$cf_add_cflags)
9948                         ;;
9949                 (*)
9950                         case $cf_add_cflags in
9951                         (-D*)
9952                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
9953
9954 CPPFLAGS=`echo "$CPPFLAGS" | \
9955         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
9956                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
9957
9958                                 ;;
9959                         esac
9960                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
9961                         ;;
9962                 esac
9963                 ;;
9964         (*)
9965                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
9966                 ;;
9967         esac
9968         ;;
9969 (yes)
9970         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
9971
9972         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
9973
9974         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
9975                 && test -z "${cf_tst_cflags}" \
9976                 && cf_fix_cppflags=no
9977         ;;
9978 esac
9979 done
9980
9981 if test -n "$cf_new_cflags" ; then
9982
9983         CFLAGS="$CFLAGS $cf_new_cflags"
9984 fi
9985
9986 if test -n "$cf_new_cppflags" ; then
9987
9988         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
9989 fi
9990
9991 if test -n "$cf_new_extra_cppflags" ; then
9992
9993         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
9994 fi
9995
9996 fi
9997
9998         ;;
9999 (netbsd*)
10000         cf_xopen_source="-D_NETBSD_SOURCE" # setting _XOPEN_SOURCE breaks IPv6 for lynx on NetBSD 1.6, breaks xterm, is not needed for ncursesw
10001         ;;
10002 (openbsd[4-9]*)
10003         # setting _XOPEN_SOURCE lower than 500 breaks g++ compile with wchar.h, needed for ncursesw
10004         cf_xopen_source="-D_BSD_SOURCE"
10005         cf_XOPEN_SOURCE=600
10006         ;;
10007 (openbsd*)
10008         # setting _XOPEN_SOURCE breaks xterm on OpenBSD 2.8, is not needed for ncursesw
10009         ;;
10010 (osf[45]*)
10011         cf_xopen_source="-D_OSF_SOURCE"
10012         ;;
10013 (nto-qnx*)
10014         cf_xopen_source="-D_QNX_SOURCE"
10015         ;;
10016 (sco*)
10017         # setting _XOPEN_SOURCE breaks Lynx on SCO Unix / OpenServer
10018         ;;
10019 (solaris2.*)
10020         cf_xopen_source="-D__EXTENSIONS__"
10021         cf_cv_xopen_source=broken
10022         ;;
10023 (sysv4.2uw2.*) # Novell/SCO UnixWare 2.x (tested on 2.1.2)
10024         cf_XOPEN_SOURCE=
10025         cf_POSIX_C_SOURCE=
10026         ;;
10027 (*)
10028
10029 echo "$as_me:10029: checking if we should define _XOPEN_SOURCE" >&5
10030 echo $ECHO_N "checking if we should define _XOPEN_SOURCE... $ECHO_C" >&6
10031 if test "${cf_cv_xopen_source+set}" = set; then
10032   echo $ECHO_N "(cached) $ECHO_C" >&6
10033 else
10034
10035         cat >conftest.$ac_ext <<_ACEOF
10036 #line 10036 "configure"
10037 #include "confdefs.h"
10038
10039 #include <stdlib.h>
10040 #include <string.h>
10041 #include <sys/types.h>
10042
10043 int
10044 main ()
10045 {
10046
10047 #ifndef _XOPEN_SOURCE
10048 make an error
10049 #endif
10050   ;
10051   return 0;
10052 }
10053 _ACEOF
10054 rm -f conftest.$ac_objext
10055 if { (eval echo "$as_me:10055: \"$ac_compile\"") >&5
10056   (eval $ac_compile) 2>&5
10057   ac_status=$?
10058   echo "$as_me:10058: \$? = $ac_status" >&5
10059   (exit $ac_status); } &&
10060          { ac_try='test -s conftest.$ac_objext'
10061   { (eval echo "$as_me:10061: \"$ac_try\"") >&5
10062   (eval $ac_try) 2>&5
10063   ac_status=$?
10064   echo "$as_me:10064: \$? = $ac_status" >&5
10065   (exit $ac_status); }; }; then
10066   cf_cv_xopen_source=no
10067 else
10068   echo "$as_me: failed program was:" >&5
10069 cat conftest.$ac_ext >&5
10070 cf_save="$CPPFLAGS"
10071          CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
10072          cat >conftest.$ac_ext <<_ACEOF
10073 #line 10073 "configure"
10074 #include "confdefs.h"
10075
10076 #include <stdlib.h>
10077 #include <string.h>
10078 #include <sys/types.h>
10079
10080 int
10081 main ()
10082 {
10083
10084 #ifdef _XOPEN_SOURCE
10085 make an error
10086 #endif
10087   ;
10088   return 0;
10089 }
10090 _ACEOF
10091 rm -f conftest.$ac_objext
10092 if { (eval echo "$as_me:10092: \"$ac_compile\"") >&5
10093   (eval $ac_compile) 2>&5
10094   ac_status=$?
10095   echo "$as_me:10095: \$? = $ac_status" >&5
10096   (exit $ac_status); } &&
10097          { ac_try='test -s conftest.$ac_objext'
10098   { (eval echo "$as_me:10098: \"$ac_try\"") >&5
10099   (eval $ac_try) 2>&5
10100   ac_status=$?
10101   echo "$as_me:10101: \$? = $ac_status" >&5
10102   (exit $ac_status); }; }; then
10103   cf_cv_xopen_source=no
10104 else
10105   echo "$as_me: failed program was:" >&5
10106 cat conftest.$ac_ext >&5
10107 cf_cv_xopen_source=$cf_XOPEN_SOURCE
10108 fi
10109 rm -f conftest.$ac_objext conftest.$ac_ext
10110         CPPFLAGS="$cf_save"
10111
10112 fi
10113 rm -f conftest.$ac_objext conftest.$ac_ext
10114
10115 fi
10116 echo "$as_me:10116: result: $cf_cv_xopen_source" >&5
10117 echo "${ECHO_T}$cf_cv_xopen_source" >&6
10118
10119 if test "$cf_cv_xopen_source" != no ; then
10120
10121 CFLAGS=`echo "$CFLAGS" | \
10122         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
10123                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
10124
10125 CPPFLAGS=`echo "$CPPFLAGS" | \
10126         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
10127                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
10128
10129         cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source"
10130
10131 cf_fix_cppflags=no
10132 cf_new_cflags=
10133 cf_new_cppflags=
10134 cf_new_extra_cppflags=
10135
10136 for cf_add_cflags in $cf_temp_xopen_source
10137 do
10138 case $cf_fix_cppflags in
10139 (no)
10140         case $cf_add_cflags in
10141         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
10142                 case $cf_add_cflags in
10143                 (-D*)
10144                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
10145
10146                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10147                                 && test -z "${cf_tst_cflags}" \
10148                                 && cf_fix_cppflags=yes
10149
10150                         if test $cf_fix_cppflags = yes ; then
10151                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10152                                 continue
10153                         elif test "${cf_tst_cflags}" = "\"'" ; then
10154                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10155                                 continue
10156                         fi
10157                         ;;
10158                 esac
10159                 case "$CPPFLAGS" in
10160                 (*$cf_add_cflags)
10161                         ;;
10162                 (*)
10163                         case $cf_add_cflags in
10164                         (-D*)
10165                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
10166
10167 CPPFLAGS=`echo "$CPPFLAGS" | \
10168         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
10169                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
10170
10171                                 ;;
10172                         esac
10173                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
10174                         ;;
10175                 esac
10176                 ;;
10177         (*)
10178                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
10179                 ;;
10180         esac
10181         ;;
10182 (yes)
10183         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10184
10185         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
10186
10187         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10188                 && test -z "${cf_tst_cflags}" \
10189                 && cf_fix_cppflags=no
10190         ;;
10191 esac
10192 done
10193
10194 if test -n "$cf_new_cflags" ; then
10195
10196         CFLAGS="$CFLAGS $cf_new_cflags"
10197 fi
10198
10199 if test -n "$cf_new_cppflags" ; then
10200
10201         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
10202 fi
10203
10204 if test -n "$cf_new_extra_cppflags" ; then
10205
10206         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
10207 fi
10208
10209 fi
10210
10211 cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE
10212
10213 cf_save_CFLAGS="$CFLAGS"
10214 cf_save_CPPFLAGS="$CPPFLAGS"
10215
10216 cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \
10217         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
10218                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
10219
10220 cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \
10221         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
10222                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
10223
10224 echo "$as_me:10224: checking if we should define _POSIX_C_SOURCE" >&5
10225 echo $ECHO_N "checking if we should define _POSIX_C_SOURCE... $ECHO_C" >&6
10226 if test "${cf_cv_posix_c_source+set}" = set; then
10227   echo $ECHO_N "(cached) $ECHO_C" >&6
10228 else
10229
10230 echo "${as_me:-configure}:10230: testing if the symbol is already defined go no further ..." 1>&5
10231
10232         cat >conftest.$ac_ext <<_ACEOF
10233 #line 10233 "configure"
10234 #include "confdefs.h"
10235 #include <sys/types.h>
10236 int
10237 main ()
10238 {
10239
10240 #ifndef _POSIX_C_SOURCE
10241 make an error
10242 #endif
10243   ;
10244   return 0;
10245 }
10246 _ACEOF
10247 rm -f conftest.$ac_objext
10248 if { (eval echo "$as_me:10248: \"$ac_compile\"") >&5
10249   (eval $ac_compile) 2>&5
10250   ac_status=$?
10251   echo "$as_me:10251: \$? = $ac_status" >&5
10252   (exit $ac_status); } &&
10253          { ac_try='test -s conftest.$ac_objext'
10254   { (eval echo "$as_me:10254: \"$ac_try\"") >&5
10255   (eval $ac_try) 2>&5
10256   ac_status=$?
10257   echo "$as_me:10257: \$? = $ac_status" >&5
10258   (exit $ac_status); }; }; then
10259   cf_cv_posix_c_source=no
10260 else
10261   echo "$as_me: failed program was:" >&5
10262 cat conftest.$ac_ext >&5
10263 cf_want_posix_source=no
10264          case .$cf_POSIX_C_SOURCE in
10265          (.[12]??*)
10266                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
10267                 ;;
10268          (.2)
10269                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
10270                 cf_want_posix_source=yes
10271                 ;;
10272          (.*)
10273                 cf_want_posix_source=yes
10274                 ;;
10275          esac
10276          if test "$cf_want_posix_source" = yes ; then
10277                 cat >conftest.$ac_ext <<_ACEOF
10278 #line 10278 "configure"
10279 #include "confdefs.h"
10280 #include <sys/types.h>
10281 int
10282 main ()
10283 {
10284
10285 #ifdef _POSIX_SOURCE
10286 make an error
10287 #endif
10288   ;
10289   return 0;
10290 }
10291 _ACEOF
10292 rm -f conftest.$ac_objext
10293 if { (eval echo "$as_me:10293: \"$ac_compile\"") >&5
10294   (eval $ac_compile) 2>&5
10295   ac_status=$?
10296   echo "$as_me:10296: \$? = $ac_status" >&5
10297   (exit $ac_status); } &&
10298          { ac_try='test -s conftest.$ac_objext'
10299   { (eval echo "$as_me:10299: \"$ac_try\"") >&5
10300   (eval $ac_try) 2>&5
10301   ac_status=$?
10302   echo "$as_me:10302: \$? = $ac_status" >&5
10303   (exit $ac_status); }; }; then
10304   :
10305 else
10306   echo "$as_me: failed program was:" >&5
10307 cat conftest.$ac_ext >&5
10308 cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE"
10309 fi
10310 rm -f conftest.$ac_objext conftest.$ac_ext
10311          fi
10312
10313 echo "${as_me:-configure}:10313: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
10314
10315          CFLAGS="$cf_trim_CFLAGS"
10316          CPPFLAGS="$cf_trim_CPPFLAGS $cf_cv_posix_c_source"
10317
10318 echo "${as_me:-configure}:10318: testing if the second compile does not leave our definition intact error ..." 1>&5
10319
10320          cat >conftest.$ac_ext <<_ACEOF
10321 #line 10321 "configure"
10322 #include "confdefs.h"
10323 #include <sys/types.h>
10324 int
10325 main ()
10326 {
10327
10328 #ifndef _POSIX_C_SOURCE
10329 make an error
10330 #endif
10331   ;
10332   return 0;
10333 }
10334 _ACEOF
10335 rm -f conftest.$ac_objext
10336 if { (eval echo "$as_me:10336: \"$ac_compile\"") >&5
10337   (eval $ac_compile) 2>&5
10338   ac_status=$?
10339   echo "$as_me:10339: \$? = $ac_status" >&5
10340   (exit $ac_status); } &&
10341          { ac_try='test -s conftest.$ac_objext'
10342   { (eval echo "$as_me:10342: \"$ac_try\"") >&5
10343   (eval $ac_try) 2>&5
10344   ac_status=$?
10345   echo "$as_me:10345: \$? = $ac_status" >&5
10346   (exit $ac_status); }; }; then
10347   :
10348 else
10349   echo "$as_me: failed program was:" >&5
10350 cat conftest.$ac_ext >&5
10351 cf_cv_posix_c_source=no
10352 fi
10353 rm -f conftest.$ac_objext conftest.$ac_ext
10354          CFLAGS="$cf_save_CFLAGS"
10355          CPPFLAGS="$cf_save_CPPFLAGS"
10356
10357 fi
10358 rm -f conftest.$ac_objext conftest.$ac_ext
10359
10360 fi
10361 echo "$as_me:10361: result: $cf_cv_posix_c_source" >&5
10362 echo "${ECHO_T}$cf_cv_posix_c_source" >&6
10363
10364 if test "$cf_cv_posix_c_source" != no ; then
10365         CFLAGS="$cf_trim_CFLAGS"
10366         CPPFLAGS="$cf_trim_CPPFLAGS"
10367
10368 cf_fix_cppflags=no
10369 cf_new_cflags=
10370 cf_new_cppflags=
10371 cf_new_extra_cppflags=
10372
10373 for cf_add_cflags in $cf_cv_posix_c_source
10374 do
10375 case $cf_fix_cppflags in
10376 (no)
10377         case $cf_add_cflags in
10378         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
10379                 case $cf_add_cflags in
10380                 (-D*)
10381                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
10382
10383                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10384                                 && test -z "${cf_tst_cflags}" \
10385                                 && cf_fix_cppflags=yes
10386
10387                         if test $cf_fix_cppflags = yes ; then
10388                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10389                                 continue
10390                         elif test "${cf_tst_cflags}" = "\"'" ; then
10391                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10392                                 continue
10393                         fi
10394                         ;;
10395                 esac
10396                 case "$CPPFLAGS" in
10397                 (*$cf_add_cflags)
10398                         ;;
10399                 (*)
10400                         case $cf_add_cflags in
10401                         (-D*)
10402                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
10403
10404 CPPFLAGS=`echo "$CPPFLAGS" | \
10405         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
10406                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
10407
10408                                 ;;
10409                         esac
10410                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
10411                         ;;
10412                 esac
10413                 ;;
10414         (*)
10415                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
10416                 ;;
10417         esac
10418         ;;
10419 (yes)
10420         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10421
10422         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
10423
10424         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10425                 && test -z "${cf_tst_cflags}" \
10426                 && cf_fix_cppflags=no
10427         ;;
10428 esac
10429 done
10430
10431 if test -n "$cf_new_cflags" ; then
10432
10433         CFLAGS="$CFLAGS $cf_new_cflags"
10434 fi
10435
10436 if test -n "$cf_new_cppflags" ; then
10437
10438         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
10439 fi
10440
10441 if test -n "$cf_new_extra_cppflags" ; then
10442
10443         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
10444 fi
10445
10446 fi
10447
10448         ;;
10449 esac
10450
10451 if test -n "$cf_xopen_source" ; then
10452
10453 cf_fix_cppflags=no
10454 cf_new_cflags=
10455 cf_new_cppflags=
10456 cf_new_extra_cppflags=
10457
10458 for cf_add_cflags in $cf_xopen_source
10459 do
10460 case $cf_fix_cppflags in
10461 (no)
10462         case $cf_add_cflags in
10463         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
10464                 case $cf_add_cflags in
10465                 (-D*)
10466                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
10467
10468                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10469                                 && test -z "${cf_tst_cflags}" \
10470                                 && cf_fix_cppflags=yes
10471
10472                         if test $cf_fix_cppflags = yes ; then
10473                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10474                                 continue
10475                         elif test "${cf_tst_cflags}" = "\"'" ; then
10476                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10477                                 continue
10478                         fi
10479                         ;;
10480                 esac
10481                 case "$CPPFLAGS" in
10482                 (*$cf_add_cflags)
10483                         ;;
10484                 (*)
10485                         case $cf_add_cflags in
10486                         (-D*)
10487                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
10488
10489 CPPFLAGS=`echo "$CPPFLAGS" | \
10490         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
10491                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
10492
10493                                 ;;
10494                         esac
10495                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
10496                         ;;
10497                 esac
10498                 ;;
10499         (*)
10500                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
10501                 ;;
10502         esac
10503         ;;
10504 (yes)
10505         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10506
10507         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
10508
10509         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10510                 && test -z "${cf_tst_cflags}" \
10511                 && cf_fix_cppflags=no
10512         ;;
10513 esac
10514 done
10515
10516 if test -n "$cf_new_cflags" ; then
10517         test -n "$verbose" && echo "    add to \$CFLAGS $cf_new_cflags" 1>&6
10518
10519 echo "${as_me:-configure}:10519: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
10520
10521         CFLAGS="$CFLAGS $cf_new_cflags"
10522 fi
10523
10524 if test -n "$cf_new_cppflags" ; then
10525         test -n "$verbose" && echo "    add to \$CPPFLAGS $cf_new_cppflags" 1>&6
10526
10527 echo "${as_me:-configure}:10527: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
10528
10529         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
10530 fi
10531
10532 if test -n "$cf_new_extra_cppflags" ; then
10533         test -n "$verbose" && echo "    add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6
10534
10535 echo "${as_me:-configure}:10535: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
10536
10537         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
10538 fi
10539
10540 fi
10541
10542 if test -n "$cf_XOPEN_SOURCE" && test -z "$cf_cv_xopen_source" ; then
10543         echo "$as_me:10543: checking if _XOPEN_SOURCE really is set" >&5
10544 echo $ECHO_N "checking if _XOPEN_SOURCE really is set... $ECHO_C" >&6
10545         cat >conftest.$ac_ext <<_ACEOF
10546 #line 10546 "configure"
10547 #include "confdefs.h"
10548 #include <stdlib.h>
10549 int
10550 main ()
10551 {
10552
10553 #ifndef _XOPEN_SOURCE
10554 make an error
10555 #endif
10556   ;
10557   return 0;
10558 }
10559 _ACEOF
10560 rm -f conftest.$ac_objext
10561 if { (eval echo "$as_me:10561: \"$ac_compile\"") >&5
10562   (eval $ac_compile) 2>&5
10563   ac_status=$?
10564   echo "$as_me:10564: \$? = $ac_status" >&5
10565   (exit $ac_status); } &&
10566          { ac_try='test -s conftest.$ac_objext'
10567   { (eval echo "$as_me:10567: \"$ac_try\"") >&5
10568   (eval $ac_try) 2>&5
10569   ac_status=$?
10570   echo "$as_me:10570: \$? = $ac_status" >&5
10571   (exit $ac_status); }; }; then
10572   cf_XOPEN_SOURCE_set=yes
10573 else
10574   echo "$as_me: failed program was:" >&5
10575 cat conftest.$ac_ext >&5
10576 cf_XOPEN_SOURCE_set=no
10577 fi
10578 rm -f conftest.$ac_objext conftest.$ac_ext
10579         echo "$as_me:10579: result: $cf_XOPEN_SOURCE_set" >&5
10580 echo "${ECHO_T}$cf_XOPEN_SOURCE_set" >&6
10581         if test $cf_XOPEN_SOURCE_set = yes
10582         then
10583                 cat >conftest.$ac_ext <<_ACEOF
10584 #line 10584 "configure"
10585 #include "confdefs.h"
10586 #include <stdlib.h>
10587 int
10588 main ()
10589 {
10590
10591 #if (_XOPEN_SOURCE - 0) < $cf_XOPEN_SOURCE
10592 make an error
10593 #endif
10594   ;
10595   return 0;
10596 }
10597 _ACEOF
10598 rm -f conftest.$ac_objext
10599 if { (eval echo "$as_me:10599: \"$ac_compile\"") >&5
10600   (eval $ac_compile) 2>&5
10601   ac_status=$?
10602   echo "$as_me:10602: \$? = $ac_status" >&5
10603   (exit $ac_status); } &&
10604          { ac_try='test -s conftest.$ac_objext'
10605   { (eval echo "$as_me:10605: \"$ac_try\"") >&5
10606   (eval $ac_try) 2>&5
10607   ac_status=$?
10608   echo "$as_me:10608: \$? = $ac_status" >&5
10609   (exit $ac_status); }; }; then
10610   cf_XOPEN_SOURCE_set_ok=yes
10611 else
10612   echo "$as_me: failed program was:" >&5
10613 cat conftest.$ac_ext >&5
10614 cf_XOPEN_SOURCE_set_ok=no
10615 fi
10616 rm -f conftest.$ac_objext conftest.$ac_ext
10617                 if test $cf_XOPEN_SOURCE_set_ok = no
10618                 then
10619                         { echo "$as_me:10619: WARNING: _XOPEN_SOURCE is lower than requested" >&5
10620 echo "$as_me: WARNING: _XOPEN_SOURCE is lower than requested" >&2;}
10621                 fi
10622         else
10623
10624 echo "$as_me:10624: checking if we should define _XOPEN_SOURCE" >&5
10625 echo $ECHO_N "checking if we should define _XOPEN_SOURCE... $ECHO_C" >&6
10626 if test "${cf_cv_xopen_source+set}" = set; then
10627   echo $ECHO_N "(cached) $ECHO_C" >&6
10628 else
10629
10630         cat >conftest.$ac_ext <<_ACEOF
10631 #line 10631 "configure"
10632 #include "confdefs.h"
10633
10634 #include <stdlib.h>
10635 #include <string.h>
10636 #include <sys/types.h>
10637
10638 int
10639 main ()
10640 {
10641
10642 #ifndef _XOPEN_SOURCE
10643 make an error
10644 #endif
10645   ;
10646   return 0;
10647 }
10648 _ACEOF
10649 rm -f conftest.$ac_objext
10650 if { (eval echo "$as_me:10650: \"$ac_compile\"") >&5
10651   (eval $ac_compile) 2>&5
10652   ac_status=$?
10653   echo "$as_me:10653: \$? = $ac_status" >&5
10654   (exit $ac_status); } &&
10655          { ac_try='test -s conftest.$ac_objext'
10656   { (eval echo "$as_me:10656: \"$ac_try\"") >&5
10657   (eval $ac_try) 2>&5
10658   ac_status=$?
10659   echo "$as_me:10659: \$? = $ac_status" >&5
10660   (exit $ac_status); }; }; then
10661   cf_cv_xopen_source=no
10662 else
10663   echo "$as_me: failed program was:" >&5
10664 cat conftest.$ac_ext >&5
10665 cf_save="$CPPFLAGS"
10666          CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
10667          cat >conftest.$ac_ext <<_ACEOF
10668 #line 10668 "configure"
10669 #include "confdefs.h"
10670
10671 #include <stdlib.h>
10672 #include <string.h>
10673 #include <sys/types.h>
10674
10675 int
10676 main ()
10677 {
10678
10679 #ifdef _XOPEN_SOURCE
10680 make an error
10681 #endif
10682   ;
10683   return 0;
10684 }
10685 _ACEOF
10686 rm -f conftest.$ac_objext
10687 if { (eval echo "$as_me:10687: \"$ac_compile\"") >&5
10688   (eval $ac_compile) 2>&5
10689   ac_status=$?
10690   echo "$as_me:10690: \$? = $ac_status" >&5
10691   (exit $ac_status); } &&
10692          { ac_try='test -s conftest.$ac_objext'
10693   { (eval echo "$as_me:10693: \"$ac_try\"") >&5
10694   (eval $ac_try) 2>&5
10695   ac_status=$?
10696   echo "$as_me:10696: \$? = $ac_status" >&5
10697   (exit $ac_status); }; }; then
10698   cf_cv_xopen_source=no
10699 else
10700   echo "$as_me: failed program was:" >&5
10701 cat conftest.$ac_ext >&5
10702 cf_cv_xopen_source=$cf_XOPEN_SOURCE
10703 fi
10704 rm -f conftest.$ac_objext conftest.$ac_ext
10705         CPPFLAGS="$cf_save"
10706
10707 fi
10708 rm -f conftest.$ac_objext conftest.$ac_ext
10709
10710 fi
10711 echo "$as_me:10711: result: $cf_cv_xopen_source" >&5
10712 echo "${ECHO_T}$cf_cv_xopen_source" >&6
10713
10714 if test "$cf_cv_xopen_source" != no ; then
10715
10716 CFLAGS=`echo "$CFLAGS" | \
10717         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
10718                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
10719
10720 CPPFLAGS=`echo "$CPPFLAGS" | \
10721         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
10722                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
10723
10724         cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source"
10725
10726 cf_fix_cppflags=no
10727 cf_new_cflags=
10728 cf_new_cppflags=
10729 cf_new_extra_cppflags=
10730
10731 for cf_add_cflags in $cf_temp_xopen_source
10732 do
10733 case $cf_fix_cppflags in
10734 (no)
10735         case $cf_add_cflags in
10736         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
10737                 case $cf_add_cflags in
10738                 (-D*)
10739                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
10740
10741                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10742                                 && test -z "${cf_tst_cflags}" \
10743                                 && cf_fix_cppflags=yes
10744
10745                         if test $cf_fix_cppflags = yes ; then
10746                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10747                                 continue
10748                         elif test "${cf_tst_cflags}" = "\"'" ; then
10749                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10750                                 continue
10751                         fi
10752                         ;;
10753                 esac
10754                 case "$CPPFLAGS" in
10755                 (*$cf_add_cflags)
10756                         ;;
10757                 (*)
10758                         case $cf_add_cflags in
10759                         (-D*)
10760                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
10761
10762 CPPFLAGS=`echo "$CPPFLAGS" | \
10763         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
10764                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
10765
10766                                 ;;
10767                         esac
10768                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
10769                         ;;
10770                 esac
10771                 ;;
10772         (*)
10773                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
10774                 ;;
10775         esac
10776         ;;
10777 (yes)
10778         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10779
10780         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
10781
10782         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10783                 && test -z "${cf_tst_cflags}" \
10784                 && cf_fix_cppflags=no
10785         ;;
10786 esac
10787 done
10788
10789 if test -n "$cf_new_cflags" ; then
10790
10791         CFLAGS="$CFLAGS $cf_new_cflags"
10792 fi
10793
10794 if test -n "$cf_new_cppflags" ; then
10795
10796         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
10797 fi
10798
10799 if test -n "$cf_new_extra_cppflags" ; then
10800
10801         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
10802 fi
10803
10804 fi
10805
10806         fi
10807 fi
10808
10809 # Check whether --enable-largefile or --disable-largefile was given.
10810 if test "${enable_largefile+set}" = set; then
10811   enableval="$enable_largefile"
10812
10813 fi;
10814 if test "$enable_largefile" != no; then
10815
10816   echo "$as_me:10816: checking for special C compiler options needed for large files" >&5
10817 echo $ECHO_N "checking for special C compiler options needed for large files... $ECHO_C" >&6
10818 if test "${ac_cv_sys_largefile_CC+set}" = set; then
10819   echo $ECHO_N "(cached) $ECHO_C" >&6
10820 else
10821   ac_cv_sys_largefile_CC=no
10822      if test "$GCC" != yes; then
10823        ac_save_CC=$CC
10824        while :; do
10825          # IRIX 6.2 and later do not support large files by default,
10826          # so use the C compiler's -n32 option if that helps.
10827          cat >conftest.$ac_ext <<_ACEOF
10828 #line 10828 "configure"
10829 #include "confdefs.h"
10830 #include <sys/types.h>
10831  /* Check that off_t can represent 2**63 - 1 correctly.
10832     We can't simply define LARGE_OFF_T to be 9223372036854775807,
10833     since some C++ compilers masquerading as C compilers
10834     incorrectly reject 9223372036854775807.  */
10835 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
10836   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
10837                        && LARGE_OFF_T % 2147483647 == 1)
10838                       ? 1 : -1];
10839 int
10840 main ()
10841 {
10842
10843   ;
10844   return 0;
10845 }
10846 _ACEOF
10847          rm -f conftest.$ac_objext
10848 if { (eval echo "$as_me:10848: \"$ac_compile\"") >&5
10849   (eval $ac_compile) 2>&5
10850   ac_status=$?
10851   echo "$as_me:10851: \$? = $ac_status" >&5
10852   (exit $ac_status); } &&
10853          { ac_try='test -s conftest.$ac_objext'
10854   { (eval echo "$as_me:10854: \"$ac_try\"") >&5
10855   (eval $ac_try) 2>&5
10856   ac_status=$?
10857   echo "$as_me:10857: \$? = $ac_status" >&5
10858   (exit $ac_status); }; }; then
10859   break
10860 else
10861   echo "$as_me: failed program was:" >&5
10862 cat conftest.$ac_ext >&5
10863 fi
10864 rm -f conftest.$ac_objext
10865          CC="$CC -n32"
10866          rm -f conftest.$ac_objext
10867 if { (eval echo "$as_me:10867: \"$ac_compile\"") >&5
10868   (eval $ac_compile) 2>&5
10869   ac_status=$?
10870   echo "$as_me:10870: \$? = $ac_status" >&5
10871   (exit $ac_status); } &&
10872          { ac_try='test -s conftest.$ac_objext'
10873   { (eval echo "$as_me:10873: \"$ac_try\"") >&5
10874   (eval $ac_try) 2>&5
10875   ac_status=$?
10876   echo "$as_me:10876: \$? = $ac_status" >&5
10877   (exit $ac_status); }; }; then
10878   ac_cv_sys_largefile_CC=' -n32'; break
10879 else
10880   echo "$as_me: failed program was:" >&5
10881 cat conftest.$ac_ext >&5
10882 fi
10883 rm -f conftest.$ac_objext
10884          break
10885        done
10886        CC=$ac_save_CC
10887        rm -f conftest.$ac_ext
10888     fi
10889 fi
10890 echo "$as_me:10890: result: $ac_cv_sys_largefile_CC" >&5
10891 echo "${ECHO_T}$ac_cv_sys_largefile_CC" >&6
10892   if test "$ac_cv_sys_largefile_CC" != no; then
10893     CC=$CC$ac_cv_sys_largefile_CC
10894   fi
10895
10896   echo "$as_me:10896: checking for _FILE_OFFSET_BITS value needed for large files" >&5
10897 echo $ECHO_N "checking for _FILE_OFFSET_BITS value needed for large files... $ECHO_C" >&6
10898 if test "${ac_cv_sys_file_offset_bits+set}" = set; then
10899   echo $ECHO_N "(cached) $ECHO_C" >&6
10900 else
10901   while :; do
10902   ac_cv_sys_file_offset_bits=no
10903   cat >conftest.$ac_ext <<_ACEOF
10904 #line 10904 "configure"
10905 #include "confdefs.h"
10906 #include <sys/types.h>
10907  /* Check that off_t can represent 2**63 - 1 correctly.
10908     We can't simply define LARGE_OFF_T to be 9223372036854775807,
10909     since some C++ compilers masquerading as C compilers
10910     incorrectly reject 9223372036854775807.  */
10911 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
10912   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
10913                        && LARGE_OFF_T % 2147483647 == 1)
10914                       ? 1 : -1];
10915 int
10916 main ()
10917 {
10918
10919   ;
10920   return 0;
10921 }
10922 _ACEOF
10923 rm -f conftest.$ac_objext
10924 if { (eval echo "$as_me:10924: \"$ac_compile\"") >&5
10925   (eval $ac_compile) 2>&5
10926   ac_status=$?
10927   echo "$as_me:10927: \$? = $ac_status" >&5
10928   (exit $ac_status); } &&
10929          { ac_try='test -s conftest.$ac_objext'
10930   { (eval echo "$as_me:10930: \"$ac_try\"") >&5
10931   (eval $ac_try) 2>&5
10932   ac_status=$?
10933   echo "$as_me:10933: \$? = $ac_status" >&5
10934   (exit $ac_status); }; }; then
10935   break
10936 else
10937   echo "$as_me: failed program was:" >&5
10938 cat conftest.$ac_ext >&5
10939 fi
10940 rm -f conftest.$ac_objext conftest.$ac_ext
10941   cat >conftest.$ac_ext <<_ACEOF
10942 #line 10942 "configure"
10943 #include "confdefs.h"
10944 #define _FILE_OFFSET_BITS 64
10945 #include <sys/types.h>
10946  /* Check that off_t can represent 2**63 - 1 correctly.
10947     We can't simply define LARGE_OFF_T to be 9223372036854775807,
10948     since some C++ compilers masquerading as C compilers
10949     incorrectly reject 9223372036854775807.  */
10950 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
10951   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
10952                        && LARGE_OFF_T % 2147483647 == 1)
10953                       ? 1 : -1];
10954 int
10955 main ()
10956 {
10957
10958   ;
10959   return 0;
10960 }
10961 _ACEOF
10962 rm -f conftest.$ac_objext
10963 if { (eval echo "$as_me:10963: \"$ac_compile\"") >&5
10964   (eval $ac_compile) 2>&5
10965   ac_status=$?
10966   echo "$as_me:10966: \$? = $ac_status" >&5
10967   (exit $ac_status); } &&
10968          { ac_try='test -s conftest.$ac_objext'
10969   { (eval echo "$as_me:10969: \"$ac_try\"") >&5
10970   (eval $ac_try) 2>&5
10971   ac_status=$?
10972   echo "$as_me:10972: \$? = $ac_status" >&5
10973   (exit $ac_status); }; }; then
10974   ac_cv_sys_file_offset_bits=64; break
10975 else
10976   echo "$as_me: failed program was:" >&5
10977 cat conftest.$ac_ext >&5
10978 fi
10979 rm -f conftest.$ac_objext conftest.$ac_ext
10980   break
10981 done
10982 fi
10983 echo "$as_me:10983: result: $ac_cv_sys_file_offset_bits" >&5
10984 echo "${ECHO_T}$ac_cv_sys_file_offset_bits" >&6
10985 if test "$ac_cv_sys_file_offset_bits" != no; then
10986
10987 cat >>confdefs.h <<EOF
10988 #define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits
10989 EOF
10990
10991 fi
10992 rm -rf conftest*
10993   echo "$as_me:10993: checking for _LARGE_FILES value needed for large files" >&5
10994 echo $ECHO_N "checking for _LARGE_FILES value needed for large files... $ECHO_C" >&6
10995 if test "${ac_cv_sys_large_files+set}" = set; then
10996   echo $ECHO_N "(cached) $ECHO_C" >&6
10997 else
10998   while :; do
10999   ac_cv_sys_large_files=no
11000   cat >conftest.$ac_ext <<_ACEOF
11001 #line 11001 "configure"
11002 #include "confdefs.h"
11003 #include <sys/types.h>
11004  /* Check that off_t can represent 2**63 - 1 correctly.
11005     We can't simply define LARGE_OFF_T to be 9223372036854775807,
11006     since some C++ compilers masquerading as C compilers
11007     incorrectly reject 9223372036854775807.  */
11008 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
11009   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
11010                        && LARGE_OFF_T % 2147483647 == 1)
11011                       ? 1 : -1];
11012 int
11013 main ()
11014 {
11015
11016   ;
11017   return 0;
11018 }
11019 _ACEOF
11020 rm -f conftest.$ac_objext
11021 if { (eval echo "$as_me:11021: \"$ac_compile\"") >&5
11022   (eval $ac_compile) 2>&5
11023   ac_status=$?
11024   echo "$as_me:11024: \$? = $ac_status" >&5
11025   (exit $ac_status); } &&
11026          { ac_try='test -s conftest.$ac_objext'
11027   { (eval echo "$as_me:11027: \"$ac_try\"") >&5
11028   (eval $ac_try) 2>&5
11029   ac_status=$?
11030   echo "$as_me:11030: \$? = $ac_status" >&5
11031   (exit $ac_status); }; }; then
11032   break
11033 else
11034   echo "$as_me: failed program was:" >&5
11035 cat conftest.$ac_ext >&5
11036 fi
11037 rm -f conftest.$ac_objext conftest.$ac_ext
11038   cat >conftest.$ac_ext <<_ACEOF
11039 #line 11039 "configure"
11040 #include "confdefs.h"
11041 #define _LARGE_FILES 1
11042 #include <sys/types.h>
11043  /* Check that off_t can represent 2**63 - 1 correctly.
11044     We can't simply define LARGE_OFF_T to be 9223372036854775807,
11045     since some C++ compilers masquerading as C compilers
11046     incorrectly reject 9223372036854775807.  */
11047 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
11048   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
11049                        && LARGE_OFF_T % 2147483647 == 1)
11050                       ? 1 : -1];
11051 int
11052 main ()
11053 {
11054
11055   ;
11056   return 0;
11057 }
11058 _ACEOF
11059 rm -f conftest.$ac_objext
11060 if { (eval echo "$as_me:11060: \"$ac_compile\"") >&5
11061   (eval $ac_compile) 2>&5
11062   ac_status=$?
11063   echo "$as_me:11063: \$? = $ac_status" >&5
11064   (exit $ac_status); } &&
11065          { ac_try='test -s conftest.$ac_objext'
11066   { (eval echo "$as_me:11066: \"$ac_try\"") >&5
11067   (eval $ac_try) 2>&5
11068   ac_status=$?
11069   echo "$as_me:11069: \$? = $ac_status" >&5
11070   (exit $ac_status); }; }; then
11071   ac_cv_sys_large_files=1; break
11072 else
11073   echo "$as_me: failed program was:" >&5
11074 cat conftest.$ac_ext >&5
11075 fi
11076 rm -f conftest.$ac_objext conftest.$ac_ext
11077   break
11078 done
11079 fi
11080 echo "$as_me:11080: result: $ac_cv_sys_large_files" >&5
11081 echo "${ECHO_T}$ac_cv_sys_large_files" >&6
11082 if test "$ac_cv_sys_large_files" != no; then
11083
11084 cat >>confdefs.h <<EOF
11085 #define _LARGE_FILES $ac_cv_sys_large_files
11086 EOF
11087
11088 fi
11089 rm -rf conftest*
11090 fi
11091
11092         if test "$enable_largefile" != no ; then
11093         echo "$as_me:11093: checking for _LARGEFILE_SOURCE value needed for large files" >&5
11094 echo $ECHO_N "checking for _LARGEFILE_SOURCE value needed for large files... $ECHO_C" >&6
11095 if test "${ac_cv_sys_largefile_source+set}" = set; then
11096   echo $ECHO_N "(cached) $ECHO_C" >&6
11097 else
11098   while :; do
11099   ac_cv_sys_largefile_source=no
11100   cat >conftest.$ac_ext <<_ACEOF
11101 #line 11101 "configure"
11102 #include "confdefs.h"
11103 #include <stdio.h>
11104 int
11105 main ()
11106 {
11107 return !fseeko;
11108   ;
11109   return 0;
11110 }
11111 _ACEOF
11112 rm -f conftest.$ac_objext
11113 if { (eval echo "$as_me:11113: \"$ac_compile\"") >&5
11114   (eval $ac_compile) 2>&5
11115   ac_status=$?
11116   echo "$as_me:11116: \$? = $ac_status" >&5
11117   (exit $ac_status); } &&
11118          { ac_try='test -s conftest.$ac_objext'
11119   { (eval echo "$as_me:11119: \"$ac_try\"") >&5
11120   (eval $ac_try) 2>&5
11121   ac_status=$?
11122   echo "$as_me:11122: \$? = $ac_status" >&5
11123   (exit $ac_status); }; }; then
11124   break
11125 else
11126   echo "$as_me: failed program was:" >&5
11127 cat conftest.$ac_ext >&5
11128 fi
11129 rm -f conftest.$ac_objext conftest.$ac_ext
11130   cat >conftest.$ac_ext <<_ACEOF
11131 #line 11131 "configure"
11132 #include "confdefs.h"
11133 #define _LARGEFILE_SOURCE 1
11134 #include <stdio.h>
11135 int
11136 main ()
11137 {
11138 return !fseeko;
11139   ;
11140   return 0;
11141 }
11142 _ACEOF
11143 rm -f conftest.$ac_objext
11144 if { (eval echo "$as_me:11144: \"$ac_compile\"") >&5
11145   (eval $ac_compile) 2>&5
11146   ac_status=$?
11147   echo "$as_me:11147: \$? = $ac_status" >&5
11148   (exit $ac_status); } &&
11149          { ac_try='test -s conftest.$ac_objext'
11150   { (eval echo "$as_me:11150: \"$ac_try\"") >&5
11151   (eval $ac_try) 2>&5
11152   ac_status=$?
11153   echo "$as_me:11153: \$? = $ac_status" >&5
11154   (exit $ac_status); }; }; then
11155   ac_cv_sys_largefile_source=1; break
11156 else
11157   echo "$as_me: failed program was:" >&5
11158 cat conftest.$ac_ext >&5
11159 fi
11160 rm -f conftest.$ac_objext conftest.$ac_ext
11161   break
11162 done
11163 fi
11164 echo "$as_me:11164: result: $ac_cv_sys_largefile_source" >&5
11165 echo "${ECHO_T}$ac_cv_sys_largefile_source" >&6
11166 if test "$ac_cv_sys_largefile_source" != no; then
11167
11168 cat >>confdefs.h <<EOF
11169 #define _LARGEFILE_SOURCE $ac_cv_sys_largefile_source
11170 EOF
11171
11172 fi
11173 rm -rf conftest*
11174
11175 # We used to try defining _XOPEN_SOURCE=500 too, to work around a bug
11176 # in glibc 2.1.3, but that breaks too many other things.
11177 # If you want fseeko and ftello with glibc, upgrade to a fixed glibc.
11178 echo "$as_me:11178: checking for fseeko" >&5
11179 echo $ECHO_N "checking for fseeko... $ECHO_C" >&6
11180 if test "${ac_cv_func_fseeko+set}" = set; then
11181   echo $ECHO_N "(cached) $ECHO_C" >&6
11182 else
11183   cat >conftest.$ac_ext <<_ACEOF
11184 #line 11184 "configure"
11185 #include "confdefs.h"
11186 #include <stdio.h>
11187 int
11188 main ()
11189 {
11190 return fseeko && fseeko (stdin, 0, 0);
11191   ;
11192   return 0;
11193 }
11194 _ACEOF
11195 rm -f conftest.$ac_objext conftest$ac_exeext
11196 if { (eval echo "$as_me:11196: \"$ac_link\"") >&5
11197   (eval $ac_link) 2>&5
11198   ac_status=$?
11199   echo "$as_me:11199: \$? = $ac_status" >&5
11200   (exit $ac_status); } &&
11201          { ac_try='test -s conftest$ac_exeext'
11202   { (eval echo "$as_me:11202: \"$ac_try\"") >&5
11203   (eval $ac_try) 2>&5
11204   ac_status=$?
11205   echo "$as_me:11205: \$? = $ac_status" >&5
11206   (exit $ac_status); }; }; then
11207   ac_cv_func_fseeko=yes
11208 else
11209   echo "$as_me: failed program was:" >&5
11210 cat conftest.$ac_ext >&5
11211 ac_cv_func_fseeko=no
11212 fi
11213 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11214 fi
11215 echo "$as_me:11215: result: $ac_cv_func_fseeko" >&5
11216 echo "${ECHO_T}$ac_cv_func_fseeko" >&6
11217 if test $ac_cv_func_fseeko = yes; then
11218
11219 cat >>confdefs.h <<\EOF
11220 #define HAVE_FSEEKO 1
11221 EOF
11222
11223 fi
11224
11225         # Normally we would collect these definitions in the config.h,
11226         # but (like _XOPEN_SOURCE), some environments rely on having these
11227         # defined before any of the system headers are included.  Another
11228         # case comes up with C++, e.g., on AIX the compiler compiles the
11229         # header files by themselves before looking at the body files it is
11230         # told to compile.  For ncurses, those header files do not include
11231         # the config.h
11232         test "$ac_cv_sys_large_files"      != no && CPPFLAGS="$CPPFLAGS -D_LARGE_FILES "
11233         test "$ac_cv_sys_largefile_source" != no && CPPFLAGS="$CPPFLAGS -D_LARGEFILE_SOURCE "
11234         test "$ac_cv_sys_file_offset_bits" != no && CPPFLAGS="$CPPFLAGS -D_FILE_OFFSET_BITS=$ac_cv_sys_file_offset_bits "
11235
11236         echo "$as_me:11236: checking whether to use struct dirent64" >&5
11237 echo $ECHO_N "checking whether to use struct dirent64... $ECHO_C" >&6
11238 if test "${cf_cv_struct_dirent64+set}" = set; then
11239   echo $ECHO_N "(cached) $ECHO_C" >&6
11240 else
11241
11242                 cat >conftest.$ac_ext <<_ACEOF
11243 #line 11243 "configure"
11244 #include "confdefs.h"
11245
11246 #include <sys/types.h>
11247 #include <dirent.h>
11248
11249 int
11250 main ()
11251 {
11252
11253                 /* if transitional largefile support is setup, this is true */
11254                 extern struct dirent64 * readdir(DIR *);
11255                 struct dirent64 *x = readdir((DIR *)0);
11256                 struct dirent *y = readdir((DIR *)0);
11257                 int z = x - y;
11258
11259   ;
11260   return 0;
11261 }
11262 _ACEOF
11263 rm -f conftest.$ac_objext
11264 if { (eval echo "$as_me:11264: \"$ac_compile\"") >&5
11265   (eval $ac_compile) 2>&5
11266   ac_status=$?
11267   echo "$as_me:11267: \$? = $ac_status" >&5
11268   (exit $ac_status); } &&
11269          { ac_try='test -s conftest.$ac_objext'
11270   { (eval echo "$as_me:11270: \"$ac_try\"") >&5
11271   (eval $ac_try) 2>&5
11272   ac_status=$?
11273   echo "$as_me:11273: \$? = $ac_status" >&5
11274   (exit $ac_status); }; }; then
11275   cf_cv_struct_dirent64=yes
11276 else
11277   echo "$as_me: failed program was:" >&5
11278 cat conftest.$ac_ext >&5
11279 cf_cv_struct_dirent64=no
11280 fi
11281 rm -f conftest.$ac_objext conftest.$ac_ext
11282
11283 fi
11284 echo "$as_me:11284: result: $cf_cv_struct_dirent64" >&5
11285 echo "${ECHO_T}$cf_cv_struct_dirent64" >&6
11286         test "$cf_cv_struct_dirent64" = yes &&
11287 cat >>confdefs.h <<\EOF
11288 #define HAVE_STRUCT_DIRENT64 1
11289 EOF
11290
11291         fi
11292
11293 ### Enable compiling-in rcs id's
11294 echo "$as_me:11294: checking if RCS identifiers should be compiled-in" >&5
11295 echo $ECHO_N "checking if RCS identifiers should be compiled-in... $ECHO_C" >&6
11296
11297 # Check whether --with-rcs-ids or --without-rcs-ids was given.
11298 if test "${with_rcs_ids+set}" = set; then
11299   withval="$with_rcs_ids"
11300   with_rcs_ids=$withval
11301 else
11302   with_rcs_ids=no
11303 fi;
11304 echo "$as_me:11304: result: $with_rcs_ids" >&5
11305 echo "${ECHO_T}$with_rcs_ids" >&6
11306 test "$with_rcs_ids" = yes &&
11307 cat >>confdefs.h <<\EOF
11308 #define USE_RCS_IDS 1
11309 EOF
11310
11311 ###############################################################################
11312
11313 ### Note that some functions (such as const) are normally disabled anyway.
11314 echo "$as_me:11314: checking if you want to build with function extensions" >&5
11315 echo $ECHO_N "checking if you want to build with function extensions... $ECHO_C" >&6
11316
11317 # Check whether --enable-ext-funcs or --disable-ext-funcs was given.
11318 if test "${enable_ext_funcs+set}" = set; then
11319   enableval="$enable_ext_funcs"
11320   with_ext_funcs=$enableval
11321 else
11322   with_ext_funcs=yes
11323 fi;
11324 echo "$as_me:11324: result: $with_ext_funcs" >&5
11325 echo "${ECHO_T}$with_ext_funcs" >&6
11326 if test "$with_ext_funcs" = yes ; then
11327         NCURSES_EXT_FUNCS=1
11328
11329 cat >>confdefs.h <<\EOF
11330 #define HAVE_USE_DEFAULT_COLORS 1
11331 EOF
11332
11333 cat >>confdefs.h <<\EOF
11334 #define NCURSES_EXT_FUNCS 1
11335 EOF
11336
11337 else
11338         NCURSES_EXT_FUNCS=0
11339 fi
11340
11341 ###   use option --enable-const to turn on use of const beyond that in XSI.
11342 echo "$as_me:11342: checking for extended use of const keyword" >&5
11343 echo $ECHO_N "checking for extended use of const keyword... $ECHO_C" >&6
11344
11345 # Check whether --enable-const or --disable-const was given.
11346 if test "${enable_const+set}" = set; then
11347   enableval="$enable_const"
11348   with_ext_const=$enableval
11349 else
11350   with_ext_const=no
11351 fi;
11352 echo "$as_me:11352: result: $with_ext_const" >&5
11353 echo "${ECHO_T}$with_ext_const" >&6
11354 NCURSES_CONST='/*nothing*/'
11355 if test "$with_ext_const" = yes ; then
11356         NCURSES_CONST=const
11357 fi
11358
11359 ###############################################################################
11360 # These options are relatively safe to experiment with.
11361
11362 echo "$as_me:11362: checking if you want all development code" >&5
11363 echo $ECHO_N "checking if you want all development code... $ECHO_C" >&6
11364
11365 # Check whether --with-develop or --without-develop was given.
11366 if test "${with_develop+set}" = set; then
11367   withval="$with_develop"
11368   with_develop=$withval
11369 else
11370   with_develop=no
11371 fi;
11372 echo "$as_me:11372: result: $with_develop" >&5
11373 echo "${ECHO_T}$with_develop" >&6
11374
11375 ###############################################################################
11376 # These are just experimental, probably should not be in a package:
11377
11378 # This is still experimental (20080329), but should ultimately be moved to
11379 # the script-block --with-normal, etc.
11380
11381 echo "$as_me:11381: checking if you want to link with the pthread library" >&5
11382 echo $ECHO_N "checking if you want to link with the pthread library... $ECHO_C" >&6
11383
11384 # Check whether --with-pthread or --without-pthread was given.
11385 if test "${with_pthread+set}" = set; then
11386   withval="$with_pthread"
11387   with_pthread=$withval
11388 else
11389   with_pthread=no
11390 fi;
11391 echo "$as_me:11391: result: $with_pthread" >&5
11392 echo "${ECHO_T}$with_pthread" >&6
11393
11394 if test "$with_pthread" != no ; then
11395         echo "$as_me:11395: checking for pthread.h" >&5
11396 echo $ECHO_N "checking for pthread.h... $ECHO_C" >&6
11397 if test "${ac_cv_header_pthread_h+set}" = set; then
11398   echo $ECHO_N "(cached) $ECHO_C" >&6
11399 else
11400   cat >conftest.$ac_ext <<_ACEOF
11401 #line 11401 "configure"
11402 #include "confdefs.h"
11403 #include <pthread.h>
11404 _ACEOF
11405 if { (eval echo "$as_me:11405: \"$ac_cpp conftest.$ac_ext\"") >&5
11406   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
11407   ac_status=$?
11408   egrep -v '^ *\+' conftest.er1 >conftest.err
11409   rm -f conftest.er1
11410   cat conftest.err >&5
11411   echo "$as_me:11411: \$? = $ac_status" >&5
11412   (exit $ac_status); } >/dev/null; then
11413   if test -s conftest.err; then
11414     ac_cpp_err=$ac_c_preproc_warn_flag
11415   else
11416     ac_cpp_err=
11417   fi
11418 else
11419   ac_cpp_err=yes
11420 fi
11421 if test -z "$ac_cpp_err"; then
11422   ac_cv_header_pthread_h=yes
11423 else
11424   echo "$as_me: failed program was:" >&5
11425   cat conftest.$ac_ext >&5
11426   ac_cv_header_pthread_h=no
11427 fi
11428 rm -f conftest.err conftest.$ac_ext
11429 fi
11430 echo "$as_me:11430: result: $ac_cv_header_pthread_h" >&5
11431 echo "${ECHO_T}$ac_cv_header_pthread_h" >&6
11432 if test $ac_cv_header_pthread_h = yes; then
11433
11434 cat >>confdefs.h <<\EOF
11435 #define HAVE_PTHREADS_H 1
11436 EOF
11437
11438         for cf_lib_pthread in pthread c_r
11439         do
11440             echo "$as_me:11440: checking if we can link with the $cf_lib_pthread library" >&5
11441 echo $ECHO_N "checking if we can link with the $cf_lib_pthread library... $ECHO_C" >&6
11442             cf_save_LIBS="$LIBS"
11443
11444 cf_add_libs="-l$cf_lib_pthread"
11445 # Filter out duplicates - this happens with badly-designed ".pc" files...
11446 for cf_add_1lib in $LIBS
11447 do
11448         for cf_add_2lib in $cf_add_libs
11449         do
11450                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
11451                 then
11452                         cf_add_1lib=
11453                         break
11454                 fi
11455         done
11456         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
11457 done
11458 LIBS="$cf_add_libs"
11459
11460             cat >conftest.$ac_ext <<_ACEOF
11461 #line 11461 "configure"
11462 #include "confdefs.h"
11463
11464 #include <pthread.h>
11465
11466 int
11467 main ()
11468 {
11469
11470                 int rc = pthread_create(0,0,0,0);
11471                 int r2 = pthread_mutexattr_settype(0, 0);
11472
11473   ;
11474   return 0;
11475 }
11476 _ACEOF
11477 rm -f conftest.$ac_objext conftest$ac_exeext
11478 if { (eval echo "$as_me:11478: \"$ac_link\"") >&5
11479   (eval $ac_link) 2>&5
11480   ac_status=$?
11481   echo "$as_me:11481: \$? = $ac_status" >&5
11482   (exit $ac_status); } &&
11483          { ac_try='test -s conftest$ac_exeext'
11484   { (eval echo "$as_me:11484: \"$ac_try\"") >&5
11485   (eval $ac_try) 2>&5
11486   ac_status=$?
11487   echo "$as_me:11487: \$? = $ac_status" >&5
11488   (exit $ac_status); }; }; then
11489   with_pthread=yes
11490 else
11491   echo "$as_me: failed program was:" >&5
11492 cat conftest.$ac_ext >&5
11493 with_pthread=no
11494 fi
11495 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11496             LIBS="$cf_save_LIBS"
11497             echo "$as_me:11497: result: $with_pthread" >&5
11498 echo "${ECHO_T}$with_pthread" >&6
11499             test "$with_pthread" = yes && break
11500         done
11501
11502         if test "$with_pthread" = yes ; then
11503
11504 cf_add_libs="-l$cf_lib_pthread"
11505 # Filter out duplicates - this happens with badly-designed ".pc" files...
11506 for cf_add_1lib in $LIBS
11507 do
11508         for cf_add_2lib in $cf_add_libs
11509         do
11510                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
11511                 then
11512                         cf_add_1lib=
11513                         break
11514                 fi
11515         done
11516         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
11517 done
11518 LIBS="$cf_add_libs"
11519
11520 cat >>confdefs.h <<\EOF
11521 #define HAVE_LIBPTHREADS 1
11522 EOF
11523
11524         else
11525             { { echo "$as_me:11525: error: Cannot link with pthread library" >&5
11526 echo "$as_me: error: Cannot link with pthread library" >&2;}
11527    { (exit 1); exit 1; }; }
11528         fi
11529
11530 fi
11531
11532 fi
11533
11534 echo "$as_me:11534: checking if you want to use weak-symbols for pthreads" >&5
11535 echo $ECHO_N "checking if you want to use weak-symbols for pthreads... $ECHO_C" >&6
11536
11537 # Check whether --enable-weak-symbols or --disable-weak-symbols was given.
11538 if test "${enable_weak_symbols+set}" = set; then
11539   enableval="$enable_weak_symbols"
11540   use_weak_symbols=$withval
11541 else
11542   use_weak_symbols=no
11543 fi;
11544 echo "$as_me:11544: result: $use_weak_symbols" >&5
11545 echo "${ECHO_T}$use_weak_symbols" >&6
11546 if test "$use_weak_symbols" = yes ; then
11547
11548 echo "$as_me:11548: checking if $CC supports weak symbols" >&5
11549 echo $ECHO_N "checking if $CC supports weak symbols... $ECHO_C" >&6
11550 if test "${cf_cv_weak_symbols+set}" = set; then
11551   echo $ECHO_N "(cached) $ECHO_C" >&6
11552 else
11553
11554 cat >conftest.$ac_ext <<_ACEOF
11555 #line 11555 "configure"
11556 #include "confdefs.h"
11557
11558 #include <stdio.h>
11559 int
11560 main ()
11561 {
11562
11563 #if defined(__GNUC__)
11564 #  if defined __USE_ISOC99
11565 #    define _cat_pragma(exp)    _Pragma(#exp)
11566 #    define _weak_pragma(exp)   _cat_pragma(weak name)
11567 #  else
11568 #    define _weak_pragma(exp)
11569 #  endif
11570 #  define _declare(name)        __extension__ extern __typeof__(name) name
11571 #  define weak_symbol(name)     _weak_pragma(name) _declare(name) __attribute__((weak))
11572 #endif
11573
11574 weak_symbol(fopen);
11575
11576   ;
11577   return 0;
11578 }
11579 _ACEOF
11580 rm -f conftest.$ac_objext
11581 if { (eval echo "$as_me:11581: \"$ac_compile\"") >&5
11582   (eval $ac_compile) 2>&5
11583   ac_status=$?
11584   echo "$as_me:11584: \$? = $ac_status" >&5
11585   (exit $ac_status); } &&
11586          { ac_try='test -s conftest.$ac_objext'
11587   { (eval echo "$as_me:11587: \"$ac_try\"") >&5
11588   (eval $ac_try) 2>&5
11589   ac_status=$?
11590   echo "$as_me:11590: \$? = $ac_status" >&5
11591   (exit $ac_status); }; }; then
11592   cf_cv_weak_symbols=yes
11593 else
11594   echo "$as_me: failed program was:" >&5
11595 cat conftest.$ac_ext >&5
11596 cf_cv_weak_symbols=no
11597 fi
11598 rm -f conftest.$ac_objext conftest.$ac_ext
11599
11600 fi
11601 echo "$as_me:11601: result: $cf_cv_weak_symbols" >&5
11602 echo "${ECHO_T}$cf_cv_weak_symbols" >&6
11603
11604 else
11605         cf_cv_weak_symbols=no
11606 fi
11607
11608 if test $cf_cv_weak_symbols = yes ; then
11609
11610 cat >>confdefs.h <<\EOF
11611 #define USE_WEAK_SYMBOLS 1
11612 EOF
11613
11614 fi
11615
11616 PTHREAD=
11617 if test "$with_pthread" = "yes" ; then
11618
11619 cat >>confdefs.h <<\EOF
11620 #define USE_PTHREADS 1
11621 EOF
11622
11623         enable_reentrant=yes
11624         if test $cf_cv_weak_symbols = yes ; then
11625                 PTHREAD=-lpthread
11626         fi
11627 fi
11628
11629 # OpenSUSE is installing ncurses6, using reentrant option.
11630 echo "$as_me:11630: checking for _nc_TABSIZE" >&5
11631 echo $ECHO_N "checking for _nc_TABSIZE... $ECHO_C" >&6
11632 if test "${ac_cv_func__nc_TABSIZE+set}" = set; then
11633   echo $ECHO_N "(cached) $ECHO_C" >&6
11634 else
11635   cat >conftest.$ac_ext <<_ACEOF
11636 #line 11636 "configure"
11637 #include "confdefs.h"
11638 /* System header to define __stub macros and hopefully few prototypes,
11639     which can conflict with char _nc_TABSIZE (); below.  */
11640 #include <assert.h>
11641 /* Override any gcc2 internal prototype to avoid an error.  */
11642 #ifdef __cplusplus
11643 extern "C"
11644 #endif
11645 /* We use char because int might match the return type of a gcc2
11646    builtin and then its argument prototype would still apply.  */
11647 char _nc_TABSIZE ();
11648 char (*f) ();
11649
11650 int
11651 main ()
11652 {
11653 /* The GNU C library defines this for functions which it implements
11654     to always fail with ENOSYS.  Some functions are actually named
11655     something starting with __ and the normal name is an alias.  */
11656 #if defined (__stub__nc_TABSIZE) || defined (__stub____nc_TABSIZE)
11657 choke me
11658 #else
11659 f = _nc_TABSIZE; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
11660 #endif
11661
11662   ;
11663   return 0;
11664 }
11665 _ACEOF
11666 rm -f conftest.$ac_objext conftest$ac_exeext
11667 if { (eval echo "$as_me:11667: \"$ac_link\"") >&5
11668   (eval $ac_link) 2>&5
11669   ac_status=$?
11670   echo "$as_me:11670: \$? = $ac_status" >&5
11671   (exit $ac_status); } &&
11672          { ac_try='test -s conftest$ac_exeext'
11673   { (eval echo "$as_me:11673: \"$ac_try\"") >&5
11674   (eval $ac_try) 2>&5
11675   ac_status=$?
11676   echo "$as_me:11676: \$? = $ac_status" >&5
11677   (exit $ac_status); }; }; then
11678   ac_cv_func__nc_TABSIZE=yes
11679 else
11680   echo "$as_me: failed program was:" >&5
11681 cat conftest.$ac_ext >&5
11682 ac_cv_func__nc_TABSIZE=no
11683 fi
11684 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11685 fi
11686 echo "$as_me:11686: result: $ac_cv_func__nc_TABSIZE" >&5
11687 echo "${ECHO_T}$ac_cv_func__nc_TABSIZE" >&6
11688 if test $ac_cv_func__nc_TABSIZE = yes; then
11689   assume_reentrant=yes
11690 else
11691   assume_reentrant=no
11692 fi
11693
11694 # Reentrant code has to be opaque; there's little advantage to making ncurses
11695 # opaque outside of that, so there is no --enable-opaque option.  We can use
11696 # this option without --with-pthreads, but this will be always set for
11697 # pthreads.
11698 echo "$as_me:11698: checking if you want experimental reentrant code" >&5
11699 echo $ECHO_N "checking if you want experimental reentrant code... $ECHO_C" >&6
11700
11701 # Check whether --enable-reentrant or --disable-reentrant was given.
11702 if test "${enable_reentrant+set}" = set; then
11703   enableval="$enable_reentrant"
11704   with_reentrant=$enableval
11705 else
11706   with_reentrant=$assume_reentrant
11707 fi;
11708 echo "$as_me:11708: result: $with_reentrant" >&5
11709 echo "${ECHO_T}$with_reentrant" >&6
11710 if test "$with_reentrant" = yes ; then
11711         cf_cv_enable_reentrant=1
11712         if test $cf_cv_weak_symbols = yes ; then
11713
11714 # remove pthread library from $LIBS
11715 LIBS=`echo "$LIBS" | sed -e 's/-lpthread[       ]//g' -e 's/-lpthread$//'`
11716
11717         elif test "$assume_reentrant" = no ; then
11718                 LIB_SUFFIX="t${LIB_SUFFIX}"
11719         fi
11720
11721 cat >>confdefs.h <<\EOF
11722 #define USE_REENTRANT 1
11723 EOF
11724
11725 else
11726         cf_cv_enable_reentrant=0
11727 fi
11728
11729 ### Allow using a different wrap-prefix
11730 if test "$cf_cv_enable_reentrant" != 0 || test "$BROKEN_LINKER" = 1 ; then
11731         echo "$as_me:11731: checking for prefix used to wrap public variables" >&5
11732 echo $ECHO_N "checking for prefix used to wrap public variables... $ECHO_C" >&6
11733
11734 # Check whether --with-wrap-prefix or --without-wrap-prefix was given.
11735 if test "${with_wrap_prefix+set}" = set; then
11736   withval="$with_wrap_prefix"
11737   NCURSES_WRAP_PREFIX=$withval
11738 else
11739   NCURSES_WRAP_PREFIX=_nc_
11740 fi;
11741         echo "$as_me:11741: result: $NCURSES_WRAP_PREFIX" >&5
11742 echo "${ECHO_T}$NCURSES_WRAP_PREFIX" >&6
11743 else
11744         NCURSES_WRAP_PREFIX=_nc_
11745 fi
11746
11747 cat >>confdefs.h <<EOF
11748 #define NCURSES_WRAP_PREFIX "$NCURSES_WRAP_PREFIX"
11749 EOF
11750
11751 ###############################################################################
11752
11753 ###     use option --disable-echo to suppress full display compiling commands
11754
11755 echo "$as_me:11755: checking if you want to see long compiling messages" >&5
11756 echo $ECHO_N "checking if you want to see long compiling messages... $ECHO_C" >&6
11757
11758 # Check whether --enable-echo or --disable-echo was given.
11759 if test "${enable_echo+set}" = set; then
11760   enableval="$enable_echo"
11761   test "$enableval" != no && enableval=yes
11762         if test "$enableval" != "yes" ; then
11763
11764         ECHO_LT='--silent'
11765         ECHO_LD='@echo linking $@;'
11766         RULE_CC='@echo compiling $<'
11767         SHOW_CC='@echo compiling $@'
11768         ECHO_CC='@'
11769
11770         else
11771
11772         ECHO_LT=''
11773         ECHO_LD=''
11774         RULE_CC=''
11775         SHOW_CC=''
11776         ECHO_CC=''
11777
11778         fi
11779 else
11780   enableval=yes
11781
11782         ECHO_LT=''
11783         ECHO_LD=''
11784         RULE_CC=''
11785         SHOW_CC=''
11786         ECHO_CC=''
11787
11788 fi;
11789 echo "$as_me:11789: result: $enableval" >&5
11790 echo "${ECHO_T}$enableval" >&6
11791
11792 ###     use option --enable-warnings to turn on all gcc warnings
11793 echo "$as_me:11793: checking if you want to see compiler warnings" >&5
11794 echo $ECHO_N "checking if you want to see compiler warnings... $ECHO_C" >&6
11795
11796 # Check whether --enable-warnings or --disable-warnings was given.
11797 if test "${enable_warnings+set}" = set; then
11798   enableval="$enable_warnings"
11799   with_warnings=$enableval
11800 fi;
11801 echo "$as_me:11801: result: $with_warnings" >&5
11802 echo "${ECHO_T}$with_warnings" >&6
11803
11804 if test "x$with_warnings" = "xyes"; then
11805
11806         ADAFLAGS="$ADAFLAGS -gnatg"
11807
11808 INTEL_COMPILER=no
11809
11810 if test "$GCC" = yes ; then
11811         case $host_os in
11812         (linux*|gnu*)
11813                 echo "$as_me:11813: checking if this is really Intel C compiler" >&5
11814 echo $ECHO_N "checking if this is really Intel C compiler... $ECHO_C" >&6
11815                 cf_save_CFLAGS="$CFLAGS"
11816                 CFLAGS="$CFLAGS -no-gcc"
11817                 cat >conftest.$ac_ext <<_ACEOF
11818 #line 11818 "configure"
11819 #include "confdefs.h"
11820
11821 int
11822 main ()
11823 {
11824
11825 #ifdef __INTEL_COMPILER
11826 #else
11827 make an error
11828 #endif
11829
11830   ;
11831   return 0;
11832 }
11833 _ACEOF
11834 rm -f conftest.$ac_objext
11835 if { (eval echo "$as_me:11835: \"$ac_compile\"") >&5
11836   (eval $ac_compile) 2>&5
11837   ac_status=$?
11838   echo "$as_me:11838: \$? = $ac_status" >&5
11839   (exit $ac_status); } &&
11840          { ac_try='test -s conftest.$ac_objext'
11841   { (eval echo "$as_me:11841: \"$ac_try\"") >&5
11842   (eval $ac_try) 2>&5
11843   ac_status=$?
11844   echo "$as_me:11844: \$? = $ac_status" >&5
11845   (exit $ac_status); }; }; then
11846   INTEL_COMPILER=yes
11847 cf_save_CFLAGS="$cf_save_CFLAGS -we147"
11848
11849 else
11850   echo "$as_me: failed program was:" >&5
11851 cat conftest.$ac_ext >&5
11852 fi
11853 rm -f conftest.$ac_objext conftest.$ac_ext
11854                 CFLAGS="$cf_save_CFLAGS"
11855                 echo "$as_me:11855: result: $INTEL_COMPILER" >&5
11856 echo "${ECHO_T}$INTEL_COMPILER" >&6
11857                 ;;
11858         esac
11859 fi
11860
11861 CLANG_COMPILER=no
11862
11863 if test "$GCC" = yes ; then
11864         echo "$as_me:11864: checking if this is really Clang C compiler" >&5
11865 echo $ECHO_N "checking if this is really Clang C compiler... $ECHO_C" >&6
11866         cf_save_CFLAGS="$CFLAGS"
11867         CFLAGS="$CFLAGS -Qunused-arguments"
11868         cat >conftest.$ac_ext <<_ACEOF
11869 #line 11869 "configure"
11870 #include "confdefs.h"
11871
11872 int
11873 main ()
11874 {
11875
11876 #ifdef __clang__
11877 #else
11878 make an error
11879 #endif
11880
11881   ;
11882   return 0;
11883 }
11884 _ACEOF
11885 rm -f conftest.$ac_objext
11886 if { (eval echo "$as_me:11886: \"$ac_compile\"") >&5
11887   (eval $ac_compile) 2>&5
11888   ac_status=$?
11889   echo "$as_me:11889: \$? = $ac_status" >&5
11890   (exit $ac_status); } &&
11891          { ac_try='test -s conftest.$ac_objext'
11892   { (eval echo "$as_me:11892: \"$ac_try\"") >&5
11893   (eval $ac_try) 2>&5
11894   ac_status=$?
11895   echo "$as_me:11895: \$? = $ac_status" >&5
11896   (exit $ac_status); }; }; then
11897   CLANG_COMPILER=yes
11898 cf_save_CFLAGS="$cf_save_CFLAGS -Qunused-arguments"
11899
11900 else
11901   echo "$as_me: failed program was:" >&5
11902 cat conftest.$ac_ext >&5
11903 fi
11904 rm -f conftest.$ac_objext conftest.$ac_ext
11905         CFLAGS="$cf_save_CFLAGS"
11906         echo "$as_me:11906: result: $CLANG_COMPILER" >&5
11907 echo "${ECHO_T}$CLANG_COMPILER" >&6
11908 fi
11909
11910 cat > conftest.$ac_ext <<EOF
11911 #line 11911 "${as_me:-configure}"
11912 int main(int argc, char *argv[]) { return (argv[argc-1] == 0) ; }
11913 EOF
11914
11915 if test "$INTEL_COMPILER" = yes
11916 then
11917 # The "-wdXXX" options suppress warnings:
11918 # remark #1419: external declaration in primary source file
11919 # remark #1683: explicit conversion of a 64-bit integral type to a smaller integral type (potential portability problem)
11920 # remark #1684: conversion from pointer to same-sized integral type (potential portability problem)
11921 # remark #193: zero used for undefined preprocessing identifier
11922 # remark #593: variable "curs_sb_left_arrow" was set but never used
11923 # remark #810: conversion from "int" to "Dimension={unsigned short}" may lose significant bits
11924 # remark #869: parameter "tw" was never referenced
11925 # remark #981: operands are evaluated in unspecified order
11926 # warning #279: controlling expression is constant
11927
11928         { echo "$as_me:11928: checking for $CC warning options..." >&5
11929 echo "$as_me: checking for $CC warning options..." >&6;}
11930         cf_save_CFLAGS="$CFLAGS"
11931         EXTRA_CFLAGS="-Wall"
11932         for cf_opt in \
11933                 wd1419 \
11934                 wd1683 \
11935                 wd1684 \
11936                 wd193 \
11937                 wd593 \
11938                 wd279 \
11939                 wd810 \
11940                 wd869 \
11941                 wd981
11942         do
11943                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
11944                 if { (eval echo "$as_me:11944: \"$ac_compile\"") >&5
11945   (eval $ac_compile) 2>&5
11946   ac_status=$?
11947   echo "$as_me:11947: \$? = $ac_status" >&5
11948   (exit $ac_status); }; then
11949                         test -n "$verbose" && echo "$as_me:11949: result: ... -$cf_opt" >&5
11950 echo "${ECHO_T}... -$cf_opt" >&6
11951                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
11952                 fi
11953         done
11954         CFLAGS="$cf_save_CFLAGS"
11955
11956 elif test "$GCC" = yes
11957 then
11958         { echo "$as_me:11958: checking for $CC warning options..." >&5
11959 echo "$as_me: checking for $CC warning options..." >&6;}
11960         cf_save_CFLAGS="$CFLAGS"
11961         EXTRA_CFLAGS=
11962         cf_warn_CONST=""
11963         test "$with_ext_const" = yes && cf_warn_CONST="Wwrite-strings"
11964         cf_gcc_warnings="Wignored-qualifiers Wlogical-op Wvarargs"
11965         test "x$CLANG_COMPILER" = xyes && cf_gcc_warnings=
11966         for cf_opt in W Wall \
11967                 Wbad-function-cast \
11968                 Wcast-align \
11969                 Wcast-qual \
11970                 Wdeclaration-after-statement \
11971                 Wextra \
11972                 Winline \
11973                 Wmissing-declarations \
11974                 Wmissing-prototypes \
11975                 Wnested-externs \
11976                 Wpointer-arith \
11977                 Wshadow \
11978                 Wstrict-prototypes \
11979                 Wundef $cf_gcc_warnings $cf_warn_CONST Wno-unknown-pragmas Wswitch-enum
11980         do
11981                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
11982                 if { (eval echo "$as_me:11982: \"$ac_compile\"") >&5
11983   (eval $ac_compile) 2>&5
11984   ac_status=$?
11985   echo "$as_me:11985: \$? = $ac_status" >&5
11986   (exit $ac_status); }; then
11987                         test -n "$verbose" && echo "$as_me:11987: result: ... -$cf_opt" >&5
11988 echo "${ECHO_T}... -$cf_opt" >&6
11989                         case $cf_opt in
11990                         (Wcast-qual)
11991                                 CPPFLAGS="$CPPFLAGS -DXTSTRINGDEFINES"
11992                                 ;;
11993                         (Winline)
11994                                 case $GCC_VERSION in
11995                                 ([34].*)
11996                                         test -n "$verbose" && echo "    feature is broken in gcc $GCC_VERSION" 1>&6
11997
11998 echo "${as_me:-configure}:11998: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
11999
12000                                         continue;;
12001                                 esac
12002                                 ;;
12003                         (Wpointer-arith)
12004                                 case $GCC_VERSION in
12005                                 ([12].*)
12006                                         test -n "$verbose" && echo "    feature is broken in gcc $GCC_VERSION" 1>&6
12007
12008 echo "${as_me:-configure}:12008: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
12009
12010                                         continue;;
12011                                 esac
12012                                 ;;
12013                         esac
12014                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
12015                 fi
12016         done
12017         CFLAGS="$cf_save_CFLAGS"
12018 fi
12019 rm -rf conftest*
12020
12021 fi
12022
12023 if test "$GCC" = yes
12024 then
12025 cat > conftest.i <<EOF
12026 #ifndef GCC_PRINTF
12027 #define GCC_PRINTF 0
12028 #endif
12029 #ifndef GCC_SCANF
12030 #define GCC_SCANF 0
12031 #endif
12032 #ifndef GCC_NORETURN
12033 #define GCC_NORETURN /* nothing */
12034 #endif
12035 #ifndef GCC_UNUSED
12036 #define GCC_UNUSED /* nothing */
12037 #endif
12038 EOF
12039 if test "$GCC" = yes
12040 then
12041         { echo "$as_me:12041: checking for $CC __attribute__ directives..." >&5
12042 echo "$as_me: checking for $CC __attribute__ directives..." >&6;}
12043 cat > conftest.$ac_ext <<EOF
12044 #line 12044 "${as_me:-configure}"
12045 #include "confdefs.h"
12046 #include "conftest.h"
12047 #include "conftest.i"
12048 #if     GCC_PRINTF
12049 #define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
12050 #else
12051 #define GCC_PRINTFLIKE(fmt,var) /*nothing*/
12052 #endif
12053 #if     GCC_SCANF
12054 #define GCC_SCANFLIKE(fmt,var)  __attribute__((format(scanf,fmt,var)))
12055 #else
12056 #define GCC_SCANFLIKE(fmt,var)  /*nothing*/
12057 #endif
12058 extern void wow(char *,...) GCC_SCANFLIKE(1,2);
12059 extern void oops(char *,...) GCC_PRINTFLIKE(1,2) GCC_NORETURN;
12060 extern void foo(void) GCC_NORETURN;
12061 int main(int argc GCC_UNUSED, char *argv[] GCC_UNUSED) { return 0; }
12062 EOF
12063         cf_printf_attribute=no
12064         cf_scanf_attribute=no
12065         for cf_attribute in scanf printf unused noreturn
12066         do
12067
12068 cf_ATTRIBUTE=`echo "$cf_attribute" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
12069
12070                 cf_directive="__attribute__(($cf_attribute))"
12071                 echo "checking for $CC $cf_directive" 1>&5
12072
12073                 case $cf_attribute in
12074                 (printf)
12075                         cf_printf_attribute=yes
12076                         cat >conftest.h <<EOF
12077 #define GCC_$cf_ATTRIBUTE 1
12078 EOF
12079                         ;;
12080                 (scanf)
12081                         cf_scanf_attribute=yes
12082                         cat >conftest.h <<EOF
12083 #define GCC_$cf_ATTRIBUTE 1
12084 EOF
12085                         ;;
12086                 (*)
12087                         cat >conftest.h <<EOF
12088 #define GCC_$cf_ATTRIBUTE $cf_directive
12089 EOF
12090                         ;;
12091                 esac
12092
12093                 if { (eval echo "$as_me:12093: \"$ac_compile\"") >&5
12094   (eval $ac_compile) 2>&5
12095   ac_status=$?
12096   echo "$as_me:12096: \$? = $ac_status" >&5
12097   (exit $ac_status); }; then
12098                         test -n "$verbose" && echo "$as_me:12098: result: ... $cf_attribute" >&5
12099 echo "${ECHO_T}... $cf_attribute" >&6
12100                         cat conftest.h >>confdefs.h
12101                         case $cf_attribute in
12102                         (noreturn)
12103
12104 cat >>confdefs.h <<EOF
12105 #define GCC_NORETURN $cf_directive
12106 EOF
12107
12108                                 ;;
12109                         (printf)
12110                                 cf_value='/* nothing */'
12111                                 if test "$cf_printf_attribute" != no ; then
12112                                         cf_value='__attribute__((format(printf,fmt,var)))'
12113
12114 cat >>confdefs.h <<\EOF
12115 #define GCC_PRINTF 1
12116 EOF
12117
12118                                 fi
12119
12120 cat >>confdefs.h <<EOF
12121 #define GCC_PRINTFLIKE(fmt,var) $cf_value
12122 EOF
12123
12124                                 ;;
12125                         (scanf)
12126                                 cf_value='/* nothing */'
12127                                 if test "$cf_scanf_attribute" != no ; then
12128                                         cf_value='__attribute__((format(scanf,fmt,var)))'
12129
12130 cat >>confdefs.h <<\EOF
12131 #define GCC_SCANF 1
12132 EOF
12133
12134                                 fi
12135
12136 cat >>confdefs.h <<EOF
12137 #define GCC_SCANFLIKE(fmt,var) $cf_value
12138 EOF
12139
12140                                 ;;
12141                         (unused)
12142
12143 cat >>confdefs.h <<EOF
12144 #define GCC_UNUSED $cf_directive
12145 EOF
12146
12147                                 ;;
12148                         esac
12149                 fi
12150         done
12151 else
12152         fgrep define conftest.i >>confdefs.h
12153 fi
12154 rm -rf conftest*
12155 fi
12156
12157 ###     use option --enable-assertions to turn on generation of assertion code
12158 echo "$as_me:12158: checking if you want to enable runtime assertions" >&5
12159 echo $ECHO_N "checking if you want to enable runtime assertions... $ECHO_C" >&6
12160
12161 # Check whether --enable-assertions or --disable-assertions was given.
12162 if test "${enable_assertions+set}" = set; then
12163   enableval="$enable_assertions"
12164   with_assertions=$enableval
12165 else
12166   with_assertions=no
12167 fi;
12168 echo "$as_me:12168: result: $with_assertions" >&5
12169 echo "${ECHO_T}$with_assertions" >&6
12170 if test -n "$GCC"
12171 then
12172         if test "$with_assertions" = no
12173         then
12174                 CPPFLAGS="$CPPFLAGS -DNDEBUG"
12175         else
12176
12177         ADAFLAGS="$ADAFLAGS -gnata"
12178
12179         fi
12180 fi
12181
12182 ###     use option --disable-leaks to suppress "permanent" leaks, for testing
12183
12184 cat >>confdefs.h <<\EOF
12185 #define HAVE_NC_ALLOC_H 1
12186 EOF
12187
12188 ###     use option --enable-expanded to generate certain macros as functions
12189
12190 # Check whether --enable-expanded or --disable-expanded was given.
12191 if test "${enable_expanded+set}" = set; then
12192   enableval="$enable_expanded"
12193   test "$enableval" = yes &&
12194 cat >>confdefs.h <<\EOF
12195 #define NCURSES_EXPANDED 1
12196 EOF
12197
12198 fi;
12199
12200 ###     use option --disable-macros to suppress macros in favor of functions
12201
12202 # Check whether --enable-macros or --disable-macros was given.
12203 if test "${enable_macros+set}" = set; then
12204   enableval="$enable_macros"
12205   test "$enableval" = no &&
12206 cat >>confdefs.h <<\EOF
12207 #define NCURSES_NOMACROS 1
12208 EOF
12209
12210 fi;
12211
12212 # Normally we only add trace() to the debug-library.  Allow this to be
12213 # extended to all models of the ncurses library:
12214 cf_all_traces=no
12215 case "$CFLAGS $CPPFLAGS" in
12216 (*-DTRACE*)
12217         cf_all_traces=yes
12218         ;;
12219 esac
12220
12221 echo "$as_me:12221: checking whether to add trace feature to all models" >&5
12222 echo $ECHO_N "checking whether to add trace feature to all models... $ECHO_C" >&6
12223
12224 # Check whether --with-trace or --without-trace was given.
12225 if test "${with_trace+set}" = set; then
12226   withval="$with_trace"
12227   cf_with_trace=$withval
12228 else
12229   cf_with_trace=$cf_all_traces
12230 fi;
12231 echo "$as_me:12231: result: $cf_with_trace" >&5
12232 echo "${ECHO_T}$cf_with_trace" >&6
12233
12234 if test "$cf_with_trace" = yes ; then
12235         ADA_TRACE=TRUE
12236
12237 cf_fix_cppflags=no
12238 cf_new_cflags=
12239 cf_new_cppflags=
12240 cf_new_extra_cppflags=
12241
12242 for cf_add_cflags in -DTRACE
12243 do
12244 case $cf_fix_cppflags in
12245 (no)
12246         case $cf_add_cflags in
12247         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
12248                 case $cf_add_cflags in
12249                 (-D*)
12250                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
12251
12252                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12253                                 && test -z "${cf_tst_cflags}" \
12254                                 && cf_fix_cppflags=yes
12255
12256                         if test $cf_fix_cppflags = yes ; then
12257                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
12258                                 continue
12259                         elif test "${cf_tst_cflags}" = "\"'" ; then
12260                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
12261                                 continue
12262                         fi
12263                         ;;
12264                 esac
12265                 case "$CPPFLAGS" in
12266                 (*$cf_add_cflags)
12267                         ;;
12268                 (*)
12269                         case $cf_add_cflags in
12270                         (-D*)
12271                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
12272
12273 CPPFLAGS=`echo "$CPPFLAGS" | \
12274         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
12275                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
12276
12277                                 ;;
12278                         esac
12279                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
12280                         ;;
12281                 esac
12282                 ;;
12283         (*)
12284                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
12285                 ;;
12286         esac
12287         ;;
12288 (yes)
12289         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
12290
12291         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
12292
12293         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12294                 && test -z "${cf_tst_cflags}" \
12295                 && cf_fix_cppflags=no
12296         ;;
12297 esac
12298 done
12299
12300 if test -n "$cf_new_cflags" ; then
12301
12302         CFLAGS="$CFLAGS $cf_new_cflags"
12303 fi
12304
12305 if test -n "$cf_new_cppflags" ; then
12306
12307         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
12308 fi
12309
12310 if test -n "$cf_new_extra_cppflags" ; then
12311
12312         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
12313 fi
12314
12315 else
12316         ADA_TRACE=FALSE
12317 fi
12318
12319 echo "$as_me:12319: checking if we want to use GNAT projects" >&5
12320 echo $ECHO_N "checking if we want to use GNAT projects... $ECHO_C" >&6
12321
12322 # Check whether --enable-gnat-projects or --disable-gnat-projects was given.
12323 if test "${enable_gnat_projects+set}" = set; then
12324   enableval="$enable_gnat_projects"
12325   test "$enableval" != no && enableval=yes
12326         if test "$enableval" != "yes" ; then
12327     enable_gnat_projects=no
12328         else
12329                 enable_gnat_projects=yes
12330         fi
12331 else
12332   enableval=yes
12333         enable_gnat_projects=yes
12334
12335 fi;
12336 echo "$as_me:12336: result: $enable_gnat_projects" >&5
12337 echo "${ECHO_T}$enable_gnat_projects" >&6
12338
12339 ###     Checks for libraries.
12340 case $cf_cv_system_name in
12341 (*mingw32*)
12342         ;;
12343 (*)
12344 echo "$as_me:12344: checking for gettimeofday" >&5
12345 echo $ECHO_N "checking for gettimeofday... $ECHO_C" >&6
12346 if test "${ac_cv_func_gettimeofday+set}" = set; then
12347   echo $ECHO_N "(cached) $ECHO_C" >&6
12348 else
12349   cat >conftest.$ac_ext <<_ACEOF
12350 #line 12350 "configure"
12351 #include "confdefs.h"
12352 /* System header to define __stub macros and hopefully few prototypes,
12353     which can conflict with char gettimeofday (); below.  */
12354 #include <assert.h>
12355 /* Override any gcc2 internal prototype to avoid an error.  */
12356 #ifdef __cplusplus
12357 extern "C"
12358 #endif
12359 /* We use char because int might match the return type of a gcc2
12360    builtin and then its argument prototype would still apply.  */
12361 char gettimeofday ();
12362 char (*f) ();
12363
12364 int
12365 main ()
12366 {
12367 /* The GNU C library defines this for functions which it implements
12368     to always fail with ENOSYS.  Some functions are actually named
12369     something starting with __ and the normal name is an alias.  */
12370 #if defined (__stub_gettimeofday) || defined (__stub___gettimeofday)
12371 choke me
12372 #else
12373 f = gettimeofday; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
12374 #endif
12375
12376   ;
12377   return 0;
12378 }
12379 _ACEOF
12380 rm -f conftest.$ac_objext conftest$ac_exeext
12381 if { (eval echo "$as_me:12381: \"$ac_link\"") >&5
12382   (eval $ac_link) 2>&5
12383   ac_status=$?
12384   echo "$as_me:12384: \$? = $ac_status" >&5
12385   (exit $ac_status); } &&
12386          { ac_try='test -s conftest$ac_exeext'
12387   { (eval echo "$as_me:12387: \"$ac_try\"") >&5
12388   (eval $ac_try) 2>&5
12389   ac_status=$?
12390   echo "$as_me:12390: \$? = $ac_status" >&5
12391   (exit $ac_status); }; }; then
12392   ac_cv_func_gettimeofday=yes
12393 else
12394   echo "$as_me: failed program was:" >&5
12395 cat conftest.$ac_ext >&5
12396 ac_cv_func_gettimeofday=no
12397 fi
12398 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12399 fi
12400 echo "$as_me:12400: result: $ac_cv_func_gettimeofday" >&5
12401 echo "${ECHO_T}$ac_cv_func_gettimeofday" >&6
12402 if test $ac_cv_func_gettimeofday = yes; then
12403   cat >>confdefs.h <<\EOF
12404 #define HAVE_GETTIMEOFDAY 1
12405 EOF
12406
12407 else
12408
12409 echo "$as_me:12409: checking for gettimeofday in -lbsd" >&5
12410 echo $ECHO_N "checking for gettimeofday in -lbsd... $ECHO_C" >&6
12411 if test "${ac_cv_lib_bsd_gettimeofday+set}" = set; then
12412   echo $ECHO_N "(cached) $ECHO_C" >&6
12413 else
12414   ac_check_lib_save_LIBS=$LIBS
12415 LIBS="-lbsd  $LIBS"
12416 cat >conftest.$ac_ext <<_ACEOF
12417 #line 12417 "configure"
12418 #include "confdefs.h"
12419
12420 /* Override any gcc2 internal prototype to avoid an error.  */
12421 #ifdef __cplusplus
12422 extern "C"
12423 #endif
12424 /* We use char because int might match the return type of a gcc2
12425    builtin and then its argument prototype would still apply.  */
12426 char gettimeofday ();
12427 int
12428 main ()
12429 {
12430 gettimeofday ();
12431   ;
12432   return 0;
12433 }
12434 _ACEOF
12435 rm -f conftest.$ac_objext conftest$ac_exeext
12436 if { (eval echo "$as_me:12436: \"$ac_link\"") >&5
12437   (eval $ac_link) 2>&5
12438   ac_status=$?
12439   echo "$as_me:12439: \$? = $ac_status" >&5
12440   (exit $ac_status); } &&
12441          { ac_try='test -s conftest$ac_exeext'
12442   { (eval echo "$as_me:12442: \"$ac_try\"") >&5
12443   (eval $ac_try) 2>&5
12444   ac_status=$?
12445   echo "$as_me:12445: \$? = $ac_status" >&5
12446   (exit $ac_status); }; }; then
12447   ac_cv_lib_bsd_gettimeofday=yes
12448 else
12449   echo "$as_me: failed program was:" >&5
12450 cat conftest.$ac_ext >&5
12451 ac_cv_lib_bsd_gettimeofday=no
12452 fi
12453 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12454 LIBS=$ac_check_lib_save_LIBS
12455 fi
12456 echo "$as_me:12456: result: $ac_cv_lib_bsd_gettimeofday" >&5
12457 echo "${ECHO_T}$ac_cv_lib_bsd_gettimeofday" >&6
12458 if test $ac_cv_lib_bsd_gettimeofday = yes; then
12459
12460 cat >>confdefs.h <<\EOF
12461 #define HAVE_GETTIMEOFDAY 1
12462 EOF
12463
12464         LIBS="$LIBS -lbsd"
12465 fi
12466
12467 fi
12468         ;;
12469 esac
12470
12471 ###     Checks for header files.
12472 echo "$as_me:12472: checking for ANSI C header files" >&5
12473 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
12474 if test "${ac_cv_header_stdc+set}" = set; then
12475   echo $ECHO_N "(cached) $ECHO_C" >&6
12476 else
12477   cat >conftest.$ac_ext <<_ACEOF
12478 #line 12478 "configure"
12479 #include "confdefs.h"
12480 #include <stdlib.h>
12481 #include <stdarg.h>
12482 #include <string.h>
12483 #include <float.h>
12484
12485 _ACEOF
12486 if { (eval echo "$as_me:12486: \"$ac_cpp conftest.$ac_ext\"") >&5
12487   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
12488   ac_status=$?
12489   egrep -v '^ *\+' conftest.er1 >conftest.err
12490   rm -f conftest.er1
12491   cat conftest.err >&5
12492   echo "$as_me:12492: \$? = $ac_status" >&5
12493   (exit $ac_status); } >/dev/null; then
12494   if test -s conftest.err; then
12495     ac_cpp_err=$ac_c_preproc_warn_flag
12496   else
12497     ac_cpp_err=
12498   fi
12499 else
12500   ac_cpp_err=yes
12501 fi
12502 if test -z "$ac_cpp_err"; then
12503   ac_cv_header_stdc=yes
12504 else
12505   echo "$as_me: failed program was:" >&5
12506   cat conftest.$ac_ext >&5
12507   ac_cv_header_stdc=no
12508 fi
12509 rm -f conftest.err conftest.$ac_ext
12510
12511 if test $ac_cv_header_stdc = yes; then
12512   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
12513   cat >conftest.$ac_ext <<_ACEOF
12514 #line 12514 "configure"
12515 #include "confdefs.h"
12516 #include <string.h>
12517
12518 _ACEOF
12519 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
12520   egrep "memchr" >/dev/null 2>&1; then
12521   :
12522 else
12523   ac_cv_header_stdc=no
12524 fi
12525 rm -rf conftest*
12526
12527 fi
12528
12529 if test $ac_cv_header_stdc = yes; then
12530   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
12531   cat >conftest.$ac_ext <<_ACEOF
12532 #line 12532 "configure"
12533 #include "confdefs.h"
12534 #include <stdlib.h>
12535
12536 _ACEOF
12537 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
12538   egrep "free" >/dev/null 2>&1; then
12539   :
12540 else
12541   ac_cv_header_stdc=no
12542 fi
12543 rm -rf conftest*
12544
12545 fi
12546
12547 if test $ac_cv_header_stdc = yes; then
12548   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
12549   if test "$cross_compiling" = yes; then
12550   :
12551 else
12552   cat >conftest.$ac_ext <<_ACEOF
12553 #line 12553 "configure"
12554 #include "confdefs.h"
12555 #include <ctype.h>
12556 #if ((' ' & 0x0FF) == 0x020)
12557 # define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
12558 # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
12559 #else
12560 # define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
12561                      || ('j' <= (c) && (c) <= 'r') \
12562                      || ('s' <= (c) && (c) <= 'z'))
12563 # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
12564 #endif
12565
12566 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
12567 int
12568 main ()
12569 {
12570   int i;
12571   for (i = 0; i < 256; i++)
12572     if (XOR (islower (i), ISLOWER (i))
12573         || toupper (i) != TOUPPER (i))
12574       $ac_main_return(2);
12575   $ac_main_return (0);
12576 }
12577 _ACEOF
12578 rm -f conftest$ac_exeext
12579 if { (eval echo "$as_me:12579: \"$ac_link\"") >&5
12580   (eval $ac_link) 2>&5
12581   ac_status=$?
12582   echo "$as_me:12582: \$? = $ac_status" >&5
12583   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
12584   { (eval echo "$as_me:12584: \"$ac_try\"") >&5
12585   (eval $ac_try) 2>&5
12586   ac_status=$?
12587   echo "$as_me:12587: \$? = $ac_status" >&5
12588   (exit $ac_status); }; }; then
12589   :
12590 else
12591   echo "$as_me: program exited with status $ac_status" >&5
12592 echo "$as_me: failed program was:" >&5
12593 cat conftest.$ac_ext >&5
12594 ac_cv_header_stdc=no
12595 fi
12596 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
12597 fi
12598 fi
12599 fi
12600 echo "$as_me:12600: result: $ac_cv_header_stdc" >&5
12601 echo "${ECHO_T}$ac_cv_header_stdc" >&6
12602 if test $ac_cv_header_stdc = yes; then
12603
12604 cat >>confdefs.h <<\EOF
12605 #define STDC_HEADERS 1
12606 EOF
12607
12608 fi
12609
12610 ac_header_dirent=no
12611 for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h; do
12612   as_ac_Header=`echo "ac_cv_header_dirent_$ac_hdr" | $as_tr_sh`
12613 echo "$as_me:12613: checking for $ac_hdr that defines DIR" >&5
12614 echo $ECHO_N "checking for $ac_hdr that defines DIR... $ECHO_C" >&6
12615 if eval "test \"\${$as_ac_Header+set}\" = set"; then
12616   echo $ECHO_N "(cached) $ECHO_C" >&6
12617 else
12618   cat >conftest.$ac_ext <<_ACEOF
12619 #line 12619 "configure"
12620 #include "confdefs.h"
12621 #include <sys/types.h>
12622 #include <$ac_hdr>
12623
12624 int
12625 main ()
12626 {
12627 if ((DIR *) 0)
12628 return 0;
12629   ;
12630   return 0;
12631 }
12632 _ACEOF
12633 rm -f conftest.$ac_objext
12634 if { (eval echo "$as_me:12634: \"$ac_compile\"") >&5
12635   (eval $ac_compile) 2>&5
12636   ac_status=$?
12637   echo "$as_me:12637: \$? = $ac_status" >&5
12638   (exit $ac_status); } &&
12639          { ac_try='test -s conftest.$ac_objext'
12640   { (eval echo "$as_me:12640: \"$ac_try\"") >&5
12641   (eval $ac_try) 2>&5
12642   ac_status=$?
12643   echo "$as_me:12643: \$? = $ac_status" >&5
12644   (exit $ac_status); }; }; then
12645   eval "$as_ac_Header=yes"
12646 else
12647   echo "$as_me: failed program was:" >&5
12648 cat conftest.$ac_ext >&5
12649 eval "$as_ac_Header=no"
12650 fi
12651 rm -f conftest.$ac_objext conftest.$ac_ext
12652 fi
12653 echo "$as_me:12653: result: `eval echo '${'$as_ac_Header'}'`" >&5
12654 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
12655 if test `eval echo '${'$as_ac_Header'}'` = yes; then
12656   cat >>confdefs.h <<EOF
12657 #define `echo "HAVE_$ac_hdr" | $as_tr_cpp` 1
12658 EOF
12659
12660 ac_header_dirent=$ac_hdr; break
12661 fi
12662
12663 done
12664 # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix.
12665 if test $ac_header_dirent = dirent.h; then
12666   echo "$as_me:12666: checking for opendir in -ldir" >&5
12667 echo $ECHO_N "checking for opendir in -ldir... $ECHO_C" >&6
12668 if test "${ac_cv_lib_dir_opendir+set}" = set; then
12669   echo $ECHO_N "(cached) $ECHO_C" >&6
12670 else
12671   ac_check_lib_save_LIBS=$LIBS
12672 LIBS="-ldir  $LIBS"
12673 cat >conftest.$ac_ext <<_ACEOF
12674 #line 12674 "configure"
12675 #include "confdefs.h"
12676
12677 /* Override any gcc2 internal prototype to avoid an error.  */
12678 #ifdef __cplusplus
12679 extern "C"
12680 #endif
12681 /* We use char because int might match the return type of a gcc2
12682    builtin and then its argument prototype would still apply.  */
12683 char opendir ();
12684 int
12685 main ()
12686 {
12687 opendir ();
12688   ;
12689   return 0;
12690 }
12691 _ACEOF
12692 rm -f conftest.$ac_objext conftest$ac_exeext
12693 if { (eval echo "$as_me:12693: \"$ac_link\"") >&5
12694   (eval $ac_link) 2>&5
12695   ac_status=$?
12696   echo "$as_me:12696: \$? = $ac_status" >&5
12697   (exit $ac_status); } &&
12698          { ac_try='test -s conftest$ac_exeext'
12699   { (eval echo "$as_me:12699: \"$ac_try\"") >&5
12700   (eval $ac_try) 2>&5
12701   ac_status=$?
12702   echo "$as_me:12702: \$? = $ac_status" >&5
12703   (exit $ac_status); }; }; then
12704   ac_cv_lib_dir_opendir=yes
12705 else
12706   echo "$as_me: failed program was:" >&5
12707 cat conftest.$ac_ext >&5
12708 ac_cv_lib_dir_opendir=no
12709 fi
12710 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12711 LIBS=$ac_check_lib_save_LIBS
12712 fi
12713 echo "$as_me:12713: result: $ac_cv_lib_dir_opendir" >&5
12714 echo "${ECHO_T}$ac_cv_lib_dir_opendir" >&6
12715 if test $ac_cv_lib_dir_opendir = yes; then
12716   LIBS="$LIBS -ldir"
12717 fi
12718
12719 else
12720   echo "$as_me:12720: checking for opendir in -lx" >&5
12721 echo $ECHO_N "checking for opendir in -lx... $ECHO_C" >&6
12722 if test "${ac_cv_lib_x_opendir+set}" = set; then
12723   echo $ECHO_N "(cached) $ECHO_C" >&6
12724 else
12725   ac_check_lib_save_LIBS=$LIBS
12726 LIBS="-lx  $LIBS"
12727 cat >conftest.$ac_ext <<_ACEOF
12728 #line 12728 "configure"
12729 #include "confdefs.h"
12730
12731 /* Override any gcc2 internal prototype to avoid an error.  */
12732 #ifdef __cplusplus
12733 extern "C"
12734 #endif
12735 /* We use char because int might match the return type of a gcc2
12736    builtin and then its argument prototype would still apply.  */
12737 char opendir ();
12738 int
12739 main ()
12740 {
12741 opendir ();
12742   ;
12743   return 0;
12744 }
12745 _ACEOF
12746 rm -f conftest.$ac_objext conftest$ac_exeext
12747 if { (eval echo "$as_me:12747: \"$ac_link\"") >&5
12748   (eval $ac_link) 2>&5
12749   ac_status=$?
12750   echo "$as_me:12750: \$? = $ac_status" >&5
12751   (exit $ac_status); } &&
12752          { ac_try='test -s conftest$ac_exeext'
12753   { (eval echo "$as_me:12753: \"$ac_try\"") >&5
12754   (eval $ac_try) 2>&5
12755   ac_status=$?
12756   echo "$as_me:12756: \$? = $ac_status" >&5
12757   (exit $ac_status); }; }; then
12758   ac_cv_lib_x_opendir=yes
12759 else
12760   echo "$as_me: failed program was:" >&5
12761 cat conftest.$ac_ext >&5
12762 ac_cv_lib_x_opendir=no
12763 fi
12764 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12765 LIBS=$ac_check_lib_save_LIBS
12766 fi
12767 echo "$as_me:12767: result: $ac_cv_lib_x_opendir" >&5
12768 echo "${ECHO_T}$ac_cv_lib_x_opendir" >&6
12769 if test $ac_cv_lib_x_opendir = yes; then
12770   LIBS="$LIBS -lx"
12771 fi
12772
12773 fi
12774
12775 echo "$as_me:12775: checking whether time.h and sys/time.h may both be included" >&5
12776 echo $ECHO_N "checking whether time.h and sys/time.h may both be included... $ECHO_C" >&6
12777 if test "${ac_cv_header_time+set}" = set; then
12778   echo $ECHO_N "(cached) $ECHO_C" >&6
12779 else
12780   cat >conftest.$ac_ext <<_ACEOF
12781 #line 12781 "configure"
12782 #include "confdefs.h"
12783 #include <sys/types.h>
12784 #include <sys/time.h>
12785 #include <time.h>
12786
12787 int
12788 main ()
12789 {
12790 if ((struct tm *) 0)
12791 return 0;
12792   ;
12793   return 0;
12794 }
12795 _ACEOF
12796 rm -f conftest.$ac_objext
12797 if { (eval echo "$as_me:12797: \"$ac_compile\"") >&5
12798   (eval $ac_compile) 2>&5
12799   ac_status=$?
12800   echo "$as_me:12800: \$? = $ac_status" >&5
12801   (exit $ac_status); } &&
12802          { ac_try='test -s conftest.$ac_objext'
12803   { (eval echo "$as_me:12803: \"$ac_try\"") >&5
12804   (eval $ac_try) 2>&5
12805   ac_status=$?
12806   echo "$as_me:12806: \$? = $ac_status" >&5
12807   (exit $ac_status); }; }; then
12808   ac_cv_header_time=yes
12809 else
12810   echo "$as_me: failed program was:" >&5
12811 cat conftest.$ac_ext >&5
12812 ac_cv_header_time=no
12813 fi
12814 rm -f conftest.$ac_objext conftest.$ac_ext
12815 fi
12816 echo "$as_me:12816: result: $ac_cv_header_time" >&5
12817 echo "${ECHO_T}$ac_cv_header_time" >&6
12818 if test $ac_cv_header_time = yes; then
12819
12820 cat >>confdefs.h <<\EOF
12821 #define TIME_WITH_SYS_TIME 1
12822 EOF
12823
12824 fi
12825
12826 ###     checks for compiler characteristics
12827 ac_ext=c
12828 ac_cpp='$CPP $CPPFLAGS'
12829 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
12830 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
12831 ac_compiler_gnu=$ac_cv_c_compiler_gnu
12832 ac_main_return=return
12833
12834 echo "$as_me:12834: checking for an ANSI C-conforming const" >&5
12835 echo $ECHO_N "checking for an ANSI C-conforming const... $ECHO_C" >&6
12836 if test "${ac_cv_c_const+set}" = set; then
12837   echo $ECHO_N "(cached) $ECHO_C" >&6
12838 else
12839   cat >conftest.$ac_ext <<_ACEOF
12840 #line 12840 "configure"
12841 #include "confdefs.h"
12842
12843 int
12844 main ()
12845 {
12846 /* FIXME: Include the comments suggested by Paul. */
12847 #ifndef __cplusplus
12848   /* Ultrix mips cc rejects this.  */
12849   typedef int charset[2];
12850   const charset x;
12851   /* SunOS 4.1.1 cc rejects this.  */
12852   char const *const *ccp;
12853   char **p;
12854   /* NEC SVR4.0.2 mips cc rejects this.  */
12855   struct point {int x, y;};
12856   static struct point const zero = {0,0};
12857   /* AIX XL C 1.02.0.0 rejects this.
12858      It does not let you subtract one const X* pointer from another in
12859      an arm of an if-expression whose if-part is not a constant
12860      expression */
12861   const char *g = "string";
12862   ccp = &g + (g ? g-g : 0);
12863   /* HPUX 7.0 cc rejects these. */
12864   ++ccp;
12865   p = (char**) ccp;
12866   ccp = (char const *const *) p;
12867   { /* SCO 3.2v4 cc rejects this.  */
12868     char *t;
12869     char const *s = 0 ? (char *) 0 : (char const *) 0;
12870
12871     *t++ = 0;
12872   }
12873   { /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  */
12874     int x[] = {25, 17};
12875     const int *foo = &x[0];
12876     ++foo;
12877   }
12878   { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
12879     typedef const int *iptr;
12880     iptr p = 0;
12881     ++p;
12882   }
12883   { /* AIX XL C 1.02.0.0 rejects this saying
12884        "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
12885     struct s { int j; const int *ap[3]; };
12886     struct s *b; b->j = 5;
12887   }
12888   { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
12889     const int foo = 10;
12890   }
12891 #endif
12892
12893   ;
12894   return 0;
12895 }
12896 _ACEOF
12897 rm -f conftest.$ac_objext
12898 if { (eval echo "$as_me:12898: \"$ac_compile\"") >&5
12899   (eval $ac_compile) 2>&5
12900   ac_status=$?
12901   echo "$as_me:12901: \$? = $ac_status" >&5
12902   (exit $ac_status); } &&
12903          { ac_try='test -s conftest.$ac_objext'
12904   { (eval echo "$as_me:12904: \"$ac_try\"") >&5
12905   (eval $ac_try) 2>&5
12906   ac_status=$?
12907   echo "$as_me:12907: \$? = $ac_status" >&5
12908   (exit $ac_status); }; }; then
12909   ac_cv_c_const=yes
12910 else
12911   echo "$as_me: failed program was:" >&5
12912 cat conftest.$ac_ext >&5
12913 ac_cv_c_const=no
12914 fi
12915 rm -f conftest.$ac_objext conftest.$ac_ext
12916 fi
12917 echo "$as_me:12917: result: $ac_cv_c_const" >&5
12918 echo "${ECHO_T}$ac_cv_c_const" >&6
12919 if test $ac_cv_c_const = no; then
12920
12921 cat >>confdefs.h <<\EOF
12922 #define const
12923 EOF
12924
12925 fi
12926
12927 ###     Checks for external-data
12928
12929 echo "$as_me:12929: checking if data-only library module links" >&5
12930 echo $ECHO_N "checking if data-only library module links... $ECHO_C" >&6
12931 if test "${cf_cv_link_dataonly+set}" = set; then
12932   echo $ECHO_N "(cached) $ECHO_C" >&6
12933 else
12934
12935         rm -f conftest.a
12936         cat >conftest.$ac_ext <<EOF
12937 #line 12937 "configure"
12938 int     testdata[3] = { 123, 456, 789 };
12939 EOF
12940         if { (eval echo "$as_me:12940: \"$ac_compile\"") >&5
12941   (eval $ac_compile) 2>&5
12942   ac_status=$?
12943   echo "$as_me:12943: \$? = $ac_status" >&5
12944   (exit $ac_status); } ; then
12945                 mv conftest.o data.o && \
12946                 ( $AR $ARFLAGS conftest.a data.o ) 2>&5 1>/dev/null
12947         fi
12948         rm -f conftest.$ac_ext data.o
12949         cat >conftest.$ac_ext <<EOF
12950 #line 12950 "configure"
12951 int     testfunc()
12952 {
12953 #if defined(NeXT)
12954         ${cf_cv_main_return:-return}(1);        /* I'm told this linker is broken */
12955 #else
12956         extern int testdata[3];
12957         return testdata[0] == 123
12958            &&  testdata[1] == 456
12959            &&  testdata[2] == 789;
12960 #endif
12961 }
12962 EOF
12963         if { (eval echo "$as_me:12963: \"$ac_compile\"") >&5
12964   (eval $ac_compile) 2>&5
12965   ac_status=$?
12966   echo "$as_me:12966: \$? = $ac_status" >&5
12967   (exit $ac_status); }; then
12968                 mv conftest.o func.o && \
12969                 ( $AR $ARFLAGS conftest.a func.o ) 2>&5 1>/dev/null
12970         fi
12971         rm -f conftest.$ac_ext func.o
12972         ( eval $RANLIB conftest.a ) 2>&5 >/dev/null
12973         cf_saveLIBS="$LIBS"
12974         LIBS="conftest.a $LIBS"
12975         if test "$cross_compiling" = yes; then
12976   cf_cv_link_dataonly=unknown
12977 else
12978   cat >conftest.$ac_ext <<_ACEOF
12979 #line 12979 "configure"
12980 #include "confdefs.h"
12981
12982         int main()
12983         {
12984                 extern int testfunc();
12985                 ${cf_cv_main_return:-return} (!testfunc());
12986         }
12987
12988 _ACEOF
12989 rm -f conftest$ac_exeext
12990 if { (eval echo "$as_me:12990: \"$ac_link\"") >&5
12991   (eval $ac_link) 2>&5
12992   ac_status=$?
12993   echo "$as_me:12993: \$? = $ac_status" >&5
12994   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
12995   { (eval echo "$as_me:12995: \"$ac_try\"") >&5
12996   (eval $ac_try) 2>&5
12997   ac_status=$?
12998   echo "$as_me:12998: \$? = $ac_status" >&5
12999   (exit $ac_status); }; }; then
13000   cf_cv_link_dataonly=yes
13001 else
13002   echo "$as_me: program exited with status $ac_status" >&5
13003 echo "$as_me: failed program was:" >&5
13004 cat conftest.$ac_ext >&5
13005 cf_cv_link_dataonly=no
13006 fi
13007 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
13008 fi
13009         LIBS="$cf_saveLIBS"
13010
13011 fi
13012
13013 echo "$as_me:13013: result: $cf_cv_link_dataonly" >&5
13014 echo "${ECHO_T}$cf_cv_link_dataonly" >&6
13015
13016 if test "$cf_cv_link_dataonly" = no ; then
13017
13018 cat >>confdefs.h <<\EOF
13019 #define BROKEN_LINKER 1
13020 EOF
13021
13022         BROKEN_LINKER=1
13023 fi
13024
13025 ###     Checks for library functions.
13026
13027 echo "$as_me:13027: checking for working mkstemp" >&5
13028 echo $ECHO_N "checking for working mkstemp... $ECHO_C" >&6
13029 if test "${cf_cv_func_mkstemp+set}" = set; then
13030   echo $ECHO_N "(cached) $ECHO_C" >&6
13031 else
13032
13033 rm -rf conftest*
13034 if test "$cross_compiling" = yes; then
13035   cf_cv_func_mkstemp=maybe
13036 else
13037   cat >conftest.$ac_ext <<_ACEOF
13038 #line 13038 "configure"
13039 #include "confdefs.h"
13040
13041 #include <sys/types.h>
13042 #include <stdlib.h>
13043 #include <stdio.h>
13044 #include <string.h>
13045 #include <sys/stat.h>
13046 int main()
13047 {
13048         char *tmpl = "conftestXXXXXX";
13049         char name[2][80];
13050         int n;
13051         int result = 0;
13052         int fd;
13053         struct stat sb;
13054
13055         umask(077);
13056         for (n = 0; n < 2; ++n) {
13057                 strcpy(name[n], tmpl);
13058                 if ((fd = mkstemp(name[n])) >= 0) {
13059                         if (!strcmp(name[n], tmpl)
13060                          || stat(name[n], &sb) != 0
13061                          || (sb.st_mode & S_IFMT) != S_IFREG
13062                          || (sb.st_mode & 077) != 0) {
13063                                 result = 1;
13064                         }
13065                         close(fd);
13066                 }
13067         }
13068         if (result == 0
13069          && !strcmp(name[0], name[1]))
13070                 result = 1;
13071         ${cf_cv_main_return:-return}(result);
13072 }
13073
13074 _ACEOF
13075 rm -f conftest$ac_exeext
13076 if { (eval echo "$as_me:13076: \"$ac_link\"") >&5
13077   (eval $ac_link) 2>&5
13078   ac_status=$?
13079   echo "$as_me:13079: \$? = $ac_status" >&5
13080   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
13081   { (eval echo "$as_me:13081: \"$ac_try\"") >&5
13082   (eval $ac_try) 2>&5
13083   ac_status=$?
13084   echo "$as_me:13084: \$? = $ac_status" >&5
13085   (exit $ac_status); }; }; then
13086   cf_cv_func_mkstemp=yes
13087
13088 else
13089   echo "$as_me: program exited with status $ac_status" >&5
13090 echo "$as_me: failed program was:" >&5
13091 cat conftest.$ac_ext >&5
13092 cf_cv_func_mkstemp=no
13093
13094 fi
13095 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
13096 fi
13097
13098 fi
13099 echo "$as_me:13099: result: $cf_cv_func_mkstemp" >&5
13100 echo "${ECHO_T}$cf_cv_func_mkstemp" >&6
13101 if test "x$cf_cv_func_mkstemp" = xmaybe ; then
13102         echo "$as_me:13102: checking for mkstemp" >&5
13103 echo $ECHO_N "checking for mkstemp... $ECHO_C" >&6
13104 if test "${ac_cv_func_mkstemp+set}" = set; then
13105   echo $ECHO_N "(cached) $ECHO_C" >&6
13106 else
13107   cat >conftest.$ac_ext <<_ACEOF
13108 #line 13108 "configure"
13109 #include "confdefs.h"
13110 /* System header to define __stub macros and hopefully few prototypes,
13111     which can conflict with char mkstemp (); below.  */
13112 #include <assert.h>
13113 /* Override any gcc2 internal prototype to avoid an error.  */
13114 #ifdef __cplusplus
13115 extern "C"
13116 #endif
13117 /* We use char because int might match the return type of a gcc2
13118    builtin and then its argument prototype would still apply.  */
13119 char mkstemp ();
13120 char (*f) ();
13121
13122 int
13123 main ()
13124 {
13125 /* The GNU C library defines this for functions which it implements
13126     to always fail with ENOSYS.  Some functions are actually named
13127     something starting with __ and the normal name is an alias.  */
13128 #if defined (__stub_mkstemp) || defined (__stub___mkstemp)
13129 choke me
13130 #else
13131 f = mkstemp; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
13132 #endif
13133
13134   ;
13135   return 0;
13136 }
13137 _ACEOF
13138 rm -f conftest.$ac_objext conftest$ac_exeext
13139 if { (eval echo "$as_me:13139: \"$ac_link\"") >&5
13140   (eval $ac_link) 2>&5
13141   ac_status=$?
13142   echo "$as_me:13142: \$? = $ac_status" >&5
13143   (exit $ac_status); } &&
13144          { ac_try='test -s conftest$ac_exeext'
13145   { (eval echo "$as_me:13145: \"$ac_try\"") >&5
13146   (eval $ac_try) 2>&5
13147   ac_status=$?
13148   echo "$as_me:13148: \$? = $ac_status" >&5
13149   (exit $ac_status); }; }; then
13150   ac_cv_func_mkstemp=yes
13151 else
13152   echo "$as_me: failed program was:" >&5
13153 cat conftest.$ac_ext >&5
13154 ac_cv_func_mkstemp=no
13155 fi
13156 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13157 fi
13158 echo "$as_me:13158: result: $ac_cv_func_mkstemp" >&5
13159 echo "${ECHO_T}$ac_cv_func_mkstemp" >&6
13160
13161 fi
13162 if test "x$cf_cv_func_mkstemp" = xyes || test "x$ac_cv_func_mkstemp" = xyes ; then
13163
13164 cat >>confdefs.h <<\EOF
13165 #define HAVE_MKSTEMP 1
13166 EOF
13167
13168 fi
13169
13170 if test -z "$cf_user_CFLAGS" && test "$with_no_leaks" = no ; then
13171         CFLAGS=`echo ${CFLAGS} | sed -e 's%-g %%' -e 's%-g$%%'`
13172         CXXFLAGS=`echo ${CXXFLAGS} | sed -e 's%-g %%' -e 's%-g$%%'`
13173 fi
13174
13175 cf_with_ada=yes
13176 if test "$cf_with_ada" != "no" ; then
13177
13178 cf_ada_make=gnatmake
13179 # Extract the first word of "$cf_ada_make", so it can be a program name with args.
13180 set dummy $cf_ada_make; ac_word=$2
13181 echo "$as_me:13181: checking for $ac_word" >&5
13182 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
13183 if test "${ac_cv_prog_gnat_exists+set}" = set; then
13184   echo $ECHO_N "(cached) $ECHO_C" >&6
13185 else
13186   if test -n "$gnat_exists"; then
13187   ac_cv_prog_gnat_exists="$gnat_exists" # Let the user override the test.
13188 else
13189   ac_save_IFS=$IFS; IFS=$ac_path_separator
13190 ac_dummy="$PATH"
13191 for ac_dir in $ac_dummy; do
13192   IFS=$ac_save_IFS
13193   test -z "$ac_dir" && ac_dir=.
13194   $as_executable_p "$ac_dir/$ac_word" || continue
13195 ac_cv_prog_gnat_exists="yes"
13196 echo "$as_me:13196: found $ac_dir/$ac_word" >&5
13197 break
13198 done
13199
13200   test -z "$ac_cv_prog_gnat_exists" && ac_cv_prog_gnat_exists="no"
13201 fi
13202 fi
13203 gnat_exists=$ac_cv_prog_gnat_exists
13204 if test -n "$gnat_exists"; then
13205   echo "$as_me:13205: result: $gnat_exists" >&5
13206 echo "${ECHO_T}$gnat_exists" >&6
13207 else
13208   echo "$as_me:13208: result: no" >&5
13209 echo "${ECHO_T}no" >&6
13210 fi
13211
13212 if test "$ac_cv_prog_gnat_exists" = no; then
13213         cf_ada_make=
13214         cf_cv_prog_gnat_correct=no
13215 else
13216
13217 echo "$as_me:13217: checking for gnat version" >&5
13218 echo $ECHO_N "checking for gnat version... $ECHO_C" >&6
13219 cf_gnat_version=`${cf_ada_make:-gnatmake} -v 2>&1 | \
13220         grep '[0-9].[0-9][0-9]*' |\
13221         sed -e '2,$d' -e 's/[^0-9 \.]//g' -e 's/^[ ]*//' -e 's/ .*//'`
13222 echo "$as_me:13222: result: $cf_gnat_version" >&5
13223 echo "${ECHO_T}$cf_gnat_version" >&6
13224
13225 case $cf_gnat_version in
13226 (3.1[1-9]*|3.[2-9]*|[4-9].*|20[0-9][0-9])
13227         cf_cv_prog_gnat_correct=yes
13228         ;;
13229 (*)
13230         { echo "$as_me:13230: WARNING: Unsupported GNAT version $cf_gnat_version. We require 3.11 or better. Disabling Ada95 binding." >&5
13231 echo "$as_me: WARNING: Unsupported GNAT version $cf_gnat_version. We require 3.11 or better. Disabling Ada95 binding." >&2;}
13232         cf_cv_prog_gnat_correct=no
13233         ;;
13234 esac
13235
13236         # Extract the first word of "m4", so it can be a program name with args.
13237 set dummy m4; ac_word=$2
13238 echo "$as_me:13238: checking for $ac_word" >&5
13239 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
13240 if test "${ac_cv_prog_M4_exists+set}" = set; then
13241   echo $ECHO_N "(cached) $ECHO_C" >&6
13242 else
13243   if test -n "$M4_exists"; then
13244   ac_cv_prog_M4_exists="$M4_exists" # Let the user override the test.
13245 else
13246   ac_save_IFS=$IFS; IFS=$ac_path_separator
13247 ac_dummy="$PATH"
13248 for ac_dir in $ac_dummy; do
13249   IFS=$ac_save_IFS
13250   test -z "$ac_dir" && ac_dir=.
13251   $as_executable_p "$ac_dir/$ac_word" || continue
13252 ac_cv_prog_M4_exists="yes"
13253 echo "$as_me:13253: found $ac_dir/$ac_word" >&5
13254 break
13255 done
13256
13257   test -z "$ac_cv_prog_M4_exists" && ac_cv_prog_M4_exists="no"
13258 fi
13259 fi
13260 M4_exists=$ac_cv_prog_M4_exists
13261 if test -n "$M4_exists"; then
13262   echo "$as_me:13262: result: $M4_exists" >&5
13263 echo "${ECHO_T}$M4_exists" >&6
13264 else
13265   echo "$as_me:13265: result: no" >&5
13266 echo "${ECHO_T}no" >&6
13267 fi
13268
13269         if test "$ac_cv_prog_M4_exists" = no; then
13270                 cf_cv_prog_gnat_correct=no
13271                 echo Ada95 binding required program m4 not found. Ada95 binding disabled.
13272         fi
13273         if test "$cf_cv_prog_gnat_correct" = yes; then
13274                 echo "$as_me:13274: checking if GNAT works" >&5
13275 echo $ECHO_N "checking if GNAT works... $ECHO_C" >&6
13276
13277 rm -rf conftest* *~conftest*
13278 cat >>conftest.ads <<CF_EOF
13279 procedure conftest;
13280 CF_EOF
13281 cat >>conftest.adb <<CF_EOF
13282 with Text_IO;
13283 with GNAT.OS_Lib;
13284 procedure conftest is
13285 begin
13286    Text_IO.Put ("Hello World");
13287    Text_IO.New_Line;
13288    GNAT.OS_Lib.OS_Exit (0);
13289 end conftest;
13290 CF_EOF
13291 if ( $cf_ada_make $ADAFLAGS conftest 1>&5 2>&1 ) ; then
13292    if ( ./conftest 1>&5 2>&1 ) ; then
13293       cf_cv_prog_gnat_correct=yes
13294    else
13295       cf_cv_prog_gnat_correct=no
13296    fi
13297 else
13298    cf_cv_prog_gnat_correct=no
13299 fi
13300 rm -rf conftest* *~conftest*
13301
13302                 echo "$as_me:13302: result: $cf_cv_prog_gnat_correct" >&5
13303 echo "${ECHO_T}$cf_cv_prog_gnat_correct" >&6
13304         fi
13305 fi
13306
13307         if test "$cf_cv_prog_gnat_correct" = yes; then
13308
13309         echo "$as_me:13309: checking optimization options for ADAFLAGS" >&5
13310 echo $ECHO_N "checking optimization options for ADAFLAGS... $ECHO_C" >&6
13311         case "$CFLAGS" in
13312         (*-g*)
13313
13314         ADAFLAGS="$ADAFLAGS -g"
13315
13316                 ;;
13317         esac
13318         case "$CFLAGS" in
13319         (*-O*)
13320                 cf_O_flag=`echo "$CFLAGS" |sed -e 's/^.*-O/-O/' -e 's/[         ].*//'`
13321
13322         ADAFLAGS="$ADAFLAGS $cf_O_flag"
13323
13324                 ;;
13325         esac
13326         echo "$as_me:13326: result: $ADAFLAGS" >&5
13327 echo "${ECHO_T}$ADAFLAGS" >&6
13328
13329 echo "$as_me:13329: checking if GNATPREP supports -T option" >&5
13330 echo $ECHO_N "checking if GNATPREP supports -T option... $ECHO_C" >&6
13331 if test "${cf_cv_gnatprep_opt_t+set}" = set; then
13332   echo $ECHO_N "(cached) $ECHO_C" >&6
13333 else
13334
13335 cf_cv_gnatprep_opt_t=no
13336 gnatprep -T 2>/dev/null >/dev/null && cf_cv_gnatprep_opt_t=yes
13337
13338 fi
13339 echo "$as_me:13339: result: $cf_cv_gnatprep_opt_t" >&5
13340 echo "${ECHO_T}$cf_cv_gnatprep_opt_t" >&6
13341 test "$cf_cv_gnatprep_opt_t" = yes && GNATPREP_OPTS="-T $GNATPREP_OPTS"
13342
13343 echo "$as_me:13343: checking if GNAT supports generics" >&5
13344 echo $ECHO_N "checking if GNAT supports generics... $ECHO_C" >&6
13345 case $cf_gnat_version in
13346 (3.[1-9]*|[4-9].*)
13347         cf_gnat_generics=yes
13348         ;;
13349 (*)
13350         cf_gnat_generics=no
13351         ;;
13352 esac
13353 echo "$as_me:13353: result: $cf_gnat_generics" >&5
13354 echo "${ECHO_T}$cf_gnat_generics" >&6
13355
13356 if test "$cf_gnat_generics" = yes
13357 then
13358         cf_compile_generics=generics
13359         cf_generic_objects="\${GENOBJS}"
13360 else
13361         cf_compile_generics=
13362         cf_generic_objects=
13363 fi
13364
13365 echo "$as_me:13365: checking if GNAT supports SIGINT" >&5
13366 echo $ECHO_N "checking if GNAT supports SIGINT... $ECHO_C" >&6
13367 if test "${cf_cv_gnat_sigint+set}" = set; then
13368   echo $ECHO_N "(cached) $ECHO_C" >&6
13369 else
13370
13371 rm -rf conftest* *~conftest*
13372 cat >>conftest.ads <<CF_EOF
13373 with Ada.Interrupts.Names;
13374
13375 package ConfTest is
13376
13377    pragma Warnings (Off);  --  the next pragma exists since 3.11p
13378    pragma Unreserve_All_Interrupts;
13379    pragma Warnings (On);
13380
13381    protected Process is
13382       procedure Stop;
13383       function Continue return Boolean;
13384       pragma Attach_Handler (Stop, Ada.Interrupts.Names.SIGINT);
13385    private
13386       Done : Boolean := False;
13387    end Process;
13388
13389 end ConfTest;
13390 CF_EOF
13391 cat >>conftest.adb <<CF_EOF
13392 package body ConfTest is
13393    protected body Process is
13394       procedure Stop is
13395       begin
13396          Done := True;
13397       end Stop;
13398       function Continue return Boolean is
13399       begin
13400          return not Done;
13401       end Continue;
13402    end Process;
13403 end ConfTest;
13404 CF_EOF
13405 if ( $cf_ada_make $ADAFLAGS conftest 1>&5 2>&1 ) ; then
13406       cf_cv_gnat_sigint=yes
13407 else
13408    cf_cv_gnat_sigint=no
13409 fi
13410 rm -rf conftest* *~conftest*
13411
13412 fi
13413 echo "$as_me:13413: result: $cf_cv_gnat_sigint" >&5
13414 echo "${ECHO_T}$cf_cv_gnat_sigint" >&6
13415
13416 if test $cf_cv_gnat_sigint = yes ; then
13417         USE_GNAT_SIGINT=""
13418 else
13419         USE_GNAT_SIGINT="#"
13420 fi
13421
13422 cf_gnat_libraries=no
13423 cf_gnat_projects=no
13424
13425 if test "$enable_gnat_projects" != no ; then
13426 echo "$as_me:13426: checking if GNAT supports project files" >&5
13427 echo $ECHO_N "checking if GNAT supports project files... $ECHO_C" >&6
13428 case $cf_gnat_version in
13429 (3.[0-9]*)
13430         ;;
13431 (*)
13432         case $cf_cv_system_name in
13433         (cygwin*|msys*)
13434                 ;;
13435         (*)
13436                 mkdir conftest.src conftest.bin conftest.lib
13437                 cd conftest.src
13438                 rm -rf conftest* *~conftest*
13439                 cat >>library.gpr <<CF_EOF
13440 project Library is
13441   Kind := External ("LIB_KIND");
13442   for Library_Name use "ConfTest";
13443   for Object_Dir use ".";
13444   for Library_ALI_Dir use External("LIBRARY_DIR");
13445   for Library_Version use External ("SONAME");
13446   for Library_Kind use Kind;
13447   for Library_Dir use External("BUILD_DIR");
13448   Source_Dir := External ("SOURCE_DIR");
13449   for Source_Dirs use (Source_Dir);
13450 end Library;
13451 CF_EOF
13452                 cat >>confpackage.ads <<CF_EOF
13453 package ConfPackage is
13454    procedure conftest;
13455 end ConfPackage;
13456 CF_EOF
13457                 cat >>confpackage.adb <<CF_EOF
13458 with Text_IO;
13459 package body ConfPackage is
13460    procedure conftest is
13461    begin
13462       Text_IO.Put ("Hello World");
13463       Text_IO.New_Line;
13464    end conftest;
13465 end ConfPackage;
13466 CF_EOF
13467                 if ( $cf_ada_make $ADAFLAGS \
13468                                 -Plibrary.gpr \
13469                                 -XBUILD_DIR=`cd ../conftest.bin;pwd` \
13470                                 -XLIBRARY_DIR=`cd ../conftest.lib;pwd` \
13471                                 -XSOURCE_DIR=`pwd` \
13472                                 -XSONAME=libConfTest.so.1 \
13473                                 -XLIB_KIND=static 1>&5 2>&1 ) ; then
13474                         cf_gnat_projects=yes
13475                 fi
13476                 cd ..
13477                 if test -f conftest.lib/confpackage.ali
13478                 then
13479                         cf_gnat_libraries=yes
13480                 fi
13481                 rm -rf conftest* *~conftest*
13482                 ;;
13483         esac
13484         ;;
13485 esac
13486 echo "$as_me:13486: result: $cf_gnat_projects" >&5
13487 echo "${ECHO_T}$cf_gnat_projects" >&6
13488 fi # enable_gnat_projects
13489
13490 if test $cf_gnat_projects = yes
13491 then
13492         echo "$as_me:13492: checking if GNAT supports libraries" >&5
13493 echo $ECHO_N "checking if GNAT supports libraries... $ECHO_C" >&6
13494         echo "$as_me:13494: result: $cf_gnat_libraries" >&5
13495 echo "${ECHO_T}$cf_gnat_libraries" >&6
13496 fi
13497
13498 if test "$cf_gnat_projects" = yes
13499 then
13500         USE_OLD_MAKERULES="#"
13501         USE_GNAT_PROJECTS=""
13502 else
13503         USE_OLD_MAKERULES=""
13504         USE_GNAT_PROJECTS="#"
13505 fi
13506
13507 if test "$cf_gnat_libraries" = yes
13508 then
13509         USE_GNAT_LIBRARIES=""
13510 else
13511         USE_GNAT_LIBRARIES="#"
13512 fi
13513
13514 echo "$as_me:13514: checking for ada-compiler" >&5
13515 echo $ECHO_N "checking for ada-compiler... $ECHO_C" >&6
13516
13517 # Check whether --with-ada-compiler or --without-ada-compiler was given.
13518 if test "${with_ada_compiler+set}" = set; then
13519   withval="$with_ada_compiler"
13520   cf_ada_compiler=$withval
13521 else
13522   cf_ada_compiler=gnatmake
13523 fi;
13524
13525 echo "$as_me:13525: result: $cf_ada_compiler" >&5
13526 echo "${ECHO_T}$cf_ada_compiler" >&6
13527
13528                 cf_ada_package=terminal_interface
13529
13530 echo "$as_me:13530: checking for ada-include" >&5
13531 echo $ECHO_N "checking for ada-include... $ECHO_C" >&6
13532
13533 # Check whether --with-ada-include or --without-ada-include was given.
13534 if test "${with_ada_include+set}" = set; then
13535   withval="$with_ada_include"
13536
13537 else
13538   withval="${ADA_INCLUDE:-$prefix/share/ada/adainclude}"
13539 fi; if test -n "$prefix/share/ada/adainclude" ; then
13540
13541 if test "x$prefix" != xNONE; then
13542         cf_path_syntax="$prefix"
13543 else
13544         cf_path_syntax="$ac_default_prefix"
13545 fi
13546
13547 case ".$withval" in
13548 (.\$\(*\)*|.\'*\'*)
13549         ;;
13550 (..|./*|.\\*)
13551         ;;
13552 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
13553         ;;
13554 (.\${*prefix}*|.\${*dir}*)
13555         eval withval="$withval"
13556         case ".$withval" in
13557         (.NONE/*)
13558                 withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
13559                 ;;
13560         esac
13561         ;;
13562 (.no|.NONE/*)
13563         withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
13564         ;;
13565 (*)
13566         { { echo "$as_me:13566: error: expected a pathname, not \"$withval\"" >&5
13567 echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;}
13568    { (exit 1); exit 1; }; }
13569         ;;
13570 esac
13571
13572 fi
13573 eval ADA_INCLUDE="$withval"
13574
13575 echo "$as_me:13575: result: $ADA_INCLUDE" >&5
13576 echo "${ECHO_T}$ADA_INCLUDE" >&6
13577
13578 echo "$as_me:13578: checking for ada-objects" >&5
13579 echo $ECHO_N "checking for ada-objects... $ECHO_C" >&6
13580
13581 # Check whether --with-ada-objects or --without-ada-objects was given.
13582 if test "${with_ada_objects+set}" = set; then
13583   withval="$with_ada_objects"
13584
13585 else
13586   withval="${ADA_OBJECTS:-$prefix/lib/ada/adalib}"
13587 fi; if test -n "$prefix/lib/ada/adalib" ; then
13588
13589 if test "x$prefix" != xNONE; then
13590         cf_path_syntax="$prefix"
13591 else
13592         cf_path_syntax="$ac_default_prefix"
13593 fi
13594
13595 case ".$withval" in
13596 (.\$\(*\)*|.\'*\'*)
13597         ;;
13598 (..|./*|.\\*)
13599         ;;
13600 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
13601         ;;
13602 (.\${*prefix}*|.\${*dir}*)
13603         eval withval="$withval"
13604         case ".$withval" in
13605         (.NONE/*)
13606                 withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
13607                 ;;
13608         esac
13609         ;;
13610 (.no|.NONE/*)
13611         withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
13612         ;;
13613 (*)
13614         { { echo "$as_me:13614: error: expected a pathname, not \"$withval\"" >&5
13615 echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;}
13616    { (exit 1); exit 1; }; }
13617         ;;
13618 esac
13619
13620 fi
13621 eval ADA_OBJECTS="$withval"
13622
13623 echo "$as_me:13623: result: $ADA_OBJECTS" >&5
13624 echo "${ECHO_T}$ADA_OBJECTS" >&6
13625
13626 echo "$as_me:13626: checking if an Ada95 shared-library should be built" >&5
13627 echo $ECHO_N "checking if an Ada95 shared-library should be built... $ECHO_C" >&6
13628
13629 # Check whether --with-ada-sharedlib or --without-ada-sharedlib was given.
13630 if test "${with_ada_sharedlib+set}" = set; then
13631   withval="$with_ada_sharedlib"
13632   with_ada_sharedlib=$withval
13633 else
13634   with_ada_sharedlib=no
13635 fi;
13636 echo "$as_me:13636: result: $with_ada_sharedlib" >&5
13637 echo "${ECHO_T}$with_ada_sharedlib" >&6
13638
13639 ADA_SHAREDLIB='lib$(LIB_NAME).so.1'
13640 MAKE_ADA_SHAREDLIB="#"
13641
13642 if test "x$with_ada_sharedlib" != xno
13643 then
13644         MAKE_ADA_SHAREDLIB=
13645         if test "x$with_ada_sharedlib" != xyes
13646         then
13647                 ADA_SHAREDLIB="$with_ada_sharedlib"
13648         fi
13649 fi
13650
13651         else
13652                 { { echo "$as_me:13652: error: No usable Ada compiler found" >&5
13653 echo "$as_me: error: No usable Ada compiler found" >&2;}
13654    { (exit 1); exit 1; }; }
13655         fi
13656 else
13657         { { echo "$as_me:13657: error: The Ada compiler is needed for this package" >&5
13658 echo "$as_me: error: The Ada compiler is needed for this package" >&2;}
13659    { (exit 1); exit 1; }; }
13660 fi
13661
13662 ################################################################################
13663
13664 # not needed
13665 TINFO_LDFLAGS2=
13666
13667 TINFO_LIBS=
13668
13669 ### Construct the list of include-directories to be generated
13670
13671 if test "$srcdir" != "."; then
13672         CPPFLAGS="-I\${srcdir}/../include $CPPFLAGS"
13673 fi
13674 CPPFLAGS="-I../include $CPPFLAGS"
13675 if test "$srcdir" != "."; then
13676         CPPFLAGS="-I\${srcdir} $CPPFLAGS"
13677 fi
13678 CPPFLAGS="-I. $CPPFLAGS"
13679
13680 ACPPFLAGS="-I. -I../include -I../../include $ACPPFLAGS"
13681 if test "$srcdir" != "."; then
13682         ACPPFLAGS="-I\${srcdir}/../../include $ACPPFLAGS"
13683 fi
13684 if test "$GCC" != yes; then
13685         ACPPFLAGS="$ACPPFLAGS -I\${includedir}"
13686 elif test "$includedir" != "/usr/include"; then
13687         if test "$includedir" = '${prefix}/include' ; then
13688                 if test x$prefix != x/usr ; then
13689                         ACPPFLAGS="$ACPPFLAGS -I\${includedir}"
13690                 fi
13691         else
13692                 ACPPFLAGS="$ACPPFLAGS -I\${includedir}"
13693         fi
13694 fi
13695
13696 ### Build up pieces for makefile rules
13697 echo "$as_me:13697: checking default library suffix" >&5
13698 echo $ECHO_N "checking default library suffix... $ECHO_C" >&6
13699
13700         case $DFT_LWR_MODEL in
13701         (libtool) DFT_ARG_SUFFIX=''   ;;
13702         (normal)  DFT_ARG_SUFFIX=''   ;;
13703         (debug)   DFT_ARG_SUFFIX='_g' ;;
13704         (profile) DFT_ARG_SUFFIX='_p' ;;
13705         (shared)  DFT_ARG_SUFFIX=''   ;;
13706         esac
13707         test -n "$LIB_SUFFIX" && DFT_ARG_SUFFIX="${LIB_SUFFIX}${DFT_ARG_SUFFIX}"
13708 echo "$as_me:13708: result: $DFT_ARG_SUFFIX" >&5
13709 echo "${ECHO_T}$DFT_ARG_SUFFIX" >&6
13710
13711 echo "$as_me:13711: checking default library-dependency suffix" >&5
13712 echo $ECHO_N "checking default library-dependency suffix... $ECHO_C" >&6
13713
13714         case X$DFT_LWR_MODEL in
13715         (Xlibtool)
13716                 DFT_LIB_SUFFIX='.la'
13717                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
13718                 ;;
13719         (Xdebug)
13720                 DFT_LIB_SUFFIX='_g.a'
13721                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
13722                 ;;
13723         (Xprofile)
13724                 DFT_LIB_SUFFIX='_p.a'
13725                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
13726                 ;;
13727         (Xshared)
13728                 case $cf_cv_system_name in
13729                 (aix[5-7]*)
13730                         DFT_LIB_SUFFIX='.so'
13731                         DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
13732                         ;;
13733                 (cygwin*|msys*|mingw*)
13734                         DFT_LIB_SUFFIX='.dll'
13735                         DFT_DEP_SUFFIX='.dll.a'
13736                         ;;
13737                 (darwin*)
13738                         DFT_LIB_SUFFIX='.dylib'
13739                         DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
13740                         ;;
13741                 (hpux*)
13742                         case $target in
13743                         (ia64*)
13744                                 DFT_LIB_SUFFIX='.so'
13745                                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
13746                                 ;;
13747                         (*)
13748                                 DFT_LIB_SUFFIX='.sl'
13749                                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
13750                                 ;;
13751                         esac
13752                         ;;
13753                 (*)
13754                         DFT_LIB_SUFFIX='.so'
13755                         DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
13756                         ;;
13757                 esac
13758                 ;;
13759         (*)
13760                 DFT_LIB_SUFFIX='.a'
13761                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
13762                 ;;
13763         esac
13764         if test -n "${LIB_SUFFIX}${EXTRA_SUFFIX}"
13765         then
13766                 DFT_LIB_SUFFIX="${LIB_SUFFIX}${EXTRA_SUFFIX}${DFT_LIB_SUFFIX}"
13767                 DFT_DEP_SUFFIX="${LIB_SUFFIX}${EXTRA_SUFFIX}${DFT_DEP_SUFFIX}"
13768         fi
13769 echo "$as_me:13769: result: $DFT_DEP_SUFFIX" >&5
13770 echo "${ECHO_T}$DFT_DEP_SUFFIX" >&6
13771
13772 echo "$as_me:13772: checking default object directory" >&5
13773 echo $ECHO_N "checking default object directory... $ECHO_C" >&6
13774
13775         case $DFT_LWR_MODEL in
13776         (libtool) DFT_OBJ_SUBDIR='obj_lo'  ;;
13777         (normal)  DFT_OBJ_SUBDIR='objects' ;;
13778         (debug)   DFT_OBJ_SUBDIR='obj_g' ;;
13779         (profile) DFT_OBJ_SUBDIR='obj_p' ;;
13780         (shared)
13781                 case $cf_cv_system_name in
13782                 (cygwin|msys)
13783                         DFT_OBJ_SUBDIR='objects' ;;
13784                 (*)
13785                         DFT_OBJ_SUBDIR='obj_s' ;;
13786                 esac
13787         esac
13788 echo "$as_me:13788: result: $DFT_OBJ_SUBDIR" >&5
13789 echo "${ECHO_T}$DFT_OBJ_SUBDIR" >&6
13790
13791 ### Set up low-level terminfo dependencies for makefiles.
13792
13793 if test "$DFT_LWR_MODEL" = shared ; then
13794         case $cf_cv_system_name in
13795         (cygwin*)
13796                 # "lib" files have ".dll.a" suffix, "cyg" files have ".dll"
13797                 ;;
13798         (msys*)
13799                 # "lib" files have ".dll.a" suffix, "msys-" files have ".dll"
13800                 ;;
13801         esac
13802 fi
13803
13804 USE_CFG_SUFFIX=${DFT_ARG_SUFFIX}
13805
13806 ### Construct the list of subdirectories for which we'll customize makefiles
13807 ### with the appropriate compile-rules.
13808
13809 SUB_MAKEFILES="gen/adacurses${USE_ARG_SUFFIX}-config:gen/adacurses-config.in"
13810
13811 cat >>confdefs.h <<EOF
13812 #define NCURSES_PATHSEP '$PATH_SEPARATOR'
13813 EOF
13814
13815 ### Now that we're done running tests, add the compiler-warnings, if any
13816
13817 cf_fix_cppflags=no
13818 cf_new_cflags=
13819 cf_new_cppflags=
13820 cf_new_extra_cppflags=
13821
13822 for cf_add_cflags in $EXTRA_CFLAGS
13823 do
13824 case $cf_fix_cppflags in
13825 (no)
13826         case $cf_add_cflags in
13827         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13828                 case $cf_add_cflags in
13829                 (-D*)
13830                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13831
13832                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13833                                 && test -z "${cf_tst_cflags}" \
13834                                 && cf_fix_cppflags=yes
13835
13836                         if test $cf_fix_cppflags = yes ; then
13837                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
13838                                 continue
13839                         elif test "${cf_tst_cflags}" = "\"'" ; then
13840                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
13841                                 continue
13842                         fi
13843                         ;;
13844                 esac
13845                 case "$CPPFLAGS" in
13846                 (*$cf_add_cflags)
13847                         ;;
13848                 (*)
13849                         case $cf_add_cflags in
13850                         (-D*)
13851                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13852
13853 CPPFLAGS=`echo "$CPPFLAGS" | \
13854         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13855                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13856
13857                                 ;;
13858                         esac
13859                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
13860                         ;;
13861                 esac
13862                 ;;
13863         (*)
13864                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
13865                 ;;
13866         esac
13867         ;;
13868 (yes)
13869         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
13870
13871         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
13872
13873         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13874                 && test -z "${cf_tst_cflags}" \
13875                 && cf_fix_cppflags=no
13876         ;;
13877 esac
13878 done
13879
13880 if test -n "$cf_new_cflags" ; then
13881
13882         CFLAGS="$CFLAGS $cf_new_cflags"
13883 fi
13884
13885 if test -n "$cf_new_cppflags" ; then
13886
13887         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
13888 fi
13889
13890 if test -n "$cf_new_extra_cppflags" ; then
13891
13892         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
13893 fi
13894
13895 ################################################################################
13896
13897 TEST_ARG2=
13898
13899 TEST_LIBS2=
13900
13901 NCURSES_SHLIB2="sh -c"
13902
13903 ADA_SUBDIRS="include gen src doc"
13904 if test "x$cf_with_tests" != "xno" ; then
13905         ADA_SUBDIRS="$ADA_SUBDIRS samples"
13906 fi
13907 for cf_dir in $ADA_SUBDIRS
13908 do
13909         SUB_MAKEFILES="$SUB_MAKEFILES $cf_dir/Makefile"
13910 done
13911
13912 NCURSES_TREE="#"
13913
13914 EXTERNAL_TREE=
13915
13916 # match layout used by make-tar.sh
13917 ADAHTML_DIR=../doc/ada
13918
13919 ac_config_files="$ac_config_files $SUB_MAKEFILES doc/adacurses${DFT_ARG_SUFFIX}-config.1:doc/MKada_config.in Makefile"
13920 ac_config_commands="$ac_config_commands default"
13921 cat >confcache <<\_ACEOF
13922 # This file is a shell script that caches the results of configure
13923 # tests run on this system so they can be shared between configure
13924 # scripts and configure runs, see configure's option --config-cache.
13925 # It is not useful on other systems.  If it contains results you don't
13926 # want to keep, you may remove or edit it.
13927 #
13928 # config.status only pays attention to the cache file if you give it
13929 # the --recheck option to rerun configure.
13930 #
13931 # `ac_cv_env_foo' variables (set or unset) will be overriden when
13932 # loading this file, other *unset* `ac_cv_foo' will be assigned the
13933 # following values.
13934
13935 _ACEOF
13936
13937 # The following way of writing the cache mishandles newlines in values,
13938 # but we know of no workaround that is simple, portable, and efficient.
13939 # So, don't put newlines in cache variables' values.
13940 # Ultrix sh set writes to stderr and can't be redirected directly,
13941 # and sets the high bit in the cache file unless we assign to the vars.
13942 {
13943   (set) 2>&1 |
13944     case `(ac_space=' '; set | grep ac_space) 2>&1` in
13945     *ac_space=\ *)
13946       # `set' does not quote correctly, so add quotes (double-quote
13947       # substitution turns \\\\ into \\, and sed turns \\ into \).
13948       sed -n \
13949         "s/'/'\\\\''/g;
13950           s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
13951       ;;
13952     *)
13953       # `set' quotes correctly as required by POSIX, so do not add quotes.
13954       sed -n \
13955         "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
13956       ;;
13957     esac;
13958 } |
13959   sed '
13960      t clear
13961      : clear
13962      s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
13963      t end
13964      /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
13965      : end' >>confcache
13966 if cmp -s $cache_file confcache; then :; else
13967   if test -w $cache_file; then
13968     test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file"
13969     cat confcache >$cache_file
13970   else
13971     echo "not updating unwritable cache $cache_file"
13972   fi
13973 fi
13974 rm -f confcache
13975
13976 test "x$prefix" = xNONE && prefix=$ac_default_prefix
13977 # Let make expand exec_prefix.
13978 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
13979
13980 # VPATH may cause trouble with some makes, so we remove $(srcdir),
13981 # ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
13982 # trailing colons and then remove the whole line if VPATH becomes empty
13983 # (actually we leave an empty line to preserve line numbers).
13984 if test "x$srcdir" = x.; then
13985   ac_vpsub='/^[         ]*VPATH[        ]*=/{
13986 s/:*\$(srcdir):*/:/;
13987 s/:*\${srcdir}:*/:/;
13988 s/:*@srcdir@:*/:/;
13989 s/^\([^=]*=[    ]*\):*/\1/;
13990 s/:*$//;
13991 s/^[^=]*=[      ]*$//;
13992 }'
13993 fi
13994
13995 DEFS=-DHAVE_CONFIG_H
13996
13997 : ${CONFIG_STATUS=./config.status}
13998 ac_clean_files_save=$ac_clean_files
13999 ac_clean_files="$ac_clean_files $CONFIG_STATUS"
14000 { echo "$as_me:14000: creating $CONFIG_STATUS" >&5
14001 echo "$as_me: creating $CONFIG_STATUS" >&6;}
14002 cat >$CONFIG_STATUS <<_ACEOF
14003 #! $SHELL
14004 # Generated automatically by configure.
14005 # Run this file to recreate the current configuration.
14006 # Compiler output produced by configure, useful for debugging
14007 # configure, is in config.log if it exists.
14008
14009 debug=false
14010 SHELL=\${CONFIG_SHELL-$SHELL}
14011 ac_cs_invocation="\$0 \$@"
14012
14013 _ACEOF
14014
14015 cat >>$CONFIG_STATUS <<\_ACEOF
14016 # Be Bourne compatible
14017 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
14018   emulate sh
14019   NULLCMD=:
14020 elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
14021   set -o posix
14022 fi
14023
14024 # Name of the executable.
14025 as_me=`echo "$0" |sed 's,.*[\\/],,'`
14026
14027 if expr a : '\(a\)' >/dev/null 2>&1; then
14028   as_expr=expr
14029 else
14030   as_expr=false
14031 fi
14032
14033 rm -f conf$$ conf$$.exe conf$$.file
14034 echo >conf$$.file
14035 if ln -s conf$$.file conf$$ 2>/dev/null; then
14036   # We could just check for DJGPP; but this test a) works b) is more generic
14037   # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
14038   if test -f conf$$.exe; then
14039     # Don't use ln at all; we don't have any links
14040     as_ln_s='cp -p'
14041   else
14042     as_ln_s='ln -s'
14043   fi
14044 elif ln conf$$.file conf$$ 2>/dev/null; then
14045   as_ln_s=ln
14046 else
14047   as_ln_s='cp -p'
14048 fi
14049 rm -f conf$$ conf$$.exe conf$$.file
14050
14051 as_executable_p="test -f"
14052
14053 # Support unset when possible.
14054 if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
14055   as_unset=unset
14056 else
14057   as_unset=false
14058 fi
14059
14060 # NLS nuisances.
14061 $as_unset LANG || test "${LANG+set}" != set || { LANG=C; export LANG; }
14062 $as_unset LC_ALL || test "${LC_ALL+set}" != set || { LC_ALL=C; export LC_ALL; }
14063 $as_unset LC_TIME || test "${LC_TIME+set}" != set || { LC_TIME=C; export LC_TIME; }
14064 $as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set || { LC_CTYPE=C; export LC_CTYPE; }
14065 $as_unset LANGUAGE || test "${LANGUAGE+set}" != set || { LANGUAGE=C; export LANGUAGE; }
14066 $as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set || { LC_COLLATE=C; export LC_COLLATE; }
14067 $as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set || { LC_NUMERIC=C; export LC_NUMERIC; }
14068 $as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set || { LC_MESSAGES=C; export LC_MESSAGES; }
14069
14070 # IFS
14071 # We need space, tab and new line, in precisely that order.
14072 as_nl='
14073 '
14074 IFS="   $as_nl"
14075
14076 # CDPATH.
14077 $as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=:; export CDPATH; }
14078
14079 exec 6>&1
14080
14081 _ACEOF
14082
14083 # Files that config.status was made for.
14084 if test -n "$ac_config_files"; then
14085   echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS
14086 fi
14087
14088 if test -n "$ac_config_headers"; then
14089   echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS
14090 fi
14091
14092 if test -n "$ac_config_links"; then
14093   echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS
14094 fi
14095
14096 if test -n "$ac_config_commands"; then
14097   echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS
14098 fi
14099
14100 cat >>$CONFIG_STATUS <<\EOF
14101
14102 ac_cs_usage="\
14103 \`$as_me' instantiates files from templates according to the
14104 current configuration.
14105
14106 Usage: $0 [OPTIONS] [FILE]...
14107
14108   -h, --help       print this help, then exit
14109   -V, --version    print version number, then exit
14110   -d, --debug      don't remove temporary files
14111       --recheck    update $as_me by reconfiguring in the same conditions
14112   --file=FILE[:TEMPLATE]
14113                    instantiate the configuration file FILE
14114   --header=FILE[:TEMPLATE]
14115                    instantiate the configuration header FILE
14116
14117 Configuration files:
14118 $config_files
14119
14120 Configuration headers:
14121 $config_headers
14122
14123 Configuration commands:
14124 $config_commands
14125
14126 Report bugs to <dickey@invisible-island.net>."
14127 EOF
14128
14129 cat >>$CONFIG_STATUS <<EOF
14130 ac_cs_version="\\
14131 config.status
14132 configured by $0, generated by GNU Autoconf 2.52.20141204,
14133   with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
14134
14135 Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
14136 Free Software Foundation, Inc.
14137 This config.status script is free software; the Free Software Foundation
14138 gives unlimited permission to copy, distribute and modify it."
14139 srcdir=$srcdir
14140 INSTALL="$INSTALL"
14141 EOF
14142
14143 cat >>$CONFIG_STATUS <<\EOF
14144 # If no file are specified by the user, then we need to provide default
14145 # value.  By we need to know if files were specified by the user.
14146 ac_need_defaults=:
14147 while test $# != 0
14148 do
14149   case $1 in
14150   --*=*)
14151     ac_option=`expr "x$1" : 'x\([^=]*\)='`
14152     ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'`
14153     shift
14154     set dummy "$ac_option" "$ac_optarg" ${1+"$@"}
14155     shift
14156     ;;
14157   -*);;
14158   *) # This is not an option, so the user has probably given explicit
14159      # arguments.
14160      ac_need_defaults=false;;
14161   esac
14162
14163   case $1 in
14164   # Handling of the options.
14165 EOF
14166 cat >>$CONFIG_STATUS <<EOF
14167   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
14168     echo "running $SHELL $0 " $ac_configure_args " --no-create --no-recursion"
14169     exec $SHELL $0 $ac_configure_args --no-create --no-recursion ;;
14170 EOF
14171 cat >>$CONFIG_STATUS <<\EOF
14172   --version | --vers* | -V )
14173     echo "$ac_cs_version"; exit 0 ;;
14174   --he | --h)
14175     # Conflict between --help and --header
14176     { { echo "$as_me:14176: error: ambiguous option: $1
14177 Try \`$0 --help' for more information." >&5
14178 echo "$as_me: error: ambiguous option: $1
14179 Try \`$0 --help' for more information." >&2;}
14180    { (exit 1); exit 1; }; };;
14181   --help | --hel | -h )
14182     echo "$ac_cs_usage"; exit 0 ;;
14183   --debug | --d* | -d )
14184     debug=: ;;
14185   --file | --fil | --fi | --f )
14186     shift
14187     CONFIG_FILES="$CONFIG_FILES $1"
14188     ac_need_defaults=false;;
14189   --header | --heade | --head | --hea )
14190     shift
14191     CONFIG_HEADERS="$CONFIG_HEADERS $1"
14192     ac_need_defaults=false;;
14193
14194   # This is an error.
14195   -*) { { echo "$as_me:14195: error: unrecognized option: $1
14196 Try \`$0 --help' for more information." >&5
14197 echo "$as_me: error: unrecognized option: $1
14198 Try \`$0 --help' for more information." >&2;}
14199    { (exit 1); exit 1; }; } ;;
14200
14201   *) ac_config_targets="$ac_config_targets $1" ;;
14202
14203   esac
14204   shift
14205 done
14206
14207 exec 5>>config.log
14208 cat >&5 << _ACEOF
14209
14210 ## ----------------------- ##
14211 ## Running config.status.  ##
14212 ## ----------------------- ##
14213
14214 This file was extended by $as_me 2.52.20141204, executed with
14215   CONFIG_FILES    = $CONFIG_FILES
14216   CONFIG_HEADERS  = $CONFIG_HEADERS
14217   CONFIG_LINKS    = $CONFIG_LINKS
14218   CONFIG_COMMANDS = $CONFIG_COMMANDS
14219   > $ac_cs_invocation
14220 on `(hostname || uname -n) 2>/dev/null | sed 1q`
14221
14222 _ACEOF
14223 EOF
14224
14225 cat >>$CONFIG_STATUS <<EOF
14226 #
14227 # INIT-COMMANDS section.
14228 #
14229
14230 ### Special initialization commands, used to pass information from the
14231 ### configuration-run into config.status
14232
14233 AWK="$AWK"
14234 DFT_ARG_SUFFIX="$DFT_ARG_SUFFIX"
14235 DFT_LWR_MODEL="$DFT_LWR_MODEL"
14236 LIB_NAME="$LIB_NAME"
14237 LIB_PREFIX="$LIB_PREFIX"
14238 LIB_SUFFIX="$LIB_SUFFIX"
14239 LN_S="$LN_S"
14240 NCURSES_MAJOR="$NCURSES_MAJOR"
14241 NCURSES_MINOR="$NCURSES_MINOR"
14242 NCURSES_PATCH="$NCURSES_PATCH"
14243 USE_OLD_MAKERULES="$USE_OLD_MAKERULES"
14244 cf_cv_abi_version="$cf_cv_abi_version"
14245 cf_cv_rel_version="$cf_cv_rel_version"
14246 cf_cv_rm_so_locs="$cf_cv_rm_so_locs"
14247 cf_cv_shared_soname='$cf_cv_shared_soname'
14248 cf_cv_shlib_version="$cf_cv_shlib_version"
14249 cf_cv_shlib_version_infix="$cf_cv_shlib_version_infix"
14250 cf_cv_system_name="$cf_cv_system_name"
14251 host="$host"
14252 target="$target"
14253
14254 EOF
14255
14256 cat >>$CONFIG_STATUS <<\EOF
14257 for ac_config_target in $ac_config_targets
14258 do
14259   case "$ac_config_target" in
14260   # Handling of arguments.
14261   "$SUB_MAKEFILES" ) CONFIG_FILES="$CONFIG_FILES $SUB_MAKEFILES" ;;
14262   "doc/adacurses${DFT_ARG_SUFFIX}-config.1" ) CONFIG_FILES="$CONFIG_FILES doc/adacurses${DFT_ARG_SUFFIX}-config.1:doc/MKada_config.in" ;;
14263   "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;;
14264   "default" ) CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;;
14265   "include/ncurses_cfg.h" ) CONFIG_HEADERS="$CONFIG_HEADERS include/ncurses_cfg.h:include/ncurses_cfg.hin" ;;
14266   *) { { echo "$as_me:14266: error: invalid argument: $ac_config_target" >&5
14267 echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
14268    { (exit 1); exit 1; }; };;
14269   esac
14270 done
14271
14272 # If the user did not use the arguments to specify the items to instantiate,
14273 # then the envvar interface is used.  Set only those that are not.
14274 # We use the long form for the default assignment because of an extremely
14275 # bizarre bug on SunOS 4.1.3.
14276 if $ac_need_defaults; then
14277   test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
14278   test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
14279   test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
14280 fi
14281
14282 # Create a temporary directory, and hook for its removal unless debugging.
14283 $debug ||
14284 {
14285   trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0
14286   trap '{ (exit 1); exit 1; }' 1 2 13 15
14287 }
14288
14289 # Create a (secure) tmp directory for tmp files.
14290 : ${TMPDIR=/tmp}
14291 {
14292   tmp=`(umask 077 && mktemp -d -q "$TMPDIR/csXXXXXX") 2>/dev/null` &&
14293   test -n "$tmp" && test -d "$tmp"
14294 }  ||
14295 {
14296   tmp=$TMPDIR/cs$$-$RANDOM
14297   (umask 077 && mkdir $tmp)
14298 } ||
14299 {
14300    echo "$me: cannot create a temporary directory in $TMPDIR" >&2
14301    { (exit 1); exit 1; }
14302 }
14303
14304 EOF
14305
14306 cat >>$CONFIG_STATUS <<EOF
14307
14308 #
14309 # CONFIG_FILES section.
14310 #
14311
14312 # No need to generate the scripts if there are no CONFIG_FILES.
14313 # This happens for instance when ./config.status config.h
14314 if test -n "\$CONFIG_FILES"; then
14315   # Protect against being on the right side of a sed subst in config.status.
14316   sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g;
14317    s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF
14318 s,@SHELL@,$SHELL,;t t
14319 s,@exec_prefix@,$exec_prefix,;t t
14320 s,@prefix@,$prefix,;t t
14321 s,@program_transform_name@,$program_transform_name,;t t
14322 s,@bindir@,$bindir,;t t
14323 s,@sbindir@,$sbindir,;t t
14324 s,@libexecdir@,$libexecdir,;t t
14325 s,@datarootdir@,$datarootdir,;t t
14326 s,@datadir@,$datadir,;t t
14327 s,@sysconfdir@,$sysconfdir,;t t
14328 s,@sharedstatedir@,$sharedstatedir,;t t
14329 s,@localstatedir@,$localstatedir,;t t
14330 s,@libdir@,$libdir,;t t
14331 s,@includedir@,$includedir,;t t
14332 s,@oldincludedir@,$oldincludedir,;t t
14333 s,@infodir@,$infodir,;t t
14334 s,@mandir@,$mandir,;t t
14335 s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t
14336 s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t
14337 s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t
14338 s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t
14339 s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t
14340 s,@build_alias@,$build_alias,;t t
14341 s,@host_alias@,$host_alias,;t t
14342 s,@target_alias@,$target_alias,;t t
14343 s,@ECHO_C@,$ECHO_C,;t t
14344 s,@ECHO_N@,$ECHO_N,;t t
14345 s,@ECHO_T@,$ECHO_T,;t t
14346 s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t
14347 s,@DEFS@,$DEFS,;t t
14348 s,@LIBS@,$LIBS,;t t
14349 s,@top_builddir@,$top_builddir,;t t
14350 s,@build@,$build,;t t
14351 s,@build_cpu@,$build_cpu,;t t
14352 s,@build_vendor@,$build_vendor,;t t
14353 s,@build_os@,$build_os,;t t
14354 s,@host@,$host,;t t
14355 s,@host_cpu@,$host_cpu,;t t
14356 s,@host_vendor@,$host_vendor,;t t
14357 s,@host_os@,$host_os,;t t
14358 s,@target@,$target,;t t
14359 s,@target_cpu@,$target_cpu,;t t
14360 s,@target_vendor@,$target_vendor,;t t
14361 s,@target_os@,$target_os,;t t
14362 s,@CC@,$CC,;t t
14363 s,@CFLAGS@,$CFLAGS,;t t
14364 s,@LDFLAGS@,$LDFLAGS,;t t
14365 s,@CPPFLAGS@,$CPPFLAGS,;t t
14366 s,@ac_ct_CC@,$ac_ct_CC,;t t
14367 s,@EXEEXT@,$EXEEXT,;t t
14368 s,@OBJEXT@,$OBJEXT,;t t
14369 s,@EXTRA_CPPFLAGS@,$EXTRA_CPPFLAGS,;t t
14370 s,@CPP@,$CPP,;t t
14371 s,@AWK@,$AWK,;t t
14372 s,@EGREP@,$EGREP,;t t
14373 s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t
14374 s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t
14375 s,@INSTALL_DATA@,$INSTALL_DATA,;t t
14376 s,@LN_S@,$LN_S,;t t
14377 s,@PKG_CONFIG@,$PKG_CONFIG,;t t
14378 s,@ac_pt_PKG_CONFIG@,$ac_pt_PKG_CONFIG,;t t
14379 s,@PKG_CONFIG_LIBDIR@,$PKG_CONFIG_LIBDIR,;t t
14380 s,@SET_MAKE@,$SET_MAKE,;t t
14381 s,@CTAGS@,$CTAGS,;t t
14382 s,@ETAGS@,$ETAGS,;t t
14383 s,@MAKE_LOWER_TAGS@,$MAKE_LOWER_TAGS,;t t
14384 s,@MAKE_UPPER_TAGS@,$MAKE_UPPER_TAGS,;t t
14385 s,@cf_cv_makeflags@,$cf_cv_makeflags,;t t
14386 s,@RANLIB@,$RANLIB,;t t
14387 s,@ac_ct_RANLIB@,$ac_ct_RANLIB,;t t
14388 s,@LD@,$LD,;t t
14389 s,@ac_ct_LD@,$ac_ct_LD,;t t
14390 s,@AR@,$AR,;t t
14391 s,@ac_ct_AR@,$ac_ct_AR,;t t
14392 s,@ARFLAGS@,$ARFLAGS,;t t
14393 s,@DESTDIR@,$DESTDIR,;t t
14394 s,@BUILD_CC@,$BUILD_CC,;t t
14395 s,@BUILD_CPP@,$BUILD_CPP,;t t
14396 s,@BUILD_CFLAGS@,$BUILD_CFLAGS,;t t
14397 s,@BUILD_CPPFLAGS@,$BUILD_CPPFLAGS,;t t
14398 s,@BUILD_LDFLAGS@,$BUILD_LDFLAGS,;t t
14399 s,@BUILD_LIBS@,$BUILD_LIBS,;t t
14400 s,@BUILD_EXEEXT@,$BUILD_EXEEXT,;t t
14401 s,@BUILD_OBJEXT@,$BUILD_OBJEXT,;t t
14402 s,@DFT_LWR_MODEL@,$DFT_LWR_MODEL,;t t
14403 s,@DFT_UPR_MODEL@,$DFT_UPR_MODEL,;t t
14404 s,@NCURSES_CONFIG@,$NCURSES_CONFIG,;t t
14405 s,@ac_ct_NCURSES_CONFIG@,$ac_ct_NCURSES_CONFIG,;t t
14406 s,@NCURSES_MAJOR@,$NCURSES_MAJOR,;t t
14407 s,@NCURSES_MINOR@,$NCURSES_MINOR,;t t
14408 s,@NCURSES_PATCH@,$NCURSES_PATCH,;t t
14409 s,@cf_cv_rel_version@,$cf_cv_rel_version,;t t
14410 s,@cf_cv_abi_version@,$cf_cv_abi_version,;t t
14411 s,@cf_cv_builtin_bool@,$cf_cv_builtin_bool,;t t
14412 s,@cf_cv_header_stdbool_h@,$cf_cv_header_stdbool_h,;t t
14413 s,@cf_cv_type_of_bool@,$cf_cv_type_of_bool,;t t
14414 s,@LIB_PREFIX@,$LIB_PREFIX,;t t
14415 s,@LIB_SUFFIX@,$LIB_SUFFIX,;t t
14416 s,@CC_G_OPT@,$CC_G_OPT,;t t
14417 s,@LD_MODEL@,$LD_MODEL,;t t
14418 s,@shlibdir@,$shlibdir,;t t
14419 s,@MAKE_DLLS@,$MAKE_DLLS,;t t
14420 s,@CC_SHARED_OPTS@,$CC_SHARED_OPTS,;t t
14421 s,@LD_RPATH_OPT@,$LD_RPATH_OPT,;t t
14422 s,@LD_SHARED_OPTS@,$LD_SHARED_OPTS,;t t
14423 s,@MK_SHARED_LIB@,$MK_SHARED_LIB,;t t
14424 s,@RM_SHARED_OPTS@,$RM_SHARED_OPTS,;t t
14425 s,@LINK_PROGS@,$LINK_PROGS,;t t
14426 s,@LINK_TESTS@,$LINK_TESTS,;t t
14427 s,@EXTRA_LDFLAGS@,$EXTRA_LDFLAGS,;t t
14428 s,@LOCAL_LDFLAGS@,$LOCAL_LDFLAGS,;t t
14429 s,@LOCAL_LDFLAGS2@,$LOCAL_LDFLAGS2,;t t
14430 s,@INSTALL_LIB@,$INSTALL_LIB,;t t
14431 s,@RPATH_LIST@,$RPATH_LIST,;t t
14432 s,@BROKEN_LINKER@,$BROKEN_LINKER,;t t
14433 s,@NCURSES_EXT_FUNCS@,$NCURSES_EXT_FUNCS,;t t
14434 s,@NCURSES_CONST@,$NCURSES_CONST,;t t
14435 s,@PTHREAD@,$PTHREAD,;t t
14436 s,@cf_cv_enable_reentrant@,$cf_cv_enable_reentrant,;t t
14437 s,@NCURSES_WRAP_PREFIX@,$NCURSES_WRAP_PREFIX,;t t
14438 s,@ECHO_LT@,$ECHO_LT,;t t
14439 s,@ECHO_LD@,$ECHO_LD,;t t
14440 s,@RULE_CC@,$RULE_CC,;t t
14441 s,@SHOW_CC@,$SHOW_CC,;t t
14442 s,@ECHO_CC@,$ECHO_CC,;t t
14443 s,@ADAFLAGS@,$ADAFLAGS,;t t
14444 s,@EXTRA_CFLAGS@,$EXTRA_CFLAGS,;t t
14445 s,@ADA_TRACE@,$ADA_TRACE,;t t
14446 s,@gnat_exists@,$gnat_exists,;t t
14447 s,@M4_exists@,$M4_exists,;t t
14448 s,@cf_ada_make@,$cf_ada_make,;t t
14449 s,@GNATPREP_OPTS@,$GNATPREP_OPTS,;t t
14450 s,@cf_compile_generics@,$cf_compile_generics,;t t
14451 s,@cf_generic_objects@,$cf_generic_objects,;t t
14452 s,@USE_GNAT_SIGINT@,$USE_GNAT_SIGINT,;t t
14453 s,@USE_OLD_MAKERULES@,$USE_OLD_MAKERULES,;t t
14454 s,@USE_GNAT_PROJECTS@,$USE_GNAT_PROJECTS,;t t
14455 s,@USE_GNAT_LIBRARIES@,$USE_GNAT_LIBRARIES,;t t
14456 s,@cf_ada_compiler@,$cf_ada_compiler,;t t
14457 s,@cf_ada_package@,$cf_ada_package,;t t
14458 s,@ADA_INCLUDE@,$ADA_INCLUDE,;t t
14459 s,@ADA_OBJECTS@,$ADA_OBJECTS,;t t
14460 s,@ADA_SHAREDLIB@,$ADA_SHAREDLIB,;t t
14461 s,@MAKE_ADA_SHAREDLIB@,$MAKE_ADA_SHAREDLIB,;t t
14462 s,@TINFO_LDFLAGS2@,$TINFO_LDFLAGS2,;t t
14463 s,@TINFO_LIBS@,$TINFO_LIBS,;t t
14464 s,@ACPPFLAGS@,$ACPPFLAGS,;t t
14465 s,@DFT_ARG_SUFFIX@,$DFT_ARG_SUFFIX,;t t
14466 s,@DFT_DEP_SUFFIX@,$DFT_DEP_SUFFIX,;t t
14467 s,@DFT_OBJ_SUBDIR@,$DFT_OBJ_SUBDIR,;t t
14468 s,@USE_CFG_SUFFIX@,$USE_CFG_SUFFIX,;t t
14469 s,@TEST_ARG2@,$TEST_ARG2,;t t
14470 s,@TEST_LIBS2@,$TEST_LIBS2,;t t
14471 s,@NCURSES_SHLIB2@,$NCURSES_SHLIB2,;t t
14472 s,@ADA_SUBDIRS@,$ADA_SUBDIRS,;t t
14473 s,@NCURSES_TREE@,$NCURSES_TREE,;t t
14474 s,@EXTERNAL_TREE@,$EXTERNAL_TREE,;t t
14475 s,@ADAHTML_DIR@,$ADAHTML_DIR,;t t
14476 CEOF
14477
14478 EOF
14479
14480   cat >>$CONFIG_STATUS <<\EOF
14481   # Split the substitutions into bite-sized pieces for seds with
14482   # small command number limits, like on Digital OSF/1 and HP-UX.
14483   ac_max_sed_lines=48
14484   ac_sed_frag=1 # Number of current file.
14485   ac_beg=1 # First line for current file.
14486   ac_end=$ac_max_sed_lines # Line after last line for current file.
14487   ac_more_lines=:
14488   ac_sed_cmds=
14489   while $ac_more_lines; do
14490     if test $ac_beg -gt 1; then
14491       sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
14492     else
14493       sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
14494     fi
14495     if test ! -s $tmp/subs.frag; then
14496       ac_more_lines=false
14497     else
14498       # The purpose of the label and of the branching condition is to
14499       # speed up the sed processing (if there are no `@' at all, there
14500       # is no need to browse any of the substitutions).
14501       # These are the two extra sed commands mentioned above.
14502       (echo ':t
14503   /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed
14504       if test -z "$ac_sed_cmds"; then
14505         ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed"
14506       else
14507         ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed"
14508       fi
14509       ac_sed_frag=`expr $ac_sed_frag + 1`
14510       ac_beg=$ac_end
14511       ac_end=`expr $ac_end + $ac_max_sed_lines`
14512     fi
14513   done
14514   if test -z "$ac_sed_cmds"; then
14515     ac_sed_cmds=cat
14516   fi
14517 fi # test -n "$CONFIG_FILES"
14518
14519 EOF
14520 cat >>$CONFIG_STATUS <<\EOF
14521 for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue
14522   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
14523   case $ac_file in
14524   - | *:- | *:-:* ) # input from stdin
14525         cat >$tmp/stdin
14526         ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
14527         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
14528   *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
14529         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
14530   * )   ac_file_in=$ac_file.in ;;
14531   esac
14532
14533   # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories.
14534   ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
14535          X"$ac_file" : 'X\(//\)[^/]' \| \
14536          X"$ac_file" : 'X\(//\)$' \| \
14537          X"$ac_file" : 'X\(/\)' \| \
14538          .     : '\(.\)' 2>/dev/null ||
14539 echo X"$ac_file" |
14540     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
14541           /^X\(\/\/\)[^/].*/{ s//\1/; q; }
14542           /^X\(\/\/\)$/{ s//\1/; q; }
14543           /^X\(\/\).*/{ s//\1/; q; }
14544           s/.*/./; q'`
14545   if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
14546     { case "$ac_dir" in
14547   [\\/]* | ?:[\\/]* ) as_incr_dir=;;
14548   *)                      as_incr_dir=.;;
14549 esac
14550 as_dummy="$ac_dir"
14551 for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
14552   case $as_mkdir_dir in
14553     # Skip DOS drivespec
14554     ?:) as_incr_dir=$as_mkdir_dir ;;
14555     *)
14556       as_incr_dir=$as_incr_dir/$as_mkdir_dir
14557       test -d "$as_incr_dir" || mkdir "$as_incr_dir"
14558     ;;
14559   esac
14560 done; }
14561
14562     ac_dir_suffix="/`echo $ac_dir|sed 's,^\./,,'`"
14563     # A "../" for each directory in $ac_dir_suffix.
14564     ac_dots=`echo "$ac_dir_suffix" | sed 's,/[^/]*,../,g'`
14565   else
14566     ac_dir_suffix= ac_dots=
14567   fi
14568
14569   case $srcdir in
14570   .)  ac_srcdir=.
14571       if test -z "$ac_dots"; then
14572          ac_top_srcdir=.
14573       else
14574          ac_top_srcdir=`echo $ac_dots | sed 's,/$,,'`
14575       fi ;;
14576   [\\/]* | ?:[\\/]* )
14577       ac_srcdir=$srcdir$ac_dir_suffix;
14578       ac_top_srcdir=$srcdir ;;
14579   *) # Relative path.
14580     ac_srcdir=$ac_dots$srcdir$ac_dir_suffix
14581     ac_top_srcdir=$ac_dots$srcdir ;;
14582   esac
14583
14584   case $INSTALL in
14585   [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
14586   *) ac_INSTALL=$ac_dots$INSTALL ;;
14587   esac
14588
14589   if test x"$ac_file" != x-; then
14590     { echo "$as_me:14590: creating $ac_file" >&5
14591 echo "$as_me: creating $ac_file" >&6;}
14592     rm -f "$ac_file"
14593   fi
14594   # Let's still pretend it is `configure' which instantiates (i.e., don't
14595   # use $as_me), people would be surprised to read:
14596   #    /* config.h.  Generated automatically by config.status.  */
14597   configure_input="Generated automatically from `echo $ac_file_in |
14598                                                  sed 's,.*/,,'` by configure."
14599
14600   # First look for the input files in the build tree, otherwise in the
14601   # src tree.
14602   ac_file_inputs=`IFS=:
14603     for f in $ac_file_in; do
14604       case $f in
14605       -) echo $tmp/stdin ;;
14606       [\\/$]*)
14607          # Absolute (can't be DOS-style, as IFS=:)
14608          test -f "$f" || { { echo "$as_me:14608: error: cannot find input file: $f" >&5
14609 echo "$as_me: error: cannot find input file: $f" >&2;}
14610    { (exit 1); exit 1; }; }
14611          echo $f;;
14612       *) # Relative
14613          if test -f "$f"; then
14614            # Build tree
14615            echo $f
14616          elif test -f "$srcdir/$f"; then
14617            # Source tree
14618            echo $srcdir/$f
14619          else
14620            # /dev/null tree
14621            { { echo "$as_me:14621: error: cannot find input file: $f" >&5
14622 echo "$as_me: error: cannot find input file: $f" >&2;}
14623    { (exit 1); exit 1; }; }
14624          fi;;
14625       esac
14626     done` || { (exit 1); exit 1; }
14627 EOF
14628 cat >>$CONFIG_STATUS <<\EOF
14629   ac_warn_datarootdir=no
14630   if test x"$ac_file" != x-; then
14631     for ac_item in $ac_file_inputs
14632     do
14633       ac_seen=`grep '@\(datadir\|mandir\|infodir\)@' $ac_item`
14634       if test -n "$ac_seen"; then
14635         ac_used=`grep '@datarootdir@' $ac_item`
14636         if test -z "$ac_used"; then
14637           { echo "$as_me:14637: WARNING: datarootdir was used implicitly but not set:
14638 $ac_seen" >&5
14639 echo "$as_me: WARNING: datarootdir was used implicitly but not set:
14640 $ac_seen" >&2;}
14641           ac_warn_datarootdir=yes
14642         fi
14643       fi
14644       ac_seen=`grep '${datarootdir}' $ac_item`
14645       if test -n "$ac_seen"; then
14646         { echo "$as_me:14646: WARNING: datarootdir was used explicitly but not set:
14647 $ac_seen" >&5
14648 echo "$as_me: WARNING: datarootdir was used explicitly but not set:
14649 $ac_seen" >&2;}
14650         ac_warn_datarootdir=yes
14651       fi
14652     done
14653   fi
14654
14655 if test "x$ac_warn_datarootdir" = xyes; then
14656   ac_sed_cmds="$ac_sed_cmds | sed -e 's,@datarootdir@,\${prefix}/share,g' -e 's,\${datarootdir},\${prefix}/share,g'"
14657 fi
14658
14659 EOF
14660 cat >>$CONFIG_STATUS <<EOF
14661   sed "$ac_vpsub
14662 $extrasub
14663 EOF
14664 cat >>$CONFIG_STATUS <<\EOF
14665 :t
14666 /@[a-zA-Z_][a-zA-Z_0-9]*@/!b
14667 s,@configure_input@,$configure_input,;t t
14668 s,@srcdir@,$ac_srcdir,;t t
14669 s,@top_srcdir@,$ac_top_srcdir,;t t
14670 s,@INSTALL@,$ac_INSTALL,;t t
14671 " $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out
14672   rm -f $tmp/stdin
14673   if test x"$ac_file" != x-; then
14674     cp $tmp/out $ac_file
14675
14676     for ac_name in prefix exec_prefix datarootdir
14677     do
14678         ac_seen=`fgrep -n '${'$ac_name'[:=].*}' $ac_file`
14679         if test -n "$ac_seen"; then
14680             ac_init=`egrep '[   ]*'$ac_name'[   ]*=' $ac_file`
14681             if test -z "$ac_init"; then
14682               ac_seen=`echo "$ac_seen" |sed -e 's,^,'$ac_file':,'`
14683               { echo "$as_me:14683: WARNING: Variable $ac_name is used but was not set:
14684 $ac_seen" >&5
14685 echo "$as_me: WARNING: Variable $ac_name is used but was not set:
14686 $ac_seen" >&2;}
14687             fi
14688         fi
14689     done
14690     egrep -n '@[a-z_][a-z_0-9]+@' $ac_file >$tmp/out
14691     egrep -n '@[A-Z_][A-Z_0-9]+@' $ac_file >>$tmp/out
14692     if test -s $tmp/out; then
14693       ac_seen=`sed -e 's,^,'$ac_file':,' < $tmp/out`
14694       { echo "$as_me:14694: WARNING: Some variables may not be substituted:
14695 $ac_seen" >&5
14696 echo "$as_me: WARNING: Some variables may not be substituted:
14697 $ac_seen" >&2;}
14698     fi
14699   else
14700     cat $tmp/out
14701   fi
14702   rm -f $tmp/out
14703
14704 done
14705 EOF
14706 cat >>$CONFIG_STATUS <<\EOF
14707
14708 #
14709 # CONFIG_HEADER section.
14710 #
14711
14712 # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
14713 # NAME is the cpp macro being defined and VALUE is the value it is being given.
14714 #
14715 # ac_d sets the value in "#define NAME VALUE" lines.
14716 ac_dA='s,^\([   ]*\)#\([        ]*define[       ][      ]*\)'
14717 ac_dB='[        ].*$,\1#\2'
14718 ac_dC=' '
14719 ac_dD=',;t'
14720 # ac_i turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
14721 ac_iA='s,^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
14722 ac_iB='\([      ]\),\1#\2define\3'
14723 ac_iC=' '
14724 ac_iD='\4,;t'
14725 # ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
14726 ac_uA='s,^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
14727 ac_uB='$,\1#\2define\3'
14728 ac_uC=' '
14729 ac_uD=',;t'
14730
14731 for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue
14732   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
14733   case $ac_file in
14734   - | *:- | *:-:* ) # input from stdin
14735         cat >$tmp/stdin
14736         ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
14737         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
14738   *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
14739         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
14740   * )   ac_file_in=$ac_file.in ;;
14741   esac
14742
14743   test x"$ac_file" != x- && { echo "$as_me:14743: creating $ac_file" >&5
14744 echo "$as_me: creating $ac_file" >&6;}
14745
14746   # First look for the input files in the build tree, otherwise in the
14747   # src tree.
14748   ac_file_inputs=`IFS=:
14749     for f in $ac_file_in; do
14750       case $f in
14751       -) echo $tmp/stdin ;;
14752       [\\/$]*)
14753          # Absolute (can't be DOS-style, as IFS=:)
14754          test -f "$f" || { { echo "$as_me:14754: error: cannot find input file: $f" >&5
14755 echo "$as_me: error: cannot find input file: $f" >&2;}
14756    { (exit 1); exit 1; }; }
14757          echo $f;;
14758       *) # Relative
14759          if test -f "$f"; then
14760            # Build tree
14761            echo $f
14762          elif test -f "$srcdir/$f"; then
14763            # Source tree
14764            echo $srcdir/$f
14765          else
14766            # /dev/null tree
14767            { { echo "$as_me:14767: error: cannot find input file: $f" >&5
14768 echo "$as_me: error: cannot find input file: $f" >&2;}
14769    { (exit 1); exit 1; }; }
14770          fi;;
14771       esac
14772     done` || { (exit 1); exit 1; }
14773   # Remove the trailing spaces.
14774   sed 's/[      ]*$//' $ac_file_inputs >$tmp/in
14775
14776 EOF
14777
14778 # Transform confdefs.h into a list of #define's.  We won't use it as a sed
14779 # script, but as data to insert where we see @DEFS@.  We expect AC_SAVE_DEFS to
14780 # be either 'cat' or 'sort'.
14781 cat confdefs.h | uniq >conftest.vals
14782
14783 # Break up conftest.vals because some shells have a limit on
14784 # the size of here documents, and old seds have small limits too.
14785
14786 rm -f conftest.tail
14787 echo '  rm -f conftest.frag' >> $CONFIG_STATUS
14788 while grep . conftest.vals >/dev/null
14789 do
14790   # Write chunks of a limited-size here document to conftest.frag.
14791   echo '  cat >> conftest.frag <<CEOF' >> $CONFIG_STATUS
14792   sed ${ac_max_here_lines}q conftest.vals | sed -e 's/#ifdef.*/#if 0/' >> $CONFIG_STATUS
14793   echo 'CEOF' >> $CONFIG_STATUS
14794   sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
14795   rm -f conftest.vals
14796   mv conftest.tail conftest.vals
14797 done
14798 rm -f conftest.vals
14799
14800 # Run sed to substitute the contents of conftest.frag into $tmp/in at the
14801 # marker @DEFS@.
14802 echo '  cat >> conftest.edit <<CEOF
14803 /@DEFS@/r conftest.frag
14804 /@DEFS@/d
14805 CEOF
14806 sed -f conftest.edit $tmp/in > $tmp/out
14807 rm -f $tmp/in
14808 mv $tmp/out $tmp/in
14809 rm -f conftest.edit conftest.frag
14810 ' >> $CONFIG_STATUS
14811
14812 cat >>$CONFIG_STATUS <<\EOF
14813   # Let's still pretend it is `configure' which instantiates (i.e., don't
14814   # use $as_me), people would be surprised to read:
14815   #    /* config.h.  Generated automatically by config.status.  */
14816   if test x"$ac_file" = x-; then
14817     echo "/* Generated automatically by configure.  */" >$tmp/config.h
14818   else
14819     echo "/* $ac_file.  Generated automatically by configure.  */" >$tmp/config.h
14820   fi
14821   cat $tmp/in >>$tmp/config.h
14822   rm -f $tmp/in
14823   if test x"$ac_file" != x-; then
14824     if cmp -s $ac_file $tmp/config.h 2>/dev/null; then
14825       { echo "$as_me:14825: $ac_file is unchanged" >&5
14826 echo "$as_me: $ac_file is unchanged" >&6;}
14827     else
14828       ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
14829          X"$ac_file" : 'X\(//\)[^/]' \| \
14830          X"$ac_file" : 'X\(//\)$' \| \
14831          X"$ac_file" : 'X\(/\)' \| \
14832          .     : '\(.\)' 2>/dev/null ||
14833 echo X"$ac_file" |
14834     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
14835           /^X\(\/\/\)[^/].*/{ s//\1/; q; }
14836           /^X\(\/\/\)$/{ s//\1/; q; }
14837           /^X\(\/\).*/{ s//\1/; q; }
14838           s/.*/./; q'`
14839       if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
14840         { case "$ac_dir" in
14841   [\\/]* | ?:[\\/]* ) as_incr_dir=;;
14842   *)                      as_incr_dir=.;;
14843 esac
14844 as_dummy="$ac_dir"
14845 for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
14846   case $as_mkdir_dir in
14847     # Skip DOS drivespec
14848     ?:) as_incr_dir=$as_mkdir_dir ;;
14849     *)
14850       as_incr_dir=$as_incr_dir/$as_mkdir_dir
14851       test -d "$as_incr_dir" || mkdir "$as_incr_dir"
14852     ;;
14853   esac
14854 done; }
14855
14856       fi
14857       rm -f $ac_file
14858       mv $tmp/config.h $ac_file
14859     fi
14860   else
14861     cat $tmp/config.h
14862     rm -f $tmp/config.h
14863   fi
14864 done
14865 EOF
14866 cat >>$CONFIG_STATUS <<\EOF
14867 #
14868 # CONFIG_COMMANDS section.
14869 #
14870 for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue
14871   ac_dest=`echo "$ac_file" | sed 's,:.*,,'`
14872   ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'`
14873
14874   case $ac_dest in
14875     default )
14876 if test -z "$USE_OLD_MAKERULES" ; then
14877         $AWK -f $srcdir/mk-1st.awk <$srcdir/src/modules >>src/Makefile
14878 fi
14879  ;;
14880   esac
14881 done
14882 EOF
14883
14884 cat >>$CONFIG_STATUS <<\EOF
14885
14886 { (exit 0); exit 0; }
14887 EOF
14888 chmod +x $CONFIG_STATUS
14889 ac_clean_files=$ac_clean_files_save
14890
14891 # configure is writing to config.log, and then calls config.status.
14892 # config.status does its own redirection, appending to config.log.
14893 # Unfortunately, on DOS this fails, as config.log is still kept open
14894 # by configure, so config.status won't be able to write to it; its
14895 # output is simply discarded.  So we exec the FD to /dev/null,
14896 # effectively closing config.log, so it can be properly (re)opened and
14897 # appended to by config.status.  When coming back to configure, we
14898 # need to make the FD available again.
14899 if test "$no_create" != yes; then
14900   ac_cs_success=:
14901   exec 5>/dev/null
14902   $SHELL $CONFIG_STATUS || ac_cs_success=false
14903   exec 5>>config.log
14904   # Use ||, not &&, to avoid exiting from the if with $? = 1, which
14905   # would make configure fail if this is the last instruction.
14906   $ac_cs_success || { (exit 1); exit 1; }
14907 fi
14908 ${MAKE:-make} preinstall