]> ncurses.scripts.mit.edu Git - ncurses.git/blob - configure
c18a988f72c4d271dae24fa52f981c98182126a5
[ncurses.git] / configure
1 #! /bin/sh
2
3 # From configure.in Revision: 1.220 
4
5
6
7 # Guess values for system-dependent variables and create Makefiles.
8 # Generated automatically using autoconf version 2.13.20000819 
9 # Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc.
10 #
11 # This configure script is free software; the Free Software Foundation
12 # gives unlimited permission to copy, distribute and modify it.
13
14 # Defaults:
15 ac_help=
16 ac_default_prefix=/usr/local
17 # Any additions from configure.in:
18
19 # Initialize some variables set by options.
20 # The variables have the same names as the options, with
21 # dashes changed to underlines.
22 build=NONE
23 cache_file=./config.cache
24 exec_prefix=NONE
25 host=NONE
26 no_create=
27 nonopt=NONE
28 no_recursion=
29 prefix=NONE
30 program_prefix=NONE
31 program_suffix=NONE
32 program_transform_name=s,x,x,
33 silent=
34 site=
35 srcdir=
36 target=NONE
37 verbose=
38 x_includes=NONE
39 x_libraries=NONE
40 bindir='${exec_prefix}/bin'
41 sbindir='${exec_prefix}/sbin'
42 libexecdir='${exec_prefix}/libexec'
43 datadir='${prefix}/share'
44 sysconfdir='${prefix}/etc'
45 sharedstatedir='${prefix}/com'
46 localstatedir='${prefix}/var'
47 libdir='${exec_prefix}/lib'
48 includedir='${prefix}/include'
49 oldincludedir='/usr/include'
50 infodir='${prefix}/info'
51 mandir='${prefix}/man'
52
53 # Initialize some other variables.
54 subdirs=
55 MFLAGS= MAKEFLAGS=
56 SHELL=${CONFIG_SHELL-/bin/sh}
57 # Maximum number of lines to put in a shell here document.
58 ac_max_here_lines=12
59
60 ac_prev=
61 for ac_option
62 do
63
64   # If the previous option needs an argument, assign it.
65   if test -n "$ac_prev"; then
66     eval "$ac_prev=\$ac_option"
67     ac_prev=
68     continue
69   fi
70
71   case "$ac_option" in
72   -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
73   *) ac_optarg= ;;
74   esac
75
76   # Accept the important Cygnus configure options, so we can diagnose typos.
77
78   case "$ac_option" in
79
80   -bindir | --bindir | --bindi | --bind | --bin | --bi)
81     ac_prev=bindir ;;
82   -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
83     bindir="$ac_optarg" ;;
84
85   -build | --build | --buil | --bui | --bu)
86     ac_prev=build ;;
87   -build=* | --build=* | --buil=* | --bui=* | --bu=*)
88     build="$ac_optarg" ;;
89
90   -cache-file | --cache-file | --cache-fil | --cache-fi \
91   | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
92     ac_prev=cache_file ;;
93   -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
94   | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
95     cache_file="$ac_optarg" ;;
96
97   -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
98     ac_prev=datadir ;;
99   -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
100   | --da=*)
101     datadir="$ac_optarg" ;;
102
103   -disable-* | --disable-*)
104     ac_feature=`echo $ac_option|sed -e 's/-*disable-//'`
105     # Reject names that are not valid shell variable names.
106     if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then
107       { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
108     fi
109     ac_feature=`echo $ac_feature| sed 's/-/_/g'`
110     eval "enable_${ac_feature}=no" ;;
111
112   -enable-* | --enable-*)
113     ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'`
114     # Reject names that are not valid shell variable names.
115     if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then
116       { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
117     fi
118     ac_feature=`echo $ac_feature| sed 's/-/_/g'`
119     case "$ac_option" in
120       *=*) ;;
121       *) ac_optarg=yes ;;
122     esac
123     eval "enable_${ac_feature}='$ac_optarg'" ;;
124
125   -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
126   | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
127   | --exec | --exe | --ex)
128     ac_prev=exec_prefix ;;
129   -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
130   | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
131   | --exec=* | --exe=* | --ex=*)
132     exec_prefix="$ac_optarg" ;;
133
134   -gas | --gas | --ga | --g)
135     # Obsolete; use --with-gas.
136     with_gas=yes ;;
137
138   -help | --help | --hel | --he)
139     # Omit some internal or obsolete options to make the list less imposing.
140     # This message is too long to be a string in the A/UX 3.1 sh.
141     cat << EOF
142 Usage: configure [options] [host]
143 Options: [defaults in brackets after descriptions]
144 Configuration:
145   --cache-file=FILE       cache test results in FILE
146   --help                  print this message
147   --no-create             do not create output files
148   --quiet, --silent       do not print \`checking...' messages
149   --version               print the version of autoconf that created configure
150 Directory and file names:
151   --prefix=PREFIX         install architecture-independent files in PREFIX
152                           [$ac_default_prefix]
153   --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
154                           [same as prefix]
155   --bindir=DIR            user executables in DIR [EPREFIX/bin]
156   --sbindir=DIR           system admin executables in DIR [EPREFIX/sbin]
157   --libexecdir=DIR        program executables in DIR [EPREFIX/libexec]
158   --datadir=DIR           read-only architecture-independent data in DIR
159                           [PREFIX/share]
160   --sysconfdir=DIR        read-only single-machine data in DIR [PREFIX/etc]
161   --sharedstatedir=DIR    modifiable architecture-independent data in DIR
162                           [PREFIX/com]
163   --localstatedir=DIR     modifiable single-machine data in DIR [PREFIX/var]
164   --libdir=DIR            object code libraries in DIR [EPREFIX/lib]
165   --includedir=DIR        C header files in DIR [PREFIX/include]
166   --oldincludedir=DIR     C header files for non-gcc in DIR [/usr/include]
167   --infodir=DIR           info documentation in DIR [PREFIX/info]
168   --mandir=DIR            man documentation in DIR [PREFIX/man]
169   --srcdir=DIR            find the sources in DIR [configure dir or ..]
170   --program-prefix=PREFIX prepend PREFIX to installed program names
171   --program-suffix=SUFFIX append SUFFIX to installed program names
172   --program-transform-name=PROGRAM
173                           run sed PROGRAM on installed program names
174 EOF
175     cat << EOF
176 Host type:
177   --build=BUILD           configure for building on BUILD [BUILD=HOST]
178   --host=HOST             configure for HOST [guessed]
179   --target=TARGET         configure for TARGET [TARGET=HOST]
180 Features and packages:
181   --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
182   --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
183   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
184   --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
185   --x-includes=DIR        X include files are in DIR
186   --x-libraries=DIR       X library files are in DIR
187 EOF
188 cat <<EOF
189 --enable and --with options recognized:
190   --with-system-type=XXX  test: override derived host system-type
191   --enable-add-ons=DIR... used to check if we are a glibc add-on.
192   --without-cxx           do not adjust ncurses bool to match C++
193   --without-cxx-binding   do not build C++ binding and demo
194   --without-ada           suppress check for Ada95, don't build demo
195   --without-progs         suppress build with programs (e.g., tic)
196   --without-curses-h      install curses.h as ncurses.h only
197   --with-install-prefix   prefixes actual install-location
198 Options to Specify the Libraries Built/Used:
199   --with-libtool          generate libraries with libtool
200   --with-shared           generate shared-libraries
201   --with-normal           generate normal-libraries (default)
202   --with-debug            generate debug-libraries (default)
203 EOF
204 cat <<EOF
205   --with-profile          generate profile-libraries
206   --with-termlib          generate separate terminfo library
207   --with-dbmalloc         test: use Conor Cahill's dbmalloc library
208   --with-dmalloc          test: use Gray Watson's dmalloc library
209   --with-gpm              use Alessandro Rubini's GPM library
210   --enable-rpath          use rpath option when generating shared libraries
211   --with-shlib-version=X  Specify rel or abi version for shared libs
212 Fine-Tuning Your Configuration:
213   --disable-overwrite     leave out the link to -lcurses
214   --disable-database      use only built-in data
215   --with-database=XXX     specify terminfo source to install
216   --with-fallbacks=XXX    specify list of fallback terminal descriptions
217 EOF
218 cat <<EOF
219   --with-terminfo-dirs=XXX specify list of terminfo directories (default: DATADIR/terminfo)
220   --with-default-terminfo-dir=DIR default terminfo directory (default: DATADIR/terminfo)
221   --disable-big-core      assume machine has little memory
222   --enable-termcap        compile in termcap fallback support
223   --enable-getcap         fast termcap load, no xrefs to terminfo
224   --enable-getcap-cache   cache translated termcaps in ~/.terminfo
225   --enable-symlinks       make tic use symbolic links not hard links
226   --enable-broken_linker  compile with broken-linker support code
227   --enable-bsdpad         recognize BSD-style prefix padding
228   --with-rcs-ids          compile-in RCS identifiers
229 Options to Specify How Manpages are Installed:
230   --with-manpage-format   specify manpage-format: gzip/compress/BSDI/normal and
231                           optionally formatted, e.g., gzip,formatted
232 EOF
233 cat <<EOF
234   --with-manpage-renames  specify manpage-renaming
235   --with-manpage-symlinks specify manpage-symlinks
236   --with-manpage-tbl      specify manpage processing with tbl
237 Extensions:
238   --disable-ext-funcs     disable function-extensions
239   --enable-const          compile with extra/non-standard const
240   --enable-no-padding     compile with \$NCURSES_NO_PADDING code
241   --enable-sigwinch       compile with SIGWINCH handler
242   --enable-tcap-names     compile with user-definable terminal capabilities
243 Development Code:
244   --with-develop          enable all development options
245   --enable-colorfgbg      compile with \$COLORFGBG code
246 EOF
247 cat <<EOF
248   --enable-hard-tabs      compile with hard-tabs code
249   --disable-root-environ  limit environment when running as root
250   --enable-xmc-glitch     compile with limited support for xmc
251 Experimental Code:
252   --disable-assumed-color do not assume anything about default-colors
253   --disable-hashmap       compile without hashmap scrolling-optimization
254   --enable-safe-sprintf   compile with experimental safe-sprintf code
255   --disable-scroll-hints  compile without scroll-hints code
256   --enable-widec          compile with experimental wide-char/UTF-8 code
257 Testing/development Options:
258   --enable-echo           build: display "compiling" commands (default)
259   --enable-warnings       build: turn on GCC compiler warnings
260 EOF
261 cat <<EOF
262   --enable-assertions     test: turn on generation of assertion code
263   --disable-leaks         test: suppress permanent memory-leaks
264   --enable-expanded       test: generate functions for certain macros
265   --disable-macros        test: use functions rather than macros
266 Ada95 Binding Options:
267   --with-ada-compiler=CMD specify Ada95 compiler command (default gnatmake)
268   --with-ada-include=DIR  Ada includes are in DIR (default: PREFIX/lib/ada/adainclude)
269   --with-ada-objects=DIR  Ada objects are in DIR (default: PREFIX/lib/ada/adalib)
270 EOF
271     exit 0 ;;
272
273   -host | --host | --hos | --ho)
274     ac_prev=host ;;
275   -host=* | --host=* | --hos=* | --ho=*)
276     host="$ac_optarg" ;;
277
278   -includedir | --includedir | --includedi | --included | --include \
279   | --includ | --inclu | --incl | --inc)
280     ac_prev=includedir ;;
281   -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
282   | --includ=* | --inclu=* | --incl=* | --inc=*)
283     includedir="$ac_optarg" ;;
284
285   -infodir | --infodir | --infodi | --infod | --info | --inf)
286     ac_prev=infodir ;;
287   -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
288     infodir="$ac_optarg" ;;
289
290   -libdir | --libdir | --libdi | --libd)
291     ac_prev=libdir ;;
292   -libdir=* | --libdir=* | --libdi=* | --libd=*)
293     libdir="$ac_optarg" ;;
294
295   -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
296   | --libexe | --libex | --libe)
297     ac_prev=libexecdir ;;
298   -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
299   | --libexe=* | --libex=* | --libe=*)
300     libexecdir="$ac_optarg" ;;
301
302   -localstatedir | --localstatedir | --localstatedi | --localstated \
303   | --localstate | --localstat | --localsta | --localst \
304   | --locals | --local | --loca | --loc | --lo)
305     ac_prev=localstatedir ;;
306   -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
307   | --localstate=* | --localstat=* | --localsta=* | --localst=* \
308   | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
309     localstatedir="$ac_optarg" ;;
310
311   -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
312     ac_prev=mandir ;;
313   -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
314     mandir="$ac_optarg" ;;
315
316   -nfp | --nfp | --nf)
317     # Obsolete; use --without-fp.
318     with_fp=no ;;
319
320   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
321   | --no-cr | --no-c)
322     no_create=yes ;;
323
324   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
325   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
326     no_recursion=yes ;;
327
328   -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
329   | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
330   | --oldin | --oldi | --old | --ol | --o)
331     ac_prev=oldincludedir ;;
332   -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
333   | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
334   | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
335     oldincludedir="$ac_optarg" ;;
336
337   -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
338     ac_prev=prefix ;;
339   -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
340     prefix="$ac_optarg" ;;
341
342   -program-prefix | --program-prefix | --program-prefi | --program-pref \
343   | --program-pre | --program-pr | --program-p)
344     ac_prev=program_prefix ;;
345   -program-prefix=* | --program-prefix=* | --program-prefi=* \
346   | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
347     program_prefix="$ac_optarg" ;;
348
349   -program-suffix | --program-suffix | --program-suffi | --program-suff \
350   | --program-suf | --program-su | --program-s)
351     ac_prev=program_suffix ;;
352   -program-suffix=* | --program-suffix=* | --program-suffi=* \
353   | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
354     program_suffix="$ac_optarg" ;;
355
356   -program-transform-name | --program-transform-name \
357   | --program-transform-nam | --program-transform-na \
358   | --program-transform-n | --program-transform- \
359   | --program-transform | --program-transfor \
360   | --program-transfo | --program-transf \
361   | --program-trans | --program-tran \
362   | --progr-tra | --program-tr | --program-t)
363     ac_prev=program_transform_name ;;
364   -program-transform-name=* | --program-transform-name=* \
365   | --program-transform-nam=* | --program-transform-na=* \
366   | --program-transform-n=* | --program-transform-=* \
367   | --program-transform=* | --program-transfor=* \
368   | --program-transfo=* | --program-transf=* \
369   | --program-trans=* | --program-tran=* \
370   | --progr-tra=* | --program-tr=* | --program-t=*)
371     program_transform_name="$ac_optarg" ;;
372
373   -q | -quiet | --quiet | --quie | --qui | --qu | --q \
374   | -silent | --silent | --silen | --sile | --sil)
375     silent=yes ;;
376
377   -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
378     ac_prev=sbindir ;;
379   -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
380   | --sbi=* | --sb=*)
381     sbindir="$ac_optarg" ;;
382
383   -sharedstatedir | --sharedstatedir | --sharedstatedi \
384   | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
385   | --sharedst | --shareds | --shared | --share | --shar \
386   | --sha | --sh)
387     ac_prev=sharedstatedir ;;
388   -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
389   | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
390   | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
391   | --sha=* | --sh=*)
392     sharedstatedir="$ac_optarg" ;;
393
394   -site | --site | --sit)
395     ac_prev=site ;;
396   -site=* | --site=* | --sit=*)
397     site="$ac_optarg" ;;
398
399   -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
400     ac_prev=srcdir ;;
401   -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
402     srcdir="$ac_optarg" ;;
403
404   -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
405   | --syscon | --sysco | --sysc | --sys | --sy)
406     ac_prev=sysconfdir ;;
407   -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
408   | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
409     sysconfdir="$ac_optarg" ;;
410
411   -target | --target | --targe | --targ | --tar | --ta | --t)
412     ac_prev=target ;;
413   -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
414     target="$ac_optarg" ;;
415
416   -v | -verbose | --verbose | --verbos | --verbo | --verb)
417     verbose=yes ;;
418
419   -version | --version | --versio | --versi | --vers)
420     echo "configure generated by autoconf version 2.13.20000819"
421     exit 0 ;;
422
423   -with-* | --with-*)
424     ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'`
425     # Reject names that are not valid shell variable names.
426     if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then
427       { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
428     fi
429     ac_package=`echo $ac_package| sed 's/-/_/g'`
430     case "$ac_option" in
431       *=*) ;;
432       *) ac_optarg=yes ;;
433     esac
434     eval "with_${ac_package}='$ac_optarg'" ;;
435
436   -without-* | --without-*)
437     ac_package=`echo $ac_option|sed -e 's/-*without-//'`
438     # Reject names that are not valid shell variable names.
439     if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then
440       { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
441     fi
442     ac_package=`echo $ac_package| sed 's/-/_/g'`
443     eval "with_${ac_package}=no" ;;
444
445   --x)
446     # Obsolete; use --with-x.
447     with_x=yes ;;
448
449   -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
450   | --x-incl | --x-inc | --x-in | --x-i)
451     ac_prev=x_includes ;;
452   -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
453   | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
454     x_includes="$ac_optarg" ;;
455
456   -x-libraries | --x-libraries | --x-librarie | --x-librari \
457   | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
458     ac_prev=x_libraries ;;
459   -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
460   | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
461     x_libraries="$ac_optarg" ;;
462
463   -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; }
464     ;;
465
466   *)
467     if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then
468       echo "configure: warning: $ac_option: invalid host type" 1>&2
469     fi
470     if test "x$nonopt" != xNONE; then
471       { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; }
472     fi
473     nonopt="$ac_option"
474     ;;
475
476   esac
477 done
478
479 if test -n "$ac_prev"; then
480   { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; }
481 fi
482
483 trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
484
485 # File descriptor usage:
486 # 0 standard input
487 # 1 file creation
488 # 2 errors and warnings
489 # 3 some systems may open it to /dev/tty
490 # 4 used on the Kubota Titan
491 # 6 checking for... messages and results
492 # 5 compiler messages saved in config.log
493 if test "$silent" = yes; then
494   exec 6>/dev/null
495 else
496   exec 6>&1
497 fi
498 exec 5>./config.log
499
500 echo "\
501 This file contains any messages produced by compilers while
502 running configure, to aid debugging if configure makes a mistake.
503 " 1>&5
504
505 # Strip out --no-create and --no-recursion so they do not pile up.
506 # Also quote any args containing shell metacharacters.
507 ac_configure_args=
508 for ac_arg
509 do
510   case "$ac_arg" in
511   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
512   | --no-cr | --no-c) ;;
513   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
514   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
515   *" "*|*"      "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*)
516   ac_configure_args="$ac_configure_args '$ac_arg'" ;;
517   *) ac_configure_args="$ac_configure_args $ac_arg" ;;
518   esac
519 done
520
521 # NLS nuisances.
522 # Only set these to C if already set.  These must not be set unconditionally
523 # because not all systems understand e.g. LANG=C (notably SCO).
524 # Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'!
525 # Non-C LC_CTYPE values break the ctype check.
526 if test "${LANG+set}"   = set; then LANG=C;   export LANG;   fi
527 if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
528 if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi
529 if test "${LC_CTYPE+set}"    = set; then LC_CTYPE=C;    export LC_CTYPE;    fi
530
531 # confdefs.h avoids OS command line length limits that DEFS can exceed.
532 rm -rf conftest* confdefs.h
533 # AIX cpp loses on an empty file, so make sure it contains at least a newline.
534 echo > confdefs.h
535
536 # A filename unique to this package, relative to the directory that
537 # configure is in, which we can look for to find out if srcdir is correct.
538 ac_unique_file=ncurses/base/lib_initscr.c
539
540 # Find the source files, if location was not specified.
541 if test -z "$srcdir"; then
542   ac_srcdir_defaulted=yes
543   # Try the directory containing this script, then its parent.
544   ac_prog=$0
545   ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'`
546   test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
547   srcdir=$ac_confdir
548   if test ! -r $srcdir/$ac_unique_file; then
549     srcdir=..
550   fi
551 else
552   ac_srcdir_defaulted=no
553 fi
554 if test ! -r $srcdir/$ac_unique_file; then
555   if test "$ac_srcdir_defaulted" = yes; then
556     { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; }
557   else
558     { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; }
559   fi
560 fi
561 srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'`
562
563 # Prefer explicitly selected file to automatically selected ones.
564 if test -z "$CONFIG_SITE"; then
565   if test "x$prefix" != xNONE; then
566     CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
567   else
568     CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
569   fi
570 fi
571 for ac_site_file in $CONFIG_SITE; do
572   if test -r "$ac_site_file"; then
573     echo "loading site script $ac_site_file"
574     . "$ac_site_file"
575   fi
576 done
577
578 if test -r "$cache_file"; then
579   echo "loading cache $cache_file"
580   . $cache_file
581 else
582   echo "creating cache $cache_file"
583   > $cache_file
584 fi
585
586 ac_ext=c
587 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
588 ac_cpp='$CPP $CPPFLAGS'
589 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
590 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
591 cross_compiling=$ac_cv_prog_cc_cross
592
593 ac_exeext=
594 ac_objext=o
595 if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
596   # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
597   if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
598     ac_n= ac_c='
599 ' ac_t='        '
600   else
601     ac_n=-n ac_c= ac_t=
602   fi
603 else
604   ac_n= ac_c='\c' ac_t=
605 fi
606
607
608
609
610
611 NCURSES_MAJOR="`egrep '^NCURSES_MAJOR[  ]*=' $srcdir/dist.mk | sed -e 's/^[^0-9]*//'`"
612 NCURSES_MINOR="`egrep '^NCURSES_MINOR[  ]*=' $srcdir/dist.mk | sed -e 's/^[^0-9]*//'`"
613 NCURSES_PATCH="`egrep '^NCURSES_PATCH[  ]*=' $srcdir/dist.mk | sed -e 's/^[^0-9]*//'`"
614 cf_cv_abi_version=${NCURSES_MAJOR}
615 cf_cv_rel_version=${NCURSES_MAJOR}.${NCURSES_MINOR}
616 echo "$ac_t""Configuring NCURSES $cf_cv_rel_version ABI $cf_cv_abi_version (`date`)" 1>&6
617
618
619
620
621
622
623
624
625 ac_aux_dir=
626 for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
627   if test -f $ac_dir/install-sh; then
628     ac_aux_dir=$ac_dir
629     ac_install_sh="$ac_aux_dir/install-sh -c"
630     break
631   elif test -f $ac_dir/install.sh; then
632     ac_aux_dir=$ac_dir
633     ac_install_sh="$ac_aux_dir/install.sh -c"
634     break
635   fi
636 done
637 if test -z "$ac_aux_dir"; then
638   { echo "configure: error: can not find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." 1>&2; exit 1; }
639 fi
640 ac_config_guess=$ac_aux_dir/config.guess
641 ac_config_sub=$ac_aux_dir/config.sub
642 ac_configure=$ac_aux_dir/configure # This should be Cygnus configure.
643
644
645 if test -f $srcdir/config.guess ; then
646         
647 # Do some error checking and defaulting for the host and target type.
648 # The inputs are:
649 #    configure --host=HOST --target=TARGET --build=BUILD NONOPT
650 #
651 # The rules are:
652 # 1. You are not allowed to specify --host, --target, and nonopt at the
653 #    same time.
654 # 2. Host defaults to nonopt.
655 # 3. If nonopt is not specified, then host defaults to the current host,
656 #    as determined by config.guess.
657 # 4. Target and build default to nonopt.
658 # 5. If nonopt is not specified, then target and build default to host.
659
660 # The aliases save the names the user supplied, while $host etc.
661 # will get canonicalized.
662 case $host---$target---$nonopt in
663 NONE---*---* | *---NONE---* | *---*---NONE) ;;
664 *) { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } ;;
665 esac
666
667
668 # Make sure we can run config.sub.
669 if ${CONFIG_SHELL-/bin/sh} $ac_config_sub sun4 >/dev/null 2>&1; then :
670 else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
671 fi
672
673 echo $ac_n "checking host system type""... $ac_c" 1>&6
674 echo "configure:675: checking host system type" >&5
675
676 host_alias=$host
677 case "$host_alias" in
678 NONE)
679   case $nonopt in
680   NONE)
681     if host_alias=`${CONFIG_SHELL-/bin/sh} $ac_config_guess`; then :
682     else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; }
683     fi ;;
684   *) host_alias=$nonopt ;;
685   esac ;;
686 esac
687
688 host=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $host_alias`
689 host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
690 host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
691 host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
692 echo "$ac_t""$host" 1>&6
693
694 echo $ac_n "checking target system type""... $ac_c" 1>&6
695 echo "configure:696: checking target system type" >&5
696
697 target_alias=$target
698 case "$target_alias" in
699 NONE)
700   case $nonopt in
701   NONE) target_alias=$host_alias ;;
702   *) target_alias=$nonopt ;;
703   esac ;;
704 esac
705
706 target=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $target_alias`
707 target_cpu=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
708 target_vendor=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
709 target_os=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
710 echo "$ac_t""$target" 1>&6
711
712 echo $ac_n "checking build system type""... $ac_c" 1>&6
713 echo "configure:714: checking build system type" >&5
714
715 build_alias=$build
716 case "$build_alias" in
717 NONE)
718   case $nonopt in
719   NONE) build_alias=$host_alias ;;
720   *) build_alias=$nonopt ;;
721   esac ;;
722 esac
723
724 build=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $build_alias`
725 build_cpu=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
726 build_vendor=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
727 build_os=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
728 echo "$ac_t""$build" 1>&6
729
730 test "$host_alias" != "$target_alias" &&
731   test "$program_prefix$program_suffix$program_transform_name" = \
732     NONENONEs,x,x, &&
733   program_prefix=${target_alias}-
734
735         system_name="$host_os"
736 else
737         system_name="`(uname -s -r) 2>/dev/null`"
738         if test -z "$system_name" ; then
739                 system_name="`(hostname) 2>/dev/null`"
740         fi
741 fi
742 test -n "$system_name" && cat >> confdefs.h <<EOF
743 #define SYSTEM_NAME "$system_name"
744 EOF
745
746 if eval "test \"`echo '$''{'cf_cv_system_name'+set}'`\" = set"; then
747   echo $ac_n "(cached) $ac_c" 1>&6
748 else
749   cf_cv_system_name="$system_name"
750 fi
751
752
753 test -z "$system_name" && system_name="$cf_cv_system_name"
754 test -n "$cf_cv_system_name" && echo "$ac_t"""Configuring for $cf_cv_system_name"" 1>&6
755
756 if test ".$system_name" != ".$cf_cv_system_name" ; then
757         echo "$ac_t""Cached system name ($system_name) does not agree with actual ($cf_cv_system_name)" 1>&6
758         { echo "configure: error: "Please remove config.cache and try again."" 1>&2; exit 1; }
759 fi
760
761
762 # Check whether --with-system-type or --without-system-type was given.
763 if test "${with_system_type+set}" = set; then
764   withval="$with_system_type"
765   echo "configure: warning: overriding system type to $withval" 1>&2
766  cf_cv_system_name=$withval
767 fi
768
769
770 # We need a configure script only when compiling as part of GNU C library.
771 # Here we have to generate one of the files we need while compiling.
772 #
773 # The only problem is that users of the package might think they have to
774 # run configure themself and find it irritating when nothing happens.
775 #
776 # So we try here to find out whether we are called from the glibc configure
777 # or by a user.
778 #
779
780 # Check whether --enable-add-ons or --disable-add-ons was given.
781 if test "${enable_add_ons+set}" = set; then
782   enableval="$enable_add_ons"
783   glibc_add_on=yes
784 else
785   glibc_add_on=
786 fi
787
788
789 if test x"$glibc_add_on" = "xyes" ; then
790   rm -f $srcdir/Banner
791   # We are in glibc.
792   rm -f $srcdir/Makefile
793   cp $srcdir/Makefile.glibc $srcdir/Makefile
794   echo "ncurses `grep \"^[      ]*ncurses-version[      ]*=.*$\" \
795                 $srcdir/Makefile | sed -e \
796                 's/^[   ]*ncurses-version[      ]*=[    ]*\([^  ^ ]*\)[         ]*$/\1/'`" > $srcdir/Banner
797   exit 0
798 fi
799
800 ###     Save the given $CFLAGS to allow user-override.
801 cf_user_CFLAGS="$CFLAGS"
802
803 ###     Default install-location
804
805 echo $ac_n "checking for prefix""... $ac_c" 1>&6
806 echo "configure:807: checking for prefix" >&5
807 if test "x$prefix" = "xNONE" ; then
808         case "$cf_cv_system_name" in
809                 # non-vendor systems don't have a conflict
810         openbsd*|netbsd*|freebsd*|linux*)
811                 prefix=/usr
812                 ;;
813         *)      prefix=$ac_default_prefix
814                 ;;
815         esac
816 fi
817 echo "$ac_t""$prefix" 1>&6
818
819 if test "x$prefix" = "xNONE" ; then
820 echo $ac_n "checking for default include-directory""... $ac_c" 1>&6
821 echo "configure:822: checking for default include-directory" >&5
822 test -n "$verbose" && echo 1>&6
823 for cf_symbol in \
824         $includedir \
825         $includedir/ncurses \
826         $prefix/include \
827         $prefix/include/ncurses \
828         /usr/local/include \
829         /usr/local/include/ncurses \
830         /usr/include \
831         /usr/include/ncurses
832 do
833         cf_dir=`eval echo $cf_symbol`
834         if test -f $cf_dir/curses.h ; then
835         if ( fgrep NCURSES_VERSION $cf_dir/curses.h 2>&1 >/dev/null ) ; then
836                 includedir="$cf_symbol"
837                 test -n "$verbose"  && echo $ac_n "     found " 1>&6
838                 break
839         fi
840         fi
841         test -n "$verbose"  && echo "   tested $cf_dir" 1>&6
842 done
843 echo "$ac_t""$includedir" 1>&6
844 fi
845
846
847 ###     Checks for programs.
848 # Extract the first word of "gcc", so it can be a program name with args.
849 set dummy gcc; ac_word=$2
850 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
851 echo "configure:852: checking for $ac_word" >&5
852 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
853   echo $ac_n "(cached) $ac_c" 1>&6
854 else
855   if test -n "$CC"; then
856   ac_cv_prog_CC="$CC" # Let the user override the test.
857 else
858   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
859   ac_dummy="$PATH"
860   for ac_dir in $ac_dummy; do
861     test -z "$ac_dir" && ac_dir=.
862     if test -f $ac_dir/$ac_word; then
863       ac_cv_prog_CC="gcc"
864       break
865     fi
866   done
867   IFS="$ac_save_ifs"
868 fi
869 fi
870 CC="$ac_cv_prog_CC"
871 if test -n "$CC"; then
872   echo "$ac_t""$CC" 1>&6
873 else
874   echo "$ac_t""no" 1>&6
875 fi
876
877 if test -z "$CC"; then
878   # Extract the first word of "cc", so it can be a program name with args.
879 set dummy cc; ac_word=$2
880 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
881 echo "configure:882: checking for $ac_word" >&5
882 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
883   echo $ac_n "(cached) $ac_c" 1>&6
884 else
885   if test -n "$CC"; then
886   ac_cv_prog_CC="$CC" # Let the user override the test.
887 else
888   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
889   ac_prog_rejected=no
890   ac_dummy="$PATH"
891   for ac_dir in $ac_dummy; do
892     test -z "$ac_dir" && ac_dir=.
893     if test -f $ac_dir/$ac_word; then
894       if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
895         ac_prog_rejected=yes
896         continue
897       fi
898       ac_cv_prog_CC="cc"
899       break
900     fi
901   done
902   IFS="$ac_save_ifs"
903 if test $ac_prog_rejected = yes; then
904   # We found a bogon in the path, so make sure we never use it.
905   set dummy $ac_cv_prog_CC
906   shift
907   if test $# -gt 0; then
908     # We chose a different compiler from the bogus one.
909     # However, it has the same basename, so the bogon will be chosen
910     # first if we set CC to just the basename; use the full file name.
911     shift
912     set dummy "$ac_dir/$ac_word" "$@"
913     shift
914     ac_cv_prog_CC="$@"
915   fi
916 fi
917 fi
918 fi
919 CC="$ac_cv_prog_CC"
920 if test -n "$CC"; then
921   echo "$ac_t""$CC" 1>&6
922 else
923   echo "$ac_t""no" 1>&6
924 fi
925
926   if test -z "$CC"; then
927     case "`uname -s`" in
928     *win32* | *WIN32*)
929       # Extract the first word of "cl", so it can be a program name with args.
930 set dummy cl; ac_word=$2
931 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
932 echo "configure:933: checking for $ac_word" >&5
933 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
934   echo $ac_n "(cached) $ac_c" 1>&6
935 else
936   if test -n "$CC"; then
937   ac_cv_prog_CC="$CC" # Let the user override the test.
938 else
939   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
940   ac_dummy="$PATH"
941   for ac_dir in $ac_dummy; do
942     test -z "$ac_dir" && ac_dir=.
943     if test -f $ac_dir/$ac_word; then
944       ac_cv_prog_CC="cl"
945       break
946     fi
947   done
948   IFS="$ac_save_ifs"
949 fi
950 fi
951 CC="$ac_cv_prog_CC"
952 if test -n "$CC"; then
953   echo "$ac_t""$CC" 1>&6
954 else
955   echo "$ac_t""no" 1>&6
956 fi
957  ;;
958     esac
959   fi
960   test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
961 fi
962
963 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
964 echo "configure:965: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
965
966 ac_ext=c
967 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
968 ac_cpp='$CPP $CPPFLAGS'
969 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
970 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
971 cross_compiling=$ac_cv_prog_cc_cross
972
973 cat > conftest.$ac_ext << EOF
974
975 #line 976 "configure"
976 #include "confdefs.h"
977
978 main(){return(0);}
979 EOF
980 if { (eval echo configure:981: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
981   ac_cv_prog_cc_works=yes
982   # If we can't run a trivial program, we are probably using a cross compiler.
983   if (./conftest; exit) 2>/dev/null; then
984     ac_cv_prog_cc_cross=no
985   else
986     ac_cv_prog_cc_cross=yes
987   fi
988 else
989   echo "configure: failed program was:" >&5
990   cat conftest.$ac_ext >&5
991   ac_cv_prog_cc_works=no
992 fi
993 rm -fr conftest*
994 ac_ext=c
995 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
996 ac_cpp='$CPP $CPPFLAGS'
997 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
998 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
999 cross_compiling=$ac_cv_prog_cc_cross
1000
1001 echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
1002 if test $ac_cv_prog_cc_works = no; then
1003   { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
1004 fi
1005 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
1006 echo "configure:1007: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
1007 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
1008 cross_compiling=$ac_cv_prog_cc_cross
1009
1010 echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
1011 echo "configure:1012: checking whether we are using GNU C" >&5
1012 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
1013   echo $ac_n "(cached) $ac_c" 1>&6
1014 else
1015   cat > conftest.c <<EOF
1016 #ifdef __GNUC__
1017   yes;
1018 #endif
1019 EOF
1020 if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1021: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
1021   ac_cv_prog_gcc=yes
1022 else
1023   ac_cv_prog_gcc=no
1024 fi
1025 fi
1026
1027 echo "$ac_t""$ac_cv_prog_gcc" 1>&6
1028
1029 if test $ac_cv_prog_gcc = yes; then
1030   GCC=yes
1031 else
1032   GCC=
1033 fi
1034
1035 ac_test_CFLAGS="${CFLAGS+set}"
1036 ac_save_CFLAGS="$CFLAGS"
1037 CFLAGS=
1038 echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
1039 echo "configure:1040: checking whether ${CC-cc} accepts -g" >&5
1040 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
1041   echo $ac_n "(cached) $ac_c" 1>&6
1042 else
1043   echo 'void f(){}' > conftest.c
1044 if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
1045   ac_cv_prog_cc_g=yes
1046 else
1047   ac_cv_prog_cc_g=no
1048 fi
1049 rm -f conftest*
1050
1051 fi
1052
1053 echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
1054 if test "$ac_test_CFLAGS" = set; then
1055   CFLAGS="$ac_save_CFLAGS"
1056 elif test $ac_cv_prog_cc_g = yes; then
1057   if test "$GCC" = yes; then
1058     CFLAGS="-g -O2"
1059   else
1060     CFLAGS="-g"
1061   fi
1062 else
1063   if test "$GCC" = yes; then
1064     CFLAGS="-O2"
1065   else
1066     CFLAGS=
1067   fi
1068 fi
1069
1070 if test "$GCC" = yes ; then
1071         echo $ac_n "checking version of gcc""... $ac_c" 1>&6
1072 echo "configure:1073: checking version of gcc" >&5
1073         eval "$CC --version"
1074 fi
1075 if test "$host" != $build; then
1076         for ac_prog in $CC gcc cc
1077 do
1078 # Extract the first word of "$ac_prog", so it can be a program name with args.
1079 set dummy $ac_prog; ac_word=$2
1080 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1081 echo "configure:1082: checking for $ac_word" >&5
1082 if eval "test \"`echo '$''{'ac_cv_prog_BUILD_CC'+set}'`\" = set"; then
1083   echo $ac_n "(cached) $ac_c" 1>&6
1084 else
1085   if test -n "$BUILD_CC"; then
1086   ac_cv_prog_BUILD_CC="$BUILD_CC" # Let the user override the test.
1087 else
1088   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
1089   ac_dummy="$PATH"
1090   for ac_dir in $ac_dummy; do
1091     test -z "$ac_dir" && ac_dir=.
1092     if test -f $ac_dir/$ac_word; then
1093       ac_cv_prog_BUILD_CC="$ac_prog"
1094       break
1095     fi
1096   done
1097   IFS="$ac_save_ifs"
1098 fi
1099 fi
1100 BUILD_CC="$ac_cv_prog_BUILD_CC"
1101 if test -n "$BUILD_CC"; then
1102   echo "$ac_t""$BUILD_CC" 1>&6
1103 else
1104   echo "$ac_t""no" 1>&6
1105 fi
1106
1107 test -n "$BUILD_CC" && break
1108 done
1109
1110 else
1111         BUILD_CC="$CC"
1112 fi
1113
1114 echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
1115 echo "configure:1116: checking how to run the C preprocessor" >&5
1116 # On Suns, sometimes $CPP names a directory.
1117 if test -n "$CPP" && test -d "$CPP"; then
1118   CPP=
1119 fi
1120 if test -z "$CPP"; then
1121 if eval "test \"`echo '$''{'ac_cv_prog_CPP'+set}'`\" = set"; then
1122   echo $ac_n "(cached) $ac_c" 1>&6
1123 else
1124     # This must be in double quotes, not single quotes, because CPP may get
1125   # substituted into the Makefile and "${CC-cc}" will confuse make.
1126   CPP="${CC-cc} -E"
1127   # On the NeXT, cc -E runs the code through the compiler's parser,
1128   # not just through cpp.
1129   cat > conftest.$ac_ext <<EOF
1130 #line 1131 "configure"
1131 #include "confdefs.h"
1132 #include <assert.h>
1133 Syntax Error
1134 EOF
1135 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
1136 { (eval echo configure:1137: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
1137 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
1138 if test -z "$ac_err"; then
1139   :
1140 else
1141   echo "$ac_err" >&5
1142   echo "configure: failed program was:" >&5
1143   cat conftest.$ac_ext >&5
1144   rm -rf conftest*
1145   CPP="${CC-cc} -E -traditional-cpp"
1146   cat > conftest.$ac_ext <<EOF
1147 #line 1148 "configure"
1148 #include "confdefs.h"
1149 #include <assert.h>
1150 Syntax Error
1151 EOF
1152 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
1153 { (eval echo configure:1154: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
1154 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
1155 if test -z "$ac_err"; then
1156   :
1157 else
1158   echo "$ac_err" >&5
1159   echo "configure: failed program was:" >&5
1160   cat conftest.$ac_ext >&5
1161   rm -rf conftest*
1162   CPP="${CC-cc} -nologo -E"
1163   cat > conftest.$ac_ext <<EOF
1164 #line 1165 "configure"
1165 #include "confdefs.h"
1166 #include <assert.h>
1167 Syntax Error
1168 EOF
1169 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
1170 { (eval echo configure:1171: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
1171 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
1172 if test -z "$ac_err"; then
1173   :
1174 else
1175   echo "$ac_err" >&5
1176   echo "configure: failed program was:" >&5
1177   cat conftest.$ac_ext >&5
1178   rm -rf conftest*
1179   CPP=/lib/cpp
1180 fi
1181 rm -f conftest*
1182 fi
1183 rm -f conftest*
1184 fi
1185 rm -f conftest*
1186   ac_cv_prog_CPP="$CPP"
1187 fi
1188   CPP="$ac_cv_prog_CPP"
1189 else
1190   ac_cv_prog_CPP="$CPP"
1191 fi
1192 echo "$ac_t""$CPP" 1>&6
1193
1194 if test $ac_cv_prog_gcc = yes; then
1195     echo $ac_n "checking whether ${CC-cc} needs -traditional""... $ac_c" 1>&6
1196 echo "configure:1197: checking whether ${CC-cc} needs -traditional" >&5
1197 if eval "test \"`echo '$''{'ac_cv_prog_gcc_traditional'+set}'`\" = set"; then
1198   echo $ac_n "(cached) $ac_c" 1>&6
1199 else
1200     ac_pattern="Autoconf.*'x'"
1201   cat > conftest.$ac_ext <<EOF
1202 #line 1203 "configure"
1203 #include "confdefs.h"
1204 #include <sgtty.h>
1205 Autoconf TIOCGETP
1206 EOF
1207 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
1208   egrep "$ac_pattern" >/dev/null 2>&1; then
1209   rm -rf conftest*
1210   ac_cv_prog_gcc_traditional=yes
1211 else
1212   rm -rf conftest*
1213   ac_cv_prog_gcc_traditional=no
1214 fi
1215 rm -f conftest*
1216
1217
1218   if test $ac_cv_prog_gcc_traditional = no; then
1219     cat > conftest.$ac_ext <<EOF
1220 #line 1221 "configure"
1221 #include "confdefs.h"
1222 #include <termio.h>
1223 Autoconf TCGETA
1224 EOF
1225 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
1226   egrep "$ac_pattern" >/dev/null 2>&1; then
1227   rm -rf conftest*
1228   ac_cv_prog_gcc_traditional=yes
1229 fi
1230 rm -f conftest*
1231
1232   fi
1233 fi
1234
1235 echo "$ac_t""$ac_cv_prog_gcc_traditional" 1>&6
1236   if test $ac_cv_prog_gcc_traditional = yes; then
1237     CC="$CC -traditional"
1238   fi
1239 fi
1240
1241 echo $ac_n "checking for POSIXized ISC""... $ac_c" 1>&6
1242 echo "configure:1243: checking for POSIXized ISC" >&5
1243 if test -d /etc/conf/kconfig.d &&
1244   grep _POSIX_VERSION /usr/include/sys/unistd.h >/dev/null 2>&1
1245 then
1246   echo "$ac_t""yes" 1>&6
1247   ISC=yes # If later tests want to check for ISC.
1248   cat >> confdefs.h <<\EOF
1249 #define _POSIX_SOURCE 1
1250 EOF
1251
1252   if test "$GCC" = yes; then
1253     CC="$CC -posix"
1254   else
1255     CC="$CC -Xp"
1256   fi
1257 else
1258   echo "$ac_t""no" 1>&6
1259   ISC=
1260 fi
1261
1262
1263 echo $ac_n "checking for ${CC-cc} option to accept ANSI C""... $ac_c" 1>&6
1264 echo "configure:1265: checking for ${CC-cc} option to accept ANSI C" >&5
1265 if eval "test \"`echo '$''{'cf_cv_ansi_cc'+set}'`\" = set"; then
1266   echo $ac_n "(cached) $ac_c" 1>&6
1267 else
1268   
1269 cf_cv_ansi_cc=no
1270 cf_save_CFLAGS="$CFLAGS"
1271 # Don't try gcc -ansi; that turns off useful extensions and
1272 # breaks some systems' header files.
1273 # AIX                   -qlanglvl=ansi
1274 # Ultrix and OSF/1      -std1
1275 # HP-UX                 -Aa -D_HPUX_SOURCE
1276 # SVR4                  -Xc
1277 # UnixWare 1.2          (cannot use -Xc, since ANSI/POSIX clashes)
1278 for cf_arg in "-DCC_HAS_PROTOS" \
1279         "" \
1280         -qlanglvl=ansi \
1281         -std1 \
1282         -Ae \
1283         "-Aa -D_HPUX_SOURCE" \
1284         -Xc
1285 do
1286         CFLAGS="$cf_save_CFLAGS $cf_arg"
1287         cat > conftest.$ac_ext <<EOF
1288 #line 1289 "configure"
1289 #include "confdefs.h"
1290
1291 #ifndef CC_HAS_PROTOS
1292 #if !defined(__STDC__) || (__STDC__ != 1)
1293 choke me
1294 #endif
1295 #endif
1296
1297 int main() {
1298
1299         int test (int i, double x);
1300         struct s1 {int (*f) (int a);};
1301         struct s2 {int (*f) (double a);};
1302 ; return 0; }
1303 EOF
1304 if { (eval echo configure:1305: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
1305   rm -rf conftest*
1306   cf_cv_ansi_cc="$cf_arg"; break
1307 else
1308   echo "configure: failed program was:" >&5
1309   cat conftest.$ac_ext >&5
1310 fi
1311 rm -f conftest*
1312 done
1313 CFLAGS="$cf_save_CFLAGS"
1314
1315 fi
1316
1317 echo "$ac_t""$cf_cv_ansi_cc" 1>&6
1318
1319 if test "$cf_cv_ansi_cc" != "no"; then
1320 if test ".$cf_cv_ansi_cc" != ".-DCC_HAS_PROTOS"; then
1321         CFLAGS="$CFLAGS $cf_cv_ansi_cc"
1322 else
1323         cat >> confdefs.h <<\EOF
1324 #define CC_HAS_PROTOS 1
1325 EOF
1326
1327 fi
1328 fi
1329
1330
1331 if test "$cf_cv_ansi_cc" = "no"; then
1332         { echo "configure: error: Your compiler does not appear to recognize prototypes.
1333 You have the following choices:
1334         a. adjust your compiler options
1335         b. get an up-to-date compiler
1336         c. use a wrapper such as unproto" 1>&2; exit 1; }
1337 fi
1338
1339
1340
1341 PROG_EXT=
1342 case $cf_cv_system_name in
1343 os2*)
1344     # We make sure -Zexe is not used -- it would interfere with @PROG_EXT@
1345     CFLAGS="$CFLAGS -Zmt -D__ST_MT_ERRNO__"
1346     CXXFLAGS="$CXXFLAGS -Zmt -D__ST_MT_ERRNO__"
1347     LDFLAGS=`echo "$LDFLAGS -Zmt -Zcrtdll" | sed "s/-Zexe//g"`
1348     PROG_EXT=".exe"
1349     ;;
1350 cygwin*)
1351     PROG_EXT=".exe"
1352     ;;
1353 esac
1354
1355
1356
1357 case "$cf_cv_system_name" in
1358 freebsd*) #(vi
1359   test -z "$LDCONFIG" && LDCONFIG="/sbin/ldconfig -R"
1360   ;;
1361 *) LDPATH=$PATH:/sbin:/usr/sbin
1362   # Extract the first word of "ldconfig", so it can be a program name with args.
1363 set dummy ldconfig; ac_word=$2
1364 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1365 echo "configure:1366: checking for $ac_word" >&5
1366 if eval "test \"`echo '$''{'ac_cv_path_LDCONFIG'+set}'`\" = set"; then
1367   echo $ac_n "(cached) $ac_c" 1>&6
1368 else
1369   case "$LDCONFIG" in
1370   /*)
1371   ac_cv_path_LDCONFIG="$LDCONFIG" # Let the user override the test with a path.
1372   ;;
1373   ?:/*)                  
1374   ac_cv_path_LDCONFIG="$LDCONFIG" # Let the user override the test with a dos path.
1375   ;;
1376   *)
1377   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
1378   ac_dummy="$LDPATH"
1379   for ac_dir in $ac_dummy; do 
1380     test -z "$ac_dir" && ac_dir=.
1381     if test -f $ac_dir/$ac_word; then
1382       ac_cv_path_LDCONFIG="$ac_dir/$ac_word"
1383       break
1384     fi
1385   done
1386   IFS="$ac_save_ifs"
1387   ;;
1388 esac
1389 fi
1390 LDCONFIG="$ac_cv_path_LDCONFIG"
1391 if test -n "$LDCONFIG"; then
1392   echo "$ac_t""$LDCONFIG" 1>&6
1393 else
1394   echo "$ac_t""no" 1>&6
1395 fi
1396
1397   ;;
1398 esac
1399
1400
1401 echo $ac_n "checking if you want to ensure bool is consistent with C++""... $ac_c" 1>&6
1402 echo "configure:1403: checking if you want to ensure bool is consistent with C++" >&5
1403
1404 # Check whether --with-cxx or --without-cxx was given.
1405 if test "${with_cxx+set}" = set; then
1406   withval="$with_cxx"
1407   cf_with_cxx=$withval
1408 else
1409   cf_with_cxx=yes
1410 fi
1411
1412 echo "$ac_t""$cf_with_cxx" 1>&6
1413 if test "X$cf_with_cxx" = Xno ; then
1414         CXX=""
1415         GXX=""
1416 else
1417                 for ac_prog in $CCC c++ g++ gcc CC cxx cc++ cl
1418 do
1419 # Extract the first word of "$ac_prog", so it can be a program name with args.
1420 set dummy $ac_prog; ac_word=$2
1421 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1422 echo "configure:1423: checking for $ac_word" >&5
1423 if eval "test \"`echo '$''{'ac_cv_prog_CXX'+set}'`\" = set"; then
1424   echo $ac_n "(cached) $ac_c" 1>&6
1425 else
1426   if test -n "$CXX"; then
1427   ac_cv_prog_CXX="$CXX" # Let the user override the test.
1428 else
1429   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
1430   ac_dummy="$PATH"
1431   for ac_dir in $ac_dummy; do
1432     test -z "$ac_dir" && ac_dir=.
1433     if test -f $ac_dir/$ac_word; then
1434       ac_cv_prog_CXX="$ac_prog"
1435       break
1436     fi
1437   done
1438   IFS="$ac_save_ifs"
1439 fi
1440 fi
1441 CXX="$ac_cv_prog_CXX"
1442 if test -n "$CXX"; then
1443   echo "$ac_t""$CXX" 1>&6
1444 else
1445   echo "$ac_t""no" 1>&6
1446 fi
1447
1448 test -n "$CXX" && break
1449 done
1450 test -n "$CXX" || CXX="gcc"
1451
1452
1453 echo $ac_n "checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works""... $ac_c" 1>&6
1454 echo "configure:1455: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works" >&5
1455
1456 ac_ext=C
1457 # CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
1458 ac_cpp='$CXXCPP $CPPFLAGS'
1459 ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
1460 ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
1461 cross_compiling=$ac_cv_prog_cxx_cross
1462
1463 cat > conftest.$ac_ext << EOF
1464
1465 #line 1466 "configure"
1466 #include "confdefs.h"
1467
1468 int main(){return(0);}
1469 EOF
1470 if { (eval echo configure:1471: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
1471   ac_cv_prog_cxx_works=yes
1472   # If we can't run a trivial program, we are probably using a cross compiler.
1473   if (./conftest; exit) 2>/dev/null; then
1474     ac_cv_prog_cxx_cross=no
1475   else
1476     ac_cv_prog_cxx_cross=yes
1477   fi
1478 else
1479   echo "configure: failed program was:" >&5
1480   cat conftest.$ac_ext >&5
1481   ac_cv_prog_cxx_works=no
1482 fi
1483 rm -fr conftest*
1484 ac_ext=c
1485 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
1486 ac_cpp='$CPP $CPPFLAGS'
1487 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
1488 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
1489 cross_compiling=$ac_cv_prog_cc_cross
1490
1491 echo "$ac_t""$ac_cv_prog_cxx_works" 1>&6
1492 if test $ac_cv_prog_cxx_works = no; then
1493   echo "$ac_t""You don't have any C++ compiler, too bad" 1>&6;          cf_with_cxx=no; CXX=""; GXX="";
1494 fi
1495 echo $ac_n "checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
1496 echo "configure:1497: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler" >&5
1497 echo "$ac_t""$ac_cv_prog_cxx_cross" 1>&6
1498 cross_compiling=$ac_cv_prog_cxx_cross
1499
1500 echo $ac_n "checking whether we are using GNU C++""... $ac_c" 1>&6
1501 echo "configure:1502: checking whether we are using GNU C++" >&5
1502 if eval "test \"`echo '$''{'ac_cv_prog_gxx'+set}'`\" = set"; then
1503   echo $ac_n "(cached) $ac_c" 1>&6
1504 else
1505   cat > conftest.C <<EOF
1506 #ifdef __GNUC__
1507   yes;
1508 #endif
1509 EOF
1510 if { ac_try='${CXX-g++} -E conftest.C'; { (eval echo configure:1511: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
1511   ac_cv_prog_gxx=yes
1512 else
1513   ac_cv_prog_gxx=no
1514 fi
1515 fi
1516
1517 echo "$ac_t""$ac_cv_prog_gxx" 1>&6
1518
1519 if test $ac_cv_prog_gxx = yes; then
1520   GXX=yes
1521 else
1522   GXX=
1523 fi
1524
1525 ac_test_CXXFLAGS="${CXXFLAGS+set}"
1526 ac_save_CXXFLAGS="$CXXFLAGS"
1527 CXXFLAGS=
1528 echo $ac_n "checking whether ${CXX-g++} accepts -g""... $ac_c" 1>&6
1529 echo "configure:1530: checking whether ${CXX-g++} accepts -g" >&5
1530 if eval "test \"`echo '$''{'ac_cv_prog_cxx_g'+set}'`\" = set"; then
1531   echo $ac_n "(cached) $ac_c" 1>&6
1532 else
1533   echo 'void f(){}' > conftest.cc
1534 if test -z "`${CXX-g++} -g -c conftest.cc 2>&1`"; then
1535   ac_cv_prog_cxx_g=yes
1536 else
1537   ac_cv_prog_cxx_g=no
1538 fi
1539 rm -f conftest*
1540
1541 fi
1542
1543 echo "$ac_t""$ac_cv_prog_cxx_g" 1>&6
1544 if test "$ac_test_CXXFLAGS" = set; then
1545   CXXFLAGS="$ac_save_CXXFLAGS"
1546 elif test $ac_cv_prog_cxx_g = yes; then
1547   if test "$GXX" = yes; then
1548     CXXFLAGS="-g -O2"
1549   else
1550     CXXFLAGS="-g"
1551   fi
1552 else
1553   if test "$GXX" = yes; then
1554     CXXFLAGS="-O2"
1555   else
1556     CXXFLAGS=
1557   fi
1558 fi
1559
1560         fi
1561
1562 if test "$GXX" = yes; then
1563         case "`${CXX-g++} --version`" in
1564         1*|2.[0-6]*)
1565                 GXX=""; CXX=""; ac_cv_prog_gxx=no
1566                 cf_cxx_library=no
1567                 echo No: templates do not work
1568                 ;;
1569         esac
1570 fi
1571
1572 echo $ac_n "checking if you want to build C++ binding and demo""... $ac_c" 1>&6
1573 echo "configure:1574: checking if you want to build C++ binding and demo" >&5
1574
1575 # Check whether --with-cxx-binding or --without-cxx-binding was given.
1576 if test "${with_cxx_binding+set}" = set; then
1577   withval="$with_cxx_binding"
1578   cf_with_cxx_binding=$withval
1579 else
1580   cf_with_cxx_binding=$cf_with_cxx
1581 fi
1582
1583 echo "$ac_t""$cf_with_cxx_binding" 1>&6
1584
1585 echo $ac_n "checking if you want to build with Ada95""... $ac_c" 1>&6
1586 echo "configure:1587: checking if you want to build with Ada95" >&5
1587
1588 # Check whether --with-ada or --without-ada was given.
1589 if test "${with_ada+set}" = set; then
1590   withval="$with_ada"
1591   cf_with_ada=$withval
1592 else
1593   cf_with_ada=yes
1594 fi
1595
1596 echo "$ac_t""$cf_with_ada" 1>&6
1597
1598 echo $ac_n "checking if you want to build programs such as tic""... $ac_c" 1>&6
1599 echo "configure:1600: checking if you want to build programs such as tic" >&5
1600
1601 # Check whether --with-progs or --without-progs was given.
1602 if test "${with_progs+set}" = set; then
1603   withval="$with_progs"
1604   cf_with_progs=$withval
1605 else
1606   cf_with_progs=yes
1607 fi
1608
1609 echo "$ac_t""$cf_with_progs" 1>&6
1610
1611 echo $ac_n "checking if you wish to install curses.h""... $ac_c" 1>&6
1612 echo "configure:1613: checking if you wish to install curses.h" >&5
1613
1614 # Check whether --with-curses-h or --without-curses-h was given.
1615 if test "${with_curses_h+set}" = set; then
1616   withval="$with_curses_h"
1617   with_curses_h=$withval
1618 else
1619   with_curses_h=yes
1620 fi
1621
1622 echo "$ac_t""$with_curses_h" 1>&6
1623
1624 modules_to_build="ncurses"
1625 if test "X$cf_with_progs" != Xno ; then
1626 modules_to_build="$modules_to_build progs tack"
1627 fi
1628 modules_to_build="$modules_to_build panel menu form"
1629
1630 if test "$program_transform_name" = s,x,x,; then
1631   program_transform_name=
1632 else
1633   # Double any \ or $.  echo might interpret backslashes.
1634   cat <<\EOF_SED > conftestsed
1635 s,\\,\\\\,g; s,\$,$$,g
1636 EOF_SED
1637   program_transform_name="`echo $program_transform_name|sed -f conftestsed`"
1638   rm -f conftestsed
1639 fi
1640 test "$program_prefix" != NONE &&
1641   program_transform_name="s,^,${program_prefix},; $program_transform_name"
1642 # Use a double $ so make ignores it.
1643 test "$program_suffix" != NONE &&
1644   program_transform_name="s,\$\$,${program_suffix},; $program_transform_name"
1645
1646 # sed with no file args requires a program.
1647 test "$program_transform_name" = "" && program_transform_name="s,x,x,"
1648
1649 for ac_prog in mawk gawk nawk awk
1650 do
1651 # Extract the first word of "$ac_prog", so it can be a program name with args.
1652 set dummy $ac_prog; ac_word=$2
1653 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1654 echo "configure:1655: checking for $ac_word" >&5
1655 if eval "test \"`echo '$''{'ac_cv_prog_AWK'+set}'`\" = set"; then
1656   echo $ac_n "(cached) $ac_c" 1>&6
1657 else
1658   if test -n "$AWK"; then
1659   ac_cv_prog_AWK="$AWK" # Let the user override the test.
1660 else
1661   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
1662   ac_dummy="$PATH"
1663   for ac_dir in $ac_dummy; do
1664     test -z "$ac_dir" && ac_dir=.
1665     if test -f $ac_dir/$ac_word; then
1666       ac_cv_prog_AWK="$ac_prog"
1667       break
1668     fi
1669   done
1670   IFS="$ac_save_ifs"
1671 fi
1672 fi
1673 AWK="$ac_cv_prog_AWK"
1674 if test -n "$AWK"; then
1675   echo "$ac_t""$AWK" 1>&6
1676 else
1677   echo "$ac_t""no" 1>&6
1678 fi
1679
1680 test -n "$AWK" && break
1681 done
1682
1683 echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
1684 echo "configure:1685: checking whether ${MAKE-make} sets \${MAKE}" >&5
1685 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
1686 if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then
1687   echo $ac_n "(cached) $ac_c" 1>&6
1688 else
1689   cat > conftestmake <<\EOF
1690 all:
1691         @echo 'ac_maketemp="${MAKE}"'
1692 EOF
1693 # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
1694 eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=`
1695 if test -n "$ac_maketemp"; then
1696   eval ac_cv_prog_make_${ac_make}_set=yes
1697 else
1698   eval ac_cv_prog_make_${ac_make}_set=no
1699 fi
1700 rm -f conftestmake
1701 fi
1702 if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
1703   echo "$ac_t""yes" 1>&6
1704   SET_MAKE=
1705 else
1706   echo "$ac_t""no" 1>&6
1707   SET_MAKE="MAKE=${MAKE-make}"
1708 fi
1709
1710 # Find a good install program.  We prefer a C program (faster),
1711 # so one script is as good as another.  But avoid the broken or
1712 # incompatible versions:
1713 # SysV /etc/install, /usr/sbin/install
1714 # SunOS /usr/etc/install
1715 # IRIX /sbin/install
1716 # AIX /bin/install
1717 # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
1718 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
1719 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
1720 # ./install, which can be erroneously created by make from ./install.sh.
1721 echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
1722 echo "configure:1723: checking for a BSD compatible install" >&5
1723 if test -z "$INSTALL"; then
1724 if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
1725   echo $ac_n "(cached) $ac_c" 1>&6
1726 else
1727     IFS="${IFS=         }"; ac_save_IFS="$IFS"; IFS=":"
1728   for ac_dir in $PATH; do
1729     # Account for people who put trailing slashes in PATH elements.
1730     case "$ac_dir/" in
1731     /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
1732     *)
1733       # OSF1 and SCO ODT 3.0 have their own names for install.
1734       # Don't use installbsd from OSF since it installs stuff as root
1735       # by default.
1736       for ac_prog in ginstall scoinst install; do
1737         if test -f $ac_dir/$ac_prog; then
1738           if test $ac_prog = install &&
1739             grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then
1740             # AIX install.  It has an incompatible calling convention.
1741             :
1742           else
1743             ac_cv_path_install="$ac_dir/$ac_prog -c"
1744             break 2
1745           fi
1746         fi
1747       done
1748       ;;
1749     esac
1750   done
1751   IFS="$ac_save_IFS"
1752
1753 fi
1754   if test "${ac_cv_path_install+set}" = set; then
1755     INSTALL="$ac_cv_path_install"
1756   else
1757     # As a last resort, use the slow shell script.  We don't cache a
1758     # path for INSTALL within a source directory, because that will
1759     # break other packages using the cache if that directory is
1760     # removed, or if the path is relative.
1761     INSTALL="$ac_install_sh"
1762   fi
1763 fi
1764 echo "$ac_t""$INSTALL" 1>&6
1765
1766 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
1767 # It thinks the first close brace ends the variable substitution.
1768 test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
1769
1770 test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
1771
1772 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
1773
1774 case $INSTALL in
1775 /*)
1776   ;;
1777 *)
1778   cf_dir=`echo $INSTALL|sed -e 's%/[^/]*$%%'`
1779   test -z "$cf_dir" && cf_dir=.
1780   INSTALL=`cd $cf_dir && pwd`/`echo $INSTALL | sed -e 's:^.*/::'`
1781   ;;
1782 esac
1783
1784 echo $ac_n "checking for long file names""... $ac_c" 1>&6
1785 echo "configure:1786: checking for long file names" >&5
1786 if eval "test \"`echo '$''{'ac_cv_sys_long_file_names'+set}'`\" = set"; then
1787   echo $ac_n "(cached) $ac_c" 1>&6
1788 else
1789   ac_cv_sys_long_file_names=yes
1790 # Test for long file names in all the places we know might matter:
1791 #      .                the current directory, where building will happen
1792 #      $prefix/lib      where we will be installing things
1793 #      $exec_prefix/lib likewise
1794 # eval it to expand exec_prefix.
1795 #      $TMPDIR          if set, where it might want to write temporary files
1796 # if $TMPDIR is not set:
1797 #      /tmp             where it might want to write temporary files
1798 #      /var/tmp         likewise
1799 #      /usr/tmp         likewise
1800 if test -n "$TMPDIR" && test -d "$TMPDIR" && test -w "$TMPDIR"; then
1801   ac_tmpdirs="$TMPDIR"
1802 else
1803   ac_tmpdirs='/tmp /var/tmp /usr/tmp'
1804 fi
1805 for ac_dir in  . $ac_tmpdirs `eval echo $prefix/lib $exec_prefix/lib` ; do
1806   test -d $ac_dir || continue
1807   test -w $ac_dir || continue # It is less confusing to not echo anything here.
1808   (echo 1 > $ac_dir/conftest9012345) 2>/dev/null
1809   (echo 2 > $ac_dir/conftest9012346) 2>/dev/null
1810   val=`cat $ac_dir/conftest9012345 2>/dev/null`
1811   if test ! -f $ac_dir/conftest9012345 || test "$val" != 1; then
1812     ac_cv_sys_long_file_names=no
1813     rm -f $ac_dir/conftest9012345 $ac_dir/conftest9012346 2>/dev/null
1814     break
1815   fi
1816   rm -f $ac_dir/conftest9012345 $ac_dir/conftest9012346 2>/dev/null
1817 done
1818 fi
1819
1820 echo "$ac_t""$ac_cv_sys_long_file_names" 1>&6
1821 if test $ac_cv_sys_long_file_names = yes; then
1822   cat >> confdefs.h <<\EOF
1823 #define HAVE_LONG_FILE_NAMES 1
1824 EOF
1825
1826 fi
1827
1828
1829 echo $ac_n "checking if filesystem supports mixed-case filenames""... $ac_c" 1>&6
1830 echo "configure:1831: checking if filesystem supports mixed-case filenames" >&5
1831 if eval "test \"`echo '$''{'cf_cv_mixedcase'+set}'`\" = set"; then
1832   echo $ac_n "(cached) $ac_c" 1>&6
1833 else
1834   
1835         rm -f conftest CONFTEST
1836         echo test >conftest
1837         if test -f CONFTEST ; then
1838                 cf_cv_mixedcase=no
1839         else
1840                 cf_cv_mixedcase=yes
1841         fi
1842         rm -f conftest CONFTEST
1843
1844 fi
1845
1846 echo "$ac_t""$cf_cv_mixedcase" 1>&6
1847 test "$cf_cv_mixedcase" = yes && cat >> confdefs.h <<\EOF
1848 #define MIXEDCASE_FILENAMES 1
1849 EOF
1850
1851
1852 echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
1853 echo "configure:1854: checking whether ln -s works" >&5
1854 if eval "test \"`echo '$''{'ac_cv_prog_LN_S'+set}'`\" = set"; then
1855   echo $ac_n "(cached) $ac_c" 1>&6
1856 else
1857   rm -f conftestdata
1858 if ln -s X conftestdata 2>/dev/null
1859 then
1860   rm -f conftestdata
1861   ac_cv_prog_LN_S="ln -s"
1862 else
1863   ac_cv_prog_LN_S=ln
1864 fi
1865 fi
1866 LN_S="$ac_cv_prog_LN_S"
1867 if test "$ac_cv_prog_LN_S" = "ln -s"; then
1868   echo "$ac_t""yes" 1>&6
1869 else
1870   echo "$ac_t""no" 1>&6
1871 fi
1872
1873 # Extract the first word of "ranlib", so it can be a program name with args.
1874 set dummy ranlib; ac_word=$2
1875 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1876 echo "configure:1877: checking for $ac_word" >&5
1877 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
1878   echo $ac_n "(cached) $ac_c" 1>&6
1879 else
1880   if test -n "$RANLIB"; then
1881   ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
1882 else
1883   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
1884   ac_dummy="$PATH"
1885   for ac_dir in $ac_dummy; do
1886     test -z "$ac_dir" && ac_dir=.
1887     if test -f $ac_dir/$ac_word; then
1888       ac_cv_prog_RANLIB="ranlib"
1889       break
1890     fi
1891   done
1892   IFS="$ac_save_ifs"
1893   test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":"
1894 fi
1895 fi
1896 RANLIB="$ac_cv_prog_RANLIB"
1897 if test -n "$RANLIB"; then
1898   echo "$ac_t""$RANLIB" 1>&6
1899 else
1900   echo "$ac_t""no" 1>&6
1901 fi
1902
1903
1904
1905 # Extract the first word of "ctags", so it can be a program name with args.
1906 set dummy ctags; ac_word=$2
1907 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1908 echo "configure:1909: checking for $ac_word" >&5
1909 if eval "test \"`echo '$''{'ac_cv_prog_MAKE_LOWER_TAGS'+set}'`\" = set"; then
1910   echo $ac_n "(cached) $ac_c" 1>&6
1911 else
1912   if test -n "$MAKE_LOWER_TAGS"; then
1913   ac_cv_prog_MAKE_LOWER_TAGS="$MAKE_LOWER_TAGS" # Let the user override the test.
1914 else
1915   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
1916   ac_dummy="$PATH"
1917   for ac_dir in $ac_dummy; do
1918     test -z "$ac_dir" && ac_dir=.
1919     if test -f $ac_dir/$ac_word; then
1920       ac_cv_prog_MAKE_LOWER_TAGS="yes"
1921       break
1922     fi
1923   done
1924   IFS="$ac_save_ifs"
1925   test -z "$ac_cv_prog_MAKE_LOWER_TAGS" && ac_cv_prog_MAKE_LOWER_TAGS="no"
1926 fi
1927 fi
1928 MAKE_LOWER_TAGS="$ac_cv_prog_MAKE_LOWER_TAGS"
1929 if test -n "$MAKE_LOWER_TAGS"; then
1930   echo "$ac_t""$MAKE_LOWER_TAGS" 1>&6
1931 else
1932   echo "$ac_t""no" 1>&6
1933 fi
1934
1935
1936 if test "$cf_cv_mixedcase" = yes ; then
1937         # Extract the first word of "etags", so it can be a program name with args.
1938 set dummy etags; ac_word=$2
1939 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1940 echo "configure:1941: checking for $ac_word" >&5
1941 if eval "test \"`echo '$''{'ac_cv_prog_MAKE_UPPER_TAGS'+set}'`\" = set"; then
1942   echo $ac_n "(cached) $ac_c" 1>&6
1943 else
1944   if test -n "$MAKE_UPPER_TAGS"; then
1945   ac_cv_prog_MAKE_UPPER_TAGS="$MAKE_UPPER_TAGS" # Let the user override the test.
1946 else
1947   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
1948   ac_dummy="$PATH"
1949   for ac_dir in $ac_dummy; do
1950     test -z "$ac_dir" && ac_dir=.
1951     if test -f $ac_dir/$ac_word; then
1952       ac_cv_prog_MAKE_UPPER_TAGS="yes"
1953       break
1954     fi
1955   done
1956   IFS="$ac_save_ifs"
1957   test -z "$ac_cv_prog_MAKE_UPPER_TAGS" && ac_cv_prog_MAKE_UPPER_TAGS="no"
1958 fi
1959 fi
1960 MAKE_UPPER_TAGS="$ac_cv_prog_MAKE_UPPER_TAGS"
1961 if test -n "$MAKE_UPPER_TAGS"; then
1962   echo "$ac_t""$MAKE_UPPER_TAGS" 1>&6
1963 else
1964   echo "$ac_t""no" 1>&6
1965 fi
1966
1967 else
1968         MAKE_UPPER_TAGS=no
1969 fi
1970
1971 if test "$MAKE_UPPER_TAGS" = yes ; then
1972         MAKE_UPPER_TAGS=
1973 else
1974         MAKE_UPPER_TAGS="#"
1975 fi
1976
1977
1978 if test "$MAKE_LOWER_TAGS" = yes ; then
1979         MAKE_LOWER_TAGS=
1980 else
1981         MAKE_LOWER_TAGS="#"
1982 fi
1983
1984
1985 for ac_prog in tdlint lint alint
1986 do
1987 # Extract the first word of "$ac_prog", so it can be a program name with args.
1988 set dummy $ac_prog; ac_word=$2
1989 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1990 echo "configure:1991: checking for $ac_word" >&5
1991 if eval "test \"`echo '$''{'ac_cv_prog_LINT'+set}'`\" = set"; then
1992   echo $ac_n "(cached) $ac_c" 1>&6
1993 else
1994   if test -n "$LINT"; then
1995   ac_cv_prog_LINT="$LINT" # Let the user override the test.
1996 else
1997   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
1998   ac_dummy="$PATH"
1999   for ac_dir in $ac_dummy; do
2000     test -z "$ac_dir" && ac_dir=.
2001     if test -f $ac_dir/$ac_word; then
2002       ac_cv_prog_LINT="$ac_prog"
2003       break
2004     fi
2005   done
2006   IFS="$ac_save_ifs"
2007 fi
2008 fi
2009 LINT="$ac_cv_prog_LINT"
2010 if test -n "$LINT"; then
2011   echo "$ac_t""$LINT" 1>&6
2012 else
2013   echo "$ac_t""no" 1>&6
2014 fi
2015
2016 test -n "$LINT" && break
2017 done
2018
2019 for ac_prog in man man_db
2020 do
2021 # Extract the first word of "$ac_prog", so it can be a program name with args.
2022 set dummy $ac_prog; ac_word=$2
2023 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2024 echo "configure:2025: checking for $ac_word" >&5
2025 if eval "test \"`echo '$''{'ac_cv_prog_MAN'+set}'`\" = set"; then
2026   echo $ac_n "(cached) $ac_c" 1>&6
2027 else
2028   if test -n "$MAN"; then
2029   ac_cv_prog_MAN="$MAN" # Let the user override the test.
2030 else
2031   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2032   ac_dummy="$PATH"
2033   for ac_dir in $ac_dummy; do
2034     test -z "$ac_dir" && ac_dir=.
2035     if test -f $ac_dir/$ac_word; then
2036       ac_cv_prog_MAN="$ac_prog"
2037       break
2038     fi
2039   done
2040   IFS="$ac_save_ifs"
2041 fi
2042 fi
2043 MAN="$ac_cv_prog_MAN"
2044 if test -n "$MAN"; then
2045   echo "$ac_t""$MAN" 1>&6
2046 else
2047   echo "$ac_t""no" 1>&6
2048 fi
2049
2050 test -n "$MAN" && break
2051 done
2052
2053
2054
2055 if eval "test \"`echo '$''{'cf_cv_subst_LD'+set}'`\" = set"; then
2056   echo $ac_n "(cached) $ac_c" 1>&6
2057 else
2058   
2059 echo $ac_n "checking for loader (symbol LD)""... $ac_c" 1>&6
2060 echo "configure:2061: checking for loader (symbol LD)" >&5
2061 test -z "$LD" && LD=ld
2062 echo "$ac_t""$LD" 1>&6
2063
2064 cf_cv_subst_LD=$LD
2065 fi
2066
2067 LD=${cf_cv_subst_LD}
2068
2069 if eval "test \"`echo '$''{'cf_cv_subst_AR'+set}'`\" = set"; then
2070   echo $ac_n "(cached) $ac_c" 1>&6
2071 else
2072   
2073 echo $ac_n "checking for archiver (symbol AR)""... $ac_c" 1>&6
2074 echo "configure:2075: checking for archiver (symbol AR)" >&5
2075 test -z "$AR" && AR=ar
2076 echo "$ac_t""$AR" 1>&6
2077
2078 cf_cv_subst_AR=$AR
2079 fi
2080
2081 AR=${cf_cv_subst_AR}
2082
2083 if eval "test \"`echo '$''{'cf_cv_subst_AR_OPTS'+set}'`\" = set"; then
2084   echo $ac_n "(cached) $ac_c" 1>&6
2085 else
2086   
2087 echo $ac_n "checking for archiver options (symbol AR_OPTS)""... $ac_c" 1>&6
2088 echo "configure:2089: checking for archiver options (symbol AR_OPTS)" >&5
2089 test -z "$AR_OPTS" && AR_OPTS=rv
2090 echo "$ac_t""$AR_OPTS" 1>&6
2091
2092 cf_cv_subst_AR_OPTS=$AR_OPTS
2093 fi
2094
2095 AR_OPTS=${cf_cv_subst_AR_OPTS}
2096
2097
2098
2099 echo $ac_n "checking for makeflags variable""... $ac_c" 1>&6
2100 echo "configure:2101: checking for makeflags variable" >&5
2101 if eval "test \"`echo '$''{'cf_cv_makeflags'+set}'`\" = set"; then
2102   echo $ac_n "(cached) $ac_c" 1>&6
2103 else
2104   
2105         cf_cv_makeflags=''
2106         for cf_option in '-$(MAKEFLAGS)' '$(MFLAGS)'
2107         do
2108                 cat >cf_makeflags.tmp <<CF_EOF
2109 all :
2110         @ echo '.$cf_option'
2111 CF_EOF
2112                 cf_result=`${MAKE-make} -k -f cf_makeflags.tmp 2>/dev/null`
2113                 case "$cf_result" in
2114                 .*k)
2115                         cf_result=`${MAKE-make} -k -f cf_makeflags.tmp CC=cc 2>/dev/null`
2116                         case "$cf_result" in
2117                         .*CC=*) cf_cv_makeflags=
2118                                 ;;
2119                         *)      cf_cv_makeflags=$cf_option
2120                                 ;;
2121                         esac
2122                         break
2123                         ;;
2124                 *)      echo no match "$cf_result"
2125                         ;;
2126                 esac
2127         done
2128         rm -f cf_makeflags.tmp
2129 fi
2130
2131 echo "$ac_t""$cf_cv_makeflags" 1>&6
2132
2133
2134
2135 echo $ac_n "checking if you have specified an install-prefix""... $ac_c" 1>&6
2136 echo "configure:2137: checking if you have specified an install-prefix" >&5
2137
2138 # Check whether --with-install-prefix or --without-install-prefix was given.
2139 if test "${with_install_prefix+set}" = set; then
2140   withval="$with_install_prefix"
2141   case "$withval" in #(vi
2142         yes|no) #(vi
2143                 ;;
2144         *)      DESTDIR="$withval"
2145                 ;;
2146         esac
2147 fi
2148
2149 echo "$ac_t""$DESTDIR" 1>&6
2150
2151
2152 ###############################################################################
2153
2154
2155 ### Options to allow the user to specify the set of libraries which are used.
2156 ### Use "--without-normal --with-shared" to allow the default model to be
2157 ### shared, for example.
2158 cf_list_models=""
2159
2160 echo $ac_n "checking if you want to build libraries with libtool""... $ac_c" 1>&6
2161 echo "configure:2162: checking if you want to build libraries with libtool" >&5
2162
2163 # Check whether --with-libtool or --without-libtool was given.
2164 if test "${with_libtool+set}" = set; then
2165   withval="$with_libtool"
2166   with_libtool=$withval
2167 else
2168   with_libtool=no
2169 fi
2170
2171 echo "$ac_t""$with_libtool" 1>&6
2172 if test "$with_libtool" = "yes"; then
2173         cf_list_models="$cf_list_models libtool"
2174         test -z "$LIBTOOL" && LIBTOOL=libtool
2175 else
2176         LIBTOOL=""
2177 fi
2178
2179
2180 echo $ac_n "checking if you want to build shared libraries""... $ac_c" 1>&6
2181 echo "configure:2182: checking if you want to build shared libraries" >&5
2182
2183 # Check whether --with-shared or --without-shared was given.
2184 if test "${with_shared+set}" = set; then
2185   withval="$with_shared"
2186   with_shared=$withval
2187 else
2188   with_shared=no
2189 fi
2190
2191 echo "$ac_t""$with_shared" 1>&6
2192 test "$with_shared" = "yes" && cf_list_models="$cf_list_models shared"
2193
2194 echo $ac_n "checking if you want to build static libraries""... $ac_c" 1>&6
2195 echo "configure:2196: checking if you want to build static libraries" >&5
2196
2197 # Check whether --with-normal or --without-normal was given.
2198 if test "${with_normal+set}" = set; then
2199   withval="$with_normal"
2200   with_normal=$withval
2201 else
2202   with_normal=yes
2203 fi
2204
2205 echo "$ac_t""$with_normal" 1>&6
2206 test "$with_normal" = "yes" && cf_list_models="$cf_list_models normal"
2207
2208 echo $ac_n "checking if you want to build debug libraries""... $ac_c" 1>&6
2209 echo "configure:2210: checking if you want to build debug libraries" >&5
2210
2211 # Check whether --with-debug or --without-debug was given.
2212 if test "${with_debug+set}" = set; then
2213   withval="$with_debug"
2214   with_debug=$withval
2215 else
2216   with_debug=yes
2217 fi
2218
2219 echo "$ac_t""$with_debug" 1>&6
2220 test "$with_debug" = "yes" && cf_list_models="$cf_list_models debug"
2221
2222 echo $ac_n "checking if you want to build profiling libraries""... $ac_c" 1>&6
2223 echo "configure:2224: checking if you want to build profiling libraries" >&5
2224
2225 # Check whether --with-profile or --without-profile was given.
2226 if test "${with_profile+set}" = set; then
2227   withval="$with_profile"
2228   with_profile=$withval
2229 else
2230   with_profile=no
2231 fi
2232
2233 echo "$ac_t""$with_profile" 1>&6
2234 test "$with_profile" = "yes" && cf_list_models="$cf_list_models profile"
2235
2236 ###############################################################################
2237
2238 echo $ac_n "checking for specified models""... $ac_c" 1>&6
2239 echo "configure:2240: checking for specified models" >&5
2240 test -z "$cf_list_models" && cf_list_models=normal
2241 test "$with_libtool" = "yes" && cf_list_models=libtool
2242 echo "$ac_t""$cf_list_models" 1>&6
2243
2244 ### Use the first model as the default, and save its suffix for use in building
2245 ### up test-applications.
2246 echo $ac_n "checking for default model""... $ac_c" 1>&6
2247 echo "configure:2248: checking for default model" >&5
2248 DFT_LWR_MODEL=`echo $cf_list_models | $AWK '{print $1}'`
2249 echo "$ac_t""$DFT_LWR_MODEL" 1>&6
2250
2251
2252 DFT_UPR_MODEL=`echo "$DFT_LWR_MODEL" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
2253
2254
2255 TINFO_NAME=tinfo
2256
2257
2258 LIB_NAME=ncurses
2259
2260
2261 LIB_DIR=../lib
2262
2263         case $cf_cv_system_name in
2264         os2)    LIB_PREFIX=''     ;;
2265         *)      LIB_PREFIX='lib'  ;;
2266         esac
2267 cf_prefix=$LIB_PREFIX
2268         
2269
2270 LIB_PREFIX=$cf_prefix
2271
2272
2273 LIB_SUFFIX=
2274
2275
2276 ###############################################################################
2277
2278 echo $ac_n "checking if you want to build a separate terminfo library""... $ac_c" 1>&6
2279 echo "configure:2280: checking if you want to build a separate terminfo library" >&5
2280
2281 # Check whether --with-termlib or --without-termlib was given.
2282 if test "${with_termlib+set}" = set; then
2283   withval="$with_termlib"
2284   with_termlib=$withval
2285 else
2286   with_termlib=no
2287 fi
2288
2289 echo "$ac_t""$with_termlib" 1>&6
2290
2291 ### Checks for special libraries, must be done up-front.
2292 echo $ac_n "checking if you want to link with dbmalloc for testing""... $ac_c" 1>&6
2293 echo "configure:2294: checking if you want to link with dbmalloc for testing" >&5
2294
2295 # Check whether --with-dbmalloc or --without-dbmalloc was given.
2296 if test "${with_dbmalloc+set}" = set; then
2297   withval="$with_dbmalloc"
2298   with_dbmalloc=$withval
2299 else
2300   with_dbmalloc=no
2301 fi
2302
2303 echo "$ac_t""$with_dbmalloc" 1>&6
2304 if test "$with_dbmalloc" = yes ; then
2305         echo $ac_n "checking for debug_malloc in -ldbmalloc""... $ac_c" 1>&6
2306 echo "configure:2307: checking for debug_malloc in -ldbmalloc" >&5
2307 ac_lib_var=`echo dbmalloc'_'debug_malloc | sed 'y%./+-%__p_%'`
2308 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
2309   echo $ac_n "(cached) $ac_c" 1>&6
2310 else
2311   ac_save_LIBS="$LIBS"
2312 LIBS="-ldbmalloc  $LIBS"
2313 cat > conftest.$ac_ext <<EOF
2314 #line 2315 "configure"
2315 #include "confdefs.h"
2316 /* Override any gcc2 internal prototype to avoid an error.  */
2317 /* We use char because int might match the return type of a gcc2
2318     builtin and then its argument prototype would still apply.  */
2319 char debug_malloc();
2320
2321 int main() {
2322 debug_malloc()
2323 ; return 0; }
2324 EOF
2325 if { (eval echo configure:2326: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2326   rm -rf conftest*
2327   eval "ac_cv_lib_$ac_lib_var=yes"
2328 else
2329   echo "configure: failed program was:" >&5
2330   cat conftest.$ac_ext >&5
2331   rm -rf conftest*
2332   eval "ac_cv_lib_$ac_lib_var=no"
2333 fi
2334 rm -f conftest*
2335 LIBS="$ac_save_LIBS"
2336
2337 fi
2338 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
2339   echo "$ac_t""yes" 1>&6
2340     ac_tr_lib=HAVE_LIB`echo dbmalloc | sed -e 's/[^a-zA-Z0-9_]/_/g' \
2341     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
2342   cat >> confdefs.h <<EOF
2343 #define $ac_tr_lib 1
2344 EOF
2345
2346   LIBS="-ldbmalloc $LIBS"
2347
2348 else
2349   echo "$ac_t""no" 1>&6
2350 fi
2351
2352 fi
2353
2354 echo $ac_n "checking if you want to link with dmalloc for testing""... $ac_c" 1>&6
2355 echo "configure:2356: checking if you want to link with dmalloc for testing" >&5
2356
2357 # Check whether --with-dmalloc or --without-dmalloc was given.
2358 if test "${with_dmalloc+set}" = set; then
2359   withval="$with_dmalloc"
2360   with_dmalloc=$withval
2361 else
2362   with_dmalloc=no
2363 fi
2364
2365 echo "$ac_t""$with_dmalloc" 1>&6
2366 if test "$with_dmalloc" = yes ; then
2367         echo $ac_n "checking for dmalloc_debug in -ldmalloc""... $ac_c" 1>&6
2368 echo "configure:2369: checking for dmalloc_debug in -ldmalloc" >&5
2369 ac_lib_var=`echo dmalloc'_'dmalloc_debug | sed 'y%./+-%__p_%'`
2370 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
2371   echo $ac_n "(cached) $ac_c" 1>&6
2372 else
2373   ac_save_LIBS="$LIBS"
2374 LIBS="-ldmalloc  $LIBS"
2375 cat > conftest.$ac_ext <<EOF
2376 #line 2377 "configure"
2377 #include "confdefs.h"
2378 /* Override any gcc2 internal prototype to avoid an error.  */
2379 /* We use char because int might match the return type of a gcc2
2380     builtin and then its argument prototype would still apply.  */
2381 char dmalloc_debug();
2382
2383 int main() {
2384 dmalloc_debug()
2385 ; return 0; }
2386 EOF
2387 if { (eval echo configure:2388: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2388   rm -rf conftest*
2389   eval "ac_cv_lib_$ac_lib_var=yes"
2390 else
2391   echo "configure: failed program was:" >&5
2392   cat conftest.$ac_ext >&5
2393   rm -rf conftest*
2394   eval "ac_cv_lib_$ac_lib_var=no"
2395 fi
2396 rm -f conftest*
2397 LIBS="$ac_save_LIBS"
2398
2399 fi
2400 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
2401   echo "$ac_t""yes" 1>&6
2402     ac_tr_lib=HAVE_LIB`echo dmalloc | sed -e 's/[^a-zA-Z0-9_]/_/g' \
2403     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
2404   cat >> confdefs.h <<EOF
2405 #define $ac_tr_lib 1
2406 EOF
2407
2408   LIBS="-ldmalloc $LIBS"
2409
2410 else
2411   echo "$ac_t""no" 1>&6
2412 fi
2413
2414 fi
2415
2416 SHLIB_LIST=""
2417 echo $ac_n "checking if you want to link with the gpm mouse library""... $ac_c" 1>&6
2418 echo "configure:2419: checking if you want to link with the gpm mouse library" >&5
2419
2420 # Check whether --with-gpm or --without-gpm was given.
2421 if test "${with_gpm+set}" = set; then
2422   withval="$with_gpm"
2423   with_gpm=$withval
2424 else
2425   with_gpm=no
2426 fi
2427
2428 echo "$ac_t""$with_gpm" 1>&6
2429 if test "$with_gpm" = yes ; then
2430         echo $ac_n "checking for Gpm_Open in -lgpm""... $ac_c" 1>&6
2431 echo "configure:2432: checking for Gpm_Open in -lgpm" >&5
2432 ac_lib_var=`echo gpm'_'Gpm_Open | sed 'y%./+-%__p_%'`
2433 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
2434   echo $ac_n "(cached) $ac_c" 1>&6
2435 else
2436   ac_save_LIBS="$LIBS"
2437 LIBS="-lgpm  $LIBS"
2438 cat > conftest.$ac_ext <<EOF
2439 #line 2440 "configure"
2440 #include "confdefs.h"
2441 /* Override any gcc2 internal prototype to avoid an error.  */
2442 /* We use char because int might match the return type of a gcc2
2443     builtin and then its argument prototype would still apply.  */
2444 char Gpm_Open();
2445
2446 int main() {
2447 Gpm_Open()
2448 ; return 0; }
2449 EOF
2450 if { (eval echo configure:2451: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2451   rm -rf conftest*
2452   eval "ac_cv_lib_$ac_lib_var=yes"
2453 else
2454   echo "configure: failed program was:" >&5
2455   cat conftest.$ac_ext >&5
2456   rm -rf conftest*
2457   eval "ac_cv_lib_$ac_lib_var=no"
2458 fi
2459 rm -f conftest*
2460 LIBS="$ac_save_LIBS"
2461
2462 fi
2463 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
2464   echo "$ac_t""yes" 1>&6
2465   
2466                 EXTRA_LIBS="-lgpm -lncurses $EXTRA_LIBS"
2467                 SHLIB_LIST="-lgpm $SHLIB_LIST"
2468                 cat >> confdefs.h <<\EOF
2469 #define HAVE_LIBGPM 1
2470 EOF
2471
2472                 for ac_hdr in gpm.h
2473 do
2474 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
2475 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
2476 echo "configure:2477: checking for $ac_hdr" >&5
2477 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
2478   echo $ac_n "(cached) $ac_c" 1>&6
2479 else
2480   cat > conftest.$ac_ext <<EOF
2481 #line 2482 "configure"
2482 #include "confdefs.h"
2483 #include <$ac_hdr>
2484 EOF
2485 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
2486 { (eval echo configure:2487: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
2487 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
2488 if test -z "$ac_err"; then
2489   rm -rf conftest*
2490   eval "ac_cv_header_$ac_safe=yes"
2491 else
2492   echo "$ac_err" >&5
2493   echo "configure: failed program was:" >&5
2494   cat conftest.$ac_ext >&5
2495   rm -rf conftest*
2496   eval "ac_cv_header_$ac_safe=no"
2497 fi
2498 rm -f conftest*
2499 fi
2500 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
2501   echo "$ac_t""yes" 1>&6
2502     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
2503   cat >> confdefs.h <<EOF
2504 #define $ac_tr_hdr 1
2505 EOF
2506  
2507 else
2508   echo "$ac_t""no" 1>&6
2509 fi
2510 done
2511
2512         
2513 else
2514   echo "$ac_t""no" 1>&6
2515 echo "configure: warning: Cannot link with gpm library - read the FAQ" 1>&2
2516 fi
2517
2518 fi
2519
2520
2521 if test X"$CC_G_OPT" = X"" ; then
2522         CC_G_OPT='-g'
2523         test -n "$GCC" && test "${ac_cv_prog_cc_g}" != yes && CC_G_OPT=''
2524 fi
2525
2526
2527 if test X"$CXX_G_OPT" = X"" ; then
2528         CXX_G_OPT='-g'
2529         test -n "$GXX" && test "${ac_cv_prog_cxx_g}" != yes && CXX_G_OPT=''
2530 fi
2531
2532
2533 echo $ac_n "checking for default loader flags""... $ac_c" 1>&6
2534 echo "configure:2535: checking for default loader flags" >&5
2535 case $DFT_LWR_MODEL in
2536 libtool) LD_MODEL=''   ;;
2537 normal)  LD_MODEL=''   ;;
2538 debug)   LD_MODEL=$CC_G_OPT ;;
2539 profile) LD_MODEL='-pg';;
2540 shared)  LD_MODEL=''   ;;
2541 esac
2542 echo "$ac_t""$LD_MODEL" 1>&6
2543
2544 echo $ac_n "checking if rpath option should be used""... $ac_c" 1>&6
2545 echo "configure:2546: checking if rpath option should be used" >&5
2546
2547 # Check whether --enable-rpath or --disable-rpath was given.
2548 if test "${enable_rpath+set}" = set; then
2549   enableval="$enable_rpath"
2550   cf_cv_ld_rpath=$enableval
2551 else
2552   cf_cv_ld_rpath=no
2553 fi
2554
2555 echo "$ac_t""$cf_cv_ld_rpath" 1>&6
2556
2557
2558         
2559         LOCAL_LDFLAGS=
2560         LOCAL_LDFLAGS2=
2561         LD_SHARED_OPTS=
2562         INSTALL_LIB="-m 644"
2563
2564         cf_cv_do_symlinks=no
2565
2566         echo $ac_n "checking if release/abi version should be used for shared libs""... $ac_c" 1>&6
2567 echo "configure:2568: checking if release/abi version should be used for shared libs" >&5
2568         
2569 # Check whether --with-shlib-version or --without-shlib-version was given.
2570 if test "${with_shlib_version+set}" = set; then
2571   withval="$with_shlib_version"
2572   test -z "$withval" && withval=auto
2573         case $withval in #(vi
2574         yes) #(vi
2575                 cf_cv_shlib_version=auto
2576                 ;;
2577         rel|abi|auto|no) #(vi
2578                 cf_cv_shlib_version=$withval
2579                 ;;
2580         *)
2581                 { echo "configure: error: option value must be one of: rel, abi, auto or no" 1>&2; exit 1; }
2582                 ;;
2583         esac
2584         
2585 else
2586   cf_cv_shlib_version=auto
2587 fi
2588
2589         echo "$ac_t""$cf_cv_shlib_version" 1>&6
2590
2591         cf_cv_rm_so_locs=no
2592
2593         # Some less-capable ports of gcc support only -fpic
2594         CC_SHARED_OPTS=
2595         if test "$GCC" = yes
2596         then
2597                 echo $ac_n "checking which $CC option to use""... $ac_c" 1>&6
2598 echo "configure:2599: checking which $CC option to use" >&5
2599                 cf_save_CFLAGS="$CFLAGS"
2600                 for CC_SHARED_OPTS in -fPIC -fpic ''
2601                 do
2602                         CFLAGS="$cf_save_CFLAGS $CC_SHARED_OPTS"
2603                         cat > conftest.$ac_ext <<EOF
2604 #line 2605 "configure"
2605 #include "confdefs.h"
2606 #include <stdio.h>
2607 int main() {
2608 int x = 1
2609 ; return 0; }
2610 EOF
2611 if { (eval echo configure:2612: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
2612   rm -rf conftest*
2613   break
2614 else
2615   echo "configure: failed program was:" >&5
2616   cat conftest.$ac_ext >&5
2617 fi
2618 rm -f conftest*
2619                 done
2620                 echo "$ac_t""$CC_SHARED_OPTS" 1>&6
2621                 CFLAGS="$cf_save_CFLAGS"
2622         fi
2623
2624         case $cf_cv_system_name in
2625         beos*)
2626                 MK_SHARED_LIB='$(CC) -o $@ -Xlinker -soname=`basename $@` -nostart -e 0'
2627                 ;;
2628         hpux*)
2629                 # (tested with gcc 2.7.2 -- I don't have c89)
2630                 if test "$GCC" = yes; then
2631                         LD_SHARED_OPTS='-Xlinker +b -Xlinker $(libdir)'
2632                 else
2633                         CC_SHARED_OPTS='+Z'
2634                         LD_SHARED_OPTS='-Wl,+b,$(libdir)'
2635                 fi
2636                 MK_SHARED_LIB='$(LD) +b $(libdir) -b -o $@'
2637                 # HP-UX shared libraries must be executable, and should be
2638                 # readonly to exploit a quirk in the memory manager.
2639                 INSTALL_LIB="-m 555"
2640                 ;;
2641         irix*)
2642                 if test "$cf_cv_ld_rpath" = yes ; then
2643                         cf_ld_rpath_opt="-Wl,-rpath,"
2644                         EXTRA_LDFLAGS="-Wl,-rpath,\$(libdir) $EXTRA_LDFLAGS"
2645                 fi
2646                 # tested with IRIX 5.2 and 'cc'.
2647                 if test "$GCC" != yes; then
2648                         CC_SHARED_OPTS='-KPIC'
2649                 fi
2650                 MK_SHARED_LIB='$(LD) -shared -rdata_shared -soname `basename $@` -o $@'
2651                 cf_cv_rm_so_locs=yes
2652                 ;;
2653         linux*|gnu*)
2654                 if test "$DFT_LWR_MODEL" = "shared" ; then
2655                         LOCAL_LDFLAGS="-Wl,-rpath,`pwd`/lib"
2656                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
2657                 fi
2658                 if test "$cf_cv_ld_rpath" = yes ; then
2659                         cf_ld_rpath_opt="-Wl,-rpath,"
2660                         EXTRA_LDFLAGS="$LOCAL_LDFLAGS $EXTRA_LDFLAGS"
2661                 fi
2662                 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
2663                 MK_SHARED_LIB='$(CC) -shared -Wl,-soname,`basename $@ .$(REL_VERSION)`.$(ABI_VERSION),-stats,-lc -o $@'
2664                 ;;
2665         openbsd2*)
2666                 CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
2667                 MK_SHARED_LIB='$(LD) -Bshareable -soname,`basename $@.$(ABI_VERSION)` -o $@'
2668                 ;;
2669         openbsd*|freebsd*)
2670                 CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
2671                 MK_SHARED_LIB='$(LD) -Bshareable -o $@'
2672                 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
2673                 ;;
2674         netbsd*)
2675                 CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
2676                 test "$cf_cv_ld_rpath" = yes && cf_ld_rpath_opt="-Wl,-rpath,"
2677                 if test "$DFT_LWR_MODEL" = "shared" && test "$cf_cv_ld_rpath" = yes ; then
2678                         LOCAL_LDFLAGS="-Wl,-rpath,`pwd`/lib"
2679                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
2680                         EXTRA_LDFLAGS="-Wl,-rpath,\$(libdir) $EXTRA_LDFLAGS"
2681                         MK_SHARED_LIB='$(CC) -shared -Wl,-soname,`basename $@ .$(REL_VERSION)`.$(ABI_VERSION) -o $@'
2682                         if test "$cf_cv_shlib_version" = auto; then
2683                         if test ! -f /usr/libexec/ld.elf_so; then
2684                                 cf_cv_shlib_version=rel
2685                         fi
2686                         fi
2687                 else
2688                         MK_SHARED_LIB='$(LD) -Bshareable -o $@'
2689                 fi
2690                 ;;
2691         osf*|mls+*)
2692                 # tested with OSF/1 V3.2 and 'cc'
2693                 # tested with OSF/1 V3.2 and gcc 2.6.3 (but the c++ demo didn't
2694                 # link with shared libs).
2695                 MK_SHARED_LIB='$(LD) -set_version $(REL_VERSION):$(ABI_VERSION) -expect_unresolved "*" -shared -soname `basename $@`'
2696                 case $host_os in
2697                 osf4*)
2698                         MK_SHARED_LIB="${MK_SHARED_LIB} -msym"
2699                         ;;
2700                 esac
2701                 MK_SHARED_LIB="${MK_SHARED_LIB}"' -o $@'
2702                 if test "$DFT_LWR_MODEL" = "shared" ; then
2703                         LOCAL_LDFLAGS="-Wl,-rpath,`pwd`/lib"
2704                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
2705                 fi
2706                 if test "$cf_cv_ld_rpath" = yes ; then
2707                         cf_ld_rpath_opt="-rpath"
2708                         # EXTRA_LDFLAGS="$LOCAL_LDFLAGS $EXTRA_LDFLAGS"
2709                 fi
2710                 cf_cv_rm_so_locs=yes
2711                 ;;
2712         sco3.2v5*)  # (also uw2* and UW7) hops 13-Apr-98
2713                 # tested with osr5.0.5
2714                 if test "$ac_cv_prog_gcc" != yes; then
2715                         CC_SHARED_OPTS='-belf -KPIC'
2716                 fi
2717                 MK_SHARED_LIB='$(LD) -dy -G -h `basename $@ .$(REL_VERSION)`.$(ABI_VERSION) -o $@'
2718                 if test "$cf_cv_ld_rpath" = yes ; then
2719                         # only way is to set LD_RUN_PATH but no switch for it
2720                         RUN_PATH=$libdir
2721                 fi
2722                 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
2723                 LINK_PROGS='LD_RUN_PATH=$(libdir)'
2724                 LINK_TESTS='Pwd=`pwd`;LD_RUN_PATH=`dirname $${Pwd}`/lib'
2725                 ;;
2726         sunos4*)
2727                 # tested with SunOS 4.1.1 and gcc 2.7.0
2728                 if test "$ac_cv_prog_gcc" != yes; then
2729                         CC_SHARED_OPTS='-KPIC'
2730                 fi
2731                 MK_SHARED_LIB='$(LD) -assert pure-text -o $@'
2732                 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
2733                 ;;
2734         solaris2*)
2735                 # tested with SunOS 5.5.1 (solaris 2.5.1) and gcc 2.7.2
2736                 if test "$ac_cv_prog_gcc" != yes; then
2737                         CC_SHARED_OPTS='-KPIC'
2738                 fi
2739                 MK_SHARED_LIB='$(LD) -dy -G -h `basename $@ .$(REL_VERSION)`.$(ABI_VERSION) -o $@'
2740                 if test "$DFT_LWR_MODEL" = "shared" ; then
2741                         LOCAL_LDFLAGS="-R `pwd`/lib:\$(libdir)"
2742                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
2743                 fi
2744                 if test "$cf_cv_ld_rpath" = yes ; then
2745                         cf_ld_rpath_opt="-R"
2746                         EXTRA_LDFLAGS="$LOCAL_LDFLAGS $EXTRA_LDFLAGS"
2747                 fi
2748                 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
2749                 ;;
2750         sysv5uw7*|unix_sv*)
2751                 # tested with UnixWare 7.1.0 (gcc 2.95.2 and cc)
2752                 if test "$ac_cv_prog_gcc" != yes; then
2753                         CC_SHARED_OPTS='-KPIC'
2754                 fi
2755                 MK_SHARED_LIB='$(LD) -d y -G -o $@'
2756                 ;;
2757         *)
2758                 CC_SHARED_OPTS='unknown'
2759                 MK_SHARED_LIB='echo unknown'
2760                 ;;
2761         esac
2762
2763         # This works if the last tokens in $MK_SHARED_LIB are the -o target.
2764         case "$cf_cv_shlib_version" in #(vi
2765         rel|abi)
2766                 case "$MK_SHARED_LIB" in #(vi
2767                 *'-o $@')
2768                         test "$cf_cv_do_symlinks" = no && cf_cv_do_symlinks=yes
2769                         ;;
2770                 *)
2771                         echo "configure: warning: ignored --with-shlib-version" 1>&2
2772                         ;;
2773                 esac
2774                 ;;
2775         esac
2776
2777         if test -n "$cf_ld_rpath_opt" ; then
2778                 echo $ac_n "checking if we need a space after rpath option""... $ac_c" 1>&6
2779 echo "configure:2780: checking if we need a space after rpath option" >&5
2780                 cf_save_LIBS="$LIBS"
2781                 LIBS="$LIBS ${cf_ld_rpath_opt}$libdir"
2782                 cat > conftest.$ac_ext <<EOF
2783 #line 2784 "configure"
2784 #include "confdefs.h"
2785
2786 int main() {
2787
2788 ; return 0; }
2789 EOF
2790 if { (eval echo configure:2791: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2791   rm -rf conftest*
2792   cf_rpath_space=no
2793 else
2794   echo "configure: failed program was:" >&5
2795   cat conftest.$ac_ext >&5
2796   rm -rf conftest*
2797   cf_rpath_space=yes
2798 fi
2799 rm -f conftest*
2800                 LIBS="$cf_save_LIBS"
2801                 echo "$ac_t""$cf_rpath_space" 1>&6
2802                 test "$cf_rpath_space" = yes && cf_ld_rpath_opt="$cf_ld_rpath_opt "
2803                 MK_SHARED_LIB="$MK_SHARED_LIB $cf_ld_rpath_opt\$(libdir)"
2804         fi
2805
2806         
2807         
2808         
2809         
2810         
2811         
2812         
2813         
2814         
2815
2816 if test "$CC_SHARED_OPTS" = "unknown"; then
2817         for model in $cf_list_models; do
2818                 if test "$model" = "shared"; then
2819                         { echo "configure: error: Shared libraries are not supported in this version" 1>&2; exit 1; }
2820                 fi
2821         done
2822 fi
2823
2824 ###############################################################################
2825
2826
2827 ###     use option --disable-overwrite to leave out the link to -lcurses
2828 echo $ac_n "checking if you wish to install ncurses overwriting curses""... $ac_c" 1>&6
2829 echo "configure:2830: checking if you wish to install ncurses overwriting curses" >&5
2830
2831 # Check whether --enable-overwrite or --disable-overwrite was given.
2832 if test "${enable_overwrite+set}" = set; then
2833   enableval="$enable_overwrite"
2834   with_overwrite=$enableval
2835 else
2836   with_overwrite=yes
2837 fi
2838
2839 echo "$ac_t""$with_overwrite" 1>&6
2840
2841 echo $ac_n "checking if external terminfo-database is used""... $ac_c" 1>&6
2842 echo "configure:2843: checking if external terminfo-database is used" >&5
2843
2844 # Check whether --enable-database or --disable-database was given.
2845 if test "${enable_database+set}" = set; then
2846   enableval="$enable_database"
2847   use_database=$enableval
2848 else
2849   use_database=yes
2850 fi
2851
2852 echo "$ac_t""$use_database" 1>&6
2853
2854 case $host_os in #(vi
2855 os2*) #(vi
2856         TERMINFO_SRC='${top_srcdir}/misc/emx.src'
2857         ;;
2858 *) #(vi
2859         TERMINFO_SRC='${top_srcdir}/misc/terminfo.src'
2860         ;;
2861 esac
2862
2863
2864 if test "$use_database" != no ; then
2865         cat >> confdefs.h <<\EOF
2866 #define USE_DATABASE 1
2867 EOF
2868
2869         echo $ac_n "checking which terminfo source-file will be installed""... $ac_c" 1>&6
2870 echo "configure:2871: checking which terminfo source-file will be installed" >&5
2871         
2872 # Check whether --enable-database or --disable-database was given.
2873 if test "${enable_database+set}" = set; then
2874   enableval="$enable_database"
2875   TERMINFO_SRC=$withval
2876 fi
2877
2878         echo "$ac_t""$TERMINFO_SRC" 1>&6
2879 fi
2880
2881 echo $ac_n "checking for list of fallback descriptions""... $ac_c" 1>&6
2882 echo "configure:2883: checking for list of fallback descriptions" >&5
2883
2884 # Check whether --with-fallbacks or --without-fallbacks was given.
2885 if test "${with_fallbacks+set}" = set; then
2886   withval="$with_fallbacks"
2887   with_fallback=$withval
2888 else
2889   with_fallback=
2890 fi
2891
2892 echo "$ac_t""$with_fallback" 1>&6
2893 FALLBACK_LIST=`echo $with_fallback|sed -e 's/,/ /g'`
2894
2895
2896 if test "$use_database" = no ; then
2897         if test -z $with_fallback ; then
2898                 { echo "configure: error: You have disabled the database w/o specifying fallbacks" 1>&2; exit 1; }
2899         fi
2900         TERMINFO="${datadir}/terminfo"
2901 else
2902
2903 echo $ac_n "checking for list of terminfo directories""... $ac_c" 1>&6
2904 echo "configure:2905: checking for list of terminfo directories" >&5
2905
2906
2907 # Check whether --with-terminfo-dirs or --without-terminfo-dirs was given.
2908 if test "${with_terminfo_dirs+set}" = set; then
2909   withval="$with_terminfo_dirs"
2910   :
2911 else
2912   withval="${TERMINFO_DIRS-${datadir}/terminfo}"
2913 fi
2914
2915 IFS="${IFS=     }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
2916 cf_dst_path=
2917 for cf_src_path in $withval
2918 do
2919   
2920 case ".$cf_src_path" in #(vi
2921 ./*) #(vi
2922   ;;
2923 .a-zA-Z:\\/*) #(vi OS/2 EMX
2924   ;;
2925 .\${*prefix}*) #(vi
2926   eval cf_src_path="$cf_src_path"
2927   case ".$cf_src_path" in #(vi
2928   .NONE/*)
2929     cf_src_path=`echo $cf_src_path | sed -e s@NONE@$ac_default_prefix@`
2930     ;;
2931   esac
2932   ;; #(vi
2933 .NONE/*)
2934   cf_src_path=`echo $cf_src_path | sed -e s@NONE@$ac_default_prefix@`
2935   ;;
2936 *)
2937   { echo "configure: error: expected a pathname" 1>&2; exit 1; }
2938   ;;
2939 esac
2940
2941   test -n "$cf_dst_path" && cf_dst_path="${cf_dst_path}:"
2942   cf_dst_path="${cf_dst_path}${cf_src_path}"
2943 done
2944 IFS="$ac_save_ifs"
2945
2946 eval TERMINFO_DIRS="$cf_dst_path"
2947
2948 echo "$ac_t""$TERMINFO_DIRS" 1>&6
2949 test -n "$TERMINFO_DIRS" && cat >> confdefs.h <<EOF
2950 #define TERMINFO_DIRS "$TERMINFO_DIRS"
2951 EOF
2952
2953
2954 echo $ac_n "checking for default terminfo directory""... $ac_c" 1>&6
2955 echo "configure:2956: checking for default terminfo directory" >&5
2956
2957 # Check whether --with-default-terminfo-dir or --without-default-terminfo-dir was given.
2958 if test "${with_default_terminfo_dir+set}" = set; then
2959   withval="$with_default_terminfo_dir"
2960   :
2961 else
2962   withval="${TERMINFO-${datadir}/terminfo}"
2963 fi
2964
2965 case ".$withval" in #(vi
2966 ./*) #(vi
2967   ;;
2968 .a-zA-Z:\\/*) #(vi OS/2 EMX
2969   ;;
2970 .\${*prefix}*) #(vi
2971   eval withval="$withval"
2972   case ".$withval" in #(vi
2973   .NONE/*)
2974     withval=`echo $withval | sed -e s@NONE@$ac_default_prefix@`
2975     ;;
2976   esac
2977   ;; #(vi
2978 .NONE/*)
2979   withval=`echo $withval | sed -e s@NONE@$ac_default_prefix@`
2980   ;;
2981 *)
2982   { echo "configure: error: expected a pathname" 1>&2; exit 1; }
2983   ;;
2984 esac
2985
2986 eval TERMINFO="$withval"
2987
2988 echo "$ac_t""$TERMINFO" 1>&6
2989 cat >> confdefs.h <<EOF
2990 #define TERMINFO "$TERMINFO"
2991 EOF
2992
2993
2994 fi
2995
2996
2997
2998 ###     use option --disable-big-core to make tic run on small machines
2999 ###     We need 4Mb, check if we can allocate 50% more than that.
3000 echo $ac_n "checking if big-core option selected""... $ac_c" 1>&6
3001 echo "configure:3002: checking if big-core option selected" >&5
3002
3003 # Check whether --enable-big-core or --disable-big-core was given.
3004 if test "${enable_big_core+set}" = set; then
3005   enableval="$enable_big_core"
3006   with_big_core=$enableval
3007 else
3008   if test "$cross_compiling" = yes; then
3009   with_big_core=no
3010 else
3011   cat > conftest.$ac_ext <<EOF
3012 #line 3013 "configure"
3013 #include "confdefs.h"
3014
3015 #include <stdlib.h>
3016 #include <string.h>
3017 int main() {
3018         unsigned long n = 6000000L;
3019         char *s = malloc(n);
3020         if (s != 0)
3021                 s[0] = s[n-1] = 0;
3022         exit(s == 0);
3023 }
3024 EOF
3025 if { (eval echo configure:3026: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
3026 then
3027   with_big_core=yes
3028 else
3029   echo "configure: failed program was:" >&5
3030   cat conftest.$ac_ext >&5
3031   rm -fr conftest*
3032   with_big_core=no
3033 fi
3034 rm -fr conftest*
3035 fi
3036
3037 fi
3038
3039 echo "$ac_t""$with_big_core" 1>&6
3040 test "$with_big_core" = "yes" && cat >> confdefs.h <<\EOF
3041 #define HAVE_BIG_CORE 1
3042 EOF
3043
3044
3045 ###     use option --enable-termcap to compile in the termcap fallback support
3046 echo $ac_n "checking if you want termcap-fallback support""... $ac_c" 1>&6
3047 echo "configure:3048: checking if you want termcap-fallback support" >&5
3048
3049 # Check whether --enable-termcap or --disable-termcap was given.
3050 if test "${enable_termcap+set}" = set; then
3051   enableval="$enable_termcap"
3052   with_termcap=$enableval
3053 else
3054   with_termcap=no
3055 fi
3056
3057 echo "$ac_t""$with_termcap" 1>&6
3058
3059 if test "$with_termcap" != "yes" ; then
3060         cat >> confdefs.h <<\EOF
3061 #define PURE_TERMINFO 1
3062 EOF
3063
3064 else
3065
3066 ###     use option --enable-getcap to use a hacked getcap for reading termcaps
3067 echo $ac_n "checking if fast termcap-loader is needed""... $ac_c" 1>&6
3068 echo "configure:3069: checking if fast termcap-loader is needed" >&5
3069
3070 # Check whether --enable-getcap or --disable-getcap was given.
3071 if test "${enable_getcap+set}" = set; then
3072   enableval="$enable_getcap"
3073   with_getcap=$enableval
3074 else
3075   with_getcap=no
3076 fi
3077
3078 echo "$ac_t""$with_getcap" 1>&6
3079 test "$with_getcap" = "yes" && cat >> confdefs.h <<\EOF
3080 #define USE_GETCAP 1
3081 EOF
3082
3083
3084 echo $ac_n "checking if translated termcaps will be cached in ~/.terminfo""... $ac_c" 1>&6
3085 echo "configure:3086: checking if translated termcaps will be cached in ~/.terminfo" >&5
3086
3087 # Check whether --enable-getcap-cache or --disable-getcap-cache was given.
3088 if test "${enable_getcap_cache+set}" = set; then
3089   enableval="$enable_getcap_cache"
3090   with_getcap_cache=$enableval
3091 else
3092   with_getcap_cache=no
3093 fi
3094
3095 echo "$ac_t""$with_getcap_cache" 1>&6
3096 test "$with_getcap_cache" = "yes" && cat >> confdefs.h <<\EOF
3097 #define USE_GETCAP_CACHE 1
3098 EOF
3099
3100
3101 fi
3102
3103 ###   Use option --enable-symlinks to make tic use symlinks, not hard links
3104 ###   to reduce storage requirements for the terminfo database.
3105
3106 for ac_func in \
3107         remove \
3108         unlink 
3109 do
3110 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
3111 echo "configure:3112: checking for $ac_func" >&5
3112 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
3113   echo $ac_n "(cached) $ac_c" 1>&6
3114 else
3115   cat > conftest.$ac_ext <<EOF
3116 #line 3117 "configure"
3117 #include "confdefs.h"
3118 /* System header to define __stub macros and hopefully few prototypes,
3119     which can conflict with char $ac_func(); below.  */
3120 #include <assert.h>
3121 /* Override any gcc2 internal prototype to avoid an error.  */
3122 /* We use char because int might match the return type of a gcc2
3123     builtin and then its argument prototype would still apply.  */
3124 char $ac_func();
3125
3126 int main() {
3127
3128 /* The GNU C library defines this for functions which it implements
3129     to always fail with ENOSYS.  Some functions are actually named
3130     something starting with __ and the normal name is an alias.  */
3131 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
3132 choke me
3133 #else
3134 $ac_func();
3135 #endif
3136
3137 ; return 0; }
3138 EOF
3139 if { (eval echo configure:3140: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3140   rm -rf conftest*
3141   eval "ac_cv_func_$ac_func=yes"
3142 else
3143   echo "configure: failed program was:" >&5
3144   cat conftest.$ac_ext >&5
3145   rm -rf conftest*
3146   eval "ac_cv_func_$ac_func=no"
3147 fi
3148 rm -f conftest*
3149 fi
3150
3151 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
3152   echo "$ac_t""yes" 1>&6
3153     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
3154   cat >> confdefs.h <<EOF
3155 #define $ac_tr_func 1
3156 EOF
3157  
3158 else
3159   echo "$ac_t""no" 1>&6
3160 fi
3161 done
3162
3163
3164 if test "$ac_cv_prog_cc_cross" = yes ; then
3165         for ac_func in \
3166                 link \
3167                 symlink 
3168 do
3169 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
3170 echo "configure:3171: checking for $ac_func" >&5
3171 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
3172   echo $ac_n "(cached) $ac_c" 1>&6
3173 else
3174   cat > conftest.$ac_ext <<EOF
3175 #line 3176 "configure"
3176 #include "confdefs.h"
3177 /* System header to define __stub macros and hopefully few prototypes,
3178     which can conflict with char $ac_func(); below.  */
3179 #include <assert.h>
3180 /* Override any gcc2 internal prototype to avoid an error.  */
3181 /* We use char because int might match the return type of a gcc2
3182     builtin and then its argument prototype would still apply.  */
3183 char $ac_func();
3184
3185 int main() {
3186
3187 /* The GNU C library defines this for functions which it implements
3188     to always fail with ENOSYS.  Some functions are actually named
3189     something starting with __ and the normal name is an alias.  */
3190 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
3191 choke me
3192 #else
3193 $ac_func();
3194 #endif
3195
3196 ; return 0; }
3197 EOF
3198 if { (eval echo configure:3199: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3199   rm -rf conftest*
3200   eval "ac_cv_func_$ac_func=yes"
3201 else
3202   echo "configure: failed program was:" >&5
3203   cat conftest.$ac_ext >&5
3204   rm -rf conftest*
3205   eval "ac_cv_func_$ac_func=no"
3206 fi
3207 rm -f conftest*
3208 fi
3209
3210 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
3211   echo "$ac_t""yes" 1>&6
3212     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
3213   cat >> confdefs.h <<EOF
3214 #define $ac_tr_func 1
3215 EOF
3216  
3217 else
3218   echo "$ac_t""no" 1>&6
3219 fi
3220 done
3221
3222 else
3223         echo $ac_n "checking if link/symlink functions work""... $ac_c" 1>&6
3224 echo "configure:3225: checking if link/symlink functions work" >&5
3225 if eval "test \"`echo '$''{'cf_cv_link_funcs'+set}'`\" = set"; then
3226   echo $ac_n "(cached) $ac_c" 1>&6
3227 else
3228   
3229                 cf_cv_link_funcs=
3230                 for cf_func in link symlink ; do
3231                         if test "$cross_compiling" = yes; then
3232   
3233                         eval 'ac_cv_func_'$cf_func'=error'
3234 else
3235   cat > conftest.$ac_ext <<EOF
3236 #line 3237 "configure"
3237 #include "confdefs.h"
3238
3239 #include <sys/types.h>
3240 #include <sys/stat.h>
3241 #ifdef HAVE_UNISTD_H
3242 #include <unistd.h>
3243 #endif
3244 int main()
3245 {
3246         int fail = 0;
3247         char *src = "config.log";
3248         char *dst = "conftest.chk";
3249         struct stat src_sb;
3250         struct stat dst_sb;
3251
3252         stat(src, &src_sb);
3253         fail = ($cf_func("config.log", "conftest.chk") < 0)
3254             || (stat(dst, &dst_sb) < 0)
3255             || (dst_sb.st_mtime != src_sb.st_mtime);
3256 #ifdef HAVE_UNLINK
3257         unlink(dst);
3258 #else
3259         remove(dst);
3260 #endif
3261         exit (fail);
3262 }
3263                         
3264 EOF
3265 if { (eval echo configure:3266: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
3266 then
3267   
3268                         cf_cv_link_funcs="$cf_cv_link_funcs $cf_func"
3269                         eval 'ac_cv_func_'$cf_func'=yes'
3270 else
3271   echo "configure: failed program was:" >&5
3272   cat conftest.$ac_ext >&5
3273   rm -fr conftest*
3274   
3275                         eval 'ac_cv_func_'$cf_func'=no'
3276 fi
3277 rm -fr conftest*
3278 fi
3279
3280                 done
3281                 test -z "$cf_cv_link_funcs" && cf_cv_link_funcs=no
3282         
3283 fi
3284
3285 echo "$ac_t""$cf_cv_link_funcs" 1>&6
3286         test "$ac_cv_func_link"    = yes && cat >> confdefs.h <<\EOF
3287 #define HAVE_LINK 1
3288 EOF
3289
3290         test "$ac_cv_func_symlink" = yes && cat >> confdefs.h <<\EOF
3291 #define HAVE_SYMLINK 1
3292 EOF
3293
3294 fi
3295
3296
3297 with_links=no
3298 with_symlinks=no
3299
3300 if test "$ac_cv_func_link" != yes ; then
3301     echo $ac_n "checking if tic should use symbolic links""... $ac_c" 1>&6
3302 echo "configure:3303: checking if tic should use symbolic links" >&5
3303     if test "$ac_cv_func_symlink" = yes ; then
3304         with_symlinks=yes
3305     else
3306         with_symlinks=no
3307     fi
3308     echo "$ac_t""$with_symlinks" 1>&6
3309 elif test "$ac_cv_func_symlink" != yes ; then
3310     echo $ac_n "checking if tic should use hard links""... $ac_c" 1>&6
3311 echo "configure:3312: checking if tic should use hard links" >&5
3312     if test "$ac_cv_func_link" = yes ; then
3313         with_links=yes
3314     else
3315         with_links=no
3316     fi
3317     echo "$ac_t""$with_links" 1>&6
3318 else
3319     echo $ac_n "checking if tic should use symbolic links""... $ac_c" 1>&6
3320 echo "configure:3321: checking if tic should use symbolic links" >&5
3321     
3322 # Check whether --enable-symlinks or --disable-symlinks was given.
3323 if test "${enable_symlinks+set}" = set; then
3324   enableval="$enable_symlinks"
3325   with_symlinks=$enableval
3326 else
3327   with_symlinks=no
3328 fi
3329
3330     echo "$ac_t""$with_symlinks" 1>&6
3331 fi
3332
3333 test "$with_links" = yes && cat >> confdefs.h <<\EOF
3334 #define USE_LINKS 1
3335 EOF
3336
3337 test "$with_symlinks" = yes && cat >> confdefs.h <<\EOF
3338 #define USE_SYMLINKS 1
3339 EOF
3340
3341
3342 ###   use option --enable-broken-linker to force on use of broken-linker support
3343 echo $ac_n "checking if you want broken-linker support code""... $ac_c" 1>&6
3344 echo "configure:3345: checking if you want broken-linker support code" >&5
3345
3346 # Check whether --enable-broken_linker or --disable-broken_linker was given.
3347 if test "${enable_broken_linker+set}" = set; then
3348   enableval="$enable_broken_linker"
3349   with_broken_linker=$enableval
3350 else
3351   with_broken_linker=$BROKEN_LINKER
3352 fi
3353
3354 echo "$ac_t""$with_broken_linker" 1>&6
3355 test "$with_broken_linker" = yes && cat >> confdefs.h <<\EOF
3356 #define BROKEN_LINKER 1
3357 EOF
3358
3359
3360 ###   use option --enable-bsdpad to have tputs process BSD-style prefix padding
3361 echo $ac_n "checking if tputs should process BSD-style prefix padding""... $ac_c" 1>&6
3362 echo "configure:3363: checking if tputs should process BSD-style prefix padding" >&5
3363
3364 # Check whether --enable-bsdpad or --disable-bsdpad was given.
3365 if test "${enable_bsdpad+set}" = set; then
3366   enableval="$enable_bsdpad"
3367   with_bsdpad=$enableval
3368 else
3369   with_bsdpad=no
3370 fi
3371
3372 echo "$ac_t""$with_bsdpad" 1>&6
3373 test "$with_bsdpad" = yes && cat >> confdefs.h <<\EOF
3374 #define BSD_TPUTS 1
3375 EOF
3376
3377
3378 ### Enable compiling-in rcs id's
3379 echo $ac_n "checking if RCS identifiers should be compiled-in""... $ac_c" 1>&6
3380 echo "configure:3381: checking if RCS identifiers should be compiled-in" >&5
3381
3382 # Check whether --with-rcs-ids or --without-rcs-ids was given.
3383 if test "${with_rcs_ids+set}" = set; then
3384   withval="$with_rcs_ids"
3385   with_rcs_ids=$withval
3386 else
3387   with_rcs_ids=no
3388 fi
3389
3390 echo "$ac_t""$with_rcs_ids" 1>&6
3391 test "$with_rcs_ids" = yes && cat >> confdefs.h <<\EOF
3392 #define USE_RCS_IDS 1
3393 EOF
3394
3395
3396 ###############################################################################
3397
3398
3399  echo $ac_n "checking format of man-pages""... $ac_c" 1>&6
3400 echo "configure:3401: checking format of man-pages" >&5
3401
3402
3403 # Check whether --with-manpage-format or --without-manpage-format was given.
3404 if test "${with_manpage_format+set}" = set; then
3405   withval="$with_manpage_format"
3406   cf_manpage_form=$withval
3407 else
3408   cf_manpage_form=unknown
3409 fi
3410
3411
3412 case ".$cf_manpage_form" in
3413 .gzip|.compress|.BSDI|.normal|.formatted) # (vi
3414   ;;
3415 .unknown|.) # (vi
3416   if test -z "$MANPATH" ; then
3417     MANPATH="/usr/man:/usr/share/man"
3418   fi
3419   # look for the 'date' man-page (it's most likely to be installed!)
3420   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
3421   cf_manpage_form=unknown
3422   for cf_dir in $MANPATH; do
3423     test -z "$cf_dir" && cf_dir=/usr/man
3424     for cf_name in $cf_dir/*/date.[01]* $cf_dir/*/date
3425     do
3426        cf_test=`echo $cf_name | sed -e 's/*//'`
3427        if test "x$cf_test" = "x$cf_name" ; then
3428           case "$cf_name" in
3429           *.gz) cf_manpage_form=gzip;;
3430           *.Z)  cf_manpage_form=compress;;
3431           *.0)  cf_manpage_form=BSDI,formatted;;
3432           *)    cf_manpage_form=normal;;
3433           esac
3434           break
3435        fi
3436     done
3437     if test "$cf_manpage_form" != "unknown" ; then
3438        break
3439     fi
3440   done
3441   IFS="$ac_save_ifs"
3442   ;;
3443 .*) # (vi
3444   echo "configure: warning: Unexpected manpage-format" 1>&2
3445   ;;
3446 esac
3447
3448 echo "$ac_t""$cf_manpage_form" 1>&6
3449
3450
3451 echo $ac_n "checking for manpage renaming""... $ac_c" 1>&6
3452 echo "configure:3453: checking for manpage renaming" >&5
3453
3454
3455 # Check whether --with-manpage-renames or --without-manpage-renames was given.
3456 if test "${with_manpage_renames+set}" = set; then
3457   withval="$with_manpage_renames"
3458   cf_manpage_renames=$withval
3459 else
3460   cf_manpage_renames=yes
3461 fi
3462
3463
3464 case ".$cf_manpage_renames" in #(vi
3465 .no) #(vi
3466   ;;
3467 .|.yes)
3468   # Debian 'man' program?
3469   if test -f /etc/debian_version ; then
3470     cf_manpage_renames=`cd $srcdir && pwd`/man/man_db.renames
3471   else
3472     cf_manpage_renames=no
3473   fi
3474   ;;
3475 esac
3476
3477 if test "$cf_manpage_renames" != no ; then
3478   if test ! -f $cf_manpage_renames ; then
3479     { echo "configure: error: not a filename: $cf_manpage_renames" 1>&2; exit 1; }
3480   fi
3481
3482   test ! -d man && mkdir man
3483
3484   # Construct a sed-script to perform renaming within man-pages
3485   if test -n "$cf_manpage_renames" ; then
3486     test ! -d man && mkdir man
3487     $srcdir/man/make_sed.sh $cf_manpage_renames >man/edit_man.sed
3488   fi
3489 fi
3490
3491 echo "$ac_t""$cf_manpage_renames" 1>&6
3492
3493
3494 echo $ac_n "checking for manpage symlinks""... $ac_c" 1>&6
3495 echo "configure:3496: checking for manpage symlinks" >&5
3496
3497
3498 # Check whether --with-manpage-symlinks or --without-manpage-symlinks was given.
3499 if test "${with_manpage_symlinks+set}" = set; then
3500   withval="$with_manpage_symlinks"
3501   cf_manpage_symlinks=$withval
3502 else
3503   cf_manpage_symlinks=yes
3504 fi
3505
3506
3507 echo "$ac_t""$cf_manpage_symlinks" 1>&6
3508
3509
3510 echo $ac_n "checking for manpage tbl""... $ac_c" 1>&6
3511 echo "configure:3512: checking for manpage tbl" >&5
3512
3513
3514 # Check whether --with-manpage-tbl or --without-manpage-tbl was given.
3515 if test "${with_manpage_tbl+set}" = set; then
3516   withval="$with_manpage_tbl"
3517   cf_manpage_tbl=$withval
3518 else
3519   cf_manpage_tbl=no
3520 fi
3521
3522
3523 echo "$ac_t""$cf_manpage_tbl" 1>&6
3524
3525
3526   if test "$prefix" = "NONE" ; then
3527      cf_prefix="$ac_default_prefix"
3528   else
3529      cf_prefix="$prefix"
3530   fi
3531
3532   case "$cf_manpage_form" in # (vi
3533   *formatted*) # (vi
3534     cf_subdir='$mandir/cat'
3535     cf_format=yes
3536     ;;
3537   *)
3538     cf_subdir='$mandir/man'
3539     cf_format=no
3540     ;;
3541   esac
3542
3543 test ! -d man && mkdir man
3544 cat >man/edit_man.sh <<CF_EOF
3545 #! /bin/sh
3546 # this script is generated by the configure-script
3547 prefix="$cf_prefix"
3548 datadir="$datadir"
3549 TERMINFO="$TERMINFO"
3550 MKDIRS="`cd $srcdir && pwd`/mkinstalldirs"
3551 INSTALL="$INSTALL"
3552 INSTALL_DATA="$INSTALL_DATA"
3553 transform="$program_transform_name"
3554
3555 TMP=\${TMPDIR-/tmp}/man\$\$
3556 trap "rm -f \$TMP" 0 1 2 5 15
3557
3558 verb=\$1
3559 shift
3560
3561 mandir=\$1
3562 shift
3563
3564 srcdir=\$1
3565 shift
3566
3567 for i in \$* ; do
3568 case \$i in #(vi
3569 *.orig|*.rej) ;; #(vi
3570 *.[0-9]*)
3571         section=\`expr "\$i" : '.*\\.\\([0-9]\\)[xm]*'\`;
3572         if test \$verb = installing ; then
3573         if test ! -d $cf_subdir\${section} ; then
3574                 \$MKDIRS $cf_subdir\$section
3575         fi
3576         fi
3577         aliases=
3578         source=\`basename \$i\`
3579         inalias=\$source
3580         test ! -f \$inalias && inalias="\$srcdir/\$inalias"
3581         if test ! -f \$inalias ; then
3582                 echo .. skipped \$source
3583                 continue
3584         fi
3585 CF_EOF
3586 if test "$cf_manpage_symlinks" = yes ; then
3587 cat >>man/edit_man.sh <<CF_EOF
3588         aliases=\`sed -f \$srcdir/manlinks.sed \$inalias | sort -u\`
3589 CF_EOF
3590 fi
3591 if test "$cf_manpage_renames" = no ; then
3592 cat >>man/edit_man.sh <<CF_EOF
3593         # perform program transformations for section 1 man pages
3594         if test \$section = 1 ; then
3595                 target=$cf_subdir\${section}/\`echo \$source|sed "\${transform}"\`
3596         else
3597                 target=$cf_subdir\${section}/\$source
3598         fi
3599
3600         # replace variables in man page
3601 CF_EOF
3602         
3603         for cf_name in  captoinfo clear infocmp infotocap tic toe tput 
3604         do
3605 cat >>man/edit_man.sh <<CF_EOF
3606         prog_$cf_name=\`echo $cf_name|sed "\${transform}"\`
3607 CF_EOF
3608         done
3609         
3610 cat >>man/edit_man.sh <<CF_EOF
3611         sed     -e "s,@DATADIR@,\$datadir," \\
3612                 -e "s,@TERMINFO@,\$TERMINFO," \\
3613 CF_EOF
3614         
3615         for cf_name in  captoinfo clear infocmp infotocap tic toe tput 
3616         do
3617                 cf_NAME=`echo "$cf_name" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
3618 cat >>man/edit_man.sh <<CF_EOF
3619                 -e "s,@$cf_NAME@,\$prog_$cf_name," \\
3620 CF_EOF
3621         done
3622         
3623 cat >>man/edit_man.sh <<CF_EOF
3624                 < \$i >\$TMP
3625 CF_EOF
3626 else
3627 cat >>man/edit_man.sh <<CF_EOF
3628         target=\`grep "^\$source" $cf_manpage_renames | $AWK '{print \$2}'\`
3629         if test -z "\$target" ; then
3630                 echo '? missing rename for '\$source
3631                 target="\$source"
3632         fi
3633         target="$cf_subdir\$section/\$target"
3634         test \$verb = installing && sed -e "s,@DATADIR@,\$datadir," < \$i | sed -f edit_man.sed >\$TMP
3635 CF_EOF
3636 fi
3637 if test $cf_manpage_tbl = yes ; then
3638 cat >>man/edit_man.sh <<CF_EOF
3639         tbl \$TMP >\$TMP.out
3640         mv \$TMP.out \$TMP
3641 CF_EOF
3642 fi
3643 if test $with_curses_h != yes ; then
3644 cat >>man/edit_man.sh <<CF_EOF
3645         sed -e "/\#[    ]*include/s,curses.h,ncurses.h," < \$TMP >\$TMP.out
3646         mv \$TMP.out \$TMP
3647 CF_EOF
3648 fi
3649 if test $cf_format = yes ; then
3650 cat >>man/edit_man.sh <<CF_EOF
3651         nroff -man \$TMP >\$TMP.out
3652         mv \$TMP.out \$TMP
3653 CF_EOF
3654 fi
3655 case "$cf_manpage_form" in #(vi
3656 *compress*) #(vi
3657 cat >>man/edit_man.sh <<CF_EOF
3658         if test \$verb = installing ; then
3659         if ( compress -f \$TMP )
3660         then
3661                 mv \$TMP.Z \$TMP
3662         fi
3663         fi
3664         target="\$target.Z"
3665 CF_EOF
3666   ;;
3667 *gzip*) #(vi
3668 cat >>man/edit_man.sh <<CF_EOF
3669         if test \$verb = installing ; then
3670         if ( gzip -f \$TMP )
3671         then
3672                 mv \$TMP.gz \$TMP
3673         fi
3674         fi
3675         target="\$target.gz"
3676 CF_EOF
3677   ;;
3678 *BSDI*)
3679 cat >>man/edit_man.sh <<CF_EOF
3680         # BSDI installs only .0 suffixes in the cat directories
3681         target="\`echo \$target|sed -e 's/\.[1-9]\+.\?/.0/'\`"
3682 CF_EOF
3683   ;;
3684 esac
3685 cat >>man/edit_man.sh <<CF_EOF
3686         suffix=\`basename \$target | sed -e 's/^[^.]*//'\`
3687         if test \$verb = installing ; then
3688                 echo \$verb \$target
3689                 \$INSTALL_DATA \$TMP \$target
3690                 test -n "\$aliases" && (
3691                         cd $cf_subdir\${section} && (
3692                                 target=\`basename \$target\`
3693                                 for cf_alias in \$aliases
3694                                 do
3695                                         if test \$section = 1 ; then
3696                                                 cf_alias=\`echo \$cf_alias|sed "\${transform}"\`
3697                                         fi
3698
3699                                         if test -f \$cf_alias\${suffix} ; then
3700                                                 if ( cmp -s \$target \$cf_alias\${suffix} )
3701                                                 then
3702                                                         :
3703                                                 else
3704                                                         echo .. \$verb alias \$cf_alias\${suffix}
3705                                                         rm -f \$cf_alias\${suffix}
3706                                                         $LN_S \$target \$cf_alias\${suffix}
3707                                                 fi
3708                                         else
3709                                                 echo .. \$verb alias \$cf_alias\${suffix}
3710                                                 rm -f \$cf_alias\${suffix}
3711                                                 $LN_S \$target \$cf_alias\${suffix}
3712                                         fi
3713                                 done
3714                         )
3715                 )
3716         elif test \$verb = removing ; then
3717                 echo \$verb \$target
3718                 rm -f \$target
3719                 test -n "\$aliases" && (
3720                         cd $cf_subdir\${section} && (
3721                                 for cf_alias in \$aliases
3722                                 do
3723                                         if test \$section = 1 ; then
3724                                                 cf_alias=\`echo \$cf_alias|sed "\${transform}"\`
3725                                         fi
3726
3727                                         echo .. \$verb alias \$cf_alias\${suffix}
3728                                         rm -f \$cf_alias\${suffix}
3729                                 done
3730                         )
3731                 )
3732         else
3733 #               echo ".hy 0"
3734                 cat \$TMP
3735         fi
3736         ;;
3737 esac
3738 done
3739 exit 0
3740 CF_EOF
3741 chmod 755 man/edit_man.sh
3742
3743
3744
3745 ###############################################################################
3746
3747
3748 ### Note that some functions (such as const) are normally disabled anyway.
3749 echo $ac_n "checking if you want to build with function extensions""... $ac_c" 1>&6
3750 echo "configure:3751: checking if you want to build with function extensions" >&5
3751
3752 # Check whether --enable-ext-funcs or --disable-ext-funcs was given.
3753 if test "${enable_ext_funcs+set}" = set; then
3754   enableval="$enable_ext_funcs"
3755   with_ext_funcs=$enableval
3756 else
3757   with_ext_funcs=yes
3758 fi
3759
3760 echo "$ac_t""$with_ext_funcs" 1>&6
3761 if test "$with_ext_funcs" = yes ; then
3762         cat >> confdefs.h <<\EOF
3763 #define HAVE_CURSES_VERSION 1
3764 EOF
3765
3766         cat >> confdefs.h <<\EOF
3767 #define HAVE_HAS_KEY 1
3768 EOF
3769
3770         cat >> confdefs.h <<\EOF
3771 #define HAVE_RESIZETERM 1
3772 EOF
3773
3774         cat >> confdefs.h <<\EOF
3775 #define HAVE_USE_DEFAULT_COLORS 1
3776 EOF
3777
3778         cat >> confdefs.h <<\EOF
3779 #define HAVE_WRESIZE 1
3780 EOF
3781
3782         cat >> confdefs.h <<\EOF
3783 #define NCURSES_EXT_FUNCS 1
3784 EOF
3785
3786 fi
3787
3788 ###   use option --enable-const to turn on use of const beyond that in XSI.
3789 echo $ac_n "checking for extended use of const keyword""... $ac_c" 1>&6
3790 echo "configure:3791: checking for extended use of const keyword" >&5
3791
3792 # Check whether --enable-const or --disable-const was given.
3793 if test "${enable_const+set}" = set; then
3794   enableval="$enable_const"
3795   with_ext_const=$enableval
3796 else
3797   with_ext_const=no
3798 fi
3799
3800 echo "$ac_t""$with_ext_const" 1>&6
3801 NCURSES_CONST='/*nothing*/'
3802 if test "$with_ext_const" = yes ; then
3803         NCURSES_CONST=const
3804 fi
3805
3806
3807 echo $ac_n "checking if you want \$NCURSES_NO_PADDING code""... $ac_c" 1>&6
3808 echo "configure:3809: checking if you want \$NCURSES_NO_PADDING code" >&5
3809
3810 # Check whether --enable-no-padding or --disable-no-padding was given.
3811 if test "${enable_no_padding+set}" = set; then
3812   enableval="$enable_no_padding"
3813   with_no_padding=$enableval
3814 else
3815   with_no_padding=$with_ext_funcs
3816 fi
3817
3818 echo "$ac_t""$with_no_padding" 1>&6
3819 test "$with_no_padding" = yes && cat >> confdefs.h <<\EOF
3820 #define NCURSES_NO_PADDING 1
3821 EOF
3822
3823
3824 ###   use option --enable-sigwinch to turn on use of SIGWINCH logic
3825 echo $ac_n "checking if you want SIGWINCH handler""... $ac_c" 1>&6
3826 echo "configure:3827: checking if you want SIGWINCH handler" >&5
3827
3828 # Check whether --enable-sigwinch or --disable-sigwinch was given.
3829 if test "${enable_sigwinch+set}" = set; then
3830   enableval="$enable_sigwinch"
3831   with_sigwinch=$enableval
3832 else
3833   with_sigwinch=$with_ext_funcs
3834 fi
3835
3836 echo "$ac_t""$with_sigwinch" 1>&6
3837 test "$with_sigwinch" = yes && cat >> confdefs.h <<\EOF
3838 #define USE_SIGWINCH 1
3839 EOF
3840
3841
3842 ###   use option --enable-tcap-names to allow user to define new capabilities
3843 echo $ac_n "checking if you want user-definable terminal capabilities like termcap""... $ac_c" 1>&6
3844 echo "configure:3845: checking if you want user-definable terminal capabilities like termcap" >&5
3845
3846 # Check whether --enable-tcap-names or --disable-tcap-names was given.
3847 if test "${enable_tcap_names+set}" = set; then
3848   enableval="$enable_tcap_names"
3849   with_tcap_names=$enableval
3850 else
3851   with_tcap_names=$with_ext_funcs
3852 fi
3853
3854 echo "$ac_t""$with_tcap_names" 1>&6
3855 NCURSES_XNAMES=0
3856 test "$with_tcap_names" = yes && NCURSES_XNAMES=1
3857
3858
3859 ###############################################################################
3860 # These options are relatively safe to experiment with.
3861
3862 echo $ac_n "checking if you want all development code""... $ac_c" 1>&6
3863 echo "configure:3864: checking if you want all development code" >&5
3864
3865 # Check whether --with-develop or --without-develop was given.
3866 if test "${with_develop+set}" = set; then
3867   withval="$with_develop"
3868   with_develop=$withval
3869 else
3870   with_develop=no
3871 fi
3872
3873 echo "$ac_t""$with_develop" 1>&6
3874
3875 ###   use option --enable-colorfgbg to turn on use of $COLORFGBG environment
3876 echo $ac_n "checking if you want colorfgbg code""... $ac_c" 1>&6
3877 echo "configure:3878: checking if you want colorfgbg code" >&5
3878
3879 # Check whether --enable-hard-tabs or --disable-hard-tabs was given.
3880 if test "${enable_hard_tabs+set}" = set; then
3881   enableval="$enable_hard_tabs"
3882   with_colorfgbg=$enableval
3883 else
3884   with_colorfgbg=$with_develop
3885 fi
3886
3887 echo "$ac_t""$with_colorfgbg" 1>&6
3888 test "$with_colorfgbg" = yes && cat >> confdefs.h <<\EOF
3889 #define USE_COLORFGBG 1
3890 EOF
3891
3892
3893 ###   use option --enable-hard-tabs to turn on use of hard-tabs optimize
3894 echo $ac_n "checking if you want hard-tabs code""... $ac_c" 1>&6
3895 echo "configure:3896: checking if you want hard-tabs code" >&5
3896
3897 # Check whether --enable-hard-tabs or --disable-hard-tabs was given.
3898 if test "${enable_hard_tabs+set}" = set; then
3899   enableval="$enable_hard_tabs"
3900   with_hardtabs=$enableval
3901 else
3902   with_hardtabs=$with_develop
3903 fi
3904
3905 echo "$ac_t""$with_hardtabs" 1>&6
3906 test "$with_hardtabs" = yes && cat >> confdefs.h <<\EOF
3907 #define USE_HARD_TABS 1
3908 EOF
3909
3910
3911 echo $ac_n "checking if you want to use restrict environment when running as root""... $ac_c" 1>&6
3912 echo "configure:3913: checking if you want to use restrict environment when running as root" >&5
3913
3914 # Check whether --enable-root-environ or --disable-root-environ was given.
3915 if test "${enable_root_environ+set}" = set; then
3916   enableval="$enable_root_environ"
3917   with_root_environ=$enableval
3918 else
3919   with_root_environ=yes
3920 fi
3921
3922 echo "$ac_t""$with_root_environ" 1>&6
3923 test "$with_root_environ" = yes && cat >> confdefs.h <<\EOF
3924 #define USE_ROOT_ENVIRON 1
3925 EOF
3926
3927
3928 ###   use option --enable-xmc-glitch to turn on use of magic-cookie optimize
3929 echo $ac_n "checking if you want limited support for xmc""... $ac_c" 1>&6
3930 echo "configure:3931: checking if you want limited support for xmc" >&5
3931
3932 # Check whether --enable-xmc-glitch or --disable-xmc-glitch was given.
3933 if test "${enable_xmc_glitch+set}" = set; then
3934   enableval="$enable_xmc_glitch"
3935   with_xmc_glitch=$enableval
3936 else
3937   with_xmc_glitch=$with_develop
3938 fi
3939
3940 echo "$ac_t""$with_xmc_glitch" 1>&6
3941 test "$with_xmc_glitch" = yes && cat >> confdefs.h <<\EOF
3942 #define USE_XMC_SUPPORT 1
3943 EOF
3944
3945
3946 ###############################################################################
3947 # These are just experimental, probably should not be in a package:
3948
3949
3950 echo $ac_n "checking if you do not want to assume colors are white-on-black""... $ac_c" 1>&6
3951 echo "configure:3952: checking if you do not want to assume colors are white-on-black" >&5
3952
3953 # Check whether --enable-assumed-color or --disable-assumed-color was given.
3954 if test "${enable_assumed_color+set}" = set; then
3955   enableval="$enable_assumed_color"
3956   with_assumed_color=$enableval
3957 else
3958   with_assumed_color=yes
3959 fi
3960
3961 echo "$ac_t""$with_assumed_color" 1>&6
3962 test "$with_assumed_color" = yes && cat >> confdefs.h <<\EOF
3963 #define USE_ASSUMED_COLOR 1
3964 EOF
3965
3966
3967 ###   use option --enable-hashmap to turn on use of hashmap scrolling logic
3968 echo $ac_n "checking if you want hashmap scrolling-optimization code""... $ac_c" 1>&6
3969 echo "configure:3970: checking if you want hashmap scrolling-optimization code" >&5
3970
3971 # Check whether --enable-hashmap or --disable-hashmap was given.
3972 if test "${enable_hashmap+set}" = set; then
3973   enableval="$enable_hashmap"
3974   with_hashmap=$enableval
3975 else
3976   with_hashmap=yes
3977 fi
3978
3979 echo "$ac_t""$with_hashmap" 1>&6
3980 test "$with_hashmap" = yes && cat >> confdefs.h <<\EOF
3981 #define USE_HASHMAP 1
3982 EOF
3983
3984
3985 echo $ac_n "checking if you want experimental safe-sprintf code""... $ac_c" 1>&6
3986 echo "configure:3987: checking if you want experimental safe-sprintf code" >&5
3987
3988 # Check whether --enable-safe-sprintf or --disable-safe-sprintf was given.
3989 if test "${enable_safe_sprintf+set}" = set; then
3990   enableval="$enable_safe_sprintf"
3991   with_safe_sprintf=$enableval
3992 else
3993   with_safe_sprintf=no
3994 fi
3995
3996 echo "$ac_t""$with_safe_sprintf" 1>&6
3997 test "$with_safe_sprintf" = yes && cat >> confdefs.h <<\EOF
3998 #define USE_SAFE_SPRINTF 1
3999 EOF
4000
4001
4002 ###   use option --disable-scroll-hints to turn off use of scroll-hints scrolling logic
4003 # when hashmap is used scroll hints are useless
4004 if test "$with_hashmap" = no ; then
4005 echo $ac_n "checking if you want to experiment without scrolling-hints code""... $ac_c" 1>&6
4006 echo "configure:4007: checking if you want to experiment without scrolling-hints code" >&5
4007
4008 # Check whether --enable-scroll-hints or --disable-scroll-hints was given.
4009 if test "${enable_scroll_hints+set}" = set; then
4010   enableval="$enable_scroll_hints"
4011   with_scroll_hints=$enableval
4012 else
4013   with_scroll_hints=yes
4014 fi
4015
4016 echo "$ac_t""$with_scroll_hints" 1>&6
4017 test "$with_scroll_hints" = yes && cat >> confdefs.h <<\EOF
4018 #define USE_SCROLL_HINTS 1
4019 EOF
4020
4021 fi
4022
4023 ###   use option --enable-widec to turn on use of wide-character support
4024 echo $ac_n "checking if you want experimental wide-character code""... $ac_c" 1>&6
4025 echo "configure:4026: checking if you want experimental wide-character code" >&5
4026
4027 # Check whether --enable-widec or --disable-widec was given.
4028 if test "${enable_widec+set}" = set; then
4029   enableval="$enable_widec"
4030   with_widec=$enableval
4031 else
4032   with_widec=no
4033 fi
4034
4035 echo "$ac_t""$with_widec" 1>&6
4036 if test "$with_widec" = yes ; then
4037         LIB_SUFFIX="w${LIB_SUFFIX}"
4038         cat >> confdefs.h <<\EOF
4039 #define USE_WIDEC_SUPPORT 1
4040 EOF
4041
4042 fi
4043
4044 ###############################################################################
4045
4046
4047 ###     use option --disable-echo to suppress full display compiling commands
4048 echo $ac_n "checking if you want to display full commands during build""... $ac_c" 1>&6
4049 echo "configure:4050: checking if you want to display full commands during build" >&5
4050
4051 # Check whether --enable-echo or --disable-echo was given.
4052 if test "${enable_echo+set}" = set; then
4053   enableval="$enable_echo"
4054   with_echo=$enableval
4055 else
4056   with_echo=yes
4057 fi
4058
4059 if test "$with_echo" = yes; then
4060         ECHO_LINK=
4061 else
4062         ECHO_LINK='@ echo linking $@ ... ;'
4063         test -n "$LIBTOOL" && LIBTOOL="$LIBTOOL --silent"
4064 fi
4065 echo "$ac_t""$with_echo" 1>&6
4066
4067
4068 ###     use option --enable-warnings to turn on all gcc warnings
4069 echo $ac_n "checking if you want to see compiler warnings""... $ac_c" 1>&6
4070 echo "configure:4071: checking if you want to see compiler warnings" >&5
4071
4072 # Check whether --enable-warnings or --disable-warnings was given.
4073 if test "${enable_warnings+set}" = set; then
4074   enableval="$enable_warnings"
4075   with_warnings=$enableval
4076 fi
4077
4078 echo "$ac_t""$with_warnings" 1>&6
4079
4080 if test -n "$with_warnings"; then
4081         ADAFLAGS="$ADAFLAGS -gnatg"
4082         
4083 if test "$GCC" = yes
4084 then
4085                 cat > conftest.$ac_ext <<EOF
4086 #line 4087 "configure"
4087 int main(int argc, char *argv[]) { return (argv[argc-1] == 0) ; }
4088 EOF
4089                 echo "checking for $CC warning options" 1>&6
4090 echo "configure:4091: checking for $CC warning options" >&5
4091         cf_save_CFLAGS="$CFLAGS"
4092         EXTRA_CFLAGS="-W -Wall"
4093         cf_warn_CONST=""
4094         test "$with_ext_const" = yes && cf_warn_CONST="Wwrite-strings"
4095         for cf_opt in \
4096                 Wbad-function-cast \
4097                 Wcast-align \
4098                 Wcast-qual \
4099                 Winline \
4100                 Wmissing-declarations \
4101                 Wmissing-prototypes \
4102                 Wnested-externs \
4103                 Wpointer-arith \
4104                 Wshadow \
4105                 Wstrict-prototypes $cf_warn_CONST
4106         do
4107                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
4108                 if { (eval echo configure:4109: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4109                         test -n "$verbose" && echo "$ac_t""... -$cf_opt" 1>&6
4110                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
4111                         test "$cf_opt" = Wcast-qual && EXTRA_CFLAGS="$EXTRA_CFLAGS -DXTSTRINGDEFINES"
4112                 fi
4113         done
4114         rm -f conftest*
4115         CFLAGS="$cf_save_CFLAGS"
4116 fi
4117
4118
4119 fi
4120
4121 if test "$GCC" = yes
4122 then
4123 cat > conftest.i <<EOF
4124 #ifndef GCC_PRINTF
4125 #define GCC_PRINTF 0
4126 #endif
4127 #ifndef GCC_SCANF
4128 #define GCC_SCANF 0
4129 #endif
4130 #ifndef GCC_NORETURN
4131 #define GCC_NORETURN /* nothing */
4132 #endif
4133 #ifndef GCC_UNUSED
4134 #define GCC_UNUSED /* nothing */
4135 #endif
4136 EOF
4137 if test "$GCC" = yes
4138 then
4139         echo "checking for $CC __attribute__ directives" 1>&6
4140 echo "configure:4141: checking for $CC __attribute__ directives" >&5
4141         cat > conftest.$ac_ext <<EOF
4142 #line 4143 "configure"
4143 #include "confdefs.h"
4144 #include "conftest.h"
4145 #include "conftest.i"
4146 #if     GCC_PRINTF
4147 #define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
4148 #else
4149 #define GCC_PRINTFLIKE(fmt,var) /*nothing*/
4150 #endif
4151 #if     GCC_SCANF
4152 #define GCC_SCANFLIKE(fmt,var)  __attribute__((format(scanf,fmt,var)))
4153 #else
4154 #define GCC_SCANFLIKE(fmt,var)  /*nothing*/
4155 #endif
4156 extern void wow(char *,...) GCC_SCANFLIKE(1,2);
4157 extern void oops(char *,...) GCC_PRINTFLIKE(1,2) GCC_NORETURN;
4158 extern void foo(void) GCC_NORETURN;
4159 int main(int argc GCC_UNUSED, char *argv[] GCC_UNUSED) { return 0; }
4160 EOF
4161                 for cf_attribute in scanf printf unused noreturn
4162         do
4163                 
4164 CF_ATTRIBUTE=`echo "$cf_attribute" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
4165
4166                 cf_directive="__attribute__(($cf_attribute))"
4167                 echo "checking for $CC $cf_directive" 1>&5
4168                 case $cf_attribute in
4169                 scanf|printf)
4170                 cat >conftest.h <<EOF
4171 #define GCC_$CF_ATTRIBUTE 1
4172 EOF
4173                         ;;
4174                 *)
4175                 cat >conftest.h <<EOF
4176 #define GCC_$CF_ATTRIBUTE $cf_directive
4177 EOF
4178                         ;;
4179                 esac
4180                 if { (eval echo configure:4181: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4181                         test -n "$verbose" && echo "$ac_t""... $cf_attribute" 1>&6
4182                         cat conftest.h >>confdefs.h
4183 #               else
4184 #                       sed -e 's/__attr.*/\/*nothing*\//' conftest.h >>confdefs.h
4185                 fi
4186         done
4187 else
4188         fgrep define conftest.i >>confdefs.h
4189 fi
4190 rm -rf conftest*
4191 fi
4192
4193
4194 ###     use option --enable-assertions to turn on generation of assertion code
4195 echo $ac_n "checking if you want to enable runtime assertions""... $ac_c" 1>&6
4196 echo "configure:4197: checking if you want to enable runtime assertions" >&5
4197
4198 # Check whether --enable-assertions or --disable-assertions was given.
4199 if test "${enable_assertions+set}" = set; then
4200   enableval="$enable_assertions"
4201   with_assertions=$enableval
4202 else
4203   with_assertions=no
4204 fi
4205
4206 echo "$ac_t""$with_assertions" 1>&6
4207 if test -n "$GCC"
4208 then
4209         if test "$with_assertions" = no
4210         then
4211                 cat >> confdefs.h <<\EOF
4212 #define NDEBUG 1
4213 EOF
4214
4215                 CPPFLAGS="$CPPFLAGS -DNDEBUG"
4216         else
4217                 ADAFLAGS="$ADAFLAGS -gnata"
4218         fi
4219 fi
4220
4221 ###     use option --disable-leaks to suppress "permanent" leaks, for testing
4222
4223 # Check whether --enable-leaks or --disable-leaks was given.
4224 if test "${enable_leaks+set}" = set; then
4225   enableval="$enable_leaks"
4226   test "$enableval" = no && cat >> confdefs.h <<\EOF
4227 #define NO_LEAKS 1
4228 EOF
4229
4230 fi
4231
4232 cat >> confdefs.h <<\EOF
4233 #define HAVE_NC_ALLOC_H 1
4234 EOF
4235
4236
4237 ###     use option --enable-expanded to generate certain macros as functions
4238
4239 # Check whether --enable-expanded or --disable-expanded was given.
4240 if test "${enable_expanded+set}" = set; then
4241   enableval="$enable_expanded"
4242   test "$enableval" = yes && cat >> confdefs.h <<\EOF
4243 #define NCURSES_EXPANDED 1
4244 EOF
4245
4246 fi
4247
4248
4249 ###     use option --disable-macros to suppress macros in favor of functions
4250
4251 # Check whether --enable-macros or --disable-macros was given.
4252 if test "${enable_macros+set}" = set; then
4253   enableval="$enable_macros"
4254   test "$enableval" = no && cat >> confdefs.h <<\EOF
4255 #define NCURSES_NOMACROS 1
4256 EOF
4257
4258 fi
4259
4260
4261 ###     Checks for libraries.
4262 echo $ac_n "checking for gettimeofday""... $ac_c" 1>&6
4263 echo "configure:4264: checking for gettimeofday" >&5
4264 if eval "test \"`echo '$''{'ac_cv_func_gettimeofday'+set}'`\" = set"; then
4265   echo $ac_n "(cached) $ac_c" 1>&6
4266 else
4267   cat > conftest.$ac_ext <<EOF
4268 #line 4269 "configure"
4269 #include "confdefs.h"
4270 /* System header to define __stub macros and hopefully few prototypes,
4271     which can conflict with char gettimeofday(); below.  */
4272 #include <assert.h>
4273 /* Override any gcc2 internal prototype to avoid an error.  */
4274 /* We use char because int might match the return type of a gcc2
4275     builtin and then its argument prototype would still apply.  */
4276 char gettimeofday();
4277
4278 int main() {
4279
4280 /* The GNU C library defines this for functions which it implements
4281     to always fail with ENOSYS.  Some functions are actually named
4282     something starting with __ and the normal name is an alias.  */
4283 #if defined (__stub_gettimeofday) || defined (__stub___gettimeofday)
4284 choke me
4285 #else
4286 gettimeofday();
4287 #endif
4288
4289 ; return 0; }
4290 EOF
4291 if { (eval echo configure:4292: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4292   rm -rf conftest*
4293   eval "ac_cv_func_gettimeofday=yes"
4294 else
4295   echo "configure: failed program was:" >&5
4296   cat conftest.$ac_ext >&5
4297   rm -rf conftest*
4298   eval "ac_cv_func_gettimeofday=no"
4299 fi
4300 rm -f conftest*
4301 fi
4302
4303 if eval "test \"`echo '$ac_cv_func_'gettimeofday`\" = yes"; then
4304   echo "$ac_t""yes" 1>&6
4305   cat >> confdefs.h <<\EOF
4306 #define HAVE_GETTIMEOFDAY 1
4307 EOF
4308
4309 else
4310   echo "$ac_t""no" 1>&6
4311
4312
4313 echo $ac_n "checking for gettimeofday in -lbsd""... $ac_c" 1>&6
4314 echo "configure:4315: checking for gettimeofday in -lbsd" >&5
4315 ac_lib_var=`echo bsd'_'gettimeofday | sed 'y%./+-%__p_%'`
4316 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4317   echo $ac_n "(cached) $ac_c" 1>&6
4318 else
4319   ac_save_LIBS="$LIBS"
4320 LIBS="-lbsd  $LIBS"
4321 cat > conftest.$ac_ext <<EOF
4322 #line 4323 "configure"
4323 #include "confdefs.h"
4324 /* Override any gcc2 internal prototype to avoid an error.  */
4325 /* We use char because int might match the return type of a gcc2
4326     builtin and then its argument prototype would still apply.  */
4327 char gettimeofday();
4328
4329 int main() {
4330 gettimeofday()
4331 ; return 0; }
4332 EOF
4333 if { (eval echo configure:4334: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4334   rm -rf conftest*
4335   eval "ac_cv_lib_$ac_lib_var=yes"
4336 else
4337   echo "configure: failed program was:" >&5
4338   cat conftest.$ac_ext >&5
4339   rm -rf conftest*
4340   eval "ac_cv_lib_$ac_lib_var=no"
4341 fi
4342 rm -f conftest*
4343 LIBS="$ac_save_LIBS"
4344
4345 fi
4346 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4347   echo "$ac_t""yes" 1>&6
4348   cat >> confdefs.h <<\EOF
4349 #define HAVE_GETTIMEOFDAY 1
4350 EOF
4351
4352         LIBS="$LIBS -lbsd"
4353 else
4354   echo "$ac_t""no" 1>&6
4355 fi
4356
4357 fi
4358
4359
4360 echo $ac_n "checking if -lm needed for math functions""... $ac_c" 1>&6
4361 echo "configure:4362: checking if -lm needed for math functions" >&5
4362 if eval "test \"`echo '$''{'cf_cv_need_libm'+set}'`\" = set"; then
4363   echo $ac_n "(cached) $ac_c" 1>&6
4364 else
4365   
4366         cat > conftest.$ac_ext <<EOF
4367 #line 4368 "configure"
4368 #include "confdefs.h"
4369
4370         #include <stdio.h>
4371         #include <math.h>
4372         
4373 int main() {
4374 double x = rand(); printf("result = %g\n", sin(x))
4375 ; return 0; }
4376 EOF
4377 if { (eval echo configure:4378: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4378   rm -rf conftest*
4379   cf_cv_need_libm=no
4380 else
4381   echo "configure: failed program was:" >&5
4382   cat conftest.$ac_ext >&5
4383   rm -rf conftest*
4384   cf_cv_need_libm=yes
4385 fi
4386 rm -f conftest*
4387 fi
4388
4389 echo "$ac_t""$cf_cv_need_libm" 1>&6
4390 if test "$cf_cv_need_libm" = yes
4391 then
4392 MATH_LIB=-lm
4393 fi
4394
4395
4396
4397 ###     Checks for header files.
4398 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
4399 echo "configure:4400: checking for ANSI C header files" >&5
4400 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then
4401   echo $ac_n "(cached) $ac_c" 1>&6
4402 else
4403   cat > conftest.$ac_ext <<EOF
4404 #line 4405 "configure"
4405 #include "confdefs.h"
4406 #include <stdlib.h>
4407 #include <stdarg.h>
4408 #include <string.h>
4409 #include <float.h>
4410 EOF
4411 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
4412 { (eval echo configure:4413: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
4413 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
4414 if test -z "$ac_err"; then
4415   rm -rf conftest*
4416   ac_cv_header_stdc=yes
4417 else
4418   echo "$ac_err" >&5
4419   echo "configure: failed program was:" >&5
4420   cat conftest.$ac_ext >&5
4421   rm -rf conftest*
4422   ac_cv_header_stdc=no
4423 fi
4424 rm -f conftest*
4425
4426 if test $ac_cv_header_stdc = yes; then
4427   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
4428 cat > conftest.$ac_ext <<EOF
4429 #line 4430 "configure"
4430 #include "confdefs.h"
4431 #include <string.h>
4432 EOF
4433 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
4434   egrep "memchr" >/dev/null 2>&1; then
4435   :
4436 else
4437   rm -rf conftest*
4438   ac_cv_header_stdc=no
4439 fi
4440 rm -f conftest*
4441
4442 fi
4443
4444 if test $ac_cv_header_stdc = yes; then
4445   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
4446 cat > conftest.$ac_ext <<EOF
4447 #line 4448 "configure"
4448 #include "confdefs.h"
4449 #include <stdlib.h>
4450 EOF
4451 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
4452   egrep "free" >/dev/null 2>&1; then
4453   :
4454 else
4455   rm -rf conftest*
4456   ac_cv_header_stdc=no
4457 fi
4458 rm -f conftest*
4459
4460 fi
4461
4462 if test $ac_cv_header_stdc = yes; then
4463   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
4464 if test "$cross_compiling" = yes; then
4465   :
4466 else
4467   cat > conftest.$ac_ext <<EOF
4468 #line 4469 "configure"
4469 #include "confdefs.h"
4470 #include <ctype.h>
4471 #define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
4472 #define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
4473 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
4474 int main () { int i; for (i = 0; i < 256; i++)
4475 if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
4476 exit (0); }
4477
4478 EOF
4479 if { (eval echo configure:4480: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
4480 then
4481   :
4482 else
4483   echo "configure: failed program was:" >&5
4484   cat conftest.$ac_ext >&5
4485   rm -fr conftest*
4486   ac_cv_header_stdc=no
4487 fi
4488 rm -fr conftest*
4489 fi
4490
4491 fi
4492 fi
4493
4494 echo "$ac_t""$ac_cv_header_stdc" 1>&6
4495 if test $ac_cv_header_stdc = yes; then
4496   cat >> confdefs.h <<\EOF
4497 #define STDC_HEADERS 1
4498 EOF
4499
4500 fi
4501
4502 ac_header_dirent=no
4503 for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h
4504 do
4505 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
4506 echo $ac_n "checking for $ac_hdr that defines DIR""... $ac_c" 1>&6
4507 echo "configure:4508: checking for $ac_hdr that defines DIR" >&5
4508 if eval "test \"`echo '$''{'ac_cv_header_dirent_$ac_safe'+set}'`\" = set"; then
4509   echo $ac_n "(cached) $ac_c" 1>&6
4510 else
4511   cat > conftest.$ac_ext <<EOF
4512 #line 4513 "configure"
4513 #include "confdefs.h"
4514 #include <sys/types.h>
4515 #include <$ac_hdr>
4516 int main() {
4517 DIR *dirp = 0;
4518 ; return 0; }
4519 EOF
4520 if { (eval echo configure:4521: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4521   rm -rf conftest*
4522   eval "ac_cv_header_dirent_$ac_safe=yes"
4523 else
4524   echo "configure: failed program was:" >&5
4525   cat conftest.$ac_ext >&5
4526   rm -rf conftest*
4527   eval "ac_cv_header_dirent_$ac_safe=no"
4528 fi
4529 rm -f conftest*
4530 fi
4531 if eval "test \"`echo '$ac_cv_header_dirent_'$ac_safe`\" = yes"; then
4532   echo "$ac_t""yes" 1>&6
4533     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
4534   cat >> confdefs.h <<EOF
4535 #define $ac_tr_hdr 1
4536 EOF
4537  ac_header_dirent=$ac_hdr; break
4538 else
4539   echo "$ac_t""no" 1>&6
4540 fi
4541 done
4542 # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix.
4543 if test $ac_header_dirent = dirent.h; then
4544 echo $ac_n "checking for opendir in -ldir""... $ac_c" 1>&6
4545 echo "configure:4546: checking for opendir in -ldir" >&5
4546 ac_lib_var=`echo dir'_'opendir | sed 'y%./+-%__p_%'`
4547 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4548   echo $ac_n "(cached) $ac_c" 1>&6
4549 else
4550   ac_save_LIBS="$LIBS"
4551 LIBS="-ldir  $LIBS"
4552 cat > conftest.$ac_ext <<EOF
4553 #line 4554 "configure"
4554 #include "confdefs.h"
4555 /* Override any gcc2 internal prototype to avoid an error.  */
4556 /* We use char because int might match the return type of a gcc2
4557     builtin and then its argument prototype would still apply.  */
4558 char opendir();
4559
4560 int main() {
4561 opendir()
4562 ; return 0; }
4563 EOF
4564 if { (eval echo configure:4565: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4565   rm -rf conftest*
4566   eval "ac_cv_lib_$ac_lib_var=yes"
4567 else
4568   echo "configure: failed program was:" >&5
4569   cat conftest.$ac_ext >&5
4570   rm -rf conftest*
4571   eval "ac_cv_lib_$ac_lib_var=no"
4572 fi
4573 rm -f conftest*
4574 LIBS="$ac_save_LIBS"
4575
4576 fi
4577 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4578   echo "$ac_t""yes" 1>&6
4579   LIBS="$LIBS -ldir"
4580 else
4581   echo "$ac_t""no" 1>&6
4582 fi
4583
4584 else
4585 echo $ac_n "checking for opendir in -lx""... $ac_c" 1>&6
4586 echo "configure:4587: checking for opendir in -lx" >&5
4587 ac_lib_var=`echo x'_'opendir | sed 'y%./+-%__p_%'`
4588 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4589   echo $ac_n "(cached) $ac_c" 1>&6
4590 else
4591   ac_save_LIBS="$LIBS"
4592 LIBS="-lx  $LIBS"
4593 cat > conftest.$ac_ext <<EOF
4594 #line 4595 "configure"
4595 #include "confdefs.h"
4596 /* Override any gcc2 internal prototype to avoid an error.  */
4597 /* We use char because int might match the return type of a gcc2
4598     builtin and then its argument prototype would still apply.  */
4599 char opendir();
4600
4601 int main() {
4602 opendir()
4603 ; return 0; }
4604 EOF
4605 if { (eval echo configure:4606: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4606   rm -rf conftest*
4607   eval "ac_cv_lib_$ac_lib_var=yes"
4608 else
4609   echo "configure: failed program was:" >&5
4610   cat conftest.$ac_ext >&5
4611   rm -rf conftest*
4612   eval "ac_cv_lib_$ac_lib_var=no"
4613 fi
4614 rm -f conftest*
4615 LIBS="$ac_save_LIBS"
4616
4617 fi
4618 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4619   echo "$ac_t""yes" 1>&6
4620   LIBS="$LIBS -lx"
4621 else
4622   echo "$ac_t""no" 1>&6
4623 fi
4624
4625 fi
4626
4627
4628 echo $ac_n "checking for regular-expression headers""... $ac_c" 1>&6
4629 echo "configure:4630: checking for regular-expression headers" >&5
4630 if eval "test \"`echo '$''{'cf_cv_regex'+set}'`\" = set"; then
4631   echo $ac_n "(cached) $ac_c" 1>&6
4632 else
4633   
4634 cat > conftest.$ac_ext <<EOF
4635 #line 4636 "configure"
4636 #include "confdefs.h"
4637 #include <sys/types.h>
4638 #include <regex.h>
4639 int main() {
4640
4641         regex_t *p;
4642         int x = regcomp(p, "", 0);
4643         int y = regexec(p, "", 0, 0, 0);
4644         regfree(p);
4645         
4646 ; return 0; }
4647 EOF
4648 if { (eval echo configure:4649: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4649   rm -rf conftest*
4650   cf_cv_regex="regex.h"
4651 else
4652   echo "configure: failed program was:" >&5
4653   cat conftest.$ac_ext >&5
4654   rm -rf conftest*
4655   
4656         cat > conftest.$ac_ext <<EOF
4657 #line 4658 "configure"
4658 #include "confdefs.h"
4659 #include <regexp.h>
4660 int main() {
4661
4662                 char *p = compile("", "", "", 0);
4663                 int x = step("", "");
4664         
4665 ; return 0; }
4666 EOF
4667 if { (eval echo configure:4668: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4668   rm -rf conftest*
4669   cf_cv_regex="regexp.h"
4670 else
4671   echo "configure: failed program was:" >&5
4672   cat conftest.$ac_ext >&5
4673   rm -rf conftest*
4674   
4675                 cf_save_LIBS="$LIBS"
4676                 LIBS="-lgen $LIBS"
4677                 cat > conftest.$ac_ext <<EOF
4678 #line 4679 "configure"
4679 #include "confdefs.h"
4680 #include <regexpr.h>
4681 int main() {
4682
4683                         char *p = compile("", "", "");
4684                         int x = step("", "");
4685                 
4686 ; return 0; }
4687 EOF
4688 if { (eval echo configure:4689: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4689   rm -rf conftest*
4690   cf_cv_regex="regexpr.h"
4691 else
4692   echo "configure: failed program was:" >&5
4693   cat conftest.$ac_ext >&5
4694   rm -rf conftest*
4695   LIBS="$cf_save_LIBS"
4696 fi
4697 rm -f conftest*
4698 fi
4699 rm -f conftest*
4700 fi
4701 rm -f conftest*
4702
4703 fi
4704
4705 echo "$ac_t""$cf_cv_regex" 1>&6
4706 case $cf_cv_regex in
4707         regex.h)   cat >> confdefs.h <<\EOF
4708 #define HAVE_REGEX_H_FUNCS 1
4709 EOF
4710  ;;
4711         regexp.h)  cat >> confdefs.h <<\EOF
4712 #define HAVE_REGEXP_H_FUNCS 1
4713 EOF
4714  ;;
4715         regexpr.h) cat >> confdefs.h <<\EOF
4716 #define HAVE_REGEXPR_H_FUNCS 1
4717 EOF
4718  ;;
4719 esac
4720
4721
4722 for ac_hdr in \
4723 fcntl.h \
4724 getopt.h \
4725 libc.h \
4726 limits.h \
4727 locale.h \
4728 poll.h \
4729 sys/bsdtypes.h \
4730 sys/ioctl.h \
4731 sys/param.h \
4732 sys/poll.h \
4733 sys/select.h \
4734 sys/time.h \
4735 sys/times.h \
4736 ttyent.h \
4737 unistd.h \
4738
4739 do
4740 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
4741 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
4742 echo "configure:4743: checking for $ac_hdr" >&5
4743 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
4744   echo $ac_n "(cached) $ac_c" 1>&6
4745 else
4746   cat > conftest.$ac_ext <<EOF
4747 #line 4748 "configure"
4748 #include "confdefs.h"
4749 #include <$ac_hdr>
4750 EOF
4751 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
4752 { (eval echo configure:4753: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
4753 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
4754 if test -z "$ac_err"; then
4755   rm -rf conftest*
4756   eval "ac_cv_header_$ac_safe=yes"
4757 else
4758   echo "$ac_err" >&5
4759   echo "configure: failed program was:" >&5
4760   cat conftest.$ac_ext >&5
4761   rm -rf conftest*
4762   eval "ac_cv_header_$ac_safe=no"
4763 fi
4764 rm -f conftest*
4765 fi
4766 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
4767   echo "$ac_t""yes" 1>&6
4768     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
4769   cat >> confdefs.h <<EOF
4770 #define $ac_tr_hdr 1
4771 EOF
4772  
4773 else
4774   echo "$ac_t""no" 1>&6
4775 fi
4776 done
4777
4778
4779 # check for ISC (this may also define _POSIX_SOURCE)
4780 # Note: even non-Posix ISC needs <sys/bsdtypes.h> to declare fd_set
4781 if test "$ISC" = yes ; then
4782         echo $ac_n "checking for main in -lcposix""... $ac_c" 1>&6
4783 echo "configure:4784: checking for main in -lcposix" >&5
4784 ac_lib_var=`echo cposix'_'main | sed 'y%./+-%__p_%'`
4785 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4786   echo $ac_n "(cached) $ac_c" 1>&6
4787 else
4788   ac_save_LIBS="$LIBS"
4789 LIBS="-lcposix  $LIBS"
4790 cat > conftest.$ac_ext <<EOF
4791 #line 4792 "configure"
4792 #include "confdefs.h"
4793
4794 int main() {
4795 main()
4796 ; return 0; }
4797 EOF
4798 if { (eval echo configure:4799: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4799   rm -rf conftest*
4800   eval "ac_cv_lib_$ac_lib_var=yes"
4801 else
4802   echo "configure: failed program was:" >&5
4803   cat conftest.$ac_ext >&5
4804   rm -rf conftest*
4805   eval "ac_cv_lib_$ac_lib_var=no"
4806 fi
4807 rm -f conftest*
4808 LIBS="$ac_save_LIBS"
4809
4810 fi
4811 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4812   echo "$ac_t""yes" 1>&6
4813     ac_tr_lib=HAVE_LIB`echo cposix | sed -e 's/[^a-zA-Z0-9_]/_/g' \
4814     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
4815   cat >> confdefs.h <<EOF
4816 #define $ac_tr_lib 1
4817 EOF
4818
4819   LIBS="-lcposix $LIBS"
4820
4821 else
4822   echo "$ac_t""no" 1>&6
4823 fi
4824
4825         echo $ac_n "checking for bzero in -linet""... $ac_c" 1>&6
4826 echo "configure:4827: checking for bzero in -linet" >&5
4827 ac_lib_var=`echo inet'_'bzero | sed 'y%./+-%__p_%'`
4828 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4829   echo $ac_n "(cached) $ac_c" 1>&6
4830 else
4831   ac_save_LIBS="$LIBS"
4832 LIBS="-linet  $LIBS"
4833 cat > conftest.$ac_ext <<EOF
4834 #line 4835 "configure"
4835 #include "confdefs.h"
4836 /* Override any gcc2 internal prototype to avoid an error.  */
4837 /* We use char because int might match the return type of a gcc2
4838     builtin and then its argument prototype would still apply.  */
4839 char bzero();
4840
4841 int main() {
4842 bzero()
4843 ; return 0; }
4844 EOF
4845 if { (eval echo configure:4846: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4846   rm -rf conftest*
4847   eval "ac_cv_lib_$ac_lib_var=yes"
4848 else
4849   echo "configure: failed program was:" >&5
4850   cat conftest.$ac_ext >&5
4851   rm -rf conftest*
4852   eval "ac_cv_lib_$ac_lib_var=no"
4853 fi
4854 rm -f conftest*
4855 LIBS="$ac_save_LIBS"
4856
4857 fi
4858 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4859   echo "$ac_t""yes" 1>&6
4860   LIBS="$LIBS -linet"
4861 else
4862   echo "$ac_t""no" 1>&6
4863 fi
4864 fi
4865
4866
4867 echo $ac_n "checking if sys/time.h works with sys/select.h""... $ac_c" 1>&6
4868 echo "configure:4869: checking if sys/time.h works with sys/select.h" >&5
4869 if eval "test \"`echo '$''{'cf_cv_sys_time_select'+set}'`\" = set"; then
4870   echo $ac_n "(cached) $ac_c" 1>&6
4871 else
4872   
4873 cat > conftest.$ac_ext <<EOF
4874 #line 4875 "configure"
4875 #include "confdefs.h"
4876
4877 #include <sys/types.h>
4878 #ifdef HAVE_SYS_TIME_H
4879 #include <sys/time.h>
4880 #endif
4881 #ifdef HAVE_SYS_SELECT_H
4882 #include <sys/select.h>
4883 #endif
4884
4885 int main() {
4886
4887 ; return 0; }
4888 EOF
4889 if { (eval echo configure:4890: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4890   rm -rf conftest*
4891   cf_cv_sys_time_select=yes
4892 else
4893   echo "configure: failed program was:" >&5
4894   cat conftest.$ac_ext >&5
4895   rm -rf conftest*
4896   cf_cv_sys_time_select=no
4897 fi
4898 rm -f conftest*
4899      
4900 fi
4901
4902 echo "$ac_t""$cf_cv_sys_time_select" 1>&6
4903 test "$cf_cv_sys_time_select" = yes && cat >> confdefs.h <<\EOF
4904 #define HAVE_SYS_TIME_SELECT 1
4905 EOF
4906
4907
4908
4909 ###     checks for compiler characteristics
4910 ac_ext=c
4911 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
4912 ac_cpp='$CPP $CPPFLAGS'
4913 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
4914 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
4915 cross_compiling=$ac_cv_prog_cc_cross
4916
4917 echo $ac_n "checking for working const""... $ac_c" 1>&6
4918 echo "configure:4919: checking for working const" >&5
4919 if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then
4920   echo $ac_n "(cached) $ac_c" 1>&6
4921 else
4922   cat > conftest.$ac_ext <<EOF
4923 #line 4924 "configure"
4924 #include "confdefs.h"
4925
4926 int main() {
4927
4928 /* Ultrix mips cc rejects this.  */
4929 typedef int charset[2]; const charset x;
4930 /* SunOS 4.1.1 cc rejects this.  */
4931 char const *const *ccp;
4932 char **p;
4933 /* NEC SVR4.0.2 mips cc rejects this.  */
4934 struct point {int x, y;};
4935 static struct point const zero = {0,0};
4936 /* AIX XL C 1.02.0.0 rejects this.
4937    It does not let you subtract one const X* pointer from another in an arm
4938    of an if-expression whose if-part is not a constant expression */
4939 const char *g = "string";
4940 ccp = &g + (g ? g-g : 0);
4941 /* HPUX 7.0 cc rejects these. */
4942 ++ccp;
4943 p = (char**) ccp;
4944 ccp = (char const *const *) p;
4945 { /* SCO 3.2v4 cc rejects this.  */
4946   char *t;
4947   char const *s = 0 ? (char *) 0 : (char const *) 0;
4948
4949   *t++ = 0;
4950 }
4951 { /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  */
4952   int x[] = {25, 17};
4953   const int *foo = &x[0];
4954   ++foo;
4955 }
4956 { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
4957   typedef const int *iptr;
4958   iptr p = 0;
4959   ++p;
4960 }
4961 { /* AIX XL C 1.02.0.0 rejects this saying
4962      "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
4963   struct s { int j; const int *ap[3]; };
4964   struct s *b; b->j = 5;
4965 }
4966 { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
4967   const int foo = 10;
4968 }
4969
4970 ; return 0; }
4971 EOF
4972 if { (eval echo configure:4973: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4973   rm -rf conftest*
4974   ac_cv_c_const=yes
4975 else
4976   echo "configure: failed program was:" >&5
4977   cat conftest.$ac_ext >&5
4978   rm -rf conftest*
4979   ac_cv_c_const=no
4980 fi
4981 rm -f conftest*
4982 fi
4983
4984 echo "$ac_t""$ac_cv_c_const" 1>&6
4985 if test $ac_cv_c_const = no; then
4986   cat >> confdefs.h <<\EOF
4987 #define const 
4988 EOF
4989
4990 fi
4991
4992 echo $ac_n "checking for inline""... $ac_c" 1>&6
4993 echo "configure:4994: checking for inline" >&5
4994 if eval "test \"`echo '$''{'ac_cv_c_inline'+set}'`\" = set"; then
4995   echo $ac_n "(cached) $ac_c" 1>&6
4996 else
4997   ac_cv_c_inline=no
4998 for ac_kw in inline __inline__ __inline; do
4999   cat > conftest.$ac_ext <<EOF
5000 #line 5001 "configure"
5001 #include "confdefs.h"
5002
5003 int main() {
5004 } $ac_kw foo() {
5005 ; return 0; }
5006 EOF
5007 if { (eval echo configure:5008: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
5008   rm -rf conftest*
5009   ac_cv_c_inline=$ac_kw; break
5010 else
5011   echo "configure: failed program was:" >&5
5012   cat conftest.$ac_ext >&5
5013 fi
5014 rm -f conftest*
5015 done
5016
5017 fi
5018
5019 echo "$ac_t""$ac_cv_c_inline" 1>&6
5020 case "$ac_cv_c_inline" in
5021   inline | yes) ;;
5022   no) cat >> confdefs.h <<\EOF
5023 #define inline 
5024 EOF
5025  ;;
5026   *)  cat >> confdefs.h <<EOF
5027 #define inline $ac_cv_c_inline
5028 EOF
5029  ;;
5030 esac
5031
5032 test "$ac_cv_c_inline" != no && cat >> confdefs.h <<\EOF
5033 #define CC_HAS_INLINE_FUNCS 1
5034 EOF
5035
5036
5037
5038 echo $ac_n "checking if unsigned literals are legal""... $ac_c" 1>&6
5039 echo "configure:5040: checking if unsigned literals are legal" >&5
5040 if eval "test \"`echo '$''{'cf_cv_unsigned_literals'+set}'`\" = set"; then
5041   echo $ac_n "(cached) $ac_c" 1>&6
5042 else
5043   
5044         cat > conftest.$ac_ext <<EOF
5045 #line 5046 "configure"
5046 #include "confdefs.h"
5047
5048 int main() {
5049 long x = 1L + 1UL + 1U + 1
5050 ; return 0; }
5051 EOF
5052 if { (eval echo configure:5053: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
5053   rm -rf conftest*
5054   cf_cv_unsigned_literals=yes
5055 else
5056   echo "configure: failed program was:" >&5
5057   cat conftest.$ac_ext >&5
5058   rm -rf conftest*
5059   cf_cv_unsigned_literals=no
5060 fi
5061 rm -f conftest*
5062         
5063 fi
5064
5065 echo "$ac_t""$cf_cv_unsigned_literals" 1>&6
5066
5067
5068
5069 echo $ac_n "checking for type of chtype""... $ac_c" 1>&6
5070 echo "configure:5071: checking for type of chtype" >&5
5071 if eval "test \"`echo '$''{'cf_cv_typeof_chtype'+set}'`\" = set"; then
5072   echo $ac_n "(cached) $ac_c" 1>&6
5073 else
5074   
5075                 if test "$cross_compiling" = yes; then
5076   cf_cv_typeof_chtype=long
5077 else
5078   cat > conftest.$ac_ext <<EOF
5079 #line 5080 "configure"
5080 #include "confdefs.h"
5081
5082 #ifdef USE_WIDEC_SUPPORT
5083 #include <stddef.h>     /* we want wchar_t */
5084 #define WANT_BITS 39
5085 #else
5086 #define WANT_BITS 31
5087 #endif
5088 #include <stdio.h>
5089 int main()
5090 {
5091         FILE *fp = fopen("cf_test.out", "w");
5092         if (fp != 0) {
5093                 char *result = "long";
5094 #ifdef USE_WIDEC_SUPPORT
5095                 /*
5096                  * If wchar_t is smaller than a long, it must be an int or a
5097                  * short.  We prefer not to use a short anyway.
5098                  */
5099                 if (sizeof(unsigned long) > sizeof(wchar_t))
5100                         result = "int";
5101 #endif
5102                 if (sizeof(unsigned long) > sizeof(unsigned int)) {
5103                         int n;
5104                         unsigned int x;
5105                         for (n = 0; n < WANT_BITS; n++) {
5106                                 unsigned int y = (x >> n);
5107                                 if (y != 1 || x == 0) {
5108                                         x = 0;
5109                                         break;
5110                                 }
5111                         }
5112                         /*
5113                          * If x is nonzero, an int is big enough for the bits
5114                          * that we want.
5115                          */
5116                         result = (x != 0) ? "int" : "long";
5117                 }
5118                 fputs(result, fp);
5119                 fclose(fp);
5120         }
5121         exit(0);
5122 }
5123                 
5124 EOF
5125 if { (eval echo configure:5126: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
5126 then
5127   cf_cv_typeof_chtype=`cat cf_test.out`
5128 else
5129   echo "configure: failed program was:" >&5
5130   cat conftest.$ac_ext >&5
5131   rm -fr conftest*
5132   cf_cv_typeof_chtype=long
5133 fi
5134 rm -fr conftest*
5135 fi
5136
5137                 rm -f cf_test.out
5138         
5139 fi
5140
5141 echo "$ac_t""$cf_cv_typeof_chtype" 1>&6
5142
5143
5144 cat >> confdefs.h <<EOF
5145 #define TYPEOF_CHTYPE $cf_cv_typeof_chtype
5146 EOF
5147
5148
5149 cf_cv_1UL="1"
5150 test "$cf_cv_unsigned_literals" = yes && cf_cv_1UL="${cf_cv_1UL}U"
5151 test "$cf_cv_typeof_chtype"    = long && cf_cv_1UL="${cf_cv_1UL}L"
5152
5153
5154
5155
5156
5157 echo $ac_n "checking for number of bits in chtype""... $ac_c" 1>&6
5158 echo "configure:5159: checking for number of bits in chtype" >&5
5159 if eval "test \"`echo '$''{'cf_cv_shift_limit'+set}'`\" = set"; then
5160   echo $ac_n "(cached) $ac_c" 1>&6
5161 else
5162   
5163         if test "$cross_compiling" = yes; then
5164   cf_cv_shift_limit=32
5165 else
5166   cat > conftest.$ac_ext <<EOF
5167 #line 5168 "configure"
5168 #include "confdefs.h"
5169
5170 #include <stdio.h>
5171 int main()
5172 {
5173         FILE *fp = fopen("cf_test.out", "w");
5174         if (fp != 0) {
5175                 int n;
5176                 unsigned TYPEOF_CHTYPE x = 1L;
5177                 for (n = 0; ; n++) {
5178                         unsigned long y = (x >> n);
5179                         if (y != 1 || x == 0)
5180                                 break;
5181                         x <<= 1;
5182                 }
5183                 fprintf(fp, "%d", n);
5184                 fclose(fp);
5185         }
5186         exit(0);
5187 }
5188                 
5189 EOF
5190 if { (eval echo configure:5191: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
5191 then
5192   cf_cv_shift_limit=`cat cf_test.out`
5193 else
5194   echo "configure: failed program was:" >&5
5195   cat conftest.$ac_ext >&5
5196   rm -fr conftest*
5197   cf_cv_shift_limit=32
5198 fi
5199 rm -fr conftest*
5200 fi
5201
5202                 rm -f cf_test.out
5203         
5204 fi
5205
5206 echo "$ac_t""$cf_cv_shift_limit" 1>&6
5207
5208
5209 echo $ac_n "checking for width of character-index""... $ac_c" 1>&6
5210 echo "configure:5211: checking for width of character-index" >&5
5211 if eval "test \"`echo '$''{'cf_cv_widec_shift'+set}'`\" = set"; then
5212   echo $ac_n "(cached) $ac_c" 1>&6
5213 else
5214   
5215 if test ".$with_widec" = ".yes" ; then
5216         cf_attrs_width=39
5217         if ( expr $cf_cv_shift_limit \> $cf_attrs_width >/dev/null )
5218         then
5219                 cf_cv_widec_shift=`expr 16 + $cf_cv_shift_limit - $cf_attrs_width`
5220         else
5221                 cf_cv_widec_shift=16
5222         fi
5223 else
5224         cf_cv_widec_shift=8
5225 fi
5226
5227 fi
5228
5229 echo "$ac_t""$cf_cv_widec_shift" 1>&6
5230
5231
5232
5233 ###     Checks for external-data
5234
5235
5236 echo $ac_n "checking if external errno is declared""... $ac_c" 1>&6
5237 echo "configure:5238: checking if external errno is declared" >&5
5238 if eval "test \"`echo '$''{'cf_cv_dcl_errno'+set}'`\" = set"; then
5239   echo $ac_n "(cached) $ac_c" 1>&6
5240 else
5241   
5242     cat > conftest.$ac_ext <<EOF
5243 #line 5244 "configure"
5244 #include "confdefs.h"
5245
5246 #ifdef HAVE_STDLIB_H
5247 #include <stdlib.h>
5248 #endif
5249 #include <stdio.h>
5250 #include <sys/types.h>
5251 #include <errno.h> 
5252 int main() {
5253 long x = (long) errno
5254 ; return 0; }
5255 EOF
5256 if { (eval echo configure:5257: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
5257   rm -rf conftest*
5258   eval 'cf_cv_dcl_'errno'=yes'
5259 else
5260   echo "configure: failed program was:" >&5
5261   cat conftest.$ac_ext >&5
5262   rm -rf conftest*
5263   eval 'cf_cv_dcl_'errno'=no'
5264 fi
5265 rm -f conftest*
5266
5267 fi
5268
5269
5270 eval 'cf_result=$cf_cv_dcl_'errno
5271 echo "$ac_t""$cf_result" 1>&6
5272
5273 if test "$cf_result" = no ; then
5274     eval 'cf_result=DECL_'errno
5275     
5276 cf_result=`echo "$cf_result" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
5277
5278     cat >> confdefs.h <<EOF
5279 #define $cf_result 1
5280 EOF
5281
5282 fi
5283
5284 # It's possible (for near-UNIX clones) that the data doesn't exist
5285
5286 echo $ac_n "checking if external errno exists""... $ac_c" 1>&6
5287 echo "configure:5288: checking if external errno exists" >&5
5288 if eval "test \"`echo '$''{'cf_cv_have_errno'+set}'`\" = set"; then
5289   echo $ac_n "(cached) $ac_c" 1>&6
5290 else
5291   
5292     cat > conftest.$ac_ext <<EOF
5293 #line 5294 "configure"
5294 #include "confdefs.h"
5295
5296 #undef errno
5297 extern int errno;
5298
5299 int main() {
5300 errno = 2
5301 ; return 0; }
5302 EOF
5303 if { (eval echo configure:5304: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5304   rm -rf conftest*
5305   eval 'cf_cv_have_'errno'=yes'
5306 else
5307   echo "configure: failed program was:" >&5
5308   cat conftest.$ac_ext >&5
5309   rm -rf conftest*
5310   eval 'cf_cv_have_'errno'=no'
5311 fi
5312 rm -f conftest*
5313 fi
5314
5315
5316 eval 'cf_result=$cf_cv_have_'errno
5317 echo "$ac_t""$cf_result" 1>&6
5318
5319 if test "$cf_result" = yes ; then
5320     eval 'cf_result=HAVE_'errno
5321     
5322 cf_result=`echo "$cf_result" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
5323
5324     cat >> confdefs.h <<EOF
5325 #define $cf_result 1
5326 EOF
5327
5328 fi
5329
5330
5331
5332
5333
5334 echo $ac_n "checking if data-only library module links""... $ac_c" 1>&6
5335 echo "configure:5336: checking if data-only library module links" >&5
5336 if eval "test \"`echo '$''{'cf_cv_link_dataonly'+set}'`\" = set"; then
5337   echo $ac_n "(cached) $ac_c" 1>&6
5338 else
5339   
5340         rm -f conftest.a
5341                 cat >conftest.$ac_ext <<EOF
5342 #line 5343 "configure"
5343 int     testdata[3] = { 123, 456, 789 };
5344 EOF
5345                 if { (eval echo configure:5346: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; } ; then
5346                 mv conftest.o data.o && \
5347                 ( $AR $AR_OPTS conftest.a data.o ) 2>&5 1>/dev/null
5348         fi
5349         rm -f conftest.$ac_ext data.o
5350                 cat >conftest.$ac_ext <<EOF
5351 #line 5352 "configure"
5352 int     testfunc()
5353 {
5354 #if defined(NeXT)
5355         exit(1);        /* I'm told this linker is broken */
5356 #else
5357         extern int testdata[3];
5358         return testdata[0] == 123
5359            &&  testdata[1] == 456
5360            &&  testdata[2] == 789;
5361 #endif
5362 }
5363 EOF
5364                 if { (eval echo configure:5365: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
5365                 mv conftest.o func.o && \
5366                 ( $AR $AR_OPTS conftest.a func.o ) 2>&5 1>/dev/null
5367         fi
5368         rm -f conftest.$ac_ext func.o
5369         ( eval $ac_cv_prog_RANLIB conftest.a ) 2>&5 >/dev/null
5370         cf_saveLIBS="$LIBS"
5371         LIBS="conftest.a $LIBS"
5372         if test "$cross_compiling" = yes; then
5373   cf_cv_link_dataonly=unknown
5374 else
5375   cat > conftest.$ac_ext <<EOF
5376 #line 5377 "configure"
5377 #include "confdefs.h"
5378
5379         int main()
5380         {
5381                 extern int testfunc();
5382                 exit (!testfunc());
5383         }
5384         
5385 EOF
5386 if { (eval echo configure:5387: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
5387 then
5388   cf_cv_link_dataonly=yes
5389 else
5390   echo "configure: failed program was:" >&5
5391   cat conftest.$ac_ext >&5
5392   rm -fr conftest*
5393   cf_cv_link_dataonly=no
5394 fi
5395 rm -fr conftest*
5396 fi
5397
5398         LIBS="$cf_saveLIBS"
5399         
5400 fi
5401
5402 echo "$ac_t""$cf_cv_link_dataonly" 1>&6
5403 test "$cf_cv_link_dataonly" = no && cat >> confdefs.h <<\EOF
5404 #define BROKEN_LINKER 1
5405 EOF
5406
5407
5408
5409 ###     Checks for library functions.
5410 for ac_func in \
5411 getcwd \
5412 getegid \
5413 geteuid \
5414 getttynam \
5415 issetugid \
5416 memccpy \
5417 mkstemp \
5418 nanosleep \
5419 poll \
5420 remove \
5421 select \
5422 setbuf \
5423 setbuffer \
5424 setvbuf \
5425 sigaction \
5426 sigvec \
5427 strdup \
5428 strstr \
5429 tcgetpgrp \
5430 times \
5431 vfscanf \
5432 vsnprintf \
5433 vsscanf \
5434
5435 do
5436 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
5437 echo "configure:5438: checking for $ac_func" >&5
5438 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
5439   echo $ac_n "(cached) $ac_c" 1>&6
5440 else
5441   cat > conftest.$ac_ext <<EOF
5442 #line 5443 "configure"
5443 #include "confdefs.h"
5444 /* System header to define __stub macros and hopefully few prototypes,
5445     which can conflict with char $ac_func(); below.  */
5446 #include <assert.h>
5447 /* Override any gcc2 internal prototype to avoid an error.  */
5448 /* We use char because int might match the return type of a gcc2
5449     builtin and then its argument prototype would still apply.  */
5450 char $ac_func();
5451
5452 int main() {
5453
5454 /* The GNU C library defines this for functions which it implements
5455     to always fail with ENOSYS.  Some functions are actually named
5456     something starting with __ and the normal name is an alias.  */
5457 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
5458 choke me
5459 #else
5460 $ac_func();
5461 #endif
5462
5463 ; return 0; }
5464 EOF
5465 if { (eval echo configure:5466: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5466   rm -rf conftest*
5467   eval "ac_cv_func_$ac_func=yes"
5468 else
5469   echo "configure: failed program was:" >&5
5470   cat conftest.$ac_ext >&5
5471   rm -rf conftest*
5472   eval "ac_cv_func_$ac_func=no"
5473 fi
5474 rm -f conftest*
5475 fi
5476
5477 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
5478   echo "$ac_t""yes" 1>&6
5479     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
5480   cat >> confdefs.h <<EOF
5481 #define $ac_tr_func 1
5482 EOF
5483  
5484 else
5485   echo "$ac_t""no" 1>&6
5486 fi
5487 done
5488
5489 if test "$with_getcap" = "yes" ; then
5490         
5491 echo $ac_n "checking for terminal-capability database functions""... $ac_c" 1>&6
5492 echo "configure:5493: checking for terminal-capability database functions" >&5
5493 if eval "test \"`echo '$''{'cf_cv_cgetent'+set}'`\" = set"; then
5494   echo $ac_n "(cached) $ac_c" 1>&6
5495 else
5496   
5497 cat > conftest.$ac_ext <<EOF
5498 #line 5499 "configure"
5499 #include "confdefs.h"
5500
5501 #include <stdlib.h>
5502 int main() {
5503
5504         char temp[128];
5505         char *buf = temp;
5506         char *db_array = temp;
5507         cgetent(&buf, /* int *, */ &db_array, "vt100");
5508         cgetcap(buf, "tc", '=');
5509         cgetmatch(buf, "tc");
5510         
5511 ; return 0; }
5512 EOF
5513 if { (eval echo configure:5514: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5514   rm -rf conftest*
5515   cf_cv_cgetent=yes
5516 else
5517   echo "configure: failed program was:" >&5
5518   cat conftest.$ac_ext >&5
5519   rm -rf conftest*
5520   cf_cv_cgetent=no
5521 fi
5522 rm -f conftest*
5523
5524 fi
5525
5526 echo "$ac_t""$cf_cv_cgetent" 1>&6
5527 test "$cf_cv_cgetent" = yes && cat >> confdefs.h <<\EOF
5528 #define HAVE_BSD_CGETENT 1
5529 EOF
5530
5531
5532 fi
5533
5534
5535 echo $ac_n "checking for isascii""... $ac_c" 1>&6
5536 echo "configure:5537: checking for isascii" >&5
5537 if eval "test \"`echo '$''{'cf_cv_have_isascii'+set}'`\" = set"; then
5538   echo $ac_n "(cached) $ac_c" 1>&6
5539 else
5540   
5541         cat > conftest.$ac_ext <<EOF
5542 #line 5543 "configure"
5543 #include "confdefs.h"
5544 #include <ctype.h>
5545 int main() {
5546 int x = isascii(' ')
5547 ; return 0; }
5548 EOF
5549 if { (eval echo configure:5550: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5550   rm -rf conftest*
5551   cf_cv_have_isascii=yes
5552 else
5553   echo "configure: failed program was:" >&5
5554   cat conftest.$ac_ext >&5
5555   rm -rf conftest*
5556   cf_cv_have_isascii=no
5557 fi
5558 rm -f conftest*
5559
5560 fi
5561 echo "$ac_t""$cf_cv_have_isascii" 1>&6
5562 test "$cf_cv_have_isascii" = yes && cat >> confdefs.h <<\EOF
5563 #define HAVE_ISASCII 1
5564 EOF
5565
5566
5567
5568 if test "$ac_cv_func_sigaction" = yes; then
5569 echo $ac_n "checking whether sigaction needs _POSIX_SOURCE""... $ac_c" 1>&6
5570 echo "configure:5571: checking whether sigaction needs _POSIX_SOURCE" >&5
5571 cat > conftest.$ac_ext <<EOF
5572 #line 5573 "configure"
5573 #include "confdefs.h"
5574
5575 #include <sys/types.h>
5576 #include <signal.h>
5577 int main() {
5578 struct sigaction act
5579 ; return 0; }
5580 EOF
5581 if { (eval echo configure:5582: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
5582   rm -rf conftest*
5583   sigact_bad=no
5584 else
5585   echo "configure: failed program was:" >&5
5586   cat conftest.$ac_ext >&5
5587   rm -rf conftest*
5588   
5589 cat > conftest.$ac_ext <<EOF
5590 #line 5591 "configure"
5591 #include "confdefs.h"
5592
5593 #define _POSIX_SOURCE
5594 #include <sys/types.h>
5595 #include <signal.h>
5596 int main() {
5597 struct sigaction act
5598 ; return 0; }
5599 EOF
5600 if { (eval echo configure:5601: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
5601   rm -rf conftest*
5602   sigact_bad=yes
5603          cat >> confdefs.h <<\EOF
5604 #define SVR4_ACTION 1
5605 EOF
5606
5607 else
5608   echo "configure: failed program was:" >&5
5609   cat conftest.$ac_ext >&5
5610   rm -rf conftest*
5611   sigact_bad=unknown
5612 fi
5613 rm -f conftest*
5614 fi
5615 rm -f conftest*
5616 echo "$ac_t""$sigact_bad" 1>&6
5617 fi
5618
5619
5620 for ac_hdr in \
5621 termio.h \
5622 termios.h \
5623 unistd.h \
5624
5625 do
5626 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
5627 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
5628 echo "configure:5629: checking for $ac_hdr" >&5
5629 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
5630   echo $ac_n "(cached) $ac_c" 1>&6
5631 else
5632   cat > conftest.$ac_ext <<EOF
5633 #line 5634 "configure"
5634 #include "confdefs.h"
5635 #include <$ac_hdr>
5636 EOF
5637 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
5638 { (eval echo configure:5639: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
5639 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
5640 if test -z "$ac_err"; then
5641   rm -rf conftest*
5642   eval "ac_cv_header_$ac_safe=yes"
5643 else
5644   echo "$ac_err" >&5
5645   echo "configure: failed program was:" >&5
5646   cat conftest.$ac_ext >&5
5647   rm -rf conftest*
5648   eval "ac_cv_header_$ac_safe=no"
5649 fi
5650 rm -f conftest*
5651 fi
5652 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
5653   echo "$ac_t""yes" 1>&6
5654     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
5655   cat >> confdefs.h <<EOF
5656 #define $ac_tr_hdr 1
5657 EOF
5658  
5659 else
5660   echo "$ac_t""no" 1>&6
5661 fi
5662 done
5663
5664 if test "$ISC" = yes ; then
5665         for ac_hdr in sys/termio.h 
5666 do
5667 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
5668 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
5669 echo "configure:5670: checking for $ac_hdr" >&5
5670 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
5671   echo $ac_n "(cached) $ac_c" 1>&6
5672 else
5673   cat > conftest.$ac_ext <<EOF
5674 #line 5675 "configure"
5675 #include "confdefs.h"
5676 #include <$ac_hdr>
5677 EOF
5678 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
5679 { (eval echo configure:5680: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
5680 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
5681 if test -z "$ac_err"; then
5682   rm -rf conftest*
5683   eval "ac_cv_header_$ac_safe=yes"
5684 else
5685   echo "$ac_err" >&5
5686   echo "configure: failed program was:" >&5
5687   cat conftest.$ac_ext >&5
5688   rm -rf conftest*
5689   eval "ac_cv_header_$ac_safe=no"
5690 fi
5691 rm -f conftest*
5692 fi
5693 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
5694   echo "$ac_t""yes" 1>&6
5695     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
5696   cat >> confdefs.h <<EOF
5697 #define $ac_tr_hdr 1
5698 EOF
5699  
5700 else
5701   echo "$ac_t""no" 1>&6
5702 fi
5703 done
5704
5705 fi
5706 if test "$ac_cv_header_termios_h" = yes ; then
5707         case "$CFLAGS" in
5708         *-D_POSIX_SOURCE*)
5709                 termios_bad=dunno ;;
5710         *)      termios_bad=maybe ;;
5711         esac
5712         if test "$termios_bad" = maybe ; then
5713         echo $ac_n "checking whether termios.h needs _POSIX_SOURCE""... $ac_c" 1>&6
5714 echo "configure:5715: checking whether termios.h needs _POSIX_SOURCE" >&5
5715         cat > conftest.$ac_ext <<EOF
5716 #line 5717 "configure"
5717 #include "confdefs.h"
5718 #include <termios.h>
5719 int main() {
5720 struct termios foo; int x = foo.c_iflag
5721 ; return 0; }
5722 EOF
5723 if { (eval echo configure:5724: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
5724   rm -rf conftest*
5725   termios_bad=no
5726 else
5727   echo "configure: failed program was:" >&5
5728   cat conftest.$ac_ext >&5
5729   rm -rf conftest*
5730   
5731                 cat > conftest.$ac_ext <<EOF
5732 #line 5733 "configure"
5733 #include "confdefs.h"
5734
5735 #define _POSIX_SOURCE
5736 #include <termios.h>
5737 int main() {
5738 struct termios foo; int x = foo.c_iflag
5739 ; return 0; }
5740 EOF
5741 if { (eval echo configure:5742: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
5742   rm -rf conftest*
5743   termios_bad=unknown
5744 else
5745   echo "configure: failed program was:" >&5
5746   cat conftest.$ac_ext >&5
5747   rm -rf conftest*
5748   termios_bad=yes cat >> confdefs.h <<\EOF
5749 #define SVR4_TERMIO 1
5750 EOF
5751
5752 fi
5753 rm -f conftest*
5754                         
5755 fi
5756 rm -f conftest*
5757         echo "$ac_t""$termios_bad" 1>&6
5758         fi
5759 fi
5760
5761
5762
5763 echo $ac_n "checking for tcgetattr""... $ac_c" 1>&6
5764 echo "configure:5765: checking for tcgetattr" >&5
5765 if eval "test \"`echo '$''{'cf_cv_have_tcgetattr'+set}'`\" = set"; then
5766   echo $ac_n "(cached) $ac_c" 1>&6
5767 else
5768   
5769 cat > conftest.$ac_ext <<EOF
5770 #line 5771 "configure"
5771 #include "confdefs.h"
5772
5773 #include <sys/types.h>
5774 #ifdef HAVE_UNISTD_H
5775 #include <unistd.h>
5776 #endif
5777 #ifdef HAVE_TERMIOS_H
5778 #include <termios.h>
5779 #define TTY struct termios
5780 #else
5781 #ifdef HAVE_TERMIO_H
5782 #include <termio.h>
5783 #define TTY struct termio
5784 #endif
5785 #endif
5786
5787 int main() {
5788
5789 TTY foo;
5790 tcgetattr(1, &foo);
5791 ; return 0; }
5792 EOF
5793 if { (eval echo configure:5794: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5794   rm -rf conftest*
5795   cf_cv_have_tcgetattr=yes
5796 else
5797   echo "configure: failed program was:" >&5
5798   cat conftest.$ac_ext >&5
5799   rm -rf conftest*
5800   cf_cv_have_tcgetattr=no
5801 fi
5802 rm -f conftest*
5803 fi
5804
5805 echo "$ac_t""$cf_cv_have_tcgetattr" 1>&6
5806 test "$cf_cv_have_tcgetattr" = yes && cat >> confdefs.h <<\EOF
5807 #define HAVE_TCGETATTR 1
5808 EOF
5809
5810
5811
5812 if test "$cross_compiling" = yes ; then
5813         echo "configure: warning: cross compiling: assume setvbuf params not reversed" 1>&2
5814 else
5815         echo $ac_n "checking whether setvbuf arguments are reversed""... $ac_c" 1>&6
5816 echo "configure:5817: checking whether setvbuf arguments are reversed" >&5
5817 if eval "test \"`echo '$''{'ac_cv_func_setvbuf_reversed'+set}'`\" = set"; then
5818   echo $ac_n "(cached) $ac_c" 1>&6
5819 else
5820   if test "$cross_compiling" = yes; then
5821     { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
5822 else
5823   cat > conftest.$ac_ext <<EOF
5824 #line 5825 "configure"
5825 #include "confdefs.h"
5826 #include <stdio.h>
5827 /* If setvbuf has the reversed format, exit 0. */
5828 main () {
5829   /* This call has the arguments reversed.
5830      A reversed system may check and see that the address of main
5831      is not _IOLBF, _IONBF, or _IOFBF, and return nonzero.  */
5832   if (setvbuf(stdout, _IOLBF, (char *) main, BUFSIZ) != 0)
5833     exit(1);
5834   putc('\r', stdout);
5835   exit(0);                      /* Non-reversed systems segv here.  */
5836 }
5837 EOF
5838 if { (eval echo configure:5839: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
5839 then
5840   ac_cv_func_setvbuf_reversed=yes
5841 else
5842   echo "configure: failed program was:" >&5
5843   cat conftest.$ac_ext >&5
5844   rm -fr conftest*
5845   ac_cv_func_setvbuf_reversed=no
5846 fi
5847 rm -fr conftest*
5848 fi
5849
5850 rm -f core core.* *.core
5851 fi
5852
5853 echo "$ac_t""$ac_cv_func_setvbuf_reversed" 1>&6
5854 if test $ac_cv_func_setvbuf_reversed = yes; then
5855   cat >> confdefs.h <<\EOF
5856 #define SETVBUF_REVERSED 1
5857 EOF
5858
5859 fi
5860
5861 fi
5862 echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6
5863 echo "configure:5864: checking return type of signal handlers" >&5
5864 if eval "test \"`echo '$''{'ac_cv_type_signal'+set}'`\" = set"; then
5865   echo $ac_n "(cached) $ac_c" 1>&6
5866 else
5867   cat > conftest.$ac_ext <<EOF
5868 #line 5869 "configure"
5869 #include "confdefs.h"
5870 #include <sys/types.h>
5871 #include <signal.h>
5872 #ifdef signal
5873 #undef signal
5874 #endif
5875 #ifdef __cplusplus
5876 extern "C" void (*signal (int, void (*)(int)))(int);
5877 #else
5878 void (*signal ()) ();
5879 #endif
5880
5881 int main() {
5882 int i;
5883 ; return 0; }
5884 EOF
5885 if { (eval echo configure:5886: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
5886   rm -rf conftest*
5887   ac_cv_type_signal=void
5888 else
5889   echo "configure: failed program was:" >&5
5890   cat conftest.$ac_ext >&5
5891   rm -rf conftest*
5892   ac_cv_type_signal=int
5893 fi
5894 rm -f conftest*
5895 fi
5896
5897 echo "$ac_t""$ac_cv_type_signal" 1>&6
5898 cat >> confdefs.h <<EOF
5899 #define RETSIGTYPE $ac_cv_type_signal
5900 EOF
5901
5902
5903
5904 echo $ac_n "checking for type sigaction_t""... $ac_c" 1>&6
5905 echo "configure:5906: checking for type sigaction_t" >&5
5906 if eval "test \"`echo '$''{'cf_cv_type_sigaction'+set}'`\" = set"; then
5907   echo $ac_n "(cached) $ac_c" 1>&6
5908 else
5909   
5910         cat > conftest.$ac_ext <<EOF
5911 #line 5912 "configure"
5912 #include "confdefs.h"
5913
5914 #include <signal.h>
5915 int main() {
5916 sigaction_t x
5917 ; return 0; }
5918 EOF
5919 if { (eval echo configure:5920: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
5920   rm -rf conftest*
5921   cf_cv_type_sigaction=yes
5922 else
5923   echo "configure: failed program was:" >&5
5924   cat conftest.$ac_ext >&5
5925   rm -rf conftest*
5926   cf_cv_type_sigaction=no
5927 fi
5928 rm -f conftest*
5929 fi
5930
5931 echo "$ac_t""$cf_cv_type_sigaction" 1>&6
5932 test "$cf_cv_type_sigaction" = yes && cat >> confdefs.h <<\EOF
5933 #define HAVE_TYPE_SIGACTION 1
5934 EOF
5935
5936
5937
5938
5939 echo $ac_n "checking declaration of size-change""... $ac_c" 1>&6
5940 echo "configure:5941: checking declaration of size-change" >&5
5941 if eval "test \"`echo '$''{'cf_cv_sizechange'+set}'`\" = set"; then
5942   echo $ac_n "(cached) $ac_c" 1>&6
5943 else
5944   
5945     cf_cv_sizechange=unknown
5946     cf_save_CFLAGS="$CFLAGS"
5947
5948 for cf_opts in "" "NEED_PTEM_H"
5949 do
5950
5951     CFLAGS="$cf_save_CFLAGS"
5952     test -n "$cf_opts" && CFLAGS="$CFLAGS -D$cf_opts"
5953     cat > conftest.$ac_ext <<EOF
5954 #line 5955 "configure"
5955 #include "confdefs.h"
5956 #include <sys/types.h>
5957 #ifdef HAVE_TERMIOS_H
5958 #include <termios.h>
5959 #else
5960 #ifdef HAVE_TERMIO_H
5961 #include <termio.h>
5962 #endif
5963 #endif
5964 #ifdef NEED_PTEM_H
5965 /* This is a workaround for SCO:  they neglected to define struct winsize in
5966  * termios.h -- it's only in termio.h and ptem.h
5967  */
5968 #include        <sys/stream.h>
5969 #include        <sys/ptem.h>
5970 #endif
5971 #if !defined(sun) || !defined(HAVE_TERMIOS_H)
5972 #include <sys/ioctl.h>
5973 #endif
5974
5975 int main() {
5976
5977 #ifdef TIOCGSIZE
5978         struct ttysize win;     /* FIXME: what system is this? */
5979         int y = win.ts_lines;
5980         int x = win.ts_cols;
5981 #else
5982 #ifdef TIOCGWINSZ
5983         struct winsize win;
5984         int y = win.ws_row;
5985         int x = win.ws_col;
5986 #else
5987         no TIOCGSIZE or TIOCGWINSZ
5988 #endif /* TIOCGWINSZ */
5989 #endif /* TIOCGSIZE */
5990         
5991 ; return 0; }
5992 EOF
5993 if { (eval echo configure:5994: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
5994   rm -rf conftest*
5995   cf_cv_sizechange=yes
5996 else
5997   echo "configure: failed program was:" >&5
5998   cat conftest.$ac_ext >&5
5999   rm -rf conftest*
6000   cf_cv_sizechange=no
6001 fi
6002 rm -f conftest*
6003
6004         CFLAGS="$cf_save_CFLAGS"
6005         if test "$cf_cv_sizechange" = yes ; then
6006                 echo "size-change succeeded ($cf_opts)" >&5
6007                 test -n "$cf_opts" && cf_cv_sizechange="$cf_opts"
6008                 break
6009         fi
6010 done
6011
6012 fi
6013
6014 echo "$ac_t""$cf_cv_sizechange" 1>&6
6015 if test "$cf_cv_sizechange" != no ; then
6016         cat >> confdefs.h <<\EOF
6017 #define HAVE_SIZECHANGE 1
6018 EOF
6019
6020         case $cf_cv_sizechange in #(vi
6021         NEED*)
6022                 cat >> confdefs.h <<EOF
6023 #define $cf_cv_sizechange  1
6024 EOF
6025
6026                 ;;
6027         esac
6028 fi
6029
6030
6031 echo $ac_n "checking for memmove""... $ac_c" 1>&6
6032 echo "configure:6033: checking for memmove" >&5
6033 if eval "test \"`echo '$''{'ac_cv_func_memmove'+set}'`\" = set"; then
6034   echo $ac_n "(cached) $ac_c" 1>&6
6035 else
6036   cat > conftest.$ac_ext <<EOF
6037 #line 6038 "configure"
6038 #include "confdefs.h"
6039 /* System header to define __stub macros and hopefully few prototypes,
6040     which can conflict with char memmove(); below.  */
6041 #include <assert.h>
6042 /* Override any gcc2 internal prototype to avoid an error.  */
6043 /* We use char because int might match the return type of a gcc2
6044     builtin and then its argument prototype would still apply.  */
6045 char memmove();
6046
6047 int main() {
6048
6049 /* The GNU C library defines this for functions which it implements
6050     to always fail with ENOSYS.  Some functions are actually named
6051     something starting with __ and the normal name is an alias.  */
6052 #if defined (__stub_memmove) || defined (__stub___memmove)
6053 choke me
6054 #else
6055 memmove();
6056 #endif
6057
6058 ; return 0; }
6059 EOF
6060 if { (eval echo configure:6061: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6061   rm -rf conftest*
6062   eval "ac_cv_func_memmove=yes"
6063 else
6064   echo "configure: failed program was:" >&5
6065   cat conftest.$ac_ext >&5
6066   rm -rf conftest*
6067   eval "ac_cv_func_memmove=no"
6068 fi
6069 rm -f conftest*
6070 fi
6071
6072 if eval "test \"`echo '$ac_cv_func_'memmove`\" = yes"; then
6073   echo "$ac_t""yes" 1>&6
6074   :
6075 else
6076   echo "$ac_t""no" 1>&6
6077
6078 echo $ac_n "checking for bcopy""... $ac_c" 1>&6
6079 echo "configure:6080: checking for bcopy" >&5
6080 if eval "test \"`echo '$''{'ac_cv_func_bcopy'+set}'`\" = set"; then
6081   echo $ac_n "(cached) $ac_c" 1>&6
6082 else
6083   cat > conftest.$ac_ext <<EOF
6084 #line 6085 "configure"
6085 #include "confdefs.h"
6086 /* System header to define __stub macros and hopefully few prototypes,
6087     which can conflict with char bcopy(); below.  */
6088 #include <assert.h>
6089 /* Override any gcc2 internal prototype to avoid an error.  */
6090 /* We use char because int might match the return type of a gcc2
6091     builtin and then its argument prototype would still apply.  */
6092 char bcopy();
6093
6094 int main() {
6095
6096 /* The GNU C library defines this for functions which it implements
6097     to always fail with ENOSYS.  Some functions are actually named
6098     something starting with __ and the normal name is an alias.  */
6099 #if defined (__stub_bcopy) || defined (__stub___bcopy)
6100 choke me
6101 #else
6102 bcopy();
6103 #endif
6104
6105 ; return 0; }
6106 EOF
6107 if { (eval echo configure:6108: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6108   rm -rf conftest*
6109   eval "ac_cv_func_bcopy=yes"
6110 else
6111   echo "configure: failed program was:" >&5
6112   cat conftest.$ac_ext >&5
6113   rm -rf conftest*
6114   eval "ac_cv_func_bcopy=no"
6115 fi
6116 rm -f conftest*
6117 fi
6118
6119 if eval "test \"`echo '$ac_cv_func_'bcopy`\" = yes"; then
6120   echo "$ac_t""yes" 1>&6
6121   
6122         echo $ac_n "checking if bcopy does overlapping moves""... $ac_c" 1>&6
6123 echo "configure:6124: checking if bcopy does overlapping moves" >&5
6124 if eval "test \"`echo '$''{'cf_cv_good_bcopy'+set}'`\" = set"; then
6125   echo $ac_n "(cached) $ac_c" 1>&6
6126 else
6127   
6128                 if test "$cross_compiling" = yes; then
6129   cf_cv_good_bcopy=unknown
6130 else
6131   cat > conftest.$ac_ext <<EOF
6132 #line 6133 "configure"
6133 #include "confdefs.h"
6134
6135 int main() {
6136         static char data[] = "abcdefghijklmnopqrstuwwxyz";
6137         char temp[40];
6138         bcopy(data, temp, sizeof(data));
6139         bcopy(temp+10, temp, 15);
6140         bcopy(temp+5, temp+15, 10);
6141         exit (strcmp(temp, "klmnopqrstuwwxypqrstuwwxyz"));
6142 }
6143                 
6144 EOF
6145 if { (eval echo configure:6146: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
6146 then
6147   cf_cv_good_bcopy=yes
6148 else
6149   echo "configure: failed program was:" >&5
6150   cat conftest.$ac_ext >&5
6151   rm -fr conftest*
6152   cf_cv_good_bcopy=no
6153 fi
6154 rm -fr conftest*
6155 fi
6156
6157                 
6158 fi
6159
6160 echo "$ac_t""$cf_cv_good_bcopy" 1>&6
6161         
6162 else
6163   echo "$ac_t""no" 1>&6
6164 cf_cv_good_bcopy=no
6165 fi
6166
6167         if test "$cf_cv_good_bcopy" = yes ; then
6168                 cat >> confdefs.h <<\EOF
6169 #define USE_OK_BCOPY 1
6170 EOF
6171
6172         else
6173                 cat >> confdefs.h <<\EOF
6174 #define USE_MY_MEMMOVE 1
6175 EOF
6176
6177         fi
6178
6179 fi
6180
6181
6182 echo $ac_n "checking if poll really works""... $ac_c" 1>&6
6183 echo "configure:6184: checking if poll really works" >&5
6184 if eval "test \"`echo '$''{'cf_cv_working_poll'+set}'`\" = set"; then
6185   echo $ac_n "(cached) $ac_c" 1>&6
6186 else
6187   
6188 if test "$cross_compiling" = yes; then
6189   cf_cv_working_poll=unknown
6190 else
6191   cat > conftest.$ac_ext <<EOF
6192 #line 6193 "configure"
6193 #include "confdefs.h"
6194
6195 #include <stdio.h>
6196 #ifdef HAVE_POLL_H
6197 #include <poll.h>
6198 #else
6199 #include <sys/poll.h>
6200 #endif
6201 int main() {
6202         struct pollfd myfds;
6203         int ret;
6204
6205         myfds.fd = 0;
6206         myfds.events = POLLIN;
6207
6208         ret = poll(&myfds, 1, 100);
6209         exit(ret != 0);
6210 }
6211 EOF
6212 if { (eval echo configure:6213: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
6213 then
6214   cf_cv_working_poll=yes
6215 else
6216   echo "configure: failed program was:" >&5
6217   cat conftest.$ac_ext >&5
6218   rm -fr conftest*
6219   cf_cv_working_poll=no
6220 fi
6221 rm -fr conftest*
6222 fi
6223
6224 fi
6225
6226 echo "$ac_t""$cf_cv_working_poll" 1>&6
6227 test "$cf_cv_working_poll" = "yes" && cat >> confdefs.h <<\EOF
6228 #define HAVE_WORKING_POLL 1
6229 EOF
6230
6231
6232
6233 if test -z "$cf_user_CFLAGS" ; then
6234         CFLAGS=`echo ${CFLAGS} | sed -e 's/-g //' -e 's/-g$//'`
6235         CXXFLAGS=`echo ${CXXFLAGS} | sed -e 's/-g //' -e 's/-g$//'`
6236 fi
6237
6238
6239 echo $ac_n "checking for builtin bool type""... $ac_c" 1>&6
6240 echo "configure:6241: checking for builtin bool type" >&5
6241 if eval "test \"`echo '$''{'cf_cv_cc_bool_type'+set}'`\" = set"; then
6242   echo $ac_n "(cached) $ac_c" 1>&6
6243 else
6244   
6245         cat > conftest.$ac_ext <<EOF
6246 #line 6247 "configure"
6247 #include "confdefs.h"
6248
6249 #include <stdio.h>
6250 #include <sys/types.h>
6251
6252 int main() {
6253 bool x = false
6254 ; return 0; }
6255 EOF
6256 if { (eval echo configure:6257: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
6257   rm -rf conftest*
6258   cf_cv_cc_bool_type=1
6259 else
6260   echo "configure: failed program was:" >&5
6261   cat conftest.$ac_ext >&5
6262   rm -rf conftest*
6263   cf_cv_cc_bool_type=0
6264 fi
6265 rm -f conftest*
6266         
6267 fi
6268
6269 if test "$cf_cv_cc_bool_type" = 1
6270 then    echo "$ac_t""yes" 1>&6
6271 else    echo "$ac_t""no" 1>&6
6272 fi
6273
6274 if test -n "$CXX" ; then
6275         ac_ext=C
6276 # CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
6277 ac_cpp='$CXXCPP $CPPFLAGS'
6278 ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
6279 ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
6280 cross_compiling=$ac_cv_prog_cxx_cross
6281
6282         
6283 if test -n "$GXX" ; then
6284 case $cf_cv_system_name in #(vi
6285 os2*) #(vi
6286         cf_stdcpp_libname=stdcpp
6287         ;;
6288 *)
6289         cf_stdcpp_libname=stdc++
6290         ;;
6291 esac
6292 echo $ac_n "checking for library $cf_stdcpp_libname""... $ac_c" 1>&6
6293 echo "configure:6294: checking for library $cf_stdcpp_libname" >&5
6294 if eval "test \"`echo '$''{'cf_cv_libstdcpp'+set}'`\" = set"; then
6295   echo $ac_n "(cached) $ac_c" 1>&6
6296 else
6297   
6298         cf_save="$LIBS"
6299         LIBS="$LIBS -l$cf_stdcpp_libname"
6300 cat > conftest.$ac_ext <<EOF
6301 #line 6302 "configure"
6302 #include "confdefs.h"
6303
6304 #include <strstream.h>
6305 int main() {
6306
6307 char buf[80];
6308 strstreambuf foo(buf, sizeof(buf))
6309
6310 ; return 0; }
6311 EOF
6312 if { (eval echo configure:6313: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6313   rm -rf conftest*
6314   cf_cv_libstdcpp=yes
6315 else
6316   echo "configure: failed program was:" >&5
6317   cat conftest.$ac_ext >&5
6318   rm -rf conftest*
6319   cf_cv_libstdcpp=no
6320 fi
6321 rm -f conftest*
6322         LIBS="$cf_save"
6323
6324 fi
6325
6326 echo "$ac_t""$cf_cv_libstdcpp" 1>&6
6327 test "$cf_cv_libstdcpp" = yes && CXXLIBS="$CXXLIBS -l$cf_stdcpp_libname"
6328 fi
6329
6330         if test "$GXX" = yes; then
6331                 case "`${CXX-g++} --version`" in
6332                 1*|2.0-6*)
6333                         cf_cxx_library=yes
6334                         ;;
6335                 2.7*)
6336                         
6337 cf_cxx_library=unknown
6338 case $cf_cv_system_name in #(vi
6339 os2*) #(vi
6340         cf_gpp_libname=gpp
6341         ;;
6342 *)
6343         cf_gpp_libname=g++
6344         ;;
6345 esac
6346 if test "$ac_cv_prog_gxx" = yes; then
6347         echo $ac_n "checking for lib$cf_gpp_libname""... $ac_c" 1>&6
6348 echo "configure:6349: checking for lib$cf_gpp_libname" >&5
6349         cf_save="$LIBS"
6350         LIBS="$LIBS -l$cf_gpp_libname"
6351         cat > conftest.$ac_ext <<EOF
6352 #line 6353 "configure"
6353 #include "confdefs.h"
6354
6355 #include <$cf_gpp_libname/builtin.h>
6356         
6357 int main() {
6358 two_arg_error_handler_t foo2 = lib_error_handler
6359 ; return 0; }
6360 EOF
6361 if { (eval echo configure:6362: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6362   rm -rf conftest*
6363   cf_cxx_library=yes
6364          CXXLIBS="$CXXLIBS -l$cf_gpp_libname"
6365          if test "$cf_gpp_libname" = cpp ; then
6366             cat >> confdefs.h <<\EOF
6367 #define HAVE_GPP_BUILTIN_H 1
6368 EOF
6369
6370          else
6371             cat >> confdefs.h <<\EOF
6372 #define HAVE_GXX_BUILTIN_H 1
6373 EOF
6374
6375          fi
6376 else
6377   echo "configure: failed program was:" >&5
6378   cat conftest.$ac_ext >&5
6379   rm -rf conftest*
6380   cat > conftest.$ac_ext <<EOF
6381 #line 6382 "configure"
6382 #include "confdefs.h"
6383
6384 #include <builtin.h>
6385         
6386 int main() {
6387 two_arg_error_handler_t foo2 = lib_error_handler
6388 ; return 0; }
6389 EOF
6390 if { (eval echo configure:6391: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6391   rm -rf conftest*
6392   cf_cxx_library=yes
6393          CXXLIBS="$CXXLIBS -l$cf_gpp_libname"
6394          cat >> confdefs.h <<\EOF
6395 #define HAVE_BUILTIN_H 1
6396 EOF
6397
6398 else
6399   echo "configure: failed program was:" >&5
6400   cat conftest.$ac_ext >&5
6401   rm -rf conftest*
6402   cf_cxx_library=no
6403 fi
6404 rm -f conftest*
6405 fi
6406 rm -f conftest*
6407         LIBS="$cf_save"
6408         echo "$ac_t""$cf_cxx_library" 1>&6
6409 fi
6410
6411                         ;;
6412                 *)
6413                         cf_cxx_library=no
6414                         ;;
6415                 esac
6416         else
6417                 cf_cxx_library=no
6418         fi
6419         echo $ac_n "checking how to run the C++ preprocessor""... $ac_c" 1>&6
6420 echo "configure:6421: checking how to run the C++ preprocessor" >&5
6421 if test -z "$CXXCPP"; then
6422 if eval "test \"`echo '$''{'ac_cv_prog_CXXCPP'+set}'`\" = set"; then
6423   echo $ac_n "(cached) $ac_c" 1>&6
6424 else
6425   ac_ext=C
6426 # CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
6427 ac_cpp='$CXXCPP $CPPFLAGS'
6428 ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
6429 ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
6430 cross_compiling=$ac_cv_prog_cxx_cross
6431   CXXCPP="${CXX-g++} -E"
6432   cat > conftest.$ac_ext <<EOF
6433 #line 6434 "configure"
6434 #include "confdefs.h"
6435 #include <stdlib.h>
6436 EOF
6437 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6438 { (eval echo configure:6439: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6439 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
6440 if test -z "$ac_err"; then
6441   :
6442 else
6443   echo "$ac_err" >&5
6444   echo "configure: failed program was:" >&5
6445   cat conftest.$ac_ext >&5
6446   rm -rf conftest*
6447   CXXCPP=/lib/cpp
6448 fi
6449 rm -f conftest*
6450   ac_cv_prog_CXXCPP="$CXXCPP"
6451 ac_ext=C
6452 # CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
6453 ac_cpp='$CXXCPP $CPPFLAGS'
6454 ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
6455 ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
6456 cross_compiling=$ac_cv_prog_cxx_cross
6457 fi
6458 fi
6459 CXXCPP="$ac_cv_prog_CXXCPP"
6460 echo "$ac_t""$CXXCPP" 1>&6
6461
6462 for ac_hdr in typeinfo
6463 do
6464 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
6465 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
6466 echo "configure:6467: checking for $ac_hdr" >&5
6467 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
6468   echo $ac_n "(cached) $ac_c" 1>&6
6469 else
6470   cat > conftest.$ac_ext <<EOF
6471 #line 6472 "configure"
6472 #include "confdefs.h"
6473 #include <$ac_hdr>
6474 EOF
6475 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6476 { (eval echo configure:6477: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6477 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
6478 if test -z "$ac_err"; then
6479   rm -rf conftest*
6480   eval "ac_cv_header_$ac_safe=yes"
6481 else
6482   echo "$ac_err" >&5
6483   echo "configure: failed program was:" >&5
6484   cat conftest.$ac_ext >&5
6485   rm -rf conftest*
6486   eval "ac_cv_header_$ac_safe=no"
6487 fi
6488 rm -f conftest*
6489 fi
6490 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6491   echo "$ac_t""yes" 1>&6
6492     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
6493   cat >> confdefs.h <<EOF
6494 #define $ac_tr_hdr 1
6495 EOF
6496  
6497 else
6498   echo "$ac_t""no" 1>&6
6499 fi
6500 done
6501
6502         
6503 echo $ac_n "checking for builtin bool type""... $ac_c" 1>&6
6504 echo "configure:6505: checking for builtin bool type" >&5
6505 if eval "test \"`echo '$''{'cf_cv_builtin_bool'+set}'`\" = set"; then
6506   echo $ac_n "(cached) $ac_c" 1>&6
6507 else
6508   
6509         cat > conftest.$ac_ext <<EOF
6510 #line 6511 "configure"
6511 #include "confdefs.h"
6512
6513 #include <stdio.h>
6514 #include <sys/types.h>
6515
6516 int main() {
6517 bool x = false
6518 ; return 0; }
6519 EOF
6520 if { (eval echo configure:6521: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
6521   rm -rf conftest*
6522   cf_cv_builtin_bool=1
6523 else
6524   echo "configure: failed program was:" >&5
6525   cat conftest.$ac_ext >&5
6526   rm -rf conftest*
6527   cf_cv_builtin_bool=0
6528 fi
6529 rm -f conftest*
6530         
6531 fi
6532
6533 if test "$cf_cv_builtin_bool" = 1
6534 then    echo "$ac_t""yes" 1>&6
6535 else    echo "$ac_t""no" 1>&6
6536 fi
6537
6538         
6539 echo $ac_n "checking for size of bool""... $ac_c" 1>&6
6540 echo "configure:6541: checking for size of bool" >&5
6541 if eval "test \"`echo '$''{'cf_cv_type_of_bool'+set}'`\" = set"; then
6542   echo $ac_n "(cached) $ac_c" 1>&6
6543 else
6544   
6545         rm -f cf_test.out
6546         if test "$cross_compiling" = yes; then
6547   cf_cv_type_of_bool=unknown
6548 else
6549   cat > conftest.$ac_ext <<EOF
6550 #line 6551 "configure"
6551 #include "confdefs.h"
6552 #ifdef __cplusplus
6553 extern "C" void exit(int);
6554 #endif
6555
6556 #include <stdlib.h>
6557 #include <stdio.h>
6558 #ifdef HAVE_GXX_BUILTIN_H
6559 #include <g++/builtin.h>
6560 #elif HAVE_GPP_BUILTIN_H
6561 #include <gpp/builtin.h>
6562 #elif HAVE_BUILTIN_H
6563 #include <builtin.h>
6564 #endif
6565 main()
6566 {
6567         FILE *fp = fopen("cf_test.out", "w");
6568         if (fp != 0) {
6569                 bool x = true;
6570                 if ((bool)(-x) >= 0)
6571                         fputs("unsigned ", fp);
6572                 if (sizeof(x) == sizeof(int))       fputs("int",  fp);
6573                 else if (sizeof(x) == sizeof(char)) fputs("char", fp);
6574                 else if (sizeof(x) == sizeof(short))fputs("short",fp);
6575                 else if (sizeof(x) == sizeof(long)) fputs("long", fp);
6576                 fclose(fp);
6577         }
6578         exit(0);
6579 }
6580                 
6581 EOF
6582 if { (eval echo configure:6583: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
6583 then
6584   cf_cv_type_of_bool=`cat cf_test.out`
6585 else
6586   echo "configure: failed program was:" >&5
6587   cat conftest.$ac_ext >&5
6588   rm -fr conftest*
6589   cf_cv_type_of_bool=unknown
6590 fi
6591 rm -fr conftest*
6592 fi
6593
6594         
6595 fi
6596
6597         rm -f cf_test.out
6598 echo "$ac_t""$cf_cv_type_of_bool" 1>&6
6599 if test "$cf_cv_type_of_bool" = unknown ; then
6600         echo "configure: warning: Assuming unsigned for type of bool" 1>&2
6601         cf_cv_type_of_bool=unsigned
6602 fi
6603
6604         
6605 echo $ac_n "checking for special defines needed for etip.h""... $ac_c" 1>&6
6606 echo "configure:6607: checking for special defines needed for etip.h" >&5
6607 cf_save_CXXFLAGS="$CXXFLAGS"
6608 cf_result="none"
6609 for cf_math in "" MATH_H
6610 do
6611 for cf_excp in "" MATH_EXCEPTION
6612 do
6613         CXXFLAGS="$cf_save_CXXFLAGS -I${srcdir}/c++ -I${srcdir}/menu"
6614         test -n "$cf_math" && CXXFLAGS="$CXXFLAGS -DETIP_NEEDS_${cf_math}"
6615         test -n "$cf_excp" && CXXFLAGS="$CXXFLAGS -DETIP_NEEDS_${cf_excp}"
6616 cat > conftest.$ac_ext <<EOF
6617 #line 6618 "configure"
6618 #include "confdefs.h"
6619
6620 #include <etip.h.in>
6621
6622 int main() {
6623
6624 ; return 0; }
6625 EOF
6626 if { (eval echo configure:6627: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
6627   rm -rf conftest*
6628   
6629         test -n "$cf_math" && cat >> confdefs.h <<EOF
6630 #define ETIP_NEEDS_${cf_math} 1
6631 EOF
6632
6633         test -n "$cf_excp" && cat >> confdefs.h <<EOF
6634 #define ETIP_NEEDS_${cf_excp} 1
6635 EOF
6636
6637         cf_result="$cf_math $cf_excp"
6638         break
6639
6640 else
6641   echo "configure: failed program was:" >&5
6642   cat conftest.$ac_ext >&5
6643 fi
6644 rm -f conftest*
6645 done
6646 done
6647 echo "$ac_t""$cf_result" 1>&6
6648 CXXFLAGS="$cf_save_CXXFLAGS"
6649
6650         
6651 if test "$CXX" = yes ; then
6652 echo $ac_n "checking if $CXX accepts parameter initialization""... $ac_c" 1>&6
6653 echo "configure:6654: checking if $CXX accepts parameter initialization" >&5
6654 if eval "test \"`echo '$''{'cf_cv_cpp_param_init'+set}'`\" = set"; then
6655   echo $ac_n "(cached) $ac_c" 1>&6
6656 else
6657   
6658         ac_ext=C
6659 # CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
6660 ac_cpp='$CXXCPP $CPPFLAGS'
6661 ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
6662 ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
6663 cross_compiling=$ac_cv_prog_cxx_cross
6664
6665         if test "$cross_compiling" = yes; then
6666   cf_cv_cpp_param_init=unknown
6667 else
6668   cat > conftest.$ac_ext <<EOF
6669 #line 6670 "configure"
6670 #include "confdefs.h"
6671 #ifdef __cplusplus
6672 extern "C" void exit(int);
6673 #endif
6674
6675 class TEST {
6676 private:
6677         int value;
6678 public:
6679         TEST(int x = 1);
6680         ~TEST();
6681 };
6682
6683 TEST::TEST(int x = 1)   // some compilers do not like second initializer
6684 {
6685         value = x;
6686 }
6687 void main() { }
6688
6689 EOF
6690 if { (eval echo configure:6691: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
6691 then
6692   cf_cv_cpp_param_init=yes
6693 else
6694   echo "configure: failed program was:" >&5
6695   cat conftest.$ac_ext >&5
6696   rm -fr conftest*
6697   cf_cv_cpp_param_init=no
6698 fi
6699 rm -fr conftest*
6700 fi
6701
6702
6703 fi
6704
6705 echo "$ac_t""$cf_cv_cpp_param_init" 1>&6
6706 fi
6707 test "$cf_cv_cpp_param_init" = yes && cat >> confdefs.h <<\EOF
6708 #define CPP_HAS_PARAM_INIT 1
6709 EOF
6710
6711
6712         case $cf_cv_system_name in #(vi
6713         sco3.2v5*)
6714             CXXLDFLAGS="-u main"
6715             ;;
6716         esac
6717         
6718 else
6719         cf_cxx_library=no
6720         cf_cv_builtin_bool=1
6721
6722         # Just because we are not configuring against C++ right now does not
6723         # mean that a user will not want to use C++.  Some distributors disable
6724         # the C++ portion of this configuration as a shortcut (or just to avoid
6725         # compiling the demo in the c++ directory).  So we need a reasonable
6726         # default for the 'bool' type.
6727         #
6728         # Caveat: since the storage of the bool type is not standardized, it
6729         # may change.
6730
6731         echo $ac_n "checking for fallback type of bool""... $ac_c" 1>&6
6732 echo "configure:6733: checking for fallback type of bool" >&5
6733         case "$host_cpu" in #(vi
6734         i?86)   cf_cv_type_of_bool=char ;; #(vi
6735         *)      cf_cv_type_of_bool=int  ;;
6736         esac
6737         echo "$ac_t""$cf_cv_type_of_bool" 1>&6
6738 fi
6739
6740
6741
6742
6743 if test "$cf_with_ada" != "no" ; then
6744 cf_ada_make=gnatmake
6745 # Extract the first word of "$cf_ada_make", so it can be a program name with args.
6746 set dummy $cf_ada_make; ac_word=$2
6747 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
6748 echo "configure:6749: checking for $ac_word" >&5
6749 if eval "test \"`echo '$''{'ac_cv_prog_gnat_exists'+set}'`\" = set"; then
6750   echo $ac_n "(cached) $ac_c" 1>&6
6751 else
6752   if test -n "$gnat_exists"; then
6753   ac_cv_prog_gnat_exists="$gnat_exists" # Let the user override the test.
6754 else
6755   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
6756   ac_dummy="$PATH"
6757   for ac_dir in $ac_dummy; do
6758     test -z "$ac_dir" && ac_dir=.
6759     if test -f $ac_dir/$ac_word; then
6760       ac_cv_prog_gnat_exists="yes"
6761       break
6762     fi
6763   done
6764   IFS="$ac_save_ifs"
6765   test -z "$ac_cv_prog_gnat_exists" && ac_cv_prog_gnat_exists="no"
6766 fi
6767 fi
6768 gnat_exists="$ac_cv_prog_gnat_exists"
6769 if test -n "$gnat_exists"; then
6770   echo "$ac_t""$gnat_exists" 1>&6
6771 else
6772   echo "$ac_t""no" 1>&6
6773 fi
6774
6775 if test "$ac_cv_prog_gnat_exists" = no; then
6776    cf_ada_make=
6777 else
6778    
6779 cf_cv_gnat_version=`$cf_ada_make -v 2>&1 | grep '[0-9].[0-9][0-9]*' |\
6780   sed -e 's/[^0-9 \.]//g' | $AWK '{print $1;}'`
6781 case $cf_cv_gnat_version in
6782   3.1[1-9]*|3.[2-9]*|[4-9].*)
6783     cf_cv_prog_gnat_correct=yes
6784     ;;
6785   *) echo Unsupported GNAT version $cf_cv_gnat_version. Required is 3.11 or better. Disabling Ada95 binding.
6786      cf_cv_prog_gnat_correct=no
6787      ;;
6788 esac
6789 case $cf_cv_gnat_version in
6790   3.1*|[4-9].*)
6791       cf_compile_generics=generics
6792       cf_generic_objects="\$(GENOBJS)"
6793       ;;
6794   *)  cf_compile_generics=
6795       cf_generic_objects=
6796       ;;
6797 esac
6798
6799    # Extract the first word of "m4", so it can be a program name with args.
6800 set dummy m4; ac_word=$2
6801 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
6802 echo "configure:6803: checking for $ac_word" >&5
6803 if eval "test \"`echo '$''{'ac_cv_prog_M4_exists'+set}'`\" = set"; then
6804   echo $ac_n "(cached) $ac_c" 1>&6
6805 else
6806   if test -n "$M4_exists"; then
6807   ac_cv_prog_M4_exists="$M4_exists" # Let the user override the test.
6808 else
6809   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
6810   ac_dummy="$PATH"
6811   for ac_dir in $ac_dummy; do
6812     test -z "$ac_dir" && ac_dir=.
6813     if test -f $ac_dir/$ac_word; then
6814       ac_cv_prog_M4_exists="yes"
6815       break
6816     fi
6817   done
6818   IFS="$ac_save_ifs"
6819   test -z "$ac_cv_prog_M4_exists" && ac_cv_prog_M4_exists="no"
6820 fi
6821 fi
6822 M4_exists="$ac_cv_prog_M4_exists"
6823 if test -n "$M4_exists"; then
6824   echo "$ac_t""$M4_exists" 1>&6
6825 else
6826   echo "$ac_t""no" 1>&6
6827 fi
6828
6829    if test "$ac_cv_prog_M4_exists" = no; then
6830       cf_cv_prog_gnat_correct=no
6831       echo Ada95 binding required program m4 not found. Ada95 binding disabled.
6832    fi
6833    if test "$cf_cv_prog_gnat_correct" = yes; then
6834       echo $ac_n "checking if GNAT works""... $ac_c" 1>&6
6835 echo "configure:6836: checking if GNAT works" >&5
6836       
6837 rm -f conftest*
6838 cat >>conftest.ads <<CF_EOF
6839 procedure conftest;
6840 CF_EOF
6841 cat >>conftest.adb <<CF_EOF
6842 with Text_IO;
6843 with GNAT.OS_Lib;
6844 procedure conftest is
6845 begin
6846    Text_IO.Put ("Hello World");
6847    Text_IO.New_Line;
6848    GNAT.OS_Lib.OS_Exit (0);
6849 end conftest;
6850 CF_EOF
6851 if ( $cf_ada_make conftest 1>&5 2>&1 ) ; then
6852    if ( ./conftest 1>&5 2>&1 ) ; then
6853       cf_cv_prog_gnat_correct=yes
6854    else
6855       cf_cv_prog_gnat_correct=no
6856    fi
6857 else
6858    cf_cv_prog_gnat_correct=no
6859 fi
6860 rm -f conftest*
6861
6862       echo "$ac_t""$cf_cv_prog_gnat_correct" 1>&6
6863    fi
6864 fi
6865 if test "$cf_cv_prog_gnat_correct" = yes; then
6866    ADAFLAGS="-O3 -gnatpn $ADAFLAGS"
6867
6868    
6869 # Check whether --with-ada-compiler or --without-ada-compiler was given.
6870 if test "${with_ada_compiler+set}" = set; then
6871   withval="$with_ada_compiler"
6872   cf_ada_compiler=$withval
6873 else
6874   cf_ada_compiler=gnatmake
6875 fi
6876
6877
6878    cf_ada_package=terminal_interface
6879
6880    
6881    
6882    
6883    
6884    
6885    
6886
6887    
6888 # Check whether --with-ada-include or --without-ada-include was given.
6889 if test "${with_ada_include+set}" = set; then
6890   withval="$with_ada_include"
6891   :
6892 else
6893   withval="${ADA_INCLUDE-$prefix/lib/ada/adainclude}"
6894 fi
6895
6896 case ".$withval" in #(vi
6897 ./*) #(vi
6898   ;;
6899 .a-zA-Z:\\/*) #(vi OS/2 EMX
6900   ;;
6901 .\${*prefix}*) #(vi
6902   eval withval="$withval"
6903   case ".$withval" in #(vi
6904   .NONE/*)
6905     withval=`echo $withval | sed -e s@NONE@$ac_default_prefix@`
6906     ;;
6907   esac
6908   ;; #(vi
6909 .NONE/*)
6910   withval=`echo $withval | sed -e s@NONE@$ac_default_prefix@`
6911   ;;
6912 *)
6913   { echo "configure: error: expected a pathname" 1>&2; exit 1; }
6914   ;;
6915 esac
6916
6917 eval ADA_INCLUDE="$withval"
6918
6919    
6920
6921    
6922 # Check whether --with-ada-objects or --without-ada-objects was given.
6923 if test "${with_ada_objects+set}" = set; then
6924   withval="$with_ada_objects"
6925   :
6926 else
6927   withval="${ADA_OBJECTS-$prefix/lib/ada/adalib}"
6928 fi
6929
6930 case ".$withval" in #(vi
6931 ./*) #(vi
6932   ;;
6933 .a-zA-Z:\\/*) #(vi OS/2 EMX
6934   ;;
6935 .\${*prefix}*) #(vi
6936   eval withval="$withval"
6937   case ".$withval" in #(vi
6938   .NONE/*)
6939     withval=`echo $withval | sed -e s@NONE@$ac_default_prefix@`
6940     ;;
6941   esac
6942   ;; #(vi
6943 .NONE/*)
6944   withval=`echo $withval | sed -e s@NONE@$ac_default_prefix@`
6945   ;;
6946 *)
6947   { echo "configure: error: expected a pathname" 1>&2; exit 1; }
6948   ;;
6949 esac
6950
6951 eval ADA_OBJECTS="$withval"
6952
6953    
6954
6955 fi
6956 fi
6957
6958 ### It's not possible to appease gcc 2.6.3's conversion-warnings if we're
6959 ### using a 'char' for bools.  gcc 2.7.0's conversion-warnings are broken too
6960 ### badly to consider using for development purposes, but 2.5.8 is okay.
6961 if test -n "$with_warnings"; then
6962         if test "$GCC" = yes; then
6963                 case "`$CC --version`" in
6964                 2.6.3)
6965                         if test "$cf_cv_type_of_bool" != "char"; then
6966                                 EXTRA_CFLAGS="$EXTRA_CFLAGS -Wconversion"
6967                         fi
6968                         ;;
6969                 2.5*)
6970                         EXTRA_CFLAGS="$EXTRA_CFLAGS -Wconversion"
6971                         ;;
6972                 esac
6973         fi
6974 fi
6975
6976 ### Construct the library-subsets, if any, from this set of keywords:
6977 ### none, base, ext_funcs, termlib.
6978 echo $ac_n "checking for library subsets""... $ac_c" 1>&6
6979 echo "configure:6980: checking for library subsets" >&5
6980 if test "$with_termlib" = yes ; then
6981         LIB_SUBSETS="termlib "
6982 else
6983         LIB_SUBSETS="termlib+"
6984 fi
6985 LIB_SUBSETS="${LIB_SUBSETS}base"
6986 test "$with_ext_funcs" = yes && LIB_SUBSETS="${LIB_SUBSETS}+ext_funcs"
6987 echo "$ac_t""$LIB_SUBSETS" 1>&6
6988
6989 LIB_TRACING=DEBUG
6990 case "$CFLAGS" in
6991 *-DTRACE*)
6992         LIB_TRACING=all
6993         ;;
6994 esac
6995
6996 ### Construct the list of include-directories to be generated
6997
6998 CPPFLAGS="$CPPFLAGS -I. -I../include"
6999 if test "$srcdir" != "."; then
7000         CPPFLAGS="$CPPFLAGS -I\$(srcdir)/../include"
7001 fi
7002 if test "$GCC" != yes; then
7003         CPPFLAGS="$CPPFLAGS -I\$(includedir)"
7004 elif test "$includedir" != "/usr/include"; then
7005         if test "$includedir" = '${prefix}/include' ; then
7006                 if test $prefix != /usr ; then
7007                         CPPFLAGS="$CPPFLAGS -I\$(includedir)"
7008                 fi
7009         else
7010                 CPPFLAGS="$CPPFLAGS -I\$(includedir)"
7011         fi
7012 fi
7013
7014
7015
7016 ACPPFLAGS="$ACPPFLAGS -I. -I../../include"
7017 if test "$srcdir" != "."; then
7018         ACPPFLAGS="$ACPPFLAGS -I\$(srcdir)/../../include"
7019 fi
7020 if test "$GCC" != yes; then
7021         ACPPFLAGS="$ACPPFLAGS -I\$(includedir)"
7022 elif test "$includedir" != "/usr/include"; then
7023         if test "$includedir" = '${prefix}/include' ; then
7024                 if test $prefix != /usr ; then
7025                         ACPPFLAGS="$ACPPFLAGS -I\$(includedir)"
7026                 fi
7027         else
7028                 ACPPFLAGS="$ACPPFLAGS -I\$(includedir)"
7029         fi
7030 fi
7031
7032
7033
7034 ### Build up pieces for makefile rules
7035 echo $ac_n "checking default library suffix""... $ac_c" 1>&6
7036 echo "configure:7037: checking default library suffix" >&5
7037
7038         case $DFT_LWR_MODEL in
7039         libtool) DFT_ARG_SUFFIX=''   ;;
7040         normal)  DFT_ARG_SUFFIX=''   ;;
7041         debug)   DFT_ARG_SUFFIX='_g' ;;
7042         profile) DFT_ARG_SUFFIX='_p' ;;
7043         shared)  DFT_ARG_SUFFIX=''   ;;
7044         esac
7045         test -n "$LIB_SUFFIX" && DFT_ARG_SUFFIX="${LIB_SUFFIX}${DFT_ARG_SUFFIX}"
7046 echo "$ac_t""$DFT_ARG_SUFFIX" 1>&6
7047
7048 echo $ac_n "checking default library-dependency suffix""... $ac_c" 1>&6
7049 echo "configure:7050: checking default library-dependency suffix" >&5
7050
7051         
7052         case $DFT_LWR_MODEL in
7053         libtool) DFT_DEP_SUFFIX='.la'  ;;
7054         normal)  DFT_DEP_SUFFIX='.a'   ;;
7055         debug)   DFT_DEP_SUFFIX='_g.a' ;;
7056         profile) DFT_DEP_SUFFIX='_p.a' ;;
7057         shared)
7058                 case $cf_cv_system_name in
7059                 hpux*)  DFT_DEP_SUFFIX='.sl'  ;;
7060                 *)      DFT_DEP_SUFFIX='.so'  ;;
7061                 esac
7062         esac
7063         test -n "$LIB_SUFFIX" && DFT_DEP_SUFFIX="${LIB_SUFFIX}${DFT_DEP_SUFFIX}"
7064 echo "$ac_t""$DFT_DEP_SUFFIX" 1>&6
7065
7066 echo $ac_n "checking default object directory""... $ac_c" 1>&6
7067 echo "configure:7068: checking default object directory" >&5
7068
7069         case $DFT_LWR_MODEL in
7070         libtool) DFT_OBJ_SUBDIR='obj_lo'  ;;
7071         normal)  DFT_OBJ_SUBDIR='objects' ;;
7072         debug)   DFT_OBJ_SUBDIR='obj_g' ;;
7073         profile) DFT_OBJ_SUBDIR='obj_p' ;;
7074         shared)  DFT_OBJ_SUBDIR='obj_s' ;;
7075         esac
7076 echo "$ac_t""$DFT_OBJ_SUBDIR" 1>&6
7077
7078 # libtool thinks it can make c++ shared libraries (perhaps only g++)
7079 echo $ac_n "checking c++ library-dependency suffux""... $ac_c" 1>&6
7080 echo "configure:7081: checking c++ library-dependency suffux" >&5
7081 if test "$with_libtool" = "yes"; then
7082         CXX_LIB_SUFFIX=$DFT_DEP_SUFFIX
7083 else
7084         
7085         
7086         case normal in
7087         libtool) CXX_LIB_SUFFIX='.la'  ;;
7088         normal)  CXX_LIB_SUFFIX='.a'   ;;
7089         debug)   CXX_LIB_SUFFIX='_g.a' ;;
7090         profile) CXX_LIB_SUFFIX='_p.a' ;;
7091         shared)
7092                 case $cf_cv_system_name in
7093                 hpux*)  CXX_LIB_SUFFIX='.sl'  ;;
7094                 *)      CXX_LIB_SUFFIX='.so'  ;;
7095                 esac
7096         esac
7097         test -n "$LIB_SUFFIX" && CXX_LIB_SUFFIX="${LIB_SUFFIX}${CXX_LIB_SUFFIX}"
7098 fi
7099 echo "$ac_t""$CXX_LIB_SUFFIX" 1>&6
7100
7101
7102 TINFO_LIST="$SHLIB_LIST"
7103 test "$with_termlib" = yes && SHLIB_LIST="$SHLIB_LIST -ltinfo${LIB_SUFFIX}"
7104
7105 echo $ac_n "checking where we will install curses.h""... $ac_c" 1>&6
7106 echo "configure:7107: checking where we will install curses.h" >&5
7107 test "$with_overwrite" = no && \
7108 test "x$includedir" = 'x${prefix}/include' && \
7109         includedir='$(prefix)/include/ncurses'${LIB_SUFFIX}
7110 echo "$ac_t""$includedir" 1>&6
7111
7112
7113
7114
7115
7116 ### Set up low-level terminfo dependencies for makefiles.  Note that we
7117 ### could override this.
7118 if test "$with_termlib" = yes ; then
7119         TEST_DEPS="${LIB_DIR}/${LIB_PREFIX}${TINFO_NAME}${DFT_DEP_SUFFIX}"
7120         if test "$DFT_LWR_MODEL" = "libtool"; then
7121                 TEST_ARGS="${TEST_DEPS}"
7122         else
7123                 TEST_ARGS="-l${TINFO_NAME}${DFT_ARG_SUFFIX}"
7124         fi
7125 fi
7126 PROG_DEPS="$TEST_DEPS"
7127 PROG_ARGS="$TEST_ARGS"
7128
7129 ### Construct the list of subdirectories for which we'll customize makefiles
7130 ### with the appropriate compile-rules.
7131
7132
7133 echo $ac_n "checking for src modules""... $ac_c" 1>&6
7134 echo "configure:7135: checking for src modules" >&5
7135
7136 # dependencies and linker-arguments for test-programs
7137 TEST_DEPS="${LIB_DIR}/${LIB_PREFIX}${LIB_NAME}${DFT_DEP_SUFFIX} $TEST_DEPS"
7138 if test "$DFT_LWR_MODEL" = "libtool"; then
7139         TEST_ARGS="${TEST_DEPS}"
7140 else
7141         TEST_ARGS="-l${LIB_NAME}${DFT_ARG_SUFFIX} $TEST_ARGS"
7142 fi
7143
7144 # dependencies and linker-arguments for utility-programs
7145 PROG_ARGS="$TEST_ARGS"
7146
7147 cf_cv_src_modules=
7148 for cf_dir in $modules_to_build
7149 do
7150         if test -f $srcdir/$cf_dir/modules; then
7151
7152                 # We may/may not have tack in the distribution, though the
7153                 # makefile is.
7154                 if test $cf_dir = tack ; then
7155                         if test ! -f $srcdir/${cf_dir}/${cf_dir}.h; then
7156                                 continue
7157                         fi
7158                 fi
7159
7160                 if test -z "$cf_cv_src_modules"; then
7161                         cf_cv_src_modules=$cf_dir
7162                 else
7163                         cf_cv_src_modules="$cf_cv_src_modules $cf_dir"
7164                 fi
7165
7166                 # Make the ncurses_cfg.h file record the library interface files as
7167                 # well.  These are header files that are the same name as their
7168                 # directory.  Ncurses is the only library that does not follow
7169                 # that pattern.
7170                 if test $cf_dir = tack ; then
7171                         continue
7172                 elif test -f $srcdir/${cf_dir}/${cf_dir}.h; then
7173                         
7174 cf_have_include=`echo "$cf_dir" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
7175
7176                         cat >> confdefs.h <<EOF
7177 #define HAVE_${cf_have_include}_H 1
7178 EOF
7179
7180                         cat >> confdefs.h <<EOF
7181 #define HAVE_LIB${cf_have_include} 1
7182 EOF
7183
7184                         TEST_DEPS="${LIB_DIR}/${LIB_PREFIX}${cf_dir}${DFT_DEP_SUFFIX} $TEST_DEPS"
7185                         if test "$DFT_LWR_MODEL" = "libtool"; then
7186                                 TEST_ARGS="${TEST_DEPS}"
7187                         else
7188                                 TEST_ARGS="-l${cf_dir}${DFT_ARG_SUFFIX} $TEST_ARGS"
7189                         fi
7190                 fi
7191         fi
7192 done
7193 echo "$ac_t""$cf_cv_src_modules" 1>&6
7194 TEST_ARGS="-L${LIB_DIR} -L\$(libdir) $TEST_ARGS"
7195
7196
7197
7198 PROG_ARGS="-L${LIB_DIR} -L\$(libdir) $PROG_ARGS"
7199
7200
7201 SRC_SUBDIRS="man include"
7202 for cf_dir in $cf_cv_src_modules
7203 do
7204         SRC_SUBDIRS="$SRC_SUBDIRS $cf_dir"
7205 done
7206 SRC_SUBDIRS="$SRC_SUBDIRS misc test"
7207 test "$cf_with_cxx_binding" != no && SRC_SUBDIRS="$SRC_SUBDIRS c++"
7208
7209 ADA_SUBDIRS=
7210 if test "$cf_cv_prog_gnat_correct" = yes && test -f $srcdir/Ada95/Makefile.in; then
7211    SRC_SUBDIRS="$SRC_SUBDIRS Ada95"
7212    ADA_SUBDIRS="gen src samples"
7213 fi
7214
7215 SUB_MAKEFILES=
7216 for cf_dir in $SRC_SUBDIRS
7217 do
7218         SUB_MAKEFILES="$SUB_MAKEFILES $cf_dir/Makefile"
7219 done
7220
7221 if test -n "$ADA_SUBDIRS"; then
7222    for cf_dir in $ADA_SUBDIRS
7223    do
7224       SUB_MAKEFILES="$SUB_MAKEFILES Ada95/$cf_dir/Makefile"
7225    done
7226    
7227 fi
7228
7229
7230 DIRS_TO_MAKE="lib"
7231 for cf_item in $cf_list_models
7232 do
7233         
7234         case $cf_item in
7235         libtool) cf_subdir='obj_lo'  ;;
7236         normal)  cf_subdir='objects' ;;
7237         debug)   cf_subdir='obj_g' ;;
7238         profile) cf_subdir='obj_p' ;;
7239         shared)  cf_subdir='obj_s' ;;
7240         esac
7241
7242         DIRS_TO_MAKE="$DIRS_TO_MAKE $cf_subdir"
7243 done
7244 for cf_dir in $DIRS_TO_MAKE
7245 do
7246         test ! -d $cf_dir && mkdir $cf_dir
7247 done
7248
7249
7250
7251 ### Now that we're done running tests, add the compiler-warnings, if any
7252 CFLAGS="$CFLAGS $EXTRA_CFLAGS"
7253
7254 ################################################################################
7255 trap '' 1 2 15
7256 cat > confcache <<\EOF
7257 # This file is a shell script that caches the results of configure
7258 # tests run on this system so they can be shared between configure
7259 # scripts and configure runs.  It is not useful on other systems.
7260 # If it contains results you don't want to keep, you may remove or edit it.
7261 #
7262 # By default, configure uses ./config.cache as the cache file,
7263 # creating it if it does not exist already.  You can give configure
7264 # the --cache-file=FILE option to use a different cache file; that is
7265 # what configure does when it calls configure scripts in
7266 # subdirectories, so they share the cache.
7267 # Giving --cache-file=/dev/null disables caching, for debugging configure.
7268 # config.status only pays attention to the cache file if you give it the
7269 # --recheck option to rerun configure.
7270 #
7271 EOF
7272 # The following way of writing the cache mishandles newlines in values,
7273 # but we know of no workaround that is simple, portable, and efficient.
7274 # So, don't put newlines in cache variables' values.
7275 # Ultrix sh set writes to stderr and can't be redirected directly,
7276 # and sets the high bit in the cache file unless we assign to the vars.
7277 (set) 2>&1 |
7278   case `(ac_space=' '; set | grep ac_space) 2>&1` in
7279   *ac_space=\ *)
7280     # `set' does not quote correctly, so add quotes (double-quote substitution
7281     # turns \\\\ into \\, and sed turns \\ into \).
7282     sed -n \
7283       -e "s/'/'\\\\''/g" \
7284       -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p"
7285     ;;
7286   *)
7287     # `set' quotes correctly as required by POSIX, so do not add quotes.
7288     sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p'
7289     ;;
7290   esac >> confcache
7291 if cmp -s $cache_file confcache; then
7292   :
7293 else
7294   if test -w $cache_file; then
7295     echo "updating cache $cache_file"
7296     cat confcache > $cache_file
7297   else
7298     echo "not updating unwritable cache $cache_file"
7299   fi
7300 fi
7301 rm -f confcache
7302
7303 trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
7304
7305 test "x$prefix" = xNONE && prefix=$ac_default_prefix
7306 # Let make expand exec_prefix.
7307 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
7308
7309 # Any assignment to VPATH causes Sun make to only execute
7310 # the first set of double-colon rules, so remove it if not needed.
7311 # If there is a colon in the path, we need to keep it.
7312 if test "x$srcdir" = x.; then
7313   ac_vpsub='/^[         ]*VPATH[        ]*=[^:]*$/d'
7314 fi
7315
7316 trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15
7317
7318 DEFS=-DHAVE_CONFIG_H
7319
7320 # Without the "./", some shells look in PATH for config.status.
7321 : ${CONFIG_STATUS=./config.status}
7322
7323 echo creating $CONFIG_STATUS
7324 rm -f $CONFIG_STATUS
7325 cat > $CONFIG_STATUS <<EOF
7326 #! /bin/sh
7327 # Generated automatically by configure.
7328 # Run this file to recreate the current configuration.
7329 # This directory was configured as follows,
7330 # on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
7331 #
7332 # $0 $ac_configure_args
7333 #
7334 # Compiler output produced by configure, useful for debugging
7335 # configure, is in ./config.log if it exists.
7336
7337 ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]"
7338 for ac_option
7339 do
7340   case "\$ac_option" in
7341   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
7342     echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
7343     exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
7344   -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
7345     echo "$CONFIG_STATUS generated by autoconf version 2.13.20000819"
7346     exit 0 ;;
7347   -help | --help | --hel | --he | --h)
7348     echo "\$ac_cs_usage"; exit 0 ;;
7349   *) echo "\$ac_cs_usage"; exit 1 ;;
7350   esac
7351 done
7352
7353 ac_given_srcdir=$srcdir
7354 ac_given_INSTALL="$INSTALL"
7355
7356 trap 'rm -fr `echo "\
7357         include/MKterm.h.awk \
7358         include/curses.h \
7359         include/termcap.h \
7360         include/unctrl.h \
7361         misc/run_tic.sh:misc/run_tic.in \
7362         $SUB_MAKEFILES \
7363         Makefile include/ncurses_cfg.h:include/ncurses_cfg.hin" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
7364 EOF
7365 cat >> $CONFIG_STATUS <<EOF
7366
7367 # Protect against being on the right side of a sed subst in config.status.
7368 sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g;
7369  s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF
7370 $ac_vpsub
7371 $extrasub
7372 s%@SHELL@%$SHELL%g
7373 s%@CFLAGS@%$CFLAGS%g
7374 s%@CPPFLAGS@%$CPPFLAGS%g
7375 s%@CXXFLAGS@%$CXXFLAGS%g
7376 s%@FFLAGS@%$FFLAGS%g
7377 s%@DEFS@%$DEFS%g
7378 s%@LDFLAGS@%$LDFLAGS%g
7379 s%@LIBS@%$LIBS%g
7380 s%@exec_prefix@%$exec_prefix%g
7381 s%@prefix@%$prefix%g
7382 s%@program_transform_name@%$program_transform_name%g
7383 s%@bindir@%$bindir%g
7384 s%@sbindir@%$sbindir%g
7385 s%@libexecdir@%$libexecdir%g
7386 s%@datadir@%$datadir%g
7387 s%@sysconfdir@%$sysconfdir%g
7388 s%@sharedstatedir@%$sharedstatedir%g
7389 s%@localstatedir@%$localstatedir%g
7390 s%@libdir@%$libdir%g
7391 s%@includedir@%$includedir%g
7392 s%@oldincludedir@%$oldincludedir%g
7393 s%@infodir@%$infodir%g
7394 s%@mandir@%$mandir%g
7395 s%@NCURSES_MAJOR@%$NCURSES_MAJOR%g
7396 s%@NCURSES_MINOR@%$NCURSES_MINOR%g
7397 s%@NCURSES_PATCH@%$NCURSES_PATCH%g
7398 s%@cf_cv_rel_version@%$cf_cv_rel_version%g
7399 s%@cf_cv_abi_version@%$cf_cv_abi_version%g
7400 s%@cf_cv_cc_bool_type@%$cf_cv_cc_bool_type%g
7401 s%@cf_cv_builtin_bool@%$cf_cv_builtin_bool%g
7402 s%@cf_cv_type_of_bool@%$cf_cv_type_of_bool%g
7403 s%@host@%$host%g
7404 s%@host_alias@%$host_alias%g
7405 s%@host_cpu@%$host_cpu%g
7406 s%@host_vendor@%$host_vendor%g
7407 s%@host_os@%$host_os%g
7408 s%@target@%$target%g
7409 s%@target_alias@%$target_alias%g
7410 s%@target_cpu@%$target_cpu%g
7411 s%@target_vendor@%$target_vendor%g
7412 s%@target_os@%$target_os%g
7413 s%@build@%$build%g
7414 s%@build_alias@%$build_alias%g
7415 s%@build_cpu@%$build_cpu%g
7416 s%@build_vendor@%$build_vendor%g
7417 s%@build_os@%$build_os%g
7418 s%@CC@%$CC%g
7419 s%@BUILD_CC@%$BUILD_CC%g
7420 s%@CPP@%$CPP%g
7421 s%@PROG_EXT@%$PROG_EXT%g
7422 s%@LDCONFIG@%$LDCONFIG%g
7423 s%@CXX@%$CXX%g
7424 s%@AWK@%$AWK%g
7425 s%@SET_MAKE@%$SET_MAKE%g
7426 s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
7427 s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g
7428 s%@INSTALL_DATA@%$INSTALL_DATA%g
7429 s%@LN_S@%$LN_S%g
7430 s%@RANLIB@%$RANLIB%g
7431 s%@MAKE_LOWER_TAGS@%$MAKE_LOWER_TAGS%g
7432 s%@MAKE_UPPER_TAGS@%$MAKE_UPPER_TAGS%g
7433 s%@LINT@%$LINT%g
7434 s%@MAN@%$MAN%g
7435 s%@LINT_OPTS@%$LINT_OPTS%g
7436 s%@LD@%$LD%g
7437 s%@AR@%$AR%g
7438 s%@AR_OPTS@%$AR_OPTS%g
7439 s%@cf_cv_makeflags@%$cf_cv_makeflags%g
7440 s%@DESTDIR@%$DESTDIR%g
7441 s%@cf_list_models@%$cf_list_models%g
7442 s%@LIBTOOL@%$LIBTOOL%g
7443 s%@DFT_LWR_MODEL@%$DFT_LWR_MODEL%g
7444 s%@DFT_UPR_MODEL@%$DFT_UPR_MODEL%g
7445 s%@TINFO_NAME@%$TINFO_NAME%g
7446 s%@LIB_NAME@%$LIB_NAME%g
7447 s%@LIB_PREFIX@%$LIB_PREFIX%g
7448 s%@LIB_SUFFIX@%$LIB_SUFFIX%g
7449 s%@CC_G_OPT@%$CC_G_OPT%g
7450 s%@CXX_G_OPT@%$CXX_G_OPT%g
7451 s%@LD_MODEL@%$LD_MODEL%g
7452 s%@CC_SHARED_OPTS@%$CC_SHARED_OPTS%g
7453 s%@LD_SHARED_OPTS@%$LD_SHARED_OPTS%g
7454 s%@MK_SHARED_LIB@%$MK_SHARED_LIB%g
7455 s%@LINK_PROGS@%$LINK_PROGS%g
7456 s%@LINK_TESTS@%$LINK_TESTS%g
7457 s%@EXTRA_LDFLAGS@%$EXTRA_LDFLAGS%g
7458 s%@LOCAL_LDFLAGS@%$LOCAL_LDFLAGS%g
7459 s%@LOCAL_LDFLAGS2@%$LOCAL_LDFLAGS2%g
7460 s%@INSTALL_LIB@%$INSTALL_LIB%g
7461 s%@TERMINFO_SRC@%$TERMINFO_SRC%g
7462 s%@FALLBACK_LIST@%$FALLBACK_LIST%g
7463 s%@TERMINFO_DIRS@%$TERMINFO_DIRS%g
7464 s%@TERMINFO@%$TERMINFO%g
7465 s%@NCURSES_CONST@%$NCURSES_CONST%g
7466 s%@NCURSES_XNAMES@%$NCURSES_XNAMES%g
7467 s%@ECHO_LINK@%$ECHO_LINK%g
7468 s%@EXTRA_CFLAGS@%$EXTRA_CFLAGS%g
7469 s%@MATH_LIB@%$MATH_LIB%g
7470 s%@cf_cv_typeof_chtype@%$cf_cv_typeof_chtype%g
7471 s%@cf_cv_1UL@%$cf_cv_1UL%g
7472 s%@cf_cv_shift_limit@%$cf_cv_shift_limit%g
7473 s%@cf_cv_widec_shift@%$cf_cv_widec_shift%g
7474 s%@CXXCPP@%$CXXCPP%g
7475 s%@CXXLDFLAGS@%$CXXLDFLAGS%g
7476 s%@CXXLIBS@%$CXXLIBS%g
7477 s%@gnat_exists@%$gnat_exists%g
7478 s%@M4_exists@%$M4_exists%g
7479 s%@cf_ada_make@%$cf_ada_make%g
7480 s%@cf_ada_compiler@%$cf_ada_compiler%g
7481 s%@cf_ada_package@%$cf_ada_package%g
7482 s%@ADAFLAGS@%$ADAFLAGS%g
7483 s%@cf_compile_generics@%$cf_compile_generics%g
7484 s%@cf_generic_objects@%$cf_generic_objects%g
7485 s%@ADA_INCLUDE@%$ADA_INCLUDE%g
7486 s%@ADA_OBJECTS@%$ADA_OBJECTS%g
7487 s%@ACPPFLAGS@%$ACPPFLAGS%g
7488 s%@DFT_ARG_SUFFIX@%$DFT_ARG_SUFFIX%g
7489 s%@DFT_DEP_SUFFIX@%$DFT_DEP_SUFFIX%g
7490 s%@DFT_OBJ_SUBDIR@%$DFT_OBJ_SUBDIR%g
7491 s%@CXX_LIB_SUFFIX@%$CXX_LIB_SUFFIX%g
7492 s%@EXTRA_LIBS@%$EXTRA_LIBS%g
7493 s%@TINFO_LIST@%$TINFO_LIST%g
7494 s%@SHLIB_LIST@%$SHLIB_LIST%g
7495 s%@TEST_DEPS@%$TEST_DEPS%g
7496 s%@TEST_ARGS@%$TEST_ARGS%g
7497 s%@PROG_ARGS@%$PROG_ARGS%g
7498 s%@ADA_SUBDIRS@%$ADA_SUBDIRS%g
7499 s%@DIRS_TO_MAKE@%$DIRS_TO_MAKE%g
7500
7501 CEOF
7502 EOF
7503
7504 cat >> $CONFIG_STATUS <<\EOF
7505
7506 # Split the substitutions into bite-sized pieces for seds with
7507 # small command number limits, like on Digital OSF/1 and HP-UX.
7508 ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script.
7509 ac_file=1 # Number of current file.
7510 ac_beg=1 # First line for current file.
7511 ac_end=$ac_max_sed_cmds # Line after last line for current file.
7512 ac_more_lines=:
7513 ac_sed_cmds=""
7514 while $ac_more_lines; do
7515   if test $ac_beg -gt 1; then
7516     sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file
7517   else
7518     sed "${ac_end}q" conftest.subs > conftest.s$ac_file
7519   fi
7520   if test ! -s conftest.s$ac_file; then
7521     ac_more_lines=false
7522     rm -f conftest.s$ac_file
7523   else
7524     if test -z "$ac_sed_cmds"; then
7525       ac_sed_cmds="sed -f conftest.s$ac_file"
7526     else
7527       ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file"
7528     fi
7529     ac_file=`expr $ac_file + 1`
7530     ac_beg=$ac_end
7531     ac_end=`expr $ac_end + $ac_max_sed_cmds`
7532   fi
7533 done
7534 if test -z "$ac_sed_cmds"; then
7535   ac_sed_cmds=cat
7536 fi
7537 EOF
7538
7539 cat >> $CONFIG_STATUS <<EOF
7540
7541 CONFIG_FILES=\${CONFIG_FILES-"\
7542         include/MKterm.h.awk \
7543         include/curses.h \
7544         include/termcap.h \
7545         include/unctrl.h \
7546         misc/run_tic.sh:misc/run_tic.in \
7547         $SUB_MAKEFILES \
7548         Makefile"}
7549 EOF
7550 cat >> $CONFIG_STATUS <<\EOF
7551 for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
7552   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
7553   case "$ac_file" in
7554   *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
7555        ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
7556   *) ac_file_in="${ac_file}.in" ;;
7557   esac
7558
7559   # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories.
7560
7561   # Remove last slash and all that follows it.  Not all systems have dirname.
7562   ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
7563   if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
7564     # The file is in a subdirectory.
7565     test ! -d "$ac_dir" && mkdir "$ac_dir"
7566     ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`"
7567     # A "../" for each directory in $ac_dir_suffix.
7568     ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'`
7569   else
7570     ac_dir_suffix= ac_dots=
7571   fi
7572
7573   case "$ac_given_srcdir" in
7574   .)  srcdir=.
7575       if test -z "$ac_dots"; then top_srcdir=.
7576       else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;;
7577   /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;;
7578   *) # Relative path.
7579     srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix"
7580     top_srcdir="$ac_dots$ac_given_srcdir" ;;
7581   esac
7582
7583   case "$ac_given_INSTALL" in
7584   [/$]*) INSTALL="$ac_given_INSTALL" ;;
7585   *) INSTALL="$ac_dots$ac_given_INSTALL" ;;
7586   esac
7587
7588   echo creating "$ac_file"
7589   rm -f "$ac_file"
7590   configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure."
7591   case "$ac_file" in
7592   *Makefile*) ac_comsub="1i\\
7593 # $configure_input" ;;
7594   *) ac_comsub= ;;
7595   esac
7596
7597   ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
7598   sed -e "$ac_comsub
7599 s%@configure_input@%$configure_input%g
7600 s%@srcdir@%$srcdir%g
7601 s%@top_srcdir@%$top_srcdir%g
7602 s%@INSTALL@%$INSTALL%g
7603 " $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file
7604 fi; done
7605 rm -f conftest.s*
7606
7607 # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
7608 # NAME is the cpp macro being defined and VALUE is the value it is being given.
7609 #
7610 # ac_d sets the value in "#define NAME VALUE" lines.
7611 ac_dA='s%^\([   ]*\)#\([        ]*define[       ][      ]*\)'
7612 ac_dB='\([      ][      ]*\)[^  ]*%\1#\2'
7613 ac_dC='\3'
7614 ac_dD='%g'
7615 # ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
7616 ac_uA='s%^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
7617 ac_uB='\([      ]\)%\1#\2define\3'
7618 ac_uC=' '
7619 ac_uD='\4%g'
7620 # ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
7621 ac_eA='s%^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
7622 ac_eB='$%\1#\2define\3'
7623 ac_eC=' '
7624 ac_eD='%g'
7625
7626 if test "${CONFIG_HEADERS+set}" != set; then
7627 EOF
7628 cat >> $CONFIG_STATUS <<EOF
7629   CONFIG_HEADERS="include/ncurses_cfg.h:include/ncurses_cfg.hin"
7630 EOF
7631 cat >> $CONFIG_STATUS <<\EOF
7632 fi
7633 for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then
7634   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
7635   case "$ac_file" in
7636   *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
7637        ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
7638   *) ac_file_in="${ac_file}.in" ;;
7639   esac
7640
7641   echo creating $ac_file
7642
7643   rm -f conftest.frag conftest.in conftest.out
7644   ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
7645   cat $ac_file_inputs > conftest.in
7646
7647 EOF
7648
7649
7650 # Transform confdefs.h into a list of #define's.  We won't use it as a sed
7651 # script, but as data to insert where we see @DEFS@.  We expect AC_SAVE_DEFS to
7652 # be either 'cat' or 'sort'.
7653 sort confdefs.h >conftest.vals
7654
7655 # Break up conftest.vals because some shells have a limit on
7656 # the size of here documents, and old seds have small limits too.
7657
7658 rm -f conftest.tail
7659 echo '  rm -f conftest.frag' >> $CONFIG_STATUS
7660 while :
7661 do
7662   ac_lines=`grep -c . conftest.vals`
7663   # grep -c gives empty output for an empty file on some AIX systems.
7664   if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi
7665   # Write chunks of a limited-size here document to conftest.frag.
7666   echo '  cat >> conftest.frag <<CEOF' >> $CONFIG_STATUS
7667   sed ${ac_max_here_lines}q conftest.vals >> $CONFIG_STATUS
7668   echo 'CEOF' >> $CONFIG_STATUS
7669   sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
7670   rm -f conftest.vals
7671   mv conftest.tail conftest.vals
7672 done
7673 rm -f conftest.vals
7674
7675 # Run sed to substitute the contents of conftest.frag into conftest.in at the
7676 # marker @DEFS@.
7677 echo '  cat >> conftest.edit <<CEOF
7678 /@DEFS@/r conftest.frag
7679 /@DEFS@/d
7680 CEOF
7681 sed -f conftest.edit conftest.in > conftest.out
7682 rm -f conftest.in
7683 mv conftest.out conftest.in
7684 rm -f conftest.edit conftest.frag
7685 ' >> $CONFIG_STATUS
7686
7687
7688 cat >> $CONFIG_STATUS <<\EOF
7689   rm -f conftest.frag conftest.h
7690   echo "/* $ac_file.  Generated automatically by configure.  */" > conftest.h
7691   cat conftest.in >> conftest.h
7692   rm -f conftest.in
7693   if cmp -s $ac_file conftest.h 2>/dev/null; then
7694     echo "$ac_file is unchanged"
7695     rm -f conftest.h
7696   else
7697     # Remove last slash and all that follows it.  Not all systems have dirname.
7698       ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
7699       if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
7700       # The file is in a subdirectory.
7701       test ! -d "$ac_dir" && mkdir "$ac_dir"
7702     fi
7703     rm -f $ac_file
7704     mv conftest.h $ac_file
7705   fi
7706 fi; done
7707
7708 EOF
7709 cat >> $CONFIG_STATUS <<EOF
7710 # Extra initialization commands, if any
7711
7712 ### Special initialization commands, used to pass information from the
7713 ### configuration-run into config.status
7714
7715 AWK="$AWK"
7716 CF_LIST_MODELS="$cf_list_models"
7717 DFT_LWR_MODEL="$DFT_LWR_MODEL"
7718 LDCONFIG="$LDCONFIG"
7719 LIB_NAME="$LIB_NAME"
7720 LIB_SUFFIX="$LIB_SUFFIX"
7721 LIB_SUBSETS="$LIB_SUBSETS"
7722 LIB_TRACING="$LIB_TRACING"
7723 SRC_SUBDIRS="$SRC_SUBDIRS"
7724 TERMINFO="$TERMINFO"
7725 TINFO_NAME="$TINFO_NAME"
7726 WITH_ECHO="$with_echo"
7727 WITH_OVERWRITE="$with_overwrite"
7728 WITH_CURSES_H="$with_curses_h"
7729 cf_cv_abi_version="$cf_cv_abi_version"
7730 cf_cv_do_symlinks="$cf_cv_do_symlinks"
7731 cf_cv_rel_version="$cf_cv_rel_version"
7732 cf_cv_rm_so_locs="$cf_cv_rm_so_locs"
7733 cf_cv_system_name="$cf_cv_system_name"
7734 cf_with_cxx_binding="$cf_with_cxx_binding"
7735 cf_cv_shlib_version="$cf_cv_shlib_version"
7736 target="$target"
7737
7738
7739 EOF
7740 cat >> $CONFIG_STATUS <<\EOF
7741 # Extra commands, if any
7742
7743
7744
7745         case $cf_cv_system_name in
7746         os2)    LIB_PREFIX=''     ;;
7747         *)      LIB_PREFIX='lib'  ;;
7748         esac
7749 cf_prefix=$LIB_PREFIX
7750         
7751
7752
7753 for cf_dir in $SRC_SUBDIRS
7754 do
7755         if test -f $srcdir/$cf_dir/modules; then
7756
7757                 cf_libs_to_make=
7758                 for cf_item in $CF_LIST_MODELS
7759                 do
7760                         
7761         
7762         case $cf_item in
7763         libtool) cf_suffix='.la'  ;;
7764         normal)  cf_suffix='.a'   ;;
7765         debug)   cf_suffix='_g.a' ;;
7766         profile) cf_suffix='_p.a' ;;
7767         shared)
7768                 case $cf_cv_system_name in
7769                 hpux*)  cf_suffix='.sl'  ;;
7770                 *)      cf_suffix='.so'  ;;
7771                 esac
7772         esac
7773         test -n "$LIB_SUFFIX" && cf_suffix="${LIB_SUFFIX}${cf_suffix}"
7774
7775                         if test $cf_item = shared ; then
7776                         if test "$cf_cv_do_symlinks" = yes ; then
7777                                 case "$cf_cv_shlib_version" in #(vi
7778                                 rel) cf_suffix="$cf_suffix"'.$(REL_VERSION)' ;; #(vi
7779                                 abi) cf_suffix="$cf_suffix"'.$(ABI_VERSION)' ;;
7780                                 esac
7781                         fi
7782                         fi
7783                         cf_libs_to_make="$cf_libs_to_make ../lib/${cf_prefix}${cf_dir}${cf_suffix}"
7784                 done
7785
7786                 if test $cf_dir = ncurses ; then
7787                         case "$LIB_SUBSETS" in #(vi
7788                         termlib+*) #(vi
7789                                 ;;
7790                         *) #(vi
7791                                 cf_item=`echo $cf_libs_to_make |sed -e s/$LIB_NAME/$TINFO_NAME/g`
7792                                 cf_libs_to_make="$cf_item $cf_libs_to_make"
7793                                 ;;
7794                         esac
7795                 fi
7796
7797                 sed -e "s@\@LIBS_TO_MAKE\@@$cf_libs_to_make@" \
7798                         $cf_dir/Makefile >$cf_dir/Makefile.out
7799                 mv $cf_dir/Makefile.out $cf_dir/Makefile
7800
7801                 $AWK -f $srcdir/mk-0th.awk \
7802                         name=$cf_dir \
7803                         $srcdir/$cf_dir/modules >>$cf_dir/Makefile
7804
7805                 for cf_item in $CF_LIST_MODELS
7806                 do
7807                         echo 'Appending rules for '$cf_item' model ('$cf_dir')'
7808                         
7809 CF_ITEM=`echo "$cf_item" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
7810
7811                         
7812         
7813         case $cf_item in
7814         libtool) cf_suffix='.la'  ;;
7815         normal)  cf_suffix='.a'   ;;
7816         debug)   cf_suffix='_g.a' ;;
7817         profile) cf_suffix='_p.a' ;;
7818         shared)
7819                 case $cf_cv_system_name in
7820                 hpux*)  cf_suffix='.sl'  ;;
7821                 *)      cf_suffix='.so'  ;;
7822                 esac
7823         esac
7824         test -n "$LIB_SUFFIX" && cf_suffix="${LIB_SUFFIX}${cf_suffix}"
7825
7826                         
7827         case $cf_item in
7828         libtool) cf_subdir='obj_lo'  ;;
7829         normal)  cf_subdir='objects' ;;
7830         debug)   cf_subdir='obj_g' ;;
7831         profile) cf_subdir='obj_p' ;;
7832         shared)  cf_subdir='obj_s' ;;
7833         esac
7834
7835
7836                         # These dependencies really are for development, not
7837                         # builds, but they are useful in porting, too.
7838                         cf_depend="../include/ncurses_cfg.h"
7839                         if test "$srcdir" = "."; then
7840                                 cf_reldir="."
7841                         else
7842                                 cf_reldir="\$(srcdir)"
7843                         fi
7844
7845                         if test -f $srcdir/$cf_dir/$cf_dir.priv.h; then
7846                                 cf_depend="$cf_depend $cf_reldir/$cf_dir.priv.h"
7847                         elif test -f $srcdir/$cf_dir/curses.priv.h; then
7848                                 cf_depend="$cf_depend $cf_reldir/curses.priv.h"
7849                         fi
7850
7851                         for cf_subset in $LIB_SUBSETS
7852                         do
7853                         $AWK -f $srcdir/mk-1st.awk \
7854                                 name=$cf_dir \
7855                                 traces=$LIB_TRACING \
7856                                 MODEL=$CF_ITEM \
7857                                 model=$cf_subdir \
7858                                 prefix=$cf_prefix \
7859                                 suffix=$cf_suffix \
7860                                 subset=$cf_subset \
7861                                 ShlibVer=$cf_cv_shlib_version \
7862                                 DoLinks=$cf_cv_do_symlinks \
7863                                 rmSoLocs=$cf_cv_rm_so_locs \
7864                                 ldconfig="$LDCONFIG" \
7865                                 overwrite=$WITH_OVERWRITE \
7866                                 depend="$cf_depend" \
7867                                 target="$target" \
7868                                 $srcdir/$cf_dir/modules >>$cf_dir/Makefile
7869                         test $cf_dir = ncurses && WITH_OVERWRITE=no
7870                         $AWK -f $srcdir/mk-2nd.awk \
7871                                 name=$cf_dir \
7872                                 traces=$LIB_TRACING \
7873                                 MODEL=$CF_ITEM \
7874                                 model=$cf_subdir \
7875                                 subset=$cf_subset \
7876                                 srcdir=$srcdir \
7877                                 echo=$WITH_ECHO \
7878                                 $srcdir/$cf_dir/modules >>$cf_dir/Makefile
7879                         done
7880                 done
7881         fi
7882
7883         echo '  cd '$cf_dir' && $(MAKE) $(CF_MFLAGS) $@' >>Makefile
7884 done
7885
7886 for cf_dir in $SRC_SUBDIRS
7887 do
7888         if test -f $cf_dir/Makefile ; then
7889                 case "$cf_dir" in
7890                 Ada95) #(vi
7891                         echo 'libs \' >> Makefile
7892                         echo 'install.libs \' >> Makefile
7893                         echo 'uninstall.libs ::' >> Makefile
7894                         echo '  cd '$cf_dir' && $(MAKE) $(CF_MFLAGS) $@' >> Makefile
7895                         ;;
7896                 esac
7897         fi
7898
7899         if test -f $srcdir/$cf_dir/modules; then
7900                 echo >> Makefile
7901                 if test -f $srcdir/$cf_dir/headers; then
7902 cat >> Makefile <<CF_EOF
7903 install.includes \\
7904 uninstall.includes \\
7905 CF_EOF
7906                 fi
7907 if test "$cf_dir" != "c++" ; then
7908 echo 'lint \' >> Makefile
7909 fi
7910 cat >> Makefile <<CF_EOF
7911 libs \\
7912 lintlib \\
7913 install.libs \\
7914 uninstall.libs \\
7915 install.$cf_dir \\
7916 uninstall.$cf_dir ::
7917         cd $cf_dir && \$(MAKE) \$(CF_MFLAGS) \$@
7918 CF_EOF
7919         elif test -f $srcdir/$cf_dir/headers; then
7920 cat >> Makefile <<CF_EOF
7921
7922 libs \\
7923 install.libs \\
7924 uninstall.libs \\
7925 install.includes \\
7926 uninstall.includes ::
7927         cd $cf_dir && \$(MAKE) \$(CF_MFLAGS) \$@
7928 CF_EOF
7929 fi
7930 done
7931
7932 cat >> Makefile <<CF_EOF
7933
7934 install.data \
7935 uninstall.data ::
7936         cd misc && \$(MAKE) \$(CF_MFLAGS) \$@
7937
7938 install.man \
7939 uninstall.man ::
7940         cd man && \$(MAKE) \$(CF_MFLAGS) \$@
7941
7942 distclean ::
7943         rm -f config.cache config.log config.status Makefile include/ncurses_cfg.h
7944         rm -f headers.sh headers.sed
7945         rm -rf \$(DIRS_TO_MAKE)
7946 CF_EOF
7947
7948 # Special case: tack's manpage lives in its own directory.
7949 if test -d tack ; then
7950 if test -f $srcdir/$tack.h; then
7951 cat >> Makefile <<CF_EOF
7952
7953 install.man \
7954 uninstall.man ::
7955         cd tack && \$(MAKE) \$(CF_MFLAGS) \$@
7956 CF_EOF
7957 fi
7958 fi
7959
7960
7961 rm -f headers.sed headers.sh
7962
7963 echo creating headers.sh
7964 cat >headers.sh <<CF_EOF
7965 #! /bin/sh
7966 # This shell script is generated by the 'configure' script.  It is invoked in a
7967 # subdirectory of the build tree.  It generates a sed-script in the parent
7968 # directory that is used to adjust includes for header files that reside in a
7969 # subdirectory of /usr/include, etc.
7970 PRG=""
7971 while test \$# != 3
7972 do
7973 PRG="\$PRG \$1"; shift
7974 done
7975 DST=\$1
7976 REF=\$2
7977 SRC=\$3
7978 TMPSRC=\${TMPDIR-/tmp}/\`basename \$SRC\`\$\$
7979 TMPSED=\${TMPDIR-/tmp}/headers.sed\$\$
7980 echo installing \$SRC in \$DST
7981 CF_EOF
7982 if test $WITH_CURSES_H = yes; then
7983         cat >>headers.sh <<CF_EOF
7984 case \$DST in
7985 /*/include/*)
7986         END=\`basename \$DST\`
7987         for i in \`cat \$REF/../*/headers |fgrep -v "#"\`
7988         do
7989                 NAME=\`basename \$i\`
7990                 echo "s/<\$NAME>/<\$END\/\$NAME>/" >> \$TMPSED
7991         done
7992         ;;
7993 *)
7994         echo "" >> \$TMPSED
7995         ;;
7996 esac
7997 CF_EOF
7998 else
7999         cat >>headers.sh <<CF_EOF
8000 case \$DST in
8001 /*/include/*)
8002         END=\`basename \$DST\`
8003         for i in \`cat \$REF/../*/headers |fgrep -v "#"\`
8004         do
8005                 NAME=\`basename \$i\`
8006                 if test "\$NAME" = "curses.h"
8007                 then
8008                         echo "s/<curses.h>/<ncurses.h>/" >> \$TMPSED
8009                         NAME=ncurses.h
8010                 fi
8011                 echo "s/<\$NAME>/<\$END\/\$NAME>/" >> \$TMPSED
8012         done
8013         ;;
8014 *)
8015         echo "s/<curses.h>/<ncurses.h>/" >> \$TMPSED
8016         ;;
8017 esac
8018 CF_EOF
8019 fi
8020 cat >>headers.sh <<CF_EOF
8021 rm -f \$TMPSRC
8022 sed -f \$TMPSED \$SRC > \$TMPSRC
8023 NAME=\`basename \$SRC\`
8024 CF_EOF
8025 if test $WITH_CURSES_H != yes; then
8026         cat >>headers.sh <<CF_EOF
8027 test "\$NAME" = "curses.h" && NAME=ncurses.h
8028 CF_EOF
8029 fi
8030 cat >>headers.sh <<CF_EOF
8031 eval \$PRG \$TMPSRC \$DST/\$NAME
8032 rm -f \$TMPSRC \$TMPSED
8033 CF_EOF
8034
8035 chmod 0755 headers.sh
8036
8037 for cf_dir in $SRC_SUBDIRS
8038 do
8039         if test -f $srcdir/$cf_dir/headers; then
8040         cat >>$cf_dir/Makefile <<CF_EOF
8041 \$(DESTDIR)\$(includedir) :
8042         \$(srcdir)/../mkinstalldirs \$@
8043
8044 install \\
8045 install.libs \\
8046 install.includes :: \$(AUTO_SRC) \$(DESTDIR)\$(includedir) \\
8047 CF_EOF
8048                 j=""
8049                 for i in `cat $srcdir/$cf_dir/headers |fgrep -v "#"`
8050                 do
8051                         test -n "$j" && echo "          $j \\" >>$cf_dir/Makefile
8052                         j=$i
8053                 done
8054                 echo "          $j" >>$cf_dir/Makefile
8055                 for i in `cat $srcdir/$cf_dir/headers |fgrep -v "#"`
8056                 do
8057                         echo "  @ (cd \$(DESTDIR)\$(includedir) && rm -f `basename $i`) ; ../headers.sh \$(INSTALL_DATA) \$(DESTDIR)\$(includedir) \$(srcdir) $i" >>$cf_dir/Makefile
8058                         test $i = curses.h && test $WITH_CURSES_H = yes && echo "       @ (cd \$(DESTDIR)\$(includedir) && rm -f ncurses.h && \$(LN_S) curses.h ncurses.h)" >>$cf_dir/Makefile
8059                 done
8060
8061         cat >>$cf_dir/Makefile <<CF_EOF
8062
8063 uninstall \\
8064 uninstall.libs \\
8065 uninstall.includes ::
8066 CF_EOF
8067                 for i in `cat $srcdir/$cf_dir/headers |fgrep -v "#"`
8068                 do
8069                         i=`basename $i`
8070                         echo "  -@ (cd \$(DESTDIR)\$(includedir) && rm -f $i)" >>$cf_dir/Makefile
8071                         test $i = curses.h && echo "    -@ (cd \$(DESTDIR)\$(includedir) && rm -f ncurses.h)" >>$cf_dir/Makefile
8072                 done
8073         fi
8074 done
8075
8076
8077
8078 exit 0
8079 EOF
8080 chmod +x $CONFIG_STATUS
8081 rm -fr confdefs* $ac_clean_files
8082 test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1
8083 ${MAKE-make} preinstall