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