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