]> ncurses.scripts.mit.edu Git - ncurses.git/blob - test/configure
ncurses 5.7 - patch 20090905
[ncurses.git] / test / configure
1 #! /bin/sh
2
3 # Guess values for system-dependent variables and create Makefiles.
4 # Generated automatically using autoconf version 2.13.20030927 
5 # Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc.
6 #
7 # This configure script is free software; the Free Software Foundation
8 # gives unlimited permission to copy, distribute and modify it.
9
10 # Defaults:
11 ac_help=
12 ac_default_prefix=/usr/local
13 # Any additions from configure.in:
14
15 # Initialize some variables set by options.
16 # The variables have the same names as the options, with
17 # dashes changed to underlines.
18 build=NONE
19 cache_file=./config.cache
20 exec_prefix=NONE
21 host=NONE
22 no_create=
23 nonopt=NONE
24 no_recursion=
25 prefix=NONE
26 program_prefix=NONE
27 program_suffix=NONE
28 program_transform_name=s,x,x,
29 silent=
30 site=
31 srcdir=
32 target=NONE
33 verbose=
34 x_includes=NONE
35 x_libraries=NONE
36 bindir='${exec_prefix}/bin'
37 sbindir='${exec_prefix}/sbin'
38 libexecdir='${exec_prefix}/libexec'
39 datadir='${prefix}/share'
40 sysconfdir='${prefix}/etc'
41 sharedstatedir='${prefix}/com'
42 localstatedir='${prefix}/var'
43 libdir='${exec_prefix}/lib'
44 includedir='${prefix}/include'
45 oldincludedir='/usr/include'
46 infodir='${prefix}/info'
47 mandir='${prefix}/man'
48
49 # Initialize some other variables.
50 subdirs=
51 MFLAGS= MAKEFLAGS=
52 SHELL=${CONFIG_SHELL-/bin/sh}
53 # Maximum number of lines to put in a shell here document.
54 ac_max_here_lines=12
55
56 ac_prev=
57 for ac_option
58 do
59
60   # If the previous option needs an argument, assign it.
61   if test -n "$ac_prev"; then
62     eval "$ac_prev=\$ac_option"
63     ac_prev=
64     continue
65   fi
66
67   case "$ac_option" in
68   -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
69   *) ac_optarg= ;;
70   esac
71
72   # Accept the important Cygnus configure options, so we can diagnose typos.
73
74   case "$ac_option" in
75
76   -bindir | --bindir | --bindi | --bind | --bin | --bi)
77     ac_prev=bindir ;;
78   -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
79     bindir="$ac_optarg" ;;
80
81   -build | --build | --buil | --bui | --bu)
82     ac_prev=build ;;
83   -build=* | --build=* | --buil=* | --bui=* | --bu=*)
84     build="$ac_optarg" ;;
85
86   -cache-file | --cache-file | --cache-fil | --cache-fi \
87   | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
88     ac_prev=cache_file ;;
89   -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
90   | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
91     cache_file="$ac_optarg" ;;
92
93   -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
94     ac_prev=datadir ;;
95   -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
96   | --da=*)
97     datadir="$ac_optarg" ;;
98
99   -disable-* | --disable-*)
100     ac_feature=`echo $ac_option|sed -e 's/-*disable-//'`
101     # Reject names that are not valid shell variable names.
102     if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then
103       { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
104     fi
105     ac_feature=`echo $ac_feature| sed 's/-/_/g'`
106     eval "enable_${ac_feature}=no" ;;
107
108   -enable-* | --enable-*)
109     ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'`
110     # Reject names that are not valid shell variable names.
111     if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then
112       { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
113     fi
114     ac_feature=`echo $ac_feature| sed 's/-/_/g'`
115     case "$ac_option" in
116       *=*) ;;
117       *) ac_optarg=yes ;;
118     esac
119     eval "enable_${ac_feature}='$ac_optarg'" ;;
120
121   -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
122   | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
123   | --exec | --exe | --ex)
124     ac_prev=exec_prefix ;;
125   -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
126   | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
127   | --exec=* | --exe=* | --ex=*)
128     exec_prefix="$ac_optarg" ;;
129
130   -gas | --gas | --ga | --g)
131     # Obsolete; use --with-gas.
132     with_gas=yes ;;
133
134   -help | --help | --hel | --he)
135     # Omit some internal or obsolete options to make the list less imposing.
136     # This message is too long to be a string in the A/UX 3.1 sh.
137     cat << EOF
138 Usage: configure [options] [host]
139 Options: [defaults in brackets after descriptions]
140 Configuration:
141   --cache-file=FILE       cache test results in FILE
142   --help                  print this message
143   --no-create             do not create output files
144   --quiet, --silent       do not print \`checking...' messages
145   --version               print the version of autoconf that created configure
146 Directory and file names:
147   --prefix=PREFIX         install architecture-independent files in PREFIX
148                           [$ac_default_prefix]
149   --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
150                           [same as prefix]
151   --bindir=DIR            user executables in DIR [EPREFIX/bin]
152   --sbindir=DIR           system admin executables in DIR [EPREFIX/sbin]
153   --libexecdir=DIR        program executables in DIR [EPREFIX/libexec]
154   --datadir=DIR           read-only architecture-independent data in DIR
155                           [PREFIX/share]
156   --sysconfdir=DIR        read-only single-machine data in DIR [PREFIX/etc]
157   --sharedstatedir=DIR    modifiable architecture-independent data in DIR
158                           [PREFIX/com]
159   --localstatedir=DIR     modifiable single-machine data in DIR [PREFIX/var]
160   --libdir=DIR            object code libraries in DIR [EPREFIX/lib]
161   --includedir=DIR        C header files in DIR [PREFIX/include]
162   --oldincludedir=DIR     C header files for non-gcc in DIR [/usr/include]
163   --infodir=DIR           info documentation in DIR [PREFIX/info]
164   --mandir=DIR            man documentation in DIR [PREFIX/man]
165   --srcdir=DIR            find the sources in DIR [configure dir or ..]
166   --program-prefix=PREFIX prepend PREFIX to installed program names
167   --program-suffix=SUFFIX append SUFFIX to installed program names
168   --program-transform-name=PROGRAM
169                           run sed PROGRAM on installed program names
170 EOF
171     cat << EOF
172 Host type:
173   --build=BUILD           configure for building on BUILD [BUILD=HOST]
174   --host=HOST             configure for HOST [guessed]
175   --target=TARGET         configure for TARGET [TARGET=HOST]
176 Features and packages:
177   --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
178   --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
179   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
180   --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
181   --x-includes=DIR        X include files are in DIR
182   --x-libraries=DIR       X library files are in DIR
183 EOF
184 cat <<\EOF
185 --enable and --with options recognized:
186   --disable-echo          display "compiling" commands
187   --enable-warnings       test: turn on gcc compiler warnings
188   --with-curses-dir=DIR   directory in which (n)curses is installed
189   --with-5lib             use SunOS sysv-libraries
190   --with-ncursesw         use wide ncurses-libraries (installed)
191   --with-ncurses          use ncurses-libraries (installed)
192   --with-pdcurses         compile/link with pdcurses X11 library
193   --with-x                use the X Window System
194   --with-Xaw3d            link with Xaw 3d library
195   --with-neXtaw           link with neXT Athena library
196   --with-XawPlus          link with Athena-Plus library
197   --with-ncurses-wrap-prefix naming-prefix for ncurses wrapped-variables
198 EOF
199     exit 0 ;;
200
201   -host | --host | --hos | --ho)
202     ac_prev=host ;;
203   -host=* | --host=* | --hos=* | --ho=*)
204     host="$ac_optarg" ;;
205
206   -includedir | --includedir | --includedi | --included | --include \
207   | --includ | --inclu | --incl | --inc)
208     ac_prev=includedir ;;
209   -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
210   | --includ=* | --inclu=* | --incl=* | --inc=*)
211     includedir="$ac_optarg" ;;
212
213   -infodir | --infodir | --infodi | --infod | --info | --inf)
214     ac_prev=infodir ;;
215   -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
216     infodir="$ac_optarg" ;;
217
218   -libdir | --libdir | --libdi | --libd)
219     ac_prev=libdir ;;
220   -libdir=* | --libdir=* | --libdi=* | --libd=*)
221     libdir="$ac_optarg" ;;
222
223   -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
224   | --libexe | --libex | --libe)
225     ac_prev=libexecdir ;;
226   -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
227   | --libexe=* | --libex=* | --libe=*)
228     libexecdir="$ac_optarg" ;;
229
230   -localstatedir | --localstatedir | --localstatedi | --localstated \
231   | --localstate | --localstat | --localsta | --localst \
232   | --locals | --local | --loca | --loc | --lo)
233     ac_prev=localstatedir ;;
234   -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
235   | --localstate=* | --localstat=* | --localsta=* | --localst=* \
236   | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
237     localstatedir="$ac_optarg" ;;
238
239   -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
240     ac_prev=mandir ;;
241   -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
242     mandir="$ac_optarg" ;;
243
244   -nfp | --nfp | --nf)
245     # Obsolete; use --without-fp.
246     with_fp=no ;;
247
248   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
249   | --no-cr | --no-c)
250     no_create=yes ;;
251
252   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
253   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
254     no_recursion=yes ;;
255
256   -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
257   | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
258   | --oldin | --oldi | --old | --ol | --o)
259     ac_prev=oldincludedir ;;
260   -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
261   | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
262   | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
263     oldincludedir="$ac_optarg" ;;
264
265   -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
266     ac_prev=prefix ;;
267   -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
268     prefix="$ac_optarg" ;;
269
270   -program-prefix | --program-prefix | --program-prefi | --program-pref \
271   | --program-pre | --program-pr | --program-p)
272     ac_prev=program_prefix ;;
273   -program-prefix=* | --program-prefix=* | --program-prefi=* \
274   | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
275     program_prefix="$ac_optarg" ;;
276
277   -program-suffix | --program-suffix | --program-suffi | --program-suff \
278   | --program-suf | --program-su | --program-s)
279     ac_prev=program_suffix ;;
280   -program-suffix=* | --program-suffix=* | --program-suffi=* \
281   | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
282     program_suffix="$ac_optarg" ;;
283
284   -program-transform-name | --program-transform-name \
285   | --program-transform-nam | --program-transform-na \
286   | --program-transform-n | --program-transform- \
287   | --program-transform | --program-transfor \
288   | --program-transfo | --program-transf \
289   | --program-trans | --program-tran \
290   | --progr-tra | --program-tr | --program-t)
291     ac_prev=program_transform_name ;;
292   -program-transform-name=* | --program-transform-name=* \
293   | --program-transform-nam=* | --program-transform-na=* \
294   | --program-transform-n=* | --program-transform-=* \
295   | --program-transform=* | --program-transfor=* \
296   | --program-transfo=* | --program-transf=* \
297   | --program-trans=* | --program-tran=* \
298   | --progr-tra=* | --program-tr=* | --program-t=*)
299     program_transform_name="$ac_optarg" ;;
300
301   -q | -quiet | --quiet | --quie | --qui | --qu | --q \
302   | -silent | --silent | --silen | --sile | --sil)
303     silent=yes ;;
304
305   -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
306     ac_prev=sbindir ;;
307   -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
308   | --sbi=* | --sb=*)
309     sbindir="$ac_optarg" ;;
310
311   -sharedstatedir | --sharedstatedir | --sharedstatedi \
312   | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
313   | --sharedst | --shareds | --shared | --share | --shar \
314   | --sha | --sh)
315     ac_prev=sharedstatedir ;;
316   -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
317   | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
318   | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
319   | --sha=* | --sh=*)
320     sharedstatedir="$ac_optarg" ;;
321
322   -site | --site | --sit)
323     ac_prev=site ;;
324   -site=* | --site=* | --sit=*)
325     site="$ac_optarg" ;;
326
327   -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
328     ac_prev=srcdir ;;
329   -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
330     srcdir="$ac_optarg" ;;
331
332   -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
333   | --syscon | --sysco | --sysc | --sys | --sy)
334     ac_prev=sysconfdir ;;
335   -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
336   | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
337     sysconfdir="$ac_optarg" ;;
338
339   -target | --target | --targe | --targ | --tar | --ta | --t)
340     ac_prev=target ;;
341   -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
342     target="$ac_optarg" ;;
343
344   -v | -verbose | --verbose | --verbos | --verbo | --verb)
345     verbose=yes ;;
346
347   -version | --version | --versio | --versi | --vers)
348     echo "configure generated by autoconf version 2.13.20030927"
349     exit 0 ;;
350
351   -with-* | --with-*)
352     ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'`
353     # Reject names that are not valid shell variable names.
354     if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then
355       { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
356     fi
357     ac_package=`echo $ac_package| sed 's/-/_/g'`
358     case "$ac_option" in
359       *=*) ;;
360       *) ac_optarg=yes ;;
361     esac
362     eval "with_${ac_package}='$ac_optarg'" ;;
363
364   -without-* | --without-*)
365     ac_package=`echo $ac_option|sed -e 's/-*without-//'`
366     # Reject names that are not valid shell variable names.
367     if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then
368       { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
369     fi
370     ac_package=`echo $ac_package| sed 's/-/_/g'`
371     eval "with_${ac_package}=no" ;;
372
373   --x)
374     # Obsolete; use --with-x.
375     with_x=yes ;;
376
377   -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
378   | --x-incl | --x-inc | --x-in | --x-i)
379     ac_prev=x_includes ;;
380   -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
381   | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
382     x_includes="$ac_optarg" ;;
383
384   -x-libraries | --x-libraries | --x-librarie | --x-librari \
385   | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
386     ac_prev=x_libraries ;;
387   -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
388   | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
389     x_libraries="$ac_optarg" ;;
390
391   -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; }
392     ;;
393
394   *)
395     if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then
396       echo "configure: warning: $ac_option: invalid host type" 1>&2
397     fi
398     if test "x$nonopt" != xNONE; then
399       { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; }
400     fi
401     nonopt="$ac_option"
402     ;;
403
404   esac
405 done
406
407 if test -n "$ac_prev"; then
408   { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; }
409 fi
410
411 trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
412
413 # File descriptor usage:
414 # 0 standard input
415 # 1 file creation
416 # 2 errors and warnings
417 # 3 some systems may open it to /dev/tty
418 # 4 used on the Kubota Titan
419 # 6 checking for... messages and results
420 # 5 compiler messages saved in config.log
421 if test "$silent" = yes; then
422   exec 6>/dev/null
423 else
424   exec 6>&1
425 fi
426 exec 5>./config.log
427
428 echo "\
429 This file contains any messages produced by compilers while
430 running configure, to aid debugging if configure makes a mistake.
431 " 1>&5
432
433 # Strip out --no-create and --no-recursion so they do not pile up.
434 # Also quote any args containing shell metacharacters.
435 ac_configure_args=
436 for ac_arg
437 do
438   case "$ac_arg" in
439   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
440   | --no-cr | --no-c) ;;
441   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
442   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
443   *" "*|*"      "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*)
444   ac_configure_args="$ac_configure_args '$ac_arg'" ;;
445   *) ac_configure_args="$ac_configure_args $ac_arg" ;;
446   esac
447 done
448
449 # NLS nuisances.
450 # Only set these to C if already set.  These must not be set unconditionally
451 # because not all systems understand e.g. LANG=C (notably SCO).
452 # Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'!
453 # Non-C LC_CTYPE values break the ctype check.
454 if test "${LANG+set}"   = set; then LANG=C;   export LANG;   fi
455 if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
456 if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi
457 if test "${LC_CTYPE+set}"    = set; then LC_CTYPE=C;    export LC_CTYPE;    fi
458
459 # confdefs.h avoids OS command line length limits that DEFS can exceed.
460 rm -rf conftest* confdefs.h
461 # AIX cpp loses on an empty file, so make sure it contains at least a newline.
462 echo > confdefs.h
463
464 # A filename unique to this package, relative to the directory that
465 # configure is in, which we can look for to find out if srcdir is correct.
466 ac_unique_file=ncurses.c
467
468 # Find the source files, if location was not specified.
469 if test -z "$srcdir"; then
470   ac_srcdir_defaulted=yes
471   # Try the directory containing this script, then its parent.
472   ac_prog=$0
473   ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'`
474   test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
475   srcdir=$ac_confdir
476   if test ! -r $srcdir/$ac_unique_file; then
477     srcdir=..
478   fi
479 else
480   ac_srcdir_defaulted=no
481 fi
482 if test ! -r $srcdir/$ac_unique_file; then
483   if test "$ac_srcdir_defaulted" = yes; then
484     { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; }
485   else
486     { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; }
487   fi
488 fi
489 srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'`
490
491 # Prefer explicitly selected file to automatically selected ones.
492 if test -z "$CONFIG_SITE"; then
493   if test "x$prefix" != xNONE; then
494     CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
495   else
496     CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
497   fi
498 fi
499 for ac_site_file in $CONFIG_SITE; do
500   if test -r "$ac_site_file"; then
501     echo "loading site script $ac_site_file"
502     . "$ac_site_file"
503   fi
504 done
505
506 if test -r "$cache_file"; then
507   echo "loading cache $cache_file"
508   . $cache_file
509 else
510   echo "creating cache $cache_file"
511   > $cache_file
512 fi
513
514 ac_ext=c
515 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
516 ac_cpp='$CPP $CPPFLAGS'
517 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
518 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
519 cross_compiling=$ac_cv_prog_cc_cross
520
521 ac_exeext=
522 ac_objext=o
523 if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
524   # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
525   if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
526     ac_n= ac_c='
527 ' ac_t='        '
528   else
529     ac_n=-n ac_c= ac_t=
530   fi
531 else
532   ac_n= ac_c='\c' ac_t=
533 fi
534
535 # If we find X, set shell vars x_includes and x_libraries to the
536 # paths, otherwise set no_x=yes.
537 # Uses ac_ vars as temps to allow command line to override cache and checks.
538 # --without-x overrides everything else, but does not touch the cache.
539 echo $ac_n "checking for X""... $ac_c" 1>&6
540 echo "configure:541: checking for X" >&5
541
542
543 # Check whether --with-x or --without-x was given.
544 if test "${with_x+set}" = set; then
545   withval="$with_x"
546   :
547 fi
548
549 # $have_x is `yes', `no', `disabled', or empty when we do not yet know.
550 if test "x$with_x" = xno; then
551   # The user explicitly disabled X.
552   have_x=disabled
553 else
554   if test "x$x_includes" != xNONE && test "x$x_libraries" != xNONE; then
555     # Both variables are already set.
556     have_x=yes
557   else
558 if eval "test \"`echo '$''{'ac_cv_have_x'+set}'`\" = set"; then
559   echo $ac_n "(cached) $ac_c" 1>&6
560 else
561   # One or both of the vars are not set, and there is no cached value.
562 ac_x_includes=NO ac_x_libraries=NO
563 rm -fr conftestdir
564 if mkdir conftestdir; then
565   cd conftestdir
566   # Make sure to not put "make" in the Imakefile rules, since we grep it out.
567   cat > Imakefile <<'EOF'
568 acfindx:
569         @echo 'ac_im_incroot="${INCROOT}"; ac_im_usrlibdir="${USRLIBDIR}"; ac_im_libdir="${LIBDIR}"'
570 EOF
571   if (xmkmf) >/dev/null 2>/dev/null && test -f Makefile; then
572     # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
573     eval `${MAKE-make} acfindx 2>/dev/null | grep -v make`
574     # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR.
575     for ac_extension in a so sl; do
576       if test ! -f $ac_im_usrlibdir/libX11.$ac_extension &&
577         test -f $ac_im_libdir/libX11.$ac_extension; then
578         ac_im_usrlibdir=$ac_im_libdir; break
579       fi
580     done
581     # Screen out bogus values from the imake configuration.  They are
582     # bogus both because they are the default anyway, and because
583     # using them would break gcc on systems where it needs fixed includes.
584     case "$ac_im_incroot" in
585         /usr/include) ;;
586         *) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes="$ac_im_incroot" ;;
587     esac
588     case "$ac_im_usrlibdir" in
589         /usr/lib | /lib) ;;
590         *) test -d "$ac_im_usrlibdir" && ac_x_libraries="$ac_im_usrlibdir" ;;
591     esac
592   fi
593   cd ..
594   rm -fr conftestdir
595 fi
596
597 if test "$ac_x_includes" = NO; then
598   # Guess where to find include files, by looking for this one X11 .h file.
599   test -z "$x_direct_test_include" && x_direct_test_include=X11/Intrinsic.h
600
601   # First, try using that file with no special directory specified.
602 cat > conftest.$ac_ext <<EOF
603 #line 604 "configure"
604 #include "confdefs.h"
605 #include <$x_direct_test_include>
606 EOF
607 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
608 { (eval echo configure:609: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
609 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
610 if test -z "$ac_err"; then
611   rm -rf conftest*
612   # We can compile using X headers with no special include directory.
613 ac_x_includes=
614 else
615   echo "$ac_err" >&5
616   echo "configure: failed program was:" >&5
617   cat conftest.$ac_ext >&5
618   rm -rf conftest*
619   # Look for the header file in a standard set of common directories.
620 # Check X11 before X11Rn because it is often a symlink to the current release.
621   for ac_dir in               \
622     /usr/X11/include          \
623     /usr/X11R6/include        \
624     /usr/X11R5/include        \
625     /usr/X11R4/include        \
626                               \
627     /usr/include/X11          \
628     /usr/include/X11R6        \
629     /usr/include/X11R5        \
630     /usr/include/X11R4        \
631                               \
632     /usr/local/X11/include    \
633     /usr/local/X11R6/include  \
634     /usr/local/X11R5/include  \
635     /usr/local/X11R4/include  \
636                               \
637     /usr/local/include/X11    \
638     /usr/local/include/X11R6  \
639     /usr/local/include/X11R5  \
640     /usr/local/include/X11R4  \
641                               \
642     /usr/X386/include         \
643     /usr/x386/include         \
644     /usr/XFree86/include/X11  \
645                               \
646     /usr/include              \
647     /usr/local/include        \
648     /usr/unsupported/include  \
649     /usr/athena/include       \
650     /usr/local/x11r5/include  \
651     /usr/lpp/Xamples/include  \
652                               \
653     /usr/openwin/include      \
654     /usr/openwin/share/include \
655     ; \
656   do
657     if test -r "$ac_dir/$x_direct_test_include"; then
658       ac_x_includes=$ac_dir
659       break
660     fi
661   done
662 fi
663 rm -f conftest*
664 fi # $ac_x_includes = NO
665
666 if test "$ac_x_libraries" = NO; then
667   # Check for the libraries.
668
669   test -z "$x_direct_test_library" && x_direct_test_library=Xt
670   test -z "$x_direct_test_function" && x_direct_test_function=XtMalloc
671
672   # See if we find them without any special options.
673   # Don't add to $LIBS permanently.
674   ac_save_LIBS="$LIBS"
675   LIBS="-l$x_direct_test_library $LIBS"
676 cat > conftest.$ac_ext <<EOF
677 #line 678 "configure"
678 #include "confdefs.h"
679
680 int main() {
681 ${x_direct_test_function}()
682 ; return 0; }
683 EOF
684 if { (eval echo configure:685: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
685   rm -rf conftest*
686   LIBS="$ac_save_LIBS"
687 # We can link X programs with no special library path.
688 ac_x_libraries=
689 else
690   echo "configure: failed program was:" >&5
691   cat conftest.$ac_ext >&5
692   rm -rf conftest*
693   LIBS="$ac_save_LIBS"
694 # First see if replacing the include by lib works.
695 # Check X11 before X11Rn because it is often a symlink to the current release.
696 for ac_dir in `echo "$ac_x_includes" | sed s/include/lib/` \
697     /usr/X11/lib          \
698     /usr/X11R6/lib        \
699     /usr/X11R5/lib        \
700     /usr/X11R4/lib        \
701                           \
702     /usr/lib/X11          \
703     /usr/lib/X11R6        \
704     /usr/lib/X11R5        \
705     /usr/lib/X11R4        \
706                           \
707     /usr/local/X11/lib    \
708     /usr/local/X11R6/lib  \
709     /usr/local/X11R5/lib  \
710     /usr/local/X11R4/lib  \
711                           \
712     /usr/local/lib/X11    \
713     /usr/local/lib/X11R6  \
714     /usr/local/lib/X11R5  \
715     /usr/local/lib/X11R4  \
716                           \
717     /usr/X386/lib         \
718     /usr/x386/lib         \
719     /usr/XFree86/lib/X11  \
720                           \
721     /usr/lib              \
722     /usr/local/lib        \
723     /usr/unsupported/lib  \
724     /usr/athena/lib       \
725     /usr/local/x11r5/lib  \
726     /usr/lpp/Xamples/lib  \
727     /lib/usr/lib/X11      \
728                           \
729     /usr/openwin/lib      \
730     /usr/openwin/share/lib \
731     ; \
732 do
733   for ac_extension in a so sl; do
734     if test -r $ac_dir/lib${x_direct_test_library}.$ac_extension; then
735       ac_x_libraries=$ac_dir
736       break 2
737     fi
738   done
739 done
740 fi
741 rm -f conftest*
742 fi # $ac_x_libraries = NO
743
744 if test "$ac_x_includes" = NO || test "$ac_x_libraries" = NO; then
745   # Didn't find X anywhere.  Cache the known absence of X.
746   ac_cv_have_x="have_x=no"
747 else
748   # Record where we found X for the cache.
749   ac_cv_have_x="have_x=yes \
750                 ac_x_includes=$ac_x_includes ac_x_libraries=$ac_x_libraries"
751 fi
752 fi
753   fi
754   eval "$ac_cv_have_x"
755 fi # $with_x != no
756
757 if test "$have_x" != yes; then
758   echo "$ac_t""$have_x" 1>&6
759   no_x=yes
760 else
761   # If each of the values was on the command line, it overrides each guess.
762   test "x$x_includes" = xNONE && x_includes=$ac_x_includes
763   test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries
764   # Update the cache value to reflect the command line values.
765   ac_cv_have_x="have_x=yes \
766                 ac_x_includes=$x_includes ac_x_libraries=$x_libraries"
767   echo "$ac_t""libraries $x_libraries, headers $x_includes" 1>&6
768 fi
769
770
771
772
773
774 test -f config.guess || ( test -f ../config.guess && cp ../config.guess ./ )
775
776
777 test -f config.sub || ( test -f ../config.sub && cp ../config.sub ./ )
778
779 ac_aux_dir=
780 for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
781   if test -f $ac_dir/install-sh; then
782     ac_aux_dir=$ac_dir
783     ac_install_sh="$ac_aux_dir/install-sh -c"
784     break
785   elif test -f $ac_dir/install.sh; then
786     ac_aux_dir=$ac_dir
787     ac_install_sh="$ac_aux_dir/install.sh -c"
788     break
789   fi
790 done
791 if test -z "$ac_aux_dir"; then
792   { echo "configure: error: can not find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." 1>&2; exit 1; }
793 fi
794 ac_config_guess=$ac_aux_dir/config.guess
795 ac_config_sub=$ac_aux_dir/config.sub
796 ac_configure=$ac_aux_dir/configure # This should be Cygnus configure.
797
798
799 if test -f $srcdir/config.guess || test -f $ac_aux_dir/config.guess ; then
800         
801 # Make sure we can run config.sub.
802 if ${CONFIG_SHELL-/bin/sh} $ac_config_sub sun4 >/dev/null 2>&1; then :
803 else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
804 fi
805
806 echo $ac_n "checking host system type""... $ac_c" 1>&6
807 echo "configure:808: checking host system type" >&5
808
809 host_alias=$host
810 case "$host_alias" in
811 NONE)
812   case $nonopt in
813   NONE)
814     if host_alias=`${CONFIG_SHELL-/bin/sh} $ac_config_guess`; then :
815     else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; }
816     fi ;;
817   *) host_alias=$nonopt ;;
818   esac ;;
819 esac
820
821 host=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $host_alias`
822 host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
823 host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
824 host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
825 echo "$ac_t""$host" 1>&6
826
827         system_name="$host_os"
828 else
829         system_name="`(uname -s -r) 2>/dev/null`"
830         if test -z "$system_name" ; then
831                 system_name="`(hostname) 2>/dev/null`"
832         fi
833 fi
834 test -n "$system_name" && cat >> confdefs.h <<EOF
835 #define SYSTEM_NAME "$system_name"
836 EOF
837
838 if eval "test \"`echo '$''{'cf_cv_system_name'+set}'`\" = set"; then
839   echo $ac_n "(cached) $ac_c" 1>&6
840 else
841   cf_cv_system_name="$system_name"
842 fi
843
844
845 test -z "$system_name" && system_name="$cf_cv_system_name"
846 test -n "$cf_cv_system_name" && echo "$ac_t""Configuring for $cf_cv_system_name" 1>&6
847
848 if test ".$system_name" != ".$cf_cv_system_name" ; then
849         echo "$ac_t""Cached system name ($system_name) does not agree with actual ($cf_cv_system_name)" 1>&6
850         { echo "configure: error: "Please remove config.cache and try again."" 1>&2; exit 1; }
851 fi
852
853
854 echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
855 echo "configure:856: checking whether ${MAKE-make} sets \${MAKE}" >&5
856 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
857 if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then
858   echo $ac_n "(cached) $ac_c" 1>&6
859 else
860   cat > conftestmake <<\EOF
861 all:
862         @echo 'ac_maketemp="${MAKE}"'
863 EOF
864 # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
865 eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=`
866 if test -n "$ac_maketemp"; then
867   eval ac_cv_prog_make_${ac_make}_set=yes
868 else
869   eval ac_cv_prog_make_${ac_make}_set=no
870 fi
871 rm -f conftestmake
872 fi
873 if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
874   echo "$ac_t""yes" 1>&6
875   SET_MAKE=
876 else
877   echo "$ac_t""no" 1>&6
878   SET_MAKE="MAKE=${MAKE-make}"
879 fi
880
881 # Extract the first word of "gcc", so it can be a program name with args.
882 set dummy gcc; ac_word=$2
883 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
884 echo "configure:885: checking for $ac_word" >&5
885 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
886   echo $ac_n "(cached) $ac_c" 1>&6
887 else
888   if test -n "$CC"; then
889   ac_cv_prog_CC="$CC" # Let the user override the test.
890 else
891   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
892   ac_dummy="$PATH"
893   for ac_dir in $ac_dummy; do
894     test -z "$ac_dir" && ac_dir=.
895     if test -f $ac_dir/$ac_word; then
896       ac_cv_prog_CC="gcc"
897       break
898     fi
899   done
900   IFS="$ac_save_ifs"
901 fi
902 fi
903 CC="$ac_cv_prog_CC"
904 if test -n "$CC"; then
905   echo "$ac_t""$CC" 1>&6
906 else
907   echo "$ac_t""no" 1>&6
908 fi
909
910 if test -z "$CC"; then
911   # Extract the first word of "cc", so it can be a program name with args.
912 set dummy cc; ac_word=$2
913 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
914 echo "configure:915: checking for $ac_word" >&5
915 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
916   echo $ac_n "(cached) $ac_c" 1>&6
917 else
918   if test -n "$CC"; then
919   ac_cv_prog_CC="$CC" # Let the user override the test.
920 else
921   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
922   ac_prog_rejected=no
923   ac_dummy="$PATH"
924   for ac_dir in $ac_dummy; do
925     test -z "$ac_dir" && ac_dir=.
926     if test -f $ac_dir/$ac_word; then
927       if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
928         ac_prog_rejected=yes
929         continue
930       fi
931       ac_cv_prog_CC="cc"
932       break
933     fi
934   done
935   IFS="$ac_save_ifs"
936 if test $ac_prog_rejected = yes; then
937   # We found a bogon in the path, so make sure we never use it.
938   set dummy $ac_cv_prog_CC
939   shift
940   if test $# -gt 0; then
941     # We chose a different compiler from the bogus one.
942     # However, it has the same basename, so the bogon will be chosen
943     # first if we set CC to just the basename; use the full file name.
944     shift
945     set dummy "$ac_dir/$ac_word" "$@"
946     shift
947     ac_cv_prog_CC="$@"
948   fi
949 fi
950 fi
951 fi
952 CC="$ac_cv_prog_CC"
953 if test -n "$CC"; then
954   echo "$ac_t""$CC" 1>&6
955 else
956   echo "$ac_t""no" 1>&6
957 fi
958
959   if test -z "$CC"; then
960     case "`uname -s`" in
961     *win32* | *WIN32*)
962       # Extract the first word of "cl", so it can be a program name with args.
963 set dummy cl; ac_word=$2
964 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
965 echo "configure:966: checking for $ac_word" >&5
966 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
967   echo $ac_n "(cached) $ac_c" 1>&6
968 else
969   if test -n "$CC"; then
970   ac_cv_prog_CC="$CC" # Let the user override the test.
971 else
972   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
973   ac_dummy="$PATH"
974   for ac_dir in $ac_dummy; do
975     test -z "$ac_dir" && ac_dir=.
976     if test -f $ac_dir/$ac_word; then
977       ac_cv_prog_CC="cl"
978       break
979     fi
980   done
981   IFS="$ac_save_ifs"
982 fi
983 fi
984 CC="$ac_cv_prog_CC"
985 if test -n "$CC"; then
986   echo "$ac_t""$CC" 1>&6
987 else
988   echo "$ac_t""no" 1>&6
989 fi
990  ;;
991     esac
992   fi
993   test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
994 fi
995
996 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
997 echo "configure:998: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
998
999 ac_ext=c
1000 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
1001 ac_cpp='$CPP $CPPFLAGS'
1002 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
1003 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
1004 cross_compiling=$ac_cv_prog_cc_cross
1005
1006 cat > conftest.$ac_ext << EOF
1007
1008 #line 1009 "configure"
1009 #include "confdefs.h"
1010
1011 main(){return(0);}
1012 EOF
1013 if { (eval echo configure:1014: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
1014   ac_cv_prog_cc_works=yes
1015   # If we can't run a trivial program, we are probably using a cross compiler.
1016   if (./conftest; exit) 2>/dev/null; then
1017     ac_cv_prog_cc_cross=no
1018   else
1019     ac_cv_prog_cc_cross=yes
1020   fi
1021 else
1022   echo "configure: failed program was:" >&5
1023   cat conftest.$ac_ext >&5
1024   ac_cv_prog_cc_works=no
1025 fi
1026 rm -fr conftest*
1027 ac_ext=c
1028 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
1029 ac_cpp='$CPP $CPPFLAGS'
1030 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
1031 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
1032 cross_compiling=$ac_cv_prog_cc_cross
1033
1034 echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
1035 if test $ac_cv_prog_cc_works = no; then
1036   { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
1037 fi
1038 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
1039 echo "configure:1040: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
1040 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
1041 cross_compiling=$ac_cv_prog_cc_cross
1042
1043 echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
1044 echo "configure:1045: checking whether we are using GNU C" >&5
1045 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
1046   echo $ac_n "(cached) $ac_c" 1>&6
1047 else
1048   cat > conftest.c <<EOF
1049 #ifdef __GNUC__
1050   yes;
1051 #endif
1052 EOF
1053 if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1054: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
1054   ac_cv_prog_gcc=yes
1055 else
1056   ac_cv_prog_gcc=no
1057 fi
1058 fi
1059
1060 echo "$ac_t""$ac_cv_prog_gcc" 1>&6
1061
1062 if test $ac_cv_prog_gcc = yes; then
1063   GCC=yes
1064 else
1065   GCC=
1066 fi
1067
1068 ac_test_CFLAGS="${CFLAGS+set}"
1069 ac_save_CFLAGS="$CFLAGS"
1070 CFLAGS=
1071 echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
1072 echo "configure:1073: checking whether ${CC-cc} accepts -g" >&5
1073 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
1074   echo $ac_n "(cached) $ac_c" 1>&6
1075 else
1076   echo 'void f(){}' > conftest.c
1077 if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
1078   ac_cv_prog_cc_g=yes
1079 else
1080   ac_cv_prog_cc_g=no
1081 fi
1082 rm -f conftest*
1083
1084 fi
1085
1086 echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
1087 if test "$ac_test_CFLAGS" = set; then
1088   CFLAGS="$ac_save_CFLAGS"
1089 elif test $ac_cv_prog_cc_g = yes; then
1090   if test "$GCC" = yes; then
1091     CFLAGS="-g -O2"
1092   else
1093     CFLAGS="-g"
1094   fi
1095 else
1096   if test "$GCC" = yes; then
1097     CFLAGS="-O2"
1098   else
1099     CFLAGS=
1100   fi
1101 fi
1102
1103 echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
1104 echo "configure:1105: checking how to run the C preprocessor" >&5
1105 # On Suns, sometimes $CPP names a directory.
1106 if test -n "$CPP" && test -d "$CPP"; then
1107   CPP=
1108 fi
1109 if test -z "$CPP"; then
1110 if eval "test \"`echo '$''{'ac_cv_prog_CPP'+set}'`\" = set"; then
1111   echo $ac_n "(cached) $ac_c" 1>&6
1112 else
1113     # This must be in double quotes, not single quotes, because CPP may get
1114   # substituted into the Makefile and "${CC-cc}" will confuse make.
1115   CPP="${CC-cc} -E"
1116   # On the NeXT, cc -E runs the code through the compiler's parser,
1117   # not just through cpp.
1118   cat > conftest.$ac_ext <<EOF
1119 #line 1120 "configure"
1120 #include "confdefs.h"
1121 #include <assert.h>
1122 Syntax Error
1123 EOF
1124 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
1125 { (eval echo configure:1126: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
1126 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
1127 if test -z "$ac_err"; then
1128   :
1129 else
1130   echo "$ac_err" >&5
1131   echo "configure: failed program was:" >&5
1132   cat conftest.$ac_ext >&5
1133   rm -rf conftest*
1134   CPP="${CC-cc} -E -traditional-cpp"
1135   cat > conftest.$ac_ext <<EOF
1136 #line 1137 "configure"
1137 #include "confdefs.h"
1138 #include <assert.h>
1139 Syntax Error
1140 EOF
1141 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
1142 { (eval echo configure:1143: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
1143 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
1144 if test -z "$ac_err"; then
1145   :
1146 else
1147   echo "$ac_err" >&5
1148   echo "configure: failed program was:" >&5
1149   cat conftest.$ac_ext >&5
1150   rm -rf conftest*
1151   CPP="${CC-cc} -nologo -E"
1152   cat > conftest.$ac_ext <<EOF
1153 #line 1154 "configure"
1154 #include "confdefs.h"
1155 #include <assert.h>
1156 Syntax Error
1157 EOF
1158 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
1159 { (eval echo configure:1160: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
1160 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
1161 if test -z "$ac_err"; then
1162   :
1163 else
1164   echo "$ac_err" >&5
1165   echo "configure: failed program was:" >&5
1166   cat conftest.$ac_ext >&5
1167   rm -rf conftest*
1168   CPP=/lib/cpp
1169 fi
1170 rm -f conftest*
1171 fi
1172 rm -f conftest*
1173 fi
1174 rm -f conftest*
1175   ac_cv_prog_CPP="$CPP"
1176 fi
1177   CPP="$ac_cv_prog_CPP"
1178 else
1179   ac_cv_prog_CPP="$CPP"
1180 fi
1181 echo "$ac_t""$CPP" 1>&6
1182
1183 for ac_prog in mawk gawk nawk awk
1184 do
1185 # Extract the first word of "$ac_prog", so it can be a program name with args.
1186 set dummy $ac_prog; ac_word=$2
1187 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1188 echo "configure:1189: checking for $ac_word" >&5
1189 if eval "test \"`echo '$''{'ac_cv_prog_AWK'+set}'`\" = set"; then
1190   echo $ac_n "(cached) $ac_c" 1>&6
1191 else
1192   if test -n "$AWK"; then
1193   ac_cv_prog_AWK="$AWK" # Let the user override the test.
1194 else
1195   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
1196   ac_dummy="$PATH"
1197   for ac_dir in $ac_dummy; do
1198     test -z "$ac_dir" && ac_dir=.
1199     if test -f $ac_dir/$ac_word; then
1200       ac_cv_prog_AWK="$ac_prog"
1201       break
1202     fi
1203   done
1204   IFS="$ac_save_ifs"
1205 fi
1206 fi
1207 AWK="$ac_cv_prog_AWK"
1208 if test -n "$AWK"; then
1209   echo "$ac_t""$AWK" 1>&6
1210 else
1211   echo "$ac_t""no" 1>&6
1212 fi
1213
1214 test -n "$AWK" && break
1215 done
1216
1217
1218 CC_G_OPT="-g"                                   
1219 CC_SHARED_OPTS=unknown                  
1220 CPPFLAGS="$CPPFLAGS"                    
1221 DFT_DEP_SUFFIX=""                               
1222 DFT_OBJ_SUBDIR=`pwd|sed -e's:.*/::'`    
1223 DFT_UPR_MODEL="NORMAL"                  
1224 LD="ld"                                                 
1225 LDFLAGS_SHARED=""                               
1226 LDFLAGS_STATIC=""                               
1227 LD_MODEL=""                                             
1228 LD_SHARED_OPTS=""                               
1229 LIBTOOL=""                                              
1230 LIB_CLEAN=""                                    
1231 LIB_COMPILE=""                                  
1232 LIB_LINK='${CC}'                                
1233 LINK_TESTS=""                                   
1234 LINT=lint                                               
1235 LINT_OPTS=""                                    
1236 LOCAL_LDFLAGS=""                                
1237 MATH_LIB="-lm"                                  
1238 PTHREAD="-lm"                                   
1239 TEST_ARGS=""                                    
1240 TEST_DEPS=""                                    
1241 TEST_LIBS=""                                    
1242 TINFO_ARGS='$(LIBS_CURSES)'             
1243 cf_cv_abi_version=""                    
1244 cf_cv_rel_version=""                    
1245
1246 cf_cv_screen=curses
1247 cf_cv_libtype=
1248
1249 echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6
1250 echo "configure:1251: checking for Cygwin environment" >&5
1251 if eval "test \"`echo '$''{'ac_cv_cygwin'+set}'`\" = set"; then
1252   echo $ac_n "(cached) $ac_c" 1>&6
1253 else
1254   cat > conftest.$ac_ext <<EOF
1255 #line 1256 "configure"
1256 #include "confdefs.h"
1257
1258 int main() {
1259
1260 #ifndef __CYGWIN__
1261 #define __CYGWIN__ __CYGWIN32__
1262 #endif
1263 return __CYGWIN__;
1264 ; return 0; }
1265 EOF
1266 if { (eval echo configure:1267: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
1267   rm -rf conftest*
1268   ac_cv_cygwin=yes
1269 else
1270   echo "configure: failed program was:" >&5
1271   cat conftest.$ac_ext >&5
1272   rm -rf conftest*
1273   ac_cv_cygwin=no
1274 fi
1275 rm -f conftest*
1276 rm -f conftest*
1277 fi
1278
1279 echo "$ac_t""$ac_cv_cygwin" 1>&6
1280 CYGWIN=
1281 test "$ac_cv_cygwin" = yes && CYGWIN=yes
1282 echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6
1283 echo "configure:1284: checking for mingw32 environment" >&5
1284 if eval "test \"`echo '$''{'ac_cv_mingw32'+set}'`\" = set"; then
1285   echo $ac_n "(cached) $ac_c" 1>&6
1286 else
1287   cat > conftest.$ac_ext <<EOF
1288 #line 1289 "configure"
1289 #include "confdefs.h"
1290
1291 int main() {
1292 return __MINGW32__;
1293 ; return 0; }
1294 EOF
1295 if { (eval echo configure:1296: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
1296   rm -rf conftest*
1297   ac_cv_mingw32=yes
1298 else
1299   echo "configure: failed program was:" >&5
1300   cat conftest.$ac_ext >&5
1301   rm -rf conftest*
1302   ac_cv_mingw32=no
1303 fi
1304 rm -f conftest*
1305 rm -f conftest*
1306 fi
1307
1308 echo "$ac_t""$ac_cv_mingw32" 1>&6
1309 MINGW32=
1310 test "$ac_cv_mingw32" = yes && MINGW32=yes
1311
1312
1313 echo $ac_n "checking for executable suffix""... $ac_c" 1>&6
1314 echo "configure:1315: checking for executable suffix" >&5
1315 if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then
1316   echo $ac_n "(cached) $ac_c" 1>&6
1317 else
1318   if test "$CYGWIN" = yes || test "$MINGW32" = yes; then
1319   ac_cv_exeext=.exe
1320 else
1321   rm -f conftest*
1322   echo 'int main () { return 0; }' > conftest.$ac_ext
1323   ac_cv_exeext=
1324   if { (eval echo configure:1325: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
1325     for file in conftest.*; do
1326       case $file in
1327       *.c | *.o | *.obj) ;;
1328       *) ac_cv_exeext=`echo $file | sed -e s/conftest//` ;;
1329       esac
1330     done
1331   else
1332     { echo "configure: error: installation or configuration problem: compiler cannot create executables." 1>&2; exit 1; }
1333   fi
1334   rm -f conftest*
1335   test x"${ac_cv_exeext}" = x && ac_cv_exeext=no
1336 fi
1337 fi
1338
1339 EXEEXT=""
1340 test x"${ac_cv_exeext}" != xno && EXEEXT=${ac_cv_exeext}
1341 echo "$ac_t""${ac_cv_exeext}" 1>&6
1342 ac_exeext=$EXEEXT
1343
1344 echo $ac_n "checking for object suffix""... $ac_c" 1>&6
1345 echo "configure:1346: checking for object suffix" >&5
1346 if eval "test \"`echo '$''{'ac_cv_objext'+set}'`\" = set"; then
1347   echo $ac_n "(cached) $ac_c" 1>&6
1348 else
1349   rm -f conftest*
1350 echo 'int i = 1;' > conftest.$ac_ext
1351 if { (eval echo configure:1352: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
1352   for ac_file in conftest.*; do
1353     case $ac_file in
1354     *.c) ;;
1355     *) ac_cv_objext=`echo $ac_file | sed -e s/conftest.//` ;;
1356     esac
1357   done
1358 else
1359   { echo "configure: error: installation or configuration problem; compiler does not work" 1>&2; exit 1; }
1360 fi
1361 rm -f conftest*
1362 fi
1363
1364 echo "$ac_t""$ac_cv_objext" 1>&6
1365 OBJEXT=$ac_cv_objext
1366 ac_objext=$ac_cv_objext
1367
1368
1369
1370 echo $ac_n "checking for ${CC-cc} option to accept ANSI C""... $ac_c" 1>&6
1371 echo "configure:1372: checking for ${CC-cc} option to accept ANSI C" >&5
1372 if eval "test \"`echo '$''{'cf_cv_ansi_cc'+set}'`\" = set"; then
1373   echo $ac_n "(cached) $ac_c" 1>&6
1374 else
1375   
1376 cf_cv_ansi_cc=no
1377 cf_save_CFLAGS="$CFLAGS"
1378 cf_save_CPPFLAGS="$CPPFLAGS"
1379 # Don't try gcc -ansi; that turns off useful extensions and
1380 # breaks some systems' header files.
1381 # AIX                   -qlanglvl=ansi
1382 # Ultrix and OSF/1      -std1
1383 # HP-UX                 -Aa -D_HPUX_SOURCE
1384 # SVR4                  -Xc
1385 # UnixWare 1.2          (cannot use -Xc, since ANSI/POSIX clashes)
1386 for cf_arg in "-DCC_HAS_PROTOS" \
1387         "" \
1388         -qlanglvl=ansi \
1389         -std1 \
1390         -Ae \
1391         "-Aa -D_HPUX_SOURCE" \
1392         -Xc
1393 do
1394         
1395 cf_fix_cppflags=no
1396 cf_new_cflags=
1397 cf_new_cppflags=
1398 cf_new_extra_cppflags=
1399
1400 for cf_add_cflags in $cf_arg
1401 do
1402 case $cf_fix_cppflags in
1403 no)
1404         case $cf_add_cflags in #(vi
1405         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
1406                 case $cf_add_cflags in
1407                 -D*)
1408                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
1409
1410                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
1411                         && test -z "${cf_tst_cflags}" \
1412                         && cf_fix_cppflags=yes
1413
1414                         if test $cf_fix_cppflags = yes ; then
1415                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
1416                                 continue
1417                         elif test "${cf_tst_cflags}" = "\"'" ; then
1418                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
1419                                 continue
1420                         fi
1421                         ;;
1422                 esac
1423                 case "$CPPFLAGS" in
1424                 *$cf_add_cflags) #(vi
1425                         ;;
1426                 *) #(vi
1427                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
1428                         ;;
1429                 esac
1430                 ;;
1431         *)
1432                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
1433                 ;;
1434         esac
1435         ;;
1436 yes)
1437         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
1438
1439         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
1440
1441         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
1442         && test -z "${cf_tst_cflags}" \
1443         && cf_fix_cppflags=no
1444         ;;
1445 esac
1446 done
1447
1448 if test -n "$cf_new_cflags" ; then
1449         
1450         CFLAGS="$CFLAGS $cf_new_cflags"
1451 fi
1452
1453 if test -n "$cf_new_cppflags" ; then
1454         
1455         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
1456 fi
1457
1458 if test -n "$cf_new_extra_cppflags" ; then
1459         
1460         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
1461 fi
1462
1463
1464
1465
1466         cat > conftest.$ac_ext <<EOF
1467 #line 1468 "configure"
1468 #include "confdefs.h"
1469
1470 #ifndef CC_HAS_PROTOS
1471 #if !defined(__STDC__) || (__STDC__ != 1)
1472 choke me
1473 #endif
1474 #endif
1475
1476 int main() {
1477
1478         int test (int i, double x);
1479         struct s1 {int (*f) (int a);};
1480         struct s2 {int (*f) (double a);};
1481 ; return 0; }
1482 EOF
1483 if { (eval echo configure:1484: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
1484   rm -rf conftest*
1485   cf_cv_ansi_cc="$cf_arg"; break
1486 else
1487   echo "configure: failed program was:" >&5
1488   cat conftest.$ac_ext >&5
1489 fi
1490 rm -f conftest*
1491 done
1492 CFLAGS="$cf_save_CFLAGS"
1493 CPPFLAGS="$cf_save_CPPFLAGS"
1494
1495 fi
1496
1497 echo "$ac_t""$cf_cv_ansi_cc" 1>&6
1498
1499 if test "$cf_cv_ansi_cc" != "no"; then
1500 if test ".$cf_cv_ansi_cc" != ".-DCC_HAS_PROTOS"; then
1501         
1502 cf_fix_cppflags=no
1503 cf_new_cflags=
1504 cf_new_cppflags=
1505 cf_new_extra_cppflags=
1506
1507 for cf_add_cflags in $cf_cv_ansi_cc
1508 do
1509 case $cf_fix_cppflags in
1510 no)
1511         case $cf_add_cflags in #(vi
1512         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
1513                 case $cf_add_cflags in
1514                 -D*)
1515                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
1516
1517                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
1518                         && test -z "${cf_tst_cflags}" \
1519                         && cf_fix_cppflags=yes
1520
1521                         if test $cf_fix_cppflags = yes ; then
1522                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
1523                                 continue
1524                         elif test "${cf_tst_cflags}" = "\"'" ; then
1525                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
1526                                 continue
1527                         fi
1528                         ;;
1529                 esac
1530                 case "$CPPFLAGS" in
1531                 *$cf_add_cflags) #(vi
1532                         ;;
1533                 *) #(vi
1534                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
1535                         ;;
1536                 esac
1537                 ;;
1538         *)
1539                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
1540                 ;;
1541         esac
1542         ;;
1543 yes)
1544         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
1545
1546         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
1547
1548         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
1549         && test -z "${cf_tst_cflags}" \
1550         && cf_fix_cppflags=no
1551         ;;
1552 esac
1553 done
1554
1555 if test -n "$cf_new_cflags" ; then
1556         
1557         CFLAGS="$CFLAGS $cf_new_cflags"
1558 fi
1559
1560 if test -n "$cf_new_cppflags" ; then
1561         
1562         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
1563 fi
1564
1565 if test -n "$cf_new_extra_cppflags" ; then
1566         
1567         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
1568 fi
1569
1570
1571
1572
1573 else
1574         cat >> confdefs.h <<\EOF
1575 #define CC_HAS_PROTOS 1
1576 EOF
1577
1578 fi
1579 fi
1580
1581
1582 if test "$cf_cv_ansi_cc" = "no"; then
1583         { echo "configure: error: Your compiler does not appear to recognize prototypes.
1584 You have the following choices:
1585         a. adjust your compiler options
1586         b. get an up-to-date compiler
1587         c. use a wrapper such as unproto" 1>&2; exit 1; }
1588 fi
1589
1590
1591 if test "$GCC" = yes
1592 then
1593 cat > conftest.i <<EOF
1594 #ifndef GCC_PRINTF
1595 #define GCC_PRINTF 0
1596 #endif
1597 #ifndef GCC_SCANF
1598 #define GCC_SCANF 0
1599 #endif
1600 #ifndef GCC_NORETURN
1601 #define GCC_NORETURN /* nothing */
1602 #endif
1603 #ifndef GCC_UNUSED
1604 #define GCC_UNUSED /* nothing */
1605 #endif
1606 EOF
1607 if test "$GCC" = yes
1608 then
1609         echo "checking for $CC __attribute__ directives" 1>&6
1610 echo "configure:1611: checking for $CC __attribute__ directives" >&5
1611 cat > conftest.$ac_ext <<EOF
1612 #line 1613 "${as_me-configure}"
1613 #include "confdefs.h"
1614 #include "conftest.h"
1615 #include "conftest.i"
1616 #if     GCC_PRINTF
1617 #define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
1618 #else
1619 #define GCC_PRINTFLIKE(fmt,var) /*nothing*/
1620 #endif
1621 #if     GCC_SCANF
1622 #define GCC_SCANFLIKE(fmt,var)  __attribute__((format(scanf,fmt,var)))
1623 #else
1624 #define GCC_SCANFLIKE(fmt,var)  /*nothing*/
1625 #endif
1626 extern void wow(char *,...) GCC_SCANFLIKE(1,2);
1627 extern void oops(char *,...) GCC_PRINTFLIKE(1,2) GCC_NORETURN;
1628 extern void foo(void) GCC_NORETURN;
1629 int main(int argc GCC_UNUSED, char *argv[] GCC_UNUSED) { return 0; }
1630 EOF
1631         for cf_attribute in scanf printf unused noreturn
1632         do
1633                 
1634 cf_ATTRIBUTE=`echo "$cf_attribute" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
1635
1636                 cf_directive="__attribute__(($cf_attribute))"
1637                 echo "checking for $CC $cf_directive" 1>&5
1638                 case $cf_attribute in
1639                 scanf|printf)
1640                 cat >conftest.h <<EOF
1641 #define GCC_$cf_ATTRIBUTE 1
1642 EOF
1643                         ;;
1644                 *)
1645                 cat >conftest.h <<EOF
1646 #define GCC_$cf_ATTRIBUTE $cf_directive
1647 EOF
1648                         ;;
1649                 esac
1650                 if { (eval echo configure:1651: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
1651                         test -n "$verbose" && echo "$ac_t""... $cf_attribute" 1>&6
1652                         cat conftest.h >>confdefs.h
1653                 fi
1654         done
1655 else
1656         fgrep define conftest.i >>confdefs.h
1657 fi
1658 rm -rf conftest*
1659 fi
1660
1661
1662 echo $ac_n "checking if $CC -U and -D options work together""... $ac_c" 1>&6
1663 echo "configure:1664: checking if $CC -U and -D options work together" >&5
1664 if eval "test \"`echo '$''{'cf_cv_cc_u_d_options'+set}'`\" = set"; then
1665   echo $ac_n "(cached) $ac_c" 1>&6
1666 else
1667   
1668         cf_save_CPPFLAGS="$CPPFLAGS"
1669         CPPFLAGS="-UU_D_OPTIONS -DU_D_OPTIONS -DD_U_OPTIONS -UD_U_OPTIONS"
1670         cat > conftest.$ac_ext <<EOF
1671 #line 1672 "configure"
1672 #include "confdefs.h"
1673
1674 int main() {
1675
1676 #ifndef U_D_OPTIONS
1677 make an undefined-error
1678 #endif
1679 #ifdef  D_U_OPTIONS
1680 make a defined-error
1681 #endif
1682         
1683 ; return 0; }
1684 EOF
1685 if { (eval echo configure:1686: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
1686   rm -rf conftest*
1687   
1688         cf_cv_cc_u_d_options=yes
1689 else
1690   echo "configure: failed program was:" >&5
1691   cat conftest.$ac_ext >&5
1692   rm -rf conftest*
1693   
1694         cf_cv_cc_u_d_options=no
1695 fi
1696 rm -f conftest*
1697         CPPFLAGS="$cf_save_CPPFLAGS"
1698
1699 fi
1700
1701 echo "$ac_t""$cf_cv_cc_u_d_options" 1>&6
1702
1703
1704
1705
1706
1707 cf_XOPEN_SOURCE=500
1708 cf_POSIX_C_SOURCE=199506L
1709
1710 case $host_os in #(vi
1711 aix[456]*) #(vi
1712         CPPFLAGS="$CPPFLAGS -D_ALL_SOURCE"
1713         ;;
1714 freebsd*|dragonfly*) #(vi
1715         # 5.x headers associate
1716         #       _XOPEN_SOURCE=600 with _POSIX_C_SOURCE=200112L
1717         #       _XOPEN_SOURCE=500 with _POSIX_C_SOURCE=199506L
1718         cf_POSIX_C_SOURCE=200112L
1719         cf_XOPEN_SOURCE=600
1720         CPPFLAGS="$CPPFLAGS -D_BSD_TYPES -D__BSD_VISIBLE -D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
1721         ;;
1722 hpux11*) #(vi
1723         CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE -D_XOPEN_SOURCE=500"
1724         ;;
1725 hpux*) #(vi
1726         CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE"
1727         ;;
1728 irix[56].*) #(vi
1729         CPPFLAGS="$CPPFLAGS -D_SGI_SOURCE"
1730         ;;
1731 linux*|gnu*|mint*|k*bsd*-gnu) #(vi
1732         
1733 echo $ac_n "checking if we must define _GNU_SOURCE""... $ac_c" 1>&6
1734 echo "configure:1735: checking if we must define _GNU_SOURCE" >&5
1735 if eval "test \"`echo '$''{'cf_cv_gnu_source'+set}'`\" = set"; then
1736   echo $ac_n "(cached) $ac_c" 1>&6
1737 else
1738   
1739 cat > conftest.$ac_ext <<EOF
1740 #line 1741 "configure"
1741 #include "confdefs.h"
1742 #include <sys/types.h>
1743 int main() {
1744
1745 #ifndef _XOPEN_SOURCE
1746 make an error
1747 #endif
1748 ; return 0; }
1749 EOF
1750 if { (eval echo configure:1751: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
1751   rm -rf conftest*
1752   cf_cv_gnu_source=no
1753 else
1754   echo "configure: failed program was:" >&5
1755   cat conftest.$ac_ext >&5
1756   rm -rf conftest*
1757   cf_save="$CPPFLAGS"
1758          CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
1759          cat > conftest.$ac_ext <<EOF
1760 #line 1761 "configure"
1761 #include "confdefs.h"
1762 #include <sys/types.h>
1763 int main() {
1764
1765 #ifdef _XOPEN_SOURCE
1766 make an error
1767 #endif
1768 ; return 0; }
1769 EOF
1770 if { (eval echo configure:1771: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
1771   rm -rf conftest*
1772   cf_cv_gnu_source=no
1773 else
1774   echo "configure: failed program was:" >&5
1775   cat conftest.$ac_ext >&5
1776   rm -rf conftest*
1777   cf_cv_gnu_source=yes
1778 fi
1779 rm -f conftest*
1780         CPPFLAGS="$cf_save"
1781         
1782 fi
1783 rm -f conftest*
1784
1785 fi
1786
1787 echo "$ac_t""$cf_cv_gnu_source" 1>&6
1788 test "$cf_cv_gnu_source" = yes && CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
1789
1790         ;;
1791 mirbsd*) #(vi
1792         # setting _XOPEN_SOURCE or _POSIX_SOURCE breaks <arpa/inet.h>
1793         ;;
1794 netbsd*) #(vi
1795         # setting _XOPEN_SOURCE breaks IPv6 for lynx on NetBSD 1.6, breaks xterm, is not needed for ncursesw
1796         ;;
1797 openbsd*) #(vi
1798         # setting _XOPEN_SOURCE breaks xterm on OpenBSD 2.8, is not needed for ncursesw
1799         ;;
1800 osf[45]*) #(vi
1801         CPPFLAGS="$CPPFLAGS -D_OSF_SOURCE"
1802         ;;
1803 nto-qnx*) #(vi
1804         CPPFLAGS="$CPPFLAGS -D_QNX_SOURCE"
1805         ;;
1806 sco*) #(vi
1807         # setting _XOPEN_SOURCE breaks Lynx on SCO Unix / OpenServer
1808         ;;
1809 solaris*) #(vi
1810         CPPFLAGS="$CPPFLAGS -D__EXTENSIONS__"
1811         ;;
1812 *)
1813         echo $ac_n "checking if we should define _XOPEN_SOURCE""... $ac_c" 1>&6
1814 echo "configure:1815: checking if we should define _XOPEN_SOURCE" >&5
1815 if eval "test \"`echo '$''{'cf_cv_xopen_source'+set}'`\" = set"; then
1816   echo $ac_n "(cached) $ac_c" 1>&6
1817 else
1818   
1819         cat > conftest.$ac_ext <<EOF
1820 #line 1821 "configure"
1821 #include "confdefs.h"
1822 #include <sys/types.h>
1823 int main() {
1824
1825 #ifndef _XOPEN_SOURCE
1826 make an error
1827 #endif
1828 ; return 0; }
1829 EOF
1830 if { (eval echo configure:1831: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
1831   rm -rf conftest*
1832   cf_cv_xopen_source=no
1833 else
1834   echo "configure: failed program was:" >&5
1835   cat conftest.$ac_ext >&5
1836   rm -rf conftest*
1837   cf_save="$CPPFLAGS"
1838          CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
1839          cat > conftest.$ac_ext <<EOF
1840 #line 1841 "configure"
1841 #include "confdefs.h"
1842 #include <sys/types.h>
1843 int main() {
1844
1845 #ifdef _XOPEN_SOURCE
1846 make an error
1847 #endif
1848 ; return 0; }
1849 EOF
1850 if { (eval echo configure:1851: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
1851   rm -rf conftest*
1852   cf_cv_xopen_source=no
1853 else
1854   echo "configure: failed program was:" >&5
1855   cat conftest.$ac_ext >&5
1856   rm -rf conftest*
1857   cf_cv_xopen_source=$cf_XOPEN_SOURCE
1858 fi
1859 rm -f conftest*
1860         CPPFLAGS="$cf_save"
1861         
1862 fi
1863 rm -f conftest*
1864
1865 fi
1866
1867 echo "$ac_t""$cf_cv_xopen_source" 1>&6
1868         if test "$cf_cv_xopen_source" != no ; then
1869                 
1870 # remove _XOPEN_SOURCE symbol from $CFLAGS
1871 CFLAGS=`echo "$CFLAGS" | \
1872         sed     -e 's/-[UD]_XOPEN_SOURCE\(=[^   ]*\)\?[         ]/ /g' \
1873                 -e 's/-[UD]_XOPEN_SOURCE\(=[^   ]*\)\?$//g'`
1874
1875                 
1876 # remove _XOPEN_SOURCE symbol from $CPPFLAGS
1877 CPPFLAGS=`echo "$CPPFLAGS" | \
1878         sed     -e 's/-[UD]_XOPEN_SOURCE\(=[^   ]*\)\?[         ]/ /g' \
1879                 -e 's/-[UD]_XOPEN_SOURCE\(=[^   ]*\)\?$//g'`
1880
1881                 test "$cf_cv_cc_u_d_options" = yes && \
1882                         CPPFLAGS="$CPPFLAGS -U_XOPEN_SOURCE"
1883                 CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=$cf_cv_xopen_source"
1884         fi
1885         
1886 cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE
1887
1888 cf_save_CFLAGS="$CFLAGS"
1889 cf_save_CPPFLAGS="$CPPFLAGS"
1890
1891
1892 # remove _POSIX_C_SOURCE symbol from $cf_save_CFLAGS
1893 cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \
1894         sed     -e 's/-[UD]_POSIX_C_SOURCE\(=[^         ]*\)\?[         ]/ /g' \
1895                 -e 's/-[UD]_POSIX_C_SOURCE\(=[^         ]*\)\?$//g'`
1896
1897
1898 # remove _POSIX_C_SOURCE symbol from $cf_save_CPPFLAGS
1899 cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \
1900         sed     -e 's/-[UD]_POSIX_C_SOURCE\(=[^         ]*\)\?[         ]/ /g' \
1901                 -e 's/-[UD]_POSIX_C_SOURCE\(=[^         ]*\)\?$//g'`
1902
1903
1904 echo $ac_n "checking if we should define _POSIX_C_SOURCE""... $ac_c" 1>&6
1905 echo "configure:1906: checking if we should define _POSIX_C_SOURCE" >&5
1906 if eval "test \"`echo '$''{'cf_cv_posix_c_source'+set}'`\" = set"; then
1907   echo $ac_n "(cached) $ac_c" 1>&6
1908 else
1909   
1910         
1911 echo "${as_me-configure}:1912: testing if the symbol is already defined go no further ..." 1>&5
1912
1913         cat > conftest.$ac_ext <<EOF
1914 #line 1915 "configure"
1915 #include "confdefs.h"
1916 #include <sys/types.h>
1917 int main() {
1918
1919 #ifndef _POSIX_C_SOURCE
1920 make an error
1921 #endif
1922 ; return 0; }
1923 EOF
1924 if { (eval echo configure:1925: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
1925   rm -rf conftest*
1926   cf_cv_posix_c_source=no
1927 else
1928   echo "configure: failed program was:" >&5
1929   cat conftest.$ac_ext >&5
1930   rm -rf conftest*
1931   cf_want_posix_source=no
1932          case .$cf_POSIX_C_SOURCE in #(vi
1933          .[12]??*) #(vi
1934                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
1935                 ;;
1936          .2) #(vi
1937                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
1938                 cf_want_posix_source=yes
1939                 ;;
1940          .*)
1941                 cf_want_posix_source=yes
1942                 ;;
1943          esac
1944          if test "$cf_want_posix_source" = yes ; then
1945                 cat > conftest.$ac_ext <<EOF
1946 #line 1947 "configure"
1947 #include "confdefs.h"
1948 #include <sys/types.h>
1949 int main() {
1950
1951 #ifdef _POSIX_SOURCE
1952 make an error
1953 #endif
1954 ; return 0; }
1955 EOF
1956 if { (eval echo configure:1957: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
1957   :
1958 else
1959   echo "configure: failed program was:" >&5
1960   cat conftest.$ac_ext >&5
1961   rm -rf conftest*
1962   cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE"
1963 fi
1964 rm -f conftest*
1965          fi
1966          
1967 echo "${as_me-configure}:1968: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
1968
1969          CFLAGS="$cf_trim_CFLAGS"
1970          CPPFLAGS="$cf_trim_CPPFLAGS $cf_cv_posix_c_source"
1971          
1972 echo "${as_me-configure}:1973: testing if the second compile does not leave our definition intact error ..." 1>&5
1973
1974          cat > conftest.$ac_ext <<EOF
1975 #line 1976 "configure"
1976 #include "confdefs.h"
1977 #include <sys/types.h>
1978 int main() {
1979
1980 #ifndef _POSIX_C_SOURCE
1981 make an error
1982 #endif
1983 ; return 0; }
1984 EOF
1985 if { (eval echo configure:1986: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
1986   :
1987 else
1988   echo "configure: failed program was:" >&5
1989   cat conftest.$ac_ext >&5
1990   rm -rf conftest*
1991   cf_cv_posix_c_source=no
1992 fi
1993 rm -f conftest*
1994          CFLAGS="$cf_save_CFLAGS"
1995          CPPFLAGS="$cf_save_CPPFLAGS"
1996         
1997 fi
1998 rm -f conftest*
1999
2000 fi
2001
2002 echo "$ac_t""$cf_cv_posix_c_source" 1>&6
2003
2004 if test "$cf_cv_posix_c_source" != no ; then
2005         CFLAGS="$cf_trim_CFLAGS"
2006         CPPFLAGS="$cf_trim_CPPFLAGS"
2007         if test "$cf_cv_cc_u_d_options" = yes ; then
2008                 cf_temp_posix_c_source=`echo "$cf_cv_posix_c_source" | \
2009                                 sed -e 's/-D/-U/g' -e 's/=[^    ]*//g'`
2010                 CPPFLAGS="$CPPFLAGS $cf_temp_posix_c_source"
2011         fi
2012         CPPFLAGS="$CPPFLAGS $cf_cv_posix_c_source"
2013 fi
2014
2015
2016         ;;
2017 esac
2018
2019 echo $ac_n "checking for working const""... $ac_c" 1>&6
2020 echo "configure:2021: checking for working const" >&5
2021 if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then
2022   echo $ac_n "(cached) $ac_c" 1>&6
2023 else
2024   cat > conftest.$ac_ext <<EOF
2025 #line 2026 "configure"
2026 #include "confdefs.h"
2027
2028 int main() {
2029
2030 /* Ultrix mips cc rejects this.  */
2031 typedef int charset[2]; const charset x;
2032 /* SunOS 4.1.1 cc rejects this.  */
2033 char const *const *ccp;
2034 char **p;
2035 /* NEC SVR4.0.2 mips cc rejects this.  */
2036 struct point {int x, y;};
2037 static struct point const zero = {0,0};
2038 /* AIX XL C 1.02.0.0 rejects this.
2039    It does not let you subtract one const X* pointer from another in an arm
2040    of an if-expression whose if-part is not a constant expression */
2041 const char *g = "string";
2042 ccp = &g + (g ? g-g : 0);
2043 /* HPUX 7.0 cc rejects these. */
2044 ++ccp;
2045 p = (char**) ccp;
2046 ccp = (char const *const *) p;
2047 { /* SCO 3.2v4 cc rejects this.  */
2048   char *t;
2049   char const *s = 0 ? (char *) 0 : (char const *) 0;
2050
2051   *t++ = 0;
2052 }
2053 { /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  */
2054   int x[] = {25, 17};
2055   const int *foo = &x[0];
2056   ++foo;
2057 }
2058 { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
2059   typedef const int *iptr;
2060   iptr p = 0;
2061   ++p;
2062 }
2063 { /* AIX XL C 1.02.0.0 rejects this saying
2064      "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
2065   struct s { int j; const int *ap[3]; };
2066   struct s *b; b->j = 5;
2067 }
2068 { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
2069   const int foo = 10;
2070 }
2071
2072 ; return 0; }
2073 EOF
2074 if { (eval echo configure:2075: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
2075   rm -rf conftest*
2076   ac_cv_c_const=yes
2077 else
2078   echo "configure: failed program was:" >&5
2079   cat conftest.$ac_ext >&5
2080   rm -rf conftest*
2081   ac_cv_c_const=no
2082 fi
2083 rm -f conftest*
2084 fi
2085
2086 echo "$ac_t""$ac_cv_c_const" 1>&6
2087 if test $ac_cv_c_const = no; then
2088   cat >> confdefs.h <<\EOF
2089 #define const 
2090 EOF
2091
2092 fi
2093
2094
2095 echo $ac_n "checking for signal global datatype""... $ac_c" 1>&6
2096 echo "configure:2097: checking for signal global datatype" >&5
2097 if eval "test \"`echo '$''{'cf_cv_sig_atomic_t'+set}'`\" = set"; then
2098   echo $ac_n "(cached) $ac_c" 1>&6
2099 else
2100   
2101         for cf_type in \
2102                 "volatile sig_atomic_t" \
2103                 "sig_atomic_t" \
2104                 "int"
2105         do
2106         cat > conftest.$ac_ext <<EOF
2107 #line 2108 "configure"
2108 #include "confdefs.h"
2109
2110 #include <sys/types.h>
2111 #include <signal.h>
2112 #include <stdio.h>
2113
2114 extern $cf_type x;
2115 $cf_type x;
2116 static void handler(int sig)
2117 {
2118         x = 5;
2119 }
2120 int main() {
2121 signal(SIGINT, handler);
2122                  x = 1
2123 ; return 0; }
2124 EOF
2125 if { (eval echo configure:2126: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
2126   rm -rf conftest*
2127   cf_cv_sig_atomic_t=$cf_type
2128 else
2129   echo "configure: failed program was:" >&5
2130   cat conftest.$ac_ext >&5
2131   rm -rf conftest*
2132   cf_cv_sig_atomic_t=no
2133 fi
2134 rm -f conftest*
2135                 test "$cf_cv_sig_atomic_t" != no && break
2136         done
2137         
2138 fi
2139
2140 echo "$ac_t""$cf_cv_sig_atomic_t" 1>&6
2141 test "$cf_cv_sig_atomic_t" != no && cat >> confdefs.h <<EOF
2142 #define SIG_ATOMIC_T $cf_cv_sig_atomic_t
2143 EOF
2144
2145
2146
2147
2148 echo $ac_n "checking if you want to see long compiling messages""... $ac_c" 1>&6
2149 echo "configure:2150: checking if you want to see long compiling messages" >&5
2150
2151 # Check whether --enable-echo or --disable-echo was given.
2152 if test "${enable_echo+set}" = set; then
2153   enableval="$enable_echo"
2154   test "$enableval" != no && enableval=yes
2155   if test "$enableval" != "yes" ; then
2156     
2157     ECHO_LT='--silent'
2158     ECHO_LD='@echo linking $@;'
2159     RULE_CC='   @echo compiling $<'
2160     SHOW_CC='   @echo compiling $@'
2161     ECHO_CC='@'
2162  
2163   else
2164     
2165     ECHO_LT=''
2166     ECHO_LD=''
2167     RULE_CC='# compiling'
2168     SHOW_CC='# compiling'
2169     ECHO_CC=''
2170
2171   fi
2172 else
2173   enableval=yes 
2174   
2175     ECHO_LT=''
2176     ECHO_LD=''
2177     RULE_CC='# compiling'
2178     SHOW_CC='# compiling'
2179     ECHO_CC=''
2180
2181   
2182 fi
2183
2184 echo "$ac_t""$enableval" 1>&6
2185
2186
2187
2188
2189
2190
2191
2192
2193 GCC_VERSION=none
2194 if test "$GCC" = yes ; then
2195         echo $ac_n "checking version of $CC""... $ac_c" 1>&6
2196 echo "configure:2197: checking version of $CC" >&5
2197         GCC_VERSION="`${CC} --version| sed -e '2,$d' -e 's/^.*(GCC) //' -e 's/^[^0-9.]*//' -e 's/[^0-9.].*//'`"
2198         test -z "$GCC_VERSION" && GCC_VERSION=unknown
2199         echo "$ac_t""$GCC_VERSION" 1>&6
2200 fi
2201
2202
2203 if ( test "$GCC" = yes || test "$GXX" = yes )
2204 then
2205 echo $ac_n "checking if you want to turn on gcc warnings""... $ac_c" 1>&6
2206 echo "configure:2207: checking if you want to turn on gcc warnings" >&5
2207
2208 # Check whether --enable-warnings or --disable-warnings was given.
2209 if test "${enable_warnings+set}" = set; then
2210   enableval="$enable_warnings"
2211   test "$enableval" != yes && enableval=no
2212   if test "$enableval" != "no" ; then
2213     with_warnings=yes 
2214   else
2215     with_warnings=no
2216   fi
2217 else
2218   enableval=no 
2219   with_warnings=no
2220   
2221 fi
2222
2223 echo "$ac_t""$with_warnings" 1>&6
2224 if test "$with_warnings" = "yes"
2225 then
2226         
2227
2228
2229 INTEL_COMPILER=no
2230
2231 if test "$GCC" = yes ; then
2232         case $host_os in
2233         linux*|gnu*)
2234                 echo $ac_n "checking if this is really Intel C compiler""... $ac_c" 1>&6
2235 echo "configure:2236: checking if this is really Intel C compiler" >&5
2236                 cf_save_CFLAGS="$CFLAGS"
2237                 CFLAGS="$CFLAGS -no-gcc"
2238                 cat > conftest.$ac_ext <<EOF
2239 #line 2240 "configure"
2240 #include "confdefs.h"
2241
2242 int main() {
2243
2244 #ifdef __INTEL_COMPILER
2245 #else
2246 make an error
2247 #endif
2248
2249 ; return 0; }
2250 EOF
2251 if { (eval echo configure:2252: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
2252   rm -rf conftest*
2253   INTEL_COMPILER=yes
2254 cf_save_CFLAGS="$cf_save_CFLAGS -we147 -no-gcc"
2255
2256 else
2257   echo "configure: failed program was:" >&5
2258   cat conftest.$ac_ext >&5
2259 fi
2260 rm -f conftest*
2261                 CFLAGS="$cf_save_CFLAGS"
2262                 echo "$ac_t""$INTEL_COMPILER" 1>&6
2263                 ;;
2264         esac
2265 fi
2266
2267
2268 cat > conftest.$ac_ext <<EOF
2269 #line 2270 "${as_me-configure}"
2270 int main(int argc, char *argv[]) { return (argv[argc-1] == 0) ; }
2271 EOF
2272
2273 if test "$INTEL_COMPILER" = yes
2274 then
2275 # The "-wdXXX" options suppress warnings:
2276 # remark #1419: external declaration in primary source file
2277 # remark #1683: explicit conversion of a 64-bit integral type to a smaller integral type (potential portability problem)
2278 # remark #1684: conversion from pointer to same-sized integral type (potential portability problem)
2279 # remark #193: zero used for undefined preprocessing identifier
2280 # remark #593: variable "curs_sb_left_arrow" was set but never used
2281 # remark #810: conversion from "int" to "Dimension={unsigned short}" may lose significant bits
2282 # remark #869: parameter "tw" was never referenced
2283 # remark #981: operands are evaluated in unspecified order
2284 # warning #279: controlling expression is constant
2285
2286         echo "checking for $CC warning options" 1>&6
2287 echo "configure:2288: checking for $CC warning options" >&5
2288         cf_save_CFLAGS="$CFLAGS"
2289         EXTRA_CFLAGS="-Wall"
2290         for cf_opt in \
2291                 wd1419 \
2292                 wd1683 \
2293                 wd1684 \
2294                 wd193 \
2295                 wd593 \
2296                 wd279 \
2297                 wd810 \
2298                 wd869 \
2299                 wd981
2300         do
2301                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
2302                 if { (eval echo configure:2303: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
2303                         test -n "$verbose" && echo "$ac_t""... -$cf_opt" 1>&6
2304                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
2305                 fi
2306         done
2307         CFLAGS="$cf_save_CFLAGS"
2308
2309 elif test "$GCC" = yes
2310 then
2311         echo "checking for $CC warning options" 1>&6
2312 echo "configure:2313: checking for $CC warning options" >&5
2313         cf_save_CFLAGS="$CFLAGS"
2314         EXTRA_CFLAGS="-W -Wall"
2315         cf_warn_CONST=""
2316         test "$with_ext_const" = yes && cf_warn_CONST="Wwrite-strings"
2317         for cf_opt in \
2318                 Wbad-function-cast \
2319                 Wcast-align \
2320                 Wcast-qual \
2321                 Winline \
2322                 Wmissing-declarations \
2323                 Wmissing-prototypes \
2324                 Wnested-externs \
2325                 Wpointer-arith \
2326                 Wshadow \
2327                 Wstrict-prototypes \
2328                 Wundef $cf_warn_CONST 
2329         do
2330                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
2331                 if { (eval echo configure:2332: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
2332                         test -n "$verbose" && echo "$ac_t""... -$cf_opt" 1>&6
2333                         case $cf_opt in #(vi
2334                         Wcast-qual) #(vi
2335                                 CPPFLAGS="$CPPFLAGS -DXTSTRINGDEFINES"
2336                                 ;;
2337                         Winline) #(vi
2338                                 case $GCC_VERSION in
2339                                 [34].*)
2340                                         test -n "$verbose" && echo "    feature is broken in gcc $GCC_VERSION" 1>&6
2341
2342 echo "${as_me-configure}:2343: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
2343
2344
2345                                         continue;;
2346                                 esac
2347                                 ;;
2348                         esac
2349                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
2350                 fi
2351         done
2352         CFLAGS="$cf_save_CFLAGS"
2353 fi
2354 rm -f conftest*
2355
2356
2357
2358 fi
2359 fi
2360
2361
2362
2363
2364 # Check whether --with-curses-dir or --without-curses-dir was given.
2365 if test "${with_curses_dir+set}" = set; then
2366   withval="$with_curses_dir"
2367   
2368 if test "x$prefix" != xNONE; then
2369   cf_path_syntax="$prefix"
2370 else
2371   cf_path_syntax="$ac_default_prefix"
2372 fi
2373
2374 case ".$withval" in #(vi
2375 .\$\(*\)*|.\'*\'*) #(vi
2376   ;;
2377 ..|./*|.\\*) #(vi
2378   ;;
2379 .[a-zA-Z]:[\\/]*) #(vi OS/2 EMX
2380   ;;
2381 .\${*prefix}*) #(vi
2382   eval withval="$withval"
2383   case ".$withval" in #(vi
2384   .NONE/*)
2385     withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
2386     ;;
2387   esac
2388   ;; #(vi
2389 .no|.NONE/*)
2390   withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
2391   ;;
2392 *)
2393   { echo "configure: error: expected a pathname, not \"$withval\"" 1>&2; exit 1; }
2394   ;;
2395 esac
2396
2397          cf_cv_curses_dir=$withval
2398 else
2399   cf_cv_curses_dir=no
2400 fi
2401
2402
2403
2404
2405 # Check whether --with-5lib or --without-5lib was given.
2406 if test "${with_5lib+set}" = set; then
2407   withval="$with_5lib"
2408   LIBS="-L/usr/5lib $LIBS"
2409          CPPFLAGS="$CPPFLAGS -I/usr/5include"
2410 fi
2411
2412
2413
2414 # Check whether --with-ncursesw or --without-ncursesw was given.
2415 if test "${with_ncursesw+set}" = set; then
2416   withval="$with_ncursesw"
2417   cf_cv_screen=ncursesw
2418 else
2419   
2420
2421
2422 # Check whether --with-ncurses or --without-ncurses was given.
2423 if test "${with_ncurses+set}" = set; then
2424   withval="$with_ncurses"
2425   cf_cv_screen=ncurses
2426 else
2427   
2428
2429
2430 # Check whether --with-pdcurses or --without-pdcurses was given.
2431 if test "${with_pdcurses+set}" = set; then
2432   withval="$with_pdcurses"
2433   cf_cv_screen=pdcurses
2434 fi
2435
2436 fi
2437
2438 fi
2439
2440
2441 case $cf_cv_screen in
2442 curses)
2443         
2444
2445
2446 echo $ac_n "checking for extra include directories""... $ac_c" 1>&6
2447 echo "configure:2448: checking for extra include directories" >&5
2448 if eval "test \"`echo '$''{'cf_cv_curses_incdir'+set}'`\" = set"; then
2449   echo $ac_n "(cached) $ac_c" 1>&6
2450 else
2451   
2452 cf_cv_curses_incdir=no
2453 case $host_os in #(vi
2454 hpux10.*) #(vi
2455         test -d /usr/include/curses_colr && \
2456         cf_cv_curses_incdir="-I/usr/include/curses_colr"
2457         ;;
2458 sunos3*|sunos4*)
2459         test -d /usr/5lib && \
2460         test -d /usr/5include && \
2461         cf_cv_curses_incdir="-I/usr/5include"
2462         ;;
2463 esac
2464
2465 fi
2466
2467 echo "$ac_t""$cf_cv_curses_incdir" 1>&6
2468 test "$cf_cv_curses_incdir" != no && CPPFLAGS="$CPPFLAGS $cf_cv_curses_incdir"
2469
2470
2471 echo $ac_n "checking if we have identified curses headers""... $ac_c" 1>&6
2472 echo "configure:2473: checking if we have identified curses headers" >&5
2473 if eval "test \"`echo '$''{'cf_cv_ncurses_header'+set}'`\" = set"; then
2474   echo $ac_n "(cached) $ac_c" 1>&6
2475 else
2476   
2477 cf_cv_ncurses_header=none
2478 for cf_header in \
2479         curses.h \
2480         ncurses.h \
2481         ncurses/curses.h \
2482         ncurses/ncurses.h
2483 do
2484 cat > conftest.$ac_ext <<EOF
2485 #line 2486 "configure"
2486 #include "confdefs.h"
2487 #include <${cf_header}>
2488 int main() {
2489 initscr(); tgoto("?", 0,0)
2490 ; return 0; }
2491 EOF
2492 if { (eval echo configure:2493: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
2493   rm -rf conftest*
2494   cf_cv_ncurses_header=$cf_header; break
2495 else
2496   echo "configure: failed program was:" >&5
2497   cat conftest.$ac_ext >&5
2498 fi
2499 rm -f conftest*
2500 done
2501
2502 fi
2503
2504 echo "$ac_t""$cf_cv_ncurses_header" 1>&6
2505
2506 if test "$cf_cv_ncurses_header" = none ; then
2507         { echo "configure: error: No curses header-files found" 1>&2; exit 1; }
2508 fi
2509
2510 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
2511 for ac_hdr in $cf_cv_ncurses_header
2512 do
2513 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
2514 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
2515 echo "configure:2516: checking for $ac_hdr" >&5
2516 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
2517   echo $ac_n "(cached) $ac_c" 1>&6
2518 else
2519   cat > conftest.$ac_ext <<EOF
2520 #line 2521 "configure"
2521 #include "confdefs.h"
2522 #include <$ac_hdr>
2523 EOF
2524 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
2525 { (eval echo configure:2526: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
2526 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
2527 if test -z "$ac_err"; then
2528   rm -rf conftest*
2529   eval "ac_cv_header_$ac_safe=yes"
2530 else
2531   echo "$ac_err" >&5
2532   echo "configure: failed program was:" >&5
2533   cat conftest.$ac_ext >&5
2534   rm -rf conftest*
2535   eval "ac_cv_header_$ac_safe=no"
2536 fi
2537 rm -f conftest*
2538 fi
2539 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
2540   echo "$ac_t""yes" 1>&6
2541     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
2542   cat >> confdefs.h <<EOF
2543 #define $ac_tr_hdr 1
2544 EOF
2545  
2546 else
2547   echo "$ac_t""no" 1>&6
2548 fi
2549 done
2550
2551
2552
2553 echo $ac_n "checking for terminfo header""... $ac_c" 1>&6
2554 echo "configure:2555: checking for terminfo header" >&5
2555 if eval "test \"`echo '$''{'cf_cv_term_header'+set}'`\" = set"; then
2556   echo $ac_n "(cached) $ac_c" 1>&6
2557 else
2558   
2559 case ${cf_cv_ncurses_header} in #(vi
2560 */ncurses.h|*/ncursesw.h) #(vi
2561         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
2562         ;;
2563 *)
2564         cf_term_header=term.h
2565         ;;
2566 esac
2567
2568 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
2569 do
2570 cat > conftest.$ac_ext <<EOF
2571 #line 2572 "configure"
2572 #include "confdefs.h"
2573 #include <stdio.h>
2574 #include <${cf_cv_ncurses_header-curses.h}>
2575 #include <$cf_test>
2576
2577 int main() {
2578 int x = auto_left_margin
2579 ; return 0; }
2580 EOF
2581 if { (eval echo configure:2582: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
2582   rm -rf conftest*
2583   
2584         cf_cv_term_header="$cf_test"
2585 else
2586   echo "configure: failed program was:" >&5
2587   cat conftest.$ac_ext >&5
2588   rm -rf conftest*
2589   
2590         cf_cv_term_header=unknown
2591         
2592 fi
2593 rm -f conftest*
2594         test "$cf_cv_term_header" != unknown && break
2595 done
2596
2597 fi
2598
2599 echo "$ac_t""$cf_cv_term_header" 1>&6
2600
2601 # Set definitions to allow ifdef'ing to accommodate subdirectories
2602
2603 case $cf_cv_term_header in # (vi
2604 *term.h)
2605         cat >> confdefs.h <<\EOF
2606 #define HAVE_TERM_H 1
2607 EOF
2608
2609         ;;
2610 esac
2611
2612 case $cf_cv_term_header in # (vi
2613 ncurses/term.h) #(vi
2614         cat >> confdefs.h <<\EOF
2615 #define HAVE_NCURSES_TERM_H 1
2616 EOF
2617
2618         ;;
2619 ncursesw/term.h)
2620         cat >> confdefs.h <<\EOF
2621 #define HAVE_NCURSESW_TERM_H 1
2622 EOF
2623
2624         ;;
2625 esac
2626
2627
2628
2629 echo $ac_n "checking for ncurses version""... $ac_c" 1>&6
2630 echo "configure:2631: checking for ncurses version" >&5
2631 if eval "test \"`echo '$''{'cf_cv_ncurses_version'+set}'`\" = set"; then
2632   echo $ac_n "(cached) $ac_c" 1>&6
2633 else
2634   
2635         cf_cv_ncurses_version=no
2636         cf_tempfile=out$$
2637         rm -f $cf_tempfile
2638         if test "$cross_compiling" = yes; then
2639   
2640
2641         # This will not work if the preprocessor splits the line after the
2642         # Autoconf token.  The 'unproto' program does that.
2643         cat > conftest.$ac_ext <<EOF
2644 #include <${cf_cv_ncurses_header-curses.h}>
2645 #undef Autoconf
2646 #ifdef NCURSES_VERSION
2647 Autoconf NCURSES_VERSION
2648 #else
2649 #ifdef __NCURSES_H
2650 Autoconf "old"
2651 #endif
2652 ;
2653 #endif
2654 EOF
2655         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
2656         { (eval echo configure:2657: \"$cf_try\") 1>&5; (eval $cf_try) 2>&5; }
2657         if test -f conftest.out ; then
2658                 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
2659                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
2660                 rm -f conftest.out
2661         fi
2662
2663 else
2664   cat > conftest.$ac_ext <<EOF
2665 #line 2666 "configure"
2666 #include "confdefs.h"
2667
2668 #include <${cf_cv_ncurses_header-curses.h}>
2669 #include <stdio.h>
2670 int main()
2671 {
2672         FILE *fp = fopen("$cf_tempfile", "w");
2673 #ifdef NCURSES_VERSION
2674 # ifdef NCURSES_VERSION_PATCH
2675         fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
2676 # else
2677         fprintf(fp, "%s\n", NCURSES_VERSION);
2678 # endif
2679 #else
2680 # ifdef __NCURSES_H
2681         fprintf(fp, "old\n");
2682 # else
2683         make an error
2684 # endif
2685 #endif
2686         ${cf_cv_main_return-return}(0);
2687 }
2688 EOF
2689 if { (eval echo configure:2690: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
2690 then
2691   
2692         cf_cv_ncurses_version=`cat $cf_tempfile`
2693 else
2694   echo "configure: failed program was:" >&5
2695   cat conftest.$ac_ext >&5
2696 fi
2697 rm -fr conftest*
2698 fi
2699
2700         rm -f $cf_tempfile
2701
2702 fi
2703
2704 echo "$ac_t""$cf_cv_ncurses_version" 1>&6
2705 test "$cf_cv_ncurses_version" = no || cat >> confdefs.h <<\EOF
2706 #define NCURSES 1
2707 EOF
2708
2709
2710
2711
2712 echo $ac_n "checking if we have identified curses libraries""... $ac_c" 1>&6
2713 echo "configure:2714: checking if we have identified curses libraries" >&5
2714 cat > conftest.$ac_ext <<EOF
2715 #line 2716 "configure"
2716 #include "confdefs.h"
2717 #include <${cf_cv_ncurses_header-curses.h}>
2718 int main() {
2719 initscr(); tgoto("?", 0,0)
2720 ; return 0; }
2721 EOF
2722 if { (eval echo configure:2723: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2723   rm -rf conftest*
2724   cf_result=yes
2725 else
2726   echo "configure: failed program was:" >&5
2727   cat conftest.$ac_ext >&5
2728   rm -rf conftest*
2729   cf_result=no
2730 fi
2731 rm -f conftest*
2732 echo "$ac_t""$cf_result" 1>&6
2733
2734 if test "$cf_result" = no ; then
2735 case $host_os in #(vi
2736 freebsd*) #(vi
2737     echo $ac_n "checking for tgoto in -lmytinfo""... $ac_c" 1>&6
2738 echo "configure:2739: checking for tgoto in -lmytinfo" >&5
2739 ac_lib_var=`echo mytinfo'_'tgoto | sed 'y%./+-%__p_%'`
2740 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
2741   echo $ac_n "(cached) $ac_c" 1>&6
2742 else
2743   ac_save_LIBS="$LIBS"
2744 LIBS="-lmytinfo  $LIBS"
2745 cat > conftest.$ac_ext <<EOF
2746 #line 2747 "configure"
2747 #include "confdefs.h"
2748 /* Override any gcc2 internal prototype to avoid an error.  */
2749 /* We use char because int might match the return type of a gcc2
2750     builtin and then its argument prototype would still apply.  */
2751 char tgoto();
2752
2753 int main() {
2754 tgoto()
2755 ; return 0; }
2756 EOF
2757 if { (eval echo configure:2758: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2758   rm -rf conftest*
2759   eval "ac_cv_lib_$ac_lib_var=yes"
2760 else
2761   echo "configure: failed program was:" >&5
2762   cat conftest.$ac_ext >&5
2763   rm -rf conftest*
2764   eval "ac_cv_lib_$ac_lib_var=no"
2765 fi
2766 rm -f conftest*
2767 LIBS="$ac_save_LIBS"
2768
2769 fi
2770 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
2771   echo "$ac_t""yes" 1>&6
2772   LIBS="-lmytinfo $LIBS"
2773 else
2774   echo "$ac_t""no" 1>&6
2775 fi
2776
2777     ;;
2778 hpux10.*) #(vi
2779     echo $ac_n "checking for initscr in -lcur_colr""... $ac_c" 1>&6
2780 echo "configure:2781: checking for initscr in -lcur_colr" >&5
2781 ac_lib_var=`echo cur_colr'_'initscr | sed 'y%./+-%__p_%'`
2782 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
2783   echo $ac_n "(cached) $ac_c" 1>&6
2784 else
2785   ac_save_LIBS="$LIBS"
2786 LIBS="-lcur_colr  $LIBS"
2787 cat > conftest.$ac_ext <<EOF
2788 #line 2789 "configure"
2789 #include "confdefs.h"
2790 /* Override any gcc2 internal prototype to avoid an error.  */
2791 /* We use char because int might match the return type of a gcc2
2792     builtin and then its argument prototype would still apply.  */
2793 char initscr();
2794
2795 int main() {
2796 initscr()
2797 ; return 0; }
2798 EOF
2799 if { (eval echo configure:2800: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2800   rm -rf conftest*
2801   eval "ac_cv_lib_$ac_lib_var=yes"
2802 else
2803   echo "configure: failed program was:" >&5
2804   cat conftest.$ac_ext >&5
2805   rm -rf conftest*
2806   eval "ac_cv_lib_$ac_lib_var=no"
2807 fi
2808 rm -f conftest*
2809 LIBS="$ac_save_LIBS"
2810
2811 fi
2812 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
2813   echo "$ac_t""yes" 1>&6
2814   
2815         LIBS="-lcur_colr $LIBS"
2816         ac_cv_func_initscr=yes
2817         
2818 else
2819   echo "$ac_t""no" 1>&6
2820
2821     echo $ac_n "checking for initscr in -lHcurses""... $ac_c" 1>&6
2822 echo "configure:2823: checking for initscr in -lHcurses" >&5
2823 ac_lib_var=`echo Hcurses'_'initscr | sed 'y%./+-%__p_%'`
2824 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
2825   echo $ac_n "(cached) $ac_c" 1>&6
2826 else
2827   ac_save_LIBS="$LIBS"
2828 LIBS="-lHcurses  $LIBS"
2829 cat > conftest.$ac_ext <<EOF
2830 #line 2831 "configure"
2831 #include "confdefs.h"
2832 /* Override any gcc2 internal prototype to avoid an error.  */
2833 /* We use char because int might match the return type of a gcc2
2834     builtin and then its argument prototype would still apply.  */
2835 char initscr();
2836
2837 int main() {
2838 initscr()
2839 ; return 0; }
2840 EOF
2841 if { (eval echo configure:2842: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2842   rm -rf conftest*
2843   eval "ac_cv_lib_$ac_lib_var=yes"
2844 else
2845   echo "configure: failed program was:" >&5
2846   cat conftest.$ac_ext >&5
2847   rm -rf conftest*
2848   eval "ac_cv_lib_$ac_lib_var=no"
2849 fi
2850 rm -f conftest*
2851 LIBS="$ac_save_LIBS"
2852
2853 fi
2854 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
2855   echo "$ac_t""yes" 1>&6
2856   
2857         # HP's header uses __HP_CURSES, but user claims _HP_CURSES.
2858         LIBS="-lHcurses $LIBS"
2859         CPPFLAGS="$CPPFLAGS -D__HP_CURSES -D_HP_CURSES"
2860         ac_cv_func_initscr=yes
2861         
2862 else
2863   echo "$ac_t""no" 1>&6
2864 fi
2865
2866 fi
2867
2868     ;;
2869 linux*) # Suse Linux does not follow /usr/lib convention
2870     
2871 if test -n "/lib" ; then
2872   for cf_add_libdir in /lib
2873   do
2874     if test $cf_add_libdir = /usr/lib ; then
2875       :
2876     elif test -d $cf_add_libdir
2877     then
2878       cf_have_libdir=no
2879       if test -n "$LDFLAGS$LIBS" ; then
2880         # a loop is needed to ensure we can add subdirs of existing dirs
2881         for cf_test_libdir in $LDFLAGS $LIBS ; do
2882           if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
2883             cf_have_libdir=yes; break
2884           fi
2885         done
2886       fi
2887       if test "$cf_have_libdir" = no ; then
2888         test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
2889
2890 echo "${as_me-configure}:2891: testing adding $cf_add_libdir to library-path ..." 1>&5
2891
2892
2893         LDFLAGS="-L$cf_add_libdir $LDFLAGS"
2894       fi
2895     fi
2896   done
2897 fi
2898
2899     ;;
2900 sunos3*|sunos4*)
2901     if test -d /usr/5lib ; then
2902       
2903 if test -n "/usr/5lib" ; then
2904   for cf_add_libdir in /usr/5lib
2905   do
2906     if test $cf_add_libdir = /usr/lib ; then
2907       :
2908     elif test -d $cf_add_libdir
2909     then
2910       cf_have_libdir=no
2911       if test -n "$LDFLAGS$LIBS" ; then
2912         # a loop is needed to ensure we can add subdirs of existing dirs
2913         for cf_test_libdir in $LDFLAGS $LIBS ; do
2914           if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
2915             cf_have_libdir=yes; break
2916           fi
2917         done
2918       fi
2919       if test "$cf_have_libdir" = no ; then
2920         test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
2921
2922 echo "${as_me-configure}:2923: testing adding $cf_add_libdir to library-path ..." 1>&5
2923
2924
2925         LDFLAGS="-L$cf_add_libdir $LDFLAGS"
2926       fi
2927     fi
2928   done
2929 fi
2930
2931       LIBS="$LIBS -lcurses -ltermcap"
2932     fi
2933     ac_cv_func_initscr=yes
2934     ;;
2935 esac
2936
2937 if test ".$ac_cv_func_initscr" != .yes ; then
2938     cf_save_LIBS="$LIBS"
2939     cf_term_lib=""
2940     cf_curs_lib=""
2941
2942     if test ".${cf_cv_ncurses_version-no}" != .no
2943     then
2944         cf_check_list="ncurses curses cursesX"
2945     else
2946         cf_check_list="cursesX curses ncurses"
2947     fi
2948
2949     # Check for library containing tgoto.  Do this before curses library
2950     # because it may be needed to link the test-case for initscr.
2951     echo $ac_n "checking for tgoto""... $ac_c" 1>&6
2952 echo "configure:2953: checking for tgoto" >&5
2953 if eval "test \"`echo '$''{'ac_cv_func_tgoto'+set}'`\" = set"; then
2954   echo $ac_n "(cached) $ac_c" 1>&6
2955 else
2956   cat > conftest.$ac_ext <<EOF
2957 #line 2958 "configure"
2958 #include "confdefs.h"
2959 /* System header to define __stub macros and hopefully few prototypes,
2960     which can conflict with char tgoto(); below.  */
2961 #include <assert.h>
2962 /* Override any gcc2 internal prototype to avoid an error.  */
2963 /* We use char because int might match the return type of a gcc2
2964     builtin and then its argument prototype would still apply.  */
2965 char tgoto();
2966
2967 int main() {
2968
2969 /* The GNU C library defines this for functions which it implements
2970     to always fail with ENOSYS.  Some functions are actually named
2971     something starting with __ and the normal name is an alias.  */
2972 #if defined (__stub_tgoto) || defined (__stub___tgoto)
2973 choke me
2974 #else
2975 tgoto();
2976 #endif
2977
2978 ; return 0; }
2979 EOF
2980 if { (eval echo configure:2981: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2981   rm -rf conftest*
2982   eval "ac_cv_func_tgoto=yes"
2983 else
2984   echo "configure: failed program was:" >&5
2985   cat conftest.$ac_ext >&5
2986   rm -rf conftest*
2987   eval "ac_cv_func_tgoto=no"
2988 fi
2989 rm -f conftest*
2990 fi
2991
2992 if eval "test \"`echo '$ac_cv_func_'tgoto`\" = yes"; then
2993   echo "$ac_t""yes" 1>&6
2994   cf_term_lib=predefined
2995 else
2996   echo "$ac_t""no" 1>&6
2997
2998         for cf_term_lib in $cf_check_list termcap termlib unknown
2999         do
3000             echo $ac_n "checking for tgoto in -l$cf_term_lib""... $ac_c" 1>&6
3001 echo "configure:3002: checking for tgoto in -l$cf_term_lib" >&5
3002 ac_lib_var=`echo $cf_term_lib'_'tgoto | sed 'y%./+-%__p_%'`
3003 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3004   echo $ac_n "(cached) $ac_c" 1>&6
3005 else
3006   ac_save_LIBS="$LIBS"
3007 LIBS="-l$cf_term_lib  $LIBS"
3008 cat > conftest.$ac_ext <<EOF
3009 #line 3010 "configure"
3010 #include "confdefs.h"
3011 /* Override any gcc2 internal prototype to avoid an error.  */
3012 /* We use char because int might match the return type of a gcc2
3013     builtin and then its argument prototype would still apply.  */
3014 char tgoto();
3015
3016 int main() {
3017 tgoto()
3018 ; return 0; }
3019 EOF
3020 if { (eval echo configure:3021: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3021   rm -rf conftest*
3022   eval "ac_cv_lib_$ac_lib_var=yes"
3023 else
3024   echo "configure: failed program was:" >&5
3025   cat conftest.$ac_ext >&5
3026   rm -rf conftest*
3027   eval "ac_cv_lib_$ac_lib_var=no"
3028 fi
3029 rm -f conftest*
3030 LIBS="$ac_save_LIBS"
3031
3032 fi
3033 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3034   echo "$ac_t""yes" 1>&6
3035   break
3036 else
3037   echo "$ac_t""no" 1>&6
3038 fi
3039
3040         done
3041     
3042 fi
3043
3044
3045     # Check for library containing initscr
3046     test "$cf_term_lib" != predefined && test "$cf_term_lib" != unknown && LIBS="-l$cf_term_lib $cf_save_LIBS"
3047         for cf_curs_lib in $cf_check_list xcurses jcurses pdcurses unknown
3048     do
3049         echo $ac_n "checking for initscr in -l$cf_curs_lib""... $ac_c" 1>&6
3050 echo "configure:3051: checking for initscr in -l$cf_curs_lib" >&5
3051 ac_lib_var=`echo $cf_curs_lib'_'initscr | sed 'y%./+-%__p_%'`
3052 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3053   echo $ac_n "(cached) $ac_c" 1>&6
3054 else
3055   ac_save_LIBS="$LIBS"
3056 LIBS="-l$cf_curs_lib  $LIBS"
3057 cat > conftest.$ac_ext <<EOF
3058 #line 3059 "configure"
3059 #include "confdefs.h"
3060 /* Override any gcc2 internal prototype to avoid an error.  */
3061 /* We use char because int might match the return type of a gcc2
3062     builtin and then its argument prototype would still apply.  */
3063 char initscr();
3064
3065 int main() {
3066 initscr()
3067 ; return 0; }
3068 EOF
3069 if { (eval echo configure:3070: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3070   rm -rf conftest*
3071   eval "ac_cv_lib_$ac_lib_var=yes"
3072 else
3073   echo "configure: failed program was:" >&5
3074   cat conftest.$ac_ext >&5
3075   rm -rf conftest*
3076   eval "ac_cv_lib_$ac_lib_var=no"
3077 fi
3078 rm -f conftest*
3079 LIBS="$ac_save_LIBS"
3080
3081 fi
3082 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3083   echo "$ac_t""yes" 1>&6
3084   break
3085 else
3086   echo "$ac_t""no" 1>&6
3087 fi
3088
3089     done
3090     test $cf_curs_lib = unknown && { echo "configure: error: no curses library found" 1>&2; exit 1; }
3091
3092     LIBS="-l$cf_curs_lib $cf_save_LIBS"
3093     if test "$cf_term_lib" = unknown ; then
3094         echo $ac_n "checking if we can link with $cf_curs_lib library""... $ac_c" 1>&6
3095 echo "configure:3096: checking if we can link with $cf_curs_lib library" >&5
3096         cat > conftest.$ac_ext <<EOF
3097 #line 3098 "configure"
3098 #include "confdefs.h"
3099 #include <${cf_cv_ncurses_header-curses.h}>
3100 int main() {
3101 initscr()
3102 ; return 0; }
3103 EOF
3104 if { (eval echo configure:3105: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3105   rm -rf conftest*
3106   cf_result=yes
3107 else
3108   echo "configure: failed program was:" >&5
3109   cat conftest.$ac_ext >&5
3110   rm -rf conftest*
3111   cf_result=no
3112 fi
3113 rm -f conftest*
3114         echo "$ac_t""$cf_result" 1>&6
3115         test $cf_result = no && { echo "configure: error: Cannot link curses library" 1>&2; exit 1; }
3116     elif test "$cf_curs_lib" = "$cf_term_lib" ; then
3117         :
3118     elif test "$cf_term_lib" != predefined ; then
3119         echo $ac_n "checking if we need both $cf_curs_lib and $cf_term_lib libraries""... $ac_c" 1>&6
3120 echo "configure:3121: checking if we need both $cf_curs_lib and $cf_term_lib libraries" >&5
3121         cat > conftest.$ac_ext <<EOF
3122 #line 3123 "configure"
3123 #include "confdefs.h"
3124 #include <${cf_cv_ncurses_header-curses.h}>
3125 int main() {
3126 initscr(); tgoto((char *)0, 0, 0);
3127 ; return 0; }
3128 EOF
3129 if { (eval echo configure:3130: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3130   rm -rf conftest*
3131   cf_result=no
3132 else
3133   echo "configure: failed program was:" >&5
3134   cat conftest.$ac_ext >&5
3135   rm -rf conftest*
3136   
3137             LIBS="-l$cf_curs_lib -l$cf_term_lib $cf_save_LIBS"
3138             cat > conftest.$ac_ext <<EOF
3139 #line 3140 "configure"
3140 #include "confdefs.h"
3141 #include <${cf_cv_ncurses_header-curses.h}>
3142 int main() {
3143 initscr()
3144 ; return 0; }
3145 EOF
3146 if { (eval echo configure:3147: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3147   rm -rf conftest*
3148   cf_result=yes
3149 else
3150   echo "configure: failed program was:" >&5
3151   cat conftest.$ac_ext >&5
3152   rm -rf conftest*
3153   cf_result=error
3154 fi
3155 rm -f conftest*
3156             
3157 fi
3158 rm -f conftest*
3159         echo "$ac_t""$cf_result" 1>&6
3160     fi
3161 fi
3162 fi
3163
3164
3165
3166         ;;
3167 ncurses)
3168         
3169 cf_ncuconfig_root=ncurses
3170
3171 echo "Looking for ${cf_ncuconfig_root}-config"
3172 for ac_prog in ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
3173 do
3174 # Extract the first word of "$ac_prog", so it can be a program name with args.
3175 set dummy $ac_prog; ac_word=$2
3176 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3177 echo "configure:3178: checking for $ac_word" >&5
3178 if eval "test \"`echo '$''{'ac_cv_path_NCURSES_CONFIG'+set}'`\" = set"; then
3179   echo $ac_n "(cached) $ac_c" 1>&6
3180 else
3181   case "$NCURSES_CONFIG" in
3182   /*)
3183   ac_cv_path_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test with a path.
3184   ;;
3185   ?:/*)                  
3186   ac_cv_path_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test with a dos path.
3187   ;;
3188   *)
3189   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3190   ac_dummy="$PATH"
3191   for ac_dir in $ac_dummy; do 
3192     test -z "$ac_dir" && ac_dir=.
3193     if test -f $ac_dir/$ac_word; then
3194       ac_cv_path_NCURSES_CONFIG="$ac_dir/$ac_word"
3195       break
3196     fi
3197   done
3198   IFS="$ac_save_ifs"
3199   ;;
3200 esac
3201 fi
3202 NCURSES_CONFIG="$ac_cv_path_NCURSES_CONFIG"
3203 if test -n "$NCURSES_CONFIG"; then
3204   echo "$ac_t""$NCURSES_CONFIG" 1>&6
3205 else
3206   echo "$ac_t""no" 1>&6
3207 fi
3208
3209 test -n "$NCURSES_CONFIG" && break
3210 done
3211 test -n "$NCURSES_CONFIG" || NCURSES_CONFIG="none"
3212
3213
3214 if test "$NCURSES_CONFIG" != none ; then
3215
3216 cf_cv_ncurses_header=curses.h
3217
3218 CPPFLAGS="$CPPFLAGS `$NCURSES_CONFIG --cflags`"
3219 LIBS="`$NCURSES_CONFIG --libs` $LIBS"
3220
3221 cat >> confdefs.h <<\EOF
3222 #define NCURSES 1
3223 EOF
3224
3225
3226
3227 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
3228
3229 cat >> confdefs.h <<EOF
3230 #define $cf_nculib_ROOT 1
3231 EOF
3232
3233
3234 cf_cv_ncurses_version=`$NCURSES_CONFIG --version`
3235
3236 else
3237
3238
3239
3240 cf_ncuhdr_root=ncurses
3241
3242 test -n "$cf_cv_curses_dir" && \
3243 test "$cf_cv_curses_dir" != "no" && { \
3244   
3245 if test -n "$cf_cv_curses_dir/include $cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
3246   for cf_add_incdir in $cf_cv_curses_dir/include $cf_cv_curses_dir/include/$cf_ncuhdr_root
3247   do
3248         while test $cf_add_incdir != /usr/include
3249         do
3250           if test -d $cf_add_incdir
3251           then
3252                 cf_have_incdir=no
3253                 if test -n "$CFLAGS$CPPFLAGS" ; then
3254                   # a loop is needed to ensure we can add subdirs of existing dirs
3255                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
3256                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
3257                           cf_have_incdir=yes; break
3258                         fi
3259                   done
3260                 fi
3261
3262                 if test "$cf_have_incdir" = no ; then
3263                   if test "$cf_add_incdir" = /usr/local/include ; then
3264                         if test "$GCC" = yes
3265                         then
3266                           cf_save_CPPFLAGS=$CPPFLAGS
3267                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
3268                           cat > conftest.$ac_ext <<EOF
3269 #line 3270 "configure"
3270 #include "confdefs.h"
3271 #include <stdio.h>
3272 int main() {
3273 printf("Hello")
3274 ; return 0; }
3275 EOF
3276 if { (eval echo configure:3277: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3277   :
3278 else
3279   echo "configure: failed program was:" >&5
3280   cat conftest.$ac_ext >&5
3281   rm -rf conftest*
3282   cf_have_incdir=yes
3283 fi
3284 rm -f conftest*
3285                           CPPFLAGS=$cf_save_CPPFLAGS
3286                         fi
3287                   fi
3288                 fi
3289
3290                 if test "$cf_have_incdir" = no ; then
3291                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
3292
3293 echo "${as_me-configure}:3294: testing adding $cf_add_incdir to include-path ..." 1>&5
3294
3295
3296                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
3297
3298                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
3299                   test "$cf_top_incdir" = "$cf_add_incdir" && break
3300                   cf_add_incdir="$cf_top_incdir"
3301                 else
3302                   break
3303                 fi
3304           fi
3305         done
3306   done
3307 fi
3308
3309 }
3310
3311 echo $ac_n "checking for $cf_ncuhdr_root header in include-path""... $ac_c" 1>&6
3312 echo "configure:3313: checking for $cf_ncuhdr_root header in include-path" >&5
3313 if eval "test \"`echo '$''{'cf_cv_ncurses_h'+set}'`\" = set"; then
3314   echo $ac_n "(cached) $ac_c" 1>&6
3315 else
3316   
3317         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
3318         ( test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw ) && cf_header_list="$cf_header_list curses.h ncurses.h"
3319         for cf_header in $cf_header_list
3320         do
3321                 
3322         cat > conftest.$ac_ext <<EOF
3323 #line 3324 "configure"
3324 #include "confdefs.h"
3325
3326
3327 #include <$cf_header>
3328 int main() {
3329
3330 #ifdef NCURSES_VERSION
3331
3332 printf("%s\n", NCURSES_VERSION);
3333 #else
3334 #ifdef __NCURSES_H
3335 printf("old\n");
3336 #else
3337         make an error
3338 #endif
3339 #endif
3340         
3341         
3342 ; return 0; }
3343 EOF
3344 if { (eval echo configure:3345: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3345   rm -rf conftest*
3346   cf_cv_ncurses_h=$cf_header
3347         
3348 else
3349   echo "configure: failed program was:" >&5
3350   cat conftest.$ac_ext >&5
3351   rm -rf conftest*
3352   cf_cv_ncurses_h=no
3353 fi
3354 rm -f conftest*
3355
3356                 test "$cf_cv_ncurses_h" != no && break
3357         done
3358
3359 fi
3360
3361 echo "$ac_t""$cf_cv_ncurses_h" 1>&6
3362
3363
3364
3365 if test "$cf_cv_ncurses_h" != no ; then
3366         cf_cv_ncurses_header=$cf_cv_ncurses_h
3367 else
3368
3369 echo $ac_n "checking for $cf_ncuhdr_root include-path""... $ac_c" 1>&6
3370 echo "configure:3371: checking for $cf_ncuhdr_root include-path" >&5
3371 if eval "test \"`echo '$''{'cf_cv_ncurses_h2'+set}'`\" = set"; then
3372   echo $ac_n "(cached) $ac_c" 1>&6
3373 else
3374   
3375         test -n "$verbose" && echo
3376         
3377 cf_header_path_list=""
3378 if test -n "${CFLAGS}${CPPFLAGS}" ; then
3379         for cf_header_path in $CPPFLAGS $CFLAGS
3380         do
3381                 case $cf_header_path in #(vi
3382                 -I*)
3383                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
3384                         
3385 test "$cf_header_path" != "NONE" && \
3386 test -d "$cf_header_path" && \
3387  {
3388         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
3389         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
3390         test -d $cf_header_path/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
3391         test -d $cf_header_path/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
3392         test -d $cf_header_path/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
3393         test -d $cf_header_path/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
3394 }
3395
3396                         cf_header_path_list="$cf_header_path_list $cf_search"
3397                         ;;
3398                 esac
3399         done
3400 fi
3401
3402 cf_search=""
3403
3404
3405 test "/usr" != "$prefix" && \
3406 test -d "/usr" && \
3407 (test $prefix = NONE || test -d $prefix) && {
3408         test -n "$verbose" && echo "    ... testing for include-directories under /usr"
3409         test -d /usr/include &&          cf_search="$cf_search /usr/include"
3410         test -d /usr/include/$cf_ncuhdr_root &&       cf_search="$cf_search /usr/include/$cf_ncuhdr_root"
3411         test -d /usr/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search /usr/include/$cf_ncuhdr_root/include"
3412         test -d /usr/$cf_ncuhdr_root/include &&       cf_search="$cf_search /usr/$cf_ncuhdr_root/include"
3413         test -d /usr/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search /usr/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
3414 }
3415
3416
3417 test "$prefix" != "NONE" && \
3418 test -d "$prefix" && \
3419  {
3420         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
3421         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
3422         test -d $prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
3423         test -d $prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
3424         test -d $prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
3425         test -d $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
3426 }
3427
3428
3429 test "/usr/local" != "$prefix" && \
3430 test -d "/usr/local" && \
3431 (test $prefix = NONE || test -d $prefix) && {
3432         test -n "$verbose" && echo "    ... testing for include-directories under /usr/local"
3433         test -d /usr/local/include &&          cf_search="$cf_search /usr/local/include"
3434         test -d /usr/local/include/$cf_ncuhdr_root &&       cf_search="$cf_search /usr/local/include/$cf_ncuhdr_root"
3435         test -d /usr/local/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search /usr/local/include/$cf_ncuhdr_root/include"
3436         test -d /usr/local/$cf_ncuhdr_root/include &&       cf_search="$cf_search /usr/local/$cf_ncuhdr_root/include"
3437         test -d /usr/local/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search /usr/local/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
3438 }
3439
3440
3441 test "/opt" != "$prefix" && \
3442 test -d "/opt" && \
3443 (test $prefix = NONE || test -d $prefix) && {
3444         test -n "$verbose" && echo "    ... testing for include-directories under /opt"
3445         test -d /opt/include &&          cf_search="$cf_search /opt/include"
3446         test -d /opt/include/$cf_ncuhdr_root &&       cf_search="$cf_search /opt/include/$cf_ncuhdr_root"
3447         test -d /opt/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search /opt/include/$cf_ncuhdr_root/include"
3448         test -d /opt/$cf_ncuhdr_root/include &&       cf_search="$cf_search /opt/$cf_ncuhdr_root/include"
3449         test -d /opt/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search /opt/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
3450 }
3451
3452
3453 test "$HOME" != "$prefix" && \
3454 test -d "$HOME" && \
3455 (test $prefix = NONE || test -d $prefix) && {
3456         test -n "$verbose" && echo "    ... testing for include-directories under $HOME"
3457         test -d $HOME/include &&          cf_search="$cf_search $HOME/include"
3458         test -d $HOME/include/$cf_ncuhdr_root &&       cf_search="$cf_search $HOME/include/$cf_ncuhdr_root"
3459         test -d $HOME/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $HOME/include/$cf_ncuhdr_root/include"
3460         test -d $HOME/$cf_ncuhdr_root/include &&       cf_search="$cf_search $HOME/$cf_ncuhdr_root/include"
3461         test -d $HOME/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $HOME/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
3462 }
3463
3464
3465
3466 test "$includedir" != NONE && \
3467 test "$includedir" != "/usr/include" && \
3468 test -d "$includedir" && {
3469         test -d $includedir &&    cf_search="$cf_search $includedir"
3470         test -d $includedir/$cf_ncuhdr_root && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
3471 }
3472
3473 test "$oldincludedir" != NONE && \
3474 test "$oldincludedir" != "/usr/include" && \
3475 test -d "$oldincludedir" && {
3476         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
3477         test -d $oldincludedir/$cf_ncuhdr_root && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
3478 }
3479
3480 cf_search="$cf_header_path_list $cf_search"
3481
3482         test -n "$verbose" && echo search path $cf_search
3483         cf_save2_CPPFLAGS="$CPPFLAGS"
3484         for cf_incdir in $cf_search
3485         do
3486                 
3487 if test -n "$cf_incdir" ; then
3488   for cf_add_incdir in $cf_incdir
3489   do
3490         while test $cf_add_incdir != /usr/include
3491         do
3492           if test -d $cf_add_incdir
3493           then
3494                 cf_have_incdir=no
3495                 if test -n "$CFLAGS$CPPFLAGS" ; then
3496                   # a loop is needed to ensure we can add subdirs of existing dirs
3497                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
3498                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
3499                           cf_have_incdir=yes; break
3500                         fi
3501                   done
3502                 fi
3503
3504                 if test "$cf_have_incdir" = no ; then
3505                   if test "$cf_add_incdir" = /usr/local/include ; then
3506                         if test "$GCC" = yes
3507                         then
3508                           cf_save_CPPFLAGS=$CPPFLAGS
3509                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
3510                           cat > conftest.$ac_ext <<EOF
3511 #line 3512 "configure"
3512 #include "confdefs.h"
3513 #include <stdio.h>
3514 int main() {
3515 printf("Hello")
3516 ; return 0; }
3517 EOF
3518 if { (eval echo configure:3519: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3519   :
3520 else
3521   echo "configure: failed program was:" >&5
3522   cat conftest.$ac_ext >&5
3523   rm -rf conftest*
3524   cf_have_incdir=yes
3525 fi
3526 rm -f conftest*
3527                           CPPFLAGS=$cf_save_CPPFLAGS
3528                         fi
3529                   fi
3530                 fi
3531
3532                 if test "$cf_have_incdir" = no ; then
3533                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
3534
3535 echo "${as_me-configure}:3536: testing adding $cf_add_incdir to include-path ..." 1>&5
3536
3537
3538                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
3539
3540                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
3541                   test "$cf_top_incdir" = "$cf_add_incdir" && break
3542                   cf_add_incdir="$cf_top_incdir"
3543                 else
3544                   break
3545                 fi
3546           fi
3547         done
3548   done
3549 fi
3550
3551                 for cf_header in \
3552                         ncurses.h \
3553                         curses.h
3554                 do
3555                         
3556         cat > conftest.$ac_ext <<EOF
3557 #line 3558 "configure"
3558 #include "confdefs.h"
3559
3560
3561 #include <$cf_header>
3562 int main() {
3563
3564 #ifdef NCURSES_VERSION
3565
3566 printf("%s\n", NCURSES_VERSION);
3567 #else
3568 #ifdef __NCURSES_H
3569 printf("old\n");
3570 #else
3571         make an error
3572 #endif
3573 #endif
3574         
3575         
3576 ; return 0; }
3577 EOF
3578 if { (eval echo configure:3579: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3579   rm -rf conftest*
3580   cf_cv_ncurses_h2=$cf_header
3581         
3582 else
3583   echo "configure: failed program was:" >&5
3584   cat conftest.$ac_ext >&5
3585   rm -rf conftest*
3586   cf_cv_ncurses_h2=no
3587 fi
3588 rm -f conftest*
3589
3590                         if test "$cf_cv_ncurses_h2" != no ; then
3591                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
3592                                 test -n "$verbose" && echo $ac_n "      ... found $ac_c" 1>&6
3593                                 break
3594                         fi
3595                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
3596                 done
3597                 CPPFLAGS="$cf_save2_CPPFLAGS"
3598                 test "$cf_cv_ncurses_h2" != no && break
3599         done
3600         test "$cf_cv_ncurses_h2" = no && { echo "configure: error: not found" 1>&2; exit 1; }
3601         
3602 fi
3603
3604 echo "$ac_t""$cf_cv_ncurses_h2" 1>&6
3605
3606         cf_1st_incdir=`echo $cf_cv_ncurses_h2 | sed -e 's%/[^/]*$%%'`
3607         cf_cv_ncurses_header=`basename $cf_cv_ncurses_h2`
3608         if test `basename $cf_1st_incdir` = $cf_ncuhdr_root ; then
3609                 cf_cv_ncurses_header=$cf_ncuhdr_root/$cf_cv_ncurses_header
3610         fi
3611         
3612 if test -n "$cf_1st_incdir" ; then
3613   for cf_add_incdir in $cf_1st_incdir
3614   do
3615         while test $cf_add_incdir != /usr/include
3616         do
3617           if test -d $cf_add_incdir
3618           then
3619                 cf_have_incdir=no
3620                 if test -n "$CFLAGS$CPPFLAGS" ; then
3621                   # a loop is needed to ensure we can add subdirs of existing dirs
3622                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
3623                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
3624                           cf_have_incdir=yes; break
3625                         fi
3626                   done
3627                 fi
3628
3629                 if test "$cf_have_incdir" = no ; then
3630                   if test "$cf_add_incdir" = /usr/local/include ; then
3631                         if test "$GCC" = yes
3632                         then
3633                           cf_save_CPPFLAGS=$CPPFLAGS
3634                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
3635                           cat > conftest.$ac_ext <<EOF
3636 #line 3637 "configure"
3637 #include "confdefs.h"
3638 #include <stdio.h>
3639 int main() {
3640 printf("Hello")
3641 ; return 0; }
3642 EOF
3643 if { (eval echo configure:3644: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3644   :
3645 else
3646   echo "configure: failed program was:" >&5
3647   cat conftest.$ac_ext >&5
3648   rm -rf conftest*
3649   cf_have_incdir=yes
3650 fi
3651 rm -f conftest*
3652                           CPPFLAGS=$cf_save_CPPFLAGS
3653                         fi
3654                   fi
3655                 fi
3656
3657                 if test "$cf_have_incdir" = no ; then
3658                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
3659
3660 echo "${as_me-configure}:3661: testing adding $cf_add_incdir to include-path ..." 1>&5
3661
3662
3663                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
3664
3665                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
3666                   test "$cf_top_incdir" = "$cf_add_incdir" && break
3667                   cf_add_incdir="$cf_top_incdir"
3668                 else
3669                   break
3670                 fi
3671           fi
3672         done
3673   done
3674 fi
3675
3676
3677 fi
3678
3679 # Set definitions to allow ifdef'ing for ncurses.h
3680
3681 case $cf_cv_ncurses_header in # (vi
3682 *ncurses.h)
3683         cat >> confdefs.h <<\EOF
3684 #define HAVE_NCURSES_H 1
3685 EOF
3686
3687         ;;
3688 esac
3689
3690 case $cf_cv_ncurses_header in # (vi
3691 ncurses/curses.h|ncurses/ncurses.h)
3692         cat >> confdefs.h <<\EOF
3693 #define HAVE_NCURSES_NCURSES_H 1
3694 EOF
3695
3696         ;;
3697 ncursesw/curses.h|ncursesw/ncurses.h)
3698         cat >> confdefs.h <<\EOF
3699 #define HAVE_NCURSESW_NCURSES_H 1
3700 EOF
3701
3702         ;;
3703 esac
3704
3705
3706
3707 echo $ac_n "checking for terminfo header""... $ac_c" 1>&6
3708 echo "configure:3709: checking for terminfo header" >&5
3709 if eval "test \"`echo '$''{'cf_cv_term_header'+set}'`\" = set"; then
3710   echo $ac_n "(cached) $ac_c" 1>&6
3711 else
3712   
3713 case ${cf_cv_ncurses_header} in #(vi
3714 */ncurses.h|*/ncursesw.h) #(vi
3715         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
3716         ;;
3717 *)
3718         cf_term_header=term.h
3719         ;;
3720 esac
3721
3722 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
3723 do
3724 cat > conftest.$ac_ext <<EOF
3725 #line 3726 "configure"
3726 #include "confdefs.h"
3727 #include <stdio.h>
3728 #include <${cf_cv_ncurses_header-curses.h}>
3729 #include <$cf_test>
3730
3731 int main() {
3732 int x = auto_left_margin
3733 ; return 0; }
3734 EOF
3735 if { (eval echo configure:3736: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3736   rm -rf conftest*
3737   
3738         cf_cv_term_header="$cf_test"
3739 else
3740   echo "configure: failed program was:" >&5
3741   cat conftest.$ac_ext >&5
3742   rm -rf conftest*
3743   
3744         cf_cv_term_header=unknown
3745         
3746 fi
3747 rm -f conftest*
3748         test "$cf_cv_term_header" != unknown && break
3749 done
3750
3751 fi
3752
3753 echo "$ac_t""$cf_cv_term_header" 1>&6
3754
3755 # Set definitions to allow ifdef'ing to accommodate subdirectories
3756
3757 case $cf_cv_term_header in # (vi
3758 *term.h)
3759         cat >> confdefs.h <<\EOF
3760 #define HAVE_TERM_H 1
3761 EOF
3762
3763         ;;
3764 esac
3765
3766 case $cf_cv_term_header in # (vi
3767 ncurses/term.h) #(vi
3768         cat >> confdefs.h <<\EOF
3769 #define HAVE_NCURSES_TERM_H 1
3770 EOF
3771
3772         ;;
3773 ncursesw/term.h)
3774         cat >> confdefs.h <<\EOF
3775 #define HAVE_NCURSESW_TERM_H 1
3776 EOF
3777
3778         ;;
3779 esac
3780
3781
3782 # some applications need this, but should check for NCURSES_VERSION
3783 cat >> confdefs.h <<\EOF
3784 #define NCURSES 1
3785 EOF
3786
3787
3788
3789 echo $ac_n "checking for ncurses version""... $ac_c" 1>&6
3790 echo "configure:3791: checking for ncurses version" >&5
3791 if eval "test \"`echo '$''{'cf_cv_ncurses_version'+set}'`\" = set"; then
3792   echo $ac_n "(cached) $ac_c" 1>&6
3793 else
3794   
3795         cf_cv_ncurses_version=no
3796         cf_tempfile=out$$
3797         rm -f $cf_tempfile
3798         if test "$cross_compiling" = yes; then
3799   
3800
3801         # This will not work if the preprocessor splits the line after the
3802         # Autoconf token.  The 'unproto' program does that.
3803         cat > conftest.$ac_ext <<EOF
3804 #include <${cf_cv_ncurses_header-curses.h}>
3805 #undef Autoconf
3806 #ifdef NCURSES_VERSION
3807 Autoconf NCURSES_VERSION
3808 #else
3809 #ifdef __NCURSES_H
3810 Autoconf "old"
3811 #endif
3812 ;
3813 #endif
3814 EOF
3815         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
3816         { (eval echo configure:3817: \"$cf_try\") 1>&5; (eval $cf_try) 2>&5; }
3817         if test -f conftest.out ; then
3818                 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
3819                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
3820                 rm -f conftest.out
3821         fi
3822
3823 else
3824   cat > conftest.$ac_ext <<EOF
3825 #line 3826 "configure"
3826 #include "confdefs.h"
3827
3828 #include <${cf_cv_ncurses_header-curses.h}>
3829 #include <stdio.h>
3830 int main()
3831 {
3832         FILE *fp = fopen("$cf_tempfile", "w");
3833 #ifdef NCURSES_VERSION
3834 # ifdef NCURSES_VERSION_PATCH
3835         fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
3836 # else
3837         fprintf(fp, "%s\n", NCURSES_VERSION);
3838 # endif
3839 #else
3840 # ifdef __NCURSES_H
3841         fprintf(fp, "old\n");
3842 # else
3843         make an error
3844 # endif
3845 #endif
3846         ${cf_cv_main_return-return}(0);
3847 }
3848 EOF
3849 if { (eval echo configure:3850: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
3850 then
3851   
3852         cf_cv_ncurses_version=`cat $cf_tempfile`
3853 else
3854   echo "configure: failed program was:" >&5
3855   cat conftest.$ac_ext >&5
3856 fi
3857 rm -fr conftest*
3858 fi
3859
3860         rm -f $cf_tempfile
3861
3862 fi
3863
3864 echo "$ac_t""$cf_cv_ncurses_version" 1>&6
3865 test "$cf_cv_ncurses_version" = no || cat >> confdefs.h <<\EOF
3866 #define NCURSES 1
3867 EOF
3868
3869
3870
3871
3872
3873 cf_nculib_root=ncurses
3874         # This works, except for the special case where we find gpm, but
3875         # ncurses is in a nonstandard location via $LIBS, and we really want
3876         # to link gpm.
3877 cf_ncurses_LIBS=""
3878 cf_ncurses_SAVE="$LIBS"
3879 echo $ac_n "checking for Gpm_Open in -lgpm""... $ac_c" 1>&6
3880 echo "configure:3881: checking for Gpm_Open in -lgpm" >&5
3881 ac_lib_var=`echo gpm'_'Gpm_Open | sed 'y%./+-%__p_%'`
3882 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3883   echo $ac_n "(cached) $ac_c" 1>&6
3884 else
3885   ac_save_LIBS="$LIBS"
3886 LIBS="-lgpm  $LIBS"
3887 cat > conftest.$ac_ext <<EOF
3888 #line 3889 "configure"
3889 #include "confdefs.h"
3890 /* Override any gcc2 internal prototype to avoid an error.  */
3891 /* We use char because int might match the return type of a gcc2
3892     builtin and then its argument prototype would still apply.  */
3893 char Gpm_Open();
3894
3895 int main() {
3896 Gpm_Open()
3897 ; return 0; }
3898 EOF
3899 if { (eval echo configure:3900: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3900   rm -rf conftest*
3901   eval "ac_cv_lib_$ac_lib_var=yes"
3902 else
3903   echo "configure: failed program was:" >&5
3904   cat conftest.$ac_ext >&5
3905   rm -rf conftest*
3906   eval "ac_cv_lib_$ac_lib_var=no"
3907 fi
3908 rm -f conftest*
3909 LIBS="$ac_save_LIBS"
3910
3911 fi
3912 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3913   echo "$ac_t""yes" 1>&6
3914   echo $ac_n "checking for initscr in -lgpm""... $ac_c" 1>&6
3915 echo "configure:3916: checking for initscr in -lgpm" >&5
3916 ac_lib_var=`echo gpm'_'initscr | sed 'y%./+-%__p_%'`
3917 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3918   echo $ac_n "(cached) $ac_c" 1>&6
3919 else
3920   ac_save_LIBS="$LIBS"
3921 LIBS="-lgpm  $LIBS"
3922 cat > conftest.$ac_ext <<EOF
3923 #line 3924 "configure"
3924 #include "confdefs.h"
3925 /* Override any gcc2 internal prototype to avoid an error.  */
3926 /* We use char because int might match the return type of a gcc2
3927     builtin and then its argument prototype would still apply.  */
3928 char initscr();
3929
3930 int main() {
3931 initscr()
3932 ; return 0; }
3933 EOF
3934 if { (eval echo configure:3935: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3935   rm -rf conftest*
3936   eval "ac_cv_lib_$ac_lib_var=yes"
3937 else
3938   echo "configure: failed program was:" >&5
3939   cat conftest.$ac_ext >&5
3940   rm -rf conftest*
3941   eval "ac_cv_lib_$ac_lib_var=no"
3942 fi
3943 rm -f c