]> ncurses.scripts.mit.edu Git - ncurses.git/blob - configure
51180b9b4cefecd847a5d5dab6961c7d5517bdd6
[ncurses.git] / configure
1 #! /bin/sh
2
3 # From configure.in Revision: 1.195 
4
5
6
7 # Guess values for system-dependent variables and create Makefiles.
8 # Generated automatically using autoconf version 2.13.19990117 
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 How Manpages are Installed:
198   --with-manpage-format   specify manpage-format: gzip/compress/BSDI/normal and
199                           optionally formatted, e.g., gzip,formatted
200   --with-manpage-renames  specify manpage-renaming
201   --with-manpage-symlinks specify manpage-symlinks
202 Options to Specify the Libraries Built/Used:
203   --with-shared           generate shared-libraries
204 EOF
205 cat <<EOF
206   --with-normal           generate normal-libraries (default)
207   --with-debug            generate debug-libraries (default)
208   --with-profile          generate profile-libraries
209   --with-termlib          generate separate terminfo library
210   --with-dbmalloc         test: use Conor Cahill's dbmalloc library
211   --with-dmalloc          test: use Gray Watson's dmalloc library
212   --with-gpm              use Alessandro Rubini's GPM library
213   --enable-rpath          use rpath option when generating shared libraries
214   --with-shlib-version=X  Specify rel or abi version for shared libs
215 Fine-Tuning Your Configuration:
216   --disable-overwrite     leave out the link to -lcurses
217   --disable-database      use only built-in data
218 EOF
219 cat <<EOF
220   --with-fallbacks=XXX    specify list of fallback terminal descriptions
221   --with-terminfo-dirs=XXX specify list of terminfo directories (default: DATADIR/terminfo)
222   --disable-big-core      assume machine has little memory
223   --enable-termcap        compile in termcap fallback support
224   --enable-getcap         fast termcap load, no xrefs to terminfo
225   --enable-getcap-cache   cache translated termcaps in ~/.terminfo
226   --enable-symlinks       make tic use symbolic links not hard links
227   --enable-broken_linker  compile with broken-linker support code
228   --enable-bsdpad         recognize BSD-style prefix padding
229   --with-rcs-ids          compile-in RCS identifiers
230 Extensions:
231   --disable-ext-funcs     disable function-extensions
232 EOF
233 cat <<EOF
234   --enable-const          compile with extra/non-standard const
235   --enable-hashmap        compile with hashmap scrolling-optimization code
236   --enable-no-padding     compile with \$NCURSES_NO_PADDING code
237   --enable-sigwinch       compile with SIGWINCH handler
238   --enable-tcap-names     compile with user-definable terminal capabilities
239 Experimental Code:
240   --with-develop          enable all experimental options for testing
241   --enable-colorfgbg      compile with experimental \$COLORFGBG code
242   --enable-hard-tabs      compile with experimental hard-tabs code
243   --enable-safe-sprintf   compile with experimental safe-sprintf code
244   --disable-scroll-hints  compile without scroll-hints code
245   --enable-widec          compile with experimental wide-char code
246 EOF
247 cat <<EOF
248   --enable-xmc-glitch     compile with experimental xmc code
249 Testing/development Options:
250   --enable-echo           build: display "compiling" commands (default)
251   --enable-warnings       build: turn on GCC compiler warnings
252   --enable-assertions     test: turn on generation of assertion code
253   --disable-leaks         test: suppress permanent memory-leaks
254   --enable-expanded       test: generate functions for certain macros
255   --disable-macros        test: use functions rather than macros
256 Ada95 Binding Options:
257   --with-ada-compiler=CMD Specify Ada95 compiler command (default gnatmake)
258   --with-ada-include=DIR  Ada includes are in DIR (default: PREFIX/lib/ada/adainclude)
259   --with-ada-objects=DIR  Ada objects are in DIR (default: PREFIX/lib/ada/adalib)
260 EOF
261 cat <<EOF
262 EOF
263     exit 0 ;;
264
265   -host | --host | --hos | --ho)
266     ac_prev=host ;;
267   -host=* | --host=* | --hos=* | --ho=*)
268     host="$ac_optarg" ;;
269
270   -includedir | --includedir | --includedi | --included | --include \
271   | --includ | --inclu | --incl | --inc)
272     ac_prev=includedir ;;
273   -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
274   | --includ=* | --inclu=* | --incl=* | --inc=*)
275     includedir="$ac_optarg" ;;
276
277   -infodir | --infodir | --infodi | --infod | --info | --inf)
278     ac_prev=infodir ;;
279   -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
280     infodir="$ac_optarg" ;;
281
282   -libdir | --libdir | --libdi | --libd)
283     ac_prev=libdir ;;
284   -libdir=* | --libdir=* | --libdi=* | --libd=*)
285     libdir="$ac_optarg" ;;
286
287   -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
288   | --libexe | --libex | --libe)
289     ac_prev=libexecdir ;;
290   -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
291   | --libexe=* | --libex=* | --libe=*)
292     libexecdir="$ac_optarg" ;;
293
294   -localstatedir | --localstatedir | --localstatedi | --localstated \
295   | --localstate | --localstat | --localsta | --localst \
296   | --locals | --local | --loca | --loc | --lo)
297     ac_prev=localstatedir ;;
298   -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
299   | --localstate=* | --localstat=* | --localsta=* | --localst=* \
300   | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
301     localstatedir="$ac_optarg" ;;
302
303   -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
304     ac_prev=mandir ;;
305   -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
306     mandir="$ac_optarg" ;;
307
308   -nfp | --nfp | --nf)
309     # Obsolete; use --without-fp.
310     with_fp=no ;;
311
312   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
313   | --no-cr | --no-c)
314     no_create=yes ;;
315
316   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
317   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
318     no_recursion=yes ;;
319
320   -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
321   | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
322   | --oldin | --oldi | --old | --ol | --o)
323     ac_prev=oldincludedir ;;
324   -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
325   | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
326   | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
327     oldincludedir="$ac_optarg" ;;
328
329   -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
330     ac_prev=prefix ;;
331   -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
332     prefix="$ac_optarg" ;;
333
334   -program-prefix | --program-prefix | --program-prefi | --program-pref \
335   | --program-pre | --program-pr | --program-p)
336     ac_prev=program_prefix ;;
337   -program-prefix=* | --program-prefix=* | --program-prefi=* \
338   | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
339     program_prefix="$ac_optarg" ;;
340
341   -program-suffix | --program-suffix | --program-suffi | --program-suff \
342   | --program-suf | --program-su | --program-s)
343     ac_prev=program_suffix ;;
344   -program-suffix=* | --program-suffix=* | --program-suffi=* \
345   | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
346     program_suffix="$ac_optarg" ;;
347
348   -program-transform-name | --program-transform-name \
349   | --program-transform-nam | --program-transform-na \
350   | --program-transform-n | --program-transform- \
351   | --program-transform | --program-transfor \
352   | --program-transfo | --program-transf \
353   | --program-trans | --program-tran \
354   | --progr-tra | --program-tr | --program-t)
355     ac_prev=program_transform_name ;;
356   -program-transform-name=* | --program-transform-name=* \
357   | --program-transform-nam=* | --program-transform-na=* \
358   | --program-transform-n=* | --program-transform-=* \
359   | --program-transform=* | --program-transfor=* \
360   | --program-transfo=* | --program-transf=* \
361   | --program-trans=* | --program-tran=* \
362   | --progr-tra=* | --program-tr=* | --program-t=*)
363     program_transform_name="$ac_optarg" ;;
364
365   -q | -quiet | --quiet | --quie | --qui | --qu | --q \
366   | -silent | --silent | --silen | --sile | --sil)
367     silent=yes ;;
368
369   -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
370     ac_prev=sbindir ;;
371   -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
372   | --sbi=* | --sb=*)
373     sbindir="$ac_optarg" ;;
374
375   -sharedstatedir | --sharedstatedir | --sharedstatedi \
376   | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
377   | --sharedst | --shareds | --shared | --share | --shar \
378   | --sha | --sh)
379     ac_prev=sharedstatedir ;;
380   -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
381   | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
382   | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
383   | --sha=* | --sh=*)
384     sharedstatedir="$ac_optarg" ;;
385
386   -site | --site | --sit)
387     ac_prev=site ;;
388   -site=* | --site=* | --sit=*)
389     site="$ac_optarg" ;;
390
391   -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
392     ac_prev=srcdir ;;
393   -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
394     srcdir="$ac_optarg" ;;
395
396   -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
397   | --syscon | --sysco | --sysc | --sys | --sy)
398     ac_prev=sysconfdir ;;
399   -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
400   | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
401     sysconfdir="$ac_optarg" ;;
402
403   -target | --target | --targe | --targ | --tar | --ta | --t)
404     ac_prev=target ;;
405   -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
406     target="$ac_optarg" ;;
407
408   -v | -verbose | --verbose | --verbos | --verbo | --verb)
409     verbose=yes ;;
410
411   -version | --version | --versio | --versi | --vers)
412     echo "configure generated by autoconf version 2.13.19990117"
413     exit 0 ;;
414
415   -with-* | --with-*)
416     ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'`
417     # Reject names that are not valid shell variable names.
418     if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then
419       { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
420     fi
421     ac_package=`echo $ac_package| sed 's/-/_/g'`
422     case "$ac_option" in
423       *=*) ;;
424       *) ac_optarg=yes ;;
425     esac
426     eval "with_${ac_package}='$ac_optarg'" ;;
427
428   -without-* | --without-*)
429     ac_package=`echo $ac_option|sed -e 's/-*without-//'`
430     # Reject names that are not valid shell variable names.
431     if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then
432       { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
433     fi
434     ac_package=`echo $ac_package| sed 's/-/_/g'`
435     eval "with_${ac_package}=no" ;;
436
437   --x)
438     # Obsolete; use --with-x.
439     with_x=yes ;;
440
441   -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
442   | --x-incl | --x-inc | --x-in | --x-i)
443     ac_prev=x_includes ;;
444   -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
445   | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
446     x_includes="$ac_optarg" ;;
447
448   -x-libraries | --x-libraries | --x-librarie | --x-librari \
449   | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
450     ac_prev=x_libraries ;;
451   -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
452   | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
453     x_libraries="$ac_optarg" ;;
454
455   -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; }
456     ;;
457
458   *)
459     if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then
460       echo "configure: warning: $ac_option: invalid host type" 1>&2
461     fi
462     if test "x$nonopt" != xNONE; then
463       { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; }
464     fi
465     nonopt="$ac_option"
466     ;;
467
468   esac
469 done
470
471 if test -n "$ac_prev"; then
472   { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; }
473 fi
474
475 trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
476
477 # File descriptor usage:
478 # 0 standard input
479 # 1 file creation
480 # 2 errors and warnings
481 # 3 some systems may open it to /dev/tty
482 # 4 used on the Kubota Titan
483 # 6 checking for... messages and results
484 # 5 compiler messages saved in config.log
485 if test "$silent" = yes; then
486   exec 6>/dev/null
487 else
488   exec 6>&1
489 fi
490 exec 5>./config.log
491
492 echo "\
493 This file contains any messages produced by compilers while
494 running configure, to aid debugging if configure makes a mistake.
495 " 1>&5
496
497 # Strip out --no-create and --no-recursion so they do not pile up.
498 # Also quote any args containing shell metacharacters.
499 ac_configure_args=
500 for ac_arg
501 do
502   case "$ac_arg" in
503   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
504   | --no-cr | --no-c) ;;
505   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
506   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
507   *" "*|*"      "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*)
508   ac_configure_args="$ac_configure_args '$ac_arg'" ;;
509   *) ac_configure_args="$ac_configure_args $ac_arg" ;;
510   esac
511 done
512
513 # NLS nuisances.
514 # Only set these to C if already set.  These must not be set unconditionally
515 # because not all systems understand e.g. LANG=C (notably SCO).
516 # Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'!
517 # Non-C LC_CTYPE values break the ctype check.
518 if test "${LANG+set}"   = set; then LANG=C;   export LANG;   fi
519 if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
520 if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi
521 if test "${LC_CTYPE+set}"    = set; then LC_CTYPE=C;    export LC_CTYPE;    fi
522
523 # confdefs.h avoids OS command line length limits that DEFS can exceed.
524 rm -rf conftest* confdefs.h
525 # AIX cpp loses on an empty file, so make sure it contains at least a newline.
526 echo > confdefs.h
527
528 # A filename unique to this package, relative to the directory that
529 # configure is in, which we can look for to find out if srcdir is correct.
530 ac_unique_file=ncurses/base/lib_initscr.c
531
532 # Find the source files, if location was not specified.
533 if test -z "$srcdir"; then
534   ac_srcdir_defaulted=yes
535   # Try the directory containing this script, then its parent.
536   ac_prog=$0
537   ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'`
538   test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
539   srcdir=$ac_confdir
540   if test ! -r $srcdir/$ac_unique_file; then
541     srcdir=..
542   fi
543 else
544   ac_srcdir_defaulted=no
545 fi
546 if test ! -r $srcdir/$ac_unique_file; then
547   if test "$ac_srcdir_defaulted" = yes; then
548     { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; }
549   else
550     { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; }
551   fi
552 fi
553 srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'`
554
555 # Prefer explicitly selected file to automatically selected ones.
556 if test -z "$CONFIG_SITE"; then
557   if test "x$prefix" != xNONE; then
558     CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
559   else
560     CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
561   fi
562 fi
563 for ac_site_file in $CONFIG_SITE; do
564   if test -r "$ac_site_file"; then
565     echo "loading site script $ac_site_file"
566     . "$ac_site_file"
567   fi
568 done
569
570 if test -r "$cache_file"; then
571   echo "loading cache $cache_file"
572   . $cache_file
573 else
574   echo "creating cache $cache_file"
575   > $cache_file
576 fi
577
578 ac_ext=c
579 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
580 ac_cpp='$CPP $CPPFLAGS'
581 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
582 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
583 cross_compiling=$ac_cv_prog_cc_cross
584
585 ac_exeext=
586 ac_objext=o
587 if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
588   # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
589   if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
590     ac_n= ac_c='
591 ' ac_t='        '
592   else
593     ac_n=-n ac_c= ac_t=
594   fi
595 else
596   ac_n= ac_c='\c' ac_t=
597 fi
598
599
600
601
602
603 NCURSES_MAJOR="`egrep '^NCURSES_MAJOR[  ]*=' $srcdir/dist.mk | sed -e 's/^[^0-9]*//'`"
604 NCURSES_MINOR="`egrep '^NCURSES_MINOR[  ]*=' $srcdir/dist.mk | sed -e 's/^[^0-9]*//'`"
605 NCURSES_PATCH="`egrep '^NCURSES_PATCH[  ]*=' $srcdir/dist.mk | sed -e 's/^[^0-9]*//'`"
606 cf_cv_abi_version=${NCURSES_MAJOR}
607 cf_cv_rel_version=${NCURSES_MAJOR}.${NCURSES_MINOR}
608 echo "$ac_t""Configuring NCURSES $cf_cv_rel_version ABI $cf_cv_abi_version (`date`)" 1>&6
609
610
611
612
613
614
615
616
617 ac_aux_dir=
618 for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
619   if test -f $ac_dir/install-sh; then
620     ac_aux_dir=$ac_dir
621     ac_install_sh="$ac_aux_dir/install-sh -c"
622     break
623   elif test -f $ac_dir/install.sh; then
624     ac_aux_dir=$ac_dir
625     ac_install_sh="$ac_aux_dir/install.sh -c"
626     break
627   fi
628 done
629 if test -z "$ac_aux_dir"; then
630   { echo "configure: error: can not find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." 1>&2; exit 1; }
631 fi
632 ac_config_guess=$ac_aux_dir/config.guess
633 ac_config_sub=$ac_aux_dir/config.sub
634 ac_configure=$ac_aux_dir/configure # This should be Cygnus configure.
635
636
637 if test -f $srcdir/config.guess ; then
638         
639 # Make sure we can run config.sub.
640 if ${CONFIG_SHELL-/bin/sh} $ac_config_sub sun4 >/dev/null 2>&1; then :
641 else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
642 fi
643
644 echo $ac_n "checking host system type""... $ac_c" 1>&6
645 echo "configure:646: checking host system type" >&5
646
647 host_alias=$host
648 case "$host_alias" in
649 NONE)
650   case $nonopt in
651   NONE)
652     if host_alias=`${CONFIG_SHELL-/bin/sh} $ac_config_guess`; then :
653     else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; }
654     fi ;;
655   *) host_alias=$nonopt ;;
656   esac ;;
657 esac
658
659 host=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $host_alias`
660 host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
661 host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
662 host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
663 echo "$ac_t""$host" 1>&6
664
665         system_name="$host_os"
666 else
667         system_name="`(uname -s -r) 2>/dev/null`"
668         if test -z "$system_name" ; then
669                 system_name="`(hostname) 2>/dev/null`"
670         fi
671 fi
672 test -n "$system_name" && cat >> confdefs.h <<EOF
673 #define SYSTEM_NAME "$system_name"
674 EOF
675
676 if eval "test \"`echo '$''{'cf_cv_system_name'+set}'`\" = set"; then
677   echo $ac_n "(cached) $ac_c" 1>&6
678 else
679   cf_cv_system_name="$system_name"
680 fi
681
682
683 test -z "$system_name" && system_name="$cf_cv_system_name"
684 test -n "$cf_cv_system_name" && echo "$ac_t"""Configuring for $cf_cv_system_name"" 1>&6
685
686 if test ".$system_name" != ".$cf_cv_system_name" ; then
687         echo "$ac_t""Cached system name ($system_name) does not agree with actual ($cf_cv_system_name)" 1>&6
688         { echo "configure: error: "Please remove config.cache and try again."" 1>&2; exit 1; }
689 fi
690
691
692 # Check whether --with-system-type or --without-system-type was given.
693 if test "${with_system_type+set}" = set; then
694   withval="$with_system_type"
695   echo "configure: warning: overriding system type to $withval" 1>&2
696  cf_cv_system_name=$withval
697 fi
698
699
700 # We need a configure script only when compiling as part of GNU C library.
701 # Here we have to generate one of the files we need while compiling.
702 #
703 # The only problem is that users of the package might think they have to
704 # run configure themself and find it irritating when nothing happens.
705 #
706 # So we try here to find out whether we are called from the glibc configure
707 # or by a user.
708 #
709
710 # Check whether --enable-add-ons or --disable-add-ons was given.
711 if test "${enable_add_ons+set}" = set; then
712   enableval="$enable_add_ons"
713   glibc_add_on=yes
714 else
715   glibc_add_on=
716 fi
717
718
719 if test x"$glibc_add_on" = "xyes" ; then
720   rm -f $srcdir/Banner
721   # We are in glibc.
722   rm -f $srcdir/Makefile
723   cp $srcdir/Makefile.glibc $srcdir/Makefile
724   echo "ncurses `grep \"^[      ]*ncurses-version[      ]*=.*$\" \
725                 $srcdir/Makefile | sed -e \
726                 's/^[   ]*ncurses-version[      ]*=[    ]*\([^  ^ ]*\)[         ]*$/\1/'`" > $srcdir/Banner
727   exit 0
728 fi
729
730 ###     Save the given $CFLAGS to allow user-override.
731 cf_user_CFLAGS="$CFLAGS"
732
733 ###     Default install-location
734
735 echo $ac_n "checking for prefix""... $ac_c" 1>&6
736 echo "configure:737: checking for prefix" >&5
737 if test "x$prefix" = "xNONE" ; then
738         case "$cf_cv_system_name" in
739                 # non-vendor systems don't have a conflict
740         openbsd*|netbsd*|freebsd*|linux*)
741                 prefix=/usr
742                 ;;
743         *)      prefix=$ac_default_prefix
744                 ;;
745         esac
746 fi
747 echo "$ac_t""$prefix" 1>&6
748
749 if test "x$prefix" = "xNONE" ; then
750 echo $ac_n "checking for default include-directory""... $ac_c" 1>&6
751 echo "configure:752: checking for default include-directory" >&5
752 test -n "$verbose" && echo 1>&6
753 for cf_symbol in \
754         $includedir \
755         $includedir/ncurses \
756         $prefix/include \
757         $prefix/include/ncurses \
758         /usr/local/include \
759         /usr/local/include/ncurses \
760         /usr/include \
761         /usr/include/ncurses
762 do
763         cf_dir=`eval echo $cf_symbol`
764         if test -f $cf_dir/curses.h ; then
765         if ( fgrep NCURSES_VERSION $cf_dir/curses.h 2>&1 >/dev/null ) ; then
766                 includedir="$cf_symbol"
767                 test -n "$verbose"  && echo $ac_n "     found " 1>&6
768                 break
769         fi
770         fi
771         test -n "$verbose"  && echo "   tested $cf_dir" 1>&6
772 done
773 echo "$ac_t""$includedir" 1>&6
774 fi
775
776
777 ###     Checks for programs.
778 # Extract the first word of "gcc", so it can be a program name with args.
779 set dummy gcc; ac_word=$2
780 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
781 echo "configure:782: checking for $ac_word" >&5
782 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
783   echo $ac_n "(cached) $ac_c" 1>&6
784 else
785   if test -n "$CC"; then
786   ac_cv_prog_CC="$CC" # Let the user override the test.
787 else
788   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
789   ac_dummy="$PATH"
790   for ac_dir in $ac_dummy; do
791     test -z "$ac_dir" && ac_dir=.
792     if test -f $ac_dir/$ac_word; then
793       ac_cv_prog_CC="gcc"
794       break
795     fi
796   done
797   IFS="$ac_save_ifs"
798 fi
799 fi
800 CC="$ac_cv_prog_CC"
801 if test -n "$CC"; then
802   echo "$ac_t""$CC" 1>&6
803 else
804   echo "$ac_t""no" 1>&6
805 fi
806
807 if test -z "$CC"; then
808   # Extract the first word of "cc", so it can be a program name with args.
809 set dummy cc; ac_word=$2
810 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
811 echo "configure:812: checking for $ac_word" >&5
812 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
813   echo $ac_n "(cached) $ac_c" 1>&6
814 else
815   if test -n "$CC"; then
816   ac_cv_prog_CC="$CC" # Let the user override the test.
817 else
818   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
819   ac_prog_rejected=no
820   ac_dummy="$PATH"
821   for ac_dir in $ac_dummy; do
822     test -z "$ac_dir" && ac_dir=.
823     if test -f $ac_dir/$ac_word; then
824       if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
825         ac_prog_rejected=yes
826         continue
827       fi
828       ac_cv_prog_CC="cc"
829       break
830     fi
831   done
832   IFS="$ac_save_ifs"
833 if test $ac_prog_rejected = yes; then
834   # We found a bogon in the path, so make sure we never use it.
835   set dummy $ac_cv_prog_CC
836   shift
837   if test $# -gt 0; then
838     # We chose a different compiler from the bogus one.
839     # However, it has the same basename, so the bogon will be chosen
840     # first if we set CC to just the basename; use the full file name.
841     shift
842     set dummy "$ac_dir/$ac_word" "$@"
843     shift
844     ac_cv_prog_CC="$@"
845   fi
846 fi
847 fi
848 fi
849 CC="$ac_cv_prog_CC"
850 if test -n "$CC"; then
851   echo "$ac_t""$CC" 1>&6
852 else
853   echo "$ac_t""no" 1>&6
854 fi
855
856   if test -z "$CC"; then
857     case "`uname -s`" in
858     *win32* | *WIN32*)
859       # Extract the first word of "cl", so it can be a program name with args.
860 set dummy cl; ac_word=$2
861 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
862 echo "configure:863: checking for $ac_word" >&5
863 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
864   echo $ac_n "(cached) $ac_c" 1>&6
865 else
866   if test -n "$CC"; then
867   ac_cv_prog_CC="$CC" # Let the user override the test.
868 else
869   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
870   ac_dummy="$PATH"
871   for ac_dir in $ac_dummy; do
872     test -z "$ac_dir" && ac_dir=.
873     if test -f $ac_dir/$ac_word; then
874       ac_cv_prog_CC="cl"
875       break
876     fi
877   done
878   IFS="$ac_save_ifs"
879 fi
880 fi
881 CC="$ac_cv_prog_CC"
882 if test -n "$CC"; then
883   echo "$ac_t""$CC" 1>&6
884 else
885   echo "$ac_t""no" 1>&6
886 fi
887  ;;
888     esac
889   fi
890   test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
891 fi
892
893 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
894 echo "configure:895: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
895
896 ac_ext=c
897 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
898 ac_cpp='$CPP $CPPFLAGS'
899 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
900 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
901 cross_compiling=$ac_cv_prog_cc_cross
902
903 cat > conftest.$ac_ext << EOF
904
905 #line 906 "configure"
906 #include "confdefs.h"
907
908 main(){return(0);}
909 EOF
910 if { (eval echo configure:911: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
911   ac_cv_prog_cc_works=yes
912   # If we can't run a trivial program, we are probably using a cross compiler.
913   if (./conftest; exit) 2>/dev/null; then
914     ac_cv_prog_cc_cross=no
915   else
916     ac_cv_prog_cc_cross=yes
917   fi
918 else
919   echo "configure: failed program was:" >&5
920   cat conftest.$ac_ext >&5
921   ac_cv_prog_cc_works=no
922 fi
923 rm -fr conftest*
924 ac_ext=c
925 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
926 ac_cpp='$CPP $CPPFLAGS'
927 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
928 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
929 cross_compiling=$ac_cv_prog_cc_cross
930
931 echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
932 if test $ac_cv_prog_cc_works = no; then
933   { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
934 fi
935 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
936 echo "configure:937: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
937 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
938 cross_compiling=$ac_cv_prog_cc_cross
939
940 echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
941 echo "configure:942: checking whether we are using GNU C" >&5
942 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
943   echo $ac_n "(cached) $ac_c" 1>&6
944 else
945   cat > conftest.c <<EOF
946 #ifdef __GNUC__
947   yes;
948 #endif
949 EOF
950 if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:951: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
951   ac_cv_prog_gcc=yes
952 else
953   ac_cv_prog_gcc=no
954 fi
955 fi
956
957 echo "$ac_t""$ac_cv_prog_gcc" 1>&6
958
959 if test $ac_cv_prog_gcc = yes; then
960   GCC=yes
961 else
962   GCC=
963 fi
964
965 ac_test_CFLAGS="${CFLAGS+set}"
966 ac_save_CFLAGS="$CFLAGS"
967 CFLAGS=
968 echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
969 echo "configure:970: checking whether ${CC-cc} accepts -g" >&5
970 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
971   echo $ac_n "(cached) $ac_c" 1>&6
972 else
973   echo 'void f(){}' > conftest.c
974 if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
975   ac_cv_prog_cc_g=yes
976 else
977   ac_cv_prog_cc_g=no
978 fi
979 rm -f conftest*
980
981 fi
982
983 echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
984 if test "$ac_test_CFLAGS" = set; then
985   CFLAGS="$ac_save_CFLAGS"
986 elif test $ac_cv_prog_cc_g = yes; then
987   if test "$GCC" = yes; then
988     CFLAGS="-g -O2"
989   else
990     CFLAGS="-g"
991   fi
992 else
993   if test "$GCC" = yes; then
994     CFLAGS="-O2"
995   else
996     CFLAGS=
997   fi
998 fi
999
1000 if test -n "$GCC" ; then
1001 echo $ac_n "checking version of gcc""... $ac_c" 1>&6
1002 echo "configure:1003: checking version of gcc" >&5
1003 eval "$CC --version"
1004 fi
1005 if test $host != $build; then
1006   for ac_prog in $CC gcc cc
1007 do
1008 # Extract the first word of "$ac_prog", so it can be a program name with args.
1009 set dummy $ac_prog; ac_word=$2
1010 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1011 echo "configure:1012: checking for $ac_word" >&5
1012 if eval "test \"`echo '$''{'ac_cv_prog_BUILD_CC'+set}'`\" = set"; then
1013   echo $ac_n "(cached) $ac_c" 1>&6
1014 else
1015   if test -n "$BUILD_CC"; then
1016   ac_cv_prog_BUILD_CC="$BUILD_CC" # Let the user override the test.
1017 else
1018   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
1019   ac_dummy="$PATH"
1020   for ac_dir in $ac_dummy; do
1021     test -z "$ac_dir" && ac_dir=.
1022     if test -f $ac_dir/$ac_word; then
1023       ac_cv_prog_BUILD_CC="$ac_prog"
1024       break
1025     fi
1026   done
1027   IFS="$ac_save_ifs"
1028 fi
1029 fi
1030 BUILD_CC="$ac_cv_prog_BUILD_CC"
1031 if test -n "$BUILD_CC"; then
1032   echo "$ac_t""$BUILD_CC" 1>&6
1033 else
1034   echo "$ac_t""no" 1>&6
1035 fi
1036
1037 test -n "$BUILD_CC" && break
1038 done
1039
1040 fi
1041 echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
1042 echo "configure:1043: checking how to run the C preprocessor" >&5
1043 # On Suns, sometimes $CPP names a directory.
1044 if test -n "$CPP" && test -d "$CPP"; then
1045   CPP=
1046 fi
1047 if test -z "$CPP"; then
1048 if eval "test \"`echo '$''{'ac_cv_prog_CPP'+set}'`\" = set"; then
1049   echo $ac_n "(cached) $ac_c" 1>&6
1050 else
1051     # This must be in double quotes, not single quotes, because CPP may get
1052   # substituted into the Makefile and "${CC-cc}" will confuse make.
1053   CPP="${CC-cc} -E"
1054   # On the NeXT, cc -E runs the code through the compiler's parser,
1055   # not just through cpp.
1056   cat > conftest.$ac_ext <<EOF
1057 #line 1058 "configure"
1058 #include "confdefs.h"
1059 #include <assert.h>
1060 Syntax Error
1061 EOF
1062 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
1063 { (eval echo configure:1064: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
1064 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
1065 if test -z "$ac_err"; then
1066   :
1067 else
1068   echo "$ac_err" >&5
1069   echo "configure: failed program was:" >&5
1070   cat conftest.$ac_ext >&5
1071   rm -rf conftest*
1072   CPP="${CC-cc} -E -traditional-cpp"
1073   cat > conftest.$ac_ext <<EOF
1074 #line 1075 "configure"
1075 #include "confdefs.h"
1076 #include <assert.h>
1077 Syntax Error
1078 EOF
1079 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
1080 { (eval echo configure:1081: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
1081 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
1082 if test -z "$ac_err"; then
1083   :
1084 else
1085   echo "$ac_err" >&5
1086   echo "configure: failed program was:" >&5
1087   cat conftest.$ac_ext >&5
1088   rm -rf conftest*
1089   CPP="${CC-cc} -nologo -E"
1090   cat > conftest.$ac_ext <<EOF
1091 #line 1092 "configure"
1092 #include "confdefs.h"
1093 #include <assert.h>
1094 Syntax Error
1095 EOF
1096 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
1097 { (eval echo configure:1098: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
1098 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
1099 if test -z "$ac_err"; then
1100   :
1101 else
1102   echo "$ac_err" >&5
1103   echo "configure: failed program was:" >&5
1104   cat conftest.$ac_ext >&5
1105   rm -rf conftest*
1106   CPP=/lib/cpp
1107 fi
1108 rm -f conftest*
1109 fi
1110 rm -f conftest*
1111 fi
1112 rm -f conftest*
1113   ac_cv_prog_CPP="$CPP"
1114 fi
1115   CPP="$ac_cv_prog_CPP"
1116 else
1117   ac_cv_prog_CPP="$CPP"
1118 fi
1119 echo "$ac_t""$CPP" 1>&6
1120
1121 if test $ac_cv_prog_gcc = yes; then
1122     echo $ac_n "checking whether ${CC-cc} needs -traditional""... $ac_c" 1>&6
1123 echo "configure:1124: checking whether ${CC-cc} needs -traditional" >&5
1124 if eval "test \"`echo '$''{'ac_cv_prog_gcc_traditional'+set}'`\" = set"; then
1125   echo $ac_n "(cached) $ac_c" 1>&6
1126 else
1127     ac_pattern="Autoconf.*'x'"
1128   cat > conftest.$ac_ext <<EOF
1129 #line 1130 "configure"
1130 #include "confdefs.h"
1131 #include <sgtty.h>
1132 Autoconf TIOCGETP
1133 EOF
1134 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
1135   egrep "$ac_pattern" >/dev/null 2>&1; then
1136   rm -rf conftest*
1137   ac_cv_prog_gcc_traditional=yes
1138 else
1139   rm -rf conftest*
1140   ac_cv_prog_gcc_traditional=no
1141 fi
1142 rm -f conftest*
1143
1144
1145   if test $ac_cv_prog_gcc_traditional = no; then
1146     cat > conftest.$ac_ext <<EOF
1147 #line 1148 "configure"
1148 #include "confdefs.h"
1149 #include <termio.h>
1150 Autoconf TCGETA
1151 EOF
1152 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
1153   egrep "$ac_pattern" >/dev/null 2>&1; then
1154   rm -rf conftest*
1155   ac_cv_prog_gcc_traditional=yes
1156 fi
1157 rm -f conftest*
1158
1159   fi
1160 fi
1161
1162 echo "$ac_t""$ac_cv_prog_gcc_traditional" 1>&6
1163   if test $ac_cv_prog_gcc_traditional = yes; then
1164     CC="$CC -traditional"
1165   fi
1166 fi
1167
1168 echo $ac_n "checking for POSIXized ISC""... $ac_c" 1>&6
1169 echo "configure:1170: checking for POSIXized ISC" >&5
1170 if test -d /etc/conf/kconfig.d &&
1171   grep _POSIX_VERSION /usr/include/sys/unistd.h >/dev/null 2>&1
1172 then
1173   echo "$ac_t""yes" 1>&6
1174   ISC=yes # If later tests want to check for ISC.
1175   cat >> confdefs.h <<\EOF
1176 #define _POSIX_SOURCE 1
1177 EOF
1178
1179   if test "$GCC" = yes; then
1180     CC="$CC -posix"
1181   else
1182     CC="$CC -Xp"
1183   fi
1184 else
1185   echo "$ac_t""no" 1>&6
1186   ISC=
1187 fi
1188
1189
1190 echo $ac_n "checking for ${CC-cc} option to accept ANSI C""... $ac_c" 1>&6
1191 echo "configure:1192: checking for ${CC-cc} option to accept ANSI C" >&5
1192 if eval "test \"`echo '$''{'cf_cv_ansi_cc'+set}'`\" = set"; then
1193   echo $ac_n "(cached) $ac_c" 1>&6
1194 else
1195   
1196 cf_cv_ansi_cc=no
1197 cf_save_CFLAGS="$CFLAGS"
1198 # Don't try gcc -ansi; that turns off useful extensions and
1199 # breaks some systems' header files.
1200 # AIX                   -qlanglvl=ansi
1201 # Ultrix and OSF/1      -std1
1202 # HP-UX                 -Aa -D_HPUX_SOURCE
1203 # SVR4                  -Xc
1204 # UnixWare 1.2          (cannot use -Xc, since ANSI/POSIX clashes)
1205 for cf_arg in "-DCC_HAS_PROTOS" \
1206         "" \
1207         -qlanglvl=ansi \
1208         -std1 \
1209         -Ae \
1210         "-Aa -D_HPUX_SOURCE" \
1211         -Xc
1212 do
1213         CFLAGS="$cf_save_CFLAGS $cf_arg"
1214         cat > conftest.$ac_ext <<EOF
1215 #line 1216 "configure"
1216 #include "confdefs.h"
1217
1218 #ifndef CC_HAS_PROTOS
1219 #if !defined(__STDC__) || (__STDC__ != 1)
1220 choke me
1221 #endif
1222 #endif
1223
1224 int main() {
1225
1226         int test (int i, double x);
1227         struct s1 {int (*f) (int a);};
1228         struct s2 {int (*f) (double a);};
1229 ; return 0; }
1230 EOF
1231 if { (eval echo configure:1232: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
1232   rm -rf conftest*
1233   cf_cv_ansi_cc="$cf_arg"; break
1234 else
1235   echo "configure: failed program was:" >&5
1236   cat conftest.$ac_ext >&5
1237 fi
1238 rm -f conftest*
1239 done
1240 CFLAGS="$cf_save_CFLAGS"
1241
1242 fi
1243
1244 echo "$ac_t""$cf_cv_ansi_cc" 1>&6
1245
1246 if test "$cf_cv_ansi_cc" != "no"; then
1247 if test ".$cf_cv_ansi_cc" != ".-DCC_HAS_PROTOS"; then
1248         CFLAGS="$CFLAGS $cf_cv_ansi_cc"
1249 else
1250         cat >> confdefs.h <<\EOF
1251 #define CC_HAS_PROTOS 1
1252 EOF
1253
1254 fi
1255 fi
1256
1257
1258 if test "$cf_cv_ansi_cc" = "no"; then
1259         { echo "configure: error: Your compiler does not appear to recognize prototypes.
1260 You have the following choices:
1261         a. adjust your compiler options
1262         b. get an up-to-date compiler
1263         c. use a wrapper such as unproto" 1>&2; exit 1; }
1264 fi
1265
1266
1267
1268 PROG_EXT=
1269 case $cf_cv_system_name in
1270 os2*)
1271     # We make sure -Zexe is not used -- it would interfere with @PROG_EXT@
1272     CFLAGS="$CFLAGS -Zmt -D__ST_MT_ERRNO__"
1273     CXXFLAGS="$CXXFLAGS -Zmt -D__ST_MT_ERRNO__"
1274     LDFLAGS=`echo "$LDFLAGS -Zmt -Zcrtdll" | sed "s/-Zexe//g"`
1275     PROG_EXT=".exe"
1276     ;;
1277 cygwin*)
1278     PROG_EXT=".exe"
1279     ;;
1280 esac
1281
1282
1283
1284 case "$cf_cv_system_name" in
1285 freebsd*) #(vi
1286   test -z "$LDCONFIG" && LDCONFIG="/sbin/ldconfig -R"
1287   ;;
1288 *) LDPATH=$PATH:/sbin:/usr/sbin
1289   # Extract the first word of "ldconfig", so it can be a program name with args.
1290 set dummy ldconfig; ac_word=$2
1291 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1292 echo "configure:1293: checking for $ac_word" >&5
1293 if eval "test \"`echo '$''{'ac_cv_path_LDCONFIG'+set}'`\" = set"; then
1294   echo $ac_n "(cached) $ac_c" 1>&6
1295 else
1296   case "$LDCONFIG" in
1297   /*)
1298   ac_cv_path_LDCONFIG="$LDCONFIG" # Let the user override the test with a path.
1299   ;;
1300   ?:/*)                  
1301   ac_cv_path_LDCONFIG="$LDCONFIG" # Let the user override the test with a dos path.
1302   ;;
1303   *)
1304   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
1305   ac_dummy="$LDPATH"
1306   for ac_dir in $ac_dummy; do 
1307     test -z "$ac_dir" && ac_dir=.
1308     if test -f $ac_dir/$ac_word; then
1309       ac_cv_path_LDCONFIG="$ac_dir/$ac_word"
1310       break
1311     fi
1312   done
1313   IFS="$ac_save_ifs"
1314   ;;
1315 esac
1316 fi
1317 LDCONFIG="$ac_cv_path_LDCONFIG"
1318 if test -n "$LDCONFIG"; then
1319   echo "$ac_t""$LDCONFIG" 1>&6
1320 else
1321   echo "$ac_t""no" 1>&6
1322 fi
1323
1324   ;;
1325 esac
1326
1327
1328 echo $ac_n "checking if you want to ensure bool is consistent with C++""... $ac_c" 1>&6
1329 echo "configure:1330: checking if you want to ensure bool is consistent with C++" >&5
1330
1331 # Check whether --with-cxx or --without-cxx was given.
1332 if test "${with_cxx+set}" = set; then
1333   withval="$with_cxx"
1334   cf_with_cxx=$withval
1335 else
1336   cf_with_cxx=yes
1337 fi
1338
1339 echo "$ac_t""$cf_with_cxx" 1>&6
1340 if test "X$cf_with_cxx" = Xno ; then
1341         CXX=""
1342         GXX=""
1343 else
1344                 for ac_prog in $CCC c++ g++ gcc CC cxx cc++ cl
1345 do
1346 # Extract the first word of "$ac_prog", so it can be a program name with args.
1347 set dummy $ac_prog; ac_word=$2
1348 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1349 echo "configure:1350: checking for $ac_word" >&5
1350 if eval "test \"`echo '$''{'ac_cv_prog_CXX'+set}'`\" = set"; then
1351   echo $ac_n "(cached) $ac_c" 1>&6
1352 else
1353   if test -n "$CXX"; then
1354   ac_cv_prog_CXX="$CXX" # Let the user override the test.
1355 else
1356   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
1357   ac_dummy="$PATH"
1358   for ac_dir in $ac_dummy; do
1359     test -z "$ac_dir" && ac_dir=.
1360     if test -f $ac_dir/$ac_word; then
1361       ac_cv_prog_CXX="$ac_prog"
1362       break
1363     fi
1364   done
1365   IFS="$ac_save_ifs"
1366 fi
1367 fi
1368 CXX="$ac_cv_prog_CXX"
1369 if test -n "$CXX"; then
1370   echo "$ac_t""$CXX" 1>&6
1371 else
1372   echo "$ac_t""no" 1>&6
1373 fi
1374
1375 test -n "$CXX" && break
1376 done
1377 test -n "$CXX" || CXX="gcc"
1378
1379
1380 echo $ac_n "checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works""... $ac_c" 1>&6
1381 echo "configure:1382: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works" >&5
1382
1383 ac_ext=C
1384 # CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
1385 ac_cpp='$CXXCPP $CPPFLAGS'
1386 ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
1387 ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
1388 cross_compiling=$ac_cv_prog_cxx_cross
1389
1390 cat > conftest.$ac_ext << EOF
1391
1392 #line 1393 "configure"
1393 #include "confdefs.h"
1394
1395 int main(){return(0);}
1396 EOF
1397 if { (eval echo configure:1398: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
1398   ac_cv_prog_cxx_works=yes
1399   # If we can't run a trivial program, we are probably using a cross compiler.
1400   if (./conftest; exit) 2>/dev/null; then
1401     ac_cv_prog_cxx_cross=no
1402   else
1403     ac_cv_prog_cxx_cross=yes
1404   fi
1405 else
1406   echo "configure: failed program was:" >&5
1407   cat conftest.$ac_ext >&5
1408   ac_cv_prog_cxx_works=no
1409 fi
1410 rm -fr conftest*
1411 ac_ext=c
1412 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
1413 ac_cpp='$CPP $CPPFLAGS'
1414 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
1415 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
1416 cross_compiling=$ac_cv_prog_cc_cross
1417
1418 echo "$ac_t""$ac_cv_prog_cxx_works" 1>&6
1419 if test $ac_cv_prog_cxx_works = no; then
1420   echo "$ac_t""You don't have any C++ compiler, too bad" 1>&6;          cf_with_cxx=no; CXX=""; GXX="";
1421 fi
1422 echo $ac_n "checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
1423 echo "configure:1424: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler" >&5
1424 echo "$ac_t""$ac_cv_prog_cxx_cross" 1>&6
1425 cross_compiling=$ac_cv_prog_cxx_cross
1426
1427 echo $ac_n "checking whether we are using GNU C++""... $ac_c" 1>&6
1428 echo "configure:1429: checking whether we are using GNU C++" >&5
1429 if eval "test \"`echo '$''{'ac_cv_prog_gxx'+set}'`\" = set"; then
1430   echo $ac_n "(cached) $ac_c" 1>&6
1431 else
1432   cat > conftest.C <<EOF
1433 #ifdef __GNUC__
1434   yes;
1435 #endif
1436 EOF
1437 if { ac_try='${CXX-g++} -E conftest.C'; { (eval echo configure:1438: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
1438   ac_cv_prog_gxx=yes
1439 else
1440   ac_cv_prog_gxx=no
1441 fi
1442 fi
1443
1444 echo "$ac_t""$ac_cv_prog_gxx" 1>&6
1445
1446 if test $ac_cv_prog_gxx = yes; then
1447   GXX=yes
1448 else
1449   GXX=
1450 fi
1451
1452 ac_test_CXXFLAGS="${CXXFLAGS+set}"
1453 ac_save_CXXFLAGS="$CXXFLAGS"
1454 CXXFLAGS=
1455 echo $ac_n "checking whether ${CXX-g++} accepts -g""... $ac_c" 1>&6
1456 echo "configure:1457: checking whether ${CXX-g++} accepts -g" >&5
1457 if eval "test \"`echo '$''{'ac_cv_prog_cxx_g'+set}'`\" = set"; then
1458   echo $ac_n "(cached) $ac_c" 1>&6
1459 else
1460   echo 'void f(){}' > conftest.cc
1461 if test -z "`${CXX-g++} -g -c conftest.cc 2>&1`"; then
1462   ac_cv_prog_cxx_g=yes
1463 else
1464   ac_cv_prog_cxx_g=no
1465 fi
1466 rm -f conftest*
1467
1468 fi
1469
1470 echo "$ac_t""$ac_cv_prog_cxx_g" 1>&6
1471 if test "$ac_test_CXXFLAGS" = set; then
1472   CXXFLAGS="$ac_save_CXXFLAGS"
1473 elif test $ac_cv_prog_cxx_g = yes; then
1474   if test "$GXX" = yes; then
1475     CXXFLAGS="-g -O2"
1476   else
1477     CXXFLAGS="-g"
1478   fi
1479 else
1480   if test "$GXX" = yes; then
1481     CXXFLAGS="-O2"
1482   else
1483     CXXFLAGS=
1484   fi
1485 fi
1486
1487         fi
1488 if test -n "$GXX" ; then case "`${CXX-g++} --version`" in 1*|2.[0-6]*) GXX=""; CXX=""; ac_cv_prog_gxx=no; cf_cxx_library=no ; echo No: templates do not work;; esac; fi
1489
1490 echo $ac_n "checking if you want to build C++ binding and demo""... $ac_c" 1>&6
1491 echo "configure:1492: checking if you want to build C++ binding and demo" >&5
1492
1493 # Check whether --with-cxx-binding or --without-cxx-binding was given.
1494 if test "${with_cxx_binding+set}" = set; then
1495   withval="$with_cxx_binding"
1496   cf_with_cxx_binding=$withval
1497 else
1498   cf_with_cxx_binding=$cf_with_cxx
1499 fi
1500
1501 echo "$ac_t""$cf_with_cxx_binding" 1>&6
1502
1503 echo $ac_n "checking if you want to build with Ada95""... $ac_c" 1>&6
1504 echo "configure:1505: checking if you want to build with Ada95" >&5
1505
1506 # Check whether --with-ada or --without-ada was given.
1507 if test "${with_ada+set}" = set; then
1508   withval="$with_ada"
1509   cf_with_ada=$withval
1510 else
1511   cf_with_ada=yes
1512 fi
1513
1514 echo "$ac_t""$cf_with_ada" 1>&6
1515
1516 echo $ac_n "checking if you want to build programs such as tic""... $ac_c" 1>&6
1517 echo "configure:1518: checking if you want to build programs such as tic" >&5
1518
1519 # Check whether --with-progs or --without-progs was given.
1520 if test "${with_progs+set}" = set; then
1521   withval="$with_progs"
1522   cf_with_progs=$withval
1523 else
1524   cf_with_progs=yes
1525 fi
1526
1527 echo "$ac_t""$cf_with_progs" 1>&6
1528
1529 modules_to_build="ncurses"
1530 if test "X$cf_with_progs" != Xno ; then
1531 modules_to_build="$modules_to_build progs tack"
1532 fi
1533 modules_to_build="$modules_to_build panel menu form"
1534
1535 for ac_prog in mawk gawk nawk awk
1536 do
1537 # Extract the first word of "$ac_prog", so it can be a program name with args.
1538 set dummy $ac_prog; ac_word=$2
1539 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1540 echo "configure:1541: checking for $ac_word" >&5
1541 if eval "test \"`echo '$''{'ac_cv_prog_AWK'+set}'`\" = set"; then
1542   echo $ac_n "(cached) $ac_c" 1>&6
1543 else
1544   if test -n "$AWK"; then
1545   ac_cv_prog_AWK="$AWK" # Let the user override the test.
1546 else
1547   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
1548   ac_dummy="$PATH"
1549   for ac_dir in $ac_dummy; do
1550     test -z "$ac_dir" && ac_dir=.
1551     if test -f $ac_dir/$ac_word; then
1552       ac_cv_prog_AWK="$ac_prog"
1553       break
1554     fi
1555   done
1556   IFS="$ac_save_ifs"
1557 fi
1558 fi
1559 AWK="$ac_cv_prog_AWK"
1560 if test -n "$AWK"; then
1561   echo "$ac_t""$AWK" 1>&6
1562 else
1563   echo "$ac_t""no" 1>&6
1564 fi
1565
1566 test -n "$AWK" && break
1567 done
1568
1569 echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
1570 echo "configure:1571: checking whether ${MAKE-make} sets \${MAKE}" >&5
1571 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
1572 if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then
1573   echo $ac_n "(cached) $ac_c" 1>&6
1574 else
1575   cat > conftestmake <<\EOF
1576 all:
1577         @echo 'ac_maketemp="${MAKE}"'
1578 EOF
1579 # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
1580 eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=`
1581 if test -n "$ac_maketemp"; then
1582   eval ac_cv_prog_make_${ac_make}_set=yes
1583 else
1584   eval ac_cv_prog_make_${ac_make}_set=no
1585 fi
1586 rm -f conftestmake
1587 fi
1588 if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
1589   echo "$ac_t""yes" 1>&6
1590   SET_MAKE=
1591 else
1592   echo "$ac_t""no" 1>&6
1593   SET_MAKE="MAKE=${MAKE-make}"
1594 fi
1595
1596 # Find a good install program.  We prefer a C program (faster),
1597 # so one script is as good as another.  But avoid the broken or
1598 # incompatible versions:
1599 # SysV /etc/install, /usr/sbin/install
1600 # SunOS /usr/etc/install
1601 # IRIX /sbin/install
1602 # AIX /bin/install
1603 # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
1604 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
1605 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
1606 # ./install, which can be erroneously created by make from ./install.sh.
1607 echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
1608 echo "configure:1609: checking for a BSD compatible install" >&5
1609 if test -z "$INSTALL"; then
1610 if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
1611   echo $ac_n "(cached) $ac_c" 1>&6
1612 else
1613     IFS="${IFS=         }"; ac_save_IFS="$IFS"; IFS=":"
1614   for ac_dir in $PATH; do
1615     # Account for people who put trailing slashes in PATH elements.
1616     case "$ac_dir/" in
1617     /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
1618     *)
1619       # OSF1 and SCO ODT 3.0 have their own names for install.
1620       # Don't use installbsd from OSF since it installs stuff as root
1621       # by default.
1622       for ac_prog in ginstall scoinst install; do
1623         if test -f $ac_dir/$ac_prog; then
1624           if test $ac_prog = install &&
1625             grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then
1626             # AIX install.  It has an incompatible calling convention.
1627             :
1628           else
1629             ac_cv_path_install="$ac_dir/$ac_prog -c"
1630             break 2
1631           fi
1632         fi
1633       done
1634       ;;
1635     esac
1636   done
1637   IFS="$ac_save_IFS"
1638
1639 fi
1640   if test "${ac_cv_path_install+set}" = set; then
1641     INSTALL="$ac_cv_path_install"
1642   else
1643     # As a last resort, use the slow shell script.  We don't cache a
1644     # path for INSTALL within a source directory, because that will
1645     # break other packages using the cache if that directory is
1646     # removed, or if the path is relative.
1647     INSTALL="$ac_install_sh"
1648   fi
1649 fi
1650 echo "$ac_t""$INSTALL" 1>&6
1651
1652 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
1653 # It thinks the first close brace ends the variable substitution.
1654 test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
1655
1656 test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
1657
1658 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
1659
1660 case $INSTALL in
1661 /*)
1662   ;;
1663 *)
1664   cf_dir=`echo $INSTALL|sed -e 's%/[^/]*$%%'`
1665   test -z "$cf_dir" && cf_dir=.
1666   INSTALL=`cd $cf_dir && pwd`/`echo $INSTALL | sed -e 's:^.*/::'`
1667   ;;
1668 esac
1669
1670 echo $ac_n "checking for long file names""... $ac_c" 1>&6
1671 echo "configure:1672: checking for long file names" >&5
1672 if eval "test \"`echo '$''{'ac_cv_sys_long_file_names'+set}'`\" = set"; then
1673   echo $ac_n "(cached) $ac_c" 1>&6
1674 else
1675   ac_cv_sys_long_file_names=yes
1676 # Test for long file names in all the places we know might matter:
1677 #      .                the current directory, where building will happen
1678 #      $prefix/lib      where we will be installing things
1679 #      $exec_prefix/lib likewise
1680 # eval it to expand exec_prefix.
1681 #      $TMPDIR          if set, where it might want to write temporary files
1682 # if $TMPDIR is not set:
1683 #      /tmp             where it might want to write temporary files
1684 #      /var/tmp         likewise
1685 #      /usr/tmp         likewise
1686 if test -n "$TMPDIR" && test -d "$TMPDIR" && test -w "$TMPDIR"; then
1687   ac_tmpdirs="$TMPDIR"
1688 else
1689   ac_tmpdirs='/tmp /var/tmp /usr/tmp'
1690 fi
1691 for ac_dir in  . $ac_tmpdirs `eval echo $prefix/lib $exec_prefix/lib` ; do
1692   test -d $ac_dir || continue
1693   test -w $ac_dir || continue # It is less confusing to not echo anything here.
1694   (echo 1 > $ac_dir/conftest9012345) 2>/dev/null
1695   (echo 2 > $ac_dir/conftest9012346) 2>/dev/null
1696   val=`cat $ac_dir/conftest9012345 2>/dev/null`
1697   if test ! -f $ac_dir/conftest9012345 || test "$val" != 1; then
1698     ac_cv_sys_long_file_names=no
1699     rm -f $ac_dir/conftest9012345 $ac_dir/conftest9012346 2>/dev/null
1700     break
1701   fi
1702   rm -f $ac_dir/conftest9012345 $ac_dir/conftest9012346 2>/dev/null
1703 done
1704 fi
1705
1706 echo "$ac_t""$ac_cv_sys_long_file_names" 1>&6
1707 if test $ac_cv_sys_long_file_names = yes; then
1708   cat >> confdefs.h <<\EOF
1709 #define HAVE_LONG_FILE_NAMES 1
1710 EOF
1711
1712 fi
1713
1714 echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
1715 echo "configure:1716: checking whether ln -s works" >&5
1716 if eval "test \"`echo '$''{'ac_cv_prog_LN_S'+set}'`\" = set"; then
1717   echo $ac_n "(cached) $ac_c" 1>&6
1718 else
1719   rm -f conftestdata
1720 if ln -s X conftestdata 2>/dev/null
1721 then
1722   rm -f conftestdata
1723   ac_cv_prog_LN_S="ln -s"
1724 else
1725   ac_cv_prog_LN_S=ln
1726 fi
1727 fi
1728 LN_S="$ac_cv_prog_LN_S"
1729 if test "$ac_cv_prog_LN_S" = "ln -s"; then
1730   echo "$ac_t""yes" 1>&6
1731 else
1732   echo "$ac_t""no" 1>&6
1733 fi
1734
1735 # Extract the first word of "ranlib", so it can be a program name with args.
1736 set dummy ranlib; ac_word=$2
1737 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1738 echo "configure:1739: checking for $ac_word" >&5
1739 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
1740   echo $ac_n "(cached) $ac_c" 1>&6
1741 else
1742   if test -n "$RANLIB"; then
1743   ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
1744 else
1745   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
1746   ac_dummy="$PATH"
1747   for ac_dir in $ac_dummy; do
1748     test -z "$ac_dir" && ac_dir=.
1749     if test -f $ac_dir/$ac_word; then
1750       ac_cv_prog_RANLIB="ranlib"
1751       break
1752     fi
1753   done
1754   IFS="$ac_save_ifs"
1755   test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":"
1756 fi
1757 fi
1758 RANLIB="$ac_cv_prog_RANLIB"
1759 if test -n "$RANLIB"; then
1760   echo "$ac_t""$RANLIB" 1>&6
1761 else
1762   echo "$ac_t""no" 1>&6
1763 fi
1764
1765 for ac_prog in tdlint lint alint
1766 do
1767 # Extract the first word of "$ac_prog", so it can be a program name with args.
1768 set dummy $ac_prog; ac_word=$2
1769 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1770 echo "configure:1771: checking for $ac_word" >&5
1771 if eval "test \"`echo '$''{'ac_cv_prog_LINT'+set}'`\" = set"; then
1772   echo $ac_n "(cached) $ac_c" 1>&6
1773 else
1774   if test -n "$LINT"; then
1775   ac_cv_prog_LINT="$LINT" # Let the user override the test.
1776 else
1777   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
1778   ac_dummy="$PATH"
1779   for ac_dir in $ac_dummy; do
1780     test -z "$ac_dir" && ac_dir=.
1781     if test -f $ac_dir/$ac_word; then
1782       ac_cv_prog_LINT="$ac_prog"
1783       break
1784     fi
1785   done
1786   IFS="$ac_save_ifs"
1787 fi
1788 fi
1789 LINT="$ac_cv_prog_LINT"
1790 if test -n "$LINT"; then
1791   echo "$ac_t""$LINT" 1>&6
1792 else
1793   echo "$ac_t""no" 1>&6
1794 fi
1795
1796 test -n "$LINT" && break
1797 done
1798
1799 for ac_prog in man man_db
1800 do
1801 # Extract the first word of "$ac_prog", so it can be a program name with args.
1802 set dummy $ac_prog; ac_word=$2
1803 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1804 echo "configure:1805: checking for $ac_word" >&5
1805 if eval "test \"`echo '$''{'ac_cv_prog_MAN'+set}'`\" = set"; then
1806   echo $ac_n "(cached) $ac_c" 1>&6
1807 else
1808   if test -n "$MAN"; then
1809   ac_cv_prog_MAN="$MAN" # Let the user override the test.
1810 else
1811   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
1812   ac_dummy="$PATH"
1813   for ac_dir in $ac_dummy; do
1814     test -z "$ac_dir" && ac_dir=.
1815     if test -f $ac_dir/$ac_word; then
1816       ac_cv_prog_MAN="$ac_prog"
1817       break
1818     fi
1819   done
1820   IFS="$ac_save_ifs"
1821 fi
1822 fi
1823 MAN="$ac_cv_prog_MAN"
1824 if test -n "$MAN"; then
1825   echo "$ac_t""$MAN" 1>&6
1826 else
1827   echo "$ac_t""no" 1>&6
1828 fi
1829
1830 test -n "$MAN" && break
1831 done
1832
1833
1834
1835 if eval "test \"`echo '$''{'cf_cv_subst_LD'+set}'`\" = set"; then
1836   echo $ac_n "(cached) $ac_c" 1>&6
1837 else
1838   
1839 echo $ac_n "checking for loader (symbol LD)""... $ac_c" 1>&6
1840 echo "configure:1841: checking for loader (symbol LD)" >&5
1841 test -z "$LD" && LD=ld
1842 echo "$ac_t""$LD" 1>&6
1843
1844 cf_cv_subst_LD=$LD
1845 fi
1846
1847 LD=${cf_cv_subst_LD}
1848
1849 if eval "test \"`echo '$''{'cf_cv_subst_AR'+set}'`\" = set"; then
1850   echo $ac_n "(cached) $ac_c" 1>&6
1851 else
1852   
1853 echo $ac_n "checking for archiver (symbol AR)""... $ac_c" 1>&6
1854 echo "configure:1855: checking for archiver (symbol AR)" >&5
1855 test -z "$AR" && AR=ar
1856 echo "$ac_t""$AR" 1>&6
1857
1858 cf_cv_subst_AR=$AR
1859 fi
1860
1861 AR=${cf_cv_subst_AR}
1862
1863 if eval "test \"`echo '$''{'cf_cv_subst_AR_OPTS'+set}'`\" = set"; then
1864   echo $ac_n "(cached) $ac_c" 1>&6
1865 else
1866   
1867 echo $ac_n "checking for archiver options (symbol AR_OPTS)""... $ac_c" 1>&6
1868 echo "configure:1869: checking for archiver options (symbol AR_OPTS)" >&5
1869 test -z "$AR_OPTS" && AR_OPTS=rv
1870 echo "$ac_t""$AR_OPTS" 1>&6
1871
1872 cf_cv_subst_AR_OPTS=$AR_OPTS
1873 fi
1874
1875 AR_OPTS=${cf_cv_subst_AR_OPTS}
1876
1877
1878
1879 echo $ac_n "checking for makeflags variable""... $ac_c" 1>&6
1880 echo "configure:1881: checking for makeflags variable" >&5
1881 if eval "test \"`echo '$''{'cf_cv_makeflags'+set}'`\" = set"; then
1882   echo $ac_n "(cached) $ac_c" 1>&6
1883 else
1884   
1885         cf_cv_makeflags=''
1886         for cf_option in '-$(MAKEFLAGS)' '$(MFLAGS)'
1887         do
1888                 cat >cf_makeflags.tmp <<CF_EOF
1889 all :
1890         @ echo '.$cf_option'
1891 CF_EOF
1892                 cf_result=`${MAKE-make} -k -f cf_makeflags.tmp 2>/dev/null`
1893                 case "$cf_result" in
1894                 .*k)
1895                         cf_result=`${MAKE-make} -k -f cf_makeflags.tmp CC=cc 2>/dev/null`
1896                         case "$cf_result" in
1897                         .*CC=*) cf_cv_makeflags=
1898                                 ;;
1899                         *)      cf_cv_makeflags=$cf_option
1900                                 ;;
1901                         esac
1902                         break
1903                         ;;
1904                 *)      echo no match "$cf_result"
1905                         ;;
1906                 esac
1907         done
1908         rm -f cf_makeflags.tmp
1909 fi
1910
1911 echo "$ac_t""$cf_cv_makeflags" 1>&6
1912
1913
1914
1915 echo $ac_n "checking if you have specified an install-prefix""... $ac_c" 1>&6
1916 echo "configure:1917: checking if you have specified an install-prefix" >&5
1917
1918 # Check whether --with-install-prefix or --without-install-prefix was given.
1919 if test "${with_install_prefix+set}" = set; then
1920   withval="$with_install_prefix"
1921   case "$withval" in #(vi
1922         yes|no) #(vi
1923                 ;;
1924         *)      INSTALL_PREFIX="$withval"
1925                 ;;
1926         esac
1927 fi
1928
1929 echo "$ac_t""$INSTALL_PREFIX" 1>&6
1930
1931
1932 ###############################################################################
1933
1934
1935  echo $ac_n "checking format of man-pages""... $ac_c" 1>&6
1936 echo "configure:1937: checking format of man-pages" >&5
1937
1938
1939 # Check whether --with-manpage-format or --without-manpage-format was given.
1940 if test "${with_manpage_format+set}" = set; then
1941   withval="$with_manpage_format"
1942   cf_manpage_form=$withval
1943 else
1944   cf_manpage_form=unknown
1945 fi
1946
1947
1948 case ".$cf_manpage_form" in
1949 .gzip|.compress|.BSDI|.normal|.formatted) # (vi
1950   ;;
1951 .unknown|.) # (vi
1952   if test -z "$MANPATH" ; then
1953     MANPATH="/usr/man:/usr/share/man"
1954   fi
1955   # look for the 'date' man-page (it's most likely to be installed!)
1956   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
1957   cf_manpage_form=unknown
1958   for cf_dir in $MANPATH; do
1959     test -z "$cf_dir" && cf_dir=/usr/man
1960     for cf_name in $cf_dir/*/date.[01]* $cf_dir/*/date
1961     do
1962        cf_test=`echo $cf_name | sed -e 's/*//'`
1963        if test "x$cf_test" = "x$cf_name" ; then
1964           case "$cf_name" in
1965           *.gz) cf_manpage_form=gzip;;
1966           *.Z)  cf_manpage_form=compress;;
1967           *.0)  cf_manpage_form=BSDI,formatted;;
1968           *)    cf_manpage_form=normal;;
1969           esac
1970           break
1971        fi
1972     done
1973     if test "$cf_manpage_form" != "unknown" ; then
1974        break
1975     fi
1976   done
1977   IFS="$ac_save_ifs"
1978   ;;
1979 .*) # (vi
1980   echo "configure: warning: Unexpected manpage-format" 1>&2
1981   ;;
1982 esac
1983
1984 echo "$ac_t""$cf_manpage_form" 1>&6
1985
1986
1987 echo $ac_n "checking for manpage renaming""... $ac_c" 1>&6
1988 echo "configure:1989: checking for manpage renaming" >&5
1989
1990
1991 # Check whether --with-manpage-renames or --without-manpage-renames was given.
1992 if test "${with_manpage_renames+set}" = set; then
1993   withval="$with_manpage_renames"
1994   cf_manpage_renames=$withval
1995 else
1996   cf_manpage_renames=yes
1997 fi
1998
1999
2000 case ".$cf_manpage_renames" in #(vi
2001 .no) #(vi
2002   ;;
2003 .|.yes)
2004   # Debian 'man' program?
2005   if test -f /etc/debian_version ; then
2006     cf_manpage_renames=`cd $srcdir && pwd`/man/man_db.renames
2007   else
2008     cf_manpage_renames=no
2009   fi
2010   ;;
2011 esac
2012
2013 if test "$cf_manpage_renames" != no ; then
2014   if test ! -f $cf_manpage_renames ; then
2015     { echo "configure: error: not a filename: $cf_manpage_renames" 1>&2; exit 1; }
2016   fi
2017
2018   test ! -d man && mkdir man
2019
2020   # Construct a sed-script to perform renaming within man-pages
2021   if test -n "$cf_manpage_renames" ; then
2022     test ! -d man && mkdir man
2023     $srcdir/man/make_sed.sh $cf_manpage_renames >man/edit_man.sed
2024   fi
2025 fi
2026
2027 echo "$ac_t""$cf_manpage_renames" 1>&6
2028
2029
2030 echo $ac_n "checking for manpage symlinks""... $ac_c" 1>&6
2031 echo "configure:2032: checking for manpage symlinks" >&5
2032
2033
2034 # Check whether --with-manpage-symlinks or --without-manpage-symlinks was given.
2035 if test "${with_manpage_symlinks+set}" = set; then
2036   withval="$with_manpage_symlinks"
2037   cf_manpage_symlinks=$withval
2038 else
2039   cf_manpage_symlinks=yes
2040 fi
2041
2042
2043 echo "$ac_t""$cf_manpage_symlinks" 1>&6
2044
2045
2046   if test "$prefix" = "NONE" ; then
2047      cf_prefix="$ac_default_prefix"
2048   else
2049      cf_prefix="$prefix"
2050   fi
2051
2052   case "$cf_manpage_form" in # (vi
2053   *formatted*) # (vi
2054     cf_subdir='$mandir/cat'
2055     cf_format=yes
2056     ;;
2057   *)
2058     cf_subdir='$mandir/man'
2059     cf_format=no
2060     ;;
2061   esac
2062
2063 test ! -d man && mkdir man
2064 cat >man/edit_man.sh <<CF_EOF
2065 #! /bin/sh
2066 # this script is generated by the configure-script
2067 prefix="$cf_prefix"
2068 datadir="$datadir"
2069 MKDIRS="`cd $srcdir && pwd`/mkinstalldirs"
2070 INSTALL="$INSTALL"
2071 INSTALL_DATA="$INSTALL_DATA"
2072
2073 TMP=\${TMPDIR-/tmp}/man\$\$
2074 trap "rm -f \$TMP" 0 1 2 5 15
2075
2076 verb=\$1
2077 shift
2078
2079 mandir=\$1
2080 shift
2081
2082 srcdir=\$1
2083 shift
2084
2085 for i in \$* ; do
2086 case \$i in #(vi
2087 *.orig|*.rej) ;; #(vi
2088 *.[0-9]*)
2089         section=\`expr "\$i" : '.*\\.\\([0-9]\\)[xm]*'\`;
2090         if test \$verb = installing ; then
2091         if test ! -d $cf_subdir\${section} ; then
2092                 \$MKDIRS $cf_subdir\$section
2093         fi
2094         fi
2095         aliases=
2096         source=\`basename \$i\`
2097 CF_EOF
2098 if test "$cf_manpage_symlinks" = yes ; then
2099 cat >>man/edit_man.sh <<CF_EOF
2100         aliases=\`sed -f \$srcdir/manlinks.sed \$source | sort -u\`
2101 CF_EOF
2102 fi
2103 if test "$cf_manpage_renames" = no ; then
2104 cat >>man/edit_man.sh <<CF_EOF
2105         target=$cf_subdir\${section}/\$source
2106         sed -e "s,@DATADIR@,\$datadir," < \$i >\$TMP
2107 CF_EOF
2108 else
2109 cat >>man/edit_man.sh <<CF_EOF
2110         target=\`grep "^\$source" $cf_manpage_renames | $AWK '{print \$2}'\`
2111         if test -z "\$target" ; then
2112                 echo '? missing rename for '\$source
2113                 target="\$source"
2114         fi
2115         target="$cf_subdir\$section/\$target"
2116         test \$verb = installing && sed -e "s,@DATADIR@,\$datadir," < \$i | sed -f edit_man.sed >\$TMP
2117 CF_EOF
2118 fi
2119 if test $cf_format = yes ; then
2120 cat >>man/edit_man.sh <<CF_EOF
2121         nroff -man \$TMP >\$TMP.out
2122         mv \$TMP.out \$TMP
2123 CF_EOF
2124 fi
2125 case "$cf_manpage_form" in #(vi
2126 *compress*) #(vi
2127 cat >>man/edit_man.sh <<CF_EOF
2128         if test \$verb = installing ; then
2129         if ( compress -f \$TMP )
2130         then
2131                 mv \$TMP.Z \$TMP
2132         fi
2133         fi
2134         target="\$target.Z"
2135 CF_EOF
2136   ;;
2137 *gzip*) #(vi
2138 cat >>man/edit_man.sh <<CF_EOF
2139         if test \$verb = installing ; then
2140         if ( gzip -f \$TMP )
2141         then
2142                 mv \$TMP.gz \$TMP
2143         fi
2144         fi
2145         target="\$target.gz"
2146 CF_EOF
2147   ;;
2148 *BSDI*)
2149 cat >>man/edit_man.sh <<CF_EOF
2150         # BSDI installs only .0 suffixes in the cat directories
2151         target="\`echo \$target|sed -e 's/\.[1-9]\+.\?/.0/'\`"
2152 CF_EOF
2153   ;;
2154 esac
2155 cat >>man/edit_man.sh <<CF_EOF
2156         echo \$verb \$target
2157         suffix=\`basename \$target | sed -e 's/^[^.]*//'\`
2158         if test \$verb = installing ; then
2159                 \$INSTALL_DATA \$TMP \$target
2160                 test -n "\$aliases" && (
2161                         cd $cf_subdir\${section} && (
2162                                 target=\`basename \$target\`
2163                                 for cf_alias in \$aliases
2164                                 do
2165                                         if test -f \$cf_alias\${suffix} ; then
2166                                                 if ( cmp -s \$target \$cf_alias\${suffix} )
2167                                                 then
2168                                                         :
2169                                                 else
2170                                                         echo .. \$verb alias \$cf_alias\${suffix}
2171                                                         rm -f \$cf_alias\${suffix}
2172                                                         $LN_S \$target \$cf_alias\${suffix}
2173                                                 fi
2174                                         else
2175                                                 echo .. \$verb alias \$cf_alias\${suffix}
2176                                                 rm -f \$cf_alias\${suffix}
2177                                                 $LN_S \$target \$cf_alias\${suffix}
2178                                         fi
2179                                 done
2180                         )
2181                 )
2182         else
2183                 rm -f \$target
2184                 test -n "\$aliases" && (
2185                         cd $cf_subdir\${section} && (
2186                                 for cf_alias in \$aliases
2187                                 do
2188                                         echo .. \$verb alias \$cf_alias\${suffix}
2189                                         rm -f \$cf_alias\${suffix}
2190                                 done
2191                         )
2192                 )
2193         fi
2194         ;;
2195 esac
2196 done
2197 exit 0
2198 CF_EOF
2199 chmod 755 man/edit_man.sh
2200
2201
2202
2203 ###############################################################################
2204
2205
2206 ### Options to allow the user to specify the set of libraries which are used.
2207 ### Use "--without-normal --with-shared" to allow the default model to be
2208 ### shared, for example.
2209 cf_list_models=""
2210
2211 echo $ac_n "checking if you want to build shared libraries""... $ac_c" 1>&6
2212 echo "configure:2213: checking if you want to build shared libraries" >&5
2213
2214 # Check whether --with-shared or --without-shared was given.
2215 if test "${with_shared+set}" = set; then
2216   withval="$with_shared"
2217   with_shared=$withval
2218 else
2219   with_shared=no
2220 fi
2221
2222 echo "$ac_t""$with_shared" 1>&6
2223 test "$with_shared" = "yes" && cf_list_models="$cf_list_models shared"
2224
2225 echo $ac_n "checking if you want to build static libraries""... $ac_c" 1>&6
2226 echo "configure:2227: checking if you want to build static libraries" >&5
2227
2228 # Check whether --with-normal or --without-normal was given.
2229 if test "${with_normal+set}" = set; then
2230   withval="$with_normal"
2231   with_normal=$withval
2232 else
2233   with_normal=yes
2234 fi
2235
2236 echo "$ac_t""$with_normal" 1>&6
2237 test "$with_normal" = "yes" && cf_list_models="$cf_list_models normal"
2238
2239 echo $ac_n "checking if you want to build debug libraries""... $ac_c" 1>&6
2240 echo "configure:2241: checking if you want to build debug libraries" >&5
2241
2242 # Check whether --with-debug or --without-debug was given.
2243 if test "${with_debug+set}" = set; then
2244   withval="$with_debug"
2245   with_debug=$withval
2246 else
2247   with_debug=yes
2248 fi
2249
2250 echo "$ac_t""$with_debug" 1>&6
2251 test "$with_debug" = "yes" && cf_list_models="$cf_list_models debug"
2252
2253 echo $ac_n "checking if you want to build profiling libraries""... $ac_c" 1>&6
2254 echo "configure:2255: checking if you want to build profiling libraries" >&5
2255
2256 # Check whether --with-profile or --without-profile was given.
2257 if test "${with_profile+set}" = set; then
2258   withval="$with_profile"
2259   with_profile=$withval
2260 else
2261   with_profile=no
2262 fi
2263
2264 echo "$ac_t""$with_profile" 1>&6
2265 test "$with_profile" = "yes" && cf_list_models="$cf_list_models profile"
2266
2267 ###############################################################################
2268
2269 echo $ac_n "checking for specified models""... $ac_c" 1>&6
2270 echo "configure:2271: checking for specified models" >&5
2271 test -z "$cf_list_models" && cf_list_models=normal
2272 echo "$ac_t""$cf_list_models" 1>&6
2273
2274 ### Use the first model as the default, and save its suffix for use in building
2275 ### up test-applications.
2276 echo $ac_n "checking for default model""... $ac_c" 1>&6
2277 echo "configure:2278: checking for default model" >&5
2278 DFT_LWR_MODEL=`echo $cf_list_models | $AWK '{print $1}'`
2279 echo "$ac_t""$DFT_LWR_MODEL" 1>&6
2280
2281
2282 DFT_UPR_MODEL=`echo $DFT_LWR_MODEL | tr '[a-z]' '[A-Z]'`
2283
2284
2285 TINFO_NAME=tinfo
2286
2287
2288 LIB_NAME=ncurses
2289
2290
2291 LIB_DIR=../lib
2292
2293         case $cf_cv_system_name in
2294         os2)    LIB_PREFIX=''     ;;
2295         *)      LIB_PREFIX='lib'  ;;
2296         esac
2297 cf_prefix=$LIB_PREFIX
2298         
2299
2300 LIB_PREFIX=$cf_prefix
2301
2302
2303 LIB_SUFFIX=
2304
2305
2306 ###############################################################################
2307
2308 echo $ac_n "checking if you want to build a separate terminfo library""... $ac_c" 1>&6
2309 echo "configure:2310: checking if you want to build a separate terminfo library" >&5
2310
2311 # Check whether --with-termlib or --without-termlib was given.
2312 if test "${with_termlib+set}" = set; then
2313   withval="$with_termlib"
2314   with_termlib=$withval
2315 else
2316   with_termlib=no
2317 fi
2318
2319 echo "$ac_t""$with_termlib" 1>&6
2320
2321 ### Checks for special libraries, must be done up-front.
2322 echo $ac_n "checking if you want to link with dbmalloc for testing""... $ac_c" 1>&6
2323 echo "configure:2324: checking if you want to link with dbmalloc for testing" >&5
2324
2325 # Check whether --with-dbmalloc or --without-dbmalloc was given.
2326 if test "${with_dbmalloc+set}" = set; then
2327   withval="$with_dbmalloc"
2328   with_dbmalloc=$withval
2329 else
2330   with_dbmalloc=no
2331 fi
2332
2333 echo "$ac_t""$with_dbmalloc" 1>&6
2334 if test $with_dbmalloc = yes ; then
2335         echo $ac_n "checking for debug_malloc in -ldbmalloc""... $ac_c" 1>&6
2336 echo "configure:2337: checking for debug_malloc in -ldbmalloc" >&5
2337 ac_lib_var=`echo dbmalloc'_'debug_malloc | sed 'y%./+-%__p_%'`
2338 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
2339   echo $ac_n "(cached) $ac_c" 1>&6
2340 else
2341   ac_save_LIBS="$LIBS"
2342 LIBS="-ldbmalloc  $LIBS"
2343 cat > conftest.$ac_ext <<EOF
2344 #line 2345 "configure"
2345 #include "confdefs.h"
2346 /* Override any gcc2 internal prototype to avoid an error.  */
2347 /* We use char because int might match the return type of a gcc2
2348     builtin and then its argument prototype would still apply.  */
2349 char debug_malloc();
2350
2351 int main() {
2352 debug_malloc()
2353 ; return 0; }
2354 EOF
2355 if { (eval echo configure:2356: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2356   rm -rf conftest*
2357   eval "ac_cv_lib_$ac_lib_var=yes"
2358 else
2359   echo "configure: failed program was:" >&5
2360   cat conftest.$ac_ext >&5
2361   rm -rf conftest*
2362   eval "ac_cv_lib_$ac_lib_var=no"
2363 fi
2364 rm -f conftest*
2365 LIBS="$ac_save_LIBS"
2366
2367 fi
2368 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
2369   echo "$ac_t""yes" 1>&6
2370     ac_tr_lib=HAVE_LIB`echo dbmalloc | sed -e 's/[^a-zA-Z0-9_]/_/g' \
2371     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
2372   cat >> confdefs.h <<EOF
2373 #define $ac_tr_lib 1
2374 EOF
2375
2376   LIBS="-ldbmalloc $LIBS"
2377
2378 else
2379   echo "$ac_t""no" 1>&6
2380 fi
2381
2382 fi
2383
2384 echo $ac_n "checking if you want to link with dmalloc for testing""... $ac_c" 1>&6
2385 echo "configure:2386: checking if you want to link with dmalloc for testing" >&5
2386
2387 # Check whether --with-dmalloc or --without-dmalloc was given.
2388 if test "${with_dmalloc+set}" = set; then
2389   withval="$with_dmalloc"
2390   with_dmalloc=$withval
2391 else
2392   with_dmalloc=no
2393 fi
2394
2395 echo "$ac_t""$with_dmalloc" 1>&6
2396 if test $with_dmalloc = yes ; then
2397         echo $ac_n "checking for dmalloc_debug in -ldmalloc""... $ac_c" 1>&6
2398 echo "configure:2399: checking for dmalloc_debug in -ldmalloc" >&5
2399 ac_lib_var=`echo dmalloc'_'dmalloc_debug | sed 'y%./+-%__p_%'`
2400 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
2401   echo $ac_n "(cached) $ac_c" 1>&6
2402 else
2403   ac_save_LIBS="$LIBS"
2404 LIBS="-ldmalloc  $LIBS"
2405 cat > conftest.$ac_ext <<EOF
2406 #line 2407 "configure"
2407 #include "confdefs.h"
2408 /* Override any gcc2 internal prototype to avoid an error.  */
2409 /* We use char because int might match the return type of a gcc2
2410     builtin and then its argument prototype would still apply.  */
2411 char dmalloc_debug();
2412
2413 int main() {
2414 dmalloc_debug()
2415 ; return 0; }
2416 EOF
2417 if { (eval echo configure:2418: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2418   rm -rf conftest*
2419   eval "ac_cv_lib_$ac_lib_var=yes"
2420 else
2421   echo "configure: failed program was:" >&5
2422   cat conftest.$ac_ext >&5
2423   rm -rf conftest*
2424   eval "ac_cv_lib_$ac_lib_var=no"
2425 fi
2426 rm -f conftest*
2427 LIBS="$ac_save_LIBS"
2428
2429 fi
2430 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
2431   echo "$ac_t""yes" 1>&6
2432     ac_tr_lib=HAVE_LIB`echo dmalloc | sed -e 's/[^a-zA-Z0-9_]/_/g' \
2433     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
2434   cat >> confdefs.h <<EOF
2435 #define $ac_tr_lib 1
2436 EOF
2437
2438   LIBS="-ldmalloc $LIBS"
2439
2440 else
2441   echo "$ac_t""no" 1>&6
2442 fi
2443
2444 fi
2445
2446 SHLIB_LIST=""
2447 echo $ac_n "checking if you want to link with the gpm mouse library""... $ac_c" 1>&6
2448 echo "configure:2449: checking if you want to link with the gpm mouse library" >&5
2449
2450 # Check whether --with-gpm or --without-gpm was given.
2451 if test "${with_gpm+set}" = set; then
2452   withval="$with_gpm"
2453   with_gpm=$withval
2454 else
2455   with_gpm=no
2456 fi
2457
2458 echo "$ac_t""$with_gpm" 1>&6
2459 if test $with_gpm = yes ; then
2460         echo $ac_n "checking for Gpm_Open in -lgpm""... $ac_c" 1>&6
2461 echo "configure:2462: checking for Gpm_Open in -lgpm" >&5
2462 ac_lib_var=`echo gpm'_'Gpm_Open | sed 'y%./+-%__p_%'`
2463 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
2464   echo $ac_n "(cached) $ac_c" 1>&6
2465 else
2466   ac_save_LIBS="$LIBS"
2467 LIBS="-lgpm  $LIBS"
2468 cat > conftest.$ac_ext <<EOF
2469 #line 2470 "configure"
2470 #include "confdefs.h"
2471 /* Override any gcc2 internal prototype to avoid an error.  */
2472 /* We use char because int might match the return type of a gcc2
2473     builtin and then its argument prototype would still apply.  */
2474 char Gpm_Open();
2475
2476 int main() {
2477 Gpm_Open()
2478 ; return 0; }
2479 EOF
2480 if { (eval echo configure:2481: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2481   rm -rf conftest*
2482   eval "ac_cv_lib_$ac_lib_var=yes"
2483 else
2484   echo "configure: failed program was:" >&5
2485   cat conftest.$ac_ext >&5
2486   rm -rf conftest*
2487   eval "ac_cv_lib_$ac_lib_var=no"
2488 fi
2489 rm -f conftest*
2490 LIBS="$ac_save_LIBS"
2491
2492 fi
2493 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
2494   echo "$ac_t""yes" 1>&6
2495   
2496                 EXTRA_LIBS="-lgpm -lncurses $EXTRA_LIBS"
2497                 SHLIB_LIST="-lgpm $SHLIB_LIST"
2498                 cat >> confdefs.h <<\EOF
2499 #define HAVE_LIBGPM 1
2500 EOF
2501
2502                 for ac_hdr in gpm.h
2503 do
2504 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
2505 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
2506 echo "configure:2507: checking for $ac_hdr" >&5
2507 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
2508   echo $ac_n "(cached) $ac_c" 1>&6
2509 else
2510   cat > conftest.$ac_ext <<EOF
2511 #line 2512 "configure"
2512 #include "confdefs.h"
2513 #include <$ac_hdr>
2514 EOF
2515 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
2516 { (eval echo configure:2517: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
2517 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
2518 if test -z "$ac_err"; then
2519   rm -rf conftest*
2520   eval "ac_cv_header_$ac_safe=yes"
2521 else
2522   echo "$ac_err" >&5
2523   echo "configure: failed program was:" >&5
2524   cat conftest.$ac_ext >&5
2525   rm -rf conftest*
2526   eval "ac_cv_header_$ac_safe=no"
2527 fi
2528 rm -f conftest*
2529 fi
2530 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
2531   echo "$ac_t""yes" 1>&6
2532     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
2533   cat >> confdefs.h <<EOF
2534 #define $ac_tr_hdr 1
2535 EOF
2536  
2537 else
2538   echo "$ac_t""no" 1>&6
2539 fi
2540 done
2541
2542         
2543 else
2544   echo "$ac_t""no" 1>&6
2545 echo "configure: warning: Cannot link with gpm library - read the FAQ" 1>&2
2546 fi
2547
2548 fi
2549
2550
2551 if test X"$CC_G_OPT" = X"" ; then
2552         CC_G_OPT='-g'
2553         test -n "$GCC" && test "${ac_cv_prog_cc_g}" != yes && CC_G_OPT=''
2554 fi
2555
2556
2557 if test X"$CXX_G_OPT" = X"" ; then
2558         CXX_G_OPT='-g'
2559         test -n "$GXX" && test "${ac_cv_prog_cxx_g}" != yes && CXX_G_OPT=''
2560 fi
2561
2562
2563 echo $ac_n "checking for default loader flags""... $ac_c" 1>&6
2564 echo "configure:2565: checking for default loader flags" >&5
2565 case $DFT_LWR_MODEL in
2566 normal)  LD_MODEL=''   ;;
2567 debug)   LD_MODEL=$CC_G_OPT ;;
2568 profile) LD_MODEL='-pg';;
2569 shared)  LD_MODEL=''   ;;
2570 esac
2571 echo "$ac_t""$LD_MODEL" 1>&6
2572
2573 echo $ac_n "checking if rpath option should be used""... $ac_c" 1>&6
2574 echo "configure:2575: checking if rpath option should be used" >&5
2575
2576 # Check whether --enable-rpath or --disable-rpath was given.
2577 if test "${enable_rpath+set}" = set; then
2578   enableval="$enable_rpath"
2579   cf_cv_ld_rpath=$enableval
2580 else
2581   cf_cv_ld_rpath=no
2582 fi
2583
2584 echo "$ac_t""$cf_cv_ld_rpath" 1>&6
2585
2586
2587         
2588         LOCAL_LDFLAGS=
2589         LOCAL_LDFLAGS2=
2590         LD_SHARED_OPTS=
2591         INSTALL_LIB="-m 644"
2592
2593         cf_cv_do_symlinks=no
2594
2595         echo $ac_n "checking if release/abi version should be used for shared libs""... $ac_c" 1>&6
2596 echo "configure:2597: checking if release/abi version should be used for shared libs" >&5
2597         
2598 # Check whether --with-shlib-version or --without-shlib-version was given.
2599 if test "${with_shlib_version+set}" = set; then
2600   withval="$with_shlib_version"
2601   test -z "$withval" && withval=auto
2602         case $withval in #(vi
2603         yes) #(vi
2604                 cf_cv_shlib_version=auto
2605                 ;;
2606         rel|abi|auto|no) #(vi
2607                 cf_cv_shlib_version=$withval
2608                 ;;
2609         *)
2610                 { echo "configure: error: option value must be one of: rel, abi, auto or no" 1>&2; exit 1; }
2611                 ;;
2612         esac
2613         
2614 else
2615   cf_cv_shlib_version=auto
2616 fi
2617
2618         echo "$ac_t""$cf_cv_shlib_version" 1>&6
2619
2620         cf_cv_rm_so_locs=no
2621
2622         # Some less-capable ports of gcc support only -fpic
2623         CC_SHARED_OPTS=
2624         if test -n "$GCC"
2625         then
2626                 echo $ac_n "checking which $CC option to use""... $ac_c" 1>&6
2627 echo "configure:2628: checking which $CC option to use" >&5
2628                 cf_save_CFLAGS="$CFLAGS"
2629                 for CC_SHARED_OPTS in -fPIC -fpic ''
2630                 do
2631                         CFLAGS="$cf_save_CFLAGS $CC_SHARED_OPTS"
2632                         cat > conftest.$ac_ext <<EOF
2633 #line 2634 "configure"
2634 #include "confdefs.h"
2635 #include <stdio.h>
2636 int main() {
2637 int x = 1
2638 ; return 0; }
2639 EOF
2640 if { (eval echo configure:2641: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
2641   rm -rf conftest*
2642   break
2643 else
2644   echo "configure: failed program was:" >&5
2645   cat conftest.$ac_ext >&5
2646 fi
2647 rm -f conftest*
2648                 done
2649                 echo "$ac_t""$CC_SHARED_OPTS" 1>&6
2650                 CFLAGS="$cf_save_CFLAGS"
2651         fi
2652
2653         case $cf_cv_system_name in
2654         beos*)
2655                 MK_SHARED_LIB='$(CC) -o $@ -Xlinker -soname=`basename $@` -nostart -e 0'
2656                 ;;
2657         hpux10.*)
2658                 # (tested with gcc 2.7.2 -- I don't have c89)
2659                 if test -n "$GCC"; then
2660                         LD_SHARED_OPTS='-Xlinker +b -Xlinker $(libdir)'
2661                 else
2662                         CC_SHARED_OPTS='+Z'
2663                         LD_SHARED_OPTS='-Wl,+b,$(libdir)'
2664                 fi
2665                 MK_SHARED_LIB='$(LD) +b $(libdir) -b +h `basename $@` -o $@'
2666                 # HP-UX shared libraries must be executable, and should be
2667                 # readonly to exploit a quirk in the memory manager.
2668                 INSTALL_LIB="-m 555"
2669                 cf_cv_do_symlinks=reverse
2670                 ;;
2671         hpux*)
2672                 # (tested with gcc 2.7.2 -- I don't have c89)
2673                 if test -n "$GCC"; then
2674                         LD_SHARED_OPTS='-Xlinker +b -Xlinker $(libdir)'
2675                 else
2676                         CC_SHARED_OPTS='+Z'
2677                         LD_SHARED_OPTS='-Wl,+b,$(libdir)'
2678                 fi
2679                 MK_SHARED_LIB='$(LD) +b $(libdir) -b -o $@'
2680                 # HP-UX shared libraries must be executable, and should be
2681                 # readonly to exploit a quirk in the memory manager.
2682                 INSTALL_LIB="-m 555"
2683                 ;;
2684         irix*)
2685                 # tested with IRIX 5.2 and 'cc'.
2686                 if test -z "$GCC"; then
2687                         CC_SHARED_OPTS='-KPIC'
2688                 fi
2689                 MK_SHARED_LIB='$(LD) -shared -rdata_shared -soname `basename $@` -o $@'
2690                 cf_cv_rm_so_locs=yes
2691                 ;;
2692         linux*|gnu*)
2693                 # tested with Linux 2.0.29 and gcc 2.7.2 (ELF)
2694                 test $cf_cv_ld_rpath = yes && cf_ld_rpath_opt="-Wl,-rpath,"
2695                 if test $DFT_LWR_MODEL = "shared" ; then
2696                         LOCAL_LDFLAGS='-Wl,-rpath,../lib'
2697                         LOCAL_LDFLAGS2='-Wl,-rpath,../../lib'
2698                 fi
2699                 test $cf_cv_shlib_version = auto && cf_cv_shlib_version=rel
2700                 MK_SHARED_LIB='$(CC) -shared -Wl,-soname,`basename $@ .$(REL_VERSION)`.$(ABI_VERSION),-stats,-lc -o $@'
2701                 ;;
2702         openbsd2*)
2703                 CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
2704                 MK_SHARED_LIB='$(LD) -Bshareable -soname,`basename $@.$(ABI_VERSION)` -o $@'
2705                 ;;
2706         openbsd*|freebsd*)
2707                 CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
2708                 MK_SHARED_LIB='$(LD) -Bshareable -o $@'
2709                 test $cf_cv_shlib_version = auto && cf_cv_shlib_version=rel
2710                 ;;
2711         netbsd*)
2712                 CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
2713                 test $cf_cv_ld_rpath = yes && cf_ld_rpath_opt="-Wl,-rpath,"
2714                 if test $DFT_LWR_MODEL = "shared" && test $cf_cv_ld_rpath = yes ; then
2715                         LOCAL_LDFLAGS='-Wl,-rpath,../lib'
2716                         LOCAL_LDFLAGS2='-Wl,-rpath,../../lib'
2717                         EXTRA_LDFLAGS="-Wl,-rpath,\$(libdir) $EXTRA_LDFLAGS"
2718                         MK_SHARED_LIB='$(CC) -shared -Wl,-soname,`basename $@ .$(REL_VERSION)`.$(ABI_VERSION) -o $@'
2719                         if test $cf_cv_shlib_version = auto; then
2720                         if test ! -f /usr/libexec/ld.elf_so; then
2721                                 cf_cv_shlib_version=rel
2722                         fi
2723                         fi
2724                 else
2725                         MK_SHARED_LIB='$(LD) -Bshareable -o $@'
2726                 fi
2727                 ;;
2728         osf*|mls+*)
2729                 # tested with OSF/1 V3.2 and 'cc'
2730                 # tested with OSF/1 V3.2 and gcc 2.6.3 (but the c++ demo didn't
2731                 # link with shared libs).
2732                 MK_SHARED_LIB='$(LD) -set_version $(REL_VERSION):$(ABI_VERSION) -expect_unresolved "*" -shared -soname `basename $@`'
2733                 test $cf_cv_ld_rpath = yes && cf_ld_rpath_opt="-rpath"
2734                 case $host_os in
2735                 osf4*)
2736                         MK_SHARED_LIB="${MK_SHARED_LIB} -msym"
2737                         ;;
2738                 esac
2739                 MK_SHARED_LIB="${MK_SHARED_LIB}"' -o $@'
2740                 if test $DFT_LWR_MODEL = "shared" ; then
2741                         LOCAL_LDFLAGS='-Wl,-rpath,../lib'
2742                         LOCAL_LDFLAGS2='-Wl,-rpath,../../lib'
2743                 fi
2744                 cf_cv_rm_so_locs=yes
2745                 ;;
2746         sco3.2v5*)  # (also uw2* and UW7) hops 13-Apr-98
2747                 # tested with osr5.0.5
2748                 if test $ac_cv_prog_gcc != yes; then
2749                         CC_SHARED_OPTS='-belf -KPIC'
2750                 fi
2751                 MK_SHARED_LIB='$(LD) -dy -G -h `basename $@ .$(REL_VERSION)`.$(ABI_VERSION) -o $@'
2752                 if test $cf_cv_ld_rpath = yes ; then
2753                         # only way is to set LD_RUN_PATH but no switch for it
2754                         RUN_PATH=$libdir
2755                 fi
2756                 test $cf_cv_shlib_version = auto && cf_cv_shlib_version=rel
2757                 LINK_PROGS='LD_RUN_PATH=$(libdir)'
2758                 LINK_TESTS='Pwd=`pwd`;LD_RUN_PATH=`dirname $${Pwd}`/lib'
2759                 ;;
2760         sunos4*)
2761                 # tested with SunOS 4.1.1 and gcc 2.7.0
2762                 if test $ac_cv_prog_gcc != yes; then
2763                         CC_SHARED_OPTS='-KPIC'
2764                 fi
2765                 MK_SHARED_LIB='$(LD) -assert pure-text -o $@'
2766                 test $cf_cv_shlib_version = auto && cf_cv_shlib_version=rel
2767                 ;;
2768         solaris2*)
2769                 # tested with SunOS 5.5.1 (solaris 2.5.1) and gcc 2.7.2
2770                 if test $ac_cv_prog_gcc != yes; then
2771                         CC_SHARED_OPTS='-KPIC'
2772                 fi
2773                 MK_SHARED_LIB='$(LD) -dy -G -h `basename $@ .$(REL_VERSION)`.$(ABI_VERSION) -o $@'
2774                 if test $cf_cv_ld_rpath = yes ; then
2775                         cf_ld_rpath_opt="-R"
2776                         EXTRA_LDFLAGS="-R ../lib:\$(libdir) $EXTRA_LDFLAGS"
2777                 fi
2778                 test $cf_cv_shlib_version = auto && cf_cv_shlib_version=rel
2779                 ;;
2780         sysv5uw7*|unix_sv*)
2781                 # tested with UnixWare 7.1.0 (gcc 2.95.2 and cc)
2782                 if test $ac_cv_prog_gcc != yes; then
2783                         CC_SHARED_OPTS='-KPIC'
2784                 fi
2785                 MK_SHARED_LIB='$(LD) -d y -G -o $@'
2786                 ;;
2787         *)
2788                 CC_SHARED_OPTS='unknown'
2789                 MK_SHARED_LIB='echo unknown'
2790                 ;;
2791         esac
2792
2793         # This works if the last tokens in $MK_SHARED_LIB are the -o target.
2794         case "$cf_cv_shlib_version" in #(vi
2795         rel|abi)
2796                 case "$MK_SHARED_LIB" in #(vi
2797                 *'-o $@')
2798                         test "$cf_cv_do_symlinks" = no && cf_cv_do_symlinks=yes
2799                         ;;
2800                 *)
2801                         echo "configure: warning: ignored --with-shlib-version" 1>&2
2802                         ;;
2803                 esac
2804                 ;;
2805         esac
2806
2807         if test -n "$cf_ld_rpath_opt" ; then
2808                 echo $ac_n "checking if we need a space after rpath option""... $ac_c" 1>&6
2809 echo "configure:2810: checking if we need a space after rpath option" >&5
2810                 cf_save_LIBS="$LIBS"
2811                 LIBS="$LIBS ${cf_ld_rpath_opt}/usr/lib"
2812                 cat > conftest.$ac_ext <<EOF
2813 #line 2814 "configure"
2814 #include "confdefs.h"
2815
2816 int main() {
2817
2818 ; return 0; }
2819 EOF
2820 if { (eval echo configure:2821: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2821   rm -rf conftest*
2822   cf_rpath_space=no
2823 else
2824   echo "configure: failed program was:" >&5
2825   cat conftest.$ac_ext >&5
2826   rm -rf conftest*
2827   cf_rpath_space=yes
2828 fi
2829 rm -f conftest*
2830                 LIBS="$cf_save_LIBS"
2831                 echo "$ac_t""$cf_rpath_space" 1>&6
2832                 test $cf_rpath_space = yes && cf_ld_rpath_opt="$cf_ld_rpath_opt "
2833                 MK_SHARED_LIB="$MK_SHARED_LIB $cf_ld_rpath_opt\$(libdir)"
2834         fi
2835
2836         
2837         
2838         
2839         
2840         
2841         
2842         
2843         
2844         
2845
2846 if test "$CC_SHARED_OPTS" = "unknown"; then
2847         for model in $cf_list_models; do
2848                 if test "$model" = "shared"; then
2849                         { echo "configure: error: Shared libraries are not supported in this version" 1>&2; exit 1; }
2850                 fi
2851         done
2852 fi
2853
2854 ###############################################################################
2855
2856
2857 ###     use option --disable-overwrite to leave out the link to -lcurses
2858 echo $ac_n "checking if you wish to install ncurses overwriting curses""... $ac_c" 1>&6
2859 echo "configure:2860: checking if you wish to install ncurses overwriting curses" >&5
2860
2861 # Check whether --enable-overwrite or --disable-overwrite was given.
2862 if test "${enable_overwrite+set}" = set; then
2863   enableval="$enable_overwrite"
2864   with_overwrite=$enableval
2865 else
2866   with_overwrite=yes
2867 fi
2868
2869 echo "$ac_t""$with_overwrite" 1>&6
2870
2871 echo $ac_n "checking if external terminfo-database is used""... $ac_c" 1>&6
2872 echo "configure:2873: checking if external terminfo-database is used" >&5
2873
2874 # Check whether --enable-database or --disable-database was given.
2875 if test "${enable_database+set}" = set; then
2876   enableval="$enable_database"
2877   with_database=$enableval
2878 else
2879   with_database=yes
2880 fi
2881
2882 echo "$ac_t""$with_database" 1>&6
2883 test $with_database != no && cat >> confdefs.h <<\EOF
2884 #define USE_DATABASE 1
2885 EOF
2886
2887
2888 echo $ac_n "checking for list of fallback descriptions""... $ac_c" 1>&6
2889 echo "configure:2890: checking for list of fallback descriptions" >&5
2890
2891 # Check whether --with-fallbacks or --without-fallbacks was given.
2892 if test "${with_fallbacks+set}" = set; then
2893   withval="$with_fallbacks"
2894   with_fallback=$withval
2895 else
2896   with_fallback=
2897 fi
2898
2899 echo "$ac_t""$with_fallback" 1>&6
2900 FALLBACK_LIST=`echo $with_fallback|sed -e 's/,/ /g'`
2901
2902
2903 echo $ac_n "checking for list of terminfo directories""... $ac_c" 1>&6
2904 echo "configure:2905: checking for list of terminfo directories" >&5
2905
2906
2907 # Check whether --with-terminfo-dirs or --without-terminfo-dirs was given.
2908 if test "${with_terminfo_dirs+set}" = set; then
2909   withval="$with_terminfo_dirs"
2910   :
2911 else
2912   withval="${TERMINFO_DIRS-${datadir}/terminfo}"
2913 fi
2914
2915 IFS="${IFS=     }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
2916 cf_dst_path=
2917 for cf_src_path in $withval
2918 do
2919   
2920 case ".$cf_src_path" in #(vi
2921 ./*) #(vi
2922   ;;
2923 .a-zA-Z:\\/*) #(vi OS/2 EMX
2924   ;;
2925 .\${*prefix}*) #(vi
2926   eval cf_src_path="$cf_src_path"
2927   case ".$cf_src_path" in #(vi
2928   .NONE/*)
2929     cf_src_path=`echo $cf_src_path | sed -e s@NONE@$ac_default_prefix@`
2930     ;;
2931   esac
2932   ;; #(vi
2933 .NONE/*)
2934   cf_src_path=`echo $cf_src_path | sed -e s@NONE@$ac_default_prefix@`
2935   ;;
2936 *)
2937   { echo "configure: error: expected a pathname" 1>&2; exit 1; }
2938   ;;
2939 esac
2940
2941   test -n "$cf_dst_path" && cf_dst_path="${cf_dst_path}:"
2942   cf_dst_path="${cf_dst_path}${cf_src_path}"
2943 done
2944 IFS="$ac_save_ifs"
2945
2946 eval TERMINFO_DIRS="$cf_dst_path"
2947
2948 echo "$ac_t""$TERMINFO_DIRS" 1>&6
2949 test -n "$TERMINFO_DIRS" && cat >> confdefs.h <<EOF
2950 #define TERMINFO_DIRS "$TERMINFO_DIRS"
2951 EOF
2952
2953
2954 if test $with_database = no ; then
2955         if test -z $with_fallback ; then
2956                 { echo "configure: error: You have disabled the database w/o specifying fallbacks" 1>&2; exit 1; }
2957         fi
2958 fi
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() { exit(malloc(6000000L) == 0); }
2980 EOF
2981 if { (eval echo configure:2982: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
2982 then
2983   with_big_core=yes
2984 else
2985   echo "configure: failed program was:" >&5
2986   cat conftest.$ac_ext >&5
2987   rm -fr conftest*
2988   with_big_core=no
2989 fi
2990 rm -fr conftest*
2991 fi
2992
2993 fi
2994
2995 echo "$ac_t""$with_big_core" 1>&6
2996 test "$with_big_core" = "yes" && cat >> confdefs.h <<\EOF
2997 #define HAVE_BIG_CORE 1
2998 EOF
2999
3000
3001 ###     use option --enable-termcap to compile in the termcap fallback support
3002 echo $ac_n "checking if you want termcap-fallback support""... $ac_c" 1>&6
3003 echo "configure:3004: checking if you want termcap-fallback support" >&5
3004
3005 # Check whether --enable-termcap or --disable-termcap was given.
3006 if test "${enable_termcap+set}" = set; then
3007   enableval="$enable_termcap"
3008   with_termcap=$enableval
3009 else
3010   with_termcap=no
3011 fi
3012
3013 echo "$ac_t""$with_termcap" 1>&6
3014
3015 if test "$with_termcap" != "yes" ; then
3016         cat >> confdefs.h <<\EOF
3017 #define PURE_TERMINFO 1
3018 EOF
3019
3020 else
3021
3022 ###     use option --enable-getcap to use a hacked getcap for reading termcaps
3023 echo $ac_n "checking if fast termcap-loader is needed""... $ac_c" 1>&6
3024 echo "configure:3025: checking if fast termcap-loader is needed" >&5
3025
3026 # Check whether --enable-getcap or --disable-getcap was given.
3027 if test "${enable_getcap+set}" = set; then
3028   enableval="$enable_getcap"
3029   with_getcap=$enableval
3030 else
3031   with_getcap=no
3032 fi
3033
3034 echo "$ac_t""$with_getcap" 1>&6
3035 test "$with_getcap" = "yes" && cat >> confdefs.h <<\EOF
3036 #define USE_GETCAP 1
3037 EOF
3038
3039
3040 echo $ac_n "checking if translated termcaps will be cached in ~/.terminfo""... $ac_c" 1>&6
3041 echo "configure:3042: checking if translated termcaps will be cached in ~/.terminfo" >&5
3042
3043 # Check whether --enable-getcap-cache or --disable-getcap-cache was given.
3044 if test "${enable_getcap_cache+set}" = set; then
3045   enableval="$enable_getcap_cache"
3046   with_getcap_cache=$enableval
3047 else
3048   with_getcap_cache=no
3049 fi
3050
3051 echo "$ac_t""$with_getcap_cache" 1>&6
3052 test "$with_getcap_cache" = "yes" && cat >> confdefs.h <<\EOF
3053 #define USE_GETCAP_CACHE 1
3054 EOF
3055
3056
3057 fi
3058
3059 ###   Use option --enable-symlinks to make tic use symlinks, not hard links
3060 ###   to reduce storage requirements for the terminfo database.
3061
3062 for ac_func in \
3063         remove \
3064         unlink 
3065 do
3066 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
3067 echo "configure:3068: checking for $ac_func" >&5
3068 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
3069   echo $ac_n "(cached) $ac_c" 1>&6
3070 else
3071   cat > conftest.$ac_ext <<EOF
3072 #line 3073 "configure"
3073 #include "confdefs.h"
3074 /* System header to define __stub macros and hopefully few prototypes,
3075     which can conflict with char $ac_func(); below.  */
3076 #include <assert.h>
3077 /* Override any gcc2 internal prototype to avoid an error.  */
3078 /* We use char because int might match the return type of a gcc2
3079     builtin and then its argument prototype would still apply.  */
3080 char $ac_func();
3081
3082 int main() {
3083
3084 /* The GNU C library defines this for functions which it implements
3085     to always fail with ENOSYS.  Some functions are actually named
3086     something starting with __ and the normal name is an alias.  */
3087 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
3088 choke me
3089 #else
3090 $ac_func();
3091 #endif
3092
3093 ; return 0; }
3094 EOF
3095 if { (eval echo configure:3096: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3096   rm -rf conftest*
3097   eval "ac_cv_func_$ac_func=yes"
3098 else
3099   echo "configure: failed program was:" >&5
3100   cat conftest.$ac_ext >&5
3101   rm -rf conftest*
3102   eval "ac_cv_func_$ac_func=no"
3103 fi
3104 rm -f conftest*
3105 fi
3106
3107 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
3108   echo "$ac_t""yes" 1>&6
3109     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
3110   cat >> confdefs.h <<EOF
3111 #define $ac_tr_func 1
3112 EOF
3113  
3114 else
3115   echo "$ac_t""no" 1>&6
3116 fi
3117 done
3118
3119
3120 if test "$ac_cv_prog_cc_cross" = yes ; then
3121         for ac_func in \
3122                 link \
3123                 symlink 
3124 do
3125 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
3126 echo "configure:3127: checking for $ac_func" >&5
3127 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
3128   echo $ac_n "(cached) $ac_c" 1>&6
3129 else
3130   cat > conftest.$ac_ext <<EOF
3131 #line 3132 "configure"
3132 #include "confdefs.h"
3133 /* System header to define __stub macros and hopefully few prototypes,
3134     which can conflict with char $ac_func(); below.  */
3135 #include <assert.h>
3136 /* Override any gcc2 internal prototype to avoid an error.  */
3137 /* We use char because int might match the return type of a gcc2
3138     builtin and then its argument prototype would still apply.  */
3139 char $ac_func();
3140
3141 int main() {
3142
3143 /* The GNU C library defines this for functions which it implements
3144     to always fail with ENOSYS.  Some functions are actually named
3145     something starting with __ and the normal name is an alias.  */
3146 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
3147 choke me
3148 #else
3149 $ac_func();
3150 #endif
3151
3152 ; return 0; }
3153 EOF
3154 if { (eval echo configure:3155: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3155   rm -rf conftest*
3156   eval "ac_cv_func_$ac_func=yes"
3157 else
3158   echo "configure: failed program was:" >&5
3159   cat conftest.$ac_ext >&5
3160   rm -rf conftest*
3161   eval "ac_cv_func_$ac_func=no"
3162 fi
3163 rm -f conftest*
3164 fi
3165
3166 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
3167   echo "$ac_t""yes" 1>&6
3168     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
3169   cat >> confdefs.h <<EOF
3170 #define $ac_tr_func 1
3171 EOF
3172  
3173 else
3174   echo "$ac_t""no" 1>&6
3175 fi
3176 done
3177
3178 else
3179         echo $ac_n "checking if link/symlink functions work""... $ac_c" 1>&6
3180 echo "configure:3181: checking if link/symlink functions work" >&5
3181 if eval "test \"`echo '$''{'cf_cv_link_funcs'+set}'`\" = set"; then
3182   echo $ac_n "(cached) $ac_c" 1>&6
3183 else
3184   
3185                 cf_cv_link_funcs=
3186                 for cf_func in link symlink ; do
3187                         if test "$cross_compiling" = yes; then
3188   
3189                         eval 'ac_cv_func_'$cf_func'=error'
3190 else
3191   cat > conftest.$ac_ext <<EOF
3192 #line 3193 "configure"
3193 #include "confdefs.h"
3194
3195 #include <sys/types.h>
3196 #include <sys/stat.h>
3197 #ifdef HAVE_UNISTD_H
3198 #include <unistd.h>
3199 #endif
3200 int main()
3201 {
3202         int fail = 0;
3203         char *src = "config.log";
3204         char *dst = "conftest.chk";
3205         struct stat src_sb;
3206         struct stat dst_sb;
3207
3208         stat(src, &src_sb);
3209         fail = ($cf_func("config.log", "conftest.chk") < 0)
3210             || (stat(dst, &dst_sb) < 0)
3211             || (dst_sb.st_mtime != src_sb.st_mtime);
3212 #ifdef HAVE_UNLINK
3213         unlink(dst);
3214 #else
3215         remove(dst);
3216 #endif
3217         exit (fail);
3218 }
3219                         
3220 EOF
3221 if { (eval echo configure:3222: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
3222 then
3223   
3224                         cf_cv_link_funcs="$cf_cv_link_funcs $cf_func"
3225                         eval 'ac_cv_func_'$cf_func'=yes'
3226                         
3227 cf_FUNC=`echo $cf_func | tr '[a-z]' '[A-Z]'`
3228
3229                         cat >> confdefs.h <<EOF
3230 #define HAVE_$cf_FUNC 1
3231 EOF
3232
3233 else
3234   echo "configure: failed program was:" >&5
3235   cat conftest.$ac_ext >&5
3236   rm -fr conftest*
3237   
3238                         eval 'ac_cv_func_'$cf_func'=no'
3239 fi
3240 rm -fr conftest*
3241 fi
3242
3243                 done
3244                 test -z "$cf_cv_link_funcs" && cf_cv_link_funcs=no
3245         
3246 fi
3247
3248 echo "$ac_t""$cf_cv_link_funcs" 1>&6
3249 fi
3250
3251
3252 with_links=no
3253 with_symlinks=no
3254
3255 if test "$ac_cv_func_link" != yes ; then
3256     echo $ac_n "checking if tic should use symbolic links""... $ac_c" 1>&6
3257 echo "configure:3258: checking if tic should use symbolic links" >&5
3258     if test "$ac_cv_func_symlink" = yes ; then
3259         with_symlinks=yes
3260     else
3261         with_symlinks=no
3262     fi
3263     echo "$ac_t""$with_symlinks" 1>&6
3264 elif test "$ac_cv_func_symlink" != yes ; then
3265     echo $ac_n "checking if tic should use hard links""... $ac_c" 1>&6
3266 echo "configure:3267: checking if tic should use hard links" >&5
3267     if test "$ac_cv_func_link" = yes ; then
3268         with_links=yes
3269     else
3270         with_links=no
3271     fi
3272     echo "$ac_t""$with_links" 1>&6
3273 else
3274     echo $ac_n "checking if tic should use symbolic links""... $ac_c" 1>&6
3275 echo "configure:3276: checking if tic should use symbolic links" >&5
3276     
3277 # Check whether --enable-symlinks or --disable-symlinks was given.
3278 if test "${enable_symlinks+set}" = set; then
3279   enableval="$enable_symlinks"
3280   with_symlinks=$enableval
3281 else
3282   with_symlinks=no
3283 fi
3284
3285     echo "$ac_t""$with_symlinks" 1>&6
3286 fi
3287
3288 test "$with_links" = yes && cat >> confdefs.h <<\EOF
3289 #define USE_LINKS 1
3290 EOF
3291
3292 test "$with_symlinks" = yes && cat >> confdefs.h <<\EOF
3293 #define USE_SYMLINKS 1
3294 EOF
3295
3296
3297 ###   use option --enable-broken-linker to force on use of broken-linker support
3298 echo $ac_n "checking if you want broken-linker support code""... $ac_c" 1>&6
3299 echo "configure:3300: checking if you want broken-linker support code" >&5
3300
3301 # Check whether --enable-broken_linker or --disable-broken_linker was given.
3302 if test "${enable_broken_linker+set}" = set; then
3303   enableval="$enable_broken_linker"
3304   with_broken_linker=$enableval
3305 else
3306   with_broken_linker=$BROKEN_LINKER
3307 fi
3308
3309 echo "$ac_t""$with_broken_linker" 1>&6
3310 test "$with_broken_linker" = yes && cat >> confdefs.h <<\EOF
3311 #define BROKEN_LINKER 1
3312 EOF
3313
3314
3315 ###   use option --enable-bsdpad to have tputs process BSD-style prefix padding
3316 echo $ac_n "checking if tputs should process BSD-style prefix padding""... $ac_c" 1>&6
3317 echo "configure:3318: checking if tputs should process BSD-style prefix padding" >&5
3318
3319 # Check whether --enable-bsdpad or --disable-bsdpad was given.
3320 if test "${enable_bsdpad+set}" = set; then
3321   enableval="$enable_bsdpad"
3322   with_bsdpad=$enableval
3323 else
3324   with_bsdpad=no
3325 fi
3326
3327 echo "$ac_t""$with_bsdpad" 1>&6
3328 test "$with_bsdpad" = yes && cat >> confdefs.h <<\EOF
3329 #define BSD_TPUTS 1
3330 EOF
3331
3332
3333 ### Enable compiling-in rcs id's
3334 echo $ac_n "checking if RCS identifiers should be compiled-in""... $ac_c" 1>&6
3335 echo "configure:3336: checking if RCS identifiers should be compiled-in" >&5
3336
3337 # Check whether --with-rcs-ids or --without-rcs-ids was given.
3338 if test "${with_rcs_ids+set}" = set; then
3339   withval="$with_rcs_ids"
3340   with_rcs_ids=$withval
3341 else
3342   with_rcs_ids=no
3343 fi
3344
3345 echo "$ac_t""$with_rcs_ids" 1>&6
3346 test "$with_rcs_ids" = yes && cat >> confdefs.h <<\EOF
3347 #define USE_RCS_IDS 1
3348 EOF
3349
3350
3351 ###############################################################################
3352
3353
3354 ### Note that some functions (such as const) are normally disabled anyway.
3355 echo $ac_n "checking if you want to build with function extensions""... $ac_c" 1>&6
3356 echo "configure:3357: checking if you want to build with function extensions" >&5
3357
3358 # Check whether --enable-ext-funcs or --disable-ext-funcs was given.
3359 if test "${enable_ext_funcs+set}" = set; then
3360   enableval="$enable_ext_funcs"
3361   with_ext_funcs=$enableval
3362 else
3363   with_ext_funcs=yes
3364 fi
3365
3366 echo "$ac_t""$with_ext_funcs" 1>&6
3367 if test "$with_ext_funcs" = yes ; then
3368         cat >> confdefs.h <<\EOF
3369 #define HAVE_HAS_KEY 1
3370 EOF
3371
3372         cat >> confdefs.h <<\EOF
3373 #define HAVE_RESIZETERM 1
3374 EOF
3375
3376         cat >> confdefs.h <<\EOF
3377 #define HAVE_USE_DEFAULT_COLORS 1
3378 EOF
3379
3380         cat >> confdefs.h <<\EOF
3381 #define HAVE_WRESIZE 1
3382 EOF
3383
3384         cat >> confdefs.h <<\EOF
3385 #define NCURSES_EXT_FUNCS 1
3386 EOF
3387
3388 fi
3389
3390 ###   use option --enable-const to turn on use of const beyond that in XSI.
3391 echo $ac_n "checking for extended use of const keyword""... $ac_c" 1>&6
3392 echo "configure:3393: checking for extended use of const keyword" >&5
3393
3394 # Check whether --enable-const or --disable-const was given.
3395 if test "${enable_const+set}" = set; then
3396   enableval="$enable_const"
3397   with_ext_const=$enableval
3398 else
3399   with_ext_const=no
3400 fi
3401
3402 echo "$ac_t""$with_ext_const" 1>&6
3403 NCURSES_CONST=""
3404 if test "$with_ext_const" = yes ; then
3405         cat >> confdefs.h <<\EOF
3406 #define NCURSES_CONST const
3407 EOF
3408
3409         NCURSES_CONST=const
3410 fi
3411
3412
3413 ###   use option --enable-hashmap to turn on use of hashmap scrolling logic
3414 echo $ac_n "checking if you want hashmap scrolling-optimization code""... $ac_c" 1>&6
3415 echo "configure:3416: checking if you want hashmap scrolling-optimization code" >&5
3416
3417 # Check whether --enable-hashmap or --disable-hashmap was given.
3418 if test "${enable_hashmap+set}" = set; then
3419   enableval="$enable_hashmap"
3420   with_hashmap=$enableval
3421 else
3422   with_hashmap=yes
3423 fi
3424
3425 echo "$ac_t""$with_hashmap" 1>&6
3426 test "$with_hashmap" = yes && cat >> confdefs.h <<\EOF
3427 #define USE_HASHMAP 1
3428 EOF
3429
3430
3431 echo $ac_n "checking if you want \$NCURSES_NO_PADDING code""... $ac_c" 1>&6
3432 echo "configure:3433: checking if you want \$NCURSES_NO_PADDING code" >&5
3433
3434 # Check whether --enable-no-padding or --disable-no-padding was given.
3435 if test "${enable_no_padding+set}" = set; then
3436   enableval="$enable_no_padding"
3437   with_no_padding=$enableval
3438 else
3439   with_no_padding=$with_ext_funcs
3440 fi
3441
3442 echo "$ac_t""$with_no_padding" 1>&6
3443 test "$with_no_padding" = yes && cat >> confdefs.h <<\EOF
3444 #define NCURSES_NO_PADDING 1
3445 EOF
3446
3447
3448 ###   use option --enable-sigwinch to turn on use of SIGWINCH logic
3449 echo $ac_n "checking if you want SIGWINCH handler""... $ac_c" 1>&6
3450 echo "configure:3451: checking if you want SIGWINCH handler" >&5
3451
3452 # Check whether --enable-sigwinch or --disable-sigwinch was given.
3453 if test "${enable_sigwinch+set}" = set; then
3454   enableval="$enable_sigwinch"
3455   with_sigwinch=$enableval
3456 else
3457   with_sigwinch=$with_ext_funcs
3458 fi
3459
3460 echo "$ac_t""$with_sigwinch" 1>&6
3461 test "$with_sigwinch" = yes && cat >> confdefs.h <<\EOF
3462 #define USE_SIGWINCH 1
3463 EOF
3464
3465
3466 ###   use option --enable-tcap-names to allow user to define new capabilities
3467 echo $ac_n "checking if you want user-definable terminal capabilities like termcap""... $ac_c" 1>&6
3468 echo "configure:3469: checking if you want user-definable terminal capabilities like termcap" >&5
3469
3470 # Check whether --enable-tcap-names or --disable-tcap-names was given.
3471 if test "${enable_tcap_names+set}" = set; then
3472   enableval="$enable_tcap_names"
3473   with_tcap_names=$enableval
3474 else
3475   with_tcap_names=$with_ext_funcs
3476 fi
3477
3478 echo "$ac_t""$with_tcap_names" 1>&6
3479 NCURSES_XNAMES=0
3480 test "$with_tcap_names" = yes && NCURSES_XNAMES=1
3481
3482
3483 ###############################################################################
3484
3485 echo $ac_n "checking if you want all experimental code""... $ac_c" 1>&6
3486 echo "configure:3487: checking if you want all experimental code" >&5
3487
3488 # Check whether --with-develop or --without-develop was given.
3489 if test "${with_develop+set}" = set; then
3490   withval="$with_develop"
3491   with_develop=$withval
3492 else
3493   with_develop=no
3494 fi
3495
3496 echo "$ac_t""$with_develop" 1>&6
3497
3498 ###   use option --enable-colorfgbg to turn on use of $COLORFGBG environment
3499 echo $ac_n "checking if you want experimental colorfgbg code""... $ac_c" 1>&6
3500 echo "configure:3501: checking if you want experimental colorfgbg code" >&5
3501
3502 # Check whether --enable-hard-tabs or --disable-hard-tabs was given.
3503 if test "${enable_hard_tabs+set}" = set; then
3504   enableval="$enable_hard_tabs"
3505   with_colorfgbg=$enableval
3506 else
3507   with_colorfgbg=$with_develop
3508 fi
3509
3510 echo "$ac_t""$with_colorfgbg" 1>&6
3511 test "$with_colorfgbg" = yes && cat >> confdefs.h <<\EOF
3512 #define USE_COLORFGBG 1
3513 EOF
3514
3515
3516 ###   use option --enable-hard-tabs to turn on use of hard-tabs optimize
3517 echo $ac_n "checking if you want experimental hard-tabs code""... $ac_c" 1>&6
3518 echo "configure:3519: checking if you want experimental hard-tabs code" >&5
3519
3520 # Check whether --enable-hard-tabs or --disable-hard-tabs was given.
3521 if test "${enable_hard_tabs+set}" = set; then
3522   enableval="$enable_hard_tabs"
3523   with_hardtabs=$enableval
3524 else
3525   with_hardtabs=$with_develop
3526 fi
3527
3528 echo "$ac_t""$with_hardtabs" 1>&6
3529 test "$with_hardtabs" = yes && cat >> confdefs.h <<\EOF
3530 #define USE_HARD_TABS 1
3531 EOF
3532
3533
3534 echo $ac_n "checking if you want experimental safe-sprintf code""... $ac_c" 1>&6
3535 echo "configure:3536: checking if you want experimental safe-sprintf code" >&5
3536
3537 # Check whether --enable-safe-sprintf or --disable-safe-sprintf was given.
3538 if test "${enable_safe_sprintf+set}" = set; then
3539   enableval="$enable_safe_sprintf"
3540   with_safe_sprintf=$enableval
3541 else
3542   with_safe_sprintf=no
3543 fi
3544
3545 echo "$ac_t""$with_safe_sprintf" 1>&6
3546 test "$with_safe_sprintf" = yes && cat >> confdefs.h <<\EOF
3547 #define USE_SAFE_SPRINTF 1
3548 EOF
3549
3550
3551 ###   use option --disable-scroll-hints to turn off use of scroll-hints scrolling logic
3552 # when hashmap is used scroll hints are useless
3553 if test "$with_hashmap" = no ; then
3554 echo $ac_n "checking if you want to experiment without scrolling-hints code""... $ac_c" 1>&6
3555 echo "configure:3556: checking if you want to experiment without scrolling-hints code" >&5
3556
3557 # Check whether --enable-scroll-hints or --disable-scroll-hints was given.
3558 if test "${enable_scroll_hints+set}" = set; then
3559   enableval="$enable_scroll_hints"
3560   with_scroll_hints=$enableval
3561 else
3562   with_scroll_hints=yes
3563 fi
3564
3565 echo "$ac_t""$with_scroll_hints" 1>&6
3566 test "$with_scroll_hints" = yes && cat >> confdefs.h <<\EOF
3567 #define USE_SCROLL_HINTS 1
3568 EOF
3569
3570 fi
3571
3572 ###   use option --enable-widec to turn on use of wide-character support
3573 echo $ac_n "checking if you want experimental wide-character code""... $ac_c" 1>&6
3574 echo "configure:3575: checking if you want experimental wide-character code" >&5
3575
3576 # Check whether --enable-widec or --disable-widec was given.
3577 if test "${enable_widec+set}" = set; then
3578   enableval="$enable_widec"
3579   with_widec=$enableval
3580 else
3581   with_widec=no
3582 fi
3583
3584 echo "$ac_t""$with_widec" 1>&6
3585 if test "$with_widec" = yes ; then
3586         LIB_SUFFIX="w${LIB_SUFFIX}"
3587         cat >> confdefs.h <<\EOF
3588 #define USE_WIDEC_SUPPORT 1
3589 EOF
3590
3591 fi
3592
3593 ###   use option --enable-xmc-glitch to turn on use of magic-cookie optimize
3594 echo $ac_n "checking if you want experimental xmc code""... $ac_c" 1>&6
3595 echo "configure:3596: checking if you want experimental xmc code" >&5
3596
3597 # Check whether --enable-xmc-glitch or --disable-xmc-glitch was given.
3598 if test "${enable_xmc_glitch+set}" = set; then
3599   enableval="$enable_xmc_glitch"
3600   with_xmc_glitch=$enableval
3601 else
3602   with_xmc_glitch=$with_develop
3603 fi
3604
3605 echo "$ac_t""$with_xmc_glitch" 1>&6
3606 test "$with_xmc_glitch" = yes && cat >> confdefs.h <<\EOF
3607 #define USE_XMC_SUPPORT 1
3608 EOF
3609
3610
3611 ###############################################################################
3612
3613
3614 ###     use option --disable-echo to suppress full display compiling commands
3615
3616 # Check whether --enable-echo or --disable-echo was given.
3617 if test "${enable_echo+set}" = set; then
3618   enableval="$enable_echo"
3619   with_echo=$enableval
3620 else
3621   with_echo=yes
3622 fi
3623
3624 if test "$with_echo" = yes; then
3625         ECHO_LINK=
3626 else
3627         ECHO_LINK='@ echo linking $@ ... ;'
3628 fi
3629
3630
3631 ###     use option --enable-warnings to turn on all gcc warnings
3632
3633 # Check whether --enable-warnings or --disable-warnings was given.
3634 if test "${enable_warnings+set}" = set; then
3635   enableval="$enable_warnings"
3636   with_warnings=$enableval
3637 fi
3638
3639 if test -n "$with_warnings"; then
3640         ADAFLAGS="$ADAFLAGS -gnatg"
3641         
3642 if test -n "$GCC"
3643 then
3644                 cat > conftest.$ac_ext <<EOF
3645 #line 3646 "configure"
3646 int main(int argc, char *argv[]) { return (argv[argc-1] == 0) ; }
3647 EOF
3648                 echo "checking for $CC warning options" 1>&6
3649 echo "configure:3650: checking for $CC warning options" >&5
3650         cf_save_CFLAGS="$CFLAGS"
3651         EXTRA_CFLAGS="-W -Wall"
3652         cf_warn_CONST=""
3653         test "$with_ext_const" = yes && cf_warn_CONST="Wwrite-strings"
3654         for cf_opt in \
3655                 Wbad-function-cast \
3656                 Wcast-align \
3657                 Wcast-qual \
3658                 Winline \
3659                 Wmissing-declarations \
3660                 Wmissing-prototypes \
3661                 Wnested-externs \
3662                 Wpointer-arith \
3663                 Wshadow \
3664                 Wstrict-prototypes $cf_warn_CONST
3665         do
3666                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
3667                 if { (eval echo configure:3668: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3668                         test -n "$verbose" && echo "$ac_t""... -$cf_opt" 1>&6
3669                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
3670                         test "$cf_opt" = Wcast-qual && EXTRA_CFLAGS="$EXTRA_CFLAGS -DXTSTRINGDEFINES"
3671                 fi
3672         done
3673         rm -f conftest*
3674         CFLAGS="$cf_save_CFLAGS"
3675 fi
3676
3677
3678 fi
3679
3680 if test -n "$GCC"
3681 then
3682 cat > conftest.i <<EOF
3683 #ifndef GCC_PRINTF
3684 #define GCC_PRINTF 0
3685 #endif
3686 #ifndef GCC_SCANF
3687 #define GCC_SCANF 0
3688 #endif
3689 #ifndef GCC_NORETURN
3690 #define GCC_NORETURN /* nothing */
3691 #endif
3692 #ifndef GCC_UNUSED
3693 #define GCC_UNUSED /* nothing */
3694 #endif
3695 EOF
3696 if test -n "$GCC"
3697 then
3698         echo "checking for $CC __attribute__ directives" 1>&6
3699 echo "configure:3700: checking for $CC __attribute__ directives" >&5
3700         cat > conftest.$ac_ext <<EOF
3701 #line 3702 "configure"
3702 #include "confdefs.h"
3703 #include "conftest.h"
3704 #include "conftest.i"
3705 #if     GCC_PRINTF
3706 #define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
3707 #else
3708 #define GCC_PRINTFLIKE(fmt,var) /*nothing*/
3709 #endif
3710 #if     GCC_SCANF
3711 #define GCC_SCANFLIKE(fmt,var)  __attribute__((format(scanf,fmt,var)))
3712 #else
3713 #define GCC_SCANFLIKE(fmt,var)  /*nothing*/
3714 #endif
3715 extern void wow(char *,...) GCC_SCANFLIKE(1,2);
3716 extern void oops(char *,...) GCC_PRINTFLIKE(1,2) GCC_NORETURN;
3717 extern void foo(void) GCC_NORETURN;
3718 int main(int argc GCC_UNUSED, char *argv[] GCC_UNUSED) { return 0; }
3719 EOF
3720                 for cf_attribute in scanf printf unused noreturn
3721         do
3722                 
3723 CF_ATTRIBUTE=`echo $cf_attribute | tr '[a-z]' '[A-Z]'`
3724
3725                 cf_directive="__attribute__(($cf_attribute))"
3726                 echo "checking for $CC $cf_directive" 1>&5
3727                 case $cf_attribute in
3728                 scanf|printf)
3729                 cat >conftest.h <<EOF
3730 #define GCC_$CF_ATTRIBUTE 1
3731 EOF
3732                         ;;
3733                 *)
3734                 cat >conftest.h <<EOF
3735 #define GCC_$CF_ATTRIBUTE $cf_directive
3736 EOF
3737                         ;;
3738                 esac
3739                 if { (eval echo configure:3740: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3740                         test -n "$verbose" && echo "$ac_t""... $cf_attribute" 1>&6
3741                         cat conftest.h >>confdefs.h
3742 #               else
3743 #                       sed -e 's/__attr.*/\/*nothing*\//' conftest.h >>confdefs.h
3744                 fi
3745         done
3746 else
3747         fgrep define conftest.i >>confdefs.h
3748 fi
3749 rm -rf conftest*
3750 fi
3751
3752
3753 ###     use option --enable-assertions to turn on generation of assertion code
3754
3755 # Check whether --enable-assertions or --disable-assertions was given.
3756 if test "${enable_assertions+set}" = set; then
3757   enableval="$enable_assertions"
3758   with_assertions=$enableval
3759 else
3760   with_assertions=no
3761 fi
3762
3763 if test -n "$GCC"
3764 then
3765         if test $with_assertions = no
3766         then
3767                 cat >> confdefs.h <<\EOF
3768 #define NDEBUG 1
3769 EOF
3770
3771                 CPPFLAGS="$CPPFLAGS -DNDEBUG"
3772         else
3773                 ADAFLAGS="$ADAFLAGS -gnata"
3774         fi
3775 fi
3776
3777 ###     use option --disable-leaks to suppress "permanent" leaks, for testing
3778
3779 # Check whether --enable-leaks or --disable-leaks was given.
3780 if test "${enable_leaks+set}" = set; then
3781   enableval="$enable_leaks"
3782   test $enableval = no && cat >> confdefs.h <<\EOF
3783 #define NO_LEAKS 1
3784 EOF
3785
3786 fi
3787
3788 cat >> confdefs.h <<\EOF
3789 #define HAVE_NC_ALLOC_H 1
3790 EOF
3791
3792
3793 ###     use option --enable-expanded to generate certain macros as functions
3794
3795 # Check whether --enable-expanded or --disable-expanded was given.
3796 if test "${enable_expanded+set}" = set; then
3797   enableval="$enable_expanded"
3798   test $enableval = yes && cat >> confdefs.h <<\EOF
3799 #define NCURSES_EXPANDED 1
3800 EOF
3801
3802 fi
3803
3804
3805 ###     use option --disable-macros to suppress macros in favor of functions
3806
3807 # Check whether --enable-macros or --disable-macros was given.
3808 if test "${enable_macros+set}" = set; then
3809   enableval="$enable_macros"
3810   test $enableval = no && cat >> confdefs.h <<\EOF
3811 #define NCURSES_NOMACROS 1
3812 EOF
3813
3814 fi
3815
3816
3817 ###     Checks for libraries.
3818 echo $ac_n "checking for gettimeofday""... $ac_c" 1>&6
3819 echo "configure:3820: checking for gettimeofday" >&5
3820 if eval "test \"`echo '$''{'ac_cv_func_gettimeofday'+set}'`\" = set"; then
3821   echo $ac_n "(cached) $ac_c" 1>&6
3822 else
3823   cat > conftest.$ac_ext <<EOF
3824 #line 3825 "configure"
3825 #include "confdefs.h"
3826 /* System header to define __stub macros and hopefully few prototypes,
3827     which can conflict with char gettimeofday(); below.  */
3828 #include <assert.h>
3829 /* Override any gcc2 internal prototype to avoid an error.  */
3830 /* We use char because int might match the return type of a gcc2
3831     builtin and then its argument prototype would still apply.  */
3832 char gettimeofday();
3833
3834 int main() {
3835
3836 /* The GNU C library defines this for functions which it implements
3837     to always fail with ENOSYS.  Some functions are actually named
3838     something starting with __ and the normal name is an alias.  */
3839 #if defined (__stub_gettimeofday) || defined (__stub___gettimeofday)
3840 choke me
3841 #else
3842 gettimeofday();
3843 #endif
3844
3845 ; return 0; }
3846 EOF
3847 if { (eval echo configure:3848: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3848   rm -rf conftest*
3849   eval "ac_cv_func_gettimeofday=yes"
3850 else
3851   echo "configure: failed program was:" >&5
3852   cat conftest.$ac_ext >&5
3853   rm -rf conftest*
3854   eval "ac_cv_func_gettimeofday=no"
3855 fi
3856 rm -f conftest*
3857 fi
3858
3859 if eval "test \"`echo '$ac_cv_func_'gettimeofday`\" = yes"; then
3860   echo "$ac_t""yes" 1>&6
3861   cat >> confdefs.h <<\EOF
3862 #define HAVE_GETTIMEOFDAY 1
3863 EOF
3864
3865 else
3866   echo "$ac_t""no" 1>&6
3867
3868
3869 echo $ac_n "checking for gettimeofday in -lbsd""... $ac_c" 1>&6
3870 echo "configure:3871: checking for gettimeofday in -lbsd" >&5
3871 ac_lib_var=`echo bsd'_'gettimeofday | sed 'y%./+-%__p_%'`
3872 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3873   echo $ac_n "(cached) $ac_c" 1>&6
3874 else
3875   ac_save_LIBS="$LIBS"
3876 LIBS="-lbsd  $LIBS"
3877 cat > conftest.$ac_ext <<EOF
3878 #line 3879 "configure"
3879 #include "confdefs.h"
3880 /* Override any gcc2 internal prototype to avoid an error.  */
3881 /* We use char because int might match the return type of a gcc2
3882     builtin and then its argument prototype would still apply.  */
3883 char gettimeofday();
3884
3885 int main() {
3886 gettimeofday()
3887 ; return 0; }
3888 EOF
3889 if { (eval echo configure:3890: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3890   rm -rf conftest*
3891   eval "ac_cv_lib_$ac_lib_var=yes"
3892 else
3893   echo "configure: failed program was:" >&5
3894   cat conftest.$ac_ext >&5
3895   rm -rf conftest*
3896   eval "ac_cv_lib_$ac_lib_var=no"
3897 fi
3898 rm -f conftest*
3899 LIBS="$ac_save_LIBS"
3900
3901 fi
3902 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3903   echo "$ac_t""yes" 1>&6
3904   cat >> confdefs.h <<\EOF
3905 #define HAVE_GETTIMEOFDAY 1
3906 EOF
3907
3908         LIBS="$LIBS -lbsd"
3909 else
3910   echo "$ac_t""no" 1>&6
3911 fi
3912
3913 fi
3914
3915
3916 echo $ac_n "checking if -lm needed for math functions""... $ac_c" 1>&6
3917 echo "configure:3918: checking if -lm needed for math functions" >&5
3918 if eval "test \"`echo '$''{'cf_cv_need_libm'+set}'`\" = set"; then
3919   echo $ac_n "(cached) $ac_c" 1>&6
3920 else
3921   
3922         cat > conftest.$ac_ext <<EOF
3923 #line 3924 "configure"
3924 #include "confdefs.h"
3925
3926         #include <stdio.h>
3927         #include <math.h>
3928         
3929 int main() {
3930 double x = rand(); printf("result = %g\n", sin(x))
3931 ; return 0; }
3932 EOF
3933 if { (eval echo configure:3934: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3934   rm -rf conftest*
3935   cf_cv_need_libm=no
3936 else
3937   echo "configure: failed program was:" >&5
3938   cat conftest.$ac_ext >&5
3939   rm -rf conftest*
3940   cf_cv_need_libm=yes
3941 fi
3942 rm -f conftest*
3943 fi
3944
3945 echo "$ac_t""$cf_cv_need_libm" 1>&6
3946 if test "$cf_cv_need_libm" = yes
3947 then
3948 MATH_LIB=-lm
3949 fi
3950
3951
3952
3953 ###     Checks for header files.
3954 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
3955 echo "configure:3956: checking for ANSI C header files" >&5
3956 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then
3957   echo $ac_n "(cached) $ac_c" 1>&6
3958 else
3959   cat > conftest.$ac_ext <<EOF
3960 #line 3961 "configure"
3961 #include "confdefs.h"
3962 #include <stdlib.h>
3963 #include <stdarg.h>
3964 #include <string.h>
3965 #include <float.h>
3966 EOF
3967 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3968 { (eval echo configure:3969: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3969 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
3970 if test -z "$ac_err"; then
3971   rm -rf conftest*
3972   ac_cv_header_stdc=yes
3973 else
3974   echo "$ac_err" >&5
3975   echo "configure: failed program was:" >&5
3976   cat conftest.$ac_ext >&5
3977   rm -rf conftest*
3978   ac_cv_header_stdc=no
3979 fi
3980 rm -f conftest*
3981
3982 if test $ac_cv_header_stdc = yes; then
3983   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
3984 cat > conftest.$ac_ext <<EOF
3985 #line 3986 "configure"
3986 #include "confdefs.h"
3987 #include <string.h>
3988 EOF
3989 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
3990   egrep "memchr" >/dev/null 2>&1; then
3991   :
3992 else
3993   rm -rf conftest*
3994   ac_cv_header_stdc=no
3995 fi
3996 rm -f conftest*
3997
3998 fi
3999
4000 if test $ac_cv_header_stdc = yes; then
4001   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
4002 cat > conftest.$ac_ext <<EOF
4003 #line 4004 "configure"
4004 #include "confdefs.h"
4005 #include <stdlib.h>
4006 EOF
4007 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
4008   egrep "free" >/dev/null 2>&1; then
4009   :
4010 else
4011   rm -rf conftest*
4012   ac_cv_header_stdc=no
4013 fi
4014 rm -f conftest*
4015
4016 fi
4017
4018 if test $ac_cv_header_stdc = yes; then
4019   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
4020 if test "$cross_compiling" = yes; then
4021   :
4022 else
4023   cat > conftest.$ac_ext <<EOF
4024 #line 4025 "configure"
4025 #include "confdefs.h"
4026 #include <ctype.h>
4027 #define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
4028 #define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
4029 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
4030 int main () { int i; for (i = 0; i < 256; i++)
4031 if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
4032 exit (0); }
4033
4034 EOF
4035 if { (eval echo configure:4036: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest$