blob: 4f155cd78d0e85162fd522c42fa6160c98881112 [file] [log] [blame]
Steve Kondikae271bc2015-11-15 02:50:53 +01001#! /bin/sh
2# Guess values for system-dependent variables and create Makefiles.
micky3879b9f5e72025-07-08 18:04:53 -04003# Generated by Autoconf 2.52.20231210.
Steve Kondikae271bc2015-11-15 02:50:53 +01004#
micky3879b9f5e72025-07-08 18:04:53 -04005# Copyright 2003-2022,2023 Thomas E. Dickey
Steve Kondikae271bc2015-11-15 02:50:53 +01006# Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
7# Free Software Foundation, Inc.
8# This configure script is free software; the Free Software Foundation
9# gives unlimited permission to copy, distribute and modify it.
10
11# Avoid depending upon Character Ranges.
12as_cr_letters='abcdefghijklmnopqrstuvwxyz'
13as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
14as_cr_Letters=$as_cr_letters$as_cr_LETTERS
15as_cr_digits='0123456789'
16as_cr_alnum=$as_cr_Letters$as_cr_digits
17
18# Sed expression to map a string onto a valid variable name.
19as_tr_sh="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g"
20
21# Sed expression to map a string onto a valid CPP name.
22as_tr_cpp="sed y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g"
23
24# Be Bourne compatible
25if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
26 emulate sh
27 NULLCMD=:
28elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
29 set -o posix
30fi
31
32# Name of the executable.
33as_me=`echo "$0" |sed 's,.*[\\/],,'`
34
35if expr a : '\(a\)' >/dev/null 2>&1; then
micky3879b9f5e72025-07-08 18:04:53 -040036 as_expr="expr"
Steve Kondikae271bc2015-11-15 02:50:53 +010037else
micky3879b9f5e72025-07-08 18:04:53 -040038 as_expr="false"
Steve Kondikae271bc2015-11-15 02:50:53 +010039fi
40
41rm -f conf$$ conf$$.exe conf$$.file
42echo >conf$$.file
43if ln -s conf$$.file conf$$ 2>/dev/null; then
44 # We could just check for DJGPP; but this test a) works b) is more generic
45 # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
46 if test -f conf$$.exe; then
47 # Don't use ln at all; we don't have any links
48 as_ln_s='cp -p'
49 else
50 as_ln_s='ln -s'
51 fi
52elif ln conf$$.file conf$$ 2>/dev/null; then
micky3879b9f5e72025-07-08 18:04:53 -040053 as_ln_s='ln'
Steve Kondikae271bc2015-11-15 02:50:53 +010054else
55 as_ln_s='cp -p'
56fi
57rm -f conf$$ conf$$.exe conf$$.file
58
59as_executable_p="test -f"
60
61# Support unset when possible.
62if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
micky3879b9f5e72025-07-08 18:04:53 -040063 as_unset="unset"
Steve Kondikae271bc2015-11-15 02:50:53 +010064else
micky3879b9f5e72025-07-08 18:04:53 -040065 as_unset="false"
Steve Kondikae271bc2015-11-15 02:50:53 +010066fi
67
68# NLS nuisances.
69$as_unset LANG || test "${LANG+set}" != set || { LANG=C; export LANG; }
70$as_unset LC_ALL || test "${LC_ALL+set}" != set || { LC_ALL=C; export LC_ALL; }
71$as_unset LC_TIME || test "${LC_TIME+set}" != set || { LC_TIME=C; export LC_TIME; }
72$as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set || { LC_CTYPE=C; export LC_CTYPE; }
73$as_unset LANGUAGE || test "${LANGUAGE+set}" != set || { LANGUAGE=C; export LANGUAGE; }
74$as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set || { LC_COLLATE=C; export LC_COLLATE; }
75$as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set || { LC_NUMERIC=C; export LC_NUMERIC; }
76$as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set || { LC_MESSAGES=C; export LC_MESSAGES; }
77
78# IFS
79# We need space, tab and new line, in precisely that order.
80as_nl='
81'
82IFS=" $as_nl"
83
84# CDPATH.
85$as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=:; export CDPATH; }
86
87# Name of the host.
88# hostname on some systems (SVR3.2, Linux) returns a bogus exit status,
89# so uname gets run too.
90ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
91
92exec 6>&1
93
94#
95# Initializations.
96#
97ac_default_prefix=/usr/local
98cross_compiling=no
99subdirs=
micky3879b9f5e72025-07-08 18:04:53 -0400100MFLAGS=
101MAKEFLAGS=
Steve Kondikae271bc2015-11-15 02:50:53 +0100102SHELL=${CONFIG_SHELL-/bin/sh}
103
104# Maximum number of lines to put in a shell here document.
105# This variable seems obsolete. It should probably be removed, and
106# only ac_max_sed_lines should be used.
micky3879b9f5e72025-07-08 18:04:53 -0400107: "${ac_max_here_lines=38}"
Steve Kondikae271bc2015-11-15 02:50:53 +0100108
109ac_unique_file="ncurses.c"
micky3879b9f5e72025-07-08 18:04:53 -0400110# Factoring default headers for most tests.
111ac_includes_default="\
112#include <stdio.h>
113#if HAVE_SYS_TYPES_H
114# include <sys/types.h>
115#endif
116#if HAVE_SYS_STAT_H
117# include <sys/stat.h>
118#endif
119#if STDC_HEADERS
120# include <stdlib.h>
121# include <stddef.h>
122#else
123# if HAVE_STDLIB_H
124# include <stdlib.h>
125# endif
126#endif
127#if HAVE_STRING_H
128# if !STDC_HEADERS && HAVE_MEMORY_H
129# include <memory.h>
130# endif
131# include <string.h>
132#endif
133#if HAVE_STRINGS_H
134# include <strings.h>
135#endif
136#if HAVE_INTTYPES_H
137# include <inttypes.h>
138#else
139# if HAVE_STDINT_H
140# include <stdint.h>
141# endif
142#endif
143#if HAVE_UNISTD_H
144# include <unistd.h>
145#endif"
Steve Kondikae271bc2015-11-15 02:50:53 +0100146
147# Initialize some variables set by options.
148ac_init_help=
149ac_init_version=false
150# The variables have the same names as the options, with
151# dashes changed to underlines.
152cache_file=/dev/null
153exec_prefix=NONE
154no_create=
155no_recursion=
156prefix=NONE
157program_prefix=NONE
158program_suffix=NONE
159program_transform_name=s,x,x,
160silent=
161site=
162srcdir=
163verbose=
164x_includes=NONE
165x_libraries=NONE
166
167# Installation directory options.
168# These are left unexpanded so users can "make install exec_prefix=/foo"
169# and all the variables that are supposed to be based on exec_prefix
170# by default will actually change.
171# Use braces instead of parens because sh, perl, etc. also accept them.
172bindir='${exec_prefix}/bin'
173sbindir='${exec_prefix}/sbin'
174libexecdir='${exec_prefix}/libexec'
175datarootdir='${prefix}/share'
176datadir='${datarootdir}'
177sysconfdir='${prefix}/etc'
178sharedstatedir='${prefix}/com'
179localstatedir='${prefix}/var'
micky3879b9f5e72025-07-08 18:04:53 -0400180runstatedir='${localstatedir}/run'
Steve Kondikae271bc2015-11-15 02:50:53 +0100181libdir='${exec_prefix}/lib'
182includedir='${prefix}/include'
183oldincludedir='/usr/include'
184infodir='${datarootdir}/info'
185mandir='${datarootdir}/man'
186
187# Identity of this package.
188PACKAGE_NAME=
189PACKAGE_TARNAME=
190PACKAGE_VERSION=
191PACKAGE_STRING=
192PACKAGE_BUGREPORT=
193
194ac_prev=
195for ac_option
196do
197 # If the previous option needs an argument, assign it.
198 if test -n "$ac_prev"; then
199 eval "$ac_prev=\$ac_option"
200 ac_prev=
201 continue
202 fi
203
204 ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'`
205
206 # Accept the important Cygnus configure options, so we can diagnose typos.
207
micky3879b9f5e72025-07-08 18:04:53 -0400208 case "$ac_option" in
Steve Kondikae271bc2015-11-15 02:50:53 +0100209
210 -bindir | --bindir | --bindi | --bind | --bin | --bi)
211 ac_prev=bindir ;;
212 -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
213 bindir=$ac_optarg ;;
214
215 -build | --build | --buil | --bui | --bu)
216 ac_prev=build_alias ;;
217 -build=* | --build=* | --buil=* | --bui=* | --bu=*)
218 build_alias=$ac_optarg ;;
219
220 -cache-file | --cache-file | --cache-fil | --cache-fi \
221 | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
222 ac_prev=cache_file ;;
223 -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
224 | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
225 cache_file=$ac_optarg ;;
226
227 --config-cache | -C)
228 cache_file=config.cache ;;
229
230 -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
231 ac_prev=datadir ;;
232 -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
233 | --da=*)
234 datadir=$ac_optarg ;;
235
236 -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \
237 | --dataroo | --dataro | --datar)
238 ac_prev=datarootdir ;;
239 -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \
240 | --dataroot=* | --dataroo=* | --dataro=* | --datar=*)
241 datarootdir=$ac_optarg ;;
242
243 -disable-* | --disable-*)
244 ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
245 # Reject names that are not valid shell variable names.
246 expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
247 { echo "$as_me: error: invalid feature name: $ac_feature" >&2
248 { (exit 1); exit 1; }; }
micky3879b9f5e72025-07-08 18:04:53 -0400249 ac_feature=`echo "$ac_feature" | sed 's/-/_/g'`
Steve Kondikae271bc2015-11-15 02:50:53 +0100250 eval "enable_$ac_feature=no" ;;
251
252 -enable-* | --enable-*)
253 ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
254 # Reject names that are not valid shell variable names.
255 expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
256 { echo "$as_me: error: invalid feature name: $ac_feature" >&2
257 { (exit 1); exit 1; }; }
micky3879b9f5e72025-07-08 18:04:53 -0400258 ac_feature=`echo "$ac_feature" | sed 's/-/_/g'`
259 case "$ac_option" in
Steve Kondikae271bc2015-11-15 02:50:53 +0100260 *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
261 *) ac_optarg=yes ;;
262 esac
263 eval "enable_$ac_feature='$ac_optarg'" ;;
264
265 -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
266 | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
267 | --exec | --exe | --ex)
268 ac_prev=exec_prefix ;;
269 -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
270 | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
271 | --exec=* | --exe=* | --ex=*)
272 exec_prefix=$ac_optarg ;;
273
274 -gas | --gas | --ga | --g)
275 # Obsolete; use --with-gas.
276 with_gas=yes ;;
277
278 -help | --help | --hel | --he | -h)
279 ac_init_help=long ;;
280 -help=r* | --help=r* | --hel=r* | --he=r* | -hr*)
281 ac_init_help=recursive ;;
282 -help=s* | --help=s* | --hel=s* | --he=s* | -hs*)
283 ac_init_help=short ;;
284
285 -host | --host | --hos | --ho)
286 ac_prev=host_alias ;;
287 -host=* | --host=* | --hos=* | --ho=*)
288 host_alias=$ac_optarg ;;
289
290 -includedir | --includedir | --includedi | --included | --include \
291 | --includ | --inclu | --incl | --inc)
292 ac_prev=includedir ;;
293 -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
294 | --includ=* | --inclu=* | --incl=* | --inc=*)
295 includedir=$ac_optarg ;;
296
297 -infodir | --infodir | --infodi | --infod | --info | --inf)
298 ac_prev=infodir ;;
299 -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
300 infodir=$ac_optarg ;;
301
302 -libdir | --libdir | --libdi | --libd)
303 ac_prev=libdir ;;
304 -libdir=* | --libdir=* | --libdi=* | --libd=*)
305 libdir=$ac_optarg ;;
306
307 -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
308 | --libexe | --libex | --libe)
309 ac_prev=libexecdir ;;
310 -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
311 | --libexe=* | --libex=* | --libe=*)
312 libexecdir=$ac_optarg ;;
313
314 -localstatedir | --localstatedir | --localstatedi | --localstated \
315 | --localstate | --localstat | --localsta | --localst \
316 | --locals | --local | --loca | --loc | --lo)
317 ac_prev=localstatedir ;;
318 -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
319 | --localstate=* | --localstat=* | --localsta=* | --localst=* \
320 | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
321 localstatedir=$ac_optarg ;;
322
micky3879b9f5e72025-07-08 18:04:53 -0400323 -runstatedir | --runstatedir | --runstatedi | --runstated \
324 | --runstate | --runstat | --runsta | --runst \
325 | --runs | --run | --ru)
326 ac_prev=runstatedir ;;
327 -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \
328 | --runstate=* | --runstat=* | --runsta=* | --runst=* \
329 | --runs=* | --run=* | --ru=*)
330 runstatedir=$ac_optarg ;;
331
Steve Kondikae271bc2015-11-15 02:50:53 +0100332 -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
333 ac_prev=mandir ;;
334 -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
335 mandir=$ac_optarg ;;
336
337 -nfp | --nfp | --nf)
338 # Obsolete; use --without-fp.
339 with_fp=no ;;
340
341 -no-create | --no-create | --no-creat | --no-crea | --no-cre \
342 | --no-cr | --no-c)
343 no_create=yes ;;
344
345 -no-recursion | --no-recursion | --no-recursio | --no-recursi \
346 | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
347 no_recursion=yes ;;
348
349 -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
350 | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
351 | --oldin | --oldi | --old | --ol | --o)
352 ac_prev=oldincludedir ;;
353 -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
354 | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
355 | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
356 oldincludedir=$ac_optarg ;;
357
358 -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
359 ac_prev=prefix ;;
360 -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
361 prefix=$ac_optarg ;;
362
363 -program-prefix | --program-prefix | --program-prefi | --program-pref \
364 | --program-pre | --program-pr | --program-p)
365 ac_prev=program_prefix ;;
366 -program-prefix=* | --program-prefix=* | --program-prefi=* \
367 | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
368 program_prefix=$ac_optarg ;;
369
370 -program-suffix | --program-suffix | --program-suffi | --program-suff \
371 | --program-suf | --program-su | --program-s)
372 ac_prev=program_suffix ;;
373 -program-suffix=* | --program-suffix=* | --program-suffi=* \
374 | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
375 program_suffix=$ac_optarg ;;
376
377 -program-transform-name | --program-transform-name \
378 | --program-transform-nam | --program-transform-na \
379 | --program-transform-n | --program-transform- \
380 | --program-transform | --program-transfor \
381 | --program-transfo | --program-transf \
382 | --program-trans | --program-tran \
383 | --progr-tra | --program-tr | --program-t)
384 ac_prev=program_transform_name ;;
385 -program-transform-name=* | --program-transform-name=* \
386 | --program-transform-nam=* | --program-transform-na=* \
387 | --program-transform-n=* | --program-transform-=* \
388 | --program-transform=* | --program-transfor=* \
389 | --program-transfo=* | --program-transf=* \
390 | --program-trans=* | --program-tran=* \
391 | --progr-tra=* | --program-tr=* | --program-t=*)
392 program_transform_name=$ac_optarg ;;
393
394 -q | -quiet | --quiet | --quie | --qui | --qu | --q \
395 | -silent | --silent | --silen | --sile | --sil)
396 silent=yes ;;
397
398 -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
399 ac_prev=sbindir ;;
400 -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
401 | --sbi=* | --sb=*)
402 sbindir=$ac_optarg ;;
403
404 -sharedstatedir | --sharedstatedir | --sharedstatedi \
405 | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
406 | --sharedst | --shareds | --shared | --share | --shar \
407 | --sha | --sh)
408 ac_prev=sharedstatedir ;;
409 -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
410 | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
411 | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
412 | --sha=* | --sh=*)
413 sharedstatedir=$ac_optarg ;;
414
415 -site | --site | --sit)
416 ac_prev=site ;;
417 -site=* | --site=* | --sit=*)
418 site=$ac_optarg ;;
419
420 -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
421 ac_prev=srcdir ;;
422 -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
423 srcdir=$ac_optarg ;;
424
425 -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
426 | --syscon | --sysco | --sysc | --sys | --sy)
427 ac_prev=sysconfdir ;;
428 -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
429 | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
430 sysconfdir=$ac_optarg ;;
431
432 -target | --target | --targe | --targ | --tar | --ta | --t)
433 ac_prev=target_alias ;;
434 -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
435 target_alias=$ac_optarg ;;
436
437 -v | -verbose | --verbose | --verbos | --verbo | --verb)
438 verbose=yes ;;
439
440 -version | --version | --versio | --versi | --vers | -V)
441 ac_init_version=: ;;
442
443 -with-* | --with-*)
444 ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
445 # Reject names that are not valid shell variable names.
446 expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
447 { echo "$as_me: error: invalid package name: $ac_package" >&2
448 { (exit 1); exit 1; }; }
micky3879b9f5e72025-07-08 18:04:53 -0400449 ac_package=`echo "$ac_package" | sed 's/-/_/g'`
450 case "$ac_option" in
Steve Kondikae271bc2015-11-15 02:50:53 +0100451 *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
452 *) ac_optarg=yes ;;
453 esac
454 eval "with_$ac_package='$ac_optarg'" ;;
455
456 -without-* | --without-*)
457 ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'`
458 # Reject names that are not valid shell variable names.
459 expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
460 { echo "$as_me: error: invalid package name: $ac_package" >&2
461 { (exit 1); exit 1; }; }
micky3879b9f5e72025-07-08 18:04:53 -0400462 ac_package=`echo "$ac_package" | sed 's/-/_/g'`
Steve Kondikae271bc2015-11-15 02:50:53 +0100463 eval "with_$ac_package=no" ;;
464
465 --x)
466 # Obsolete; use --with-x.
467 with_x=yes ;;
468
469 -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
470 | --x-incl | --x-inc | --x-in | --x-i)
471 ac_prev=x_includes ;;
472 -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
473 | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
474 x_includes=$ac_optarg ;;
475
476 -x-libraries | --x-libraries | --x-librarie | --x-librari \
477 | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
478 ac_prev=x_libraries ;;
479 -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
480 | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
481 x_libraries=$ac_optarg ;;
482
483 -*) { echo "$as_me: error: unrecognized option: $ac_option
484Try \`$0 --help' for more information." >&2
485 { (exit 1); exit 1; }; }
486 ;;
487
488 *=*)
489 ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
490 # Reject names that are not valid shell variable names.
491 expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null &&
492 { echo "$as_me: error: invalid variable name: $ac_envvar" >&2
493 { (exit 1); exit 1; }; }
494 ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`
495 eval "$ac_envvar='$ac_optarg'"
micky3879b9f5e72025-07-08 18:04:53 -0400496 export "$ac_envvar" ;;
Steve Kondikae271bc2015-11-15 02:50:53 +0100497
498 *)
499 # FIXME: should be removed in autoconf 3.0.
500 echo "$as_me: WARNING: you should use --build, --host, --target" >&2
501 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
502 echo "$as_me: WARNING: invalid host type: $ac_option" >&2
micky3879b9f5e72025-07-08 18:04:53 -0400503 : "${build_alias=$ac_option}" "${host_alias=$ac_option}" "${target_alias=$ac_option}"
Steve Kondikae271bc2015-11-15 02:50:53 +0100504 ;;
505
506 esac
507done
508
509if test -n "$ac_prev"; then
micky3879b9f5e72025-07-08 18:04:53 -0400510 ac_option=--`echo "$ac_prev" | sed 's/_/-/g'`
Steve Kondikae271bc2015-11-15 02:50:53 +0100511 { echo "$as_me: error: missing argument to $ac_option" >&2
512 { (exit 1); exit 1; }; }
513fi
514
515# Be sure to have absolute paths.
516for ac_var in exec_prefix prefix
517do
micky3879b9f5e72025-07-08 18:04:53 -0400518 eval ac_val=$`echo "$ac_var"`
519 case "$ac_val" in
Steve Kondikae271bc2015-11-15 02:50:53 +0100520 [\\/$]* | ?:[\\/]* | NONE | '' ) ;;
521 *) { echo "$as_me: error: expected an absolute path for --$ac_var: $ac_val" >&2
522 { (exit 1); exit 1; }; };;
523 esac
524done
525
526# Be sure to have absolute paths.
527for ac_var in bindir sbindir libexecdir datarootdir datadir sysconfdir sharedstatedir \
528 localstatedir libdir includedir oldincludedir infodir mandir
529do
micky3879b9f5e72025-07-08 18:04:53 -0400530 eval ac_val=$`echo "$ac_var"`
531 case "$ac_val" in
Steve Kondikae271bc2015-11-15 02:50:53 +0100532 [\\/$]* | ?:[\\/]* ) ;;
533 *) { echo "$as_me: error: expected an absolute path for --$ac_var: $ac_val" >&2
534 { (exit 1); exit 1; }; };;
535 esac
536done
537
538# There might be people who depend on the old broken behavior: `$host'
539# used to hold the argument of --host etc.
540build=$build_alias
541host=$host_alias
542target=$target_alias
543
544# FIXME: should be removed in autoconf 3.0.
545if test "x$host_alias" != x; then
546 if test "x$build_alias" = x; then
547 cross_compiling=maybe
548 echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host.
549 If a cross compiler is detected then cross compile mode will be used." >&2
550 elif test "x$build_alias" != "x$host_alias"; then
551 cross_compiling=yes
552 fi
553fi
554
555ac_tool_prefix=
556test -n "$host_alias" && ac_tool_prefix=$host_alias-
557
558test "$silent" = yes && exec 6>/dev/null
559
560# Find the source files, if location was not specified.
561if test -z "$srcdir"; then
562 ac_srcdir_defaulted=yes
563 # Try the directory containing this script, then its parent.
564 ac_prog=$0
565 ac_confdir=`echo "$ac_prog" | sed 's%[\\/][^\\/][^\\/]*$%%'`
566 test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
567 srcdir=$ac_confdir
micky3879b9f5e72025-07-08 18:04:53 -0400568 if test ! -r "$srcdir/$ac_unique_file"; then
Steve Kondikae271bc2015-11-15 02:50:53 +0100569 srcdir=..
570 fi
571else
572 ac_srcdir_defaulted=no
573fi
micky3879b9f5e72025-07-08 18:04:53 -0400574if test ! -r "$srcdir/$ac_unique_file"; then
Steve Kondikae271bc2015-11-15 02:50:53 +0100575 if test "$ac_srcdir_defaulted" = yes; then
576 { echo "$as_me: error: cannot find sources in $ac_confdir or .." >&2
577 { (exit 1); exit 1; }; }
578 else
579 { echo "$as_me: error: cannot find sources in $srcdir" >&2
580 { (exit 1); exit 1; }; }
581 fi
582fi
583srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'`
584ac_env_build_alias_set=${build_alias+set}
585ac_env_build_alias_value=$build_alias
586ac_cv_env_build_alias_set=${build_alias+set}
587ac_cv_env_build_alias_value=$build_alias
588ac_env_host_alias_set=${host_alias+set}
589ac_env_host_alias_value=$host_alias
590ac_cv_env_host_alias_set=${host_alias+set}
591ac_cv_env_host_alias_value=$host_alias
592ac_env_target_alias_set=${target_alias+set}
593ac_env_target_alias_value=$target_alias
594ac_cv_env_target_alias_set=${target_alias+set}
595ac_cv_env_target_alias_value=$target_alias
596ac_env_CC_set=${CC+set}
597ac_env_CC_value=$CC
598ac_cv_env_CC_set=${CC+set}
599ac_cv_env_CC_value=$CC
600ac_env_CFLAGS_set=${CFLAGS+set}
601ac_env_CFLAGS_value=$CFLAGS
602ac_cv_env_CFLAGS_set=${CFLAGS+set}
603ac_cv_env_CFLAGS_value=$CFLAGS
604ac_env_LDFLAGS_set=${LDFLAGS+set}
605ac_env_LDFLAGS_value=$LDFLAGS
606ac_cv_env_LDFLAGS_set=${LDFLAGS+set}
607ac_cv_env_LDFLAGS_value=$LDFLAGS
608ac_env_CPPFLAGS_set=${CPPFLAGS+set}
609ac_env_CPPFLAGS_value=$CPPFLAGS
610ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set}
611ac_cv_env_CPPFLAGS_value=$CPPFLAGS
612ac_env_CPP_set=${CPP+set}
613ac_env_CPP_value=$CPP
614ac_cv_env_CPP_set=${CPP+set}
615ac_cv_env_CPP_value=$CPP
616
617#
618# Report the --help message.
619#
620if test "$ac_init_help" = "long"; then
621 # Omit some internal or obsolete options to make the list less imposing.
622 # This message is too long to be a string in the A/UX 3.1 sh.
623 cat <<EOF
624\`configure' configures this package to adapt to many kinds of systems.
625
626Usage: $0 [OPTION]... [VAR=VALUE]...
627
628To assign environment variables (e.g., CC, CFLAGS...), specify them as
629VAR=VALUE. See below for descriptions of some of the useful variables.
630
631Defaults for the options are specified in brackets.
632
633Configuration:
634 -h, --help display this help and exit
635 --help=short display options specific to this package
636 --help=recursive display the short help of all the included packages
637 -V, --version display version information and exit
638 -q, --quiet, --silent do not print \`checking...' messages
639 --cache-file=FILE cache test results in FILE [disabled]
640 -C, --config-cache alias for \`--cache-file=config.cache'
641 -n, --no-create do not create output files
642 --srcdir=DIR find the sources in DIR [configure dir or \`..']
643
644EOF
645
646 cat <<EOF
647Installation directories:
648 --prefix=PREFIX install architecture-independent files in PREFIX
649 [$ac_default_prefix]
650 --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX
651 [PREFIX]
652
653By default, \`make install' will install all the files in
654\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify
655an installation prefix other than \`$ac_default_prefix' using \`--prefix',
656for instance \`--prefix=\$HOME'.
657
658For better control, use the options below.
659
660Fine tuning of the installation directories:
661 --bindir=DIR user executables [EPREFIX/bin]
662 --sbindir=DIR system admin executables [EPREFIX/sbin]
663 --libexecdir=DIR program executables [EPREFIX/libexec]
664 --datarootdir=DIR read-only architecture-independent data [PREFIX/share]
665 --datadir=DIR read-only architecture-independent data [DATAROOTDIR]
666 --sysconfdir=DIR read-only single-machine data [PREFIX/etc]
667 --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
668 --localstatedir=DIR modifiable single-machine data [PREFIX/var]
micky3879b9f5e72025-07-08 18:04:53 -0400669 --runstatedir=DIR extra definition of runtime data [LOCALSTATEDIR/run]
Steve Kondikae271bc2015-11-15 02:50:53 +0100670 --libdir=DIR object code libraries [EPREFIX/lib]
671 --includedir=DIR C header files [PREFIX/include]
672 --oldincludedir=DIR C header files for non-gcc [/usr/include]
673 --infodir=DIR info documentation [DATAROOTDIR/info]
674 --mandir=DIR man documentation [DATAROOTDIR/man]
675EOF
676
677 cat <<\EOF
678
679Program names:
680 --program-prefix=PREFIX prepend PREFIX to installed program names
681 --program-suffix=SUFFIX append SUFFIX to installed program names
682 --program-transform-name=PROGRAM run sed PROGRAM on installed program names
683
684X features:
685 --x-includes=DIR X include files are in DIR
686 --x-libraries=DIR X library files are in DIR
687
688System types:
689 --build=BUILD configure for building on BUILD [guessed]
690 --host=HOST build programs to run on HOST [BUILD]
691EOF
692fi
693
694if test -n "$ac_init_help"; then
695
696 cat <<\EOF
697
Steve Kondikae271bc2015-11-15 02:50:53 +0100698Optional Features:
699 --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
700 --enable-FEATURE[=ARG] include FEATURE [ARG=yes]
701
micky3879b9f5e72025-07-08 18:04:53 -0400702Optional Packages:
703 --with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
704 --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
705
Steve Kondikae271bc2015-11-15 02:50:53 +0100706General Options:
micky3879b9f5e72025-07-08 18:04:53 -0400707 --disable-stripping do not strip (debug info) installed executables
708 --with-strip-program=XX specify program to use when stripping in install
709 --enable-stdnoreturn enable C11 _Noreturn feature for diagnostics
710 --enable-string-hacks work around bogus compiler/loader warnings
711 --with-pkg-config[=CMD] enable/disable use of pkg-config and its name CMD
Steve Kondikae271bc2015-11-15 02:50:53 +0100712 --disable-echo do not display "compiling" commands
713Curses Version-dependent Options:
714 --with-ncurses-wrap-prefix naming-prefix for ncurses wrapped-variables
715 --disable-widec disable checks for wide-character functions
716 --with-curses-dir=DIR directory in which (n)curses is installed
717 --with-screen=XXX use specified curses-libraries
718 --with-ncursesw use wide ncurses-libraries
719 --with-ncurses use ncurses-libraries
720 --with-pdcurses compile/link with pdcurses X11 library
721 --with-curses-colr compile/link with HPUX 10.x color-curses
722 --with-curses-5lib compile/link with SunOS 5lib curses
723 --with-Xaw3d link with Xaw 3d library
724 --with-Xaw3dxft link with Xaw 3d xft library
725 --with-neXtaw link with neXT Athena library
726 --with-XawPlus link with Athena-Plus library
727 --with-x use the X Window System
micky3879b9f5e72025-07-08 18:04:53 -0400728 --with-x11-rgb=FILE obtain X11 color definitions from FILE (default: EPREFIX/lib/X11/rgb.txt)
729 --with-form-libname[=XXX] override ifelse(,,form,) basename of library
730 --with-menu-libname[=XXX] override ifelse(,,menu,) basename of library
731 --with-panel-libname[=XXX] override ifelse(,,panel,) basename of library
732 --disable-panel disable checks for panel functions
733 --disable-menu disable checks for menu functions
734 --disable-form disable checks for form functions
Steve Kondikae271bc2015-11-15 02:50:53 +0100735Testing/development Options:
736 --enable-warnings test: turn on gcc compiler warnings
737 --with-dmalloc test: use Gray Watson's dmalloc library
738 --with-dbmalloc test: use Conor Cahill's dbmalloc library
739 --with-valgrind test: use valgrind
740 --disable-leaks test: free permanent memory, analyze leaks
741 --disable-rpath-hack don't add rpath options for additional libraries
742
743Some influential environment variables:
744 CC C compiler command
745 CFLAGS C compiler flags
746 LDFLAGS linker flags, e.g. -L<lib dir> if you have libraries in a
747 nonstandard directory <lib dir>
748 CPPFLAGS C/C++ preprocessor flags, e.g. -I<include dir> if you have
749 headers in a nonstandard directory <include dir>
750 CPP C preprocessor
751
752Use these variables to override the choices made by `configure' or to help
753it to find libraries and programs with nonstandard names/locations.
754
755EOF
756fi
757
758if test "$ac_init_help" = "recursive"; then
759 # If there are subdirs, report their specific --help.
760 ac_popdir=`pwd`
761 for ac_subdir in : $ac_subdirs_all; do test "x$ac_subdir" = x: && continue
micky3879b9f5e72025-07-08 18:04:53 -0400762 cd "$ac_subdir"
Steve Kondikae271bc2015-11-15 02:50:53 +0100763 # A "../" for each directory in /$ac_subdir.
micky3879b9f5e72025-07-08 18:04:53 -0400764 ac_dots=`echo "$ac_subdir" |
Steve Kondikae271bc2015-11-15 02:50:53 +0100765 sed 's,^\./,,;s,[^/]$,&/,;s,[^/]*/,../,g'`
766
micky3879b9f5e72025-07-08 18:04:53 -0400767 case "$srcdir" in
Steve Kondikae271bc2015-11-15 02:50:53 +0100768 .) # No --srcdir option. We are building in place.
micky3879b9f5e72025-07-08 18:04:53 -0400769 ac_sub_srcdir="$srcdir" ;;
Steve Kondikae271bc2015-11-15 02:50:53 +0100770 [\\/]* | ?:[\\/]* ) # Absolute path.
micky3879b9f5e72025-07-08 18:04:53 -0400771 ac_sub_srcdir="$srcdir/$ac_subdir" ;;
Steve Kondikae271bc2015-11-15 02:50:53 +0100772 *) # Relative path.
micky3879b9f5e72025-07-08 18:04:53 -0400773 ac_sub_srcdir="$ac_dots$srcdir/$ac_subdir" ;;
Steve Kondikae271bc2015-11-15 02:50:53 +0100774 esac
775
776 # Check for guested configure; otherwise get Cygnus style configure.
micky3879b9f5e72025-07-08 18:04:53 -0400777 if test -f "$ac_sub_srcdir/configure.gnu"; then
Steve Kondikae271bc2015-11-15 02:50:53 +0100778 echo
micky3879b9f5e72025-07-08 18:04:53 -0400779 $SHELL "$ac_sub_srcdir/configure.gnu" --help=recursive
780 elif test -f "$ac_sub_srcdir/configure"; then
Steve Kondikae271bc2015-11-15 02:50:53 +0100781 echo
micky3879b9f5e72025-07-08 18:04:53 -0400782 $SHELL "$ac_sub_srcdir/configure" --help=recursive
783 elif test -f "$ac_sub_srcdir/configure.ac" ||
784 test -f "$ac_sub_srcdir/configure.in"; then
Steve Kondikae271bc2015-11-15 02:50:53 +0100785 echo
micky3879b9f5e72025-07-08 18:04:53 -0400786 "$ac_configure" --help
Steve Kondikae271bc2015-11-15 02:50:53 +0100787 else
788 echo "$as_me: WARNING: no configuration information is in $ac_subdir" >&2
789 fi
micky3879b9f5e72025-07-08 18:04:53 -0400790 cd "$ac_popdir"
Steve Kondikae271bc2015-11-15 02:50:53 +0100791 done
792fi
793
794test -n "$ac_init_help" && exit 0
micky3879b9f5e72025-07-08 18:04:53 -0400795if "$ac_init_version"; then
Steve Kondikae271bc2015-11-15 02:50:53 +0100796 cat <<\EOF
797
micky3879b9f5e72025-07-08 18:04:53 -0400798Copyright 2003-2022,2023 Thomas E. Dickey
Steve Kondikae271bc2015-11-15 02:50:53 +0100799Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
800Free Software Foundation, Inc.
801This configure script is free software; the Free Software Foundation
802gives unlimited permission to copy, distribute and modify it.
803EOF
804 exit 0
805fi
806exec 5>config.log
807cat >&5 <<EOF
808This file contains any messages produced by compilers while
809running configure, to aid debugging if configure makes a mistake.
810
811It was created by $as_me, which was
micky3879b9f5e72025-07-08 18:04:53 -0400812generated by GNU Autoconf 2.52.20231210. Invocation command line was
Steve Kondikae271bc2015-11-15 02:50:53 +0100813
814 $ $0 $@
815
816EOF
817{
818cat <<_ASUNAME
819## ---------- ##
820## Platform. ##
821## ---------- ##
822
823hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
824uname -m = `(uname -m) 2>/dev/null || echo unknown`
825uname -r = `(uname -r) 2>/dev/null || echo unknown`
826uname -s = `(uname -s) 2>/dev/null || echo unknown`
827uname -v = `(uname -v) 2>/dev/null || echo unknown`
828
829/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
830/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown`
831
832/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown`
833/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown`
834/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
835hostinfo = `(hostinfo) 2>/dev/null || echo unknown`
836/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown`
837/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown`
838/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown`
839
840PATH = $PATH
841
842_ASUNAME
843} >&5
844
845cat >&5 <<EOF
846## ------------ ##
847## Core tests. ##
848## ------------ ##
849
850EOF
851
852# Keep a trace of the command line.
853# Strip out --no-create and --no-recursion so they do not pile up.
854# Also quote any args containing shell meta-characters.
855ac_configure_args=
856ac_sep=
857for ac_arg
858do
micky3879b9f5e72025-07-08 18:04:53 -0400859 case "$ac_arg" in
Steve Kondikae271bc2015-11-15 02:50:53 +0100860 -no-create | --no-create | --no-creat | --no-crea | --no-cre \
861 | --no-cr | --no-c) ;;
862 -no-recursion | --no-recursion | --no-recursio | --no-recursi \
863 | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
864 *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
865 ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"`
866 ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'"
867 ac_sep=" " ;;
868 *) ac_configure_args="$ac_configure_args$ac_sep$ac_arg"
869 ac_sep=" " ;;
870 esac
871 # Get rid of the leading space.
872done
873
874# When interrupted or exit'd, cleanup temporary files, and complete
875# config.log. We remove comments because anyway the quotes in there
876# would cause problems or look ugly.
877trap 'exit_status=$?
878 # Save into config.log some information that might help in debugging.
879 echo >&5
880 echo "## ----------------- ##" >&5
881 echo "## Cache variables. ##" >&5
882 echo "## ----------------- ##" >&5
883 echo >&5
884 # The following way of writing the cache mishandles newlines in values,
885{
886 (set) 2>&1 |
887 case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in
888 *ac_space=\ *)
889 sed -n \
890 "s/'"'"'/'"'"'\\\\'"'"''"'"'/g;
891 s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p"
892 ;;
893 *)
894 sed -n \
895 "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
896 ;;
897 esac;
898} >&5
899 sed "/^$/d" confdefs.h >conftest.log
900 if test -s conftest.log; then
901 echo >&5
902 echo "## ------------ ##" >&5
903 echo "## confdefs.h. ##" >&5
904 echo "## ------------ ##" >&5
905 echo >&5
906 cat conftest.log >&5
907 fi
908 (echo; echo) >&5
909 test "$ac_signal" != 0 &&
910 echo "$as_me: caught signal $ac_signal" >&5
911 echo "$as_me: exit $exit_status" >&5
912 rm -rf conftest* confdefs* core core.* *.core conf$$* $ac_clean_files &&
913 exit $exit_status
914 ' 0
915for ac_signal in 1 2 13 15; do
micky3879b9f5e72025-07-08 18:04:53 -0400916 trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' "$ac_signal"
Steve Kondikae271bc2015-11-15 02:50:53 +0100917done
918ac_signal=0
919
920# confdefs.h avoids OS command line length limits that DEFS can exceed.
921rm -rf conftest* confdefs.h
922# AIX cpp loses on an empty file, so make sure it contains at least a newline.
923echo >confdefs.h
924
925# Let the site file select an alternate cache file if it wants to.
926# Prefer explicitly selected file to automatically selected ones.
927if test -z "$CONFIG_SITE"; then
928 if test "x$prefix" != xNONE; then
929 CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
930 else
931 CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
932 fi
933fi
934for ac_site_file in $CONFIG_SITE; do
935 if test -r "$ac_site_file"; then
micky3879b9f5e72025-07-08 18:04:53 -0400936 { echo "$as_me:936: loading site script $ac_site_file" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +0100937echo "$as_me: loading site script $ac_site_file" >&6;}
938 cat "$ac_site_file" >&5
939 . "$ac_site_file"
940 fi
941done
942
943if test -r "$cache_file"; then
944 # Some versions of bash will fail to source /dev/null (special
945 # files actually), so we avoid doing that.
946 if test -f "$cache_file"; then
micky3879b9f5e72025-07-08 18:04:53 -0400947 { echo "$as_me:947: loading cache $cache_file" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +0100948echo "$as_me: loading cache $cache_file" >&6;}
949 case $cache_file in
950 [\\/]* | ?:[\\/]* ) . $cache_file;;
951 *) . ./$cache_file;;
952 esac
953 fi
954else
micky3879b9f5e72025-07-08 18:04:53 -0400955 { echo "$as_me:955: creating cache $cache_file" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +0100956echo "$as_me: creating cache $cache_file" >&6;}
957 >$cache_file
958fi
959
960# Check that the precious variables saved in the cache have kept the same
961# value.
962ac_cache_corrupted=false
963for ac_var in `(set) 2>&1 |
964 sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do
965 eval ac_old_set=\$ac_cv_env_${ac_var}_set
966 eval ac_new_set=\$ac_env_${ac_var}_set
967 eval ac_old_val="\$ac_cv_env_${ac_var}_value"
968 eval ac_new_val="\$ac_env_${ac_var}_value"
micky3879b9f5e72025-07-08 18:04:53 -0400969 case "$ac_old_set,$ac_new_set" in
Steve Kondikae271bc2015-11-15 02:50:53 +0100970 set,)
micky3879b9f5e72025-07-08 18:04:53 -0400971 { echo "$as_me:971: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +0100972echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
973 ac_cache_corrupted=: ;;
974 ,set)
micky3879b9f5e72025-07-08 18:04:53 -0400975 { echo "$as_me:975: error: \`$ac_var' was not set in the previous run" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +0100976echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
977 ac_cache_corrupted=: ;;
978 ,);;
979 *)
980 if test "x$ac_old_val" != "x$ac_new_val"; then
micky3879b9f5e72025-07-08 18:04:53 -0400981 { echo "$as_me:981: error: \`$ac_var' has changed since the previous run:" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +0100982echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
micky3879b9f5e72025-07-08 18:04:53 -0400983 { echo "$as_me:983: former value: $ac_old_val" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +0100984echo "$as_me: former value: $ac_old_val" >&2;}
micky3879b9f5e72025-07-08 18:04:53 -0400985 { echo "$as_me:985: current value: $ac_new_val" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +0100986echo "$as_me: current value: $ac_new_val" >&2;}
987 ac_cache_corrupted=:
988 fi;;
989 esac
990 # Pass precious variables to config.status. It doesn't matter if
991 # we pass some twice (in addition to the command line arguments).
992 if test "$ac_new_set" = set; then
micky3879b9f5e72025-07-08 18:04:53 -0400993 case "$ac_new_val" in
Steve Kondikae271bc2015-11-15 02:50:53 +0100994 *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
995 ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"`
996 ac_configure_args="$ac_configure_args '$ac_arg'"
997 ;;
998 *) ac_configure_args="$ac_configure_args $ac_var=$ac_new_val"
999 ;;
1000 esac
1001 fi
1002done
micky3879b9f5e72025-07-08 18:04:53 -04001003if "$ac_cache_corrupted"; then
1004 { echo "$as_me:1004: error: changes in the environment can compromise the build" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01001005echo "$as_me: error: changes in the environment can compromise the build" >&2;}
micky3879b9f5e72025-07-08 18:04:53 -04001006 { { echo "$as_me:1006: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01001007echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;}
1008 { (exit 1); exit 1; }; }
1009fi
1010
1011ac_ext=c
1012ac_cpp='$CPP $CPPFLAGS'
micky3879b9f5e72025-07-08 18:04:53 -04001013ac_compile='$CC -c $CFLAGS $CPPFLAGS "conftest.$ac_ext" >&5'
1014ac_link='$CC -o "conftest$ac_exeext" $CFLAGS $CPPFLAGS $LDFLAGS "conftest.$ac_ext" $LIBS >&5'
Steve Kondikae271bc2015-11-15 02:50:53 +01001015ac_compiler_gnu=$ac_cv_c_compiler_gnu
micky3879b9f5e72025-07-08 18:04:53 -04001016ac_main_return="return"
Steve Kondikae271bc2015-11-15 02:50:53 +01001017
1018case `echo "testing\c" 2>/dev/null; echo 1,2,3`,`echo -n testing 2>/dev/null; echo 1,2,3` in
micky3879b9f5e72025-07-08 18:04:53 -04001019 *c*,-n*) ECHO_N=
1020 ECHO_C= # newlines do not sed ;-) only broken shells would use this case anyway
1021 ECHO_T=' '
1022 ;;
1023 *c*,* ) ECHO_N=-n
1024 ECHO_C=
1025 ECHO_T=
1026 ;;
1027 *) ECHO_N=
1028 ECHO_C='\c'
1029 ECHO_T=
1030 ;;
Steve Kondikae271bc2015-11-15 02:50:53 +01001031esac
1032echo "#! $SHELL" >conftest.sh
1033echo "exit 0" >>conftest.sh
1034chmod +x conftest.sh
micky3879b9f5e72025-07-08 18:04:53 -04001035if { (echo "$as_me:1035: PATH=\".;.\"; conftest.sh") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01001036 (PATH=".;."; conftest.sh) 2>&5
1037 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -04001038 echo "$as_me:1038: \$? = $ac_status" >&5
1039 (exit "$ac_status"); }; then
Steve Kondikae271bc2015-11-15 02:50:53 +01001040 ac_path_separator=';'
1041else
1042 ac_path_separator=:
1043fi
1044PATH_SEPARATOR="$ac_path_separator"
1045rm -f conftest.sh
1046
1047ac_config_headers="$ac_config_headers ncurses_cfg.h:ncurses_tst.hin"
1048
1049test -f config.guess || ( test -f ../config.guess && cp ../config.guess ./ )
1050
1051test -f config.sub || ( test -f ../config.sub && cp ../config.sub ./ )
1052
1053ac_aux_dir=
1054for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
micky3879b9f5e72025-07-08 18:04:53 -04001055 if test -f "$ac_dir/install-sh"; then
Steve Kondikae271bc2015-11-15 02:50:53 +01001056 ac_aux_dir=$ac_dir
1057 ac_install_sh="$ac_aux_dir/install-sh -c"
1058 break
micky3879b9f5e72025-07-08 18:04:53 -04001059 elif test -f "$ac_dir/install.sh"; then
Steve Kondikae271bc2015-11-15 02:50:53 +01001060 ac_aux_dir=$ac_dir
1061 ac_install_sh="$ac_aux_dir/install.sh -c"
1062 break
micky3879b9f5e72025-07-08 18:04:53 -04001063 elif test -f "$ac_dir/shtool"; then
Steve Kondikae271bc2015-11-15 02:50:53 +01001064 ac_aux_dir=$ac_dir
1065 ac_install_sh="$ac_aux_dir/shtool install -c"
1066 break
1067 fi
1068done
1069if test -z "$ac_aux_dir"; then
micky3879b9f5e72025-07-08 18:04:53 -04001070 { { echo "$as_me:1070: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01001071echo "$as_me: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&2;}
1072 { (exit 1); exit 1; }; }
1073fi
1074ac_config_guess="$SHELL $ac_aux_dir/config.guess"
1075ac_config_sub="$SHELL $ac_aux_dir/config.sub"
1076ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure.
1077
1078# Make sure we can run config.sub.
1079$ac_config_sub sun4 >/dev/null 2>&1 ||
micky3879b9f5e72025-07-08 18:04:53 -04001080 { { echo "$as_me:1080: error: cannot run $ac_config_sub" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01001081echo "$as_me: error: cannot run $ac_config_sub" >&2;}
1082 { (exit 1); exit 1; }; }
1083
micky3879b9f5e72025-07-08 18:04:53 -04001084echo "$as_me:1084: checking build system type" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01001085echo $ECHO_N "checking build system type... $ECHO_C" >&6
1086if test "${ac_cv_build+set}" = set; then
1087 echo $ECHO_N "(cached) $ECHO_C" >&6
1088else
1089 ac_cv_build_alias=$build_alias
1090test -z "$ac_cv_build_alias" &&
1091 ac_cv_build_alias=`$ac_config_guess`
1092test -z "$ac_cv_build_alias" &&
micky3879b9f5e72025-07-08 18:04:53 -04001093 { { echo "$as_me:1093: error: cannot guess build type; you must specify one" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01001094echo "$as_me: error: cannot guess build type; you must specify one" >&2;}
1095 { (exit 1); exit 1; }; }
micky3879b9f5e72025-07-08 18:04:53 -04001096ac_cv_build=`$ac_config_sub "$ac_cv_build_alias"` ||
1097 { { echo "$as_me:1097: error: $ac_config_sub $ac_cv_build_alias failed." >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01001098echo "$as_me: error: $ac_config_sub $ac_cv_build_alias failed." >&2;}
1099 { (exit 1); exit 1; }; }
1100
1101fi
micky3879b9f5e72025-07-08 18:04:53 -04001102echo "$as_me:1102: result: $ac_cv_build" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01001103echo "${ECHO_T}$ac_cv_build" >&6
1104build=$ac_cv_build
micky3879b9f5e72025-07-08 18:04:53 -04001105build_cpu=`echo "$ac_cv_build" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
1106build_vendor=`echo "$ac_cv_build" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
1107build_os=`echo "$ac_cv_build" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
Steve Kondikae271bc2015-11-15 02:50:53 +01001108
micky3879b9f5e72025-07-08 18:04:53 -04001109if test -f "$srcdir/config.guess" || test -f "$ac_aux_dir/config.guess" ; then
1110 echo "$as_me:1110: checking host system type" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01001111echo $ECHO_N "checking host system type... $ECHO_C" >&6
1112if test "${ac_cv_host+set}" = set; then
1113 echo $ECHO_N "(cached) $ECHO_C" >&6
1114else
1115 ac_cv_host_alias=$host_alias
1116test -z "$ac_cv_host_alias" &&
1117 ac_cv_host_alias=$ac_cv_build_alias
micky3879b9f5e72025-07-08 18:04:53 -04001118ac_cv_host=`$ac_config_sub "$ac_cv_host_alias"` ||
1119 { { echo "$as_me:1119: error: $ac_config_sub $ac_cv_host_alias failed" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01001120echo "$as_me: error: $ac_config_sub $ac_cv_host_alias failed" >&2;}
1121 { (exit 1); exit 1; }; }
1122
1123fi
micky3879b9f5e72025-07-08 18:04:53 -04001124echo "$as_me:1124: result: $ac_cv_host" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01001125echo "${ECHO_T}$ac_cv_host" >&6
1126host=$ac_cv_host
micky3879b9f5e72025-07-08 18:04:53 -04001127host_cpu=`echo "$ac_cv_host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
1128host_vendor=`echo "$ac_cv_host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
1129host_os=`echo "$ac_cv_host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
Steve Kondikae271bc2015-11-15 02:50:53 +01001130
1131 system_name="$host_os"
1132else
1133 system_name="`(uname -s -r) 2>/dev/null`"
1134 if test -z "$system_name" ; then
1135 system_name="`(hostname) 2>/dev/null`"
1136 fi
1137fi
1138test -n "$system_name" &&
1139cat >>confdefs.h <<EOF
1140#define SYSTEM_NAME "$system_name"
1141EOF
1142
1143if test "${cf_cv_system_name+set}" = set; then
1144 echo $ECHO_N "(cached) $ECHO_C" >&6
1145else
1146 cf_cv_system_name="$system_name"
1147fi
1148
1149test -z "$system_name" && system_name="$cf_cv_system_name"
micky3879b9f5e72025-07-08 18:04:53 -04001150test -n "$cf_cv_system_name" && echo "$as_me:1150: result: Configuring for $cf_cv_system_name" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01001151echo "${ECHO_T}Configuring for $cf_cv_system_name" >&6
1152
1153if test ".$system_name" != ".$cf_cv_system_name" ; then
micky3879b9f5e72025-07-08 18:04:53 -04001154 echo "$as_me:1154: result: Cached system name ($system_name) does not agree with actual ($cf_cv_system_name)" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01001155echo "${ECHO_T}Cached system name ($system_name) does not agree with actual ($cf_cv_system_name)" >&6
micky3879b9f5e72025-07-08 18:04:53 -04001156 { { echo "$as_me:1156: error: \"Please remove config.cache and try again.\"" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01001157echo "$as_me: error: \"Please remove config.cache and try again.\"" >&2;}
1158 { (exit 1); exit 1; }; }
1159fi
1160
1161test "$program_prefix" != NONE &&
1162 program_transform_name="s,^,$program_prefix,;$program_transform_name"
1163# Use a double $ so make ignores it.
1164test "$program_suffix" != NONE &&
1165 program_transform_name="s,\$,$program_suffix,;$program_transform_name"
1166# Double any \ or $. echo might interpret backslashes.
1167# By default was `s,x,x', remove it if useless.
1168cat <<\_ACEOF >conftest.sed
1169s/[\\$]/&&/g;s/;s,x,x,$//
1170_ACEOF
1171program_transform_name=`echo $program_transform_name | sed -f conftest.sed`
1172rm conftest.sed
1173
micky3879b9f5e72025-07-08 18:04:53 -04001174echo "$as_me:1174: checking whether ${MAKE-make} sets \${MAKE}" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01001175echo $ECHO_N "checking whether ${MAKE-make} sets \${MAKE}... $ECHO_C" >&6
1176set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,./+-,__p_,'`
1177if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then
1178 echo $ECHO_N "(cached) $ECHO_C" >&6
1179else
1180 cat >conftest.make <<\EOF
1181all:
1182 @echo 'ac_maketemp="${MAKE}"'
1183EOF
1184# GNU make sometimes prints "make[1]: Entering...", which would confuse us.
1185eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=`
1186if test -n "$ac_maketemp"; then
1187 eval ac_cv_prog_make_${ac_make}_set=yes
1188else
1189 eval ac_cv_prog_make_${ac_make}_set=no
1190fi
1191rm -f conftest.make
1192fi
1193if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
micky3879b9f5e72025-07-08 18:04:53 -04001194 echo "$as_me:1194: result: yes" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01001195echo "${ECHO_T}yes" >&6
1196 SET_MAKE=
1197else
micky3879b9f5e72025-07-08 18:04:53 -04001198 echo "$as_me:1198: result: no" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01001199echo "${ECHO_T}no" >&6
1200 SET_MAKE="MAKE=${MAKE-make}"
1201fi
1202
1203ac_ext=c
1204ac_cpp='$CPP $CPPFLAGS'
micky3879b9f5e72025-07-08 18:04:53 -04001205ac_compile='$CC -c $CFLAGS $CPPFLAGS "conftest.$ac_ext" >&5'
1206ac_link='$CC -o "conftest$ac_exeext" $CFLAGS $CPPFLAGS $LDFLAGS "conftest.$ac_ext" $LIBS >&5'
Steve Kondikae271bc2015-11-15 02:50:53 +01001207ac_compiler_gnu=$ac_cv_c_compiler_gnu
micky3879b9f5e72025-07-08 18:04:53 -04001208ac_main_return="return"
Steve Kondikae271bc2015-11-15 02:50:53 +01001209if test -n "$ac_tool_prefix"; then
1210 # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
1211set dummy ${ac_tool_prefix}gcc; ac_word=$2
micky3879b9f5e72025-07-08 18:04:53 -04001212echo "$as_me:1212: checking for $ac_word" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01001213echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1214if test "${ac_cv_prog_CC+set}" = set; then
1215 echo $ECHO_N "(cached) $ECHO_C" >&6
1216else
1217 if test -n "$CC"; then
1218 ac_cv_prog_CC="$CC" # Let the user override the test.
1219else
1220 ac_save_IFS=$IFS; IFS=$ac_path_separator
1221ac_dummy="$PATH"
1222for ac_dir in $ac_dummy; do
1223 IFS=$ac_save_IFS
1224 test -z "$ac_dir" && ac_dir=.
1225 $as_executable_p "$ac_dir/$ac_word" || continue
1226ac_cv_prog_CC="${ac_tool_prefix}gcc"
micky3879b9f5e72025-07-08 18:04:53 -04001227echo "$as_me:1227: found $ac_dir/$ac_word" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01001228break
1229done
1230
1231fi
1232fi
1233CC=$ac_cv_prog_CC
1234if test -n "$CC"; then
micky3879b9f5e72025-07-08 18:04:53 -04001235 echo "$as_me:1235: result: $CC" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01001236echo "${ECHO_T}$CC" >&6
1237else
micky3879b9f5e72025-07-08 18:04:53 -04001238 echo "$as_me:1238: result: no" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01001239echo "${ECHO_T}no" >&6
1240fi
1241
1242fi
1243if test -z "$ac_cv_prog_CC"; then
1244 ac_ct_CC=$CC
1245 # Extract the first word of "gcc", so it can be a program name with args.
1246set dummy gcc; ac_word=$2
micky3879b9f5e72025-07-08 18:04:53 -04001247echo "$as_me:1247: checking for $ac_word" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01001248echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1249if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
1250 echo $ECHO_N "(cached) $ECHO_C" >&6
1251else
1252 if test -n "$ac_ct_CC"; then
1253 ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
1254else
1255 ac_save_IFS=$IFS; IFS=$ac_path_separator
1256ac_dummy="$PATH"
1257for ac_dir in $ac_dummy; do
1258 IFS=$ac_save_IFS
1259 test -z "$ac_dir" && ac_dir=.
1260 $as_executable_p "$ac_dir/$ac_word" || continue
1261ac_cv_prog_ac_ct_CC="gcc"
micky3879b9f5e72025-07-08 18:04:53 -04001262echo "$as_me:1262: found $ac_dir/$ac_word" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01001263break
1264done
1265
1266fi
1267fi
1268ac_ct_CC=$ac_cv_prog_ac_ct_CC
1269if test -n "$ac_ct_CC"; then
micky3879b9f5e72025-07-08 18:04:53 -04001270 echo "$as_me:1270: result: $ac_ct_CC" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01001271echo "${ECHO_T}$ac_ct_CC" >&6
1272else
micky3879b9f5e72025-07-08 18:04:53 -04001273 echo "$as_me:1273: result: no" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01001274echo "${ECHO_T}no" >&6
1275fi
1276
1277 CC=$ac_ct_CC
1278else
1279 CC="$ac_cv_prog_CC"
1280fi
1281
1282if test -z "$CC"; then
1283 if test -n "$ac_tool_prefix"; then
1284 # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
1285set dummy ${ac_tool_prefix}cc; ac_word=$2
micky3879b9f5e72025-07-08 18:04:53 -04001286echo "$as_me:1286: checking for $ac_word" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01001287echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1288if test "${ac_cv_prog_CC+set}" = set; then
1289 echo $ECHO_N "(cached) $ECHO_C" >&6
1290else
1291 if test -n "$CC"; then
1292 ac_cv_prog_CC="$CC" # Let the user override the test.
1293else
1294 ac_save_IFS=$IFS; IFS=$ac_path_separator
1295ac_dummy="$PATH"
1296for ac_dir in $ac_dummy; do
1297 IFS=$ac_save_IFS
1298 test -z "$ac_dir" && ac_dir=.
1299 $as_executable_p "$ac_dir/$ac_word" || continue
1300ac_cv_prog_CC="${ac_tool_prefix}cc"
micky3879b9f5e72025-07-08 18:04:53 -04001301echo "$as_me:1301: found $ac_dir/$ac_word" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01001302break
1303done
1304
1305fi
1306fi
1307CC=$ac_cv_prog_CC
1308if test -n "$CC"; then
micky3879b9f5e72025-07-08 18:04:53 -04001309 echo "$as_me:1309: result: $CC" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01001310echo "${ECHO_T}$CC" >&6
1311else
micky3879b9f5e72025-07-08 18:04:53 -04001312 echo "$as_me:1312: result: no" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01001313echo "${ECHO_T}no" >&6
1314fi
1315
1316fi
1317if test -z "$ac_cv_prog_CC"; then
1318 ac_ct_CC=$CC
1319 # Extract the first word of "cc", so it can be a program name with args.
1320set dummy cc; ac_word=$2
micky3879b9f5e72025-07-08 18:04:53 -04001321echo "$as_me:1321: checking for $ac_word" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01001322echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1323if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
1324 echo $ECHO_N "(cached) $ECHO_C" >&6
1325else
1326 if test -n "$ac_ct_CC"; then
1327 ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
1328else
1329 ac_save_IFS=$IFS; IFS=$ac_path_separator
1330ac_dummy="$PATH"
1331for ac_dir in $ac_dummy; do
1332 IFS=$ac_save_IFS
1333 test -z "$ac_dir" && ac_dir=.
1334 $as_executable_p "$ac_dir/$ac_word" || continue
1335ac_cv_prog_ac_ct_CC="cc"
micky3879b9f5e72025-07-08 18:04:53 -04001336echo "$as_me:1336: found $ac_dir/$ac_word" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01001337break
1338done
1339
1340fi
1341fi
1342ac_ct_CC=$ac_cv_prog_ac_ct_CC
1343if test -n "$ac_ct_CC"; then
micky3879b9f5e72025-07-08 18:04:53 -04001344 echo "$as_me:1344: result: $ac_ct_CC" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01001345echo "${ECHO_T}$ac_ct_CC" >&6
1346else
micky3879b9f5e72025-07-08 18:04:53 -04001347 echo "$as_me:1347: result: no" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01001348echo "${ECHO_T}no" >&6
1349fi
1350
1351 CC=$ac_ct_CC
1352else
1353 CC="$ac_cv_prog_CC"
1354fi
1355
1356fi
1357if test -z "$CC"; then
1358 # Extract the first word of "cc", so it can be a program name with args.
1359set dummy cc; ac_word=$2
micky3879b9f5e72025-07-08 18:04:53 -04001360echo "$as_me:1360: checking for $ac_word" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01001361echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1362if test "${ac_cv_prog_CC+set}" = set; then
1363 echo $ECHO_N "(cached) $ECHO_C" >&6
1364else
1365 if test -n "$CC"; then
1366 ac_cv_prog_CC="$CC" # Let the user override the test.
1367else
1368 ac_prog_rejected=no
1369 ac_save_IFS=$IFS; IFS=$ac_path_separator
1370ac_dummy="$PATH"
1371for ac_dir in $ac_dummy; do
1372 IFS=$ac_save_IFS
1373 test -z "$ac_dir" && ac_dir=.
1374 $as_executable_p "$ac_dir/$ac_word" || continue
1375if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
1376 ac_prog_rejected=yes
1377 continue
1378fi
1379ac_cv_prog_CC="cc"
micky3879b9f5e72025-07-08 18:04:53 -04001380echo "$as_me:1380: found $ac_dir/$ac_word" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01001381break
1382done
1383
micky3879b9f5e72025-07-08 18:04:53 -04001384if test "$ac_prog_rejected" = yes; then
Steve Kondikae271bc2015-11-15 02:50:53 +01001385 # We found a bogon in the path, so make sure we never use it.
1386 set dummy $ac_cv_prog_CC
1387 shift
1388 if test $# != 0; then
1389 # We chose a different compiler from the bogus one.
1390 # However, it has the same basename, so the bogon will be chosen
1391 # first if we set CC to just the basename; use the full file name.
1392 shift
1393 set dummy "$ac_dir/$ac_word" ${1+"$@"}
1394 shift
1395 ac_cv_prog_CC="$@"
1396 fi
1397fi
1398fi
1399fi
1400CC=$ac_cv_prog_CC
1401if test -n "$CC"; then
micky3879b9f5e72025-07-08 18:04:53 -04001402 echo "$as_me:1402: result: $CC" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01001403echo "${ECHO_T}$CC" >&6
1404else
micky3879b9f5e72025-07-08 18:04:53 -04001405 echo "$as_me:1405: result: no" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01001406echo "${ECHO_T}no" >&6
1407fi
1408
1409fi
1410if test -z "$CC"; then
1411 if test -n "$ac_tool_prefix"; then
1412 for ac_prog in cl
1413 do
1414 # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
1415set dummy $ac_tool_prefix$ac_prog; ac_word=$2
micky3879b9f5e72025-07-08 18:04:53 -04001416echo "$as_me:1416: checking for $ac_word" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01001417echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1418if test "${ac_cv_prog_CC+set}" = set; then
1419 echo $ECHO_N "(cached) $ECHO_C" >&6
1420else
1421 if test -n "$CC"; then
1422 ac_cv_prog_CC="$CC" # Let the user override the test.
1423else
1424 ac_save_IFS=$IFS; IFS=$ac_path_separator
1425ac_dummy="$PATH"
1426for ac_dir in $ac_dummy; do
1427 IFS=$ac_save_IFS
1428 test -z "$ac_dir" && ac_dir=.
1429 $as_executable_p "$ac_dir/$ac_word" || continue
1430ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
micky3879b9f5e72025-07-08 18:04:53 -04001431echo "$as_me:1431: found $ac_dir/$ac_word" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01001432break
1433done
1434
1435fi
1436fi
1437CC=$ac_cv_prog_CC
1438if test -n "$CC"; then
micky3879b9f5e72025-07-08 18:04:53 -04001439 echo "$as_me:1439: result: $CC" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01001440echo "${ECHO_T}$CC" >&6
1441else
micky3879b9f5e72025-07-08 18:04:53 -04001442 echo "$as_me:1442: result: no" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01001443echo "${ECHO_T}no" >&6
1444fi
1445
1446 test -n "$CC" && break
1447 done
1448fi
1449if test -z "$CC"; then
1450 ac_ct_CC=$CC
1451 for ac_prog in cl
1452do
1453 # Extract the first word of "$ac_prog", so it can be a program name with args.
1454set dummy $ac_prog; ac_word=$2
micky3879b9f5e72025-07-08 18:04:53 -04001455echo "$as_me:1455: checking for $ac_word" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01001456echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1457if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
1458 echo $ECHO_N "(cached) $ECHO_C" >&6
1459else
1460 if test -n "$ac_ct_CC"; then
1461 ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
1462else
1463 ac_save_IFS=$IFS; IFS=$ac_path_separator
1464ac_dummy="$PATH"
1465for ac_dir in $ac_dummy; do
1466 IFS=$ac_save_IFS
1467 test -z "$ac_dir" && ac_dir=.
1468 $as_executable_p "$ac_dir/$ac_word" || continue
1469ac_cv_prog_ac_ct_CC="$ac_prog"
micky3879b9f5e72025-07-08 18:04:53 -04001470echo "$as_me:1470: found $ac_dir/$ac_word" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01001471break
1472done
1473
1474fi
1475fi
1476ac_ct_CC=$ac_cv_prog_ac_ct_CC
1477if test -n "$ac_ct_CC"; then
micky3879b9f5e72025-07-08 18:04:53 -04001478 echo "$as_me:1478: result: $ac_ct_CC" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01001479echo "${ECHO_T}$ac_ct_CC" >&6
1480else
micky3879b9f5e72025-07-08 18:04:53 -04001481 echo "$as_me:1481: result: no" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01001482echo "${ECHO_T}no" >&6
1483fi
1484
1485 test -n "$ac_ct_CC" && break
1486done
1487
1488 CC=$ac_ct_CC
1489fi
1490
1491fi
1492
micky3879b9f5e72025-07-08 18:04:53 -04001493test -z "$CC" && { { echo "$as_me:1493: error: no acceptable cc found in \$PATH" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01001494echo "$as_me: error: no acceptable cc found in \$PATH" >&2;}
1495 { (exit 1); exit 1; }; }
1496
1497# Provide some information about the compiler.
micky3879b9f5e72025-07-08 18:04:53 -04001498echo "$as_me:1498:" \
Steve Kondikae271bc2015-11-15 02:50:53 +01001499 "checking for C compiler version" >&5
micky3879b9f5e72025-07-08 18:04:53 -04001500ac_compiler=`set X $ac_compile; echo "$2"`
1501{ (eval echo "$as_me:1501: \"$ac_compiler --version </dev/null >&5\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01001502 (eval $ac_compiler --version </dev/null >&5) 2>&5
1503 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -04001504 echo "$as_me:1504: \$? = $ac_status" >&5
1505 (exit "$ac_status"); }
1506{ (eval echo "$as_me:1506: \"$ac_compiler -v </dev/null >&5\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01001507 (eval $ac_compiler -v </dev/null >&5) 2>&5
1508 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -04001509 echo "$as_me:1509: \$? = $ac_status" >&5
1510 (exit "$ac_status"); }
1511{ (eval echo "$as_me:1511: \"$ac_compiler -V </dev/null >&5\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01001512 (eval $ac_compiler -V </dev/null >&5) 2>&5
1513 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -04001514 echo "$as_me:1514: \$? = $ac_status" >&5
1515 (exit "$ac_status"); }
Steve Kondikae271bc2015-11-15 02:50:53 +01001516
micky3879b9f5e72025-07-08 18:04:53 -04001517cat >"conftest.$ac_ext" <<_ACEOF
1518#line 1518 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +01001519#include "confdefs.h"
1520
1521int
micky3879b9f5e72025-07-08 18:04:53 -04001522main (void)
Steve Kondikae271bc2015-11-15 02:50:53 +01001523{
1524
1525 ;
1526 return 0;
1527}
1528_ACEOF
1529ac_clean_files_save=$ac_clean_files
1530ac_clean_files="$ac_clean_files a.out a.exe"
1531# Try to create an executable without -o first, disregard a.out.
1532# It will help us diagnose broken compilers, and finding out an intuition
1533# of exeext.
micky3879b9f5e72025-07-08 18:04:53 -04001534echo "$as_me:1534: checking for C compiler default output" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01001535echo $ECHO_N "checking for C compiler default output... $ECHO_C" >&6
micky3879b9f5e72025-07-08 18:04:53 -04001536ac_link_default=`echo "$ac_link" | sed 's/ -o *"conftest[^"]*"//'`
1537if { (eval echo "$as_me:1537: \"$ac_link_default\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01001538 (eval $ac_link_default) 2>&5
1539 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -04001540 echo "$as_me:1540: \$? = $ac_status" >&5
1541 (exit "$ac_status"); }; then
Steve Kondikae271bc2015-11-15 02:50:53 +01001542 # Find the output, starting from the most likely. This scheme is
1543# not robust to junk in `.', hence go to wildcards (a.*) only as a last
1544# resort.
1545for ac_file in `ls a.exe conftest.exe 2>/dev/null;
1546 ls a.out conftest 2>/dev/null;
1547 ls a.* conftest.* 2>/dev/null`; do
1548 case $ac_file in
1549 *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;;
1550 a.out ) # We found the default executable, but exeext='' is most
1551 # certainly right.
1552 break;;
1553 *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
1554 # FIXME: I believe we export ac_cv_exeext for Libtool --akim.
1555 export ac_cv_exeext
1556 break;;
1557 * ) break;;
1558 esac
1559done
1560else
1561 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -04001562cat "conftest.$ac_ext" >&5
1563{ { echo "$as_me:1563: error: C compiler cannot create executables" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01001564echo "$as_me: error: C compiler cannot create executables" >&2;}
1565 { (exit 77); exit 77; }; }
1566fi
1567
1568ac_exeext=$ac_cv_exeext
micky3879b9f5e72025-07-08 18:04:53 -04001569echo "$as_me:1569: result: $ac_file" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01001570echo "${ECHO_T}$ac_file" >&6
1571
1572# Check the compiler produces executables we can run. If not, either
1573# the compiler is broken, or we cross compile.
micky3879b9f5e72025-07-08 18:04:53 -04001574echo "$as_me:1574: checking whether the C compiler works" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01001575echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6
1576# FIXME: These cross compiler hacks should be removed for Autoconf 3.0
1577# If not cross compiling, check that we can run a simple program.
1578if test "$cross_compiling" != yes; then
1579 if { ac_try='./$ac_file'
micky3879b9f5e72025-07-08 18:04:53 -04001580 { (eval echo "$as_me:1580: \"$ac_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01001581 (eval $ac_try) 2>&5
1582 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -04001583 echo "$as_me:1583: \$? = $ac_status" >&5
1584 (exit "$ac_status"); }; }; then
Steve Kondikae271bc2015-11-15 02:50:53 +01001585 cross_compiling=no
1586 else
1587 if test "$cross_compiling" = maybe; then
1588 cross_compiling=yes
1589 else
micky3879b9f5e72025-07-08 18:04:53 -04001590 { { echo "$as_me:1590: error: cannot run C compiled programs.
Steve Kondikae271bc2015-11-15 02:50:53 +01001591If you meant to cross compile, use \`--host'." >&5
1592echo "$as_me: error: cannot run C compiled programs.
1593If you meant to cross compile, use \`--host'." >&2;}
1594 { (exit 1); exit 1; }; }
1595 fi
1596 fi
1597fi
micky3879b9f5e72025-07-08 18:04:53 -04001598echo "$as_me:1598: result: yes" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01001599echo "${ECHO_T}yes" >&6
1600
micky3879b9f5e72025-07-08 18:04:53 -04001601rm -f a.out a.exe "conftest$ac_cv_exeext"
Steve Kondikae271bc2015-11-15 02:50:53 +01001602ac_clean_files=$ac_clean_files_save
1603# Check the compiler produces executables we can run. If not, either
1604# the compiler is broken, or we cross compile.
micky3879b9f5e72025-07-08 18:04:53 -04001605echo "$as_me:1605: checking whether we are cross compiling" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01001606echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6
micky3879b9f5e72025-07-08 18:04:53 -04001607echo "$as_me:1607: result: $cross_compiling" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01001608echo "${ECHO_T}$cross_compiling" >&6
1609
micky3879b9f5e72025-07-08 18:04:53 -04001610echo "$as_me:1610: checking for executable suffix" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01001611echo $ECHO_N "checking for executable suffix... $ECHO_C" >&6
micky3879b9f5e72025-07-08 18:04:53 -04001612if { (eval echo "$as_me:1612: \"$ac_link\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01001613 (eval $ac_link) 2>&5
1614 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -04001615 echo "$as_me:1615: \$? = $ac_status" >&5
1616 (exit "$ac_status"); }; then
Steve Kondikae271bc2015-11-15 02:50:53 +01001617 # If both `conftest.exe' and `conftest' are `present' (well, observable)
1618# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will
1619# work properly (i.e., refer to `conftest.exe'), while it won't with
1620# `rm'.
1621for ac_file in `(ls conftest.exe; ls conftest; ls conftest.*) 2>/dev/null`; do
1622 case $ac_file in
1623 *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;;
1624 *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
1625 export ac_cv_exeext
1626 break;;
1627 * ) break;;
1628 esac
1629done
1630else
micky3879b9f5e72025-07-08 18:04:53 -04001631 { { echo "$as_me:1631: error: cannot compute EXEEXT: cannot compile and link" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01001632echo "$as_me: error: cannot compute EXEEXT: cannot compile and link" >&2;}
1633 { (exit 1); exit 1; }; }
1634fi
1635
micky3879b9f5e72025-07-08 18:04:53 -04001636rm -f "conftest$ac_cv_exeext"
1637echo "$as_me:1637: result: $ac_cv_exeext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01001638echo "${ECHO_T}$ac_cv_exeext" >&6
1639
micky3879b9f5e72025-07-08 18:04:53 -04001640rm -f "conftest.$ac_ext"
Steve Kondikae271bc2015-11-15 02:50:53 +01001641EXEEXT=$ac_cv_exeext
1642ac_exeext=$EXEEXT
micky3879b9f5e72025-07-08 18:04:53 -04001643echo "$as_me:1643: checking for object suffix" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01001644echo $ECHO_N "checking for object suffix... $ECHO_C" >&6
1645if test "${ac_cv_objext+set}" = set; then
1646 echo $ECHO_N "(cached) $ECHO_C" >&6
1647else
micky3879b9f5e72025-07-08 18:04:53 -04001648 cat >"conftest.$ac_ext" <<_ACEOF
1649#line 1649 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +01001650#include "confdefs.h"
1651
1652int
micky3879b9f5e72025-07-08 18:04:53 -04001653main (void)
Steve Kondikae271bc2015-11-15 02:50:53 +01001654{
1655
1656 ;
1657 return 0;
1658}
1659_ACEOF
1660rm -f conftest.o conftest.obj
micky3879b9f5e72025-07-08 18:04:53 -04001661if { (eval echo "$as_me:1661: \"$ac_compile\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01001662 (eval $ac_compile) 2>&5
1663 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -04001664 echo "$as_me:1664: \$? = $ac_status" >&5
1665 (exit "$ac_status"); }; then
Steve Kondikae271bc2015-11-15 02:50:53 +01001666 for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do
1667 case $ac_file in
1668 *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.map | *.inf ) ;;
1669 *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
1670 break;;
1671 esac
1672done
1673else
1674 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -04001675cat "conftest.$ac_ext" >&5
1676{ { echo "$as_me:1676: error: cannot compute OBJEXT: cannot compile" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01001677echo "$as_me: error: cannot compute OBJEXT: cannot compile" >&2;}
1678 { (exit 1); exit 1; }; }
1679fi
1680
micky3879b9f5e72025-07-08 18:04:53 -04001681rm -f "conftest.$ac_cv_objext" "conftest.$ac_ext"
Steve Kondikae271bc2015-11-15 02:50:53 +01001682fi
micky3879b9f5e72025-07-08 18:04:53 -04001683echo "$as_me:1683: result: $ac_cv_objext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01001684echo "${ECHO_T}$ac_cv_objext" >&6
1685OBJEXT=$ac_cv_objext
1686ac_objext=$OBJEXT
micky3879b9f5e72025-07-08 18:04:53 -04001687echo "$as_me:1687: checking whether we are using the GNU C compiler" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01001688echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6
1689if test "${ac_cv_c_compiler_gnu+set}" = set; then
1690 echo $ECHO_N "(cached) $ECHO_C" >&6
1691else
micky3879b9f5e72025-07-08 18:04:53 -04001692 cat >"conftest.$ac_ext" <<_ACEOF
1693#line 1693 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +01001694#include "confdefs.h"
1695
1696int
micky3879b9f5e72025-07-08 18:04:53 -04001697main (void)
Steve Kondikae271bc2015-11-15 02:50:53 +01001698{
1699#ifndef __GNUC__
1700 choke me
1701#endif
1702
1703 ;
1704 return 0;
1705}
1706_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -04001707rm -f "conftest.$ac_objext"
1708if { (eval echo "$as_me:1708: \"$ac_compile\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01001709 (eval $ac_compile) 2>&5
1710 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -04001711 echo "$as_me:1711: \$? = $ac_status" >&5
1712 (exit "$ac_status"); } &&
1713 { ac_try='test -s "conftest.$ac_objext"'
1714 { (eval echo "$as_me:1714: \"$ac_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01001715 (eval $ac_try) 2>&5
1716 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -04001717 echo "$as_me:1717: \$? = $ac_status" >&5
1718 (exit "$ac_status"); }; }; then
Steve Kondikae271bc2015-11-15 02:50:53 +01001719 ac_compiler_gnu=yes
1720else
1721 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -04001722cat "conftest.$ac_ext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01001723ac_compiler_gnu=no
1724fi
micky3879b9f5e72025-07-08 18:04:53 -04001725rm -f "conftest.$ac_objext" "conftest.$ac_ext"
Steve Kondikae271bc2015-11-15 02:50:53 +01001726ac_cv_c_compiler_gnu=$ac_compiler_gnu
1727
1728fi
micky3879b9f5e72025-07-08 18:04:53 -04001729echo "$as_me:1729: result: $ac_cv_c_compiler_gnu" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01001730echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6
1731GCC=`test $ac_compiler_gnu = yes && echo yes`
1732ac_test_CFLAGS=${CFLAGS+set}
1733ac_save_CFLAGS=$CFLAGS
1734CFLAGS="-g"
micky3879b9f5e72025-07-08 18:04:53 -04001735echo "$as_me:1735: checking whether $CC accepts -g" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01001736echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6
1737if test "${ac_cv_prog_cc_g+set}" = set; then
1738 echo $ECHO_N "(cached) $ECHO_C" >&6
1739else
micky3879b9f5e72025-07-08 18:04:53 -04001740 cat >"conftest.$ac_ext" <<_ACEOF
1741#line 1741 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +01001742#include "confdefs.h"
1743
1744int
micky3879b9f5e72025-07-08 18:04:53 -04001745main (void)
Steve Kondikae271bc2015-11-15 02:50:53 +01001746{
1747
1748 ;
1749 return 0;
1750}
1751_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -04001752rm -f "conftest.$ac_objext"
1753if { (eval echo "$as_me:1753: \"$ac_compile\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01001754 (eval $ac_compile) 2>&5
1755 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -04001756 echo "$as_me:1756: \$? = $ac_status" >&5
1757 (exit "$ac_status"); } &&
1758 { ac_try='test -s "conftest.$ac_objext"'
1759 { (eval echo "$as_me:1759: \"$ac_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01001760 (eval $ac_try) 2>&5
1761 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -04001762 echo "$as_me:1762: \$? = $ac_status" >&5
1763 (exit "$ac_status"); }; }; then
Steve Kondikae271bc2015-11-15 02:50:53 +01001764 ac_cv_prog_cc_g=yes
1765else
1766 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -04001767cat "conftest.$ac_ext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01001768ac_cv_prog_cc_g=no
1769fi
micky3879b9f5e72025-07-08 18:04:53 -04001770rm -f "conftest.$ac_objext" "conftest.$ac_ext"
Steve Kondikae271bc2015-11-15 02:50:53 +01001771fi
micky3879b9f5e72025-07-08 18:04:53 -04001772echo "$as_me:1772: result: $ac_cv_prog_cc_g" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01001773echo "${ECHO_T}$ac_cv_prog_cc_g" >&6
1774if test "$ac_test_CFLAGS" = set; then
1775 CFLAGS=$ac_save_CFLAGS
1776elif test $ac_cv_prog_cc_g = yes; then
1777 if test "$GCC" = yes; then
1778 CFLAGS="-g -O2"
1779 else
1780 CFLAGS="-g"
1781 fi
1782else
1783 if test "$GCC" = yes; then
1784 CFLAGS="-O2"
1785 else
1786 CFLAGS=
1787 fi
1788fi
1789# Some people use a C++ compiler to compile C. Since we use `exit',
1790# in C++ we need to declare it. In case someone uses the same compiler
1791# for both compiling C and C++ we need to have the C++ compiler decide
1792# the declaration of exit, since it's the most demanding environment.
micky3879b9f5e72025-07-08 18:04:53 -04001793cat >"conftest.$ac_ext" <<_ACEOF
Steve Kondikae271bc2015-11-15 02:50:53 +01001794#ifndef __cplusplus
1795 choke me
1796#endif
1797_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -04001798rm -f "conftest.$ac_objext"
1799if { (eval echo "$as_me:1799: \"$ac_compile\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01001800 (eval $ac_compile) 2>&5
1801 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -04001802 echo "$as_me:1802: \$? = $ac_status" >&5
1803 (exit "$ac_status"); } &&
1804 { ac_try='test -s "conftest.$ac_objext"'
1805 { (eval echo "$as_me:1805: \"$ac_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01001806 (eval $ac_try) 2>&5
1807 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -04001808 echo "$as_me:1808: \$? = $ac_status" >&5
1809 (exit "$ac_status"); }; }; then
Steve Kondikae271bc2015-11-15 02:50:53 +01001810 for ac_declaration in \
1811 ''\
1812 '#include <stdlib.h>' \
1813 'extern "C" void std::exit (int) throw (); using std::exit;' \
1814 'extern "C" void std::exit (int); using std::exit;' \
1815 'extern "C" void exit (int) throw ();' \
1816 'extern "C" void exit (int);' \
1817 'void exit (int);'
1818do
micky3879b9f5e72025-07-08 18:04:53 -04001819 cat >"conftest.$ac_ext" <<_ACEOF
1820#line 1820 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +01001821#include "confdefs.h"
1822#include <stdlib.h>
1823$ac_declaration
1824int
micky3879b9f5e72025-07-08 18:04:53 -04001825main (void)
Steve Kondikae271bc2015-11-15 02:50:53 +01001826{
1827exit (42);
1828 ;
1829 return 0;
1830}
1831_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -04001832rm -f "conftest.$ac_objext"
1833if { (eval echo "$as_me:1833: \"$ac_compile\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01001834 (eval $ac_compile) 2>&5
1835 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -04001836 echo "$as_me:1836: \$? = $ac_status" >&5
1837 (exit "$ac_status"); } &&
1838 { ac_try='test -s "conftest.$ac_objext"'
1839 { (eval echo "$as_me:1839: \"$ac_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01001840 (eval $ac_try) 2>&5
1841 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -04001842 echo "$as_me:1842: \$? = $ac_status" >&5
1843 (exit "$ac_status"); }; }; then
Steve Kondikae271bc2015-11-15 02:50:53 +01001844 :
1845else
1846 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -04001847cat "conftest.$ac_ext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01001848continue
1849fi
micky3879b9f5e72025-07-08 18:04:53 -04001850rm -f "conftest.$ac_objext" "conftest.$ac_ext"
1851 cat >"conftest.$ac_ext" <<_ACEOF
1852#line 1852 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +01001853#include "confdefs.h"
1854$ac_declaration
1855int
micky3879b9f5e72025-07-08 18:04:53 -04001856main (void)
Steve Kondikae271bc2015-11-15 02:50:53 +01001857{
1858exit (42);
1859 ;
1860 return 0;
1861}
1862_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -04001863rm -f "conftest.$ac_objext"
1864if { (eval echo "$as_me:1864: \"$ac_compile\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01001865 (eval $ac_compile) 2>&5
1866 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -04001867 echo "$as_me:1867: \$? = $ac_status" >&5
1868 (exit "$ac_status"); } &&
1869 { ac_try='test -s "conftest.$ac_objext"'
1870 { (eval echo "$as_me:1870: \"$ac_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01001871 (eval $ac_try) 2>&5
1872 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -04001873 echo "$as_me:1873: \$? = $ac_status" >&5
1874 (exit "$ac_status"); }; }; then
Steve Kondikae271bc2015-11-15 02:50:53 +01001875 break
1876else
1877 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -04001878cat "conftest.$ac_ext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01001879fi
micky3879b9f5e72025-07-08 18:04:53 -04001880rm -f "conftest.$ac_objext" "conftest.$ac_ext"
Steve Kondikae271bc2015-11-15 02:50:53 +01001881done
1882rm -rf conftest*
1883if test -n "$ac_declaration"; then
1884 echo '#ifdef __cplusplus' >>confdefs.h
micky3879b9f5e72025-07-08 18:04:53 -04001885 echo "$ac_declaration" >>confdefs.h
Steve Kondikae271bc2015-11-15 02:50:53 +01001886 echo '#endif' >>confdefs.h
1887fi
1888
1889else
1890 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -04001891cat "conftest.$ac_ext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01001892fi
micky3879b9f5e72025-07-08 18:04:53 -04001893rm -f "conftest.$ac_objext" "conftest.$ac_ext"
Steve Kondikae271bc2015-11-15 02:50:53 +01001894ac_ext=c
1895ac_cpp='$CPP $CPPFLAGS'
micky3879b9f5e72025-07-08 18:04:53 -04001896ac_compile='$CC -c $CFLAGS $CPPFLAGS "conftest.$ac_ext" >&5'
1897ac_link='$CC -o "conftest$ac_exeext" $CFLAGS $CPPFLAGS $LDFLAGS "conftest.$ac_ext" $LIBS >&5'
Steve Kondikae271bc2015-11-15 02:50:53 +01001898ac_compiler_gnu=$ac_cv_c_compiler_gnu
micky3879b9f5e72025-07-08 18:04:53 -04001899ac_main_return="return"
Steve Kondikae271bc2015-11-15 02:50:53 +01001900
1901GCC_VERSION=none
1902if test "$GCC" = yes ; then
micky3879b9f5e72025-07-08 18:04:53 -04001903 echo "$as_me:1903: checking version of $CC" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01001904echo $ECHO_N "checking version of $CC... $ECHO_C" >&6
micky3879b9f5e72025-07-08 18:04:53 -04001905 GCC_VERSION="`${CC} --version 2>/dev/null | sed -e '2,$d' -e 's/^[^(]*([^)][^)]*) //' -e 's/^[^0-9.]*//' -e 's/[^0-9.].*//'`"
Steve Kondikae271bc2015-11-15 02:50:53 +01001906 test -z "$GCC_VERSION" && GCC_VERSION=unknown
micky3879b9f5e72025-07-08 18:04:53 -04001907 echo "$as_me:1907: result: $GCC_VERSION" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01001908echo "${ECHO_T}$GCC_VERSION" >&6
1909fi
1910
micky3879b9f5e72025-07-08 18:04:53 -04001911INTEL_COMPILER=no
1912
1913if test "$GCC" = yes ; then
1914 case "$host_os" in
1915 (linux*|gnu*)
1916 echo "$as_me:1916: checking if this is really Intel C compiler" >&5
1917echo $ECHO_N "checking if this is really Intel C compiler... $ECHO_C" >&6
1918 cf_save_CFLAGS="$CFLAGS"
1919 CFLAGS="$CFLAGS -no-gcc"
1920 cat >"conftest.$ac_ext" <<_ACEOF
1921#line 1921 "configure"
1922#include "confdefs.h"
1923
1924int
1925main (void)
1926{
1927
1928#ifdef __INTEL_COMPILER
1929#else
1930#error __INTEL_COMPILER is not defined
1931#endif
1932
1933 ;
1934 return 0;
1935}
1936_ACEOF
1937rm -f "conftest.$ac_objext"
1938if { (eval echo "$as_me:1938: \"$ac_compile\"") >&5
1939 (eval $ac_compile) 2>&5
1940 ac_status=$?
1941 echo "$as_me:1941: \$? = $ac_status" >&5
1942 (exit "$ac_status"); } &&
1943 { ac_try='test -s "conftest.$ac_objext"'
1944 { (eval echo "$as_me:1944: \"$ac_try\"") >&5
1945 (eval $ac_try) 2>&5
1946 ac_status=$?
1947 echo "$as_me:1947: \$? = $ac_status" >&5
1948 (exit "$ac_status"); }; }; then
1949 INTEL_COMPILER=yes
1950cf_save_CFLAGS="$cf_save_CFLAGS -we147"
1951
1952else
1953 echo "$as_me: failed program was:" >&5
1954cat "conftest.$ac_ext" >&5
1955fi
1956rm -f "conftest.$ac_objext" "conftest.$ac_ext"
1957 CFLAGS="$cf_save_CFLAGS"
1958 echo "$as_me:1958: result: $INTEL_COMPILER" >&5
1959echo "${ECHO_T}$INTEL_COMPILER" >&6
1960 ;;
1961 esac
1962fi
1963
1964CLANG_COMPILER=no
1965
1966if test "$GCC" = yes ; then
1967 echo "$as_me:1967: checking if this is really Clang C compiler" >&5
1968echo $ECHO_N "checking if this is really Clang C compiler... $ECHO_C" >&6
1969 cf_save_CFLAGS="$CFLAGS"
1970 cat >"conftest.$ac_ext" <<_ACEOF
1971#line 1971 "configure"
1972#include "confdefs.h"
1973
1974int
1975main (void)
1976{
1977
1978#ifdef __clang__
1979#else
1980#error __clang__ is not defined
1981#endif
1982
1983 ;
1984 return 0;
1985}
1986_ACEOF
1987rm -f "conftest.$ac_objext"
1988if { (eval echo "$as_me:1988: \"$ac_compile\"") >&5
1989 (eval $ac_compile) 2>&5
1990 ac_status=$?
1991 echo "$as_me:1991: \$? = $ac_status" >&5
1992 (exit "$ac_status"); } &&
1993 { ac_try='test -s "conftest.$ac_objext"'
1994 { (eval echo "$as_me:1994: \"$ac_try\"") >&5
1995 (eval $ac_try) 2>&5
1996 ac_status=$?
1997 echo "$as_me:1997: \$? = $ac_status" >&5
1998 (exit "$ac_status"); }; }; then
1999 CLANG_COMPILER=yes
2000
2001else
2002 echo "$as_me: failed program was:" >&5
2003cat "conftest.$ac_ext" >&5
2004fi
2005rm -f "conftest.$ac_objext" "conftest.$ac_ext"
2006 CFLAGS="$cf_save_CFLAGS"
2007 echo "$as_me:2007: result: $CLANG_COMPILER" >&5
2008echo "${ECHO_T}$CLANG_COMPILER" >&6
2009fi
2010
2011CLANG_VERSION=none
2012
2013if test "x$CLANG_COMPILER" = "xyes" ; then
2014 case "$CC" in
2015 (c[1-9][0-9]|*/c[1-9][0-9])
2016 { echo "$as_me:2016: WARNING: replacing broken compiler alias $CC" >&5
2017echo "$as_me: WARNING: replacing broken compiler alias $CC" >&2;}
2018 CFLAGS="$CFLAGS -std=`echo "$CC" | sed -e 's%.*/%%'`"
2019 CC=clang
2020 ;;
2021 esac
2022
2023 echo "$as_me:2023: checking version of $CC" >&5
2024echo $ECHO_N "checking version of $CC... $ECHO_C" >&6
2025 CLANG_VERSION="`$CC --version 2>/dev/null | sed -e '2,$d' -e 's/^.*(CLANG[^)]*) //' -e 's/^.*(Debian[^)]*) //' -e 's/^[^0-9.]*//' -e 's/[^0-9.].*//'`"
2026 test -z "$CLANG_VERSION" && CLANG_VERSION=unknown
2027 echo "$as_me:2027: result: $CLANG_VERSION" >&5
2028echo "${ECHO_T}$CLANG_VERSION" >&6
2029
2030 for cf_clang_opt in \
2031 -Qunused-arguments \
2032 -Wno-error=implicit-function-declaration
2033 do
2034 echo "$as_me:2034: checking if option $cf_clang_opt works" >&5
2035echo $ECHO_N "checking if option $cf_clang_opt works... $ECHO_C" >&6
2036 cf_save_CFLAGS="$CFLAGS"
2037 CFLAGS="$CFLAGS $cf_clang_opt"
2038 cat >"conftest.$ac_ext" <<_ACEOF
2039#line 2039 "configure"
2040#include "confdefs.h"
2041
2042 #include <stdio.h>
2043int
2044main (void)
2045{
2046
2047 printf("hello!\\n");
2048 ;
2049 return 0;
2050}
2051_ACEOF
2052rm -f "conftest.$ac_objext" "conftest$ac_exeext"
2053if { (eval echo "$as_me:2053: \"$ac_link\"") >&5
2054 (eval $ac_link) 2>&5
2055 ac_status=$?
2056 echo "$as_me:2056: \$? = $ac_status" >&5
2057 (exit "$ac_status"); } &&
2058 { ac_try='test -s "conftest$ac_exeext"'
2059 { (eval echo "$as_me:2059: \"$ac_try\"") >&5
2060 (eval $ac_try) 2>&5
2061 ac_status=$?
2062 echo "$as_me:2062: \$? = $ac_status" >&5
2063 (exit "$ac_status"); }; }; then
2064
2065 cf_clang_optok=yes
2066else
2067 echo "$as_me: failed program was:" >&5
2068cat "conftest.$ac_ext" >&5
2069
2070 cf_clang_optok=no
2071fi
2072rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
2073 echo "$as_me:2073: result: $cf_clang_optok" >&5
2074echo "${ECHO_T}$cf_clang_optok" >&6
2075 CFLAGS="$cf_save_CFLAGS"
2076 if test "$cf_clang_optok" = yes; then
2077 test -n "$verbose" && echo " adding option $cf_clang_opt" 1>&6
2078
2079echo "${as_me:-configure}:2079: testing adding option $cf_clang_opt ..." 1>&5
2080
2081 test -n "$CFLAGS" && CFLAGS="$CFLAGS "
2082 CFLAGS="${CFLAGS}$cf_clang_opt"
2083
2084 fi
2085 done
2086fi
2087
2088echo "$as_me:2088: checking for $CC option to accept ANSI C" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01002089echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6
2090if test "${ac_cv_prog_cc_stdc+set}" = set; then
2091 echo $ECHO_N "(cached) $ECHO_C" >&6
2092else
2093 ac_cv_prog_cc_stdc=no
2094ac_save_CC=$CC
micky3879b9f5e72025-07-08 18:04:53 -04002095cat >"conftest.$ac_ext" <<_ACEOF
2096#line 2096 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +01002097#include "confdefs.h"
2098#include <stdarg.h>
2099#include <stdio.h>
2100#include <sys/types.h>
2101#include <sys/stat.h>
2102/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */
2103struct buf { int x; };
2104FILE * (*rcsopen) (struct buf *, struct stat *, int);
micky3879b9f5e72025-07-08 18:04:53 -04002105static char *e (char **p, int i)
Steve Kondikae271bc2015-11-15 02:50:53 +01002106{
2107 return p[i];
2108}
2109static char *f (char * (*g) (char **, int), char **p, ...)
2110{
2111 char *s;
2112 va_list v;
2113 va_start (v,p);
2114 s = g (p, va_arg (v,int));
2115 va_end (v);
2116 return s;
2117}
2118int test (int i, double x);
2119struct s1 {int (*f) (int a);};
2120struct s2 {int (*f) (double a);};
2121int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
2122int argc;
2123char **argv;
2124int
micky3879b9f5e72025-07-08 18:04:53 -04002125main (void)
Steve Kondikae271bc2015-11-15 02:50:53 +01002126{
2127return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1];
2128 ;
2129 return 0;
2130}
2131_ACEOF
2132# Don't try gcc -ansi; that turns off useful extensions and
2133# breaks some systems' header files.
2134# AIX -qlanglvl=ansi
2135# Ultrix and OSF/1 -std1
2136# HP-UX 10.20 and later -Ae
2137# HP-UX older versions -Aa -D_HPUX_SOURCE
2138# SVR4 -Xc -D__EXTENSIONS__
2139for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
2140do
2141 CC="$ac_save_CC $ac_arg"
micky3879b9f5e72025-07-08 18:04:53 -04002142 rm -f "conftest.$ac_objext"
2143if { (eval echo "$as_me:2143: \"$ac_compile\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01002144 (eval $ac_compile) 2>&5
2145 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -04002146 echo "$as_me:2146: \$? = $ac_status" >&5
2147 (exit "$ac_status"); } &&
2148 { ac_try='test -s "conftest.$ac_objext"'
2149 { (eval echo "$as_me:2149: \"$ac_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01002150 (eval $ac_try) 2>&5
2151 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -04002152 echo "$as_me:2152: \$? = $ac_status" >&5
2153 (exit "$ac_status"); }; }; then
Steve Kondikae271bc2015-11-15 02:50:53 +01002154 ac_cv_prog_cc_stdc=$ac_arg
2155break
2156else
2157 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -04002158cat "conftest.$ac_ext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01002159fi
micky3879b9f5e72025-07-08 18:04:53 -04002160rm -f "conftest.$ac_objext"
Steve Kondikae271bc2015-11-15 02:50:53 +01002161done
micky3879b9f5e72025-07-08 18:04:53 -04002162rm -f "conftest.$ac_ext" "conftest.$ac_objext"
Steve Kondikae271bc2015-11-15 02:50:53 +01002163CC=$ac_save_CC
2164
2165fi
2166
2167case "x$ac_cv_prog_cc_stdc" in
2168 x|xno)
micky3879b9f5e72025-07-08 18:04:53 -04002169 echo "$as_me:2169: result: none needed" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01002170echo "${ECHO_T}none needed" >&6 ;;
2171 *)
micky3879b9f5e72025-07-08 18:04:53 -04002172 echo "$as_me:2172: result: $ac_cv_prog_cc_stdc" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01002173echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6
2174 CC="$CC $ac_cv_prog_cc_stdc" ;;
2175esac
2176
2177# This should have been defined by AC_PROG_CC
micky3879b9f5e72025-07-08 18:04:53 -04002178: "${CC:=cc}"
Steve Kondikae271bc2015-11-15 02:50:53 +01002179
micky3879b9f5e72025-07-08 18:04:53 -04002180echo "$as_me:2180: checking \$CFLAGS variable" >&5
2181echo $ECHO_N "checking \$CFLAGS variable... $ECHO_C" >&6
2182case "x$CFLAGS" in
2183(*-[IUD]*)
2184 echo "$as_me:2184: result: broken" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01002185echo "${ECHO_T}broken" >&6
micky3879b9f5e72025-07-08 18:04:53 -04002186 { echo "$as_me:2186: WARNING: your environment uses the CFLAGS variable to hold CPPFLAGS options" >&5
2187echo "$as_me: WARNING: your environment uses the CFLAGS variable to hold CPPFLAGS options" >&2;}
2188 cf_flags="$CFLAGS"
2189 CFLAGS=
2190 for cf_arg in $cf_flags
2191 do
Steve Kondikae271bc2015-11-15 02:50:53 +01002192
2193cf_fix_cppflags=no
2194cf_new_cflags=
2195cf_new_cppflags=
2196cf_new_extra_cppflags=
2197
micky3879b9f5e72025-07-08 18:04:53 -04002198for cf_add_cflags in $cf_arg
Steve Kondikae271bc2015-11-15 02:50:53 +01002199do
micky3879b9f5e72025-07-08 18:04:53 -04002200case "$cf_fix_cppflags" in
Steve Kondikae271bc2015-11-15 02:50:53 +01002201(no)
micky3879b9f5e72025-07-08 18:04:53 -04002202 case "$cf_add_cflags" in
Steve Kondikae271bc2015-11-15 02:50:53 +01002203 (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
micky3879b9f5e72025-07-08 18:04:53 -04002204 case "$cf_add_cflags" in
Steve Kondikae271bc2015-11-15 02:50:53 +01002205 (-D*)
micky3879b9f5e72025-07-08 18:04:53 -04002206 cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
Steve Kondikae271bc2015-11-15 02:50:53 +01002207
2208 test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
2209 && test -z "${cf_tst_cflags}" \
2210 && cf_fix_cppflags=yes
2211
micky3879b9f5e72025-07-08 18:04:53 -04002212 if test "$cf_fix_cppflags" = yes ; then
2213
2214 test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
2215 cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
2216
Steve Kondikae271bc2015-11-15 02:50:53 +01002217 continue
2218 elif test "${cf_tst_cflags}" = "\"'" ; then
micky3879b9f5e72025-07-08 18:04:53 -04002219
2220 test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
2221 cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
2222
Steve Kondikae271bc2015-11-15 02:50:53 +01002223 continue
2224 fi
2225 ;;
2226 esac
2227 case "$CPPFLAGS" in
2228 (*$cf_add_cflags)
2229 ;;
2230 (*)
micky3879b9f5e72025-07-08 18:04:53 -04002231 case "$cf_add_cflags" in
Steve Kondikae271bc2015-11-15 02:50:53 +01002232 (-D*)
2233 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
2234
2235CPPFLAGS=`echo "$CPPFLAGS" | \
2236 sed -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?[ ]/ /g' \
2237 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?$//g'`
2238
2239 ;;
2240 esac
micky3879b9f5e72025-07-08 18:04:53 -04002241
2242 test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
2243 cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
2244
Steve Kondikae271bc2015-11-15 02:50:53 +01002245 ;;
2246 esac
2247 ;;
2248 (*)
micky3879b9f5e72025-07-08 18:04:53 -04002249
2250 test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
2251 cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
2252
Steve Kondikae271bc2015-11-15 02:50:53 +01002253 ;;
2254 esac
2255 ;;
2256(yes)
Steve Kondikae271bc2015-11-15 02:50:53 +01002257
micky3879b9f5e72025-07-08 18:04:53 -04002258 test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
2259 cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
2260
2261 cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
Steve Kondikae271bc2015-11-15 02:50:53 +01002262
2263 test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
2264 && test -z "${cf_tst_cflags}" \
2265 && cf_fix_cppflags=no
2266 ;;
2267esac
2268done
2269
2270if test -n "$cf_new_cflags" ; then
2271
micky3879b9f5e72025-07-08 18:04:53 -04002272 test -n "$CFLAGS" && CFLAGS="$CFLAGS "
2273 CFLAGS="${CFLAGS}$cf_new_cflags"
2274
Steve Kondikae271bc2015-11-15 02:50:53 +01002275fi
2276
2277if test -n "$cf_new_cppflags" ; then
2278
micky3879b9f5e72025-07-08 18:04:53 -04002279 test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
2280 CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
2281
Steve Kondikae271bc2015-11-15 02:50:53 +01002282fi
2283
2284if test -n "$cf_new_extra_cppflags" ; then
2285
micky3879b9f5e72025-07-08 18:04:53 -04002286 test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
2287 EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
2288
Steve Kondikae271bc2015-11-15 02:50:53 +01002289fi
2290
micky3879b9f5e72025-07-08 18:04:53 -04002291 done
Steve Kondikae271bc2015-11-15 02:50:53 +01002292 ;;
2293(*)
micky3879b9f5e72025-07-08 18:04:53 -04002294 echo "$as_me:2294: result: ok" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01002295echo "${ECHO_T}ok" >&6
2296 ;;
2297esac
2298
micky3879b9f5e72025-07-08 18:04:53 -04002299echo "$as_me:2299: checking \$CC variable" >&5
2300echo $ECHO_N "checking \$CC variable... $ECHO_C" >&6
2301case "$CC" in
2302(*[\ \ ]-*)
2303 echo "$as_me:2303: result: broken" >&5
2304echo "${ECHO_T}broken" >&6
2305 { echo "$as_me:2305: WARNING: your environment uses the CC variable to hold CFLAGS/CPPFLAGS options" >&5
2306echo "$as_me: WARNING: your environment uses the CC variable to hold CFLAGS/CPPFLAGS options" >&2;}
2307 # humor him...
2308 cf_prog=`echo "$CC" | sed -e 's/ / /g' -e 's/[ ]* / /g' -e 's/[ ]*[ ]-[^ ].*//'`
2309 cf_flags=`echo "$CC" | sed -e "s%^$cf_prog%%"`
2310 CC="$cf_prog"
2311 for cf_arg in $cf_flags
2312 do
2313 case "x$cf_arg" in
2314 (x-[IUDfgOW]*)
2315
2316cf_fix_cppflags=no
2317cf_new_cflags=
2318cf_new_cppflags=
2319cf_new_extra_cppflags=
2320
2321for cf_add_cflags in $cf_arg
2322do
2323case "$cf_fix_cppflags" in
2324(no)
2325 case "$cf_add_cflags" in
2326 (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
2327 case "$cf_add_cflags" in
2328 (-D*)
2329 cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
2330
2331 test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
2332 && test -z "${cf_tst_cflags}" \
2333 && cf_fix_cppflags=yes
2334
2335 if test "$cf_fix_cppflags" = yes ; then
2336
2337 test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
2338 cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
2339
2340 continue
2341 elif test "${cf_tst_cflags}" = "\"'" ; then
2342
2343 test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
2344 cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
2345
2346 continue
2347 fi
2348 ;;
2349 esac
2350 case "$CPPFLAGS" in
2351 (*$cf_add_cflags)
2352 ;;
2353 (*)
2354 case "$cf_add_cflags" in
2355 (-D*)
2356 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
2357
2358CPPFLAGS=`echo "$CPPFLAGS" | \
2359 sed -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?[ ]/ /g' \
2360 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?$//g'`
2361
2362 ;;
2363 esac
2364
2365 test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
2366 cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
2367
2368 ;;
2369 esac
2370 ;;
2371 (*)
2372
2373 test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
2374 cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
2375
2376 ;;
2377 esac
2378 ;;
2379(yes)
2380
2381 test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
2382 cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
2383
2384 cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
2385
2386 test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
2387 && test -z "${cf_tst_cflags}" \
2388 && cf_fix_cppflags=no
2389 ;;
2390esac
2391done
2392
2393if test -n "$cf_new_cflags" ; then
2394
2395 test -n "$CFLAGS" && CFLAGS="$CFLAGS "
2396 CFLAGS="${CFLAGS}$cf_new_cflags"
2397
2398fi
2399
2400if test -n "$cf_new_cppflags" ; then
2401
2402 test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
2403 CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
2404
2405fi
2406
2407if test -n "$cf_new_extra_cppflags" ; then
2408
2409 test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
2410 EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
2411
2412fi
2413
2414 ;;
2415 (*)
2416 CC="$CC $cf_arg"
2417 ;;
2418 esac
2419 done
2420 test -n "$verbose" && echo " resulting CC: '$CC'" 1>&6
2421
2422echo "${as_me:-configure}:2422: testing resulting CC: '$CC' ..." 1>&5
2423
2424 test -n "$verbose" && echo " resulting CFLAGS: '$CFLAGS'" 1>&6
2425
2426echo "${as_me:-configure}:2426: testing resulting CFLAGS: '$CFLAGS' ..." 1>&5
2427
2428 test -n "$verbose" && echo " resulting CPPFLAGS: '$CPPFLAGS'" 1>&6
2429
2430echo "${as_me:-configure}:2430: testing resulting CPPFLAGS: '$CPPFLAGS' ..." 1>&5
2431
2432 ;;
2433(*)
2434 echo "$as_me:2434: result: ok" >&5
2435echo "${ECHO_T}ok" >&6
2436 ;;
2437esac
2438
2439echo "$as_me:2439: checking for inline" >&5
2440echo $ECHO_N "checking for inline... $ECHO_C" >&6
2441if test "${ac_cv_c_inline+set}" = set; then
2442 echo $ECHO_N "(cached) $ECHO_C" >&6
2443else
2444 ac_cv_c_inline=no
2445for ac_kw in inline __inline__ __inline; do
2446 cat >"conftest.$ac_ext" <<_ACEOF
2447#line 2447 "configure"
2448#include "confdefs.h"
2449#ifndef __cplusplus
2450static $ac_kw int static_foo (void) {return 0; }
2451$ac_kw int foo (void) {return 0; }
2452#endif
2453
2454_ACEOF
2455rm -f "conftest.$ac_objext"
2456if { (eval echo "$as_me:2456: \"$ac_compile\"") >&5
2457 (eval $ac_compile) 2>&5
2458 ac_status=$?
2459 echo "$as_me:2459: \$? = $ac_status" >&5
2460 (exit "$ac_status"); } &&
2461 { ac_try='test -s "conftest.$ac_objext"'
2462 { (eval echo "$as_me:2462: \"$ac_try\"") >&5
2463 (eval $ac_try) 2>&5
2464 ac_status=$?
2465 echo "$as_me:2465: \$? = $ac_status" >&5
2466 (exit "$ac_status"); }; }; then
2467 ac_cv_c_inline=$ac_kw; break
2468else
2469 echo "$as_me: failed program was:" >&5
2470cat "conftest.$ac_ext" >&5
2471fi
2472rm -f "conftest.$ac_objext" "conftest.$ac_ext"
2473done
2474
2475fi
2476echo "$as_me:2476: result: $ac_cv_c_inline" >&5
2477echo "${ECHO_T}$ac_cv_c_inline" >&6
2478case $ac_cv_c_inline in
2479 inline | yes) ;;
2480 no)
2481cat >>confdefs.h <<\EOF
2482#define inline
2483EOF
2484 ;;
2485 *) cat >>confdefs.h <<EOF
2486#define inline $ac_cv_c_inline
2487EOF
2488 ;;
2489esac
2490
2491for ac_prog in ggrep grep
2492do
2493 # Extract the first word of "$ac_prog", so it can be a program name with args.
2494set dummy $ac_prog; ac_word=$2
2495echo "$as_me:2495: checking for $ac_word" >&5
2496echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2497if test "${ac_cv_prog_GREP+set}" = set; then
2498 echo $ECHO_N "(cached) $ECHO_C" >&6
2499else
2500 if test -n "$GREP"; then
2501 ac_cv_prog_GREP="$GREP" # Let the user override the test.
2502else
2503 ac_save_IFS=$IFS; IFS=$ac_path_separator
2504ac_dummy="$PATH"
2505for ac_dir in $ac_dummy; do
2506 IFS=$ac_save_IFS
2507 test -z "$ac_dir" && ac_dir=.
2508 $as_executable_p "$ac_dir/$ac_word" || continue
2509ac_cv_prog_GREP="$ac_prog"
2510echo "$as_me:2510: found $ac_dir/$ac_word" >&5
2511break
2512done
2513
2514fi
2515fi
2516GREP=$ac_cv_prog_GREP
2517if test -n "$GREP"; then
2518 echo "$as_me:2518: result: $GREP" >&5
2519echo "${ECHO_T}$GREP" >&6
2520else
2521 echo "$as_me:2521: result: no" >&5
2522echo "${ECHO_T}no" >&6
2523fi
2524
2525 test -n "$GREP" && break
2526done
2527test -n "$GREP" || GREP=": "
2528
2529echo "$as_me:2529: checking for egrep" >&5
2530echo $ECHO_N "checking for egrep... $ECHO_C" >&6
2531if test "${ac_cv_path_EGREP+set}" = set; then
2532 echo $ECHO_N "(cached) $ECHO_C" >&6
2533else
2534 if echo a | $GREP -E '(a|b)' >/dev/null 2>&1
2535 then ac_cv_path_EGREP="$GREP -E"
2536 else
2537 for ac_prog in gegrep egrep
2538do
2539 # Extract the first word of "$ac_prog", so it can be a program name with args.
2540set dummy $ac_prog; ac_word=$2
2541echo "$as_me:2541: checking for $ac_word" >&5
2542echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2543if test "${ac_cv_path_EGREP+set}" = set; then
2544 echo $ECHO_N "(cached) $ECHO_C" >&6
2545else
2546 case $EGREP in
2547 [\\/]* | ?:[\\/]*)
2548 ac_cv_path_EGREP="$EGREP" # Let the user override the test with a path.
2549 ;;
2550 *)
2551 ac_save_IFS=$IFS; IFS=$ac_path_separator
2552ac_dummy="$PATH"
2553for ac_dir in $ac_dummy; do
2554 IFS=$ac_save_IFS
2555 test -z "$ac_dir" && ac_dir=.
2556 if $as_executable_p "$ac_dir/$ac_word"; then
2557 ac_cv_path_EGREP="$ac_dir/$ac_word"
2558 echo "$as_me:2558: found $ac_dir/$ac_word" >&5
2559 break
2560fi
2561done
2562
2563 ;;
2564esac
2565fi
2566EGREP=$ac_cv_path_EGREP
2567
2568if test -n "$EGREP"; then
2569 echo "$as_me:2569: result: $EGREP" >&5
2570echo "${ECHO_T}$EGREP" >&6
2571else
2572 echo "$as_me:2572: result: no" >&5
2573echo "${ECHO_T}no" >&6
2574fi
2575
2576 test -n "$EGREP" && break
2577done
2578test -n "$EGREP" || EGREP=": "
2579
2580 test "x$ac_cv_path_EGREP" = "x:" && { { echo "$as_me:2580: error: cannot find workable egrep" >&5
2581echo "$as_me: error: cannot find workable egrep" >&2;}
2582 { (exit 1); exit 1; }; }
2583 fi
2584fi
2585echo "$as_me:2585: result: $ac_cv_path_EGREP" >&5
2586echo "${ECHO_T}$ac_cv_path_EGREP" >&6
2587 EGREP="$ac_cv_path_EGREP"
2588
Steve Kondikae271bc2015-11-15 02:50:53 +01002589ac_ext=c
2590ac_cpp='$CPP $CPPFLAGS'
micky3879b9f5e72025-07-08 18:04:53 -04002591ac_compile='$CC -c $CFLAGS $CPPFLAGS "conftest.$ac_ext" >&5'
2592ac_link='$CC -o "conftest$ac_exeext" $CFLAGS $CPPFLAGS $LDFLAGS "conftest.$ac_ext" $LIBS >&5'
Steve Kondikae271bc2015-11-15 02:50:53 +01002593ac_compiler_gnu=$ac_cv_c_compiler_gnu
micky3879b9f5e72025-07-08 18:04:53 -04002594ac_main_return="return"
2595echo "$as_me:2595: checking how to run the C preprocessor" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01002596echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6
2597# On Suns, sometimes $CPP names a directory.
2598if test -n "$CPP" && test -d "$CPP"; then
2599 CPP=
2600fi
2601if test -z "$CPP"; then
2602 if test "${ac_cv_prog_CPP+set}" = set; then
2603 echo $ECHO_N "(cached) $ECHO_C" >&6
2604else
2605 # Double quotes because CPP needs to be expanded
2606 for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
2607 do
2608 ac_preproc_ok=false
2609for ac_c_preproc_warn_flag in '' yes
2610do
2611 # Use a header file that comes with gcc, so configuring glibc
2612 # with a fresh cross-compiler works.
2613 # On the NeXT, cc -E runs the code through the compiler's parser,
2614 # not just through cpp. "Syntax error" is here to catch this case.
micky3879b9f5e72025-07-08 18:04:53 -04002615 cat >"conftest.$ac_ext" <<_ACEOF
2616#line 2616 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +01002617#include "confdefs.h"
2618#include <assert.h>
2619 Syntax error
2620_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -04002621if { (eval echo "$as_me:2621: \"$ac_cpp "conftest.$ac_ext"\"") >&5
2622 (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
Steve Kondikae271bc2015-11-15 02:50:53 +01002623 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -04002624 $EGREP -v '^ *\+' conftest.er1 >conftest.err
Steve Kondikae271bc2015-11-15 02:50:53 +01002625 rm -f conftest.er1
2626 cat conftest.err >&5
micky3879b9f5e72025-07-08 18:04:53 -04002627 echo "$as_me:2627: \$? = $ac_status" >&5
2628 (exit "$ac_status"); } >/dev/null; then
Steve Kondikae271bc2015-11-15 02:50:53 +01002629 if test -s conftest.err; then
2630 ac_cpp_err=$ac_c_preproc_warn_flag
2631 else
2632 ac_cpp_err=
2633 fi
2634else
2635 ac_cpp_err=yes
2636fi
2637if test -z "$ac_cpp_err"; then
2638 :
2639else
2640 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -04002641 cat "conftest.$ac_ext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01002642 # Broken: fails on valid input.
2643continue
2644fi
micky3879b9f5e72025-07-08 18:04:53 -04002645rm -f conftest.err "conftest.$ac_ext"
Steve Kondikae271bc2015-11-15 02:50:53 +01002646
2647 # OK, works on sane cases. Now check whether non-existent headers
2648 # can be detected and how.
micky3879b9f5e72025-07-08 18:04:53 -04002649 cat >"conftest.$ac_ext" <<_ACEOF
2650#line 2650 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +01002651#include "confdefs.h"
2652#include <ac_nonexistent.h>
2653_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -04002654if { (eval echo "$as_me:2654: \"$ac_cpp "conftest.$ac_ext"\"") >&5
2655 (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
Steve Kondikae271bc2015-11-15 02:50:53 +01002656 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -04002657 $EGREP -v '^ *\+' conftest.er1 >conftest.err
Steve Kondikae271bc2015-11-15 02:50:53 +01002658 rm -f conftest.er1
2659 cat conftest.err >&5
micky3879b9f5e72025-07-08 18:04:53 -04002660 echo "$as_me:2660: \$? = $ac_status" >&5
2661 (exit "$ac_status"); } >/dev/null; then
Steve Kondikae271bc2015-11-15 02:50:53 +01002662 if test -s conftest.err; then
2663 ac_cpp_err=$ac_c_preproc_warn_flag
2664 else
2665 ac_cpp_err=
2666 fi
2667else
2668 ac_cpp_err=yes
2669fi
2670if test -z "$ac_cpp_err"; then
2671 # Broken: success on invalid input.
2672continue
2673else
2674 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -04002675 cat "conftest.$ac_ext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01002676 # Passes both tests.
2677ac_preproc_ok=:
2678break
2679fi
micky3879b9f5e72025-07-08 18:04:53 -04002680rm -f conftest.err "conftest.$ac_ext"
Steve Kondikae271bc2015-11-15 02:50:53 +01002681
2682done
2683# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
micky3879b9f5e72025-07-08 18:04:53 -04002684rm -f conftest.err "conftest.$ac_ext"
Steve Kondikae271bc2015-11-15 02:50:53 +01002685if $ac_preproc_ok; then
2686 break
2687fi
2688
2689 done
2690 ac_cv_prog_CPP=$CPP
2691
2692fi
2693 CPP=$ac_cv_prog_CPP
2694else
2695 ac_cv_prog_CPP=$CPP
2696fi
micky3879b9f5e72025-07-08 18:04:53 -04002697echo "$as_me:2697: result: $CPP" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01002698echo "${ECHO_T}$CPP" >&6
2699ac_preproc_ok=false
2700for ac_c_preproc_warn_flag in '' yes
2701do
2702 # Use a header file that comes with gcc, so configuring glibc
2703 # with a fresh cross-compiler works.
2704 # On the NeXT, cc -E runs the code through the compiler's parser,
2705 # not just through cpp. "Syntax error" is here to catch this case.
micky3879b9f5e72025-07-08 18:04:53 -04002706 cat >"conftest.$ac_ext" <<_ACEOF
2707#line 2707 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +01002708#include "confdefs.h"
2709#include <assert.h>
2710 Syntax error
2711_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -04002712if { (eval echo "$as_me:2712: \"$ac_cpp "conftest.$ac_ext"\"") >&5
2713 (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
Steve Kondikae271bc2015-11-15 02:50:53 +01002714 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -04002715 $EGREP -v '^ *\+' conftest.er1 >conftest.err
Steve Kondikae271bc2015-11-15 02:50:53 +01002716 rm -f conftest.er1
2717 cat conftest.err >&5
micky3879b9f5e72025-07-08 18:04:53 -04002718 echo "$as_me:2718: \$? = $ac_status" >&5
2719 (exit "$ac_status"); } >/dev/null; then
Steve Kondikae271bc2015-11-15 02:50:53 +01002720 if test -s conftest.err; then
2721 ac_cpp_err=$ac_c_preproc_warn_flag
2722 else
2723 ac_cpp_err=
2724 fi
2725else
2726 ac_cpp_err=yes
2727fi
2728if test -z "$ac_cpp_err"; then
2729 :
2730else
2731 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -04002732 cat "conftest.$ac_ext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01002733 # Broken: fails on valid input.
2734continue
2735fi
micky3879b9f5e72025-07-08 18:04:53 -04002736rm -f conftest.err "conftest.$ac_ext"
Steve Kondikae271bc2015-11-15 02:50:53 +01002737
2738 # OK, works on sane cases. Now check whether non-existent headers
2739 # can be detected and how.
micky3879b9f5e72025-07-08 18:04:53 -04002740 cat >"conftest.$ac_ext" <<_ACEOF
2741#line 2741 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +01002742#include "confdefs.h"
2743#include <ac_nonexistent.h>
2744_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -04002745if { (eval echo "$as_me:2745: \"$ac_cpp "conftest.$ac_ext"\"") >&5
2746 (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
Steve Kondikae271bc2015-11-15 02:50:53 +01002747 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -04002748 $EGREP -v '^ *\+' conftest.er1 >conftest.err
Steve Kondikae271bc2015-11-15 02:50:53 +01002749 rm -f conftest.er1
2750 cat conftest.err >&5
micky3879b9f5e72025-07-08 18:04:53 -04002751 echo "$as_me:2751: \$? = $ac_status" >&5
2752 (exit "$ac_status"); } >/dev/null; then
Steve Kondikae271bc2015-11-15 02:50:53 +01002753 if test -s conftest.err; then
2754 ac_cpp_err=$ac_c_preproc_warn_flag
2755 else
2756 ac_cpp_err=
2757 fi
2758else
2759 ac_cpp_err=yes
2760fi
2761if test -z "$ac_cpp_err"; then
2762 # Broken: success on invalid input.
2763continue
2764else
2765 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -04002766 cat "conftest.$ac_ext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01002767 # Passes both tests.
2768ac_preproc_ok=:
2769break
2770fi
micky3879b9f5e72025-07-08 18:04:53 -04002771rm -f conftest.err "conftest.$ac_ext"
Steve Kondikae271bc2015-11-15 02:50:53 +01002772
2773done
2774# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
micky3879b9f5e72025-07-08 18:04:53 -04002775rm -f conftest.err "conftest.$ac_ext"
Steve Kondikae271bc2015-11-15 02:50:53 +01002776if $ac_preproc_ok; then
2777 :
2778else
micky3879b9f5e72025-07-08 18:04:53 -04002779 { { echo "$as_me:2779: error: C preprocessor \"$CPP\" fails sanity check" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01002780echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check" >&2;}
2781 { (exit 1); exit 1; }; }
2782fi
2783
2784ac_ext=c
2785ac_cpp='$CPP $CPPFLAGS'
micky3879b9f5e72025-07-08 18:04:53 -04002786ac_compile='$CC -c $CFLAGS $CPPFLAGS "conftest.$ac_ext" >&5'
2787ac_link='$CC -o "conftest$ac_exeext" $CFLAGS $CPPFLAGS $LDFLAGS "conftest.$ac_ext" $LIBS >&5'
Steve Kondikae271bc2015-11-15 02:50:53 +01002788ac_compiler_gnu=$ac_cv_c_compiler_gnu
micky3879b9f5e72025-07-08 18:04:53 -04002789ac_main_return="return"
Steve Kondikae271bc2015-11-15 02:50:53 +01002790
2791for ac_prog in mawk gawk nawk awk
2792do
2793 # Extract the first word of "$ac_prog", so it can be a program name with args.
2794set dummy $ac_prog; ac_word=$2
micky3879b9f5e72025-07-08 18:04:53 -04002795echo "$as_me:2795: checking for $ac_word" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01002796echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2797if test "${ac_cv_prog_AWK+set}" = set; then
2798 echo $ECHO_N "(cached) $ECHO_C" >&6
2799else
2800 if test -n "$AWK"; then
2801 ac_cv_prog_AWK="$AWK" # Let the user override the test.
2802else
2803 ac_save_IFS=$IFS; IFS=$ac_path_separator
2804ac_dummy="$PATH"
2805for ac_dir in $ac_dummy; do
2806 IFS=$ac_save_IFS
2807 test -z "$ac_dir" && ac_dir=.
2808 $as_executable_p "$ac_dir/$ac_word" || continue
2809ac_cv_prog_AWK="$ac_prog"
micky3879b9f5e72025-07-08 18:04:53 -04002810echo "$as_me:2810: found $ac_dir/$ac_word" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01002811break
2812done
2813
2814fi
2815fi
2816AWK=$ac_cv_prog_AWK
2817if test -n "$AWK"; then
micky3879b9f5e72025-07-08 18:04:53 -04002818 echo "$as_me:2818: result: $AWK" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01002819echo "${ECHO_T}$AWK" >&6
2820else
micky3879b9f5e72025-07-08 18:04:53 -04002821 echo "$as_me:2821: result: no" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01002822echo "${ECHO_T}no" >&6
2823fi
2824
2825 test -n "$AWK" && break
2826done
2827
2828# Find a good install program. We prefer a C program (faster),
2829# so one script is as good as another. But avoid the broken or
2830# incompatible versions:
2831# SysV /etc/install, /usr/sbin/install
2832# SunOS /usr/etc/install
2833# IRIX /sbin/install
2834# AIX /bin/install
2835# AmigaOS /C/install, which installs bootblocks on floppy discs
2836# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
2837# AFS /usr/afsws/bin/install, which mishandles nonexistent args
2838# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
2839# ./install, which can be erroneously created by make from ./install.sh.
micky3879b9f5e72025-07-08 18:04:53 -04002840echo "$as_me:2840: checking for a BSD compatible install" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01002841echo $ECHO_N "checking for a BSD compatible install... $ECHO_C" >&6
2842if test -z "$INSTALL"; then
2843if test "${ac_cv_path_install+set}" = set; then
2844 echo $ECHO_N "(cached) $ECHO_C" >&6
2845else
2846 ac_save_IFS=$IFS; IFS=$ac_path_separator
2847 for ac_dir in $PATH; do
2848 IFS=$ac_save_IFS
2849 # Account for people who put trailing slashes in PATH elements.
2850 case $ac_dir/ in
2851 / | ./ | .// | /cC/* \
2852 | /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* \
2853 | /usr/ucb/* ) ;;
2854 *)
2855 # OSF1 and SCO ODT 3.0 have their own names for install.
2856 # Don't use installbsd from OSF since it installs stuff as root
2857 # by default.
2858 for ac_prog in ginstall scoinst install; do
2859 if $as_executable_p "$ac_dir/$ac_prog"; then
2860 if test $ac_prog = install &&
2861 grep dspmsg "$ac_dir/$ac_prog" >/dev/null 2>&1; then
2862 # AIX install. It has an incompatible calling convention.
2863 :
2864 elif test $ac_prog = install &&
2865 grep pwplus "$ac_dir/$ac_prog" >/dev/null 2>&1; then
2866 # program-specific install script used by HP pwplus--don't use.
2867 :
2868 else
2869 ac_cv_path_install="$ac_dir/$ac_prog -c"
2870 break 2
2871 fi
2872 fi
2873 done
2874 ;;
2875 esac
2876 done
2877
2878fi
2879 if test "${ac_cv_path_install+set}" = set; then
2880 INSTALL=$ac_cv_path_install
2881 else
2882 # As a last resort, use the slow shell script. We don't cache a
2883 # path for INSTALL within a source directory, because that will
2884 # break other packages using the cache if that directory is
2885 # removed, or if the path is relative.
2886 INSTALL=$ac_install_sh
2887 fi
2888fi
micky3879b9f5e72025-07-08 18:04:53 -04002889echo "$as_me:2889: result: $INSTALL" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01002890echo "${ECHO_T}$INSTALL" >&6
2891
2892# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
2893# It thinks the first close brace ends the variable substitution.
2894test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
2895
2896test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
2897
2898test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
2899
2900case $INSTALL in
2901(/*)
2902 ;;
2903(*)
micky3879b9f5e72025-07-08 18:04:53 -04002904 cf_dir=`echo "$INSTALL" | sed -e 's%/[^/]*$%%'`
Steve Kondikae271bc2015-11-15 02:50:53 +01002905 test -z "$cf_dir" && cf_dir=.
micky3879b9f5e72025-07-08 18:04:53 -04002906 INSTALL="`cd \"$cf_dir\" && pwd`"/"`echo "$INSTALL" | sed -e 's%^.*/%%'`"
Steve Kondikae271bc2015-11-15 02:50:53 +01002907 ;;
2908esac
2909
micky3879b9f5e72025-07-08 18:04:53 -04002910echo "$as_me:2910: checking if you want to install stripped executables" >&5
2911echo $ECHO_N "checking if you want to install stripped executables... $ECHO_C" >&6
2912
2913# Check whether --enable-stripping or --disable-stripping was given.
2914if test "${enable_stripping+set}" = set; then
2915 enableval="$enable_stripping"
2916 test "$enableval" != no && enableval=yes
2917 if test "$enableval" != "yes" ; then
2918 enable_stripping=no
2919 else
2920 enable_stripping=yes
2921 fi
2922else
2923 enableval=yes
2924 enable_stripping=yes
2925
2926fi;
2927echo "$as_me:2927: result: $enable_stripping" >&5
2928echo "${ECHO_T}$enable_stripping" >&6
2929
2930if test "$enable_stripping" = yes
2931then
2932 INSTALL_OPT_S="-s"
2933else
2934 INSTALL_OPT_S=
2935fi
2936
2937: "${INSTALL:=install}"
2938echo "$as_me:2938: checking if install accepts -p option" >&5
2939echo $ECHO_N "checking if install accepts -p option... $ECHO_C" >&6
2940if test "${cf_cv_install_p+set}" = set; then
2941 echo $ECHO_N "(cached) $ECHO_C" >&6
2942else
2943
2944 rm -rf ./conftest*
2945 date >conftest.in
2946 mkdir conftest.out
2947 sleep 3
2948 if $INSTALL -p conftest.in conftest.out 2>/dev/null
2949 then
2950 if test -f conftest.out/conftest.in
2951 then
2952 test conftest.in -nt conftest.out/conftest.in 2>conftest.err && \
2953 test conftest.out/conftest.in -nt conftest.in 2>conftest.err
2954 if test -s conftest.err
2955 then
2956 cf_cv_install_p=no
2957 else
2958 cf_cv_install_p=yes
2959 fi
2960 else
2961 cf_cv_install_p=no
2962 fi
2963 else
2964 cf_cv_install_p=no
2965 fi
2966 rm -rf ./conftest*
2967
2968fi
2969echo "$as_me:2969: result: $cf_cv_install_p" >&5
2970echo "${ECHO_T}$cf_cv_install_p" >&6
2971
2972echo "$as_me:2972: checking if install needs to be told about ownership" >&5
2973echo $ECHO_N "checking if install needs to be told about ownership... $ECHO_C" >&6
2974case `$ac_config_guess` in
2975(*minix)
2976 with_install_o=yes
2977 ;;
2978(*)
2979 with_install_o=no
2980 ;;
2981esac
2982
2983echo "$as_me:2983: result: $with_install_o" >&5
2984echo "${ECHO_T}$with_install_o" >&6
2985if test "x$with_install_o" = xyes
2986then
2987 INSTALL_OPT_O="`id root|sed -e 's/uid=[0-9]*(/ -o /' -e 's/gid=[0-9]*(/ -g /' -e 's/ [^=[:space:]][^=[:space:]]*=.*/ /' -e 's/)//g'`"
2988else
2989 INSTALL_OPT_O=
2990fi
2991
2992if test -n "$INSTALL_OPT_S"
2993then
2994 echo "$as_me:2994: checking if you want to specify strip-program" >&5
2995echo $ECHO_N "checking if you want to specify strip-program... $ECHO_C" >&6
2996
2997# Check whether --with-strip-program or --without-strip-program was given.
2998if test "${with_strip_program+set}" = set; then
2999 withval="$with_strip_program"
3000 with_strip_program=$withval
3001else
3002 with_strip_program=no
3003fi;
3004 echo "$as_me:3004: result: $with_strip_program" >&5
3005echo "${ECHO_T}$with_strip_program" >&6
3006 if test "$with_strip_program" != no
3007 then
3008 echo "$as_me:3008: checking if strip-program is supported with this installer" >&5
3009echo $ECHO_N "checking if strip-program is supported with this installer... $ECHO_C" >&6
3010 cf_install_program=`echo "$INSTALL" | sed -e 's%[ ]*[ ]-.%%'`
3011 check_install_strip=no
3012 if test -f "$cf_install_program"
3013 then
3014 check_install_version=`"$cf_install_program" --version 2>/dev/null | head -n 1 | grep coreutils`
3015 if test -n "$check_install_version"
3016 then
3017 check_install_strip="option"
3018 else
3019 for check_strip_variable in STRIPBIN STRIP
3020 do
3021 if strings "$cf_install_program" | grep "^$check_strip_variable$" >/dev/null
3022 then
3023 check_install_strip="environ"
3024 break
3025 fi
3026 done
3027 fi
3028 fi
3029 echo "$as_me:3029: result: $check_install_strip" >&5
3030echo "${ECHO_T}$check_install_strip" >&6
3031 case "$check_install_strip" in
3032 (no)
3033 { echo "$as_me:3033: WARNING: $cf_install_program does not support strip program option" >&5
3034echo "$as_me: WARNING: $cf_install_program does not support strip program option" >&2;}
3035 with_strip_program=no
3036 ;;
3037 (environ)
3038 cat >install.tmp <<-CF_EOF
3039 #! $SHELL
3040 STRIPBIN="$with_strip_program" \\
3041 STRIP="$with_strip_program" \\
3042 $INSTALL "$@"
3043 CF_EOF
3044 INSTALL="`pwd`/install.tmp"
3045 chmod +x "$INSTALL"
3046 test -n "$verbose" && echo " created $INSTALL" 1>&6
3047
3048echo "${as_me:-configure}:3048: testing created $INSTALL ..." 1>&5
3049
3050 ;;
3051 (option)
3052 INSTALL_OPT_S="$INSTALL_OPT_S --strip-program=\"$with_strip_program\""
3053 ;;
3054 esac
3055 fi
3056fi
3057
3058for ac_prog in lint cppcheck splint
Steve Kondikae271bc2015-11-15 02:50:53 +01003059do
3060 # Extract the first word of "$ac_prog", so it can be a program name with args.
3061set dummy $ac_prog; ac_word=$2
micky3879b9f5e72025-07-08 18:04:53 -04003062echo "$as_me:3062: checking for $ac_word" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01003063echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3064if test "${ac_cv_prog_LINT+set}" = set; then
3065 echo $ECHO_N "(cached) $ECHO_C" >&6
3066else
3067 if test -n "$LINT"; then
3068 ac_cv_prog_LINT="$LINT" # Let the user override the test.
3069else
3070 ac_save_IFS=$IFS; IFS=$ac_path_separator
3071ac_dummy="$PATH"
3072for ac_dir in $ac_dummy; do
3073 IFS=$ac_save_IFS
3074 test -z "$ac_dir" && ac_dir=.
3075 $as_executable_p "$ac_dir/$ac_word" || continue
3076ac_cv_prog_LINT="$ac_prog"
micky3879b9f5e72025-07-08 18:04:53 -04003077echo "$as_me:3077: found $ac_dir/$ac_word" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01003078break
3079done
3080
3081fi
3082fi
3083LINT=$ac_cv_prog_LINT
3084if test -n "$LINT"; then
micky3879b9f5e72025-07-08 18:04:53 -04003085 echo "$as_me:3085: result: $LINT" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01003086echo "${ECHO_T}$LINT" >&6
3087else
micky3879b9f5e72025-07-08 18:04:53 -04003088 echo "$as_me:3088: result: no" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01003089echo "${ECHO_T}no" >&6
3090fi
3091
3092 test -n "$LINT" && break
3093done
3094
micky3879b9f5e72025-07-08 18:04:53 -04003095case "x$LINT" in
3096(xcppcheck|x*/cppcheck)
3097 test -z "$LINT_OPTS" && LINT_OPTS="--enable=all"
3098 ;;
3099esac
3100
3101echo "$as_me:3101: checking for \".PHONY\" make-support" >&5
3102echo $ECHO_N "checking for \".PHONY\" make-support... $ECHO_C" >&6
3103if test "${cf_cv_make_PHONY+set}" = set; then
3104 echo $ECHO_N "(cached) $ECHO_C" >&6
3105else
3106
3107 rm -rf conftest*
3108 (
3109 mkdir conftest || exit 1
3110 cd conftest
3111 cat >makefile <<'CF_EOF'
3112.PHONY: always
3113DATA=0
3114always: always.out
3115 @echo "** making $@ $(DATA)"
3116once: once.out
3117 @echo "** making $@ $(DATA)"
3118always.out:
3119 @echo "** making $@ $(DATA)"
3120 echo $(DATA) > $@
3121once.out:
3122 @echo "** making $@ $(DATA)"
3123 echo $(DATA) > $@
3124CF_EOF
3125 for cf_data in 1 2 3
3126 do
3127 ${MAKE:-make} always DATA=$cf_data
3128 ${MAKE:-make} once DATA=$cf_data
3129 ${MAKE:-make} -t always once
3130 if test -f always ; then
3131 echo "no (case 1)" > ../conftest.tmp
3132 elif test ! -f always.out ; then
3133 echo "no (case 2)" > ../conftest.tmp
3134 elif test ! -f once.out ; then
3135 echo "no (case 3)" > ../conftest.tmp
3136 elif ! cmp -s always.out once.out ; then
3137 echo "no (case 4)" > ../conftest.tmp
3138 diff always.out once.out
3139 else
3140 cf_check="`cat always.out`"
3141 if test "x$cf_check" != "x$cf_data" ; then
3142 echo "no (case 5)" > ../conftest.tmp
3143 else
3144 echo yes > ../conftest.tmp
3145 rm -f ./*.out
3146 continue
3147 fi
3148 fi
3149 break
3150 done
3151 ) >&5 2>&1
3152 cf_cv_make_PHONY="`cat conftest.tmp`"
3153 rm -rf conftest*
3154
3155fi
3156echo "$as_me:3156: result: $cf_cv_make_PHONY" >&5
3157echo "${ECHO_T}$cf_cv_make_PHONY" >&6
3158MAKE_NO_PHONY="#"
3159MAKE_PHONY="#"
3160test "x$cf_cv_make_PHONY" = xyes && MAKE_PHONY=
3161test "x$cf_cv_make_PHONY" != xyes && MAKE_NO_PHONY=
3162
3163echo "$as_me:3163: checking if filesystem supports mixed-case filenames" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01003164echo $ECHO_N "checking if filesystem supports mixed-case filenames... $ECHO_C" >&6
3165if test "${cf_cv_mixedcase+set}" = set; then
3166 echo $ECHO_N "(cached) $ECHO_C" >&6
3167else
3168
3169if test "$cross_compiling" = yes ; then
micky3879b9f5e72025-07-08 18:04:53 -04003170 case "$target_alias" in
3171 (*-os2-emx*|*-msdosdjgpp*|*-cygwin*|*-msys*|*-mingw*|*-uwin*|darwin*)
Steve Kondikae271bc2015-11-15 02:50:53 +01003172 cf_cv_mixedcase=no
3173 ;;
3174 (*)
3175 cf_cv_mixedcase=yes
3176 ;;
3177 esac
3178else
3179 rm -f conftest CONFTEST
3180 echo test >conftest
3181 if test -f CONFTEST ; then
3182 cf_cv_mixedcase=no
3183 else
3184 cf_cv_mixedcase=yes
3185 fi
3186 rm -f conftest CONFTEST
3187fi
3188
3189fi
micky3879b9f5e72025-07-08 18:04:53 -04003190echo "$as_me:3190: result: $cf_cv_mixedcase" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01003191echo "${ECHO_T}$cf_cv_mixedcase" >&6
3192test "$cf_cv_mixedcase" = yes &&
3193cat >>confdefs.h <<\EOF
3194#define MIXEDCASE_FILENAMES 1
3195EOF
3196
3197for ac_prog in exctags ctags
3198do
3199 # Extract the first word of "$ac_prog", so it can be a program name with args.
3200set dummy $ac_prog; ac_word=$2
micky3879b9f5e72025-07-08 18:04:53 -04003201echo "$as_me:3201: checking for $ac_word" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01003202echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3203if test "${ac_cv_prog_CTAGS+set}" = set; then
3204 echo $ECHO_N "(cached) $ECHO_C" >&6
3205else
3206 if test -n "$CTAGS"; then
3207 ac_cv_prog_CTAGS="$CTAGS" # Let the user override the test.
3208else
3209 ac_save_IFS=$IFS; IFS=$ac_path_separator
3210ac_dummy="$PATH"
3211for ac_dir in $ac_dummy; do
3212 IFS=$ac_save_IFS
3213 test -z "$ac_dir" && ac_dir=.
3214 $as_executable_p "$ac_dir/$ac_word" || continue
3215ac_cv_prog_CTAGS="$ac_prog"
micky3879b9f5e72025-07-08 18:04:53 -04003216echo "$as_me:3216: found $ac_dir/$ac_word" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01003217break
3218done
3219
3220fi
3221fi
3222CTAGS=$ac_cv_prog_CTAGS
3223if test -n "$CTAGS"; then
micky3879b9f5e72025-07-08 18:04:53 -04003224 echo "$as_me:3224: result: $CTAGS" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01003225echo "${ECHO_T}$CTAGS" >&6
3226else
micky3879b9f5e72025-07-08 18:04:53 -04003227 echo "$as_me:3227: result: no" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01003228echo "${ECHO_T}no" >&6
3229fi
3230
3231 test -n "$CTAGS" && break
3232done
3233
3234for ac_prog in exetags etags
3235do
3236 # Extract the first word of "$ac_prog", so it can be a program name with args.
3237set dummy $ac_prog; ac_word=$2
micky3879b9f5e72025-07-08 18:04:53 -04003238echo "$as_me:3238: checking for $ac_word" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01003239echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3240if test "${ac_cv_prog_ETAGS+set}" = set; then
3241 echo $ECHO_N "(cached) $ECHO_C" >&6
3242else
3243 if test -n "$ETAGS"; then
3244 ac_cv_prog_ETAGS="$ETAGS" # Let the user override the test.
3245else
3246 ac_save_IFS=$IFS; IFS=$ac_path_separator
3247ac_dummy="$PATH"
3248for ac_dir in $ac_dummy; do
3249 IFS=$ac_save_IFS
3250 test -z "$ac_dir" && ac_dir=.
3251 $as_executable_p "$ac_dir/$ac_word" || continue
3252ac_cv_prog_ETAGS="$ac_prog"
micky3879b9f5e72025-07-08 18:04:53 -04003253echo "$as_me:3253: found $ac_dir/$ac_word" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01003254break
3255done
3256
3257fi
3258fi
3259ETAGS=$ac_cv_prog_ETAGS
3260if test -n "$ETAGS"; then
micky3879b9f5e72025-07-08 18:04:53 -04003261 echo "$as_me:3261: result: $ETAGS" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01003262echo "${ECHO_T}$ETAGS" >&6
3263else
micky3879b9f5e72025-07-08 18:04:53 -04003264 echo "$as_me:3264: result: no" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01003265echo "${ECHO_T}no" >&6
3266fi
3267
3268 test -n "$ETAGS" && break
3269done
3270
3271# Extract the first word of "${CTAGS:-ctags}", so it can be a program name with args.
3272set dummy ${CTAGS:-ctags}; ac_word=$2
micky3879b9f5e72025-07-08 18:04:53 -04003273echo "$as_me:3273: checking for $ac_word" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01003274echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3275if test "${ac_cv_prog_MAKE_LOWER_TAGS+set}" = set; then
3276 echo $ECHO_N "(cached) $ECHO_C" >&6
3277else
3278 if test -n "$MAKE_LOWER_TAGS"; then
3279 ac_cv_prog_MAKE_LOWER_TAGS="$MAKE_LOWER_TAGS" # Let the user override the test.
3280else
3281 ac_save_IFS=$IFS; IFS=$ac_path_separator
3282ac_dummy="$PATH"
3283for ac_dir in $ac_dummy; do
3284 IFS=$ac_save_IFS
3285 test -z "$ac_dir" && ac_dir=.
3286 $as_executable_p "$ac_dir/$ac_word" || continue
3287ac_cv_prog_MAKE_LOWER_TAGS="yes"
micky3879b9f5e72025-07-08 18:04:53 -04003288echo "$as_me:3288: found $ac_dir/$ac_word" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01003289break
3290done
3291
3292 test -z "$ac_cv_prog_MAKE_LOWER_TAGS" && ac_cv_prog_MAKE_LOWER_TAGS="no"
3293fi
3294fi
3295MAKE_LOWER_TAGS=$ac_cv_prog_MAKE_LOWER_TAGS
3296if test -n "$MAKE_LOWER_TAGS"; then
micky3879b9f5e72025-07-08 18:04:53 -04003297 echo "$as_me:3297: result: $MAKE_LOWER_TAGS" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01003298echo "${ECHO_T}$MAKE_LOWER_TAGS" >&6
3299else
micky3879b9f5e72025-07-08 18:04:53 -04003300 echo "$as_me:3300: result: no" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01003301echo "${ECHO_T}no" >&6
3302fi
3303
3304if test "$cf_cv_mixedcase" = yes ; then
3305 # Extract the first word of "${ETAGS:-etags}", so it can be a program name with args.
3306set dummy ${ETAGS:-etags}; ac_word=$2
micky3879b9f5e72025-07-08 18:04:53 -04003307echo "$as_me:3307: checking for $ac_word" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01003308echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3309if test "${ac_cv_prog_MAKE_UPPER_TAGS+set}" = set; then
3310 echo $ECHO_N "(cached) $ECHO_C" >&6
3311else
3312 if test -n "$MAKE_UPPER_TAGS"; then
3313 ac_cv_prog_MAKE_UPPER_TAGS="$MAKE_UPPER_TAGS" # Let the user override the test.
3314else
3315 ac_save_IFS=$IFS; IFS=$ac_path_separator
3316ac_dummy="$PATH"
3317for ac_dir in $ac_dummy; do
3318 IFS=$ac_save_IFS
3319 test -z "$ac_dir" && ac_dir=.
3320 $as_executable_p "$ac_dir/$ac_word" || continue
3321ac_cv_prog_MAKE_UPPER_TAGS="yes"
micky3879b9f5e72025-07-08 18:04:53 -04003322echo "$as_me:3322: found $ac_dir/$ac_word" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01003323break
3324done
3325
3326 test -z "$ac_cv_prog_MAKE_UPPER_TAGS" && ac_cv_prog_MAKE_UPPER_TAGS="no"
3327fi
3328fi
3329MAKE_UPPER_TAGS=$ac_cv_prog_MAKE_UPPER_TAGS
3330if test -n "$MAKE_UPPER_TAGS"; then
micky3879b9f5e72025-07-08 18:04:53 -04003331 echo "$as_me:3331: result: $MAKE_UPPER_TAGS" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01003332echo "${ECHO_T}$MAKE_UPPER_TAGS" >&6
3333else
micky3879b9f5e72025-07-08 18:04:53 -04003334 echo "$as_me:3334: result: no" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01003335echo "${ECHO_T}no" >&6
3336fi
3337
3338else
3339 MAKE_UPPER_TAGS=no
3340fi
3341
3342if test "$MAKE_UPPER_TAGS" = yes ; then
3343 MAKE_UPPER_TAGS=
3344else
3345 MAKE_UPPER_TAGS="#"
3346fi
3347
3348if test "$MAKE_LOWER_TAGS" = yes ; then
3349 MAKE_LOWER_TAGS=
3350else
3351 MAKE_LOWER_TAGS="#"
3352fi
3353
micky3879b9f5e72025-07-08 18:04:53 -04003354echo "$as_me:3354: checking if -lm needed for math functions" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01003355echo $ECHO_N "checking if -lm needed for math functions... $ECHO_C" >&6
3356if test "${cf_cv_need_libm+set}" = set; then
3357 echo $ECHO_N "(cached) $ECHO_C" >&6
3358else
3359
micky3879b9f5e72025-07-08 18:04:53 -04003360 cat >"conftest.$ac_ext" <<_ACEOF
3361#line 3361 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +01003362#include "confdefs.h"
3363
micky3879b9f5e72025-07-08 18:04:53 -04003364 #include <stdio.h>
3365 #include <stdlib.h>
3366 #include <math.h>
Steve Kondikae271bc2015-11-15 02:50:53 +01003367
3368int
micky3879b9f5e72025-07-08 18:04:53 -04003369main (void)
Steve Kondikae271bc2015-11-15 02:50:53 +01003370{
micky3879b9f5e72025-07-08 18:04:53 -04003371double x = rand(); printf("result = %g\\n", pow(sin(x),x))
Steve Kondikae271bc2015-11-15 02:50:53 +01003372 ;
3373 return 0;
3374}
3375_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -04003376rm -f "conftest.$ac_objext" "conftest$ac_exeext"
3377if { (eval echo "$as_me:3377: \"$ac_link\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01003378 (eval $ac_link) 2>&5
3379 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -04003380 echo "$as_me:3380: \$? = $ac_status" >&5
3381 (exit "$ac_status"); } &&
3382 { ac_try='test -s "conftest$ac_exeext"'
3383 { (eval echo "$as_me:3383: \"$ac_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01003384 (eval $ac_try) 2>&5
3385 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -04003386 echo "$as_me:3386: \$? = $ac_status" >&5
3387 (exit "$ac_status"); }; }; then
Steve Kondikae271bc2015-11-15 02:50:53 +01003388 cf_cv_need_libm=no
3389else
3390 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -04003391cat "conftest.$ac_ext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01003392cf_cv_need_libm=yes
3393fi
micky3879b9f5e72025-07-08 18:04:53 -04003394rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
Steve Kondikae271bc2015-11-15 02:50:53 +01003395fi
micky3879b9f5e72025-07-08 18:04:53 -04003396echo "$as_me:3396: result: $cf_cv_need_libm" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01003397echo "${ECHO_T}$cf_cv_need_libm" >&6
micky3879b9f5e72025-07-08 18:04:53 -04003398
Steve Kondikae271bc2015-11-15 02:50:53 +01003399if test "$cf_cv_need_libm" = yes
3400then
micky3879b9f5e72025-07-08 18:04:53 -04003401
3402 cf_save_LIBS="$LIBS"
3403 LIBS="$LIBS -lm"
3404 echo "$as_me:3404: checking if -lm is available for math functions" >&5
3405echo $ECHO_N "checking if -lm is available for math functions... $ECHO_C" >&6
3406if test "${cf_cv_have_libm+set}" = set; then
3407 echo $ECHO_N "(cached) $ECHO_C" >&6
3408else
3409
3410 cat >"conftest.$ac_ext" <<_ACEOF
3411#line 3411 "configure"
3412#include "confdefs.h"
3413
3414 #include <stdio.h>
3415 #include <stdlib.h>
3416 #include <math.h>
3417
3418int
3419main (void)
3420{
3421double x = rand(); printf("result = %g\\n", pow(sin(x),x))
3422 ;
3423 return 0;
3424}
3425_ACEOF
3426rm -f "conftest.$ac_objext" "conftest$ac_exeext"
3427if { (eval echo "$as_me:3427: \"$ac_link\"") >&5
3428 (eval $ac_link) 2>&5
3429 ac_status=$?
3430 echo "$as_me:3430: \$? = $ac_status" >&5
3431 (exit "$ac_status"); } &&
3432 { ac_try='test -s "conftest$ac_exeext"'
3433 { (eval echo "$as_me:3433: \"$ac_try\"") >&5
3434 (eval $ac_try) 2>&5
3435 ac_status=$?
3436 echo "$as_me:3436: \$? = $ac_status" >&5
3437 (exit "$ac_status"); }; }; then
3438 cf_cv_have_libm=yes
3439else
3440 echo "$as_me: failed program was:" >&5
3441cat "conftest.$ac_ext" >&5
3442cf_cv_have_libm=no
3443fi
3444rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
3445fi
3446echo "$as_me:3446: result: $cf_cv_have_libm" >&5
3447echo "${ECHO_T}$cf_cv_have_libm" >&6
3448 LIBS="$cf_save_LIBS"
3449
3450 if test "$cf_cv_have_libm" = yes
3451 then
3452 MATH_LIB=-lm
3453 fi
3454else
3455 cf_cv_have_libm=yes
3456fi
3457
3458if test "$cf_cv_have_libm" = yes
3459then
3460
3461cat >>confdefs.h <<\EOF
3462#define HAVE_MATH_FUNCS 1
3463EOF
3464
Steve Kondikae271bc2015-11-15 02:50:53 +01003465fi
3466
3467top_builddir=`pwd`
3468
3469CC_G_OPT="-g"
3470CC_SHARED_OPTS=unknown
3471CPPFLAGS="$CPPFLAGS"
3472DFT_DEP_SUFFIX=""
3473DFT_OBJ_SUBDIR=`pwd|sed -e's:.*/::'`
3474DFT_UPR_MODEL="NORMAL"
3475LD="ld"
3476LDFLAGS_SHARED=""
3477LDFLAGS_STATIC=""
3478LD_MODEL=""
3479LD_SHARED_OPTS=""
3480LIBTOOL=""
3481LIBTOOL_OPTS=""
3482LIB_CLEAN=""
3483LIB_COMPILE=""
3484LIB_LINK='${CC}'
3485LINK_TESTS=""
3486LOCAL_LDFLAGS=""
3487PACKAGE="ncurses-examples"
3488PTHREAD="-lm"
3489TEST_ARGS=""
3490TEST_DEPS=""
3491TEST_LIBS=""
3492TINFO_LDFLAGS=''
3493TINFO_LIBS='$(LIBS_CURSES)'
3494cf_cv_abi_version=""
3495cf_cv_rel_version=""
3496includesubdir=""
3497
3498cf_cv_screen=curses
3499cf_cv_libtype=
3500
micky3879b9f5e72025-07-08 18:04:53 -04003501echo "$as_me:3501: checking for fgrep" >&5
3502echo $ECHO_N "checking for fgrep... $ECHO_C" >&6
3503if test "${ac_cv_path_FGREP+set}" = set; then
3504 echo $ECHO_N "(cached) $ECHO_C" >&6
3505else
3506 if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1
3507 then ac_cv_path_FGREP="$GREP -F"
3508 else
3509 for ac_prog in gfgrep fgrep
3510do
3511 # Extract the first word of "$ac_prog", so it can be a program name with args.
3512set dummy $ac_prog; ac_word=$2
3513echo "$as_me:3513: checking for $ac_word" >&5
3514echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3515if test "${ac_cv_path_FGREP+set}" = set; then
3516 echo $ECHO_N "(cached) $ECHO_C" >&6
3517else
3518 case $FGREP in
3519 [\\/]* | ?:[\\/]*)
3520 ac_cv_path_FGREP="$FGREP" # Let the user override the test with a path.
3521 ;;
3522 *)
3523 ac_save_IFS=$IFS; IFS=$ac_path_separator
3524ac_dummy="$PATH"
3525for ac_dir in $ac_dummy; do
3526 IFS=$ac_save_IFS
3527 test -z "$ac_dir" && ac_dir=.
3528 if $as_executable_p "$ac_dir/$ac_word"; then
3529 ac_cv_path_FGREP="$ac_dir/$ac_word"
3530 echo "$as_me:3530: found $ac_dir/$ac_word" >&5
3531 break
3532fi
3533done
3534
3535 ;;
3536esac
3537fi
3538FGREP=$ac_cv_path_FGREP
3539
3540if test -n "$FGREP"; then
3541 echo "$as_me:3541: result: $FGREP" >&5
3542echo "${ECHO_T}$FGREP" >&6
3543else
3544 echo "$as_me:3544: result: no" >&5
3545echo "${ECHO_T}no" >&6
3546fi
3547
3548 test -n "$FGREP" && break
3549done
3550test -n "$FGREP" || FGREP=": "
3551
3552 test "x$ac_cv_path_FGREP" = "x:" && { { echo "$as_me:3552: error: cannot find workable fgrep" >&5
3553echo "$as_me: error: cannot find workable fgrep" >&2;}
3554 { (exit 1); exit 1; }; }
3555 fi
3556fi
3557echo "$as_me:3557: result: $ac_cv_path_FGREP" >&5
3558echo "${ECHO_T}$ac_cv_path_FGREP" >&6
3559 FGREP="$ac_cv_path_FGREP"
3560
3561echo "$as_me:3561: checking if you want to use C11 _Noreturn feature" >&5
3562echo $ECHO_N "checking if you want to use C11 _Noreturn feature... $ECHO_C" >&6
3563
3564# Check whether --enable-stdnoreturn or --disable-stdnoreturn was given.
3565if test "${enable_stdnoreturn+set}" = set; then
3566 enableval="$enable_stdnoreturn"
3567 test "$enableval" != yes && enableval=no
3568 if test "$enableval" != "no" ; then
3569 enable_stdnoreturn=yes
3570 else
3571 enable_stdnoreturn=no
3572 fi
3573else
3574 enableval=no
3575 enable_stdnoreturn=no
3576
3577fi;
3578echo "$as_me:3578: result: $enable_stdnoreturn" >&5
3579echo "${ECHO_T}$enable_stdnoreturn" >&6
3580
3581if test $enable_stdnoreturn = yes; then
3582echo "$as_me:3582: checking for C11 _Noreturn feature" >&5
3583echo $ECHO_N "checking for C11 _Noreturn feature... $ECHO_C" >&6
3584if test "${cf_cv_c11_noreturn+set}" = set; then
3585 echo $ECHO_N "(cached) $ECHO_C" >&6
3586else
3587 cat >"conftest.$ac_ext" <<_ACEOF
3588#line 3588 "configure"
3589#include "confdefs.h"
3590
3591$ac_includes_default
3592#include <stdnoreturn.h>
3593static _Noreturn void giveup(void) { exit(0); }
3594
3595int
3596main (void)
3597{
3598if (feof(stdin)) giveup()
3599 ;
3600 return 0;
3601}
3602_ACEOF
3603rm -f "conftest.$ac_objext"
3604if { (eval echo "$as_me:3604: \"$ac_compile\"") >&5
3605 (eval $ac_compile) 2>&5
3606 ac_status=$?
3607 echo "$as_me:3607: \$? = $ac_status" >&5
3608 (exit "$ac_status"); } &&
3609 { ac_try='test -s "conftest.$ac_objext"'
3610 { (eval echo "$as_me:3610: \"$ac_try\"") >&5
3611 (eval $ac_try) 2>&5
3612 ac_status=$?
3613 echo "$as_me:3613: \$? = $ac_status" >&5
3614 (exit "$ac_status"); }; }; then
3615 cf_cv_c11_noreturn=yes
3616else
3617 echo "$as_me: failed program was:" >&5
3618cat "conftest.$ac_ext" >&5
3619cf_cv_c11_noreturn=no
3620fi
3621rm -f "conftest.$ac_objext" "conftest.$ac_ext"
3622
3623fi
3624echo "$as_me:3624: result: $cf_cv_c11_noreturn" >&5
3625echo "${ECHO_T}$cf_cv_c11_noreturn" >&6
3626else
3627 cf_cv_c11_noreturn=no,
3628fi
3629
3630if test "$cf_cv_c11_noreturn" = yes; then
3631
3632cat >>confdefs.h <<\EOF
3633#define HAVE_STDNORETURN_H 1
3634EOF
3635
3636cat >>confdefs.h <<EOF
3637#define STDC_NORETURN _Noreturn
3638EOF
3639
3640 HAVE_STDNORETURN_H=1
3641else
3642 HAVE_STDNORETURN_H=0
3643fi
3644
3645if test "$GCC" = yes || test "$GXX" = yes
Steve Kondikae271bc2015-11-15 02:50:53 +01003646then
3647cat > conftest.i <<EOF
3648#ifndef GCC_PRINTF
3649#define GCC_PRINTF 0
3650#endif
3651#ifndef GCC_SCANF
3652#define GCC_SCANF 0
3653#endif
3654#ifndef GCC_NORETURN
3655#define GCC_NORETURN /* nothing */
3656#endif
3657#ifndef GCC_UNUSED
3658#define GCC_UNUSED /* nothing */
3659#endif
3660EOF
3661if test "$GCC" = yes
3662then
micky3879b9f5e72025-07-08 18:04:53 -04003663 { echo "$as_me:3663: checking for $CC __attribute__ directives..." >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01003664echo "$as_me: checking for $CC __attribute__ directives..." >&6;}
micky3879b9f5e72025-07-08 18:04:53 -04003665cat > "conftest.$ac_ext" <<EOF
3666#line 3666 "${as_me:-configure}"
3667#include <stdio.h>
Steve Kondikae271bc2015-11-15 02:50:53 +01003668#include "confdefs.h"
3669#include "conftest.h"
3670#include "conftest.i"
3671#if GCC_PRINTF
3672#define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
3673#else
3674#define GCC_PRINTFLIKE(fmt,var) /*nothing*/
3675#endif
3676#if GCC_SCANF
3677#define GCC_SCANFLIKE(fmt,var) __attribute__((format(scanf,fmt,var)))
3678#else
3679#define GCC_SCANFLIKE(fmt,var) /*nothing*/
3680#endif
3681extern void wow(char *,...) GCC_SCANFLIKE(1,2);
micky3879b9f5e72025-07-08 18:04:53 -04003682extern GCC_NORETURN void oops(char *,...) GCC_PRINTFLIKE(1,2);
3683extern GCC_NORETURN void foo(void);
3684int main(int argc GCC_UNUSED, char *argv[] GCC_UNUSED) { (void)argc; (void)argv; return 0; }
Steve Kondikae271bc2015-11-15 02:50:53 +01003685EOF
3686 cf_printf_attribute=no
3687 cf_scanf_attribute=no
3688 for cf_attribute in scanf printf unused noreturn
3689 do
3690
3691cf_ATTRIBUTE=`echo "$cf_attribute" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
3692
3693 cf_directive="__attribute__(($cf_attribute))"
3694 echo "checking for $CC $cf_directive" 1>&5
3695
micky3879b9f5e72025-07-08 18:04:53 -04003696 case "$cf_attribute" in
Steve Kondikae271bc2015-11-15 02:50:53 +01003697 (printf)
3698 cf_printf_attribute=yes
3699 cat >conftest.h <<EOF
3700#define GCC_$cf_ATTRIBUTE 1
3701EOF
3702 ;;
3703 (scanf)
3704 cf_scanf_attribute=yes
3705 cat >conftest.h <<EOF
3706#define GCC_$cf_ATTRIBUTE 1
3707EOF
3708 ;;
3709 (*)
3710 cat >conftest.h <<EOF
3711#define GCC_$cf_ATTRIBUTE $cf_directive
3712EOF
3713 ;;
3714 esac
3715
micky3879b9f5e72025-07-08 18:04:53 -04003716 if { (eval echo "$as_me:3716: \"$ac_compile\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01003717 (eval $ac_compile) 2>&5
3718 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -04003719 echo "$as_me:3719: \$? = $ac_status" >&5
3720 (exit "$ac_status"); }; then
3721 test -n "$verbose" && echo "$as_me:3721: result: ... $cf_attribute" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01003722echo "${ECHO_T}... $cf_attribute" >&6
3723 cat conftest.h >>confdefs.h
micky3879b9f5e72025-07-08 18:04:53 -04003724 case "$cf_attribute" in
Steve Kondikae271bc2015-11-15 02:50:53 +01003725 (noreturn)
3726
3727cat >>confdefs.h <<EOF
3728#define GCC_NORETURN $cf_directive
3729EOF
3730
3731 ;;
3732 (printf)
3733 cf_value='/* nothing */'
3734 if test "$cf_printf_attribute" != no ; then
3735 cf_value='__attribute__((format(printf,fmt,var)))'
3736
3737cat >>confdefs.h <<\EOF
3738#define GCC_PRINTF 1
3739EOF
3740
3741 fi
3742
3743cat >>confdefs.h <<EOF
3744#define GCC_PRINTFLIKE(fmt,var) $cf_value
3745EOF
3746
3747 ;;
3748 (scanf)
3749 cf_value='/* nothing */'
3750 if test "$cf_scanf_attribute" != no ; then
3751 cf_value='__attribute__((format(scanf,fmt,var)))'
3752
3753cat >>confdefs.h <<\EOF
3754#define GCC_SCANF 1
3755EOF
3756
3757 fi
3758
3759cat >>confdefs.h <<EOF
3760#define GCC_SCANFLIKE(fmt,var) $cf_value
3761EOF
3762
3763 ;;
3764 (unused)
3765
3766cat >>confdefs.h <<EOF
3767#define GCC_UNUSED $cf_directive
3768EOF
3769
3770 ;;
3771 esac
3772 fi
3773 done
3774else
micky3879b9f5e72025-07-08 18:04:53 -04003775 ${FGREP-fgrep} define conftest.i >>confdefs.h
Steve Kondikae271bc2015-11-15 02:50:53 +01003776fi
micky3879b9f5e72025-07-08 18:04:53 -04003777rm -rf ./conftest*
Steve Kondikae271bc2015-11-15 02:50:53 +01003778fi
3779
micky3879b9f5e72025-07-08 18:04:53 -04003780echo "$as_me:3780: checking if you want to work around bogus compiler/loader warnings" >&5
3781echo $ECHO_N "checking if you want to work around bogus compiler/loader warnings... $ECHO_C" >&6
3782
3783# Check whether --enable-string-hacks or --disable-string-hacks was given.
3784if test "${enable_string_hacks+set}" = set; then
3785 enableval="$enable_string_hacks"
3786 enable_string_hacks=$enableval
3787else
3788 enable_string_hacks=no
3789fi;
3790echo "$as_me:3790: result: $enable_string_hacks" >&5
3791echo "${ECHO_T}$enable_string_hacks" >&6
3792
3793if test "x$enable_string_hacks" = "xyes"; then
3794
3795cat >>confdefs.h <<\EOF
3796#define USE_STRING_HACKS 1
3797EOF
3798
3799 { echo "$as_me:3799: WARNING: enabling string-hacks to work around bogus compiler/loader warnings" >&5
3800echo "$as_me: WARNING: enabling string-hacks to work around bogus compiler/loader warnings" >&2;}
3801 echo "$as_me:3801: checking for strlcat" >&5
3802echo $ECHO_N "checking for strlcat... $ECHO_C" >&6
3803if test "${ac_cv_func_strlcat+set}" = set; then
3804 echo $ECHO_N "(cached) $ECHO_C" >&6
3805else
3806 cat >"conftest.$ac_ext" <<_ACEOF
3807#line 3807 "configure"
3808#include "confdefs.h"
3809#define strlcat autoconf_temporary
3810#include <limits.h> /* least-intrusive standard header which defines gcc2 __stub macros */
3811#undef strlcat
3812
3813#ifdef __cplusplus
3814extern "C"
3815#endif
3816
3817/* We use char because int might match the return type of a gcc2
3818 builtin and then its argument prototype would still apply. */
3819char strlcat (void);
3820
3821int
3822main (void)
3823{
3824
3825/* The GNU C library defines stubs for functions which it implements
3826 to always fail with ENOSYS. Some functions are actually named
3827 something starting with __ and the normal name is an alias. */
3828#if defined (__stub_strlcat) || defined (__stub___strlcat)
3829#error found stub for strlcat
3830#endif
3831
3832 return strlcat ();
3833 ;
3834 return 0;
3835}
3836_ACEOF
3837rm -f "conftest.$ac_objext" "conftest$ac_exeext"
3838if { (eval echo "$as_me:3838: \"$ac_link\"") >&5
3839 (eval $ac_link) 2>&5
3840 ac_status=$?
3841 echo "$as_me:3841: \$? = $ac_status" >&5
3842 (exit "$ac_status"); } &&
3843 { ac_try='test -s "conftest$ac_exeext"'
3844 { (eval echo "$as_me:3844: \"$ac_try\"") >&5
3845 (eval $ac_try) 2>&5
3846 ac_status=$?
3847 echo "$as_me:3847: \$? = $ac_status" >&5
3848 (exit "$ac_status"); }; }; then
3849 ac_cv_func_strlcat=yes
3850else
3851 echo "$as_me: failed program was:" >&5
3852cat "conftest.$ac_ext" >&5
3853ac_cv_func_strlcat=no
3854fi
3855rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
3856fi
3857echo "$as_me:3857: result: $ac_cv_func_strlcat" >&5
3858echo "${ECHO_T}$ac_cv_func_strlcat" >&6
3859if test "$ac_cv_func_strlcat" = yes; then
3860
3861cat >>confdefs.h <<\EOF
3862#define HAVE_STRLCAT 1
3863EOF
3864
3865else
3866
3867 echo "$as_me:3867: checking for strlcat in -lbsd" >&5
3868echo $ECHO_N "checking for strlcat in -lbsd... $ECHO_C" >&6
3869if test "${ac_cv_lib_bsd_strlcat+set}" = set; then
3870 echo $ECHO_N "(cached) $ECHO_C" >&6
3871else
3872 ac_check_lib_save_LIBS=$LIBS
3873LIBS="-lbsd $LIBS"
3874cat >"conftest.$ac_ext" <<_ACEOF
3875#line 3875 "configure"
3876#include "confdefs.h"
3877
3878/* Override any gcc2 internal prototype to avoid an error. */
3879#ifdef __cplusplus
3880extern "C"
3881#endif
3882/* We use char because int might match the return type of a gcc2
3883 builtin and then its argument prototype would still apply. */
3884char strlcat (void);
3885int
3886main (void)
3887{
3888strlcat ();
3889 ;
3890 return 0;
3891}
3892_ACEOF
3893rm -f "conftest.$ac_objext" "conftest$ac_exeext"
3894if { (eval echo "$as_me:3894: \"$ac_link\"") >&5
3895 (eval $ac_link) 2>&5
3896 ac_status=$?
3897 echo "$as_me:3897: \$? = $ac_status" >&5
3898 (exit "$ac_status"); } &&
3899 { ac_try='test -s "conftest$ac_exeext"'
3900 { (eval echo "$as_me:3900: \"$ac_try\"") >&5
3901 (eval $ac_try) 2>&5
3902 ac_status=$?
3903 echo "$as_me:3903: \$? = $ac_status" >&5
3904 (exit "$ac_status"); }; }; then
3905 ac_cv_lib_bsd_strlcat=yes
3906else
3907 echo "$as_me: failed program was:" >&5
3908cat "conftest.$ac_ext" >&5
3909ac_cv_lib_bsd_strlcat=no
3910fi
3911rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
3912LIBS=$ac_check_lib_save_LIBS
3913fi
3914echo "$as_me:3914: result: $ac_cv_lib_bsd_strlcat" >&5
3915echo "${ECHO_T}$ac_cv_lib_bsd_strlcat" >&6
3916if test "$ac_cv_lib_bsd_strlcat" = yes; then
3917
3918cf_add_libs="$LIBS"
3919# reverse order
3920cf_add_0lib=
3921for cf_add_1lib in -lbsd; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
3922# filter duplicates
3923for cf_add_1lib in $cf_add_0lib; do
3924 for cf_add_2lib in $cf_add_libs; do
3925 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
3926 cf_add_1lib=
3927 break
3928 fi
3929 done
3930 test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
3931done
3932LIBS="$cf_add_libs"
3933
3934for ac_header in bsd/string.h
3935do
3936as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
3937echo "$as_me:3937: checking for $ac_header" >&5
3938echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
3939if eval "test \"\${$as_ac_Header+set}\" = set"; then
3940 echo $ECHO_N "(cached) $ECHO_C" >&6
3941else
3942 cat >"conftest.$ac_ext" <<_ACEOF
3943#line 3943 "configure"
3944#include "confdefs.h"
3945#include <$ac_header>
3946_ACEOF
3947if { (eval echo "$as_me:3947: \"$ac_cpp "conftest.$ac_ext"\"") >&5
3948 (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
3949 ac_status=$?
3950 $EGREP -v '^ *\+' conftest.er1 >conftest.err
3951 rm -f conftest.er1
3952 cat conftest.err >&5
3953 echo "$as_me:3953: \$? = $ac_status" >&5
3954 (exit "$ac_status"); } >/dev/null; then
3955 if test -s conftest.err; then
3956 ac_cpp_err=$ac_c_preproc_warn_flag
3957 else
3958 ac_cpp_err=
3959 fi
3960else
3961 ac_cpp_err=yes
3962fi
3963if test -z "$ac_cpp_err"; then
3964 eval "$as_ac_Header=yes"
3965else
3966 echo "$as_me: failed program was:" >&5
3967 cat "conftest.$ac_ext" >&5
3968 eval "$as_ac_Header=no"
3969fi
3970rm -f conftest.err "conftest.$ac_ext"
3971fi
3972echo "$as_me:3972: result: `eval echo '${'"$as_ac_Header"'}'`" >&5
3973echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6
3974if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then
3975 cat >>confdefs.h <<EOF
3976#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
3977EOF
3978
3979fi
3980done
3981
3982cat >>confdefs.h <<\EOF
3983#define HAVE_STRLCAT 1
3984EOF
3985
3986fi
3987
3988fi
3989
3990for ac_func in strlcpy snprintf
3991do
3992as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
3993echo "$as_me:3993: checking for $ac_func" >&5
3994echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
3995if eval "test \"\${$as_ac_var+set}\" = set"; then
3996 echo $ECHO_N "(cached) $ECHO_C" >&6
3997else
3998 cat >"conftest.$ac_ext" <<_ACEOF
3999#line 3999 "configure"
4000#include "confdefs.h"
4001#define $ac_func autoconf_temporary
4002#include <limits.h> /* least-intrusive standard header which defines gcc2 __stub macros */
4003#undef $ac_func
4004
4005#ifdef __cplusplus
4006extern "C"
4007#endif
4008
4009/* We use char because int might match the return type of a gcc2
4010 builtin and then its argument prototype would still apply. */
4011char $ac_func (void);
4012
4013int
4014main (void)
4015{
4016
4017/* The GNU C library defines stubs for functions which it implements
4018 to always fail with ENOSYS. Some functions are actually named
4019 something starting with __ and the normal name is an alias. */
4020#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
4021#error found stub for $ac_func
4022#endif
4023
4024 return $ac_func ();
4025 ;
4026 return 0;
4027}
4028_ACEOF
4029rm -f "conftest.$ac_objext" "conftest$ac_exeext"
4030if { (eval echo "$as_me:4030: \"$ac_link\"") >&5
4031 (eval $ac_link) 2>&5
4032 ac_status=$?
4033 echo "$as_me:4033: \$? = $ac_status" >&5
4034 (exit "$ac_status"); } &&
4035 { ac_try='test -s "conftest$ac_exeext"'
4036 { (eval echo "$as_me:4036: \"$ac_try\"") >&5
4037 (eval $ac_try) 2>&5
4038 ac_status=$?
4039 echo "$as_me:4039: \$? = $ac_status" >&5
4040 (exit "$ac_status"); }; }; then
4041 eval "$as_ac_var=yes"
4042else
4043 echo "$as_me: failed program was:" >&5
4044cat "conftest.$ac_ext" >&5
4045eval "$as_ac_var=no"
4046fi
4047rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
4048fi
4049echo "$as_me:4049: result: `eval echo '${'"$as_ac_var"'}'`" >&5
4050echo "${ECHO_T}`eval echo '${'"$as_ac_var"'}'`" >&6
4051if test "`eval echo '${'"$as_ac_var"'}'`" = yes; then
4052 cat >>confdefs.h <<EOF
4053#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
4054EOF
4055
4056fi
4057done
4058
4059fi
4060
4061echo "$as_me:4061: checking if the POSIX test-macros are already defined" >&5
4062echo $ECHO_N "checking if the POSIX test-macros are already defined... $ECHO_C" >&6
4063if test "${cf_cv_posix_visible+set}" = set; then
4064 echo $ECHO_N "(cached) $ECHO_C" >&6
4065else
4066
4067cat >"conftest.$ac_ext" <<_ACEOF
4068#line 4068 "configure"
4069#include "confdefs.h"
4070#include <stdio.h>
4071int
4072main (void)
4073{
4074
4075#if defined(__POSIX_VISIBLE) && ((__POSIX_VISIBLE - 0L) > 0) \
4076 && defined(__XSI_VISIBLE) && ((__XSI_VISIBLE - 0L) > 0) \
4077 && defined(__BSD_VISIBLE) && ((__BSD_VISIBLE - 0L) > 0) \
4078 && defined(__ISO_C_VISIBLE) && ((__ISO_C_VISIBLE - 0L) > 0)
4079#error conflicting symbols found
4080#endif
4081
4082 ;
4083 return 0;
4084}
4085_ACEOF
4086rm -f "conftest.$ac_objext"
4087if { (eval echo "$as_me:4087: \"$ac_compile\"") >&5
4088 (eval $ac_compile) 2>&5
4089 ac_status=$?
4090 echo "$as_me:4090: \$? = $ac_status" >&5
4091 (exit "$ac_status"); } &&
4092 { ac_try='test -s "conftest.$ac_objext"'
4093 { (eval echo "$as_me:4093: \"$ac_try\"") >&5
4094 (eval $ac_try) 2>&5
4095 ac_status=$?
4096 echo "$as_me:4096: \$? = $ac_status" >&5
4097 (exit "$ac_status"); }; }; then
4098 cf_cv_posix_visible=no
4099else
4100 echo "$as_me: failed program was:" >&5
4101cat "conftest.$ac_ext" >&5
4102cf_cv_posix_visible=yes
4103fi
4104rm -f "conftest.$ac_objext" "conftest.$ac_ext"
4105
4106fi
4107echo "$as_me:4107: result: $cf_cv_posix_visible" >&5
4108echo "${ECHO_T}$cf_cv_posix_visible" >&6
4109
4110if test "$cf_cv_posix_visible" = no; then
4111
4112cf_XOPEN_SOURCE=600
Steve Kondikae271bc2015-11-15 02:50:53 +01004113cf_POSIX_C_SOURCE=199506L
4114cf_xopen_source=
4115
micky3879b9f5e72025-07-08 18:04:53 -04004116case "$host_os" in
Steve Kondikae271bc2015-11-15 02:50:53 +01004117(aix[4-7]*)
4118 cf_xopen_source="-D_ALL_SOURCE"
4119 ;;
Steve Kondikae271bc2015-11-15 02:50:53 +01004120(darwin[0-8].*)
4121 cf_xopen_source="-D_APPLE_C_SOURCE"
4122 ;;
4123(darwin*)
4124 cf_xopen_source="-D_DARWIN_C_SOURCE"
4125 cf_XOPEN_SOURCE=
4126 ;;
micky3879b9f5e72025-07-08 18:04:53 -04004127(freebsd*|dragonfly*|midnightbsd*)
Steve Kondikae271bc2015-11-15 02:50:53 +01004128 # 5.x headers associate
4129 # _XOPEN_SOURCE=600 with _POSIX_C_SOURCE=200112L
4130 # _XOPEN_SOURCE=500 with _POSIX_C_SOURCE=199506L
4131 cf_POSIX_C_SOURCE=200112L
4132 cf_XOPEN_SOURCE=600
4133 cf_xopen_source="-D_BSD_TYPES -D__BSD_VISIBLE -D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
4134 ;;
4135(hpux11*)
4136 cf_xopen_source="-D_HPUX_SOURCE -D_XOPEN_SOURCE=500"
4137 ;;
4138(hpux*)
4139 cf_xopen_source="-D_HPUX_SOURCE"
4140 ;;
4141(irix[56].*)
4142 cf_xopen_source="-D_SGI_SOURCE"
4143 cf_XOPEN_SOURCE=
4144 ;;
micky3879b9f5e72025-07-08 18:04:53 -04004145(linux*gnu|linux*gnuabi64|linux*gnuabin32|linux*gnueabi|linux*gnueabihf|linux*gnux32|uclinux*|gnu*|mint*|k*bsd*-gnu|cygwin|msys|mingw*|linux*uclibc)
Steve Kondikae271bc2015-11-15 02:50:53 +01004146
micky3879b9f5e72025-07-08 18:04:53 -04004147cf_gnu_xopen_source=$cf_XOPEN_SOURCE
4148
4149echo "$as_me:4149: checking if this is the GNU C library" >&5
4150echo $ECHO_N "checking if this is the GNU C library... $ECHO_C" >&6
4151if test "${cf_cv_gnu_library+set}" = set; then
4152 echo $ECHO_N "(cached) $ECHO_C" >&6
4153else
4154
4155cat >"conftest.$ac_ext" <<_ACEOF
4156#line 4156 "configure"
4157#include "confdefs.h"
4158#include <sys/types.h>
4159int
4160main (void)
4161{
4162
4163 #if __GLIBC__ > 0 && __GLIBC_MINOR__ >= 0
4164 return 0;
4165 #elif __NEWLIB__ > 0 && __NEWLIB_MINOR__ >= 0
4166 return 0;
4167 #else
4168 # error not GNU C library
4169 #endif
4170 ;
4171 return 0;
4172}
4173_ACEOF
4174rm -f "conftest.$ac_objext"
4175if { (eval echo "$as_me:4175: \"$ac_compile\"") >&5
4176 (eval $ac_compile) 2>&5
4177 ac_status=$?
4178 echo "$as_me:4178: \$? = $ac_status" >&5
4179 (exit "$ac_status"); } &&
4180 { ac_try='test -s "conftest.$ac_objext"'
4181 { (eval echo "$as_me:4181: \"$ac_try\"") >&5
4182 (eval $ac_try) 2>&5
4183 ac_status=$?
4184 echo "$as_me:4184: \$? = $ac_status" >&5
4185 (exit "$ac_status"); }; }; then
4186 cf_cv_gnu_library=yes
4187else
4188 echo "$as_me: failed program was:" >&5
4189cat "conftest.$ac_ext" >&5
4190cf_cv_gnu_library=no
4191fi
4192rm -f "conftest.$ac_objext" "conftest.$ac_ext"
4193
4194fi
4195echo "$as_me:4195: result: $cf_cv_gnu_library" >&5
4196echo "${ECHO_T}$cf_cv_gnu_library" >&6
4197
4198if test x$cf_cv_gnu_library = xyes; then
4199
4200 # With glibc 2.19 (13 years after this check was begun), _DEFAULT_SOURCE
4201 # was changed to help a little. newlib incorporated the change about 4
4202 # years later.
4203 echo "$as_me:4203: checking if _DEFAULT_SOURCE can be used as a basis" >&5
4204echo $ECHO_N "checking if _DEFAULT_SOURCE can be used as a basis... $ECHO_C" >&6
4205if test "${cf_cv_gnu_library_219+set}" = set; then
4206 echo $ECHO_N "(cached) $ECHO_C" >&6
4207else
4208
4209 cf_save="$CPPFLAGS"
4210
4211 test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4212 CPPFLAGS="${CPPFLAGS}-D_DEFAULT_SOURCE"
4213
4214 cat >"conftest.$ac_ext" <<_ACEOF
4215#line 4215 "configure"
4216#include "confdefs.h"
4217#include <sys/types.h>
4218int
4219main (void)
4220{
4221
4222 #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 19) || (__GLIBC__ > 2)
4223 return 0;
4224 #elif (__NEWLIB__ == 2 && __NEWLIB_MINOR__ >= 4) || (__GLIBC__ > 3)
4225 return 0;
4226 #else
4227 # error GNU C library __GLIBC__.__GLIBC_MINOR__ is too old
4228 #endif
4229 ;
4230 return 0;
4231}
4232_ACEOF
4233rm -f "conftest.$ac_objext"
4234if { (eval echo "$as_me:4234: \"$ac_compile\"") >&5
4235 (eval $ac_compile) 2>&5
4236 ac_status=$?
4237 echo "$as_me:4237: \$? = $ac_status" >&5
4238 (exit "$ac_status"); } &&
4239 { ac_try='test -s "conftest.$ac_objext"'
4240 { (eval echo "$as_me:4240: \"$ac_try\"") >&5
4241 (eval $ac_try) 2>&5
4242 ac_status=$?
4243 echo "$as_me:4243: \$? = $ac_status" >&5
4244 (exit "$ac_status"); }; }; then
4245 cf_cv_gnu_library_219=yes
4246else
4247 echo "$as_me: failed program was:" >&5
4248cat "conftest.$ac_ext" >&5
4249cf_cv_gnu_library_219=no
4250fi
4251rm -f "conftest.$ac_objext" "conftest.$ac_ext"
4252 CPPFLAGS="$cf_save"
4253
4254fi
4255echo "$as_me:4255: result: $cf_cv_gnu_library_219" >&5
4256echo "${ECHO_T}$cf_cv_gnu_library_219" >&6
4257
4258 if test "x$cf_cv_gnu_library_219" = xyes; then
4259 cf_save="$CPPFLAGS"
4260 echo "$as_me:4260: checking if _XOPEN_SOURCE=$cf_gnu_xopen_source works with _DEFAULT_SOURCE" >&5
4261echo $ECHO_N "checking if _XOPEN_SOURCE=$cf_gnu_xopen_source works with _DEFAULT_SOURCE... $ECHO_C" >&6
4262if test "${cf_cv_gnu_dftsrc_219+set}" = set; then
4263 echo $ECHO_N "(cached) $ECHO_C" >&6
4264else
4265
4266cf_fix_cppflags=no
4267cf_new_cflags=
4268cf_new_cppflags=
4269cf_new_extra_cppflags=
4270
4271for cf_add_cflags in -D_DEFAULT_SOURCE -D_XOPEN_SOURCE=$cf_gnu_xopen_source
4272do
4273case "$cf_fix_cppflags" in
4274(no)
4275 case "$cf_add_cflags" in
4276 (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
4277 case "$cf_add_cflags" in
4278 (-D*)
4279 cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
4280
4281 test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4282 && test -z "${cf_tst_cflags}" \
4283 && cf_fix_cppflags=yes
4284
4285 if test "$cf_fix_cppflags" = yes ; then
4286
4287 test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4288 cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4289
4290 continue
4291 elif test "${cf_tst_cflags}" = "\"'" ; then
4292
4293 test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4294 cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4295
4296 continue
4297 fi
4298 ;;
4299 esac
4300 case "$CPPFLAGS" in
4301 (*$cf_add_cflags)
4302 ;;
4303 (*)
4304 case "$cf_add_cflags" in
4305 (-D*)
4306 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
4307
4308CPPFLAGS=`echo "$CPPFLAGS" | \
4309 sed -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?[ ]/ /g' \
4310 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?$//g'`
4311
4312 ;;
4313 esac
4314
4315 test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
4316 cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
4317
4318 ;;
4319 esac
4320 ;;
4321 (*)
4322
4323 test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
4324 cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
4325
4326 ;;
4327 esac
4328 ;;
4329(yes)
4330
4331 test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4332 cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4333
4334 cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
4335
4336 test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4337 && test -z "${cf_tst_cflags}" \
4338 && cf_fix_cppflags=no
4339 ;;
4340esac
4341done
4342
4343if test -n "$cf_new_cflags" ; then
4344
4345 test -n "$CFLAGS" && CFLAGS="$CFLAGS "
4346 CFLAGS="${CFLAGS}$cf_new_cflags"
4347
4348fi
4349
4350if test -n "$cf_new_cppflags" ; then
4351
4352 test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4353 CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
4354
4355fi
4356
4357if test -n "$cf_new_extra_cppflags" ; then
4358
4359 test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
4360 EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
4361
4362fi
4363
4364 cat >"conftest.$ac_ext" <<_ACEOF
4365#line 4365 "configure"
4366#include "confdefs.h"
4367
4368 #include <limits.h>
4369 #include <sys/types.h>
4370
4371int
4372main (void)
4373{
4374
4375 #if (_XOPEN_SOURCE >= $cf_gnu_xopen_source) && (MB_LEN_MAX > 1)
4376 return 0;
4377 #else
4378 # error GNU C library is too old
4379 #endif
4380 ;
4381 return 0;
4382}
4383_ACEOF
4384rm -f "conftest.$ac_objext"
4385if { (eval echo "$as_me:4385: \"$ac_compile\"") >&5
4386 (eval $ac_compile) 2>&5
4387 ac_status=$?
4388 echo "$as_me:4388: \$? = $ac_status" >&5
4389 (exit "$ac_status"); } &&
4390 { ac_try='test -s "conftest.$ac_objext"'
4391 { (eval echo "$as_me:4391: \"$ac_try\"") >&5
4392 (eval $ac_try) 2>&5
4393 ac_status=$?
4394 echo "$as_me:4394: \$? = $ac_status" >&5
4395 (exit "$ac_status"); }; }; then
4396 cf_cv_gnu_dftsrc_219=yes
4397else
4398 echo "$as_me: failed program was:" >&5
4399cat "conftest.$ac_ext" >&5
4400cf_cv_gnu_dftsrc_219=no
4401fi
4402rm -f "conftest.$ac_objext" "conftest.$ac_ext"
4403
4404fi
4405echo "$as_me:4405: result: $cf_cv_gnu_dftsrc_219" >&5
4406echo "${ECHO_T}$cf_cv_gnu_dftsrc_219" >&6
4407 test "x$cf_cv_gnu_dftsrc_219" = "xyes" || CPPFLAGS="$cf_save"
4408 else
4409 cf_cv_gnu_dftsrc_219=maybe
4410 fi
4411
4412 if test "x$cf_cv_gnu_dftsrc_219" != xyes; then
4413
4414 echo "$as_me:4414: checking if we must define _GNU_SOURCE" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01004415echo $ECHO_N "checking if we must define _GNU_SOURCE... $ECHO_C" >&6
4416if test "${cf_cv_gnu_source+set}" = set; then
4417 echo $ECHO_N "(cached) $ECHO_C" >&6
4418else
4419
micky3879b9f5e72025-07-08 18:04:53 -04004420 cat >"conftest.$ac_ext" <<_ACEOF
4421#line 4421 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +01004422#include "confdefs.h"
4423#include <sys/types.h>
4424int
micky3879b9f5e72025-07-08 18:04:53 -04004425main (void)
Steve Kondikae271bc2015-11-15 02:50:53 +01004426{
4427
micky3879b9f5e72025-07-08 18:04:53 -04004428 #ifndef _XOPEN_SOURCE
4429 #error expected _XOPEN_SOURCE to be defined
4430 #endif
Steve Kondikae271bc2015-11-15 02:50:53 +01004431 ;
4432 return 0;
4433}
4434_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -04004435rm -f "conftest.$ac_objext"
4436if { (eval echo "$as_me:4436: \"$ac_compile\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01004437 (eval $ac_compile) 2>&5
4438 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -04004439 echo "$as_me:4439: \$? = $ac_status" >&5
4440 (exit "$ac_status"); } &&
4441 { ac_try='test -s "conftest.$ac_objext"'
4442 { (eval echo "$as_me:4442: \"$ac_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01004443 (eval $ac_try) 2>&5
4444 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -04004445 echo "$as_me:4445: \$? = $ac_status" >&5
4446 (exit "$ac_status"); }; }; then
Steve Kondikae271bc2015-11-15 02:50:53 +01004447 cf_cv_gnu_source=no
4448else
4449 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -04004450cat "conftest.$ac_ext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01004451cf_save="$CPPFLAGS"
micky3879b9f5e72025-07-08 18:04:53 -04004452
4453cf_fix_cppflags=no
4454cf_new_cflags=
4455cf_new_cppflags=
4456cf_new_extra_cppflags=
4457
4458for cf_add_cflags in -D_GNU_SOURCE
4459do
4460case "$cf_fix_cppflags" in
4461(no)
4462 case "$cf_add_cflags" in
4463 (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
4464 case "$cf_add_cflags" in
4465 (-D*)
4466 cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
4467
4468 test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4469 && test -z "${cf_tst_cflags}" \
4470 && cf_fix_cppflags=yes
4471
4472 if test "$cf_fix_cppflags" = yes ; then
4473
4474 test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4475 cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4476
4477 continue
4478 elif test "${cf_tst_cflags}" = "\"'" ; then
4479
4480 test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4481 cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4482
4483 continue
4484 fi
4485 ;;
4486 esac
4487 case "$CPPFLAGS" in
4488 (*$cf_add_cflags)
4489 ;;
4490 (*)
4491 case "$cf_add_cflags" in
4492 (-D*)
4493 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
4494
4495CPPFLAGS=`echo "$CPPFLAGS" | \
4496 sed -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?[ ]/ /g' \
4497 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?$//g'`
4498
4499 ;;
4500 esac
4501
4502 test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
4503 cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
4504
4505 ;;
4506 esac
4507 ;;
4508 (*)
4509
4510 test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
4511 cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
4512
4513 ;;
4514 esac
4515 ;;
4516(yes)
4517
4518 test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4519 cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4520
4521 cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
4522
4523 test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4524 && test -z "${cf_tst_cflags}" \
4525 && cf_fix_cppflags=no
4526 ;;
4527esac
4528done
4529
4530if test -n "$cf_new_cflags" ; then
4531
4532 test -n "$CFLAGS" && CFLAGS="$CFLAGS "
4533 CFLAGS="${CFLAGS}$cf_new_cflags"
4534
4535fi
4536
4537if test -n "$cf_new_cppflags" ; then
4538
4539 test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4540 CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
4541
4542fi
4543
4544if test -n "$cf_new_extra_cppflags" ; then
4545
4546 test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
4547 EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
4548
4549fi
4550
4551 cat >"conftest.$ac_ext" <<_ACEOF
4552#line 4552 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +01004553#include "confdefs.h"
4554#include <sys/types.h>
4555int
micky3879b9f5e72025-07-08 18:04:53 -04004556main (void)
Steve Kondikae271bc2015-11-15 02:50:53 +01004557{
4558
micky3879b9f5e72025-07-08 18:04:53 -04004559 #ifdef _XOPEN_SOURCE
4560 #error expected _XOPEN_SOURCE to be undefined
4561 #endif
Steve Kondikae271bc2015-11-15 02:50:53 +01004562 ;
4563 return 0;
4564}
4565_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -04004566rm -f "conftest.$ac_objext"
4567if { (eval echo "$as_me:4567: \"$ac_compile\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01004568 (eval $ac_compile) 2>&5
4569 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -04004570 echo "$as_me:4570: \$? = $ac_status" >&5
4571 (exit "$ac_status"); } &&
4572 { ac_try='test -s "conftest.$ac_objext"'
4573 { (eval echo "$as_me:4573: \"$ac_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01004574 (eval $ac_try) 2>&5
4575 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -04004576 echo "$as_me:4576: \$? = $ac_status" >&5
4577 (exit "$ac_status"); }; }; then
Steve Kondikae271bc2015-11-15 02:50:53 +01004578 cf_cv_gnu_source=no
4579else
4580 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -04004581cat "conftest.$ac_ext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01004582cf_cv_gnu_source=yes
4583fi
micky3879b9f5e72025-07-08 18:04:53 -04004584rm -f "conftest.$ac_objext" "conftest.$ac_ext"
4585 CPPFLAGS="$cf_save"
Steve Kondikae271bc2015-11-15 02:50:53 +01004586
4587fi
micky3879b9f5e72025-07-08 18:04:53 -04004588rm -f "conftest.$ac_objext" "conftest.$ac_ext"
Steve Kondikae271bc2015-11-15 02:50:53 +01004589
4590fi
micky3879b9f5e72025-07-08 18:04:53 -04004591echo "$as_me:4591: result: $cf_cv_gnu_source" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01004592echo "${ECHO_T}$cf_cv_gnu_source" >&6
micky3879b9f5e72025-07-08 18:04:53 -04004593
4594 if test "$cf_cv_gnu_source" = yes
4595 then
4596 echo "$as_me:4596: checking if we should also define _DEFAULT_SOURCE" >&5
4597echo $ECHO_N "checking if we should also define _DEFAULT_SOURCE... $ECHO_C" >&6
4598if test "${cf_cv_default_source+set}" = set; then
4599 echo $ECHO_N "(cached) $ECHO_C" >&6
4600else
4601
4602 test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4603 CPPFLAGS="${CPPFLAGS}-D_GNU_SOURCE"
4604
4605 cat >"conftest.$ac_ext" <<_ACEOF
4606#line 4606 "configure"
4607#include "confdefs.h"
4608#include <sys/types.h>
4609int
4610main (void)
4611{
4612
4613 #ifdef _DEFAULT_SOURCE
4614 #error expected _DEFAULT_SOURCE to be undefined
4615 #endif
4616 ;
4617 return 0;
4618}
4619_ACEOF
4620rm -f "conftest.$ac_objext"
4621if { (eval echo "$as_me:4621: \"$ac_compile\"") >&5
4622 (eval $ac_compile) 2>&5
4623 ac_status=$?
4624 echo "$as_me:4624: \$? = $ac_status" >&5
4625 (exit "$ac_status"); } &&
4626 { ac_try='test -s "conftest.$ac_objext"'
4627 { (eval echo "$as_me:4627: \"$ac_try\"") >&5
4628 (eval $ac_try) 2>&5
4629 ac_status=$?
4630 echo "$as_me:4630: \$? = $ac_status" >&5
4631 (exit "$ac_status"); }; }; then
4632 cf_cv_default_source=no
4633else
4634 echo "$as_me: failed program was:" >&5
4635cat "conftest.$ac_ext" >&5
4636cf_cv_default_source=yes
4637fi
4638rm -f "conftest.$ac_objext" "conftest.$ac_ext"
4639
4640fi
4641echo "$as_me:4641: result: $cf_cv_default_source" >&5
4642echo "${ECHO_T}$cf_cv_default_source" >&6
4643 if test "$cf_cv_default_source" = yes
4644 then
4645
4646 test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4647 CPPFLAGS="${CPPFLAGS}-D_DEFAULT_SOURCE"
4648
4649 fi
4650 fi
4651 fi
4652
4653fi
Steve Kondikae271bc2015-11-15 02:50:53 +01004654
4655 ;;
4656(minix*)
4657 cf_xopen_source="-D_NETBSD_SOURCE" # POSIX.1-2001 features are ifdef'd with this...
4658 ;;
4659(mirbsd*)
4660 # setting _XOPEN_SOURCE or _POSIX_SOURCE breaks <sys/select.h> and other headers which use u_int / u_short types
4661 cf_XOPEN_SOURCE=
4662
micky3879b9f5e72025-07-08 18:04:53 -04004663if test "$cf_cv_posix_visible" = no; then
4664
Steve Kondikae271bc2015-11-15 02:50:53 +01004665cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE
4666
4667cf_save_CFLAGS="$CFLAGS"
4668cf_save_CPPFLAGS="$CPPFLAGS"
4669
4670cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \
4671 sed -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^ ]*\)\?[ ]/ /g' \
4672 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^ ]*\)\?$//g'`
4673
4674cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \
4675 sed -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^ ]*\)\?[ ]/ /g' \
4676 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^ ]*\)\?$//g'`
4677
micky3879b9f5e72025-07-08 18:04:53 -04004678echo "$as_me:4678: checking if we should define _POSIX_C_SOURCE" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01004679echo $ECHO_N "checking if we should define _POSIX_C_SOURCE... $ECHO_C" >&6
4680if test "${cf_cv_posix_c_source+set}" = set; then
4681 echo $ECHO_N "(cached) $ECHO_C" >&6
4682else
4683
micky3879b9f5e72025-07-08 18:04:53 -04004684echo "${as_me:-configure}:4684: testing if the symbol is already defined go no further ..." 1>&5
Steve Kondikae271bc2015-11-15 02:50:53 +01004685
micky3879b9f5e72025-07-08 18:04:53 -04004686 cat >"conftest.$ac_ext" <<_ACEOF
4687#line 4687 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +01004688#include "confdefs.h"
4689#include <sys/types.h>
4690int
micky3879b9f5e72025-07-08 18:04:53 -04004691main (void)
Steve Kondikae271bc2015-11-15 02:50:53 +01004692{
4693
4694#ifndef _POSIX_C_SOURCE
micky3879b9f5e72025-07-08 18:04:53 -04004695#error _POSIX_C_SOURCE is not defined
Steve Kondikae271bc2015-11-15 02:50:53 +01004696#endif
4697 ;
4698 return 0;
4699}
4700_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -04004701rm -f "conftest.$ac_objext"
4702if { (eval echo "$as_me:4702: \"$ac_compile\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01004703 (eval $ac_compile) 2>&5
4704 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -04004705 echo "$as_me:4705: \$? = $ac_status" >&5
4706 (exit "$ac_status"); } &&
4707 { ac_try='test -s "conftest.$ac_objext"'
4708 { (eval echo "$as_me:4708: \"$ac_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01004709 (eval $ac_try) 2>&5
4710 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -04004711 echo "$as_me:4711: \$? = $ac_status" >&5
4712 (exit "$ac_status"); }; }; then
Steve Kondikae271bc2015-11-15 02:50:53 +01004713 cf_cv_posix_c_source=no
4714else
4715 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -04004716cat "conftest.$ac_ext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01004717cf_want_posix_source=no
4718 case .$cf_POSIX_C_SOURCE in
4719 (.[12]??*)
4720 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
4721 ;;
4722 (.2)
4723 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
4724 cf_want_posix_source=yes
4725 ;;
4726 (.*)
4727 cf_want_posix_source=yes
4728 ;;
4729 esac
4730 if test "$cf_want_posix_source" = yes ; then
micky3879b9f5e72025-07-08 18:04:53 -04004731 cat >"conftest.$ac_ext" <<_ACEOF
4732#line 4732 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +01004733#include "confdefs.h"
4734#include <sys/types.h>
4735int
micky3879b9f5e72025-07-08 18:04:53 -04004736main (void)
Steve Kondikae271bc2015-11-15 02:50:53 +01004737{
4738
4739#ifdef _POSIX_SOURCE
micky3879b9f5e72025-07-08 18:04:53 -04004740#error _POSIX_SOURCE is defined
Steve Kondikae271bc2015-11-15 02:50:53 +01004741#endif
4742 ;
4743 return 0;
4744}
4745_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -04004746rm -f "conftest.$ac_objext"
4747if { (eval echo "$as_me:4747: \"$ac_compile\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01004748 (eval $ac_compile) 2>&5
4749 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -04004750 echo "$as_me:4750: \$? = $ac_status" >&5
4751 (exit "$ac_status"); } &&
4752 { ac_try='test -s "conftest.$ac_objext"'
4753 { (eval echo "$as_me:4753: \"$ac_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01004754 (eval $ac_try) 2>&5
4755 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -04004756 echo "$as_me:4756: \$? = $ac_status" >&5
4757 (exit "$ac_status"); }; }; then
Steve Kondikae271bc2015-11-15 02:50:53 +01004758 :
4759else
4760 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -04004761cat "conftest.$ac_ext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01004762cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE"
4763fi
micky3879b9f5e72025-07-08 18:04:53 -04004764rm -f "conftest.$ac_objext" "conftest.$ac_ext"
Steve Kondikae271bc2015-11-15 02:50:53 +01004765 fi
4766
micky3879b9f5e72025-07-08 18:04:53 -04004767echo "${as_me:-configure}:4767: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
Steve Kondikae271bc2015-11-15 02:50:53 +01004768
4769 CFLAGS="$cf_trim_CFLAGS"
micky3879b9f5e72025-07-08 18:04:53 -04004770 CPPFLAGS="$cf_trim_CPPFLAGS"
Steve Kondikae271bc2015-11-15 02:50:53 +01004771
micky3879b9f5e72025-07-08 18:04:53 -04004772 test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4773 CPPFLAGS="${CPPFLAGS}$cf_cv_posix_c_source"
Steve Kondikae271bc2015-11-15 02:50:53 +01004774
micky3879b9f5e72025-07-08 18:04:53 -04004775echo "${as_me:-configure}:4775: testing if the second compile does not leave our definition intact error ..." 1>&5
4776
4777 cat >"conftest.$ac_ext" <<_ACEOF
4778#line 4778 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +01004779#include "confdefs.h"
4780#include <sys/types.h>
4781int
micky3879b9f5e72025-07-08 18:04:53 -04004782main (void)
Steve Kondikae271bc2015-11-15 02:50:53 +01004783{
4784
4785#ifndef _POSIX_C_SOURCE
micky3879b9f5e72025-07-08 18:04:53 -04004786#error _POSIX_C_SOURCE is not defined
Steve Kondikae271bc2015-11-15 02:50:53 +01004787#endif
4788 ;
4789 return 0;
4790}
4791_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -04004792rm -f "conftest.$ac_objext"
4793if { (eval echo "$as_me:4793: \"$ac_compile\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01004794 (eval $ac_compile) 2>&5
4795 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -04004796 echo "$as_me:4796: \$? = $ac_status" >&5
4797 (exit "$ac_status"); } &&
4798 { ac_try='test -s "conftest.$ac_objext"'
4799 { (eval echo "$as_me:4799: \"$ac_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01004800 (eval $ac_try) 2>&5
4801 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -04004802 echo "$as_me:4802: \$? = $ac_status" >&5
4803 (exit "$ac_status"); }; }; then
Steve Kondikae271bc2015-11-15 02:50:53 +01004804 :
4805else
4806 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -04004807cat "conftest.$ac_ext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01004808cf_cv_posix_c_source=no
4809fi
micky3879b9f5e72025-07-08 18:04:53 -04004810rm -f "conftest.$ac_objext" "conftest.$ac_ext"
Steve Kondikae271bc2015-11-15 02:50:53 +01004811 CFLAGS="$cf_save_CFLAGS"
4812 CPPFLAGS="$cf_save_CPPFLAGS"
4813
4814fi
micky3879b9f5e72025-07-08 18:04:53 -04004815rm -f "conftest.$ac_objext" "conftest.$ac_ext"
Steve Kondikae271bc2015-11-15 02:50:53 +01004816
4817fi
micky3879b9f5e72025-07-08 18:04:53 -04004818echo "$as_me:4818: result: $cf_cv_posix_c_source" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01004819echo "${ECHO_T}$cf_cv_posix_c_source" >&6
4820
4821if test "$cf_cv_posix_c_source" != no ; then
4822 CFLAGS="$cf_trim_CFLAGS"
4823 CPPFLAGS="$cf_trim_CPPFLAGS"
4824
4825cf_fix_cppflags=no
4826cf_new_cflags=
4827cf_new_cppflags=
4828cf_new_extra_cppflags=
4829
4830for cf_add_cflags in $cf_cv_posix_c_source
4831do
micky3879b9f5e72025-07-08 18:04:53 -04004832case "$cf_fix_cppflags" in
Steve Kondikae271bc2015-11-15 02:50:53 +01004833(no)
micky3879b9f5e72025-07-08 18:04:53 -04004834 case "$cf_add_cflags" in
Steve Kondikae271bc2015-11-15 02:50:53 +01004835 (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
micky3879b9f5e72025-07-08 18:04:53 -04004836 case "$cf_add_cflags" in
Steve Kondikae271bc2015-11-15 02:50:53 +01004837 (-D*)
micky3879b9f5e72025-07-08 18:04:53 -04004838 cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
Steve Kondikae271bc2015-11-15 02:50:53 +01004839
4840 test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4841 && test -z "${cf_tst_cflags}" \
4842 && cf_fix_cppflags=yes
4843
micky3879b9f5e72025-07-08 18:04:53 -04004844 if test "$cf_fix_cppflags" = yes ; then
4845
4846 test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4847 cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4848
Steve Kondikae271bc2015-11-15 02:50:53 +01004849 continue
4850 elif test "${cf_tst_cflags}" = "\"'" ; then
micky3879b9f5e72025-07-08 18:04:53 -04004851
4852 test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4853 cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4854
Steve Kondikae271bc2015-11-15 02:50:53 +01004855 continue
4856 fi
4857 ;;
4858 esac
4859 case "$CPPFLAGS" in
4860 (*$cf_add_cflags)
4861 ;;
4862 (*)
micky3879b9f5e72025-07-08 18:04:53 -04004863 case "$cf_add_cflags" in
Steve Kondikae271bc2015-11-15 02:50:53 +01004864 (-D*)
4865 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
4866
4867CPPFLAGS=`echo "$CPPFLAGS" | \
4868 sed -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?[ ]/ /g' \
4869 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?$//g'`
4870
4871 ;;
4872 esac
micky3879b9f5e72025-07-08 18:04:53 -04004873
4874 test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
4875 cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
4876
Steve Kondikae271bc2015-11-15 02:50:53 +01004877 ;;
4878 esac
4879 ;;
4880 (*)
micky3879b9f5e72025-07-08 18:04:53 -04004881
4882 test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
4883 cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
4884
Steve Kondikae271bc2015-11-15 02:50:53 +01004885 ;;
4886 esac
4887 ;;
4888(yes)
Steve Kondikae271bc2015-11-15 02:50:53 +01004889
micky3879b9f5e72025-07-08 18:04:53 -04004890 test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4891 cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4892
4893 cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
Steve Kondikae271bc2015-11-15 02:50:53 +01004894
4895 test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4896 && test -z "${cf_tst_cflags}" \
4897 && cf_fix_cppflags=no
4898 ;;
4899esac
4900done
4901
4902if test -n "$cf_new_cflags" ; then
4903
micky3879b9f5e72025-07-08 18:04:53 -04004904 test -n "$CFLAGS" && CFLAGS="$CFLAGS "
4905 CFLAGS="${CFLAGS}$cf_new_cflags"
4906
Steve Kondikae271bc2015-11-15 02:50:53 +01004907fi
4908
4909if test -n "$cf_new_cppflags" ; then
4910
micky3879b9f5e72025-07-08 18:04:53 -04004911 test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4912 CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
4913
Steve Kondikae271bc2015-11-15 02:50:53 +01004914fi
4915
4916if test -n "$cf_new_extra_cppflags" ; then
4917
micky3879b9f5e72025-07-08 18:04:53 -04004918 test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
4919 EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
4920
Steve Kondikae271bc2015-11-15 02:50:53 +01004921fi
4922
4923fi
4924
micky3879b9f5e72025-07-08 18:04:53 -04004925fi # cf_cv_posix_visible
4926
Steve Kondikae271bc2015-11-15 02:50:53 +01004927 ;;
4928(netbsd*)
4929 cf_xopen_source="-D_NETBSD_SOURCE" # setting _XOPEN_SOURCE breaks IPv6 for lynx on NetBSD 1.6, breaks xterm, is not needed for ncursesw
4930 ;;
micky3879b9f5e72025-07-08 18:04:53 -04004931(openbsd[6-9]*)
4932 # OpenBSD 6.x has broken locale support, both compile-time and runtime.
4933 # see https://www.mail-archive.com/bugs@openbsd.org/msg13200.html
4934 # Abusing the conformance level is a workaround.
4935 { echo "$as_me:4935: WARNING: this system does not provide usable locale support" >&5
4936echo "$as_me: WARNING: this system does not provide usable locale support" >&2;}
4937 cf_xopen_source="-D_BSD_SOURCE"
4938 cf_XOPEN_SOURCE=700
4939 ;;
4940(openbsd[4-5]*)
Steve Kondikae271bc2015-11-15 02:50:53 +01004941 # setting _XOPEN_SOURCE lower than 500 breaks g++ compile with wchar.h, needed for ncursesw
4942 cf_xopen_source="-D_BSD_SOURCE"
4943 cf_XOPEN_SOURCE=600
4944 ;;
4945(openbsd*)
4946 # setting _XOPEN_SOURCE breaks xterm on OpenBSD 2.8, is not needed for ncursesw
4947 ;;
4948(osf[45]*)
4949 cf_xopen_source="-D_OSF_SOURCE"
4950 ;;
4951(nto-qnx*)
4952 cf_xopen_source="-D_QNX_SOURCE"
4953 ;;
4954(sco*)
4955 # setting _XOPEN_SOURCE breaks Lynx on SCO Unix / OpenServer
4956 ;;
4957(solaris2.*)
4958 cf_xopen_source="-D__EXTENSIONS__"
4959 cf_cv_xopen_source=broken
4960 ;;
4961(sysv4.2uw2.*) # Novell/SCO UnixWare 2.x (tested on 2.1.2)
4962 cf_XOPEN_SOURCE=
4963 cf_POSIX_C_SOURCE=
4964 ;;
4965(*)
4966
micky3879b9f5e72025-07-08 18:04:53 -04004967echo "$as_me:4967: checking if we should define _XOPEN_SOURCE" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01004968echo $ECHO_N "checking if we should define _XOPEN_SOURCE... $ECHO_C" >&6
4969if test "${cf_cv_xopen_source+set}" = set; then
4970 echo $ECHO_N "(cached) $ECHO_C" >&6
4971else
4972
micky3879b9f5e72025-07-08 18:04:53 -04004973 cat >"conftest.$ac_ext" <<_ACEOF
4974#line 4974 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +01004975#include "confdefs.h"
4976
micky3879b9f5e72025-07-08 18:04:53 -04004977$ac_includes_default
Steve Kondikae271bc2015-11-15 02:50:53 +01004978
4979int
micky3879b9f5e72025-07-08 18:04:53 -04004980main (void)
Steve Kondikae271bc2015-11-15 02:50:53 +01004981{
4982
4983#ifndef _XOPEN_SOURCE
micky3879b9f5e72025-07-08 18:04:53 -04004984#error _XOPEN_SOURCE is not defined
Steve Kondikae271bc2015-11-15 02:50:53 +01004985#endif
micky3879b9f5e72025-07-08 18:04:53 -04004986
Steve Kondikae271bc2015-11-15 02:50:53 +01004987 ;
4988 return 0;
4989}
4990_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -04004991rm -f "conftest.$ac_objext"
4992if { (eval echo "$as_me:4992: \"$ac_compile\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01004993 (eval $ac_compile) 2>&5
4994 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -04004995 echo "$as_me:4995: \$? = $ac_status" >&5
4996 (exit "$ac_status"); } &&
4997 { ac_try='test -s "conftest.$ac_objext"'
4998 { (eval echo "$as_me:4998: \"$ac_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01004999 (eval $ac_try) 2>&5
5000 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -04005001 echo "$as_me:5001: \$? = $ac_status" >&5
5002 (exit "$ac_status"); }; }; then
Steve Kondikae271bc2015-11-15 02:50:53 +01005003 cf_cv_xopen_source=no
5004else
5005 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -04005006cat "conftest.$ac_ext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01005007cf_save="$CPPFLAGS"
micky3879b9f5e72025-07-08 18:04:53 -04005008
5009 test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
5010 CPPFLAGS="${CPPFLAGS}-D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
5011
5012 cat >"conftest.$ac_ext" <<_ACEOF
5013#line 5013 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +01005014#include "confdefs.h"
5015
micky3879b9f5e72025-07-08 18:04:53 -04005016$ac_includes_default
Steve Kondikae271bc2015-11-15 02:50:53 +01005017
5018int
micky3879b9f5e72025-07-08 18:04:53 -04005019main (void)
Steve Kondikae271bc2015-11-15 02:50:53 +01005020{
5021
micky3879b9f5e72025-07-08 18:04:53 -04005022#ifndef _XOPEN_SOURCE
5023#error _XOPEN_SOURCE is not defined
Steve Kondikae271bc2015-11-15 02:50:53 +01005024#endif
micky3879b9f5e72025-07-08 18:04:53 -04005025
Steve Kondikae271bc2015-11-15 02:50:53 +01005026 ;
5027 return 0;
5028}
5029_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -04005030rm -f "conftest.$ac_objext"
5031if { (eval echo "$as_me:5031: \"$ac_compile\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01005032 (eval $ac_compile) 2>&5
5033 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -04005034 echo "$as_me:5034: \$? = $ac_status" >&5
5035 (exit "$ac_status"); } &&
5036 { ac_try='test -s "conftest.$ac_objext"'
5037 { (eval echo "$as_me:5037: \"$ac_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01005038 (eval $ac_try) 2>&5
5039 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -04005040 echo "$as_me:5040: \$? = $ac_status" >&5
5041 (exit "$ac_status"); }; }; then
Steve Kondikae271bc2015-11-15 02:50:53 +01005042 cf_cv_xopen_source=no
5043else
5044 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -04005045cat "conftest.$ac_ext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01005046cf_cv_xopen_source=$cf_XOPEN_SOURCE
5047fi
micky3879b9f5e72025-07-08 18:04:53 -04005048rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5049 CPPFLAGS="$cf_save"
Steve Kondikae271bc2015-11-15 02:50:53 +01005050
5051fi
micky3879b9f5e72025-07-08 18:04:53 -04005052rm -f "conftest.$ac_objext" "conftest.$ac_ext"
Steve Kondikae271bc2015-11-15 02:50:53 +01005053
5054fi
micky3879b9f5e72025-07-08 18:04:53 -04005055echo "$as_me:5055: result: $cf_cv_xopen_source" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01005056echo "${ECHO_T}$cf_cv_xopen_source" >&6
5057
5058if test "$cf_cv_xopen_source" != no ; then
5059
5060CFLAGS=`echo "$CFLAGS" | \
5061 sed -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^ ]*\)\?[ ]/ /g' \
5062 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^ ]*\)\?$//g'`
5063
5064CPPFLAGS=`echo "$CPPFLAGS" | \
5065 sed -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^ ]*\)\?[ ]/ /g' \
5066 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^ ]*\)\?$//g'`
5067
5068 cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source"
5069
micky3879b9f5e72025-07-08 18:04:53 -04005070for cf_add_cflags in $cf_temp_xopen_source
5071do
5072 case "x$cf_add_cflags" in
5073 (x-[DU]*)
5074
5075cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
5076while true
5077do
5078 cf_old_cflag=`echo "x$CFLAGS" | sed -e 's/^.//' -e 's/[ ][ ]*-/ -/g' -e "s%$cf_tmp_cflag\\(=[^ ][^ ]*\\)\?%%" -e 's/^[ ]*//' -e 's%[ ][ ]*-D% -D%g' -e 's%[ ][ ]*-I% -I%g'`
5079 test "$CFLAGS" != "$cf_old_cflag" || break
5080
5081 CFLAGS="$cf_old_cflag"
5082done
5083
5084cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
5085while true
5086do
5087 cf_old_cflag=`echo "x$CPPFLAGS" | sed -e 's/^.//' -e 's/[ ][ ]*-/ -/g' -e "s%$cf_tmp_cflag\\(=[^ ][^ ]*\\)\?%%" -e 's/^[ ]*//' -e 's%[ ][ ]*-D% -D%g' -e 's%[ ][ ]*-I% -I%g'`
5088 test "$CPPFLAGS" != "$cf_old_cflag" || break
5089
5090 CPPFLAGS="$cf_old_cflag"
5091done
5092
5093 ;;
5094 esac
5095
Steve Kondikae271bc2015-11-15 02:50:53 +01005096cf_fix_cppflags=no
5097cf_new_cflags=
5098cf_new_cppflags=
5099cf_new_extra_cppflags=
5100
micky3879b9f5e72025-07-08 18:04:53 -04005101for cf_add_cflags in $cf_add_cflags
Steve Kondikae271bc2015-11-15 02:50:53 +01005102do
micky3879b9f5e72025-07-08 18:04:53 -04005103case "$cf_fix_cppflags" in
Steve Kondikae271bc2015-11-15 02:50:53 +01005104(no)
micky3879b9f5e72025-07-08 18:04:53 -04005105 case "$cf_add_cflags" in
Steve Kondikae271bc2015-11-15 02:50:53 +01005106 (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
micky3879b9f5e72025-07-08 18:04:53 -04005107 case "$cf_add_cflags" in
Steve Kondikae271bc2015-11-15 02:50:53 +01005108 (-D*)
micky3879b9f5e72025-07-08 18:04:53 -04005109 cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
Steve Kondikae271bc2015-11-15 02:50:53 +01005110
5111 test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
5112 && test -z "${cf_tst_cflags}" \
5113 && cf_fix_cppflags=yes
5114
micky3879b9f5e72025-07-08 18:04:53 -04005115 if test "$cf_fix_cppflags" = yes ; then
5116
5117 test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
5118 cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
5119
Steve Kondikae271bc2015-11-15 02:50:53 +01005120 continue
5121 elif test "${cf_tst_cflags}" = "\"'" ; then
micky3879b9f5e72025-07-08 18:04:53 -04005122
5123 test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
5124 cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
5125
Steve Kondikae271bc2015-11-15 02:50:53 +01005126 continue
5127 fi
5128 ;;
5129 esac
5130 case "$CPPFLAGS" in
5131 (*$cf_add_cflags)
5132 ;;
5133 (*)
micky3879b9f5e72025-07-08 18:04:53 -04005134 case "$cf_add_cflags" in
Steve Kondikae271bc2015-11-15 02:50:53 +01005135 (-D*)
5136 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
5137
5138CPPFLAGS=`echo "$CPPFLAGS" | \
5139 sed -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?[ ]/ /g' \
5140 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?$//g'`
5141
5142 ;;
5143 esac
micky3879b9f5e72025-07-08 18:04:53 -04005144
5145 test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
5146 cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
5147
Steve Kondikae271bc2015-11-15 02:50:53 +01005148 ;;
5149 esac
5150 ;;
5151 (*)
micky3879b9f5e72025-07-08 18:04:53 -04005152
5153 test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
5154 cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
5155
Steve Kondikae271bc2015-11-15 02:50:53 +01005156 ;;
5157 esac
5158 ;;
5159(yes)
Steve Kondikae271bc2015-11-15 02:50:53 +01005160
micky3879b9f5e72025-07-08 18:04:53 -04005161 test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
5162 cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
5163
5164 cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
Steve Kondikae271bc2015-11-15 02:50:53 +01005165
5166 test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
5167 && test -z "${cf_tst_cflags}" \
5168 && cf_fix_cppflags=no
5169 ;;
5170esac
5171done
5172
5173if test -n "$cf_new_cflags" ; then
5174
micky3879b9f5e72025-07-08 18:04:53 -04005175 test -n "$CFLAGS" && CFLAGS="$CFLAGS "
5176 CFLAGS="${CFLAGS}$cf_new_cflags"
5177
Steve Kondikae271bc2015-11-15 02:50:53 +01005178fi
5179
5180if test -n "$cf_new_cppflags" ; then
5181
micky3879b9f5e72025-07-08 18:04:53 -04005182 test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
5183 CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
5184
Steve Kondikae271bc2015-11-15 02:50:53 +01005185fi
5186
5187if test -n "$cf_new_extra_cppflags" ; then
5188
micky3879b9f5e72025-07-08 18:04:53 -04005189 test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
5190 EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
Steve Kondikae271bc2015-11-15 02:50:53 +01005191
5192fi
5193
micky3879b9f5e72025-07-08 18:04:53 -04005194done
5195
5196fi
5197
5198 cf_save_xopen_cppflags="$CPPFLAGS"
5199
5200if test "$cf_cv_posix_visible" = no; then
5201
Steve Kondikae271bc2015-11-15 02:50:53 +01005202cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE
5203
5204cf_save_CFLAGS="$CFLAGS"
5205cf_save_CPPFLAGS="$CPPFLAGS"
5206
5207cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \
5208 sed -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^ ]*\)\?[ ]/ /g' \
5209 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^ ]*\)\?$//g'`
5210
5211cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \
5212 sed -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^ ]*\)\?[ ]/ /g' \
5213 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^ ]*\)\?$//g'`
5214
micky3879b9f5e72025-07-08 18:04:53 -04005215echo "$as_me:5215: checking if we should define _POSIX_C_SOURCE" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01005216echo $ECHO_N "checking if we should define _POSIX_C_SOURCE... $ECHO_C" >&6
5217if test "${cf_cv_posix_c_source+set}" = set; then
5218 echo $ECHO_N "(cached) $ECHO_C" >&6
5219else
5220
micky3879b9f5e72025-07-08 18:04:53 -04005221echo "${as_me:-configure}:5221: testing if the symbol is already defined go no further ..." 1>&5
Steve Kondikae271bc2015-11-15 02:50:53 +01005222
micky3879b9f5e72025-07-08 18:04:53 -04005223 cat >"conftest.$ac_ext" <<_ACEOF
5224#line 5224 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +01005225#include "confdefs.h"
5226#include <sys/types.h>
5227int
micky3879b9f5e72025-07-08 18:04:53 -04005228main (void)
Steve Kondikae271bc2015-11-15 02:50:53 +01005229{
5230
5231#ifndef _POSIX_C_SOURCE
micky3879b9f5e72025-07-08 18:04:53 -04005232#error _POSIX_C_SOURCE is not defined
Steve Kondikae271bc2015-11-15 02:50:53 +01005233#endif
5234 ;
5235 return 0;
5236}
5237_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -04005238rm -f "conftest.$ac_objext"
5239if { (eval echo "$as_me:5239: \"$ac_compile\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01005240 (eval $ac_compile) 2>&5
5241 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -04005242 echo "$as_me:5242: \$? = $ac_status" >&5
5243 (exit "$ac_status"); } &&
5244 { ac_try='test -s "conftest.$ac_objext"'
5245 { (eval echo "$as_me:5245: \"$ac_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01005246 (eval $ac_try) 2>&5
5247 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -04005248 echo "$as_me:5248: \$? = $ac_status" >&5
5249 (exit "$ac_status"); }; }; then
Steve Kondikae271bc2015-11-15 02:50:53 +01005250 cf_cv_posix_c_source=no
5251else
5252 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -04005253cat "conftest.$ac_ext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01005254cf_want_posix_source=no
5255 case .$cf_POSIX_C_SOURCE in
5256 (.[12]??*)
5257 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
5258 ;;
5259 (.2)
5260 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
5261 cf_want_posix_source=yes
5262 ;;
5263 (.*)
5264 cf_want_posix_source=yes
5265 ;;
5266 esac
5267 if test "$cf_want_posix_source" = yes ; then
micky3879b9f5e72025-07-08 18:04:53 -04005268 cat >"conftest.$ac_ext" <<_ACEOF
5269#line 5269 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +01005270#include "confdefs.h"
5271#include <sys/types.h>
5272int
micky3879b9f5e72025-07-08 18:04:53 -04005273main (void)
Steve Kondikae271bc2015-11-15 02:50:53 +01005274{
5275
5276#ifdef _POSIX_SOURCE
micky3879b9f5e72025-07-08 18:04:53 -04005277#error _POSIX_SOURCE is defined
Steve Kondikae271bc2015-11-15 02:50:53 +01005278#endif
5279 ;
5280 return 0;
5281}
5282_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -04005283rm -f "conftest.$ac_objext"
5284if { (eval echo "$as_me:5284: \"$ac_compile\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01005285 (eval $ac_compile) 2>&5
5286 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -04005287 echo "$as_me:5287: \$? = $ac_status" >&5
5288 (exit "$ac_status"); } &&
5289 { ac_try='test -s "conftest.$ac_objext"'
5290 { (eval echo "$as_me:5290: \"$ac_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01005291 (eval $ac_try) 2>&5
5292 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -04005293 echo "$as_me:5293: \$? = $ac_status" >&5
5294 (exit "$ac_status"); }; }; then
Steve Kondikae271bc2015-11-15 02:50:53 +01005295 :
5296else
5297 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -04005298cat "conftest.$ac_ext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01005299cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE"
5300fi
micky3879b9f5e72025-07-08 18:04:53 -04005301rm -f "conftest.$ac_objext" "conftest.$ac_ext"
Steve Kondikae271bc2015-11-15 02:50:53 +01005302 fi
5303
micky3879b9f5e72025-07-08 18:04:53 -04005304echo "${as_me:-configure}:5304: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
Steve Kondikae271bc2015-11-15 02:50:53 +01005305
5306 CFLAGS="$cf_trim_CFLAGS"
micky3879b9f5e72025-07-08 18:04:53 -04005307 CPPFLAGS="$cf_trim_CPPFLAGS"
Steve Kondikae271bc2015-11-15 02:50:53 +01005308
micky3879b9f5e72025-07-08 18:04:53 -04005309 test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
5310 CPPFLAGS="${CPPFLAGS}$cf_cv_posix_c_source"
Steve Kondikae271bc2015-11-15 02:50:53 +01005311
micky3879b9f5e72025-07-08 18:04:53 -04005312echo "${as_me:-configure}:5312: testing if the second compile does not leave our definition intact error ..." 1>&5
5313
5314 cat >"conftest.$ac_ext" <<_ACEOF
5315#line 5315 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +01005316#include "confdefs.h"
5317#include <sys/types.h>
5318int
micky3879b9f5e72025-07-08 18:04:53 -04005319main (void)
Steve Kondikae271bc2015-11-15 02:50:53 +01005320{
5321
5322#ifndef _POSIX_C_SOURCE
micky3879b9f5e72025-07-08 18:04:53 -04005323#error _POSIX_C_SOURCE is not defined
Steve Kondikae271bc2015-11-15 02:50:53 +01005324#endif
5325 ;
5326 return 0;
5327}
5328_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -04005329rm -f "conftest.$ac_objext"
5330if { (eval echo "$as_me:5330: \"$ac_compile\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01005331 (eval $ac_compile) 2>&5
5332 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -04005333 echo "$as_me:5333: \$? = $ac_status" >&5
5334 (exit "$ac_status"); } &&
5335 { ac_try='test -s "conftest.$ac_objext"'
5336 { (eval echo "$as_me:5336: \"$ac_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01005337 (eval $ac_try) 2>&5
5338 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -04005339 echo "$as_me:5339: \$? = $ac_status" >&5
5340 (exit "$ac_status"); }; }; then
Steve Kondikae271bc2015-11-15 02:50:53 +01005341 :
5342else
5343 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -04005344cat "conftest.$ac_ext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01005345cf_cv_posix_c_source=no
5346fi
micky3879b9f5e72025-07-08 18:04:53 -04005347rm -f "conftest.$ac_objext" "conftest.$ac_ext"
Steve Kondikae271bc2015-11-15 02:50:53 +01005348 CFLAGS="$cf_save_CFLAGS"
5349 CPPFLAGS="$cf_save_CPPFLAGS"
5350
5351fi
micky3879b9f5e72025-07-08 18:04:53 -04005352rm -f "conftest.$ac_objext" "conftest.$ac_ext"
Steve Kondikae271bc2015-11-15 02:50:53 +01005353
5354fi
micky3879b9f5e72025-07-08 18:04:53 -04005355echo "$as_me:5355: result: $cf_cv_posix_c_source" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01005356echo "${ECHO_T}$cf_cv_posix_c_source" >&6
5357
5358if test "$cf_cv_posix_c_source" != no ; then
5359 CFLAGS="$cf_trim_CFLAGS"
5360 CPPFLAGS="$cf_trim_CPPFLAGS"
5361
5362cf_fix_cppflags=no
5363cf_new_cflags=
5364cf_new_cppflags=
5365cf_new_extra_cppflags=
5366
5367for cf_add_cflags in $cf_cv_posix_c_source
5368do
micky3879b9f5e72025-07-08 18:04:53 -04005369case "$cf_fix_cppflags" in
Steve Kondikae271bc2015-11-15 02:50:53 +01005370(no)
micky3879b9f5e72025-07-08 18:04:53 -04005371 case "$cf_add_cflags" in
Steve Kondikae271bc2015-11-15 02:50:53 +01005372 (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
micky3879b9f5e72025-07-08 18:04:53 -04005373 case "$cf_add_cflags" in
Steve Kondikae271bc2015-11-15 02:50:53 +01005374 (-D*)
micky3879b9f5e72025-07-08 18:04:53 -04005375 cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
Steve Kondikae271bc2015-11-15 02:50:53 +01005376
5377 test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
5378 && test -z "${cf_tst_cflags}" \
5379 && cf_fix_cppflags=yes
5380
micky3879b9f5e72025-07-08 18:04:53 -04005381 if test "$cf_fix_cppflags" = yes ; then
5382
5383 test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
5384 cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
5385
Steve Kondikae271bc2015-11-15 02:50:53 +01005386 continue
5387 elif test "${cf_tst_cflags}" = "\"'" ; then
micky3879b9f5e72025-07-08 18:04:53 -04005388
5389 test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
5390 cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
5391
Steve Kondikae271bc2015-11-15 02:50:53 +01005392 continue
5393 fi
5394 ;;
5395 esac
5396 case "$CPPFLAGS" in
5397 (*$cf_add_cflags)
5398 ;;
5399 (*)
micky3879b9f5e72025-07-08 18:04:53 -04005400 case "$cf_add_cflags" in
Steve Kondikae271bc2015-11-15 02:50:53 +01005401 (-D*)
5402 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
5403
5404CPPFLAGS=`echo "$CPPFLAGS" | \
5405 sed -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?[ ]/ /g' \
5406 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?$//g'`
5407
5408 ;;
5409 esac
micky3879b9f5e72025-07-08 18:04:53 -04005410
5411 test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
5412 cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
5413
Steve Kondikae271bc2015-11-15 02:50:53 +01005414 ;;
5415 esac
5416 ;;
5417 (*)
micky3879b9f5e72025-07-08 18:04:53 -04005418
5419 test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
5420 cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
5421
Steve Kondikae271bc2015-11-15 02:50:53 +01005422 ;;
5423 esac
5424 ;;
5425(yes)
Steve Kondikae271bc2015-11-15 02:50:53 +01005426
micky3879b9f5e72025-07-08 18:04:53 -04005427 test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
5428 cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
5429
5430 cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
Steve Kondikae271bc2015-11-15 02:50:53 +01005431
5432 test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
5433 && test -z "${cf_tst_cflags}" \
5434 && cf_fix_cppflags=no
5435 ;;
5436esac
5437done
5438
5439if test -n "$cf_new_cflags" ; then
5440
micky3879b9f5e72025-07-08 18:04:53 -04005441 test -n "$CFLAGS" && CFLAGS="$CFLAGS "
5442 CFLAGS="${CFLAGS}$cf_new_cflags"
5443
Steve Kondikae271bc2015-11-15 02:50:53 +01005444fi
5445
5446if test -n "$cf_new_cppflags" ; then
5447
micky3879b9f5e72025-07-08 18:04:53 -04005448 test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
5449 CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
5450
Steve Kondikae271bc2015-11-15 02:50:53 +01005451fi
5452
5453if test -n "$cf_new_extra_cppflags" ; then
5454
micky3879b9f5e72025-07-08 18:04:53 -04005455 test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
5456 EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
5457
Steve Kondikae271bc2015-11-15 02:50:53 +01005458fi
5459
5460fi
5461
micky3879b9f5e72025-07-08 18:04:53 -04005462fi # cf_cv_posix_visible
5463
5464 # Some of these niche implementations use copy/paste, double-check...
5465 if test "$cf_cv_xopen_source" = no ; then
5466 test -n "$verbose" && echo " checking if _POSIX_C_SOURCE interferes with _XOPEN_SOURCE" 1>&6
5467
5468echo "${as_me:-configure}:5468: testing checking if _POSIX_C_SOURCE interferes with _XOPEN_SOURCE ..." 1>&5
5469
5470 cat >"conftest.$ac_ext" <<_ACEOF
5471#line 5471 "configure"
5472#include "confdefs.h"
5473
5474$ac_includes_default
5475
5476int
5477main (void)
5478{
5479
5480#ifndef _XOPEN_SOURCE
5481#error _XOPEN_SOURCE is not defined
5482#endif
5483
5484 ;
5485 return 0;
5486}
5487_ACEOF
5488rm -f "conftest.$ac_objext"
5489if { (eval echo "$as_me:5489: \"$ac_compile\"") >&5
5490 (eval $ac_compile) 2>&5
5491 ac_status=$?
5492 echo "$as_me:5492: \$? = $ac_status" >&5
5493 (exit "$ac_status"); } &&
5494 { ac_try='test -s "conftest.$ac_objext"'
5495 { (eval echo "$as_me:5495: \"$ac_try\"") >&5
5496 (eval $ac_try) 2>&5
5497 ac_status=$?
5498 echo "$as_me:5498: \$? = $ac_status" >&5
5499 (exit "$ac_status"); }; }; then
5500 :
5501else
5502 echo "$as_me: failed program was:" >&5
5503cat "conftest.$ac_ext" >&5
5504
5505 { echo "$as_me:5505: WARNING: _POSIX_C_SOURCE definition is not usable" >&5
5506echo "$as_me: WARNING: _POSIX_C_SOURCE definition is not usable" >&2;}
5507 CPPFLAGS="$cf_save_xopen_cppflags"
5508fi
5509rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5510 fi
Steve Kondikae271bc2015-11-15 02:50:53 +01005511 ;;
5512esac
5513
5514if test -n "$cf_xopen_source" ; then
5515
micky3879b9f5e72025-07-08 18:04:53 -04005516for cf_add_cflags in $cf_xopen_source
5517do
5518 case "x$cf_add_cflags" in
5519 (x-[DU]*)
5520
5521cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
5522while true
5523do
5524 cf_old_cflag=`echo "x$CFLAGS" | sed -e 's/^.//' -e 's/[ ][ ]*-/ -/g' -e "s%$cf_tmp_cflag\\(=[^ ][^ ]*\\)\?%%" -e 's/^[ ]*//' -e 's%[ ][ ]*-D% -D%g' -e 's%[ ][ ]*-I% -I%g'`
5525 test "$CFLAGS" != "$cf_old_cflag" || break
5526 test -n "$verbose" && echo " removing old option $cf_add_cflags from CFLAGS" 1>&6
5527
5528echo "${as_me:-configure}:5528: testing removing old option $cf_add_cflags from CFLAGS ..." 1>&5
5529
5530 CFLAGS="$cf_old_cflag"
5531done
5532
5533cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
5534while true
5535do
5536 cf_old_cflag=`echo "x$CPPFLAGS" | sed -e 's/^.//' -e 's/[ ][ ]*-/ -/g' -e "s%$cf_tmp_cflag\\(=[^ ][^ ]*\\)\?%%" -e 's/^[ ]*//' -e 's%[ ][ ]*-D% -D%g' -e 's%[ ][ ]*-I% -I%g'`
5537 test "$CPPFLAGS" != "$cf_old_cflag" || break
5538 test -n "$verbose" && echo " removing old option $cf_add_cflags from CPPFLAGS" 1>&6
5539
5540echo "${as_me:-configure}:5540: testing removing old option $cf_add_cflags from CPPFLAGS ..." 1>&5
5541
5542 CPPFLAGS="$cf_old_cflag"
5543done
5544
5545 ;;
5546 esac
5547
Steve Kondikae271bc2015-11-15 02:50:53 +01005548cf_fix_cppflags=no
5549cf_new_cflags=
5550cf_new_cppflags=
5551cf_new_extra_cppflags=
5552
micky3879b9f5e72025-07-08 18:04:53 -04005553for cf_add_cflags in $cf_add_cflags
Steve Kondikae271bc2015-11-15 02:50:53 +01005554do
micky3879b9f5e72025-07-08 18:04:53 -04005555case "$cf_fix_cppflags" in
Steve Kondikae271bc2015-11-15 02:50:53 +01005556(no)
micky3879b9f5e72025-07-08 18:04:53 -04005557 case "$cf_add_cflags" in
Steve Kondikae271bc2015-11-15 02:50:53 +01005558 (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
micky3879b9f5e72025-07-08 18:04:53 -04005559 case "$cf_add_cflags" in
Steve Kondikae271bc2015-11-15 02:50:53 +01005560 (-D*)
micky3879b9f5e72025-07-08 18:04:53 -04005561 cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
Steve Kondikae271bc2015-11-15 02:50:53 +01005562
5563 test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
5564 && test -z "${cf_tst_cflags}" \
5565 && cf_fix_cppflags=yes
5566
micky3879b9f5e72025-07-08 18:04:53 -04005567 if test "$cf_fix_cppflags" = yes ; then
5568
5569 test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
5570 cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
5571
Steve Kondikae271bc2015-11-15 02:50:53 +01005572 continue
5573 elif test "${cf_tst_cflags}" = "\"'" ; then
micky3879b9f5e72025-07-08 18:04:53 -04005574
5575 test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
5576 cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
5577
Steve Kondikae271bc2015-11-15 02:50:53 +01005578 continue
5579 fi
5580 ;;
5581 esac
5582 case "$CPPFLAGS" in
5583 (*$cf_add_cflags)
5584 ;;
5585 (*)
micky3879b9f5e72025-07-08 18:04:53 -04005586 case "$cf_add_cflags" in
Steve Kondikae271bc2015-11-15 02:50:53 +01005587 (-D*)
5588 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
5589
5590CPPFLAGS=`echo "$CPPFLAGS" | \
5591 sed -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?[ ]/ /g' \
5592 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?$//g'`
5593
5594 ;;
5595 esac
micky3879b9f5e72025-07-08 18:04:53 -04005596
5597 test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
5598 cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
5599
Steve Kondikae271bc2015-11-15 02:50:53 +01005600 ;;
5601 esac
5602 ;;
5603 (*)
micky3879b9f5e72025-07-08 18:04:53 -04005604
5605 test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
5606 cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
5607
Steve Kondikae271bc2015-11-15 02:50:53 +01005608 ;;
5609 esac
5610 ;;
5611(yes)
Steve Kondikae271bc2015-11-15 02:50:53 +01005612
micky3879b9f5e72025-07-08 18:04:53 -04005613 test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
5614 cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
5615
5616 cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
Steve Kondikae271bc2015-11-15 02:50:53 +01005617
5618 test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
5619 && test -z "${cf_tst_cflags}" \
5620 && cf_fix_cppflags=no
5621 ;;
5622esac
5623done
5624
5625if test -n "$cf_new_cflags" ; then
5626 test -n "$verbose" && echo " add to \$CFLAGS $cf_new_cflags" 1>&6
5627
micky3879b9f5e72025-07-08 18:04:53 -04005628echo "${as_me:-configure}:5628: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
Steve Kondikae271bc2015-11-15 02:50:53 +01005629
micky3879b9f5e72025-07-08 18:04:53 -04005630 test -n "$CFLAGS" && CFLAGS="$CFLAGS "
5631 CFLAGS="${CFLAGS}$cf_new_cflags"
5632
Steve Kondikae271bc2015-11-15 02:50:53 +01005633fi
5634
5635if test -n "$cf_new_cppflags" ; then
5636 test -n "$verbose" && echo " add to \$CPPFLAGS $cf_new_cppflags" 1>&6
5637
micky3879b9f5e72025-07-08 18:04:53 -04005638echo "${as_me:-configure}:5638: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
Steve Kondikae271bc2015-11-15 02:50:53 +01005639
micky3879b9f5e72025-07-08 18:04:53 -04005640 test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
5641 CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
5642
Steve Kondikae271bc2015-11-15 02:50:53 +01005643fi
5644
5645if test -n "$cf_new_extra_cppflags" ; then
5646 test -n "$verbose" && echo " add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6
5647
micky3879b9f5e72025-07-08 18:04:53 -04005648echo "${as_me:-configure}:5648: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
Steve Kondikae271bc2015-11-15 02:50:53 +01005649
micky3879b9f5e72025-07-08 18:04:53 -04005650 test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
5651 EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
5652
Steve Kondikae271bc2015-11-15 02:50:53 +01005653fi
5654
micky3879b9f5e72025-07-08 18:04:53 -04005655done
5656
Steve Kondikae271bc2015-11-15 02:50:53 +01005657fi
5658
5659if test -n "$cf_XOPEN_SOURCE" && test -z "$cf_cv_xopen_source" ; then
micky3879b9f5e72025-07-08 18:04:53 -04005660 echo "$as_me:5660: checking if _XOPEN_SOURCE really is set" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01005661echo $ECHO_N "checking if _XOPEN_SOURCE really is set... $ECHO_C" >&6
micky3879b9f5e72025-07-08 18:04:53 -04005662 cat >"conftest.$ac_ext" <<_ACEOF
5663#line 5663 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +01005664#include "confdefs.h"
5665#include <stdlib.h>
5666int
micky3879b9f5e72025-07-08 18:04:53 -04005667main (void)
Steve Kondikae271bc2015-11-15 02:50:53 +01005668{
5669
5670#ifndef _XOPEN_SOURCE
micky3879b9f5e72025-07-08 18:04:53 -04005671#error _XOPEN_SOURCE is not defined
Steve Kondikae271bc2015-11-15 02:50:53 +01005672#endif
5673 ;
5674 return 0;
5675}
5676_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -04005677rm -f "conftest.$ac_objext"
5678if { (eval echo "$as_me:5678: \"$ac_compile\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01005679 (eval $ac_compile) 2>&5
5680 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -04005681 echo "$as_me:5681: \$? = $ac_status" >&5
5682 (exit "$ac_status"); } &&
5683 { ac_try='test -s "conftest.$ac_objext"'
5684 { (eval echo "$as_me:5684: \"$ac_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01005685 (eval $ac_try) 2>&5
5686 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -04005687 echo "$as_me:5687: \$? = $ac_status" >&5
5688 (exit "$ac_status"); }; }; then
Steve Kondikae271bc2015-11-15 02:50:53 +01005689 cf_XOPEN_SOURCE_set=yes
5690else
5691 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -04005692cat "conftest.$ac_ext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01005693cf_XOPEN_SOURCE_set=no
5694fi
micky3879b9f5e72025-07-08 18:04:53 -04005695rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5696 echo "$as_me:5696: result: $cf_XOPEN_SOURCE_set" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01005697echo "${ECHO_T}$cf_XOPEN_SOURCE_set" >&6
micky3879b9f5e72025-07-08 18:04:53 -04005698 if test "$cf_XOPEN_SOURCE_set" = yes
Steve Kondikae271bc2015-11-15 02:50:53 +01005699 then
micky3879b9f5e72025-07-08 18:04:53 -04005700 cat >"conftest.$ac_ext" <<_ACEOF
5701#line 5701 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +01005702#include "confdefs.h"
5703#include <stdlib.h>
5704int
micky3879b9f5e72025-07-08 18:04:53 -04005705main (void)
Steve Kondikae271bc2015-11-15 02:50:53 +01005706{
5707
5708#if (_XOPEN_SOURCE - 0) < $cf_XOPEN_SOURCE
micky3879b9f5e72025-07-08 18:04:53 -04005709#error (_XOPEN_SOURCE - 0) < $cf_XOPEN_SOURCE
Steve Kondikae271bc2015-11-15 02:50:53 +01005710#endif
5711 ;
5712 return 0;
5713}
5714_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -04005715rm -f "conftest.$ac_objext"
5716if { (eval echo "$as_me:5716: \"$ac_compile\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01005717 (eval $ac_compile) 2>&5
5718 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -04005719 echo "$as_me:5719: \$? = $ac_status" >&5
5720 (exit "$ac_status"); } &&
5721 { ac_try='test -s "conftest.$ac_objext"'
5722 { (eval echo "$as_me:5722: \"$ac_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01005723 (eval $ac_try) 2>&5
5724 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -04005725 echo "$as_me:5725: \$? = $ac_status" >&5
5726 (exit "$ac_status"); }; }; then
Steve Kondikae271bc2015-11-15 02:50:53 +01005727 cf_XOPEN_SOURCE_set_ok=yes
5728else
5729 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -04005730cat "conftest.$ac_ext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01005731cf_XOPEN_SOURCE_set_ok=no
5732fi
micky3879b9f5e72025-07-08 18:04:53 -04005733rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5734 if test "$cf_XOPEN_SOURCE_set_ok" = no
Steve Kondikae271bc2015-11-15 02:50:53 +01005735 then
micky3879b9f5e72025-07-08 18:04:53 -04005736 { echo "$as_me:5736: WARNING: _XOPEN_SOURCE is lower than requested" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01005737echo "$as_me: WARNING: _XOPEN_SOURCE is lower than requested" >&2;}
5738 fi
5739 else
5740
micky3879b9f5e72025-07-08 18:04:53 -04005741echo "$as_me:5741: checking if we should define _XOPEN_SOURCE" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01005742echo $ECHO_N "checking if we should define _XOPEN_SOURCE... $ECHO_C" >&6
5743if test "${cf_cv_xopen_source+set}" = set; then
5744 echo $ECHO_N "(cached) $ECHO_C" >&6
5745else
5746
micky3879b9f5e72025-07-08 18:04:53 -04005747 cat >"conftest.$ac_ext" <<_ACEOF
5748#line 5748 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +01005749#include "confdefs.h"
5750
micky3879b9f5e72025-07-08 18:04:53 -04005751$ac_includes_default
Steve Kondikae271bc2015-11-15 02:50:53 +01005752
5753int
micky3879b9f5e72025-07-08 18:04:53 -04005754main (void)
Steve Kondikae271bc2015-11-15 02:50:53 +01005755{
5756
5757#ifndef _XOPEN_SOURCE
micky3879b9f5e72025-07-08 18:04:53 -04005758#error _XOPEN_SOURCE is not defined
Steve Kondikae271bc2015-11-15 02:50:53 +01005759#endif
micky3879b9f5e72025-07-08 18:04:53 -04005760
Steve Kondikae271bc2015-11-15 02:50:53 +01005761 ;
5762 return 0;
5763}
5764_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -04005765rm -f "conftest.$ac_objext"
5766if { (eval echo "$as_me:5766: \"$ac_compile\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01005767 (eval $ac_compile) 2>&5
5768 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -04005769 echo "$as_me:5769: \$? = $ac_status" >&5
5770 (exit "$ac_status"); } &&
5771 { ac_try='test -s "conftest.$ac_objext"'
5772 { (eval echo "$as_me:5772: \"$ac_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01005773 (eval $ac_try) 2>&5
5774 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -04005775 echo "$as_me:5775: \$? = $ac_status" >&5
5776 (exit "$ac_status"); }; }; then
Steve Kondikae271bc2015-11-15 02:50:53 +01005777 cf_cv_xopen_source=no
5778else
5779 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -04005780cat "conftest.$ac_ext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01005781cf_save="$CPPFLAGS"
micky3879b9f5e72025-07-08 18:04:53 -04005782
5783 test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
5784 CPPFLAGS="${CPPFLAGS}-D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
5785
5786 cat >"conftest.$ac_ext" <<_ACEOF
5787#line 5787 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +01005788#include "confdefs.h"
5789
micky3879b9f5e72025-07-08 18:04:53 -04005790$ac_includes_default
Steve Kondikae271bc2015-11-15 02:50:53 +01005791
5792int
micky3879b9f5e72025-07-08 18:04:53 -04005793main (void)
Steve Kondikae271bc2015-11-15 02:50:53 +01005794{
5795
micky3879b9f5e72025-07-08 18:04:53 -04005796#ifndef _XOPEN_SOURCE
5797#error _XOPEN_SOURCE is not defined
Steve Kondikae271bc2015-11-15 02:50:53 +01005798#endif
micky3879b9f5e72025-07-08 18:04:53 -04005799
Steve Kondikae271bc2015-11-15 02:50:53 +01005800 ;
5801 return 0;
5802}
5803_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -04005804rm -f "conftest.$ac_objext"
5805if { (eval echo "$as_me:5805: \"$ac_compile\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01005806 (eval $ac_compile) 2>&5
5807 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -04005808 echo "$as_me:5808: \$? = $ac_status" >&5
5809 (exit "$ac_status"); } &&
5810 { ac_try='test -s "conftest.$ac_objext"'
5811 { (eval echo "$as_me:5811: \"$ac_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01005812 (eval $ac_try) 2>&5
5813 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -04005814 echo "$as_me:5814: \$? = $ac_status" >&5
5815 (exit "$ac_status"); }; }; then
Steve Kondikae271bc2015-11-15 02:50:53 +01005816 cf_cv_xopen_source=no
5817else
5818 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -04005819cat "conftest.$ac_ext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01005820cf_cv_xopen_source=$cf_XOPEN_SOURCE
5821fi
micky3879b9f5e72025-07-08 18:04:53 -04005822rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5823 CPPFLAGS="$cf_save"
Steve Kondikae271bc2015-11-15 02:50:53 +01005824
5825fi
micky3879b9f5e72025-07-08 18:04:53 -04005826rm -f "conftest.$ac_objext" "conftest.$ac_ext"
Steve Kondikae271bc2015-11-15 02:50:53 +01005827
5828fi
micky3879b9f5e72025-07-08 18:04:53 -04005829echo "$as_me:5829: result: $cf_cv_xopen_source" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01005830echo "${ECHO_T}$cf_cv_xopen_source" >&6
5831
5832if test "$cf_cv_xopen_source" != no ; then
5833
5834CFLAGS=`echo "$CFLAGS" | \
5835 sed -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^ ]*\)\?[ ]/ /g' \
5836 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^ ]*\)\?$//g'`
5837
5838CPPFLAGS=`echo "$CPPFLAGS" | \
5839 sed -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^ ]*\)\?[ ]/ /g' \
5840 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^ ]*\)\?$//g'`
5841
5842 cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source"
5843
micky3879b9f5e72025-07-08 18:04:53 -04005844for cf_add_cflags in $cf_temp_xopen_source
5845do
5846 case "x$cf_add_cflags" in
5847 (x-[DU]*)
5848
5849cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
5850while true
5851do
5852 cf_old_cflag=`echo "x$CFLAGS" | sed -e 's/^.//' -e 's/[ ][ ]*-/ -/g' -e "s%$cf_tmp_cflag\\(=[^ ][^ ]*\\)\?%%" -e 's/^[ ]*//' -e 's%[ ][ ]*-D% -D%g' -e 's%[ ][ ]*-I% -I%g'`
5853 test "$CFLAGS" != "$cf_old_cflag" || break
5854
5855 CFLAGS="$cf_old_cflag"
5856done
5857
5858cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
5859while true
5860do
5861 cf_old_cflag=`echo "x$CPPFLAGS" | sed -e 's/^.//' -e 's/[ ][ ]*-/ -/g' -e "s%$cf_tmp_cflag\\(=[^ ][^ ]*\\)\?%%" -e 's/^[ ]*//' -e 's%[ ][ ]*-D% -D%g' -e 's%[ ][ ]*-I% -I%g'`
5862 test "$CPPFLAGS" != "$cf_old_cflag" || break
5863
5864 CPPFLAGS="$cf_old_cflag"
5865done
5866
5867 ;;
5868 esac
5869
Steve Kondikae271bc2015-11-15 02:50:53 +01005870cf_fix_cppflags=no
5871cf_new_cflags=
5872cf_new_cppflags=
5873cf_new_extra_cppflags=
5874
micky3879b9f5e72025-07-08 18:04:53 -04005875for cf_add_cflags in $cf_add_cflags
Steve Kondikae271bc2015-11-15 02:50:53 +01005876do
micky3879b9f5e72025-07-08 18:04:53 -04005877case "$cf_fix_cppflags" in
Steve Kondikae271bc2015-11-15 02:50:53 +01005878(no)
micky3879b9f5e72025-07-08 18:04:53 -04005879 case "$cf_add_cflags" in
Steve Kondikae271bc2015-11-15 02:50:53 +01005880 (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
micky3879b9f5e72025-07-08 18:04:53 -04005881 case "$cf_add_cflags" in
Steve Kondikae271bc2015-11-15 02:50:53 +01005882 (-D*)
micky3879b9f5e72025-07-08 18:04:53 -04005883 cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
Steve Kondikae271bc2015-11-15 02:50:53 +01005884
5885 test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
5886 && test -z "${cf_tst_cflags}" \
5887 && cf_fix_cppflags=yes
5888
micky3879b9f5e72025-07-08 18:04:53 -04005889 if test "$cf_fix_cppflags" = yes ; then
5890
5891 test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
5892 cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
5893
Steve Kondikae271bc2015-11-15 02:50:53 +01005894 continue
5895 elif test "${cf_tst_cflags}" = "\"'" ; then
micky3879b9f5e72025-07-08 18:04:53 -04005896
5897 test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
5898 cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
5899
Steve Kondikae271bc2015-11-15 02:50:53 +01005900 continue
5901 fi
5902 ;;
5903 esac
5904 case "$CPPFLAGS" in
5905 (*$cf_add_cflags)
5906 ;;
5907 (*)
micky3879b9f5e72025-07-08 18:04:53 -04005908 case "$cf_add_cflags" in
Steve Kondikae271bc2015-11-15 02:50:53 +01005909 (-D*)
5910 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
5911
5912CPPFLAGS=`echo "$CPPFLAGS" | \
5913 sed -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?[ ]/ /g' \
5914 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?$//g'`
5915
5916 ;;
5917 esac
micky3879b9f5e72025-07-08 18:04:53 -04005918
5919 test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
5920 cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
5921
Steve Kondikae271bc2015-11-15 02:50:53 +01005922 ;;
5923 esac
5924 ;;
5925 (*)
micky3879b9f5e72025-07-08 18:04:53 -04005926
5927 test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
5928 cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
5929
Steve Kondikae271bc2015-11-15 02:50:53 +01005930 ;;
5931 esac
5932 ;;
5933(yes)
Steve Kondikae271bc2015-11-15 02:50:53 +01005934
micky3879b9f5e72025-07-08 18:04:53 -04005935 test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
5936 cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
5937
5938 cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
Steve Kondikae271bc2015-11-15 02:50:53 +01005939
5940 test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
5941 && test -z "${cf_tst_cflags}" \
5942 && cf_fix_cppflags=no
5943 ;;
5944esac
5945done
5946
5947if test -n "$cf_new_cflags" ; then
5948
micky3879b9f5e72025-07-08 18:04:53 -04005949 test -n "$CFLAGS" && CFLAGS="$CFLAGS "
5950 CFLAGS="${CFLAGS}$cf_new_cflags"
5951
Steve Kondikae271bc2015-11-15 02:50:53 +01005952fi
5953
5954if test -n "$cf_new_cppflags" ; then
5955
micky3879b9f5e72025-07-08 18:04:53 -04005956 test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
5957 CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
5958
Steve Kondikae271bc2015-11-15 02:50:53 +01005959fi
5960
5961if test -n "$cf_new_extra_cppflags" ; then
5962
micky3879b9f5e72025-07-08 18:04:53 -04005963 test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
5964 EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
5965
Steve Kondikae271bc2015-11-15 02:50:53 +01005966fi
5967
micky3879b9f5e72025-07-08 18:04:53 -04005968done
5969
Steve Kondikae271bc2015-11-15 02:50:53 +01005970fi
5971
5972 fi
5973fi
micky3879b9f5e72025-07-08 18:04:53 -04005974fi # cf_cv_posix_visible
Steve Kondikae271bc2015-11-15 02:50:53 +01005975
micky3879b9f5e72025-07-08 18:04:53 -04005976echo "$as_me:5976: checking for ANSI C header files" >&5
5977echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
5978if test "${ac_cv_header_stdc+set}" = set; then
5979 echo $ECHO_N "(cached) $ECHO_C" >&6
5980else
5981 cat >"conftest.$ac_ext" <<_ACEOF
5982#line 5982 "configure"
5983#include "confdefs.h"
5984#include <stdlib.h>
5985#include <stdarg.h>
5986#include <string.h>
5987#include <float.h>
5988
5989_ACEOF
5990if { (eval echo "$as_me:5990: \"$ac_cpp "conftest.$ac_ext"\"") >&5
5991 (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
5992 ac_status=$?
5993 $EGREP -v '^ *\+' conftest.er1 >conftest.err
5994 rm -f conftest.er1
5995 cat conftest.err >&5
5996 echo "$as_me:5996: \$? = $ac_status" >&5
5997 (exit "$ac_status"); } >/dev/null; then
5998 if test -s conftest.err; then
5999 ac_cpp_err=$ac_c_preproc_warn_flag
6000 else
6001 ac_cpp_err=
6002 fi
6003else
6004 ac_cpp_err=yes
6005fi
6006if test -z "$ac_cpp_err"; then
6007 ac_cv_header_stdc=yes
6008else
6009 echo "$as_me: failed program was:" >&5
6010 cat "conftest.$ac_ext" >&5
6011 ac_cv_header_stdc=no
6012fi
6013rm -f conftest.err "conftest.$ac_ext"
6014
6015if test $ac_cv_header_stdc = yes; then
6016 # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
6017 cat >"conftest.$ac_ext" <<_ACEOF
6018#line 6018 "configure"
6019#include "confdefs.h"
6020#include <string.h>
6021
6022_ACEOF
6023if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
6024 $EGREP "memchr" >/dev/null 2>&1; then
6025 :
6026else
6027 ac_cv_header_stdc=no
6028fi
6029rm -rf conftest*
6030
6031fi
6032
6033if test $ac_cv_header_stdc = yes; then
6034 # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
6035 cat >"conftest.$ac_ext" <<_ACEOF
6036#line 6036 "configure"
6037#include "confdefs.h"
6038#include <stdlib.h>
6039
6040_ACEOF
6041if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
6042 $EGREP "free" >/dev/null 2>&1; then
6043 :
6044else
6045 ac_cv_header_stdc=no
6046fi
6047rm -rf conftest*
6048
6049fi
6050
6051if test $ac_cv_header_stdc = yes; then
6052 # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
6053 if test "$cross_compiling" = yes; then
6054 :
6055else
6056 cat >"conftest.$ac_ext" <<_ACEOF
6057#line 6057 "configure"
6058#include "confdefs.h"
6059#include <ctype.h>
6060#if ((' ' & 0x0FF) == 0x020)
6061# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
6062# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
6063#else
6064# define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
6065 || ('j' <= (c) && (c) <= 'r') \
6066 || ('s' <= (c) && (c) <= 'z'))
6067# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
6068#endif
6069
6070#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
6071int
6072main (void)
6073{
6074 int i;
6075 for (i = 0; i < 256; i++)
6076 if (XOR (islower (i), ISLOWER (i))
6077 || toupper (i) != TOUPPER (i))
6078 $ac_main_return(2);
6079 $ac_main_return (0);
6080}
6081_ACEOF
6082rm -f "conftest$ac_exeext"
6083if { (eval echo "$as_me:6083: \"$ac_link\"") >&5
6084 (eval $ac_link) 2>&5
6085 ac_status=$?
6086 echo "$as_me:6086: \$? = $ac_status" >&5
6087 (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
6088 { (eval echo "$as_me:6088: \"$ac_try\"") >&5
6089 (eval $ac_try) 2>&5
6090 ac_status=$?
6091 echo "$as_me:6091: \$? = $ac_status" >&5
6092 (exit "$ac_status"); }; }; then
6093 :
6094else
6095 echo "$as_me: program exited with status $ac_status" >&5
6096echo "$as_me: failed program was:" >&5
6097cat "conftest.$ac_ext" >&5
6098ac_cv_header_stdc=no
6099fi
6100rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
6101fi
6102fi
6103fi
6104echo "$as_me:6104: result: $ac_cv_header_stdc" >&5
6105echo "${ECHO_T}$ac_cv_header_stdc" >&6
6106if test $ac_cv_header_stdc = yes; then
6107
6108cat >>confdefs.h <<\EOF
6109#define STDC_HEADERS 1
6110EOF
6111
6112fi
6113
6114# On IRIX 5.3, sys/types and inttypes.h are conflicting.
6115
6116for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
6117 inttypes.h stdint.h unistd.h
6118do
6119as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
6120echo "$as_me:6120: checking for $ac_header" >&5
6121echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
6122if eval "test \"\${$as_ac_Header+set}\" = set"; then
6123 echo $ECHO_N "(cached) $ECHO_C" >&6
6124else
6125 cat >"conftest.$ac_ext" <<_ACEOF
6126#line 6126 "configure"
6127#include "confdefs.h"
6128$ac_includes_default
6129#include <$ac_header>
6130_ACEOF
6131rm -f "conftest.$ac_objext"
6132if { (eval echo "$as_me:6132: \"$ac_compile\"") >&5
6133 (eval $ac_compile) 2>&5
6134 ac_status=$?
6135 echo "$as_me:6135: \$? = $ac_status" >&5
6136 (exit "$ac_status"); } &&
6137 { ac_try='test -s "conftest.$ac_objext"'
6138 { (eval echo "$as_me:6138: \"$ac_try\"") >&5
6139 (eval $ac_try) 2>&5
6140 ac_status=$?
6141 echo "$as_me:6141: \$? = $ac_status" >&5
6142 (exit "$ac_status"); }; }; then
6143 eval "$as_ac_Header=yes"
6144else
6145 echo "$as_me: failed program was:" >&5
6146cat "conftest.$ac_ext" >&5
6147eval "$as_ac_Header=no"
6148fi
6149rm -f "conftest.$ac_objext" "conftest.$ac_ext"
6150fi
6151echo "$as_me:6151: result: `eval echo '${'"$as_ac_Header"'}'`" >&5
6152echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6
6153if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then
6154 cat >>confdefs.h <<EOF
6155#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
6156EOF
6157
6158fi
6159done
6160
6161echo "$as_me:6161: checking whether exit is declared" >&5
6162echo $ECHO_N "checking whether exit is declared... $ECHO_C" >&6
6163if test "${ac_cv_have_decl_exit+set}" = set; then
6164 echo $ECHO_N "(cached) $ECHO_C" >&6
6165else
6166 cat >"conftest.$ac_ext" <<_ACEOF
6167#line 6167 "configure"
6168#include "confdefs.h"
6169$ac_includes_default
6170int
6171main (void)
6172{
6173#ifndef exit
6174 (void) exit;
6175#endif
6176
6177 ;
6178 return 0;
6179}
6180_ACEOF
6181rm -f "conftest.$ac_objext"
6182if { (eval echo "$as_me:6182: \"$ac_compile\"") >&5
6183 (eval $ac_compile) 2>&5
6184 ac_status=$?
6185 echo "$as_me:6185: \$? = $ac_status" >&5
6186 (exit "$ac_status"); } &&
6187 { ac_try='test -s "conftest.$ac_objext"'
6188 { (eval echo "$as_me:6188: \"$ac_try\"") >&5
6189 (eval $ac_try) 2>&5
6190 ac_status=$?
6191 echo "$as_me:6191: \$? = $ac_status" >&5
6192 (exit "$ac_status"); }; }; then
6193 ac_cv_have_decl_exit=yes
6194else
6195 echo "$as_me: failed program was:" >&5
6196cat "conftest.$ac_ext" >&5
6197ac_cv_have_decl_exit=no
6198fi
6199rm -f "conftest.$ac_objext" "conftest.$ac_ext"
6200fi
6201echo "$as_me:6201: result: $ac_cv_have_decl_exit" >&5
6202echo "${ECHO_T}$ac_cv_have_decl_exit" >&6
6203
6204echo "$as_me:6204: checking for signal global datatype" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01006205echo $ECHO_N "checking for signal global datatype... $ECHO_C" >&6
6206if test "${cf_cv_sig_atomic_t+set}" = set; then
6207 echo $ECHO_N "(cached) $ECHO_C" >&6
6208else
6209
6210 for cf_type in \
6211 "volatile sig_atomic_t" \
6212 "sig_atomic_t" \
6213 "int"
6214 do
micky3879b9f5e72025-07-08 18:04:53 -04006215 cat >"conftest.$ac_ext" <<_ACEOF
6216#line 6216 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +01006217#include "confdefs.h"
6218
6219#include <sys/types.h>
6220#include <signal.h>
6221#include <stdio.h>
6222
6223extern $cf_type x;
6224$cf_type x;
6225static void handler(int sig)
6226{
micky3879b9f5e72025-07-08 18:04:53 -04006227 (void)sig;
Steve Kondikae271bc2015-11-15 02:50:53 +01006228 x = 5;
6229}
6230int
micky3879b9f5e72025-07-08 18:04:53 -04006231main (void)
Steve Kondikae271bc2015-11-15 02:50:53 +01006232{
6233signal(SIGINT, handler);
6234 x = 1
6235 ;
6236 return 0;
6237}
6238_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -04006239rm -f "conftest.$ac_objext"
6240if { (eval echo "$as_me:6240: \"$ac_compile\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01006241 (eval $ac_compile) 2>&5
6242 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -04006243 echo "$as_me:6243: \$? = $ac_status" >&5
6244 (exit "$ac_status"); } &&
6245 { ac_try='test -s "conftest.$ac_objext"'
6246 { (eval echo "$as_me:6246: \"$ac_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01006247 (eval $ac_try) 2>&5
6248 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -04006249 echo "$as_me:6249: \$? = $ac_status" >&5
6250 (exit "$ac_status"); }; }; then
Steve Kondikae271bc2015-11-15 02:50:53 +01006251 cf_cv_sig_atomic_t=$cf_type
6252else
6253 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -04006254cat "conftest.$ac_ext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01006255cf_cv_sig_atomic_t=no
6256fi
micky3879b9f5e72025-07-08 18:04:53 -04006257rm -f "conftest.$ac_objext" "conftest.$ac_ext"
Steve Kondikae271bc2015-11-15 02:50:53 +01006258 test "$cf_cv_sig_atomic_t" != no && break
6259 done
6260
6261fi
6262
micky3879b9f5e72025-07-08 18:04:53 -04006263echo "$as_me:6263: result: $cf_cv_sig_atomic_t" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01006264echo "${ECHO_T}$cf_cv_sig_atomic_t" >&6
6265test "$cf_cv_sig_atomic_t" != no &&
6266cat >>confdefs.h <<EOF
6267#define SIG_ATOMIC_T $cf_cv_sig_atomic_t
6268EOF
6269
micky3879b9f5e72025-07-08 18:04:53 -04006270# Work around breakage on OS X
6271
6272echo "$as_me:6272: checking if SIGWINCH is defined" >&5
6273echo $ECHO_N "checking if SIGWINCH is defined... $ECHO_C" >&6
6274if test "${cf_cv_define_sigwinch+set}" = set; then
6275 echo $ECHO_N "(cached) $ECHO_C" >&6
6276else
6277
6278 cat >"conftest.$ac_ext" <<_ACEOF
6279#line 6279 "configure"
6280#include "confdefs.h"
6281
6282#include <sys/types.h>
6283#include <sys/signal.h>
6284
6285int
6286main (void)
6287{
6288int x = SIGWINCH; (void)x
6289 ;
6290 return 0;
6291}
6292_ACEOF
6293rm -f "conftest.$ac_objext"
6294if { (eval echo "$as_me:6294: \"$ac_compile\"") >&5
6295 (eval $ac_compile) 2>&5
6296 ac_status=$?
6297 echo "$as_me:6297: \$? = $ac_status" >&5
6298 (exit "$ac_status"); } &&
6299 { ac_try='test -s "conftest.$ac_objext"'
6300 { (eval echo "$as_me:6300: \"$ac_try\"") >&5
6301 (eval $ac_try) 2>&5
6302 ac_status=$?
6303 echo "$as_me:6303: \$? = $ac_status" >&5
6304 (exit "$ac_status"); }; }; then
6305 cf_cv_define_sigwinch=yes
6306else
6307 echo "$as_me: failed program was:" >&5
6308cat "conftest.$ac_ext" >&5
6309cat >"conftest.$ac_ext" <<_ACEOF
6310#line 6310 "configure"
6311#include "confdefs.h"
6312
6313#undef _XOPEN_SOURCE
6314#undef _POSIX_SOURCE
6315#undef _POSIX_C_SOURCE
6316#include <sys/types.h>
6317#include <sys/signal.h>
6318
6319int
6320main (void)
6321{
6322int x = SIGWINCH; (void)x
6323 ;
6324 return 0;
6325}
6326_ACEOF
6327rm -f "conftest.$ac_objext"
6328if { (eval echo "$as_me:6328: \"$ac_compile\"") >&5
6329 (eval $ac_compile) 2>&5
6330 ac_status=$?
6331 echo "$as_me:6331: \$? = $ac_status" >&5
6332 (exit "$ac_status"); } &&
6333 { ac_try='test -s "conftest.$ac_objext"'
6334 { (eval echo "$as_me:6334: \"$ac_try\"") >&5
6335 (eval $ac_try) 2>&5
6336 ac_status=$?
6337 echo "$as_me:6337: \$? = $ac_status" >&5
6338 (exit "$ac_status"); }; }; then
6339 cf_cv_define_sigwinch=maybe
6340else
6341 echo "$as_me: failed program was:" >&5
6342cat "conftest.$ac_ext" >&5
6343cf_cv_define_sigwinch=no
6344fi
6345rm -f "conftest.$ac_objext" "conftest.$ac_ext"
6346
6347fi
6348rm -f "conftest.$ac_objext" "conftest.$ac_ext"
6349
6350fi
6351echo "$as_me:6351: result: $cf_cv_define_sigwinch" >&5
6352echo "${ECHO_T}$cf_cv_define_sigwinch" >&6
6353
6354if test "$cf_cv_define_sigwinch" = maybe ; then
6355echo "$as_me:6355: checking for actual SIGWINCH definition" >&5
6356echo $ECHO_N "checking for actual SIGWINCH definition... $ECHO_C" >&6
6357if test "${cf_cv_fixup_sigwinch+set}" = set; then
6358 echo $ECHO_N "(cached) $ECHO_C" >&6
6359else
6360
6361cf_cv_fixup_sigwinch=unknown
6362cf_sigwinch=32
6363while test "$cf_sigwinch" != 1
6364do
6365 cat >"conftest.$ac_ext" <<_ACEOF
6366#line 6366 "configure"
6367#include "confdefs.h"
6368
6369#undef _XOPEN_SOURCE
6370#undef _POSIX_SOURCE
6371#undef _POSIX_C_SOURCE
6372#include <sys/types.h>
6373#include <sys/signal.h>
6374
6375int
6376main (void)
6377{
6378
6379#if SIGWINCH != $cf_sigwinch
6380#error SIGWINCH is not $cf_sigwinch
6381#endif
6382int x = SIGWINCH; (void)x
6383 ;
6384 return 0;
6385}
6386_ACEOF
6387rm -f "conftest.$ac_objext"
6388if { (eval echo "$as_me:6388: \"$ac_compile\"") >&5
6389 (eval $ac_compile) 2>&5
6390 ac_status=$?
6391 echo "$as_me:6391: \$? = $ac_status" >&5
6392 (exit "$ac_status"); } &&
6393 { ac_try='test -s "conftest.$ac_objext"'
6394 { (eval echo "$as_me:6394: \"$ac_try\"") >&5
6395 (eval $ac_try) 2>&5
6396 ac_status=$?
6397 echo "$as_me:6397: \$? = $ac_status" >&5
6398 (exit "$ac_status"); }; }; then
6399 cf_cv_fixup_sigwinch=$cf_sigwinch
6400 break
6401else
6402 echo "$as_me: failed program was:" >&5
6403cat "conftest.$ac_ext" >&5
6404fi
6405rm -f "conftest.$ac_objext" "conftest.$ac_ext"
6406
6407cf_sigwinch="`expr "$cf_sigwinch" - 1`"
6408done
6409
6410fi
6411echo "$as_me:6411: result: $cf_cv_fixup_sigwinch" >&5
6412echo "${ECHO_T}$cf_cv_fixup_sigwinch" >&6
6413
6414 if test "$cf_cv_fixup_sigwinch" != unknown ; then
6415 CPPFLAGS="$CPPFLAGS -DSIGWINCH=$cf_cv_fixup_sigwinch"
6416 fi
6417fi
6418
6419# Checks for CODESET support.
6420
6421echo "$as_me:6421: checking for nl_langinfo and CODESET" >&5
6422echo $ECHO_N "checking for nl_langinfo and CODESET... $ECHO_C" >&6
6423if test "${am_cv_langinfo_codeset+set}" = set; then
6424 echo $ECHO_N "(cached) $ECHO_C" >&6
6425else
6426 cat >"conftest.$ac_ext" <<_ACEOF
6427#line 6427 "configure"
6428#include "confdefs.h"
6429
6430$ac_includes_default
6431#include <langinfo.h>
6432int
6433main (void)
6434{
6435char* cs = nl_langinfo(CODESET); (void)cs
6436 ;
6437 return 0;
6438}
6439_ACEOF
6440rm -f "conftest.$ac_objext" "conftest$ac_exeext"
6441if { (eval echo "$as_me:6441: \"$ac_link\"") >&5
6442 (eval $ac_link) 2>&5
6443 ac_status=$?
6444 echo "$as_me:6444: \$? = $ac_status" >&5
6445 (exit "$ac_status"); } &&
6446 { ac_try='test -s "conftest$ac_exeext"'
6447 { (eval echo "$as_me:6447: \"$ac_try\"") >&5
6448 (eval $ac_try) 2>&5
6449 ac_status=$?
6450 echo "$as_me:6450: \$? = $ac_status" >&5
6451 (exit "$ac_status"); }; }; then
6452 am_cv_langinfo_codeset=yes
6453else
6454 echo "$as_me: failed program was:" >&5
6455cat "conftest.$ac_ext" >&5
6456am_cv_langinfo_codeset=no
6457fi
6458rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
6459
6460fi
6461echo "$as_me:6461: result: $am_cv_langinfo_codeset" >&5
6462echo "${ECHO_T}$am_cv_langinfo_codeset" >&6
6463 if test "$am_cv_langinfo_codeset" = yes; then
6464
6465cat >>confdefs.h <<\EOF
6466#define HAVE_LANGINFO_CODESET 1
6467EOF
6468
6469 fi
6470
6471echo "$as_me:6471: checking if you want to use pkg-config" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01006472echo $ECHO_N "checking if you want to use pkg-config... $ECHO_C" >&6
6473
6474# Check whether --with-pkg-config or --without-pkg-config was given.
6475if test "${with_pkg_config+set}" = set; then
6476 withval="$with_pkg_config"
6477 cf_pkg_config=$withval
6478else
6479 cf_pkg_config=yes
6480fi;
micky3879b9f5e72025-07-08 18:04:53 -04006481echo "$as_me:6481: result: $cf_pkg_config" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01006482echo "${ECHO_T}$cf_pkg_config" >&6
6483
micky3879b9f5e72025-07-08 18:04:53 -04006484case "$cf_pkg_config" in
Steve Kondikae271bc2015-11-15 02:50:53 +01006485(no)
6486 PKG_CONFIG=none
6487 ;;
6488(yes)
6489
6490if test -n "$ac_tool_prefix"; then
6491 # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
6492set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
micky3879b9f5e72025-07-08 18:04:53 -04006493echo "$as_me:6493: checking for $ac_word" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01006494echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
6495if test "${ac_cv_path_PKG_CONFIG+set}" = set; then
6496 echo $ECHO_N "(cached) $ECHO_C" >&6
6497else
6498 case $PKG_CONFIG in
6499 [\\/]* | ?:[\\/]*)
6500 ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
6501 ;;
6502 *)
6503 ac_save_IFS=$IFS; IFS=$ac_path_separator
6504ac_dummy="$PATH"
6505for ac_dir in $ac_dummy; do
6506 IFS=$ac_save_IFS
6507 test -z "$ac_dir" && ac_dir=.
6508 if $as_executable_p "$ac_dir/$ac_word"; then
6509 ac_cv_path_PKG_CONFIG="$ac_dir/$ac_word"
micky3879b9f5e72025-07-08 18:04:53 -04006510 echo "$as_me:6510: found $ac_dir/$ac_word" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01006511 break
6512fi
6513done
6514
6515 ;;
6516esac
6517fi
6518PKG_CONFIG=$ac_cv_path_PKG_CONFIG
6519
6520if test -n "$PKG_CONFIG"; then
micky3879b9f5e72025-07-08 18:04:53 -04006521 echo "$as_me:6521: result: $PKG_CONFIG" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01006522echo "${ECHO_T}$PKG_CONFIG" >&6
6523else
micky3879b9f5e72025-07-08 18:04:53 -04006524 echo "$as_me:6524: result: no" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01006525echo "${ECHO_T}no" >&6
6526fi
6527
6528fi
6529if test -z "$ac_cv_path_PKG_CONFIG"; then
6530 ac_pt_PKG_CONFIG=$PKG_CONFIG
6531 # Extract the first word of "pkg-config", so it can be a program name with args.
6532set dummy pkg-config; ac_word=$2
micky3879b9f5e72025-07-08 18:04:53 -04006533echo "$as_me:6533: checking for $ac_word" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01006534echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
6535if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then
6536 echo $ECHO_N "(cached) $ECHO_C" >&6
6537else
6538 case $ac_pt_PKG_CONFIG in
6539 [\\/]* | ?:[\\/]*)
6540 ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path.
6541 ;;
6542 *)
6543 ac_save_IFS=$IFS; IFS=$ac_path_separator
6544ac_dummy="$PATH"
6545for ac_dir in $ac_dummy; do
6546 IFS=$ac_save_IFS
6547 test -z "$ac_dir" && ac_dir=.
6548 if $as_executable_p "$ac_dir/$ac_word"; then
6549 ac_cv_path_ac_pt_PKG_CONFIG="$ac_dir/$ac_word"
micky3879b9f5e72025-07-08 18:04:53 -04006550 echo "$as_me:6550: found $ac_dir/$ac_word" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01006551 break
6552fi
6553done
6554
6555 test -z "$ac_cv_path_ac_pt_PKG_CONFIG" && ac_cv_path_ac_pt_PKG_CONFIG="none"
6556 ;;
6557esac
6558fi
6559ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
6560
6561if test -n "$ac_pt_PKG_CONFIG"; then
micky3879b9f5e72025-07-08 18:04:53 -04006562 echo "$as_me:6562: result: $ac_pt_PKG_CONFIG" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01006563echo "${ECHO_T}$ac_pt_PKG_CONFIG" >&6
6564else
micky3879b9f5e72025-07-08 18:04:53 -04006565 echo "$as_me:6565: result: no" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01006566echo "${ECHO_T}no" >&6
6567fi
6568
6569 PKG_CONFIG=$ac_pt_PKG_CONFIG
6570else
6571 PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
6572fi
6573
6574 ;;
6575(*)
6576 PKG_CONFIG=$withval
6577 ;;
6578esac
6579
6580test -z "$PKG_CONFIG" && PKG_CONFIG=none
6581if test "$PKG_CONFIG" != none ; then
6582
6583if test "x$prefix" != xNONE; then
6584 cf_path_syntax="$prefix"
6585else
6586 cf_path_syntax="$ac_default_prefix"
6587fi
6588
6589case ".$PKG_CONFIG" in
6590(.\$\(*\)*|.\'*\'*)
6591 ;;
6592(..|./*|.\\*)
6593 ;;
6594(.[a-zA-Z]:[\\/]*) # OS/2 EMX
6595 ;;
micky3879b9f5e72025-07-08 18:04:53 -04006596(.\$\{*prefix\}*|.\$\{*dir\}*)
Steve Kondikae271bc2015-11-15 02:50:53 +01006597 eval PKG_CONFIG="$PKG_CONFIG"
6598 case ".$PKG_CONFIG" in
6599 (.NONE/*)
micky3879b9f5e72025-07-08 18:04:53 -04006600 PKG_CONFIG=`echo "$PKG_CONFIG" | sed -e s%NONE%$cf_path_syntax%`
Steve Kondikae271bc2015-11-15 02:50:53 +01006601 ;;
6602 esac
6603 ;;
6604(.no|.NONE/*)
micky3879b9f5e72025-07-08 18:04:53 -04006605 PKG_CONFIG=`echo "$PKG_CONFIG" | sed -e s%NONE%$cf_path_syntax%`
Steve Kondikae271bc2015-11-15 02:50:53 +01006606 ;;
6607(*)
micky3879b9f5e72025-07-08 18:04:53 -04006608 { { echo "$as_me:6608: error: expected a pathname, not \"$PKG_CONFIG\"" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01006609echo "$as_me: error: expected a pathname, not \"$PKG_CONFIG\"" >&2;}
6610 { (exit 1); exit 1; }; }
6611 ;;
6612esac
6613
6614elif test "x$cf_pkg_config" != xno ; then
micky3879b9f5e72025-07-08 18:04:53 -04006615 { echo "$as_me:6615: WARNING: pkg-config is not installed" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01006616echo "$as_me: WARNING: pkg-config is not installed" >&2;}
6617fi
6618
micky3879b9f5e72025-07-08 18:04:53 -04006619echo "$as_me:6619: checking if you want to see long compiling messages" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01006620echo $ECHO_N "checking if you want to see long compiling messages... $ECHO_C" >&6
6621
6622# Check whether --enable-echo or --disable-echo was given.
6623if test "${enable_echo+set}" = set; then
6624 enableval="$enable_echo"
6625 test "$enableval" != no && enableval=yes
6626 if test "$enableval" != "yes" ; then
6627
6628 ECHO_LT='--silent'
6629 ECHO_LD='@echo linking $@;'
6630 RULE_CC='@echo compiling $<'
6631 SHOW_CC='@echo compiling $@'
6632 ECHO_CC='@'
6633
6634 else
6635
6636 ECHO_LT=''
6637 ECHO_LD=''
6638 RULE_CC=''
6639 SHOW_CC=''
6640 ECHO_CC=''
6641
6642 fi
6643else
6644 enableval=yes
6645
6646 ECHO_LT=''
6647 ECHO_LD=''
6648 RULE_CC=''
6649 SHOW_CC=''
6650 ECHO_CC=''
6651
6652fi;
micky3879b9f5e72025-07-08 18:04:53 -04006653echo "$as_me:6653: result: $enableval" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01006654echo "${ECHO_T}$enableval" >&6
6655
micky3879b9f5e72025-07-08 18:04:53 -04006656echo "$as_me:6656: checking for ncurses wrap-prefix" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01006657echo $ECHO_N "checking for ncurses wrap-prefix... $ECHO_C" >&6
6658
6659# Check whether --with-ncurses-wrap-prefix or --without-ncurses-wrap-prefix was given.
6660if test "${with_ncurses_wrap_prefix+set}" = set; then
6661 withval="$with_ncurses_wrap_prefix"
6662 NCURSES_WRAP_PREFIX=$withval
6663else
6664 NCURSES_WRAP_PREFIX=_nc_
6665fi;
micky3879b9f5e72025-07-08 18:04:53 -04006666echo "$as_me:6666: result: $NCURSES_WRAP_PREFIX" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01006667echo "${ECHO_T}$NCURSES_WRAP_PREFIX" >&6
6668
micky3879b9f5e72025-07-08 18:04:53 -04006669echo "$as_me:6669: checking if you want to check for wide-character functions" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01006670echo $ECHO_N "checking if you want to check for wide-character functions... $ECHO_C" >&6
6671
6672# Check whether --enable-widec or --disable-widec was given.
6673if test "${enable_widec+set}" = set; then
6674 enableval="$enable_widec"
6675 test "$enableval" != no && enableval=yes
6676 if test "$enableval" != "yes" ; then
6677 cf_enable_widec=no
6678 else
6679 cf_enable_widec=yes
6680 fi
6681else
6682 enableval=yes
6683 cf_enable_widec=yes
6684
6685fi;
micky3879b9f5e72025-07-08 18:04:53 -04006686echo "$as_me:6686: result: $cf_enable_widec" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01006687echo "${ECHO_T}$cf_enable_widec" >&6
6688
micky3879b9f5e72025-07-08 18:04:53 -04006689echo "$as_me:6689: checking for specific curses-directory" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01006690echo $ECHO_N "checking for specific curses-directory... $ECHO_C" >&6
6691
6692# Check whether --with-curses-dir or --without-curses-dir was given.
6693if test "${with_curses_dir+set}" = set; then
6694 withval="$with_curses_dir"
6695 cf_cv_curses_dir=$withval
6696else
6697 cf_cv_curses_dir=no
6698fi;
micky3879b9f5e72025-07-08 18:04:53 -04006699echo "$as_me:6699: result: $cf_cv_curses_dir" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01006700echo "${ECHO_T}$cf_cv_curses_dir" >&6
6701
micky3879b9f5e72025-07-08 18:04:53 -04006702if test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no"
Steve Kondikae271bc2015-11-15 02:50:53 +01006703then
6704
6705if test "x$prefix" != xNONE; then
6706 cf_path_syntax="$prefix"
6707else
6708 cf_path_syntax="$ac_default_prefix"
6709fi
6710
6711case ".$withval" in
6712(.\$\(*\)*|.\'*\'*)
6713 ;;
6714(..|./*|.\\*)
6715 ;;
6716(.[a-zA-Z]:[\\/]*) # OS/2 EMX
6717 ;;
micky3879b9f5e72025-07-08 18:04:53 -04006718(.\$\{*prefix\}*|.\$\{*dir\}*)
Steve Kondikae271bc2015-11-15 02:50:53 +01006719 eval withval="$withval"
6720 case ".$withval" in
6721 (.NONE/*)
micky3879b9f5e72025-07-08 18:04:53 -04006722 withval=`echo "$withval" | sed -e s%NONE%$cf_path_syntax%`
Steve Kondikae271bc2015-11-15 02:50:53 +01006723 ;;
6724 esac
6725 ;;
6726(.no|.NONE/*)
micky3879b9f5e72025-07-08 18:04:53 -04006727 withval=`echo "$withval" | sed -e s%NONE%$cf_path_syntax%`
Steve Kondikae271bc2015-11-15 02:50:53 +01006728 ;;
6729(*)
micky3879b9f5e72025-07-08 18:04:53 -04006730 { { echo "$as_me:6730: error: expected a pathname, not \"$withval\"" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01006731echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;}
6732 { (exit 1); exit 1; }; }
6733 ;;
6734esac
6735
6736 if test -d "$cf_cv_curses_dir"
6737 then
6738
6739if test -n "$cf_cv_curses_dir/include" ; then
6740 for cf_add_incdir in $cf_cv_curses_dir/include
6741 do
micky3879b9f5e72025-07-08 18:04:53 -04006742 while test "$cf_add_incdir" != /usr/include
Steve Kondikae271bc2015-11-15 02:50:53 +01006743 do
micky3879b9f5e72025-07-08 18:04:53 -04006744 if test -d "$cf_add_incdir"
Steve Kondikae271bc2015-11-15 02:50:53 +01006745 then
6746 cf_have_incdir=no
6747 if test -n "$CFLAGS$CPPFLAGS" ; then
6748 # a loop is needed to ensure we can add subdirs of existing dirs
6749 for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
6750 if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
6751 cf_have_incdir=yes; break
6752 fi
6753 done
6754 fi
6755
6756 if test "$cf_have_incdir" = no ; then
6757 if test "$cf_add_incdir" = /usr/local/include ; then
6758 if test "$GCC" = yes
6759 then
6760 cf_save_CPPFLAGS=$CPPFLAGS
micky3879b9f5e72025-07-08 18:04:53 -04006761
6762 test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
6763 CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
6764
6765 cat >"conftest.$ac_ext" <<_ACEOF
6766#line 6766 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +01006767#include "confdefs.h"
6768#include <stdio.h>
6769int
micky3879b9f5e72025-07-08 18:04:53 -04006770main (void)
Steve Kondikae271bc2015-11-15 02:50:53 +01006771{
6772printf("Hello")
6773 ;
6774 return 0;
6775}
6776_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -04006777rm -f "conftest.$ac_objext"
6778if { (eval echo "$as_me:6778: \"$ac_compile\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01006779 (eval $ac_compile) 2>&5
6780 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -04006781 echo "$as_me:6781: \$? = $ac_status" >&5
6782 (exit "$ac_status"); } &&
6783 { ac_try='test -s "conftest.$ac_objext"'
6784 { (eval echo "$as_me:6784: \"$ac_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01006785 (eval $ac_try) 2>&5
6786 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -04006787 echo "$as_me:6787: \$? = $ac_status" >&5
6788 (exit "$ac_status"); }; }; then
Steve Kondikae271bc2015-11-15 02:50:53 +01006789 :
6790else
6791 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -04006792cat "conftest.$ac_ext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01006793cf_have_incdir=yes
6794fi
micky3879b9f5e72025-07-08 18:04:53 -04006795rm -f "conftest.$ac_objext" "conftest.$ac_ext"
Steve Kondikae271bc2015-11-15 02:50:53 +01006796 CPPFLAGS=$cf_save_CPPFLAGS
6797 fi
6798 fi
6799 fi
6800
6801 if test "$cf_have_incdir" = no ; then
6802 test -n "$verbose" && echo " adding $cf_add_incdir to include-path" 1>&6
6803
micky3879b9f5e72025-07-08 18:04:53 -04006804echo "${as_me:-configure}:6804: testing adding $cf_add_incdir to include-path ..." 1>&5
Steve Kondikae271bc2015-11-15 02:50:53 +01006805
6806 CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6807
micky3879b9f5e72025-07-08 18:04:53 -04006808 cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
Steve Kondikae271bc2015-11-15 02:50:53 +01006809 test "$cf_top_incdir" = "$cf_add_incdir" && break
6810 cf_add_incdir="$cf_top_incdir"
6811 else
6812 break
6813 fi
6814 else
6815 break
6816 fi
6817 done
6818 done
6819fi
6820
6821if test -n "$cf_cv_curses_dir/lib" ; then
6822 for cf_add_libdir in $cf_cv_curses_dir/lib
6823 do
micky3879b9f5e72025-07-08 18:04:53 -04006824 if test "$cf_add_libdir" = /usr/lib ; then
Steve Kondikae271bc2015-11-15 02:50:53 +01006825 :
micky3879b9f5e72025-07-08 18:04:53 -04006826 elif test -d "$cf_add_libdir"
Steve Kondikae271bc2015-11-15 02:50:53 +01006827 then
6828 cf_have_libdir=no
6829 if test -n "$LDFLAGS$LIBS" ; then
6830 # a loop is needed to ensure we can add subdirs of existing dirs
6831 for cf_test_libdir in $LDFLAGS $LIBS ; do
6832 if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
6833 cf_have_libdir=yes; break
6834 fi
6835 done
6836 fi
6837 if test "$cf_have_libdir" = no ; then
6838 test -n "$verbose" && echo " adding $cf_add_libdir to library-path" 1>&6
6839
micky3879b9f5e72025-07-08 18:04:53 -04006840echo "${as_me:-configure}:6840: testing adding $cf_add_libdir to library-path ..." 1>&5
Steve Kondikae271bc2015-11-15 02:50:53 +01006841
6842 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
6843 fi
6844 fi
6845 done
6846fi
6847
6848 fi
6849fi
6850
6851cf_cv_screen=curses
6852
micky3879b9f5e72025-07-08 18:04:53 -04006853echo "$as_me:6853: checking for specified curses library type" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01006854echo $ECHO_N "checking for specified curses library type... $ECHO_C" >&6
6855
6856# Check whether --with-screen or --without-screen was given.
6857if test "${with_screen+set}" = set; then
6858 withval="$with_screen"
6859 cf_cv_screen=$withval
6860else
6861
6862# Check whether --with-ncursesw or --without-ncursesw was given.
6863if test "${with_ncursesw+set}" = set; then
6864 withval="$with_ncursesw"
6865 cf_cv_screen=ncursesw
6866else
6867
6868# Check whether --with-ncurses or --without-ncurses was given.
6869if test "${with_ncurses+set}" = set; then
6870 withval="$with_ncurses"
6871 cf_cv_screen=ncurses
6872else
6873
6874# Check whether --with-pdcurses or --without-pdcurses was given.
6875if test "${with_pdcurses+set}" = set; then
6876 withval="$with_pdcurses"
6877 cf_cv_screen=pdcurses
6878else
6879
6880# Check whether --with-curses-colr or --without-curses-colr was given.
6881if test "${with_curses_colr+set}" = set; then
6882 withval="$with_curses_colr"
6883 cf_cv_screen=curses_colr
6884else
6885
6886# Check whether --with-curses-5lib or --without-curses-5lib was given.
6887if test "${with_curses_5lib+set}" = set; then
6888 withval="$with_curses_5lib"
6889 cf_cv_screen=curses_5lib
6890fi;
6891fi;
6892fi;
6893fi;
6894fi;
6895fi;
6896
micky3879b9f5e72025-07-08 18:04:53 -04006897echo "$as_me:6897: result: $cf_cv_screen" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01006898echo "${ECHO_T}$cf_cv_screen" >&6
6899
6900case $cf_cv_screen in
6901(curses|curses_*)
6902
micky3879b9f5e72025-07-08 18:04:53 -04006903echo "$as_me:6903: checking for extra include directories" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01006904echo $ECHO_N "checking for extra include directories... $ECHO_C" >&6
6905if test "${cf_cv_curses_incdir+set}" = set; then
6906 echo $ECHO_N "(cached) $ECHO_C" >&6
6907else
6908
6909cf_cv_curses_incdir=no
micky3879b9f5e72025-07-08 18:04:53 -04006910case "$host_os" in
Steve Kondikae271bc2015-11-15 02:50:53 +01006911(hpux10.*)
6912 if test "x$cf_cv_screen" = "xcurses_colr"
6913 then
6914 test -d /usr/include/curses_colr && \
6915 cf_cv_curses_incdir="-I/usr/include/curses_colr"
6916 fi
6917 ;;
6918(sunos3*|sunos4*)
6919 if test "x$cf_cv_screen" = "xcurses_5lib"
6920 then
6921 test -d /usr/5lib && \
6922 test -d /usr/5include && \
6923 cf_cv_curses_incdir="-I/usr/5include"
6924 fi
6925 ;;
6926esac
6927
6928fi
micky3879b9f5e72025-07-08 18:04:53 -04006929echo "$as_me:6929: result: $cf_cv_curses_incdir" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01006930echo "${ECHO_T}$cf_cv_curses_incdir" >&6
micky3879b9f5e72025-07-08 18:04:53 -04006931if test "$cf_cv_curses_incdir" != no
6932then
Steve Kondikae271bc2015-11-15 02:50:53 +01006933
micky3879b9f5e72025-07-08 18:04:53 -04006934 test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
6935 CPPFLAGS="${CPPFLAGS}$cf_cv_curses_incdir"
6936
6937fi
6938
6939echo "$as_me:6939: checking if we have identified curses headers" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01006940echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
6941if test "${cf_cv_ncurses_header+set}" = set; then
6942 echo $ECHO_N "(cached) $ECHO_C" >&6
6943else
6944
6945cf_cv_ncurses_header=none
6946for cf_header in \
6947 ncurses.h \
6948 curses.h ncurses/ncurses.h ncurses/curses.h
6949do
micky3879b9f5e72025-07-08 18:04:53 -04006950cat >"conftest.$ac_ext" <<_ACEOF
6951#line 6951 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +01006952#include "confdefs.h"
6953#include <${cf_header}>
6954int
micky3879b9f5e72025-07-08 18:04:53 -04006955main (void)
Steve Kondikae271bc2015-11-15 02:50:53 +01006956{
micky3879b9f5e72025-07-08 18:04:53 -04006957initscr(); endwin()
Steve Kondikae271bc2015-11-15 02:50:53 +01006958 ;
6959 return 0;
6960}
6961_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -04006962rm -f "conftest.$ac_objext"
6963if { (eval echo "$as_me:6963: \"$ac_compile\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01006964 (eval $ac_compile) 2>&5
6965 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -04006966 echo "$as_me:6966: \$? = $ac_status" >&5
6967 (exit "$ac_status"); } &&
6968 { ac_try='test -s "conftest.$ac_objext"'
6969 { (eval echo "$as_me:6969: \"$ac_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01006970 (eval $ac_try) 2>&5
6971 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -04006972 echo "$as_me:6972: \$? = $ac_status" >&5
6973 (exit "$ac_status"); }; }; then
Steve Kondikae271bc2015-11-15 02:50:53 +01006974 cf_cv_ncurses_header=$cf_header; break
6975else
6976 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -04006977cat "conftest.$ac_ext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01006978fi
micky3879b9f5e72025-07-08 18:04:53 -04006979rm -f "conftest.$ac_objext" "conftest.$ac_ext"
Steve Kondikae271bc2015-11-15 02:50:53 +01006980done
6981
6982fi
micky3879b9f5e72025-07-08 18:04:53 -04006983echo "$as_me:6983: result: $cf_cv_ncurses_header" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01006984echo "${ECHO_T}$cf_cv_ncurses_header" >&6
6985
6986if test "$cf_cv_ncurses_header" = none ; then
micky3879b9f5e72025-07-08 18:04:53 -04006987 { { echo "$as_me:6987: error: No curses header-files found" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01006988echo "$as_me: error: No curses header-files found" >&2;}
6989 { (exit 1); exit 1; }; }
6990fi
6991
6992# cheat, to get the right #define's for HAVE_NCURSES_H, etc.
6993
6994for ac_header in $cf_cv_ncurses_header
6995do
6996as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
micky3879b9f5e72025-07-08 18:04:53 -04006997echo "$as_me:6997: checking for $ac_header" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01006998echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
6999if eval "test \"\${$as_ac_Header+set}\" = set"; then
7000 echo $ECHO_N "(cached) $ECHO_C" >&6
7001else
micky3879b9f5e72025-07-08 18:04:53 -04007002 cat >"conftest.$ac_ext" <<_ACEOF
7003#line 7003 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +01007004#include "confdefs.h"
7005#include <$ac_header>
7006_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -04007007if { (eval echo "$as_me:7007: \"$ac_cpp "conftest.$ac_ext"\"") >&5
7008 (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
Steve Kondikae271bc2015-11-15 02:50:53 +01007009 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -04007010 $EGREP -v '^ *\+' conftest.er1 >conftest.err
Steve Kondikae271bc2015-11-15 02:50:53 +01007011 rm -f conftest.er1
7012 cat conftest.err >&5
micky3879b9f5e72025-07-08 18:04:53 -04007013 echo "$as_me:7013: \$? = $ac_status" >&5
7014 (exit "$ac_status"); } >/dev/null; then
Steve Kondikae271bc2015-11-15 02:50:53 +01007015 if test -s conftest.err; then
7016 ac_cpp_err=$ac_c_preproc_warn_flag
7017 else
7018 ac_cpp_err=
7019 fi
7020else
7021 ac_cpp_err=yes
7022fi
7023if test -z "$ac_cpp_err"; then
7024 eval "$as_ac_Header=yes"
7025else
7026 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -04007027 cat "conftest.$ac_ext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01007028 eval "$as_ac_Header=no"
7029fi
micky3879b9f5e72025-07-08 18:04:53 -04007030rm -f conftest.err "conftest.$ac_ext"
Steve Kondikae271bc2015-11-15 02:50:53 +01007031fi
micky3879b9f5e72025-07-08 18:04:53 -04007032echo "$as_me:7032: result: `eval echo '${'"$as_ac_Header"'}'`" >&5
7033echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6
7034if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then
Steve Kondikae271bc2015-11-15 02:50:53 +01007035 cat >>confdefs.h <<EOF
7036#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
7037EOF
7038
7039fi
7040done
7041
micky3879b9f5e72025-07-08 18:04:53 -04007042echo "$as_me:7042: checking for terminfo header" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01007043echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
7044if test "${cf_cv_term_header+set}" = set; then
7045 echo $ECHO_N "(cached) $ECHO_C" >&6
7046else
7047
micky3879b9f5e72025-07-08 18:04:53 -04007048case "${cf_cv_ncurses_header}" in
Steve Kondikae271bc2015-11-15 02:50:53 +01007049(*/ncurses.h|*/ncursesw.h)
7050 cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
7051 ;;
7052(*)
7053 cf_term_header=term.h
7054 ;;
7055esac
7056
7057for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
7058do
micky3879b9f5e72025-07-08 18:04:53 -04007059cat >"conftest.$ac_ext" <<_ACEOF
7060#line 7060 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +01007061#include "confdefs.h"
7062#include <stdio.h>
7063#include <${cf_cv_ncurses_header:-curses.h}>
7064#include <$cf_test>
7065
7066int
micky3879b9f5e72025-07-08 18:04:53 -04007067main (void)
Steve Kondikae271bc2015-11-15 02:50:53 +01007068{
micky3879b9f5e72025-07-08 18:04:53 -04007069int x = auto_left_margin; (void)x
Steve Kondikae271bc2015-11-15 02:50:53 +01007070 ;
7071 return 0;
7072}
7073_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -04007074rm -f "conftest.$ac_objext"
7075if { (eval echo "$as_me:7075: \"$ac_compile\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01007076 (eval $ac_compile) 2>&5
7077 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -04007078 echo "$as_me:7078: \$? = $ac_status" >&5
7079 (exit "$ac_status"); } &&
7080 { ac_try='test -s "conftest.$ac_objext"'
7081 { (eval echo "$as_me:7081: \"$ac_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01007082 (eval $ac_try) 2>&5
7083 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -04007084 echo "$as_me:7084: \$? = $ac_status" >&5
7085 (exit "$ac_status"); }; }; then
Steve Kondikae271bc2015-11-15 02:50:53 +01007086
7087 cf_cv_term_header="$cf_test"
7088else
7089 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -04007090cat "conftest.$ac_ext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01007091
7092 cf_cv_term_header=unknown
7093
7094fi
micky3879b9f5e72025-07-08 18:04:53 -04007095rm -f "conftest.$ac_objext" "conftest.$ac_ext"
Steve Kondikae271bc2015-11-15 02:50:53 +01007096 test "$cf_cv_term_header" != unknown && break
7097done
7098
7099fi
micky3879b9f5e72025-07-08 18:04:53 -04007100echo "$as_me:7100: result: $cf_cv_term_header" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01007101echo "${ECHO_T}$cf_cv_term_header" >&6
7102
7103# Set definitions to allow ifdef'ing to accommodate subdirectories
7104
micky3879b9f5e72025-07-08 18:04:53 -04007105case "$cf_cv_term_header" in
Steve Kondikae271bc2015-11-15 02:50:53 +01007106(*term.h)
7107
7108cat >>confdefs.h <<\EOF
7109#define HAVE_TERM_H 1
7110EOF
7111
7112 ;;
7113esac
7114
micky3879b9f5e72025-07-08 18:04:53 -04007115case "$cf_cv_term_header" in
Steve Kondikae271bc2015-11-15 02:50:53 +01007116(ncurses/term.h)
7117
7118cat >>confdefs.h <<\EOF
7119#define HAVE_NCURSES_TERM_H 1
7120EOF
7121
7122 ;;
7123(ncursesw/term.h)
7124
7125cat >>confdefs.h <<\EOF
7126#define HAVE_NCURSESW_TERM_H 1
7127EOF
7128
7129 ;;
7130esac
7131
micky3879b9f5e72025-07-08 18:04:53 -04007132echo "$as_me:7132: checking for ncurses version" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01007133echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
7134if test "${cf_cv_ncurses_version+set}" = set; then
7135 echo $ECHO_N "(cached) $ECHO_C" >&6
7136else
7137
7138 cf_cv_ncurses_version=no
7139 cf_tempfile=out$$
micky3879b9f5e72025-07-08 18:04:53 -04007140 rm -f "$cf_tempfile"
Steve Kondikae271bc2015-11-15 02:50:53 +01007141 if test "$cross_compiling" = yes; then
7142
7143 # This will not work if the preprocessor splits the line after the
7144 # Autoconf token. The 'unproto' program does that.
micky3879b9f5e72025-07-08 18:04:53 -04007145 cat > "conftest.$ac_ext" <<EOF
Steve Kondikae271bc2015-11-15 02:50:53 +01007146#include <${cf_cv_ncurses_header:-curses.h}>
7147#undef Autoconf
7148#ifdef NCURSES_VERSION
7149Autoconf NCURSES_VERSION
7150#else
7151#ifdef __NCURSES_H
7152Autoconf "old"
7153#endif
7154;
7155#endif
7156EOF
7157 cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
micky3879b9f5e72025-07-08 18:04:53 -04007158 { (eval echo "$as_me:7158: \"$cf_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01007159 (eval $cf_try) 2>&5
7160 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -04007161 echo "$as_me:7161: \$? = $ac_status" >&5
7162 (exit "$ac_status"); }
Steve Kondikae271bc2015-11-15 02:50:53 +01007163 if test -f conftest.out ; then
micky3879b9f5e72025-07-08 18:04:53 -04007164 cf_out=`sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%' conftest.out`
Steve Kondikae271bc2015-11-15 02:50:53 +01007165 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
7166 rm -f conftest.out
7167 fi
7168
7169else
micky3879b9f5e72025-07-08 18:04:53 -04007170 cat >"conftest.$ac_ext" <<_ACEOF
7171#line 7171 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +01007172#include "confdefs.h"
7173
micky3879b9f5e72025-07-08 18:04:53 -04007174$ac_includes_default
7175
Steve Kondikae271bc2015-11-15 02:50:53 +01007176#include <${cf_cv_ncurses_header:-curses.h}>
micky3879b9f5e72025-07-08 18:04:53 -04007177
7178int main(void)
Steve Kondikae271bc2015-11-15 02:50:53 +01007179{
7180 FILE *fp = fopen("$cf_tempfile", "w");
7181#ifdef NCURSES_VERSION
7182# ifdef NCURSES_VERSION_PATCH
micky3879b9f5e72025-07-08 18:04:53 -04007183 fprintf(fp, "%s.%d\\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
Steve Kondikae271bc2015-11-15 02:50:53 +01007184# else
micky3879b9f5e72025-07-08 18:04:53 -04007185 fprintf(fp, "%s\\n", NCURSES_VERSION);
Steve Kondikae271bc2015-11-15 02:50:53 +01007186# endif
7187#else
7188# ifdef __NCURSES_H
micky3879b9f5e72025-07-08 18:04:53 -04007189 fprintf(fp, "old\\n");
Steve Kondikae271bc2015-11-15 02:50:53 +01007190# else
micky3879b9f5e72025-07-08 18:04:53 -04007191 #error expected ncurses header to define __NCURSES_H
Steve Kondikae271bc2015-11-15 02:50:53 +01007192# endif
7193#endif
7194 ${cf_cv_main_return:-return}(0);
7195}
7196_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -04007197rm -f "conftest$ac_exeext"
7198if { (eval echo "$as_me:7198: \"$ac_link\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01007199 (eval $ac_link) 2>&5
7200 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -04007201 echo "$as_me:7201: \$? = $ac_status" >&5
7202 (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
7203 { (eval echo "$as_me:7203: \"$ac_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01007204 (eval $ac_try) 2>&5
7205 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -04007206 echo "$as_me:7206: \$? = $ac_status" >&5
7207 (exit "$ac_status"); }; }; then
Steve Kondikae271bc2015-11-15 02:50:53 +01007208
7209 cf_cv_ncurses_version=`cat $cf_tempfile`
7210else
7211 echo "$as_me: program exited with status $ac_status" >&5
7212echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -04007213cat "conftest.$ac_ext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01007214fi
micky3879b9f5e72025-07-08 18:04:53 -04007215rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
Steve Kondikae271bc2015-11-15 02:50:53 +01007216fi
micky3879b9f5e72025-07-08 18:04:53 -04007217 rm -f "$cf_tempfile"
Steve Kondikae271bc2015-11-15 02:50:53 +01007218
7219fi
micky3879b9f5e72025-07-08 18:04:53 -04007220echo "$as_me:7220: result: $cf_cv_ncurses_version" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01007221echo "${ECHO_T}$cf_cv_ncurses_version" >&6
7222test "$cf_cv_ncurses_version" = no ||
7223cat >>confdefs.h <<\EOF
7224#define NCURSES 1
7225EOF
7226
micky3879b9f5e72025-07-08 18:04:53 -04007227echo "$as_me:7227: checking if we have identified curses libraries" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01007228echo $ECHO_N "checking if we have identified curses libraries... $ECHO_C" >&6
micky3879b9f5e72025-07-08 18:04:53 -04007229cat >"conftest.$ac_ext" <<_ACEOF
7230#line 7230 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +01007231#include "confdefs.h"
7232#include <${cf_cv_ncurses_header:-curses.h}>
7233int
micky3879b9f5e72025-07-08 18:04:53 -04007234main (void)
Steve Kondikae271bc2015-11-15 02:50:53 +01007235{
micky3879b9f5e72025-07-08 18:04:53 -04007236initscr(); endwin()
Steve Kondikae271bc2015-11-15 02:50:53 +01007237 ;
7238 return 0;
7239}
7240_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -04007241rm -f "conftest.$ac_objext" "conftest$ac_exeext"
7242if { (eval echo "$as_me:7242: \"$ac_link\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01007243 (eval $ac_link) 2>&5
7244 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -04007245 echo "$as_me:7245: \$? = $ac_status" >&5
7246 (exit "$ac_status"); } &&
7247 { ac_try='test -s "conftest$ac_exeext"'
7248 { (eval echo "$as_me:7248: \"$ac_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01007249 (eval $ac_try) 2>&5
7250 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -04007251 echo "$as_me:7251: \$? = $ac_status" >&5
7252 (exit "$ac_status"); }; }; then
Steve Kondikae271bc2015-11-15 02:50:53 +01007253 cf_result=yes
7254else
7255 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -04007256cat "conftest.$ac_ext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01007257cf_result=no
7258fi
micky3879b9f5e72025-07-08 18:04:53 -04007259rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
7260echo "$as_me:7260: result: $cf_result" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01007261echo "${ECHO_T}$cf_result" >&6
7262
7263if test "$cf_result" = no ; then
micky3879b9f5e72025-07-08 18:04:53 -04007264case "$host_os" in
Steve Kondikae271bc2015-11-15 02:50:53 +01007265(freebsd*)
micky3879b9f5e72025-07-08 18:04:53 -04007266 echo "$as_me:7266: checking for tgoto in -lmytinfo" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01007267echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
7268if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
7269 echo $ECHO_N "(cached) $ECHO_C" >&6
7270else
7271 ac_check_lib_save_LIBS=$LIBS
7272LIBS="-lmytinfo $LIBS"
micky3879b9f5e72025-07-08 18:04:53 -04007273cat >"conftest.$ac_ext" <<_ACEOF
7274#line 7274 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +01007275#include "confdefs.h"
7276
7277/* Override any gcc2 internal prototype to avoid an error. */
7278#ifdef __cplusplus
7279extern "C"
7280#endif
7281/* We use char because int might match the return type of a gcc2
7282 builtin and then its argument prototype would still apply. */
micky3879b9f5e72025-07-08 18:04:53 -04007283char tgoto (void);
Steve Kondikae271bc2015-11-15 02:50:53 +01007284int
micky3879b9f5e72025-07-08 18:04:53 -04007285main (void)
Steve Kondikae271bc2015-11-15 02:50:53 +01007286{
7287tgoto ();
7288 ;
7289 return 0;
7290}
7291_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -04007292rm -f "conftest.$ac_objext" "conftest$ac_exeext"
7293if { (eval echo "$as_me:7293: \"$ac_link\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01007294 (eval $ac_link) 2>&5
7295 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -04007296 echo "$as_me:7296: \$? = $ac_status" >&5
7297 (exit "$ac_status"); } &&
7298 { ac_try='test -s "conftest$ac_exeext"'
7299 { (eval echo "$as_me:7299: \"$ac_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01007300 (eval $ac_try) 2>&5
7301 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -04007302 echo "$as_me:7302: \$? = $ac_status" >&5
7303 (exit "$ac_status"); }; }; then
Steve Kondikae271bc2015-11-15 02:50:53 +01007304 ac_cv_lib_mytinfo_tgoto=yes
7305else
7306 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -04007307cat "conftest.$ac_ext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01007308ac_cv_lib_mytinfo_tgoto=no
7309fi
micky3879b9f5e72025-07-08 18:04:53 -04007310rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
Steve Kondikae271bc2015-11-15 02:50:53 +01007311LIBS=$ac_check_lib_save_LIBS
7312fi
micky3879b9f5e72025-07-08 18:04:53 -04007313echo "$as_me:7313: result: $ac_cv_lib_mytinfo_tgoto" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01007314echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
micky3879b9f5e72025-07-08 18:04:53 -04007315if test "$ac_cv_lib_mytinfo_tgoto" = yes; then
Steve Kondikae271bc2015-11-15 02:50:53 +01007316
micky3879b9f5e72025-07-08 18:04:53 -04007317cf_add_libs="$LIBS"
7318# reverse order
7319cf_add_0lib=
7320for cf_add_1lib in -lmytinfo; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
7321# filter duplicates
7322for cf_add_1lib in $cf_add_0lib; do
7323 for cf_add_2lib in $cf_add_libs; do
7324 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
Steve Kondikae271bc2015-11-15 02:50:53 +01007325 cf_add_1lib=
7326 break
7327 fi
7328 done
micky3879b9f5e72025-07-08 18:04:53 -04007329 test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
Steve Kondikae271bc2015-11-15 02:50:53 +01007330done
7331LIBS="$cf_add_libs"
7332
7333fi
7334
7335 ;;
7336(hpux10.*)
7337 # Looking at HPUX 10.20, the Hcurses library is the oldest (1997), cur_colr
7338 # next (1998), and xcurses "newer" (2000). There is no header file for
7339 # Hcurses; the subdirectory curses_colr has the headers (curses.h and
7340 # term.h) for cur_colr
7341 if test "x$cf_cv_screen" = "xcurses_colr"
7342 then
micky3879b9f5e72025-07-08 18:04:53 -04007343 echo "$as_me:7343: checking for initscr in -lcur_colr" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01007344echo $ECHO_N "checking for initscr in -lcur_colr... $ECHO_C" >&6
7345if test "${ac_cv_lib_cur_colr_initscr+set}" = set; then
7346 echo $ECHO_N "(cached) $ECHO_C" >&6
7347else
7348 ac_check_lib_save_LIBS=$LIBS
7349LIBS="-lcur_colr $LIBS"
micky3879b9f5e72025-07-08 18:04:53 -04007350cat >"conftest.$ac_ext" <<_ACEOF
7351#line 7351 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +01007352#include "confdefs.h"
7353
7354/* Override any gcc2 internal prototype to avoid an error. */
7355#ifdef __cplusplus
7356extern "C"
7357#endif
7358/* We use char because int might match the return type of a gcc2
7359 builtin and then its argument prototype would still apply. */
micky3879b9f5e72025-07-08 18:04:53 -04007360char initscr (void);
Steve Kondikae271bc2015-11-15 02:50:53 +01007361int
micky3879b9f5e72025-07-08 18:04:53 -04007362main (void)
Steve Kondikae271bc2015-11-15 02:50:53 +01007363{
7364initscr ();
7365 ;
7366 return 0;
7367}
7368_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -04007369rm -f "conftest.$ac_objext" "conftest$ac_exeext"
7370if { (eval echo "$as_me:7370: \"$ac_link\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01007371 (eval $ac_link) 2>&5
7372 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -04007373 echo "$as_me:7373: \$? = $ac_status" >&5
7374 (exit "$ac_status"); } &&
7375 { ac_try='test -s "conftest$ac_exeext"'
7376 { (eval echo "$as_me:7376: \"$ac_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01007377 (eval $ac_try) 2>&5
7378 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -04007379 echo "$as_me:7379: \$? = $ac_status" >&5
7380 (exit "$ac_status"); }; }; then
Steve Kondikae271bc2015-11-15 02:50:53 +01007381 ac_cv_lib_cur_colr_initscr=yes
7382else
7383 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -04007384cat "conftest.$ac_ext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01007385ac_cv_lib_cur_colr_initscr=no
7386fi
micky3879b9f5e72025-07-08 18:04:53 -04007387rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
Steve Kondikae271bc2015-11-15 02:50:53 +01007388LIBS=$ac_check_lib_save_LIBS
7389fi
micky3879b9f5e72025-07-08 18:04:53 -04007390echo "$as_me:7390: result: $ac_cv_lib_cur_colr_initscr" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01007391echo "${ECHO_T}$ac_cv_lib_cur_colr_initscr" >&6
micky3879b9f5e72025-07-08 18:04:53 -04007392if test "$ac_cv_lib_cur_colr_initscr" = yes; then
Steve Kondikae271bc2015-11-15 02:50:53 +01007393
micky3879b9f5e72025-07-08 18:04:53 -04007394cf_add_libs="$LIBS"
7395# reverse order
7396cf_add_0lib=
7397for cf_add_1lib in -lcur_colr; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
7398# filter duplicates
7399for cf_add_1lib in $cf_add_0lib; do
7400 for cf_add_2lib in $cf_add_libs; do
7401 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
Steve Kondikae271bc2015-11-15 02:50:53 +01007402 cf_add_1lib=
7403 break
7404 fi
7405 done
micky3879b9f5e72025-07-08 18:04:53 -04007406 test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
Steve Kondikae271bc2015-11-15 02:50:53 +01007407done
7408LIBS="$cf_add_libs"
7409
7410 ac_cv_func_initscr=yes
7411
7412else
7413
micky3879b9f5e72025-07-08 18:04:53 -04007414 echo "$as_me:7414: checking for initscr in -lHcurses" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01007415echo $ECHO_N "checking for initscr in -lHcurses... $ECHO_C" >&6
7416if test "${ac_cv_lib_Hcurses_initscr+set}" = set; then
7417 echo $ECHO_N "(cached) $ECHO_C" >&6
7418else
7419 ac_check_lib_save_LIBS=$LIBS
7420LIBS="-lHcurses $LIBS"
micky3879b9f5e72025-07-08 18:04:53 -04007421cat >"conftest.$ac_ext" <<_ACEOF
7422#line 7422 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +01007423#include "confdefs.h"
7424
7425/* Override any gcc2 internal prototype to avoid an error. */
7426#ifdef __cplusplus
7427extern "C"
7428#endif
7429/* We use char because int might match the return type of a gcc2
7430 builtin and then its argument prototype would still apply. */
micky3879b9f5e72025-07-08 18:04:53 -04007431char initscr (void);
Steve Kondikae271bc2015-11-15 02:50:53 +01007432int
micky3879b9f5e72025-07-08 18:04:53 -04007433main (void)
Steve Kondikae271bc2015-11-15 02:50:53 +01007434{
7435initscr ();
7436 ;
7437 return 0;
7438}
7439_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -04007440rm -f "conftest.$ac_objext" "conftest$ac_exeext"
7441if { (eval echo "$as_me:7441: \"$ac_link\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01007442 (eval $ac_link) 2>&5
7443 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -04007444 echo "$as_me:7444: \$? = $ac_status" >&5
7445 (exit "$ac_status"); } &&
7446 { ac_try='test -s "conftest$ac_exeext"'
7447 { (eval echo "$as_me:7447: \"$ac_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01007448 (eval $ac_try) 2>&5
7449 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -04007450 echo "$as_me:7450: \$? = $ac_status" >&5
7451 (exit "$ac_status"); }; }; then
Steve Kondikae271bc2015-11-15 02:50:53 +01007452 ac_cv_lib_Hcurses_initscr=yes
7453else
7454 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -04007455cat "conftest.$ac_ext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01007456ac_cv_lib_Hcurses_initscr=no
7457fi
micky3879b9f5e72025-07-08 18:04:53 -04007458rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
Steve Kondikae271bc2015-11-15 02:50:53 +01007459LIBS=$ac_check_lib_save_LIBS
7460fi
micky3879b9f5e72025-07-08 18:04:53 -04007461echo "$as_me:7461: result: $ac_cv_lib_Hcurses_initscr" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01007462echo "${ECHO_T}$ac_cv_lib_Hcurses_initscr" >&6
micky3879b9f5e72025-07-08 18:04:53 -04007463if test "$ac_cv_lib_Hcurses_initscr" = yes; then
Steve Kondikae271bc2015-11-15 02:50:53 +01007464
7465 # HP's header uses __HP_CURSES, but user claims _HP_CURSES.
7466
micky3879b9f5e72025-07-08 18:04:53 -04007467cf_add_libs="$LIBS"
7468# reverse order
7469cf_add_0lib=
7470for cf_add_1lib in -lHcurses; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
7471# filter duplicates
7472for cf_add_1lib in $cf_add_0lib; do
7473 for cf_add_2lib in $cf_add_libs; do
7474 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
Steve Kondikae271bc2015-11-15 02:50:53 +01007475 cf_add_1lib=
7476 break
7477 fi
7478 done
micky3879b9f5e72025-07-08 18:04:53 -04007479 test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
Steve Kondikae271bc2015-11-15 02:50:53 +01007480done
7481LIBS="$cf_add_libs"
7482
micky3879b9f5e72025-07-08 18:04:53 -04007483 test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
7484 CPPFLAGS="${CPPFLAGS}-D__HP_CURSES -D_HP_CURSES"
7485
Steve Kondikae271bc2015-11-15 02:50:53 +01007486 ac_cv_func_initscr=yes
7487
7488fi
7489
7490fi
7491
7492 fi
7493 ;;
7494(linux*)
7495 case `arch 2>/dev/null` in
7496 (x86_64)
7497 if test -d /lib64
7498 then
7499
7500if test -n "/lib64" ; then
7501 for cf_add_libdir in /lib64
7502 do
micky3879b9f5e72025-07-08 18:04:53 -04007503 if test "$cf_add_libdir" = /usr/lib ; then
Steve Kondikae271bc2015-11-15 02:50:53 +01007504 :
micky3879b9f5e72025-07-08 18:04:53 -04007505 elif test -d "$cf_add_libdir"
Steve Kondikae271bc2015-11-15 02:50:53 +01007506 then
7507 cf_have_libdir=no
7508 if test -n "$LDFLAGS$LIBS" ; then
7509 # a loop is needed to ensure we can add subdirs of existing dirs
7510 for cf_test_libdir in $LDFLAGS $LIBS ; do
7511 if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
7512 cf_have_libdir=yes; break
7513 fi
7514 done
7515 fi
7516 if test "$cf_have_libdir" = no ; then
7517 test -n "$verbose" && echo " adding $cf_add_libdir to library-path" 1>&6
7518
micky3879b9f5e72025-07-08 18:04:53 -04007519echo "${as_me:-configure}:7519: testing adding $cf_add_libdir to library-path ..." 1>&5
Steve Kondikae271bc2015-11-15 02:50:53 +01007520
7521 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
7522 fi
7523 fi
7524 done
7525fi
7526
7527 else
7528
7529if test -n "/lib" ; then
7530 for cf_add_libdir in /lib
7531 do
micky3879b9f5e72025-07-08 18:04:53 -04007532 if test "$cf_add_libdir" = /usr/lib ; then
Steve Kondikae271bc2015-11-15 02:50:53 +01007533 :
micky3879b9f5e72025-07-08 18:04:53 -04007534 elif test -d "$cf_add_libdir"
Steve Kondikae271bc2015-11-15 02:50:53 +01007535 then
7536 cf_have_libdir=no
7537 if test -n "$LDFLAGS$LIBS" ; then
7538 # a loop is needed to ensure we can add subdirs of existing dirs
7539 for cf_test_libdir in $LDFLAGS $LIBS ; do
7540 if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
7541 cf_have_libdir=yes; break
7542 fi
7543 done
7544 fi
7545 if test "$cf_have_libdir" = no ; then
7546 test -n "$verbose" && echo " adding $cf_add_libdir to library-path" 1>&6
7547
micky3879b9f5e72025-07-08 18:04:53 -04007548echo "${as_me:-configure}:7548: testing adding $cf_add_libdir to library-path ..." 1>&5
Steve Kondikae271bc2015-11-15 02:50:53 +01007549
7550 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
7551 fi
7552 fi
7553 done
7554fi
7555
7556 fi
7557 ;;
7558 (*)
7559
7560if test -n "/lib" ; then
7561 for cf_add_libdir in /lib
7562 do
micky3879b9f5e72025-07-08 18:04:53 -04007563 if test "$cf_add_libdir" = /usr/lib ; then
Steve Kondikae271bc2015-11-15 02:50:53 +01007564 :
micky3879b9f5e72025-07-08 18:04:53 -04007565 elif test -d "$cf_add_libdir"
Steve Kondikae271bc2015-11-15 02:50:53 +01007566 then
7567 cf_have_libdir=no
7568 if test -n "$LDFLAGS$LIBS" ; then
7569 # a loop is needed to ensure we can add subdirs of existing dirs
7570 for cf_test_libdir in $LDFLAGS $LIBS ; do
7571 if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
7572 cf_have_libdir=yes; break
7573 fi
7574 done
7575 fi
7576 if test "$cf_have_libdir" = no ; then
7577 test -n "$verbose" && echo " adding $cf_add_libdir to library-path" 1>&6
7578
micky3879b9f5e72025-07-08 18:04:53 -04007579echo "${as_me:-configure}:7579: testing adding $cf_add_libdir to library-path ..." 1>&5
Steve Kondikae271bc2015-11-15 02:50:53 +01007580
7581 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
7582 fi
7583 fi
7584 done
7585fi
7586
7587 ;;
7588 esac
7589 ;;
7590(sunos3*|sunos4*)
7591 if test "x$cf_cv_screen" = "xcurses_5lib"
7592 then
7593 if test -d /usr/5lib ; then
7594
7595if test -n "/usr/5lib" ; then
7596 for cf_add_libdir in /usr/5lib
7597 do
micky3879b9f5e72025-07-08 18:04:53 -04007598 if test "$cf_add_libdir" = /usr/lib ; then
Steve Kondikae271bc2015-11-15 02:50:53 +01007599 :
micky3879b9f5e72025-07-08 18:04:53 -04007600 elif test -d "$cf_add_libdir"
Steve Kondikae271bc2015-11-15 02:50:53 +01007601 then
7602 cf_have_libdir=no
7603 if test -n "$LDFLAGS$LIBS" ; then
7604 # a loop is needed to ensure we can add subdirs of existing dirs
7605 for cf_test_libdir in $LDFLAGS $LIBS ; do
7606 if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
7607 cf_have_libdir=yes; break
7608 fi
7609 done
7610 fi
7611 if test "$cf_have_libdir" = no ; then
7612 test -n "$verbose" && echo " adding $cf_add_libdir to library-path" 1>&6
7613
micky3879b9f5e72025-07-08 18:04:53 -04007614echo "${as_me:-configure}:7614: testing adding $cf_add_libdir to library-path ..." 1>&5
Steve Kondikae271bc2015-11-15 02:50:53 +01007615
7616 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
7617 fi
7618 fi
7619 done
7620fi
7621
micky3879b9f5e72025-07-08 18:04:53 -04007622cf_add_libs="$LIBS"
7623# reverse order
7624cf_add_0lib=
7625for cf_add_1lib in -lcurses -ltermcap; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
7626# filter duplicates
7627for cf_add_1lib in $cf_add_0lib; do
7628 for cf_add_2lib in $cf_add_libs; do
7629 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
Steve Kondikae271bc2015-11-15 02:50:53 +01007630 cf_add_1lib=
7631 break
7632 fi
7633 done
micky3879b9f5e72025-07-08 18:04:53 -04007634 test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
Steve Kondikae271bc2015-11-15 02:50:53 +01007635done
7636LIBS="$cf_add_libs"
7637
7638 fi
7639 fi
7640 ac_cv_func_initscr=yes
7641 ;;
7642esac
7643
7644if test ".$ac_cv_func_initscr" != .yes ; then
7645 cf_save_LIBS="$LIBS"
7646
7647 if test ".${cf_cv_ncurses_version:-no}" != .no
7648 then
7649 cf_check_list="ncurses curses cursesX"
7650 else
7651 cf_check_list="cursesX curses ncurses"
7652 fi
7653
7654 # Check for library containing tgoto. Do this before curses library
7655 # because it may be needed to link the test-case for initscr.
7656 if test "x$cf_term_lib" = x
7657 then
micky3879b9f5e72025-07-08 18:04:53 -04007658 echo "$as_me:7658: checking for tgoto" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01007659echo $ECHO_N "checking for tgoto... $ECHO_C" >&6
7660if test "${ac_cv_func_tgoto+set}" = set; then
7661 echo $ECHO_N "(cached) $ECHO_C" >&6
7662else
micky3879b9f5e72025-07-08 18:04:53 -04007663 cat >"conftest.$ac_ext" <<_ACEOF
7664#line 7664 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +01007665#include "confdefs.h"
micky3879b9f5e72025-07-08 18:04:53 -04007666#define tgoto autoconf_temporary
7667#include <limits.h> /* least-intrusive standard header which defines gcc2 __stub macros */
7668#undef tgoto
7669
Steve Kondikae271bc2015-11-15 02:50:53 +01007670#ifdef __cplusplus
7671extern "C"
7672#endif
micky3879b9f5e72025-07-08 18:04:53 -04007673
Steve Kondikae271bc2015-11-15 02:50:53 +01007674/* We use char because int might match the return type of a gcc2
7675 builtin and then its argument prototype would still apply. */
micky3879b9f5e72025-07-08 18:04:53 -04007676char tgoto (void);
Steve Kondikae271bc2015-11-15 02:50:53 +01007677
7678int
micky3879b9f5e72025-07-08 18:04:53 -04007679main (void)
Steve Kondikae271bc2015-11-15 02:50:53 +01007680{
micky3879b9f5e72025-07-08 18:04:53 -04007681
7682/* The GNU C library defines stubs for functions which it implements
Steve Kondikae271bc2015-11-15 02:50:53 +01007683 to always fail with ENOSYS. Some functions are actually named
7684 something starting with __ and the normal name is an alias. */
7685#if defined (__stub_tgoto) || defined (__stub___tgoto)
micky3879b9f5e72025-07-08 18:04:53 -04007686#error found stub for tgoto
Steve Kondikae271bc2015-11-15 02:50:53 +01007687#endif
7688
micky3879b9f5e72025-07-08 18:04:53 -04007689 return tgoto ();
Steve Kondikae271bc2015-11-15 02:50:53 +01007690 ;
7691 return 0;
7692}
7693_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -04007694rm -f "conftest.$ac_objext" "conftest$ac_exeext"
7695if { (eval echo "$as_me:7695: \"$ac_link\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01007696 (eval $ac_link) 2>&5
7697 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -04007698 echo "$as_me:7698: \$? = $ac_status" >&5
7699 (exit "$ac_status"); } &&
7700 { ac_try='test -s "conftest$ac_exeext"'
7701 { (eval echo "$as_me:7701: \"$ac_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01007702 (eval $ac_try) 2>&5
7703 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -04007704 echo "$as_me:7704: \$? = $ac_status" >&5
7705 (exit "$ac_status"); }; }; then
Steve Kondikae271bc2015-11-15 02:50:53 +01007706 ac_cv_func_tgoto=yes
7707else
7708 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -04007709cat "conftest.$ac_ext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01007710ac_cv_func_tgoto=no
7711fi
micky3879b9f5e72025-07-08 18:04:53 -04007712rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
Steve Kondikae271bc2015-11-15 02:50:53 +01007713fi
micky3879b9f5e72025-07-08 18:04:53 -04007714echo "$as_me:7714: result: $ac_cv_func_tgoto" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01007715echo "${ECHO_T}$ac_cv_func_tgoto" >&6
micky3879b9f5e72025-07-08 18:04:53 -04007716if test "$ac_cv_func_tgoto" = yes; then
Steve Kondikae271bc2015-11-15 02:50:53 +01007717 cf_term_lib=predefined
7718else
7719
7720 for cf_term_lib in $cf_check_list otermcap termcap tinfo termlib unknown
7721 do
7722 as_ac_Lib=`echo "ac_cv_lib_$cf_term_lib''_tgoto" | $as_tr_sh`
micky3879b9f5e72025-07-08 18:04:53 -04007723echo "$as_me:7723: checking for tgoto in -l$cf_term_lib" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01007724echo $ECHO_N "checking for tgoto in -l$cf_term_lib... $ECHO_C" >&6
7725if eval "test \"\${$as_ac_Lib+set}\" = set"; then
7726 echo $ECHO_N "(cached) $ECHO_C" >&6
7727else
7728 ac_check_lib_save_LIBS=$LIBS
7729LIBS="-l$cf_term_lib $LIBS"
micky3879b9f5e72025-07-08 18:04:53 -04007730cat >"conftest.$ac_ext" <<_ACEOF
7731#line 7731 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +01007732#include "confdefs.h"
7733
7734/* Override any gcc2 internal prototype to avoid an error. */
7735#ifdef __cplusplus
7736extern "C"
7737#endif
7738/* We use char because int might match the return type of a gcc2
7739 builtin and then its argument prototype would still apply. */
micky3879b9f5e72025-07-08 18:04:53 -04007740char tgoto (void);
Steve Kondikae271bc2015-11-15 02:50:53 +01007741int
micky3879b9f5e72025-07-08 18:04:53 -04007742main (void)
Steve Kondikae271bc2015-11-15 02:50:53 +01007743{
7744tgoto ();
7745 ;
7746 return 0;
7747}
7748_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -04007749rm -f "conftest.$ac_objext" "conftest$ac_exeext"
7750if { (eval echo "$as_me:7750: \"$ac_link\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01007751 (eval $ac_link) 2>&5
7752 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -04007753 echo "$as_me:7753: \$? = $ac_status" >&5
7754 (exit "$ac_status"); } &&
7755 { ac_try='test -s "conftest$ac_exeext"'
7756 { (eval echo "$as_me:7756: \"$ac_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01007757 (eval $ac_try) 2>&5
7758 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -04007759 echo "$as_me:7759: \$? = $ac_status" >&5
7760 (exit "$ac_status"); }; }; then
Steve Kondikae271bc2015-11-15 02:50:53 +01007761 eval "$as_ac_Lib=yes"
7762else
7763 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -04007764cat "conftest.$ac_ext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01007765eval "$as_ac_Lib=no"
7766fi
micky3879b9f5e72025-07-08 18:04:53 -04007767rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
Steve Kondikae271bc2015-11-15 02:50:53 +01007768LIBS=$ac_check_lib_save_LIBS
7769fi
micky3879b9f5e72025-07-08 18:04:53 -04007770echo "$as_me:7770: result: `eval echo '${'"$as_ac_Lib"'}'`" >&5
7771echo "${ECHO_T}`eval echo '${'"$as_ac_Lib"'}'`" >&6
7772if test "`eval echo '${'"$as_ac_Lib"'}'`" = yes; then
7773
7774 : "${cf_nculib_root:=$cf_term_lib}"
7775 break
7776
Steve Kondikae271bc2015-11-15 02:50:53 +01007777fi
7778
7779 done
7780
7781fi
7782
7783 fi
7784
7785 # Check for library containing initscr
7786 test "$cf_term_lib" != predefined && test "$cf_term_lib" != unknown && LIBS="-l$cf_term_lib $cf_save_LIBS"
7787 if test "x$cf_curs_lib" = x
7788 then
7789 for cf_curs_lib in $cf_check_list xcurses jcurses pdcurses unknown
7790 do
micky3879b9f5e72025-07-08 18:04:53 -04007791 LIBS="-l$cf_curs_lib $cf_save_LIBS"
7792 if test "$cf_term_lib" = unknown || test "$cf_term_lib" = "$cf_curs_lib" ; then
7793 echo "$as_me:7793: checking if we can link with $cf_curs_lib library" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01007794echo $ECHO_N "checking if we can link with $cf_curs_lib library... $ECHO_C" >&6
micky3879b9f5e72025-07-08 18:04:53 -04007795 cat >"conftest.$ac_ext" <<_ACEOF
7796#line 7796 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +01007797#include "confdefs.h"
7798#include <${cf_cv_ncurses_header:-curses.h}>
7799int
micky3879b9f5e72025-07-08 18:04:53 -04007800main (void)
Steve Kondikae271bc2015-11-15 02:50:53 +01007801{
7802initscr()
7803 ;
7804 return 0;
7805}
7806_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -04007807rm -f "conftest.$ac_objext" "conftest$ac_exeext"
7808if { (eval echo "$as_me:7808: \"$ac_link\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01007809 (eval $ac_link) 2>&5
7810 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -04007811 echo "$as_me:7811: \$? = $ac_status" >&5
7812 (exit "$ac_status"); } &&
7813 { ac_try='test -s "conftest$ac_exeext"'
7814 { (eval echo "$as_me:7814: \"$ac_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01007815 (eval $ac_try) 2>&5
7816 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -04007817 echo "$as_me:7817: \$? = $ac_status" >&5
7818 (exit "$ac_status"); }; }; then
Steve Kondikae271bc2015-11-15 02:50:53 +01007819 cf_result=yes
7820else
7821 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -04007822cat "conftest.$ac_ext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01007823cf_result=no
7824fi
micky3879b9f5e72025-07-08 18:04:53 -04007825rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
7826 echo "$as_me:7826: result: $cf_result" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01007827echo "${ECHO_T}$cf_result" >&6
micky3879b9f5e72025-07-08 18:04:53 -04007828 test "$cf_result" = yes && break
7829 elif test "$cf_curs_lib" = "$cf_term_lib" ; then
7830 cf_result=no
7831 elif test "$cf_term_lib" != predefined ; then
7832 echo "$as_me:7832: checking if we need both $cf_curs_lib and $cf_term_lib libraries" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01007833echo $ECHO_N "checking if we need both $cf_curs_lib and $cf_term_lib libraries... $ECHO_C" >&6
micky3879b9f5e72025-07-08 18:04:53 -04007834 cat >"conftest.$ac_ext" <<_ACEOF
7835#line 7835 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +01007836#include "confdefs.h"
7837#include <${cf_cv_ncurses_header:-curses.h}>
7838int
micky3879b9f5e72025-07-08 18:04:53 -04007839main (void)
Steve Kondikae271bc2015-11-15 02:50:53 +01007840{
micky3879b9f5e72025-07-08 18:04:53 -04007841initscr(); endwin();
Steve Kondikae271bc2015-11-15 02:50:53 +01007842 ;
7843 return 0;
7844}
7845_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -04007846rm -f "conftest.$ac_objext" "conftest$ac_exeext"
7847if { (eval echo "$as_me:7847: \"$ac_link\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01007848 (eval $ac_link) 2>&5
7849 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -04007850 echo "$as_me:7850: \$? = $ac_status" >&5
7851 (exit "$ac_status"); } &&
7852 { ac_try='test -s "conftest$ac_exeext"'
7853 { (eval echo "$as_me:7853: \"$ac_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01007854 (eval $ac_try) 2>&5
7855 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -04007856 echo "$as_me:7856: \$? = $ac_status" >&5
7857 (exit "$ac_status"); }; }; then
Steve Kondikae271bc2015-11-15 02:50:53 +01007858 cf_result=no
7859else
7860 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -04007861cat "conftest.$ac_ext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01007862
micky3879b9f5e72025-07-08 18:04:53 -04007863 LIBS="-l$cf_curs_lib -l$cf_term_lib $cf_save_LIBS"
7864 cat >"conftest.$ac_ext" <<_ACEOF
7865#line 7865 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +01007866#include "confdefs.h"
7867#include <${cf_cv_ncurses_header:-curses.h}>
7868int
micky3879b9f5e72025-07-08 18:04:53 -04007869main (void)
Steve Kondikae271bc2015-11-15 02:50:53 +01007870{
7871initscr()
7872 ;
7873 return 0;
7874}
7875_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -04007876rm -f "conftest.$ac_objext" "conftest$ac_exeext"
7877if { (eval echo "$as_me:7877: \"$ac_link\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01007878 (eval $ac_link) 2>&5
7879 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -04007880 echo "$as_me:7880: \$? = $ac_status" >&5
7881 (exit "$ac_status"); } &&
7882 { ac_try='test -s "conftest$ac_exeext"'
7883 { (eval echo "$as_me:7883: \"$ac_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01007884 (eval $ac_try) 2>&5
7885 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -04007886 echo "$as_me:7886: \$? = $ac_status" >&5
7887 (exit "$ac_status"); }; }; then
Steve Kondikae271bc2015-11-15 02:50:53 +01007888 cf_result=yes
7889else
7890 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -04007891cat "conftest.$ac_ext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01007892cf_result=error
7893fi
micky3879b9f5e72025-07-08 18:04:53 -04007894rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
Steve Kondikae271bc2015-11-15 02:50:53 +01007895
7896fi
micky3879b9f5e72025-07-08 18:04:53 -04007897rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
7898 echo "$as_me:7898: result: $cf_result" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01007899echo "${ECHO_T}$cf_result" >&6
micky3879b9f5e72025-07-08 18:04:53 -04007900 test "$cf_result" != error && break
7901 fi
7902 done
Steve Kondikae271bc2015-11-15 02:50:53 +01007903 fi
micky3879b9f5e72025-07-08 18:04:53 -04007904 test "$cf_curs_lib" = unknown && { { echo "$as_me:7904: error: no curses library found" >&5
7905echo "$as_me: error: no curses library found" >&2;}
7906 { (exit 1); exit 1; }; }
Steve Kondikae271bc2015-11-15 02:50:53 +01007907fi
7908fi
7909
7910 ;;
7911(ncursesw*)
7912
micky3879b9f5e72025-07-08 18:04:53 -04007913for ac_header in wchar.h
7914do
7915as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
7916echo "$as_me:7916: checking for $ac_header" >&5
7917echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
7918if eval "test \"\${$as_ac_Header+set}\" = set"; then
7919 echo $ECHO_N "(cached) $ECHO_C" >&6
7920else
7921 cat >"conftest.$ac_ext" <<_ACEOF
7922#line 7922 "configure"
7923#include "confdefs.h"
7924#include <$ac_header>
7925_ACEOF
7926if { (eval echo "$as_me:7926: \"$ac_cpp "conftest.$ac_ext"\"") >&5
7927 (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
7928 ac_status=$?
7929 $EGREP -v '^ *\+' conftest.er1 >conftest.err
7930 rm -f conftest.er1
7931 cat conftest.err >&5
7932 echo "$as_me:7932: \$? = $ac_status" >&5
7933 (exit "$ac_status"); } >/dev/null; then
7934 if test -s conftest.err; then
7935 ac_cpp_err=$ac_c_preproc_warn_flag
7936 else
7937 ac_cpp_err=
7938 fi
7939else
7940 ac_cpp_err=yes
7941fi
7942if test -z "$ac_cpp_err"; then
7943 eval "$as_ac_Header=yes"
7944else
7945 echo "$as_me: failed program was:" >&5
7946 cat "conftest.$ac_ext" >&5
7947 eval "$as_ac_Header=no"
7948fi
7949rm -f conftest.err "conftest.$ac_ext"
7950fi
7951echo "$as_me:7951: result: `eval echo '${'"$as_ac_Header"'}'`" >&5
7952echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6
7953if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then
7954 cat >>confdefs.h <<EOF
7955#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
7956EOF
7957
7958fi
7959done
7960
7961echo "$as_me:7961: checking for multibyte character support" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01007962echo $ECHO_N "checking for multibyte character support... $ECHO_C" >&6
7963if test "${cf_cv_utf8_lib+set}" = set; then
7964 echo $ECHO_N "(cached) $ECHO_C" >&6
7965else
7966
7967 cf_save_LIBS="$LIBS"
micky3879b9f5e72025-07-08 18:04:53 -04007968 cat >"conftest.$ac_ext" <<_ACEOF
7969#line 7969 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +01007970#include "confdefs.h"
7971
micky3879b9f5e72025-07-08 18:04:53 -04007972$ac_includes_default
7973#ifdef HAVE_WCHAR_H
7974#include <wchar.h>
7975#endif
7976
Steve Kondikae271bc2015-11-15 02:50:53 +01007977int
micky3879b9f5e72025-07-08 18:04:53 -04007978main (void)
Steve Kondikae271bc2015-11-15 02:50:53 +01007979{
7980putwc(0,0);
7981 ;
7982 return 0;
7983}
7984_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -04007985rm -f "conftest.$ac_objext" "conftest$ac_exeext"
7986if { (eval echo "$as_me:7986: \"$ac_link\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01007987 (eval $ac_link) 2>&5
7988 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -04007989 echo "$as_me:7989: \$? = $ac_status" >&5
7990 (exit "$ac_status"); } &&
7991 { ac_try='test -s "conftest$ac_exeext"'
7992 { (eval echo "$as_me:7992: \"$ac_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01007993 (eval $ac_try) 2>&5
7994 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -04007995 echo "$as_me:7995: \$? = $ac_status" >&5
7996 (exit "$ac_status"); }; }; then
Steve Kondikae271bc2015-11-15 02:50:53 +01007997 cf_cv_utf8_lib=yes
7998else
7999 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -04008000cat "conftest.$ac_ext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01008001
8002# If the linkage is not already in the $CPPFLAGS/$LDFLAGS configuration, these
8003# will be set on completion of the AC_TRY_LINK below.
8004cf_cv_header_path_utf8=
8005cf_cv_library_path_utf8=
8006
micky3879b9f5e72025-07-08 18:04:53 -04008007echo "${as_me:-configure}:8007: testing Starting FIND_LINKAGE(utf8,) ..." 1>&5
Steve Kondikae271bc2015-11-15 02:50:53 +01008008
8009cf_save_LIBS="$LIBS"
8010
micky3879b9f5e72025-07-08 18:04:53 -04008011cat >"conftest.$ac_ext" <<_ACEOF
8012#line 8012 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +01008013#include "confdefs.h"
8014
8015#include <libutf8.h>
8016int
micky3879b9f5e72025-07-08 18:04:53 -04008017main (void)
Steve Kondikae271bc2015-11-15 02:50:53 +01008018{
8019putwc(0,0);
8020 ;
8021 return 0;
8022}
8023_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -04008024rm -f "conftest.$ac_objext" "conftest$ac_exeext"
8025if { (eval echo "$as_me:8025: \"$ac_link\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01008026 (eval $ac_link) 2>&5
8027 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -04008028 echo "$as_me:8028: \$? = $ac_status" >&5
8029 (exit "$ac_status"); } &&
8030 { ac_try='test -s "conftest$ac_exeext"'
8031 { (eval echo "$as_me:8031: \"$ac_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01008032 (eval $ac_try) 2>&5
8033 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -04008034 echo "$as_me:8034: \$? = $ac_status" >&5
8035 (exit "$ac_status"); }; }; then
Steve Kondikae271bc2015-11-15 02:50:53 +01008036
8037 cf_cv_find_linkage_utf8=yes
8038 cf_cv_header_path_utf8=/usr/include
8039 cf_cv_library_path_utf8=/usr/lib
8040
8041else
8042 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -04008043cat "conftest.$ac_ext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01008044
8045LIBS="-lutf8 $cf_save_LIBS"
8046
micky3879b9f5e72025-07-08 18:04:53 -04008047cat >"conftest.$ac_ext" <<_ACEOF
8048#line 8048 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +01008049#include "confdefs.h"
8050
8051#include <libutf8.h>
8052int
micky3879b9f5e72025-07-08 18:04:53 -04008053main (void)
Steve Kondikae271bc2015-11-15 02:50:53 +01008054{
8055putwc(0,0);
8056 ;
8057 return 0;
8058}
8059_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -04008060rm -f "conftest.$ac_objext" "conftest$ac_exeext"
8061if { (eval echo "$as_me:8061: \"$ac_link\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01008062 (eval $ac_link) 2>&5
8063 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -04008064 echo "$as_me:8064: \$? = $ac_status" >&5
8065 (exit "$ac_status"); } &&
8066 { ac_try='test -s "conftest$ac_exeext"'
8067 { (eval echo "$as_me:8067: \"$ac_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01008068 (eval $ac_try) 2>&5
8069 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -04008070 echo "$as_me:8070: \$? = $ac_status" >&5
8071 (exit "$ac_status"); }; }; then
Steve Kondikae271bc2015-11-15 02:50:53 +01008072
8073 cf_cv_find_linkage_utf8=yes
8074 cf_cv_header_path_utf8=/usr/include
8075 cf_cv_library_path_utf8=/usr/lib
8076 cf_cv_library_file_utf8="-lutf8"
8077
8078else
8079 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -04008080cat "conftest.$ac_ext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01008081
8082 cf_cv_find_linkage_utf8=no
8083 LIBS="$cf_save_LIBS"
8084
8085 test -n "$verbose" && echo " find linkage for utf8 library" 1>&6
8086
micky3879b9f5e72025-07-08 18:04:53 -04008087echo "${as_me:-configure}:8087: testing find linkage for utf8 library ..." 1>&5
Steve Kondikae271bc2015-11-15 02:50:53 +01008088
micky3879b9f5e72025-07-08 18:04:53 -04008089echo "${as_me:-configure}:8089: testing Searching for headers in FIND_LINKAGE(utf8,) ..." 1>&5
Steve Kondikae271bc2015-11-15 02:50:53 +01008090
8091 cf_save_CPPFLAGS="$CPPFLAGS"
8092 cf_test_CPPFLAGS="$CPPFLAGS"
8093
8094cf_search=
8095
8096# collect the current set of include-directories from compiler flags
8097cf_header_path_list=""
8098if test -n "${CFLAGS}${CPPFLAGS}" ; then
8099 for cf_header_path in $CPPFLAGS $CFLAGS
8100 do
micky3879b9f5e72025-07-08 18:04:53 -04008101 case "$cf_header_path" in
Steve Kondikae271bc2015-11-15 02:50:53 +01008102 (-I*)
8103 cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
8104
8105test "x$cf_header_path" != "xNONE" && \
8106test -d "$cf_header_path" && \
8107 {
8108 test -n "$verbose" && echo " ... testing for include-directories under $cf_header_path"
micky3879b9f5e72025-07-08 18:04:53 -04008109 test -d "$cf_header_path/include" && cf_search="$cf_search $cf_header_path/include"
8110 test -d "$cf_header_path/include/utf8" && cf_search="$cf_search $cf_header_path/include/utf8"
8111 test -d "$cf_header_path/include/utf8/include" && cf_search="$cf_search $cf_header_path/include/utf8/include"
8112 test -d "$cf_header_path/utf8/include" && cf_search="$cf_search $cf_header_path/utf8/include"
8113 test -d "$cf_header_path/utf8/include/utf8" && cf_search="$cf_search $cf_header_path/utf8/include/utf8"
Steve Kondikae271bc2015-11-15 02:50:53 +01008114}
8115
8116 cf_header_path_list="$cf_header_path_list $cf_search"
8117 ;;
8118 esac
8119 done
8120fi
8121
8122# add the variations for the package we are looking for
8123
8124cf_search=
8125
8126test "x$prefix" != "xNONE" && \
8127test -d "$prefix" && \
8128 {
8129 test -n "$verbose" && echo " ... testing for include-directories under $prefix"
micky3879b9f5e72025-07-08 18:04:53 -04008130 test -d "$prefix/include" && cf_search="$cf_search $prefix/include"
8131 test -d "$prefix/include/utf8" && cf_search="$cf_search $prefix/include/utf8"
8132 test -d "$prefix/include/utf8/include" && cf_search="$cf_search $prefix/include/utf8/include"
8133 test -d "$prefix/utf8/include" && cf_search="$cf_search $prefix/utf8/include"
8134 test -d "$prefix/utf8/include/utf8" && cf_search="$cf_search $prefix/utf8/include/utf8"
Steve Kondikae271bc2015-11-15 02:50:53 +01008135}
8136
8137for cf_subdir_prefix in \
8138 /usr \
8139 /usr/local \
8140 /usr/pkg \
8141 /opt \
8142 /opt/local \
8143 $HOME
8144do
8145
8146test "x$cf_subdir_prefix" != "x$prefix" && \
8147test -d "$cf_subdir_prefix" && \
micky3879b9f5e72025-07-08 18:04:53 -04008148{ test -z "$prefix" || test "x$prefix" = xNONE || test "x$cf_subdir_prefix" != "x$prefix"; } && {
Steve Kondikae271bc2015-11-15 02:50:53 +01008149 test -n "$verbose" && echo " ... testing for include-directories under $cf_subdir_prefix"
micky3879b9f5e72025-07-08 18:04:53 -04008150 test -d "$cf_subdir_prefix/include" && cf_search="$cf_search $cf_subdir_prefix/include"
8151 test -d "$cf_subdir_prefix/include/utf8" && cf_search="$cf_search $cf_subdir_prefix/include/utf8"
8152 test -d "$cf_subdir_prefix/include/utf8/include" && cf_search="$cf_search $cf_subdir_prefix/include/utf8/include"
8153 test -d "$cf_subdir_prefix/utf8/include" && cf_search="$cf_search $cf_subdir_prefix/utf8/include"
8154 test -d "$cf_subdir_prefix/utf8/include/utf8" && cf_search="$cf_search $cf_subdir_prefix/utf8/include/utf8"
Steve Kondikae271bc2015-11-15 02:50:53 +01008155}
8156
8157done
8158
8159test "$includedir" != NONE && \
8160test "$includedir" != "/usr/include" && \
8161test -d "$includedir" && {
micky3879b9f5e72025-07-08 18:04:53 -04008162 test -d "$includedir" && cf_search="$cf_search $includedir"
8163 test -d "$includedir/utf8" && cf_search="$cf_search $includedir/utf8"
Steve Kondikae271bc2015-11-15 02:50:53 +01008164}
8165
8166test "$oldincludedir" != NONE && \
8167test "$oldincludedir" != "/usr/include" && \
8168test -d "$oldincludedir" && {
micky3879b9f5e72025-07-08 18:04:53 -04008169 test -d "$oldincludedir" && cf_search="$cf_search $oldincludedir"
8170 test -d "$oldincludedir/utf8" && cf_search="$cf_search $oldincludedir/utf8"
Steve Kondikae271bc2015-11-15 02:50:53 +01008171}
8172
8173cf_search="$cf_search $cf_header_path_list"
8174
8175 for cf_cv_header_path_utf8 in $cf_search
8176 do
micky3879b9f5e72025-07-08 18:04:53 -04008177 if test -d "$cf_cv_header_path_utf8" ; then
Steve Kondikae271bc2015-11-15 02:50:53 +01008178 test -n "$verbose" && echo " ... testing $cf_cv_header_path_utf8" 1>&6
8179
micky3879b9f5e72025-07-08 18:04:53 -04008180echo "${as_me:-configure}:8180: testing ... testing $cf_cv_header_path_utf8 ..." 1>&5
Steve Kondikae271bc2015-11-15 02:50:53 +01008181
micky3879b9f5e72025-07-08 18:04:53 -04008182 CPPFLAGS="$cf_save_CPPFLAGS"
8183
8184 test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
8185 CPPFLAGS="${CPPFLAGS}-I$cf_cv_header_path_utf8"
8186
8187 cat >"conftest.$ac_ext" <<_ACEOF
8188#line 8188 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +01008189#include "confdefs.h"
8190
8191#include <libutf8.h>
8192int
micky3879b9f5e72025-07-08 18:04:53 -04008193main (void)
Steve Kondikae271bc2015-11-15 02:50:53 +01008194{
8195putwc(0,0);
8196 ;
8197 return 0;
8198}
8199_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -04008200rm -f "conftest.$ac_objext"
8201if { (eval echo "$as_me:8201: \"$ac_compile\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01008202 (eval $ac_compile) 2>&5
8203 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -04008204 echo "$as_me:8204: \$? = $ac_status" >&5
8205 (exit "$ac_status"); } &&
8206 { ac_try='test -s "conftest.$ac_objext"'
8207 { (eval echo "$as_me:8207: \"$ac_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01008208 (eval $ac_try) 2>&5
8209 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -04008210 echo "$as_me:8210: \$? = $ac_status" >&5
8211 (exit "$ac_status"); }; }; then
Steve Kondikae271bc2015-11-15 02:50:53 +01008212
8213 test -n "$verbose" && echo " ... found utf8 headers in $cf_cv_header_path_utf8" 1>&6
8214
micky3879b9f5e72025-07-08 18:04:53 -04008215echo "${as_me:-configure}:8215: testing ... found utf8 headers in $cf_cv_header_path_utf8 ..." 1>&5
Steve Kondikae271bc2015-11-15 02:50:53 +01008216
8217 cf_cv_find_linkage_utf8=maybe
8218 cf_test_CPPFLAGS="$CPPFLAGS"
8219 break
8220else
8221 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -04008222cat "conftest.$ac_ext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01008223
8224 CPPFLAGS="$cf_save_CPPFLAGS"
8225
8226fi
micky3879b9f5e72025-07-08 18:04:53 -04008227rm -f "conftest.$ac_objext" "conftest.$ac_ext"
Steve Kondikae271bc2015-11-15 02:50:53 +01008228 fi
8229 done
8230
8231 if test "$cf_cv_find_linkage_utf8" = maybe ; then
8232
micky3879b9f5e72025-07-08 18:04:53 -04008233echo "${as_me:-configure}:8233: testing Searching for utf8 library in FIND_LINKAGE(utf8,) ..." 1>&5
Steve Kondikae271bc2015-11-15 02:50:53 +01008234
8235 cf_save_LIBS="$LIBS"
8236 cf_save_LDFLAGS="$LDFLAGS"
8237
8238 if test "$cf_cv_find_linkage_utf8" != yes ; then
8239
8240cf_search=
8241cf_library_path_list=""
8242if test -n "${LDFLAGS}${LIBS}" ; then
8243 for cf_library_path in $LDFLAGS $LIBS
8244 do
micky3879b9f5e72025-07-08 18:04:53 -04008245 case "$cf_library_path" in
Steve Kondikae271bc2015-11-15 02:50:53 +01008246 (-L*)
8247 cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
8248
8249test "x$cf_library_path" != "xNONE" && \
8250test -d "$cf_library_path" && \
8251 {
8252 test -n "$verbose" && echo " ... testing for lib-directories under $cf_library_path"
micky3879b9f5e72025-07-08 18:04:53 -04008253 test -d "$cf_library_path/lib" && cf_search="$cf_search $cf_library_path/lib"
8254 test -d "$cf_library_path/lib/utf8" && cf_search="$cf_search $cf_library_path/lib/utf8"
8255 test -d "$cf_library_path/lib/utf8/lib" && cf_search="$cf_search $cf_library_path/lib/utf8/lib"
8256 test -d "$cf_library_path/utf8/lib" && cf_search="$cf_search $cf_library_path/utf8/lib"
8257 test -d "$cf_library_path/utf8/lib/utf8" && cf_search="$cf_search $cf_library_path/utf8/lib/utf8"
Steve Kondikae271bc2015-11-15 02:50:53 +01008258}
8259
8260 cf_library_path_list="$cf_library_path_list $cf_search"
8261 ;;
8262 esac
8263 done
8264fi
8265
8266cf_search=
8267
8268test "x$prefix" != "xNONE" && \
8269test -d "$prefix" && \
8270 {
8271 test -n "$verbose" && echo " ... testing for lib-directories under $prefix"
micky3879b9f5e72025-07-08 18:04:53 -04008272 test -d "$prefix/lib" && cf_search="$cf_search $prefix/lib"
8273 test -d "$prefix/lib/utf8" && cf_search="$cf_search $prefix/lib/utf8"
8274 test -d "$prefix/lib/utf8/lib" && cf_search="$cf_search $prefix/lib/utf8/lib"
8275 test -d "$prefix/utf8/lib" && cf_search="$cf_search $prefix/utf8/lib"
8276 test -d "$prefix/utf8/lib/utf8" && cf_search="$cf_search $prefix/utf8/lib/utf8"
Steve Kondikae271bc2015-11-15 02:50:53 +01008277}
8278
8279for cf_subdir_prefix in \
8280 /usr \
8281 /usr/local \
8282 /usr/pkg \
8283 /opt \
8284 /opt/local \
8285 $HOME
8286do
8287
8288test "x$cf_subdir_prefix" != "x$prefix" && \
8289test -d "$cf_subdir_prefix" && \
micky3879b9f5e72025-07-08 18:04:53 -04008290{ test -z "$prefix" || test "x$prefix" = xNONE || test "x$cf_subdir_prefix" != "x$prefix"; } && {
Steve Kondikae271bc2015-11-15 02:50:53 +01008291 test -n "$verbose" && echo " ... testing for lib-directories under $cf_subdir_prefix"
micky3879b9f5e72025-07-08 18:04:53 -04008292 test -d "$cf_subdir_prefix/lib" && cf_search="$cf_search $cf_subdir_prefix/lib"
8293 test -d "$cf_subdir_prefix/lib/utf8" && cf_search="$cf_search $cf_subdir_prefix/lib/utf8"
8294 test -d "$cf_subdir_prefix/lib/utf8/lib" && cf_search="$cf_search $cf_subdir_prefix/lib/utf8/lib"
8295 test -d "$cf_subdir_prefix/utf8/lib" && cf_search="$cf_search $cf_subdir_prefix/utf8/lib"
8296 test -d "$cf_subdir_prefix/utf8/lib/utf8" && cf_search="$cf_search $cf_subdir_prefix/utf8/lib/utf8"
Steve Kondikae271bc2015-11-15 02:50:53 +01008297}
8298
8299done
8300
8301cf_search="$cf_library_path_list $cf_search"
8302
8303 for cf_cv_library_path_utf8 in $cf_search
8304 do
micky3879b9f5e72025-07-08 18:04:53 -04008305 if test -d "$cf_cv_library_path_utf8" ; then
Steve Kondikae271bc2015-11-15 02:50:53 +01008306 test -n "$verbose" && echo " ... testing $cf_cv_library_path_utf8" 1>&6
8307
micky3879b9f5e72025-07-08 18:04:53 -04008308echo "${as_me:-configure}:8308: testing ... testing $cf_cv_library_path_utf8 ..." 1>&5
Steve Kondikae271bc2015-11-15 02:50:53 +01008309
8310 CPPFLAGS="$cf_test_CPPFLAGS"
8311 LIBS="-lutf8 $cf_save_LIBS"
8312 LDFLAGS="$cf_save_LDFLAGS -L$cf_cv_library_path_utf8"
micky3879b9f5e72025-07-08 18:04:53 -04008313 cat >"conftest.$ac_ext" <<_ACEOF
8314#line 8314 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +01008315#include "confdefs.h"
8316
8317#include <libutf8.h>
8318int
micky3879b9f5e72025-07-08 18:04:53 -04008319main (void)
Steve Kondikae271bc2015-11-15 02:50:53 +01008320{
8321putwc(0,0);
8322 ;
8323 return 0;
8324}
8325_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -04008326rm -f "conftest.$ac_objext" "conftest$ac_exeext"
8327if { (eval echo "$as_me:8327: \"$ac_link\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01008328 (eval $ac_link) 2>&5
8329 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -04008330 echo "$as_me:8330: \$? = $ac_status" >&5
8331 (exit "$ac_status"); } &&
8332 { ac_try='test -s "conftest$ac_exeext"'
8333 { (eval echo "$as_me:8333: \"$ac_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01008334 (eval $ac_try) 2>&5
8335 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -04008336 echo "$as_me:8336: \$? = $ac_status" >&5
8337 (exit "$ac_status"); }; }; then
Steve Kondikae271bc2015-11-15 02:50:53 +01008338
8339 test -n "$verbose" && echo " ... found utf8 library in $cf_cv_library_path_utf8" 1>&6
8340
micky3879b9f5e72025-07-08 18:04:53 -04008341echo "${as_me:-configure}:8341: testing ... found utf8 library in $cf_cv_library_path_utf8 ..." 1>&5
Steve Kondikae271bc2015-11-15 02:50:53 +01008342
8343 cf_cv_find_linkage_utf8=yes
8344 cf_cv_library_file_utf8="-lutf8"
8345 break
8346else
8347 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -04008348cat "conftest.$ac_ext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01008349
8350 CPPFLAGS="$cf_save_CPPFLAGS"
8351 LIBS="$cf_save_LIBS"
8352 LDFLAGS="$cf_save_LDFLAGS"
8353
8354fi
micky3879b9f5e72025-07-08 18:04:53 -04008355rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
Steve Kondikae271bc2015-11-15 02:50:53 +01008356 fi
8357 done
8358 CPPFLAGS="$cf_save_CPPFLAGS"
8359 LDFLAGS="$cf_save_LDFLAGS"
8360 fi
8361
8362 else
8363 cf_cv_find_linkage_utf8=no
8364 fi
8365
8366fi
micky3879b9f5e72025-07-08 18:04:53 -04008367rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
Steve Kondikae271bc2015-11-15 02:50:53 +01008368
8369fi
micky3879b9f5e72025-07-08 18:04:53 -04008370rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
Steve Kondikae271bc2015-11-15 02:50:53 +01008371
8372LIBS="$cf_save_LIBS"
8373
8374if test "$cf_cv_find_linkage_utf8" = yes ; then
8375cf_cv_utf8_lib=add-on
8376else
8377cf_cv_utf8_lib=no
8378fi
8379
8380fi
micky3879b9f5e72025-07-08 18:04:53 -04008381rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
Steve Kondikae271bc2015-11-15 02:50:53 +01008382fi
micky3879b9f5e72025-07-08 18:04:53 -04008383echo "$as_me:8383: result: $cf_cv_utf8_lib" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01008384echo "${ECHO_T}$cf_cv_utf8_lib" >&6
8385
8386# HAVE_LIBUTF8_H is used by ncurses if curses.h is shared between
8387# ncurses/ncursesw:
8388if test "$cf_cv_utf8_lib" = "add-on" ; then
8389
8390cat >>confdefs.h <<\EOF
8391#define HAVE_LIBUTF8_H 1
8392EOF
8393
8394if test -n "$cf_cv_header_path_utf8" ; then
8395 for cf_add_incdir in $cf_cv_header_path_utf8
8396 do
micky3879b9f5e72025-07-08 18:04:53 -04008397 while test "$cf_add_incdir" != /usr/include
Steve Kondikae271bc2015-11-15 02:50:53 +01008398 do
micky3879b9f5e72025-07-08 18:04:53 -04008399 if test -d "$cf_add_incdir"
Steve Kondikae271bc2015-11-15 02:50:53 +01008400 then
8401 cf_have_incdir=no
8402 if test -n "$CFLAGS$CPPFLAGS" ; then
8403 # a loop is needed to ensure we can add subdirs of existing dirs
8404 for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
8405 if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
8406 cf_have_incdir=yes; break
8407 fi
8408 done
8409 fi
8410
8411 if test "$cf_have_incdir" = no ; then
8412 if test "$cf_add_incdir" = /usr/local/include ; then
8413 if test "$GCC" = yes
8414 then
8415 cf_save_CPPFLAGS=$CPPFLAGS
micky3879b9f5e72025-07-08 18:04:53 -04008416
8417 test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
8418 CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
8419
8420 cat >"conftest.$ac_ext" <<_ACEOF
8421#line 8421 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +01008422#include "confdefs.h"
8423#include <stdio.h>
8424int
micky3879b9f5e72025-07-08 18:04:53 -04008425main (void)
Steve Kondikae271bc2015-11-15 02:50:53 +01008426{
8427printf("Hello")
8428 ;
8429 return 0;
8430}
8431_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -04008432rm -f "conftest.$ac_objext"
8433if { (eval echo "$as_me:8433: \"$ac_compile\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01008434 (eval $ac_compile) 2>&5
8435 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -04008436 echo "$as_me:8436: \$? = $ac_status" >&5
8437 (exit "$ac_status"); } &&
8438 { ac_try='test -s "conftest.$ac_objext"'
8439 { (eval echo "$as_me:8439: \"$ac_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01008440 (eval $ac_try) 2>&5
8441 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -04008442 echo "$as_me:8442: \$? = $ac_status" >&5
8443 (exit "$ac_status"); }; }; then
Steve Kondikae271bc2015-11-15 02:50:53 +01008444 :
8445else
8446 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -04008447cat "conftest.$ac_ext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01008448cf_have_incdir=yes
8449fi
micky3879b9f5e72025-07-08 18:04:53 -04008450rm -f "conftest.$ac_objext" "conftest.$ac_ext"
Steve Kondikae271bc2015-11-15 02:50:53 +01008451 CPPFLAGS=$cf_save_CPPFLAGS
8452 fi
8453 fi
8454 fi
8455
8456 if test "$cf_have_incdir" = no ; then
8457 test -n "$verbose" && echo " adding $cf_add_incdir to include-path" 1>&6
8458
micky3879b9f5e72025-07-08 18:04:53 -04008459echo "${as_me:-configure}:8459: testing adding $cf_add_incdir to include-path ..." 1>&5
Steve Kondikae271bc2015-11-15 02:50:53 +01008460
8461 CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8462
micky3879b9f5e72025-07-08 18:04:53 -04008463 cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
Steve Kondikae271bc2015-11-15 02:50:53 +01008464 test "$cf_top_incdir" = "$cf_add_incdir" && break
8465 cf_add_incdir="$cf_top_incdir"
8466 else
8467 break
8468 fi
8469 else
8470 break
8471 fi
8472 done
8473 done
8474fi
8475
8476if test -n "$cf_cv_library_path_utf8" ; then
8477 for cf_add_libdir in $cf_cv_library_path_utf8
8478 do
micky3879b9f5e72025-07-08 18:04:53 -04008479 if test "$cf_add_libdir" = /usr/lib ; then
Steve Kondikae271bc2015-11-15 02:50:53 +01008480 :
micky3879b9f5e72025-07-08 18:04:53 -04008481 elif test -d "$cf_add_libdir"
Steve Kondikae271bc2015-11-15 02:50:53 +01008482 then
8483 cf_have_libdir=no
8484 if test -n "$LDFLAGS$LIBS" ; then
8485 # a loop is needed to ensure we can add subdirs of existing dirs
8486 for cf_test_libdir in $LDFLAGS $LIBS ; do
8487 if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
8488 cf_have_libdir=yes; break
8489 fi
8490 done
8491 fi
8492 if test "$cf_have_libdir" = no ; then
8493 test -n "$verbose" && echo " adding $cf_add_libdir to library-path" 1>&6
8494
micky3879b9f5e72025-07-08 18:04:53 -04008495echo "${as_me:-configure}:8495: testing adding $cf_add_libdir to library-path ..." 1>&5
Steve Kondikae271bc2015-11-15 02:50:53 +01008496
8497 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
8498 fi
8499 fi
8500 done
8501fi
8502
micky3879b9f5e72025-07-08 18:04:53 -04008503cf_add_libs="$LIBS"
8504# reverse order
8505cf_add_0lib=
8506for cf_add_1lib in $cf_cv_library_file_utf8; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
8507# filter duplicates
8508for cf_add_1lib in $cf_add_0lib; do
8509 for cf_add_2lib in $cf_add_libs; do
8510 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
Steve Kondikae271bc2015-11-15 02:50:53 +01008511 cf_add_1lib=
8512 break
8513 fi
8514 done
micky3879b9f5e72025-07-08 18:04:53 -04008515 test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
Steve Kondikae271bc2015-11-15 02:50:53 +01008516done
8517LIBS="$cf_add_libs"
8518
8519fi
8520
8521cf_ncuconfig_root=$cf_cv_screen
8522cf_have_ncuconfig=no
8523
8524if test "x${PKG_CONFIG:=none}" != xnone; then
micky3879b9f5e72025-07-08 18:04:53 -04008525 echo "$as_me:8525: checking pkg-config for $cf_ncuconfig_root" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01008526echo $ECHO_N "checking pkg-config for $cf_ncuconfig_root... $ECHO_C" >&6
8527 if "$PKG_CONFIG" --exists $cf_ncuconfig_root ; then
micky3879b9f5e72025-07-08 18:04:53 -04008528 echo "$as_me:8528: result: yes" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01008529echo "${ECHO_T}yes" >&6
8530
micky3879b9f5e72025-07-08 18:04:53 -04008531 echo "$as_me:8531: checking if the $cf_ncuconfig_root package files work" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01008532echo $ECHO_N "checking if the $cf_ncuconfig_root package files work... $ECHO_C" >&6
8533 cf_have_ncuconfig=unknown
8534
micky3879b9f5e72025-07-08 18:04:53 -04008535 cf_save_CFLAGS="$CFLAGS"
Steve Kondikae271bc2015-11-15 02:50:53 +01008536 cf_save_CPPFLAGS="$CPPFLAGS"
8537 cf_save_LIBS="$LIBS"
8538
micky3879b9f5e72025-07-08 18:04:53 -04008539 cf_pkg_cflags="`$PKG_CONFIG --cflags $cf_ncuconfig_root`"
8540 cf_pkg_libs="`$PKG_CONFIG --libs $cf_ncuconfig_root`"
Steve Kondikae271bc2015-11-15 02:50:53 +01008541
micky3879b9f5e72025-07-08 18:04:53 -04008542 # while -W for passing linker flags is prevalent, it is not "standard".
8543 # At least one wrapper for c89/c99 (in Apple's xcode) has its own
8544 # incompatible _and_ non-standard -W option which gives an error. Work
8545 # around that pitfall.
8546 case "x${CC}@@${cf_pkg_libs}@${cf_pkg_cflags}" in
8547 (x*c[89]9@@*-W*)
8548
8549cf_fix_cppflags=no
8550cf_new_cflags=
8551cf_new_cppflags=
8552cf_new_extra_cppflags=
8553
8554for cf_add_cflags in $cf_pkg_cflags
Steve Kondikae271bc2015-11-15 02:50:53 +01008555do
micky3879b9f5e72025-07-08 18:04:53 -04008556case "$cf_fix_cppflags" in
8557(no)
8558 case "$cf_add_cflags" in
8559 (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
8560 case "$cf_add_cflags" in
8561 (-D*)
8562 cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
8563
8564 test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
8565 && test -z "${cf_tst_cflags}" \
8566 && cf_fix_cppflags=yes
8567
8568 if test "$cf_fix_cppflags" = yes ; then
8569
8570 test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
8571 cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
8572
8573 continue
8574 elif test "${cf_tst_cflags}" = "\"'" ; then
8575
8576 test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
8577 cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
8578
8579 continue
8580 fi
8581 ;;
8582 esac
8583 case "$CPPFLAGS" in
8584 (*$cf_add_cflags)
8585 ;;
8586 (*)
8587 case "$cf_add_cflags" in
8588 (-D*)
8589 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
8590
8591CPPFLAGS=`echo "$CPPFLAGS" | \
8592 sed -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?[ ]/ /g' \
8593 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?$//g'`
8594
8595 ;;
8596 esac
8597
8598 test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
8599 cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
8600
8601 ;;
8602 esac
8603 ;;
8604 (*)
8605
8606 test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
8607 cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
8608
8609 ;;
8610 esac
8611 ;;
8612(yes)
8613
8614 test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
8615 cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
8616
8617 cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
8618
8619 test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
8620 && test -z "${cf_tst_cflags}" \
8621 && cf_fix_cppflags=no
8622 ;;
8623esac
8624done
8625
8626if test -n "$cf_new_cflags" ; then
8627
8628 test -n "$CFLAGS" && CFLAGS="$CFLAGS "
8629 CFLAGS="${CFLAGS}$cf_new_cflags"
8630
8631fi
8632
8633if test -n "$cf_new_cppflags" ; then
8634
8635 test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
8636 CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
8637
8638fi
8639
8640if test -n "$cf_new_extra_cppflags" ; then
8641
8642 test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
8643 EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
8644
8645fi
8646
8647cf_add_libs="$LIBS"
8648# reverse order
8649cf_add_0lib=
8650for cf_add_1lib in $cf_pkg_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
8651# filter duplicates
8652for cf_add_1lib in $cf_add_0lib; do
8653 for cf_add_2lib in $cf_add_libs; do
8654 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
Steve Kondikae271bc2015-11-15 02:50:53 +01008655 cf_add_1lib=
8656 break
8657 fi
8658 done
micky3879b9f5e72025-07-08 18:04:53 -04008659 test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
Steve Kondikae271bc2015-11-15 02:50:53 +01008660done
8661LIBS="$cf_add_libs"
8662
micky3879b9f5e72025-07-08 18:04:53 -04008663 cat >"conftest.$ac_ext" <<_ACEOF
8664#line 8664 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +01008665#include "confdefs.h"
8666#include <${cf_cv_ncurses_header:-curses.h}>
8667int
micky3879b9f5e72025-07-08 18:04:53 -04008668main (void)
Steve Kondikae271bc2015-11-15 02:50:53 +01008669{
micky3879b9f5e72025-07-08 18:04:53 -04008670initscr(); mousemask(0,0); tigetstr((char *)0);
Steve Kondikae271bc2015-11-15 02:50:53 +01008671 ;
8672 return 0;
8673}
8674_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -04008675rm -f "conftest.$ac_objext" "conftest$ac_exeext"
8676if { (eval echo "$as_me:8676: \"$ac_link\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01008677 (eval $ac_link) 2>&5
8678 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -04008679 echo "$as_me:8679: \$? = $ac_status" >&5
8680 (exit "$ac_status"); } &&
8681 { ac_try='test -s "conftest$ac_exeext"'
8682 { (eval echo "$as_me:8682: \"$ac_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01008683 (eval $ac_try) 2>&5
8684 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -04008685 echo "$as_me:8685: \$? = $ac_status" >&5
8686 (exit "$ac_status"); }; }; then
8687 if test "$cross_compiling" = yes; then
8688 cf_test_ncuconfig=maybe
8689else
8690 cat >"conftest.$ac_ext" <<_ACEOF
8691#line 8691 "configure"
8692#include "confdefs.h"
8693#include <${cf_cv_ncurses_header:-curses.h}>
8694 int main(void)
8695 { const char *xx = curses_version(); return (xx == 0); }
8696_ACEOF
8697rm -f "conftest$ac_exeext"
8698if { (eval echo "$as_me:8698: \"$ac_link\"") >&5
8699 (eval $ac_link) 2>&5
8700 ac_status=$?
8701 echo "$as_me:8701: \$? = $ac_status" >&5
8702 (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
8703 { (eval echo "$as_me:8703: \"$ac_try\"") >&5
8704 (eval $ac_try) 2>&5
8705 ac_status=$?
8706 echo "$as_me:8706: \$? = $ac_status" >&5
8707 (exit "$ac_status"); }; }; then
8708 cf_test_ncuconfig=yes
8709else
8710 echo "$as_me: program exited with status $ac_status" >&5
8711echo "$as_me: failed program was:" >&5
8712cat "conftest.$ac_ext" >&5
8713cf_test_ncuconfig=no
8714fi
8715rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
8716fi
8717else
8718 echo "$as_me: failed program was:" >&5
8719cat "conftest.$ac_ext" >&5
8720cf_test_ncuconfig=no
8721fi
8722rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
8723
8724 CFLAGS="$cf_save_CFLAGS"
8725 CPPFLAGS="$cf_save_CPPFLAGS"
8726 LIBS="$cf_save_LIBS"
8727
8728 if test "x$cf_test_ncuconfig" != xyes; then
8729 cf_temp=`echo "x$cf_pkg_cflags" | sed -e s/^x// -e 's/-W[^ ]*//g'`
8730 cf_pkg_cflags="$cf_temp"
8731 cf_temp=`echo "x$cf_pkg_libs" | sed -e s/^x// -e 's/-W[^ ]*//g'`
8732 cf_pkg_libs="$cf_temp"
8733 fi
8734 ;;
8735 esac
8736
8737for cf_add_cflags in $cf_pkg_cflags
8738do
8739 case "x$cf_add_cflags" in
8740 (x-[DU]*)
8741
8742cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
8743while true
8744do
8745 cf_old_cflag=`echo "x$CFLAGS" | sed -e 's/^.//' -e 's/[ ][ ]*-/ -/g' -e "s%$cf_tmp_cflag\\(=[^ ][^ ]*\\)\?%%" -e 's/^[ ]*//' -e 's%[ ][ ]*-D% -D%g' -e 's%[ ][ ]*-I% -I%g'`
8746 test "$CFLAGS" != "$cf_old_cflag" || break
8747
8748 CFLAGS="$cf_old_cflag"
8749done
8750
8751cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
8752while true
8753do
8754 cf_old_cflag=`echo "x$CPPFLAGS" | sed -e 's/^.//' -e 's/[ ][ ]*-/ -/g' -e "s%$cf_tmp_cflag\\(=[^ ][^ ]*\\)\?%%" -e 's/^[ ]*//' -e 's%[ ][ ]*-D% -D%g' -e 's%[ ][ ]*-I% -I%g'`
8755 test "$CPPFLAGS" != "$cf_old_cflag" || break
8756
8757 CPPFLAGS="$cf_old_cflag"
8758done
8759
8760 ;;
8761 esac
8762
8763cf_fix_cppflags=no
8764cf_new_cflags=
8765cf_new_cppflags=
8766cf_new_extra_cppflags=
8767
8768for cf_add_cflags in $cf_add_cflags
8769do
8770case "$cf_fix_cppflags" in
8771(no)
8772 case "$cf_add_cflags" in
8773 (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
8774 case "$cf_add_cflags" in
8775 (-D*)
8776 cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
8777
8778 test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
8779 && test -z "${cf_tst_cflags}" \
8780 && cf_fix_cppflags=yes
8781
8782 if test "$cf_fix_cppflags" = yes ; then
8783
8784 test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
8785 cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
8786
8787 continue
8788 elif test "${cf_tst_cflags}" = "\"'" ; then
8789
8790 test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
8791 cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
8792
8793 continue
8794 fi
8795 ;;
8796 esac
8797 case "$CPPFLAGS" in
8798 (*$cf_add_cflags)
8799 ;;
8800 (*)
8801 case "$cf_add_cflags" in
8802 (-D*)
8803 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
8804
8805CPPFLAGS=`echo "$CPPFLAGS" | \
8806 sed -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?[ ]/ /g' \
8807 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?$//g'`
8808
8809 ;;
8810 esac
8811
8812 test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
8813 cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
8814
8815 ;;
8816 esac
8817 ;;
8818 (*)
8819
8820 test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
8821 cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
8822
8823 ;;
8824 esac
8825 ;;
8826(yes)
8827
8828 test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
8829 cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
8830
8831 cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
8832
8833 test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
8834 && test -z "${cf_tst_cflags}" \
8835 && cf_fix_cppflags=no
8836 ;;
8837esac
8838done
8839
8840if test -n "$cf_new_cflags" ; then
8841
8842 test -n "$CFLAGS" && CFLAGS="$CFLAGS "
8843 CFLAGS="${CFLAGS}$cf_new_cflags"
8844
8845fi
8846
8847if test -n "$cf_new_cppflags" ; then
8848
8849 test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
8850 CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
8851
8852fi
8853
8854if test -n "$cf_new_extra_cppflags" ; then
8855
8856 test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
8857 EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
8858
8859fi
8860
8861done
8862
8863cf_add_libs="$LIBS"
8864# reverse order
8865cf_add_0lib=
8866for cf_add_1lib in $cf_pkg_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
8867# filter duplicates
8868for cf_add_1lib in $cf_add_0lib; do
8869 for cf_add_2lib in $cf_add_libs; do
8870 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
8871 cf_add_1lib=
8872 break
8873 fi
8874 done
8875 test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
8876done
8877LIBS="$cf_add_libs"
8878
8879 cat >"conftest.$ac_ext" <<_ACEOF
8880#line 8880 "configure"
8881#include "confdefs.h"
8882#include <${cf_cv_ncurses_header:-curses.h}>
8883int
8884main (void)
8885{
8886initscr(); mousemask(0,0); tigetstr((char *)0);
8887 ;
8888 return 0;
8889}
8890_ACEOF
8891rm -f "conftest.$ac_objext" "conftest$ac_exeext"
8892if { (eval echo "$as_me:8892: \"$ac_link\"") >&5
8893 (eval $ac_link) 2>&5
8894 ac_status=$?
8895 echo "$as_me:8895: \$? = $ac_status" >&5
8896 (exit "$ac_status"); } &&
8897 { ac_try='test -s "conftest$ac_exeext"'
8898 { (eval echo "$as_me:8898: \"$ac_try\"") >&5
8899 (eval $ac_try) 2>&5
8900 ac_status=$?
8901 echo "$as_me:8901: \$? = $ac_status" >&5
8902 (exit "$ac_status"); }; }; then
Steve Kondikae271bc2015-11-15 02:50:53 +01008903 if test "$cross_compiling" = yes; then
8904 cf_have_ncuconfig=maybe
8905else
micky3879b9f5e72025-07-08 18:04:53 -04008906 cat >"conftest.$ac_ext" <<_ACEOF
8907#line 8907 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +01008908#include "confdefs.h"
8909#include <${cf_cv_ncurses_header:-curses.h}>
8910 int main(void)
micky3879b9f5e72025-07-08 18:04:53 -04008911 { const char *xx = curses_version(); return (xx == 0); }
Steve Kondikae271bc2015-11-15 02:50:53 +01008912_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -04008913rm -f "conftest$ac_exeext"
8914if { (eval echo "$as_me:8914: \"$ac_link\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01008915 (eval $ac_link) 2>&5
8916 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -04008917 echo "$as_me:8917: \$? = $ac_status" >&5
8918 (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
8919 { (eval echo "$as_me:8919: \"$ac_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01008920 (eval $ac_try) 2>&5
8921 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -04008922 echo "$as_me:8922: \$? = $ac_status" >&5
8923 (exit "$ac_status"); }; }; then
Steve Kondikae271bc2015-11-15 02:50:53 +01008924 cf_have_ncuconfig=yes
8925else
8926 echo "$as_me: program exited with status $ac_status" >&5
8927echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -04008928cat "conftest.$ac_ext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01008929cf_have_ncuconfig=no
8930fi
micky3879b9f5e72025-07-08 18:04:53 -04008931rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
Steve Kondikae271bc2015-11-15 02:50:53 +01008932fi
8933else
8934 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -04008935cat "conftest.$ac_ext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01008936cf_have_ncuconfig=no
8937fi
micky3879b9f5e72025-07-08 18:04:53 -04008938rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
8939 echo "$as_me:8939: result: $cf_have_ncuconfig" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01008940echo "${ECHO_T}$cf_have_ncuconfig" >&6
8941 test "$cf_have_ncuconfig" = maybe && cf_have_ncuconfig=yes
8942 if test "$cf_have_ncuconfig" != "yes"
8943 then
8944 CPPFLAGS="$cf_save_CPPFLAGS"
8945 LIBS="$cf_save_LIBS"
8946 NCURSES_CONFIG_PKG=none
8947 else
8948
8949cat >>confdefs.h <<\EOF
8950#define NCURSES 1
8951EOF
8952
8953 NCURSES_CONFIG_PKG=$cf_ncuconfig_root
micky3879b9f5e72025-07-08 18:04:53 -04008954
8955echo "$as_me:8955: checking for terminfo header" >&5
8956echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
8957if test "${cf_cv_term_header+set}" = set; then
8958 echo $ECHO_N "(cached) $ECHO_C" >&6
8959else
8960
8961case "${cf_cv_ncurses_header}" in
8962(*/ncurses.h|*/ncursesw.h)
8963 cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
8964 ;;
8965(*)
8966 cf_term_header=term.h
8967 ;;
8968esac
8969
8970for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
8971do
8972cat >"conftest.$ac_ext" <<_ACEOF
8973#line 8973 "configure"
8974#include "confdefs.h"
8975#include <stdio.h>
8976#include <${cf_cv_ncurses_header:-curses.h}>
8977#include <$cf_test>
8978
8979int
8980main (void)
8981{
8982int x = auto_left_margin; (void)x
8983 ;
8984 return 0;
8985}
8986_ACEOF
8987rm -f "conftest.$ac_objext"
8988if { (eval echo "$as_me:8988: \"$ac_compile\"") >&5
8989 (eval $ac_compile) 2>&5
8990 ac_status=$?
8991 echo "$as_me:8991: \$? = $ac_status" >&5
8992 (exit "$ac_status"); } &&
8993 { ac_try='test -s "conftest.$ac_objext"'
8994 { (eval echo "$as_me:8994: \"$ac_try\"") >&5
8995 (eval $ac_try) 2>&5
8996 ac_status=$?
8997 echo "$as_me:8997: \$? = $ac_status" >&5
8998 (exit "$ac_status"); }; }; then
8999
9000 cf_cv_term_header="$cf_test"
9001else
9002 echo "$as_me: failed program was:" >&5
9003cat "conftest.$ac_ext" >&5
9004
9005 cf_cv_term_header=unknown
9006
9007fi
9008rm -f "conftest.$ac_objext" "conftest.$ac_ext"
9009 test "$cf_cv_term_header" != unknown && break
9010done
9011
9012fi
9013echo "$as_me:9013: result: $cf_cv_term_header" >&5
9014echo "${ECHO_T}$cf_cv_term_header" >&6
9015
9016# Set definitions to allow ifdef'ing to accommodate subdirectories
9017
9018case "$cf_cv_term_header" in
9019(*term.h)
9020
9021cat >>confdefs.h <<\EOF
9022#define HAVE_TERM_H 1
9023EOF
9024
9025 ;;
9026esac
9027
9028case "$cf_cv_term_header" in
9029(ncurses/term.h)
9030
9031cat >>confdefs.h <<\EOF
9032#define HAVE_NCURSES_TERM_H 1
9033EOF
9034
9035 ;;
9036(ncursesw/term.h)
9037
9038cat >>confdefs.h <<\EOF
9039#define HAVE_NCURSESW_TERM_H 1
9040EOF
9041
9042 ;;
9043esac
9044
Steve Kondikae271bc2015-11-15 02:50:53 +01009045 fi
9046
9047 else
micky3879b9f5e72025-07-08 18:04:53 -04009048 echo "$as_me:9048: result: no" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01009049echo "${ECHO_T}no" >&6
9050 NCURSES_CONFIG_PKG=none
9051 fi
9052else
9053 NCURSES_CONFIG_PKG=none
9054fi
9055
9056if test "x$cf_have_ncuconfig" = "xno"; then
micky3879b9f5e72025-07-08 18:04:53 -04009057 cf_ncurses_config="${cf_ncuconfig_root}${NCURSES_CONFIG_SUFFIX}-config"; echo "Looking for ${cf_ncurses_config}"
Steve Kondikae271bc2015-11-15 02:50:53 +01009058
9059if test -n "$ac_tool_prefix"; then
micky3879b9f5e72025-07-08 18:04:53 -04009060 for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
Steve Kondikae271bc2015-11-15 02:50:53 +01009061 do
9062 # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
9063set dummy $ac_tool_prefix$ac_prog; ac_word=$2
micky3879b9f5e72025-07-08 18:04:53 -04009064echo "$as_me:9064: checking for $ac_word" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01009065echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
9066if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
9067 echo $ECHO_N "(cached) $ECHO_C" >&6
9068else
9069 if test -n "$NCURSES_CONFIG"; then
9070 ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
9071else
9072 ac_save_IFS=$IFS; IFS=$ac_path_separator
9073ac_dummy="$PATH"
9074for ac_dir in $ac_dummy; do
9075 IFS=$ac_save_IFS
9076 test -z "$ac_dir" && ac_dir=.
9077 $as_executable_p "$ac_dir/$ac_word" || continue
9078ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
micky3879b9f5e72025-07-08 18:04:53 -04009079echo "$as_me:9079: found $ac_dir/$ac_word" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01009080break
9081done
9082
9083fi
9084fi
9085NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
9086if test -n "$NCURSES_CONFIG"; then
micky3879b9f5e72025-07-08 18:04:53 -04009087 echo "$as_me:9087: result: $NCURSES_CONFIG" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01009088echo "${ECHO_T}$NCURSES_CONFIG" >&6
9089else
micky3879b9f5e72025-07-08 18:04:53 -04009090 echo "$as_me:9090: result: no" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01009091echo "${ECHO_T}no" >&6
9092fi
9093
9094 test -n "$NCURSES_CONFIG" && break
9095 done
9096fi
9097if test -z "$NCURSES_CONFIG"; then
9098 ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
micky3879b9f5e72025-07-08 18:04:53 -04009099 for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
Steve Kondikae271bc2015-11-15 02:50:53 +01009100do
9101 # Extract the first word of "$ac_prog", so it can be a program name with args.
9102set dummy $ac_prog; ac_word=$2
micky3879b9f5e72025-07-08 18:04:53 -04009103echo "$as_me:9103: checking for $ac_word" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01009104echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
9105if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
9106 echo $ECHO_N "(cached) $ECHO_C" >&6
9107else
9108 if test -n "$ac_ct_NCURSES_CONFIG"; then
9109 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
9110else
9111 ac_save_IFS=$IFS; IFS=$ac_path_separator
9112ac_dummy="$PATH"
9113for ac_dir in $ac_dummy; do
9114 IFS=$ac_save_IFS
9115 test -z "$ac_dir" && ac_dir=.
9116 $as_executable_p "$ac_dir/$ac_word" || continue
9117ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
micky3879b9f5e72025-07-08 18:04:53 -04009118echo "$as_me:9118: found $ac_dir/$ac_word" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01009119break
9120done
9121
9122fi
9123fi
9124ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
9125if test -n "$ac_ct_NCURSES_CONFIG"; then
micky3879b9f5e72025-07-08 18:04:53 -04009126 echo "$as_me:9126: result: $ac_ct_NCURSES_CONFIG" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01009127echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
9128else
micky3879b9f5e72025-07-08 18:04:53 -04009129 echo "$as_me:9129: result: no" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01009130echo "${ECHO_T}no" >&6
9131fi
9132
9133 test -n "$ac_ct_NCURSES_CONFIG" && break
9134done
9135test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
9136
9137 NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
9138fi
9139
9140 if test "$NCURSES_CONFIG" != none ; then
9141
micky3879b9f5e72025-07-08 18:04:53 -04009142for cf_add_cflags in `$NCURSES_CONFIG --cflags`
Steve Kondikae271bc2015-11-15 02:50:53 +01009143do
micky3879b9f5e72025-07-08 18:04:53 -04009144 case "x$cf_add_cflags" in
9145 (x-[DU]*)
9146
9147cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
9148while true
9149do
9150 cf_old_cflag=`echo "x$CFLAGS" | sed -e 's/^.//' -e 's/[ ][ ]*-/ -/g' -e "s%$cf_tmp_cflag\\(=[^ ][^ ]*\\)\?%%" -e 's/^[ ]*//' -e 's%[ ][ ]*-D% -D%g' -e 's%[ ][ ]*-I% -I%g'`
9151 test "$CFLAGS" != "$cf_old_cflag" || break
9152
9153 CFLAGS="$cf_old_cflag"
9154done
9155
9156cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
9157while true
9158do
9159 cf_old_cflag=`echo "x$CPPFLAGS" | sed -e 's/^.//' -e 's/[ ][ ]*-/ -/g' -e "s%$cf_tmp_cflag\\(=[^ ][^ ]*\\)\?%%" -e 's/^[ ]*//' -e 's%[ ][ ]*-D% -D%g' -e 's%[ ][ ]*-I% -I%g'`
9160 test "$CPPFLAGS" != "$cf_old_cflag" || break
9161
9162 CPPFLAGS="$cf_old_cflag"
9163done
9164
9165 ;;
9166 esac
9167
9168cf_fix_cppflags=no
9169cf_new_cflags=
9170cf_new_cppflags=
9171cf_new_extra_cppflags=
9172
9173for cf_add_cflags in $cf_add_cflags
9174do
9175case "$cf_fix_cppflags" in
9176(no)
9177 case "$cf_add_cflags" in
9178 (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
9179 case "$cf_add_cflags" in
9180 (-D*)
9181 cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
9182
9183 test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
9184 && test -z "${cf_tst_cflags}" \
9185 && cf_fix_cppflags=yes
9186
9187 if test "$cf_fix_cppflags" = yes ; then
9188
9189 test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9190 cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9191
9192 continue
9193 elif test "${cf_tst_cflags}" = "\"'" ; then
9194
9195 test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9196 cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9197
9198 continue
9199 fi
9200 ;;
9201 esac
9202 case "$CPPFLAGS" in
9203 (*$cf_add_cflags)
9204 ;;
9205 (*)
9206 case "$cf_add_cflags" in
9207 (-D*)
9208 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
9209
9210CPPFLAGS=`echo "$CPPFLAGS" | \
9211 sed -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?[ ]/ /g' \
9212 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?$//g'`
9213
9214 ;;
9215 esac
9216
9217 test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
9218 cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
9219
9220 ;;
9221 esac
9222 ;;
9223 (*)
9224
9225 test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
9226 cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
9227
9228 ;;
9229 esac
9230 ;;
9231(yes)
9232
9233 test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9234 cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9235
9236 cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
9237
9238 test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
9239 && test -z "${cf_tst_cflags}" \
9240 && cf_fix_cppflags=no
9241 ;;
9242esac
9243done
9244
9245if test -n "$cf_new_cflags" ; then
9246
9247 test -n "$CFLAGS" && CFLAGS="$CFLAGS "
9248 CFLAGS="${CFLAGS}$cf_new_cflags"
9249
9250fi
9251
9252if test -n "$cf_new_cppflags" ; then
9253
9254 test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
9255 CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
9256
9257fi
9258
9259if test -n "$cf_new_extra_cppflags" ; then
9260
9261 test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
9262 EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
9263
9264fi
9265
9266done
9267
9268cf_add_libs="$LIBS"
9269# reverse order
9270cf_add_0lib=
9271for cf_add_1lib in `$NCURSES_CONFIG --libs`; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
9272# filter duplicates
9273for cf_add_1lib in $cf_add_0lib; do
9274 for cf_add_2lib in $cf_add_libs; do
9275 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
Steve Kondikae271bc2015-11-15 02:50:53 +01009276 cf_add_1lib=
9277 break
9278 fi
9279 done
micky3879b9f5e72025-07-08 18:04:53 -04009280 test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
Steve Kondikae271bc2015-11-15 02:50:53 +01009281done
9282LIBS="$cf_add_libs"
9283
9284 # even with config script, some packages use no-override for curses.h
9285
micky3879b9f5e72025-07-08 18:04:53 -04009286echo "$as_me:9286: checking if we have identified curses headers" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01009287echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
9288if test "${cf_cv_ncurses_header+set}" = set; then
9289 echo $ECHO_N "(cached) $ECHO_C" >&6
9290else
9291
9292cf_cv_ncurses_header=none
9293for cf_header in \
9294 ncurses.h $cf_cv_screen/ncurses.h \
9295 curses.h $cf_cv_screen/curses.h
9296do
micky3879b9f5e72025-07-08 18:04:53 -04009297cat >"conftest.$ac_ext" <<_ACEOF
9298#line 9298 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +01009299#include "confdefs.h"
9300#include <${cf_header}>
9301int
micky3879b9f5e72025-07-08 18:04:53 -04009302main (void)
Steve Kondikae271bc2015-11-15 02:50:53 +01009303{
micky3879b9f5e72025-07-08 18:04:53 -04009304initscr(); endwin()
Steve Kondikae271bc2015-11-15 02:50:53 +01009305 ;
9306 return 0;
9307}
9308_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -04009309rm -f "conftest.$ac_objext"
9310if { (eval echo "$as_me:9310: \"$ac_compile\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01009311 (eval $ac_compile) 2>&5
9312 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -04009313 echo "$as_me:9313: \$? = $ac_status" >&5
9314 (exit "$ac_status"); } &&
9315 { ac_try='test -s "conftest.$ac_objext"'
9316 { (eval echo "$as_me:9316: \"$ac_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01009317 (eval $ac_try) 2>&5
9318 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -04009319 echo "$as_me:9319: \$? = $ac_status" >&5
9320 (exit "$ac_status"); }; }; then
Steve Kondikae271bc2015-11-15 02:50:53 +01009321 cf_cv_ncurses_header=$cf_header; break
9322else
9323 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -04009324cat "conftest.$ac_ext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01009325fi
micky3879b9f5e72025-07-08 18:04:53 -04009326rm -f "conftest.$ac_objext" "conftest.$ac_ext"
Steve Kondikae271bc2015-11-15 02:50:53 +01009327done
9328
9329fi
micky3879b9f5e72025-07-08 18:04:53 -04009330echo "$as_me:9330: result: $cf_cv_ncurses_header" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01009331echo "${ECHO_T}$cf_cv_ncurses_header" >&6
9332
9333if test "$cf_cv_ncurses_header" = none ; then
micky3879b9f5e72025-07-08 18:04:53 -04009334 { { echo "$as_me:9334: error: No curses header-files found" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01009335echo "$as_me: error: No curses header-files found" >&2;}
9336 { (exit 1); exit 1; }; }
9337fi
9338
9339# cheat, to get the right #define's for HAVE_NCURSES_H, etc.
9340
9341for ac_header in $cf_cv_ncurses_header
9342do
9343as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
micky3879b9f5e72025-07-08 18:04:53 -04009344echo "$as_me:9344: checking for $ac_header" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01009345echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
9346if eval "test \"\${$as_ac_Header+set}\" = set"; then
9347 echo $ECHO_N "(cached) $ECHO_C" >&6
9348else
micky3879b9f5e72025-07-08 18:04:53 -04009349 cat >"conftest.$ac_ext" <<_ACEOF
9350#line 9350 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +01009351#include "confdefs.h"
9352#include <$ac_header>
9353_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -04009354if { (eval echo "$as_me:9354: \"$ac_cpp "conftest.$ac_ext"\"") >&5
9355 (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
Steve Kondikae271bc2015-11-15 02:50:53 +01009356 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -04009357 $EGREP -v '^ *\+' conftest.er1 >conftest.err
Steve Kondikae271bc2015-11-15 02:50:53 +01009358 rm -f conftest.er1
9359 cat conftest.err >&5
micky3879b9f5e72025-07-08 18:04:53 -04009360 echo "$as_me:9360: \$? = $ac_status" >&5
9361 (exit "$ac_status"); } >/dev/null; then
Steve Kondikae271bc2015-11-15 02:50:53 +01009362 if test -s conftest.err; then
9363 ac_cpp_err=$ac_c_preproc_warn_flag
9364 else
9365 ac_cpp_err=
9366 fi
9367else
9368 ac_cpp_err=yes
9369fi
9370if test -z "$ac_cpp_err"; then
9371 eval "$as_ac_Header=yes"
9372else
9373 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -04009374 cat "conftest.$ac_ext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01009375 eval "$as_ac_Header=no"
9376fi
micky3879b9f5e72025-07-08 18:04:53 -04009377rm -f conftest.err "conftest.$ac_ext"
Steve Kondikae271bc2015-11-15 02:50:53 +01009378fi
micky3879b9f5e72025-07-08 18:04:53 -04009379echo "$as_me:9379: result: `eval echo '${'"$as_ac_Header"'}'`" >&5
9380echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6
9381if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then
Steve Kondikae271bc2015-11-15 02:50:53 +01009382 cat >>confdefs.h <<EOF
9383#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
9384EOF
9385
9386fi
9387done
9388
9389cat >>confdefs.h <<\EOF
9390#define NCURSES 1
9391EOF
9392
9393cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
9394
9395 cat >>confdefs.h <<EOF
9396#define $cf_nculib_ROOT 1
9397EOF
9398
micky3879b9f5e72025-07-08 18:04:53 -04009399 cf_cv_ncurses_version="`$NCURSES_CONFIG --version`"
Steve Kondikae271bc2015-11-15 02:50:53 +01009400
9401 else
9402
9403cf_ncuhdr_root=$cf_cv_screen
9404
9405test -n "$cf_cv_curses_dir" && \
9406test "$cf_cv_curses_dir" != "no" && { \
9407
9408if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
9409 for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
9410 do
micky3879b9f5e72025-07-08 18:04:53 -04009411 while test "$cf_add_incdir" != /usr/include
Steve Kondikae271bc2015-11-15 02:50:53 +01009412 do
micky3879b9f5e72025-07-08 18:04:53 -04009413 if test -d "$cf_add_incdir"
Steve Kondikae271bc2015-11-15 02:50:53 +01009414 then
9415 cf_have_incdir=no
9416 if test -n "$CFLAGS$CPPFLAGS" ; then
9417 # a loop is needed to ensure we can add subdirs of existing dirs
9418 for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
9419 if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
9420 cf_have_incdir=yes; break
9421 fi
9422 done
9423 fi
9424
9425 if test "$cf_have_incdir" = no ; then
9426 if test "$cf_add_incdir" = /usr/local/include ; then
9427 if test "$GCC" = yes
9428 then
9429 cf_save_CPPFLAGS=$CPPFLAGS
micky3879b9f5e72025-07-08 18:04:53 -04009430
9431 test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
9432 CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
9433
9434 cat >"conftest.$ac_ext" <<_ACEOF
9435#line 9435 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +01009436#include "confdefs.h"
9437#include <stdio.h>
9438int
micky3879b9f5e72025-07-08 18:04:53 -04009439main (void)
Steve Kondikae271bc2015-11-15 02:50:53 +01009440{
9441printf("Hello")
9442 ;
9443 return 0;
9444}
9445_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -04009446rm -f "conftest.$ac_objext"
9447if { (eval echo "$as_me:9447: \"$ac_compile\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01009448 (eval $ac_compile) 2>&5
9449 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -04009450 echo "$as_me:9450: \$? = $ac_status" >&5
9451 (exit "$ac_status"); } &&
9452 { ac_try='test -s "conftest.$ac_objext"'
9453 { (eval echo "$as_me:9453: \"$ac_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01009454 (eval $ac_try) 2>&5
9455 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -04009456 echo "$as_me:9456: \$? = $ac_status" >&5
9457 (exit "$ac_status"); }; }; then
Steve Kondikae271bc2015-11-15 02:50:53 +01009458 :
9459else
9460 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -04009461cat "conftest.$ac_ext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01009462cf_have_incdir=yes
9463fi
micky3879b9f5e72025-07-08 18:04:53 -04009464rm -f "conftest.$ac_objext" "conftest.$ac_ext"
Steve Kondikae271bc2015-11-15 02:50:53 +01009465 CPPFLAGS=$cf_save_CPPFLAGS
9466 fi
9467 fi
9468 fi
9469
9470 if test "$cf_have_incdir" = no ; then
9471 test -n "$verbose" && echo " adding $cf_add_incdir to include-path" 1>&6
9472
micky3879b9f5e72025-07-08 18:04:53 -04009473echo "${as_me:-configure}:9473: testing adding $cf_add_incdir to include-path ..." 1>&5
Steve Kondikae271bc2015-11-15 02:50:53 +01009474
9475 CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
9476
micky3879b9f5e72025-07-08 18:04:53 -04009477 cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
Steve Kondikae271bc2015-11-15 02:50:53 +01009478 test "$cf_top_incdir" = "$cf_add_incdir" && break
9479 cf_add_incdir="$cf_top_incdir"
9480 else
9481 break
9482 fi
9483 else
9484 break
9485 fi
9486 done
9487 done
9488fi
9489
9490}
9491
micky3879b9f5e72025-07-08 18:04:53 -04009492echo "$as_me:9492: checking for $cf_ncuhdr_root header in include-path" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01009493echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
9494if test "${cf_cv_ncurses_h+set}" = set; then
9495 echo $ECHO_N "(cached) $ECHO_C" >&6
9496else
9497
9498 cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
micky3879b9f5e72025-07-08 18:04:53 -04009499 { test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw; } && cf_header_list="$cf_header_list curses.h ncurses.h"
Steve Kondikae271bc2015-11-15 02:50:53 +01009500 for cf_header in $cf_header_list
9501 do
9502
micky3879b9f5e72025-07-08 18:04:53 -04009503 cat >"conftest.$ac_ext" <<_ACEOF
9504#line 9504 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +01009505#include "confdefs.h"
9506
9507#include <$cf_header>
9508int
micky3879b9f5e72025-07-08 18:04:53 -04009509main (void)
Steve Kondikae271bc2015-11-15 02:50:53 +01009510{
9511
9512#ifdef NCURSES_VERSION
9513
micky3879b9f5e72025-07-08 18:04:53 -04009514printf("%s\\n", NCURSES_VERSION);
Steve Kondikae271bc2015-11-15 02:50:53 +01009515#else
9516#ifdef __NCURSES_H
micky3879b9f5e72025-07-08 18:04:53 -04009517printf("old\\n");
Steve Kondikae271bc2015-11-15 02:50:53 +01009518#else
micky3879b9f5e72025-07-08 18:04:53 -04009519 #error __NCURSES_H is not defined
Steve Kondikae271bc2015-11-15 02:50:53 +01009520#endif
9521#endif
9522
9523 ;
9524 return 0;
9525}
9526_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -04009527rm -f "conftest.$ac_objext"
9528if { (eval echo "$as_me:9528: \"$ac_compile\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01009529 (eval $ac_compile) 2>&5
9530 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -04009531 echo "$as_me:9531: \$? = $ac_status" >&5
9532 (exit "$ac_status"); } &&
9533 { ac_try='test -s "conftest.$ac_objext"'
9534 { (eval echo "$as_me:9534: \"$ac_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01009535 (eval $ac_try) 2>&5
9536 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -04009537 echo "$as_me:9537: \$? = $ac_status" >&5
9538 (exit "$ac_status"); }; }; then
Steve Kondikae271bc2015-11-15 02:50:53 +01009539 cf_cv_ncurses_h=$cf_header
9540
9541else
9542 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -04009543cat "conftest.$ac_ext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01009544cf_cv_ncurses_h=no
9545fi
micky3879b9f5e72025-07-08 18:04:53 -04009546rm -f "conftest.$ac_objext" "conftest.$ac_ext"
Steve Kondikae271bc2015-11-15 02:50:53 +01009547
9548 test "$cf_cv_ncurses_h" != no && break
9549 done
9550
9551fi
micky3879b9f5e72025-07-08 18:04:53 -04009552echo "$as_me:9552: result: $cf_cv_ncurses_h" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01009553echo "${ECHO_T}$cf_cv_ncurses_h" >&6
9554
9555if test "$cf_cv_ncurses_h" != no ; then
9556 cf_cv_ncurses_header=$cf_cv_ncurses_h
9557else
9558
micky3879b9f5e72025-07-08 18:04:53 -04009559echo "$as_me:9559: checking for $cf_ncuhdr_root include-path" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01009560echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
9561if test "${cf_cv_ncurses_h2+set}" = set; then
9562 echo $ECHO_N "(cached) $ECHO_C" >&6
9563else
9564
9565 test -n "$verbose" && echo
9566
9567cf_search=
9568
9569# collect the current set of include-directories from compiler flags
9570cf_header_path_list=""
9571if test -n "${CFLAGS}${CPPFLAGS}" ; then
9572 for cf_header_path in $CPPFLAGS $CFLAGS
9573 do
micky3879b9f5e72025-07-08 18:04:53 -04009574 case "$cf_header_path" in
Steve Kondikae271bc2015-11-15 02:50:53 +01009575 (-I*)
9576 cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
9577
9578test "x$cf_header_path" != "xNONE" && \
9579test -d "$cf_header_path" && \
9580 {
9581 test -n "$verbose" && echo " ... testing for include-directories under $cf_header_path"
micky3879b9f5e72025-07-08 18:04:53 -04009582 test -d "$cf_header_path/include" && cf_search="$cf_search $cf_header_path/include"
9583 test -d "$cf_header_path/include/$cf_ncuhdr_root" && cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
9584 test -d "$cf_header_path/include/$cf_ncuhdr_root/include" && cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
9585 test -d "$cf_header_path/$cf_ncuhdr_root/include" && cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
9586 test -d "$cf_header_path/$cf_ncuhdr_root/include/$cf_ncuhdr_root" && cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
Steve Kondikae271bc2015-11-15 02:50:53 +01009587}
9588
9589 cf_header_path_list="$cf_header_path_list $cf_search"
9590 ;;
9591 esac
9592 done
9593fi
9594
9595# add the variations for the package we are looking for
9596
9597cf_search=
9598
9599test "x$prefix" != "xNONE" && \
9600test -d "$prefix" && \
9601 {
9602 test -n "$verbose" && echo " ... testing for include-directories under $prefix"
micky3879b9f5e72025-07-08 18:04:53 -04009603 test -d "$prefix/include" && cf_search="$cf_search $prefix/include"
9604 test -d "$prefix/include/$cf_ncuhdr_root" && cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
9605 test -d "$prefix/include/$cf_ncuhdr_root/include" && cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
9606 test -d "$prefix/$cf_ncuhdr_root/include" && cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
9607 test -d "$prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root" && cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
Steve Kondikae271bc2015-11-15 02:50:53 +01009608}
9609
9610for cf_subdir_prefix in \
9611 /usr \
9612 /usr/local \
9613 /usr/pkg \
9614 /opt \
9615 /opt/local \
9616 $HOME
9617do
9618
9619test "x$cf_subdir_prefix" != "x$prefix" && \
9620test -d "$cf_subdir_prefix" && \
micky3879b9f5e72025-07-08 18:04:53 -04009621{ test -z "$prefix" || test "x$prefix" = xNONE || test "x$cf_subdir_prefix" != "x$prefix"; } && {
Steve Kondikae271bc2015-11-15 02:50:53 +01009622 test -n "$verbose" && echo " ... testing for include-directories under $cf_subdir_prefix"
micky3879b9f5e72025-07-08 18:04:53 -04009623 test -d "$cf_subdir_prefix/include" && cf_search="$cf_search $cf_subdir_prefix/include"
9624 test -d "$cf_subdir_prefix/include/$cf_ncuhdr_root" && cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root"
9625 test -d "$cf_subdir_prefix/include/$cf_ncuhdr_root/include" && cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root/include"
9626 test -d "$cf_subdir_prefix/$cf_ncuhdr_root/include" && cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include"
9627 test -d "$cf_subdir_prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root" && cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
Steve Kondikae271bc2015-11-15 02:50:53 +01009628}
9629
9630done
9631
9632test "$includedir" != NONE && \
9633test "$includedir" != "/usr/include" && \
9634test -d "$includedir" && {
micky3879b9f5e72025-07-08 18:04:53 -04009635 test -d "$includedir" && cf_search="$cf_search $includedir"
9636 test -d "$includedir/$cf_ncuhdr_root" && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
Steve Kondikae271bc2015-11-15 02:50:53 +01009637}
9638
9639test "$oldincludedir" != NONE && \
9640test "$oldincludedir" != "/usr/include" && \
9641test -d "$oldincludedir" && {
micky3879b9f5e72025-07-08 18:04:53 -04009642 test -d "$oldincludedir" && cf_search="$cf_search $oldincludedir"
9643 test -d "$oldincludedir/$cf_ncuhdr_root" && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
Steve Kondikae271bc2015-11-15 02:50:53 +01009644}
9645
9646cf_search="$cf_search $cf_header_path_list"
9647
micky3879b9f5e72025-07-08 18:04:53 -04009648 test -n "$verbose" && echo "search path $cf_search"
Steve Kondikae271bc2015-11-15 02:50:53 +01009649 cf_save2_CPPFLAGS="$CPPFLAGS"
9650 for cf_incdir in $cf_search
9651 do
9652
9653if test -n "$cf_incdir" ; then
9654 for cf_add_incdir in $cf_incdir
9655 do
micky3879b9f5e72025-07-08 18:04:53 -04009656 while test "$cf_add_incdir" != /usr/include
Steve Kondikae271bc2015-11-15 02:50:53 +01009657 do
micky3879b9f5e72025-07-08 18:04:53 -04009658 if test -d "$cf_add_incdir"
Steve Kondikae271bc2015-11-15 02:50:53 +01009659 then
9660 cf_have_incdir=no
9661 if test -n "$CFLAGS$CPPFLAGS" ; then
9662 # a loop is needed to ensure we can add subdirs of existing dirs
9663 for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
9664 if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
9665 cf_have_incdir=yes; break
9666 fi
9667 done
9668 fi
9669
9670 if test "$cf_have_incdir" = no ; then
9671 if test "$cf_add_incdir" = /usr/local/include ; then
9672 if test "$GCC" = yes
9673 then
9674 cf_save_CPPFLAGS=$CPPFLAGS
micky3879b9f5e72025-07-08 18:04:53 -04009675
9676 test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
9677 CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
9678
9679 cat >"conftest.$ac_ext" <<_ACEOF
9680#line 9680 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +01009681#include "confdefs.h"
9682#include <stdio.h>
9683int
micky3879b9f5e72025-07-08 18:04:53 -04009684main (void)
Steve Kondikae271bc2015-11-15 02:50:53 +01009685{
9686printf("Hello")
9687 ;
9688 return 0;
9689}
9690_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -04009691rm -f "conftest.$ac_objext"
9692if { (eval echo "$as_me:9692: \"$ac_compile\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01009693 (eval $ac_compile) 2>&5
9694 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -04009695 echo "$as_me:9695: \$? = $ac_status" >&5
9696 (exit "$ac_status"); } &&
9697 { ac_try='test -s "conftest.$ac_objext"'
9698 { (eval echo "$as_me:9698: \"$ac_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01009699 (eval $ac_try) 2>&5
9700 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -04009701 echo "$as_me:9701: \$? = $ac_status" >&5
9702 (exit "$ac_status"); }; }; then
Steve Kondikae271bc2015-11-15 02:50:53 +01009703 :
9704else
9705 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -04009706cat "conftest.$ac_ext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01009707cf_have_incdir=yes
9708fi
micky3879b9f5e72025-07-08 18:04:53 -04009709rm -f "conftest.$ac_objext" "conftest.$ac_ext"
Steve Kondikae271bc2015-11-15 02:50:53 +01009710 CPPFLAGS=$cf_save_CPPFLAGS
9711 fi
9712 fi
9713 fi
9714
9715 if test "$cf_have_incdir" = no ; then
9716 test -n "$verbose" && echo " adding $cf_add_incdir to include-path" 1>&6
9717
micky3879b9f5e72025-07-08 18:04:53 -04009718echo "${as_me:-configure}:9718: testing adding $cf_add_incdir to include-path ..." 1>&5
Steve Kondikae271bc2015-11-15 02:50:53 +01009719
9720 CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
9721
micky3879b9f5e72025-07-08 18:04:53 -04009722 cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
Steve Kondikae271bc2015-11-15 02:50:53 +01009723 test "$cf_top_incdir" = "$cf_add_incdir" && break
9724 cf_add_incdir="$cf_top_incdir"
9725 else
9726 break
9727 fi
9728 else
9729 break
9730 fi
9731 done
9732 done
9733fi
9734
9735 for cf_header in \
9736 ncurses.h \
9737 curses.h
9738 do
9739
micky3879b9f5e72025-07-08 18:04:53 -04009740 cat >"conftest.$ac_ext" <<_ACEOF
9741#line 9741 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +01009742#include "confdefs.h"
9743
9744#include <$cf_header>
9745int
micky3879b9f5e72025-07-08 18:04:53 -04009746main (void)
Steve Kondikae271bc2015-11-15 02:50:53 +01009747{
9748
9749#ifdef NCURSES_VERSION
9750
micky3879b9f5e72025-07-08 18:04:53 -04009751printf("%s\\n", NCURSES_VERSION);
Steve Kondikae271bc2015-11-15 02:50:53 +01009752#else
9753#ifdef __NCURSES_H
micky3879b9f5e72025-07-08 18:04:53 -04009754printf("old\\n");
Steve Kondikae271bc2015-11-15 02:50:53 +01009755#else
micky3879b9f5e72025-07-08 18:04:53 -04009756 #error __NCURSES_H is not defined
Steve Kondikae271bc2015-11-15 02:50:53 +01009757#endif
9758#endif
9759
9760 ;
9761 return 0;
9762}
9763_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -04009764rm -f "conftest.$ac_objext"
9765if { (eval echo "$as_me:9765: \"$ac_compile\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01009766 (eval $ac_compile) 2>&5
9767 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -04009768 echo "$as_me:9768: \$? = $ac_status" >&5
9769 (exit "$ac_status"); } &&
9770 { ac_try='test -s "conftest.$ac_objext"'
9771 { (eval echo "$as_me:9771: \"$ac_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01009772 (eval $ac_try) 2>&5
9773 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -04009774 echo "$as_me:9774: \$? = $ac_status" >&5
9775 (exit "$ac_status"); }; }; then
Steve Kondikae271bc2015-11-15 02:50:53 +01009776 cf_cv_ncurses_h2=$cf_header
9777
9778else
9779 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -04009780cat "conftest.$ac_ext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01009781cf_cv_ncurses_h2=no
9782fi
micky3879b9f5e72025-07-08 18:04:53 -04009783rm -f "conftest.$ac_objext" "conftest.$ac_ext"
Steve Kondikae271bc2015-11-15 02:50:53 +01009784
9785 if test "$cf_cv_ncurses_h2" != no ; then
9786 cf_cv_ncurses_h2=$cf_incdir/$cf_header
micky3879b9f5e72025-07-08 18:04:53 -04009787 test -n "$verbose" && echo $ECHO_N " ... found $ECHO_C" 1>&6
Steve Kondikae271bc2015-11-15 02:50:53 +01009788 break
9789 fi
9790 test -n "$verbose" && echo " ... tested $cf_incdir/$cf_header" 1>&6
9791 done
9792 CPPFLAGS="$cf_save2_CPPFLAGS"
9793 test "$cf_cv_ncurses_h2" != no && break
9794 done
micky3879b9f5e72025-07-08 18:04:53 -04009795 test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:9795: error: not found" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01009796echo "$as_me: error: not found" >&2;}
9797 { (exit 1); exit 1; }; }
9798
9799fi
micky3879b9f5e72025-07-08 18:04:53 -04009800echo "$as_me:9800: result: $cf_cv_ncurses_h2" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01009801echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
9802
micky3879b9f5e72025-07-08 18:04:53 -04009803 cf_1st_incdir=`echo "$cf_cv_ncurses_h2" | sed -e 's%/[^/]*$%%'`
9804 cf_cv_ncurses_header="`basename "$cf_cv_ncurses_h2"`"
9805 if test "`basename "$cf_1st_incdir"`" = "$cf_ncuhdr_root" ; then
9806 cf_cv_ncurses_header="$cf_ncuhdr_root/$cf_cv_ncurses_header"
Steve Kondikae271bc2015-11-15 02:50:53 +01009807 fi
9808
9809if test -n "$cf_1st_incdir" ; then
9810 for cf_add_incdir in $cf_1st_incdir
9811 do
micky3879b9f5e72025-07-08 18:04:53 -04009812 while test "$cf_add_incdir" != /usr/include
Steve Kondikae271bc2015-11-15 02:50:53 +01009813 do
micky3879b9f5e72025-07-08 18:04:53 -04009814 if test -d "$cf_add_incdir"
Steve Kondikae271bc2015-11-15 02:50:53 +01009815 then
9816 cf_have_incdir=no
9817 if test -n "$CFLAGS$CPPFLAGS" ; then
9818 # a loop is needed to ensure we can add subdirs of existing dirs
9819 for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
9820 if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
9821 cf_have_incdir=yes; break
9822 fi
9823 done
9824 fi
9825
9826 if test "$cf_have_incdir" = no ; then
9827 if test "$cf_add_incdir" = /usr/local/include ; then
9828 if test "$GCC" = yes
9829 then
9830 cf_save_CPPFLAGS=$CPPFLAGS
micky3879b9f5e72025-07-08 18:04:53 -04009831
9832 test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
9833 CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
9834
9835 cat >"conftest.$ac_ext" <<_ACEOF
9836#line 9836 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +01009837#include "confdefs.h"
9838#include <stdio.h>
9839int
micky3879b9f5e72025-07-08 18:04:53 -04009840main (void)
Steve Kondikae271bc2015-11-15 02:50:53 +01009841{
9842printf("Hello")
9843 ;
9844 return 0;
9845}
9846_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -04009847rm -f "conftest.$ac_objext"
9848if { (eval echo "$as_me:9848: \"$ac_compile\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01009849 (eval $ac_compile) 2>&5
9850 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -04009851 echo "$as_me:9851: \$? = $ac_status" >&5
9852 (exit "$ac_status"); } &&
9853 { ac_try='test -s "conftest.$ac_objext"'
9854 { (eval echo "$as_me:9854: \"$ac_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01009855 (eval $ac_try) 2>&5
9856 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -04009857 echo "$as_me:9857: \$? = $ac_status" >&5
9858 (exit "$ac_status"); }; }; then
Steve Kondikae271bc2015-11-15 02:50:53 +01009859 :
9860else
9861 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -04009862cat "conftest.$ac_ext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01009863cf_have_incdir=yes
9864fi
micky3879b9f5e72025-07-08 18:04:53 -04009865rm -f "conftest.$ac_objext" "conftest.$ac_ext"
Steve Kondikae271bc2015-11-15 02:50:53 +01009866 CPPFLAGS=$cf_save_CPPFLAGS
9867 fi
9868 fi
9869 fi
9870
9871 if test "$cf_have_incdir" = no ; then
9872 test -n "$verbose" && echo " adding $cf_add_incdir to include-path" 1>&6
9873
micky3879b9f5e72025-07-08 18:04:53 -04009874echo "${as_me:-configure}:9874: testing adding $cf_add_incdir to include-path ..." 1>&5
Steve Kondikae271bc2015-11-15 02:50:53 +01009875
9876 CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
9877
micky3879b9f5e72025-07-08 18:04:53 -04009878 cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
Steve Kondikae271bc2015-11-15 02:50:53 +01009879 test "$cf_top_incdir" = "$cf_add_incdir" && break
9880 cf_add_incdir="$cf_top_incdir"
9881 else
9882 break
9883 fi
9884 else
9885 break
9886 fi
9887 done
9888 done
9889fi
9890
9891fi
9892
9893# Set definitions to allow ifdef'ing for ncurses.h
9894
micky3879b9f5e72025-07-08 18:04:53 -04009895case "$cf_cv_ncurses_header" in
Steve Kondikae271bc2015-11-15 02:50:53 +01009896(*ncurses.h)
9897
9898cat >>confdefs.h <<\EOF
9899#define HAVE_NCURSES_H 1
9900EOF
9901
9902 ;;
9903esac
9904
micky3879b9f5e72025-07-08 18:04:53 -04009905case "$cf_cv_ncurses_header" in
Steve Kondikae271bc2015-11-15 02:50:53 +01009906(ncurses/curses.h|ncurses/ncurses.h)
9907
9908cat >>confdefs.h <<\EOF
9909#define HAVE_NCURSES_NCURSES_H 1
9910EOF
9911
9912 ;;
9913(ncursesw/curses.h|ncursesw/ncurses.h)
9914
9915cat >>confdefs.h <<\EOF
9916#define HAVE_NCURSESW_NCURSES_H 1
9917EOF
9918
9919 ;;
9920esac
9921
micky3879b9f5e72025-07-08 18:04:53 -04009922echo "$as_me:9922: checking for terminfo header" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01009923echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
9924if test "${cf_cv_term_header+set}" = set; then
9925 echo $ECHO_N "(cached) $ECHO_C" >&6
9926else
9927
micky3879b9f5e72025-07-08 18:04:53 -04009928case "${cf_cv_ncurses_header}" in
Steve Kondikae271bc2015-11-15 02:50:53 +01009929(*/ncurses.h|*/ncursesw.h)
9930 cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
9931 ;;
9932(*)
9933 cf_term_header=term.h
9934 ;;
9935esac
9936
9937for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
9938do
micky3879b9f5e72025-07-08 18:04:53 -04009939cat >"conftest.$ac_ext" <<_ACEOF
9940#line 9940 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +01009941#include "confdefs.h"
9942#include <stdio.h>
9943#include <${cf_cv_ncurses_header:-curses.h}>
9944#include <$cf_test>
9945
9946int
micky3879b9f5e72025-07-08 18:04:53 -04009947main (void)
Steve Kondikae271bc2015-11-15 02:50:53 +01009948{
micky3879b9f5e72025-07-08 18:04:53 -04009949int x = auto_left_margin; (void)x
Steve Kondikae271bc2015-11-15 02:50:53 +01009950 ;
9951 return 0;
9952}
9953_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -04009954rm -f "conftest.$ac_objext"
9955if { (eval echo "$as_me:9955: \"$ac_compile\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01009956 (eval $ac_compile) 2>&5
9957 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -04009958 echo "$as_me:9958: \$? = $ac_status" >&5
9959 (exit "$ac_status"); } &&
9960 { ac_try='test -s "conftest.$ac_objext"'
9961 { (eval echo "$as_me:9961: \"$ac_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01009962 (eval $ac_try) 2>&5
9963 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -04009964 echo "$as_me:9964: \$? = $ac_status" >&5
9965 (exit "$ac_status"); }; }; then
Steve Kondikae271bc2015-11-15 02:50:53 +01009966
9967 cf_cv_term_header="$cf_test"
9968else
9969 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -04009970cat "conftest.$ac_ext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01009971
9972 cf_cv_term_header=unknown
9973
9974fi
micky3879b9f5e72025-07-08 18:04:53 -04009975rm -f "conftest.$ac_objext" "conftest.$ac_ext"
Steve Kondikae271bc2015-11-15 02:50:53 +01009976 test "$cf_cv_term_header" != unknown && break
9977done
9978
9979fi
micky3879b9f5e72025-07-08 18:04:53 -04009980echo "$as_me:9980: result: $cf_cv_term_header" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01009981echo "${ECHO_T}$cf_cv_term_header" >&6
9982
9983# Set definitions to allow ifdef'ing to accommodate subdirectories
9984
micky3879b9f5e72025-07-08 18:04:53 -04009985case "$cf_cv_term_header" in
Steve Kondikae271bc2015-11-15 02:50:53 +01009986(*term.h)
9987
9988cat >>confdefs.h <<\EOF
9989#define HAVE_TERM_H 1
9990EOF
9991
9992 ;;
9993esac
9994
micky3879b9f5e72025-07-08 18:04:53 -04009995case "$cf_cv_term_header" in
Steve Kondikae271bc2015-11-15 02:50:53 +01009996(ncurses/term.h)
9997
9998cat >>confdefs.h <<\EOF
9999#define HAVE_NCURSES_TERM_H 1
10000EOF
10001
10002 ;;
10003(ncursesw/term.h)
10004
10005cat >>confdefs.h <<\EOF
10006#define HAVE_NCURSESW_TERM_H 1
10007EOF
10008
10009 ;;
10010esac
10011
10012# some applications need this, but should check for NCURSES_VERSION
10013
10014cat >>confdefs.h <<\EOF
10015#define NCURSES 1
10016EOF
10017
micky3879b9f5e72025-07-08 18:04:53 -040010018echo "$as_me:10018: checking for ncurses version" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010010019echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
10020if test "${cf_cv_ncurses_version+set}" = set; then
10021 echo $ECHO_N "(cached) $ECHO_C" >&6
10022else
10023
10024 cf_cv_ncurses_version=no
10025 cf_tempfile=out$$
micky3879b9f5e72025-07-08 18:04:53 -040010026 rm -f "$cf_tempfile"
Steve Kondikae271bc2015-11-15 02:50:53 +010010027 if test "$cross_compiling" = yes; then
10028
10029 # This will not work if the preprocessor splits the line after the
10030 # Autoconf token. The 'unproto' program does that.
micky3879b9f5e72025-07-08 18:04:53 -040010031 cat > "conftest.$ac_ext" <<EOF
Steve Kondikae271bc2015-11-15 02:50:53 +010010032#include <${cf_cv_ncurses_header:-curses.h}>
10033#undef Autoconf
10034#ifdef NCURSES_VERSION
10035Autoconf NCURSES_VERSION
10036#else
10037#ifdef __NCURSES_H
10038Autoconf "old"
10039#endif
10040;
10041#endif
10042EOF
10043 cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
micky3879b9f5e72025-07-08 18:04:53 -040010044 { (eval echo "$as_me:10044: \"$cf_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010010045 (eval $cf_try) 2>&5
10046 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040010047 echo "$as_me:10047: \$? = $ac_status" >&5
10048 (exit "$ac_status"); }
Steve Kondikae271bc2015-11-15 02:50:53 +010010049 if test -f conftest.out ; then
micky3879b9f5e72025-07-08 18:04:53 -040010050 cf_out=`sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%' conftest.out`
Steve Kondikae271bc2015-11-15 02:50:53 +010010051 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
10052 rm -f conftest.out
10053 fi
10054
10055else
micky3879b9f5e72025-07-08 18:04:53 -040010056 cat >"conftest.$ac_ext" <<_ACEOF
10057#line 10057 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +010010058#include "confdefs.h"
10059
micky3879b9f5e72025-07-08 18:04:53 -040010060$ac_includes_default
10061
Steve Kondikae271bc2015-11-15 02:50:53 +010010062#include <${cf_cv_ncurses_header:-curses.h}>
micky3879b9f5e72025-07-08 18:04:53 -040010063
10064int main(void)
Steve Kondikae271bc2015-11-15 02:50:53 +010010065{
10066 FILE *fp = fopen("$cf_tempfile", "w");
10067#ifdef NCURSES_VERSION
10068# ifdef NCURSES_VERSION_PATCH
micky3879b9f5e72025-07-08 18:04:53 -040010069 fprintf(fp, "%s.%d\\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
Steve Kondikae271bc2015-11-15 02:50:53 +010010070# else
micky3879b9f5e72025-07-08 18:04:53 -040010071 fprintf(fp, "%s\\n", NCURSES_VERSION);
Steve Kondikae271bc2015-11-15 02:50:53 +010010072# endif
10073#else
10074# ifdef __NCURSES_H
micky3879b9f5e72025-07-08 18:04:53 -040010075 fprintf(fp, "old\\n");
Steve Kondikae271bc2015-11-15 02:50:53 +010010076# else
micky3879b9f5e72025-07-08 18:04:53 -040010077 #error expected ncurses header to define __NCURSES_H
Steve Kondikae271bc2015-11-15 02:50:53 +010010078# endif
10079#endif
10080 ${cf_cv_main_return:-return}(0);
10081}
10082_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -040010083rm -f "conftest$ac_exeext"
10084if { (eval echo "$as_me:10084: \"$ac_link\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010010085 (eval $ac_link) 2>&5
10086 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040010087 echo "$as_me:10087: \$? = $ac_status" >&5
10088 (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
10089 { (eval echo "$as_me:10089: \"$ac_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010010090 (eval $ac_try) 2>&5
10091 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040010092 echo "$as_me:10092: \$? = $ac_status" >&5
10093 (exit "$ac_status"); }; }; then
Steve Kondikae271bc2015-11-15 02:50:53 +010010094
10095 cf_cv_ncurses_version=`cat $cf_tempfile`
10096else
10097 echo "$as_me: program exited with status $ac_status" >&5
10098echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -040010099cat "conftest.$ac_ext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010010100fi
micky3879b9f5e72025-07-08 18:04:53 -040010101rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
Steve Kondikae271bc2015-11-15 02:50:53 +010010102fi
micky3879b9f5e72025-07-08 18:04:53 -040010103 rm -f "$cf_tempfile"
Steve Kondikae271bc2015-11-15 02:50:53 +010010104
10105fi
micky3879b9f5e72025-07-08 18:04:53 -040010106echo "$as_me:10106: result: $cf_cv_ncurses_version" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010010107echo "${ECHO_T}$cf_cv_ncurses_version" >&6
10108test "$cf_cv_ncurses_version" = no ||
10109cat >>confdefs.h <<\EOF
10110#define NCURSES 1
10111EOF
10112
10113cf_nculib_root=$cf_cv_screen
10114 # This works, except for the special case where we find gpm, but
10115 # ncurses is in a nonstandard location via $LIBS, and we really want
10116 # to link gpm.
10117cf_ncurses_LIBS=""
10118cf_ncurses_SAVE="$LIBS"
micky3879b9f5e72025-07-08 18:04:53 -040010119echo "$as_me:10119: checking for Gpm_Open in -lgpm" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010010120echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
10121if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
10122 echo $ECHO_N "(cached) $ECHO_C" >&6
10123else
10124 ac_check_lib_save_LIBS=$LIBS
10125LIBS="-lgpm $LIBS"
micky3879b9f5e72025-07-08 18:04:53 -040010126cat >"conftest.$ac_ext" <<_ACEOF
10127#line 10127 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +010010128#include "confdefs.h"
10129
10130/* Override any gcc2 internal prototype to avoid an error. */
10131#ifdef __cplusplus
10132extern "C"
10133#endif
10134/* We use char because int might match the return type of a gcc2
10135 builtin and then its argument prototype would still apply. */
micky3879b9f5e72025-07-08 18:04:53 -040010136char Gpm_Open (void);
Steve Kondikae271bc2015-11-15 02:50:53 +010010137int
micky3879b9f5e72025-07-08 18:04:53 -040010138main (void)
Steve Kondikae271bc2015-11-15 02:50:53 +010010139{
10140Gpm_Open ();
10141 ;
10142 return 0;
10143}
10144_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -040010145rm -f "conftest.$ac_objext" "conftest$ac_exeext"
10146if { (eval echo "$as_me:10146: \"$ac_link\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010010147 (eval $ac_link) 2>&5
10148 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040010149 echo "$as_me:10149: \$? = $ac_status" >&5
10150 (exit "$ac_status"); } &&
10151 { ac_try='test -s "conftest$ac_exeext"'
10152 { (eval echo "$as_me:10152: \"$ac_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010010153 (eval $ac_try) 2>&5
10154 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040010155 echo "$as_me:10155: \$? = $ac_status" >&5
10156 (exit "$ac_status"); }; }; then
Steve Kondikae271bc2015-11-15 02:50:53 +010010157 ac_cv_lib_gpm_Gpm_Open=yes
10158else
10159 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -040010160cat "conftest.$ac_ext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010010161ac_cv_lib_gpm_Gpm_Open=no
10162fi
micky3879b9f5e72025-07-08 18:04:53 -040010163rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
Steve Kondikae271bc2015-11-15 02:50:53 +010010164LIBS=$ac_check_lib_save_LIBS
10165fi
micky3879b9f5e72025-07-08 18:04:53 -040010166echo "$as_me:10166: result: $ac_cv_lib_gpm_Gpm_Open" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010010167echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
micky3879b9f5e72025-07-08 18:04:53 -040010168if test "$ac_cv_lib_gpm_Gpm_Open" = yes; then
10169 echo "$as_me:10169: checking for initscr in -lgpm" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010010170echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
10171if test "${ac_cv_lib_gpm_initscr+set}" = set; then
10172 echo $ECHO_N "(cached) $ECHO_C" >&6
10173else
10174 ac_check_lib_save_LIBS=$LIBS
10175LIBS="-lgpm $LIBS"
micky3879b9f5e72025-07-08 18:04:53 -040010176cat >"conftest.$ac_ext" <<_ACEOF
10177#line 10177 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +010010178#include "confdefs.h"
10179
10180/* Override any gcc2 internal prototype to avoid an error. */
10181#ifdef __cplusplus
10182extern "C"
10183#endif
10184/* We use char because int might match the return type of a gcc2
10185 builtin and then its argument prototype would still apply. */
micky3879b9f5e72025-07-08 18:04:53 -040010186char initscr (void);
Steve Kondikae271bc2015-11-15 02:50:53 +010010187int
micky3879b9f5e72025-07-08 18:04:53 -040010188main (void)
Steve Kondikae271bc2015-11-15 02:50:53 +010010189{
10190initscr ();
10191 ;
10192 return 0;
10193}
10194_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -040010195rm -f "conftest.$ac_objext" "conftest$ac_exeext"
10196if { (eval echo "$as_me:10196: \"$ac_link\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010010197 (eval $ac_link) 2>&5
10198 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040010199 echo "$as_me:10199: \$? = $ac_status" >&5
10200 (exit "$ac_status"); } &&
10201 { ac_try='test -s "conftest$ac_exeext"'
10202 { (eval echo "$as_me:10202: \"$ac_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010010203 (eval $ac_try) 2>&5
10204 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040010205 echo "$as_me:10205: \$? = $ac_status" >&5
10206 (exit "$ac_status"); }; }; then
Steve Kondikae271bc2015-11-15 02:50:53 +010010207 ac_cv_lib_gpm_initscr=yes
10208else
10209 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -040010210cat "conftest.$ac_ext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010010211ac_cv_lib_gpm_initscr=no
10212fi
micky3879b9f5e72025-07-08 18:04:53 -040010213rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
Steve Kondikae271bc2015-11-15 02:50:53 +010010214LIBS=$ac_check_lib_save_LIBS
10215fi
micky3879b9f5e72025-07-08 18:04:53 -040010216echo "$as_me:10216: result: $ac_cv_lib_gpm_initscr" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010010217echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
micky3879b9f5e72025-07-08 18:04:53 -040010218if test "$ac_cv_lib_gpm_initscr" = yes; then
Steve Kondikae271bc2015-11-15 02:50:53 +010010219 LIBS="$cf_ncurses_SAVE"
10220else
10221 cf_ncurses_LIBS="-lgpm"
10222fi
10223
10224fi
10225
micky3879b9f5e72025-07-08 18:04:53 -040010226case "$host_os" in
Steve Kondikae271bc2015-11-15 02:50:53 +010010227(freebsd*)
10228 # This is only necessary if you are linking against an obsolete
micky3879b9f5e72025-07-08 18:04:53 -040010229 # version of ncurses (but it should do no harm, since it is static).
Steve Kondikae271bc2015-11-15 02:50:53 +010010230 if test "$cf_nculib_root" = ncurses ; then
micky3879b9f5e72025-07-08 18:04:53 -040010231 echo "$as_me:10231: checking for tgoto in -lmytinfo" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010010232echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
10233if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
10234 echo $ECHO_N "(cached) $ECHO_C" >&6
10235else
10236 ac_check_lib_save_LIBS=$LIBS
10237LIBS="-lmytinfo $LIBS"
micky3879b9f5e72025-07-08 18:04:53 -040010238cat >"conftest.$ac_ext" <<_ACEOF
10239#line 10239 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +010010240#include "confdefs.h"
10241
10242/* Override any gcc2 internal prototype to avoid an error. */
10243#ifdef __cplusplus
10244extern "C"
10245#endif
10246/* We use char because int might match the return type of a gcc2
10247 builtin and then its argument prototype would still apply. */
micky3879b9f5e72025-07-08 18:04:53 -040010248char tgoto (void);
Steve Kondikae271bc2015-11-15 02:50:53 +010010249int
micky3879b9f5e72025-07-08 18:04:53 -040010250main (void)
Steve Kondikae271bc2015-11-15 02:50:53 +010010251{
10252tgoto ();
10253 ;
10254 return 0;
10255}
10256_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -040010257rm -f "conftest.$ac_objext" "conftest$ac_exeext"
10258if { (eval echo "$as_me:10258: \"$ac_link\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010010259 (eval $ac_link) 2>&5
10260 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040010261 echo "$as_me:10261: \$? = $ac_status" >&5
10262 (exit "$ac_status"); } &&
10263 { ac_try='test -s "conftest$ac_exeext"'
10264 { (eval echo "$as_me:10264: \"$ac_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010010265 (eval $ac_try) 2>&5
10266 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040010267 echo "$as_me:10267: \$? = $ac_status" >&5
10268 (exit "$ac_status"); }; }; then
Steve Kondikae271bc2015-11-15 02:50:53 +010010269 ac_cv_lib_mytinfo_tgoto=yes
10270else
10271 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -040010272cat "conftest.$ac_ext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010010273ac_cv_lib_mytinfo_tgoto=no
10274fi
micky3879b9f5e72025-07-08 18:04:53 -040010275rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
Steve Kondikae271bc2015-11-15 02:50:53 +010010276LIBS=$ac_check_lib_save_LIBS
10277fi
micky3879b9f5e72025-07-08 18:04:53 -040010278echo "$as_me:10278: result: $ac_cv_lib_mytinfo_tgoto" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010010279echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
micky3879b9f5e72025-07-08 18:04:53 -040010280if test "$ac_cv_lib_mytinfo_tgoto" = yes; then
Steve Kondikae271bc2015-11-15 02:50:53 +010010281 cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
10282fi
10283
10284 fi
10285 ;;
10286esac
10287
micky3879b9f5e72025-07-08 18:04:53 -040010288cf_add_libs="$LIBS"
10289# reverse order
10290cf_add_0lib=
10291for cf_add_1lib in $cf_ncurses_LIBS; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
10292# filter duplicates
10293for cf_add_1lib in $cf_add_0lib; do
10294 for cf_add_2lib in $cf_add_libs; do
10295 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
Steve Kondikae271bc2015-11-15 02:50:53 +010010296 cf_add_1lib=
10297 break
10298 fi
10299 done
micky3879b9f5e72025-07-08 18:04:53 -040010300 test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
Steve Kondikae271bc2015-11-15 02:50:53 +010010301done
10302LIBS="$cf_add_libs"
10303
micky3879b9f5e72025-07-08 18:04:53 -040010304if test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no"
Steve Kondikae271bc2015-11-15 02:50:53 +010010305then
10306
micky3879b9f5e72025-07-08 18:04:53 -040010307cf_add_libs="$LIBS"
10308# reverse order
10309cf_add_0lib=
10310for cf_add_1lib in -l$cf_nculib_root; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
10311# filter duplicates
10312for cf_add_1lib in $cf_add_0lib; do
10313 for cf_add_2lib in $cf_add_libs; do
10314 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
Steve Kondikae271bc2015-11-15 02:50:53 +010010315 cf_add_1lib=
10316 break
10317 fi
10318 done
micky3879b9f5e72025-07-08 18:04:53 -040010319 test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
Steve Kondikae271bc2015-11-15 02:50:53 +010010320done
10321LIBS="$cf_add_libs"
10322
10323else
10324
micky3879b9f5e72025-07-08 18:04:53 -040010325 eval 'cf_cv_have_lib_'"$cf_nculib_root"'=no'
Steve Kondikae271bc2015-11-15 02:50:53 +010010326 cf_libdir=""
micky3879b9f5e72025-07-08 18:04:53 -040010327 echo "$as_me:10327: checking for initscr" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010010328echo $ECHO_N "checking for initscr... $ECHO_C" >&6
10329if test "${ac_cv_func_initscr+set}" = set; then
10330 echo $ECHO_N "(cached) $ECHO_C" >&6
10331else
micky3879b9f5e72025-07-08 18:04:53 -040010332 cat >"conftest.$ac_ext" <<_ACEOF
10333#line 10333 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +010010334#include "confdefs.h"
micky3879b9f5e72025-07-08 18:04:53 -040010335#define initscr autoconf_temporary
10336#include <limits.h> /* least-intrusive standard header which defines gcc2 __stub macros */
10337#undef initscr
10338
Steve Kondikae271bc2015-11-15 02:50:53 +010010339#ifdef __cplusplus
10340extern "C"
10341#endif
micky3879b9f5e72025-07-08 18:04:53 -040010342
Steve Kondikae271bc2015-11-15 02:50:53 +010010343/* We use char because int might match the return type of a gcc2
10344 builtin and then its argument prototype would still apply. */
micky3879b9f5e72025-07-08 18:04:53 -040010345char initscr (void);
Steve Kondikae271bc2015-11-15 02:50:53 +010010346
10347int
micky3879b9f5e72025-07-08 18:04:53 -040010348main (void)
Steve Kondikae271bc2015-11-15 02:50:53 +010010349{
micky3879b9f5e72025-07-08 18:04:53 -040010350
10351/* The GNU C library defines stubs for functions which it implements
Steve Kondikae271bc2015-11-15 02:50:53 +010010352 to always fail with ENOSYS. Some functions are actually named
10353 something starting with __ and the normal name is an alias. */
10354#if defined (__stub_initscr) || defined (__stub___initscr)
micky3879b9f5e72025-07-08 18:04:53 -040010355#error found stub for initscr
Steve Kondikae271bc2015-11-15 02:50:53 +010010356#endif
10357
micky3879b9f5e72025-07-08 18:04:53 -040010358 return initscr ();
Steve Kondikae271bc2015-11-15 02:50:53 +010010359 ;
10360 return 0;
10361}
10362_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -040010363rm -f "conftest.$ac_objext" "conftest$ac_exeext"
10364if { (eval echo "$as_me:10364: \"$ac_link\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010010365 (eval $ac_link) 2>&5
10366 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040010367 echo "$as_me:10367: \$? = $ac_status" >&5
10368 (exit "$ac_status"); } &&
10369 { ac_try='test -s "conftest$ac_exeext"'
10370 { (eval echo "$as_me:10370: \"$ac_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010010371 (eval $ac_try) 2>&5
10372 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040010373 echo "$as_me:10373: \$? = $ac_status" >&5
10374 (exit "$ac_status"); }; }; then
Steve Kondikae271bc2015-11-15 02:50:53 +010010375 ac_cv_func_initscr=yes
10376else
10377 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -040010378cat "conftest.$ac_ext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010010379ac_cv_func_initscr=no
10380fi
micky3879b9f5e72025-07-08 18:04:53 -040010381rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
Steve Kondikae271bc2015-11-15 02:50:53 +010010382fi
micky3879b9f5e72025-07-08 18:04:53 -040010383echo "$as_me:10383: result: $ac_cv_func_initscr" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010010384echo "${ECHO_T}$ac_cv_func_initscr" >&6
micky3879b9f5e72025-07-08 18:04:53 -040010385if test "$ac_cv_func_initscr" = yes; then
10386 eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
Steve Kondikae271bc2015-11-15 02:50:53 +010010387else
10388
10389 cf_save_LIBS="$LIBS"
micky3879b9f5e72025-07-08 18:04:53 -040010390 echo "$as_me:10390: checking for initscr in -l$cf_nculib_root" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010010391echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
10392 LIBS="-l$cf_nculib_root $LIBS"
micky3879b9f5e72025-07-08 18:04:53 -040010393 cat >"conftest.$ac_ext" <<_ACEOF
10394#line 10394 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +010010395#include "confdefs.h"
10396#include <${cf_cv_ncurses_header:-curses.h}>
10397int
micky3879b9f5e72025-07-08 18:04:53 -040010398main (void)
Steve Kondikae271bc2015-11-15 02:50:53 +010010399{
10400initscr()
10401 ;
10402 return 0;
10403}
10404_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -040010405rm -f "conftest.$ac_objext" "conftest$ac_exeext"
10406if { (eval echo "$as_me:10406: \"$ac_link\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010010407 (eval $ac_link) 2>&5
10408 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040010409 echo "$as_me:10409: \$? = $ac_status" >&5
10410 (exit "$ac_status"); } &&
10411 { ac_try='test -s "conftest$ac_exeext"'
10412 { (eval echo "$as_me:10412: \"$ac_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010010413 (eval $ac_try) 2>&5
10414 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040010415 echo "$as_me:10415: \$? = $ac_status" >&5
10416 (exit "$ac_status"); }; }; then
10417 echo "$as_me:10417: result: yes" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010010418echo "${ECHO_T}yes" >&6
micky3879b9f5e72025-07-08 18:04:53 -040010419 eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
Steve Kondikae271bc2015-11-15 02:50:53 +010010420
10421else
10422 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -040010423cat "conftest.$ac_ext" >&5
10424echo "$as_me:10424: result: no" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010010425echo "${ECHO_T}no" >&6
10426
10427cf_search=
10428cf_library_path_list=""
10429if test -n "${LDFLAGS}${LIBS}" ; then
10430 for cf_library_path in $LDFLAGS $LIBS
10431 do
micky3879b9f5e72025-07-08 18:04:53 -040010432 case "$cf_library_path" in
Steve Kondikae271bc2015-11-15 02:50:53 +010010433 (-L*)
10434 cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
10435
10436test "x$cf_library_path" != "xNONE" && \
10437test -d "$cf_library_path" && \
10438 {
10439 test -n "$verbose" && echo " ... testing for lib-directories under $cf_library_path"
micky3879b9f5e72025-07-08 18:04:53 -040010440 test -d "$cf_library_path/lib" && cf_search="$cf_search $cf_library_path/lib"
10441 test -d "$cf_library_path/lib/$cf_nculib_root" && cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
10442 test -d "$cf_library_path/lib/$cf_nculib_root/lib" && cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
10443 test -d "$cf_library_path/$cf_nculib_root/lib" && cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
10444 test -d "$cf_library_path/$cf_nculib_root/lib/$cf_nculib_root" && cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib/$cf_nculib_root"
Steve Kondikae271bc2015-11-15 02:50:53 +010010445}
10446
10447 cf_library_path_list="$cf_library_path_list $cf_search"
10448 ;;
10449 esac
10450 done
10451fi
10452
10453cf_search=
10454
10455test "x$prefix" != "xNONE" && \
10456test -d "$prefix" && \
10457 {
10458 test -n "$verbose" && echo " ... testing for lib-directories under $prefix"
micky3879b9f5e72025-07-08 18:04:53 -040010459 test -d "$prefix/lib" && cf_search="$cf_search $prefix/lib"
10460 test -d "$prefix/lib/$cf_nculib_root" && cf_search="$cf_search $prefix/lib/$cf_nculib_root"
10461 test -d "$prefix/lib/$cf_nculib_root/lib" && cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
10462 test -d "$prefix/$cf_nculib_root/lib" && cf_search="$cf_search $prefix/$cf_nculib_root/lib"
10463 test -d "$prefix/$cf_nculib_root/lib/$cf_nculib_root" && cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
Steve Kondikae271bc2015-11-15 02:50:53 +010010464}
10465
10466for cf_subdir_prefix in \
10467 /usr \
10468 /usr/local \
10469 /usr/pkg \
10470 /opt \
10471 /opt/local \
10472 $HOME
10473do
10474
10475test "x$cf_subdir_prefix" != "x$prefix" && \
10476test -d "$cf_subdir_prefix" && \
micky3879b9f5e72025-07-08 18:04:53 -040010477{ test -z "$prefix" || test "x$prefix" = xNONE || test "x$cf_subdir_prefix" != "x$prefix"; } && {
Steve Kondikae271bc2015-11-15 02:50:53 +010010478 test -n "$verbose" && echo " ... testing for lib-directories under $cf_subdir_prefix"
micky3879b9f5e72025-07-08 18:04:53 -040010479 test -d "$cf_subdir_prefix/lib" && cf_search="$cf_search $cf_subdir_prefix/lib"
10480 test -d "$cf_subdir_prefix/lib/$cf_nculib_root" && cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root"
10481 test -d "$cf_subdir_prefix/lib/$cf_nculib_root/lib" && cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root/lib"
10482 test -d "$cf_subdir_prefix/$cf_nculib_root/lib" && cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib"
10483 test -d "$cf_subdir_prefix/$cf_nculib_root/lib/$cf_nculib_root" && cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib/$cf_nculib_root"
Steve Kondikae271bc2015-11-15 02:50:53 +010010484}
10485
10486done
10487
10488cf_search="$cf_library_path_list $cf_search"
10489
10490 for cf_libdir in $cf_search
10491 do
micky3879b9f5e72025-07-08 18:04:53 -040010492 echo "$as_me:10492: checking for -l$cf_nculib_root in $cf_libdir" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010010493echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
10494 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
micky3879b9f5e72025-07-08 18:04:53 -040010495 cat >"conftest.$ac_ext" <<_ACEOF
10496#line 10496 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +010010497#include "confdefs.h"
10498#include <${cf_cv_ncurses_header:-curses.h}>
10499int
micky3879b9f5e72025-07-08 18:04:53 -040010500main (void)
Steve Kondikae271bc2015-11-15 02:50:53 +010010501{
10502initscr()
10503 ;
10504 return 0;
10505}
10506_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -040010507rm -f "conftest.$ac_objext" "conftest$ac_exeext"
10508if { (eval echo "$as_me:10508: \"$ac_link\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010010509 (eval $ac_link) 2>&5
10510 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040010511 echo "$as_me:10511: \$? = $ac_status" >&5
10512 (exit "$ac_status"); } &&
10513 { ac_try='test -s "conftest$ac_exeext"'
10514 { (eval echo "$as_me:10514: \"$ac_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010010515 (eval $ac_try) 2>&5
10516 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040010517 echo "$as_me:10517: \$? = $ac_status" >&5
10518 (exit "$ac_status"); }; }; then
10519 echo "$as_me:10519: result: yes" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010010520echo "${ECHO_T}yes" >&6
micky3879b9f5e72025-07-08 18:04:53 -040010521 eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
Steve Kondikae271bc2015-11-15 02:50:53 +010010522 break
10523else
10524 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -040010525cat "conftest.$ac_ext" >&5
10526echo "$as_me:10526: result: no" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010010527echo "${ECHO_T}no" >&6
10528 LIBS="$cf_save_LIBS"
10529fi
micky3879b9f5e72025-07-08 18:04:53 -040010530rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
Steve Kondikae271bc2015-11-15 02:50:53 +010010531 done
10532
10533fi
micky3879b9f5e72025-07-08 18:04:53 -040010534rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
Steve Kondikae271bc2015-11-15 02:50:53 +010010535
10536fi
10537
micky3879b9f5e72025-07-08 18:04:53 -040010538eval 'cf_found_library="$cf_cv_have_lib_'"$cf_nculib_root"\"
Steve Kondikae271bc2015-11-15 02:50:53 +010010539
micky3879b9f5e72025-07-08 18:04:53 -040010540if test "$cf_found_library" = no ; then
10541 { { echo "$as_me:10541: error: Cannot link $cf_nculib_root library" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010010542echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
10543 { (exit 1); exit 1; }; }
10544fi
10545
10546fi
10547
10548if test -n "$cf_ncurses_LIBS" ; then
micky3879b9f5e72025-07-08 18:04:53 -040010549 echo "$as_me:10549: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010010550echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
10551 cf_ncurses_SAVE="$LIBS"
10552 for p in $cf_ncurses_LIBS ; do
micky3879b9f5e72025-07-08 18:04:53 -040010553 q=`echo "$LIBS" | sed -e "s%$p %%" -e "s%$p$%%"`
Steve Kondikae271bc2015-11-15 02:50:53 +010010554 if test "$q" != "$LIBS" ; then
10555 LIBS="$q"
10556 fi
10557 done
micky3879b9f5e72025-07-08 18:04:53 -040010558 cat >"conftest.$ac_ext" <<_ACEOF
10559#line 10559 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +010010560#include "confdefs.h"
10561#include <${cf_cv_ncurses_header:-curses.h}>
10562int
micky3879b9f5e72025-07-08 18:04:53 -040010563main (void)
Steve Kondikae271bc2015-11-15 02:50:53 +010010564{
micky3879b9f5e72025-07-08 18:04:53 -040010565initscr(); mousemask(0,0); tigetstr((char *)0);
Steve Kondikae271bc2015-11-15 02:50:53 +010010566 ;
10567 return 0;
10568}
10569_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -040010570rm -f "conftest.$ac_objext" "conftest$ac_exeext"
10571if { (eval echo "$as_me:10571: \"$ac_link\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010010572 (eval $ac_link) 2>&5
10573 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040010574 echo "$as_me:10574: \$? = $ac_status" >&5
10575 (exit "$ac_status"); } &&
10576 { ac_try='test -s "conftest$ac_exeext"'
10577 { (eval echo "$as_me:10577: \"$ac_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010010578 (eval $ac_try) 2>&5
10579 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040010580 echo "$as_me:10580: \$? = $ac_status" >&5
10581 (exit "$ac_status"); }; }; then
10582 echo "$as_me:10582: result: yes" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010010583echo "${ECHO_T}yes" >&6
10584else
10585 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -040010586cat "conftest.$ac_ext" >&5
10587echo "$as_me:10587: result: no" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010010588echo "${ECHO_T}no" >&6
10589 LIBS="$cf_ncurses_SAVE"
10590fi
micky3879b9f5e72025-07-08 18:04:53 -040010591rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
Steve Kondikae271bc2015-11-15 02:50:53 +010010592fi
10593
10594cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
10595
10596cat >>confdefs.h <<EOF
10597#define $cf_nculib_ROOT 1
10598EOF
10599
10600 fi
10601else
10602 NCURSES_CONFIG=none
10603fi
10604
10605 ;;
10606(ncurses*)
10607
10608cf_ncuconfig_root=$cf_cv_screen
10609cf_have_ncuconfig=no
10610
10611if test "x${PKG_CONFIG:=none}" != xnone; then
micky3879b9f5e72025-07-08 18:04:53 -040010612 echo "$as_me:10612: checking pkg-config for $cf_ncuconfig_root" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010010613echo $ECHO_N "checking pkg-config for $cf_ncuconfig_root... $ECHO_C" >&6
10614 if "$PKG_CONFIG" --exists $cf_ncuconfig_root ; then
micky3879b9f5e72025-07-08 18:04:53 -040010615 echo "$as_me:10615: result: yes" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010010616echo "${ECHO_T}yes" >&6
10617
micky3879b9f5e72025-07-08 18:04:53 -040010618 echo "$as_me:10618: checking if the $cf_ncuconfig_root package files work" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010010619echo $ECHO_N "checking if the $cf_ncuconfig_root package files work... $ECHO_C" >&6
10620 cf_have_ncuconfig=unknown
10621
micky3879b9f5e72025-07-08 18:04:53 -040010622 cf_save_CFLAGS="$CFLAGS"
Steve Kondikae271bc2015-11-15 02:50:53 +010010623 cf_save_CPPFLAGS="$CPPFLAGS"
10624 cf_save_LIBS="$LIBS"
10625
micky3879b9f5e72025-07-08 18:04:53 -040010626 cf_pkg_cflags="`$PKG_CONFIG --cflags $cf_ncuconfig_root`"
10627 cf_pkg_libs="`$PKG_CONFIG --libs $cf_ncuconfig_root`"
Steve Kondikae271bc2015-11-15 02:50:53 +010010628
micky3879b9f5e72025-07-08 18:04:53 -040010629 # while -W for passing linker flags is prevalent, it is not "standard".
10630 # At least one wrapper for c89/c99 (in Apple's xcode) has its own
10631 # incompatible _and_ non-standard -W option which gives an error. Work
10632 # around that pitfall.
10633 case "x${CC}@@${cf_pkg_libs}@${cf_pkg_cflags}" in
10634 (x*c[89]9@@*-W*)
10635
10636cf_fix_cppflags=no
10637cf_new_cflags=
10638cf_new_cppflags=
10639cf_new_extra_cppflags=
10640
10641for cf_add_cflags in $cf_pkg_cflags
Steve Kondikae271bc2015-11-15 02:50:53 +010010642do
micky3879b9f5e72025-07-08 18:04:53 -040010643case "$cf_fix_cppflags" in
10644(no)
10645 case "$cf_add_cflags" in
10646 (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
10647 case "$cf_add_cflags" in
10648 (-D*)
10649 cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
10650
10651 test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10652 && test -z "${cf_tst_cflags}" \
10653 && cf_fix_cppflags=yes
10654
10655 if test "$cf_fix_cppflags" = yes ; then
10656
10657 test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
10658 cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
10659
10660 continue
10661 elif test "${cf_tst_cflags}" = "\"'" ; then
10662
10663 test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
10664 cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
10665
10666 continue
10667 fi
10668 ;;
10669 esac
10670 case "$CPPFLAGS" in
10671 (*$cf_add_cflags)
10672 ;;
10673 (*)
10674 case "$cf_add_cflags" in
10675 (-D*)
10676 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
10677
10678CPPFLAGS=`echo "$CPPFLAGS" | \
10679 sed -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?[ ]/ /g' \
10680 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?$//g'`
10681
10682 ;;
10683 esac
10684
10685 test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
10686 cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
10687
10688 ;;
10689 esac
10690 ;;
10691 (*)
10692
10693 test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
10694 cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
10695
10696 ;;
10697 esac
10698 ;;
10699(yes)
10700
10701 test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
10702 cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
10703
10704 cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
10705
10706 test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10707 && test -z "${cf_tst_cflags}" \
10708 && cf_fix_cppflags=no
10709 ;;
10710esac
10711done
10712
10713if test -n "$cf_new_cflags" ; then
10714
10715 test -n "$CFLAGS" && CFLAGS="$CFLAGS "
10716 CFLAGS="${CFLAGS}$cf_new_cflags"
10717
10718fi
10719
10720if test -n "$cf_new_cppflags" ; then
10721
10722 test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
10723 CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
10724
10725fi
10726
10727if test -n "$cf_new_extra_cppflags" ; then
10728
10729 test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
10730 EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
10731
10732fi
10733
10734cf_add_libs="$LIBS"
10735# reverse order
10736cf_add_0lib=
10737for cf_add_1lib in $cf_pkg_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
10738# filter duplicates
10739for cf_add_1lib in $cf_add_0lib; do
10740 for cf_add_2lib in $cf_add_libs; do
10741 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
Steve Kondikae271bc2015-11-15 02:50:53 +010010742 cf_add_1lib=
10743 break
10744 fi
10745 done
micky3879b9f5e72025-07-08 18:04:53 -040010746 test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
Steve Kondikae271bc2015-11-15 02:50:53 +010010747done
10748LIBS="$cf_add_libs"
10749
micky3879b9f5e72025-07-08 18:04:53 -040010750 cat >"conftest.$ac_ext" <<_ACEOF
10751#line 10751 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +010010752#include "confdefs.h"
10753#include <${cf_cv_ncurses_header:-curses.h}>
10754int
micky3879b9f5e72025-07-08 18:04:53 -040010755main (void)
Steve Kondikae271bc2015-11-15 02:50:53 +010010756{
micky3879b9f5e72025-07-08 18:04:53 -040010757initscr(); mousemask(0,0); tigetstr((char *)0);
Steve Kondikae271bc2015-11-15 02:50:53 +010010758 ;
10759 return 0;
10760}
10761_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -040010762rm -f "conftest.$ac_objext" "conftest$ac_exeext"
10763if { (eval echo "$as_me:10763: \"$ac_link\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010010764 (eval $ac_link) 2>&5
10765 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040010766 echo "$as_me:10766: \$? = $ac_status" >&5
10767 (exit "$ac_status"); } &&
10768 { ac_try='test -s "conftest$ac_exeext"'
10769 { (eval echo "$as_me:10769: \"$ac_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010010770 (eval $ac_try) 2>&5
10771 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040010772 echo "$as_me:10772: \$? = $ac_status" >&5
10773 (exit "$ac_status"); }; }; then
10774 if test "$cross_compiling" = yes; then
10775 cf_test_ncuconfig=maybe
10776else
10777 cat >"conftest.$ac_ext" <<_ACEOF
10778#line 10778 "configure"
10779#include "confdefs.h"
10780#include <${cf_cv_ncurses_header:-curses.h}>
10781 int main(void)
10782 { const char *xx = curses_version(); return (xx == 0); }
10783_ACEOF
10784rm -f "conftest$ac_exeext"
10785if { (eval echo "$as_me:10785: \"$ac_link\"") >&5
10786 (eval $ac_link) 2>&5
10787 ac_status=$?
10788 echo "$as_me:10788: \$? = $ac_status" >&5
10789 (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
10790 { (eval echo "$as_me:10790: \"$ac_try\"") >&5
10791 (eval $ac_try) 2>&5
10792 ac_status=$?
10793 echo "$as_me:10793: \$? = $ac_status" >&5
10794 (exit "$ac_status"); }; }; then
10795 cf_test_ncuconfig=yes
10796else
10797 echo "$as_me: program exited with status $ac_status" >&5
10798echo "$as_me: failed program was:" >&5
10799cat "conftest.$ac_ext" >&5
10800cf_test_ncuconfig=no
10801fi
10802rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
10803fi
10804else
10805 echo "$as_me: failed program was:" >&5
10806cat "conftest.$ac_ext" >&5
10807cf_test_ncuconfig=no
10808fi
10809rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
10810
10811 CFLAGS="$cf_save_CFLAGS"
10812 CPPFLAGS="$cf_save_CPPFLAGS"
10813 LIBS="$cf_save_LIBS"
10814
10815 if test "x$cf_test_ncuconfig" != xyes; then
10816 cf_temp=`echo "x$cf_pkg_cflags" | sed -e s/^x// -e 's/-W[^ ]*//g'`
10817 cf_pkg_cflags="$cf_temp"
10818 cf_temp=`echo "x$cf_pkg_libs" | sed -e s/^x// -e 's/-W[^ ]*//g'`
10819 cf_pkg_libs="$cf_temp"
10820 fi
10821 ;;
10822 esac
10823
10824for cf_add_cflags in $cf_pkg_cflags
10825do
10826 case "x$cf_add_cflags" in
10827 (x-[DU]*)
10828
10829cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
10830while true
10831do
10832 cf_old_cflag=`echo "x$CFLAGS" | sed -e 's/^.//' -e 's/[ ][ ]*-/ -/g' -e "s%$cf_tmp_cflag\\(=[^ ][^ ]*\\)\?%%" -e 's/^[ ]*//' -e 's%[ ][ ]*-D% -D%g' -e 's%[ ][ ]*-I% -I%g'`
10833 test "$CFLAGS" != "$cf_old_cflag" || break
10834
10835 CFLAGS="$cf_old_cflag"
10836done
10837
10838cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
10839while true
10840do
10841 cf_old_cflag=`echo "x$CPPFLAGS" | sed -e 's/^.//' -e 's/[ ][ ]*-/ -/g' -e "s%$cf_tmp_cflag\\(=[^ ][^ ]*\\)\?%%" -e 's/^[ ]*//' -e 's%[ ][ ]*-D% -D%g' -e 's%[ ][ ]*-I% -I%g'`
10842 test "$CPPFLAGS" != "$cf_old_cflag" || break
10843
10844 CPPFLAGS="$cf_old_cflag"
10845done
10846
10847 ;;
10848 esac
10849
10850cf_fix_cppflags=no
10851cf_new_cflags=
10852cf_new_cppflags=
10853cf_new_extra_cppflags=
10854
10855for cf_add_cflags in $cf_add_cflags
10856do
10857case "$cf_fix_cppflags" in
10858(no)
10859 case "$cf_add_cflags" in
10860 (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
10861 case "$cf_add_cflags" in
10862 (-D*)
10863 cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
10864
10865 test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10866 && test -z "${cf_tst_cflags}" \
10867 && cf_fix_cppflags=yes
10868
10869 if test "$cf_fix_cppflags" = yes ; then
10870
10871 test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
10872 cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
10873
10874 continue
10875 elif test "${cf_tst_cflags}" = "\"'" ; then
10876
10877 test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
10878 cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
10879
10880 continue
10881 fi
10882 ;;
10883 esac
10884 case "$CPPFLAGS" in
10885 (*$cf_add_cflags)
10886 ;;
10887 (*)
10888 case "$cf_add_cflags" in
10889 (-D*)
10890 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
10891
10892CPPFLAGS=`echo "$CPPFLAGS" | \
10893 sed -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?[ ]/ /g' \
10894 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?$//g'`
10895
10896 ;;
10897 esac
10898
10899 test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
10900 cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
10901
10902 ;;
10903 esac
10904 ;;
10905 (*)
10906
10907 test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
10908 cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
10909
10910 ;;
10911 esac
10912 ;;
10913(yes)
10914
10915 test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
10916 cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
10917
10918 cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
10919
10920 test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10921 && test -z "${cf_tst_cflags}" \
10922 && cf_fix_cppflags=no
10923 ;;
10924esac
10925done
10926
10927if test -n "$cf_new_cflags" ; then
10928
10929 test -n "$CFLAGS" && CFLAGS="$CFLAGS "
10930 CFLAGS="${CFLAGS}$cf_new_cflags"
10931
10932fi
10933
10934if test -n "$cf_new_cppflags" ; then
10935
10936 test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
10937 CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
10938
10939fi
10940
10941if test -n "$cf_new_extra_cppflags" ; then
10942
10943 test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
10944 EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
10945
10946fi
10947
10948done
10949
10950cf_add_libs="$LIBS"
10951# reverse order
10952cf_add_0lib=
10953for cf_add_1lib in $cf_pkg_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
10954# filter duplicates
10955for cf_add_1lib in $cf_add_0lib; do
10956 for cf_add_2lib in $cf_add_libs; do
10957 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
10958 cf_add_1lib=
10959 break
10960 fi
10961 done
10962 test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
10963done
10964LIBS="$cf_add_libs"
10965
10966 cat >"conftest.$ac_ext" <<_ACEOF
10967#line 10967 "configure"
10968#include "confdefs.h"
10969#include <${cf_cv_ncurses_header:-curses.h}>
10970int
10971main (void)
10972{
10973initscr(); mousemask(0,0); tigetstr((char *)0);
10974 ;
10975 return 0;
10976}
10977_ACEOF
10978rm -f "conftest.$ac_objext" "conftest$ac_exeext"
10979if { (eval echo "$as_me:10979: \"$ac_link\"") >&5
10980 (eval $ac_link) 2>&5
10981 ac_status=$?
10982 echo "$as_me:10982: \$? = $ac_status" >&5
10983 (exit "$ac_status"); } &&
10984 { ac_try='test -s "conftest$ac_exeext"'
10985 { (eval echo "$as_me:10985: \"$ac_try\"") >&5
10986 (eval $ac_try) 2>&5
10987 ac_status=$?
10988 echo "$as_me:10988: \$? = $ac_status" >&5
10989 (exit "$ac_status"); }; }; then
Steve Kondikae271bc2015-11-15 02:50:53 +010010990 if test "$cross_compiling" = yes; then
10991 cf_have_ncuconfig=maybe
10992else
micky3879b9f5e72025-07-08 18:04:53 -040010993 cat >"conftest.$ac_ext" <<_ACEOF
10994#line 10994 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +010010995#include "confdefs.h"
10996#include <${cf_cv_ncurses_header:-curses.h}>
10997 int main(void)
micky3879b9f5e72025-07-08 18:04:53 -040010998 { const char *xx = curses_version(); return (xx == 0); }
Steve Kondikae271bc2015-11-15 02:50:53 +010010999_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -040011000rm -f "conftest$ac_exeext"
11001if { (eval echo "$as_me:11001: \"$ac_link\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010011002 (eval $ac_link) 2>&5
11003 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040011004 echo "$as_me:11004: \$? = $ac_status" >&5
11005 (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
11006 { (eval echo "$as_me:11006: \"$ac_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010011007 (eval $ac_try) 2>&5
11008 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040011009 echo "$as_me:11009: \$? = $ac_status" >&5
11010 (exit "$ac_status"); }; }; then
Steve Kondikae271bc2015-11-15 02:50:53 +010011011 cf_have_ncuconfig=yes
11012else
11013 echo "$as_me: program exited with status $ac_status" >&5
11014echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -040011015cat "conftest.$ac_ext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010011016cf_have_ncuconfig=no
11017fi
micky3879b9f5e72025-07-08 18:04:53 -040011018rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
Steve Kondikae271bc2015-11-15 02:50:53 +010011019fi
11020else
11021 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -040011022cat "conftest.$ac_ext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010011023cf_have_ncuconfig=no
11024fi
micky3879b9f5e72025-07-08 18:04:53 -040011025rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
11026 echo "$as_me:11026: result: $cf_have_ncuconfig" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010011027echo "${ECHO_T}$cf_have_ncuconfig" >&6
11028 test "$cf_have_ncuconfig" = maybe && cf_have_ncuconfig=yes
11029 if test "$cf_have_ncuconfig" != "yes"
11030 then
11031 CPPFLAGS="$cf_save_CPPFLAGS"
11032 LIBS="$cf_save_LIBS"
11033 NCURSES_CONFIG_PKG=none
11034 else
11035
11036cat >>confdefs.h <<\EOF
11037#define NCURSES 1
11038EOF
11039
11040 NCURSES_CONFIG_PKG=$cf_ncuconfig_root
micky3879b9f5e72025-07-08 18:04:53 -040011041
11042echo "$as_me:11042: checking for terminfo header" >&5
11043echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
11044if test "${cf_cv_term_header+set}" = set; then
11045 echo $ECHO_N "(cached) $ECHO_C" >&6
11046else
11047
11048case "${cf_cv_ncurses_header}" in
11049(*/ncurses.h|*/ncursesw.h)
11050 cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
11051 ;;
11052(*)
11053 cf_term_header=term.h
11054 ;;
11055esac
11056
11057for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
11058do
11059cat >"conftest.$ac_ext" <<_ACEOF
11060#line 11060 "configure"
11061#include "confdefs.h"
11062#include <stdio.h>
11063#include <${cf_cv_ncurses_header:-curses.h}>
11064#include <$cf_test>
11065
11066int
11067main (void)
11068{
11069int x = auto_left_margin; (void)x
11070 ;
11071 return 0;
11072}
11073_ACEOF
11074rm -f "conftest.$ac_objext"
11075if { (eval echo "$as_me:11075: \"$ac_compile\"") >&5
11076 (eval $ac_compile) 2>&5
11077 ac_status=$?
11078 echo "$as_me:11078: \$? = $ac_status" >&5
11079 (exit "$ac_status"); } &&
11080 { ac_try='test -s "conftest.$ac_objext"'
11081 { (eval echo "$as_me:11081: \"$ac_try\"") >&5
11082 (eval $ac_try) 2>&5
11083 ac_status=$?
11084 echo "$as_me:11084: \$? = $ac_status" >&5
11085 (exit "$ac_status"); }; }; then
11086
11087 cf_cv_term_header="$cf_test"
11088else
11089 echo "$as_me: failed program was:" >&5
11090cat "conftest.$ac_ext" >&5
11091
11092 cf_cv_term_header=unknown
11093
11094fi
11095rm -f "conftest.$ac_objext" "conftest.$ac_ext"
11096 test "$cf_cv_term_header" != unknown && break
11097done
11098
11099fi
11100echo "$as_me:11100: result: $cf_cv_term_header" >&5
11101echo "${ECHO_T}$cf_cv_term_header" >&6
11102
11103# Set definitions to allow ifdef'ing to accommodate subdirectories
11104
11105case "$cf_cv_term_header" in
11106(*term.h)
11107
11108cat >>confdefs.h <<\EOF
11109#define HAVE_TERM_H 1
11110EOF
11111
11112 ;;
11113esac
11114
11115case "$cf_cv_term_header" in
11116(ncurses/term.h)
11117
11118cat >>confdefs.h <<\EOF
11119#define HAVE_NCURSES_TERM_H 1
11120EOF
11121
11122 ;;
11123(ncursesw/term.h)
11124
11125cat >>confdefs.h <<\EOF
11126#define HAVE_NCURSESW_TERM_H 1
11127EOF
11128
11129 ;;
11130esac
11131
Steve Kondikae271bc2015-11-15 02:50:53 +010011132 fi
11133
11134 else
micky3879b9f5e72025-07-08 18:04:53 -040011135 echo "$as_me:11135: result: no" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010011136echo "${ECHO_T}no" >&6
11137 NCURSES_CONFIG_PKG=none
11138 fi
11139else
11140 NCURSES_CONFIG_PKG=none
11141fi
11142
11143if test "x$cf_have_ncuconfig" = "xno"; then
micky3879b9f5e72025-07-08 18:04:53 -040011144 cf_ncurses_config="${cf_ncuconfig_root}${NCURSES_CONFIG_SUFFIX}-config"; echo "Looking for ${cf_ncurses_config}"
Steve Kondikae271bc2015-11-15 02:50:53 +010011145
11146if test -n "$ac_tool_prefix"; then
micky3879b9f5e72025-07-08 18:04:53 -040011147 for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
Steve Kondikae271bc2015-11-15 02:50:53 +010011148 do
11149 # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
11150set dummy $ac_tool_prefix$ac_prog; ac_word=$2
micky3879b9f5e72025-07-08 18:04:53 -040011151echo "$as_me:11151: checking for $ac_word" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010011152echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
11153if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
11154 echo $ECHO_N "(cached) $ECHO_C" >&6
11155else
11156 if test -n "$NCURSES_CONFIG"; then
11157 ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
11158else
11159 ac_save_IFS=$IFS; IFS=$ac_path_separator
11160ac_dummy="$PATH"
11161for ac_dir in $ac_dummy; do
11162 IFS=$ac_save_IFS
11163 test -z "$ac_dir" && ac_dir=.
11164 $as_executable_p "$ac_dir/$ac_word" || continue
11165ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
micky3879b9f5e72025-07-08 18:04:53 -040011166echo "$as_me:11166: found $ac_dir/$ac_word" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010011167break
11168done
11169
11170fi
11171fi
11172NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
11173if test -n "$NCURSES_CONFIG"; then
micky3879b9f5e72025-07-08 18:04:53 -040011174 echo "$as_me:11174: result: $NCURSES_CONFIG" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010011175echo "${ECHO_T}$NCURSES_CONFIG" >&6
11176else
micky3879b9f5e72025-07-08 18:04:53 -040011177 echo "$as_me:11177: result: no" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010011178echo "${ECHO_T}no" >&6
11179fi
11180
11181 test -n "$NCURSES_CONFIG" && break
11182 done
11183fi
11184if test -z "$NCURSES_CONFIG"; then
11185 ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
micky3879b9f5e72025-07-08 18:04:53 -040011186 for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
Steve Kondikae271bc2015-11-15 02:50:53 +010011187do
11188 # Extract the first word of "$ac_prog", so it can be a program name with args.
11189set dummy $ac_prog; ac_word=$2
micky3879b9f5e72025-07-08 18:04:53 -040011190echo "$as_me:11190: checking for $ac_word" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010011191echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
11192if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
11193 echo $ECHO_N "(cached) $ECHO_C" >&6
11194else
11195 if test -n "$ac_ct_NCURSES_CONFIG"; then
11196 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
11197else
11198 ac_save_IFS=$IFS; IFS=$ac_path_separator
11199ac_dummy="$PATH"
11200for ac_dir in $ac_dummy; do
11201 IFS=$ac_save_IFS
11202 test -z "$ac_dir" && ac_dir=.
11203 $as_executable_p "$ac_dir/$ac_word" || continue
11204ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
micky3879b9f5e72025-07-08 18:04:53 -040011205echo "$as_me:11205: found $ac_dir/$ac_word" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010011206break
11207done
11208
11209fi
11210fi
11211ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
11212if test -n "$ac_ct_NCURSES_CONFIG"; then
micky3879b9f5e72025-07-08 18:04:53 -040011213 echo "$as_me:11213: result: $ac_ct_NCURSES_CONFIG" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010011214echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
11215else
micky3879b9f5e72025-07-08 18:04:53 -040011216 echo "$as_me:11216: result: no" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010011217echo "${ECHO_T}no" >&6
11218fi
11219
11220 test -n "$ac_ct_NCURSES_CONFIG" && break
11221done
11222test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
11223
11224 NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
11225fi
11226
11227 if test "$NCURSES_CONFIG" != none ; then
11228
micky3879b9f5e72025-07-08 18:04:53 -040011229for cf_add_cflags in `$NCURSES_CONFIG --cflags`
Steve Kondikae271bc2015-11-15 02:50:53 +010011230do
micky3879b9f5e72025-07-08 18:04:53 -040011231 case "x$cf_add_cflags" in
11232 (x-[DU]*)
11233
11234cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
11235while true
11236do
11237 cf_old_cflag=`echo "x$CFLAGS" | sed -e 's/^.//' -e 's/[ ][ ]*-/ -/g' -e "s%$cf_tmp_cflag\\(=[^ ][^ ]*\\)\?%%" -e 's/^[ ]*//' -e 's%[ ][ ]*-D% -D%g' -e 's%[ ][ ]*-I% -I%g'`
11238 test "$CFLAGS" != "$cf_old_cflag" || break
11239
11240 CFLAGS="$cf_old_cflag"
11241done
11242
11243cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
11244while true
11245do
11246 cf_old_cflag=`echo "x$CPPFLAGS" | sed -e 's/^.//' -e 's/[ ][ ]*-/ -/g' -e "s%$cf_tmp_cflag\\(=[^ ][^ ]*\\)\?%%" -e 's/^[ ]*//' -e 's%[ ][ ]*-D% -D%g' -e 's%[ ][ ]*-I% -I%g'`
11247 test "$CPPFLAGS" != "$cf_old_cflag" || break
11248
11249 CPPFLAGS="$cf_old_cflag"
11250done
11251
11252 ;;
11253 esac
11254
11255cf_fix_cppflags=no
11256cf_new_cflags=
11257cf_new_cppflags=
11258cf_new_extra_cppflags=
11259
11260for cf_add_cflags in $cf_add_cflags
11261do
11262case "$cf_fix_cppflags" in
11263(no)
11264 case "$cf_add_cflags" in
11265 (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
11266 case "$cf_add_cflags" in
11267 (-D*)
11268 cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
11269
11270 test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11271 && test -z "${cf_tst_cflags}" \
11272 && cf_fix_cppflags=yes
11273
11274 if test "$cf_fix_cppflags" = yes ; then
11275
11276 test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
11277 cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
11278
11279 continue
11280 elif test "${cf_tst_cflags}" = "\"'" ; then
11281
11282 test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
11283 cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
11284
11285 continue
11286 fi
11287 ;;
11288 esac
11289 case "$CPPFLAGS" in
11290 (*$cf_add_cflags)
11291 ;;
11292 (*)
11293 case "$cf_add_cflags" in
11294 (-D*)
11295 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
11296
11297CPPFLAGS=`echo "$CPPFLAGS" | \
11298 sed -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?[ ]/ /g' \
11299 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?$//g'`
11300
11301 ;;
11302 esac
11303
11304 test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
11305 cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
11306
11307 ;;
11308 esac
11309 ;;
11310 (*)
11311
11312 test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
11313 cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
11314
11315 ;;
11316 esac
11317 ;;
11318(yes)
11319
11320 test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
11321 cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
11322
11323 cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
11324
11325 test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11326 && test -z "${cf_tst_cflags}" \
11327 && cf_fix_cppflags=no
11328 ;;
11329esac
11330done
11331
11332if test -n "$cf_new_cflags" ; then
11333
11334 test -n "$CFLAGS" && CFLAGS="$CFLAGS "
11335 CFLAGS="${CFLAGS}$cf_new_cflags"
11336
11337fi
11338
11339if test -n "$cf_new_cppflags" ; then
11340
11341 test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
11342 CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
11343
11344fi
11345
11346if test -n "$cf_new_extra_cppflags" ; then
11347
11348 test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
11349 EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
11350
11351fi
11352
11353done
11354
11355cf_add_libs="$LIBS"
11356# reverse order
11357cf_add_0lib=
11358for cf_add_1lib in `$NCURSES_CONFIG --libs`; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
11359# filter duplicates
11360for cf_add_1lib in $cf_add_0lib; do
11361 for cf_add_2lib in $cf_add_libs; do
11362 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
Steve Kondikae271bc2015-11-15 02:50:53 +010011363 cf_add_1lib=
11364 break
11365 fi
11366 done
micky3879b9f5e72025-07-08 18:04:53 -040011367 test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
Steve Kondikae271bc2015-11-15 02:50:53 +010011368done
11369LIBS="$cf_add_libs"
11370
11371 # even with config script, some packages use no-override for curses.h
11372
micky3879b9f5e72025-07-08 18:04:53 -040011373echo "$as_me:11373: checking if we have identified curses headers" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010011374echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
11375if test "${cf_cv_ncurses_header+set}" = set; then
11376 echo $ECHO_N "(cached) $ECHO_C" >&6
11377else
11378
11379cf_cv_ncurses_header=none
11380for cf_header in \
11381 ncurses.h $cf_cv_screen/ncurses.h \
11382 curses.h $cf_cv_screen/curses.h
11383do
micky3879b9f5e72025-07-08 18:04:53 -040011384cat >"conftest.$ac_ext" <<_ACEOF
11385#line 11385 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +010011386#include "confdefs.h"
11387#include <${cf_header}>
11388int
micky3879b9f5e72025-07-08 18:04:53 -040011389main (void)
Steve Kondikae271bc2015-11-15 02:50:53 +010011390{
micky3879b9f5e72025-07-08 18:04:53 -040011391initscr(); endwin()
Steve Kondikae271bc2015-11-15 02:50:53 +010011392 ;
11393 return 0;
11394}
11395_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -040011396rm -f "conftest.$ac_objext"
11397if { (eval echo "$as_me:11397: \"$ac_compile\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010011398 (eval $ac_compile) 2>&5
11399 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040011400 echo "$as_me:11400: \$? = $ac_status" >&5
11401 (exit "$ac_status"); } &&
11402 { ac_try='test -s "conftest.$ac_objext"'
11403 { (eval echo "$as_me:11403: \"$ac_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010011404 (eval $ac_try) 2>&5
11405 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040011406 echo "$as_me:11406: \$? = $ac_status" >&5
11407 (exit "$ac_status"); }; }; then
Steve Kondikae271bc2015-11-15 02:50:53 +010011408 cf_cv_ncurses_header=$cf_header; break
11409else
11410 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -040011411cat "conftest.$ac_ext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010011412fi
micky3879b9f5e72025-07-08 18:04:53 -040011413rm -f "conftest.$ac_objext" "conftest.$ac_ext"
Steve Kondikae271bc2015-11-15 02:50:53 +010011414done
11415
11416fi
micky3879b9f5e72025-07-08 18:04:53 -040011417echo "$as_me:11417: result: $cf_cv_ncurses_header" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010011418echo "${ECHO_T}$cf_cv_ncurses_header" >&6
11419
11420if test "$cf_cv_ncurses_header" = none ; then
micky3879b9f5e72025-07-08 18:04:53 -040011421 { { echo "$as_me:11421: error: No curses header-files found" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010011422echo "$as_me: error: No curses header-files found" >&2;}
11423 { (exit 1); exit 1; }; }
11424fi
11425
11426# cheat, to get the right #define's for HAVE_NCURSES_H, etc.
11427
11428for ac_header in $cf_cv_ncurses_header
11429do
11430as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
micky3879b9f5e72025-07-08 18:04:53 -040011431echo "$as_me:11431: checking for $ac_header" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010011432echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
11433if eval "test \"\${$as_ac_Header+set}\" = set"; then
11434 echo $ECHO_N "(cached) $ECHO_C" >&6
11435else
micky3879b9f5e72025-07-08 18:04:53 -040011436 cat >"conftest.$ac_ext" <<_ACEOF
11437#line 11437 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +010011438#include "confdefs.h"
11439#include <$ac_header>
11440_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -040011441if { (eval echo "$as_me:11441: \"$ac_cpp "conftest.$ac_ext"\"") >&5
11442 (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
Steve Kondikae271bc2015-11-15 02:50:53 +010011443 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040011444 $EGREP -v '^ *\+' conftest.er1 >conftest.err
Steve Kondikae271bc2015-11-15 02:50:53 +010011445 rm -f conftest.er1
11446 cat conftest.err >&5
micky3879b9f5e72025-07-08 18:04:53 -040011447 echo "$as_me:11447: \$? = $ac_status" >&5
11448 (exit "$ac_status"); } >/dev/null; then
Steve Kondikae271bc2015-11-15 02:50:53 +010011449 if test -s conftest.err; then
11450 ac_cpp_err=$ac_c_preproc_warn_flag
11451 else
11452 ac_cpp_err=
11453 fi
11454else
11455 ac_cpp_err=yes
11456fi
11457if test -z "$ac_cpp_err"; then
11458 eval "$as_ac_Header=yes"
11459else
11460 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -040011461 cat "conftest.$ac_ext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010011462 eval "$as_ac_Header=no"
11463fi
micky3879b9f5e72025-07-08 18:04:53 -040011464rm -f conftest.err "conftest.$ac_ext"
Steve Kondikae271bc2015-11-15 02:50:53 +010011465fi
micky3879b9f5e72025-07-08 18:04:53 -040011466echo "$as_me:11466: result: `eval echo '${'"$as_ac_Header"'}'`" >&5
11467echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6
11468if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then
Steve Kondikae271bc2015-11-15 02:50:53 +010011469 cat >>confdefs.h <<EOF
11470#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
11471EOF
11472
11473fi
11474done
11475
11476cat >>confdefs.h <<\EOF
11477#define NCURSES 1
11478EOF
11479
11480cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
11481
11482 cat >>confdefs.h <<EOF
11483#define $cf_nculib_ROOT 1
11484EOF
11485
micky3879b9f5e72025-07-08 18:04:53 -040011486 cf_cv_ncurses_version="`$NCURSES_CONFIG --version`"
Steve Kondikae271bc2015-11-15 02:50:53 +010011487
11488 else
11489
11490cf_ncuhdr_root=$cf_cv_screen
11491
11492test -n "$cf_cv_curses_dir" && \
11493test "$cf_cv_curses_dir" != "no" && { \
11494
11495if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
11496 for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
11497 do
micky3879b9f5e72025-07-08 18:04:53 -040011498 while test "$cf_add_incdir" != /usr/include
Steve Kondikae271bc2015-11-15 02:50:53 +010011499 do
micky3879b9f5e72025-07-08 18:04:53 -040011500 if test -d "$cf_add_incdir"
Steve Kondikae271bc2015-11-15 02:50:53 +010011501 then
11502 cf_have_incdir=no
11503 if test -n "$CFLAGS$CPPFLAGS" ; then
11504 # a loop is needed to ensure we can add subdirs of existing dirs
11505 for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
11506 if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
11507 cf_have_incdir=yes; break
11508 fi
11509 done
11510 fi
11511
11512 if test "$cf_have_incdir" = no ; then
11513 if test "$cf_add_incdir" = /usr/local/include ; then
11514 if test "$GCC" = yes
11515 then
11516 cf_save_CPPFLAGS=$CPPFLAGS
micky3879b9f5e72025-07-08 18:04:53 -040011517
11518 test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
11519 CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
11520
11521 cat >"conftest.$ac_ext" <<_ACEOF
11522#line 11522 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +010011523#include "confdefs.h"
11524#include <stdio.h>
11525int
micky3879b9f5e72025-07-08 18:04:53 -040011526main (void)
Steve Kondikae271bc2015-11-15 02:50:53 +010011527{
11528printf("Hello")
11529 ;
11530 return 0;
11531}
11532_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -040011533rm -f "conftest.$ac_objext"
11534if { (eval echo "$as_me:11534: \"$ac_compile\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010011535 (eval $ac_compile) 2>&5
11536 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040011537 echo "$as_me:11537: \$? = $ac_status" >&5
11538 (exit "$ac_status"); } &&
11539 { ac_try='test -s "conftest.$ac_objext"'
11540 { (eval echo "$as_me:11540: \"$ac_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010011541 (eval $ac_try) 2>&5
11542 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040011543 echo "$as_me:11543: \$? = $ac_status" >&5
11544 (exit "$ac_status"); }; }; then
Steve Kondikae271bc2015-11-15 02:50:53 +010011545 :
11546else
11547 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -040011548cat "conftest.$ac_ext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010011549cf_have_incdir=yes
11550fi
micky3879b9f5e72025-07-08 18:04:53 -040011551rm -f "conftest.$ac_objext" "conftest.$ac_ext"
Steve Kondikae271bc2015-11-15 02:50:53 +010011552 CPPFLAGS=$cf_save_CPPFLAGS
11553 fi
11554 fi
11555 fi
11556
11557 if test "$cf_have_incdir" = no ; then
11558 test -n "$verbose" && echo " adding $cf_add_incdir to include-path" 1>&6
11559
micky3879b9f5e72025-07-08 18:04:53 -040011560echo "${as_me:-configure}:11560: testing adding $cf_add_incdir to include-path ..." 1>&5
Steve Kondikae271bc2015-11-15 02:50:53 +010011561
11562 CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
11563
micky3879b9f5e72025-07-08 18:04:53 -040011564 cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
Steve Kondikae271bc2015-11-15 02:50:53 +010011565 test "$cf_top_incdir" = "$cf_add_incdir" && break
11566 cf_add_incdir="$cf_top_incdir"
11567 else
11568 break
11569 fi
11570 else
11571 break
11572 fi
11573 done
11574 done
11575fi
11576
11577}
11578
micky3879b9f5e72025-07-08 18:04:53 -040011579echo "$as_me:11579: checking for $cf_ncuhdr_root header in include-path" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010011580echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
11581if test "${cf_cv_ncurses_h+set}" = set; then
11582 echo $ECHO_N "(cached) $ECHO_C" >&6
11583else
11584
11585 cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
micky3879b9f5e72025-07-08 18:04:53 -040011586 { test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw; } && cf_header_list="$cf_header_list curses.h ncurses.h"
Steve Kondikae271bc2015-11-15 02:50:53 +010011587 for cf_header in $cf_header_list
11588 do
11589
micky3879b9f5e72025-07-08 18:04:53 -040011590 cat >"conftest.$ac_ext" <<_ACEOF
11591#line 11591 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +010011592#include "confdefs.h"
11593
11594#include <$cf_header>
11595int
micky3879b9f5e72025-07-08 18:04:53 -040011596main (void)
Steve Kondikae271bc2015-11-15 02:50:53 +010011597{
11598
11599#ifdef NCURSES_VERSION
11600
micky3879b9f5e72025-07-08 18:04:53 -040011601printf("%s\\n", NCURSES_VERSION);
Steve Kondikae271bc2015-11-15 02:50:53 +010011602#else
11603#ifdef __NCURSES_H
micky3879b9f5e72025-07-08 18:04:53 -040011604printf("old\\n");
Steve Kondikae271bc2015-11-15 02:50:53 +010011605#else
micky3879b9f5e72025-07-08 18:04:53 -040011606 #error __NCURSES_H is not defined
Steve Kondikae271bc2015-11-15 02:50:53 +010011607#endif
11608#endif
11609
11610 ;
11611 return 0;
11612}
11613_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -040011614rm -f "conftest.$ac_objext"
11615if { (eval echo "$as_me:11615: \"$ac_compile\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010011616 (eval $ac_compile) 2>&5
11617 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040011618 echo "$as_me:11618: \$? = $ac_status" >&5
11619 (exit "$ac_status"); } &&
11620 { ac_try='test -s "conftest.$ac_objext"'
11621 { (eval echo "$as_me:11621: \"$ac_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010011622 (eval $ac_try) 2>&5
11623 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040011624 echo "$as_me:11624: \$? = $ac_status" >&5
11625 (exit "$ac_status"); }; }; then
Steve Kondikae271bc2015-11-15 02:50:53 +010011626 cf_cv_ncurses_h=$cf_header
11627
11628else
11629 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -040011630cat "conftest.$ac_ext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010011631cf_cv_ncurses_h=no
11632fi
micky3879b9f5e72025-07-08 18:04:53 -040011633rm -f "conftest.$ac_objext" "conftest.$ac_ext"
Steve Kondikae271bc2015-11-15 02:50:53 +010011634
11635 test "$cf_cv_ncurses_h" != no && break
11636 done
11637
11638fi
micky3879b9f5e72025-07-08 18:04:53 -040011639echo "$as_me:11639: result: $cf_cv_ncurses_h" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010011640echo "${ECHO_T}$cf_cv_ncurses_h" >&6
11641
11642if test "$cf_cv_ncurses_h" != no ; then
11643 cf_cv_ncurses_header=$cf_cv_ncurses_h
11644else
11645
micky3879b9f5e72025-07-08 18:04:53 -040011646echo "$as_me:11646: checking for $cf_ncuhdr_root include-path" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010011647echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
11648if test "${cf_cv_ncurses_h2+set}" = set; then
11649 echo $ECHO_N "(cached) $ECHO_C" >&6
11650else
11651
11652 test -n "$verbose" && echo
11653
11654cf_search=
11655
11656# collect the current set of include-directories from compiler flags
11657cf_header_path_list=""
11658if test -n "${CFLAGS}${CPPFLAGS}" ; then
11659 for cf_header_path in $CPPFLAGS $CFLAGS
11660 do
micky3879b9f5e72025-07-08 18:04:53 -040011661 case "$cf_header_path" in
Steve Kondikae271bc2015-11-15 02:50:53 +010011662 (-I*)
11663 cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
11664
11665test "x$cf_header_path" != "xNONE" && \
11666test -d "$cf_header_path" && \
11667 {
11668 test -n "$verbose" && echo " ... testing for include-directories under $cf_header_path"
micky3879b9f5e72025-07-08 18:04:53 -040011669 test -d "$cf_header_path/include" && cf_search="$cf_search $cf_header_path/include"
11670 test -d "$cf_header_path/include/$cf_ncuhdr_root" && cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
11671 test -d "$cf_header_path/include/$cf_ncuhdr_root/include" && cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
11672 test -d "$cf_header_path/$cf_ncuhdr_root/include" && cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
11673 test -d "$cf_header_path/$cf_ncuhdr_root/include/$cf_ncuhdr_root" && cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
Steve Kondikae271bc2015-11-15 02:50:53 +010011674}
11675
11676 cf_header_path_list="$cf_header_path_list $cf_search"
11677 ;;
11678 esac
11679 done
11680fi
11681
11682# add the variations for the package we are looking for
11683
11684cf_search=
11685
11686test "x$prefix" != "xNONE" && \
11687test -d "$prefix" && \
11688 {
11689 test -n "$verbose" && echo " ... testing for include-directories under $prefix"
micky3879b9f5e72025-07-08 18:04:53 -040011690 test -d "$prefix/include" && cf_search="$cf_search $prefix/include"
11691 test -d "$prefix/include/$cf_ncuhdr_root" && cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
11692 test -d "$prefix/include/$cf_ncuhdr_root/include" && cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
11693 test -d "$prefix/$cf_ncuhdr_root/include" && cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
11694 test -d "$prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root" && cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
Steve Kondikae271bc2015-11-15 02:50:53 +010011695}
11696
11697for cf_subdir_prefix in \
11698 /usr \
11699 /usr/local \
11700 /usr/pkg \
11701 /opt \
11702 /opt/local \
11703 $HOME
11704do
11705
11706test "x$cf_subdir_prefix" != "x$prefix" && \
11707test -d "$cf_subdir_prefix" && \
micky3879b9f5e72025-07-08 18:04:53 -040011708{ test -z "$prefix" || test "x$prefix" = xNONE || test "x$cf_subdir_prefix" != "x$prefix"; } && {
Steve Kondikae271bc2015-11-15 02:50:53 +010011709 test -n "$verbose" && echo " ... testing for include-directories under $cf_subdir_prefix"
micky3879b9f5e72025-07-08 18:04:53 -040011710 test -d "$cf_subdir_prefix/include" && cf_search="$cf_search $cf_subdir_prefix/include"
11711 test -d "$cf_subdir_prefix/include/$cf_ncuhdr_root" && cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root"
11712 test -d "$cf_subdir_prefix/include/$cf_ncuhdr_root/include" && cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root/include"
11713 test -d "$cf_subdir_prefix/$cf_ncuhdr_root/include" && cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include"
11714 test -d "$cf_subdir_prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root" && cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
Steve Kondikae271bc2015-11-15 02:50:53 +010011715}
11716
11717done
11718
11719test "$includedir" != NONE && \
11720test "$includedir" != "/usr/include" && \
11721test -d "$includedir" && {
micky3879b9f5e72025-07-08 18:04:53 -040011722 test -d "$includedir" && cf_search="$cf_search $includedir"
11723 test -d "$includedir/$cf_ncuhdr_root" && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
Steve Kondikae271bc2015-11-15 02:50:53 +010011724}
11725
11726test "$oldincludedir" != NONE && \
11727test "$oldincludedir" != "/usr/include" && \
11728test -d "$oldincludedir" && {
micky3879b9f5e72025-07-08 18:04:53 -040011729 test -d "$oldincludedir" && cf_search="$cf_search $oldincludedir"
11730 test -d "$oldincludedir/$cf_ncuhdr_root" && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
Steve Kondikae271bc2015-11-15 02:50:53 +010011731}
11732
11733cf_search="$cf_search $cf_header_path_list"
11734
micky3879b9f5e72025-07-08 18:04:53 -040011735 test -n "$verbose" && echo "search path $cf_search"
Steve Kondikae271bc2015-11-15 02:50:53 +010011736 cf_save2_CPPFLAGS="$CPPFLAGS"
11737 for cf_incdir in $cf_search
11738 do
11739
11740if test -n "$cf_incdir" ; then
11741 for cf_add_incdir in $cf_incdir
11742 do
micky3879b9f5e72025-07-08 18:04:53 -040011743 while test "$cf_add_incdir" != /usr/include
Steve Kondikae271bc2015-11-15 02:50:53 +010011744 do
micky3879b9f5e72025-07-08 18:04:53 -040011745 if test -d "$cf_add_incdir"
Steve Kondikae271bc2015-11-15 02:50:53 +010011746 then
11747 cf_have_incdir=no
11748 if test -n "$CFLAGS$CPPFLAGS" ; then
11749 # a loop is needed to ensure we can add subdirs of existing dirs
11750 for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
11751 if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
11752 cf_have_incdir=yes; break
11753 fi
11754 done
11755 fi
11756
11757 if test "$cf_have_incdir" = no ; then
11758 if test "$cf_add_incdir" = /usr/local/include ; then
11759 if test "$GCC" = yes
11760 then
11761 cf_save_CPPFLAGS=$CPPFLAGS
micky3879b9f5e72025-07-08 18:04:53 -040011762
11763 test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
11764 CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
11765
11766 cat >"conftest.$ac_ext" <<_ACEOF
11767#line 11767 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +010011768#include "confdefs.h"
11769#include <stdio.h>
11770int
micky3879b9f5e72025-07-08 18:04:53 -040011771main (void)
Steve Kondikae271bc2015-11-15 02:50:53 +010011772{
11773printf("Hello")
11774 ;
11775 return 0;
11776}
11777_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -040011778rm -f "conftest.$ac_objext"
11779if { (eval echo "$as_me:11779: \"$ac_compile\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010011780 (eval $ac_compile) 2>&5
11781 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040011782 echo "$as_me:11782: \$? = $ac_status" >&5
11783 (exit "$ac_status"); } &&
11784 { ac_try='test -s "conftest.$ac_objext"'
11785 { (eval echo "$as_me:11785: \"$ac_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010011786 (eval $ac_try) 2>&5
11787 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040011788 echo "$as_me:11788: \$? = $ac_status" >&5
11789 (exit "$ac_status"); }; }; then
Steve Kondikae271bc2015-11-15 02:50:53 +010011790 :
11791else
11792 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -040011793cat "conftest.$ac_ext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010011794cf_have_incdir=yes
11795fi
micky3879b9f5e72025-07-08 18:04:53 -040011796rm -f "conftest.$ac_objext" "conftest.$ac_ext"
Steve Kondikae271bc2015-11-15 02:50:53 +010011797 CPPFLAGS=$cf_save_CPPFLAGS
11798 fi
11799 fi
11800 fi
11801
11802 if test "$cf_have_incdir" = no ; then
11803 test -n "$verbose" && echo " adding $cf_add_incdir to include-path" 1>&6
11804
micky3879b9f5e72025-07-08 18:04:53 -040011805echo "${as_me:-configure}:11805: testing adding $cf_add_incdir to include-path ..." 1>&5
Steve Kondikae271bc2015-11-15 02:50:53 +010011806
11807 CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
11808
micky3879b9f5e72025-07-08 18:04:53 -040011809 cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
Steve Kondikae271bc2015-11-15 02:50:53 +010011810 test "$cf_top_incdir" = "$cf_add_incdir" && break
11811 cf_add_incdir="$cf_top_incdir"
11812 else
11813 break
11814 fi
11815 else
11816 break
11817 fi
11818 done
11819 done
11820fi
11821
11822 for cf_header in \
11823 ncurses.h \
11824 curses.h
11825 do
11826
micky3879b9f5e72025-07-08 18:04:53 -040011827 cat >"conftest.$ac_ext" <<_ACEOF
11828#line 11828 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +010011829#include "confdefs.h"
11830
11831#include <$cf_header>
11832int
micky3879b9f5e72025-07-08 18:04:53 -040011833main (void)
Steve Kondikae271bc2015-11-15 02:50:53 +010011834{
11835
11836#ifdef NCURSES_VERSION
11837
micky3879b9f5e72025-07-08 18:04:53 -040011838printf("%s\\n", NCURSES_VERSION);
Steve Kondikae271bc2015-11-15 02:50:53 +010011839#else
11840#ifdef __NCURSES_H
micky3879b9f5e72025-07-08 18:04:53 -040011841printf("old\\n");
Steve Kondikae271bc2015-11-15 02:50:53 +010011842#else
micky3879b9f5e72025-07-08 18:04:53 -040011843 #error __NCURSES_H is not defined
Steve Kondikae271bc2015-11-15 02:50:53 +010011844#endif
11845#endif
11846
11847 ;
11848 return 0;
11849}
11850_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -040011851rm -f "conftest.$ac_objext"
11852if { (eval echo "$as_me:11852: \"$ac_compile\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010011853 (eval $ac_compile) 2>&5
11854 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040011855 echo "$as_me:11855: \$? = $ac_status" >&5
11856 (exit "$ac_status"); } &&
11857 { ac_try='test -s "conftest.$ac_objext"'
11858 { (eval echo "$as_me:11858: \"$ac_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010011859 (eval $ac_try) 2>&5
11860 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040011861 echo "$as_me:11861: \$? = $ac_status" >&5
11862 (exit "$ac_status"); }; }; then
Steve Kondikae271bc2015-11-15 02:50:53 +010011863 cf_cv_ncurses_h2=$cf_header
11864
11865else
11866 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -040011867cat "conftest.$ac_ext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010011868cf_cv_ncurses_h2=no
11869fi
micky3879b9f5e72025-07-08 18:04:53 -040011870rm -f "conftest.$ac_objext" "conftest.$ac_ext"
Steve Kondikae271bc2015-11-15 02:50:53 +010011871
11872 if test "$cf_cv_ncurses_h2" != no ; then
11873 cf_cv_ncurses_h2=$cf_incdir/$cf_header
micky3879b9f5e72025-07-08 18:04:53 -040011874 test -n "$verbose" && echo $ECHO_N " ... found $ECHO_C" 1>&6
Steve Kondikae271bc2015-11-15 02:50:53 +010011875 break
11876 fi
11877 test -n "$verbose" && echo " ... tested $cf_incdir/$cf_header" 1>&6
11878 done
11879 CPPFLAGS="$cf_save2_CPPFLAGS"
11880 test "$cf_cv_ncurses_h2" != no && break
11881 done
micky3879b9f5e72025-07-08 18:04:53 -040011882 test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:11882: error: not found" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010011883echo "$as_me: error: not found" >&2;}
11884 { (exit 1); exit 1; }; }
11885
11886fi
micky3879b9f5e72025-07-08 18:04:53 -040011887echo "$as_me:11887: result: $cf_cv_ncurses_h2" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010011888echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
11889
micky3879b9f5e72025-07-08 18:04:53 -040011890 cf_1st_incdir=`echo "$cf_cv_ncurses_h2" | sed -e 's%/[^/]*$%%'`
11891 cf_cv_ncurses_header="`basename "$cf_cv_ncurses_h2"`"
11892 if test "`basename "$cf_1st_incdir"`" = "$cf_ncuhdr_root" ; then
11893 cf_cv_ncurses_header="$cf_ncuhdr_root/$cf_cv_ncurses_header"
Steve Kondikae271bc2015-11-15 02:50:53 +010011894 fi
11895
11896if test -n "$cf_1st_incdir" ; then
11897 for cf_add_incdir in $cf_1st_incdir
11898 do
micky3879b9f5e72025-07-08 18:04:53 -040011899 while test "$cf_add_incdir" != /usr/include
Steve Kondikae271bc2015-11-15 02:50:53 +010011900 do
micky3879b9f5e72025-07-08 18:04:53 -040011901 if test -d "$cf_add_incdir"
Steve Kondikae271bc2015-11-15 02:50:53 +010011902 then
11903 cf_have_incdir=no
11904 if test -n "$CFLAGS$CPPFLAGS" ; then
11905 # a loop is needed to ensure we can add subdirs of existing dirs
11906 for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
11907 if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
11908 cf_have_incdir=yes; break
11909 fi
11910 done
11911 fi
11912
11913 if test "$cf_have_incdir" = no ; then
11914 if test "$cf_add_incdir" = /usr/local/include ; then
11915 if test "$GCC" = yes
11916 then
11917 cf_save_CPPFLAGS=$CPPFLAGS
micky3879b9f5e72025-07-08 18:04:53 -040011918
11919 test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
11920 CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
11921
11922 cat >"conftest.$ac_ext" <<_ACEOF
11923#line 11923 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +010011924#include "confdefs.h"
11925#include <stdio.h>
11926int
micky3879b9f5e72025-07-08 18:04:53 -040011927main (void)
Steve Kondikae271bc2015-11-15 02:50:53 +010011928{
11929printf("Hello")
11930 ;
11931 return 0;
11932}
11933_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -040011934rm -f "conftest.$ac_objext"
11935if { (eval echo "$as_me:11935: \"$ac_compile\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010011936 (eval $ac_compile) 2>&5
11937 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040011938 echo "$as_me:11938: \$? = $ac_status" >&5
11939 (exit "$ac_status"); } &&
11940 { ac_try='test -s "conftest.$ac_objext"'
11941 { (eval echo "$as_me:11941: \"$ac_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010011942 (eval $ac_try) 2>&5
11943 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040011944 echo "$as_me:11944: \$? = $ac_status" >&5
11945 (exit "$ac_status"); }; }; then
Steve Kondikae271bc2015-11-15 02:50:53 +010011946 :
11947else
11948 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -040011949cat "conftest.$ac_ext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010011950cf_have_incdir=yes
11951fi
micky3879b9f5e72025-07-08 18:04:53 -040011952rm -f "conftest.$ac_objext" "conftest.$ac_ext"
Steve Kondikae271bc2015-11-15 02:50:53 +010011953 CPPFLAGS=$cf_save_CPPFLAGS
11954 fi
11955 fi
11956 fi
11957
11958 if test "$cf_have_incdir" = no ; then
11959 test -n "$verbose" && echo " adding $cf_add_incdir to include-path" 1>&6
11960
micky3879b9f5e72025-07-08 18:04:53 -040011961echo "${as_me:-configure}:11961: testing adding $cf_add_incdir to include-path ..." 1>&5
Steve Kondikae271bc2015-11-15 02:50:53 +010011962
11963 CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
11964
micky3879b9f5e72025-07-08 18:04:53 -040011965 cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
Steve Kondikae271bc2015-11-15 02:50:53 +010011966 test "$cf_top_incdir" = "$cf_add_incdir" && break
11967 cf_add_incdir="$cf_top_incdir"
11968 else
11969 break
11970 fi
11971 else
11972 break
11973 fi
11974 done
11975 done
11976fi
11977
11978fi
11979
11980# Set definitions to allow ifdef'ing for ncurses.h
11981
micky3879b9f5e72025-07-08 18:04:53 -040011982case "$cf_cv_ncurses_header" in
Steve Kondikae271bc2015-11-15 02:50:53 +010011983(*ncurses.h)
11984
11985cat >>confdefs.h <<\EOF
11986#define HAVE_NCURSES_H 1
11987EOF
11988
11989 ;;
11990esac
11991
micky3879b9f5e72025-07-08 18:04:53 -040011992case "$cf_cv_ncurses_header" in
Steve Kondikae271bc2015-11-15 02:50:53 +010011993(ncurses/curses.h|ncurses/ncurses.h)
11994
11995cat >>confdefs.h <<\EOF
11996#define HAVE_NCURSES_NCURSES_H 1
11997EOF
11998
11999 ;;
12000(ncursesw/curses.h|ncursesw/ncurses.h)
12001
12002cat >>confdefs.h <<\EOF
12003#define HAVE_NCURSESW_NCURSES_H 1
12004EOF
12005
12006 ;;
12007esac
12008
micky3879b9f5e72025-07-08 18:04:53 -040012009echo "$as_me:12009: checking for terminfo header" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010012010echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
12011if test "${cf_cv_term_header+set}" = set; then
12012 echo $ECHO_N "(cached) $ECHO_C" >&6
12013else
12014
micky3879b9f5e72025-07-08 18:04:53 -040012015case "${cf_cv_ncurses_header}" in
Steve Kondikae271bc2015-11-15 02:50:53 +010012016(*/ncurses.h|*/ncursesw.h)
12017 cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
12018 ;;
12019(*)
12020 cf_term_header=term.h
12021 ;;
12022esac
12023
12024for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
12025do
micky3879b9f5e72025-07-08 18:04:53 -040012026cat >"conftest.$ac_ext" <<_ACEOF
12027#line 12027 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +010012028#include "confdefs.h"
12029#include <stdio.h>
12030#include <${cf_cv_ncurses_header:-curses.h}>
12031#include <$cf_test>
12032
12033int
micky3879b9f5e72025-07-08 18:04:53 -040012034main (void)
Steve Kondikae271bc2015-11-15 02:50:53 +010012035{
micky3879b9f5e72025-07-08 18:04:53 -040012036int x = auto_left_margin; (void)x
Steve Kondikae271bc2015-11-15 02:50:53 +010012037 ;
12038 return 0;
12039}
12040_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -040012041rm -f "conftest.$ac_objext"
12042if { (eval echo "$as_me:12042: \"$ac_compile\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010012043 (eval $ac_compile) 2>&5
12044 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040012045 echo "$as_me:12045: \$? = $ac_status" >&5
12046 (exit "$ac_status"); } &&
12047 { ac_try='test -s "conftest.$ac_objext"'
12048 { (eval echo "$as_me:12048: \"$ac_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010012049 (eval $ac_try) 2>&5
12050 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040012051 echo "$as_me:12051: \$? = $ac_status" >&5
12052 (exit "$ac_status"); }; }; then
Steve Kondikae271bc2015-11-15 02:50:53 +010012053
12054 cf_cv_term_header="$cf_test"
12055else
12056 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -040012057cat "conftest.$ac_ext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010012058
12059 cf_cv_term_header=unknown
12060
12061fi
micky3879b9f5e72025-07-08 18:04:53 -040012062rm -f "conftest.$ac_objext" "conftest.$ac_ext"
Steve Kondikae271bc2015-11-15 02:50:53 +010012063 test "$cf_cv_term_header" != unknown && break
12064done
12065
12066fi
micky3879b9f5e72025-07-08 18:04:53 -040012067echo "$as_me:12067: result: $cf_cv_term_header" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010012068echo "${ECHO_T}$cf_cv_term_header" >&6
12069
12070# Set definitions to allow ifdef'ing to accommodate subdirectories
12071
micky3879b9f5e72025-07-08 18:04:53 -040012072case "$cf_cv_term_header" in
Steve Kondikae271bc2015-11-15 02:50:53 +010012073(*term.h)
12074
12075cat >>confdefs.h <<\EOF
12076#define HAVE_TERM_H 1
12077EOF
12078
12079 ;;
12080esac
12081
micky3879b9f5e72025-07-08 18:04:53 -040012082case "$cf_cv_term_header" in
Steve Kondikae271bc2015-11-15 02:50:53 +010012083(ncurses/term.h)
12084
12085cat >>confdefs.h <<\EOF
12086#define HAVE_NCURSES_TERM_H 1
12087EOF
12088
12089 ;;
12090(ncursesw/term.h)
12091
12092cat >>confdefs.h <<\EOF
12093#define HAVE_NCURSESW_TERM_H 1
12094EOF
12095
12096 ;;
12097esac
12098
12099# some applications need this, but should check for NCURSES_VERSION
12100
12101cat >>confdefs.h <<\EOF
12102#define NCURSES 1
12103EOF
12104
micky3879b9f5e72025-07-08 18:04:53 -040012105echo "$as_me:12105: checking for ncurses version" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010012106echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
12107if test "${cf_cv_ncurses_version+set}" = set; then
12108 echo $ECHO_N "(cached) $ECHO_C" >&6
12109else
12110
12111 cf_cv_ncurses_version=no
12112 cf_tempfile=out$$
micky3879b9f5e72025-07-08 18:04:53 -040012113 rm -f "$cf_tempfile"
Steve Kondikae271bc2015-11-15 02:50:53 +010012114 if test "$cross_compiling" = yes; then
12115
12116 # This will not work if the preprocessor splits the line after the
12117 # Autoconf token. The 'unproto' program does that.
micky3879b9f5e72025-07-08 18:04:53 -040012118 cat > "conftest.$ac_ext" <<EOF
Steve Kondikae271bc2015-11-15 02:50:53 +010012119#include <${cf_cv_ncurses_header:-curses.h}>
12120#undef Autoconf
12121#ifdef NCURSES_VERSION
12122Autoconf NCURSES_VERSION
12123#else
12124#ifdef __NCURSES_H
12125Autoconf "old"
12126#endif
12127;
12128#endif
12129EOF
12130 cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
micky3879b9f5e72025-07-08 18:04:53 -040012131 { (eval echo "$as_me:12131: \"$cf_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010012132 (eval $cf_try) 2>&5
12133 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040012134 echo "$as_me:12134: \$? = $ac_status" >&5
12135 (exit "$ac_status"); }
Steve Kondikae271bc2015-11-15 02:50:53 +010012136 if test -f conftest.out ; then
micky3879b9f5e72025-07-08 18:04:53 -040012137 cf_out=`sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%' conftest.out`
Steve Kondikae271bc2015-11-15 02:50:53 +010012138 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
12139 rm -f conftest.out
12140 fi
12141
12142else
micky3879b9f5e72025-07-08 18:04:53 -040012143 cat >"conftest.$ac_ext" <<_ACEOF
12144#line 12144 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +010012145#include "confdefs.h"
12146
micky3879b9f5e72025-07-08 18:04:53 -040012147$ac_includes_default
12148
Steve Kondikae271bc2015-11-15 02:50:53 +010012149#include <${cf_cv_ncurses_header:-curses.h}>
micky3879b9f5e72025-07-08 18:04:53 -040012150
12151int main(void)
Steve Kondikae271bc2015-11-15 02:50:53 +010012152{
12153 FILE *fp = fopen("$cf_tempfile", "w");
12154#ifdef NCURSES_VERSION
12155# ifdef NCURSES_VERSION_PATCH
micky3879b9f5e72025-07-08 18:04:53 -040012156 fprintf(fp, "%s.%d\\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
Steve Kondikae271bc2015-11-15 02:50:53 +010012157# else
micky3879b9f5e72025-07-08 18:04:53 -040012158 fprintf(fp, "%s\\n", NCURSES_VERSION);
Steve Kondikae271bc2015-11-15 02:50:53 +010012159# endif
12160#else
12161# ifdef __NCURSES_H
micky3879b9f5e72025-07-08 18:04:53 -040012162 fprintf(fp, "old\\n");
Steve Kondikae271bc2015-11-15 02:50:53 +010012163# else
micky3879b9f5e72025-07-08 18:04:53 -040012164 #error expected ncurses header to define __NCURSES_H
Steve Kondikae271bc2015-11-15 02:50:53 +010012165# endif
12166#endif
12167 ${cf_cv_main_return:-return}(0);
12168}
12169_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -040012170rm -f "conftest$ac_exeext"
12171if { (eval echo "$as_me:12171: \"$ac_link\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010012172 (eval $ac_link) 2>&5
12173 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040012174 echo "$as_me:12174: \$? = $ac_status" >&5
12175 (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
12176 { (eval echo "$as_me:12176: \"$ac_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010012177 (eval $ac_try) 2>&5
12178 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040012179 echo "$as_me:12179: \$? = $ac_status" >&5
12180 (exit "$ac_status"); }; }; then
Steve Kondikae271bc2015-11-15 02:50:53 +010012181
12182 cf_cv_ncurses_version=`cat $cf_tempfile`
12183else
12184 echo "$as_me: program exited with status $ac_status" >&5
12185echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -040012186cat "conftest.$ac_ext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010012187fi
micky3879b9f5e72025-07-08 18:04:53 -040012188rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
Steve Kondikae271bc2015-11-15 02:50:53 +010012189fi
micky3879b9f5e72025-07-08 18:04:53 -040012190 rm -f "$cf_tempfile"
Steve Kondikae271bc2015-11-15 02:50:53 +010012191
12192fi
micky3879b9f5e72025-07-08 18:04:53 -040012193echo "$as_me:12193: result: $cf_cv_ncurses_version" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010012194echo "${ECHO_T}$cf_cv_ncurses_version" >&6
12195test "$cf_cv_ncurses_version" = no ||
12196cat >>confdefs.h <<\EOF
12197#define NCURSES 1
12198EOF
12199
12200cf_nculib_root=$cf_cv_screen
12201 # This works, except for the special case where we find gpm, but
12202 # ncurses is in a nonstandard location via $LIBS, and we really want
12203 # to link gpm.
12204cf_ncurses_LIBS=""
12205cf_ncurses_SAVE="$LIBS"
micky3879b9f5e72025-07-08 18:04:53 -040012206echo "$as_me:12206: checking for Gpm_Open in -lgpm" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010012207echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
12208if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
12209 echo $ECHO_N "(cached) $ECHO_C" >&6
12210else
12211 ac_check_lib_save_LIBS=$LIBS
12212LIBS="-lgpm $LIBS"
micky3879b9f5e72025-07-08 18:04:53 -040012213cat >"conftest.$ac_ext" <<_ACEOF
12214#line 12214 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +010012215#include "confdefs.h"
12216
12217/* Override any gcc2 internal prototype to avoid an error. */
12218#ifdef __cplusplus
12219extern "C"
12220#endif
12221/* We use char because int might match the return type of a gcc2
12222 builtin and then its argument prototype would still apply. */
micky3879b9f5e72025-07-08 18:04:53 -040012223char Gpm_Open (void);
Steve Kondikae271bc2015-11-15 02:50:53 +010012224int
micky3879b9f5e72025-07-08 18:04:53 -040012225main (void)
Steve Kondikae271bc2015-11-15 02:50:53 +010012226{
12227Gpm_Open ();
12228 ;
12229 return 0;
12230}
12231_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -040012232rm -f "conftest.$ac_objext" "conftest$ac_exeext"
12233if { (eval echo "$as_me:12233: \"$ac_link\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010012234 (eval $ac_link) 2>&5
12235 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040012236 echo "$as_me:12236: \$? = $ac_status" >&5
12237 (exit "$ac_status"); } &&
12238 { ac_try='test -s "conftest$ac_exeext"'
12239 { (eval echo "$as_me:12239: \"$ac_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010012240 (eval $ac_try) 2>&5
12241 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040012242 echo "$as_me:12242: \$? = $ac_status" >&5
12243 (exit "$ac_status"); }; }; then
Steve Kondikae271bc2015-11-15 02:50:53 +010012244 ac_cv_lib_gpm_Gpm_Open=yes
12245else
12246 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -040012247cat "conftest.$ac_ext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010012248ac_cv_lib_gpm_Gpm_Open=no
12249fi
micky3879b9f5e72025-07-08 18:04:53 -040012250rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
Steve Kondikae271bc2015-11-15 02:50:53 +010012251LIBS=$ac_check_lib_save_LIBS
12252fi
micky3879b9f5e72025-07-08 18:04:53 -040012253echo "$as_me:12253: result: $ac_cv_lib_gpm_Gpm_Open" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010012254echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
micky3879b9f5e72025-07-08 18:04:53 -040012255if test "$ac_cv_lib_gpm_Gpm_Open" = yes; then
12256 echo "$as_me:12256: checking for initscr in -lgpm" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010012257echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
12258if test "${ac_cv_lib_gpm_initscr+set}" = set; then
12259 echo $ECHO_N "(cached) $ECHO_C" >&6
12260else
12261 ac_check_lib_save_LIBS=$LIBS
12262LIBS="-lgpm $LIBS"
micky3879b9f5e72025-07-08 18:04:53 -040012263cat >"conftest.$ac_ext" <<_ACEOF
12264#line 12264 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +010012265#include "confdefs.h"
12266
12267/* Override any gcc2 internal prototype to avoid an error. */
12268#ifdef __cplusplus
12269extern "C"
12270#endif
12271/* We use char because int might match the return type of a gcc2
12272 builtin and then its argument prototype would still apply. */
micky3879b9f5e72025-07-08 18:04:53 -040012273char initscr (void);
Steve Kondikae271bc2015-11-15 02:50:53 +010012274int
micky3879b9f5e72025-07-08 18:04:53 -040012275main (void)
Steve Kondikae271bc2015-11-15 02:50:53 +010012276{
12277initscr ();
12278 ;
12279 return 0;
12280}
12281_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -040012282rm -f "conftest.$ac_objext" "conftest$ac_exeext"
12283if { (eval echo "$as_me:12283: \"$ac_link\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010012284 (eval $ac_link) 2>&5
12285 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040012286 echo "$as_me:12286: \$? = $ac_status" >&5
12287 (exit "$ac_status"); } &&
12288 { ac_try='test -s "conftest$ac_exeext"'
12289 { (eval echo "$as_me:12289: \"$ac_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010012290 (eval $ac_try) 2>&5
12291 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040012292 echo "$as_me:12292: \$? = $ac_status" >&5
12293 (exit "$ac_status"); }; }; then
Steve Kondikae271bc2015-11-15 02:50:53 +010012294 ac_cv_lib_gpm_initscr=yes
12295else
12296 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -040012297cat "conftest.$ac_ext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010012298ac_cv_lib_gpm_initscr=no
12299fi
micky3879b9f5e72025-07-08 18:04:53 -040012300rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
Steve Kondikae271bc2015-11-15 02:50:53 +010012301LIBS=$ac_check_lib_save_LIBS
12302fi
micky3879b9f5e72025-07-08 18:04:53 -040012303echo "$as_me:12303: result: $ac_cv_lib_gpm_initscr" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010012304echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
micky3879b9f5e72025-07-08 18:04:53 -040012305if test "$ac_cv_lib_gpm_initscr" = yes; then
Steve Kondikae271bc2015-11-15 02:50:53 +010012306 LIBS="$cf_ncurses_SAVE"
12307else
12308 cf_ncurses_LIBS="-lgpm"
12309fi
12310
12311fi
12312
micky3879b9f5e72025-07-08 18:04:53 -040012313case "$host_os" in
Steve Kondikae271bc2015-11-15 02:50:53 +010012314(freebsd*)
12315 # This is only necessary if you are linking against an obsolete
micky3879b9f5e72025-07-08 18:04:53 -040012316 # version of ncurses (but it should do no harm, since it is static).
Steve Kondikae271bc2015-11-15 02:50:53 +010012317 if test "$cf_nculib_root" = ncurses ; then
micky3879b9f5e72025-07-08 18:04:53 -040012318 echo "$as_me:12318: checking for tgoto in -lmytinfo" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010012319echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
12320if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
12321 echo $ECHO_N "(cached) $ECHO_C" >&6
12322else
12323 ac_check_lib_save_LIBS=$LIBS
12324LIBS="-lmytinfo $LIBS"
micky3879b9f5e72025-07-08 18:04:53 -040012325cat >"conftest.$ac_ext" <<_ACEOF
12326#line 12326 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +010012327#include "confdefs.h"
12328
12329/* Override any gcc2 internal prototype to avoid an error. */
12330#ifdef __cplusplus
12331extern "C"
12332#endif
12333/* We use char because int might match the return type of a gcc2
12334 builtin and then its argument prototype would still apply. */
micky3879b9f5e72025-07-08 18:04:53 -040012335char tgoto (void);
Steve Kondikae271bc2015-11-15 02:50:53 +010012336int
micky3879b9f5e72025-07-08 18:04:53 -040012337main (void)
Steve Kondikae271bc2015-11-15 02:50:53 +010012338{
12339tgoto ();
12340 ;
12341 return 0;
12342}
12343_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -040012344rm -f "conftest.$ac_objext" "conftest$ac_exeext"
12345if { (eval echo "$as_me:12345: \"$ac_link\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010012346 (eval $ac_link) 2>&5
12347 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040012348 echo "$as_me:12348: \$? = $ac_status" >&5
12349 (exit "$ac_status"); } &&
12350 { ac_try='test -s "conftest$ac_exeext"'
12351 { (eval echo "$as_me:12351: \"$ac_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010012352 (eval $ac_try) 2>&5
12353 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040012354 echo "$as_me:12354: \$? = $ac_status" >&5
12355 (exit "$ac_status"); }; }; then
Steve Kondikae271bc2015-11-15 02:50:53 +010012356 ac_cv_lib_mytinfo_tgoto=yes
12357else
12358 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -040012359cat "conftest.$ac_ext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010012360ac_cv_lib_mytinfo_tgoto=no
12361fi
micky3879b9f5e72025-07-08 18:04:53 -040012362rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
Steve Kondikae271bc2015-11-15 02:50:53 +010012363LIBS=$ac_check_lib_save_LIBS
12364fi
micky3879b9f5e72025-07-08 18:04:53 -040012365echo "$as_me:12365: result: $ac_cv_lib_mytinfo_tgoto" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010012366echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
micky3879b9f5e72025-07-08 18:04:53 -040012367if test "$ac_cv_lib_mytinfo_tgoto" = yes; then
Steve Kondikae271bc2015-11-15 02:50:53 +010012368 cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
12369fi
12370
12371 fi
12372 ;;
12373esac
12374
micky3879b9f5e72025-07-08 18:04:53 -040012375cf_add_libs="$LIBS"
12376# reverse order
12377cf_add_0lib=
12378for cf_add_1lib in $cf_ncurses_LIBS; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
12379# filter duplicates
12380for cf_add_1lib in $cf_add_0lib; do
12381 for cf_add_2lib in $cf_add_libs; do
12382 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
Steve Kondikae271bc2015-11-15 02:50:53 +010012383 cf_add_1lib=
12384 break
12385 fi
12386 done
micky3879b9f5e72025-07-08 18:04:53 -040012387 test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
Steve Kondikae271bc2015-11-15 02:50:53 +010012388done
12389LIBS="$cf_add_libs"
12390
micky3879b9f5e72025-07-08 18:04:53 -040012391if test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no"
Steve Kondikae271bc2015-11-15 02:50:53 +010012392then
12393
micky3879b9f5e72025-07-08 18:04:53 -040012394cf_add_libs="$LIBS"
12395# reverse order
12396cf_add_0lib=
12397for cf_add_1lib in -l$cf_nculib_root; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
12398# filter duplicates
12399for cf_add_1lib in $cf_add_0lib; do
12400 for cf_add_2lib in $cf_add_libs; do
12401 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
Steve Kondikae271bc2015-11-15 02:50:53 +010012402 cf_add_1lib=
12403 break
12404 fi
12405 done
micky3879b9f5e72025-07-08 18:04:53 -040012406 test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
Steve Kondikae271bc2015-11-15 02:50:53 +010012407done
12408LIBS="$cf_add_libs"
12409
12410else
12411
micky3879b9f5e72025-07-08 18:04:53 -040012412 eval 'cf_cv_have_lib_'"$cf_nculib_root"'=no'
Steve Kondikae271bc2015-11-15 02:50:53 +010012413 cf_libdir=""
micky3879b9f5e72025-07-08 18:04:53 -040012414 echo "$as_me:12414: checking for initscr" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010012415echo $ECHO_N "checking for initscr... $ECHO_C" >&6
12416if test "${ac_cv_func_initscr+set}" = set; then
12417 echo $ECHO_N "(cached) $ECHO_C" >&6
12418else
micky3879b9f5e72025-07-08 18:04:53 -040012419 cat >"conftest.$ac_ext" <<_ACEOF
12420#line 12420 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +010012421#include "confdefs.h"
micky3879b9f5e72025-07-08 18:04:53 -040012422#define initscr autoconf_temporary
12423#include <limits.h> /* least-intrusive standard header which defines gcc2 __stub macros */
12424#undef initscr
12425
Steve Kondikae271bc2015-11-15 02:50:53 +010012426#ifdef __cplusplus
12427extern "C"
12428#endif
micky3879b9f5e72025-07-08 18:04:53 -040012429
Steve Kondikae271bc2015-11-15 02:50:53 +010012430/* We use char because int might match the return type of a gcc2
12431 builtin and then its argument prototype would still apply. */
micky3879b9f5e72025-07-08 18:04:53 -040012432char initscr (void);
Steve Kondikae271bc2015-11-15 02:50:53 +010012433
12434int
micky3879b9f5e72025-07-08 18:04:53 -040012435main (void)
Steve Kondikae271bc2015-11-15 02:50:53 +010012436{
micky3879b9f5e72025-07-08 18:04:53 -040012437
12438/* The GNU C library defines stubs for functions which it implements
Steve Kondikae271bc2015-11-15 02:50:53 +010012439 to always fail with ENOSYS. Some functions are actually named
12440 something starting with __ and the normal name is an alias. */
12441#if defined (__stub_initscr) || defined (__stub___initscr)
micky3879b9f5e72025-07-08 18:04:53 -040012442#error found stub for initscr
Steve Kondikae271bc2015-11-15 02:50:53 +010012443#endif
12444
micky3879b9f5e72025-07-08 18:04:53 -040012445 return initscr ();
Steve Kondikae271bc2015-11-15 02:50:53 +010012446 ;
12447 return 0;
12448}
12449_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -040012450rm -f "conftest.$ac_objext" "conftest$ac_exeext"
12451if { (eval echo "$as_me:12451: \"$ac_link\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010012452 (eval $ac_link) 2>&5
12453 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040012454 echo "$as_me:12454: \$? = $ac_status" >&5
12455 (exit "$ac_status"); } &&
12456 { ac_try='test -s "conftest$ac_exeext"'
12457 { (eval echo "$as_me:12457: \"$ac_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010012458 (eval $ac_try) 2>&5
12459 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040012460 echo "$as_me:12460: \$? = $ac_status" >&5
12461 (exit "$ac_status"); }; }; then
Steve Kondikae271bc2015-11-15 02:50:53 +010012462 ac_cv_func_initscr=yes
12463else
12464 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -040012465cat "conftest.$ac_ext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010012466ac_cv_func_initscr=no
12467fi
micky3879b9f5e72025-07-08 18:04:53 -040012468rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
Steve Kondikae271bc2015-11-15 02:50:53 +010012469fi
micky3879b9f5e72025-07-08 18:04:53 -040012470echo "$as_me:12470: result: $ac_cv_func_initscr" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010012471echo "${ECHO_T}$ac_cv_func_initscr" >&6
micky3879b9f5e72025-07-08 18:04:53 -040012472if test "$ac_cv_func_initscr" = yes; then
12473 eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
Steve Kondikae271bc2015-11-15 02:50:53 +010012474else
12475
12476 cf_save_LIBS="$LIBS"
micky3879b9f5e72025-07-08 18:04:53 -040012477 echo "$as_me:12477: checking for initscr in -l$cf_nculib_root" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010012478echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
12479 LIBS="-l$cf_nculib_root $LIBS"
micky3879b9f5e72025-07-08 18:04:53 -040012480 cat >"conftest.$ac_ext" <<_ACEOF
12481#line 12481 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +010012482#include "confdefs.h"
12483#include <${cf_cv_ncurses_header:-curses.h}>
12484int
micky3879b9f5e72025-07-08 18:04:53 -040012485main (void)
Steve Kondikae271bc2015-11-15 02:50:53 +010012486{
12487initscr()
12488 ;
12489 return 0;
12490}
12491_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -040012492rm -f "conftest.$ac_objext" "conftest$ac_exeext"
12493if { (eval echo "$as_me:12493: \"$ac_link\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010012494 (eval $ac_link) 2>&5
12495 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040012496 echo "$as_me:12496: \$? = $ac_status" >&5
12497 (exit "$ac_status"); } &&
12498 { ac_try='test -s "conftest$ac_exeext"'
12499 { (eval echo "$as_me:12499: \"$ac_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010012500 (eval $ac_try) 2>&5
12501 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040012502 echo "$as_me:12502: \$? = $ac_status" >&5
12503 (exit "$ac_status"); }; }; then
12504 echo "$as_me:12504: result: yes" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010012505echo "${ECHO_T}yes" >&6
micky3879b9f5e72025-07-08 18:04:53 -040012506 eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
Steve Kondikae271bc2015-11-15 02:50:53 +010012507
12508else
12509 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -040012510cat "conftest.$ac_ext" >&5
12511echo "$as_me:12511: result: no" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010012512echo "${ECHO_T}no" >&6
12513
12514cf_search=
12515cf_library_path_list=""
12516if test -n "${LDFLAGS}${LIBS}" ; then
12517 for cf_library_path in $LDFLAGS $LIBS
12518 do
micky3879b9f5e72025-07-08 18:04:53 -040012519 case "$cf_library_path" in
Steve Kondikae271bc2015-11-15 02:50:53 +010012520 (-L*)
12521 cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
12522
12523test "x$cf_library_path" != "xNONE" && \
12524test -d "$cf_library_path" && \
12525 {
12526 test -n "$verbose" && echo " ... testing for lib-directories under $cf_library_path"
micky3879b9f5e72025-07-08 18:04:53 -040012527 test -d "$cf_library_path/lib" && cf_search="$cf_search $cf_library_path/lib"
12528 test -d "$cf_library_path/lib/$cf_nculib_root" && cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
12529 test -d "$cf_library_path/lib/$cf_nculib_root/lib" && cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
12530 test -d "$cf_library_path/$cf_nculib_root/lib" && cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
12531 test -d "$cf_library_path/$cf_nculib_root/lib/$cf_nculib_root" && cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib/$cf_nculib_root"
Steve Kondikae271bc2015-11-15 02:50:53 +010012532}
12533
12534 cf_library_path_list="$cf_library_path_list $cf_search"
12535 ;;
12536 esac
12537 done
12538fi
12539
12540cf_search=
12541
12542test "x$prefix" != "xNONE" && \
12543test -d "$prefix" && \
12544 {
12545 test -n "$verbose" && echo " ... testing for lib-directories under $prefix"
micky3879b9f5e72025-07-08 18:04:53 -040012546 test -d "$prefix/lib" && cf_search="$cf_search $prefix/lib"
12547 test -d "$prefix/lib/$cf_nculib_root" && cf_search="$cf_search $prefix/lib/$cf_nculib_root"
12548 test -d "$prefix/lib/$cf_nculib_root/lib" && cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
12549 test -d "$prefix/$cf_nculib_root/lib" && cf_search="$cf_search $prefix/$cf_nculib_root/lib"
12550 test -d "$prefix/$cf_nculib_root/lib/$cf_nculib_root" && cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
Steve Kondikae271bc2015-11-15 02:50:53 +010012551}
12552
12553for cf_subdir_prefix in \
12554 /usr \
12555 /usr/local \
12556 /usr/pkg \
12557 /opt \
12558 /opt/local \
12559 $HOME
12560do
12561
12562test "x$cf_subdir_prefix" != "x$prefix" && \
12563test -d "$cf_subdir_prefix" && \
micky3879b9f5e72025-07-08 18:04:53 -040012564{ test -z "$prefix" || test "x$prefix" = xNONE || test "x$cf_subdir_prefix" != "x$prefix"; } && {
Steve Kondikae271bc2015-11-15 02:50:53 +010012565 test -n "$verbose" && echo " ... testing for lib-directories under $cf_subdir_prefix"
micky3879b9f5e72025-07-08 18:04:53 -040012566 test -d "$cf_subdir_prefix/lib" && cf_search="$cf_search $cf_subdir_prefix/lib"
12567 test -d "$cf_subdir_prefix/lib/$cf_nculib_root" && cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root"
12568 test -d "$cf_subdir_prefix/lib/$cf_nculib_root/lib" && cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root/lib"
12569 test -d "$cf_subdir_prefix/$cf_nculib_root/lib" && cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib"
12570 test -d "$cf_subdir_prefix/$cf_nculib_root/lib/$cf_nculib_root" && cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib/$cf_nculib_root"
Steve Kondikae271bc2015-11-15 02:50:53 +010012571}
12572
12573done
12574
12575cf_search="$cf_library_path_list $cf_search"
12576
12577 for cf_libdir in $cf_search
12578 do
micky3879b9f5e72025-07-08 18:04:53 -040012579 echo "$as_me:12579: checking for -l$cf_nculib_root in $cf_libdir" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010012580echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
12581 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
micky3879b9f5e72025-07-08 18:04:53 -040012582 cat >"conftest.$ac_ext" <<_ACEOF
12583#line 12583 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +010012584#include "confdefs.h"
12585#include <${cf_cv_ncurses_header:-curses.h}>
12586int
micky3879b9f5e72025-07-08 18:04:53 -040012587main (void)
Steve Kondikae271bc2015-11-15 02:50:53 +010012588{
12589initscr()
12590 ;
12591 return 0;
12592}
12593_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -040012594rm -f "conftest.$ac_objext" "conftest$ac_exeext"
12595if { (eval echo "$as_me:12595: \"$ac_link\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010012596 (eval $ac_link) 2>&5
12597 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040012598 echo "$as_me:12598: \$? = $ac_status" >&5
12599 (exit "$ac_status"); } &&
12600 { ac_try='test -s "conftest$ac_exeext"'
12601 { (eval echo "$as_me:12601: \"$ac_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010012602 (eval $ac_try) 2>&5
12603 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040012604 echo "$as_me:12604: \$? = $ac_status" >&5
12605 (exit "$ac_status"); }; }; then
12606 echo "$as_me:12606: result: yes" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010012607echo "${ECHO_T}yes" >&6
micky3879b9f5e72025-07-08 18:04:53 -040012608 eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
Steve Kondikae271bc2015-11-15 02:50:53 +010012609 break
12610else
12611 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -040012612cat "conftest.$ac_ext" >&5
12613echo "$as_me:12613: result: no" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010012614echo "${ECHO_T}no" >&6
12615 LIBS="$cf_save_LIBS"
12616fi
micky3879b9f5e72025-07-08 18:04:53 -040012617rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
Steve Kondikae271bc2015-11-15 02:50:53 +010012618 done
12619
12620fi
micky3879b9f5e72025-07-08 18:04:53 -040012621rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
Steve Kondikae271bc2015-11-15 02:50:53 +010012622
12623fi
12624
micky3879b9f5e72025-07-08 18:04:53 -040012625eval 'cf_found_library="$cf_cv_have_lib_'"$cf_nculib_root"\"
Steve Kondikae271bc2015-11-15 02:50:53 +010012626
micky3879b9f5e72025-07-08 18:04:53 -040012627if test "$cf_found_library" = no ; then
12628 { { echo "$as_me:12628: error: Cannot link $cf_nculib_root library" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010012629echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
12630 { (exit 1); exit 1; }; }
12631fi
12632
12633fi
12634
12635if test -n "$cf_ncurses_LIBS" ; then
micky3879b9f5e72025-07-08 18:04:53 -040012636 echo "$as_me:12636: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010012637echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
12638 cf_ncurses_SAVE="$LIBS"
12639 for p in $cf_ncurses_LIBS ; do
micky3879b9f5e72025-07-08 18:04:53 -040012640 q=`echo "$LIBS" | sed -e "s%$p %%" -e "s%$p$%%"`
Steve Kondikae271bc2015-11-15 02:50:53 +010012641 if test "$q" != "$LIBS" ; then
12642 LIBS="$q"
12643 fi
12644 done
micky3879b9f5e72025-07-08 18:04:53 -040012645 cat >"conftest.$ac_ext" <<_ACEOF
12646#line 12646 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +010012647#include "confdefs.h"
12648#include <${cf_cv_ncurses_header:-curses.h}>
12649int
micky3879b9f5e72025-07-08 18:04:53 -040012650main (void)
Steve Kondikae271bc2015-11-15 02:50:53 +010012651{
micky3879b9f5e72025-07-08 18:04:53 -040012652initscr(); mousemask(0,0); tigetstr((char *)0);
Steve Kondikae271bc2015-11-15 02:50:53 +010012653 ;
12654 return 0;
12655}
12656_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -040012657rm -f "conftest.$ac_objext" "conftest$ac_exeext"
12658if { (eval echo "$as_me:12658: \"$ac_link\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010012659 (eval $ac_link) 2>&5
12660 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040012661 echo "$as_me:12661: \$? = $ac_status" >&5
12662 (exit "$ac_status"); } &&
12663 { ac_try='test -s "conftest$ac_exeext"'
12664 { (eval echo "$as_me:12664: \"$ac_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010012665 (eval $ac_try) 2>&5
12666 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040012667 echo "$as_me:12667: \$? = $ac_status" >&5
12668 (exit "$ac_status"); }; }; then
12669 echo "$as_me:12669: result: yes" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010012670echo "${ECHO_T}yes" >&6
12671else
12672 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -040012673cat "conftest.$ac_ext" >&5
12674echo "$as_me:12674: result: no" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010012675echo "${ECHO_T}no" >&6
12676 LIBS="$cf_ncurses_SAVE"
12677fi
micky3879b9f5e72025-07-08 18:04:53 -040012678rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
Steve Kondikae271bc2015-11-15 02:50:53 +010012679fi
12680
12681cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
12682
12683cat >>confdefs.h <<EOF
12684#define $cf_nculib_ROOT 1
12685EOF
12686
12687 fi
12688else
12689 NCURSES_CONFIG=none
12690fi
12691
12692 ;;
12693(pdcurses)
micky3879b9f5e72025-07-08 18:04:53 -040012694 echo "$as_me:12694: checking for X" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010012695echo $ECHO_N "checking for X... $ECHO_C" >&6
12696
12697# Check whether --with-x or --without-x was given.
12698if test "${with_x+set}" = set; then
12699 withval="$with_x"
12700
12701fi;
12702# $have_x is `yes', `no', `disabled', or empty when we do not yet know.
12703if test "x$with_x" = xno; then
12704 # The user explicitly disabled X.
12705 have_x=disabled
12706else
12707 if test "x$x_includes" != xNONE && test "x$x_libraries" != xNONE; then
12708 # Both variables are already set.
12709 have_x=yes
12710 else
12711 if test "${ac_cv_have_x+set}" = set; then
12712 echo $ECHO_N "(cached) $ECHO_C" >&6
12713else
12714 # One or both of the vars are not set, and there is no cached value.
12715ac_x_includes=no ac_x_libraries=no
12716rm -fr conftest.dir
12717if mkdir conftest.dir; then
12718 cd conftest.dir
12719 # Make sure to not put "make" in the Imakefile rules, since we grep it out.
12720 cat >Imakefile <<'EOF'
12721acfindx:
12722 @echo 'ac_im_incroot="${INCROOT}"; ac_im_usrlibdir="${USRLIBDIR}"; ac_im_libdir="${LIBDIR}"'
12723EOF
12724 if (xmkmf) >/dev/null 2>/dev/null && test -f Makefile; then
12725 # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
micky3879b9f5e72025-07-08 18:04:53 -040012726 eval "`${MAKE-make} acfindx 2>/dev/null | grep -v make`"
Steve Kondikae271bc2015-11-15 02:50:53 +010012727 # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR.
12728 for ac_extension in a so sl dylib dll; do
micky3879b9f5e72025-07-08 18:04:53 -040012729 if test ! -f "$ac_im_usrlibdir/libX11.$ac_extension" &&
12730 test -f "$ac_im_libdir/libX11.$ac_extension"; then
Steve Kondikae271bc2015-11-15 02:50:53 +010012731 ac_im_usrlibdir=$ac_im_libdir; break
12732 fi
12733 done
12734 # Screen out bogus values from the imake configuration. They are
12735 # bogus both because they are the default anyway, and because
12736 # using them would break gcc on systems where it needs fixed includes.
12737 case $ac_im_incroot in
12738 /usr/include) ;;
12739 *) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes=$ac_im_incroot;;
12740 esac
12741 case $ac_im_usrlibdir in
12742 /usr/lib | /lib) ;;
12743 *) test -d "$ac_im_usrlibdir" && ac_x_libraries=$ac_im_usrlibdir ;;
12744 esac
12745 fi
12746 cd ..
12747 rm -fr conftest.dir
12748fi
12749
12750# Standard set of common directories for X headers.
12751# Check X11 before X11Rn because it is often a symlink to the current release.
12752ac_x_header_dirs='
12753/usr/X11/include
micky3879b9f5e72025-07-08 18:04:53 -040012754/usr/X11R7/include
Steve Kondikae271bc2015-11-15 02:50:53 +010012755/usr/X11R6/include
12756/usr/X11R5/include
12757/usr/X11R4/include
12758
micky3879b9f5e72025-07-08 18:04:53 -040012759/opt/local/include
12760/opt/X11/include
12761
Steve Kondikae271bc2015-11-15 02:50:53 +010012762/usr/include/X11
micky3879b9f5e72025-07-08 18:04:53 -040012763/usr/include/X11R7
Steve Kondikae271bc2015-11-15 02:50:53 +010012764/usr/include/X11R6
12765/usr/include/X11R5
12766/usr/include/X11R4
12767
12768/usr/local/X11/include
micky3879b9f5e72025-07-08 18:04:53 -040012769/usr/local/X11R7/include
Steve Kondikae271bc2015-11-15 02:50:53 +010012770/usr/local/X11R6/include
12771/usr/local/X11R5/include
12772/usr/local/X11R4/include
12773
12774/usr/local/include/X11
micky3879b9f5e72025-07-08 18:04:53 -040012775/usr/local/include/X11R7
Steve Kondikae271bc2015-11-15 02:50:53 +010012776/usr/local/include/X11R6
12777/usr/local/include/X11R5
12778/usr/local/include/X11R4
12779
12780/usr/X386/include
12781/usr/x386/include
12782/usr/XFree86/include/X11
12783
12784/usr/include
12785/usr/local/include
12786/usr/unsupported/include
12787/usr/athena/include
12788/usr/local/x11r5/include
12789/usr/lpp/Xamples/include
12790
12791/usr/openwin/include
12792/usr/openwin/share/include'
12793
12794if test "$ac_x_includes" = no; then
12795 # Guess where to find include files, by looking for Intrinsic.h.
12796 # First, try using that file with no special directory specified.
micky3879b9f5e72025-07-08 18:04:53 -040012797 cat >"conftest.$ac_ext" <<_ACEOF
12798#line 12798 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +010012799#include "confdefs.h"
12800#include <X11/Intrinsic.h>
12801_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -040012802if { (eval echo "$as_me:12802: \"$ac_cpp "conftest.$ac_ext"\"") >&5
12803 (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
Steve Kondikae271bc2015-11-15 02:50:53 +010012804 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040012805 $EGREP -v '^ *\+' conftest.er1 >conftest.err
Steve Kondikae271bc2015-11-15 02:50:53 +010012806 rm -f conftest.er1
12807 cat conftest.err >&5
micky3879b9f5e72025-07-08 18:04:53 -040012808 echo "$as_me:12808: \$? = $ac_status" >&5
12809 (exit "$ac_status"); } >/dev/null; then
Steve Kondikae271bc2015-11-15 02:50:53 +010012810 if test -s conftest.err; then
12811 ac_cpp_err=$ac_c_preproc_warn_flag
12812 else
12813 ac_cpp_err=
12814 fi
12815else
12816 ac_cpp_err=yes
12817fi
12818if test -z "$ac_cpp_err"; then
12819 # We can compile using X headers with no special include directory.
12820ac_x_includes=
12821else
12822 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -040012823 cat "conftest.$ac_ext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010012824 for ac_dir in $ac_x_header_dirs; do
12825 if test -r "$ac_dir/X11/Intrinsic.h"; then
12826 ac_x_includes=$ac_dir
12827 break
12828 fi
12829done
12830fi
micky3879b9f5e72025-07-08 18:04:53 -040012831rm -f conftest.err "conftest.$ac_ext"
Steve Kondikae271bc2015-11-15 02:50:53 +010012832fi # $ac_x_includes = no
12833
12834if test "$ac_x_libraries" = no; then
12835 # Check for the libraries.
12836 # See if we find them without any special options.
12837 # Don't add to $LIBS permanently.
12838 ac_save_LIBS=$LIBS
12839 LIBS="-lXt $LIBS"
micky3879b9f5e72025-07-08 18:04:53 -040012840 cat >"conftest.$ac_ext" <<_ACEOF
12841#line 12841 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +010012842#include "confdefs.h"
12843#include <X11/Intrinsic.h>
12844int
micky3879b9f5e72025-07-08 18:04:53 -040012845main (void)
Steve Kondikae271bc2015-11-15 02:50:53 +010012846{
12847XtMalloc (0)
12848 ;
12849 return 0;
12850}
12851_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -040012852rm -f "conftest.$ac_objext" "conftest$ac_exeext"
12853if { (eval echo "$as_me:12853: \"$ac_link\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010012854 (eval $ac_link) 2>&5
12855 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040012856 echo "$as_me:12856: \$? = $ac_status" >&5
12857 (exit "$ac_status"); } &&
12858 { ac_try='test -s "conftest$ac_exeext"'
12859 { (eval echo "$as_me:12859: \"$ac_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010012860 (eval $ac_try) 2>&5
12861 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040012862 echo "$as_me:12862: \$? = $ac_status" >&5
12863 (exit "$ac_status"); }; }; then
Steve Kondikae271bc2015-11-15 02:50:53 +010012864 LIBS=$ac_save_LIBS
12865# We can link X programs with no special library path.
12866ac_x_libraries=
12867else
12868 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -040012869cat "conftest.$ac_ext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010012870LIBS=$ac_save_LIBS
12871for ac_dir in `echo "$ac_x_includes $ac_x_header_dirs" | sed s/include/lib/g`
12872do
12873 # Don't even attempt the hair of trying to link an X program!
12874 for ac_extension in a so sl dylib dll; do
micky3879b9f5e72025-07-08 18:04:53 -040012875 if test -r "$ac_dir/libXt.$ac_extension"; then
Steve Kondikae271bc2015-11-15 02:50:53 +010012876 ac_x_libraries=$ac_dir
12877 break 2
12878 fi
12879 done
12880done
12881fi
micky3879b9f5e72025-07-08 18:04:53 -040012882rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
Steve Kondikae271bc2015-11-15 02:50:53 +010012883fi # $ac_x_libraries = no
12884
12885if test "$ac_x_includes" = no || test "$ac_x_libraries" = no; then
12886 # Didn't find X anywhere. Cache the known absence of X.
12887 ac_cv_have_x="have_x=no"
12888else
12889 # Record where we found X for the cache.
12890 ac_cv_have_x="have_x=yes \
12891 ac_x_includes=$ac_x_includes ac_x_libraries=$ac_x_libraries"
12892fi
12893fi
12894
12895 fi
12896 eval "$ac_cv_have_x"
12897fi # $with_x != no
12898
12899if test "$have_x" != yes; then
micky3879b9f5e72025-07-08 18:04:53 -040012900 echo "$as_me:12900: result: $have_x" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010012901echo "${ECHO_T}$have_x" >&6
12902 no_x=yes
12903else
12904 # If each of the values was on the command line, it overrides each guess.
12905 test "x$x_includes" = xNONE && x_includes=$ac_x_includes
12906 test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries
12907 # Update the cache value to reflect the command line values.
12908 ac_cv_have_x="have_x=yes \
12909 ac_x_includes=$x_includes ac_x_libraries=$x_libraries"
micky3879b9f5e72025-07-08 18:04:53 -040012910 echo "$as_me:12910: result: libraries $x_libraries, headers $x_includes" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010012911echo "${ECHO_T}libraries $x_libraries, headers $x_includes" >&6
12912fi
12913
12914if test "$no_x" = yes; then
12915 # Not all programs may use this symbol, but it does not hurt to define it.
12916
12917cat >>confdefs.h <<\EOF
12918#define X_DISPLAY_MISSING 1
12919EOF
12920
micky3879b9f5e72025-07-08 18:04:53 -040012921 X_CFLAGS=
12922 X_PRE_LIBS=
12923 X_LIBS=
12924 X_EXTRA_LIBS=
Steve Kondikae271bc2015-11-15 02:50:53 +010012925else
12926 if test -n "$x_includes"; then
12927 X_CFLAGS="$X_CFLAGS -I$x_includes"
12928 fi
12929
12930 # It would also be nice to do this for all -L options, not just this one.
12931 if test -n "$x_libraries"; then
12932 X_LIBS="$X_LIBS -L$x_libraries"
12933 # For Solaris; some versions of Sun CC require a space after -R and
12934 # others require no space. Words are not sufficient . . . .
12935 case `(uname -sr) 2>/dev/null` in
12936 "SunOS 5"*)
micky3879b9f5e72025-07-08 18:04:53 -040012937 echo "$as_me:12937: checking whether -R must be followed by a space" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010012938echo $ECHO_N "checking whether -R must be followed by a space... $ECHO_C" >&6
12939 ac_xsave_LIBS=$LIBS; LIBS="$LIBS -R$x_libraries"
micky3879b9f5e72025-07-08 18:04:53 -040012940 cat >"conftest.$ac_ext" <<_ACEOF
12941#line 12941 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +010012942#include "confdefs.h"
12943
12944int
micky3879b9f5e72025-07-08 18:04:53 -040012945main (void)
Steve Kondikae271bc2015-11-15 02:50:53 +010012946{
12947
12948 ;
12949 return 0;
12950}
12951_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -040012952rm -f "conftest.$ac_objext" "conftest$ac_exeext"
12953if { (eval echo "$as_me:12953: \"$ac_link\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010012954 (eval $ac_link) 2>&5
12955 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040012956 echo "$as_me:12956: \$? = $ac_status" >&5
12957 (exit "$ac_status"); } &&
12958 { ac_try='test -s "conftest$ac_exeext"'
12959 { (eval echo "$as_me:12959: \"$ac_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010012960 (eval $ac_try) 2>&5
12961 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040012962 echo "$as_me:12962: \$? = $ac_status" >&5
12963 (exit "$ac_status"); }; }; then
Steve Kondikae271bc2015-11-15 02:50:53 +010012964 ac_R_nospace=yes
12965else
12966 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -040012967cat "conftest.$ac_ext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010012968ac_R_nospace=no
12969fi
micky3879b9f5e72025-07-08 18:04:53 -040012970rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
Steve Kondikae271bc2015-11-15 02:50:53 +010012971 if test $ac_R_nospace = yes; then
micky3879b9f5e72025-07-08 18:04:53 -040012972 echo "$as_me:12972: result: no" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010012973echo "${ECHO_T}no" >&6
12974 X_LIBS="$X_LIBS -R$x_libraries"
12975 else
12976 LIBS="$ac_xsave_LIBS -R $x_libraries"
micky3879b9f5e72025-07-08 18:04:53 -040012977 cat >"conftest.$ac_ext" <<_ACEOF
12978#line 12978 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +010012979#include "confdefs.h"
12980
12981int
micky3879b9f5e72025-07-08 18:04:53 -040012982main (void)
Steve Kondikae271bc2015-11-15 02:50:53 +010012983{
12984
12985 ;
12986 return 0;
12987}
12988_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -040012989rm -f "conftest.$ac_objext" "conftest$ac_exeext"
12990if { (eval echo "$as_me:12990: \"$ac_link\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010012991 (eval $ac_link) 2>&5
12992 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040012993 echo "$as_me:12993: \$? = $ac_status" >&5
12994 (exit "$ac_status"); } &&
12995 { ac_try='test -s "conftest$ac_exeext"'
12996 { (eval echo "$as_me:12996: \"$ac_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010012997 (eval $ac_try) 2>&5
12998 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040012999 echo "$as_me:12999: \$? = $ac_status" >&5
13000 (exit "$ac_status"); }; }; then
Steve Kondikae271bc2015-11-15 02:50:53 +010013001 ac_R_space=yes
13002else
13003 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -040013004cat "conftest.$ac_ext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010013005ac_R_space=no
13006fi
micky3879b9f5e72025-07-08 18:04:53 -040013007rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
Steve Kondikae271bc2015-11-15 02:50:53 +010013008 if test $ac_R_space = yes; then
micky3879b9f5e72025-07-08 18:04:53 -040013009 echo "$as_me:13009: result: yes" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010013010echo "${ECHO_T}yes" >&6
13011 X_LIBS="$X_LIBS -R $x_libraries"
13012 else
micky3879b9f5e72025-07-08 18:04:53 -040013013 echo "$as_me:13013: result: neither works" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010013014echo "${ECHO_T}neither works" >&6
13015 fi
13016 fi
13017 LIBS=$ac_xsave_LIBS
13018 esac
13019 fi
13020
13021 # Check for system-dependent libraries X programs must link with.
13022 # Do this before checking for the system-independent R6 libraries
13023 # (-lICE), since we may need -lsocket or whatever for X linking.
13024
13025 if test "$ISC" = yes; then
13026 X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl_s -linet"
13027 else
13028 # Martyn Johnson says this is needed for Ultrix, if the X
13029 # libraries were built with DECnet support. And Karl Berry says
13030 # the Alpha needs dnet_stub (dnet does not exist).
13031 ac_xsave_LIBS="$LIBS"; LIBS="$LIBS $X_LIBS -lX11"
micky3879b9f5e72025-07-08 18:04:53 -040013032 cat >"conftest.$ac_ext" <<_ACEOF
13033#line 13033 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +010013034#include "confdefs.h"
13035
13036/* Override any gcc2 internal prototype to avoid an error. */
13037#ifdef __cplusplus
13038extern "C"
13039#endif
13040/* We use char because int might match the return type of a gcc2
13041 builtin and then its argument prototype would still apply. */
micky3879b9f5e72025-07-08 18:04:53 -040013042char XOpenDisplay (void);
Steve Kondikae271bc2015-11-15 02:50:53 +010013043int
micky3879b9f5e72025-07-08 18:04:53 -040013044main (void)
Steve Kondikae271bc2015-11-15 02:50:53 +010013045{
13046XOpenDisplay ();
13047 ;
13048 return 0;
13049}
13050_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -040013051rm -f "conftest.$ac_objext" "conftest$ac_exeext"
13052if { (eval echo "$as_me:13052: \"$ac_link\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010013053 (eval $ac_link) 2>&5
13054 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040013055 echo "$as_me:13055: \$? = $ac_status" >&5
13056 (exit "$ac_status"); } &&
13057 { ac_try='test -s "conftest$ac_exeext"'
13058 { (eval echo "$as_me:13058: \"$ac_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010013059 (eval $ac_try) 2>&5
13060 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040013061 echo "$as_me:13061: \$? = $ac_status" >&5
13062 (exit "$ac_status"); }; }; then
Steve Kondikae271bc2015-11-15 02:50:53 +010013063 :
13064else
13065 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -040013066cat "conftest.$ac_ext" >&5
13067echo "$as_me:13067: checking for dnet_ntoa in -ldnet" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010013068echo $ECHO_N "checking for dnet_ntoa in -ldnet... $ECHO_C" >&6
13069if test "${ac_cv_lib_dnet_dnet_ntoa+set}" = set; then
13070 echo $ECHO_N "(cached) $ECHO_C" >&6
13071else
13072 ac_check_lib_save_LIBS=$LIBS
13073LIBS="-ldnet $LIBS"
micky3879b9f5e72025-07-08 18:04:53 -040013074cat >"conftest.$ac_ext" <<_ACEOF
13075#line 13075 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +010013076#include "confdefs.h"
13077
13078/* Override any gcc2 internal prototype to avoid an error. */
13079#ifdef __cplusplus
13080extern "C"
13081#endif
13082/* We use char because int might match the return type of a gcc2
13083 builtin and then its argument prototype would still apply. */
micky3879b9f5e72025-07-08 18:04:53 -040013084char dnet_ntoa (void);
Steve Kondikae271bc2015-11-15 02:50:53 +010013085int
micky3879b9f5e72025-07-08 18:04:53 -040013086main (void)
Steve Kondikae271bc2015-11-15 02:50:53 +010013087{
13088dnet_ntoa ();
13089 ;
13090 return 0;
13091}
13092_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -040013093rm -f "conftest.$ac_objext" "conftest$ac_exeext"
13094if { (eval echo "$as_me:13094: \"$ac_link\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010013095 (eval $ac_link) 2>&5
13096 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040013097 echo "$as_me:13097: \$? = $ac_status" >&5
13098 (exit "$ac_status"); } &&
13099 { ac_try='test -s "conftest$ac_exeext"'
13100 { (eval echo "$as_me:13100: \"$ac_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010013101 (eval $ac_try) 2>&5
13102 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040013103 echo "$as_me:13103: \$? = $ac_status" >&5
13104 (exit "$ac_status"); }; }; then
Steve Kondikae271bc2015-11-15 02:50:53 +010013105 ac_cv_lib_dnet_dnet_ntoa=yes
13106else
13107 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -040013108cat "conftest.$ac_ext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010013109ac_cv_lib_dnet_dnet_ntoa=no
13110fi
micky3879b9f5e72025-07-08 18:04:53 -040013111rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
Steve Kondikae271bc2015-11-15 02:50:53 +010013112LIBS=$ac_check_lib_save_LIBS
13113fi
micky3879b9f5e72025-07-08 18:04:53 -040013114echo "$as_me:13114: result: $ac_cv_lib_dnet_dnet_ntoa" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010013115echo "${ECHO_T}$ac_cv_lib_dnet_dnet_ntoa" >&6
micky3879b9f5e72025-07-08 18:04:53 -040013116if test "$ac_cv_lib_dnet_dnet_ntoa" = yes; then
Steve Kondikae271bc2015-11-15 02:50:53 +010013117 X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet"
13118fi
13119
13120 if test $ac_cv_lib_dnet_dnet_ntoa = no; then
micky3879b9f5e72025-07-08 18:04:53 -040013121 echo "$as_me:13121: checking for dnet_ntoa in -ldnet_stub" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010013122echo $ECHO_N "checking for dnet_ntoa in -ldnet_stub... $ECHO_C" >&6
13123if test "${ac_cv_lib_dnet_stub_dnet_ntoa+set}" = set; then
13124 echo $ECHO_N "(cached) $ECHO_C" >&6
13125else
13126 ac_check_lib_save_LIBS=$LIBS
13127LIBS="-ldnet_stub $LIBS"
micky3879b9f5e72025-07-08 18:04:53 -040013128cat >"conftest.$ac_ext" <<_ACEOF
13129#line 13129 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +010013130#include "confdefs.h"
13131
13132/* Override any gcc2 internal prototype to avoid an error. */
13133#ifdef __cplusplus
13134extern "C"
13135#endif
13136/* We use char because int might match the return type of a gcc2
13137 builtin and then its argument prototype would still apply. */
micky3879b9f5e72025-07-08 18:04:53 -040013138char dnet_ntoa (void);
Steve Kondikae271bc2015-11-15 02:50:53 +010013139int
micky3879b9f5e72025-07-08 18:04:53 -040013140main (void)
Steve Kondikae271bc2015-11-15 02:50:53 +010013141{
13142dnet_ntoa ();
13143 ;
13144 return 0;
13145}
13146_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -040013147rm -f "conftest.$ac_objext" "conftest$ac_exeext"
13148if { (eval echo "$as_me:13148: \"$ac_link\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010013149 (eval $ac_link) 2>&5
13150 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040013151 echo "$as_me:13151: \$? = $ac_status" >&5
13152 (exit "$ac_status"); } &&
13153 { ac_try='test -s "conftest$ac_exeext"'
13154 { (eval echo "$as_me:13154: \"$ac_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010013155 (eval $ac_try) 2>&5
13156 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040013157 echo "$as_me:13157: \$? = $ac_status" >&5
13158 (exit "$ac_status"); }; }; then
Steve Kondikae271bc2015-11-15 02:50:53 +010013159 ac_cv_lib_dnet_stub_dnet_ntoa=yes
13160else
13161 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -040013162cat "conftest.$ac_ext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010013163ac_cv_lib_dnet_stub_dnet_ntoa=no
13164fi
micky3879b9f5e72025-07-08 18:04:53 -040013165rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
Steve Kondikae271bc2015-11-15 02:50:53 +010013166LIBS=$ac_check_lib_save_LIBS
13167fi
micky3879b9f5e72025-07-08 18:04:53 -040013168echo "$as_me:13168: result: $ac_cv_lib_dnet_stub_dnet_ntoa" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010013169echo "${ECHO_T}$ac_cv_lib_dnet_stub_dnet_ntoa" >&6
micky3879b9f5e72025-07-08 18:04:53 -040013170if test "$ac_cv_lib_dnet_stub_dnet_ntoa" = yes; then
Steve Kondikae271bc2015-11-15 02:50:53 +010013171 X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub"
13172fi
13173
13174 fi
13175fi
micky3879b9f5e72025-07-08 18:04:53 -040013176rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
Steve Kondikae271bc2015-11-15 02:50:53 +010013177 LIBS="$ac_xsave_LIBS"
13178
13179 # msh@cis.ufl.edu says -lnsl (and -lsocket) are needed for his 386/AT,
13180 # to get the SysV transport functions.
13181 # Chad R. Larson says the Pyramis MIS-ES running DC/OSx (SVR4)
13182 # needs -lnsl.
13183 # The nsl library prevents programs from opening the X display
13184 # on Irix 5.2, according to T.E. Dickey.
13185 # The functions gethostbyname, getservbyname, and inet_addr are
13186 # in -lbsd on LynxOS 3.0.1/i386, according to Lars Hecking.
micky3879b9f5e72025-07-08 18:04:53 -040013187 echo "$as_me:13187: checking for gethostbyname" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010013188echo $ECHO_N "checking for gethostbyname... $ECHO_C" >&6
13189if test "${ac_cv_func_gethostbyname+set}" = set; then
13190 echo $ECHO_N "(cached) $ECHO_C" >&6
13191else
micky3879b9f5e72025-07-08 18:04:53 -040013192 cat >"conftest.$ac_ext" <<_ACEOF
13193#line 13193 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +010013194#include "confdefs.h"
micky3879b9f5e72025-07-08 18:04:53 -040013195#define gethostbyname autoconf_temporary
13196#include <limits.h> /* least-intrusive standard header which defines gcc2 __stub macros */
13197#undef gethostbyname
13198
Steve Kondikae271bc2015-11-15 02:50:53 +010013199#ifdef __cplusplus
13200extern "C"
13201#endif
micky3879b9f5e72025-07-08 18:04:53 -040013202
Steve Kondikae271bc2015-11-15 02:50:53 +010013203/* We use char because int might match the return type of a gcc2
13204 builtin and then its argument prototype would still apply. */
micky3879b9f5e72025-07-08 18:04:53 -040013205char gethostbyname (void);
Steve Kondikae271bc2015-11-15 02:50:53 +010013206
13207int
micky3879b9f5e72025-07-08 18:04:53 -040013208main (void)
Steve Kondikae271bc2015-11-15 02:50:53 +010013209{
micky3879b9f5e72025-07-08 18:04:53 -040013210
13211/* The GNU C library defines stubs for functions which it implements
Steve Kondikae271bc2015-11-15 02:50:53 +010013212 to always fail with ENOSYS. Some functions are actually named
13213 something starting with __ and the normal name is an alias. */
13214#if defined (__stub_gethostbyname) || defined (__stub___gethostbyname)
micky3879b9f5e72025-07-08 18:04:53 -040013215#error found stub for gethostbyname
Steve Kondikae271bc2015-11-15 02:50:53 +010013216#endif
13217
micky3879b9f5e72025-07-08 18:04:53 -040013218 return gethostbyname ();
Steve Kondikae271bc2015-11-15 02:50:53 +010013219 ;
13220 return 0;
13221}
13222_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -040013223rm -f "conftest.$ac_objext" "conftest$ac_exeext"
13224if { (eval echo "$as_me:13224: \"$ac_link\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010013225 (eval $ac_link) 2>&5
13226 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040013227 echo "$as_me:13227: \$? = $ac_status" >&5
13228 (exit "$ac_status"); } &&
13229 { ac_try='test -s "conftest$ac_exeext"'
13230 { (eval echo "$as_me:13230: \"$ac_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010013231 (eval $ac_try) 2>&5
13232 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040013233 echo "$as_me:13233: \$? = $ac_status" >&5
13234 (exit "$ac_status"); }; }; then
Steve Kondikae271bc2015-11-15 02:50:53 +010013235 ac_cv_func_gethostbyname=yes
13236else
13237 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -040013238cat "conftest.$ac_ext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010013239ac_cv_func_gethostbyname=no
13240fi
micky3879b9f5e72025-07-08 18:04:53 -040013241rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
Steve Kondikae271bc2015-11-15 02:50:53 +010013242fi
micky3879b9f5e72025-07-08 18:04:53 -040013243echo "$as_me:13243: result: $ac_cv_func_gethostbyname" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010013244echo "${ECHO_T}$ac_cv_func_gethostbyname" >&6
13245
13246 if test $ac_cv_func_gethostbyname = no; then
micky3879b9f5e72025-07-08 18:04:53 -040013247 echo "$as_me:13247: checking for gethostbyname in -lnsl" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010013248echo $ECHO_N "checking for gethostbyname in -lnsl... $ECHO_C" >&6
13249if test "${ac_cv_lib_nsl_gethostbyname+set}" = set; then
13250 echo $ECHO_N "(cached) $ECHO_C" >&6
13251else
13252 ac_check_lib_save_LIBS=$LIBS
13253LIBS="-lnsl $LIBS"
micky3879b9f5e72025-07-08 18:04:53 -040013254cat >"conftest.$ac_ext" <<_ACEOF
13255#line 13255 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +010013256#include "confdefs.h"
13257
13258/* Override any gcc2 internal prototype to avoid an error. */
13259#ifdef __cplusplus
13260extern "C"
13261#endif
13262/* We use char because int might match the return type of a gcc2
13263 builtin and then its argument prototype would still apply. */
micky3879b9f5e72025-07-08 18:04:53 -040013264char gethostbyname (void);
Steve Kondikae271bc2015-11-15 02:50:53 +010013265int
micky3879b9f5e72025-07-08 18:04:53 -040013266main (void)
Steve Kondikae271bc2015-11-15 02:50:53 +010013267{
13268gethostbyname ();
13269 ;
13270 return 0;
13271}
13272_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -040013273rm -f "conftest.$ac_objext" "conftest$ac_exeext"
13274if { (eval echo "$as_me:13274: \"$ac_link\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010013275 (eval $ac_link) 2>&5
13276 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040013277 echo "$as_me:13277: \$? = $ac_status" >&5
13278 (exit "$ac_status"); } &&
13279 { ac_try='test -s "conftest$ac_exeext"'
13280 { (eval echo "$as_me:13280: \"$ac_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010013281 (eval $ac_try) 2>&5
13282 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040013283 echo "$as_me:13283: \$? = $ac_status" >&5
13284 (exit "$ac_status"); }; }; then
Steve Kondikae271bc2015-11-15 02:50:53 +010013285 ac_cv_lib_nsl_gethostbyname=yes
13286else
13287 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -040013288cat "conftest.$ac_ext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010013289ac_cv_lib_nsl_gethostbyname=no
13290fi
micky3879b9f5e72025-07-08 18:04:53 -040013291rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
Steve Kondikae271bc2015-11-15 02:50:53 +010013292LIBS=$ac_check_lib_save_LIBS
13293fi
micky3879b9f5e72025-07-08 18:04:53 -040013294echo "$as_me:13294: result: $ac_cv_lib_nsl_gethostbyname" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010013295echo "${ECHO_T}$ac_cv_lib_nsl_gethostbyname" >&6
micky3879b9f5e72025-07-08 18:04:53 -040013296if test "$ac_cv_lib_nsl_gethostbyname" = yes; then
Steve Kondikae271bc2015-11-15 02:50:53 +010013297 X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl"
13298fi
13299
13300 if test $ac_cv_lib_nsl_gethostbyname = no; then
micky3879b9f5e72025-07-08 18:04:53 -040013301 echo "$as_me:13301: checking for gethostbyname in -lbsd" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010013302echo $ECHO_N "checking for gethostbyname in -lbsd... $ECHO_C" >&6
13303if test "${ac_cv_lib_bsd_gethostbyname+set}" = set; then
13304 echo $ECHO_N "(cached) $ECHO_C" >&6
13305else
13306 ac_check_lib_save_LIBS=$LIBS
13307LIBS="-lbsd $LIBS"
micky3879b9f5e72025-07-08 18:04:53 -040013308cat >"conftest.$ac_ext" <<_ACEOF
13309#line 13309 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +010013310#include "confdefs.h"
13311
13312/* Override any gcc2 internal prototype to avoid an error. */
13313#ifdef __cplusplus
13314extern "C"
13315#endif
13316/* We use char because int might match the return type of a gcc2
13317 builtin and then its argument prototype would still apply. */
micky3879b9f5e72025-07-08 18:04:53 -040013318char gethostbyname (void);
Steve Kondikae271bc2015-11-15 02:50:53 +010013319int
micky3879b9f5e72025-07-08 18:04:53 -040013320main (void)
Steve Kondikae271bc2015-11-15 02:50:53 +010013321{
13322gethostbyname ();
13323 ;
13324 return 0;
13325}
13326_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -040013327rm -f "conftest.$ac_objext" "conftest$ac_exeext"
13328if { (eval echo "$as_me:13328: \"$ac_link\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010013329 (eval $ac_link) 2>&5
13330 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040013331 echo "$as_me:13331: \$? = $ac_status" >&5
13332 (exit "$ac_status"); } &&
13333 { ac_try='test -s "conftest$ac_exeext"'
13334 { (eval echo "$as_me:13334: \"$ac_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010013335 (eval $ac_try) 2>&5
13336 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040013337 echo "$as_me:13337: \$? = $ac_status" >&5
13338 (exit "$ac_status"); }; }; then
Steve Kondikae271bc2015-11-15 02:50:53 +010013339 ac_cv_lib_bsd_gethostbyname=yes
13340else
13341 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -040013342cat "conftest.$ac_ext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010013343ac_cv_lib_bsd_gethostbyname=no
13344fi
micky3879b9f5e72025-07-08 18:04:53 -040013345rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
Steve Kondikae271bc2015-11-15 02:50:53 +010013346LIBS=$ac_check_lib_save_LIBS
13347fi
micky3879b9f5e72025-07-08 18:04:53 -040013348echo "$as_me:13348: result: $ac_cv_lib_bsd_gethostbyname" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010013349echo "${ECHO_T}$ac_cv_lib_bsd_gethostbyname" >&6
micky3879b9f5e72025-07-08 18:04:53 -040013350if test "$ac_cv_lib_bsd_gethostbyname" = yes; then
Steve Kondikae271bc2015-11-15 02:50:53 +010013351 X_EXTRA_LIBS="$X_EXTRA_LIBS -lbsd"
13352fi
13353
13354 fi
13355 fi
13356
13357 # lieder@skyler.mavd.honeywell.com says without -lsocket,
13358 # socket/setsockopt and other routines are undefined under SCO ODT
13359 # 2.0. But -lsocket is broken on IRIX 5.2 (and is not necessary
13360 # on later versions), says Simon Leinen: it contains gethostby*
13361 # variants that don't use the nameserver (or something). -lsocket
13362 # must be given before -lnsl if both are needed. We assume that
13363 # if connect needs -lnsl, so does gethostbyname.
micky3879b9f5e72025-07-08 18:04:53 -040013364 echo "$as_me:13364: checking for connect" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010013365echo $ECHO_N "checking for connect... $ECHO_C" >&6
13366if test "${ac_cv_func_connect+set}" = set; then
13367 echo $ECHO_N "(cached) $ECHO_C" >&6
13368else
micky3879b9f5e72025-07-08 18:04:53 -040013369 cat >"conftest.$ac_ext" <<_ACEOF
13370#line 13370 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +010013371#include "confdefs.h"
micky3879b9f5e72025-07-08 18:04:53 -040013372#define connect autoconf_temporary
13373#include <limits.h> /* least-intrusive standard header which defines gcc2 __stub macros */
13374#undef connect
13375
Steve Kondikae271bc2015-11-15 02:50:53 +010013376#ifdef __cplusplus
13377extern "C"
13378#endif
micky3879b9f5e72025-07-08 18:04:53 -040013379
Steve Kondikae271bc2015-11-15 02:50:53 +010013380/* We use char because int might match the return type of a gcc2
13381 builtin and then its argument prototype would still apply. */
micky3879b9f5e72025-07-08 18:04:53 -040013382char connect (void);
Steve Kondikae271bc2015-11-15 02:50:53 +010013383
13384int
micky3879b9f5e72025-07-08 18:04:53 -040013385main (void)
Steve Kondikae271bc2015-11-15 02:50:53 +010013386{
micky3879b9f5e72025-07-08 18:04:53 -040013387
13388/* The GNU C library defines stubs for functions which it implements
Steve Kondikae271bc2015-11-15 02:50:53 +010013389 to always fail with ENOSYS. Some functions are actually named
13390 something starting with __ and the normal name is an alias. */
13391#if defined (__stub_connect) || defined (__stub___connect)
micky3879b9f5e72025-07-08 18:04:53 -040013392#error found stub for connect
Steve Kondikae271bc2015-11-15 02:50:53 +010013393#endif
13394
micky3879b9f5e72025-07-08 18:04:53 -040013395 return connect ();
Steve Kondikae271bc2015-11-15 02:50:53 +010013396 ;
13397 return 0;
13398}
13399_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -040013400rm -f "conftest.$ac_objext" "conftest$ac_exeext"
13401if { (eval echo "$as_me:13401: \"$ac_link\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010013402 (eval $ac_link) 2>&5
13403 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040013404 echo "$as_me:13404: \$? = $ac_status" >&5
13405 (exit "$ac_status"); } &&
13406 { ac_try='test -s "conftest$ac_exeext"'
13407 { (eval echo "$as_me:13407: \"$ac_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010013408 (eval $ac_try) 2>&5
13409 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040013410 echo "$as_me:13410: \$? = $ac_status" >&5
13411 (exit "$ac_status"); }; }; then
Steve Kondikae271bc2015-11-15 02:50:53 +010013412 ac_cv_func_connect=yes
13413else
13414 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -040013415cat "conftest.$ac_ext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010013416ac_cv_func_connect=no
13417fi
micky3879b9f5e72025-07-08 18:04:53 -040013418rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
Steve Kondikae271bc2015-11-15 02:50:53 +010013419fi
micky3879b9f5e72025-07-08 18:04:53 -040013420echo "$as_me:13420: result: $ac_cv_func_connect" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010013421echo "${ECHO_T}$ac_cv_func_connect" >&6
13422
13423 if test $ac_cv_func_connect = no; then
micky3879b9f5e72025-07-08 18:04:53 -040013424 echo "$as_me:13424: checking for connect in -lsocket" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010013425echo $ECHO_N "checking for connect in -lsocket... $ECHO_C" >&6
13426if test "${ac_cv_lib_socket_connect+set}" = set; then
13427 echo $ECHO_N "(cached) $ECHO_C" >&6
13428else
13429 ac_check_lib_save_LIBS=$LIBS
13430LIBS="-lsocket $X_EXTRA_LIBS $LIBS"
micky3879b9f5e72025-07-08 18:04:53 -040013431cat >"conftest.$ac_ext" <<_ACEOF
13432#line 13432 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +010013433#include "confdefs.h"
13434
13435/* Override any gcc2 internal prototype to avoid an error. */
13436#ifdef __cplusplus
13437extern "C"
13438#endif
13439/* We use char because int might match the return type of a gcc2
13440 builtin and then its argument prototype would still apply. */
micky3879b9f5e72025-07-08 18:04:53 -040013441char connect (void);
Steve Kondikae271bc2015-11-15 02:50:53 +010013442int
micky3879b9f5e72025-07-08 18:04:53 -040013443main (void)
Steve Kondikae271bc2015-11-15 02:50:53 +010013444{
13445connect ();
13446 ;
13447 return 0;
13448}
13449_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -040013450rm -f "conftest.$ac_objext" "conftest$ac_exeext"
13451if { (eval echo "$as_me:13451: \"$ac_link\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010013452 (eval $ac_link) 2>&5
13453 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040013454 echo "$as_me:13454: \$? = $ac_status" >&5
13455 (exit "$ac_status"); } &&
13456 { ac_try='test -s "conftest$ac_exeext"'
13457 { (eval echo "$as_me:13457: \"$ac_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010013458 (eval $ac_try) 2>&5
13459 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040013460 echo "$as_me:13460: \$? = $ac_status" >&5
13461 (exit "$ac_status"); }; }; then
Steve Kondikae271bc2015-11-15 02:50:53 +010013462 ac_cv_lib_socket_connect=yes
13463else
13464 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -040013465cat "conftest.$ac_ext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010013466ac_cv_lib_socket_connect=no
13467fi
micky3879b9f5e72025-07-08 18:04:53 -040013468rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
Steve Kondikae271bc2015-11-15 02:50:53 +010013469LIBS=$ac_check_lib_save_LIBS
13470fi
micky3879b9f5e72025-07-08 18:04:53 -040013471echo "$as_me:13471: result: $ac_cv_lib_socket_connect" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010013472echo "${ECHO_T}$ac_cv_lib_socket_connect" >&6
micky3879b9f5e72025-07-08 18:04:53 -040013473if test "$ac_cv_lib_socket_connect" = yes; then
Steve Kondikae271bc2015-11-15 02:50:53 +010013474 X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS"
13475fi
13476
13477 fi
13478
13479 # Guillermo Gomez says -lposix is necessary on A/UX.
micky3879b9f5e72025-07-08 18:04:53 -040013480 echo "$as_me:13480: checking for remove" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010013481echo $ECHO_N "checking for remove... $ECHO_C" >&6
13482if test "${ac_cv_func_remove+set}" = set; then
13483 echo $ECHO_N "(cached) $ECHO_C" >&6
13484else
micky3879b9f5e72025-07-08 18:04:53 -040013485 cat >"conftest.$ac_ext" <<_ACEOF
13486#line 13486 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +010013487#include "confdefs.h"
micky3879b9f5e72025-07-08 18:04:53 -040013488#define remove autoconf_temporary
13489#include <limits.h> /* least-intrusive standard header which defines gcc2 __stub macros */
13490#undef remove
13491
Steve Kondikae271bc2015-11-15 02:50:53 +010013492#ifdef __cplusplus
13493extern "C"
13494#endif
micky3879b9f5e72025-07-08 18:04:53 -040013495
Steve Kondikae271bc2015-11-15 02:50:53 +010013496/* We use char because int might match the return type of a gcc2
13497 builtin and then its argument prototype would still apply. */
micky3879b9f5e72025-07-08 18:04:53 -040013498char remove (void);
Steve Kondikae271bc2015-11-15 02:50:53 +010013499
13500int
micky3879b9f5e72025-07-08 18:04:53 -040013501main (void)
Steve Kondikae271bc2015-11-15 02:50:53 +010013502{
micky3879b9f5e72025-07-08 18:04:53 -040013503
13504/* The GNU C library defines stubs for functions which it implements
Steve Kondikae271bc2015-11-15 02:50:53 +010013505 to always fail with ENOSYS. Some functions are actually named
13506 something starting with __ and the normal name is an alias. */
13507#if defined (__stub_remove) || defined (__stub___remove)
micky3879b9f5e72025-07-08 18:04:53 -040013508#error found stub for remove
Steve Kondikae271bc2015-11-15 02:50:53 +010013509#endif
13510
micky3879b9f5e72025-07-08 18:04:53 -040013511 return remove ();
Steve Kondikae271bc2015-11-15 02:50:53 +010013512 ;
13513 return 0;
13514}
13515_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -040013516rm -f "conftest.$ac_objext" "conftest$ac_exeext"
13517if { (eval echo "$as_me:13517: \"$ac_link\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010013518 (eval $ac_link) 2>&5
13519 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040013520 echo "$as_me:13520: \$? = $ac_status" >&5
13521 (exit "$ac_status"); } &&
13522 { ac_try='test -s "conftest$ac_exeext"'
13523 { (eval echo "$as_me:13523: \"$ac_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010013524 (eval $ac_try) 2>&5
13525 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040013526 echo "$as_me:13526: \$? = $ac_status" >&5
13527 (exit "$ac_status"); }; }; then
Steve Kondikae271bc2015-11-15 02:50:53 +010013528 ac_cv_func_remove=yes
13529else
13530 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -040013531cat "conftest.$ac_ext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010013532ac_cv_func_remove=no
13533fi
micky3879b9f5e72025-07-08 18:04:53 -040013534rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
Steve Kondikae271bc2015-11-15 02:50:53 +010013535fi
micky3879b9f5e72025-07-08 18:04:53 -040013536echo "$as_me:13536: result: $ac_cv_func_remove" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010013537echo "${ECHO_T}$ac_cv_func_remove" >&6
13538
13539 if test $ac_cv_func_remove = no; then
micky3879b9f5e72025-07-08 18:04:53 -040013540 echo "$as_me:13540: checking for remove in -lposix" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010013541echo $ECHO_N "checking for remove in -lposix... $ECHO_C" >&6
13542if test "${ac_cv_lib_posix_remove+set}" = set; then
13543 echo $ECHO_N "(cached) $ECHO_C" >&6
13544else
13545 ac_check_lib_save_LIBS=$LIBS
13546LIBS="-lposix $LIBS"
micky3879b9f5e72025-07-08 18:04:53 -040013547cat >"conftest.$ac_ext" <<_ACEOF
13548#line 13548 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +010013549#include "confdefs.h"
13550
13551/* Override any gcc2 internal prototype to avoid an error. */
13552#ifdef __cplusplus
13553extern "C"
13554#endif
13555/* We use char because int might match the return type of a gcc2
13556 builtin and then its argument prototype would still apply. */
micky3879b9f5e72025-07-08 18:04:53 -040013557char remove (void);
Steve Kondikae271bc2015-11-15 02:50:53 +010013558int
micky3879b9f5e72025-07-08 18:04:53 -040013559main (void)
Steve Kondikae271bc2015-11-15 02:50:53 +010013560{
13561remove ();
13562 ;
13563 return 0;
13564}
13565_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -040013566rm -f "conftest.$ac_objext" "conftest$ac_exeext"
13567if { (eval echo "$as_me:13567: \"$ac_link\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010013568 (eval $ac_link) 2>&5
13569 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040013570 echo "$as_me:13570: \$? = $ac_status" >&5
13571 (exit "$ac_status"); } &&
13572 { ac_try='test -s "conftest$ac_exeext"'
13573 { (eval echo "$as_me:13573: \"$ac_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010013574 (eval $ac_try) 2>&5
13575 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040013576 echo "$as_me:13576: \$? = $ac_status" >&5
13577 (exit "$ac_status"); }; }; then
Steve Kondikae271bc2015-11-15 02:50:53 +010013578 ac_cv_lib_posix_remove=yes
13579else
13580 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -040013581cat "conftest.$ac_ext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010013582ac_cv_lib_posix_remove=no
13583fi
micky3879b9f5e72025-07-08 18:04:53 -040013584rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
Steve Kondikae271bc2015-11-15 02:50:53 +010013585LIBS=$ac_check_lib_save_LIBS
13586fi
micky3879b9f5e72025-07-08 18:04:53 -040013587echo "$as_me:13587: result: $ac_cv_lib_posix_remove" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010013588echo "${ECHO_T}$ac_cv_lib_posix_remove" >&6
micky3879b9f5e72025-07-08 18:04:53 -040013589if test "$ac_cv_lib_posix_remove" = yes; then
Steve Kondikae271bc2015-11-15 02:50:53 +010013590 X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix"
13591fi
13592
13593 fi
13594
13595 # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay.
micky3879b9f5e72025-07-08 18:04:53 -040013596 echo "$as_me:13596: checking for shmat" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010013597echo $ECHO_N "checking for shmat... $ECHO_C" >&6
13598if test "${ac_cv_func_shmat+set}" = set; then
13599 echo $ECHO_N "(cached) $ECHO_C" >&6
13600else
micky3879b9f5e72025-07-08 18:04:53 -040013601 cat >"conftest.$ac_ext" <<_ACEOF
13602#line 13602 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +010013603#include "confdefs.h"
micky3879b9f5e72025-07-08 18:04:53 -040013604#define shmat autoconf_temporary
13605#include <limits.h> /* least-intrusive standard header which defines gcc2 __stub macros */
13606#undef shmat
13607
Steve Kondikae271bc2015-11-15 02:50:53 +010013608#ifdef __cplusplus
13609extern "C"
13610#endif
micky3879b9f5e72025-07-08 18:04:53 -040013611
Steve Kondikae271bc2015-11-15 02:50:53 +010013612/* We use char because int might match the return type of a gcc2
13613 builtin and then its argument prototype would still apply. */
micky3879b9f5e72025-07-08 18:04:53 -040013614char shmat (void);
Steve Kondikae271bc2015-11-15 02:50:53 +010013615
13616int
micky3879b9f5e72025-07-08 18:04:53 -040013617main (void)
Steve Kondikae271bc2015-11-15 02:50:53 +010013618{
micky3879b9f5e72025-07-08 18:04:53 -040013619
13620/* The GNU C library defines stubs for functions which it implements
Steve Kondikae271bc2015-11-15 02:50:53 +010013621 to always fail with ENOSYS. Some functions are actually named
13622 something starting with __ and the normal name is an alias. */
13623#if defined (__stub_shmat) || defined (__stub___shmat)
micky3879b9f5e72025-07-08 18:04:53 -040013624#error found stub for shmat
Steve Kondikae271bc2015-11-15 02:50:53 +010013625#endif
13626
micky3879b9f5e72025-07-08 18:04:53 -040013627 return shmat ();
Steve Kondikae271bc2015-11-15 02:50:53 +010013628 ;
13629 return 0;
13630}
13631_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -040013632rm -f "conftest.$ac_objext" "conftest$ac_exeext"
13633if { (eval echo "$as_me:13633: \"$ac_link\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010013634 (eval $ac_link) 2>&5
13635 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040013636 echo "$as_me:13636: \$? = $ac_status" >&5
13637 (exit "$ac_status"); } &&
13638 { ac_try='test -s "conftest$ac_exeext"'
13639 { (eval echo "$as_me:13639: \"$ac_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010013640 (eval $ac_try) 2>&5
13641 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040013642 echo "$as_me:13642: \$? = $ac_status" >&5
13643 (exit "$ac_status"); }; }; then
Steve Kondikae271bc2015-11-15 02:50:53 +010013644 ac_cv_func_shmat=yes
13645else
13646 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -040013647cat "conftest.$ac_ext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010013648ac_cv_func_shmat=no
13649fi
micky3879b9f5e72025-07-08 18:04:53 -040013650rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
Steve Kondikae271bc2015-11-15 02:50:53 +010013651fi
micky3879b9f5e72025-07-08 18:04:53 -040013652echo "$as_me:13652: result: $ac_cv_func_shmat" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010013653echo "${ECHO_T}$ac_cv_func_shmat" >&6
13654
13655 if test $ac_cv_func_shmat = no; then
micky3879b9f5e72025-07-08 18:04:53 -040013656 echo "$as_me:13656: checking for shmat in -lipc" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010013657echo $ECHO_N "checking for shmat in -lipc... $ECHO_C" >&6
13658if test "${ac_cv_lib_ipc_shmat+set}" = set; then
13659 echo $ECHO_N "(cached) $ECHO_C" >&6
13660else
13661 ac_check_lib_save_LIBS=$LIBS
13662LIBS="-lipc $LIBS"
micky3879b9f5e72025-07-08 18:04:53 -040013663cat >"conftest.$ac_ext" <<_ACEOF
13664#line 13664 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +010013665#include "confdefs.h"
13666
13667/* Override any gcc2 internal prototype to avoid an error. */
13668#ifdef __cplusplus
13669extern "C"
13670#endif
13671/* We use char because int might match the return type of a gcc2
13672 builtin and then its argument prototype would still apply. */
micky3879b9f5e72025-07-08 18:04:53 -040013673char shmat (void);
Steve Kondikae271bc2015-11-15 02:50:53 +010013674int
micky3879b9f5e72025-07-08 18:04:53 -040013675main (void)
Steve Kondikae271bc2015-11-15 02:50:53 +010013676{
13677shmat ();
13678 ;
13679 return 0;
13680}
13681_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -040013682rm -f "conftest.$ac_objext" "conftest$ac_exeext"
13683if { (eval echo "$as_me:13683: \"$ac_link\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010013684 (eval $ac_link) 2>&5
13685 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040013686 echo "$as_me:13686: \$? = $ac_status" >&5
13687 (exit "$ac_status"); } &&
13688 { ac_try='test -s "conftest$ac_exeext"'
13689 { (eval echo "$as_me:13689: \"$ac_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010013690 (eval $ac_try) 2>&5
13691 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040013692 echo "$as_me:13692: \$? = $ac_status" >&5
13693 (exit "$ac_status"); }; }; then
Steve Kondikae271bc2015-11-15 02:50:53 +010013694 ac_cv_lib_ipc_shmat=yes
13695else
13696 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -040013697cat "conftest.$ac_ext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010013698ac_cv_lib_ipc_shmat=no
13699fi
micky3879b9f5e72025-07-08 18:04:53 -040013700rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
Steve Kondikae271bc2015-11-15 02:50:53 +010013701LIBS=$ac_check_lib_save_LIBS
13702fi
micky3879b9f5e72025-07-08 18:04:53 -040013703echo "$as_me:13703: result: $ac_cv_lib_ipc_shmat" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010013704echo "${ECHO_T}$ac_cv_lib_ipc_shmat" >&6
micky3879b9f5e72025-07-08 18:04:53 -040013705if test "$ac_cv_lib_ipc_shmat" = yes; then
Steve Kondikae271bc2015-11-15 02:50:53 +010013706 X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc"
13707fi
13708
13709 fi
13710 fi
13711
13712 # Check for libraries that X11R6 Xt/Xaw programs need.
13713 ac_save_LDFLAGS=$LDFLAGS
13714 test -n "$x_libraries" && LDFLAGS="$LDFLAGS -L$x_libraries"
13715 # SM needs ICE to (dynamically) link under SunOS 4.x (so we have to
13716 # check for ICE first), but we must link in the order -lSM -lICE or
13717 # we get undefined symbols. So assume we have SM if we have ICE.
13718 # These have to be linked with before -lX11, unlike the other
13719 # libraries we check for below, so use a different variable.
13720 # John Interrante, Karl Berry
micky3879b9f5e72025-07-08 18:04:53 -040013721 echo "$as_me:13721: checking for IceConnectionNumber in -lICE" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010013722echo $ECHO_N "checking for IceConnectionNumber in -lICE... $ECHO_C" >&6
13723if test "${ac_cv_lib_ICE_IceConnectionNumber+set}" = set; then
13724 echo $ECHO_N "(cached) $ECHO_C" >&6
13725else
13726 ac_check_lib_save_LIBS=$LIBS
13727LIBS="-lICE $X_EXTRA_LIBS $LIBS"
micky3879b9f5e72025-07-08 18:04:53 -040013728cat >"conftest.$ac_ext" <<_ACEOF
13729#line 13729 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +010013730#include "confdefs.h"
13731
13732/* Override any gcc2 internal prototype to avoid an error. */
13733#ifdef __cplusplus
13734extern "C"
13735#endif
13736/* We use char because int might match the return type of a gcc2
13737 builtin and then its argument prototype would still apply. */
micky3879b9f5e72025-07-08 18:04:53 -040013738char IceConnectionNumber (void);
Steve Kondikae271bc2015-11-15 02:50:53 +010013739int
micky3879b9f5e72025-07-08 18:04:53 -040013740main (void)
Steve Kondikae271bc2015-11-15 02:50:53 +010013741{
13742IceConnectionNumber ();
13743 ;
13744 return 0;
13745}
13746_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -040013747rm -f "conftest.$ac_objext" "conftest$ac_exeext"
13748if { (eval echo "$as_me:13748: \"$ac_link\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010013749 (eval $ac_link) 2>&5
13750 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040013751 echo "$as_me:13751: \$? = $ac_status" >&5
13752 (exit "$ac_status"); } &&
13753 { ac_try='test -s "conftest$ac_exeext"'
13754 { (eval echo "$as_me:13754: \"$ac_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010013755 (eval $ac_try) 2>&5
13756 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040013757 echo "$as_me:13757: \$? = $ac_status" >&5
13758 (exit "$ac_status"); }; }; then
Steve Kondikae271bc2015-11-15 02:50:53 +010013759 ac_cv_lib_ICE_IceConnectionNumber=yes
13760else
13761 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -040013762cat "conftest.$ac_ext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010013763ac_cv_lib_ICE_IceConnectionNumber=no
13764fi
micky3879b9f5e72025-07-08 18:04:53 -040013765rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
Steve Kondikae271bc2015-11-15 02:50:53 +010013766LIBS=$ac_check_lib_save_LIBS
13767fi
micky3879b9f5e72025-07-08 18:04:53 -040013768echo "$as_me:13768: result: $ac_cv_lib_ICE_IceConnectionNumber" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010013769echo "${ECHO_T}$ac_cv_lib_ICE_IceConnectionNumber" >&6
micky3879b9f5e72025-07-08 18:04:53 -040013770if test "$ac_cv_lib_ICE_IceConnectionNumber" = yes; then
Steve Kondikae271bc2015-11-15 02:50:53 +010013771 X_PRE_LIBS="$X_PRE_LIBS -lSM -lICE"
13772fi
13773
13774 LDFLAGS=$ac_save_LDFLAGS
13775
13776fi
13777
13778cf_x_athena=${cf_x_athena:-Xaw}
13779
micky3879b9f5e72025-07-08 18:04:53 -040013780echo "$as_me:13780: checking if you want to link with Xaw 3d library" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010013781echo $ECHO_N "checking if you want to link with Xaw 3d library... $ECHO_C" >&6
13782withval=
13783
13784# Check whether --with-Xaw3d or --without-Xaw3d was given.
13785if test "${with_Xaw3d+set}" = set; then
13786 withval="$with_Xaw3d"
13787
13788fi;
13789if test "$withval" = yes ; then
13790 cf_x_athena=Xaw3d
micky3879b9f5e72025-07-08 18:04:53 -040013791 echo "$as_me:13791: result: yes" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010013792echo "${ECHO_T}yes" >&6
13793else
micky3879b9f5e72025-07-08 18:04:53 -040013794 echo "$as_me:13794: result: no" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010013795echo "${ECHO_T}no" >&6
13796fi
13797
micky3879b9f5e72025-07-08 18:04:53 -040013798echo "$as_me:13798: checking if you want to link with Xaw 3d xft library" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010013799echo $ECHO_N "checking if you want to link with Xaw 3d xft library... $ECHO_C" >&6
13800withval=
13801
13802# Check whether --with-Xaw3dxft or --without-Xaw3dxft was given.
13803if test "${with_Xaw3dxft+set}" = set; then
13804 withval="$with_Xaw3dxft"
13805
13806fi;
13807if test "$withval" = yes ; then
13808 cf_x_athena=Xaw3dxft
micky3879b9f5e72025-07-08 18:04:53 -040013809 echo "$as_me:13809: result: yes" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010013810echo "${ECHO_T}yes" >&6
13811else
micky3879b9f5e72025-07-08 18:04:53 -040013812 echo "$as_me:13812: result: no" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010013813echo "${ECHO_T}no" >&6
13814fi
13815
micky3879b9f5e72025-07-08 18:04:53 -040013816echo "$as_me:13816: checking if you want to link with neXT Athena library" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010013817echo $ECHO_N "checking if you want to link with neXT Athena library... $ECHO_C" >&6
13818withval=
13819
13820# Check whether --with-neXtaw or --without-neXtaw was given.
13821if test "${with_neXtaw+set}" = set; then
13822 withval="$with_neXtaw"
13823
13824fi;
13825if test "$withval" = yes ; then
13826 cf_x_athena=neXtaw
micky3879b9f5e72025-07-08 18:04:53 -040013827 echo "$as_me:13827: result: yes" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010013828echo "${ECHO_T}yes" >&6
13829else
micky3879b9f5e72025-07-08 18:04:53 -040013830 echo "$as_me:13830: result: no" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010013831echo "${ECHO_T}no" >&6
13832fi
13833
micky3879b9f5e72025-07-08 18:04:53 -040013834echo "$as_me:13834: checking if you want to link with Athena-Plus library" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010013835echo $ECHO_N "checking if you want to link with Athena-Plus library... $ECHO_C" >&6
13836withval=
13837
13838# Check whether --with-XawPlus or --without-XawPlus was given.
13839if test "${with_XawPlus+set}" = set; then
13840 withval="$with_XawPlus"
13841
13842fi;
13843if test "$withval" = yes ; then
13844 cf_x_athena=XawPlus
micky3879b9f5e72025-07-08 18:04:53 -040013845 echo "$as_me:13845: result: yes" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010013846echo "${ECHO_T}yes" >&6
13847else
micky3879b9f5e72025-07-08 18:04:53 -040013848 echo "$as_me:13848: result: no" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010013849echo "${ECHO_T}no" >&6
13850fi
13851
13852cf_x_athena_lib=""
13853
13854if test "$PKG_CONFIG" != none ; then
13855 cf_athena_list=
13856 test "$cf_x_athena" = Xaw && cf_athena_list="xaw8 xaw7 xaw6"
13857 for cf_athena_pkg in \
13858 $cf_athena_list \
13859 ${cf_x_athena} \
13860 ${cf_x_athena}-devel \
13861 lib${cf_x_athena} \
13862 lib${cf_x_athena}-devel
13863 do
13864
micky3879b9f5e72025-07-08 18:04:53 -040013865if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists "$cf_athena_pkg"; then
Steve Kondikae271bc2015-11-15 02:50:53 +010013866 test -n "$verbose" && echo " found package $cf_athena_pkg" 1>&6
13867
micky3879b9f5e72025-07-08 18:04:53 -040013868echo "${as_me:-configure}:13868: testing found package $cf_athena_pkg ..." 1>&5
Steve Kondikae271bc2015-11-15 02:50:53 +010013869
micky3879b9f5e72025-07-08 18:04:53 -040013870 cf_pkgconfig_incs="`$PKG_CONFIG --cflags "$cf_athena_pkg" 2>/dev/null`"
13871 cf_pkgconfig_libs="`$PKG_CONFIG --libs "$cf_athena_pkg" 2>/dev/null`"
Steve Kondikae271bc2015-11-15 02:50:53 +010013872 test -n "$verbose" && echo " package $cf_athena_pkg CFLAGS: $cf_pkgconfig_incs" 1>&6
13873
micky3879b9f5e72025-07-08 18:04:53 -040013874echo "${as_me:-configure}:13874: testing package $cf_athena_pkg CFLAGS: $cf_pkgconfig_incs ..." 1>&5
Steve Kondikae271bc2015-11-15 02:50:53 +010013875
13876 test -n "$verbose" && echo " package $cf_athena_pkg LIBS: $cf_pkgconfig_libs" 1>&6
13877
micky3879b9f5e72025-07-08 18:04:53 -040013878echo "${as_me:-configure}:13878: testing package $cf_athena_pkg LIBS: $cf_pkgconfig_libs ..." 1>&5
Steve Kondikae271bc2015-11-15 02:50:53 +010013879
13880cf_fix_cppflags=no
13881cf_new_cflags=
13882cf_new_cppflags=
13883cf_new_extra_cppflags=
13884
13885for cf_add_cflags in $cf_pkgconfig_incs
13886do
micky3879b9f5e72025-07-08 18:04:53 -040013887case "$cf_fix_cppflags" in
Steve Kondikae271bc2015-11-15 02:50:53 +010013888(no)
micky3879b9f5e72025-07-08 18:04:53 -040013889 case "$cf_add_cflags" in
Steve Kondikae271bc2015-11-15 02:50:53 +010013890 (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
micky3879b9f5e72025-07-08 18:04:53 -040013891 case "$cf_add_cflags" in
Steve Kondikae271bc2015-11-15 02:50:53 +010013892 (-D*)
micky3879b9f5e72025-07-08 18:04:53 -040013893 cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
Steve Kondikae271bc2015-11-15 02:50:53 +010013894
13895 test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13896 && test -z "${cf_tst_cflags}" \
13897 && cf_fix_cppflags=yes
13898
micky3879b9f5e72025-07-08 18:04:53 -040013899 if test "$cf_fix_cppflags" = yes ; then
13900
13901 test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13902 cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13903
Steve Kondikae271bc2015-11-15 02:50:53 +010013904 continue
13905 elif test "${cf_tst_cflags}" = "\"'" ; then
micky3879b9f5e72025-07-08 18:04:53 -040013906
13907 test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13908 cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13909
Steve Kondikae271bc2015-11-15 02:50:53 +010013910 continue
13911 fi
13912 ;;
13913 esac
13914 case "$CPPFLAGS" in
13915 (*$cf_add_cflags)
13916 ;;
13917 (*)
micky3879b9f5e72025-07-08 18:04:53 -040013918 case "$cf_add_cflags" in
Steve Kondikae271bc2015-11-15 02:50:53 +010013919 (-D*)
13920 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13921
13922CPPFLAGS=`echo "$CPPFLAGS" | \
13923 sed -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?[ ]/ /g' \
13924 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?$//g'`
13925
13926 ;;
13927 esac
micky3879b9f5e72025-07-08 18:04:53 -040013928
13929 test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13930 cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
13931
Steve Kondikae271bc2015-11-15 02:50:53 +010013932 ;;
13933 esac
13934 ;;
13935 (*)
micky3879b9f5e72025-07-08 18:04:53 -040013936
13937 test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
13938 cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
13939
Steve Kondikae271bc2015-11-15 02:50:53 +010013940 ;;
13941 esac
13942 ;;
13943(yes)
Steve Kondikae271bc2015-11-15 02:50:53 +010013944
micky3879b9f5e72025-07-08 18:04:53 -040013945 test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13946 cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13947
13948 cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
Steve Kondikae271bc2015-11-15 02:50:53 +010013949
13950 test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13951 && test -z "${cf_tst_cflags}" \
13952 && cf_fix_cppflags=no
13953 ;;
13954esac
13955done
13956
13957if test -n "$cf_new_cflags" ; then
13958
micky3879b9f5e72025-07-08 18:04:53 -040013959 test -n "$CFLAGS" && CFLAGS="$CFLAGS "
13960 CFLAGS="${CFLAGS}$cf_new_cflags"
13961
Steve Kondikae271bc2015-11-15 02:50:53 +010013962fi
13963
13964if test -n "$cf_new_cppflags" ; then
13965
micky3879b9f5e72025-07-08 18:04:53 -040013966 test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13967 CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
13968
Steve Kondikae271bc2015-11-15 02:50:53 +010013969fi
13970
13971if test -n "$cf_new_extra_cppflags" ; then
13972
micky3879b9f5e72025-07-08 18:04:53 -040013973 test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
13974 EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
13975
Steve Kondikae271bc2015-11-15 02:50:53 +010013976fi
13977
micky3879b9f5e72025-07-08 18:04:53 -040013978cf_add_libs="$LIBS"
13979# reverse order
13980cf_add_0lib=
13981for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
13982# filter duplicates
13983for cf_add_1lib in $cf_add_0lib; do
13984 for cf_add_2lib in $cf_add_libs; do
13985 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
Steve Kondikae271bc2015-11-15 02:50:53 +010013986 cf_add_1lib=
13987 break
13988 fi
13989 done
micky3879b9f5e72025-07-08 18:04:53 -040013990 test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
Steve Kondikae271bc2015-11-15 02:50:53 +010013991done
13992LIBS="$cf_add_libs"
13993
13994 cf_x_athena_lib="$cf_pkgconfig_libs"
13995
13996cf_x_athena_LIBS=`echo "HAVE_LIB_$cf_x_athena" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
13997
13998 cat >>confdefs.h <<EOF
13999#define $cf_x_athena_LIBS 1
14000EOF
14001
14002 for cf_trim_lib in Xmu Xt X11
14003 do
14004 case "$LIBS" in
14005 (*-l$cf_trim_lib\ *-l$cf_trim_lib*)
14006 LIBS=`echo "$LIBS " | sed -e 's/ / /g' -e 's%-l'"$cf_trim_lib"' %%' -e 's/ $//'`
14007 test -n "$verbose" && echo " ..trimmed $LIBS" 1>&6
14008
micky3879b9f5e72025-07-08 18:04:53 -040014009echo "${as_me:-configure}:14009: testing ..trimmed $LIBS ..." 1>&5
Steve Kondikae271bc2015-11-15 02:50:53 +010014010
14011 ;;
14012 esac
14013 done
14014
micky3879b9f5e72025-07-08 18:04:53 -040014015echo "$as_me:14015: checking for usable $cf_x_athena/Xmu package" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010014016echo $ECHO_N "checking for usable $cf_x_athena/Xmu package... $ECHO_C" >&6
14017if test "${cf_cv_xaw_compat+set}" = set; then
14018 echo $ECHO_N "(cached) $ECHO_C" >&6
14019else
14020
micky3879b9f5e72025-07-08 18:04:53 -040014021cat >"conftest.$ac_ext" <<_ACEOF
14022#line 14022 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +010014023#include "confdefs.h"
14024
micky3879b9f5e72025-07-08 18:04:53 -040014025$ac_includes_default
Steve Kondikae271bc2015-11-15 02:50:53 +010014026#include <X11/Xmu/CharSet.h>
14027
14028int
micky3879b9f5e72025-07-08 18:04:53 -040014029main (void)
Steve Kondikae271bc2015-11-15 02:50:53 +010014030{
14031
micky3879b9f5e72025-07-08 18:04:53 -040014032int check = XmuCompareISOLatin1("big", "small");
14033(void)check;
Steve Kondikae271bc2015-11-15 02:50:53 +010014034
14035 ;
14036 return 0;
14037}
14038_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -040014039rm -f "conftest.$ac_objext" "conftest$ac_exeext"
14040if { (eval echo "$as_me:14040: \"$ac_link\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010014041 (eval $ac_link) 2>&5
14042 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040014043 echo "$as_me:14043: \$? = $ac_status" >&5
14044 (exit "$ac_status"); } &&
14045 { ac_try='test -s "conftest$ac_exeext"'
14046 { (eval echo "$as_me:14046: \"$ac_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010014047 (eval $ac_try) 2>&5
14048 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040014049 echo "$as_me:14049: \$? = $ac_status" >&5
14050 (exit "$ac_status"); }; }; then
Steve Kondikae271bc2015-11-15 02:50:53 +010014051 cf_cv_xaw_compat=yes
14052else
14053 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -040014054cat "conftest.$ac_ext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010014055cf_cv_xaw_compat=no
14056fi
micky3879b9f5e72025-07-08 18:04:53 -040014057rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
Steve Kondikae271bc2015-11-15 02:50:53 +010014058fi
micky3879b9f5e72025-07-08 18:04:53 -040014059echo "$as_me:14059: result: $cf_cv_xaw_compat" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010014060echo "${ECHO_T}$cf_cv_xaw_compat" >&6
14061
14062 if test "$cf_cv_xaw_compat" = no
14063 then
14064 # workaround for broken ".pc" files...
14065 case "$cf_x_athena_lib" in
14066 (*-lXmu*)
14067 ;;
14068 (*)
14069 test -n "$verbose" && echo " work around broken package" 1>&6
14070
micky3879b9f5e72025-07-08 18:04:53 -040014071echo "${as_me:-configure}:14071: testing work around broken package ..." 1>&5
Steve Kondikae271bc2015-11-15 02:50:53 +010014072
14073 cf_save_xmu="$LIBS"
14074 cf_first_lib=`echo "$cf_save_xmu" | sed -e 's/^ *//' -e 's/ .*//'`
14075
micky3879b9f5e72025-07-08 18:04:53 -040014076if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists "xmu"; then
Steve Kondikae271bc2015-11-15 02:50:53 +010014077 test -n "$verbose" && echo " found package xmu" 1>&6
14078
micky3879b9f5e72025-07-08 18:04:53 -040014079echo "${as_me:-configure}:14079: testing found package xmu ..." 1>&5
Steve Kondikae271bc2015-11-15 02:50:53 +010014080
micky3879b9f5e72025-07-08 18:04:53 -040014081 cf_pkgconfig_incs="`$PKG_CONFIG --cflags "xmu" 2>/dev/null`"
14082 cf_pkgconfig_libs="`$PKG_CONFIG --libs "xmu" 2>/dev/null`"
Steve Kondikae271bc2015-11-15 02:50:53 +010014083 test -n "$verbose" && echo " package xmu CFLAGS: $cf_pkgconfig_incs" 1>&6
14084
micky3879b9f5e72025-07-08 18:04:53 -040014085echo "${as_me:-configure}:14085: testing package xmu CFLAGS: $cf_pkgconfig_incs ..." 1>&5
Steve Kondikae271bc2015-11-15 02:50:53 +010014086
14087 test -n "$verbose" && echo " package xmu LIBS: $cf_pkgconfig_libs" 1>&6
14088
micky3879b9f5e72025-07-08 18:04:53 -040014089echo "${as_me:-configure}:14089: testing package xmu LIBS: $cf_pkgconfig_libs ..." 1>&5
Steve Kondikae271bc2015-11-15 02:50:53 +010014090
14091cf_fix_cppflags=no
14092cf_new_cflags=
14093cf_new_cppflags=
14094cf_new_extra_cppflags=
14095
14096for cf_add_cflags in $cf_pkgconfig_incs
14097do
micky3879b9f5e72025-07-08 18:04:53 -040014098case "$cf_fix_cppflags" in
Steve Kondikae271bc2015-11-15 02:50:53 +010014099(no)
micky3879b9f5e72025-07-08 18:04:53 -040014100 case "$cf_add_cflags" in
Steve Kondikae271bc2015-11-15 02:50:53 +010014101 (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
micky3879b9f5e72025-07-08 18:04:53 -040014102 case "$cf_add_cflags" in
Steve Kondikae271bc2015-11-15 02:50:53 +010014103 (-D*)
micky3879b9f5e72025-07-08 18:04:53 -040014104 cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
Steve Kondikae271bc2015-11-15 02:50:53 +010014105
14106 test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14107 && test -z "${cf_tst_cflags}" \
14108 && cf_fix_cppflags=yes
14109
micky3879b9f5e72025-07-08 18:04:53 -040014110 if test "$cf_fix_cppflags" = yes ; then
14111
14112 test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14113 cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14114
Steve Kondikae271bc2015-11-15 02:50:53 +010014115 continue
14116 elif test "${cf_tst_cflags}" = "\"'" ; then
micky3879b9f5e72025-07-08 18:04:53 -040014117
14118 test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14119 cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14120
Steve Kondikae271bc2015-11-15 02:50:53 +010014121 continue
14122 fi
14123 ;;
14124 esac
14125 case "$CPPFLAGS" in
14126 (*$cf_add_cflags)
14127 ;;
14128 (*)
micky3879b9f5e72025-07-08 18:04:53 -040014129 case "$cf_add_cflags" in
Steve Kondikae271bc2015-11-15 02:50:53 +010014130 (-D*)
14131 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
14132
14133CPPFLAGS=`echo "$CPPFLAGS" | \
14134 sed -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?[ ]/ /g' \
14135 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?$//g'`
14136
14137 ;;
14138 esac
micky3879b9f5e72025-07-08 18:04:53 -040014139
14140 test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
14141 cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
14142
Steve Kondikae271bc2015-11-15 02:50:53 +010014143 ;;
14144 esac
14145 ;;
14146 (*)
micky3879b9f5e72025-07-08 18:04:53 -040014147
14148 test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
14149 cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
14150
Steve Kondikae271bc2015-11-15 02:50:53 +010014151 ;;
14152 esac
14153 ;;
14154(yes)
Steve Kondikae271bc2015-11-15 02:50:53 +010014155
micky3879b9f5e72025-07-08 18:04:53 -040014156 test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14157 cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14158
14159 cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
Steve Kondikae271bc2015-11-15 02:50:53 +010014160
14161 test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14162 && test -z "${cf_tst_cflags}" \
14163 && cf_fix_cppflags=no
14164 ;;
14165esac
14166done
14167
14168if test -n "$cf_new_cflags" ; then
14169
micky3879b9f5e72025-07-08 18:04:53 -040014170 test -n "$CFLAGS" && CFLAGS="$CFLAGS "
14171 CFLAGS="${CFLAGS}$cf_new_cflags"
14172
Steve Kondikae271bc2015-11-15 02:50:53 +010014173fi
14174
14175if test -n "$cf_new_cppflags" ; then
14176
micky3879b9f5e72025-07-08 18:04:53 -040014177 test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14178 CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
14179
Steve Kondikae271bc2015-11-15 02:50:53 +010014180fi
14181
14182if test -n "$cf_new_extra_cppflags" ; then
14183
micky3879b9f5e72025-07-08 18:04:53 -040014184 test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
14185 EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
14186
Steve Kondikae271bc2015-11-15 02:50:53 +010014187fi
14188
micky3879b9f5e72025-07-08 18:04:53 -040014189cf_add_libs="$LIBS"
14190# reverse order
14191cf_add_0lib=
14192for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
14193# filter duplicates
14194for cf_add_1lib in $cf_add_0lib; do
14195 for cf_add_2lib in $cf_add_libs; do
14196 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
Steve Kondikae271bc2015-11-15 02:50:53 +010014197 cf_add_1lib=
14198 break
14199 fi
14200 done
micky3879b9f5e72025-07-08 18:04:53 -040014201 test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
Steve Kondikae271bc2015-11-15 02:50:53 +010014202done
14203LIBS="$cf_add_libs"
14204
14205 LIBS="$cf_save_xmu"
14206
14207test -n "$verbose" && echo " ...before $LIBS" 1>&6
14208
micky3879b9f5e72025-07-08 18:04:53 -040014209echo "${as_me:-configure}:14209: testing ...before $LIBS ..." 1>&5
Steve Kondikae271bc2015-11-15 02:50:53 +010014210
14211LIBS=`echo "$LIBS" | sed -e "s/[ ][ ]*/ /g" -e "s%$cf_first_lib %$cf_first_lib $cf_pkgconfig_libs %" -e 's% % %g'`
14212test -n "$verbose" && echo " ...after $LIBS" 1>&6
14213
micky3879b9f5e72025-07-08 18:04:53 -040014214echo "${as_me:-configure}:14214: testing ...after $LIBS ..." 1>&5
Steve Kondikae271bc2015-11-15 02:50:53 +010014215
14216else
14217 cf_pkgconfig_incs=
14218 cf_pkgconfig_libs=
14219
14220test -n "$verbose" && echo " ...before $LIBS" 1>&6
14221
micky3879b9f5e72025-07-08 18:04:53 -040014222echo "${as_me:-configure}:14222: testing ...before $LIBS ..." 1>&5
Steve Kondikae271bc2015-11-15 02:50:53 +010014223
14224LIBS=`echo "$LIBS" | sed -e "s/[ ][ ]*/ /g" -e "s%$cf_first_lib %$cf_first_lib -lXmu %" -e 's% % %g'`
14225test -n "$verbose" && echo " ...after $LIBS" 1>&6
14226
micky3879b9f5e72025-07-08 18:04:53 -040014227echo "${as_me:-configure}:14227: testing ...after $LIBS ..." 1>&5
Steve Kondikae271bc2015-11-15 02:50:53 +010014228
14229fi
14230
14231 for cf_trim_lib in Xmu Xt X11
14232 do
14233 case "$LIBS" in
14234 (*-l$cf_trim_lib\ *-l$cf_trim_lib*)
14235 LIBS=`echo "$LIBS " | sed -e 's/ / /g' -e 's%-l'"$cf_trim_lib"' %%' -e 's/ $//'`
14236 test -n "$verbose" && echo " ..trimmed $LIBS" 1>&6
14237
micky3879b9f5e72025-07-08 18:04:53 -040014238echo "${as_me:-configure}:14238: testing ..trimmed $LIBS ..." 1>&5
Steve Kondikae271bc2015-11-15 02:50:53 +010014239
14240 ;;
14241 esac
14242 done
14243
14244 ;;
14245 esac
14246 fi
14247
14248 break
14249else
14250 cf_pkgconfig_incs=
14251 cf_pkgconfig_libs=
14252 :
14253fi
14254
14255 done
14256fi
14257
14258if test -z "$cf_x_athena_lib" ; then
14259
micky3879b9f5e72025-07-08 18:04:53 -040014260if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists "Xext"; then
Steve Kondikae271bc2015-11-15 02:50:53 +010014261 test -n "$verbose" && echo " found package Xext" 1>&6
14262
micky3879b9f5e72025-07-08 18:04:53 -040014263echo "${as_me:-configure}:14263: testing found package Xext ..." 1>&5
Steve Kondikae271bc2015-11-15 02:50:53 +010014264
micky3879b9f5e72025-07-08 18:04:53 -040014265 cf_pkgconfig_incs="`$PKG_CONFIG --cflags "Xext" 2>/dev/null`"
14266 cf_pkgconfig_libs="`$PKG_CONFIG --libs "Xext" 2>/dev/null`"
Steve Kondikae271bc2015-11-15 02:50:53 +010014267 test -n "$verbose" && echo " package Xext CFLAGS: $cf_pkgconfig_incs" 1>&6
14268
micky3879b9f5e72025-07-08 18:04:53 -040014269echo "${as_me:-configure}:14269: testing package Xext CFLAGS: $cf_pkgconfig_incs ..." 1>&5
Steve Kondikae271bc2015-11-15 02:50:53 +010014270
14271 test -n "$verbose" && echo " package Xext LIBS: $cf_pkgconfig_libs" 1>&6
14272
micky3879b9f5e72025-07-08 18:04:53 -040014273echo "${as_me:-configure}:14273: testing package Xext LIBS: $cf_pkgconfig_libs ..." 1>&5
Steve Kondikae271bc2015-11-15 02:50:53 +010014274
14275cf_fix_cppflags=no
14276cf_new_cflags=
14277cf_new_cppflags=
14278cf_new_extra_cppflags=
14279
14280for cf_add_cflags in $cf_pkgconfig_incs
14281do
micky3879b9f5e72025-07-08 18:04:53 -040014282case "$cf_fix_cppflags" in
Steve Kondikae271bc2015-11-15 02:50:53 +010014283(no)
micky3879b9f5e72025-07-08 18:04:53 -040014284 case "$cf_add_cflags" in
Steve Kondikae271bc2015-11-15 02:50:53 +010014285 (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
micky3879b9f5e72025-07-08 18:04:53 -040014286 case "$cf_add_cflags" in
Steve Kondikae271bc2015-11-15 02:50:53 +010014287 (-D*)
micky3879b9f5e72025-07-08 18:04:53 -040014288 cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
Steve Kondikae271bc2015-11-15 02:50:53 +010014289
14290 test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14291 && test -z "${cf_tst_cflags}" \
14292 && cf_fix_cppflags=yes
14293
micky3879b9f5e72025-07-08 18:04:53 -040014294 if test "$cf_fix_cppflags" = yes ; then
14295
14296 test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14297 cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14298
Steve Kondikae271bc2015-11-15 02:50:53 +010014299 continue
14300 elif test "${cf_tst_cflags}" = "\"'" ; then
micky3879b9f5e72025-07-08 18:04:53 -040014301
14302 test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14303 cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14304
Steve Kondikae271bc2015-11-15 02:50:53 +010014305 continue
14306 fi
14307 ;;
14308 esac
14309 case "$CPPFLAGS" in
14310 (*$cf_add_cflags)
14311 ;;
14312 (*)
micky3879b9f5e72025-07-08 18:04:53 -040014313 case "$cf_add_cflags" in
Steve Kondikae271bc2015-11-15 02:50:53 +010014314 (-D*)
14315 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
14316
14317CPPFLAGS=`echo "$CPPFLAGS" | \
14318 sed -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?[ ]/ /g' \
14319 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?$//g'`
14320
14321 ;;
14322 esac
micky3879b9f5e72025-07-08 18:04:53 -040014323
14324 test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
14325 cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
14326
Steve Kondikae271bc2015-11-15 02:50:53 +010014327 ;;
14328 esac
14329 ;;
14330 (*)
micky3879b9f5e72025-07-08 18:04:53 -040014331
14332 test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
14333 cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
14334
Steve Kondikae271bc2015-11-15 02:50:53 +010014335 ;;
14336 esac
14337 ;;
14338(yes)
Steve Kondikae271bc2015-11-15 02:50:53 +010014339
micky3879b9f5e72025-07-08 18:04:53 -040014340 test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14341 cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14342
14343 cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
Steve Kondikae271bc2015-11-15 02:50:53 +010014344
14345 test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14346 && test -z "${cf_tst_cflags}" \
14347 && cf_fix_cppflags=no
14348 ;;
14349esac
14350done
14351
14352if test -n "$cf_new_cflags" ; then
14353
micky3879b9f5e72025-07-08 18:04:53 -040014354 test -n "$CFLAGS" && CFLAGS="$CFLAGS "
14355 CFLAGS="${CFLAGS}$cf_new_cflags"
14356
Steve Kondikae271bc2015-11-15 02:50:53 +010014357fi
14358
14359if test -n "$cf_new_cppflags" ; then
14360
micky3879b9f5e72025-07-08 18:04:53 -040014361 test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14362 CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
14363
Steve Kondikae271bc2015-11-15 02:50:53 +010014364fi
14365
14366if test -n "$cf_new_extra_cppflags" ; then
14367
micky3879b9f5e72025-07-08 18:04:53 -040014368 test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
14369 EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
14370
Steve Kondikae271bc2015-11-15 02:50:53 +010014371fi
14372
micky3879b9f5e72025-07-08 18:04:53 -040014373cf_add_libs="$LIBS"
14374# reverse order
14375cf_add_0lib=
14376for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
14377# filter duplicates
14378for cf_add_1lib in $cf_add_0lib; do
14379 for cf_add_2lib in $cf_add_libs; do
14380 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
Steve Kondikae271bc2015-11-15 02:50:53 +010014381 cf_add_1lib=
14382 break
14383 fi
14384 done
micky3879b9f5e72025-07-08 18:04:53 -040014385 test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
Steve Kondikae271bc2015-11-15 02:50:53 +010014386done
14387LIBS="$cf_add_libs"
14388
14389 :
14390else
14391 cf_pkgconfig_incs=
14392 cf_pkgconfig_libs=
14393
micky3879b9f5e72025-07-08 18:04:53 -040014394 echo "$as_me:14394: checking for XextCreateExtension in -lXext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010014395echo $ECHO_N "checking for XextCreateExtension in -lXext... $ECHO_C" >&6
14396if test "${ac_cv_lib_Xext_XextCreateExtension+set}" = set; then
14397 echo $ECHO_N "(cached) $ECHO_C" >&6
14398else
14399 ac_check_lib_save_LIBS=$LIBS
14400LIBS="-lXext $LIBS"
micky3879b9f5e72025-07-08 18:04:53 -040014401cat >"conftest.$ac_ext" <<_ACEOF
14402#line 14402 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +010014403#include "confdefs.h"
14404
14405/* Override any gcc2 internal prototype to avoid an error. */
14406#ifdef __cplusplus
14407extern "C"
14408#endif
14409/* We use char because int might match the return type of a gcc2
14410 builtin and then its argument prototype would still apply. */
micky3879b9f5e72025-07-08 18:04:53 -040014411char XextCreateExtension (void);
Steve Kondikae271bc2015-11-15 02:50:53 +010014412int
micky3879b9f5e72025-07-08 18:04:53 -040014413main (void)
Steve Kondikae271bc2015-11-15 02:50:53 +010014414{
14415XextCreateExtension ();
14416 ;
14417 return 0;
14418}
14419_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -040014420rm -f "conftest.$ac_objext" "conftest$ac_exeext"
14421if { (eval echo "$as_me:14421: \"$ac_link\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010014422 (eval $ac_link) 2>&5
14423 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040014424 echo "$as_me:14424: \$? = $ac_status" >&5
14425 (exit "$ac_status"); } &&
14426 { ac_try='test -s "conftest$ac_exeext"'
14427 { (eval echo "$as_me:14427: \"$ac_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010014428 (eval $ac_try) 2>&5
14429 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040014430 echo "$as_me:14430: \$? = $ac_status" >&5
14431 (exit "$ac_status"); }; }; then
Steve Kondikae271bc2015-11-15 02:50:53 +010014432 ac_cv_lib_Xext_XextCreateExtension=yes
14433else
14434 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -040014435cat "conftest.$ac_ext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010014436ac_cv_lib_Xext_XextCreateExtension=no
14437fi
micky3879b9f5e72025-07-08 18:04:53 -040014438rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
Steve Kondikae271bc2015-11-15 02:50:53 +010014439LIBS=$ac_check_lib_save_LIBS
14440fi
micky3879b9f5e72025-07-08 18:04:53 -040014441echo "$as_me:14441: result: $ac_cv_lib_Xext_XextCreateExtension" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010014442echo "${ECHO_T}$ac_cv_lib_Xext_XextCreateExtension" >&6
micky3879b9f5e72025-07-08 18:04:53 -040014443if test "$ac_cv_lib_Xext_XextCreateExtension" = yes; then
Steve Kondikae271bc2015-11-15 02:50:53 +010014444
micky3879b9f5e72025-07-08 18:04:53 -040014445cf_add_libs="$LIBS"
14446# reverse order
14447cf_add_0lib=
14448for cf_add_1lib in -lXext; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
14449# filter duplicates
14450for cf_add_1lib in $cf_add_0lib; do
14451 for cf_add_2lib in $cf_add_libs; do
14452 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
Steve Kondikae271bc2015-11-15 02:50:53 +010014453 cf_add_1lib=
14454 break
14455 fi
14456 done
micky3879b9f5e72025-07-08 18:04:53 -040014457 test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
Steve Kondikae271bc2015-11-15 02:50:53 +010014458done
14459LIBS="$cf_add_libs"
14460
14461fi
14462
14463fi
14464
micky3879b9f5e72025-07-08 18:04:53 -040014465# OSX is schizoid about who owns /usr/X11 (old) versus /opt/X11 (new) (and
Steve Kondikae271bc2015-11-15 02:50:53 +010014466# in some cases has installed dummy files in the former, other cases replaced
14467# it with a link to the new location). This complicates the configure script.
14468# Check for that pitfall, and recover using pkg-config
14469#
14470# If none of these are set, the configuration is almost certainly broken.
14471if test -z "${X_CFLAGS}${X_PRE_LIBS}${X_LIBS}${X_EXTRA_LIBS}"
14472then
14473
micky3879b9f5e72025-07-08 18:04:53 -040014474if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists "x11"; then
Steve Kondikae271bc2015-11-15 02:50:53 +010014475 test -n "$verbose" && echo " found package x11" 1>&6
14476
micky3879b9f5e72025-07-08 18:04:53 -040014477echo "${as_me:-configure}:14477: testing found package x11 ..." 1>&5
Steve Kondikae271bc2015-11-15 02:50:53 +010014478
micky3879b9f5e72025-07-08 18:04:53 -040014479 cf_pkgconfig_incs="`$PKG_CONFIG --cflags "x11" 2>/dev/null`"
14480 cf_pkgconfig_libs="`$PKG_CONFIG --libs "x11" 2>/dev/null`"
Steve Kondikae271bc2015-11-15 02:50:53 +010014481 test -n "$verbose" && echo " package x11 CFLAGS: $cf_pkgconfig_incs" 1>&6
14482
micky3879b9f5e72025-07-08 18:04:53 -040014483echo "${as_me:-configure}:14483: testing package x11 CFLAGS: $cf_pkgconfig_incs ..." 1>&5
Steve Kondikae271bc2015-11-15 02:50:53 +010014484
14485 test -n "$verbose" && echo " package x11 LIBS: $cf_pkgconfig_libs" 1>&6
14486
micky3879b9f5e72025-07-08 18:04:53 -040014487echo "${as_me:-configure}:14487: testing package x11 LIBS: $cf_pkgconfig_libs ..." 1>&5
Steve Kondikae271bc2015-11-15 02:50:53 +010014488
14489cf_fix_cppflags=no
14490cf_new_cflags=
14491cf_new_cppflags=
14492cf_new_extra_cppflags=
14493
14494for cf_add_cflags in $cf_pkgconfig_incs
14495do
micky3879b9f5e72025-07-08 18:04:53 -040014496case "$cf_fix_cppflags" in
Steve Kondikae271bc2015-11-15 02:50:53 +010014497(no)
micky3879b9f5e72025-07-08 18:04:53 -040014498 case "$cf_add_cflags" in
Steve Kondikae271bc2015-11-15 02:50:53 +010014499 (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
micky3879b9f5e72025-07-08 18:04:53 -040014500 case "$cf_add_cflags" in
Steve Kondikae271bc2015-11-15 02:50:53 +010014501 (-D*)
micky3879b9f5e72025-07-08 18:04:53 -040014502 cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
Steve Kondikae271bc2015-11-15 02:50:53 +010014503
14504 test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14505 && test -z "${cf_tst_cflags}" \
14506 && cf_fix_cppflags=yes
14507
micky3879b9f5e72025-07-08 18:04:53 -040014508 if test "$cf_fix_cppflags" = yes ; then
14509
14510 test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14511 cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14512
Steve Kondikae271bc2015-11-15 02:50:53 +010014513 continue
14514 elif test "${cf_tst_cflags}" = "\"'" ; then
micky3879b9f5e72025-07-08 18:04:53 -040014515
14516 test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14517 cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14518
Steve Kondikae271bc2015-11-15 02:50:53 +010014519 continue
14520 fi
14521 ;;
14522 esac
14523 case "$CPPFLAGS" in
14524 (*$cf_add_cflags)
14525 ;;
14526 (*)
micky3879b9f5e72025-07-08 18:04:53 -040014527 case "$cf_add_cflags" in
Steve Kondikae271bc2015-11-15 02:50:53 +010014528 (-D*)
14529 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
14530
14531CPPFLAGS=`echo "$CPPFLAGS" | \
14532 sed -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?[ ]/ /g' \
14533 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?$//g'`
14534
14535 ;;
14536 esac
micky3879b9f5e72025-07-08 18:04:53 -040014537
14538 test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
14539 cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
14540
Steve Kondikae271bc2015-11-15 02:50:53 +010014541 ;;
14542 esac
14543 ;;
14544 (*)
micky3879b9f5e72025-07-08 18:04:53 -040014545
14546 test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
14547 cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
14548
Steve Kondikae271bc2015-11-15 02:50:53 +010014549 ;;
14550 esac
14551 ;;
14552(yes)
Steve Kondikae271bc2015-11-15 02:50:53 +010014553
micky3879b9f5e72025-07-08 18:04:53 -040014554 test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14555 cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14556
14557 cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
Steve Kondikae271bc2015-11-15 02:50:53 +010014558
14559 test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14560 && test -z "${cf_tst_cflags}" \
14561 && cf_fix_cppflags=no
14562 ;;
14563esac
14564done
14565
14566if test -n "$cf_new_cflags" ; then
14567
micky3879b9f5e72025-07-08 18:04:53 -040014568 test -n "$CFLAGS" && CFLAGS="$CFLAGS "
14569 CFLAGS="${CFLAGS}$cf_new_cflags"
14570
Steve Kondikae271bc2015-11-15 02:50:53 +010014571fi
14572
14573if test -n "$cf_new_cppflags" ; then
14574
micky3879b9f5e72025-07-08 18:04:53 -040014575 test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14576 CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
14577
Steve Kondikae271bc2015-11-15 02:50:53 +010014578fi
14579
14580if test -n "$cf_new_extra_cppflags" ; then
14581
micky3879b9f5e72025-07-08 18:04:53 -040014582 test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
14583 EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
14584
Steve Kondikae271bc2015-11-15 02:50:53 +010014585fi
14586
micky3879b9f5e72025-07-08 18:04:53 -040014587cf_add_libs="$LIBS"
14588# reverse order
14589cf_add_0lib=
14590for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
14591# filter duplicates
14592for cf_add_1lib in $cf_add_0lib; do
14593 for cf_add_2lib in $cf_add_libs; do
14594 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
Steve Kondikae271bc2015-11-15 02:50:53 +010014595 cf_add_1lib=
14596 break
14597 fi
14598 done
micky3879b9f5e72025-07-08 18:04:53 -040014599 test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
Steve Kondikae271bc2015-11-15 02:50:53 +010014600done
14601LIBS="$cf_add_libs"
14602
14603 :
14604else
14605 cf_pkgconfig_incs=
14606 cf_pkgconfig_libs=
micky3879b9f5e72025-07-08 18:04:53 -040014607 { echo "$as_me:14607: WARNING: unable to find X11 library" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010014608echo "$as_me: WARNING: unable to find X11 library" >&2;}
14609fi
14610
micky3879b9f5e72025-07-08 18:04:53 -040014611if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists "ice"; then
Steve Kondikae271bc2015-11-15 02:50:53 +010014612 test -n "$verbose" && echo " found package ice" 1>&6
14613
micky3879b9f5e72025-07-08 18:04:53 -040014614echo "${as_me:-configure}:14614: testing found package ice ..." 1>&5
Steve Kondikae271bc2015-11-15 02:50:53 +010014615
micky3879b9f5e72025-07-08 18:04:53 -040014616 cf_pkgconfig_incs="`$PKG_CONFIG --cflags "ice" 2>/dev/null`"
14617 cf_pkgconfig_libs="`$PKG_CONFIG --libs "ice" 2>/dev/null`"
Steve Kondikae271bc2015-11-15 02:50:53 +010014618 test -n "$verbose" && echo " package ice CFLAGS: $cf_pkgconfig_incs" 1>&6
14619
micky3879b9f5e72025-07-08 18:04:53 -040014620echo "${as_me:-configure}:14620: testing package ice CFLAGS: $cf_pkgconfig_incs ..." 1>&5
Steve Kondikae271bc2015-11-15 02:50:53 +010014621
14622 test -n "$verbose" && echo " package ice LIBS: $cf_pkgconfig_libs" 1>&6
14623
micky3879b9f5e72025-07-08 18:04:53 -040014624echo "${as_me:-configure}:14624: testing package ice LIBS: $cf_pkgconfig_libs ..." 1>&5
Steve Kondikae271bc2015-11-15 02:50:53 +010014625
14626cf_fix_cppflags=no
14627cf_new_cflags=
14628cf_new_cppflags=
14629cf_new_extra_cppflags=
14630
14631for cf_add_cflags in $cf_pkgconfig_incs
14632do
micky3879b9f5e72025-07-08 18:04:53 -040014633case "$cf_fix_cppflags" in
Steve Kondikae271bc2015-11-15 02:50:53 +010014634(no)
micky3879b9f5e72025-07-08 18:04:53 -040014635 case "$cf_add_cflags" in
Steve Kondikae271bc2015-11-15 02:50:53 +010014636 (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
micky3879b9f5e72025-07-08 18:04:53 -040014637 case "$cf_add_cflags" in
Steve Kondikae271bc2015-11-15 02:50:53 +010014638 (-D*)
micky3879b9f5e72025-07-08 18:04:53 -040014639 cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
Steve Kondikae271bc2015-11-15 02:50:53 +010014640
14641 test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14642 && test -z "${cf_tst_cflags}" \
14643 && cf_fix_cppflags=yes
14644
micky3879b9f5e72025-07-08 18:04:53 -040014645 if test "$cf_fix_cppflags" = yes ; then
14646
14647 test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14648 cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14649
Steve Kondikae271bc2015-11-15 02:50:53 +010014650 continue
14651 elif test "${cf_tst_cflags}" = "\"'" ; then
micky3879b9f5e72025-07-08 18:04:53 -040014652
14653 test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14654 cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14655
Steve Kondikae271bc2015-11-15 02:50:53 +010014656 continue
14657 fi
14658 ;;
14659 esac
14660 case "$CPPFLAGS" in
14661 (*$cf_add_cflags)
14662 ;;
14663 (*)
micky3879b9f5e72025-07-08 18:04:53 -040014664 case "$cf_add_cflags" in
Steve Kondikae271bc2015-11-15 02:50:53 +010014665 (-D*)
14666 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
14667
14668CPPFLAGS=`echo "$CPPFLAGS" | \
14669 sed -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?[ ]/ /g' \
14670 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?$//g'`
14671
14672 ;;
14673 esac
micky3879b9f5e72025-07-08 18:04:53 -040014674
14675 test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
14676 cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
14677
Steve Kondikae271bc2015-11-15 02:50:53 +010014678 ;;
14679 esac
14680 ;;
14681 (*)
micky3879b9f5e72025-07-08 18:04:53 -040014682
14683 test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
14684 cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
14685
Steve Kondikae271bc2015-11-15 02:50:53 +010014686 ;;
14687 esac
14688 ;;
14689(yes)
Steve Kondikae271bc2015-11-15 02:50:53 +010014690
micky3879b9f5e72025-07-08 18:04:53 -040014691 test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14692 cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14693
14694 cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
Steve Kondikae271bc2015-11-15 02:50:53 +010014695
14696 test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14697 && test -z "${cf_tst_cflags}" \
14698 && cf_fix_cppflags=no
14699 ;;
14700esac
14701done
14702
14703if test -n "$cf_new_cflags" ; then
14704
micky3879b9f5e72025-07-08 18:04:53 -040014705 test -n "$CFLAGS" && CFLAGS="$CFLAGS "
14706 CFLAGS="${CFLAGS}$cf_new_cflags"
14707
Steve Kondikae271bc2015-11-15 02:50:53 +010014708fi
14709
14710if test -n "$cf_new_cppflags" ; then
14711
micky3879b9f5e72025-07-08 18:04:53 -040014712 test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14713 CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
14714
Steve Kondikae271bc2015-11-15 02:50:53 +010014715fi
14716
14717if test -n "$cf_new_extra_cppflags" ; then
14718
micky3879b9f5e72025-07-08 18:04:53 -040014719 test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
14720 EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
14721
Steve Kondikae271bc2015-11-15 02:50:53 +010014722fi
14723
micky3879b9f5e72025-07-08 18:04:53 -040014724cf_add_libs="$LIBS"
14725# reverse order
14726cf_add_0lib=
14727for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
14728# filter duplicates
14729for cf_add_1lib in $cf_add_0lib; do
14730 for cf_add_2lib in $cf_add_libs; do
14731 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
Steve Kondikae271bc2015-11-15 02:50:53 +010014732 cf_add_1lib=
14733 break
14734 fi
14735 done
micky3879b9f5e72025-07-08 18:04:53 -040014736 test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
Steve Kondikae271bc2015-11-15 02:50:53 +010014737done
14738LIBS="$cf_add_libs"
14739
14740 :
14741else
14742 cf_pkgconfig_incs=
14743 cf_pkgconfig_libs=
micky3879b9f5e72025-07-08 18:04:53 -040014744 { echo "$as_me:14744: WARNING: unable to find ICE library" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010014745echo "$as_me: WARNING: unable to find ICE library" >&2;}
14746fi
14747
micky3879b9f5e72025-07-08 18:04:53 -040014748if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists "sm"; then
Steve Kondikae271bc2015-11-15 02:50:53 +010014749 test -n "$verbose" && echo " found package sm" 1>&6
14750
micky3879b9f5e72025-07-08 18:04:53 -040014751echo "${as_me:-configure}:14751: testing found package sm ..." 1>&5
Steve Kondikae271bc2015-11-15 02:50:53 +010014752
micky3879b9f5e72025-07-08 18:04:53 -040014753 cf_pkgconfig_incs="`$PKG_CONFIG --cflags "sm" 2>/dev/null`"
14754 cf_pkgconfig_libs="`$PKG_CONFIG --libs "sm" 2>/dev/null`"
Steve Kondikae271bc2015-11-15 02:50:53 +010014755 test -n "$verbose" && echo " package sm CFLAGS: $cf_pkgconfig_incs" 1>&6
14756
micky3879b9f5e72025-07-08 18:04:53 -040014757echo "${as_me:-configure}:14757: testing package sm CFLAGS: $cf_pkgconfig_incs ..." 1>&5
Steve Kondikae271bc2015-11-15 02:50:53 +010014758
14759 test -n "$verbose" && echo " package sm LIBS: $cf_pkgconfig_libs" 1>&6
14760
micky3879b9f5e72025-07-08 18:04:53 -040014761echo "${as_me:-configure}:14761: testing package sm LIBS: $cf_pkgconfig_libs ..." 1>&5
Steve Kondikae271bc2015-11-15 02:50:53 +010014762
14763cf_fix_cppflags=no
14764cf_new_cflags=
14765cf_new_cppflags=
14766cf_new_extra_cppflags=
14767
14768for cf_add_cflags in $cf_pkgconfig_incs
14769do
micky3879b9f5e72025-07-08 18:04:53 -040014770case "$cf_fix_cppflags" in
Steve Kondikae271bc2015-11-15 02:50:53 +010014771(no)
micky3879b9f5e72025-07-08 18:04:53 -040014772 case "$cf_add_cflags" in
Steve Kondikae271bc2015-11-15 02:50:53 +010014773 (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
micky3879b9f5e72025-07-08 18:04:53 -040014774 case "$cf_add_cflags" in
Steve Kondikae271bc2015-11-15 02:50:53 +010014775 (-D*)
micky3879b9f5e72025-07-08 18:04:53 -040014776 cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
Steve Kondikae271bc2015-11-15 02:50:53 +010014777
14778 test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14779 && test -z "${cf_tst_cflags}" \
14780 && cf_fix_cppflags=yes
14781
micky3879b9f5e72025-07-08 18:04:53 -040014782 if test "$cf_fix_cppflags" = yes ; then
14783
14784 test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14785 cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14786
Steve Kondikae271bc2015-11-15 02:50:53 +010014787 continue
14788 elif test "${cf_tst_cflags}" = "\"'" ; then
micky3879b9f5e72025-07-08 18:04:53 -040014789
14790 test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14791 cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14792
Steve Kondikae271bc2015-11-15 02:50:53 +010014793 continue
14794 fi
14795 ;;
14796 esac
14797 case "$CPPFLAGS" in
14798 (*$cf_add_cflags)
14799 ;;
14800 (*)
micky3879b9f5e72025-07-08 18:04:53 -040014801 case "$cf_add_cflags" in
Steve Kondikae271bc2015-11-15 02:50:53 +010014802 (-D*)
14803 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
14804
14805CPPFLAGS=`echo "$CPPFLAGS" | \
14806 sed -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?[ ]/ /g' \
14807 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?$//g'`
14808
14809 ;;
14810 esac
micky3879b9f5e72025-07-08 18:04:53 -040014811
14812 test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
14813 cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
14814
Steve Kondikae271bc2015-11-15 02:50:53 +010014815 ;;
14816 esac
14817 ;;
14818 (*)
micky3879b9f5e72025-07-08 18:04:53 -040014819
14820 test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
14821 cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
14822
Steve Kondikae271bc2015-11-15 02:50:53 +010014823 ;;
14824 esac
14825 ;;
14826(yes)
Steve Kondikae271bc2015-11-15 02:50:53 +010014827
micky3879b9f5e72025-07-08 18:04:53 -040014828 test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14829 cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14830
14831 cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
Steve Kondikae271bc2015-11-15 02:50:53 +010014832
14833 test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14834 && test -z "${cf_tst_cflags}" \
14835 && cf_fix_cppflags=no
14836 ;;
14837esac
14838done
14839
14840if test -n "$cf_new_cflags" ; then
14841
micky3879b9f5e72025-07-08 18:04:53 -040014842 test -n "$CFLAGS" && CFLAGS="$CFLAGS "
14843 CFLAGS="${CFLAGS}$cf_new_cflags"
14844
Steve Kondikae271bc2015-11-15 02:50:53 +010014845fi
14846
14847if test -n "$cf_new_cppflags" ; then
14848
micky3879b9f5e72025-07-08 18:04:53 -040014849 test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14850 CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
14851
Steve Kondikae271bc2015-11-15 02:50:53 +010014852fi
14853
14854if test -n "$cf_new_extra_cppflags" ; then
14855
micky3879b9f5e72025-07-08 18:04:53 -040014856 test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
14857 EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
14858
Steve Kondikae271bc2015-11-15 02:50:53 +010014859fi
14860
micky3879b9f5e72025-07-08 18:04:53 -040014861cf_add_libs="$LIBS"
14862# reverse order
14863cf_add_0lib=
14864for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
14865# filter duplicates
14866for cf_add_1lib in $cf_add_0lib; do
14867 for cf_add_2lib in $cf_add_libs; do
14868 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
Steve Kondikae271bc2015-11-15 02:50:53 +010014869 cf_add_1lib=
14870 break
14871 fi
14872 done
micky3879b9f5e72025-07-08 18:04:53 -040014873 test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
Steve Kondikae271bc2015-11-15 02:50:53 +010014874done
14875LIBS="$cf_add_libs"
14876
14877 :
14878else
14879 cf_pkgconfig_incs=
14880 cf_pkgconfig_libs=
micky3879b9f5e72025-07-08 18:04:53 -040014881 { echo "$as_me:14881: WARNING: unable to find SM library" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010014882echo "$as_me: WARNING: unable to find SM library" >&2;}
14883fi
14884
micky3879b9f5e72025-07-08 18:04:53 -040014885if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists "xt"; then
Steve Kondikae271bc2015-11-15 02:50:53 +010014886 test -n "$verbose" && echo " found package xt" 1>&6
14887
micky3879b9f5e72025-07-08 18:04:53 -040014888echo "${as_me:-configure}:14888: testing found package xt ..." 1>&5
Steve Kondikae271bc2015-11-15 02:50:53 +010014889
micky3879b9f5e72025-07-08 18:04:53 -040014890 cf_pkgconfig_incs="`$PKG_CONFIG --cflags "xt" 2>/dev/null`"
14891 cf_pkgconfig_libs="`$PKG_CONFIG --libs "xt" 2>/dev/null`"
Steve Kondikae271bc2015-11-15 02:50:53 +010014892 test -n "$verbose" && echo " package xt CFLAGS: $cf_pkgconfig_incs" 1>&6
14893
micky3879b9f5e72025-07-08 18:04:53 -040014894echo "${as_me:-configure}:14894: testing package xt CFLAGS: $cf_pkgconfig_incs ..." 1>&5
Steve Kondikae271bc2015-11-15 02:50:53 +010014895
14896 test -n "$verbose" && echo " package xt LIBS: $cf_pkgconfig_libs" 1>&6
14897
micky3879b9f5e72025-07-08 18:04:53 -040014898echo "${as_me:-configure}:14898: testing package xt LIBS: $cf_pkgconfig_libs ..." 1>&5
Steve Kondikae271bc2015-11-15 02:50:53 +010014899
14900cf_fix_cppflags=no
14901cf_new_cflags=
14902cf_new_cppflags=
14903cf_new_extra_cppflags=
14904
14905for cf_add_cflags in $cf_pkgconfig_incs
14906do
micky3879b9f5e72025-07-08 18:04:53 -040014907case "$cf_fix_cppflags" in
Steve Kondikae271bc2015-11-15 02:50:53 +010014908(no)
micky3879b9f5e72025-07-08 18:04:53 -040014909 case "$cf_add_cflags" in
Steve Kondikae271bc2015-11-15 02:50:53 +010014910 (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
micky3879b9f5e72025-07-08 18:04:53 -040014911 case "$cf_add_cflags" in
Steve Kondikae271bc2015-11-15 02:50:53 +010014912 (-D*)
micky3879b9f5e72025-07-08 18:04:53 -040014913 cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
Steve Kondikae271bc2015-11-15 02:50:53 +010014914
14915 test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14916 && test -z "${cf_tst_cflags}" \
14917 && cf_fix_cppflags=yes
14918
micky3879b9f5e72025-07-08 18:04:53 -040014919 if test "$cf_fix_cppflags" = yes ; then
14920
14921 test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14922 cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14923
Steve Kondikae271bc2015-11-15 02:50:53 +010014924 continue
14925 elif test "${cf_tst_cflags}" = "\"'" ; then
micky3879b9f5e72025-07-08 18:04:53 -040014926
14927 test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14928 cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14929
Steve Kondikae271bc2015-11-15 02:50:53 +010014930 continue
14931 fi
14932 ;;
14933 esac
14934 case "$CPPFLAGS" in
14935 (*$cf_add_cflags)
14936 ;;
14937 (*)
micky3879b9f5e72025-07-08 18:04:53 -040014938 case "$cf_add_cflags" in
Steve Kondikae271bc2015-11-15 02:50:53 +010014939 (-D*)
14940 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
14941
14942CPPFLAGS=`echo "$CPPFLAGS" | \
14943 sed -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?[ ]/ /g' \
14944 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?$//g'`
14945
14946 ;;
14947 esac
micky3879b9f5e72025-07-08 18:04:53 -040014948
14949 test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
14950 cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
14951
Steve Kondikae271bc2015-11-15 02:50:53 +010014952 ;;
14953 esac
14954 ;;
14955 (*)
micky3879b9f5e72025-07-08 18:04:53 -040014956
14957 test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
14958 cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
14959
Steve Kondikae271bc2015-11-15 02:50:53 +010014960 ;;
14961 esac
14962 ;;
14963(yes)
Steve Kondikae271bc2015-11-15 02:50:53 +010014964
micky3879b9f5e72025-07-08 18:04:53 -040014965 test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14966 cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14967
14968 cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
Steve Kondikae271bc2015-11-15 02:50:53 +010014969
14970 test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14971 && test -z "${cf_tst_cflags}" \
14972 && cf_fix_cppflags=no
14973 ;;
14974esac
14975done
14976
14977if test -n "$cf_new_cflags" ; then
14978
micky3879b9f5e72025-07-08 18:04:53 -040014979 test -n "$CFLAGS" && CFLAGS="$CFLAGS "
14980 CFLAGS="${CFLAGS}$cf_new_cflags"
14981
Steve Kondikae271bc2015-11-15 02:50:53 +010014982fi
14983
14984if test -n "$cf_new_cppflags" ; then
14985
micky3879b9f5e72025-07-08 18:04:53 -040014986 test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14987 CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
14988
Steve Kondikae271bc2015-11-15 02:50:53 +010014989fi
14990
14991if test -n "$cf_new_extra_cppflags" ; then
14992
micky3879b9f5e72025-07-08 18:04:53 -040014993 test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
14994 EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
14995
Steve Kondikae271bc2015-11-15 02:50:53 +010014996fi
14997
micky3879b9f5e72025-07-08 18:04:53 -040014998cf_add_libs="$LIBS"
14999# reverse order
15000cf_add_0lib=
15001for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
15002# filter duplicates
15003for cf_add_1lib in $cf_add_0lib; do
15004 for cf_add_2lib in $cf_add_libs; do
15005 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
Steve Kondikae271bc2015-11-15 02:50:53 +010015006 cf_add_1lib=
15007 break
15008 fi
15009 done
micky3879b9f5e72025-07-08 18:04:53 -040015010 test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
Steve Kondikae271bc2015-11-15 02:50:53 +010015011done
15012LIBS="$cf_add_libs"
15013
15014 :
15015else
15016 cf_pkgconfig_incs=
15017 cf_pkgconfig_libs=
micky3879b9f5e72025-07-08 18:04:53 -040015018 { echo "$as_me:15018: WARNING: unable to find Xt library" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010015019echo "$as_me: WARNING: unable to find Xt library" >&2;}
15020fi
15021
micky3879b9f5e72025-07-08 18:04:53 -040015022else
15023 LIBS="$X_PRE_LIBS $LIBS $X_EXTRA_LIBS"
Steve Kondikae271bc2015-11-15 02:50:53 +010015024fi
15025
15026cf_have_X_LIBS=no
15027
micky3879b9f5e72025-07-08 18:04:53 -040015028if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists "xt"; then
Steve Kondikae271bc2015-11-15 02:50:53 +010015029 test -n "$verbose" && echo " found package xt" 1>&6
15030
micky3879b9f5e72025-07-08 18:04:53 -040015031echo "${as_me:-configure}:15031: testing found package xt ..." 1>&5
Steve Kondikae271bc2015-11-15 02:50:53 +010015032
micky3879b9f5e72025-07-08 18:04:53 -040015033 cf_pkgconfig_incs="`$PKG_CONFIG --cflags "xt" 2>/dev/null`"
15034 cf_pkgconfig_libs="`$PKG_CONFIG --libs "xt" 2>/dev/null`"
Steve Kondikae271bc2015-11-15 02:50:53 +010015035 test -n "$verbose" && echo " package xt CFLAGS: $cf_pkgconfig_incs" 1>&6
15036
micky3879b9f5e72025-07-08 18:04:53 -040015037echo "${as_me:-configure}:15037: testing package xt CFLAGS: $cf_pkgconfig_incs ..." 1>&5
Steve Kondikae271bc2015-11-15 02:50:53 +010015038
15039 test -n "$verbose" && echo " package xt LIBS: $cf_pkgconfig_libs" 1>&6
15040
micky3879b9f5e72025-07-08 18:04:53 -040015041echo "${as_me:-configure}:15041: testing package xt LIBS: $cf_pkgconfig_libs ..." 1>&5
Steve Kondikae271bc2015-11-15 02:50:53 +010015042
15043cf_fix_cppflags=no
15044cf_new_cflags=
15045cf_new_cppflags=
15046cf_new_extra_cppflags=
15047
15048for cf_add_cflags in $cf_pkgconfig_incs
15049do
micky3879b9f5e72025-07-08 18:04:53 -040015050case "$cf_fix_cppflags" in
Steve Kondikae271bc2015-11-15 02:50:53 +010015051(no)
micky3879b9f5e72025-07-08 18:04:53 -040015052 case "$cf_add_cflags" in
Steve Kondikae271bc2015-11-15 02:50:53 +010015053 (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
micky3879b9f5e72025-07-08 18:04:53 -040015054 case "$cf_add_cflags" in
Steve Kondikae271bc2015-11-15 02:50:53 +010015055 (-D*)
micky3879b9f5e72025-07-08 18:04:53 -040015056 cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
Steve Kondikae271bc2015-11-15 02:50:53 +010015057
15058 test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
15059 && test -z "${cf_tst_cflags}" \
15060 && cf_fix_cppflags=yes
15061
micky3879b9f5e72025-07-08 18:04:53 -040015062 if test "$cf_fix_cppflags" = yes ; then
15063
15064 test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15065 cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15066
Steve Kondikae271bc2015-11-15 02:50:53 +010015067 continue
15068 elif test "${cf_tst_cflags}" = "\"'" ; then
micky3879b9f5e72025-07-08 18:04:53 -040015069
15070 test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15071 cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15072
Steve Kondikae271bc2015-11-15 02:50:53 +010015073 continue
15074 fi
15075 ;;
15076 esac
15077 case "$CPPFLAGS" in
15078 (*$cf_add_cflags)
15079 ;;
15080 (*)
micky3879b9f5e72025-07-08 18:04:53 -040015081 case "$cf_add_cflags" in
Steve Kondikae271bc2015-11-15 02:50:53 +010015082 (-D*)
15083 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
15084
15085CPPFLAGS=`echo "$CPPFLAGS" | \
15086 sed -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?[ ]/ /g' \
15087 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?$//g'`
15088
15089 ;;
15090 esac
micky3879b9f5e72025-07-08 18:04:53 -040015091
15092 test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
15093 cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
15094
Steve Kondikae271bc2015-11-15 02:50:53 +010015095 ;;
15096 esac
15097 ;;
15098 (*)
micky3879b9f5e72025-07-08 18:04:53 -040015099
15100 test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
15101 cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
15102
Steve Kondikae271bc2015-11-15 02:50:53 +010015103 ;;
15104 esac
15105 ;;
15106(yes)
Steve Kondikae271bc2015-11-15 02:50:53 +010015107
micky3879b9f5e72025-07-08 18:04:53 -040015108 test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15109 cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15110
15111 cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
Steve Kondikae271bc2015-11-15 02:50:53 +010015112
15113 test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
15114 && test -z "${cf_tst_cflags}" \
15115 && cf_fix_cppflags=no
15116 ;;
15117esac
15118done
15119
15120if test -n "$cf_new_cflags" ; then
15121
micky3879b9f5e72025-07-08 18:04:53 -040015122 test -n "$CFLAGS" && CFLAGS="$CFLAGS "
15123 CFLAGS="${CFLAGS}$cf_new_cflags"
15124
Steve Kondikae271bc2015-11-15 02:50:53 +010015125fi
15126
15127if test -n "$cf_new_cppflags" ; then
15128
micky3879b9f5e72025-07-08 18:04:53 -040015129 test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
15130 CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
15131
Steve Kondikae271bc2015-11-15 02:50:53 +010015132fi
15133
15134if test -n "$cf_new_extra_cppflags" ; then
15135
micky3879b9f5e72025-07-08 18:04:53 -040015136 test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
15137 EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
15138
Steve Kondikae271bc2015-11-15 02:50:53 +010015139fi
15140
micky3879b9f5e72025-07-08 18:04:53 -040015141cf_add_libs="$LIBS"
15142# reverse order
15143cf_add_0lib=
15144for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
15145# filter duplicates
15146for cf_add_1lib in $cf_add_0lib; do
15147 for cf_add_2lib in $cf_add_libs; do
15148 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
Steve Kondikae271bc2015-11-15 02:50:53 +010015149 cf_add_1lib=
15150 break
15151 fi
15152 done
micky3879b9f5e72025-07-08 18:04:53 -040015153 test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
Steve Kondikae271bc2015-11-15 02:50:53 +010015154done
15155LIBS="$cf_add_libs"
15156
15157 case "x$LIBS" in
15158 (*-lX11*)
15159 ;;
15160 (*)
15161# we have an "xt" package, but it may omit Xt's dependency on X11
micky3879b9f5e72025-07-08 18:04:53 -040015162echo "$as_me:15162: checking for usable X dependency" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010015163echo $ECHO_N "checking for usable X dependency... $ECHO_C" >&6
15164if test "${cf_cv_xt_x11_compat+set}" = set; then
15165 echo $ECHO_N "(cached) $ECHO_C" >&6
15166else
15167
micky3879b9f5e72025-07-08 18:04:53 -040015168cat >"conftest.$ac_ext" <<_ACEOF
15169#line 15169 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +010015170#include "confdefs.h"
15171
micky3879b9f5e72025-07-08 18:04:53 -040015172$ac_includes_default
Steve Kondikae271bc2015-11-15 02:50:53 +010015173#include <X11/Xlib.h>
15174
15175int
micky3879b9f5e72025-07-08 18:04:53 -040015176main (void)
Steve Kondikae271bc2015-11-15 02:50:53 +010015177{
15178
15179 int rc1 = XDrawLine((Display*) 0, (Drawable) 0, (GC) 0, 0, 0, 0, 0);
15180 int rc2 = XClearWindow((Display*) 0, (Window) 0);
15181 int rc3 = XMoveWindow((Display*) 0, (Window) 0, 0, 0);
15182 int rc4 = XMoveResizeWindow((Display*)0, (Window)0, 0, 0, 0, 0);
15183
15184 ;
15185 return 0;
15186}
15187_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -040015188rm -f "conftest.$ac_objext" "conftest$ac_exeext"
15189if { (eval echo "$as_me:15189: \"$ac_link\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010015190 (eval $ac_link) 2>&5
15191 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040015192 echo "$as_me:15192: \$? = $ac_status" >&5
15193 (exit "$ac_status"); } &&
15194 { ac_try='test -s "conftest$ac_exeext"'
15195 { (eval echo "$as_me:15195: \"$ac_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010015196 (eval $ac_try) 2>&5
15197 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040015198 echo "$as_me:15198: \$? = $ac_status" >&5
15199 (exit "$ac_status"); }; }; then
Steve Kondikae271bc2015-11-15 02:50:53 +010015200 cf_cv_xt_x11_compat=yes
15201else
15202 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -040015203cat "conftest.$ac_ext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010015204cf_cv_xt_x11_compat=no
15205fi
micky3879b9f5e72025-07-08 18:04:53 -040015206rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
Steve Kondikae271bc2015-11-15 02:50:53 +010015207fi
micky3879b9f5e72025-07-08 18:04:53 -040015208echo "$as_me:15208: result: $cf_cv_xt_x11_compat" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010015209echo "${ECHO_T}$cf_cv_xt_x11_compat" >&6
15210 if test "$cf_cv_xt_x11_compat" = no
15211 then
15212 test -n "$verbose" && echo " work around broken X11 dependency" 1>&6
15213
micky3879b9f5e72025-07-08 18:04:53 -040015214echo "${as_me:-configure}:15214: testing work around broken X11 dependency ..." 1>&5
Steve Kondikae271bc2015-11-15 02:50:53 +010015215
15216 # 2010/11/19 - good enough until a working Xt on Xcb is delivered.
15217
micky3879b9f5e72025-07-08 18:04:53 -040015218if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists "x11"; then
Steve Kondikae271bc2015-11-15 02:50:53 +010015219 test -n "$verbose" && echo " found package x11" 1>&6
15220
micky3879b9f5e72025-07-08 18:04:53 -040015221echo "${as_me:-configure}:15221: testing found package x11 ..." 1>&5
Steve Kondikae271bc2015-11-15 02:50:53 +010015222
micky3879b9f5e72025-07-08 18:04:53 -040015223 cf_pkgconfig_incs="`$PKG_CONFIG --cflags "x11" 2>/dev/null`"
15224 cf_pkgconfig_libs="`$PKG_CONFIG --libs "x11" 2>/dev/null`"
Steve Kondikae271bc2015-11-15 02:50:53 +010015225 test -n "$verbose" && echo " package x11 CFLAGS: $cf_pkgconfig_incs" 1>&6
15226
micky3879b9f5e72025-07-08 18:04:53 -040015227echo "${as_me:-configure}:15227: testing package x11 CFLAGS: $cf_pkgconfig_incs ..." 1>&5
Steve Kondikae271bc2015-11-15 02:50:53 +010015228
15229 test -n "$verbose" && echo " package x11 LIBS: $cf_pkgconfig_libs" 1>&6
15230
micky3879b9f5e72025-07-08 18:04:53 -040015231echo "${as_me:-configure}:15231: testing package x11 LIBS: $cf_pkgconfig_libs ..." 1>&5
Steve Kondikae271bc2015-11-15 02:50:53 +010015232
15233cf_fix_cppflags=no
15234cf_new_cflags=
15235cf_new_cppflags=
15236cf_new_extra_cppflags=
15237
15238for cf_add_cflags in $cf_pkgconfig_incs
15239do
micky3879b9f5e72025-07-08 18:04:53 -040015240case "$cf_fix_cppflags" in
Steve Kondikae271bc2015-11-15 02:50:53 +010015241(no)
micky3879b9f5e72025-07-08 18:04:53 -040015242 case "$cf_add_cflags" in
Steve Kondikae271bc2015-11-15 02:50:53 +010015243 (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
micky3879b9f5e72025-07-08 18:04:53 -040015244 case "$cf_add_cflags" in
Steve Kondikae271bc2015-11-15 02:50:53 +010015245 (-D*)
micky3879b9f5e72025-07-08 18:04:53 -040015246 cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
Steve Kondikae271bc2015-11-15 02:50:53 +010015247
15248 test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
15249 && test -z "${cf_tst_cflags}" \
15250 && cf_fix_cppflags=yes
15251
micky3879b9f5e72025-07-08 18:04:53 -040015252 if test "$cf_fix_cppflags" = yes ; then
15253
15254 test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15255 cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15256
Steve Kondikae271bc2015-11-15 02:50:53 +010015257 continue
15258 elif test "${cf_tst_cflags}" = "\"'" ; then
micky3879b9f5e72025-07-08 18:04:53 -040015259
15260 test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15261 cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15262
Steve Kondikae271bc2015-11-15 02:50:53 +010015263 continue
15264 fi
15265 ;;
15266 esac
15267 case "$CPPFLAGS" in
15268 (*$cf_add_cflags)
15269 ;;
15270 (*)
micky3879b9f5e72025-07-08 18:04:53 -040015271 case "$cf_add_cflags" in
Steve Kondikae271bc2015-11-15 02:50:53 +010015272 (-D*)
15273 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
15274
15275CPPFLAGS=`echo "$CPPFLAGS" | \
15276 sed -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?[ ]/ /g' \
15277 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?$//g'`
15278
15279 ;;
15280 esac
micky3879b9f5e72025-07-08 18:04:53 -040015281
15282 test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
15283 cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
15284
Steve Kondikae271bc2015-11-15 02:50:53 +010015285 ;;
15286 esac
15287 ;;
15288 (*)
micky3879b9f5e72025-07-08 18:04:53 -040015289
15290 test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
15291 cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
15292
Steve Kondikae271bc2015-11-15 02:50:53 +010015293 ;;
15294 esac
15295 ;;
15296(yes)
Steve Kondikae271bc2015-11-15 02:50:53 +010015297
micky3879b9f5e72025-07-08 18:04:53 -040015298 test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15299 cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15300
15301 cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
Steve Kondikae271bc2015-11-15 02:50:53 +010015302
15303 test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
15304 && test -z "${cf_tst_cflags}" \
15305 && cf_fix_cppflags=no
15306 ;;
15307esac
15308done
15309
15310if test -n "$cf_new_cflags" ; then
15311
micky3879b9f5e72025-07-08 18:04:53 -040015312 test -n "$CFLAGS" && CFLAGS="$CFLAGS "
15313 CFLAGS="${CFLAGS}$cf_new_cflags"
15314
Steve Kondikae271bc2015-11-15 02:50:53 +010015315fi
15316
15317if test -n "$cf_new_cppflags" ; then
15318
micky3879b9f5e72025-07-08 18:04:53 -040015319 test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
15320 CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
15321
Steve Kondikae271bc2015-11-15 02:50:53 +010015322fi
15323
15324if test -n "$cf_new_extra_cppflags" ; then
15325
micky3879b9f5e72025-07-08 18:04:53 -040015326 test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
15327 EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
15328
Steve Kondikae271bc2015-11-15 02:50:53 +010015329fi
15330
micky3879b9f5e72025-07-08 18:04:53 -040015331cf_add_libs="$LIBS"
15332# reverse order
15333cf_add_0lib=
15334for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
15335# filter duplicates
15336for cf_add_1lib in $cf_add_0lib; do
15337 for cf_add_2lib in $cf_add_libs; do
15338 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
Steve Kondikae271bc2015-11-15 02:50:53 +010015339 cf_add_1lib=
15340 break
15341 fi
15342 done
micky3879b9f5e72025-07-08 18:04:53 -040015343 test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
Steve Kondikae271bc2015-11-15 02:50:53 +010015344done
15345LIBS="$cf_add_libs"
15346
15347 :
15348else
15349 cf_pkgconfig_incs=
15350 cf_pkgconfig_libs=
15351
15352test -n "$verbose" && echo " ...before $LIBS" 1>&6
15353
micky3879b9f5e72025-07-08 18:04:53 -040015354echo "${as_me:-configure}:15354: testing ...before $LIBS ..." 1>&5
Steve Kondikae271bc2015-11-15 02:50:53 +010015355
15356LIBS=`echo "$LIBS" | sed -e "s/[ ][ ]*/ /g" -e "s%-lXt %-lXt -lX11 %" -e 's% % %g'`
15357test -n "$verbose" && echo " ...after $LIBS" 1>&6
15358
micky3879b9f5e72025-07-08 18:04:53 -040015359echo "${as_me:-configure}:15359: testing ...after $LIBS ..." 1>&5
Steve Kondikae271bc2015-11-15 02:50:53 +010015360
15361fi
15362
15363 fi
15364 ;;
15365 esac
15366
micky3879b9f5e72025-07-08 18:04:53 -040015367echo "$as_me:15367: checking for usable X Toolkit package" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010015368echo $ECHO_N "checking for usable X Toolkit package... $ECHO_C" >&6
15369if test "${cf_cv_xt_ice_compat+set}" = set; then
15370 echo $ECHO_N "(cached) $ECHO_C" >&6
15371else
15372
micky3879b9f5e72025-07-08 18:04:53 -040015373cat >"conftest.$ac_ext" <<_ACEOF
15374#line 15374 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +010015375#include "confdefs.h"
15376
micky3879b9f5e72025-07-08 18:04:53 -040015377$ac_includes_default
Steve Kondikae271bc2015-11-15 02:50:53 +010015378#include <X11/Shell.h>
15379
15380int
micky3879b9f5e72025-07-08 18:04:53 -040015381main (void)
Steve Kondikae271bc2015-11-15 02:50:53 +010015382{
micky3879b9f5e72025-07-08 18:04:53 -040015383int num = IceConnectionNumber(0); (void) num
Steve Kondikae271bc2015-11-15 02:50:53 +010015384
15385 ;
15386 return 0;
15387}
15388_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -040015389rm -f "conftest.$ac_objext" "conftest$ac_exeext"
15390if { (eval echo "$as_me:15390: \"$ac_link\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010015391 (eval $ac_link) 2>&5
15392 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040015393 echo "$as_me:15393: \$? = $ac_status" >&5
15394 (exit "$ac_status"); } &&
15395 { ac_try='test -s "conftest$ac_exeext"'
15396 { (eval echo "$as_me:15396: \"$ac_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010015397 (eval $ac_try) 2>&5
15398 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040015399 echo "$as_me:15399: \$? = $ac_status" >&5
15400 (exit "$ac_status"); }; }; then
Steve Kondikae271bc2015-11-15 02:50:53 +010015401 cf_cv_xt_ice_compat=yes
15402else
15403 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -040015404cat "conftest.$ac_ext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010015405cf_cv_xt_ice_compat=no
15406fi
micky3879b9f5e72025-07-08 18:04:53 -040015407rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
Steve Kondikae271bc2015-11-15 02:50:53 +010015408fi
micky3879b9f5e72025-07-08 18:04:53 -040015409echo "$as_me:15409: result: $cf_cv_xt_ice_compat" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010015410echo "${ECHO_T}$cf_cv_xt_ice_compat" >&6
15411
15412 if test "$cf_cv_xt_ice_compat" = no
15413 then
15414 # workaround for broken ".pc" files used for X Toolkit.
15415 case "x$X_PRE_LIBS" in
15416 (*-lICE*)
15417 case "x$LIBS" in
15418 (*-lICE*)
15419 ;;
15420 (*)
15421 test -n "$verbose" && echo " work around broken ICE dependency" 1>&6
15422
micky3879b9f5e72025-07-08 18:04:53 -040015423echo "${as_me:-configure}:15423: testing work around broken ICE dependency ..." 1>&5
Steve Kondikae271bc2015-11-15 02:50:53 +010015424
micky3879b9f5e72025-07-08 18:04:53 -040015425if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists "ice"; then
Steve Kondikae271bc2015-11-15 02:50:53 +010015426 test -n "$verbose" && echo " found package ice" 1>&6
15427
micky3879b9f5e72025-07-08 18:04:53 -040015428echo "${as_me:-configure}:15428: testing found package ice ..." 1>&5
Steve Kondikae271bc2015-11-15 02:50:53 +010015429
micky3879b9f5e72025-07-08 18:04:53 -040015430 cf_pkgconfig_incs="`$PKG_CONFIG --cflags "ice" 2>/dev/null`"
15431 cf_pkgconfig_libs="`$PKG_CONFIG --libs "ice" 2>/dev/null`"
Steve Kondikae271bc2015-11-15 02:50:53 +010015432 test -n "$verbose" && echo " package ice CFLAGS: $cf_pkgconfig_incs" 1>&6
15433
micky3879b9f5e72025-07-08 18:04:53 -040015434echo "${as_me:-configure}:15434: testing package ice CFLAGS: $cf_pkgconfig_incs ..." 1>&5
Steve Kondikae271bc2015-11-15 02:50:53 +010015435
15436 test -n "$verbose" && echo " package ice LIBS: $cf_pkgconfig_libs" 1>&6
15437
micky3879b9f5e72025-07-08 18:04:53 -040015438echo "${as_me:-configure}:15438: testing package ice LIBS: $cf_pkgconfig_libs ..." 1>&5
Steve Kondikae271bc2015-11-15 02:50:53 +010015439
15440cf_fix_cppflags=no
15441cf_new_cflags=
15442cf_new_cppflags=
15443cf_new_extra_cppflags=
15444
15445for cf_add_cflags in $cf_pkgconfig_incs
15446do
micky3879b9f5e72025-07-08 18:04:53 -040015447case "$cf_fix_cppflags" in
Steve Kondikae271bc2015-11-15 02:50:53 +010015448(no)
micky3879b9f5e72025-07-08 18:04:53 -040015449 case "$cf_add_cflags" in
Steve Kondikae271bc2015-11-15 02:50:53 +010015450 (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
micky3879b9f5e72025-07-08 18:04:53 -040015451 case "$cf_add_cflags" in
Steve Kondikae271bc2015-11-15 02:50:53 +010015452 (-D*)
micky3879b9f5e72025-07-08 18:04:53 -040015453 cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
Steve Kondikae271bc2015-11-15 02:50:53 +010015454
15455 test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
15456 && test -z "${cf_tst_cflags}" \
15457 && cf_fix_cppflags=yes
15458
micky3879b9f5e72025-07-08 18:04:53 -040015459 if test "$cf_fix_cppflags" = yes ; then
15460
15461 test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15462 cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15463
Steve Kondikae271bc2015-11-15 02:50:53 +010015464 continue
15465 elif test "${cf_tst_cflags}" = "\"'" ; then
micky3879b9f5e72025-07-08 18:04:53 -040015466
15467 test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15468 cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15469
Steve Kondikae271bc2015-11-15 02:50:53 +010015470 continue
15471 fi
15472 ;;
15473 esac
15474 case "$CPPFLAGS" in
15475 (*$cf_add_cflags)
15476 ;;
15477 (*)
micky3879b9f5e72025-07-08 18:04:53 -040015478 case "$cf_add_cflags" in
Steve Kondikae271bc2015-11-15 02:50:53 +010015479 (-D*)
15480 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
15481
15482CPPFLAGS=`echo "$CPPFLAGS" | \
15483 sed -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?[ ]/ /g' \
15484 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?$//g'`
15485
15486 ;;
15487 esac
micky3879b9f5e72025-07-08 18:04:53 -040015488
15489 test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
15490 cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
15491
Steve Kondikae271bc2015-11-15 02:50:53 +010015492 ;;
15493 esac
15494 ;;
15495 (*)
micky3879b9f5e72025-07-08 18:04:53 -040015496
15497 test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
15498 cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
15499
Steve Kondikae271bc2015-11-15 02:50:53 +010015500 ;;
15501 esac
15502 ;;
15503(yes)
Steve Kondikae271bc2015-11-15 02:50:53 +010015504
micky3879b9f5e72025-07-08 18:04:53 -040015505 test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15506 cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15507
15508 cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
Steve Kondikae271bc2015-11-15 02:50:53 +010015509
15510 test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
15511 && test -z "${cf_tst_cflags}" \
15512 && cf_fix_cppflags=no
15513 ;;
15514esac
15515done
15516
15517if test -n "$cf_new_cflags" ; then
15518
micky3879b9f5e72025-07-08 18:04:53 -040015519 test -n "$CFLAGS" && CFLAGS="$CFLAGS "
15520 CFLAGS="${CFLAGS}$cf_new_cflags"
15521
Steve Kondikae271bc2015-11-15 02:50:53 +010015522fi
15523
15524if test -n "$cf_new_cppflags" ; then
15525
micky3879b9f5e72025-07-08 18:04:53 -040015526 test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
15527 CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
15528
Steve Kondikae271bc2015-11-15 02:50:53 +010015529fi
15530
15531if test -n "$cf_new_extra_cppflags" ; then
15532
micky3879b9f5e72025-07-08 18:04:53 -040015533 test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
15534 EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
15535
Steve Kondikae271bc2015-11-15 02:50:53 +010015536fi
15537
micky3879b9f5e72025-07-08 18:04:53 -040015538cf_add_libs="$LIBS"
15539# reverse order
15540cf_add_0lib=
15541for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
15542# filter duplicates
15543for cf_add_1lib in $cf_add_0lib; do
15544 for cf_add_2lib in $cf_add_libs; do
15545 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
Steve Kondikae271bc2015-11-15 02:50:53 +010015546 cf_add_1lib=
15547 break
15548 fi
15549 done
micky3879b9f5e72025-07-08 18:04:53 -040015550 test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
Steve Kondikae271bc2015-11-15 02:50:53 +010015551done
15552LIBS="$cf_add_libs"
15553
micky3879b9f5e72025-07-08 18:04:53 -040015554if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists "sm"; then
Steve Kondikae271bc2015-11-15 02:50:53 +010015555 test -n "$verbose" && echo " found package sm" 1>&6
15556
micky3879b9f5e72025-07-08 18:04:53 -040015557echo "${as_me:-configure}:15557: testing found package sm ..." 1>&5
Steve Kondikae271bc2015-11-15 02:50:53 +010015558
micky3879b9f5e72025-07-08 18:04:53 -040015559 cf_pkgconfig_incs="`$PKG_CONFIG --cflags "sm" 2>/dev/null`"
15560 cf_pkgconfig_libs="`$PKG_CONFIG --libs "sm" 2>/dev/null`"
Steve Kondikae271bc2015-11-15 02:50:53 +010015561 test -n "$verbose" && echo " package sm CFLAGS: $cf_pkgconfig_incs" 1>&6
15562
micky3879b9f5e72025-07-08 18:04:53 -040015563echo "${as_me:-configure}:15563: testing package sm CFLAGS: $cf_pkgconfig_incs ..." 1>&5
Steve Kondikae271bc2015-11-15 02:50:53 +010015564
15565 test -n "$verbose" && echo " package sm LIBS: $cf_pkgconfig_libs" 1>&6
15566
micky3879b9f5e72025-07-08 18:04:53 -040015567echo "${as_me:-configure}:15567: testing package sm LIBS: $cf_pkgconfig_libs ..." 1>&5
Steve Kondikae271bc2015-11-15 02:50:53 +010015568
15569cf_fix_cppflags=no
15570cf_new_cflags=
15571cf_new_cppflags=
15572cf_new_extra_cppflags=
15573
15574for cf_add_cflags in $cf_pkgconfig_incs
15575do
micky3879b9f5e72025-07-08 18:04:53 -040015576case "$cf_fix_cppflags" in
Steve Kondikae271bc2015-11-15 02:50:53 +010015577(no)
micky3879b9f5e72025-07-08 18:04:53 -040015578 case "$cf_add_cflags" in
Steve Kondikae271bc2015-11-15 02:50:53 +010015579 (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
micky3879b9f5e72025-07-08 18:04:53 -040015580 case "$cf_add_cflags" in
Steve Kondikae271bc2015-11-15 02:50:53 +010015581 (-D*)
micky3879b9f5e72025-07-08 18:04:53 -040015582 cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
Steve Kondikae271bc2015-11-15 02:50:53 +010015583
15584 test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
15585 && test -z "${cf_tst_cflags}" \
15586 && cf_fix_cppflags=yes
15587
micky3879b9f5e72025-07-08 18:04:53 -040015588 if test "$cf_fix_cppflags" = yes ; then
15589
15590 test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15591 cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15592
Steve Kondikae271bc2015-11-15 02:50:53 +010015593 continue
15594 elif test "${cf_tst_cflags}" = "\"'" ; then
micky3879b9f5e72025-07-08 18:04:53 -040015595
15596 test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15597 cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15598
Steve Kondikae271bc2015-11-15 02:50:53 +010015599 continue
15600 fi
15601 ;;
15602 esac
15603 case "$CPPFLAGS" in
15604 (*$cf_add_cflags)
15605 ;;
15606 (*)
micky3879b9f5e72025-07-08 18:04:53 -040015607 case "$cf_add_cflags" in
Steve Kondikae271bc2015-11-15 02:50:53 +010015608 (-D*)
15609 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
15610
15611CPPFLAGS=`echo "$CPPFLAGS" | \
15612 sed -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?[ ]/ /g' \
15613 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?$//g'`
15614
15615 ;;
15616 esac
micky3879b9f5e72025-07-08 18:04:53 -040015617
15618 test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
15619 cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
15620
Steve Kondikae271bc2015-11-15 02:50:53 +010015621 ;;
15622 esac
15623 ;;
15624 (*)
micky3879b9f5e72025-07-08 18:04:53 -040015625
15626 test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
15627 cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
15628
Steve Kondikae271bc2015-11-15 02:50:53 +010015629 ;;
15630 esac
15631 ;;
15632(yes)
Steve Kondikae271bc2015-11-15 02:50:53 +010015633
micky3879b9f5e72025-07-08 18:04:53 -040015634 test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15635 cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15636
15637 cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
Steve Kondikae271bc2015-11-15 02:50:53 +010015638
15639 test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
15640 && test -z "${cf_tst_cflags}" \
15641 && cf_fix_cppflags=no
15642 ;;
15643esac
15644done
15645
15646if test -n "$cf_new_cflags" ; then
15647
micky3879b9f5e72025-07-08 18:04:53 -040015648 test -n "$CFLAGS" && CFLAGS="$CFLAGS "
15649 CFLAGS="${CFLAGS}$cf_new_cflags"
15650
Steve Kondikae271bc2015-11-15 02:50:53 +010015651fi
15652
15653if test -n "$cf_new_cppflags" ; then
15654
micky3879b9f5e72025-07-08 18:04:53 -040015655 test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
15656 CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
15657
Steve Kondikae271bc2015-11-15 02:50:53 +010015658fi
15659
15660if test -n "$cf_new_extra_cppflags" ; then
15661
micky3879b9f5e72025-07-08 18:04:53 -040015662 test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
15663 EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
15664
Steve Kondikae271bc2015-11-15 02:50:53 +010015665fi
15666
micky3879b9f5e72025-07-08 18:04:53 -040015667cf_add_libs="$LIBS"
15668# reverse order
15669cf_add_0lib=
15670for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
15671# filter duplicates
15672for cf_add_1lib in $cf_add_0lib; do
15673 for cf_add_2lib in $cf_add_libs; do
15674 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
Steve Kondikae271bc2015-11-15 02:50:53 +010015675 cf_add_1lib=
15676 break
15677 fi
15678 done
micky3879b9f5e72025-07-08 18:04:53 -040015679 test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
Steve Kondikae271bc2015-11-15 02:50:53 +010015680done
15681LIBS="$cf_add_libs"
15682
15683 :
15684else
15685 cf_pkgconfig_incs=
15686 cf_pkgconfig_libs=
15687 :
15688fi
15689
15690else
15691 cf_pkgconfig_incs=
15692 cf_pkgconfig_libs=
15693
15694test -n "$verbose" && echo " ...before $LIBS" 1>&6
15695
micky3879b9f5e72025-07-08 18:04:53 -040015696echo "${as_me:-configure}:15696: testing ...before $LIBS ..." 1>&5
Steve Kondikae271bc2015-11-15 02:50:53 +010015697
15698LIBS=`echo "$LIBS" | sed -e "s/[ ][ ]*/ /g" -e "s%-lXt %-lXt $X_PRE_LIBS %" -e 's% % %g'`
15699test -n "$verbose" && echo " ...after $LIBS" 1>&6
15700
micky3879b9f5e72025-07-08 18:04:53 -040015701echo "${as_me:-configure}:15701: testing ...after $LIBS ..." 1>&5
Steve Kondikae271bc2015-11-15 02:50:53 +010015702
15703fi
15704
15705 ;;
15706 esac
15707 ;;
15708 esac
15709 fi
15710
15711 cf_have_X_LIBS=yes
15712
15713else
15714 cf_pkgconfig_incs=
15715 cf_pkgconfig_libs=
15716
15717 LDFLAGS="$X_LIBS $LDFLAGS"
15718
15719test -n "$verbose" && echo " checking additions to CFLAGS" 1>&6
15720
micky3879b9f5e72025-07-08 18:04:53 -040015721echo "${as_me:-configure}:15721: testing checking additions to CFLAGS ..." 1>&5
Steve Kondikae271bc2015-11-15 02:50:53 +010015722
15723cf_check_cflags="$CFLAGS"
15724cf_check_cppflags="$CPPFLAGS"
15725
15726cf_fix_cppflags=no
15727cf_new_cflags=
15728cf_new_cppflags=
15729cf_new_extra_cppflags=
15730
15731for cf_add_cflags in $X_CFLAGS
15732do
micky3879b9f5e72025-07-08 18:04:53 -040015733case "$cf_fix_cppflags" in
Steve Kondikae271bc2015-11-15 02:50:53 +010015734(no)
micky3879b9f5e72025-07-08 18:04:53 -040015735 case "$cf_add_cflags" in
Steve Kondikae271bc2015-11-15 02:50:53 +010015736 (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
micky3879b9f5e72025-07-08 18:04:53 -040015737 case "$cf_add_cflags" in
Steve Kondikae271bc2015-11-15 02:50:53 +010015738 (-D*)
micky3879b9f5e72025-07-08 18:04:53 -040015739 cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
Steve Kondikae271bc2015-11-15 02:50:53 +010015740
15741 test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
15742 && test -z "${cf_tst_cflags}" \
15743 && cf_fix_cppflags=yes
15744
micky3879b9f5e72025-07-08 18:04:53 -040015745 if test "$cf_fix_cppflags" = yes ; then
15746
15747 test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15748 cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15749
Steve Kondikae271bc2015-11-15 02:50:53 +010015750 continue
15751 elif test "${cf_tst_cflags}" = "\"'" ; then
micky3879b9f5e72025-07-08 18:04:53 -040015752
15753 test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15754 cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15755
Steve Kondikae271bc2015-11-15 02:50:53 +010015756 continue
15757 fi
15758 ;;
15759 esac
15760 case "$CPPFLAGS" in
15761 (*$cf_add_cflags)
15762 ;;
15763 (*)
micky3879b9f5e72025-07-08 18:04:53 -040015764 case "$cf_add_cflags" in
Steve Kondikae271bc2015-11-15 02:50:53 +010015765 (-D*)
15766 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
15767
15768CPPFLAGS=`echo "$CPPFLAGS" | \
15769 sed -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?[ ]/ /g' \
15770 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?$//g'`
15771
15772 ;;
15773 esac
micky3879b9f5e72025-07-08 18:04:53 -040015774
15775 test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
15776 cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
15777
Steve Kondikae271bc2015-11-15 02:50:53 +010015778 ;;
15779 esac
15780 ;;
15781 (*)
micky3879b9f5e72025-07-08 18:04:53 -040015782
15783 test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
15784 cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
15785
Steve Kondikae271bc2015-11-15 02:50:53 +010015786 ;;
15787 esac
15788 ;;
15789(yes)
Steve Kondikae271bc2015-11-15 02:50:53 +010015790
micky3879b9f5e72025-07-08 18:04:53 -040015791 test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15792 cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15793
15794 cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
Steve Kondikae271bc2015-11-15 02:50:53 +010015795
15796 test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
15797 && test -z "${cf_tst_cflags}" \
15798 && cf_fix_cppflags=no
15799 ;;
15800esac
15801done
15802
15803if test -n "$cf_new_cflags" ; then
15804 test -n "$verbose" && echo " add to \$CFLAGS $cf_new_cflags" 1>&6
15805
micky3879b9f5e72025-07-08 18:04:53 -040015806echo "${as_me:-configure}:15806: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
Steve Kondikae271bc2015-11-15 02:50:53 +010015807
micky3879b9f5e72025-07-08 18:04:53 -040015808 test -n "$CFLAGS" && CFLAGS="$CFLAGS "
15809 CFLAGS="${CFLAGS}$cf_new_cflags"
15810
Steve Kondikae271bc2015-11-15 02:50:53 +010015811fi
15812
15813if test -n "$cf_new_cppflags" ; then
15814 test -n "$verbose" && echo " add to \$CPPFLAGS $cf_new_cppflags" 1>&6
15815
micky3879b9f5e72025-07-08 18:04:53 -040015816echo "${as_me:-configure}:15816: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
Steve Kondikae271bc2015-11-15 02:50:53 +010015817
micky3879b9f5e72025-07-08 18:04:53 -040015818 test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
15819 CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
15820
Steve Kondikae271bc2015-11-15 02:50:53 +010015821fi
15822
15823if test -n "$cf_new_extra_cppflags" ; then
15824 test -n "$verbose" && echo " add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6
15825
micky3879b9f5e72025-07-08 18:04:53 -040015826echo "${as_me:-configure}:15826: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
Steve Kondikae271bc2015-11-15 02:50:53 +010015827
micky3879b9f5e72025-07-08 18:04:53 -040015828 test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
15829 EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
15830
Steve Kondikae271bc2015-11-15 02:50:53 +010015831fi
15832
15833if test "x$cf_check_cflags" != "x$CFLAGS" ; then
micky3879b9f5e72025-07-08 18:04:53 -040015834cat >"conftest.$ac_ext" <<_ACEOF
15835#line 15835 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +010015836#include "confdefs.h"
15837#include <stdio.h>
15838int
micky3879b9f5e72025-07-08 18:04:53 -040015839main (void)
Steve Kondikae271bc2015-11-15 02:50:53 +010015840{
15841printf("Hello world");
15842 ;
15843 return 0;
15844}
15845_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -040015846rm -f "conftest.$ac_objext" "conftest$ac_exeext"
15847if { (eval echo "$as_me:15847: \"$ac_link\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010015848 (eval $ac_link) 2>&5
15849 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040015850 echo "$as_me:15850: \$? = $ac_status" >&5
15851 (exit "$ac_status"); } &&
15852 { ac_try='test -s "conftest$ac_exeext"'
15853 { (eval echo "$as_me:15853: \"$ac_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010015854 (eval $ac_try) 2>&5
15855 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040015856 echo "$as_me:15856: \$? = $ac_status" >&5
15857 (exit "$ac_status"); }; }; then
Steve Kondikae271bc2015-11-15 02:50:53 +010015858 :
15859else
15860 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -040015861cat "conftest.$ac_ext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010015862test -n "$verbose" && echo " test-compile failed. Undoing change to \$CFLAGS" 1>&6
15863
micky3879b9f5e72025-07-08 18:04:53 -040015864echo "${as_me:-configure}:15864: testing test-compile failed. Undoing change to \$CFLAGS ..." 1>&5
Steve Kondikae271bc2015-11-15 02:50:53 +010015865
15866 if test "x$cf_check_cppflags" != "x$CPPFLAGS" ; then
15867 test -n "$verbose" && echo " but keeping change to \$CPPFLAGS" 1>&6
15868
micky3879b9f5e72025-07-08 18:04:53 -040015869echo "${as_me:-configure}:15869: testing but keeping change to \$CPPFLAGS ..." 1>&5
Steve Kondikae271bc2015-11-15 02:50:53 +010015870
15871 fi
micky3879b9f5e72025-07-08 18:04:53 -040015872 CFLAGS="$cf_check_cflags"
Steve Kondikae271bc2015-11-15 02:50:53 +010015873fi
micky3879b9f5e72025-07-08 18:04:53 -040015874rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
Steve Kondikae271bc2015-11-15 02:50:53 +010015875fi
15876
micky3879b9f5e72025-07-08 18:04:53 -040015877 echo "$as_me:15877: checking for XOpenDisplay" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010015878echo $ECHO_N "checking for XOpenDisplay... $ECHO_C" >&6
15879if test "${ac_cv_func_XOpenDisplay+set}" = set; then
15880 echo $ECHO_N "(cached) $ECHO_C" >&6
15881else
micky3879b9f5e72025-07-08 18:04:53 -040015882 cat >"conftest.$ac_ext" <<_ACEOF
15883#line 15883 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +010015884#include "confdefs.h"
micky3879b9f5e72025-07-08 18:04:53 -040015885#define XOpenDisplay autoconf_temporary
15886#include <limits.h> /* least-intrusive standard header which defines gcc2 __stub macros */
15887#undef XOpenDisplay
15888
Steve Kondikae271bc2015-11-15 02:50:53 +010015889#ifdef __cplusplus
15890extern "C"
15891#endif
micky3879b9f5e72025-07-08 18:04:53 -040015892
Steve Kondikae271bc2015-11-15 02:50:53 +010015893/* We use char because int might match the return type of a gcc2
15894 builtin and then its argument prototype would still apply. */
micky3879b9f5e72025-07-08 18:04:53 -040015895char XOpenDisplay (void);
Steve Kondikae271bc2015-11-15 02:50:53 +010015896
15897int
micky3879b9f5e72025-07-08 18:04:53 -040015898main (void)
Steve Kondikae271bc2015-11-15 02:50:53 +010015899{
micky3879b9f5e72025-07-08 18:04:53 -040015900
15901/* The GNU C library defines stubs for functions which it implements
Steve Kondikae271bc2015-11-15 02:50:53 +010015902 to always fail with ENOSYS. Some functions are actually named
15903 something starting with __ and the normal name is an alias. */
15904#if defined (__stub_XOpenDisplay) || defined (__stub___XOpenDisplay)
micky3879b9f5e72025-07-08 18:04:53 -040015905#error found stub for XOpenDisplay
Steve Kondikae271bc2015-11-15 02:50:53 +010015906#endif
15907
micky3879b9f5e72025-07-08 18:04:53 -040015908 return XOpenDisplay ();
Steve Kondikae271bc2015-11-15 02:50:53 +010015909 ;
15910 return 0;
15911}
15912_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -040015913rm -f "conftest.$ac_objext" "conftest$ac_exeext"
15914if { (eval echo "$as_me:15914: \"$ac_link\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010015915 (eval $ac_link) 2>&5
15916 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040015917 echo "$as_me:15917: \$? = $ac_status" >&5
15918 (exit "$ac_status"); } &&
15919 { ac_try='test -s "conftest$ac_exeext"'
15920 { (eval echo "$as_me:15920: \"$ac_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010015921 (eval $ac_try) 2>&5
15922 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040015923 echo "$as_me:15923: \$? = $ac_status" >&5
15924 (exit "$ac_status"); }; }; then
Steve Kondikae271bc2015-11-15 02:50:53 +010015925 ac_cv_func_XOpenDisplay=yes
15926else
15927 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -040015928cat "conftest.$ac_ext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010015929ac_cv_func_XOpenDisplay=no
15930fi
micky3879b9f5e72025-07-08 18:04:53 -040015931rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
Steve Kondikae271bc2015-11-15 02:50:53 +010015932fi
micky3879b9f5e72025-07-08 18:04:53 -040015933echo "$as_me:15933: result: $ac_cv_func_XOpenDisplay" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010015934echo "${ECHO_T}$ac_cv_func_XOpenDisplay" >&6
micky3879b9f5e72025-07-08 18:04:53 -040015935if test "$ac_cv_func_XOpenDisplay" = yes; then
Steve Kondikae271bc2015-11-15 02:50:53 +010015936 :
15937else
15938
micky3879b9f5e72025-07-08 18:04:53 -040015939 echo "$as_me:15939: checking for XOpenDisplay in -lX11" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010015940echo $ECHO_N "checking for XOpenDisplay in -lX11... $ECHO_C" >&6
15941if test "${ac_cv_lib_X11_XOpenDisplay+set}" = set; then
15942 echo $ECHO_N "(cached) $ECHO_C" >&6
15943else
15944 ac_check_lib_save_LIBS=$LIBS
micky3879b9f5e72025-07-08 18:04:53 -040015945LIBS="-lX11 $LIBS"
15946cat >"conftest.$ac_ext" <<_ACEOF
15947#line 15947 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +010015948#include "confdefs.h"
15949
15950/* Override any gcc2 internal prototype to avoid an error. */
15951#ifdef __cplusplus
15952extern "C"
15953#endif
15954/* We use char because int might match the return type of a gcc2
15955 builtin and then its argument prototype would still apply. */
micky3879b9f5e72025-07-08 18:04:53 -040015956char XOpenDisplay (void);
Steve Kondikae271bc2015-11-15 02:50:53 +010015957int
micky3879b9f5e72025-07-08 18:04:53 -040015958main (void)
Steve Kondikae271bc2015-11-15 02:50:53 +010015959{
15960XOpenDisplay ();
15961 ;
15962 return 0;
15963}
15964_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -040015965rm -f "conftest.$ac_objext" "conftest$ac_exeext"
15966if { (eval echo "$as_me:15966: \"$ac_link\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010015967 (eval $ac_link) 2>&5
15968 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040015969 echo "$as_me:15969: \$? = $ac_status" >&5
15970 (exit "$ac_status"); } &&
15971 { ac_try='test -s "conftest$ac_exeext"'
15972 { (eval echo "$as_me:15972: \"$ac_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010015973 (eval $ac_try) 2>&5
15974 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040015975 echo "$as_me:15975: \$? = $ac_status" >&5
15976 (exit "$ac_status"); }; }; then
Steve Kondikae271bc2015-11-15 02:50:53 +010015977 ac_cv_lib_X11_XOpenDisplay=yes
15978else
15979 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -040015980cat "conftest.$ac_ext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010015981ac_cv_lib_X11_XOpenDisplay=no
15982fi
micky3879b9f5e72025-07-08 18:04:53 -040015983rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
Steve Kondikae271bc2015-11-15 02:50:53 +010015984LIBS=$ac_check_lib_save_LIBS
15985fi
micky3879b9f5e72025-07-08 18:04:53 -040015986echo "$as_me:15986: result: $ac_cv_lib_X11_XOpenDisplay" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010015987echo "${ECHO_T}$ac_cv_lib_X11_XOpenDisplay" >&6
micky3879b9f5e72025-07-08 18:04:53 -040015988if test "$ac_cv_lib_X11_XOpenDisplay" = yes; then
Steve Kondikae271bc2015-11-15 02:50:53 +010015989
micky3879b9f5e72025-07-08 18:04:53 -040015990cf_add_libs="$LIBS"
15991# reverse order
15992cf_add_0lib=
15993for cf_add_1lib in -lX11; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
15994# filter duplicates
15995for cf_add_1lib in $cf_add_0lib; do
15996 for cf_add_2lib in $cf_add_libs; do
15997 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
Steve Kondikae271bc2015-11-15 02:50:53 +010015998 cf_add_1lib=
15999 break
16000 fi
16001 done
micky3879b9f5e72025-07-08 18:04:53 -040016002 test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
Steve Kondikae271bc2015-11-15 02:50:53 +010016003done
16004LIBS="$cf_add_libs"
16005
16006fi
16007
16008fi
16009
micky3879b9f5e72025-07-08 18:04:53 -040016010 echo "$as_me:16010: checking for XtAppInitialize" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010016011echo $ECHO_N "checking for XtAppInitialize... $ECHO_C" >&6
16012if test "${ac_cv_func_XtAppInitialize+set}" = set; then
16013 echo $ECHO_N "(cached) $ECHO_C" >&6
16014else
micky3879b9f5e72025-07-08 18:04:53 -040016015 cat >"conftest.$ac_ext" <<_ACEOF
16016#line 16016 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +010016017#include "confdefs.h"
micky3879b9f5e72025-07-08 18:04:53 -040016018#define XtAppInitialize autoconf_temporary
16019#include <limits.h> /* least-intrusive standard header which defines gcc2 __stub macros */
16020#undef XtAppInitialize
16021
Steve Kondikae271bc2015-11-15 02:50:53 +010016022#ifdef __cplusplus
16023extern "C"
16024#endif
micky3879b9f5e72025-07-08 18:04:53 -040016025
Steve Kondikae271bc2015-11-15 02:50:53 +010016026/* We use char because int might match the return type of a gcc2
16027 builtin and then its argument prototype would still apply. */
micky3879b9f5e72025-07-08 18:04:53 -040016028char XtAppInitialize (void);
Steve Kondikae271bc2015-11-15 02:50:53 +010016029
16030int
micky3879b9f5e72025-07-08 18:04:53 -040016031main (void)
Steve Kondikae271bc2015-11-15 02:50:53 +010016032{
micky3879b9f5e72025-07-08 18:04:53 -040016033
16034/* The GNU C library defines stubs for functions which it implements
Steve Kondikae271bc2015-11-15 02:50:53 +010016035 to always fail with ENOSYS. Some functions are actually named
16036 something starting with __ and the normal name is an alias. */
16037#if defined (__stub_XtAppInitialize) || defined (__stub___XtAppInitialize)
micky3879b9f5e72025-07-08 18:04:53 -040016038#error found stub for XtAppInitialize
Steve Kondikae271bc2015-11-15 02:50:53 +010016039#endif
16040
micky3879b9f5e72025-07-08 18:04:53 -040016041 return XtAppInitialize ();
Steve Kondikae271bc2015-11-15 02:50:53 +010016042 ;
16043 return 0;
16044}
16045_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -040016046rm -f "conftest.$ac_objext" "conftest$ac_exeext"
16047if { (eval echo "$as_me:16047: \"$ac_link\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010016048 (eval $ac_link) 2>&5
16049 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040016050 echo "$as_me:16050: \$? = $ac_status" >&5
16051 (exit "$ac_status"); } &&
16052 { ac_try='test -s "conftest$ac_exeext"'
16053 { (eval echo "$as_me:16053: \"$ac_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010016054 (eval $ac_try) 2>&5
16055 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040016056 echo "$as_me:16056: \$? = $ac_status" >&5
16057 (exit "$ac_status"); }; }; then
Steve Kondikae271bc2015-11-15 02:50:53 +010016058 ac_cv_func_XtAppInitialize=yes
16059else
16060 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -040016061cat "conftest.$ac_ext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010016062ac_cv_func_XtAppInitialize=no
16063fi
micky3879b9f5e72025-07-08 18:04:53 -040016064rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
Steve Kondikae271bc2015-11-15 02:50:53 +010016065fi
micky3879b9f5e72025-07-08 18:04:53 -040016066echo "$as_me:16066: result: $ac_cv_func_XtAppInitialize" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010016067echo "${ECHO_T}$ac_cv_func_XtAppInitialize" >&6
micky3879b9f5e72025-07-08 18:04:53 -040016068if test "$ac_cv_func_XtAppInitialize" = yes; then
Steve Kondikae271bc2015-11-15 02:50:53 +010016069 :
16070else
16071
micky3879b9f5e72025-07-08 18:04:53 -040016072 echo "$as_me:16072: checking for XtAppInitialize in -lXt" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010016073echo $ECHO_N "checking for XtAppInitialize in -lXt... $ECHO_C" >&6
16074if test "${ac_cv_lib_Xt_XtAppInitialize+set}" = set; then
16075 echo $ECHO_N "(cached) $ECHO_C" >&6
16076else
16077 ac_check_lib_save_LIBS=$LIBS
micky3879b9f5e72025-07-08 18:04:53 -040016078LIBS="-lXt $LIBS"
16079cat >"conftest.$ac_ext" <<_ACEOF
16080#line 16080 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +010016081#include "confdefs.h"
16082
16083/* Override any gcc2 internal prototype to avoid an error. */
16084#ifdef __cplusplus
16085extern "C"
16086#endif
16087/* We use char because int might match the return type of a gcc2
16088 builtin and then its argument prototype would still apply. */
micky3879b9f5e72025-07-08 18:04:53 -040016089char XtAppInitialize (void);
Steve Kondikae271bc2015-11-15 02:50:53 +010016090int
micky3879b9f5e72025-07-08 18:04:53 -040016091main (void)
Steve Kondikae271bc2015-11-15 02:50:53 +010016092{
16093XtAppInitialize ();
16094 ;
16095 return 0;
16096}
16097_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -040016098rm -f "conftest.$ac_objext" "conftest$ac_exeext"
16099if { (eval echo "$as_me:16099: \"$ac_link\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010016100 (eval $ac_link) 2>&5
16101 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040016102 echo "$as_me:16102: \$? = $ac_status" >&5
16103 (exit "$ac_status"); } &&
16104 { ac_try='test -s "conftest$ac_exeext"'
16105 { (eval echo "$as_me:16105: \"$ac_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010016106 (eval $ac_try) 2>&5
16107 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040016108 echo "$as_me:16108: \$? = $ac_status" >&5
16109 (exit "$ac_status"); }; }; then
Steve Kondikae271bc2015-11-15 02:50:53 +010016110 ac_cv_lib_Xt_XtAppInitialize=yes
16111else
16112 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -040016113cat "conftest.$ac_ext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010016114ac_cv_lib_Xt_XtAppInitialize=no
16115fi
micky3879b9f5e72025-07-08 18:04:53 -040016116rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
Steve Kondikae271bc2015-11-15 02:50:53 +010016117LIBS=$ac_check_lib_save_LIBS
16118fi
micky3879b9f5e72025-07-08 18:04:53 -040016119echo "$as_me:16119: result: $ac_cv_lib_Xt_XtAppInitialize" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010016120echo "${ECHO_T}$ac_cv_lib_Xt_XtAppInitialize" >&6
micky3879b9f5e72025-07-08 18:04:53 -040016121if test "$ac_cv_lib_Xt_XtAppInitialize" = yes; then
Steve Kondikae271bc2015-11-15 02:50:53 +010016122
16123cat >>confdefs.h <<\EOF
16124#define HAVE_LIBXT 1
16125EOF
16126
16127 cf_have_X_LIBS=Xt
micky3879b9f5e72025-07-08 18:04:53 -040016128 LIBS="-lXt $LIBS"
Steve Kondikae271bc2015-11-15 02:50:53 +010016129fi
16130
16131fi
16132
16133fi
16134
micky3879b9f5e72025-07-08 18:04:53 -040016135if test "$cf_have_X_LIBS" = no ; then
16136 { echo "$as_me:16136: WARNING: Unable to successfully link X Toolkit library (-lXt) with
Steve Kondikae271bc2015-11-15 02:50:53 +010016137test program. You will have to check and add the proper libraries by hand
16138to makefile." >&5
16139echo "$as_me: WARNING: Unable to successfully link X Toolkit library (-lXt) with
16140test program. You will have to check and add the proper libraries by hand
16141to makefile." >&2;}
16142fi
16143
16144cf_x_athena_root=$cf_x_athena
16145cf_x_athena_inc=""
16146
16147for cf_path in default \
16148 /usr/contrib/X11R6 \
16149 /usr/contrib/X11R5 \
16150 /usr/lib/X11R5 \
16151 /usr/local
16152do
16153 if test -z "$cf_x_athena_inc" ; then
micky3879b9f5e72025-07-08 18:04:53 -040016154
16155cf_save_LIBS_CF_X_ATHENA_CPPFLAGS="$LIBS"
16156cf_save_CFLAGS_CF_X_ATHENA_CPPFLAGS="$CFLAGS"
16157cf_save_CPPFLAGS_CF_X_ATHENA_CPPFLAGS="$CPPFLAGS"
16158LIBS="$LIBS ${X_PRE_LIBS} ${X_LIBS} ${X_EXTRA_LIBS}"
16159for cf_X_CFLAGS in $X_CFLAGS
16160do
16161 case "x$cf_X_CFLAGS" in
16162 x-[IUD]*)
16163 CPPFLAGS="$CPPFLAGS $cf_X_CFLAGS"
16164 ;;
16165 *)
16166 CFLAGS="$CFLAGS $cf_X_CFLAGS"
16167 ;;
16168 esac
16169done
16170
Steve Kondikae271bc2015-11-15 02:50:53 +010016171 cf_test=X11/$cf_x_athena_root/SimpleMenu.h
micky3879b9f5e72025-07-08 18:04:53 -040016172 if test "$cf_path" != default ; then
16173
16174 test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
16175 CPPFLAGS="${CPPFLAGS}-I$cf_path/include"
16176
16177 echo "$as_me:16177: checking for $cf_test in $cf_path" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010016178echo $ECHO_N "checking for $cf_test in $cf_path... $ECHO_C" >&6
16179 else
micky3879b9f5e72025-07-08 18:04:53 -040016180 echo "$as_me:16180: checking for $cf_test" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010016181echo $ECHO_N "checking for $cf_test... $ECHO_C" >&6
16182 fi
micky3879b9f5e72025-07-08 18:04:53 -040016183 cat >"conftest.$ac_ext" <<_ACEOF
16184#line 16184 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +010016185#include "confdefs.h"
16186
16187#include <X11/Intrinsic.h>
16188#include <$cf_test>
16189int
micky3879b9f5e72025-07-08 18:04:53 -040016190main (void)
Steve Kondikae271bc2015-11-15 02:50:53 +010016191{
16192
16193 ;
16194 return 0;
16195}
16196_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -040016197rm -f "conftest.$ac_objext"
16198if { (eval echo "$as_me:16198: \"$ac_compile\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010016199 (eval $ac_compile) 2>&5
16200 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040016201 echo "$as_me:16201: \$? = $ac_status" >&5
16202 (exit "$ac_status"); } &&
16203 { ac_try='test -s "conftest.$ac_objext"'
16204 { (eval echo "$as_me:16204: \"$ac_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010016205 (eval $ac_try) 2>&5
16206 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040016207 echo "$as_me:16207: \$? = $ac_status" >&5
16208 (exit "$ac_status"); }; }; then
Steve Kondikae271bc2015-11-15 02:50:53 +010016209 cf_result=yes
16210else
16211 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -040016212cat "conftest.$ac_ext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010016213cf_result=no
16214fi
micky3879b9f5e72025-07-08 18:04:53 -040016215rm -f "conftest.$ac_objext" "conftest.$ac_ext"
16216 echo "$as_me:16216: result: $cf_result" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010016217echo "${ECHO_T}$cf_result" >&6
micky3879b9f5e72025-07-08 18:04:53 -040016218
16219LIBS="$cf_save_LIBS_CF_X_ATHENA_CPPFLAGS"
16220CFLAGS="$cf_save_CFLAGS_CF_X_ATHENA_CPPFLAGS"
16221CPPFLAGS="$cf_save_CPPFLAGS_CF_X_ATHENA_CPPFLAGS"
16222
Steve Kondikae271bc2015-11-15 02:50:53 +010016223 if test "$cf_result" = yes ; then
micky3879b9f5e72025-07-08 18:04:53 -040016224 test "$cf_path" = default && cf_x_athena_inc=default
16225 test "$cf_path" != default && cf_x_athena_inc="$cf_path/include"
Steve Kondikae271bc2015-11-15 02:50:53 +010016226 break
Steve Kondikae271bc2015-11-15 02:50:53 +010016227 fi
16228 fi
16229done
16230
16231if test -z "$cf_x_athena_inc" ; then
micky3879b9f5e72025-07-08 18:04:53 -040016232 { echo "$as_me:16232: WARNING: Unable to find Athena header files" >&5
16233echo "$as_me: WARNING: Unable to find Athena header files" >&2;}
Steve Kondikae271bc2015-11-15 02:50:53 +010016234elif test "$cf_x_athena_inc" != default ; then
micky3879b9f5e72025-07-08 18:04:53 -040016235
16236 test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
16237 CPPFLAGS="${CPPFLAGS}-I$cf_x_athena_inc"
16238
Steve Kondikae271bc2015-11-15 02:50:53 +010016239fi
16240
16241cf_x_athena_root=$cf_x_athena
16242cf_x_athena_lib=""
16243
16244for cf_path in default \
16245 /usr/contrib/X11R6 \
16246 /usr/contrib/X11R5 \
16247 /usr/lib/X11R5 \
16248 /usr/local
16249do
16250 for cf_lib in \
16251 ${cf_x_athena_root} \
16252 ${cf_x_athena_root}7 \
16253 ${cf_x_athena_root}6
16254 do
16255 for cf_libs in \
16256 "-l$cf_lib -lXmu" \
16257 "-l$cf_lib -lXpm -lXmu" \
16258 "-l${cf_lib}_s -lXmu_s"
16259 do
micky3879b9f5e72025-07-08 18:04:53 -040016260 test -n "$cf_x_athena_lib" && break
Steve Kondikae271bc2015-11-15 02:50:53 +010016261
micky3879b9f5e72025-07-08 18:04:53 -040016262cf_save_LIBS_CF_X_ATHENA_LIBS="$LIBS"
16263cf_save_CFLAGS_CF_X_ATHENA_LIBS="$CFLAGS"
16264cf_save_CPPFLAGS_CF_X_ATHENA_LIBS="$CPPFLAGS"
16265LIBS="$LIBS ${X_PRE_LIBS} ${X_LIBS} ${X_EXTRA_LIBS}"
16266for cf_X_CFLAGS in $X_CFLAGS
Steve Kondikae271bc2015-11-15 02:50:53 +010016267do
micky3879b9f5e72025-07-08 18:04:53 -040016268 case "x$cf_X_CFLAGS" in
16269 x-[IUD]*)
16270 CPPFLAGS="$CPPFLAGS $cf_X_CFLAGS"
16271 ;;
16272 *)
16273 CFLAGS="$CFLAGS $cf_X_CFLAGS"
16274 ;;
16275 esac
16276done
16277
16278 cf_test=XawSimpleMenuAddGlobalActions
16279 test "$cf_path" != default && cf_libs="-L$cf_path/lib $cf_libs"
16280
16281cf_add_libs="$LIBS"
16282# reverse order
16283cf_add_0lib=
16284for cf_add_1lib in $cf_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
16285# filter duplicates
16286for cf_add_1lib in $cf_add_0lib; do
16287 for cf_add_2lib in $cf_add_libs; do
16288 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
Steve Kondikae271bc2015-11-15 02:50:53 +010016289 cf_add_1lib=
16290 break
16291 fi
16292 done
micky3879b9f5e72025-07-08 18:04:53 -040016293 test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
Steve Kondikae271bc2015-11-15 02:50:53 +010016294done
16295LIBS="$cf_add_libs"
16296
micky3879b9f5e72025-07-08 18:04:53 -040016297 echo "$as_me:16297: checking for $cf_test in $cf_libs" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010016298echo $ECHO_N "checking for $cf_test in $cf_libs... $ECHO_C" >&6
micky3879b9f5e72025-07-08 18:04:53 -040016299 cat >"conftest.$ac_ext" <<_ACEOF
16300#line 16300 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +010016301#include "confdefs.h"
16302
micky3879b9f5e72025-07-08 18:04:53 -040016303$ac_includes_default
Steve Kondikae271bc2015-11-15 02:50:53 +010016304#include <X11/Intrinsic.h>
16305#include <X11/$cf_x_athena_root/SimpleMenu.h>
16306
16307int
micky3879b9f5e72025-07-08 18:04:53 -040016308main (void)
Steve Kondikae271bc2015-11-15 02:50:53 +010016309{
16310
16311$cf_test((XtAppContext) 0)
16312 ;
16313 return 0;
16314}
16315_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -040016316rm -f "conftest.$ac_objext" "conftest$ac_exeext"
16317if { (eval echo "$as_me:16317: \"$ac_link\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010016318 (eval $ac_link) 2>&5
16319 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040016320 echo "$as_me:16320: \$? = $ac_status" >&5
16321 (exit "$ac_status"); } &&
16322 { ac_try='test -s "conftest$ac_exeext"'
16323 { (eval echo "$as_me:16323: \"$ac_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010016324 (eval $ac_try) 2>&5
16325 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040016326 echo "$as_me:16326: \$? = $ac_status" >&5
16327 (exit "$ac_status"); }; }; then
Steve Kondikae271bc2015-11-15 02:50:53 +010016328 cf_result=yes
16329else
16330 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -040016331cat "conftest.$ac_ext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010016332cf_result=no
16333fi
micky3879b9f5e72025-07-08 18:04:53 -040016334rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
16335 echo "$as_me:16335: result: $cf_result" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010016336echo "${ECHO_T}$cf_result" >&6
micky3879b9f5e72025-07-08 18:04:53 -040016337
16338LIBS="$cf_save_LIBS_CF_X_ATHENA_LIBS"
16339CFLAGS="$cf_save_CFLAGS_CF_X_ATHENA_LIBS"
16340CPPFLAGS="$cf_save_CPPFLAGS_CF_X_ATHENA_LIBS"
16341
16342 if test "$cf_result" = yes ; then
16343 cf_x_athena_lib="$cf_libs"
16344 break
Steve Kondikae271bc2015-11-15 02:50:53 +010016345 fi
16346 done # cf_libs
16347 test -n "$cf_x_athena_lib" && break
16348 done # cf_lib
16349done
16350
16351if test -z "$cf_x_athena_lib" ; then
micky3879b9f5e72025-07-08 18:04:53 -040016352 { { echo "$as_me:16352: error: Unable to successfully link Athena library (-l$cf_x_athena_root) with test program" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010016353echo "$as_me: error: Unable to successfully link Athena library (-l$cf_x_athena_root) with test program" >&2;}
16354 { (exit 1); exit 1; }; }
16355fi
16356
micky3879b9f5e72025-07-08 18:04:53 -040016357cf_add_libs="$LIBS"
16358# reverse order
16359cf_add_0lib=
16360for cf_add_1lib in $cf_x_athena_lib; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
16361# filter duplicates
16362for cf_add_1lib in $cf_add_0lib; do
16363 for cf_add_2lib in $cf_add_libs; do
16364 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
16365 cf_add_1lib=
16366 break
16367 fi
16368 done
16369 test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
16370done
16371LIBS="$cf_add_libs"
16372
Steve Kondikae271bc2015-11-15 02:50:53 +010016373cf_x_athena_LIBS=`echo "HAVE_LIB_$cf_x_athena" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
16374
16375cat >>confdefs.h <<EOF
16376#define $cf_x_athena_LIBS 1
16377EOF
16378
16379fi
16380
16381if test -n "$ac_tool_prefix"; then
16382 for ac_prog in xcurses-config
16383 do
16384 # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
16385set dummy $ac_tool_prefix$ac_prog; ac_word=$2
micky3879b9f5e72025-07-08 18:04:53 -040016386echo "$as_me:16386: checking for $ac_word" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010016387echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
16388if test "${ac_cv_prog_XCURSES_CONFIG+set}" = set; then
16389 echo $ECHO_N "(cached) $ECHO_C" >&6
16390else
16391 if test -n "$XCURSES_CONFIG"; then
16392 ac_cv_prog_XCURSES_CONFIG="$XCURSES_CONFIG" # Let the user override the test.
16393else
16394 ac_save_IFS=$IFS; IFS=$ac_path_separator
16395ac_dummy="$PATH"
16396for ac_dir in $ac_dummy; do
16397 IFS=$ac_save_IFS
16398 test -z "$ac_dir" && ac_dir=.
16399 $as_executable_p "$ac_dir/$ac_word" || continue
16400ac_cv_prog_XCURSES_CONFIG="$ac_tool_prefix$ac_prog"
micky3879b9f5e72025-07-08 18:04:53 -040016401echo "$as_me:16401: found $ac_dir/$ac_word" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010016402break
16403done
16404
16405fi
16406fi
16407XCURSES_CONFIG=$ac_cv_prog_XCURSES_CONFIG
16408if test -n "$XCURSES_CONFIG"; then
micky3879b9f5e72025-07-08 18:04:53 -040016409 echo "$as_me:16409: result: $XCURSES_CONFIG" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010016410echo "${ECHO_T}$XCURSES_CONFIG" >&6
16411else
micky3879b9f5e72025-07-08 18:04:53 -040016412 echo "$as_me:16412: result: no" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010016413echo "${ECHO_T}no" >&6
16414fi
16415
16416 test -n "$XCURSES_CONFIG" && break
16417 done
16418fi
16419if test -z "$XCURSES_CONFIG"; then
16420 ac_ct_XCURSES_CONFIG=$XCURSES_CONFIG
16421 for ac_prog in xcurses-config
16422do
16423 # Extract the first word of "$ac_prog", so it can be a program name with args.
16424set dummy $ac_prog; ac_word=$2
micky3879b9f5e72025-07-08 18:04:53 -040016425echo "$as_me:16425: checking for $ac_word" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010016426echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
16427if test "${ac_cv_prog_ac_ct_XCURSES_CONFIG+set}" = set; then
16428 echo $ECHO_N "(cached) $ECHO_C" >&6
16429else
16430 if test -n "$ac_ct_XCURSES_CONFIG"; then
16431 ac_cv_prog_ac_ct_XCURSES_CONFIG="$ac_ct_XCURSES_CONFIG" # Let the user override the test.
16432else
16433 ac_save_IFS=$IFS; IFS=$ac_path_separator
16434ac_dummy="$PATH"
16435for ac_dir in $ac_dummy; do
16436 IFS=$ac_save_IFS
16437 test -z "$ac_dir" && ac_dir=.
16438 $as_executable_p "$ac_dir/$ac_word" || continue
16439ac_cv_prog_ac_ct_XCURSES_CONFIG="$ac_prog"
micky3879b9f5e72025-07-08 18:04:53 -040016440echo "$as_me:16440: found $ac_dir/$ac_word" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010016441break
16442done
16443
16444fi
16445fi
16446ac_ct_XCURSES_CONFIG=$ac_cv_prog_ac_ct_XCURSES_CONFIG
16447if test -n "$ac_ct_XCURSES_CONFIG"; then
micky3879b9f5e72025-07-08 18:04:53 -040016448 echo "$as_me:16448: result: $ac_ct_XCURSES_CONFIG" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010016449echo "${ECHO_T}$ac_ct_XCURSES_CONFIG" >&6
16450else
micky3879b9f5e72025-07-08 18:04:53 -040016451 echo "$as_me:16451: result: no" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010016452echo "${ECHO_T}no" >&6
16453fi
16454
16455 test -n "$ac_ct_XCURSES_CONFIG" && break
16456done
16457test -n "$ac_ct_XCURSES_CONFIG" || ac_ct_XCURSES_CONFIG="none"
16458
16459 XCURSES_CONFIG=$ac_ct_XCURSES_CONFIG
16460fi
16461
16462if test "$XCURSES_CONFIG" != none ; then
16463
micky3879b9f5e72025-07-08 18:04:53 -040016464cf_fix_cppflags=no
16465cf_new_cflags=
16466cf_new_cppflags=
16467cf_new_extra_cppflags=
Steve Kondikae271bc2015-11-15 02:50:53 +010016468
micky3879b9f5e72025-07-08 18:04:53 -040016469for cf_add_cflags in `$XCURSES_CONFIG --cflags`
Steve Kondikae271bc2015-11-15 02:50:53 +010016470do
micky3879b9f5e72025-07-08 18:04:53 -040016471case "$cf_fix_cppflags" in
16472(no)
16473 case "$cf_add_cflags" in
16474 (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
16475 case "$cf_add_cflags" in
16476 (-D*)
16477 cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
16478
16479 test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
16480 && test -z "${cf_tst_cflags}" \
16481 && cf_fix_cppflags=yes
16482
16483 if test "$cf_fix_cppflags" = yes ; then
16484
16485 test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
16486 cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
16487
16488 continue
16489 elif test "${cf_tst_cflags}" = "\"'" ; then
16490
16491 test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
16492 cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
16493
16494 continue
16495 fi
16496 ;;
16497 esac
16498 case "$CPPFLAGS" in
16499 (*$cf_add_cflags)
16500 ;;
16501 (*)
16502 case "$cf_add_cflags" in
16503 (-D*)
16504 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
16505
16506CPPFLAGS=`echo "$CPPFLAGS" | \
16507 sed -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?[ ]/ /g' \
16508 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?$//g'`
16509
16510 ;;
16511 esac
16512
16513 test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
16514 cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
16515
16516 ;;
16517 esac
16518 ;;
16519 (*)
16520
16521 test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
16522 cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
16523
16524 ;;
16525 esac
16526 ;;
16527(yes)
16528
16529 test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
16530 cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
16531
16532 cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
16533
16534 test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
16535 && test -z "${cf_tst_cflags}" \
16536 && cf_fix_cppflags=no
16537 ;;
16538esac
16539done
16540
16541if test -n "$cf_new_cflags" ; then
16542
16543 test -n "$CFLAGS" && CFLAGS="$CFLAGS "
16544 CFLAGS="${CFLAGS}$cf_new_cflags"
16545
16546fi
16547
16548if test -n "$cf_new_cppflags" ; then
16549
16550 test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
16551 CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
16552
16553fi
16554
16555if test -n "$cf_new_extra_cppflags" ; then
16556
16557 test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
16558 EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
16559
16560fi
16561
16562cf_add_libs="$LIBS"
16563# reverse order
16564cf_add_0lib=
16565for cf_add_1lib in `$XCURSES_CONFIG --libs`; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
16566# filter duplicates
16567for cf_add_1lib in $cf_add_0lib; do
16568 for cf_add_2lib in $cf_add_libs; do
16569 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
Steve Kondikae271bc2015-11-15 02:50:53 +010016570 cf_add_1lib=
16571 break
16572 fi
16573 done
micky3879b9f5e72025-07-08 18:04:53 -040016574 test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
Steve Kondikae271bc2015-11-15 02:50:53 +010016575done
16576LIBS="$cf_add_libs"
16577
16578cf_cv_lib_XCurses=yes
16579
16580else
16581
16582LDFLAGS="$LDFLAGS $X_LIBS"
16583
16584test -n "$verbose" && echo " checking additions to CFLAGS" 1>&6
16585
micky3879b9f5e72025-07-08 18:04:53 -040016586echo "${as_me:-configure}:16586: testing checking additions to CFLAGS ..." 1>&5
Steve Kondikae271bc2015-11-15 02:50:53 +010016587
16588cf_check_cflags="$CFLAGS"
16589cf_check_cppflags="$CPPFLAGS"
16590
16591cf_fix_cppflags=no
16592cf_new_cflags=
16593cf_new_cppflags=
16594cf_new_extra_cppflags=
16595
16596for cf_add_cflags in $X_CFLAGS
16597do
micky3879b9f5e72025-07-08 18:04:53 -040016598case "$cf_fix_cppflags" in
Steve Kondikae271bc2015-11-15 02:50:53 +010016599(no)
micky3879b9f5e72025-07-08 18:04:53 -040016600 case "$cf_add_cflags" in
Steve Kondikae271bc2015-11-15 02:50:53 +010016601 (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
micky3879b9f5e72025-07-08 18:04:53 -040016602 case "$cf_add_cflags" in
Steve Kondikae271bc2015-11-15 02:50:53 +010016603 (-D*)
micky3879b9f5e72025-07-08 18:04:53 -040016604 cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
Steve Kondikae271bc2015-11-15 02:50:53 +010016605
16606 test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
16607 && test -z "${cf_tst_cflags}" \
16608 && cf_fix_cppflags=yes
16609
micky3879b9f5e72025-07-08 18:04:53 -040016610 if test "$cf_fix_cppflags" = yes ; then
16611
16612 test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
16613 cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
16614
Steve Kondikae271bc2015-11-15 02:50:53 +010016615 continue
16616 elif test "${cf_tst_cflags}" = "\"'" ; then
micky3879b9f5e72025-07-08 18:04:53 -040016617
16618 test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
16619 cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
16620
Steve Kondikae271bc2015-11-15 02:50:53 +010016621 continue
16622 fi
16623 ;;
16624 esac
16625 case "$CPPFLAGS" in
16626 (*$cf_add_cflags)
16627 ;;
16628 (*)
micky3879b9f5e72025-07-08 18:04:53 -040016629 case "$cf_add_cflags" in
Steve Kondikae271bc2015-11-15 02:50:53 +010016630 (-D*)
16631 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
16632
16633CPPFLAGS=`echo "$CPPFLAGS" | \
16634 sed -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?[ ]/ /g' \
16635 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?$//g'`
16636
16637 ;;
16638 esac
micky3879b9f5e72025-07-08 18:04:53 -040016639
16640 test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
16641 cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
16642
Steve Kondikae271bc2015-11-15 02:50:53 +010016643 ;;
16644 esac
16645 ;;
16646 (*)
micky3879b9f5e72025-07-08 18:04:53 -040016647
16648 test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
16649 cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
16650
Steve Kondikae271bc2015-11-15 02:50:53 +010016651 ;;
16652 esac
16653 ;;
16654(yes)
Steve Kondikae271bc2015-11-15 02:50:53 +010016655
micky3879b9f5e72025-07-08 18:04:53 -040016656 test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
16657 cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
16658
16659 cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
Steve Kondikae271bc2015-11-15 02:50:53 +010016660
16661 test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
16662 && test -z "${cf_tst_cflags}" \
16663 && cf_fix_cppflags=no
16664 ;;
16665esac
16666done
16667
16668if test -n "$cf_new_cflags" ; then
16669 test -n "$verbose" && echo " add to \$CFLAGS $cf_new_cflags" 1>&6
16670
micky3879b9f5e72025-07-08 18:04:53 -040016671echo "${as_me:-configure}:16671: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
Steve Kondikae271bc2015-11-15 02:50:53 +010016672
micky3879b9f5e72025-07-08 18:04:53 -040016673 test -n "$CFLAGS" && CFLAGS="$CFLAGS "
16674 CFLAGS="${CFLAGS}$cf_new_cflags"
16675
Steve Kondikae271bc2015-11-15 02:50:53 +010016676fi
16677
16678if test -n "$cf_new_cppflags" ; then
16679 test -n "$verbose" && echo " add to \$CPPFLAGS $cf_new_cppflags" 1>&6
16680
micky3879b9f5e72025-07-08 18:04:53 -040016681echo "${as_me:-configure}:16681: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
Steve Kondikae271bc2015-11-15 02:50:53 +010016682
micky3879b9f5e72025-07-08 18:04:53 -040016683 test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
16684 CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
16685
Steve Kondikae271bc2015-11-15 02:50:53 +010016686fi
16687
16688if test -n "$cf_new_extra_cppflags" ; then
16689 test -n "$verbose" && echo " add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6
16690
micky3879b9f5e72025-07-08 18:04:53 -040016691echo "${as_me:-configure}:16691: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
Steve Kondikae271bc2015-11-15 02:50:53 +010016692
micky3879b9f5e72025-07-08 18:04:53 -040016693 test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
16694 EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
16695
Steve Kondikae271bc2015-11-15 02:50:53 +010016696fi
16697
16698if test "x$cf_check_cflags" != "x$CFLAGS" ; then
micky3879b9f5e72025-07-08 18:04:53 -040016699cat >"conftest.$ac_ext" <<_ACEOF
16700#line 16700 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +010016701#include "confdefs.h"
16702#include <stdio.h>
16703int
micky3879b9f5e72025-07-08 18:04:53 -040016704main (void)
Steve Kondikae271bc2015-11-15 02:50:53 +010016705{
16706printf("Hello world");
16707 ;
16708 return 0;
16709}
16710_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -040016711rm -f "conftest.$ac_objext" "conftest$ac_exeext"
16712if { (eval echo "$as_me:16712: \"$ac_link\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010016713 (eval $ac_link) 2>&5
16714 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040016715 echo "$as_me:16715: \$? = $ac_status" >&5
16716 (exit "$ac_status"); } &&
16717 { ac_try='test -s "conftest$ac_exeext"'
16718 { (eval echo "$as_me:16718: \"$ac_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010016719 (eval $ac_try) 2>&5
16720 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040016721 echo "$as_me:16721: \$? = $ac_status" >&5
16722 (exit "$ac_status"); }; }; then
Steve Kondikae271bc2015-11-15 02:50:53 +010016723 :
16724else
16725 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -040016726cat "conftest.$ac_ext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010016727test -n "$verbose" && echo " test-compile failed. Undoing change to \$CFLAGS" 1>&6
16728
micky3879b9f5e72025-07-08 18:04:53 -040016729echo "${as_me:-configure}:16729: testing test-compile failed. Undoing change to \$CFLAGS ..." 1>&5
Steve Kondikae271bc2015-11-15 02:50:53 +010016730
16731 if test "x$cf_check_cppflags" != "x$CPPFLAGS" ; then
16732 test -n "$verbose" && echo " but keeping change to \$CPPFLAGS" 1>&6
16733
micky3879b9f5e72025-07-08 18:04:53 -040016734echo "${as_me:-configure}:16734: testing but keeping change to \$CPPFLAGS ..." 1>&5
Steve Kondikae271bc2015-11-15 02:50:53 +010016735
16736 fi
micky3879b9f5e72025-07-08 18:04:53 -040016737 CFLAGS="$cf_check_cflags"
Steve Kondikae271bc2015-11-15 02:50:53 +010016738fi
micky3879b9f5e72025-07-08 18:04:53 -040016739rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
Steve Kondikae271bc2015-11-15 02:50:53 +010016740fi
16741
micky3879b9f5e72025-07-08 18:04:53 -040016742echo "$as_me:16742: checking for XOpenDisplay in -lX11" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010016743echo $ECHO_N "checking for XOpenDisplay in -lX11... $ECHO_C" >&6
16744if test "${ac_cv_lib_X11_XOpenDisplay+set}" = set; then
16745 echo $ECHO_N "(cached) $ECHO_C" >&6
16746else
16747 ac_check_lib_save_LIBS=$LIBS
16748LIBS="-lX11 $X_PRE_LIBS $LIBS $X_EXTRA_LIBS $LIBS"
micky3879b9f5e72025-07-08 18:04:53 -040016749cat >"conftest.$ac_ext" <<_ACEOF
16750#line 16750 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +010016751#include "confdefs.h"
16752
16753/* Override any gcc2 internal prototype to avoid an error. */
16754#ifdef __cplusplus
16755extern "C"
16756#endif
16757/* We use char because int might match the return type of a gcc2
16758 builtin and then its argument prototype would still apply. */
micky3879b9f5e72025-07-08 18:04:53 -040016759char XOpenDisplay (void);
Steve Kondikae271bc2015-11-15 02:50:53 +010016760int
micky3879b9f5e72025-07-08 18:04:53 -040016761main (void)
Steve Kondikae271bc2015-11-15 02:50:53 +010016762{
16763XOpenDisplay ();
16764 ;
16765 return 0;
16766}
16767_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -040016768rm -f "conftest.$ac_objext" "conftest$ac_exeext"
16769if { (eval echo "$as_me:16769: \"$ac_link\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010016770 (eval $ac_link) 2>&5
16771 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040016772 echo "$as_me:16772: \$? = $ac_status" >&5
16773 (exit "$ac_status"); } &&
16774 { ac_try='test -s "conftest$ac_exeext"'
16775 { (eval echo "$as_me:16775: \"$ac_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010016776 (eval $ac_try) 2>&5
16777 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040016778 echo "$as_me:16778: \$? = $ac_status" >&5
16779 (exit "$ac_status"); }; }; then
Steve Kondikae271bc2015-11-15 02:50:53 +010016780 ac_cv_lib_X11_XOpenDisplay=yes
16781else
16782 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -040016783cat "conftest.$ac_ext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010016784ac_cv_lib_X11_XOpenDisplay=no
16785fi
micky3879b9f5e72025-07-08 18:04:53 -040016786rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
Steve Kondikae271bc2015-11-15 02:50:53 +010016787LIBS=$ac_check_lib_save_LIBS
16788fi
micky3879b9f5e72025-07-08 18:04:53 -040016789echo "$as_me:16789: result: $ac_cv_lib_X11_XOpenDisplay" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010016790echo "${ECHO_T}$ac_cv_lib_X11_XOpenDisplay" >&6
micky3879b9f5e72025-07-08 18:04:53 -040016791if test "$ac_cv_lib_X11_XOpenDisplay" = yes; then
Steve Kondikae271bc2015-11-15 02:50:53 +010016792
micky3879b9f5e72025-07-08 18:04:53 -040016793cf_add_libs="$LIBS"
16794# reverse order
16795cf_add_0lib=
16796for cf_add_1lib in -lX11; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
16797# filter duplicates
16798for cf_add_1lib in $cf_add_0lib; do
16799 for cf_add_2lib in $cf_add_libs; do
16800 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
Steve Kondikae271bc2015-11-15 02:50:53 +010016801 cf_add_1lib=
16802 break
16803 fi
16804 done
micky3879b9f5e72025-07-08 18:04:53 -040016805 test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
Steve Kondikae271bc2015-11-15 02:50:53 +010016806done
16807LIBS="$cf_add_libs"
16808
16809fi
16810
micky3879b9f5e72025-07-08 18:04:53 -040016811echo "$as_me:16811: checking for XCurses library" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010016812echo $ECHO_N "checking for XCurses library... $ECHO_C" >&6
16813if test "${cf_cv_lib_XCurses+set}" = set; then
16814 echo $ECHO_N "(cached) $ECHO_C" >&6
16815else
16816
micky3879b9f5e72025-07-08 18:04:53 -040016817cf_add_libs="$LIBS"
16818# reverse order
16819cf_add_0lib=
16820for cf_add_1lib in -lXCurses; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
16821# filter duplicates
16822for cf_add_1lib in $cf_add_0lib; do
16823 for cf_add_2lib in $cf_add_libs; do
16824 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
Steve Kondikae271bc2015-11-15 02:50:53 +010016825 cf_add_1lib=
16826 break
16827 fi
16828 done
micky3879b9f5e72025-07-08 18:04:53 -040016829 test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
Steve Kondikae271bc2015-11-15 02:50:53 +010016830done
16831LIBS="$cf_add_libs"
16832
micky3879b9f5e72025-07-08 18:04:53 -040016833cat >"conftest.$ac_ext" <<_ACEOF
16834#line 16834 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +010016835#include "confdefs.h"
16836
16837#include <xcurses.h>
16838char *XCursesProgramName = "test";
16839
16840int
micky3879b9f5e72025-07-08 18:04:53 -040016841main (void)
Steve Kondikae271bc2015-11-15 02:50:53 +010016842{
16843XCursesExit();
16844 ;
16845 return 0;
16846}
16847_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -040016848rm -f "conftest.$ac_objext" "conftest$ac_exeext"
16849if { (eval echo "$as_me:16849: \"$ac_link\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010016850 (eval $ac_link) 2>&5
16851 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040016852 echo "$as_me:16852: \$? = $ac_status" >&5
16853 (exit "$ac_status"); } &&
16854 { ac_try='test -s "conftest$ac_exeext"'
16855 { (eval echo "$as_me:16855: \"$ac_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010016856 (eval $ac_try) 2>&5
16857 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040016858 echo "$as_me:16858: \$? = $ac_status" >&5
16859 (exit "$ac_status"); }; }; then
Steve Kondikae271bc2015-11-15 02:50:53 +010016860 cf_cv_lib_XCurses=yes
16861else
16862 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -040016863cat "conftest.$ac_ext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010016864cf_cv_lib_XCurses=no
16865fi
micky3879b9f5e72025-07-08 18:04:53 -040016866rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
Steve Kondikae271bc2015-11-15 02:50:53 +010016867
16868fi
micky3879b9f5e72025-07-08 18:04:53 -040016869echo "$as_me:16869: result: $cf_cv_lib_XCurses" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010016870echo "${ECHO_T}$cf_cv_lib_XCurses" >&6
16871
16872fi
16873
micky3879b9f5e72025-07-08 18:04:53 -040016874if test "$cf_cv_lib_XCurses" = yes ; then
Steve Kondikae271bc2015-11-15 02:50:53 +010016875
16876cat >>confdefs.h <<\EOF
16877#define UNIX 1
16878EOF
16879
16880cat >>confdefs.h <<\EOF
16881#define XCURSES 1
16882EOF
16883
micky3879b9f5e72025-07-08 18:04:53 -040016884 echo "$as_me:16884: checking for xcurses.h" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010016885echo $ECHO_N "checking for xcurses.h... $ECHO_C" >&6
16886if test "${ac_cv_header_xcurses_h+set}" = set; then
16887 echo $ECHO_N "(cached) $ECHO_C" >&6
16888else
micky3879b9f5e72025-07-08 18:04:53 -040016889 cat >"conftest.$ac_ext" <<_ACEOF
16890#line 16890 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +010016891#include "confdefs.h"
16892#include <xcurses.h>
16893_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -040016894if { (eval echo "$as_me:16894: \"$ac_cpp "conftest.$ac_ext"\"") >&5
16895 (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
Steve Kondikae271bc2015-11-15 02:50:53 +010016896 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040016897 $EGREP -v '^ *\+' conftest.er1 >conftest.err
Steve Kondikae271bc2015-11-15 02:50:53 +010016898 rm -f conftest.er1
16899 cat conftest.err >&5
micky3879b9f5e72025-07-08 18:04:53 -040016900 echo "$as_me:16900: \$? = $ac_status" >&5
16901 (exit "$ac_status"); } >/dev/null; then
Steve Kondikae271bc2015-11-15 02:50:53 +010016902 if test -s conftest.err; then
16903 ac_cpp_err=$ac_c_preproc_warn_flag
16904 else
16905 ac_cpp_err=
16906 fi
16907else
16908 ac_cpp_err=yes
16909fi
16910if test -z "$ac_cpp_err"; then
16911 ac_cv_header_xcurses_h=yes
16912else
16913 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -040016914 cat "conftest.$ac_ext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010016915 ac_cv_header_xcurses_h=no
16916fi
micky3879b9f5e72025-07-08 18:04:53 -040016917rm -f conftest.err "conftest.$ac_ext"
Steve Kondikae271bc2015-11-15 02:50:53 +010016918fi
micky3879b9f5e72025-07-08 18:04:53 -040016919echo "$as_me:16919: result: $ac_cv_header_xcurses_h" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010016920echo "${ECHO_T}$ac_cv_header_xcurses_h" >&6
micky3879b9f5e72025-07-08 18:04:53 -040016921if test "$ac_cv_header_xcurses_h" = yes; then
Steve Kondikae271bc2015-11-15 02:50:53 +010016922
16923cat >>confdefs.h <<\EOF
16924#define HAVE_XCURSES 1
16925EOF
16926
16927fi
16928
16929else
micky3879b9f5e72025-07-08 18:04:53 -040016930 { { echo "$as_me:16930: error: Cannot link with XCurses" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010016931echo "$as_me: error: Cannot link with XCurses" >&2;}
16932 { (exit 1); exit 1; }; }
16933fi
16934
16935 ;;
16936(*)
micky3879b9f5e72025-07-08 18:04:53 -040016937 { { echo "$as_me:16937: error: unexpected screen-value: $cf_cv_screen" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010016938echo "$as_me: error: unexpected screen-value: $cf_cv_screen" >&2;}
16939 { (exit 1); exit 1; }; }
16940 ;;
16941esac
16942
micky3879b9f5e72025-07-08 18:04:53 -040016943: ${cf_nculib_root:=$cf_cv_screen}
16944as_ac_Lib=`echo "ac_cv_lib_$cf_nculib_root''__nc_init_pthreads" | $as_tr_sh`
16945echo "$as_me:16945: checking for _nc_init_pthreads in -l$cf_nculib_root" >&5
16946echo $ECHO_N "checking for _nc_init_pthreads in -l$cf_nculib_root... $ECHO_C" >&6
16947if eval "test \"\${$as_ac_Lib+set}\" = set"; then
16948 echo $ECHO_N "(cached) $ECHO_C" >&6
16949else
16950 ac_check_lib_save_LIBS=$LIBS
16951LIBS="-l$cf_nculib_root $LIBS"
16952cat >"conftest.$ac_ext" <<_ACEOF
16953#line 16953 "configure"
16954#include "confdefs.h"
16955
16956/* Override any gcc2 internal prototype to avoid an error. */
16957#ifdef __cplusplus
16958extern "C"
16959#endif
16960/* We use char because int might match the return type of a gcc2
16961 builtin and then its argument prototype would still apply. */
16962char _nc_init_pthreads (void);
16963int
16964main (void)
16965{
16966_nc_init_pthreads ();
16967 ;
16968 return 0;
16969}
16970_ACEOF
16971rm -f "conftest.$ac_objext" "conftest$ac_exeext"
16972if { (eval echo "$as_me:16972: \"$ac_link\"") >&5
16973 (eval $ac_link) 2>&5
16974 ac_status=$?
16975 echo "$as_me:16975: \$? = $ac_status" >&5
16976 (exit "$ac_status"); } &&
16977 { ac_try='test -s "conftest$ac_exeext"'
16978 { (eval echo "$as_me:16978: \"$ac_try\"") >&5
16979 (eval $ac_try) 2>&5
16980 ac_status=$?
16981 echo "$as_me:16981: \$? = $ac_status" >&5
16982 (exit "$ac_status"); }; }; then
16983 eval "$as_ac_Lib=yes"
16984else
16985 echo "$as_me: failed program was:" >&5
16986cat "conftest.$ac_ext" >&5
16987eval "$as_ac_Lib=no"
16988fi
16989rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
16990LIBS=$ac_check_lib_save_LIBS
16991fi
16992echo "$as_me:16992: result: `eval echo '${'"$as_ac_Lib"'}'`" >&5
16993echo "${ECHO_T}`eval echo '${'"$as_ac_Lib"'}'`" >&6
16994if test "`eval echo '${'"$as_ac_Lib"'}'`" = yes; then
16995 cf_cv_ncurses_pthreads=yes
16996else
16997 cf_cv_ncurses_pthreads=no
16998fi
16999
17000if test "$cf_cv_ncurses_pthreads" = yes
17001then
17002
17003cf_add_libs="$LIBS"
17004# reverse order
17005cf_add_0lib=
17006for cf_add_1lib in -lpthread; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
17007# filter duplicates
17008for cf_add_1lib in $cf_add_0lib; do
17009 for cf_add_2lib in $cf_add_libs; do
17010 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
17011 cf_add_1lib=
17012 break
17013 fi
17014 done
17015 test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
17016done
17017LIBS="$cf_add_libs"
17018
17019fi
17020
Steve Kondikae271bc2015-11-15 02:50:53 +010017021case $cf_cv_screen in
17022(ncurses*)
17023 cf_cv_libtype=`echo "$cf_cv_screen" | sed -e 's/^ncurses//'`
17024 ;;
micky3879b9f5e72025-07-08 18:04:53 -040017025esac
Steve Kondikae271bc2015-11-15 02:50:53 +010017026
micky3879b9f5e72025-07-08 18:04:53 -040017027echo "$as_me:17027: checking for X11 rgb file" >&5
17028echo $ECHO_N "checking for X11 rgb file... $ECHO_C" >&6
17029
17030# Check whether --with-x11-rgb or --without-x11-rgb was given.
17031if test "${with_x11_rgb+set}" = set; then
17032 withval="$with_x11_rgb"
17033 RGB_PATH=$withval
17034else
17035 RGB_PATH=auto
17036fi;
17037
17038if test "x$RGB_PATH" = xauto
17039then
17040 RGB_PATH='${exec_prefix}/lib/X11/rgb.txt'
17041 for cf_path in \
17042 /opt/local/share/X11/rgb.txt \
17043 /opt/X11/share/X11/rgb.txt \
17044 /usr/share/X11/rgb.txt \
17045 /usr/X11/share/X11/rgb.txt \
17046 /usr/X11/lib/X11/rgb.txt \
17047 /usr/lib/X11/rgb.txt \
17048 /etc/X11/rgb.txt \
17049 /usr/pkg/lib/X11/rgb.txt \
17050 /usr/X11R7/lib/X11/rgb.txt \
17051 /usr/X11R6/lib/X11/rgb.txt \
17052 /usr/X11R5/lib/X11/rgb.txt \
17053 /usr/X11R4/lib/X11/rgb.txt \
17054 /usr/local/lib/X11/rgb.txt \
17055 /usr/local/share/X11/rgb.txt \
17056 /usr/lib64/X11/rgb.txt
17057 do
17058 if test -f "$cf_path" ; then
17059 RGB_PATH="$cf_path"
17060 break
17061 fi
17062 done
17063else
17064 cf_path=$RGB_PATH
17065
17066if test "x$prefix" != xNONE; then
17067 cf_path_syntax="$prefix"
17068else
17069 cf_path_syntax="$ac_default_prefix"
17070fi
17071
17072case ".$cf_path" in
17073(.\$\(*\)*|.\'*\'*)
17074 ;;
17075(..|./*|.\\*)
17076 ;;
17077(.[a-zA-Z]:[\\/]*) # OS/2 EMX
17078 ;;
17079(.\$\{*prefix\}*|.\$\{*dir\}*)
17080 eval cf_path="$cf_path"
17081 case ".$cf_path" in
17082 (.NONE/*)
17083 cf_path=`echo "$cf_path" | sed -e s%NONE%$cf_path_syntax%`
17084 ;;
17085 esac
17086 ;;
17087(.no|.NONE/*)
17088 cf_path=`echo "$cf_path" | sed -e s%NONE%$cf_path_syntax%`
17089 ;;
17090(*)
17091 { { echo "$as_me:17091: error: expected a pathname, not \"$cf_path\"" >&5
17092echo "$as_me: error: expected a pathname, not \"$cf_path\"" >&2;}
17093 { (exit 1); exit 1; }; }
17094 ;;
17095esac
17096
17097fi
17098
17099echo "$as_me:17099: result: $RGB_PATH" >&5
17100echo "${ECHO_T}$RGB_PATH" >&6
17101
17102cat >>confdefs.h <<EOF
17103#define RGB_PATH "$cf_path"
17104EOF
17105
17106no_x11_rgb=
17107if test "$RGB_PATH" = no
17108then
17109 no_x11_rgb="#"
17110fi
17111
17112cf_curses_headers=
17113
17114case $cf_cv_screen in
17115(pdcurses)
17116 cf_default_panel=no
17117 cf_default_form=no
17118 cf_default_menu=no
17119 cf_default_tinfo=no
17120 ;;
17121(xcurses|bsdcurses)
17122 cf_default_panel=no
17123 cf_default_form=no
17124 cf_default_menu=no
17125 cf_default_tinfo=yes
17126 ;;
17127(*)
17128 cf_default_panel=yes
17129 cf_default_form=yes
17130 cf_default_menu=yes
17131 cf_default_tinfo=yes
17132 case $cf_cv_screen in
17133 (ncurses*)
17134 cf_curses_headers="nc_alloc.h nomacros.h term_entry.h"
17135 ;;
17136 esac
17137 ;;
17138esac
17139
17140echo "$as_me:17140: checking for desired basename for form library" >&5
17141echo $ECHO_N "checking for desired basename for form library... $ECHO_C" >&6
17142
17143# Check whether --with-form-libname or --without-form-libname was given.
17144if test "${with_form_libname+set}" = set; then
17145 withval="$with_form_libname"
17146 with_lib_basename=$withval
17147else
17148 with_lib_basename=form
17149fi;
17150FORM_NAME="$with_lib_basename"
17151
17152case "x$FORM_NAME" in
17153(x|xno|xnone|xyes)
17154 FORM_NAME=form
17155 ;;
17156(*)
17157 ;;
17158esac
17159
17160echo "$as_me:17160: result: $FORM_NAME" >&5
17161echo "${ECHO_T}$FORM_NAME" >&6
17162
17163echo "$as_me:17163: checking for desired basename for menu library" >&5
17164echo $ECHO_N "checking for desired basename for menu library... $ECHO_C" >&6
17165
17166# Check whether --with-menu-libname or --without-menu-libname was given.
17167if test "${with_menu_libname+set}" = set; then
17168 withval="$with_menu_libname"
17169 with_lib_basename=$withval
17170else
17171 with_lib_basename=menu
17172fi;
17173MENU_NAME="$with_lib_basename"
17174
17175case "x$MENU_NAME" in
17176(x|xno|xnone|xyes)
17177 MENU_NAME=menu
17178 ;;
17179(*)
17180 ;;
17181esac
17182
17183echo "$as_me:17183: result: $MENU_NAME" >&5
17184echo "${ECHO_T}$MENU_NAME" >&6
17185
17186echo "$as_me:17186: checking for desired basename for panel library" >&5
17187echo $ECHO_N "checking for desired basename for panel library... $ECHO_C" >&6
17188
17189# Check whether --with-panel-libname or --without-panel-libname was given.
17190if test "${with_panel_libname+set}" = set; then
17191 withval="$with_panel_libname"
17192 with_lib_basename=$withval
17193else
17194 with_lib_basename=panel
17195fi;
17196PANEL_NAME="$with_lib_basename"
17197
17198case "x$PANEL_NAME" in
17199(x|xno|xnone|xyes)
17200 PANEL_NAME=panel
17201 ;;
17202(*)
17203 ;;
17204esac
17205
17206echo "$as_me:17206: result: $PANEL_NAME" >&5
17207echo "${ECHO_T}$PANEL_NAME" >&6
17208
17209echo "$as_me:17209: checking if you want to check for panel functions" >&5
17210echo $ECHO_N "checking if you want to check for panel functions... $ECHO_C" >&6
17211
17212# Check whether --enable-panel or --disable-panel was given.
17213if test "${enable_panel+set}" = set; then
17214 enableval="$enable_panel"
17215 test "$enableval" != no && enableval=yes
17216 if test "$enableval" != "yes" ; then
17217 cf_enable_panel=no
17218 else
17219 cf_enable_panel=$cf_default_panel
17220 fi
17221else
17222 enableval=yes
17223 cf_enable_panel=$cf_default_panel
17224
17225fi;
17226echo "$as_me:17226: result: $cf_enable_panel" >&5
17227echo "${ECHO_T}$cf_enable_panel" >&6
17228if test $cf_enable_panel = yes
17229then
17230
17231cf_have_curses_lib=no
17232
17233: ${NCURSES_CONFIG_PKG:=none}
17234if test "x${NCURSES_CONFIG_PKG}" = xnone; then
17235 :
17236elif test "x${PKG_CONFIG:=none}" != xnone; then
17237 echo "$as_me:17237: checking pkg-config for $PANEL_NAME$cf_cv_libtype" >&5
17238echo $ECHO_N "checking pkg-config for $PANEL_NAME$cf_cv_libtype... $ECHO_C" >&6
17239 if "$PKG_CONFIG" --exists "$PANEL_NAME$cf_cv_libtype" ; then
17240 echo "$as_me:17240: result: yes" >&5
17241echo "${ECHO_T}yes" >&6
17242
17243 echo "$as_me:17243: checking if the $PANEL_NAME$cf_cv_libtype package files work" >&5
17244echo $ECHO_N "checking if the $PANEL_NAME$cf_cv_libtype package files work... $ECHO_C" >&6
17245
17246 cf_save_CFLAGS="$CFLAGS"
17247 cf_save_CPPFLAGS="$CPPFLAGS"
17248 cf_save_LIBS="$LIBS"
17249
17250for cf_add_cflags in `$PKG_CONFIG --cflags "$PANEL_NAME$cf_cv_libtype"`
17251do
17252 case "x$cf_add_cflags" in
17253 (x-[DU]*)
17254
17255cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
17256while true
17257do
17258 cf_old_cflag=`echo "x$CFLAGS" | sed -e 's/^.//' -e 's/[ ][ ]*-/ -/g' -e "s%$cf_tmp_cflag\\(=[^ ][^ ]*\\)\?%%" -e 's/^[ ]*//' -e 's%[ ][ ]*-D% -D%g' -e 's%[ ][ ]*-I% -I%g'`
17259 test "$CFLAGS" != "$cf_old_cflag" || break
17260
17261 CFLAGS="$cf_old_cflag"
17262done
17263
17264cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
17265while true
17266do
17267 cf_old_cflag=`echo "x$CPPFLAGS" | sed -e 's/^.//' -e 's/[ ][ ]*-/ -/g' -e "s%$cf_tmp_cflag\\(=[^ ][^ ]*\\)\?%%" -e 's/^[ ]*//' -e 's%[ ][ ]*-D% -D%g' -e 's%[ ][ ]*-I% -I%g'`
17268 test "$CPPFLAGS" != "$cf_old_cflag" || break
17269
17270 CPPFLAGS="$cf_old_cflag"
17271done
17272
17273 ;;
17274 esac
17275
17276cf_fix_cppflags=no
17277cf_new_cflags=
17278cf_new_cppflags=
17279cf_new_extra_cppflags=
17280
17281for cf_add_cflags in $cf_add_cflags
17282do
17283case "$cf_fix_cppflags" in
17284(no)
17285 case "$cf_add_cflags" in
17286 (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
17287 case "$cf_add_cflags" in
17288 (-D*)
17289 cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
17290
17291 test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
17292 && test -z "${cf_tst_cflags}" \
17293 && cf_fix_cppflags=yes
17294
17295 if test "$cf_fix_cppflags" = yes ; then
17296
17297 test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
17298 cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
17299
17300 continue
17301 elif test "${cf_tst_cflags}" = "\"'" ; then
17302
17303 test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
17304 cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
17305
17306 continue
17307 fi
17308 ;;
17309 esac
17310 case "$CPPFLAGS" in
17311 (*$cf_add_cflags)
17312 ;;
17313 (*)
17314 case "$cf_add_cflags" in
17315 (-D*)
17316 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
17317
17318CPPFLAGS=`echo "$CPPFLAGS" | \
17319 sed -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?[ ]/ /g' \
17320 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?$//g'`
17321
17322 ;;
17323 esac
17324
17325 test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
17326 cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
17327
17328 ;;
17329 esac
17330 ;;
17331 (*)
17332
17333 test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
17334 cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
17335
17336 ;;
17337 esac
17338 ;;
17339(yes)
17340
17341 test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
17342 cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
17343
17344 cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
17345
17346 test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
17347 && test -z "${cf_tst_cflags}" \
17348 && cf_fix_cppflags=no
17349 ;;
17350esac
17351done
17352
17353if test -n "$cf_new_cflags" ; then
17354
17355 test -n "$CFLAGS" && CFLAGS="$CFLAGS "
17356 CFLAGS="${CFLAGS}$cf_new_cflags"
17357
17358fi
17359
17360if test -n "$cf_new_cppflags" ; then
17361
17362 test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
17363 CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
17364
17365fi
17366
17367if test -n "$cf_new_extra_cppflags" ; then
17368
17369 test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
17370 EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
17371
17372fi
17373
17374done
17375
17376cf_add_libs="$LIBS"
17377# reverse order
17378cf_add_0lib=
17379for cf_add_1lib in `$PKG_CONFIG --libs "$PANEL_NAME$cf_cv_libtype"`; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
17380# filter duplicates
17381for cf_add_1lib in $cf_add_0lib; do
17382 for cf_add_2lib in $cf_add_libs; do
17383 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
17384 cf_add_1lib=
17385 break
17386 fi
17387 done
17388 test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
17389done
17390LIBS="$cf_add_libs"
17391
17392 cat >"conftest.$ac_ext" <<_ACEOF
17393#line 17393 "configure"
17394#include "confdefs.h"
17395#include <$PANEL_NAME.h>
17396int
17397main (void)
17398{
17399(void) new_panel ( 0 );
17400 ;
17401 return 0;
17402}
17403_ACEOF
17404rm -f "conftest.$ac_objext" "conftest$ac_exeext"
17405if { (eval echo "$as_me:17405: \"$ac_link\"") >&5
17406 (eval $ac_link) 2>&5
17407 ac_status=$?
17408 echo "$as_me:17408: \$? = $ac_status" >&5
17409 (exit "$ac_status"); } &&
17410 { ac_try='test -s "conftest$ac_exeext"'
17411 { (eval echo "$as_me:17411: \"$ac_try\"") >&5
17412 (eval $ac_try) 2>&5
17413 ac_status=$?
17414 echo "$as_me:17414: \$? = $ac_status" >&5
17415 (exit "$ac_status"); }; }; then
17416 if test "$cross_compiling" = yes; then
17417 cf_have_curses_lib=maybe
17418else
17419 cat >"conftest.$ac_ext" <<_ACEOF
17420#line 17420 "configure"
17421#include "confdefs.h"
17422#include <$PANEL_NAME.h>
17423 int main(void)
17424 { (void) new_panel ( 0 ); return 0; }
17425_ACEOF
17426rm -f "conftest$ac_exeext"
17427if { (eval echo "$as_me:17427: \"$ac_link\"") >&5
17428 (eval $ac_link) 2>&5
17429 ac_status=$?
17430 echo "$as_me:17430: \$? = $ac_status" >&5
17431 (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
17432 { (eval echo "$as_me:17432: \"$ac_try\"") >&5
17433 (eval $ac_try) 2>&5
17434 ac_status=$?
17435 echo "$as_me:17435: \$? = $ac_status" >&5
17436 (exit "$ac_status"); }; }; then
17437 cf_have_curses_lib=yes
17438else
17439 echo "$as_me: program exited with status $ac_status" >&5
17440echo "$as_me: failed program was:" >&5
17441cat "conftest.$ac_ext" >&5
17442cf_have_curses_lib=no
17443fi
17444rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
17445fi
17446else
17447 echo "$as_me: failed program was:" >&5
17448cat "conftest.$ac_ext" >&5
17449cf_have_curses_lib=no
17450fi
17451rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
17452 echo "$as_me:17452: result: $cf_have_curses_lib" >&5
17453echo "${ECHO_T}$cf_have_curses_lib" >&6
17454 test "$cf_have_curses_lib" = maybe && cf_have_curses_lib=yes
17455 if test "$cf_have_curses_lib" = "yes"
17456 then
17457
17458cf_upper=`echo "have_lib$PANEL_NAME" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
17459
17460 cat >>confdefs.h <<EOF
17461#define $cf_upper 1
17462EOF
17463
17464 else
17465 CFLAGS="$cf_save_CFLAGS"
17466 CPPFLAGS="$cf_save_CPPFLAGS"
17467 LIBS="$cf_save_LIBS"
17468 fi
17469 fi
17470fi
17471if test "$cf_have_curses_lib" = no; then
17472 as_ac_Lib=`echo "ac_cv_lib_$PANEL_NAME$cf_cv_libtype''_new_panel" | $as_tr_sh`
17473echo "$as_me:17473: checking for new_panel in -l$PANEL_NAME$cf_cv_libtype" >&5
17474echo $ECHO_N "checking for new_panel in -l$PANEL_NAME$cf_cv_libtype... $ECHO_C" >&6
17475if eval "test \"\${$as_ac_Lib+set}\" = set"; then
17476 echo $ECHO_N "(cached) $ECHO_C" >&6
17477else
17478 ac_check_lib_save_LIBS=$LIBS
17479LIBS="-l$PANEL_NAME$cf_cv_libtype $LIBS"
17480cat >"conftest.$ac_ext" <<_ACEOF
17481#line 17481 "configure"
17482#include "confdefs.h"
17483
17484/* Override any gcc2 internal prototype to avoid an error. */
17485#ifdef __cplusplus
17486extern "C"
17487#endif
17488/* We use char because int might match the return type of a gcc2
17489 builtin and then its argument prototype would still apply. */
17490char new_panel (void);
17491int
17492main (void)
17493{
17494new_panel ();
17495 ;
17496 return 0;
17497}
17498_ACEOF
17499rm -f "conftest.$ac_objext" "conftest$ac_exeext"
17500if { (eval echo "$as_me:17500: \"$ac_link\"") >&5
17501 (eval $ac_link) 2>&5
17502 ac_status=$?
17503 echo "$as_me:17503: \$? = $ac_status" >&5
17504 (exit "$ac_status"); } &&
17505 { ac_try='test -s "conftest$ac_exeext"'
17506 { (eval echo "$as_me:17506: \"$ac_try\"") >&5
17507 (eval $ac_try) 2>&5
17508 ac_status=$?
17509 echo "$as_me:17509: \$? = $ac_status" >&5
17510 (exit "$ac_status"); }; }; then
17511 eval "$as_ac_Lib=yes"
17512else
17513 echo "$as_me: failed program was:" >&5
17514cat "conftest.$ac_ext" >&5
17515eval "$as_ac_Lib=no"
17516fi
17517rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
17518LIBS=$ac_check_lib_save_LIBS
17519fi
17520echo "$as_me:17520: result: `eval echo '${'"$as_ac_Lib"'}'`" >&5
17521echo "${ECHO_T}`eval echo '${'"$as_ac_Lib"'}'`" >&6
17522if test "`eval echo '${'"$as_ac_Lib"'}'`" = yes; then
17523
17524cf_upper=`echo "have_lib$PANEL_NAME" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
17525
17526cf_add_libs="$LIBS"
17527# reverse order
17528cf_add_0lib=
17529for cf_add_1lib in -l$PANEL_NAME$cf_cv_libtype; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
17530# filter duplicates
17531for cf_add_1lib in $cf_add_0lib; do
17532 for cf_add_2lib in $cf_add_libs; do
17533 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
17534 cf_add_1lib=
17535 break
17536 fi
17537 done
17538 test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
17539done
17540LIBS="$cf_add_libs"
17541
17542 cat >>confdefs.h <<EOF
17543#define $cf_upper 1
17544EOF
17545
17546fi
17547
17548fi
17549
17550 cf_curses_headers="$cf_curses_headers panel.h"
17551fi
17552
17553echo "$as_me:17553: checking if you want to check for menu functions" >&5
17554echo $ECHO_N "checking if you want to check for menu functions... $ECHO_C" >&6
17555
17556# Check whether --enable-menu or --disable-menu was given.
17557if test "${enable_menu+set}" = set; then
17558 enableval="$enable_menu"
17559 test "$enableval" != no && enableval=yes
17560 if test "$enableval" != "yes" ; then
17561 cf_enable_menu=no
17562 else
17563 cf_enable_menu=$cf_default_menu
17564 fi
17565else
17566 enableval=yes
17567 cf_enable_menu=$cf_default_menu
17568
17569fi;
17570echo "$as_me:17570: result: $cf_enable_menu" >&5
17571echo "${ECHO_T}$cf_enable_menu" >&6
17572if test $cf_enable_menu = yes
17573then
17574 case $cf_cv_screen in
17575 (ncurses*)
17576 ;;
17577 (curses*)
17578
17579echo "$as_me:17579: checking for NetBSD menu.h" >&5
17580echo $ECHO_N "checking for NetBSD menu.h... $ECHO_C" >&6
17581if test "${cf_cv_netbsd_menu_h+set}" = set; then
17582 echo $ECHO_N "(cached) $ECHO_C" >&6
17583else
17584
17585cat >"conftest.$ac_ext" <<_ACEOF
17586#line 17586 "configure"
17587#include "confdefs.h"
17588
17589#include <${cf_cv_ncurses_header:-curses.h}>
17590#include <menu.h>
17591
17592int
17593main (void)
17594{
17595
17596 MENU *menu;
17597 int y = menu->max_item_width;
17598
17599 ;
17600 return 0;
17601}
17602_ACEOF
17603rm -f "conftest.$ac_objext"
17604if { (eval echo "$as_me:17604: \"$ac_compile\"") >&5
17605 (eval $ac_compile) 2>&5
17606 ac_status=$?
17607 echo "$as_me:17607: \$? = $ac_status" >&5
17608 (exit "$ac_status"); } &&
17609 { ac_try='test -s "conftest.$ac_objext"'
17610 { (eval echo "$as_me:17610: \"$ac_try\"") >&5
17611 (eval $ac_try) 2>&5
17612 ac_status=$?
17613 echo "$as_me:17613: \$? = $ac_status" >&5
17614 (exit "$ac_status"); }; }; then
17615 cf_cv_netbsd_menu_h=yes
17616
17617else
17618 echo "$as_me: failed program was:" >&5
17619cat "conftest.$ac_ext" >&5
17620cf_cv_netbsd_menu_h=no
17621fi
17622rm -f "conftest.$ac_objext" "conftest.$ac_ext"
17623
17624fi
17625echo "$as_me:17625: result: $cf_cv_netbsd_menu_h" >&5
17626echo "${ECHO_T}$cf_cv_netbsd_menu_h" >&6
17627
17628test "$cf_cv_netbsd_menu_h" = yes &&
17629cat >>confdefs.h <<\EOF
17630#define HAVE_NETBSD_MENU_H 1
17631EOF
17632
17633 ;;
17634 esac
17635
17636cf_have_curses_lib=no
17637
17638: ${NCURSES_CONFIG_PKG:=none}
17639if test "x${NCURSES_CONFIG_PKG}" = xnone; then
17640 :
17641elif test "x${PKG_CONFIG:=none}" != xnone; then
17642 echo "$as_me:17642: checking pkg-config for $MENU_NAME$cf_cv_libtype" >&5
17643echo $ECHO_N "checking pkg-config for $MENU_NAME$cf_cv_libtype... $ECHO_C" >&6
17644 if "$PKG_CONFIG" --exists "$MENU_NAME$cf_cv_libtype" ; then
17645 echo "$as_me:17645: result: yes" >&5
17646echo "${ECHO_T}yes" >&6
17647
17648 echo "$as_me:17648: checking if the $MENU_NAME$cf_cv_libtype package files work" >&5
17649echo $ECHO_N "checking if the $MENU_NAME$cf_cv_libtype package files work... $ECHO_C" >&6
17650
17651 cf_save_CFLAGS="$CFLAGS"
17652 cf_save_CPPFLAGS="$CPPFLAGS"
17653 cf_save_LIBS="$LIBS"
17654
17655for cf_add_cflags in `$PKG_CONFIG --cflags "$MENU_NAME$cf_cv_libtype"`
17656do
17657 case "x$cf_add_cflags" in
17658 (x-[DU]*)
17659
17660cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
17661while true
17662do
17663 cf_old_cflag=`echo "x$CFLAGS" | sed -e 's/^.//' -e 's/[ ][ ]*-/ -/g' -e "s%$cf_tmp_cflag\\(=[^ ][^ ]*\\)\?%%" -e 's/^[ ]*//' -e 's%[ ][ ]*-D% -D%g' -e 's%[ ][ ]*-I% -I%g'`
17664 test "$CFLAGS" != "$cf_old_cflag" || break
17665
17666 CFLAGS="$cf_old_cflag"
17667done
17668
17669cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
17670while true
17671do
17672 cf_old_cflag=`echo "x$CPPFLAGS" | sed -e 's/^.//' -e 's/[ ][ ]*-/ -/g' -e "s%$cf_tmp_cflag\\(=[^ ][^ ]*\\)\?%%" -e 's/^[ ]*//' -e 's%[ ][ ]*-D% -D%g' -e 's%[ ][ ]*-I% -I%g'`
17673 test "$CPPFLAGS" != "$cf_old_cflag" || break
17674
17675 CPPFLAGS="$cf_old_cflag"
17676done
17677
17678 ;;
17679 esac
17680
17681cf_fix_cppflags=no
17682cf_new_cflags=
17683cf_new_cppflags=
17684cf_new_extra_cppflags=
17685
17686for cf_add_cflags in $cf_add_cflags
17687do
17688case "$cf_fix_cppflags" in
17689(no)
17690 case "$cf_add_cflags" in
17691 (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
17692 case "$cf_add_cflags" in
17693 (-D*)
17694 cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
17695
17696 test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
17697 && test -z "${cf_tst_cflags}" \
17698 && cf_fix_cppflags=yes
17699
17700 if test "$cf_fix_cppflags" = yes ; then
17701
17702 test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
17703 cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
17704
17705 continue
17706 elif test "${cf_tst_cflags}" = "\"'" ; then
17707
17708 test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
17709 cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
17710
17711 continue
17712 fi
17713 ;;
17714 esac
17715 case "$CPPFLAGS" in
17716 (*$cf_add_cflags)
17717 ;;
17718 (*)
17719 case "$cf_add_cflags" in
17720 (-D*)
17721 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
17722
17723CPPFLAGS=`echo "$CPPFLAGS" | \
17724 sed -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?[ ]/ /g' \
17725 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?$//g'`
17726
17727 ;;
17728 esac
17729
17730 test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
17731 cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
17732
17733 ;;
17734 esac
17735 ;;
17736 (*)
17737
17738 test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
17739 cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
17740
17741 ;;
17742 esac
17743 ;;
17744(yes)
17745
17746 test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
17747 cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
17748
17749 cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
17750
17751 test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
17752 && test -z "${cf_tst_cflags}" \
17753 && cf_fix_cppflags=no
17754 ;;
17755esac
17756done
17757
17758if test -n "$cf_new_cflags" ; then
17759
17760 test -n "$CFLAGS" && CFLAGS="$CFLAGS "
17761 CFLAGS="${CFLAGS}$cf_new_cflags"
17762
17763fi
17764
17765if test -n "$cf_new_cppflags" ; then
17766
17767 test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
17768 CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
17769
17770fi
17771
17772if test -n "$cf_new_extra_cppflags" ; then
17773
17774 test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
17775 EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
17776
17777fi
17778
17779done
17780
17781cf_add_libs="$LIBS"
17782# reverse order
17783cf_add_0lib=
17784for cf_add_1lib in `$PKG_CONFIG --libs "$MENU_NAME$cf_cv_libtype"`; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
17785# filter duplicates
17786for cf_add_1lib in $cf_add_0lib; do
17787 for cf_add_2lib in $cf_add_libs; do
17788 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
17789 cf_add_1lib=
17790 break
17791 fi
17792 done
17793 test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
17794done
17795LIBS="$cf_add_libs"
17796
17797 cat >"conftest.$ac_ext" <<_ACEOF
17798#line 17798 "configure"
17799#include "confdefs.h"
17800#include <$MENU_NAME.h>
17801int
17802main (void)
17803{
17804(void) menu_driver ( 0,0 );
17805 ;
17806 return 0;
17807}
17808_ACEOF
17809rm -f "conftest.$ac_objext" "conftest$ac_exeext"
17810if { (eval echo "$as_me:17810: \"$ac_link\"") >&5
17811 (eval $ac_link) 2>&5
17812 ac_status=$?
17813 echo "$as_me:17813: \$? = $ac_status" >&5
17814 (exit "$ac_status"); } &&
17815 { ac_try='test -s "conftest$ac_exeext"'
17816 { (eval echo "$as_me:17816: \"$ac_try\"") >&5
17817 (eval $ac_try) 2>&5
17818 ac_status=$?
17819 echo "$as_me:17819: \$? = $ac_status" >&5
17820 (exit "$ac_status"); }; }; then
17821 if test "$cross_compiling" = yes; then
17822 cf_have_curses_lib=maybe
17823else
17824 cat >"conftest.$ac_ext" <<_ACEOF
17825#line 17825 "configure"
17826#include "confdefs.h"
17827#include <$MENU_NAME.h>
17828 int main(void)
17829 { (void) menu_driver ( 0,0 ); return 0; }
17830_ACEOF
17831rm -f "conftest$ac_exeext"
17832if { (eval echo "$as_me:17832: \"$ac_link\"") >&5
17833 (eval $ac_link) 2>&5
17834 ac_status=$?
17835 echo "$as_me:17835: \$? = $ac_status" >&5
17836 (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
17837 { (eval echo "$as_me:17837: \"$ac_try\"") >&5
17838 (eval $ac_try) 2>&5
17839 ac_status=$?
17840 echo "$as_me:17840: \$? = $ac_status" >&5
17841 (exit "$ac_status"); }; }; then
17842 cf_have_curses_lib=yes
17843else
17844 echo "$as_me: program exited with status $ac_status" >&5
17845echo "$as_me: failed program was:" >&5
17846cat "conftest.$ac_ext" >&5
17847cf_have_curses_lib=no
17848fi
17849rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
17850fi
17851else
17852 echo "$as_me: failed program was:" >&5
17853cat "conftest.$ac_ext" >&5
17854cf_have_curses_lib=no
17855fi
17856rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
17857 echo "$as_me:17857: result: $cf_have_curses_lib" >&5
17858echo "${ECHO_T}$cf_have_curses_lib" >&6
17859 test "$cf_have_curses_lib" = maybe && cf_have_curses_lib=yes
17860 if test "$cf_have_curses_lib" = "yes"
17861 then
17862
17863cf_upper=`echo "have_lib$MENU_NAME" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
17864
17865 cat >>confdefs.h <<EOF
17866#define $cf_upper 1
17867EOF
17868
17869 else
17870 CFLAGS="$cf_save_CFLAGS"
17871 CPPFLAGS="$cf_save_CPPFLAGS"
17872 LIBS="$cf_save_LIBS"
17873 fi
17874 fi
17875fi
17876if test "$cf_have_curses_lib" = no; then
17877 as_ac_Lib=`echo "ac_cv_lib_$MENU_NAME$cf_cv_libtype''_menu_driver" | $as_tr_sh`
17878echo "$as_me:17878: checking for menu_driver in -l$MENU_NAME$cf_cv_libtype" >&5
17879echo $ECHO_N "checking for menu_driver in -l$MENU_NAME$cf_cv_libtype... $ECHO_C" >&6
17880if eval "test \"\${$as_ac_Lib+set}\" = set"; then
17881 echo $ECHO_N "(cached) $ECHO_C" >&6
17882else
17883 ac_check_lib_save_LIBS=$LIBS
17884LIBS="-l$MENU_NAME$cf_cv_libtype $LIBS"
17885cat >"conftest.$ac_ext" <<_ACEOF
17886#line 17886 "configure"
17887#include "confdefs.h"
17888
17889/* Override any gcc2 internal prototype to avoid an error. */
17890#ifdef __cplusplus
17891extern "C"
17892#endif
17893/* We use char because int might match the return type of a gcc2
17894 builtin and then its argument prototype would still apply. */
17895char menu_driver (void);
17896int
17897main (void)
17898{
17899menu_driver ();
17900 ;
17901 return 0;
17902}
17903_ACEOF
17904rm -f "conftest.$ac_objext" "conftest$ac_exeext"
17905if { (eval echo "$as_me:17905: \"$ac_link\"") >&5
17906 (eval $ac_link) 2>&5
17907 ac_status=$?
17908 echo "$as_me:17908: \$? = $ac_status" >&5
17909 (exit "$ac_status"); } &&
17910 { ac_try='test -s "conftest$ac_exeext"'
17911 { (eval echo "$as_me:17911: \"$ac_try\"") >&5
17912 (eval $ac_try) 2>&5
17913 ac_status=$?
17914 echo "$as_me:17914: \$? = $ac_status" >&5
17915 (exit "$ac_status"); }; }; then
17916 eval "$as_ac_Lib=yes"
17917else
17918 echo "$as_me: failed program was:" >&5
17919cat "conftest.$ac_ext" >&5
17920eval "$as_ac_Lib=no"
17921fi
17922rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
17923LIBS=$ac_check_lib_save_LIBS
17924fi
17925echo "$as_me:17925: result: `eval echo '${'"$as_ac_Lib"'}'`" >&5
17926echo "${ECHO_T}`eval echo '${'"$as_ac_Lib"'}'`" >&6
17927if test "`eval echo '${'"$as_ac_Lib"'}'`" = yes; then
17928
17929cf_upper=`echo "have_lib$MENU_NAME" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
17930
17931cf_add_libs="$LIBS"
17932# reverse order
17933cf_add_0lib=
17934for cf_add_1lib in -l$MENU_NAME$cf_cv_libtype; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
17935# filter duplicates
17936for cf_add_1lib in $cf_add_0lib; do
17937 for cf_add_2lib in $cf_add_libs; do
17938 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
17939 cf_add_1lib=
17940 break
17941 fi
17942 done
17943 test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
17944done
17945LIBS="$cf_add_libs"
17946
17947 cat >>confdefs.h <<EOF
17948#define $cf_upper 1
17949EOF
17950
17951fi
17952
17953fi
17954
17955 cf_curses_headers="$cf_curses_headers menu.h"
17956fi
17957
17958echo "$as_me:17958: checking if you want to check for form functions" >&5
17959echo $ECHO_N "checking if you want to check for form functions... $ECHO_C" >&6
17960
17961# Check whether --enable-form or --disable-form was given.
17962if test "${enable_form+set}" = set; then
17963 enableval="$enable_form"
17964 test "$enableval" != no && enableval=yes
17965 if test "$enableval" != "yes" ; then
17966 cf_enable_form=no
17967 else
17968 cf_enable_form=$cf_default_form
17969 fi
17970else
17971 enableval=yes
17972 cf_enable_form=$cf_default_form
17973
17974fi;
17975echo "$as_me:17975: result: $cf_enable_form" >&5
17976echo "${ECHO_T}$cf_enable_form" >&6
17977if test $cf_enable_form = yes
17978then
17979 case $cf_cv_screen in
17980 (ncurses*)
17981 ;;
17982 (curses*)
17983
17984echo "$as_me:17984: checking for NetBSD form.h" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010017985echo $ECHO_N "checking for NetBSD form.h... $ECHO_C" >&6
17986if test "${cf_cv_netbsd_form_h+set}" = set; then
17987 echo $ECHO_N "(cached) $ECHO_C" >&6
17988else
17989
micky3879b9f5e72025-07-08 18:04:53 -040017990cat >"conftest.$ac_ext" <<_ACEOF
17991#line 17991 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +010017992#include "confdefs.h"
17993
17994#include <${cf_cv_ncurses_header:-curses.h}>
17995#include <form.h>
17996
17997int
micky3879b9f5e72025-07-08 18:04:53 -040017998main (void)
Steve Kondikae271bc2015-11-15 02:50:53 +010017999{
18000
18001 FORM *form;
18002 int y = current_field(form)->cursor_ypos;
18003 int x = current_field(form)->cursor_xpos;
18004
18005 ;
18006 return 0;
18007}
18008_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -040018009rm -f "conftest.$ac_objext"
18010if { (eval echo "$as_me:18010: \"$ac_compile\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010018011 (eval $ac_compile) 2>&5
18012 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040018013 echo "$as_me:18013: \$? = $ac_status" >&5
18014 (exit "$ac_status"); } &&
18015 { ac_try='test -s "conftest.$ac_objext"'
18016 { (eval echo "$as_me:18016: \"$ac_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010018017 (eval $ac_try) 2>&5
18018 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040018019 echo "$as_me:18019: \$? = $ac_status" >&5
18020 (exit "$ac_status"); }; }; then
Steve Kondikae271bc2015-11-15 02:50:53 +010018021 cf_cv_netbsd_form_h=yes
18022
18023else
18024 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -040018025cat "conftest.$ac_ext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010018026cf_cv_netbsd_form_h=no
18027fi
micky3879b9f5e72025-07-08 18:04:53 -040018028rm -f "conftest.$ac_objext" "conftest.$ac_ext"
Steve Kondikae271bc2015-11-15 02:50:53 +010018029
18030fi
micky3879b9f5e72025-07-08 18:04:53 -040018031echo "$as_me:18031: result: $cf_cv_netbsd_form_h" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010018032echo "${ECHO_T}$cf_cv_netbsd_form_h" >&6
18033
18034test "$cf_cv_netbsd_form_h" = yes &&
18035cat >>confdefs.h <<\EOF
18036#define HAVE_NETBSD_FORM_H 1
18037EOF
18038
micky3879b9f5e72025-07-08 18:04:53 -040018039 ;;
18040 esac
Steve Kondikae271bc2015-11-15 02:50:53 +010018041
micky3879b9f5e72025-07-08 18:04:53 -040018042cf_have_curses_lib=no
Steve Kondikae271bc2015-11-15 02:50:53 +010018043
micky3879b9f5e72025-07-08 18:04:53 -040018044: ${NCURSES_CONFIG_PKG:=none}
18045if test "x${NCURSES_CONFIG_PKG}" = xnone; then
18046 :
18047elif test "x${PKG_CONFIG:=none}" != xnone; then
18048 echo "$as_me:18048: checking pkg-config for $FORM_NAME$cf_cv_libtype" >&5
18049echo $ECHO_N "checking pkg-config for $FORM_NAME$cf_cv_libtype... $ECHO_C" >&6
18050 if "$PKG_CONFIG" --exists "$FORM_NAME$cf_cv_libtype" ; then
18051 echo "$as_me:18051: result: yes" >&5
18052echo "${ECHO_T}yes" >&6
Steve Kondikae271bc2015-11-15 02:50:53 +010018053
micky3879b9f5e72025-07-08 18:04:53 -040018054 echo "$as_me:18054: checking if the $FORM_NAME$cf_cv_libtype package files work" >&5
18055echo $ECHO_N "checking if the $FORM_NAME$cf_cv_libtype package files work... $ECHO_C" >&6
Steve Kondikae271bc2015-11-15 02:50:53 +010018056
micky3879b9f5e72025-07-08 18:04:53 -040018057 cf_save_CFLAGS="$CFLAGS"
18058 cf_save_CPPFLAGS="$CPPFLAGS"
18059 cf_save_LIBS="$LIBS"
Steve Kondikae271bc2015-11-15 02:50:53 +010018060
micky3879b9f5e72025-07-08 18:04:53 -040018061for cf_add_cflags in `$PKG_CONFIG --cflags "$FORM_NAME$cf_cv_libtype"`
18062do
18063 case "x$cf_add_cflags" in
18064 (x-[DU]*)
Steve Kondikae271bc2015-11-15 02:50:53 +010018065
micky3879b9f5e72025-07-08 18:04:53 -040018066cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
18067while true
18068do
18069 cf_old_cflag=`echo "x$CFLAGS" | sed -e 's/^.//' -e 's/[ ][ ]*-/ -/g' -e "s%$cf_tmp_cflag\\(=[^ ][^ ]*\\)\?%%" -e 's/^[ ]*//' -e 's%[ ][ ]*-D% -D%g' -e 's%[ ][ ]*-I% -I%g'`
18070 test "$CFLAGS" != "$cf_old_cflag" || break
Steve Kondikae271bc2015-11-15 02:50:53 +010018071
micky3879b9f5e72025-07-08 18:04:53 -040018072 CFLAGS="$cf_old_cflag"
18073done
Steve Kondikae271bc2015-11-15 02:50:53 +010018074
micky3879b9f5e72025-07-08 18:04:53 -040018075cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
18076while true
18077do
18078 cf_old_cflag=`echo "x$CPPFLAGS" | sed -e 's/^.//' -e 's/[ ][ ]*-/ -/g' -e "s%$cf_tmp_cflag\\(=[^ ][^ ]*\\)\?%%" -e 's/^[ ]*//' -e 's%[ ][ ]*-D% -D%g' -e 's%[ ][ ]*-I% -I%g'`
18079 test "$CPPFLAGS" != "$cf_old_cflag" || break
Steve Kondikae271bc2015-11-15 02:50:53 +010018080
micky3879b9f5e72025-07-08 18:04:53 -040018081 CPPFLAGS="$cf_old_cflag"
18082done
18083
18084 ;;
18085 esac
18086
18087cf_fix_cppflags=no
18088cf_new_cflags=
18089cf_new_cppflags=
18090cf_new_extra_cppflags=
18091
18092for cf_add_cflags in $cf_add_cflags
18093do
18094case "$cf_fix_cppflags" in
18095(no)
18096 case "$cf_add_cflags" in
18097 (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
18098 case "$cf_add_cflags" in
18099 (-D*)
18100 cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
18101
18102 test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
18103 && test -z "${cf_tst_cflags}" \
18104 && cf_fix_cppflags=yes
18105
18106 if test "$cf_fix_cppflags" = yes ; then
18107
18108 test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
18109 cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
18110
18111 continue
18112 elif test "${cf_tst_cflags}" = "\"'" ; then
18113
18114 test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
18115 cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
18116
18117 continue
18118 fi
18119 ;;
18120 esac
18121 case "$CPPFLAGS" in
18122 (*$cf_add_cflags)
18123 ;;
18124 (*)
18125 case "$cf_add_cflags" in
18126 (-D*)
18127 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
18128
18129CPPFLAGS=`echo "$CPPFLAGS" | \
18130 sed -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?[ ]/ /g' \
18131 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?$//g'`
18132
18133 ;;
18134 esac
18135
18136 test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
18137 cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
18138
18139 ;;
18140 esac
18141 ;;
18142 (*)
18143
18144 test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
18145 cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
18146
18147 ;;
18148 esac
18149 ;;
18150(yes)
18151
18152 test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
18153 cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
18154
18155 cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
18156
18157 test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
18158 && test -z "${cf_tst_cflags}" \
18159 && cf_fix_cppflags=no
Steve Kondikae271bc2015-11-15 02:50:53 +010018160 ;;
18161esac
micky3879b9f5e72025-07-08 18:04:53 -040018162done
Steve Kondikae271bc2015-11-15 02:50:53 +010018163
micky3879b9f5e72025-07-08 18:04:53 -040018164if test -n "$cf_new_cflags" ; then
Steve Kondikae271bc2015-11-15 02:50:53 +010018165
micky3879b9f5e72025-07-08 18:04:53 -040018166 test -n "$CFLAGS" && CFLAGS="$CFLAGS "
18167 CFLAGS="${CFLAGS}$cf_new_cflags"
Steve Kondikae271bc2015-11-15 02:50:53 +010018168
Steve Kondikae271bc2015-11-15 02:50:53 +010018169fi
micky3879b9f5e72025-07-08 18:04:53 -040018170
18171if test -n "$cf_new_cppflags" ; then
18172
18173 test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
18174 CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
18175
Steve Kondikae271bc2015-11-15 02:50:53 +010018176fi
Steve Kondikae271bc2015-11-15 02:50:53 +010018177
micky3879b9f5e72025-07-08 18:04:53 -040018178if test -n "$cf_new_extra_cppflags" ; then
Steve Kondikae271bc2015-11-15 02:50:53 +010018179
micky3879b9f5e72025-07-08 18:04:53 -040018180 test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
18181 EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
18182
18183fi
18184
18185done
18186
18187cf_add_libs="$LIBS"
18188# reverse order
18189cf_add_0lib=
18190for cf_add_1lib in `$PKG_CONFIG --libs "$FORM_NAME$cf_cv_libtype"`; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
18191# filter duplicates
18192for cf_add_1lib in $cf_add_0lib; do
18193 for cf_add_2lib in $cf_add_libs; do
18194 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
Steve Kondikae271bc2015-11-15 02:50:53 +010018195 cf_add_1lib=
18196 break
18197 fi
18198 done
micky3879b9f5e72025-07-08 18:04:53 -040018199 test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
Steve Kondikae271bc2015-11-15 02:50:53 +010018200done
18201LIBS="$cf_add_libs"
18202
micky3879b9f5e72025-07-08 18:04:53 -040018203 cat >"conftest.$ac_ext" <<_ACEOF
18204#line 18204 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +010018205#include "confdefs.h"
micky3879b9f5e72025-07-08 18:04:53 -040018206#include <$FORM_NAME.h>
Steve Kondikae271bc2015-11-15 02:50:53 +010018207int
micky3879b9f5e72025-07-08 18:04:53 -040018208main (void)
Steve Kondikae271bc2015-11-15 02:50:53 +010018209{
micky3879b9f5e72025-07-08 18:04:53 -040018210(void) form_driver ( 0,0 );
Steve Kondikae271bc2015-11-15 02:50:53 +010018211 ;
18212 return 0;
18213}
18214_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -040018215rm -f "conftest.$ac_objext" "conftest$ac_exeext"
18216if { (eval echo "$as_me:18216: \"$ac_link\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010018217 (eval $ac_link) 2>&5
18218 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040018219 echo "$as_me:18219: \$? = $ac_status" >&5
18220 (exit "$ac_status"); } &&
18221 { ac_try='test -s "conftest$ac_exeext"'
18222 { (eval echo "$as_me:18222: \"$ac_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010018223 (eval $ac_try) 2>&5
18224 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040018225 echo "$as_me:18225: \$? = $ac_status" >&5
18226 (exit "$ac_status"); }; }; then
18227 if test "$cross_compiling" = yes; then
18228 cf_have_curses_lib=maybe
18229else
18230 cat >"conftest.$ac_ext" <<_ACEOF
18231#line 18231 "configure"
18232#include "confdefs.h"
18233#include <$FORM_NAME.h>
18234 int main(void)
18235 { (void) form_driver ( 0,0 ); return 0; }
18236_ACEOF
18237rm -f "conftest$ac_exeext"
18238if { (eval echo "$as_me:18238: \"$ac_link\"") >&5
18239 (eval $ac_link) 2>&5
18240 ac_status=$?
18241 echo "$as_me:18241: \$? = $ac_status" >&5
18242 (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
18243 { (eval echo "$as_me:18243: \"$ac_try\"") >&5
18244 (eval $ac_try) 2>&5
18245 ac_status=$?
18246 echo "$as_me:18246: \$? = $ac_status" >&5
18247 (exit "$ac_status"); }; }; then
18248 cf_have_curses_lib=yes
18249else
18250 echo "$as_me: program exited with status $ac_status" >&5
18251echo "$as_me: failed program was:" >&5
18252cat "conftest.$ac_ext" >&5
18253cf_have_curses_lib=no
18254fi
18255rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
18256fi
Steve Kondikae271bc2015-11-15 02:50:53 +010018257else
18258 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -040018259cat "conftest.$ac_ext" >&5
18260cf_have_curses_lib=no
Steve Kondikae271bc2015-11-15 02:50:53 +010018261fi
micky3879b9f5e72025-07-08 18:04:53 -040018262rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
18263 echo "$as_me:18263: result: $cf_have_curses_lib" >&5
18264echo "${ECHO_T}$cf_have_curses_lib" >&6
18265 test "$cf_have_curses_lib" = maybe && cf_have_curses_lib=yes
18266 if test "$cf_have_curses_lib" = "yes"
Steve Kondikae271bc2015-11-15 02:50:53 +010018267 then
Steve Kondikae271bc2015-11-15 02:50:53 +010018268
micky3879b9f5e72025-07-08 18:04:53 -040018269cf_upper=`echo "have_lib$FORM_NAME" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
18270
18271 cat >>confdefs.h <<EOF
Steve Kondikae271bc2015-11-15 02:50:53 +010018272#define $cf_upper 1
18273EOF
18274
micky3879b9f5e72025-07-08 18:04:53 -040018275 else
18276 CFLAGS="$cf_save_CFLAGS"
18277 CPPFLAGS="$cf_save_CPPFLAGS"
18278 LIBS="$cf_save_LIBS"
18279 fi
18280 fi
Steve Kondikae271bc2015-11-15 02:50:53 +010018281fi
micky3879b9f5e72025-07-08 18:04:53 -040018282if test "$cf_have_curses_lib" = no; then
18283 as_ac_Lib=`echo "ac_cv_lib_$FORM_NAME$cf_cv_libtype''_form_driver" | $as_tr_sh`
18284echo "$as_me:18284: checking for form_driver in -l$FORM_NAME$cf_cv_libtype" >&5
18285echo $ECHO_N "checking for form_driver in -l$FORM_NAME$cf_cv_libtype... $ECHO_C" >&6
Steve Kondikae271bc2015-11-15 02:50:53 +010018286if eval "test \"\${$as_ac_Lib+set}\" = set"; then
18287 echo $ECHO_N "(cached) $ECHO_C" >&6
18288else
18289 ac_check_lib_save_LIBS=$LIBS
micky3879b9f5e72025-07-08 18:04:53 -040018290LIBS="-l$FORM_NAME$cf_cv_libtype $LIBS"
18291cat >"conftest.$ac_ext" <<_ACEOF
18292#line 18292 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +010018293#include "confdefs.h"
18294
18295/* Override any gcc2 internal prototype to avoid an error. */
18296#ifdef __cplusplus
18297extern "C"
18298#endif
18299/* We use char because int might match the return type of a gcc2
18300 builtin and then its argument prototype would still apply. */
micky3879b9f5e72025-07-08 18:04:53 -040018301char form_driver (void);
Steve Kondikae271bc2015-11-15 02:50:53 +010018302int
micky3879b9f5e72025-07-08 18:04:53 -040018303main (void)
Steve Kondikae271bc2015-11-15 02:50:53 +010018304{
18305form_driver ();
18306 ;
18307 return 0;
18308}
18309_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -040018310rm -f "conftest.$ac_objext" "conftest$ac_exeext"
18311if { (eval echo "$as_me:18311: \"$ac_link\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010018312 (eval $ac_link) 2>&5
18313 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040018314 echo "$as_me:18314: \$? = $ac_status" >&5
18315 (exit "$ac_status"); } &&
18316 { ac_try='test -s "conftest$ac_exeext"'
18317 { (eval echo "$as_me:18317: \"$ac_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010018318 (eval $ac_try) 2>&5
18319 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040018320 echo "$as_me:18320: \$? = $ac_status" >&5
18321 (exit "$ac_status"); }; }; then
Steve Kondikae271bc2015-11-15 02:50:53 +010018322 eval "$as_ac_Lib=yes"
18323else
18324 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -040018325cat "conftest.$ac_ext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010018326eval "$as_ac_Lib=no"
18327fi
micky3879b9f5e72025-07-08 18:04:53 -040018328rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
Steve Kondikae271bc2015-11-15 02:50:53 +010018329LIBS=$ac_check_lib_save_LIBS
18330fi
micky3879b9f5e72025-07-08 18:04:53 -040018331echo "$as_me:18331: result: `eval echo '${'"$as_ac_Lib"'}'`" >&5
18332echo "${ECHO_T}`eval echo '${'"$as_ac_Lib"'}'`" >&6
18333if test "`eval echo '${'"$as_ac_Lib"'}'`" = yes; then
Steve Kondikae271bc2015-11-15 02:50:53 +010018334
micky3879b9f5e72025-07-08 18:04:53 -040018335cf_upper=`echo "have_lib$FORM_NAME" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
Steve Kondikae271bc2015-11-15 02:50:53 +010018336
micky3879b9f5e72025-07-08 18:04:53 -040018337cf_add_libs="$LIBS"
18338# reverse order
18339cf_add_0lib=
18340for cf_add_1lib in -l$FORM_NAME$cf_cv_libtype; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
18341# filter duplicates
18342for cf_add_1lib in $cf_add_0lib; do
18343 for cf_add_2lib in $cf_add_libs; do
18344 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
Steve Kondikae271bc2015-11-15 02:50:53 +010018345 cf_add_1lib=
18346 break
18347 fi
18348 done
micky3879b9f5e72025-07-08 18:04:53 -040018349 test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
Steve Kondikae271bc2015-11-15 02:50:53 +010018350done
18351LIBS="$cf_add_libs"
18352
micky3879b9f5e72025-07-08 18:04:53 -040018353 cat >>confdefs.h <<EOF
Steve Kondikae271bc2015-11-15 02:50:53 +010018354#define $cf_upper 1
18355EOF
18356
18357fi
18358
micky3879b9f5e72025-07-08 18:04:53 -040018359fi
Steve Kondikae271bc2015-11-15 02:50:53 +010018360
micky3879b9f5e72025-07-08 18:04:53 -040018361 cf_curses_headers="$cf_curses_headers form.h"
18362fi
Steve Kondikae271bc2015-11-15 02:50:53 +010018363
micky3879b9f5e72025-07-08 18:04:53 -040018364# look for curses-related headers
18365
18366for ac_header in $cf_curses_headers
Steve Kondikae271bc2015-11-15 02:50:53 +010018367do
18368as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
micky3879b9f5e72025-07-08 18:04:53 -040018369echo "$as_me:18369: checking for $ac_header" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010018370echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
18371if eval "test \"\${$as_ac_Header+set}\" = set"; then
18372 echo $ECHO_N "(cached) $ECHO_C" >&6
18373else
micky3879b9f5e72025-07-08 18:04:53 -040018374 cat >"conftest.$ac_ext" <<_ACEOF
18375#line 18375 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +010018376#include "confdefs.h"
18377#include <$ac_header>
18378_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -040018379if { (eval echo "$as_me:18379: \"$ac_cpp "conftest.$ac_ext"\"") >&5
18380 (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
Steve Kondikae271bc2015-11-15 02:50:53 +010018381 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040018382 $EGREP -v '^ *\+' conftest.er1 >conftest.err
Steve Kondikae271bc2015-11-15 02:50:53 +010018383 rm -f conftest.er1
18384 cat conftest.err >&5
micky3879b9f5e72025-07-08 18:04:53 -040018385 echo "$as_me:18385: \$? = $ac_status" >&5
18386 (exit "$ac_status"); } >/dev/null; then
Steve Kondikae271bc2015-11-15 02:50:53 +010018387 if test -s conftest.err; then
18388 ac_cpp_err=$ac_c_preproc_warn_flag
18389 else
18390 ac_cpp_err=
18391 fi
18392else
18393 ac_cpp_err=yes
18394fi
18395if test -z "$ac_cpp_err"; then
18396 eval "$as_ac_Header=yes"
18397else
18398 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -040018399 cat "conftest.$ac_ext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010018400 eval "$as_ac_Header=no"
18401fi
micky3879b9f5e72025-07-08 18:04:53 -040018402rm -f conftest.err "conftest.$ac_ext"
Steve Kondikae271bc2015-11-15 02:50:53 +010018403fi
micky3879b9f5e72025-07-08 18:04:53 -040018404echo "$as_me:18404: result: `eval echo '${'"$as_ac_Header"'}'`" >&5
18405echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6
18406if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then
Steve Kondikae271bc2015-11-15 02:50:53 +010018407 cat >>confdefs.h <<EOF
18408#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
18409EOF
18410
18411fi
18412done
18413
micky3879b9f5e72025-07-08 18:04:53 -040018414echo "$as_me:18414: checking whether time.h and sys/time.h may both be included" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010018415echo $ECHO_N "checking whether time.h and sys/time.h may both be included... $ECHO_C" >&6
18416if test "${ac_cv_header_time+set}" = set; then
18417 echo $ECHO_N "(cached) $ECHO_C" >&6
18418else
micky3879b9f5e72025-07-08 18:04:53 -040018419 cat >"conftest.$ac_ext" <<_ACEOF
18420#line 18420 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +010018421#include "confdefs.h"
18422#include <sys/types.h>
18423#include <sys/time.h>
18424#include <time.h>
18425
18426int
micky3879b9f5e72025-07-08 18:04:53 -040018427main (void)
Steve Kondikae271bc2015-11-15 02:50:53 +010018428{
18429if ((struct tm *) 0)
18430return 0;
18431 ;
18432 return 0;
18433}
18434_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -040018435rm -f "conftest.$ac_objext"
18436if { (eval echo "$as_me:18436: \"$ac_compile\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010018437 (eval $ac_compile) 2>&5
18438 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040018439 echo "$as_me:18439: \$? = $ac_status" >&5
18440 (exit "$ac_status"); } &&
18441 { ac_try='test -s "conftest.$ac_objext"'
18442 { (eval echo "$as_me:18442: \"$ac_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010018443 (eval $ac_try) 2>&5
18444 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040018445 echo "$as_me:18445: \$? = $ac_status" >&5
18446 (exit "$ac_status"); }; }; then
Steve Kondikae271bc2015-11-15 02:50:53 +010018447 ac_cv_header_time=yes
18448else
18449 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -040018450cat "conftest.$ac_ext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010018451ac_cv_header_time=no
18452fi
micky3879b9f5e72025-07-08 18:04:53 -040018453rm -f "conftest.$ac_objext" "conftest.$ac_ext"
Steve Kondikae271bc2015-11-15 02:50:53 +010018454fi
micky3879b9f5e72025-07-08 18:04:53 -040018455echo "$as_me:18455: result: $ac_cv_header_time" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010018456echo "${ECHO_T}$ac_cv_header_time" >&6
18457if test $ac_cv_header_time = yes; then
18458
18459cat >>confdefs.h <<\EOF
18460#define TIME_WITH_SYS_TIME 1
18461EOF
18462
18463fi
18464
18465for ac_header in \
18466getopt.h \
18467locale.h \
18468math.h \
18469stdarg.h \
18470sys/ioctl.h \
18471sys/select.h \
18472sys/time.h \
18473termios.h \
18474unistd.h \
18475
18476do
18477as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
micky3879b9f5e72025-07-08 18:04:53 -040018478echo "$as_me:18478: checking for $ac_header" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010018479echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
18480if eval "test \"\${$as_ac_Header+set}\" = set"; then
18481 echo $ECHO_N "(cached) $ECHO_C" >&6
18482else
micky3879b9f5e72025-07-08 18:04:53 -040018483 cat >"conftest.$ac_ext" <<_ACEOF
18484#line 18484 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +010018485#include "confdefs.h"
18486#include <$ac_header>
18487_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -040018488if { (eval echo "$as_me:18488: \"$ac_cpp "conftest.$ac_ext"\"") >&5
18489 (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
Steve Kondikae271bc2015-11-15 02:50:53 +010018490 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040018491 $EGREP -v '^ *\+' conftest.er1 >conftest.err
Steve Kondikae271bc2015-11-15 02:50:53 +010018492 rm -f conftest.er1
18493 cat conftest.err >&5
micky3879b9f5e72025-07-08 18:04:53 -040018494 echo "$as_me:18494: \$? = $ac_status" >&5
18495 (exit "$ac_status"); } >/dev/null; then
Steve Kondikae271bc2015-11-15 02:50:53 +010018496 if test -s conftest.err; then
18497 ac_cpp_err=$ac_c_preproc_warn_flag
18498 else
18499 ac_cpp_err=
18500 fi
18501else
18502 ac_cpp_err=yes
18503fi
18504if test -z "$ac_cpp_err"; then
18505 eval "$as_ac_Header=yes"
18506else
18507 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -040018508 cat "conftest.$ac_ext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010018509 eval "$as_ac_Header=no"
18510fi
micky3879b9f5e72025-07-08 18:04:53 -040018511rm -f conftest.err "conftest.$ac_ext"
Steve Kondikae271bc2015-11-15 02:50:53 +010018512fi
micky3879b9f5e72025-07-08 18:04:53 -040018513echo "$as_me:18513: result: `eval echo '${'"$as_ac_Header"'}'`" >&5
18514echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6
18515if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then
Steve Kondikae271bc2015-11-15 02:50:53 +010018516 cat >>confdefs.h <<EOF
18517#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
18518EOF
18519
18520fi
18521done
18522
18523for ac_header in unistd.h getopt.h
18524do
18525as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
micky3879b9f5e72025-07-08 18:04:53 -040018526echo "$as_me:18526: checking for $ac_header" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010018527echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
18528if eval "test \"\${$as_ac_Header+set}\" = set"; then
18529 echo $ECHO_N "(cached) $ECHO_C" >&6
18530else
micky3879b9f5e72025-07-08 18:04:53 -040018531 cat >"conftest.$ac_ext" <<_ACEOF
18532#line 18532 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +010018533#include "confdefs.h"
18534#include <$ac_header>
18535_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -040018536if { (eval echo "$as_me:18536: \"$ac_cpp "conftest.$ac_ext"\"") >&5
18537 (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
Steve Kondikae271bc2015-11-15 02:50:53 +010018538 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040018539 $EGREP -v '^ *\+' conftest.er1 >conftest.err
Steve Kondikae271bc2015-11-15 02:50:53 +010018540 rm -f conftest.er1
18541 cat conftest.err >&5
micky3879b9f5e72025-07-08 18:04:53 -040018542 echo "$as_me:18542: \$? = $ac_status" >&5
18543 (exit "$ac_status"); } >/dev/null; then
Steve Kondikae271bc2015-11-15 02:50:53 +010018544 if test -s conftest.err; then
18545 ac_cpp_err=$ac_c_preproc_warn_flag
18546 else
18547 ac_cpp_err=
18548 fi
18549else
18550 ac_cpp_err=yes
18551fi
18552if test -z "$ac_cpp_err"; then
18553 eval "$as_ac_Header=yes"
18554else
18555 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -040018556 cat "conftest.$ac_ext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010018557 eval "$as_ac_Header=no"
18558fi
micky3879b9f5e72025-07-08 18:04:53 -040018559rm -f conftest.err "conftest.$ac_ext"
Steve Kondikae271bc2015-11-15 02:50:53 +010018560fi
micky3879b9f5e72025-07-08 18:04:53 -040018561echo "$as_me:18561: result: `eval echo '${'"$as_ac_Header"'}'`" >&5
18562echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6
18563if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then
Steve Kondikae271bc2015-11-15 02:50:53 +010018564 cat >>confdefs.h <<EOF
18565#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
18566EOF
18567
18568fi
18569done
18570
micky3879b9f5e72025-07-08 18:04:53 -040018571echo "$as_me:18571: checking for header declaring getopt variables" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010018572echo $ECHO_N "checking for header declaring getopt variables... $ECHO_C" >&6
18573if test "${cf_cv_getopt_header+set}" = set; then
18574 echo $ECHO_N "(cached) $ECHO_C" >&6
18575else
18576
18577cf_cv_getopt_header=none
18578for cf_header in stdio.h stdlib.h unistd.h getopt.h
18579do
micky3879b9f5e72025-07-08 18:04:53 -040018580cat >"conftest.$ac_ext" <<_ACEOF
18581#line 18581 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +010018582#include "confdefs.h"
18583
18584#include <$cf_header>
18585int
micky3879b9f5e72025-07-08 18:04:53 -040018586main (void)
Steve Kondikae271bc2015-11-15 02:50:53 +010018587{
micky3879b9f5e72025-07-08 18:04:53 -040018588int x = optind; char *y = optarg; (void)x; (void)y
Steve Kondikae271bc2015-11-15 02:50:53 +010018589 ;
18590 return 0;
18591}
18592_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -040018593rm -f "conftest.$ac_objext"
18594if { (eval echo "$as_me:18594: \"$ac_compile\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010018595 (eval $ac_compile) 2>&5
18596 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040018597 echo "$as_me:18597: \$? = $ac_status" >&5
18598 (exit "$ac_status"); } &&
18599 { ac_try='test -s "conftest.$ac_objext"'
18600 { (eval echo "$as_me:18600: \"$ac_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010018601 (eval $ac_try) 2>&5
18602 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040018603 echo "$as_me:18603: \$? = $ac_status" >&5
18604 (exit "$ac_status"); }; }; then
Steve Kondikae271bc2015-11-15 02:50:53 +010018605 cf_cv_getopt_header=$cf_header
18606 break
18607else
18608 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -040018609cat "conftest.$ac_ext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010018610fi
micky3879b9f5e72025-07-08 18:04:53 -040018611rm -f "conftest.$ac_objext" "conftest.$ac_ext"
Steve Kondikae271bc2015-11-15 02:50:53 +010018612done
18613
18614fi
micky3879b9f5e72025-07-08 18:04:53 -040018615echo "$as_me:18615: result: $cf_cv_getopt_header" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010018616echo "${ECHO_T}$cf_cv_getopt_header" >&6
micky3879b9f5e72025-07-08 18:04:53 -040018617if test "$cf_cv_getopt_header" != none ; then
Steve Kondikae271bc2015-11-15 02:50:53 +010018618
18619cat >>confdefs.h <<\EOF
18620#define HAVE_GETOPT_HEADER 1
18621EOF
18622
18623fi
micky3879b9f5e72025-07-08 18:04:53 -040018624if test "$cf_cv_getopt_header" = getopt.h ; then
Steve Kondikae271bc2015-11-15 02:50:53 +010018625
18626cat >>confdefs.h <<\EOF
18627#define NEED_GETOPT_H 1
18628EOF
18629
18630fi
18631
micky3879b9f5e72025-07-08 18:04:53 -040018632echo "$as_me:18632: checking for clock_gettime" >&5
18633echo $ECHO_N "checking for clock_gettime... $ECHO_C" >&6
18634if test "${cf_cv_func_clock_gettime+set}" = set; then
Steve Kondikae271bc2015-11-15 02:50:53 +010018635 echo $ECHO_N "(cached) $ECHO_C" >&6
18636else
micky3879b9f5e72025-07-08 18:04:53 -040018637
18638 cat >"conftest.$ac_ext" <<_ACEOF
18639#line 18639 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +010018640#include "confdefs.h"
micky3879b9f5e72025-07-08 18:04:53 -040018641#include <time.h>
18642int
18643main (void)
18644{
18645struct timespec ts;
18646 int rc = clock_gettime(CLOCK_REALTIME, &ts); (void) rc; (void)ts
18647 ;
18648 return 0;
18649}
18650_ACEOF
18651rm -f "conftest.$ac_objext" "conftest$ac_exeext"
18652if { (eval echo "$as_me:18652: \"$ac_link\"") >&5
18653 (eval $ac_link) 2>&5
18654 ac_status=$?
18655 echo "$as_me:18655: \$? = $ac_status" >&5
18656 (exit "$ac_status"); } &&
18657 { ac_try='test -s "conftest$ac_exeext"'
18658 { (eval echo "$as_me:18658: \"$ac_try\"") >&5
18659 (eval $ac_try) 2>&5
18660 ac_status=$?
18661 echo "$as_me:18661: \$? = $ac_status" >&5
18662 (exit "$ac_status"); }; }; then
18663 cf_cv_func_clock_gettime=yes
18664else
18665 echo "$as_me: failed program was:" >&5
18666cat "conftest.$ac_ext" >&5
18667cf_cv_func_clock_gettime=no
18668fi
18669rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
18670
18671fi
18672echo "$as_me:18672: result: $cf_cv_func_clock_gettime" >&5
18673echo "${ECHO_T}$cf_cv_func_clock_gettime" >&6
18674
18675if test "$cf_cv_func_clock_gettime" = yes
18676then
18677
18678cat >>confdefs.h <<\EOF
18679#define HAVE_CLOCK_GETTIME 1
18680EOF
18681
18682else
18683echo "$as_me:18683: checking for gettimeofday" >&5
18684echo $ECHO_N "checking for gettimeofday... $ECHO_C" >&6
18685if test "${ac_cv_func_gettimeofday+set}" = set; then
18686 echo $ECHO_N "(cached) $ECHO_C" >&6
18687else
18688 cat >"conftest.$ac_ext" <<_ACEOF
18689#line 18689 "configure"
18690#include "confdefs.h"
18691#define gettimeofday autoconf_temporary
18692#include <limits.h> /* least-intrusive standard header which defines gcc2 __stub macros */
18693#undef gettimeofday
18694
18695#ifdef __cplusplus
18696extern "C"
18697#endif
18698
18699/* We use char because int might match the return type of a gcc2
18700 builtin and then its argument prototype would still apply. */
18701char gettimeofday (void);
18702
18703int
18704main (void)
18705{
18706
18707/* The GNU C library defines stubs for functions which it implements
18708 to always fail with ENOSYS. Some functions are actually named
18709 something starting with __ and the normal name is an alias. */
18710#if defined (__stub_gettimeofday) || defined (__stub___gettimeofday)
18711#error found stub for gettimeofday
18712#endif
18713
18714 return gettimeofday ();
18715 ;
18716 return 0;
18717}
18718_ACEOF
18719rm -f "conftest.$ac_objext" "conftest$ac_exeext"
18720if { (eval echo "$as_me:18720: \"$ac_link\"") >&5
18721 (eval $ac_link) 2>&5
18722 ac_status=$?
18723 echo "$as_me:18723: \$? = $ac_status" >&5
18724 (exit "$ac_status"); } &&
18725 { ac_try='test -s "conftest$ac_exeext"'
18726 { (eval echo "$as_me:18726: \"$ac_try\"") >&5
18727 (eval $ac_try) 2>&5
18728 ac_status=$?
18729 echo "$as_me:18729: \$? = $ac_status" >&5
18730 (exit "$ac_status"); }; }; then
18731 ac_cv_func_gettimeofday=yes
18732else
18733 echo "$as_me: failed program was:" >&5
18734cat "conftest.$ac_ext" >&5
18735ac_cv_func_gettimeofday=no
18736fi
18737rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
18738fi
18739echo "$as_me:18739: result: $ac_cv_func_gettimeofday" >&5
18740echo "${ECHO_T}$ac_cv_func_gettimeofday" >&6
18741if test "$ac_cv_func_gettimeofday" = yes; then
18742
18743cat >>confdefs.h <<\EOF
18744#define HAVE_GETTIMEOFDAY 1
18745EOF
18746
18747else
18748
18749echo "$as_me:18749: checking for gettimeofday in -lbsd" >&5
18750echo $ECHO_N "checking for gettimeofday in -lbsd... $ECHO_C" >&6
18751if test "${ac_cv_lib_bsd_gettimeofday+set}" = set; then
18752 echo $ECHO_N "(cached) $ECHO_C" >&6
18753else
18754 ac_check_lib_save_LIBS=$LIBS
18755LIBS="-lbsd $LIBS"
18756cat >"conftest.$ac_ext" <<_ACEOF
18757#line 18757 "configure"
18758#include "confdefs.h"
18759
Steve Kondikae271bc2015-11-15 02:50:53 +010018760/* Override any gcc2 internal prototype to avoid an error. */
18761#ifdef __cplusplus
18762extern "C"
18763#endif
18764/* We use char because int might match the return type of a gcc2
18765 builtin and then its argument prototype would still apply. */
micky3879b9f5e72025-07-08 18:04:53 -040018766char gettimeofday (void);
Steve Kondikae271bc2015-11-15 02:50:53 +010018767int
micky3879b9f5e72025-07-08 18:04:53 -040018768main (void)
Steve Kondikae271bc2015-11-15 02:50:53 +010018769{
micky3879b9f5e72025-07-08 18:04:53 -040018770gettimeofday ();
Steve Kondikae271bc2015-11-15 02:50:53 +010018771 ;
18772 return 0;
18773}
18774_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -040018775rm -f "conftest.$ac_objext" "conftest$ac_exeext"
18776if { (eval echo "$as_me:18776: \"$ac_link\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010018777 (eval $ac_link) 2>&5
18778 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040018779 echo "$as_me:18779: \$? = $ac_status" >&5
18780 (exit "$ac_status"); } &&
18781 { ac_try='test -s "conftest$ac_exeext"'
18782 { (eval echo "$as_me:18782: \"$ac_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010018783 (eval $ac_try) 2>&5
18784 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040018785 echo "$as_me:18785: \$? = $ac_status" >&5
18786 (exit "$ac_status"); }; }; then
18787 ac_cv_lib_bsd_gettimeofday=yes
18788else
18789 echo "$as_me: failed program was:" >&5
18790cat "conftest.$ac_ext" >&5
18791ac_cv_lib_bsd_gettimeofday=no
18792fi
18793rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
18794LIBS=$ac_check_lib_save_LIBS
18795fi
18796echo "$as_me:18796: result: $ac_cv_lib_bsd_gettimeofday" >&5
18797echo "${ECHO_T}$ac_cv_lib_bsd_gettimeofday" >&6
18798if test "$ac_cv_lib_bsd_gettimeofday" = yes; then
18799
18800cat >>confdefs.h <<\EOF
18801#define HAVE_GETTIMEOFDAY 1
18802EOF
18803
18804cf_add_libs="$LIBS"
18805# reverse order
18806cf_add_0lib=
18807for cf_add_1lib in -lbsd; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
18808# filter duplicates
18809for cf_add_1lib in $cf_add_0lib; do
18810 for cf_add_2lib in $cf_add_libs; do
18811 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
18812 cf_add_1lib=
18813 break
18814 fi
18815 done
18816 test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
18817done
18818LIBS="$cf_add_libs"
18819
18820fi
18821
18822fi
18823fi
18824
18825for ac_func in \
18826getopt \
18827snprintf \
18828strdup \
18829strstr \
18830tsearch \
18831
18832do
18833as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
18834echo "$as_me:18834: checking for $ac_func" >&5
18835echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
18836if eval "test \"\${$as_ac_var+set}\" = set"; then
18837 echo $ECHO_N "(cached) $ECHO_C" >&6
18838else
18839 cat >"conftest.$ac_ext" <<_ACEOF
18840#line 18840 "configure"
18841#include "confdefs.h"
18842#define $ac_func autoconf_temporary
18843#include <limits.h> /* least-intrusive standard header which defines gcc2 __stub macros */
18844#undef $ac_func
18845
18846#ifdef __cplusplus
18847extern "C"
18848#endif
18849
18850/* We use char because int might match the return type of a gcc2
18851 builtin and then its argument prototype would still apply. */
18852char $ac_func (void);
18853
18854int
18855main (void)
18856{
18857
18858/* The GNU C library defines stubs for functions which it implements
18859 to always fail with ENOSYS. Some functions are actually named
18860 something starting with __ and the normal name is an alias. */
18861#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
18862#error found stub for $ac_func
18863#endif
18864
18865 return $ac_func ();
18866 ;
18867 return 0;
18868}
18869_ACEOF
18870rm -f "conftest.$ac_objext" "conftest$ac_exeext"
18871if { (eval echo "$as_me:18871: \"$ac_link\"") >&5
18872 (eval $ac_link) 2>&5
18873 ac_status=$?
18874 echo "$as_me:18874: \$? = $ac_status" >&5
18875 (exit "$ac_status"); } &&
18876 { ac_try='test -s "conftest$ac_exeext"'
18877 { (eval echo "$as_me:18877: \"$ac_try\"") >&5
18878 (eval $ac_try) 2>&5
18879 ac_status=$?
18880 echo "$as_me:18880: \$? = $ac_status" >&5
18881 (exit "$ac_status"); }; }; then
Steve Kondikae271bc2015-11-15 02:50:53 +010018882 eval "$as_ac_var=yes"
18883else
18884 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -040018885cat "conftest.$ac_ext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010018886eval "$as_ac_var=no"
18887fi
micky3879b9f5e72025-07-08 18:04:53 -040018888rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
Steve Kondikae271bc2015-11-15 02:50:53 +010018889fi
micky3879b9f5e72025-07-08 18:04:53 -040018890echo "$as_me:18890: result: `eval echo '${'"$as_ac_var"'}'`" >&5
18891echo "${ECHO_T}`eval echo '${'"$as_ac_var"'}'`" >&6
18892if test "`eval echo '${'"$as_ac_var"'}'`" = yes; then
Steve Kondikae271bc2015-11-15 02:50:53 +010018893 cat >>confdefs.h <<EOF
18894#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
18895EOF
18896
18897fi
18898done
18899
micky3879b9f5e72025-07-08 18:04:53 -040018900# use a compile-check to work with ncurses*-config and subdirectory includes
18901echo "$as_me:18901: checking if we can use termcap.h" >&5
18902echo $ECHO_N "checking if we can use termcap.h... $ECHO_C" >&6
18903if test "${cf_cv_have_termcap_h+set}" = set; then
18904 echo $ECHO_N "(cached) $ECHO_C" >&6
18905else
18906
18907 cat >"conftest.$ac_ext" <<_ACEOF
18908#line 18908 "configure"
18909#include "confdefs.h"
18910
18911#include <curses.h>
18912#ifdef NCURSES_VERSION
18913#undef NCURSES_VERSION
18914#endif
18915#include <termcap.h>
18916#ifndef NCURSES_VERSION
18917#error wrong header
18918#endif
18919
18920int
18921main (void)
18922{
18923return 0;
18924 ;
18925 return 0;
18926}
18927_ACEOF
18928rm -f "conftest.$ac_objext"
18929if { (eval echo "$as_me:18929: \"$ac_compile\"") >&5
18930 (eval $ac_compile) 2>&5
18931 ac_status=$?
18932 echo "$as_me:18932: \$? = $ac_status" >&5
18933 (exit "$ac_status"); } &&
18934 { ac_try='test -s "conftest.$ac_objext"'
18935 { (eval echo "$as_me:18935: \"$ac_try\"") >&5
18936 (eval $ac_try) 2>&5
18937 ac_status=$?
18938 echo "$as_me:18938: \$? = $ac_status" >&5
18939 (exit "$ac_status"); }; }; then
18940 cf_cv_have_termcap_h=yes
18941else
18942 echo "$as_me: failed program was:" >&5
18943cat "conftest.$ac_ext" >&5
18944cf_cv_have_termcap_h=no
18945fi
18946rm -f "conftest.$ac_objext" "conftest.$ac_ext"
18947fi
18948echo "$as_me:18948: result: $cf_cv_have_termcap_h" >&5
18949echo "${ECHO_T}$cf_cv_have_termcap_h" >&6
18950if test "x$cf_cv_have_termcap_h" = xyes
18951then
18952
18953cat >>confdefs.h <<\EOF
18954#define HAVE_TERMCAP_H 1
18955EOF
18956
18957else
18958echo "$as_me:18958: checking if we can use ncurses/termcap.h" >&5
18959echo $ECHO_N "checking if we can use ncurses/termcap.h... $ECHO_C" >&6
18960if test "${cf_cv_have_ncurses_termcap_h+set}" = set; then
18961 echo $ECHO_N "(cached) $ECHO_C" >&6
18962else
18963
18964 cat >"conftest.$ac_ext" <<_ACEOF
18965#line 18965 "configure"
18966#include "confdefs.h"
18967
18968#include <ncurses/curses.h>
18969#ifdef NCURSES_VERSION
18970#undef NCURSES_VERSION
18971#endif
18972#include <ncurses/termcap.h>
18973#ifndef NCURSES_VERSION
18974#error wrong header
18975#endif
18976
18977int
18978main (void)
18979{
18980return 0;
18981 ;
18982 return 0;
18983}
18984_ACEOF
18985rm -f "conftest.$ac_objext"
18986if { (eval echo "$as_me:18986: \"$ac_compile\"") >&5
18987 (eval $ac_compile) 2>&5
18988 ac_status=$?
18989 echo "$as_me:18989: \$? = $ac_status" >&5
18990 (exit "$ac_status"); } &&
18991 { ac_try='test -s "conftest.$ac_objext"'
18992 { (eval echo "$as_me:18992: \"$ac_try\"") >&5
18993 (eval $ac_try) 2>&5
18994 ac_status=$?
18995 echo "$as_me:18995: \$? = $ac_status" >&5
18996 (exit "$ac_status"); }; }; then
18997 cf_cv_have_ncurses_termcap_h=yes
18998else
18999 echo "$as_me: failed program was:" >&5
19000cat "conftest.$ac_ext" >&5
19001cf_cv_have_ncurses_termcap_h=no
19002fi
19003rm -f "conftest.$ac_objext" "conftest.$ac_ext"
19004fi
19005echo "$as_me:19005: result: $cf_cv_have_ncurses_termcap_h" >&5
19006echo "${ECHO_T}$cf_cv_have_ncurses_termcap_h" >&6
19007test "x$cf_cv_have_ncurses_termcap_h" = xyes &&
19008cat >>confdefs.h <<\EOF
19009#define HAVE_NCURSES_TERMCAP_H 1
19010EOF
19011
19012fi
19013
Steve Kondikae271bc2015-11-15 02:50:53 +010019014if test "x$ac_cv_func_getopt" = xno; then
micky3879b9f5e72025-07-08 18:04:53 -040019015 { { echo "$as_me:19015: error: getopt is required for building programs" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010019016echo "$as_me: error: getopt is required for building programs" >&2;}
19017 { (exit 1); exit 1; }; }
19018fi
19019
19020if test "$cf_enable_widec" = yes; then
19021
19022for ac_func in \
19023mblen \
19024mbrlen \
19025mbrtowc \
19026mbsrtowcs \
19027mbstowcs \
19028mbtowc \
19029wcsrtombs \
19030wcstombs \
19031
19032do
19033as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
micky3879b9f5e72025-07-08 18:04:53 -040019034echo "$as_me:19034: checking for $ac_func" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010019035echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
19036if eval "test \"\${$as_ac_var+set}\" = set"; then
19037 echo $ECHO_N "(cached) $ECHO_C" >&6
19038else
micky3879b9f5e72025-07-08 18:04:53 -040019039 cat >"conftest.$ac_ext" <<_ACEOF
19040#line 19040 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +010019041#include "confdefs.h"
micky3879b9f5e72025-07-08 18:04:53 -040019042#define $ac_func autoconf_temporary
19043#include <limits.h> /* least-intrusive standard header which defines gcc2 __stub macros */
19044#undef $ac_func
19045
Steve Kondikae271bc2015-11-15 02:50:53 +010019046#ifdef __cplusplus
19047extern "C"
19048#endif
micky3879b9f5e72025-07-08 18:04:53 -040019049
Steve Kondikae271bc2015-11-15 02:50:53 +010019050/* We use char because int might match the return type of a gcc2
19051 builtin and then its argument prototype would still apply. */
micky3879b9f5e72025-07-08 18:04:53 -040019052char $ac_func (void);
Steve Kondikae271bc2015-11-15 02:50:53 +010019053
19054int
micky3879b9f5e72025-07-08 18:04:53 -040019055main (void)
Steve Kondikae271bc2015-11-15 02:50:53 +010019056{
micky3879b9f5e72025-07-08 18:04:53 -040019057
19058/* The GNU C library defines stubs for functions which it implements
Steve Kondikae271bc2015-11-15 02:50:53 +010019059 to always fail with ENOSYS. Some functions are actually named
19060 something starting with __ and the normal name is an alias. */
19061#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
micky3879b9f5e72025-07-08 18:04:53 -040019062#error found stub for $ac_func
Steve Kondikae271bc2015-11-15 02:50:53 +010019063#endif
19064
micky3879b9f5e72025-07-08 18:04:53 -040019065 return $ac_func ();
Steve Kondikae271bc2015-11-15 02:50:53 +010019066 ;
19067 return 0;
19068}
19069_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -040019070rm -f "conftest.$ac_objext" "conftest$ac_exeext"
19071if { (eval echo "$as_me:19071: \"$ac_link\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010019072 (eval $ac_link) 2>&5
19073 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040019074 echo "$as_me:19074: \$? = $ac_status" >&5
19075 (exit "$ac_status"); } &&
19076 { ac_try='test -s "conftest$ac_exeext"'
19077 { (eval echo "$as_me:19077: \"$ac_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010019078 (eval $ac_try) 2>&5
19079 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040019080 echo "$as_me:19080: \$? = $ac_status" >&5
19081 (exit "$ac_status"); }; }; then
Steve Kondikae271bc2015-11-15 02:50:53 +010019082 eval "$as_ac_var=yes"
19083else
19084 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -040019085cat "conftest.$ac_ext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010019086eval "$as_ac_var=no"
19087fi
micky3879b9f5e72025-07-08 18:04:53 -040019088rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
Steve Kondikae271bc2015-11-15 02:50:53 +010019089fi
micky3879b9f5e72025-07-08 18:04:53 -040019090echo "$as_me:19090: result: `eval echo '${'"$as_ac_var"'}'`" >&5
19091echo "${ECHO_T}`eval echo '${'"$as_ac_var"'}'`" >&6
19092if test "`eval echo '${'"$as_ac_var"'}'`" = yes; then
Steve Kondikae271bc2015-11-15 02:50:53 +010019093 cat >>confdefs.h <<EOF
19094#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
19095EOF
19096
19097fi
19098done
19099
19100fi
19101
micky3879b9f5e72025-07-08 18:04:53 -040019102echo "$as_me:19102: checking definition to turn on extended curses functions" >&5
19103echo $ECHO_N "checking definition to turn on extended curses functions... $ECHO_C" >&6
Steve Kondikae271bc2015-11-15 02:50:53 +010019104if test "${cf_cv_need_xopen_extension+set}" = set; then
19105 echo $ECHO_N "(cached) $ECHO_C" >&6
19106else
19107
micky3879b9f5e72025-07-08 18:04:53 -040019108cf_cv_need_xopen_extension=unknown
19109cat >"conftest.$ac_ext" <<_ACEOF
19110#line 19110 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +010019111#include "confdefs.h"
19112
micky3879b9f5e72025-07-08 18:04:53 -040019113$ac_includes_default
Steve Kondikae271bc2015-11-15 02:50:53 +010019114#include <${cf_cv_ncurses_header:-curses.h}>
19115int
micky3879b9f5e72025-07-08 18:04:53 -040019116main (void)
Steve Kondikae271bc2015-11-15 02:50:53 +010019117{
19118
19119#if defined(NCURSES_VERSION_PATCH)
19120#if (NCURSES_VERSION_PATCH < 20100501) && (NCURSES_VERSION_PATCH >= 20100403)
micky3879b9f5e72025-07-08 18:04:53 -040019121 #error disallow ncurses versions between 2020/04/03 and 2010/05/01
Steve Kondikae271bc2015-11-15 02:50:53 +010019122#endif
19123#endif
micky3879b9f5e72025-07-08 18:04:53 -040019124#ifdef NCURSES_WIDECHAR
19125#error prefer to fall-through on the second checks
19126#endif
19127 static char dummy[10];
Steve Kondikae271bc2015-11-15 02:50:53 +010019128 cchar_t check;
19129 int check2 = curs_set((int)sizeof(check));
micky3879b9f5e72025-07-08 18:04:53 -040019130 long x = winnstr(stdscr, dummy, 5);
Steve Kondikae271bc2015-11-15 02:50:53 +010019131 int x1, y1;
micky3879b9f5e72025-07-08 18:04:53 -040019132 (void)check2;
19133 getbegyx(stdscr, y1, x1);
19134 (void)x;
19135 (void)y1;
19136 (void)x1;
19137
Steve Kondikae271bc2015-11-15 02:50:53 +010019138 ;
19139 return 0;
19140}
19141_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -040019142rm -f "conftest.$ac_objext" "conftest$ac_exeext"
19143if { (eval echo "$as_me:19143: \"$ac_link\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010019144 (eval $ac_link) 2>&5
19145 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040019146 echo "$as_me:19146: \$? = $ac_status" >&5
19147 (exit "$ac_status"); } &&
19148 { ac_try='test -s "conftest$ac_exeext"'
19149 { (eval echo "$as_me:19149: \"$ac_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010019150 (eval $ac_try) 2>&5
19151 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040019152 echo "$as_me:19152: \$? = $ac_status" >&5
19153 (exit "$ac_status"); }; }; then
19154 cf_cv_need_xopen_extension=none
Steve Kondikae271bc2015-11-15 02:50:53 +010019155else
19156 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -040019157cat "conftest.$ac_ext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010019158
micky3879b9f5e72025-07-08 18:04:53 -040019159 for cf_try_xopen_extension in _XOPEN_SOURCE_EXTENDED NCURSES_WIDECHAR
19160 do
19161 cat >"conftest.$ac_ext" <<_ACEOF
19162#line 19162 "configure"
19163#include "confdefs.h"
19164
19165#define $cf_try_xopen_extension 1
19166$ac_includes_default
19167#include <${cf_cv_ncurses_header:-curses.h}>
19168int
19169main (void)
19170{
19171
19172 static char dummy[10];
19173 cchar_t check;
19174 int check2 = curs_set((int)sizeof(check));
19175 long x = winnstr(stdscr, dummy, 5);
19176 int x1, y1;
19177 getbegyx(stdscr, y1, x1);
19178 (void)check2;
19179 (void)x;
19180 (void)y1;
19181 (void)x1;
19182
19183 ;
19184 return 0;
19185}
19186_ACEOF
19187rm -f "conftest.$ac_objext" "conftest$ac_exeext"
19188if { (eval echo "$as_me:19188: \"$ac_link\"") >&5
19189 (eval $ac_link) 2>&5
19190 ac_status=$?
19191 echo "$as_me:19191: \$? = $ac_status" >&5
19192 (exit "$ac_status"); } &&
19193 { ac_try='test -s "conftest$ac_exeext"'
19194 { (eval echo "$as_me:19194: \"$ac_try\"") >&5
19195 (eval $ac_try) 2>&5
19196 ac_status=$?
19197 echo "$as_me:19197: \$? = $ac_status" >&5
19198 (exit "$ac_status"); }; }; then
19199 cf_cv_need_xopen_extension=$cf_try_xopen_extension; break
19200else
19201 echo "$as_me: failed program was:" >&5
19202cat "conftest.$ac_ext" >&5
19203fi
19204rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
19205 done
19206
19207fi
19208rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
19209
19210fi
19211echo "$as_me:19211: result: $cf_cv_need_xopen_extension" >&5
19212echo "${ECHO_T}$cf_cv_need_xopen_extension" >&6
19213
19214case "$cf_cv_need_xopen_extension" in
19215(*_*)
19216
19217 test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
19218 CPPFLAGS="${CPPFLAGS}-D$cf_cv_need_xopen_extension"
19219
19220 ;;
19221esac
19222
19223echo "$as_me:19223: checking for term.h" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010019224echo $ECHO_N "checking for term.h... $ECHO_C" >&6
19225if test "${cf_cv_term_header+set}" = set; then
19226 echo $ECHO_N "(cached) $ECHO_C" >&6
19227else
19228
19229# If we found <ncurses/curses.h>, look for <ncurses/term.h>, but always look
19230# for <term.h> if we do not find the variant.
19231
19232cf_header_list="term.h ncurses/term.h ncursesw/term.h"
19233
micky3879b9f5e72025-07-08 18:04:53 -040019234case "${cf_cv_ncurses_header:-curses.h}" in
Steve Kondikae271bc2015-11-15 02:50:53 +010019235(*/*)
micky3879b9f5e72025-07-08 18:04:53 -040019236 cf_header_item=`echo "${cf_cv_ncurses_header:-curses.h}" | sed -e 's%\..*%%' -e 's%/.*%/%'`term.h
Steve Kondikae271bc2015-11-15 02:50:53 +010019237 cf_header_list="$cf_header_item $cf_header_list"
19238 ;;
19239esac
19240
19241for cf_header in $cf_header_list
19242do
micky3879b9f5e72025-07-08 18:04:53 -040019243 cat >"conftest.$ac_ext" <<_ACEOF
19244#line 19244 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +010019245#include "confdefs.h"
19246
19247#include <${cf_cv_ncurses_header:-curses.h}>
19248#include <${cf_header}>
19249int
micky3879b9f5e72025-07-08 18:04:53 -040019250main (void)
Steve Kondikae271bc2015-11-15 02:50:53 +010019251{
micky3879b9f5e72025-07-08 18:04:53 -040019252WINDOW *x; (void)x
Steve Kondikae271bc2015-11-15 02:50:53 +010019253 ;
19254 return 0;
19255}
19256_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -040019257rm -f "conftest.$ac_objext"
19258if { (eval echo "$as_me:19258: \"$ac_compile\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010019259 (eval $ac_compile) 2>&5
19260 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040019261 echo "$as_me:19261: \$? = $ac_status" >&5
19262 (exit "$ac_status"); } &&
19263 { ac_try='test -s "conftest.$ac_objext"'
19264 { (eval echo "$as_me:19264: \"$ac_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010019265 (eval $ac_try) 2>&5
19266 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040019267 echo "$as_me:19267: \$? = $ac_status" >&5
19268 (exit "$ac_status"); }; }; then
Steve Kondikae271bc2015-11-15 02:50:53 +010019269 cf_cv_term_header=$cf_header
19270 break
19271else
19272 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -040019273cat "conftest.$ac_ext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010019274cf_cv_term_header=no
19275fi
micky3879b9f5e72025-07-08 18:04:53 -040019276rm -f "conftest.$ac_objext" "conftest.$ac_ext"
Steve Kondikae271bc2015-11-15 02:50:53 +010019277done
19278
micky3879b9f5e72025-07-08 18:04:53 -040019279case "$cf_cv_term_header" in
Steve Kondikae271bc2015-11-15 02:50:53 +010019280(no)
19281 # If curses is ncurses, some packagers still mess it up by trying to make
19282 # us use GNU termcap. This handles the most common case.
19283 for cf_header in ncurses/term.h ncursesw/term.h
19284 do
micky3879b9f5e72025-07-08 18:04:53 -040019285 cat >"conftest.$ac_ext" <<_ACEOF
19286#line 19286 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +010019287#include "confdefs.h"
19288
19289#include <${cf_cv_ncurses_header:-curses.h}>
19290#ifdef NCURSES_VERSION
19291#include <${cf_header}>
19292#else
micky3879b9f5e72025-07-08 18:04:53 -040019293#error expected NCURSES_VERSION to be defined
Steve Kondikae271bc2015-11-15 02:50:53 +010019294#endif
19295int
micky3879b9f5e72025-07-08 18:04:53 -040019296main (void)
Steve Kondikae271bc2015-11-15 02:50:53 +010019297{
micky3879b9f5e72025-07-08 18:04:53 -040019298WINDOW *x; (void)x
Steve Kondikae271bc2015-11-15 02:50:53 +010019299 ;
19300 return 0;
19301}
19302_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -040019303rm -f "conftest.$ac_objext"
19304if { (eval echo "$as_me:19304: \"$ac_compile\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010019305 (eval $ac_compile) 2>&5
19306 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040019307 echo "$as_me:19307: \$? = $ac_status" >&5
19308 (exit "$ac_status"); } &&
19309 { ac_try='test -s "conftest.$ac_objext"'
19310 { (eval echo "$as_me:19310: \"$ac_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010019311 (eval $ac_try) 2>&5
19312 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040019313 echo "$as_me:19313: \$? = $ac_status" >&5
19314 (exit "$ac_status"); }; }; then
Steve Kondikae271bc2015-11-15 02:50:53 +010019315 cf_cv_term_header=$cf_header
19316 break
19317else
19318 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -040019319cat "conftest.$ac_ext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010019320cf_cv_term_header=no
19321fi
micky3879b9f5e72025-07-08 18:04:53 -040019322rm -f "conftest.$ac_objext" "conftest.$ac_ext"
Steve Kondikae271bc2015-11-15 02:50:53 +010019323 done
19324 ;;
19325esac
19326
19327fi
micky3879b9f5e72025-07-08 18:04:53 -040019328echo "$as_me:19328: result: $cf_cv_term_header" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010019329echo "${ECHO_T}$cf_cv_term_header" >&6
19330
micky3879b9f5e72025-07-08 18:04:53 -040019331case "$cf_cv_term_header" in
Steve Kondikae271bc2015-11-15 02:50:53 +010019332(term.h)
19333
19334cat >>confdefs.h <<\EOF
19335#define HAVE_TERM_H 1
19336EOF
19337
19338 ;;
19339(ncurses/term.h)
19340
19341cat >>confdefs.h <<\EOF
19342#define HAVE_NCURSES_TERM_H 1
19343EOF
19344
19345 ;;
19346(ncursesw/term.h)
19347
19348cat >>confdefs.h <<\EOF
19349#define HAVE_NCURSESW_TERM_H 1
19350EOF
19351
19352 ;;
19353esac
19354
micky3879b9f5e72025-07-08 18:04:53 -040019355echo "$as_me:19355: checking for unctrl.h" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010019356echo $ECHO_N "checking for unctrl.h... $ECHO_C" >&6
19357if test "${cf_cv_unctrl_header+set}" = set; then
19358 echo $ECHO_N "(cached) $ECHO_C" >&6
19359else
19360
19361# If we found <ncurses/curses.h>, look for <ncurses/unctrl.h>, but always look
19362# for <unctrl.h> if we do not find the variant.
19363
19364cf_header_list="unctrl.h ncurses/unctrl.h ncursesw/unctrl.h"
19365
micky3879b9f5e72025-07-08 18:04:53 -040019366case "${cf_cv_ncurses_header:-curses.h}" in
Steve Kondikae271bc2015-11-15 02:50:53 +010019367(*/*)
micky3879b9f5e72025-07-08 18:04:53 -040019368 cf_header_item=`echo "${cf_cv_ncurses_header:-curses.h}" | sed -e 's%\..*%%' -e 's%/.*%/%'`unctrl.h
Steve Kondikae271bc2015-11-15 02:50:53 +010019369 cf_header_list="$cf_header_item $cf_header_list"
19370 ;;
19371esac
19372
19373for cf_header in $cf_header_list
19374do
micky3879b9f5e72025-07-08 18:04:53 -040019375 cat >"conftest.$ac_ext" <<_ACEOF
19376#line 19376 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +010019377#include "confdefs.h"
19378
19379#include <${cf_cv_ncurses_header:-curses.h}>
19380#include <${cf_header}>
19381int
micky3879b9f5e72025-07-08 18:04:53 -040019382main (void)
Steve Kondikae271bc2015-11-15 02:50:53 +010019383{
micky3879b9f5e72025-07-08 18:04:53 -040019384WINDOW *x; (void)x
Steve Kondikae271bc2015-11-15 02:50:53 +010019385 ;
19386 return 0;
19387}
19388_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -040019389rm -f "conftest.$ac_objext"
19390if { (eval echo "$as_me:19390: \"$ac_compile\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010019391 (eval $ac_compile) 2>&5
19392 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040019393 echo "$as_me:19393: \$? = $ac_status" >&5
19394 (exit "$ac_status"); } &&
19395 { ac_try='test -s "conftest.$ac_objext"'
19396 { (eval echo "$as_me:19396: \"$ac_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010019397 (eval $ac_try) 2>&5
19398 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040019399 echo "$as_me:19399: \$? = $ac_status" >&5
19400 (exit "$ac_status"); }; }; then
Steve Kondikae271bc2015-11-15 02:50:53 +010019401 cf_cv_unctrl_header=$cf_header
19402 break
19403else
19404 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -040019405cat "conftest.$ac_ext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010019406cf_cv_unctrl_header=no
19407fi
micky3879b9f5e72025-07-08 18:04:53 -040019408rm -f "conftest.$ac_objext" "conftest.$ac_ext"
Steve Kondikae271bc2015-11-15 02:50:53 +010019409done
19410
19411fi
micky3879b9f5e72025-07-08 18:04:53 -040019412echo "$as_me:19412: result: $cf_cv_unctrl_header" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010019413echo "${ECHO_T}$cf_cv_unctrl_header" >&6
19414
micky3879b9f5e72025-07-08 18:04:53 -040019415case "$cf_cv_unctrl_header" in
Steve Kondikae271bc2015-11-15 02:50:53 +010019416(no)
micky3879b9f5e72025-07-08 18:04:53 -040019417 { echo "$as_me:19417: WARNING: unctrl.h header not found" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010019418echo "$as_me: WARNING: unctrl.h header not found" >&2;}
19419 ;;
19420esac
19421
micky3879b9f5e72025-07-08 18:04:53 -040019422case "$cf_cv_unctrl_header" in
Steve Kondikae271bc2015-11-15 02:50:53 +010019423(unctrl.h)
19424
19425cat >>confdefs.h <<\EOF
19426#define HAVE_UNCTRL_H 1
19427EOF
19428
19429 ;;
19430(ncurses/unctrl.h)
19431
19432cat >>confdefs.h <<\EOF
19433#define HAVE_NCURSES_UNCTRL_H 1
19434EOF
19435
19436 ;;
19437(ncursesw/unctrl.h)
19438
19439cat >>confdefs.h <<\EOF
19440#define HAVE_NCURSESW_UNCTRL_H 1
19441EOF
19442
19443 ;;
19444esac
19445
19446for cf_func in \
micky3879b9f5e72025-07-08 18:04:53 -040019447_nc_tparm_analyze \
19448_tracef \
19449alloc_pair \
Steve Kondikae271bc2015-11-15 02:50:53 +010019450assume_default_colors \
19451chgat \
micky3879b9f5e72025-07-08 18:04:53 -040019452color_content \
Steve Kondikae271bc2015-11-15 02:50:53 +010019453color_set \
micky3879b9f5e72025-07-08 18:04:53 -040019454copywin \
19455curses_trace \
19456delscreen \
19457dupwin \
19458exit_curses \
19459exit_terminfo \
Steve Kondikae271bc2015-11-15 02:50:53 +010019460filter \
19461getbegx \
19462getcurx \
19463getmaxx \
19464getnstr \
19465getparx \
19466getwin \
micky3879b9f5e72025-07-08 18:04:53 -040019467halfdelay \
19468init_extended_color \
19469mvderwin \
Steve Kondikae271bc2015-11-15 02:50:53 +010019470mvvline \
micky3879b9f5e72025-07-08 18:04:53 -040019471mvwin \
Steve Kondikae271bc2015-11-15 02:50:53 +010019472mvwvline \
19473napms \
micky3879b9f5e72025-07-08 18:04:53 -040019474newpad \
Steve Kondikae271bc2015-11-15 02:50:53 +010019475putwin \
micky3879b9f5e72025-07-08 18:04:53 -040019476reset_color_pairs \
Steve Kondikae271bc2015-11-15 02:50:53 +010019477resize_term \
19478resizeterm \
micky3879b9f5e72025-07-08 18:04:53 -040019479restartterm \
Steve Kondikae271bc2015-11-15 02:50:53 +010019480ripoffline \
19481scr_dump \
19482setupterm \
19483slk_color \
19484slk_init \
19485termattrs \
micky3879b9f5e72025-07-08 18:04:53 -040019486termname \
Steve Kondikae271bc2015-11-15 02:50:53 +010019487tgetent \
19488tigetnum \
19489tigetstr \
micky3879b9f5e72025-07-08 18:04:53 -040019490tiparm \
19491tiparm_s \
19492tiscan_s \
19493tputs_sp \
Steve Kondikae271bc2015-11-15 02:50:53 +010019494typeahead \
micky3879b9f5e72025-07-08 18:04:53 -040019495unget_wch \
Steve Kondikae271bc2015-11-15 02:50:53 +010019496use_default_colors \
19497use_env \
19498use_extended_names \
19499use_screen \
19500use_window \
19501vid_puts \
19502vidputs \
19503vsscanf \
19504vw_printw \
19505wchgat \
micky3879b9f5e72025-07-08 18:04:53 -040019506winsdelln \
Steve Kondikae271bc2015-11-15 02:50:53 +010019507winsstr \
19508wresize \
19509wsyncdown \
19510
19511do
19512
19513cf_tr_func=`echo "$cf_func" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
19514
micky3879b9f5e72025-07-08 18:04:53 -040019515 echo "$as_me:19515: checking for ${cf_func}" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010019516echo $ECHO_N "checking for ${cf_func}... $ECHO_C" >&6
19517
micky3879b9f5e72025-07-08 18:04:53 -040019518echo "${as_me:-configure}:19518: testing ${cf_func} ..." 1>&5
Steve Kondikae271bc2015-11-15 02:50:53 +010019519
19520 if eval "test \"\${cf_cv_func_$cf_func+set}\" = set"; then
19521 echo $ECHO_N "(cached) $ECHO_C" >&6
19522else
19523
19524 eval cf_result='$ac_cv_func_'$cf_func
19525 if test ".$cf_result" != ".no"; then
micky3879b9f5e72025-07-08 18:04:53 -040019526 cat >"conftest.$ac_ext" <<_ACEOF
19527#line 19527 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +010019528#include "confdefs.h"
19529
19530#ifdef HAVE_XCURSES
19531#include <xcurses.h>
19532char * XCursesProgramName = "test";
19533#else
19534#include <${cf_cv_ncurses_header:-curses.h}>
19535#if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
19536#include <ncursesw/term.h>
19537#elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
19538#include <ncurses/term.h>
19539#elif defined(HAVE_TERM_H)
19540#include <term.h>
19541#endif
19542#endif
19543
19544int
micky3879b9f5e72025-07-08 18:04:53 -040019545main (void)
Steve Kondikae271bc2015-11-15 02:50:53 +010019546{
19547
19548#ifndef ${cf_func}
19549long foo = (long)(&${cf_func});
micky3879b9f5e72025-07-08 18:04:53 -040019550fprintf(stderr, "testing linkage of $cf_func:%p\\n", (void *)foo);
19551if (foo + 1234L > 5678L)
19552 ${cf_cv_main_return:-return}(foo != 0);
Steve Kondikae271bc2015-11-15 02:50:53 +010019553#endif
19554
19555 ;
19556 return 0;
19557}
19558_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -040019559rm -f "conftest.$ac_objext" "conftest$ac_exeext"
19560if { (eval echo "$as_me:19560: \"$ac_link\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010019561 (eval $ac_link) 2>&5
19562 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040019563 echo "$as_me:19563: \$? = $ac_status" >&5
19564 (exit "$ac_status"); } &&
19565 { ac_try='test -s "conftest$ac_exeext"'
19566 { (eval echo "$as_me:19566: \"$ac_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010019567 (eval $ac_try) 2>&5
19568 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040019569 echo "$as_me:19569: \$? = $ac_status" >&5
19570 (exit "$ac_status"); }; }; then
Steve Kondikae271bc2015-11-15 02:50:53 +010019571 cf_result=yes
19572else
19573 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -040019574cat "conftest.$ac_ext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010019575cf_result=no
19576fi
micky3879b9f5e72025-07-08 18:04:53 -040019577rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
Steve Kondikae271bc2015-11-15 02:50:53 +010019578 fi
micky3879b9f5e72025-07-08 18:04:53 -040019579 eval 'cf_cv_func_'$cf_func'="$cf_result"'
Steve Kondikae271bc2015-11-15 02:50:53 +010019580
19581fi
19582
19583 # use the computed/retrieved cache-value:
19584 eval 'cf_result=$cf_cv_func_'$cf_func
micky3879b9f5e72025-07-08 18:04:53 -040019585 echo "$as_me:19585: result: $cf_result" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010019586echo "${ECHO_T}$cf_result" >&6
micky3879b9f5e72025-07-08 18:04:53 -040019587 if test "$cf_result" != no; then
Steve Kondikae271bc2015-11-15 02:50:53 +010019588 cat >>confdefs.h <<EOF
19589#define HAVE_${cf_tr_func} 1
19590EOF
19591
19592 fi
19593done
19594
19595for cf_func in tputs
19596do
19597
19598cf_tr_func=`echo "$cf_func" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
19599
micky3879b9f5e72025-07-08 18:04:53 -040019600 echo "$as_me:19600: checking for ${cf_func}" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010019601echo $ECHO_N "checking for ${cf_func}... $ECHO_C" >&6
19602
micky3879b9f5e72025-07-08 18:04:53 -040019603echo "${as_me:-configure}:19603: testing ${cf_func} ..." 1>&5
Steve Kondikae271bc2015-11-15 02:50:53 +010019604
19605 if eval "test \"\${cf_cv_func_$cf_func+set}\" = set"; then
19606 echo $ECHO_N "(cached) $ECHO_C" >&6
19607else
19608
19609 eval cf_result='$ac_cv_func_'$cf_func
19610 if test ".$cf_result" != ".no"; then
micky3879b9f5e72025-07-08 18:04:53 -040019611 cat >"conftest.$ac_ext" <<_ACEOF
19612#line 19612 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +010019613#include "confdefs.h"
19614
19615#ifdef HAVE_XCURSES
19616#include <xcurses.h>
19617char * XCursesProgramName = "test";
19618#else
19619#include <${cf_cv_ncurses_header:-curses.h}>
19620#if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
19621#include <ncursesw/term.h>
19622#elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
19623#include <ncurses/term.h>
19624#elif defined(HAVE_TERM_H)
19625#include <term.h>
19626#endif
19627#endif
19628
19629int
micky3879b9f5e72025-07-08 18:04:53 -040019630main (void)
Steve Kondikae271bc2015-11-15 02:50:53 +010019631{
19632
19633#ifndef ${cf_func}
19634long foo = (long)(&${cf_func});
micky3879b9f5e72025-07-08 18:04:53 -040019635fprintf(stderr, "testing linkage of $cf_func:%p\\n", (void *)foo);
19636if (foo + 1234L > 5678L)
19637 ${cf_cv_main_return:-return}(foo != 0);
Steve Kondikae271bc2015-11-15 02:50:53 +010019638#endif
19639
19640 ;
19641 return 0;
19642}
19643_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -040019644rm -f "conftest.$ac_objext" "conftest$ac_exeext"
19645if { (eval echo "$as_me:19645: \"$ac_link\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010019646 (eval $ac_link) 2>&5
19647 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040019648 echo "$as_me:19648: \$? = $ac_status" >&5
19649 (exit "$ac_status"); } &&
19650 { ac_try='test -s "conftest$ac_exeext"'
19651 { (eval echo "$as_me:19651: \"$ac_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010019652 (eval $ac_try) 2>&5
19653 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040019654 echo "$as_me:19654: \$? = $ac_status" >&5
19655 (exit "$ac_status"); }; }; then
Steve Kondikae271bc2015-11-15 02:50:53 +010019656 cf_result=yes
19657else
19658 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -040019659cat "conftest.$ac_ext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010019660cf_result=no
19661fi
micky3879b9f5e72025-07-08 18:04:53 -040019662rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
Steve Kondikae271bc2015-11-15 02:50:53 +010019663 fi
micky3879b9f5e72025-07-08 18:04:53 -040019664 eval 'cf_cv_func_'$cf_func'="$cf_result"'
Steve Kondikae271bc2015-11-15 02:50:53 +010019665
19666fi
19667
19668 # use the computed/retrieved cache-value:
19669 eval 'cf_result=$cf_cv_func_'$cf_func
micky3879b9f5e72025-07-08 18:04:53 -040019670 echo "$as_me:19670: result: $cf_result" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010019671echo "${ECHO_T}$cf_result" >&6
micky3879b9f5e72025-07-08 18:04:53 -040019672 if test "$cf_result" != no; then
Steve Kondikae271bc2015-11-15 02:50:53 +010019673 cat >>confdefs.h <<EOF
19674#define HAVE_${cf_tr_func} 1
19675EOF
19676
19677 fi
19678done
19679
micky3879b9f5e72025-07-08 18:04:53 -040019680if test "x$cf_cv_func_tputs" = xyes
Steve Kondikae271bc2015-11-15 02:50:53 +010019681then
19682 cf_done=no
19683 for cf_arg in int char
19684 do
19685 for cf_ret in int void
19686 do
micky3879b9f5e72025-07-08 18:04:53 -040019687 if test "$cf_ret" = void
Steve Kondikae271bc2015-11-15 02:50:53 +010019688 then
19689 cf_return="/* nothing */"
19690 else
19691 cf_return="return value"
19692 fi
micky3879b9f5e72025-07-08 18:04:53 -040019693 cat >"conftest.$ac_ext" <<_ACEOF
19694#line 19694 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +010019695#include "confdefs.h"
19696
19697#include <${cf_cv_ncurses_header:-curses.h}>
19698#include <$cf_cv_term_header>
19699
19700static $cf_ret outc($cf_arg value) { $cf_return; }
19701
19702int
micky3879b9f5e72025-07-08 18:04:53 -040019703main (void)
Steve Kondikae271bc2015-11-15 02:50:53 +010019704{
19705
19706 tputs("hello", 0, outc);
19707 ${cf_cv_main_return:-return}(0);
19708
19709 ;
19710 return 0;
19711}
19712_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -040019713rm -f "conftest.$ac_objext"
19714if { (eval echo "$as_me:19714: \"$ac_compile\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010019715 (eval $ac_compile) 2>&5
19716 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040019717 echo "$as_me:19717: \$? = $ac_status" >&5
19718 (exit "$ac_status"); } &&
19719 { ac_try='test -s "conftest.$ac_objext"'
19720 { (eval echo "$as_me:19720: \"$ac_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010019721 (eval $ac_try) 2>&5
19722 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040019723 echo "$as_me:19723: \$? = $ac_status" >&5
19724 (exit "$ac_status"); }; }; then
Steve Kondikae271bc2015-11-15 02:50:53 +010019725
19726 test -n "$verbose" && echo " prototype $cf_ret func($cf_arg value)" 1>&6
19727
micky3879b9f5e72025-07-08 18:04:53 -040019728echo "${as_me:-configure}:19728: testing prototype $cf_ret func($cf_arg value) ..." 1>&5
Steve Kondikae271bc2015-11-15 02:50:53 +010019729
19730 cat >>confdefs.h <<EOF
19731#define TPUTS_ARG $cf_arg
19732#define TPUTS_PROTO(func,value) $cf_ret func(TPUTS_ARG value)
19733#define TPUTS_RETURN(value) $cf_return
19734EOF
19735 cf_done=yes
19736 break
19737
19738else
19739 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -040019740cat "conftest.$ac_ext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010019741fi
micky3879b9f5e72025-07-08 18:04:53 -040019742rm -f "conftest.$ac_objext" "conftest.$ac_ext"
Steve Kondikae271bc2015-11-15 02:50:53 +010019743 done
micky3879b9f5e72025-07-08 18:04:53 -040019744 test "$cf_done" = yes && break
Steve Kondikae271bc2015-11-15 02:50:53 +010019745 done
19746fi
19747
micky3879b9f5e72025-07-08 18:04:53 -040019748echo "$as_me:19748: checking for ncurses extended functions" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010019749echo $ECHO_N "checking for ncurses extended functions... $ECHO_C" >&6
19750if test "${cf_cv_ncurses_ext_funcs+set}" = set; then
19751 echo $ECHO_N "(cached) $ECHO_C" >&6
19752else
19753
micky3879b9f5e72025-07-08 18:04:53 -040019754cat >"conftest.$ac_ext" <<_ACEOF
19755#line 19755 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +010019756#include "confdefs.h"
19757
19758#include <${cf_cv_ncurses_header:-curses.h}>
19759int
micky3879b9f5e72025-07-08 18:04:53 -040019760main (void)
Steve Kondikae271bc2015-11-15 02:50:53 +010019761{
19762
19763int x = NCURSES_EXT_FUNCS
19764
19765 ;
19766 return 0;
19767}
19768_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -040019769rm -f "conftest.$ac_objext"
19770if { (eval echo "$as_me:19770: \"$ac_compile\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010019771 (eval $ac_compile) 2>&5
19772 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040019773 echo "$as_me:19773: \$? = $ac_status" >&5
19774 (exit "$ac_status"); } &&
19775 { ac_try='test -s "conftest.$ac_objext"'
19776 { (eval echo "$as_me:19776: \"$ac_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010019777 (eval $ac_try) 2>&5
19778 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040019779 echo "$as_me:19779: \$? = $ac_status" >&5
19780 (exit "$ac_status"); }; }; then
Steve Kondikae271bc2015-11-15 02:50:53 +010019781 cf_cv_ncurses_ext_funcs=defined
19782else
19783 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -040019784cat "conftest.$ac_ext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010019785
micky3879b9f5e72025-07-08 18:04:53 -040019786cat >"conftest.$ac_ext" <<_ACEOF
19787#line 19787 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +010019788#include "confdefs.h"
19789
19790#include <${cf_cv_ncurses_header:-curses.h}>
19791int
micky3879b9f5e72025-07-08 18:04:53 -040019792main (void)
Steve Kondikae271bc2015-11-15 02:50:53 +010019793{
19794
19795 (void) assume_default_colors (0, 0);
19796 (void) curses_version ();
19797 (void) define_key (0, 0);
19798 (void) is_term_resized (0, 0);
19799 (void) key_defined (0);
19800 (void) keybound (0, 0);
19801 (void) keyok (0, 0);
19802 (void) resize_term (0, 0);
19803 (void) resizeterm (0, 0);
19804 (void) use_default_colors ();
19805 (void) use_extended_names (0);
19806 (void) wresize (0, 0, 0);
19807 ;
19808 return 0;
19809}
19810_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -040019811rm -f "conftest.$ac_objext" "conftest$ac_exeext"
19812if { (eval echo "$as_me:19812: \"$ac_link\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010019813 (eval $ac_link) 2>&5
19814 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040019815 echo "$as_me:19815: \$? = $ac_status" >&5
19816 (exit "$ac_status"); } &&
19817 { ac_try='test -s "conftest$ac_exeext"'
19818 { (eval echo "$as_me:19818: \"$ac_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010019819 (eval $ac_try) 2>&5
19820 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040019821 echo "$as_me:19821: \$? = $ac_status" >&5
19822 (exit "$ac_status"); }; }; then
Steve Kondikae271bc2015-11-15 02:50:53 +010019823 cf_cv_ncurses_ext_funcs=yes
19824else
19825 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -040019826cat "conftest.$ac_ext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010019827cf_cv_ncurses_ext_funcs=no
19828fi
micky3879b9f5e72025-07-08 18:04:53 -040019829rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
Steve Kondikae271bc2015-11-15 02:50:53 +010019830
19831fi
micky3879b9f5e72025-07-08 18:04:53 -040019832rm -f "conftest.$ac_objext" "conftest.$ac_ext"
Steve Kondikae271bc2015-11-15 02:50:53 +010019833
19834fi
micky3879b9f5e72025-07-08 18:04:53 -040019835echo "$as_me:19835: result: $cf_cv_ncurses_ext_funcs" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010019836echo "${ECHO_T}$cf_cv_ncurses_ext_funcs" >&6
19837test "$cf_cv_ncurses_ext_funcs" = yes &&
19838cat >>confdefs.h <<\EOF
19839#define NCURSES_EXT_FUNCS 1
19840EOF
19841
19842if test "$cf_enable_widec" = yes
19843then
19844 # workaround for systems with ncurses before 20111029, due to change of
19845 # feature test macro from _XPG5 to _XOPEN_SOURCE
19846 if test -n "$cf_cv_ncurses_version" && test "x$cf_cv_ncurses_version" != xno
19847 then
19848 cf_define_xpg5=no
micky3879b9f5e72025-07-08 18:04:53 -040019849 echo "$as_me:19849: checking if _XPG5 should be defined to enable wide-characters" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010019850echo $ECHO_N "checking if _XPG5 should be defined to enable wide-characters... $ECHO_C" >&6
19851
micky3879b9f5e72025-07-08 18:04:53 -040019852 cat >"conftest.$ac_ext" <<_ACEOF
19853#line 19853 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +010019854#include "confdefs.h"
19855
19856#include <${cf_cv_ncurses_header:-curses.h}>
19857int
micky3879b9f5e72025-07-08 18:04:53 -040019858main (void)
Steve Kondikae271bc2015-11-15 02:50:53 +010019859{
19860int x = _XPG5
19861 ;
19862 return 0;
19863}
19864_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -040019865rm -f "conftest.$ac_objext"
19866if { (eval echo "$as_me:19866: \"$ac_compile\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010019867 (eval $ac_compile) 2>&5
19868 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040019869 echo "$as_me:19869: \$? = $ac_status" >&5
19870 (exit "$ac_status"); } &&
19871 { ac_try='test -s "conftest.$ac_objext"'
19872 { (eval echo "$as_me:19872: \"$ac_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010019873 (eval $ac_try) 2>&5
19874 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040019875 echo "$as_me:19875: \$? = $ac_status" >&5
19876 (exit "$ac_status"); }; }; then
Steve Kondikae271bc2015-11-15 02:50:53 +010019877 :
19878else
19879 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -040019880cat "conftest.$ac_ext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010019881cf_save_cppflags="$CPPFLAGS"
19882 CPPFLAGS="$CPPFLAGS -D_XPG5"
micky3879b9f5e72025-07-08 18:04:53 -040019883 cat >"conftest.$ac_ext" <<_ACEOF
19884#line 19884 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +010019885#include "confdefs.h"
19886
19887#include <${cf_cv_ncurses_header:-curses.h}>
19888int
micky3879b9f5e72025-07-08 18:04:53 -040019889main (void)
Steve Kondikae271bc2015-11-15 02:50:53 +010019890{
19891int x = _XPG5
19892 ;
19893 return 0;
19894}
19895_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -040019896rm -f "conftest.$ac_objext"
19897if { (eval echo "$as_me:19897: \"$ac_compile\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010019898 (eval $ac_compile) 2>&5
19899 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040019900 echo "$as_me:19900: \$? = $ac_status" >&5
19901 (exit "$ac_status"); } &&
19902 { ac_try='test -s "conftest.$ac_objext"'
19903 { (eval echo "$as_me:19903: \"$ac_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010019904 (eval $ac_try) 2>&5
19905 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040019906 echo "$as_me:19906: \$? = $ac_status" >&5
19907 (exit "$ac_status"); }; }; then
Steve Kondikae271bc2015-11-15 02:50:53 +010019908 cf_define_xpg5=yes
19909else
19910 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -040019911cat "conftest.$ac_ext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010019912fi
micky3879b9f5e72025-07-08 18:04:53 -040019913rm -f "conftest.$ac_objext" "conftest.$ac_ext"
Steve Kondikae271bc2015-11-15 02:50:53 +010019914 CPPFLAGS="$cf_save_cppflags"
19915fi
micky3879b9f5e72025-07-08 18:04:53 -040019916rm -f "conftest.$ac_objext" "conftest.$ac_ext"
19917 echo "$as_me:19917: result: $cf_define_xpg5" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010019918echo "${ECHO_T}$cf_define_xpg5" >&6
19919
19920 if test "$cf_define_xpg5" = yes
19921 then
19922 CPPFLAGS="$CPPFLAGS -D_XPG5"
19923 fi
19924 fi
19925
micky3879b9f5e72025-07-08 18:04:53 -040019926 echo "$as_me:19926: checking for wide-character functions" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010019927echo $ECHO_N "checking for wide-character functions... $ECHO_C" >&6
19928if test "${cf_cv_widechar_funcs+set}" = set; then
19929 echo $ECHO_N "(cached) $ECHO_C" >&6
19930else
19931
micky3879b9f5e72025-07-08 18:04:53 -040019932 cat >"conftest.$ac_ext" <<_ACEOF
19933#line 19933 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +010019934#include "confdefs.h"
19935
19936#include <${cf_cv_ncurses_header:-curses.h}>
19937int
micky3879b9f5e72025-07-08 18:04:53 -040019938main (void)
Steve Kondikae271bc2015-11-15 02:50:53 +010019939{
19940
19941 static wchar_t src_wchar[2];
19942 static cchar_t dst_cchar;
19943 setcchar(&dst_cchar, src_wchar, A_NORMAL, 0, (void *) 0);
19944
19945 ;
19946 return 0;
19947}
19948_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -040019949rm -f "conftest.$ac_objext" "conftest$ac_exeext"
19950if { (eval echo "$as_me:19950: \"$ac_link\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010019951 (eval $ac_link) 2>&5
19952 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040019953 echo "$as_me:19953: \$? = $ac_status" >&5
19954 (exit "$ac_status"); } &&
19955 { ac_try='test -s "conftest$ac_exeext"'
19956 { (eval echo "$as_me:19956: \"$ac_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010019957 (eval $ac_try) 2>&5
19958 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040019959 echo "$as_me:19959: \$? = $ac_status" >&5
19960 (exit "$ac_status"); }; }; then
Steve Kondikae271bc2015-11-15 02:50:53 +010019961 cf_cv_widechar_funcs=yes
19962else
19963 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -040019964cat "conftest.$ac_ext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010019965cf_cv_widechar_funcs=no
19966fi
micky3879b9f5e72025-07-08 18:04:53 -040019967rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
Steve Kondikae271bc2015-11-15 02:50:53 +010019968
19969fi
micky3879b9f5e72025-07-08 18:04:53 -040019970echo "$as_me:19970: result: $cf_cv_widechar_funcs" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010019971echo "${ECHO_T}$cf_cv_widechar_funcs" >&6
19972 if test "$cf_cv_widechar_funcs" != no ; then
19973
19974cat >>confdefs.h <<\EOF
19975#define USE_WIDEC_SUPPORT 1
19976EOF
19977
19978 else
19979 cat >>confdefs.h <<\EOF
19980#define USE_WIDEC_SUPPORT 0
19981EOF
19982
19983 fi
19984else
19985 cat >>confdefs.h <<\EOF
19986#define USE_WIDEC_SUPPORT 0
19987EOF
19988
19989fi
19990
micky3879b9f5e72025-07-08 18:04:53 -040019991echo "$as_me:19991: checking if $cf_cv_screen library uses pthreads" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010019992echo $ECHO_N "checking if $cf_cv_screen library uses pthreads... $ECHO_C" >&6
19993if test "${cf_cv_use_pthreads+set}" = set; then
19994 echo $ECHO_N "(cached) $ECHO_C" >&6
19995else
19996
micky3879b9f5e72025-07-08 18:04:53 -040019997cat >"conftest.$ac_ext" <<_ACEOF
19998#line 19998 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +010019999#include "confdefs.h"
20000
20001#include <${cf_cv_ncurses_header:-curses.h}>
20002extern void _nc_init_pthreads(void);
20003
20004int
micky3879b9f5e72025-07-08 18:04:53 -040020005main (void)
Steve Kondikae271bc2015-11-15 02:50:53 +010020006{
20007
20008 initscr();
20009 _nc_init_pthreads();
20010
20011 ;
20012 return 0;
20013}
20014_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -040020015rm -f "conftest.$ac_objext" "conftest$ac_exeext"
20016if { (eval echo "$as_me:20016: \"$ac_link\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010020017 (eval $ac_link) 2>&5
20018 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040020019 echo "$as_me:20019: \$? = $ac_status" >&5
20020 (exit "$ac_status"); } &&
20021 { ac_try='test -s "conftest$ac_exeext"'
20022 { (eval echo "$as_me:20022: \"$ac_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010020023 (eval $ac_try) 2>&5
20024 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040020025 echo "$as_me:20025: \$? = $ac_status" >&5
20026 (exit "$ac_status"); }; }; then
Steve Kondikae271bc2015-11-15 02:50:53 +010020027 cf_cv_use_pthreads=yes
20028else
20029 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -040020030cat "conftest.$ac_ext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010020031cf_cv_use_pthreads=no
20032fi
micky3879b9f5e72025-07-08 18:04:53 -040020033rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
Steve Kondikae271bc2015-11-15 02:50:53 +010020034
20035fi
micky3879b9f5e72025-07-08 18:04:53 -040020036echo "$as_me:20036: result: $cf_cv_use_pthreads" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010020037echo "${ECHO_T}$cf_cv_use_pthreads" >&6
micky3879b9f5e72025-07-08 18:04:53 -040020038test $cf_cv_use_pthreads = yes &&
20039cat >>confdefs.h <<\EOF
Steve Kondikae271bc2015-11-15 02:50:53 +010020040#define USE_PTHREADS 1
20041EOF
20042
micky3879b9f5e72025-07-08 18:04:53 -040020043echo "$as_me:20043: checking if sys/time.h works with sys/select.h" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010020044echo $ECHO_N "checking if sys/time.h works with sys/select.h... $ECHO_C" >&6
20045if test "${cf_cv_sys_time_select+set}" = set; then
20046 echo $ECHO_N "(cached) $ECHO_C" >&6
20047else
20048
micky3879b9f5e72025-07-08 18:04:53 -040020049cat >"conftest.$ac_ext" <<_ACEOF
20050#line 20050 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +010020051#include "confdefs.h"
20052
20053#include <sys/types.h>
20054#ifdef HAVE_SYS_TIME_H
20055#include <sys/time.h>
20056#endif
20057#ifdef HAVE_SYS_SELECT_H
20058#include <sys/select.h>
20059#endif
20060
20061int
micky3879b9f5e72025-07-08 18:04:53 -040020062main (void)
Steve Kondikae271bc2015-11-15 02:50:53 +010020063{
20064
20065 ;
20066 return 0;
20067}
20068_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -040020069rm -f "conftest.$ac_objext"
20070if { (eval echo "$as_me:20070: \"$ac_compile\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010020071 (eval $ac_compile) 2>&5
20072 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040020073 echo "$as_me:20073: \$? = $ac_status" >&5
20074 (exit "$ac_status"); } &&
20075 { ac_try='test -s "conftest.$ac_objext"'
20076 { (eval echo "$as_me:20076: \"$ac_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010020077 (eval $ac_try) 2>&5
20078 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040020079 echo "$as_me:20079: \$? = $ac_status" >&5
20080 (exit "$ac_status"); }; }; then
Steve Kondikae271bc2015-11-15 02:50:53 +010020081 cf_cv_sys_time_select=yes
20082else
20083 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -040020084cat "conftest.$ac_ext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010020085cf_cv_sys_time_select=no
20086fi
micky3879b9f5e72025-07-08 18:04:53 -040020087rm -f "conftest.$ac_objext" "conftest.$ac_ext"
Steve Kondikae271bc2015-11-15 02:50:53 +010020088
20089fi
20090
micky3879b9f5e72025-07-08 18:04:53 -040020091echo "$as_me:20091: result: $cf_cv_sys_time_select" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010020092echo "${ECHO_T}$cf_cv_sys_time_select" >&6
20093test "$cf_cv_sys_time_select" = yes &&
20094cat >>confdefs.h <<\EOF
20095#define HAVE_SYS_TIME_SELECT 1
20096EOF
20097
micky3879b9f5e72025-07-08 18:04:53 -040020098# special check for test/ditto.c
20099
20100echo "$as_me:20100: checking for openpty in -lutil" >&5
20101echo $ECHO_N "checking for openpty in -lutil... $ECHO_C" >&6
20102if test "${ac_cv_lib_util_openpty+set}" = set; then
20103 echo $ECHO_N "(cached) $ECHO_C" >&6
20104else
20105 ac_check_lib_save_LIBS=$LIBS
20106LIBS="-lutil $LIBS"
20107cat >"conftest.$ac_ext" <<_ACEOF
20108#line 20108 "configure"
20109#include "confdefs.h"
20110
20111/* Override any gcc2 internal prototype to avoid an error. */
20112#ifdef __cplusplus
20113extern "C"
20114#endif
20115/* We use char because int might match the return type of a gcc2
20116 builtin and then its argument prototype would still apply. */
20117char openpty (void);
20118int
20119main (void)
20120{
20121openpty ();
20122 ;
20123 return 0;
20124}
20125_ACEOF
20126rm -f "conftest.$ac_objext" "conftest$ac_exeext"
20127if { (eval echo "$as_me:20127: \"$ac_link\"") >&5
20128 (eval $ac_link) 2>&5
20129 ac_status=$?
20130 echo "$as_me:20130: \$? = $ac_status" >&5
20131 (exit "$ac_status"); } &&
20132 { ac_try='test -s "conftest$ac_exeext"'
20133 { (eval echo "$as_me:20133: \"$ac_try\"") >&5
20134 (eval $ac_try) 2>&5
20135 ac_status=$?
20136 echo "$as_me:20136: \$? = $ac_status" >&5
20137 (exit "$ac_status"); }; }; then
20138 ac_cv_lib_util_openpty=yes
20139else
20140 echo "$as_me: failed program was:" >&5
20141cat "conftest.$ac_ext" >&5
20142ac_cv_lib_util_openpty=no
20143fi
20144rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
20145LIBS=$ac_check_lib_save_LIBS
20146fi
20147echo "$as_me:20147: result: $ac_cv_lib_util_openpty" >&5
20148echo "${ECHO_T}$ac_cv_lib_util_openpty" >&6
20149if test "$ac_cv_lib_util_openpty" = yes; then
20150 cf_cv_lib_util=yes
20151else
20152 cf_cv_lib_util=no
20153fi
20154
20155echo "$as_me:20155: checking for openpty header" >&5
20156echo $ECHO_N "checking for openpty header... $ECHO_C" >&6
20157if test "${cf_cv_func_openpty+set}" = set; then
20158 echo $ECHO_N "(cached) $ECHO_C" >&6
20159else
20160
20161 cf_save_LIBS="$LIBS"
20162 test "$cf_cv_lib_util" = yes && {
20163cf_add_libs="$LIBS"
20164# reverse order
20165cf_add_0lib=
20166for cf_add_1lib in -lutil; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
20167# filter duplicates
20168for cf_add_1lib in $cf_add_0lib; do
20169 for cf_add_2lib in $cf_add_libs; do
20170 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
20171 cf_add_1lib=
20172 break
20173 fi
20174 done
20175 test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
20176done
20177LIBS="$cf_add_libs"
20178 }
20179 for cf_header in pty.h libutil.h util.h
20180 do
20181 cat >"conftest.$ac_ext" <<_ACEOF
20182#line 20182 "configure"
20183#include "confdefs.h"
20184
20185#include <$cf_header>
20186
20187int
20188main (void)
20189{
20190
20191 int x = openpty((int *)0, (int *)0, (char *)0,
20192 (struct termios *)0, (struct winsize *)0);
20193 (void)x;
20194
20195 ;
20196 return 0;
20197}
20198_ACEOF
20199rm -f "conftest.$ac_objext" "conftest$ac_exeext"
20200if { (eval echo "$as_me:20200: \"$ac_link\"") >&5
20201 (eval $ac_link) 2>&5
20202 ac_status=$?
20203 echo "$as_me:20203: \$? = $ac_status" >&5
20204 (exit "$ac_status"); } &&
20205 { ac_try='test -s "conftest$ac_exeext"'
20206 { (eval echo "$as_me:20206: \"$ac_try\"") >&5
20207 (eval $ac_try) 2>&5
20208 ac_status=$?
20209 echo "$as_me:20209: \$? = $ac_status" >&5
20210 (exit "$ac_status"); }; }; then
20211
20212 cf_cv_func_openpty=$cf_header
20213 break
20214
20215else
20216 echo "$as_me: failed program was:" >&5
20217cat "conftest.$ac_ext" >&5
20218
20219 cf_cv_func_openpty=no
20220
20221fi
20222rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
20223 done
20224 LIBS="$cf_save_LIBS"
20225
20226fi
20227echo "$as_me:20227: result: $cf_cv_func_openpty" >&5
20228echo "${ECHO_T}$cf_cv_func_openpty" >&6
20229
20230if test "$cf_cv_func_openpty" != no ; then
20231
20232cat >>confdefs.h <<EOF
20233#define USE_OPENPTY_HEADER <$cf_cv_func_openpty>
20234EOF
20235
20236cat >>confdefs.h <<\EOF
20237#define USE_XTERM_PTY 1
20238EOF
20239
20240 if test "x$cf_cv_lib_util" = xyes ; then
20241
20242cf_add_libs="$TEST_LIBS"
20243# reverse order
20244cf_add_0lib=
20245for cf_add_1lib in -lutil; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
20246# filter duplicates
20247for cf_add_1lib in $cf_add_0lib; do
20248 for cf_add_2lib in $cf_add_libs; do
20249 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
20250 cf_add_1lib=
20251 break
20252 fi
20253 done
20254 test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
20255done
20256TEST_LIBS="$cf_add_libs"
20257
20258 fi
20259fi
20260
20261echo "$as_me:20261: checking for function curses_version" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010020262echo $ECHO_N "checking for function curses_version... $ECHO_C" >&6
20263if test "${cf_cv_func_curses_version+set}" = set; then
20264 echo $ECHO_N "(cached) $ECHO_C" >&6
20265else
20266
20267if test "$cross_compiling" = yes; then
20268 cf_cv_func_curses_version=unknown
20269else
micky3879b9f5e72025-07-08 18:04:53 -040020270 cat >"conftest.$ac_ext" <<_ACEOF
20271#line 20271 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +010020272#include "confdefs.h"
20273
micky3879b9f5e72025-07-08 18:04:53 -040020274$ac_includes_default
20275
Steve Kondikae271bc2015-11-15 02:50:53 +010020276#include <${cf_cv_ncurses_header:-curses.h}>
micky3879b9f5e72025-07-08 18:04:53 -040020277
20278int main(void)
Steve Kondikae271bc2015-11-15 02:50:53 +010020279{
20280 char temp[1024];
micky3879b9f5e72025-07-08 18:04:53 -040020281 sprintf(temp, "%.999s\\n", curses_version());
Steve Kondikae271bc2015-11-15 02:50:53 +010020282 ${cf_cv_main_return:-return}(0);
20283}
20284
20285_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -040020286rm -f "conftest$ac_exeext"
20287if { (eval echo "$as_me:20287: \"$ac_link\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010020288 (eval $ac_link) 2>&5
20289 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040020290 echo "$as_me:20290: \$? = $ac_status" >&5
20291 (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
20292 { (eval echo "$as_me:20292: \"$ac_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010020293 (eval $ac_try) 2>&5
20294 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040020295 echo "$as_me:20295: \$? = $ac_status" >&5
20296 (exit "$ac_status"); }; }; then
Steve Kondikae271bc2015-11-15 02:50:53 +010020297 cf_cv_func_curses_version=yes
20298
20299else
20300 echo "$as_me: program exited with status $ac_status" >&5
20301echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -040020302cat "conftest.$ac_ext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010020303cf_cv_func_curses_version=no
20304
20305fi
micky3879b9f5e72025-07-08 18:04:53 -040020306rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
Steve Kondikae271bc2015-11-15 02:50:53 +010020307fi
20308rm -f core
20309fi
micky3879b9f5e72025-07-08 18:04:53 -040020310echo "$as_me:20310: result: $cf_cv_func_curses_version" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010020311echo "${ECHO_T}$cf_cv_func_curses_version" >&6
20312test "$cf_cv_func_curses_version" = yes &&
20313cat >>confdefs.h <<\EOF
20314#define HAVE_CURSES_VERSION 1
20315EOF
20316
micky3879b9f5e72025-07-08 18:04:53 -040020317echo "$as_me:20317: checking for alternate character set array" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010020318echo $ECHO_N "checking for alternate character set array... $ECHO_C" >&6
20319if test "${cf_cv_curses_acs_map+set}" = set; then
20320 echo $ECHO_N "(cached) $ECHO_C" >&6
20321else
20322
20323cf_cv_curses_acs_map=unknown
20324for name in acs_map _acs_map __acs_map ${NCURSES_WRAP_PREFIX}acs_map
20325do
micky3879b9f5e72025-07-08 18:04:53 -040020326cat >"conftest.$ac_ext" <<_ACEOF
20327#line 20327 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +010020328#include "confdefs.h"
20329
20330#include <${cf_cv_ncurses_header:-curses.h}>
20331
20332int
micky3879b9f5e72025-07-08 18:04:53 -040020333main (void)
Steve Kondikae271bc2015-11-15 02:50:53 +010020334{
20335
micky3879b9f5e72025-07-08 18:04:53 -040020336${name}['k'] = ACS_PLUS
Steve Kondikae271bc2015-11-15 02:50:53 +010020337
20338 ;
20339 return 0;
20340}
20341_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -040020342rm -f "conftest.$ac_objext" "conftest$ac_exeext"
20343if { (eval echo "$as_me:20343: \"$ac_link\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010020344 (eval $ac_link) 2>&5
20345 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040020346 echo "$as_me:20346: \$? = $ac_status" >&5
20347 (exit "$ac_status"); } &&
20348 { ac_try='test -s "conftest$ac_exeext"'
20349 { (eval echo "$as_me:20349: \"$ac_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010020350 (eval $ac_try) 2>&5
20351 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040020352 echo "$as_me:20352: \$? = $ac_status" >&5
20353 (exit "$ac_status"); }; }; then
Steve Kondikae271bc2015-11-15 02:50:53 +010020354 cf_cv_curses_acs_map=$name; break
20355else
20356 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -040020357cat "conftest.$ac_ext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010020358fi
micky3879b9f5e72025-07-08 18:04:53 -040020359rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
Steve Kondikae271bc2015-11-15 02:50:53 +010020360done
20361
20362fi
micky3879b9f5e72025-07-08 18:04:53 -040020363echo "$as_me:20363: result: $cf_cv_curses_acs_map" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010020364echo "${ECHO_T}$cf_cv_curses_acs_map" >&6
20365
20366test "$cf_cv_curses_acs_map" != unknown &&
20367cat >>confdefs.h <<EOF
20368#define CURSES_ACS_ARRAY $cf_cv_curses_acs_map
20369EOF
20370
20371if test "$cf_enable_widec" = yes; then
20372
micky3879b9f5e72025-07-08 18:04:53 -040020373echo "$as_me:20373: checking for wide alternate character set array" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010020374echo $ECHO_N "checking for wide alternate character set array... $ECHO_C" >&6
20375if test "${cf_cv_curses_wacs_map+set}" = set; then
20376 echo $ECHO_N "(cached) $ECHO_C" >&6
20377else
20378
20379 cf_cv_curses_wacs_map=unknown
20380 for name in wacs_map _wacs_map __wacs_map _nc_wacs _wacs_char
20381 do
micky3879b9f5e72025-07-08 18:04:53 -040020382 cat >"conftest.$ac_ext" <<_ACEOF
20383#line 20383 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +010020384#include "confdefs.h"
20385
20386#ifndef _XOPEN_SOURCE_EXTENDED
20387#define _XOPEN_SOURCE_EXTENDED
20388#endif
20389#include <${cf_cv_ncurses_header:-curses.h}>
20390int
micky3879b9f5e72025-07-08 18:04:53 -040020391main (void)
Steve Kondikae271bc2015-11-15 02:50:53 +010020392{
micky3879b9f5e72025-07-08 18:04:53 -040020393void *foo = &(${name}['k']); (void)foo
Steve Kondikae271bc2015-11-15 02:50:53 +010020394 ;
20395 return 0;
20396}
20397_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -040020398rm -f "conftest.$ac_objext" "conftest$ac_exeext"
20399if { (eval echo "$as_me:20399: \"$ac_link\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010020400 (eval $ac_link) 2>&5
20401 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040020402 echo "$as_me:20402: \$? = $ac_status" >&5
20403 (exit "$ac_status"); } &&
20404 { ac_try='test -s "conftest$ac_exeext"'
20405 { (eval echo "$as_me:20405: \"$ac_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010020406 (eval $ac_try) 2>&5
20407 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040020408 echo "$as_me:20408: \$? = $ac_status" >&5
20409 (exit "$ac_status"); }; }; then
Steve Kondikae271bc2015-11-15 02:50:53 +010020410 cf_cv_curses_wacs_map=$name
20411 break
20412else
20413 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -040020414cat "conftest.$ac_ext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010020415fi
micky3879b9f5e72025-07-08 18:04:53 -040020416rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
Steve Kondikae271bc2015-11-15 02:50:53 +010020417 done
20418fi
micky3879b9f5e72025-07-08 18:04:53 -040020419echo "$as_me:20419: result: $cf_cv_curses_wacs_map" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010020420echo "${ECHO_T}$cf_cv_curses_wacs_map" >&6
20421
20422test "$cf_cv_curses_wacs_map" != unknown &&
20423cat >>confdefs.h <<EOF
20424#define CURSES_WACS_ARRAY $cf_cv_curses_wacs_map
20425EOF
20426
micky3879b9f5e72025-07-08 18:04:53 -040020427echo "$as_me:20427: checking for wide alternate character constants" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010020428echo $ECHO_N "checking for wide alternate character constants... $ECHO_C" >&6
20429if test "${cf_cv_curses_wacs_symbols+set}" = set; then
20430 echo $ECHO_N "(cached) $ECHO_C" >&6
20431else
20432
20433cf_cv_curses_wacs_symbols=no
20434if test "$cf_cv_curses_wacs_map" != unknown
20435then
micky3879b9f5e72025-07-08 18:04:53 -040020436 cat >"conftest.$ac_ext" <<_ACEOF
20437#line 20437 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +010020438#include "confdefs.h"
20439
20440#ifndef _XOPEN_SOURCE_EXTENDED
20441#define _XOPEN_SOURCE_EXTENDED
20442#endif
20443#include <${cf_cv_ncurses_header:-curses.h}>
20444int
micky3879b9f5e72025-07-08 18:04:53 -040020445main (void)
Steve Kondikae271bc2015-11-15 02:50:53 +010020446{
20447cchar_t *foo = WACS_PLUS;
micky3879b9f5e72025-07-08 18:04:53 -040020448 ${cf_cv_curses_wacs_map}['k'] = *WACS_PLUS; (void)foo
Steve Kondikae271bc2015-11-15 02:50:53 +010020449 ;
20450 return 0;
20451}
20452_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -040020453rm -f "conftest.$ac_objext" "conftest$ac_exeext"
20454if { (eval echo "$as_me:20454: \"$ac_link\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010020455 (eval $ac_link) 2>&5
20456 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040020457 echo "$as_me:20457: \$? = $ac_status" >&5
20458 (exit "$ac_status"); } &&
20459 { ac_try='test -s "conftest$ac_exeext"'
20460 { (eval echo "$as_me:20460: \"$ac_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010020461 (eval $ac_try) 2>&5
20462 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040020463 echo "$as_me:20463: \$? = $ac_status" >&5
20464 (exit "$ac_status"); }; }; then
Steve Kondikae271bc2015-11-15 02:50:53 +010020465 cf_cv_curses_wacs_symbols=yes
20466else
20467 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -040020468cat "conftest.$ac_ext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010020469fi
micky3879b9f5e72025-07-08 18:04:53 -040020470rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
Steve Kondikae271bc2015-11-15 02:50:53 +010020471else
micky3879b9f5e72025-07-08 18:04:53 -040020472 cat >"conftest.$ac_ext" <<_ACEOF
20473#line 20473 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +010020474#include "confdefs.h"
20475
20476#ifndef _XOPEN_SOURCE_EXTENDED
20477#define _XOPEN_SOURCE_EXTENDED
20478#endif
20479#include <${cf_cv_ncurses_header:-curses.h}>
20480int
micky3879b9f5e72025-07-08 18:04:53 -040020481main (void)
Steve Kondikae271bc2015-11-15 02:50:53 +010020482{
micky3879b9f5e72025-07-08 18:04:53 -040020483cchar_t *foo = WACS_PLUS; (void)foo
Steve Kondikae271bc2015-11-15 02:50:53 +010020484 ;
20485 return 0;
20486}
20487_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -040020488rm -f "conftest.$ac_objext" "conftest$ac_exeext"
20489if { (eval echo "$as_me:20489: \"$ac_link\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010020490 (eval $ac_link) 2>&5
20491 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040020492 echo "$as_me:20492: \$? = $ac_status" >&5
20493 (exit "$ac_status"); } &&
20494 { ac_try='test -s "conftest$ac_exeext"'
20495 { (eval echo "$as_me:20495: \"$ac_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010020496 (eval $ac_try) 2>&5
20497 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040020498 echo "$as_me:20498: \$? = $ac_status" >&5
20499 (exit "$ac_status"); }; }; then
Steve Kondikae271bc2015-11-15 02:50:53 +010020500 cf_cv_curses_wacs_symbols=yes
20501else
20502 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -040020503cat "conftest.$ac_ext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010020504fi
micky3879b9f5e72025-07-08 18:04:53 -040020505rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
Steve Kondikae271bc2015-11-15 02:50:53 +010020506fi
20507
20508fi
micky3879b9f5e72025-07-08 18:04:53 -040020509echo "$as_me:20509: result: $cf_cv_curses_wacs_symbols" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010020510echo "${ECHO_T}$cf_cv_curses_wacs_symbols" >&6
20511
20512test "$cf_cv_curses_wacs_symbols" != no &&
20513cat >>confdefs.h <<\EOF
20514#define CURSES_WACS_SYMBOLS 1
20515EOF
20516
20517fi
20518
micky3879b9f5e72025-07-08 18:04:53 -040020519echo "$as_me:20519: checking for type attr_t in ${cf_cv_ncurses_header:-curses.h}" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010020520echo $ECHO_N "checking for type attr_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
micky3879b9f5e72025-07-08 18:04:53 -040020521cat >"conftest.$ac_ext" <<_ACEOF
20522#line 20522 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +010020523#include "confdefs.h"
20524
20525#ifndef _XOPEN_SOURCE_EXTENDED
20526#define _XOPEN_SOURCE_EXTENDED
20527#endif
20528#include <${cf_cv_ncurses_header:-curses.h}>
20529int
micky3879b9f5e72025-07-08 18:04:53 -040020530main (void)
Steve Kondikae271bc2015-11-15 02:50:53 +010020531{
20532
20533attr_t foo
20534
20535 ;
20536 return 0;
20537}
20538_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -040020539rm -f "conftest.$ac_objext"
20540if { (eval echo "$as_me:20540: \"$ac_compile\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010020541 (eval $ac_compile) 2>&5
20542 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040020543 echo "$as_me:20543: \$? = $ac_status" >&5
20544 (exit "$ac_status"); } &&
20545 { ac_try='test -s "conftest.$ac_objext"'
20546 { (eval echo "$as_me:20546: \"$ac_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010020547 (eval $ac_try) 2>&5
20548 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040020549 echo "$as_me:20549: \$? = $ac_status" >&5
20550 (exit "$ac_status"); }; }; then
Steve Kondikae271bc2015-11-15 02:50:53 +010020551 cf_result=yes
20552else
20553 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -040020554cat "conftest.$ac_ext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010020555cf_result=no
20556fi
micky3879b9f5e72025-07-08 18:04:53 -040020557rm -f "conftest.$ac_objext" "conftest.$ac_ext"
20558echo "$as_me:20558: result: $cf_result" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010020559echo "${ECHO_T}$cf_result" >&6
micky3879b9f5e72025-07-08 18:04:53 -040020560if test "$cf_result" = yes ; then
Steve Kondikae271bc2015-11-15 02:50:53 +010020561
20562cf_result=`echo "have_type_attr_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
20563
20564cat >>confdefs.h <<EOF
20565#define $cf_result 1
20566EOF
20567
20568else
20569
20570cat >>confdefs.h <<EOF
20571#define attr_t long
20572EOF
20573
20574fi
20575
20576if test "$cf_enable_widec" = yes; then
20577
20578# This is needed on Tru64 5.0 to declare mbstate_t
micky3879b9f5e72025-07-08 18:04:53 -040020579echo "$as_me:20579: checking if we must include wchar.h to declare mbstate_t" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010020580echo $ECHO_N "checking if we must include wchar.h to declare mbstate_t... $ECHO_C" >&6
20581if test "${cf_cv_mbstate_t+set}" = set; then
20582 echo $ECHO_N "(cached) $ECHO_C" >&6
20583else
20584
micky3879b9f5e72025-07-08 18:04:53 -040020585cat >"conftest.$ac_ext" <<_ACEOF
20586#line 20586 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +010020587#include "confdefs.h"
20588
20589#include <stdlib.h>
20590#include <stdarg.h>
20591#include <stdio.h>
20592#ifdef HAVE_LIBUTF8_H
20593#include <libutf8.h>
20594#endif
20595int
micky3879b9f5e72025-07-08 18:04:53 -040020596main (void)
Steve Kondikae271bc2015-11-15 02:50:53 +010020597{
micky3879b9f5e72025-07-08 18:04:53 -040020598mbstate_t state; (void)state
Steve Kondikae271bc2015-11-15 02:50:53 +010020599 ;
20600 return 0;
20601}
20602_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -040020603rm -f "conftest.$ac_objext"
20604if { (eval echo "$as_me:20604: \"$ac_compile\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010020605 (eval $ac_compile) 2>&5
20606 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040020607 echo "$as_me:20607: \$? = $ac_status" >&5
20608 (exit "$ac_status"); } &&
20609 { ac_try='test -s "conftest.$ac_objext"'
20610 { (eval echo "$as_me:20610: \"$ac_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010020611 (eval $ac_try) 2>&5
20612 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040020613 echo "$as_me:20613: \$? = $ac_status" >&5
20614 (exit "$ac_status"); }; }; then
Steve Kondikae271bc2015-11-15 02:50:53 +010020615 cf_cv_mbstate_t=no
20616else
20617 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -040020618cat "conftest.$ac_ext" >&5
20619cat >"conftest.$ac_ext" <<_ACEOF
20620#line 20620 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +010020621#include "confdefs.h"
20622
20623#include <stdlib.h>
20624#include <stdarg.h>
20625#include <stdio.h>
20626#include <wchar.h>
20627#ifdef HAVE_LIBUTF8_H
20628#include <libutf8.h>
20629#endif
20630int
micky3879b9f5e72025-07-08 18:04:53 -040020631main (void)
Steve Kondikae271bc2015-11-15 02:50:53 +010020632{
micky3879b9f5e72025-07-08 18:04:53 -040020633mbstate_t value; (void) value
Steve Kondikae271bc2015-11-15 02:50:53 +010020634 ;
20635 return 0;
20636}
20637_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -040020638rm -f "conftest.$ac_objext"
20639if { (eval echo "$as_me:20639: \"$ac_compile\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010020640 (eval $ac_compile) 2>&5
20641 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040020642 echo "$as_me:20642: \$? = $ac_status" >&5
20643 (exit "$ac_status"); } &&
20644 { ac_try='test -s "conftest.$ac_objext"'
20645 { (eval echo "$as_me:20645: \"$ac_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010020646 (eval $ac_try) 2>&5
20647 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040020648 echo "$as_me:20648: \$? = $ac_status" >&5
20649 (exit "$ac_status"); }; }; then
Steve Kondikae271bc2015-11-15 02:50:53 +010020650 cf_cv_mbstate_t=yes
20651else
20652 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -040020653cat "conftest.$ac_ext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010020654cf_cv_mbstate_t=unknown
20655fi
micky3879b9f5e72025-07-08 18:04:53 -040020656rm -f "conftest.$ac_objext" "conftest.$ac_ext"
Steve Kondikae271bc2015-11-15 02:50:53 +010020657fi
micky3879b9f5e72025-07-08 18:04:53 -040020658rm -f "conftest.$ac_objext" "conftest.$ac_ext"
Steve Kondikae271bc2015-11-15 02:50:53 +010020659fi
micky3879b9f5e72025-07-08 18:04:53 -040020660echo "$as_me:20660: result: $cf_cv_mbstate_t" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010020661echo "${ECHO_T}$cf_cv_mbstate_t" >&6
20662
20663if test "$cf_cv_mbstate_t" = yes ; then
20664
20665cat >>confdefs.h <<\EOF
20666#define NEED_WCHAR_H 1
20667EOF
20668
20669 NEED_WCHAR_H=1
20670fi
20671
20672# if we do not find mbstate_t in either place, use substitution to provide a fallback.
20673if test "$cf_cv_mbstate_t" = unknown ; then
20674 NCURSES_MBSTATE_T=1
20675fi
20676
20677# if we find mbstate_t in either place, use substitution to provide a fallback.
20678if test "$cf_cv_mbstate_t" != unknown ; then
20679 NCURSES_OK_MBSTATE_T=1
20680fi
20681
20682# This is needed on Tru64 5.0 to declare wchar_t
micky3879b9f5e72025-07-08 18:04:53 -040020683echo "$as_me:20683: checking if we must include wchar.h to declare wchar_t" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010020684echo $ECHO_N "checking if we must include wchar.h to declare wchar_t... $ECHO_C" >&6
20685if test "${cf_cv_wchar_t+set}" = set; then
20686 echo $ECHO_N "(cached) $ECHO_C" >&6
20687else
20688
micky3879b9f5e72025-07-08 18:04:53 -040020689cat >"conftest.$ac_ext" <<_ACEOF
20690#line 20690 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +010020691#include "confdefs.h"
20692
20693#include <stdlib.h>
20694#include <stdarg.h>
20695#include <stdio.h>
20696#ifdef HAVE_LIBUTF8_H
20697#include <libutf8.h>
20698#endif
20699int
micky3879b9f5e72025-07-08 18:04:53 -040020700main (void)
Steve Kondikae271bc2015-11-15 02:50:53 +010020701{
micky3879b9f5e72025-07-08 18:04:53 -040020702wchar_t state; (void)state
Steve Kondikae271bc2015-11-15 02:50:53 +010020703 ;
20704 return 0;
20705}
20706_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -040020707rm -f "conftest.$ac_objext"
20708if { (eval echo "$as_me:20708: \"$ac_compile\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010020709 (eval $ac_compile) 2>&5
20710 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040020711 echo "$as_me:20711: \$? = $ac_status" >&5
20712 (exit "$ac_status"); } &&
20713 { ac_try='test -s "conftest.$ac_objext"'
20714 { (eval echo "$as_me:20714: \"$ac_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010020715 (eval $ac_try) 2>&5
20716 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040020717 echo "$as_me:20717: \$? = $ac_status" >&5
20718 (exit "$ac_status"); }; }; then
Steve Kondikae271bc2015-11-15 02:50:53 +010020719 cf_cv_wchar_t=no
20720else
20721 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -040020722cat "conftest.$ac_ext" >&5
20723cat >"conftest.$ac_ext" <<_ACEOF
20724#line 20724 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +010020725#include "confdefs.h"
20726
20727#include <stdlib.h>
20728#include <stdarg.h>
20729#include <stdio.h>
20730#include <wchar.h>
20731#ifdef HAVE_LIBUTF8_H
20732#include <libutf8.h>
20733#endif
20734int
micky3879b9f5e72025-07-08 18:04:53 -040020735main (void)
Steve Kondikae271bc2015-11-15 02:50:53 +010020736{
micky3879b9f5e72025-07-08 18:04:53 -040020737wchar_t value; (void) value
Steve Kondikae271bc2015-11-15 02:50:53 +010020738 ;
20739 return 0;
20740}
20741_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -040020742rm -f "conftest.$ac_objext"
20743if { (eval echo "$as_me:20743: \"$ac_compile\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010020744 (eval $ac_compile) 2>&5
20745 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040020746 echo "$as_me:20746: \$? = $ac_status" >&5
20747 (exit "$ac_status"); } &&
20748 { ac_try='test -s "conftest.$ac_objext"'
20749 { (eval echo "$as_me:20749: \"$ac_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010020750 (eval $ac_try) 2>&5
20751 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040020752 echo "$as_me:20752: \$? = $ac_status" >&5
20753 (exit "$ac_status"); }; }; then
Steve Kondikae271bc2015-11-15 02:50:53 +010020754 cf_cv_wchar_t=yes
20755else
20756 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -040020757cat "conftest.$ac_ext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010020758cf_cv_wchar_t=unknown
20759fi
micky3879b9f5e72025-07-08 18:04:53 -040020760rm -f "conftest.$ac_objext" "conftest.$ac_ext"
Steve Kondikae271bc2015-11-15 02:50:53 +010020761fi
micky3879b9f5e72025-07-08 18:04:53 -040020762rm -f "conftest.$ac_objext" "conftest.$ac_ext"
Steve Kondikae271bc2015-11-15 02:50:53 +010020763fi
micky3879b9f5e72025-07-08 18:04:53 -040020764echo "$as_me:20764: result: $cf_cv_wchar_t" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010020765echo "${ECHO_T}$cf_cv_wchar_t" >&6
20766
20767if test "$cf_cv_wchar_t" = yes ; then
20768
20769cat >>confdefs.h <<\EOF
20770#define NEED_WCHAR_H 1
20771EOF
20772
20773 NEED_WCHAR_H=1
20774fi
20775
20776# if we do not find wchar_t in either place, use substitution to provide a fallback.
20777if test "$cf_cv_wchar_t" = unknown ; then
20778 NCURSES_WCHAR_T=1
20779fi
20780
20781# if we find wchar_t in either place, use substitution to provide a fallback.
20782if test "$cf_cv_wchar_t" != unknown ; then
20783 NCURSES_OK_WCHAR_T=1
20784fi
20785
20786# This is needed on Tru64 5.0 to declare wint_t
micky3879b9f5e72025-07-08 18:04:53 -040020787echo "$as_me:20787: checking if we must include wchar.h to declare wint_t" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010020788echo $ECHO_N "checking if we must include wchar.h to declare wint_t... $ECHO_C" >&6
20789if test "${cf_cv_wint_t+set}" = set; then
20790 echo $ECHO_N "(cached) $ECHO_C" >&6
20791else
20792
micky3879b9f5e72025-07-08 18:04:53 -040020793cat >"conftest.$ac_ext" <<_ACEOF
20794#line 20794 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +010020795#include "confdefs.h"
20796
20797#include <stdlib.h>
20798#include <stdarg.h>
20799#include <stdio.h>
20800#ifdef HAVE_LIBUTF8_H
20801#include <libutf8.h>
20802#endif
20803int
micky3879b9f5e72025-07-08 18:04:53 -040020804main (void)
Steve Kondikae271bc2015-11-15 02:50:53 +010020805{
micky3879b9f5e72025-07-08 18:04:53 -040020806wint_t state; (void)state
Steve Kondikae271bc2015-11-15 02:50:53 +010020807 ;
20808 return 0;
20809}
20810_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -040020811rm -f "conftest.$ac_objext"
20812if { (eval echo "$as_me:20812: \"$ac_compile\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010020813 (eval $ac_compile) 2>&5
20814 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040020815 echo "$as_me:20815: \$? = $ac_status" >&5
20816 (exit "$ac_status"); } &&
20817 { ac_try='test -s "conftest.$ac_objext"'
20818 { (eval echo "$as_me:20818: \"$ac_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010020819 (eval $ac_try) 2>&5
20820 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040020821 echo "$as_me:20821: \$? = $ac_status" >&5
20822 (exit "$ac_status"); }; }; then
Steve Kondikae271bc2015-11-15 02:50:53 +010020823 cf_cv_wint_t=no
20824else
20825 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -040020826cat "conftest.$ac_ext" >&5
20827cat >"conftest.$ac_ext" <<_ACEOF
20828#line 20828 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +010020829#include "confdefs.h"
20830
20831#include <stdlib.h>
20832#include <stdarg.h>
20833#include <stdio.h>
20834#include <wchar.h>
20835#ifdef HAVE_LIBUTF8_H
20836#include <libutf8.h>
20837#endif
20838int
micky3879b9f5e72025-07-08 18:04:53 -040020839main (void)
Steve Kondikae271bc2015-11-15 02:50:53 +010020840{
micky3879b9f5e72025-07-08 18:04:53 -040020841wint_t value; (void) value
Steve Kondikae271bc2015-11-15 02:50:53 +010020842 ;
20843 return 0;
20844}
20845_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -040020846rm -f "conftest.$ac_objext"
20847if { (eval echo "$as_me:20847: \"$ac_compile\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010020848 (eval $ac_compile) 2>&5
20849 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040020850 echo "$as_me:20850: \$? = $ac_status" >&5
20851 (exit "$ac_status"); } &&
20852 { ac_try='test -s "conftest.$ac_objext"'
20853 { (eval echo "$as_me:20853: \"$ac_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010020854 (eval $ac_try) 2>&5
20855 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040020856 echo "$as_me:20856: \$? = $ac_status" >&5
20857 (exit "$ac_status"); }; }; then
Steve Kondikae271bc2015-11-15 02:50:53 +010020858 cf_cv_wint_t=yes
20859else
20860 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -040020861cat "conftest.$ac_ext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010020862cf_cv_wint_t=unknown
20863fi
micky3879b9f5e72025-07-08 18:04:53 -040020864rm -f "conftest.$ac_objext" "conftest.$ac_ext"
Steve Kondikae271bc2015-11-15 02:50:53 +010020865fi
micky3879b9f5e72025-07-08 18:04:53 -040020866rm -f "conftest.$ac_objext" "conftest.$ac_ext"
Steve Kondikae271bc2015-11-15 02:50:53 +010020867fi
micky3879b9f5e72025-07-08 18:04:53 -040020868echo "$as_me:20868: result: $cf_cv_wint_t" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010020869echo "${ECHO_T}$cf_cv_wint_t" >&6
20870
20871if test "$cf_cv_wint_t" = yes ; then
20872
20873cat >>confdefs.h <<\EOF
20874#define NEED_WCHAR_H 1
20875EOF
20876
20877 NEED_WCHAR_H=1
20878fi
20879
20880# if we do not find wint_t in either place, use substitution to provide a fallback.
20881if test "$cf_cv_wint_t" = unknown ; then
20882 NCURSES_WINT_T=1
20883fi
20884
20885# if we find wint_t in either place, use substitution to provide a fallback.
20886if test "$cf_cv_wint_t" != unknown ; then
20887 NCURSES_OK_WINT_T=1
20888fi
20889
20890 if test "$NCURSES_OK_MBSTATE_T" = 0 ; then
20891
micky3879b9f5e72025-07-08 18:04:53 -040020892echo "$as_me:20892: checking for type mbstate_t in ${cf_cv_ncurses_header:-curses.h}" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010020893echo $ECHO_N "checking for type mbstate_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
micky3879b9f5e72025-07-08 18:04:53 -040020894cat >"conftest.$ac_ext" <<_ACEOF
20895#line 20895 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +010020896#include "confdefs.h"
20897
20898#ifndef _XOPEN_SOURCE_EXTENDED
20899#define _XOPEN_SOURCE_EXTENDED
20900#endif
20901#include <${cf_cv_ncurses_header:-curses.h}>
20902int
micky3879b9f5e72025-07-08 18:04:53 -040020903main (void)
Steve Kondikae271bc2015-11-15 02:50:53 +010020904{
20905
20906mbstate_t foo
20907
20908 ;
20909 return 0;
20910}
20911_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -040020912rm -f "conftest.$ac_objext"
20913if { (eval echo "$as_me:20913: \"$ac_compile\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010020914 (eval $ac_compile) 2>&5
20915 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040020916 echo "$as_me:20916: \$? = $ac_status" >&5
20917 (exit "$ac_status"); } &&
20918 { ac_try='test -s "conftest.$ac_objext"'
20919 { (eval echo "$as_me:20919: \"$ac_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010020920 (eval $ac_try) 2>&5
20921 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040020922 echo "$as_me:20922: \$? = $ac_status" >&5
20923 (exit "$ac_status"); }; }; then
Steve Kondikae271bc2015-11-15 02:50:53 +010020924 cf_result=yes
20925else
20926 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -040020927cat "conftest.$ac_ext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010020928cf_result=no
20929fi
micky3879b9f5e72025-07-08 18:04:53 -040020930rm -f "conftest.$ac_objext" "conftest.$ac_ext"
20931echo "$as_me:20931: result: $cf_result" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010020932echo "${ECHO_T}$cf_result" >&6
micky3879b9f5e72025-07-08 18:04:53 -040020933if test "$cf_result" = yes ; then
Steve Kondikae271bc2015-11-15 02:50:53 +010020934
20935cf_result=`echo "have_type_mbstate_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
20936
20937cat >>confdefs.h <<EOF
20938#define $cf_result 1
20939EOF
20940
20941else
20942
20943cat >>confdefs.h <<EOF
20944#define mbstate_t long
20945EOF
20946
20947fi
20948
20949 fi
20950
20951 if test "$NCURSES_OK_WCHAR_T" = 0 ; then
20952
micky3879b9f5e72025-07-08 18:04:53 -040020953echo "$as_me:20953: checking for type wchar_t in ${cf_cv_ncurses_header:-curses.h}" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010020954echo $ECHO_N "checking for type wchar_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
micky3879b9f5e72025-07-08 18:04:53 -040020955cat >"conftest.$ac_ext" <<_ACEOF
20956#line 20956 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +010020957#include "confdefs.h"
20958
20959#ifndef _XOPEN_SOURCE_EXTENDED
20960#define _XOPEN_SOURCE_EXTENDED
20961#endif
20962#include <${cf_cv_ncurses_header:-curses.h}>
20963int
micky3879b9f5e72025-07-08 18:04:53 -040020964main (void)
Steve Kondikae271bc2015-11-15 02:50:53 +010020965{
20966
20967wchar_t foo
20968
20969 ;
20970 return 0;
20971}
20972_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -040020973rm -f "conftest.$ac_objext"
20974if { (eval echo "$as_me:20974: \"$ac_compile\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010020975 (eval $ac_compile) 2>&5
20976 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040020977 echo "$as_me:20977: \$? = $ac_status" >&5
20978 (exit "$ac_status"); } &&
20979 { ac_try='test -s "conftest.$ac_objext"'
20980 { (eval echo "$as_me:20980: \"$ac_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010020981 (eval $ac_try) 2>&5
20982 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040020983 echo "$as_me:20983: \$? = $ac_status" >&5
20984 (exit "$ac_status"); }; }; then
Steve Kondikae271bc2015-11-15 02:50:53 +010020985 cf_result=yes
20986else
20987 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -040020988cat "conftest.$ac_ext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010020989cf_result=no
20990fi
micky3879b9f5e72025-07-08 18:04:53 -040020991rm -f "conftest.$ac_objext" "conftest.$ac_ext"
20992echo "$as_me:20992: result: $cf_result" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010020993echo "${ECHO_T}$cf_result" >&6
micky3879b9f5e72025-07-08 18:04:53 -040020994if test "$cf_result" = yes ; then
Steve Kondikae271bc2015-11-15 02:50:53 +010020995
20996cf_result=`echo "have_type_wchar_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
20997
20998cat >>confdefs.h <<EOF
20999#define $cf_result 1
21000EOF
21001
21002else
21003
21004cat >>confdefs.h <<EOF
21005#define wchar_t long
21006EOF
21007
21008fi
21009
21010 fi
21011
21012 if test "$NCURSES_OK_WINT_T" = 0 ; then
21013
micky3879b9f5e72025-07-08 18:04:53 -040021014echo "$as_me:21014: checking for type wint_t in ${cf_cv_ncurses_header:-curses.h}" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010021015echo $ECHO_N "checking for type wint_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
micky3879b9f5e72025-07-08 18:04:53 -040021016cat >"conftest.$ac_ext" <<_ACEOF
21017#line 21017 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +010021018#include "confdefs.h"
21019
21020#ifndef _XOPEN_SOURCE_EXTENDED
21021#define _XOPEN_SOURCE_EXTENDED
21022#endif
21023#include <${cf_cv_ncurses_header:-curses.h}>
21024int
micky3879b9f5e72025-07-08 18:04:53 -040021025main (void)
Steve Kondikae271bc2015-11-15 02:50:53 +010021026{
21027
21028wint_t foo
21029
21030 ;
21031 return 0;
21032}
21033_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -040021034rm -f "conftest.$ac_objext"
21035if { (eval echo "$as_me:21035: \"$ac_compile\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010021036 (eval $ac_compile) 2>&5
21037 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040021038 echo "$as_me:21038: \$? = $ac_status" >&5
21039 (exit "$ac_status"); } &&
21040 { ac_try='test -s "conftest.$ac_objext"'
21041 { (eval echo "$as_me:21041: \"$ac_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010021042 (eval $ac_try) 2>&5
21043 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040021044 echo "$as_me:21044: \$? = $ac_status" >&5
21045 (exit "$ac_status"); }; }; then
Steve Kondikae271bc2015-11-15 02:50:53 +010021046 cf_result=yes
21047else
21048 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -040021049cat "conftest.$ac_ext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010021050cf_result=no
21051fi
micky3879b9f5e72025-07-08 18:04:53 -040021052rm -f "conftest.$ac_objext" "conftest.$ac_ext"
21053echo "$as_me:21053: result: $cf_result" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010021054echo "${ECHO_T}$cf_result" >&6
micky3879b9f5e72025-07-08 18:04:53 -040021055if test "$cf_result" = yes ; then
Steve Kondikae271bc2015-11-15 02:50:53 +010021056
21057cf_result=`echo "have_type_wint_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
21058
21059cat >>confdefs.h <<EOF
21060#define $cf_result 1
21061EOF
21062
21063else
21064
21065cat >>confdefs.h <<EOF
21066#define wint_t long
21067EOF
21068
21069fi
21070
21071 fi
21072fi
21073
micky3879b9f5e72025-07-08 18:04:53 -040021074for cf_data in \
21075TABSIZE \
21076curscr \
21077ospeed \
21078boolnames \
21079boolfnames \
21080ttytype
21081do
21082echo "$as_me:21082: checking for data $cf_data declaration in ${cf_cv_ncurses_header:-curses.h}" >&5
21083echo $ECHO_N "checking for data $cf_data declaration in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
Steve Kondikae271bc2015-11-15 02:50:53 +010021084
micky3879b9f5e72025-07-08 18:04:53 -040021085cat >"conftest.$ac_ext" <<_ACEOF
21086#line 21086 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +010021087#include "confdefs.h"
21088
21089#ifdef HAVE_XCURSES
21090#include <xcurses.h>
21091char * XCursesProgramName = "test";
21092#else
21093#include <${cf_cv_ncurses_header:-curses.h}>
21094#if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
21095#include <ncursesw/term.h>
21096#elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
21097#include <ncurses/term.h>
21098#elif defined(HAVE_TERM_H)
21099#include <term.h>
21100#endif
21101#endif
21102
21103int
micky3879b9f5e72025-07-08 18:04:53 -040021104main (void)
Steve Kondikae271bc2015-11-15 02:50:53 +010021105{
21106
micky3879b9f5e72025-07-08 18:04:53 -040021107#if defined($cf_data) && ((defined(NCURSES_WRAPPED_VAR) && (NCURSES_VERSION_PATCH < 20200208)) || defined(NCURSES_BROKEN_LINKER) || defined(NCURSES_REENTRANT))
21108 const void *foo = (const void *)($cf_data);
21109#else
21110 const void *foo = &($cf_data);
21111#endif
21112 fprintf(stderr, "testing linkage of $cf_data:%p\\n", (const void *)foo);
Steve Kondikae271bc2015-11-15 02:50:53 +010021113
21114 ;
21115 return 0;
21116}
21117_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -040021118rm -f "conftest.$ac_objext"
21119if { (eval echo "$as_me:21119: \"$ac_compile\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010021120 (eval $ac_compile) 2>&5
21121 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040021122 echo "$as_me:21122: \$? = $ac_status" >&5
21123 (exit "$ac_status"); } &&
21124 { ac_try='test -s "conftest.$ac_objext"'
21125 { (eval echo "$as_me:21125: \"$ac_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010021126 (eval $ac_try) 2>&5
21127 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040021128 echo "$as_me:21128: \$? = $ac_status" >&5
21129 (exit "$ac_status"); }; }; then
Steve Kondikae271bc2015-11-15 02:50:53 +010021130 cf_result=yes
micky3879b9f5e72025-07-08 18:04:53 -040021131
Steve Kondikae271bc2015-11-15 02:50:53 +010021132else
21133 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -040021134cat "conftest.$ac_ext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010021135cf_result=no
21136fi
micky3879b9f5e72025-07-08 18:04:53 -040021137rm -f "conftest.$ac_objext" "conftest.$ac_ext"
21138echo "$as_me:21138: result: $cf_result" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010021139echo "${ECHO_T}$cf_result" >&6
21140
micky3879b9f5e72025-07-08 18:04:53 -040021141if test "$cf_result" = yes ; then
Steve Kondikae271bc2015-11-15 02:50:53 +010021142
micky3879b9f5e72025-07-08 18:04:53 -040021143cf_result=`echo "have_curses_data_$cf_data" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
Steve Kondikae271bc2015-11-15 02:50:53 +010021144
21145 cat >>confdefs.h <<EOF
21146#define $cf_result 1
21147EOF
21148
21149else
micky3879b9f5e72025-07-08 18:04:53 -040021150 echo "$as_me:21150: checking for data $cf_data in library" >&5
21151echo $ECHO_N "checking for data $cf_data in library... $ECHO_C" >&6
Steve Kondikae271bc2015-11-15 02:50:53 +010021152 # BSD linkers insist on making weak linkage, but resolve at runtime.
21153 if test "$cross_compiling" = yes; then
21154
21155 # cross-compiling
micky3879b9f5e72025-07-08 18:04:53 -040021156 cat >"conftest.$ac_ext" <<_ACEOF
21157#line 21157 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +010021158#include "confdefs.h"
21159
21160#ifdef HAVE_XCURSES
21161#include <xcurses.h>
21162char * XCursesProgramName = "test";
21163#else
21164#include <${cf_cv_ncurses_header:-curses.h}>
21165#if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
21166#include <ncursesw/term.h>
21167#elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
21168#include <ncurses/term.h>
21169#elif defined(HAVE_TERM_H)
21170#include <term.h>
21171#endif
21172#endif
21173
micky3879b9f5e72025-07-08 18:04:53 -040021174extern char $cf_data;
Steve Kondikae271bc2015-11-15 02:50:53 +010021175int
micky3879b9f5e72025-07-08 18:04:53 -040021176main (void)
Steve Kondikae271bc2015-11-15 02:50:53 +010021177{
21178
21179 do {
micky3879b9f5e72025-07-08 18:04:53 -040021180
21181#if defined($cf_data) && ((defined(NCURSES_WRAPPED_VAR) && (NCURSES_VERSION_PATCH < 20200208)) || defined(NCURSES_BROKEN_LINKER) || defined(NCURSES_REENTRANT))
21182 const void *foo = (const void *)($cf_data);
21183#else
21184 const void *foo = &($cf_data);
21185#endif
21186 fprintf(stderr, "testing linkage of $cf_data:%p\\n", (const void *)foo);
21187
Steve Kondikae271bc2015-11-15 02:50:53 +010021188 ${cf_cv_main_return:-return}(foo == 0);
21189 } while (0)
21190
21191 ;
21192 return 0;
21193}
21194_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -040021195rm -f "conftest.$ac_objext" "conftest$ac_exeext"
21196if { (eval echo "$as_me:21196: \"$ac_link\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010021197 (eval $ac_link) 2>&5
21198 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040021199 echo "$as_me:21199: \$? = $ac_status" >&5
21200 (exit "$ac_status"); } &&
21201 { ac_try='test -s "conftest$ac_exeext"'
21202 { (eval echo "$as_me:21202: \"$ac_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010021203 (eval $ac_try) 2>&5
21204 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040021205 echo "$as_me:21205: \$? = $ac_status" >&5
21206 (exit "$ac_status"); }; }; then
Steve Kondikae271bc2015-11-15 02:50:53 +010021207 cf_result=yes
21208else
21209 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -040021210cat "conftest.$ac_ext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010021211cf_result=no
21212fi
micky3879b9f5e72025-07-08 18:04:53 -040021213rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
Steve Kondikae271bc2015-11-15 02:50:53 +010021214
21215else
micky3879b9f5e72025-07-08 18:04:53 -040021216 cat >"conftest.$ac_ext" <<_ACEOF
21217#line 21217 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +010021218#include "confdefs.h"
21219
21220#ifdef HAVE_XCURSES
21221#include <xcurses.h>
21222char * XCursesProgramName = "test";
21223#else
21224#include <${cf_cv_ncurses_header:-curses.h}>
21225#if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
21226#include <ncursesw/term.h>
21227#elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
21228#include <ncurses/term.h>
21229#elif defined(HAVE_TERM_H)
21230#include <term.h>
21231#endif
21232#endif
21233
micky3879b9f5e72025-07-08 18:04:53 -040021234extern char $cf_data;
Steve Kondikae271bc2015-11-15 02:50:53 +010021235int main(void)
21236{
micky3879b9f5e72025-07-08 18:04:53 -040021237
21238#if defined($cf_data) && ((defined(NCURSES_WRAPPED_VAR) && (NCURSES_VERSION_PATCH < 20200208)) || defined(NCURSES_BROKEN_LINKER) || defined(NCURSES_REENTRANT))
21239 const void *foo = (const void *)($cf_data);
21240#else
21241 const void *foo = &($cf_data);
21242#endif
21243 fprintf(stderr, "testing linkage of $cf_data:%p\\n", (const void *)foo);
21244
Steve Kondikae271bc2015-11-15 02:50:53 +010021245 ${cf_cv_main_return:-return}(foo == 0);
21246}
21247_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -040021248rm -f "conftest$ac_exeext"
21249if { (eval echo "$as_me:21249: \"$ac_link\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010021250 (eval $ac_link) 2>&5
21251 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040021252 echo "$as_me:21252: \$? = $ac_status" >&5
21253 (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
21254 { (eval echo "$as_me:21254: \"$ac_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010021255 (eval $ac_try) 2>&5
21256 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040021257 echo "$as_me:21257: \$? = $ac_status" >&5
21258 (exit "$ac_status"); }; }; then
Steve Kondikae271bc2015-11-15 02:50:53 +010021259 cf_result=yes
micky3879b9f5e72025-07-08 18:04:53 -040021260
Steve Kondikae271bc2015-11-15 02:50:53 +010021261else
21262 echo "$as_me: program exited with status $ac_status" >&5
21263echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -040021264cat "conftest.$ac_ext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010021265cf_result=no
21266fi
micky3879b9f5e72025-07-08 18:04:53 -040021267rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
Steve Kondikae271bc2015-11-15 02:50:53 +010021268fi
micky3879b9f5e72025-07-08 18:04:53 -040021269 echo "$as_me:21269: result: $cf_result" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010021270echo "${ECHO_T}$cf_result" >&6
micky3879b9f5e72025-07-08 18:04:53 -040021271 if test "$cf_result" = yes ; then
Steve Kondikae271bc2015-11-15 02:50:53 +010021272
micky3879b9f5e72025-07-08 18:04:53 -040021273cf_result=`echo "decl_curses_data_$cf_data" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
Steve Kondikae271bc2015-11-15 02:50:53 +010021274
21275 cat >>confdefs.h <<EOF
21276#define $cf_result 1
21277EOF
21278
micky3879b9f5e72025-07-08 18:04:53 -040021279 # do not exit loop here, since we prefer system's declarations
Steve Kondikae271bc2015-11-15 02:50:53 +010021280 fi
21281fi
micky3879b9f5e72025-07-08 18:04:53 -040021282done
Steve Kondikae271bc2015-11-15 02:50:53 +010021283
micky3879b9f5e72025-07-08 18:04:53 -040021284if test -n "$with_screen" && test "x$with_screen" = "xpdcurses"
Steve Kondikae271bc2015-11-15 02:50:53 +010021285then
micky3879b9f5e72025-07-08 18:04:53 -040021286 echo "$as_me:21286: checking for X" >&5
21287echo $ECHO_N "checking for X... $ECHO_C" >&6
21288
21289# Check whether --with-x or --without-x was given.
21290if test "${with_x+set}" = set; then
21291 withval="$with_x"
21292
21293fi;
21294# $have_x is `yes', `no', `disabled', or empty when we do not yet know.
21295if test "x$with_x" = xno; then
21296 # The user explicitly disabled X.
21297 have_x=disabled
21298else
21299 if test "x$x_includes" != xNONE && test "x$x_libraries" != xNONE; then
21300 # Both variables are already set.
21301 have_x=yes
21302 else
21303 if test "${ac_cv_have_x+set}" = set; then
21304 echo $ECHO_N "(cached) $ECHO_C" >&6
21305else
21306 # One or both of the vars are not set, and there is no cached value.
21307ac_x_includes=no ac_x_libraries=no
21308rm -fr conftest.dir
21309if mkdir conftest.dir; then
21310 cd conftest.dir
21311 # Make sure to not put "make" in the Imakefile rules, since we grep it out.
21312 cat >Imakefile <<'EOF'
21313acfindx:
21314 @echo 'ac_im_incroot="${INCROOT}"; ac_im_usrlibdir="${USRLIBDIR}"; ac_im_libdir="${LIBDIR}"'
21315EOF
21316 if (xmkmf) >/dev/null 2>/dev/null && test -f Makefile; then
21317 # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
21318 eval "`${MAKE-make} acfindx 2>/dev/null | grep -v make`"
21319 # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR.
21320 for ac_extension in a so sl dylib dll; do
21321 if test ! -f "$ac_im_usrlibdir/libX11.$ac_extension" &&
21322 test -f "$ac_im_libdir/libX11.$ac_extension"; then
21323 ac_im_usrlibdir=$ac_im_libdir; break
21324 fi
21325 done
21326 # Screen out bogus values from the imake configuration. They are
21327 # bogus both because they are the default anyway, and because
21328 # using them would break gcc on systems where it needs fixed includes.
21329 case $ac_im_incroot in
21330 /usr/include) ;;
21331 *) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes=$ac_im_incroot;;
21332 esac
21333 case $ac_im_usrlibdir in
21334 /usr/lib | /lib) ;;
21335 *) test -d "$ac_im_usrlibdir" && ac_x_libraries=$ac_im_usrlibdir ;;
21336 esac
21337 fi
21338 cd ..
21339 rm -fr conftest.dir
21340fi
21341
21342# Standard set of common directories for X headers.
21343# Check X11 before X11Rn because it is often a symlink to the current release.
21344ac_x_header_dirs='
21345/usr/X11/include
21346/usr/X11R7/include
21347/usr/X11R6/include
21348/usr/X11R5/include
21349/usr/X11R4/include
21350
21351/opt/local/include
21352/opt/X11/include
21353
21354/usr/include/X11
21355/usr/include/X11R7
21356/usr/include/X11R6
21357/usr/include/X11R5
21358/usr/include/X11R4
21359
21360/usr/local/X11/include
21361/usr/local/X11R7/include
21362/usr/local/X11R6/include
21363/usr/local/X11R5/include
21364/usr/local/X11R4/include
21365
21366/usr/local/include/X11
21367/usr/local/include/X11R7
21368/usr/local/include/X11R6
21369/usr/local/include/X11R5
21370/usr/local/include/X11R4
21371
21372/usr/X386/include
21373/usr/x386/include
21374/usr/XFree86/include/X11
21375
21376/usr/include
21377/usr/local/include
21378/usr/unsupported/include
21379/usr/athena/include
21380/usr/local/x11r5/include
21381/usr/lpp/Xamples/include
21382
21383/usr/openwin/include
21384/usr/openwin/share/include'
21385
21386if test "$ac_x_includes" = no; then
21387 # Guess where to find include files, by looking for Intrinsic.h.
21388 # First, try using that file with no special directory specified.
21389 cat >"conftest.$ac_ext" <<_ACEOF
21390#line 21390 "configure"
21391#include "confdefs.h"
21392#include <X11/Intrinsic.h>
21393_ACEOF
21394if { (eval echo "$as_me:21394: \"$ac_cpp "conftest.$ac_ext"\"") >&5
21395 (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
21396 ac_status=$?
21397 $EGREP -v '^ *\+' conftest.er1 >conftest.err
21398 rm -f conftest.er1
21399 cat conftest.err >&5
21400 echo "$as_me:21400: \$? = $ac_status" >&5
21401 (exit "$ac_status"); } >/dev/null; then
21402 if test -s conftest.err; then
21403 ac_cpp_err=$ac_c_preproc_warn_flag
21404 else
21405 ac_cpp_err=
21406 fi
21407else
21408 ac_cpp_err=yes
21409fi
21410if test -z "$ac_cpp_err"; then
21411 # We can compile using X headers with no special include directory.
21412ac_x_includes=
21413else
21414 echo "$as_me: failed program was:" >&5
21415 cat "conftest.$ac_ext" >&5
21416 for ac_dir in $ac_x_header_dirs; do
21417 if test -r "$ac_dir/X11/Intrinsic.h"; then
21418 ac_x_includes=$ac_dir
21419 break
21420 fi
21421done
21422fi
21423rm -f conftest.err "conftest.$ac_ext"
21424fi # $ac_x_includes = no
21425
21426if test "$ac_x_libraries" = no; then
21427 # Check for the libraries.
21428 # See if we find them without any special options.
21429 # Don't add to $LIBS permanently.
21430 ac_save_LIBS=$LIBS
21431 LIBS="-lXt $LIBS"
21432 cat >"conftest.$ac_ext" <<_ACEOF
21433#line 21433 "configure"
21434#include "confdefs.h"
21435#include <X11/Intrinsic.h>
21436int
21437main (void)
21438{
21439XtMalloc (0)
21440 ;
21441 return 0;
21442}
21443_ACEOF
21444rm -f "conftest.$ac_objext" "conftest$ac_exeext"
21445if { (eval echo "$as_me:21445: \"$ac_link\"") >&5
21446 (eval $ac_link) 2>&5
21447 ac_status=$?
21448 echo "$as_me:21448: \$? = $ac_status" >&5
21449 (exit "$ac_status"); } &&
21450 { ac_try='test -s "conftest$ac_exeext"'
21451 { (eval echo "$as_me:21451: \"$ac_try\"") >&5
21452 (eval $ac_try) 2>&5
21453 ac_status=$?
21454 echo "$as_me:21454: \$? = $ac_status" >&5
21455 (exit "$ac_status"); }; }; then
21456 LIBS=$ac_save_LIBS
21457# We can link X programs with no special library path.
21458ac_x_libraries=
21459else
21460 echo "$as_me: failed program was:" >&5
21461cat "conftest.$ac_ext" >&5
21462LIBS=$ac_save_LIBS
21463for ac_dir in `echo "$ac_x_includes $ac_x_header_dirs" | sed s/include/lib/g`
21464do
21465 # Don't even attempt the hair of trying to link an X program!
21466 for ac_extension in a so sl dylib dll; do
21467 if test -r "$ac_dir/libXt.$ac_extension"; then
21468 ac_x_libraries=$ac_dir
21469 break 2
21470 fi
21471 done
21472done
21473fi
21474rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
21475fi # $ac_x_libraries = no
21476
21477if test "$ac_x_includes" = no || test "$ac_x_libraries" = no; then
21478 # Didn't find X anywhere. Cache the known absence of X.
21479 ac_cv_have_x="have_x=no"
21480else
21481 # Record where we found X for the cache.
21482 ac_cv_have_x="have_x=yes \
21483 ac_x_includes=$ac_x_includes ac_x_libraries=$ac_x_libraries"
21484fi
21485fi
21486
21487 fi
21488 eval "$ac_cv_have_x"
21489fi # $with_x != no
21490
21491if test "$have_x" != yes; then
21492 echo "$as_me:21492: result: $have_x" >&5
21493echo "${ECHO_T}$have_x" >&6
21494 no_x=yes
21495else
21496 # If each of the values was on the command line, it overrides each guess.
21497 test "x$x_includes" = xNONE && x_includes=$ac_x_includes
21498 test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries
21499 # Update the cache value to reflect the command line values.
21500 ac_cv_have_x="have_x=yes \
21501 ac_x_includes=$x_includes ac_x_libraries=$x_libraries"
21502 echo "$as_me:21502: result: libraries $x_libraries, headers $x_includes" >&5
21503echo "${ECHO_T}libraries $x_libraries, headers $x_includes" >&6
21504fi
21505
21506 if test "$no_x" = yes; then
21507 # Not all programs may use this symbol, but it does not hurt to define it.
21508
21509cat >>confdefs.h <<\EOF
21510#define X_DISPLAY_MISSING 1
21511EOF
21512
21513 X_CFLAGS=
21514 X_PRE_LIBS=
21515 X_LIBS=
21516 X_EXTRA_LIBS=
21517else
21518 if test -n "$x_includes"; then
21519 X_CFLAGS="$X_CFLAGS -I$x_includes"
21520 fi
21521
21522 # It would also be nice to do this for all -L options, not just this one.
21523 if test -n "$x_libraries"; then
21524 X_LIBS="$X_LIBS -L$x_libraries"
21525 # For Solaris; some versions of Sun CC require a space after -R and
21526 # others require no space. Words are not sufficient . . . .
21527 case `(uname -sr) 2>/dev/null` in
21528 "SunOS 5"*)
21529 echo "$as_me:21529: checking whether -R must be followed by a space" >&5
21530echo $ECHO_N "checking whether -R must be followed by a space... $ECHO_C" >&6
21531 ac_xsave_LIBS=$LIBS; LIBS="$LIBS -R$x_libraries"
21532 cat >"conftest.$ac_ext" <<_ACEOF
21533#line 21533 "configure"
21534#include "confdefs.h"
21535
21536int
21537main (void)
21538{
21539
21540 ;
21541 return 0;
21542}
21543_ACEOF
21544rm -f "conftest.$ac_objext" "conftest$ac_exeext"
21545if { (eval echo "$as_me:21545: \"$ac_link\"") >&5
21546 (eval $ac_link) 2>&5
21547 ac_status=$?
21548 echo "$as_me:21548: \$? = $ac_status" >&5
21549 (exit "$ac_status"); } &&
21550 { ac_try='test -s "conftest$ac_exeext"'
21551 { (eval echo "$as_me:21551: \"$ac_try\"") >&5
21552 (eval $ac_try) 2>&5
21553 ac_status=$?
21554 echo "$as_me:21554: \$? = $ac_status" >&5
21555 (exit "$ac_status"); }; }; then
21556 ac_R_nospace=yes
21557else
21558 echo "$as_me: failed program was:" >&5
21559cat "conftest.$ac_ext" >&5
21560ac_R_nospace=no
21561fi
21562rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
21563 if test $ac_R_nospace = yes; then
21564 echo "$as_me:21564: result: no" >&5
21565echo "${ECHO_T}no" >&6
21566 X_LIBS="$X_LIBS -R$x_libraries"
21567 else
21568 LIBS="$ac_xsave_LIBS -R $x_libraries"
21569 cat >"conftest.$ac_ext" <<_ACEOF
21570#line 21570 "configure"
21571#include "confdefs.h"
21572
21573int
21574main (void)
21575{
21576
21577 ;
21578 return 0;
21579}
21580_ACEOF
21581rm -f "conftest.$ac_objext" "conftest$ac_exeext"
21582if { (eval echo "$as_me:21582: \"$ac_link\"") >&5
21583 (eval $ac_link) 2>&5
21584 ac_status=$?
21585 echo "$as_me:21585: \$? = $ac_status" >&5
21586 (exit "$ac_status"); } &&
21587 { ac_try='test -s "conftest$ac_exeext"'
21588 { (eval echo "$as_me:21588: \"$ac_try\"") >&5
21589 (eval $ac_try) 2>&5
21590 ac_status=$?
21591 echo "$as_me:21591: \$? = $ac_status" >&5
21592 (exit "$ac_status"); }; }; then
21593 ac_R_space=yes
21594else
21595 echo "$as_me: failed program was:" >&5
21596cat "conftest.$ac_ext" >&5
21597ac_R_space=no
21598fi
21599rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
21600 if test $ac_R_space = yes; then
21601 echo "$as_me:21601: result: yes" >&5
21602echo "${ECHO_T}yes" >&6
21603 X_LIBS="$X_LIBS -R $x_libraries"
21604 else
21605 echo "$as_me:21605: result: neither works" >&5
21606echo "${ECHO_T}neither works" >&6
21607 fi
21608 fi
21609 LIBS=$ac_xsave_LIBS
21610 esac
21611 fi
21612
21613 # Check for system-dependent libraries X programs must link with.
21614 # Do this before checking for the system-independent R6 libraries
21615 # (-lICE), since we may need -lsocket or whatever for X linking.
21616
21617 if test "$ISC" = yes; then
21618 X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl_s -linet"
21619 else
21620 # Martyn Johnson says this is needed for Ultrix, if the X
21621 # libraries were built with DECnet support. And Karl Berry says
21622 # the Alpha needs dnet_stub (dnet does not exist).
21623 ac_xsave_LIBS="$LIBS"; LIBS="$LIBS $X_LIBS -lX11"
21624 cat >"conftest.$ac_ext" <<_ACEOF
21625#line 21625 "configure"
21626#include "confdefs.h"
21627
21628/* Override any gcc2 internal prototype to avoid an error. */
21629#ifdef __cplusplus
21630extern "C"
21631#endif
21632/* We use char because int might match the return type of a gcc2
21633 builtin and then its argument prototype would still apply. */
21634char XOpenDisplay (void);
21635int
21636main (void)
21637{
21638XOpenDisplay ();
21639 ;
21640 return 0;
21641}
21642_ACEOF
21643rm -f "conftest.$ac_objext" "conftest$ac_exeext"
21644if { (eval echo "$as_me:21644: \"$ac_link\"") >&5
21645 (eval $ac_link) 2>&5
21646 ac_status=$?
21647 echo "$as_me:21647: \$? = $ac_status" >&5
21648 (exit "$ac_status"); } &&
21649 { ac_try='test -s "conftest$ac_exeext"'
21650 { (eval echo "$as_me:21650: \"$ac_try\"") >&5
21651 (eval $ac_try) 2>&5
21652 ac_status=$?
21653 echo "$as_me:21653: \$? = $ac_status" >&5
21654 (exit "$ac_status"); }; }; then
21655 :
21656else
21657 echo "$as_me: failed program was:" >&5
21658cat "conftest.$ac_ext" >&5
21659echo "$as_me:21659: checking for dnet_ntoa in -ldnet" >&5
21660echo $ECHO_N "checking for dnet_ntoa in -ldnet... $ECHO_C" >&6
21661if test "${ac_cv_lib_dnet_dnet_ntoa+set}" = set; then
21662 echo $ECHO_N "(cached) $ECHO_C" >&6
21663else
21664 ac_check_lib_save_LIBS=$LIBS
21665LIBS="-ldnet $LIBS"
21666cat >"conftest.$ac_ext" <<_ACEOF
21667#line 21667 "configure"
21668#include "confdefs.h"
21669
21670/* Override any gcc2 internal prototype to avoid an error. */
21671#ifdef __cplusplus
21672extern "C"
21673#endif
21674/* We use char because int might match the return type of a gcc2
21675 builtin and then its argument prototype would still apply. */
21676char dnet_ntoa (void);
21677int
21678main (void)
21679{
21680dnet_ntoa ();
21681 ;
21682 return 0;
21683}
21684_ACEOF
21685rm -f "conftest.$ac_objext" "conftest$ac_exeext"
21686if { (eval echo "$as_me:21686: \"$ac_link\"") >&5
21687 (eval $ac_link) 2>&5
21688 ac_status=$?
21689 echo "$as_me:21689: \$? = $ac_status" >&5
21690 (exit "$ac_status"); } &&
21691 { ac_try='test -s "conftest$ac_exeext"'
21692 { (eval echo "$as_me:21692: \"$ac_try\"") >&5
21693 (eval $ac_try) 2>&5
21694 ac_status=$?
21695 echo "$as_me:21695: \$? = $ac_status" >&5
21696 (exit "$ac_status"); }; }; then
21697 ac_cv_lib_dnet_dnet_ntoa=yes
21698else
21699 echo "$as_me: failed program was:" >&5
21700cat "conftest.$ac_ext" >&5
21701ac_cv_lib_dnet_dnet_ntoa=no
21702fi
21703rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
21704LIBS=$ac_check_lib_save_LIBS
21705fi
21706echo "$as_me:21706: result: $ac_cv_lib_dnet_dnet_ntoa" >&5
21707echo "${ECHO_T}$ac_cv_lib_dnet_dnet_ntoa" >&6
21708if test "$ac_cv_lib_dnet_dnet_ntoa" = yes; then
21709 X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet"
21710fi
21711
21712 if test $ac_cv_lib_dnet_dnet_ntoa = no; then
21713 echo "$as_me:21713: checking for dnet_ntoa in -ldnet_stub" >&5
21714echo $ECHO_N "checking for dnet_ntoa in -ldnet_stub... $ECHO_C" >&6
21715if test "${ac_cv_lib_dnet_stub_dnet_ntoa+set}" = set; then
21716 echo $ECHO_N "(cached) $ECHO_C" >&6
21717else
21718 ac_check_lib_save_LIBS=$LIBS
21719LIBS="-ldnet_stub $LIBS"
21720cat >"conftest.$ac_ext" <<_ACEOF
21721#line 21721 "configure"
21722#include "confdefs.h"
21723
21724/* Override any gcc2 internal prototype to avoid an error. */
21725#ifdef __cplusplus
21726extern "C"
21727#endif
21728/* We use char because int might match the return type of a gcc2
21729 builtin and then its argument prototype would still apply. */
21730char dnet_ntoa (void);
21731int
21732main (void)
21733{
21734dnet_ntoa ();
21735 ;
21736 return 0;
21737}
21738_ACEOF
21739rm -f "conftest.$ac_objext" "conftest$ac_exeext"
21740if { (eval echo "$as_me:21740: \"$ac_link\"") >&5
21741 (eval $ac_link) 2>&5
21742 ac_status=$?
21743 echo "$as_me:21743: \$? = $ac_status" >&5
21744 (exit "$ac_status"); } &&
21745 { ac_try='test -s "conftest$ac_exeext"'
21746 { (eval echo "$as_me:21746: \"$ac_try\"") >&5
21747 (eval $ac_try) 2>&5
21748 ac_status=$?
21749 echo "$as_me:21749: \$? = $ac_status" >&5
21750 (exit "$ac_status"); }; }; then
21751 ac_cv_lib_dnet_stub_dnet_ntoa=yes
21752else
21753 echo "$as_me: failed program was:" >&5
21754cat "conftest.$ac_ext" >&5
21755ac_cv_lib_dnet_stub_dnet_ntoa=no
21756fi
21757rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
21758LIBS=$ac_check_lib_save_LIBS
21759fi
21760echo "$as_me:21760: result: $ac_cv_lib_dnet_stub_dnet_ntoa" >&5
21761echo "${ECHO_T}$ac_cv_lib_dnet_stub_dnet_ntoa" >&6
21762if test "$ac_cv_lib_dnet_stub_dnet_ntoa" = yes; then
21763 X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub"
21764fi
21765
21766 fi
21767fi
21768rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
21769 LIBS="$ac_xsave_LIBS"
21770
21771 # msh@cis.ufl.edu says -lnsl (and -lsocket) are needed for his 386/AT,
21772 # to get the SysV transport functions.
21773 # Chad R. Larson says the Pyramis MIS-ES running DC/OSx (SVR4)
21774 # needs -lnsl.
21775 # The nsl library prevents programs from opening the X display
21776 # on Irix 5.2, according to T.E. Dickey.
21777 # The functions gethostbyname, getservbyname, and inet_addr are
21778 # in -lbsd on LynxOS 3.0.1/i386, according to Lars Hecking.
21779 echo "$as_me:21779: checking for gethostbyname" >&5
21780echo $ECHO_N "checking for gethostbyname... $ECHO_C" >&6
21781if test "${ac_cv_func_gethostbyname+set}" = set; then
21782 echo $ECHO_N "(cached) $ECHO_C" >&6
21783else
21784 cat >"conftest.$ac_ext" <<_ACEOF
21785#line 21785 "configure"
21786#include "confdefs.h"
21787#define gethostbyname autoconf_temporary
21788#include <limits.h> /* least-intrusive standard header which defines gcc2 __stub macros */
21789#undef gethostbyname
21790
21791#ifdef __cplusplus
21792extern "C"
21793#endif
21794
21795/* We use char because int might match the return type of a gcc2
21796 builtin and then its argument prototype would still apply. */
21797char gethostbyname (void);
21798
21799int
21800main (void)
21801{
21802
21803/* The GNU C library defines stubs for functions which it implements
21804 to always fail with ENOSYS. Some functions are actually named
21805 something starting with __ and the normal name is an alias. */
21806#if defined (__stub_gethostbyname) || defined (__stub___gethostbyname)
21807#error found stub for gethostbyname
21808#endif
21809
21810 return gethostbyname ();
21811 ;
21812 return 0;
21813}
21814_ACEOF
21815rm -f "conftest.$ac_objext" "conftest$ac_exeext"
21816if { (eval echo "$as_me:21816: \"$ac_link\"") >&5
21817 (eval $ac_link) 2>&5
21818 ac_status=$?
21819 echo "$as_me:21819: \$? = $ac_status" >&5
21820 (exit "$ac_status"); } &&
21821 { ac_try='test -s "conftest$ac_exeext"'
21822 { (eval echo "$as_me:21822: \"$ac_try\"") >&5
21823 (eval $ac_try) 2>&5
21824 ac_status=$?
21825 echo "$as_me:21825: \$? = $ac_status" >&5
21826 (exit "$ac_status"); }; }; then
21827 ac_cv_func_gethostbyname=yes
21828else
21829 echo "$as_me: failed program was:" >&5
21830cat "conftest.$ac_ext" >&5
21831ac_cv_func_gethostbyname=no
21832fi
21833rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
21834fi
21835echo "$as_me:21835: result: $ac_cv_func_gethostbyname" >&5
21836echo "${ECHO_T}$ac_cv_func_gethostbyname" >&6
21837
21838 if test $ac_cv_func_gethostbyname = no; then
21839 echo "$as_me:21839: checking for gethostbyname in -lnsl" >&5
21840echo $ECHO_N "checking for gethostbyname in -lnsl... $ECHO_C" >&6
21841if test "${ac_cv_lib_nsl_gethostbyname+set}" = set; then
21842 echo $ECHO_N "(cached) $ECHO_C" >&6
21843else
21844 ac_check_lib_save_LIBS=$LIBS
21845LIBS="-lnsl $LIBS"
21846cat >"conftest.$ac_ext" <<_ACEOF
21847#line 21847 "configure"
21848#include "confdefs.h"
21849
21850/* Override any gcc2 internal prototype to avoid an error. */
21851#ifdef __cplusplus
21852extern "C"
21853#endif
21854/* We use char because int might match the return type of a gcc2
21855 builtin and then its argument prototype would still apply. */
21856char gethostbyname (void);
21857int
21858main (void)
21859{
21860gethostbyname ();
21861 ;
21862 return 0;
21863}
21864_ACEOF
21865rm -f "conftest.$ac_objext" "conftest$ac_exeext"
21866if { (eval echo "$as_me:21866: \"$ac_link\"") >&5
21867 (eval $ac_link) 2>&5
21868 ac_status=$?
21869 echo "$as_me:21869: \$? = $ac_status" >&5
21870 (exit "$ac_status"); } &&
21871 { ac_try='test -s "conftest$ac_exeext"'
21872 { (eval echo "$as_me:21872: \"$ac_try\"") >&5
21873 (eval $ac_try) 2>&5
21874 ac_status=$?
21875 echo "$as_me:21875: \$? = $ac_status" >&5
21876 (exit "$ac_status"); }; }; then
21877 ac_cv_lib_nsl_gethostbyname=yes
21878else
21879 echo "$as_me: failed program was:" >&5
21880cat "conftest.$ac_ext" >&5
21881ac_cv_lib_nsl_gethostbyname=no
21882fi
21883rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
21884LIBS=$ac_check_lib_save_LIBS
21885fi
21886echo "$as_me:21886: result: $ac_cv_lib_nsl_gethostbyname" >&5
21887echo "${ECHO_T}$ac_cv_lib_nsl_gethostbyname" >&6
21888if test "$ac_cv_lib_nsl_gethostbyname" = yes; then
21889 X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl"
21890fi
21891
21892 if test $ac_cv_lib_nsl_gethostbyname = no; then
21893 echo "$as_me:21893: checking for gethostbyname in -lbsd" >&5
21894echo $ECHO_N "checking for gethostbyname in -lbsd... $ECHO_C" >&6
21895if test "${ac_cv_lib_bsd_gethostbyname+set}" = set; then
21896 echo $ECHO_N "(cached) $ECHO_C" >&6
21897else
21898 ac_check_lib_save_LIBS=$LIBS
21899LIBS="-lbsd $LIBS"
21900cat >"conftest.$ac_ext" <<_ACEOF
21901#line 21901 "configure"
21902#include "confdefs.h"
21903
21904/* Override any gcc2 internal prototype to avoid an error. */
21905#ifdef __cplusplus
21906extern "C"
21907#endif
21908/* We use char because int might match the return type of a gcc2
21909 builtin and then its argument prototype would still apply. */
21910char gethostbyname (void);
21911int
21912main (void)
21913{
21914gethostbyname ();
21915 ;
21916 return 0;
21917}
21918_ACEOF
21919rm -f "conftest.$ac_objext" "conftest$ac_exeext"
21920if { (eval echo "$as_me:21920: \"$ac_link\"") >&5
21921 (eval $ac_link) 2>&5
21922 ac_status=$?
21923 echo "$as_me:21923: \$? = $ac_status" >&5
21924 (exit "$ac_status"); } &&
21925 { ac_try='test -s "conftest$ac_exeext"'
21926 { (eval echo "$as_me:21926: \"$ac_try\"") >&5
21927 (eval $ac_try) 2>&5
21928 ac_status=$?
21929 echo "$as_me:21929: \$? = $ac_status" >&5
21930 (exit "$ac_status"); }; }; then
21931 ac_cv_lib_bsd_gethostbyname=yes
21932else
21933 echo "$as_me: failed program was:" >&5
21934cat "conftest.$ac_ext" >&5
21935ac_cv_lib_bsd_gethostbyname=no
21936fi
21937rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
21938LIBS=$ac_check_lib_save_LIBS
21939fi
21940echo "$as_me:21940: result: $ac_cv_lib_bsd_gethostbyname" >&5
21941echo "${ECHO_T}$ac_cv_lib_bsd_gethostbyname" >&6
21942if test "$ac_cv_lib_bsd_gethostbyname" = yes; then
21943 X_EXTRA_LIBS="$X_EXTRA_LIBS -lbsd"
21944fi
21945
21946 fi
21947 fi
21948
21949 # lieder@skyler.mavd.honeywell.com says without -lsocket,
21950 # socket/setsockopt and other routines are undefined under SCO ODT
21951 # 2.0. But -lsocket is broken on IRIX 5.2 (and is not necessary
21952 # on later versions), says Simon Leinen: it contains gethostby*
21953 # variants that don't use the nameserver (or something). -lsocket
21954 # must be given before -lnsl if both are needed. We assume that
21955 # if connect needs -lnsl, so does gethostbyname.
21956 echo "$as_me:21956: checking for connect" >&5
21957echo $ECHO_N "checking for connect... $ECHO_C" >&6
21958if test "${ac_cv_func_connect+set}" = set; then
21959 echo $ECHO_N "(cached) $ECHO_C" >&6
21960else
21961 cat >"conftest.$ac_ext" <<_ACEOF
21962#line 21962 "configure"
21963#include "confdefs.h"
21964#define connect autoconf_temporary
21965#include <limits.h> /* least-intrusive standard header which defines gcc2 __stub macros */
21966#undef connect
21967
21968#ifdef __cplusplus
21969extern "C"
21970#endif
21971
21972/* We use char because int might match the return type of a gcc2
21973 builtin and then its argument prototype would still apply. */
21974char connect (void);
21975
21976int
21977main (void)
21978{
21979
21980/* The GNU C library defines stubs for functions which it implements
21981 to always fail with ENOSYS. Some functions are actually named
21982 something starting with __ and the normal name is an alias. */
21983#if defined (__stub_connect) || defined (__stub___connect)
21984#error found stub for connect
21985#endif
21986
21987 return connect ();
21988 ;
21989 return 0;
21990}
21991_ACEOF
21992rm -f "conftest.$ac_objext" "conftest$ac_exeext"
21993if { (eval echo "$as_me:21993: \"$ac_link\"") >&5
21994 (eval $ac_link) 2>&5
21995 ac_status=$?
21996 echo "$as_me:21996: \$? = $ac_status" >&5
21997 (exit "$ac_status"); } &&
21998 { ac_try='test -s "conftest$ac_exeext"'
21999 { (eval echo "$as_me:21999: \"$ac_try\"") >&5
22000 (eval $ac_try) 2>&5
22001 ac_status=$?
22002 echo "$as_me:22002: \$? = $ac_status" >&5
22003 (exit "$ac_status"); }; }; then
22004 ac_cv_func_connect=yes
22005else
22006 echo "$as_me: failed program was:" >&5
22007cat "conftest.$ac_ext" >&5
22008ac_cv_func_connect=no
22009fi
22010rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
22011fi
22012echo "$as_me:22012: result: $ac_cv_func_connect" >&5
22013echo "${ECHO_T}$ac_cv_func_connect" >&6
22014
22015 if test $ac_cv_func_connect = no; then
22016 echo "$as_me:22016: checking for connect in -lsocket" >&5
22017echo $ECHO_N "checking for connect in -lsocket... $ECHO_C" >&6
22018if test "${ac_cv_lib_socket_connect+set}" = set; then
22019 echo $ECHO_N "(cached) $ECHO_C" >&6
22020else
22021 ac_check_lib_save_LIBS=$LIBS
22022LIBS="-lsocket $X_EXTRA_LIBS $LIBS"
22023cat >"conftest.$ac_ext" <<_ACEOF
22024#line 22024 "configure"
22025#include "confdefs.h"
22026
22027/* Override any gcc2 internal prototype to avoid an error. */
22028#ifdef __cplusplus
22029extern "C"
22030#endif
22031/* We use char because int might match the return type of a gcc2
22032 builtin and then its argument prototype would still apply. */
22033char connect (void);
22034int
22035main (void)
22036{
22037connect ();
22038 ;
22039 return 0;
22040}
22041_ACEOF
22042rm -f "conftest.$ac_objext" "conftest$ac_exeext"
22043if { (eval echo "$as_me:22043: \"$ac_link\"") >&5
22044 (eval $ac_link) 2>&5
22045 ac_status=$?
22046 echo "$as_me:22046: \$? = $ac_status" >&5
22047 (exit "$ac_status"); } &&
22048 { ac_try='test -s "conftest$ac_exeext"'
22049 { (eval echo "$as_me:22049: \"$ac_try\"") >&5
22050 (eval $ac_try) 2>&5
22051 ac_status=$?
22052 echo "$as_me:22052: \$? = $ac_status" >&5
22053 (exit "$ac_status"); }; }; then
22054 ac_cv_lib_socket_connect=yes
22055else
22056 echo "$as_me: failed program was:" >&5
22057cat "conftest.$ac_ext" >&5
22058ac_cv_lib_socket_connect=no
22059fi
22060rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
22061LIBS=$ac_check_lib_save_LIBS
22062fi
22063echo "$as_me:22063: result: $ac_cv_lib_socket_connect" >&5
22064echo "${ECHO_T}$ac_cv_lib_socket_connect" >&6
22065if test "$ac_cv_lib_socket_connect" = yes; then
22066 X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS"
22067fi
22068
22069 fi
22070
22071 # Guillermo Gomez says -lposix is necessary on A/UX.
22072 echo "$as_me:22072: checking for remove" >&5
22073echo $ECHO_N "checking for remove... $ECHO_C" >&6
22074if test "${ac_cv_func_remove+set}" = set; then
22075 echo $ECHO_N "(cached) $ECHO_C" >&6
22076else
22077 cat >"conftest.$ac_ext" <<_ACEOF
22078#line 22078 "configure"
22079#include "confdefs.h"
22080#define remove autoconf_temporary
22081#include <limits.h> /* least-intrusive standard header which defines gcc2 __stub macros */
22082#undef remove
22083
22084#ifdef __cplusplus
22085extern "C"
22086#endif
22087
22088/* We use char because int might match the return type of a gcc2
22089 builtin and then its argument prototype would still apply. */
22090char remove (void);
22091
22092int
22093main (void)
22094{
22095
22096/* The GNU C library defines stubs for functions which it implements
22097 to always fail with ENOSYS. Some functions are actually named
22098 something starting with __ and the normal name is an alias. */
22099#if defined (__stub_remove) || defined (__stub___remove)
22100#error found stub for remove
22101#endif
22102
22103 return remove ();
22104 ;
22105 return 0;
22106}
22107_ACEOF
22108rm -f "conftest.$ac_objext" "conftest$ac_exeext"
22109if { (eval echo "$as_me:22109: \"$ac_link\"") >&5
22110 (eval $ac_link) 2>&5
22111 ac_status=$?
22112 echo "$as_me:22112: \$? = $ac_status" >&5
22113 (exit "$ac_status"); } &&
22114 { ac_try='test -s "conftest$ac_exeext"'
22115 { (eval echo "$as_me:22115: \"$ac_try\"") >&5
22116 (eval $ac_try) 2>&5
22117 ac_status=$?
22118 echo "$as_me:22118: \$? = $ac_status" >&5
22119 (exit "$ac_status"); }; }; then
22120 ac_cv_func_remove=yes
22121else
22122 echo "$as_me: failed program was:" >&5
22123cat "conftest.$ac_ext" >&5
22124ac_cv_func_remove=no
22125fi
22126rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
22127fi
22128echo "$as_me:22128: result: $ac_cv_func_remove" >&5
22129echo "${ECHO_T}$ac_cv_func_remove" >&6
22130
22131 if test $ac_cv_func_remove = no; then
22132 echo "$as_me:22132: checking for remove in -lposix" >&5
22133echo $ECHO_N "checking for remove in -lposix... $ECHO_C" >&6
22134if test "${ac_cv_lib_posix_remove+set}" = set; then
22135 echo $ECHO_N "(cached) $ECHO_C" >&6
22136else
22137 ac_check_lib_save_LIBS=$LIBS
22138LIBS="-lposix $LIBS"
22139cat >"conftest.$ac_ext" <<_ACEOF
22140#line 22140 "configure"
22141#include "confdefs.h"
22142
22143/* Override any gcc2 internal prototype to avoid an error. */
22144#ifdef __cplusplus
22145extern "C"
22146#endif
22147/* We use char because int might match the return type of a gcc2
22148 builtin and then its argument prototype would still apply. */
22149char remove (void);
22150int
22151main (void)
22152{
22153remove ();
22154 ;
22155 return 0;
22156}
22157_ACEOF
22158rm -f "conftest.$ac_objext" "conftest$ac_exeext"
22159if { (eval echo "$as_me:22159: \"$ac_link\"") >&5
22160 (eval $ac_link) 2>&5
22161 ac_status=$?
22162 echo "$as_me:22162: \$? = $ac_status" >&5
22163 (exit "$ac_status"); } &&
22164 { ac_try='test -s "conftest$ac_exeext"'
22165 { (eval echo "$as_me:22165: \"$ac_try\"") >&5
22166 (eval $ac_try) 2>&5
22167 ac_status=$?
22168 echo "$as_me:22168: \$? = $ac_status" >&5
22169 (exit "$ac_status"); }; }; then
22170 ac_cv_lib_posix_remove=yes
22171else
22172 echo "$as_me: failed program was:" >&5
22173cat "conftest.$ac_ext" >&5
22174ac_cv_lib_posix_remove=no
22175fi
22176rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
22177LIBS=$ac_check_lib_save_LIBS
22178fi
22179echo "$as_me:22179: result: $ac_cv_lib_posix_remove" >&5
22180echo "${ECHO_T}$ac_cv_lib_posix_remove" >&6
22181if test "$ac_cv_lib_posix_remove" = yes; then
22182 X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix"
22183fi
22184
22185 fi
22186
22187 # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay.
22188 echo "$as_me:22188: checking for shmat" >&5
22189echo $ECHO_N "checking for shmat... $ECHO_C" >&6
22190if test "${ac_cv_func_shmat+set}" = set; then
22191 echo $ECHO_N "(cached) $ECHO_C" >&6
22192else
22193 cat >"conftest.$ac_ext" <<_ACEOF
22194#line 22194 "configure"
22195#include "confdefs.h"
22196#define shmat autoconf_temporary
22197#include <limits.h> /* least-intrusive standard header which defines gcc2 __stub macros */
22198#undef shmat
22199
22200#ifdef __cplusplus
22201extern "C"
22202#endif
22203
22204/* We use char because int might match the return type of a gcc2
22205 builtin and then its argument prototype would still apply. */
22206char shmat (void);
22207
22208int
22209main (void)
22210{
22211
22212/* The GNU C library defines stubs for functions which it implements
22213 to always fail with ENOSYS. Some functions are actually named
22214 something starting with __ and the normal name is an alias. */
22215#if defined (__stub_shmat) || defined (__stub___shmat)
22216#error found stub for shmat
22217#endif
22218
22219 return shmat ();
22220 ;
22221 return 0;
22222}
22223_ACEOF
22224rm -f "conftest.$ac_objext" "conftest$ac_exeext"
22225if { (eval echo "$as_me:22225: \"$ac_link\"") >&5
22226 (eval $ac_link) 2>&5
22227 ac_status=$?
22228 echo "$as_me:22228: \$? = $ac_status" >&5
22229 (exit "$ac_status"); } &&
22230 { ac_try='test -s "conftest$ac_exeext"'
22231 { (eval echo "$as_me:22231: \"$ac_try\"") >&5
22232 (eval $ac_try) 2>&5
22233 ac_status=$?
22234 echo "$as_me:22234: \$? = $ac_status" >&5
22235 (exit "$ac_status"); }; }; then
22236 ac_cv_func_shmat=yes
22237else
22238 echo "$as_me: failed program was:" >&5
22239cat "conftest.$ac_ext" >&5
22240ac_cv_func_shmat=no
22241fi
22242rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
22243fi
22244echo "$as_me:22244: result: $ac_cv_func_shmat" >&5
22245echo "${ECHO_T}$ac_cv_func_shmat" >&6
22246
22247 if test $ac_cv_func_shmat = no; then
22248 echo "$as_me:22248: checking for shmat in -lipc" >&5
22249echo $ECHO_N "checking for shmat in -lipc... $ECHO_C" >&6
22250if test "${ac_cv_lib_ipc_shmat+set}" = set; then
22251 echo $ECHO_N "(cached) $ECHO_C" >&6
22252else
22253 ac_check_lib_save_LIBS=$LIBS
22254LIBS="-lipc $LIBS"
22255cat >"conftest.$ac_ext" <<_ACEOF
22256#line 22256 "configure"
22257#include "confdefs.h"
22258
22259/* Override any gcc2 internal prototype to avoid an error. */
22260#ifdef __cplusplus
22261extern "C"
22262#endif
22263/* We use char because int might match the return type of a gcc2
22264 builtin and then its argument prototype would still apply. */
22265char shmat (void);
22266int
22267main (void)
22268{
22269shmat ();
22270 ;
22271 return 0;
22272}
22273_ACEOF
22274rm -f "conftest.$ac_objext" "conftest$ac_exeext"
22275if { (eval echo "$as_me:22275: \"$ac_link\"") >&5
22276 (eval $ac_link) 2>&5
22277 ac_status=$?
22278 echo "$as_me:22278: \$? = $ac_status" >&5
22279 (exit "$ac_status"); } &&
22280 { ac_try='test -s "conftest$ac_exeext"'
22281 { (eval echo "$as_me:22281: \"$ac_try\"") >&5
22282 (eval $ac_try) 2>&5
22283 ac_status=$?
22284 echo "$as_me:22284: \$? = $ac_status" >&5
22285 (exit "$ac_status"); }; }; then
22286 ac_cv_lib_ipc_shmat=yes
22287else
22288 echo "$as_me: failed program was:" >&5
22289cat "conftest.$ac_ext" >&5
22290ac_cv_lib_ipc_shmat=no
22291fi
22292rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
22293LIBS=$ac_check_lib_save_LIBS
22294fi
22295echo "$as_me:22295: result: $ac_cv_lib_ipc_shmat" >&5
22296echo "${ECHO_T}$ac_cv_lib_ipc_shmat" >&6
22297if test "$ac_cv_lib_ipc_shmat" = yes; then
22298 X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc"
22299fi
22300
22301 fi
22302 fi
22303
22304 # Check for libraries that X11R6 Xt/Xaw programs need.
22305 ac_save_LDFLAGS=$LDFLAGS
22306 test -n "$x_libraries" && LDFLAGS="$LDFLAGS -L$x_libraries"
22307 # SM needs ICE to (dynamically) link under SunOS 4.x (so we have to
22308 # check for ICE first), but we must link in the order -lSM -lICE or
22309 # we get undefined symbols. So assume we have SM if we have ICE.
22310 # These have to be linked with before -lX11, unlike the other
22311 # libraries we check for below, so use a different variable.
22312 # John Interrante, Karl Berry
22313 echo "$as_me:22313: checking for IceConnectionNumber in -lICE" >&5
22314echo $ECHO_N "checking for IceConnectionNumber in -lICE... $ECHO_C" >&6
22315if test "${ac_cv_lib_ICE_IceConnectionNumber+set}" = set; then
22316 echo $ECHO_N "(cached) $ECHO_C" >&6
22317else
22318 ac_check_lib_save_LIBS=$LIBS
22319LIBS="-lICE $X_EXTRA_LIBS $LIBS"
22320cat >"conftest.$ac_ext" <<_ACEOF
22321#line 22321 "configure"
22322#include "confdefs.h"
22323
22324/* Override any gcc2 internal prototype to avoid an error. */
22325#ifdef __cplusplus
22326extern "C"
22327#endif
22328/* We use char because int might match the return type of a gcc2
22329 builtin and then its argument prototype would still apply. */
22330char IceConnectionNumber (void);
22331int
22332main (void)
22333{
22334IceConnectionNumber ();
22335 ;
22336 return 0;
22337}
22338_ACEOF
22339rm -f "conftest.$ac_objext" "conftest$ac_exeext"
22340if { (eval echo "$as_me:22340: \"$ac_link\"") >&5
22341 (eval $ac_link) 2>&5
22342 ac_status=$?
22343 echo "$as_me:22343: \$? = $ac_status" >&5
22344 (exit "$ac_status"); } &&
22345 { ac_try='test -s "conftest$ac_exeext"'
22346 { (eval echo "$as_me:22346: \"$ac_try\"") >&5
22347 (eval $ac_try) 2>&5
22348 ac_status=$?
22349 echo "$as_me:22349: \$? = $ac_status" >&5
22350 (exit "$ac_status"); }; }; then
22351 ac_cv_lib_ICE_IceConnectionNumber=yes
22352else
22353 echo "$as_me: failed program was:" >&5
22354cat "conftest.$ac_ext" >&5
22355ac_cv_lib_ICE_IceConnectionNumber=no
22356fi
22357rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
22358LIBS=$ac_check_lib_save_LIBS
22359fi
22360echo "$as_me:22360: result: $ac_cv_lib_ICE_IceConnectionNumber" >&5
22361echo "${ECHO_T}$ac_cv_lib_ICE_IceConnectionNumber" >&6
22362if test "$ac_cv_lib_ICE_IceConnectionNumber" = yes; then
22363 X_PRE_LIBS="$X_PRE_LIBS -lSM -lICE"
22364fi
22365
22366 LDFLAGS=$ac_save_LDFLAGS
22367
22368fi
22369
22370fi
22371
22372if test "$GCC" = yes || test "$GXX" = yes
22373then
22374
22375if test "$GCC" = yes || test "$GXX" = yes
22376then
22377 case $CFLAGS in
22378 (*-Werror=*)
22379 cf_temp_flags=
22380 for cf_temp_scan in $CFLAGS
22381 do
22382 case "x$cf_temp_scan" in
22383 (x-Werror=format*)
22384
22385 test -n "$cf_temp_flags" && cf_temp_flags="$cf_temp_flags "
22386 cf_temp_flags="${cf_temp_flags}$cf_temp_scan"
22387
22388 ;;
22389 (x-Werror=*)
22390
22391 test -n "$EXTRA_CFLAGS" && EXTRA_CFLAGS="$EXTRA_CFLAGS "
22392 EXTRA_CFLAGS="${EXTRA_CFLAGS}$cf_temp_scan"
22393
22394 ;;
22395 (*)
22396
22397 test -n "$cf_temp_flags" && cf_temp_flags="$cf_temp_flags "
22398 cf_temp_flags="${cf_temp_flags}$cf_temp_scan"
22399
22400 ;;
22401 esac
22402 done
22403 if test "x$CFLAGS" != "x$cf_temp_flags"
22404 then
22405 test -n "$verbose" && echo " repairing CFLAGS: $CFLAGS" 1>&6
22406
22407echo "${as_me:-configure}:22407: testing repairing CFLAGS: $CFLAGS ..." 1>&5
22408
22409 CFLAGS="$cf_temp_flags"
22410 test -n "$verbose" && echo " ... fixed $CFLAGS" 1>&6
22411
22412echo "${as_me:-configure}:22412: testing ... fixed $CFLAGS ..." 1>&5
22413
22414 test -n "$verbose" && echo " ... extra $EXTRA_CFLAGS" 1>&6
22415
22416echo "${as_me:-configure}:22416: testing ... extra $EXTRA_CFLAGS ..." 1>&5
22417
22418 fi
22419 ;;
22420 esac
22421fi
22422
22423if test "$GCC" = yes || test "$GXX" = yes
22424then
22425 case $CPPFLAGS in
22426 (*-Werror=*)
22427 cf_temp_flags=
22428 for cf_temp_scan in $CPPFLAGS
22429 do
22430 case "x$cf_temp_scan" in
22431 (x-Werror=format*)
22432
22433 test -n "$cf_temp_flags" && cf_temp_flags="$cf_temp_flags "
22434 cf_temp_flags="${cf_temp_flags}$cf_temp_scan"
22435
22436 ;;
22437 (x-Werror=*)
22438
22439 test -n "$EXTRA_CFLAGS" && EXTRA_CFLAGS="$EXTRA_CFLAGS "
22440 EXTRA_CFLAGS="${EXTRA_CFLAGS}$cf_temp_scan"
22441
22442 ;;
22443 (*)
22444
22445 test -n "$cf_temp_flags" && cf_temp_flags="$cf_temp_flags "
22446 cf_temp_flags="${cf_temp_flags}$cf_temp_scan"
22447
22448 ;;
22449 esac
22450 done
22451 if test "x$CPPFLAGS" != "x$cf_temp_flags"
22452 then
22453 test -n "$verbose" && echo " repairing CPPFLAGS: $CPPFLAGS" 1>&6
22454
22455echo "${as_me:-configure}:22455: testing repairing CPPFLAGS: $CPPFLAGS ..." 1>&5
22456
22457 CPPFLAGS="$cf_temp_flags"
22458 test -n "$verbose" && echo " ... fixed $CPPFLAGS" 1>&6
22459
22460echo "${as_me:-configure}:22460: testing ... fixed $CPPFLAGS ..." 1>&5
22461
22462 test -n "$verbose" && echo " ... extra $EXTRA_CFLAGS" 1>&6
22463
22464echo "${as_me:-configure}:22464: testing ... extra $EXTRA_CFLAGS ..." 1>&5
22465
22466 fi
22467 ;;
22468 esac
22469fi
22470
22471if test "$GCC" = yes || test "$GXX" = yes
22472then
22473 case $LDFLAGS in
22474 (*-Werror=*)
22475 cf_temp_flags=
22476 for cf_temp_scan in $LDFLAGS
22477 do
22478 case "x$cf_temp_scan" in
22479 (x-Werror=format*)
22480
22481 test -n "$cf_temp_flags" && cf_temp_flags="$cf_temp_flags "
22482 cf_temp_flags="${cf_temp_flags}$cf_temp_scan"
22483
22484 ;;
22485 (x-Werror=*)
22486
22487 test -n "$EXTRA_CFLAGS" && EXTRA_CFLAGS="$EXTRA_CFLAGS "
22488 EXTRA_CFLAGS="${EXTRA_CFLAGS}$cf_temp_scan"
22489
22490 ;;
22491 (*)
22492
22493 test -n "$cf_temp_flags" && cf_temp_flags="$cf_temp_flags "
22494 cf_temp_flags="${cf_temp_flags}$cf_temp_scan"
22495
22496 ;;
22497 esac
22498 done
22499 if test "x$LDFLAGS" != "x$cf_temp_flags"
22500 then
22501 test -n "$verbose" && echo " repairing LDFLAGS: $LDFLAGS" 1>&6
22502
22503echo "${as_me:-configure}:22503: testing repairing LDFLAGS: $LDFLAGS ..." 1>&5
22504
22505 LDFLAGS="$cf_temp_flags"
22506 test -n "$verbose" && echo " ... fixed $LDFLAGS" 1>&6
22507
22508echo "${as_me:-configure}:22508: testing ... fixed $LDFLAGS ..." 1>&5
22509
22510 test -n "$verbose" && echo " ... extra $EXTRA_CFLAGS" 1>&6
22511
22512echo "${as_me:-configure}:22512: testing ... extra $EXTRA_CFLAGS ..." 1>&5
22513
22514 fi
22515 ;;
22516 esac
22517fi
22518
22519echo "$as_me:22519: checking if you want to turn on gcc warnings" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010022520echo $ECHO_N "checking if you want to turn on gcc warnings... $ECHO_C" >&6
22521
22522# Check whether --enable-warnings or --disable-warnings was given.
22523if test "${enable_warnings+set}" = set; then
22524 enableval="$enable_warnings"
22525 test "$enableval" != yes && enableval=no
22526 if test "$enableval" != "no" ; then
micky3879b9f5e72025-07-08 18:04:53 -040022527 enable_warnings=yes
Steve Kondikae271bc2015-11-15 02:50:53 +010022528 else
micky3879b9f5e72025-07-08 18:04:53 -040022529 enable_warnings=no
Steve Kondikae271bc2015-11-15 02:50:53 +010022530 fi
22531else
22532 enableval=no
micky3879b9f5e72025-07-08 18:04:53 -040022533 enable_warnings=no
Steve Kondikae271bc2015-11-15 02:50:53 +010022534
22535fi;
micky3879b9f5e72025-07-08 18:04:53 -040022536echo "$as_me:22536: result: $enable_warnings" >&5
22537echo "${ECHO_T}$enable_warnings" >&6
22538if test "$enable_warnings" = "yes"
Steve Kondikae271bc2015-11-15 02:50:53 +010022539then
22540
micky3879b9f5e72025-07-08 18:04:53 -040022541if test "$GCC" = yes || test "$GXX" = yes
Steve Kondikae271bc2015-11-15 02:50:53 +010022542then
22543cat > conftest.i <<EOF
22544#ifndef GCC_PRINTF
22545#define GCC_PRINTF 0
22546#endif
22547#ifndef GCC_SCANF
22548#define GCC_SCANF 0
22549#endif
22550#ifndef GCC_NORETURN
22551#define GCC_NORETURN /* nothing */
22552#endif
22553#ifndef GCC_UNUSED
22554#define GCC_UNUSED /* nothing */
22555#endif
22556EOF
22557if test "$GCC" = yes
22558then
micky3879b9f5e72025-07-08 18:04:53 -040022559 { echo "$as_me:22559: checking for $CC __attribute__ directives..." >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010022560echo "$as_me: checking for $CC __attribute__ directives..." >&6;}
micky3879b9f5e72025-07-08 18:04:53 -040022561cat > "conftest.$ac_ext" <<EOF
22562#line 22562 "${as_me:-configure}"
22563#include <stdio.h>
Steve Kondikae271bc2015-11-15 02:50:53 +010022564#include "confdefs.h"
22565#include "conftest.h"
22566#include "conftest.i"
22567#if GCC_PRINTF
22568#define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
22569#else
22570#define GCC_PRINTFLIKE(fmt,var) /*nothing*/
22571#endif
22572#if GCC_SCANF
22573#define GCC_SCANFLIKE(fmt,var) __attribute__((format(scanf,fmt,var)))
22574#else
22575#define GCC_SCANFLIKE(fmt,var) /*nothing*/
22576#endif
22577extern void wow(char *,...) GCC_SCANFLIKE(1,2);
micky3879b9f5e72025-07-08 18:04:53 -040022578extern GCC_NORETURN void oops(char *,...) GCC_PRINTFLIKE(1,2);
22579extern GCC_NORETURN void foo(void);
22580int main(int argc GCC_UNUSED, char *argv[] GCC_UNUSED) { (void)argc; (void)argv; return 0; }
Steve Kondikae271bc2015-11-15 02:50:53 +010022581EOF
22582 cf_printf_attribute=no
22583 cf_scanf_attribute=no
22584 for cf_attribute in scanf printf unused noreturn
22585 do
22586
22587cf_ATTRIBUTE=`echo "$cf_attribute" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
22588
22589 cf_directive="__attribute__(($cf_attribute))"
22590 echo "checking for $CC $cf_directive" 1>&5
22591
micky3879b9f5e72025-07-08 18:04:53 -040022592 case "$cf_attribute" in
Steve Kondikae271bc2015-11-15 02:50:53 +010022593 (printf)
22594 cf_printf_attribute=yes
22595 cat >conftest.h <<EOF
22596#define GCC_$cf_ATTRIBUTE 1
22597EOF
22598 ;;
22599 (scanf)
22600 cf_scanf_attribute=yes
22601 cat >conftest.h <<EOF
22602#define GCC_$cf_ATTRIBUTE 1
22603EOF
22604 ;;
22605 (*)
22606 cat >conftest.h <<EOF
22607#define GCC_$cf_ATTRIBUTE $cf_directive
22608EOF
22609 ;;
22610 esac
22611
micky3879b9f5e72025-07-08 18:04:53 -040022612 if { (eval echo "$as_me:22612: \"$ac_compile\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010022613 (eval $ac_compile) 2>&5
22614 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040022615 echo "$as_me:22615: \$? = $ac_status" >&5
22616 (exit "$ac_status"); }; then
22617 test -n "$verbose" && echo "$as_me:22617: result: ... $cf_attribute" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010022618echo "${ECHO_T}... $cf_attribute" >&6
22619 cat conftest.h >>confdefs.h
micky3879b9f5e72025-07-08 18:04:53 -040022620 case "$cf_attribute" in
Steve Kondikae271bc2015-11-15 02:50:53 +010022621 (noreturn)
22622
22623cat >>confdefs.h <<EOF
22624#define GCC_NORETURN $cf_directive
22625EOF
22626
22627 ;;
22628 (printf)
22629 cf_value='/* nothing */'
22630 if test "$cf_printf_attribute" != no ; then
22631 cf_value='__attribute__((format(printf,fmt,var)))'
22632
22633cat >>confdefs.h <<\EOF
22634#define GCC_PRINTF 1
22635EOF
22636
22637 fi
22638
22639cat >>confdefs.h <<EOF
22640#define GCC_PRINTFLIKE(fmt,var) $cf_value
22641EOF
22642
22643 ;;
22644 (scanf)
22645 cf_value='/* nothing */'
22646 if test "$cf_scanf_attribute" != no ; then
22647 cf_value='__attribute__((format(scanf,fmt,var)))'
22648
22649cat >>confdefs.h <<\EOF
22650#define GCC_SCANF 1
22651EOF
22652
22653 fi
22654
22655cat >>confdefs.h <<EOF
22656#define GCC_SCANFLIKE(fmt,var) $cf_value
22657EOF
22658
22659 ;;
22660 (unused)
22661
22662cat >>confdefs.h <<EOF
22663#define GCC_UNUSED $cf_directive
22664EOF
22665
22666 ;;
22667 esac
22668 fi
22669 done
22670else
micky3879b9f5e72025-07-08 18:04:53 -040022671 ${FGREP-fgrep} define conftest.i >>confdefs.h
Steve Kondikae271bc2015-11-15 02:50:53 +010022672fi
micky3879b9f5e72025-07-08 18:04:53 -040022673rm -rf ./conftest*
Steve Kondikae271bc2015-11-15 02:50:53 +010022674fi
22675
micky3879b9f5e72025-07-08 18:04:53 -040022676if test "x$have_x" = xyes; then
Steve Kondikae271bc2015-11-15 02:50:53 +010022677
micky3879b9f5e72025-07-08 18:04:53 -040022678cf_save_LIBS_CF_CONST_X_STRING="$LIBS"
22679cf_save_CFLAGS_CF_CONST_X_STRING="$CFLAGS"
22680cf_save_CPPFLAGS_CF_CONST_X_STRING="$CPPFLAGS"
22681LIBS="$LIBS ${X_PRE_LIBS} ${X_LIBS} ${X_EXTRA_LIBS}"
22682for cf_X_CFLAGS in $X_CFLAGS
22683do
22684 case "x$cf_X_CFLAGS" in
22685 x-[IUD]*)
22686 CPPFLAGS="$CPPFLAGS $cf_X_CFLAGS"
22687 ;;
22688 *)
22689 CFLAGS="$CFLAGS $cf_X_CFLAGS"
Steve Kondikae271bc2015-11-15 02:50:53 +010022690 ;;
22691 esac
micky3879b9f5e72025-07-08 18:04:53 -040022692done
Steve Kondikae271bc2015-11-15 02:50:53 +010022693
micky3879b9f5e72025-07-08 18:04:53 -040022694cat >"conftest.$ac_ext" <<_ACEOF
22695#line 22695 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +010022696#include "confdefs.h"
22697
micky3879b9f5e72025-07-08 18:04:53 -040022698#include <stdlib.h>
22699#include <X11/Intrinsic.h>
22700
Steve Kondikae271bc2015-11-15 02:50:53 +010022701int
micky3879b9f5e72025-07-08 18:04:53 -040022702main (void)
Steve Kondikae271bc2015-11-15 02:50:53 +010022703{
micky3879b9f5e72025-07-08 18:04:53 -040022704String foo = malloc(1); free((void*)foo)
Steve Kondikae271bc2015-11-15 02:50:53 +010022705 ;
22706 return 0;
22707}
22708_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -040022709rm -f "conftest.$ac_objext"
22710if { (eval echo "$as_me:22710: \"$ac_compile\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010022711 (eval $ac_compile) 2>&5
22712 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040022713 echo "$as_me:22713: \$? = $ac_status" >&5
22714 (exit "$ac_status"); } &&
22715 { ac_try='test -s "conftest.$ac_objext"'
22716 { (eval echo "$as_me:22716: \"$ac_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010022717 (eval $ac_try) 2>&5
22718 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040022719 echo "$as_me:22719: \$? = $ac_status" >&5
22720 (exit "$ac_status"); }; }; then
22721
22722echo "$as_me:22722: checking for X11/Xt const-feature" >&5
22723echo $ECHO_N "checking for X11/Xt const-feature... $ECHO_C" >&6
22724if test "${cf_cv_const_x_string+set}" = set; then
22725 echo $ECHO_N "(cached) $ECHO_C" >&6
22726else
22727
22728 cat >"conftest.$ac_ext" <<_ACEOF
22729#line 22729 "configure"
22730#include "confdefs.h"
22731
22732#undef _CONST_X_STRING
22733#define _CONST_X_STRING /* X11R7.8 (perhaps) */
22734#undef XTSTRINGDEFINES /* X11R5 and later */
22735#include <stdlib.h>
22736#include <X11/Intrinsic.h>
22737
22738int
22739main (void)
22740{
22741String foo = malloc(1); *foo = 0
22742 ;
22743 return 0;
22744}
22745_ACEOF
22746rm -f "conftest.$ac_objext"
22747if { (eval echo "$as_me:22747: \"$ac_compile\"") >&5
22748 (eval $ac_compile) 2>&5
22749 ac_status=$?
22750 echo "$as_me:22750: \$? = $ac_status" >&5
22751 (exit "$ac_status"); } &&
22752 { ac_try='test -s "conftest.$ac_objext"'
22753 { (eval echo "$as_me:22753: \"$ac_try\"") >&5
22754 (eval $ac_try) 2>&5
22755 ac_status=$?
22756 echo "$as_me:22756: \$? = $ac_status" >&5
22757 (exit "$ac_status"); }; }; then
22758
22759 cf_cv_const_x_string=no
Steve Kondikae271bc2015-11-15 02:50:53 +010022760
22761else
22762 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -040022763cat "conftest.$ac_ext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010022764
micky3879b9f5e72025-07-08 18:04:53 -040022765 cf_cv_const_x_string=yes
22766
22767fi
22768rm -f "conftest.$ac_objext" "conftest.$ac_ext"
22769
22770fi
22771echo "$as_me:22771: result: $cf_cv_const_x_string" >&5
22772echo "${ECHO_T}$cf_cv_const_x_string" >&6
22773
22774LIBS="$cf_save_LIBS_CF_CONST_X_STRING"
22775CFLAGS="$cf_save_CFLAGS_CF_CONST_X_STRING"
22776CPPFLAGS="$cf_save_CPPFLAGS_CF_CONST_X_STRING"
22777
22778case "$cf_cv_const_x_string" in
22779(no)
22780
22781 test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
22782 CPPFLAGS="${CPPFLAGS}-DXTSTRINGDEFINES"
22783
22784 ;;
22785(*)
22786
22787 test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
22788 CPPFLAGS="${CPPFLAGS}-D_CONST_X_STRING"
22789
22790 ;;
22791esac
22792
22793else
22794 echo "$as_me: failed program was:" >&5
22795cat "conftest.$ac_ext" >&5
22796fi
22797rm -f "conftest.$ac_objext" "conftest.$ac_ext"
22798 fi
22799cat > "conftest.$ac_ext" <<EOF
22800#line 22800 "${as_me:-configure}"
Steve Kondikae271bc2015-11-15 02:50:53 +010022801int main(int argc, char *argv[]) { return (argv[argc-1] == 0) ; }
22802EOF
Steve Kondikae271bc2015-11-15 02:50:53 +010022803if test "$INTEL_COMPILER" = yes
22804then
22805# The "-wdXXX" options suppress warnings:
22806# remark #1419: external declaration in primary source file
22807# remark #1683: explicit conversion of a 64-bit integral type to a smaller integral type (potential portability problem)
22808# remark #1684: conversion from pointer to same-sized integral type (potential portability problem)
22809# remark #193: zero used for undefined preprocessing identifier
22810# remark #593: variable "curs_sb_left_arrow" was set but never used
22811# remark #810: conversion from "int" to "Dimension={unsigned short}" may lose significant bits
22812# remark #869: parameter "tw" was never referenced
22813# remark #981: operands are evaluated in unspecified order
22814# warning #279: controlling expression is constant
22815
micky3879b9f5e72025-07-08 18:04:53 -040022816 { echo "$as_me:22816: checking for $CC warning options..." >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010022817echo "$as_me: checking for $CC warning options..." >&6;}
22818 cf_save_CFLAGS="$CFLAGS"
micky3879b9f5e72025-07-08 18:04:53 -040022819 EXTRA_CFLAGS="$EXTRA_CFLAGS -Wall"
Steve Kondikae271bc2015-11-15 02:50:53 +010022820 for cf_opt in \
22821 wd1419 \
22822 wd1683 \
22823 wd1684 \
22824 wd193 \
22825 wd593 \
22826 wd279 \
22827 wd810 \
22828 wd869 \
22829 wd981
22830 do
22831 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
micky3879b9f5e72025-07-08 18:04:53 -040022832 if { (eval echo "$as_me:22832: \"$ac_compile\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010022833 (eval $ac_compile) 2>&5
22834 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040022835 echo "$as_me:22835: \$? = $ac_status" >&5
22836 (exit "$ac_status"); }; then
22837 test -n "$verbose" && echo "$as_me:22837: result: ... -$cf_opt" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010022838echo "${ECHO_T}... -$cf_opt" >&6
22839 EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
22840 fi
22841 done
22842 CFLAGS="$cf_save_CFLAGS"
micky3879b9f5e72025-07-08 18:04:53 -040022843elif test "$GCC" = yes && test "$GCC_VERSION" != "unknown"
Steve Kondikae271bc2015-11-15 02:50:53 +010022844then
micky3879b9f5e72025-07-08 18:04:53 -040022845 { echo "$as_me:22845: checking for $CC warning options..." >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010022846echo "$as_me: checking for $CC warning options..." >&6;}
22847 cf_save_CFLAGS="$CFLAGS"
Steve Kondikae271bc2015-11-15 02:50:53 +010022848 cf_warn_CONST=""
22849 test "$with_ext_const" = yes && cf_warn_CONST="Wwrite-strings"
22850 cf_gcc_warnings="Wignored-qualifiers Wlogical-op Wvarargs"
22851 test "x$CLANG_COMPILER" = xyes && cf_gcc_warnings=
22852 for cf_opt in W Wall \
22853 Wbad-function-cast \
22854 Wcast-align \
22855 Wcast-qual \
22856 Wdeclaration-after-statement \
22857 Wextra \
22858 Winline \
22859 Wmissing-declarations \
22860 Wmissing-prototypes \
22861 Wnested-externs \
22862 Wpointer-arith \
22863 Wshadow \
22864 Wstrict-prototypes \
micky3879b9f5e72025-07-08 18:04:53 -040022865 Wundef Wno-inline $cf_gcc_warnings $cf_warn_CONST Wno-unknown-pragmas
Steve Kondikae271bc2015-11-15 02:50:53 +010022866 do
22867 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
micky3879b9f5e72025-07-08 18:04:53 -040022868 if { (eval echo "$as_me:22868: \"$ac_compile\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010022869 (eval $ac_compile) 2>&5
22870 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040022871 echo "$as_me:22871: \$? = $ac_status" >&5
22872 (exit "$ac_status"); }; then
22873 test -n "$verbose" && echo "$as_me:22873: result: ... -$cf_opt" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010022874echo "${ECHO_T}... -$cf_opt" >&6
micky3879b9f5e72025-07-08 18:04:53 -040022875 case "$cf_opt" in
Steve Kondikae271bc2015-11-15 02:50:53 +010022876 (Winline)
micky3879b9f5e72025-07-08 18:04:53 -040022877 case "$GCC_VERSION" in
Steve Kondikae271bc2015-11-15 02:50:53 +010022878 ([34].*)
22879 test -n "$verbose" && echo " feature is broken in gcc $GCC_VERSION" 1>&6
22880
micky3879b9f5e72025-07-08 18:04:53 -040022881echo "${as_me:-configure}:22881: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
Steve Kondikae271bc2015-11-15 02:50:53 +010022882
22883 continue;;
22884 esac
22885 ;;
22886 (Wpointer-arith)
micky3879b9f5e72025-07-08 18:04:53 -040022887 case "$GCC_VERSION" in
Steve Kondikae271bc2015-11-15 02:50:53 +010022888 ([12].*)
22889 test -n "$verbose" && echo " feature is broken in gcc $GCC_VERSION" 1>&6
22890
micky3879b9f5e72025-07-08 18:04:53 -040022891echo "${as_me:-configure}:22891: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
Steve Kondikae271bc2015-11-15 02:50:53 +010022892
22893 continue;;
22894 esac
22895 ;;
22896 esac
22897 EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
22898 fi
22899 done
22900 CFLAGS="$cf_save_CFLAGS"
22901fi
micky3879b9f5e72025-07-08 18:04:53 -040022902rm -rf ./conftest*
Steve Kondikae271bc2015-11-15 02:50:53 +010022903
22904fi
micky3879b9f5e72025-07-08 18:04:53 -040022905
Steve Kondikae271bc2015-11-15 02:50:53 +010022906fi
22907
micky3879b9f5e72025-07-08 18:04:53 -040022908echo "$as_me:22908: checking if you want to use dmalloc for testing" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010022909echo $ECHO_N "checking if you want to use dmalloc for testing... $ECHO_C" >&6
22910
22911# Check whether --with-dmalloc or --without-dmalloc was given.
22912if test "${with_dmalloc+set}" = set; then
22913 withval="$with_dmalloc"
micky3879b9f5e72025-07-08 18:04:53 -040022914 case "x$withval" in
22915 (x|xno) ;;
22916 (*)
22917 : "${with_cflags:=-g}"
22918 : "${enable_leaks:=no}"
22919 with_dmalloc=yes
Steve Kondikae271bc2015-11-15 02:50:53 +010022920
22921cat >>confdefs.h <<EOF
22922#define USE_DMALLOC 1
22923EOF
22924
micky3879b9f5e72025-07-08 18:04:53 -040022925 ;;
22926 esac
Steve Kondikae271bc2015-11-15 02:50:53 +010022927else
22928 with_dmalloc=
22929fi;
micky3879b9f5e72025-07-08 18:04:53 -040022930echo "$as_me:22930: result: ${with_dmalloc:-no}" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010022931echo "${ECHO_T}${with_dmalloc:-no}" >&6
22932
micky3879b9f5e72025-07-08 18:04:53 -040022933case ".$with_cflags" in
Steve Kondikae271bc2015-11-15 02:50:53 +010022934(.*-g*)
22935 case .$CFLAGS in
22936 (.*-g*)
22937 ;;
22938 (*)
22939
22940cf_fix_cppflags=no
22941cf_new_cflags=
22942cf_new_cppflags=
22943cf_new_extra_cppflags=
22944
22945for cf_add_cflags in -g
22946do
micky3879b9f5e72025-07-08 18:04:53 -040022947case "$cf_fix_cppflags" in
Steve Kondikae271bc2015-11-15 02:50:53 +010022948(no)
micky3879b9f5e72025-07-08 18:04:53 -040022949 case "$cf_add_cflags" in
Steve Kondikae271bc2015-11-15 02:50:53 +010022950 (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
micky3879b9f5e72025-07-08 18:04:53 -040022951 case "$cf_add_cflags" in
Steve Kondikae271bc2015-11-15 02:50:53 +010022952 (-D*)
micky3879b9f5e72025-07-08 18:04:53 -040022953 cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
Steve Kondikae271bc2015-11-15 02:50:53 +010022954
22955 test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
22956 && test -z "${cf_tst_cflags}" \
22957 && cf_fix_cppflags=yes
22958
micky3879b9f5e72025-07-08 18:04:53 -040022959 if test "$cf_fix_cppflags" = yes ; then
22960
22961 test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
22962 cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
22963
Steve Kondikae271bc2015-11-15 02:50:53 +010022964 continue
22965 elif test "${cf_tst_cflags}" = "\"'" ; then
micky3879b9f5e72025-07-08 18:04:53 -040022966
22967 test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
22968 cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
22969
Steve Kondikae271bc2015-11-15 02:50:53 +010022970 continue
22971 fi
22972 ;;
22973 esac
22974 case "$CPPFLAGS" in
22975 (*$cf_add_cflags)
22976 ;;
22977 (*)
micky3879b9f5e72025-07-08 18:04:53 -040022978 case "$cf_add_cflags" in
Steve Kondikae271bc2015-11-15 02:50:53 +010022979 (-D*)
22980 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
22981
22982CPPFLAGS=`echo "$CPPFLAGS" | \
22983 sed -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?[ ]/ /g' \
22984 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?$//g'`
22985
22986 ;;
22987 esac
micky3879b9f5e72025-07-08 18:04:53 -040022988
22989 test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
22990 cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
22991
Steve Kondikae271bc2015-11-15 02:50:53 +010022992 ;;
22993 esac
22994 ;;
22995 (*)
micky3879b9f5e72025-07-08 18:04:53 -040022996
22997 test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
22998 cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
22999
Steve Kondikae271bc2015-11-15 02:50:53 +010023000 ;;
23001 esac
23002 ;;
23003(yes)
Steve Kondikae271bc2015-11-15 02:50:53 +010023004
micky3879b9f5e72025-07-08 18:04:53 -040023005 test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
23006 cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
23007
23008 cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
Steve Kondikae271bc2015-11-15 02:50:53 +010023009
23010 test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
23011 && test -z "${cf_tst_cflags}" \
23012 && cf_fix_cppflags=no
23013 ;;
23014esac
23015done
23016
23017if test -n "$cf_new_cflags" ; then
23018
micky3879b9f5e72025-07-08 18:04:53 -040023019 test -n "$CFLAGS" && CFLAGS="$CFLAGS "
23020 CFLAGS="${CFLAGS}$cf_new_cflags"
23021
Steve Kondikae271bc2015-11-15 02:50:53 +010023022fi
23023
23024if test -n "$cf_new_cppflags" ; then
23025
micky3879b9f5e72025-07-08 18:04:53 -040023026 test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
23027 CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
23028
Steve Kondikae271bc2015-11-15 02:50:53 +010023029fi
23030
23031if test -n "$cf_new_extra_cppflags" ; then
23032
micky3879b9f5e72025-07-08 18:04:53 -040023033 test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
23034 EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
23035
Steve Kondikae271bc2015-11-15 02:50:53 +010023036fi
23037
23038 ;;
23039 esac
23040 ;;
23041esac
23042
23043if test "$with_dmalloc" = yes ; then
micky3879b9f5e72025-07-08 18:04:53 -040023044 echo "$as_me:23044: checking for dmalloc.h" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010023045echo $ECHO_N "checking for dmalloc.h... $ECHO_C" >&6
23046if test "${ac_cv_header_dmalloc_h+set}" = set; then
23047 echo $ECHO_N "(cached) $ECHO_C" >&6
23048else
micky3879b9f5e72025-07-08 18:04:53 -040023049 cat >"conftest.$ac_ext" <<_ACEOF
23050#line 23050 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +010023051#include "confdefs.h"
23052#include <dmalloc.h>
23053_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -040023054if { (eval echo "$as_me:23054: \"$ac_cpp "conftest.$ac_ext"\"") >&5
23055 (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
Steve Kondikae271bc2015-11-15 02:50:53 +010023056 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040023057 $EGREP -v '^ *\+' conftest.er1 >conftest.err
Steve Kondikae271bc2015-11-15 02:50:53 +010023058 rm -f conftest.er1
23059 cat conftest.err >&5
micky3879b9f5e72025-07-08 18:04:53 -040023060 echo "$as_me:23060: \$? = $ac_status" >&5
23061 (exit "$ac_status"); } >/dev/null; then
Steve Kondikae271bc2015-11-15 02:50:53 +010023062 if test -s conftest.err; then
23063 ac_cpp_err=$ac_c_preproc_warn_flag
23064 else
23065 ac_cpp_err=
23066 fi
23067else
23068 ac_cpp_err=yes
23069fi
23070if test -z "$ac_cpp_err"; then
23071 ac_cv_header_dmalloc_h=yes
23072else
23073 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -040023074 cat "conftest.$ac_ext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010023075 ac_cv_header_dmalloc_h=no
23076fi
micky3879b9f5e72025-07-08 18:04:53 -040023077rm -f conftest.err "conftest.$ac_ext"
Steve Kondikae271bc2015-11-15 02:50:53 +010023078fi
micky3879b9f5e72025-07-08 18:04:53 -040023079echo "$as_me:23079: result: $ac_cv_header_dmalloc_h" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010023080echo "${ECHO_T}$ac_cv_header_dmalloc_h" >&6
micky3879b9f5e72025-07-08 18:04:53 -040023081if test "$ac_cv_header_dmalloc_h" = yes; then
Steve Kondikae271bc2015-11-15 02:50:53 +010023082
micky3879b9f5e72025-07-08 18:04:53 -040023083echo "$as_me:23083: checking for dmalloc_debug in -ldmalloc" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010023084echo $ECHO_N "checking for dmalloc_debug in -ldmalloc... $ECHO_C" >&6
23085if test "${ac_cv_lib_dmalloc_dmalloc_debug+set}" = set; then
23086 echo $ECHO_N "(cached) $ECHO_C" >&6
23087else
23088 ac_check_lib_save_LIBS=$LIBS
23089LIBS="-ldmalloc $LIBS"
micky3879b9f5e72025-07-08 18:04:53 -040023090cat >"conftest.$ac_ext" <<_ACEOF
23091#line 23091 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +010023092#include "confdefs.h"
23093
23094/* Override any gcc2 internal prototype to avoid an error. */
23095#ifdef __cplusplus
23096extern "C"
23097#endif
23098/* We use char because int might match the return type of a gcc2
23099 builtin and then its argument prototype would still apply. */
micky3879b9f5e72025-07-08 18:04:53 -040023100char dmalloc_debug (void);
Steve Kondikae271bc2015-11-15 02:50:53 +010023101int
micky3879b9f5e72025-07-08 18:04:53 -040023102main (void)
Steve Kondikae271bc2015-11-15 02:50:53 +010023103{
23104dmalloc_debug ();
23105 ;
23106 return 0;
23107}
23108_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -040023109rm -f "conftest.$ac_objext" "conftest$ac_exeext"
23110if { (eval echo "$as_me:23110: \"$ac_link\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010023111 (eval $ac_link) 2>&5
23112 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040023113 echo "$as_me:23113: \$? = $ac_status" >&5
23114 (exit "$ac_status"); } &&
23115 { ac_try='test -s "conftest$ac_exeext"'
23116 { (eval echo "$as_me:23116: \"$ac_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010023117 (eval $ac_try) 2>&5
23118 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040023119 echo "$as_me:23119: \$? = $ac_status" >&5
23120 (exit "$ac_status"); }; }; then
Steve Kondikae271bc2015-11-15 02:50:53 +010023121 ac_cv_lib_dmalloc_dmalloc_debug=yes
23122else
23123 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -040023124cat "conftest.$ac_ext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010023125ac_cv_lib_dmalloc_dmalloc_debug=no
23126fi
micky3879b9f5e72025-07-08 18:04:53 -040023127rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
Steve Kondikae271bc2015-11-15 02:50:53 +010023128LIBS=$ac_check_lib_save_LIBS
23129fi
micky3879b9f5e72025-07-08 18:04:53 -040023130echo "$as_me:23130: result: $ac_cv_lib_dmalloc_dmalloc_debug" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010023131echo "${ECHO_T}$ac_cv_lib_dmalloc_dmalloc_debug" >&6
micky3879b9f5e72025-07-08 18:04:53 -040023132if test "$ac_cv_lib_dmalloc_dmalloc_debug" = yes; then
Steve Kondikae271bc2015-11-15 02:50:53 +010023133 cat >>confdefs.h <<EOF
23134#define HAVE_LIBDMALLOC 1
23135EOF
23136
23137 LIBS="-ldmalloc $LIBS"
23138
23139fi
23140
23141fi
23142
23143fi
23144
micky3879b9f5e72025-07-08 18:04:53 -040023145echo "$as_me:23145: checking if you want to use dbmalloc for testing" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010023146echo $ECHO_N "checking if you want to use dbmalloc for testing... $ECHO_C" >&6
23147
23148# Check whether --with-dbmalloc or --without-dbmalloc was given.
23149if test "${with_dbmalloc+set}" = set; then
23150 withval="$with_dbmalloc"
micky3879b9f5e72025-07-08 18:04:53 -040023151 case "x$withval" in
23152 (x|xno) ;;
23153 (*)
23154 : "${with_cflags:=-g}"
23155 : "${enable_leaks:=no}"
23156 with_dbmalloc=yes
Steve Kondikae271bc2015-11-15 02:50:53 +010023157
23158cat >>confdefs.h <<EOF
23159#define USE_DBMALLOC 1
23160EOF
23161
micky3879b9f5e72025-07-08 18:04:53 -040023162 ;;
23163 esac
Steve Kondikae271bc2015-11-15 02:50:53 +010023164else
23165 with_dbmalloc=
23166fi;
micky3879b9f5e72025-07-08 18:04:53 -040023167echo "$as_me:23167: result: ${with_dbmalloc:-no}" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010023168echo "${ECHO_T}${with_dbmalloc:-no}" >&6
23169
micky3879b9f5e72025-07-08 18:04:53 -040023170case ".$with_cflags" in
Steve Kondikae271bc2015-11-15 02:50:53 +010023171(.*-g*)
23172 case .$CFLAGS in
23173 (.*-g*)
23174 ;;
23175 (*)
23176
23177cf_fix_cppflags=no
23178cf_new_cflags=
23179cf_new_cppflags=
23180cf_new_extra_cppflags=
23181
23182for cf_add_cflags in -g
23183do
micky3879b9f5e72025-07-08 18:04:53 -040023184case "$cf_fix_cppflags" in
Steve Kondikae271bc2015-11-15 02:50:53 +010023185(no)
micky3879b9f5e72025-07-08 18:04:53 -040023186 case "$cf_add_cflags" in
Steve Kondikae271bc2015-11-15 02:50:53 +010023187 (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
micky3879b9f5e72025-07-08 18:04:53 -040023188 case "$cf_add_cflags" in
Steve Kondikae271bc2015-11-15 02:50:53 +010023189 (-D*)
micky3879b9f5e72025-07-08 18:04:53 -040023190 cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
Steve Kondikae271bc2015-11-15 02:50:53 +010023191
23192 test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
23193 && test -z "${cf_tst_cflags}" \
23194 && cf_fix_cppflags=yes
23195
micky3879b9f5e72025-07-08 18:04:53 -040023196 if test "$cf_fix_cppflags" = yes ; then
23197
23198 test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
23199 cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
23200
Steve Kondikae271bc2015-11-15 02:50:53 +010023201 continue
23202 elif test "${cf_tst_cflags}" = "\"'" ; then
micky3879b9f5e72025-07-08 18:04:53 -040023203
23204 test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
23205 cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
23206
Steve Kondikae271bc2015-11-15 02:50:53 +010023207 continue
23208 fi
23209 ;;
23210 esac
23211 case "$CPPFLAGS" in
23212 (*$cf_add_cflags)
23213 ;;
23214 (*)
micky3879b9f5e72025-07-08 18:04:53 -040023215 case "$cf_add_cflags" in
Steve Kondikae271bc2015-11-15 02:50:53 +010023216 (-D*)
23217 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
23218
23219CPPFLAGS=`echo "$CPPFLAGS" | \
23220 sed -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?[ ]/ /g' \
23221 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?$//g'`
23222
23223 ;;
23224 esac
micky3879b9f5e72025-07-08 18:04:53 -040023225
23226 test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
23227 cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
23228
Steve Kondikae271bc2015-11-15 02:50:53 +010023229 ;;
23230 esac
23231 ;;
23232 (*)
micky3879b9f5e72025-07-08 18:04:53 -040023233
23234 test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
23235 cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
23236
Steve Kondikae271bc2015-11-15 02:50:53 +010023237 ;;
23238 esac
23239 ;;
23240(yes)
Steve Kondikae271bc2015-11-15 02:50:53 +010023241
micky3879b9f5e72025-07-08 18:04:53 -040023242 test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
23243 cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
23244
23245 cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
Steve Kondikae271bc2015-11-15 02:50:53 +010023246
23247 test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
23248 && test -z "${cf_tst_cflags}" \
23249 && cf_fix_cppflags=no
23250 ;;
23251esac
23252done
23253
23254if test -n "$cf_new_cflags" ; then
23255
micky3879b9f5e72025-07-08 18:04:53 -040023256 test -n "$CFLAGS" && CFLAGS="$CFLAGS "
23257 CFLAGS="${CFLAGS}$cf_new_cflags"
23258
Steve Kondikae271bc2015-11-15 02:50:53 +010023259fi
23260
23261if test -n "$cf_new_cppflags" ; then
23262
micky3879b9f5e72025-07-08 18:04:53 -040023263 test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
23264 CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
23265
Steve Kondikae271bc2015-11-15 02:50:53 +010023266fi
23267
23268if test -n "$cf_new_extra_cppflags" ; then
23269
micky3879b9f5e72025-07-08 18:04:53 -040023270 test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
23271 EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
23272
Steve Kondikae271bc2015-11-15 02:50:53 +010023273fi
23274
23275 ;;
23276 esac
23277 ;;
23278esac
23279
23280if test "$with_dbmalloc" = yes ; then
micky3879b9f5e72025-07-08 18:04:53 -040023281 echo "$as_me:23281: checking for dbmalloc.h" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010023282echo $ECHO_N "checking for dbmalloc.h... $ECHO_C" >&6
23283if test "${ac_cv_header_dbmalloc_h+set}" = set; then
23284 echo $ECHO_N "(cached) $ECHO_C" >&6
23285else
micky3879b9f5e72025-07-08 18:04:53 -040023286 cat >"conftest.$ac_ext" <<_ACEOF
23287#line 23287 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +010023288#include "confdefs.h"
23289#include <dbmalloc.h>
23290_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -040023291if { (eval echo "$as_me:23291: \"$ac_cpp "conftest.$ac_ext"\"") >&5
23292 (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
Steve Kondikae271bc2015-11-15 02:50:53 +010023293 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040023294 $EGREP -v '^ *\+' conftest.er1 >conftest.err
Steve Kondikae271bc2015-11-15 02:50:53 +010023295 rm -f conftest.er1
23296 cat conftest.err >&5
micky3879b9f5e72025-07-08 18:04:53 -040023297 echo "$as_me:23297: \$? = $ac_status" >&5
23298 (exit "$ac_status"); } >/dev/null; then
Steve Kondikae271bc2015-11-15 02:50:53 +010023299 if test -s conftest.err; then
23300 ac_cpp_err=$ac_c_preproc_warn_flag
23301 else
23302 ac_cpp_err=
23303 fi
23304else
23305 ac_cpp_err=yes
23306fi
23307if test -z "$ac_cpp_err"; then
23308 ac_cv_header_dbmalloc_h=yes
23309else
23310 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -040023311 cat "conftest.$ac_ext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010023312 ac_cv_header_dbmalloc_h=no
23313fi
micky3879b9f5e72025-07-08 18:04:53 -040023314rm -f conftest.err "conftest.$ac_ext"
Steve Kondikae271bc2015-11-15 02:50:53 +010023315fi
micky3879b9f5e72025-07-08 18:04:53 -040023316echo "$as_me:23316: result: $ac_cv_header_dbmalloc_h" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010023317echo "${ECHO_T}$ac_cv_header_dbmalloc_h" >&6
micky3879b9f5e72025-07-08 18:04:53 -040023318if test "$ac_cv_header_dbmalloc_h" = yes; then
Steve Kondikae271bc2015-11-15 02:50:53 +010023319
micky3879b9f5e72025-07-08 18:04:53 -040023320echo "$as_me:23320: checking for debug_malloc in -ldbmalloc" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010023321echo $ECHO_N "checking for debug_malloc in -ldbmalloc... $ECHO_C" >&6
23322if test "${ac_cv_lib_dbmalloc_debug_malloc+set}" = set; then
23323 echo $ECHO_N "(cached) $ECHO_C" >&6
23324else
23325 ac_check_lib_save_LIBS=$LIBS
23326LIBS="-ldbmalloc $LIBS"
micky3879b9f5e72025-07-08 18:04:53 -040023327cat >"conftest.$ac_ext" <<_ACEOF
23328#line 23328 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +010023329#include "confdefs.h"
23330
23331/* Override any gcc2 internal prototype to avoid an error. */
23332#ifdef __cplusplus
23333extern "C"
23334#endif
23335/* We use char because int might match the return type of a gcc2
23336 builtin and then its argument prototype would still apply. */
micky3879b9f5e72025-07-08 18:04:53 -040023337char debug_malloc (void);
Steve Kondikae271bc2015-11-15 02:50:53 +010023338int
micky3879b9f5e72025-07-08 18:04:53 -040023339main (void)
Steve Kondikae271bc2015-11-15 02:50:53 +010023340{
23341debug_malloc ();
23342 ;
23343 return 0;
23344}
23345_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -040023346rm -f "conftest.$ac_objext" "conftest$ac_exeext"
23347if { (eval echo "$as_me:23347: \"$ac_link\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010023348 (eval $ac_link) 2>&5
23349 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040023350 echo "$as_me:23350: \$? = $ac_status" >&5
23351 (exit "$ac_status"); } &&
23352 { ac_try='test -s "conftest$ac_exeext"'
23353 { (eval echo "$as_me:23353: \"$ac_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010023354 (eval $ac_try) 2>&5
23355 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040023356 echo "$as_me:23356: \$? = $ac_status" >&5
23357 (exit "$ac_status"); }; }; then
Steve Kondikae271bc2015-11-15 02:50:53 +010023358 ac_cv_lib_dbmalloc_debug_malloc=yes
23359else
23360 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -040023361cat "conftest.$ac_ext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010023362ac_cv_lib_dbmalloc_debug_malloc=no
23363fi
micky3879b9f5e72025-07-08 18:04:53 -040023364rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
Steve Kondikae271bc2015-11-15 02:50:53 +010023365LIBS=$ac_check_lib_save_LIBS
23366fi
micky3879b9f5e72025-07-08 18:04:53 -040023367echo "$as_me:23367: result: $ac_cv_lib_dbmalloc_debug_malloc" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010023368echo "${ECHO_T}$ac_cv_lib_dbmalloc_debug_malloc" >&6
micky3879b9f5e72025-07-08 18:04:53 -040023369if test "$ac_cv_lib_dbmalloc_debug_malloc" = yes; then
Steve Kondikae271bc2015-11-15 02:50:53 +010023370 cat >>confdefs.h <<EOF
23371#define HAVE_LIBDBMALLOC 1
23372EOF
23373
23374 LIBS="-ldbmalloc $LIBS"
23375
23376fi
23377
23378fi
23379
23380fi
23381
micky3879b9f5e72025-07-08 18:04:53 -040023382echo "$as_me:23382: checking if you want to use valgrind for testing" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010023383echo $ECHO_N "checking if you want to use valgrind for testing... $ECHO_C" >&6
23384
23385# Check whether --with-valgrind or --without-valgrind was given.
23386if test "${with_valgrind+set}" = set; then
23387 withval="$with_valgrind"
micky3879b9f5e72025-07-08 18:04:53 -040023388 case "x$withval" in
23389 (x|xno) ;;
23390 (*)
23391 : "${with_cflags:=-g}"
23392 : "${enable_leaks:=no}"
23393 with_valgrind=yes
Steve Kondikae271bc2015-11-15 02:50:53 +010023394
23395cat >>confdefs.h <<EOF
23396#define USE_VALGRIND 1
23397EOF
23398
micky3879b9f5e72025-07-08 18:04:53 -040023399 ;;
23400 esac
Steve Kondikae271bc2015-11-15 02:50:53 +010023401else
23402 with_valgrind=
23403fi;
micky3879b9f5e72025-07-08 18:04:53 -040023404echo "$as_me:23404: result: ${with_valgrind:-no}" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010023405echo "${ECHO_T}${with_valgrind:-no}" >&6
23406
micky3879b9f5e72025-07-08 18:04:53 -040023407case ".$with_cflags" in
Steve Kondikae271bc2015-11-15 02:50:53 +010023408(.*-g*)
23409 case .$CFLAGS in
23410 (.*-g*)
23411 ;;
23412 (*)
23413
23414cf_fix_cppflags=no
23415cf_new_cflags=
23416cf_new_cppflags=
23417cf_new_extra_cppflags=
23418
23419for cf_add_cflags in -g
23420do
micky3879b9f5e72025-07-08 18:04:53 -040023421case "$cf_fix_cppflags" in
Steve Kondikae271bc2015-11-15 02:50:53 +010023422(no)
micky3879b9f5e72025-07-08 18:04:53 -040023423 case "$cf_add_cflags" in
Steve Kondikae271bc2015-11-15 02:50:53 +010023424 (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
micky3879b9f5e72025-07-08 18:04:53 -040023425 case "$cf_add_cflags" in
Steve Kondikae271bc2015-11-15 02:50:53 +010023426 (-D*)
micky3879b9f5e72025-07-08 18:04:53 -040023427 cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
Steve Kondikae271bc2015-11-15 02:50:53 +010023428
23429 test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
23430 && test -z "${cf_tst_cflags}" \
23431 && cf_fix_cppflags=yes
23432
micky3879b9f5e72025-07-08 18:04:53 -040023433 if test "$cf_fix_cppflags" = yes ; then
23434
23435 test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
23436 cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
23437
Steve Kondikae271bc2015-11-15 02:50:53 +010023438 continue
23439 elif test "${cf_tst_cflags}" = "\"'" ; then
micky3879b9f5e72025-07-08 18:04:53 -040023440
23441 test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
23442 cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
23443
Steve Kondikae271bc2015-11-15 02:50:53 +010023444 continue
23445 fi
23446 ;;
23447 esac
23448 case "$CPPFLAGS" in
23449 (*$cf_add_cflags)
23450 ;;
23451 (*)
micky3879b9f5e72025-07-08 18:04:53 -040023452 case "$cf_add_cflags" in
Steve Kondikae271bc2015-11-15 02:50:53 +010023453 (-D*)
23454 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
23455
23456CPPFLAGS=`echo "$CPPFLAGS" | \
23457 sed -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?[ ]/ /g' \
23458 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?$//g'`
23459
23460 ;;
23461 esac
micky3879b9f5e72025-07-08 18:04:53 -040023462
23463 test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
23464 cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
23465
Steve Kondikae271bc2015-11-15 02:50:53 +010023466 ;;
23467 esac
23468 ;;
23469 (*)
micky3879b9f5e72025-07-08 18:04:53 -040023470
23471 test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
23472 cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
23473
Steve Kondikae271bc2015-11-15 02:50:53 +010023474 ;;
23475 esac
23476 ;;
23477(yes)
Steve Kondikae271bc2015-11-15 02:50:53 +010023478
micky3879b9f5e72025-07-08 18:04:53 -040023479 test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
23480 cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
23481
23482 cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
Steve Kondikae271bc2015-11-15 02:50:53 +010023483
23484 test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
23485 && test -z "${cf_tst_cflags}" \
23486 && cf_fix_cppflags=no
23487 ;;
23488esac
23489done
23490
23491if test -n "$cf_new_cflags" ; then
23492
micky3879b9f5e72025-07-08 18:04:53 -040023493 test -n "$CFLAGS" && CFLAGS="$CFLAGS "
23494 CFLAGS="${CFLAGS}$cf_new_cflags"
23495
Steve Kondikae271bc2015-11-15 02:50:53 +010023496fi
23497
23498if test -n "$cf_new_cppflags" ; then
23499
micky3879b9f5e72025-07-08 18:04:53 -040023500 test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
23501 CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
23502
Steve Kondikae271bc2015-11-15 02:50:53 +010023503fi
23504
23505if test -n "$cf_new_extra_cppflags" ; then
23506
micky3879b9f5e72025-07-08 18:04:53 -040023507 test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
23508 EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
23509
Steve Kondikae271bc2015-11-15 02:50:53 +010023510fi
23511
23512 ;;
23513 esac
23514 ;;
23515esac
23516
micky3879b9f5e72025-07-08 18:04:53 -040023517echo "$as_me:23517: checking if you want to perform memory-leak testing" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010023518echo $ECHO_N "checking if you want to perform memory-leak testing... $ECHO_C" >&6
23519
23520# Check whether --enable-leaks or --disable-leaks was given.
23521if test "${enable_leaks+set}" = set; then
23522 enableval="$enable_leaks"
micky3879b9f5e72025-07-08 18:04:53 -040023523 enable_leaks=$enableval
Steve Kondikae271bc2015-11-15 02:50:53 +010023524else
micky3879b9f5e72025-07-08 18:04:53 -040023525 enable_leaks=yes
Steve Kondikae271bc2015-11-15 02:50:53 +010023526fi;
micky3879b9f5e72025-07-08 18:04:53 -040023527if test "x$enable_leaks" = xno; then with_no_leaks=yes; else with_no_leaks=no; fi
23528echo "$as_me:23528: result: $with_no_leaks" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010023529echo "${ECHO_T}$with_no_leaks" >&6
23530
micky3879b9f5e72025-07-08 18:04:53 -040023531if test "$enable_leaks" = no ; then
Steve Kondikae271bc2015-11-15 02:50:53 +010023532
23533cat >>confdefs.h <<\EOF
23534#define NO_LEAKS 1
23535EOF
23536
23537cat >>confdefs.h <<\EOF
23538#define YY_NO_LEAKS 1
23539EOF
23540
23541fi
23542
23543LD_RPATH_OPT=
micky3879b9f5e72025-07-08 18:04:53 -040023544if test "x$cf_cv_enable_rpath" != xno
23545then
23546 echo "$as_me:23546: checking for an rpath option" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010023547echo $ECHO_N "checking for an rpath option... $ECHO_C" >&6
micky3879b9f5e72025-07-08 18:04:53 -040023548 case "$cf_cv_system_name" in
23549 (irix*)
23550 if test "$GCC" = yes; then
23551 LD_RPATH_OPT="-Wl,-rpath,"
23552 else
23553 LD_RPATH_OPT="-rpath "
23554 fi
23555 ;;
23556 (linux*|gnu*|k*bsd*-gnu|freebsd*)
Steve Kondikae271bc2015-11-15 02:50:53 +010023557 LD_RPATH_OPT="-Wl,-rpath,"
micky3879b9f5e72025-07-08 18:04:53 -040023558 ;;
23559 (openbsd[2-9].*|mirbsd*)
23560 LD_RPATH_OPT="-Wl,-rpath,"
23561 ;;
23562 (dragonfly*)
Steve Kondikae271bc2015-11-15 02:50:53 +010023563 LD_RPATH_OPT="-rpath "
micky3879b9f5e72025-07-08 18:04:53 -040023564 ;;
23565 (netbsd*)
23566 LD_RPATH_OPT="-Wl,-rpath,"
23567 ;;
23568 (osf*|mls+*)
23569 LD_RPATH_OPT="-rpath "
23570 ;;
23571 (solaris2*)
23572 LD_RPATH_OPT="-R"
23573 ;;
23574 (*)
23575 ;;
23576 esac
23577 echo "$as_me:23577: result: $LD_RPATH_OPT" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010023578echo "${ECHO_T}$LD_RPATH_OPT" >&6
23579
micky3879b9f5e72025-07-08 18:04:53 -040023580 case "x$LD_RPATH_OPT" in
23581 (x-R*)
23582 echo "$as_me:23582: checking if we need a space after rpath option" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010023583echo $ECHO_N "checking if we need a space after rpath option... $ECHO_C" >&6
micky3879b9f5e72025-07-08 18:04:53 -040023584 cf_save_LIBS="$LIBS"
Steve Kondikae271bc2015-11-15 02:50:53 +010023585
micky3879b9f5e72025-07-08 18:04:53 -040023586cf_add_libs="$LIBS"
23587# reverse order
23588cf_add_0lib=
23589for cf_add_1lib in ${LD_RPATH_OPT}$libdir; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
23590# filter duplicates
23591for cf_add_1lib in $cf_add_0lib; do
23592 for cf_add_2lib in $cf_add_libs; do
23593 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
Steve Kondikae271bc2015-11-15 02:50:53 +010023594 cf_add_1lib=
23595 break
23596 fi
23597 done
micky3879b9f5e72025-07-08 18:04:53 -040023598 test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
Steve Kondikae271bc2015-11-15 02:50:53 +010023599done
23600LIBS="$cf_add_libs"
23601
micky3879b9f5e72025-07-08 18:04:53 -040023602 cat >"conftest.$ac_ext" <<_ACEOF
23603#line 23603 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +010023604#include "confdefs.h"
23605
23606int
micky3879b9f5e72025-07-08 18:04:53 -040023607main (void)
Steve Kondikae271bc2015-11-15 02:50:53 +010023608{
23609
23610 ;
23611 return 0;
23612}
23613_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -040023614rm -f "conftest.$ac_objext" "conftest$ac_exeext"
23615if { (eval echo "$as_me:23615: \"$ac_link\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010023616 (eval $ac_link) 2>&5
23617 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040023618 echo "$as_me:23618: \$? = $ac_status" >&5
23619 (exit "$ac_status"); } &&
23620 { ac_try='test -s "conftest$ac_exeext"'
23621 { (eval echo "$as_me:23621: \"$ac_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010023622 (eval $ac_try) 2>&5
23623 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040023624 echo "$as_me:23624: \$? = $ac_status" >&5
23625 (exit "$ac_status"); }; }; then
Steve Kondikae271bc2015-11-15 02:50:53 +010023626 cf_rpath_space=no
23627else
23628 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -040023629cat "conftest.$ac_ext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010023630cf_rpath_space=yes
23631fi
micky3879b9f5e72025-07-08 18:04:53 -040023632rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
23633 LIBS="$cf_save_LIBS"
23634 echo "$as_me:23634: result: $cf_rpath_space" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010023635echo "${ECHO_T}$cf_rpath_space" >&6
micky3879b9f5e72025-07-08 18:04:53 -040023636 test "$cf_rpath_space" = yes && LD_RPATH_OPT="$LD_RPATH_OPT "
23637 ;;
23638 esac
23639fi
Steve Kondikae271bc2015-11-15 02:50:53 +010023640
micky3879b9f5e72025-07-08 18:04:53 -040023641echo "$as_me:23641: checking if rpath-hack should be disabled" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010023642echo $ECHO_N "checking if rpath-hack should be disabled... $ECHO_C" >&6
23643
23644# Check whether --enable-rpath-hack or --disable-rpath-hack was given.
23645if test "${enable_rpath_hack+set}" = set; then
23646 enableval="$enable_rpath_hack"
23647 test "$enableval" != no && enableval=yes
23648 if test "$enableval" != "yes" ; then
micky3879b9f5e72025-07-08 18:04:53 -040023649 enable_rpath_hack=no
Steve Kondikae271bc2015-11-15 02:50:53 +010023650 else
micky3879b9f5e72025-07-08 18:04:53 -040023651 enable_rpath_hack=yes
Steve Kondikae271bc2015-11-15 02:50:53 +010023652 fi
23653else
23654 enableval=yes
micky3879b9f5e72025-07-08 18:04:53 -040023655 enable_rpath_hack=yes
Steve Kondikae271bc2015-11-15 02:50:53 +010023656
23657fi;
micky3879b9f5e72025-07-08 18:04:53 -040023658if test "x$enable_rpath_hack" = xno; then cf_disable_rpath_hack=yes; else cf_disable_rpath_hack=no; fi
23659echo "$as_me:23659: result: $cf_disable_rpath_hack" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010023660echo "${ECHO_T}$cf_disable_rpath_hack" >&6
Steve Kondikae271bc2015-11-15 02:50:53 +010023661
micky3879b9f5e72025-07-08 18:04:53 -040023662if test "$enable_rpath_hack" = yes ; then
23663
23664echo "$as_me:23664: checking for updated LDFLAGS" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010023665echo $ECHO_N "checking for updated LDFLAGS... $ECHO_C" >&6
23666if test -n "$LD_RPATH_OPT" ; then
micky3879b9f5e72025-07-08 18:04:53 -040023667 echo "$as_me:23667: result: maybe" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010023668echo "${ECHO_T}maybe" >&6
23669
23670 for ac_prog in ldd
23671do
23672 # Extract the first word of "$ac_prog", so it can be a program name with args.
23673set dummy $ac_prog; ac_word=$2
micky3879b9f5e72025-07-08 18:04:53 -040023674echo "$as_me:23674: checking for $ac_word" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010023675echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
23676if test "${ac_cv_prog_cf_ldd_prog+set}" = set; then
23677 echo $ECHO_N "(cached) $ECHO_C" >&6
23678else
23679 if test -n "$cf_ldd_prog"; then
23680 ac_cv_prog_cf_ldd_prog="$cf_ldd_prog" # Let the user override the test.
23681else
23682 ac_save_IFS=$IFS; IFS=$ac_path_separator
23683ac_dummy="$PATH"
23684for ac_dir in $ac_dummy; do
23685 IFS=$ac_save_IFS
23686 test -z "$ac_dir" && ac_dir=.
23687 $as_executable_p "$ac_dir/$ac_word" || continue
23688ac_cv_prog_cf_ldd_prog="$ac_prog"
micky3879b9f5e72025-07-08 18:04:53 -040023689echo "$as_me:23689: found $ac_dir/$ac_word" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010023690break
23691done
23692
23693fi
23694fi
23695cf_ldd_prog=$ac_cv_prog_cf_ldd_prog
23696if test -n "$cf_ldd_prog"; then
micky3879b9f5e72025-07-08 18:04:53 -040023697 echo "$as_me:23697: result: $cf_ldd_prog" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010023698echo "${ECHO_T}$cf_ldd_prog" >&6
23699else
micky3879b9f5e72025-07-08 18:04:53 -040023700 echo "$as_me:23700: result: no" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010023701echo "${ECHO_T}no" >&6
23702fi
23703
23704 test -n "$cf_ldd_prog" && break
23705done
23706test -n "$cf_ldd_prog" || cf_ldd_prog="no"
23707
23708 cf_rpath_list="/usr/lib /lib"
23709 if test "$cf_ldd_prog" != no
23710 then
23711 cf_rpath_oops=
23712
micky3879b9f5e72025-07-08 18:04:53 -040023713cat >"conftest.$ac_ext" <<_ACEOF
23714#line 23714 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +010023715#include "confdefs.h"
23716#include <stdio.h>
23717int
micky3879b9f5e72025-07-08 18:04:53 -040023718main (void)
Steve Kondikae271bc2015-11-15 02:50:53 +010023719{
23720printf("Hello");
23721 ;
23722 return 0;
23723}
23724_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -040023725rm -f "conftest.$ac_objext" "conftest$ac_exeext"
23726if { (eval echo "$as_me:23726: \"$ac_link\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010023727 (eval $ac_link) 2>&5
23728 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040023729 echo "$as_me:23729: \$? = $ac_status" >&5
23730 (exit "$ac_status"); } &&
23731 { ac_try='test -s "conftest$ac_exeext"'
23732 { (eval echo "$as_me:23732: \"$ac_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010023733 (eval $ac_try) 2>&5
23734 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040023735 echo "$as_me:23735: \$? = $ac_status" >&5
23736 (exit "$ac_status"); }; }; then
23737 cf_rpath_oops=`"$cf_ldd_prog" "conftest$ac_exeext" | ${FGREP-fgrep} ' not found' | sed -e 's% =>.*$%%' |sort | uniq`
23738 cf_rpath_list=`"$cf_ldd_prog" "conftest$ac_exeext" | ${FGREP-fgrep} / | sed -e 's%^.*[ ]/%/%' -e 's%/[^/][^/]*$%%' |sort | uniq`
Steve Kondikae271bc2015-11-15 02:50:53 +010023739else
23740 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -040023741cat "conftest.$ac_ext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010023742fi
micky3879b9f5e72025-07-08 18:04:53 -040023743rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
Steve Kondikae271bc2015-11-15 02:50:53 +010023744
23745 # If we passed the link-test, but get a "not found" on a given library,
23746 # this could be due to inept reconfiguration of gcc to make it only
23747 # partly honor /usr/local/lib (or whatever). Sometimes this behavior
23748 # is intentional, e.g., installing gcc in /usr/bin and suppressing the
23749 # /usr/local libraries.
23750 if test -n "$cf_rpath_oops"
23751 then
23752 for cf_rpath_src in $cf_rpath_oops
23753 do
23754 for cf_rpath_dir in \
23755 /usr/local \
23756 /usr/pkg \
23757 /opt/sfw
23758 do
micky3879b9f5e72025-07-08 18:04:53 -040023759 if test -f "$cf_rpath_dir/lib/$cf_rpath_src"
Steve Kondikae271bc2015-11-15 02:50:53 +010023760 then
23761 test -n "$verbose" && echo " ...adding -L$cf_rpath_dir/lib to LDFLAGS for $cf_rpath_src" 1>&6
23762
micky3879b9f5e72025-07-08 18:04:53 -040023763echo "${as_me:-configure}:23763: testing ...adding -L$cf_rpath_dir/lib to LDFLAGS for $cf_rpath_src ..." 1>&5
Steve Kondikae271bc2015-11-15 02:50:53 +010023764
23765 LDFLAGS="$LDFLAGS -L$cf_rpath_dir/lib"
23766 break
23767 fi
23768 done
23769 done
23770 fi
23771 fi
23772
23773 test -n "$verbose" && echo " ...checking EXTRA_LDFLAGS $EXTRA_LDFLAGS" 1>&6
23774
micky3879b9f5e72025-07-08 18:04:53 -040023775echo "${as_me:-configure}:23775: testing ...checking EXTRA_LDFLAGS $EXTRA_LDFLAGS ..." 1>&5
Steve Kondikae271bc2015-11-15 02:50:53 +010023776
23777test -n "$verbose" && echo " ...checking LDFLAGS $LDFLAGS" 1>&6
23778
micky3879b9f5e72025-07-08 18:04:53 -040023779echo "${as_me:-configure}:23779: testing ...checking LDFLAGS $LDFLAGS ..." 1>&5
Steve Kondikae271bc2015-11-15 02:50:53 +010023780
23781cf_rpath_dst=
23782for cf_rpath_src in $LDFLAGS
23783do
micky3879b9f5e72025-07-08 18:04:53 -040023784 case "$cf_rpath_src" in
Steve Kondikae271bc2015-11-15 02:50:53 +010023785 (-L*)
23786
23787 # check if this refers to a directory which we will ignore
23788 cf_rpath_skip=no
23789 if test -n "$cf_rpath_list"
23790 then
23791 for cf_rpath_item in $cf_rpath_list
23792 do
23793 if test "x$cf_rpath_src" = "x-L$cf_rpath_item"
23794 then
23795 cf_rpath_skip=yes
23796 break
23797 fi
23798 done
23799 fi
23800
23801 if test "$cf_rpath_skip" = no
23802 then
23803 # transform the option
23804 if test "$LD_RPATH_OPT" = "-R " ; then
23805 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%-R %"`
23806 else
23807 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%$LD_RPATH_OPT%"`
23808 fi
23809
23810 # if we have not already added this, add it now
23811 cf_rpath_tst=`echo "$EXTRA_LDFLAGS" | sed -e "s%$cf_rpath_tmp %%"`
23812 if test "x$cf_rpath_tst" = "x$EXTRA_LDFLAGS"
23813 then
23814 test -n "$verbose" && echo " ...Filter $cf_rpath_src ->$cf_rpath_tmp" 1>&6
23815
micky3879b9f5e72025-07-08 18:04:53 -040023816echo "${as_me:-configure}:23816: testing ...Filter $cf_rpath_src ->$cf_rpath_tmp ..." 1>&5
Steve Kondikae271bc2015-11-15 02:50:53 +010023817
23818 EXTRA_LDFLAGS="$cf_rpath_tmp $EXTRA_LDFLAGS"
23819 fi
23820 fi
23821 ;;
23822 esac
23823 cf_rpath_dst="$cf_rpath_dst $cf_rpath_src"
23824done
23825LDFLAGS=$cf_rpath_dst
23826
23827test -n "$verbose" && echo " ...checked LDFLAGS $LDFLAGS" 1>&6
23828
micky3879b9f5e72025-07-08 18:04:53 -040023829echo "${as_me:-configure}:23829: testing ...checked LDFLAGS $LDFLAGS ..." 1>&5
Steve Kondikae271bc2015-11-15 02:50:53 +010023830
23831test -n "$verbose" && echo " ...checking LIBS $LIBS" 1>&6
23832
micky3879b9f5e72025-07-08 18:04:53 -040023833echo "${as_me:-configure}:23833: testing ...checking LIBS $LIBS ..." 1>&5
Steve Kondikae271bc2015-11-15 02:50:53 +010023834
23835cf_rpath_dst=
23836for cf_rpath_src in $LIBS
23837do
micky3879b9f5e72025-07-08 18:04:53 -040023838 case "$cf_rpath_src" in
Steve Kondikae271bc2015-11-15 02:50:53 +010023839 (-L*)
23840
23841 # check if this refers to a directory which we will ignore
23842 cf_rpath_skip=no
23843 if test -n "$cf_rpath_list"
23844 then
23845 for cf_rpath_item in $cf_rpath_list
23846 do
23847 if test "x$cf_rpath_src" = "x-L$cf_rpath_item"
23848 then
23849 cf_rpath_skip=yes
23850 break
23851 fi
23852 done
23853 fi
23854
23855 if test "$cf_rpath_skip" = no
23856 then
23857 # transform the option
23858 if test "$LD_RPATH_OPT" = "-R " ; then
23859 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%-R %"`
23860 else
23861 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%$LD_RPATH_OPT%"`
23862 fi
23863
23864 # if we have not already added this, add it now
23865 cf_rpath_tst=`echo "$EXTRA_LDFLAGS" | sed -e "s%$cf_rpath_tmp %%"`
23866 if test "x$cf_rpath_tst" = "x$EXTRA_LDFLAGS"
23867 then
23868 test -n "$verbose" && echo " ...Filter $cf_rpath_src ->$cf_rpath_tmp" 1>&6
23869
micky3879b9f5e72025-07-08 18:04:53 -040023870echo "${as_me:-configure}:23870: testing ...Filter $cf_rpath_src ->$cf_rpath_tmp ..." 1>&5
Steve Kondikae271bc2015-11-15 02:50:53 +010023871
23872 EXTRA_LDFLAGS="$cf_rpath_tmp $EXTRA_LDFLAGS"
23873 fi
23874 fi
23875 ;;
23876 esac
23877 cf_rpath_dst="$cf_rpath_dst $cf_rpath_src"
23878done
23879LIBS=$cf_rpath_dst
23880
23881test -n "$verbose" && echo " ...checked LIBS $LIBS" 1>&6
23882
micky3879b9f5e72025-07-08 18:04:53 -040023883echo "${as_me:-configure}:23883: testing ...checked LIBS $LIBS ..." 1>&5
Steve Kondikae271bc2015-11-15 02:50:53 +010023884
23885 test -n "$verbose" && echo " ...checked EXTRA_LDFLAGS $EXTRA_LDFLAGS" 1>&6
23886
micky3879b9f5e72025-07-08 18:04:53 -040023887echo "${as_me:-configure}:23887: testing ...checked EXTRA_LDFLAGS $EXTRA_LDFLAGS ..." 1>&5
Steve Kondikae271bc2015-11-15 02:50:53 +010023888
23889else
micky3879b9f5e72025-07-08 18:04:53 -040023890 echo "$as_me:23890: result: no" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010023891echo "${ECHO_T}no" >&6
23892fi
23893
23894fi
23895
23896TEST_ARGS="$LIBS"
23897LIBS=
23898
23899ac_config_files="$ac_config_files Makefile"
23900ac_config_commands="$ac_config_commands default"
23901cat >confcache <<\_ACEOF
23902# This file is a shell script that caches the results of configure
23903# tests run on this system so they can be shared between configure
23904# scripts and configure runs, see configure's option --config-cache.
23905# It is not useful on other systems. If it contains results you don't
23906# want to keep, you may remove or edit it.
23907#
23908# config.status only pays attention to the cache file if you give it
23909# the --recheck option to rerun configure.
23910#
micky3879b9f5e72025-07-08 18:04:53 -040023911# `ac_cv_env_foo' variables (set or unset) will be overridden when
Steve Kondikae271bc2015-11-15 02:50:53 +010023912# loading this file, other *unset* `ac_cv_foo' will be assigned the
23913# following values.
23914
23915_ACEOF
23916
23917# The following way of writing the cache mishandles newlines in values,
23918# but we know of no workaround that is simple, portable, and efficient.
23919# So, don't put newlines in cache variables' values.
23920# Ultrix sh set writes to stderr and can't be redirected directly,
23921# and sets the high bit in the cache file unless we assign to the vars.
23922{
23923 (set) 2>&1 |
23924 case `(ac_space=' '; set | grep ac_space) 2>&1` in
23925 *ac_space=\ *)
23926 # `set' does not quote correctly, so add quotes (double-quote
23927 # substitution turns \\\\ into \\, and sed turns \\ into \).
23928 sed -n \
23929 "s/'/'\\\\''/g;
23930 s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
23931 ;;
23932 *)
23933 # `set' quotes correctly as required by POSIX, so do not add quotes.
23934 sed -n \
23935 "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
23936 ;;
23937 esac;
23938} |
23939 sed '
23940 t clear
23941 : clear
23942 s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
23943 t end
23944 /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
23945 : end' >>confcache
23946if cmp -s $cache_file confcache; then :; else
23947 if test -w $cache_file; then
23948 test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file"
23949 cat confcache >$cache_file
23950 else
23951 echo "not updating unwritable cache $cache_file"
23952 fi
23953fi
23954rm -f confcache
23955
23956test "x$prefix" = xNONE && prefix=$ac_default_prefix
23957# Let make expand exec_prefix.
23958test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
23959
23960# VPATH may cause trouble with some makes, so we remove $(srcdir),
23961# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
23962# trailing colons and then remove the whole line if VPATH becomes empty
23963# (actually we leave an empty line to preserve line numbers).
23964if test "x$srcdir" = x.; then
23965 ac_vpsub='/^[ ]*VPATH[ ]*=/{
23966s/:*\$(srcdir):*/:/;
23967s/:*\${srcdir}:*/:/;
23968s/:*@srcdir@:*/:/;
23969s/^\([^=]*=[ ]*\):*/\1/;
23970s/:*$//;
23971s/^[^=]*=[ ]*$//;
23972}'
23973fi
23974
23975DEFS=-DHAVE_CONFIG_H
23976
micky3879b9f5e72025-07-08 18:04:53 -040023977: "${CONFIG_STATUS=./config.status}"
Steve Kondikae271bc2015-11-15 02:50:53 +010023978ac_clean_files_save=$ac_clean_files
23979ac_clean_files="$ac_clean_files $CONFIG_STATUS"
micky3879b9f5e72025-07-08 18:04:53 -040023980{ echo "$as_me:23980: creating $CONFIG_STATUS" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010023981echo "$as_me: creating $CONFIG_STATUS" >&6;}
micky3879b9f5e72025-07-08 18:04:53 -040023982cat >"$CONFIG_STATUS" <<_ACEOF
Steve Kondikae271bc2015-11-15 02:50:53 +010023983#! $SHELL
23984# Generated automatically by configure.
23985# Run this file to recreate the current configuration.
23986# Compiler output produced by configure, useful for debugging
23987# configure, is in config.log if it exists.
23988
micky3879b9f5e72025-07-08 18:04:53 -040023989me=\`echo "\$0" | sed -e 's,.*\\/,,'\`
23990
Steve Kondikae271bc2015-11-15 02:50:53 +010023991debug=false
23992SHELL=\${CONFIG_SHELL-$SHELL}
23993ac_cs_invocation="\$0 \$@"
23994
micky3879b9f5e72025-07-08 18:04:53 -040023995CLICOLOR_FORCE= GREP_OPTIONS=
23996unset CLICOLOR_FORCE GREP_OPTIONS
Steve Kondikae271bc2015-11-15 02:50:53 +010023997_ACEOF
23998
micky3879b9f5e72025-07-08 18:04:53 -040023999cat >>"$CONFIG_STATUS" <<\_ACEOF
Steve Kondikae271bc2015-11-15 02:50:53 +010024000# Be Bourne compatible
24001if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
24002 emulate sh
24003 NULLCMD=:
24004elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
24005 set -o posix
24006fi
24007
24008# Name of the executable.
24009as_me=`echo "$0" |sed 's,.*[\\/],,'`
24010
24011if expr a : '\(a\)' >/dev/null 2>&1; then
micky3879b9f5e72025-07-08 18:04:53 -040024012 as_expr="expr"
Steve Kondikae271bc2015-11-15 02:50:53 +010024013else
micky3879b9f5e72025-07-08 18:04:53 -040024014 as_expr="false"
Steve Kondikae271bc2015-11-15 02:50:53 +010024015fi
24016
24017rm -f conf$$ conf$$.exe conf$$.file
24018echo >conf$$.file
24019if ln -s conf$$.file conf$$ 2>/dev/null; then
24020 # We could just check for DJGPP; but this test a) works b) is more generic
24021 # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
24022 if test -f conf$$.exe; then
24023 # Don't use ln at all; we don't have any links
24024 as_ln_s='cp -p'
24025 else
24026 as_ln_s='ln -s'
24027 fi
24028elif ln conf$$.file conf$$ 2>/dev/null; then
micky3879b9f5e72025-07-08 18:04:53 -040024029 as_ln_s='ln'
Steve Kondikae271bc2015-11-15 02:50:53 +010024030else
24031 as_ln_s='cp -p'
24032fi
24033rm -f conf$$ conf$$.exe conf$$.file
24034
24035as_executable_p="test -f"
24036
24037# Support unset when possible.
24038if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
micky3879b9f5e72025-07-08 18:04:53 -040024039 as_unset="unset"
Steve Kondikae271bc2015-11-15 02:50:53 +010024040else
micky3879b9f5e72025-07-08 18:04:53 -040024041 as_unset="false"
Steve Kondikae271bc2015-11-15 02:50:53 +010024042fi
24043
24044# NLS nuisances.
24045$as_unset LANG || test "${LANG+set}" != set || { LANG=C; export LANG; }
24046$as_unset LC_ALL || test "${LC_ALL+set}" != set || { LC_ALL=C; export LC_ALL; }
24047$as_unset LC_TIME || test "${LC_TIME+set}" != set || { LC_TIME=C; export LC_TIME; }
24048$as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set || { LC_CTYPE=C; export LC_CTYPE; }
24049$as_unset LANGUAGE || test "${LANGUAGE+set}" != set || { LANGUAGE=C; export LANGUAGE; }
24050$as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set || { LC_COLLATE=C; export LC_COLLATE; }
24051$as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set || { LC_NUMERIC=C; export LC_NUMERIC; }
24052$as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set || { LC_MESSAGES=C; export LC_MESSAGES; }
24053
24054# IFS
24055# We need space, tab and new line, in precisely that order.
24056as_nl='
24057'
24058IFS=" $as_nl"
24059
24060# CDPATH.
24061$as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=:; export CDPATH; }
24062
24063exec 6>&1
24064
24065_ACEOF
24066
24067# Files that config.status was made for.
24068if test -n "$ac_config_files"; then
micky3879b9f5e72025-07-08 18:04:53 -040024069 echo "config_files=\"$ac_config_files\"" >>"$CONFIG_STATUS"
Steve Kondikae271bc2015-11-15 02:50:53 +010024070fi
24071
24072if test -n "$ac_config_headers"; then
micky3879b9f5e72025-07-08 18:04:53 -040024073 echo "config_headers=\"$ac_config_headers\"" >>"$CONFIG_STATUS"
Steve Kondikae271bc2015-11-15 02:50:53 +010024074fi
24075
24076if test -n "$ac_config_links"; then
micky3879b9f5e72025-07-08 18:04:53 -040024077 echo "config_links=\"$ac_config_links\"" >>"$CONFIG_STATUS"
Steve Kondikae271bc2015-11-15 02:50:53 +010024078fi
24079
24080if test -n "$ac_config_commands"; then
micky3879b9f5e72025-07-08 18:04:53 -040024081 echo "config_commands=\"$ac_config_commands\"" >>"$CONFIG_STATUS"
Steve Kondikae271bc2015-11-15 02:50:53 +010024082fi
24083
micky3879b9f5e72025-07-08 18:04:53 -040024084cat >>"$CONFIG_STATUS" <<\EOF
Steve Kondikae271bc2015-11-15 02:50:53 +010024085
24086ac_cs_usage="\
24087\`$as_me' instantiates files from templates according to the
24088current configuration.
24089
24090Usage: $0 [OPTIONS] [FILE]...
24091
24092 -h, --help print this help, then exit
24093 -V, --version print version number, then exit
24094 -d, --debug don't remove temporary files
24095 --recheck update $as_me by reconfiguring in the same conditions
24096 --file=FILE[:TEMPLATE]
24097 instantiate the configuration file FILE
24098 --header=FILE[:TEMPLATE]
24099 instantiate the configuration header FILE
24100
24101Configuration files:
24102$config_files
24103
24104Configuration headers:
24105$config_headers
24106
24107Configuration commands:
24108$config_commands
24109
24110Report bugs to <dickey@invisible-island.net>."
24111EOF
24112
micky3879b9f5e72025-07-08 18:04:53 -040024113cat >>"$CONFIG_STATUS" <<EOF
Steve Kondikae271bc2015-11-15 02:50:53 +010024114ac_cs_version="\\
24115config.status
micky3879b9f5e72025-07-08 18:04:53 -040024116configured by $0, generated by GNU Autoconf 2.52.20231210,
Steve Kondikae271bc2015-11-15 02:50:53 +010024117 with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
24118
micky3879b9f5e72025-07-08 18:04:53 -040024119Copyright 2003-2022,2023 Thomas E. Dickey
Steve Kondikae271bc2015-11-15 02:50:53 +010024120Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
24121Free Software Foundation, Inc.
24122This config.status script is free software; the Free Software Foundation
24123gives unlimited permission to copy, distribute and modify it."
micky3879b9f5e72025-07-08 18:04:53 -040024124srcdir="$srcdir"
Steve Kondikae271bc2015-11-15 02:50:53 +010024125INSTALL="$INSTALL"
24126EOF
24127
micky3879b9f5e72025-07-08 18:04:53 -040024128cat >>"$CONFIG_STATUS" <<\EOF
Steve Kondikae271bc2015-11-15 02:50:53 +010024129# If no file are specified by the user, then we need to provide default
24130# value. By we need to know if files were specified by the user.
24131ac_need_defaults=:
24132while test $# != 0
24133do
24134 case $1 in
24135 --*=*)
24136 ac_option=`expr "x$1" : 'x\([^=]*\)='`
24137 ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'`
24138 shift
24139 set dummy "$ac_option" "$ac_optarg" ${1+"$@"}
24140 shift
24141 ;;
24142 -*);;
24143 *) # This is not an option, so the user has probably given explicit
24144 # arguments.
24145 ac_need_defaults=false;;
24146 esac
24147
24148 case $1 in
24149 # Handling of the options.
24150EOF
micky3879b9f5e72025-07-08 18:04:53 -040024151cat >>"$CONFIG_STATUS" <<EOF
Steve Kondikae271bc2015-11-15 02:50:53 +010024152 -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
24153 echo "running $SHELL $0 " $ac_configure_args " --no-create --no-recursion"
24154 exec $SHELL $0 $ac_configure_args --no-create --no-recursion ;;
24155EOF
micky3879b9f5e72025-07-08 18:04:53 -040024156cat >>"$CONFIG_STATUS" <<\EOF
Steve Kondikae271bc2015-11-15 02:50:53 +010024157 --version | --vers* | -V )
24158 echo "$ac_cs_version"; exit 0 ;;
24159 --he | --h)
24160 # Conflict between --help and --header
micky3879b9f5e72025-07-08 18:04:53 -040024161 { { echo "$as_me:24161: error: ambiguous option: $1
Steve Kondikae271bc2015-11-15 02:50:53 +010024162Try \`$0 --help' for more information." >&5
24163echo "$as_me: error: ambiguous option: $1
24164Try \`$0 --help' for more information." >&2;}
24165 { (exit 1); exit 1; }; };;
24166 --help | --hel | -h )
24167 echo "$ac_cs_usage"; exit 0 ;;
24168 --debug | --d* | -d )
24169 debug=: ;;
24170 --file | --fil | --fi | --f )
24171 shift
24172 CONFIG_FILES="$CONFIG_FILES $1"
24173 ac_need_defaults=false;;
24174 --header | --heade | --head | --hea )
24175 shift
24176 CONFIG_HEADERS="$CONFIG_HEADERS $1"
24177 ac_need_defaults=false;;
24178
24179 # This is an error.
micky3879b9f5e72025-07-08 18:04:53 -040024180 -*) { { echo "$as_me:24180: error: unrecognized option: $1
Steve Kondikae271bc2015-11-15 02:50:53 +010024181Try \`$0 --help' for more information." >&5
24182echo "$as_me: error: unrecognized option: $1
24183Try \`$0 --help' for more information." >&2;}
24184 { (exit 1); exit 1; }; } ;;
24185
24186 *) ac_config_targets="$ac_config_targets $1" ;;
24187
24188 esac
24189 shift
24190done
24191
24192exec 5>>config.log
24193cat >&5 << _ACEOF
24194
24195## ----------------------- ##
24196## Running config.status. ##
24197## ----------------------- ##
24198
micky3879b9f5e72025-07-08 18:04:53 -040024199This file was extended by $as_me 2.52.20231210, executed with
Steve Kondikae271bc2015-11-15 02:50:53 +010024200 CONFIG_FILES = $CONFIG_FILES
24201 CONFIG_HEADERS = $CONFIG_HEADERS
24202 CONFIG_LINKS = $CONFIG_LINKS
24203 CONFIG_COMMANDS = $CONFIG_COMMANDS
micky3879b9f5e72025-07-08 18:04:53 -040024204 > "$ac_cs_invocation"
Steve Kondikae271bc2015-11-15 02:50:53 +010024205on `(hostname || uname -n) 2>/dev/null | sed 1q`
24206
24207_ACEOF
24208EOF
24209
micky3879b9f5e72025-07-08 18:04:53 -040024210cat >>"$CONFIG_STATUS" <<EOF
Steve Kondikae271bc2015-11-15 02:50:53 +010024211#
24212# INIT-COMMANDS section.
24213#
24214
24215AWK="$AWK"
24216ECHO_CC="$ECHO_CC"
24217ECHO_LD="$ECHO_LD"
24218SHOW_CC="$SHOW_LD"
24219
24220EOF
24221
micky3879b9f5e72025-07-08 18:04:53 -040024222cat >>"$CONFIG_STATUS" <<\EOF
Steve Kondikae271bc2015-11-15 02:50:53 +010024223for ac_config_target in $ac_config_targets
24224do
24225 case "$ac_config_target" in
24226 # Handling of arguments.
24227 "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;;
24228 "default" ) CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;;
24229 "ncurses_cfg.h" ) CONFIG_HEADERS="$CONFIG_HEADERS ncurses_cfg.h:ncurses_tst.hin" ;;
micky3879b9f5e72025-07-08 18:04:53 -040024230 *) { { echo "$as_me:24230: error: invalid argument: $ac_config_target" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010024231echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
24232 { (exit 1); exit 1; }; };;
24233 esac
24234done
24235
24236# If the user did not use the arguments to specify the items to instantiate,
24237# then the envvar interface is used. Set only those that are not.
24238# We use the long form for the default assignment because of an extremely
24239# bizarre bug on SunOS 4.1.3.
micky3879b9f5e72025-07-08 18:04:53 -040024240if "$ac_need_defaults"; then
Steve Kondikae271bc2015-11-15 02:50:53 +010024241 test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
24242 test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
24243 test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
24244fi
24245
24246# Create a temporary directory, and hook for its removal unless debugging.
24247$debug ||
24248{
24249 trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0
24250 trap '{ (exit 1); exit 1; }' 1 2 13 15
24251}
24252
24253# Create a (secure) tmp directory for tmp files.
micky3879b9f5e72025-07-08 18:04:53 -040024254: "${TMPDIR=/tmp}"
Steve Kondikae271bc2015-11-15 02:50:53 +010024255{
24256 tmp=`(umask 077 && mktemp -d -q "$TMPDIR/csXXXXXX") 2>/dev/null` &&
24257 test -n "$tmp" && test -d "$tmp"
24258} ||
24259{
24260 tmp=$TMPDIR/cs$$-$RANDOM
micky3879b9f5e72025-07-08 18:04:53 -040024261 (umask 077 && mkdir "$tmp")
Steve Kondikae271bc2015-11-15 02:50:53 +010024262} ||
24263{
24264 echo "$me: cannot create a temporary directory in $TMPDIR" >&2
24265 { (exit 1); exit 1; }
24266}
24267
24268EOF
24269
micky3879b9f5e72025-07-08 18:04:53 -040024270cat >>"$CONFIG_STATUS" <<EOF
Steve Kondikae271bc2015-11-15 02:50:53 +010024271
24272#
24273# CONFIG_FILES section.
24274#
24275
24276# No need to generate the scripts if there are no CONFIG_FILES.
24277# This happens for instance when ./config.status config.h
24278if test -n "\$CONFIG_FILES"; then
24279 # Protect against being on the right side of a sed subst in config.status.
24280 sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g;
micky3879b9f5e72025-07-08 18:04:53 -040024281 s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >"\$tmp"/subs.sed <<\\CEOF
Steve Kondikae271bc2015-11-15 02:50:53 +010024282s,@SHELL@,$SHELL,;t t
24283s,@exec_prefix@,$exec_prefix,;t t
24284s,@prefix@,$prefix,;t t
24285s,@program_transform_name@,$program_transform_name,;t t
24286s,@bindir@,$bindir,;t t
24287s,@sbindir@,$sbindir,;t t
24288s,@libexecdir@,$libexecdir,;t t
24289s,@datarootdir@,$datarootdir,;t t
24290s,@datadir@,$datadir,;t t
24291s,@sysconfdir@,$sysconfdir,;t t
24292s,@sharedstatedir@,$sharedstatedir,;t t
24293s,@localstatedir@,$localstatedir,;t t
micky3879b9f5e72025-07-08 18:04:53 -040024294s,@runstatedir@,$runstatedir,;t t
Steve Kondikae271bc2015-11-15 02:50:53 +010024295s,@libdir@,$libdir,;t t
24296s,@includedir@,$includedir,;t t
24297s,@oldincludedir@,$oldincludedir,;t t
24298s,@infodir@,$infodir,;t t
24299s,@mandir@,$mandir,;t t
24300s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t
24301s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t
24302s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t
24303s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t
24304s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t
24305s,@build_alias@,$build_alias,;t t
24306s,@host_alias@,$host_alias,;t t
24307s,@target_alias@,$target_alias,;t t
24308s,@ECHO_C@,$ECHO_C,;t t
24309s,@ECHO_N@,$ECHO_N,;t t
24310s,@ECHO_T@,$ECHO_T,;t t
24311s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t
24312s,@DEFS@,$DEFS,;t t
24313s,@LIBS@,$LIBS,;t t
24314s,@build@,$build,;t t
24315s,@build_cpu@,$build_cpu,;t t
24316s,@build_vendor@,$build_vendor,;t t
24317s,@build_os@,$build_os,;t t
24318s,@host@,$host,;t t
24319s,@host_cpu@,$host_cpu,;t t
24320s,@host_vendor@,$host_vendor,;t t
24321s,@host_os@,$host_os,;t t
24322s,@SET_MAKE@,$SET_MAKE,;t t
24323s,@CC@,$CC,;t t
24324s,@CFLAGS@,$CFLAGS,;t t
24325s,@LDFLAGS@,$LDFLAGS,;t t
24326s,@CPPFLAGS@,$CPPFLAGS,;t t
24327s,@ac_ct_CC@,$ac_ct_CC,;t t
24328s,@EXEEXT@,$EXEEXT,;t t
24329s,@OBJEXT@,$OBJEXT,;t t
24330s,@EXTRA_CPPFLAGS@,$EXTRA_CPPFLAGS,;t t
24331s,@CPP@,$CPP,;t t
micky3879b9f5e72025-07-08 18:04:53 -040024332s,@GREP@,$GREP,;t t
24333s,@EGREP@,$EGREP,;t t
Steve Kondikae271bc2015-11-15 02:50:53 +010024334s,@AWK@,$AWK,;t t
24335s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t
24336s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t
24337s,@INSTALL_DATA@,$INSTALL_DATA,;t t
micky3879b9f5e72025-07-08 18:04:53 -040024338s,@INSTALL_OPT_S@,$INSTALL_OPT_S,;t t
24339s,@INSTALL_OPT_O@,$INSTALL_OPT_O,;t t
Steve Kondikae271bc2015-11-15 02:50:53 +010024340s,@LINT@,$LINT,;t t
24341s,@LINT_OPTS@,$LINT_OPTS,;t t
micky3879b9f5e72025-07-08 18:04:53 -040024342s,@LINT_LIBS@,$LINT_LIBS,;t t
24343s,@MAKE_NO_PHONY@,$MAKE_NO_PHONY,;t t
24344s,@MAKE_PHONY@,$MAKE_PHONY,;t t
Steve Kondikae271bc2015-11-15 02:50:53 +010024345s,@CTAGS@,$CTAGS,;t t
24346s,@ETAGS@,$ETAGS,;t t
24347s,@MAKE_LOWER_TAGS@,$MAKE_LOWER_TAGS,;t t
24348s,@MAKE_UPPER_TAGS@,$MAKE_UPPER_TAGS,;t t
24349s,@MATH_LIB@,$MATH_LIB,;t t
24350s,@top_builddir@,$top_builddir,;t t
24351s,@CC_G_OPT@,$CC_G_OPT,;t t
24352s,@CC_SHARED_OPTS@,$CC_SHARED_OPTS,;t t
24353s,@DFT_DEP_SUFFIX@,$DFT_DEP_SUFFIX,;t t
24354s,@DFT_OBJ_SUBDIR@,$DFT_OBJ_SUBDIR,;t t
24355s,@DFT_UPR_MODEL@,$DFT_UPR_MODEL,;t t
24356s,@LD@,$LD,;t t
24357s,@LDFLAGS_SHARED@,$LDFLAGS_SHARED,;t t
24358s,@LDFLAGS_STATIC@,$LDFLAGS_STATIC,;t t
24359s,@LD_MODEL@,$LD_MODEL,;t t
24360s,@LD_SHARED_OPTS@,$LD_SHARED_OPTS,;t t
24361s,@LIBTOOL@,$LIBTOOL,;t t
24362s,@LIBTOOL_OPTS@,$LIBTOOL_OPTS,;t t
24363s,@LIB_CLEAN@,$LIB_CLEAN,;t t
24364s,@LIB_COMPILE@,$LIB_COMPILE,;t t
24365s,@LIB_LINK@,$LIB_LINK,;t t
24366s,@LINK_TESTS@,$LINK_TESTS,;t t
24367s,@LOCAL_LDFLAGS@,$LOCAL_LDFLAGS,;t t
24368s,@PACKAGE@,$PACKAGE,;t t
24369s,@PTHREAD@,$PTHREAD,;t t
24370s,@TEST_ARGS@,$TEST_ARGS,;t t
24371s,@TEST_DEPS@,$TEST_DEPS,;t t
24372s,@TEST_LIBS@,$TEST_LIBS,;t t
24373s,@TINFO_LDFLAGS@,$TINFO_LDFLAGS,;t t
24374s,@TINFO_LIBS@,$TINFO_LIBS,;t t
24375s,@cf_cv_abi_version@,$cf_cv_abi_version,;t t
24376s,@cf_cv_rel_version@,$cf_cv_rel_version,;t t
24377s,@includesubdir@,$includesubdir,;t t
micky3879b9f5e72025-07-08 18:04:53 -040024378s,@FGREP@,$FGREP,;t t
24379s,@HAVE_STDNORETURN_H@,$HAVE_STDNORETURN_H,;t t
24380s,@STDC_NORETURN@,$STDC_NORETURN,;t t
Steve Kondikae271bc2015-11-15 02:50:53 +010024381s,@PKG_CONFIG@,$PKG_CONFIG,;t t
24382s,@ac_pt_PKG_CONFIG@,$ac_pt_PKG_CONFIG,;t t
24383s,@ECHO_LT@,$ECHO_LT,;t t
24384s,@ECHO_LD@,$ECHO_LD,;t t
24385s,@RULE_CC@,$RULE_CC,;t t
24386s,@SHOW_CC@,$SHOW_CC,;t t
24387s,@ECHO_CC@,$ECHO_CC,;t t
24388s,@NCURSES_WRAP_PREFIX@,$NCURSES_WRAP_PREFIX,;t t
24389s,@NCURSES_CONFIG@,$NCURSES_CONFIG,;t t
24390s,@ac_ct_NCURSES_CONFIG@,$ac_ct_NCURSES_CONFIG,;t t
24391s,@X_CFLAGS@,$X_CFLAGS,;t t
24392s,@X_PRE_LIBS@,$X_PRE_LIBS,;t t
24393s,@X_LIBS@,$X_LIBS,;t t
24394s,@X_EXTRA_LIBS@,$X_EXTRA_LIBS,;t t
24395s,@XCURSES_CONFIG@,$XCURSES_CONFIG,;t t
24396s,@ac_ct_XCURSES_CONFIG@,$ac_ct_XCURSES_CONFIG,;t t
micky3879b9f5e72025-07-08 18:04:53 -040024397s,@cf_cv_screen@,$cf_cv_screen,;t t
24398s,@RGB_PATH@,$RGB_PATH,;t t
24399s,@no_x11_rgb@,$no_x11_rgb,;t t
24400s,@FORM_NAME@,$FORM_NAME,;t t
24401s,@MENU_NAME@,$MENU_NAME,;t t
24402s,@PANEL_NAME@,$PANEL_NAME,;t t
Steve Kondikae271bc2015-11-15 02:50:53 +010024403s,@EXTRA_CFLAGS@,$EXTRA_CFLAGS,;t t
24404s,@cf_ldd_prog@,$cf_ldd_prog,;t t
24405s,@EXTRA_LDFLAGS@,$EXTRA_LDFLAGS,;t t
24406CEOF
24407
24408EOF
24409
micky3879b9f5e72025-07-08 18:04:53 -040024410 cat >>"$CONFIG_STATUS" <<\EOF
Steve Kondikae271bc2015-11-15 02:50:53 +010024411 # Split the substitutions into bite-sized pieces for seds with
24412 # small command number limits, like on Digital OSF/1 and HP-UX.
24413 ac_max_sed_lines=48
24414 ac_sed_frag=1 # Number of current file.
24415 ac_beg=1 # First line for current file.
24416 ac_end=$ac_max_sed_lines # Line after last line for current file.
24417 ac_more_lines=:
24418 ac_sed_cmds=
micky3879b9f5e72025-07-08 18:04:53 -040024419 while "$ac_more_lines"; do
24420 if test "$ac_beg" -gt 1; then
24421 sed "1,${ac_beg}d; ${ac_end}q" "$tmp"/subs.sed >"$tmp"/subs.frag
Steve Kondikae271bc2015-11-15 02:50:53 +010024422 else
micky3879b9f5e72025-07-08 18:04:53 -040024423 sed "${ac_end}q" "$tmp"/subs.sed >"$tmp"/subs.frag
Steve Kondikae271bc2015-11-15 02:50:53 +010024424 fi
micky3879b9f5e72025-07-08 18:04:53 -040024425 if test ! -s "$tmp"/subs.frag; then
Steve Kondikae271bc2015-11-15 02:50:53 +010024426 ac_more_lines=false
24427 else
24428 # The purpose of the label and of the branching condition is to
24429 # speed up the sed processing (if there are no `@' at all, there
24430 # is no need to browse any of the substitutions).
24431 # These are the two extra sed commands mentioned above.
24432 (echo ':t
micky3879b9f5e72025-07-08 18:04:53 -040024433 /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat "$tmp"/subs.frag) >"$tmp"/subs-$ac_sed_frag.sed
24434 # It is possible to make a multiline substitution using escaped newlines.
24435 # Ensure that we do not split the substitution between script fragments.
24436 ac_BEG=$ac_end
24437 ac_END=`expr "$ac_end" + "$ac_max_sed_lines"`
24438 sed "1,${ac_BEG}d; ${ac_END}p; q" "$tmp"/subs.sed >"$tmp"/subs.next
24439 if test -s "$tmp"/subs.next; then
24440 grep '^s,@[^@,][^@,]*@,.*\\$' "$tmp"/subs.next >"$tmp"/subs.edit
24441 if test ! -s "$tmp"/subs.edit; then
24442 grep "^s,@[^@,][^@,]*@,.*,;t t$" "$tmp"/subs.next >"$tmp"/subs.edit
24443 if test ! -s "$tmp"/subs.edit; then
24444 if test "$ac_beg" -gt 1; then
24445 ac_end=`expr "$ac_end" - 1`
24446 continue
24447 fi
24448 fi
24449 fi
Steve Kondikae271bc2015-11-15 02:50:53 +010024450 fi
micky3879b9f5e72025-07-08 18:04:53 -040024451
24452 if test -z "$ac_sed_cmds"; then
24453 ac_sed_cmds="sed -f \"$tmp\"/subs-$ac_sed_frag.sed"
24454 else
24455 ac_sed_cmds="$ac_sed_cmds | sed -f \"$tmp\"/subs-$ac_sed_frag.sed"
24456 fi
24457 ac_sed_frag=`expr "$ac_sed_frag" + 1`
Steve Kondikae271bc2015-11-15 02:50:53 +010024458 ac_beg=$ac_end
micky3879b9f5e72025-07-08 18:04:53 -040024459 ac_end=`expr "$ac_end" + "$ac_max_sed_lines"`
Steve Kondikae271bc2015-11-15 02:50:53 +010024460 fi
24461 done
24462 if test -z "$ac_sed_cmds"; then
micky3879b9f5e72025-07-08 18:04:53 -040024463 ac_sed_cmds="cat"
Steve Kondikae271bc2015-11-15 02:50:53 +010024464 fi
24465fi # test -n "$CONFIG_FILES"
24466
24467EOF
micky3879b9f5e72025-07-08 18:04:53 -040024468cat >>"$CONFIG_STATUS" <<\EOF
Steve Kondikae271bc2015-11-15 02:50:53 +010024469for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue
24470 # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
micky3879b9f5e72025-07-08 18:04:53 -040024471 case "$ac_file" in
Steve Kondikae271bc2015-11-15 02:50:53 +010024472 - | *:- | *:-:* ) # input from stdin
micky3879b9f5e72025-07-08 18:04:53 -040024473 cat >"$tmp"/stdin
Steve Kondikae271bc2015-11-15 02:50:53 +010024474 ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
24475 ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
24476 *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
24477 ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
24478 * ) ac_file_in=$ac_file.in ;;
24479 esac
24480
24481 # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories.
24482 ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
24483 X"$ac_file" : 'X\(//\)[^/]' \| \
24484 X"$ac_file" : 'X\(//\)$' \| \
24485 X"$ac_file" : 'X\(/\)' \| \
24486 . : '\(.\)' 2>/dev/null ||
24487echo X"$ac_file" |
24488 sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
24489 /^X\(\/\/\)[^/].*/{ s//\1/; q; }
24490 /^X\(\/\/\)$/{ s//\1/; q; }
24491 /^X\(\/\).*/{ s//\1/; q; }
24492 s/.*/./; q'`
24493 if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
24494 { case "$ac_dir" in
24495 [\\/]* | ?:[\\/]* ) as_incr_dir=;;
24496 *) as_incr_dir=.;;
24497esac
24498as_dummy="$ac_dir"
24499for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
24500 case $as_mkdir_dir in
24501 # Skip DOS drivespec
24502 ?:) as_incr_dir=$as_mkdir_dir ;;
24503 *)
24504 as_incr_dir=$as_incr_dir/$as_mkdir_dir
24505 test -d "$as_incr_dir" || mkdir "$as_incr_dir"
24506 ;;
24507 esac
24508done; }
24509
micky3879b9f5e72025-07-08 18:04:53 -040024510 ac_dir_suffix="/`echo "$ac_dir"|sed 's,^\./,,'`"
Steve Kondikae271bc2015-11-15 02:50:53 +010024511 # A "../" for each directory in $ac_dir_suffix.
24512 ac_dots=`echo "$ac_dir_suffix" | sed 's,/[^/]*,../,g'`
24513 else
24514 ac_dir_suffix= ac_dots=
24515 fi
24516
micky3879b9f5e72025-07-08 18:04:53 -040024517 case "$srcdir" in
Steve Kondikae271bc2015-11-15 02:50:53 +010024518 .) ac_srcdir=.
24519 if test -z "$ac_dots"; then
24520 ac_top_srcdir=.
24521 else
micky3879b9f5e72025-07-08 18:04:53 -040024522 ac_top_srcdir=`echo "$ac_dots" | sed 's,/$,,'`
Steve Kondikae271bc2015-11-15 02:50:53 +010024523 fi ;;
24524 [\\/]* | ?:[\\/]* )
micky3879b9f5e72025-07-08 18:04:53 -040024525 ac_srcdir="$srcdir$ac_dir_suffix";
24526 ac_top_srcdir="$srcdir" ;;
Steve Kondikae271bc2015-11-15 02:50:53 +010024527 *) # Relative path.
micky3879b9f5e72025-07-08 18:04:53 -040024528 ac_srcdir="$ac_dots$srcdir$ac_dir_suffix"
24529 ac_top_srcdir="$ac_dots$srcdir" ;;
Steve Kondikae271bc2015-11-15 02:50:53 +010024530 esac
24531
24532 case $INSTALL in
24533 [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
24534 *) ac_INSTALL=$ac_dots$INSTALL ;;
24535 esac
24536
24537 if test x"$ac_file" != x-; then
micky3879b9f5e72025-07-08 18:04:53 -040024538 { echo "$as_me:24538: creating $ac_file" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010024539echo "$as_me: creating $ac_file" >&6;}
24540 rm -f "$ac_file"
24541 fi
24542 # Let's still pretend it is `configure' which instantiates (i.e., don't
24543 # use $as_me), people would be surprised to read:
24544 # /* config.h. Generated automatically by config.status. */
24545 configure_input="Generated automatically from `echo $ac_file_in |
24546 sed 's,.*/,,'` by configure."
24547
24548 # First look for the input files in the build tree, otherwise in the
24549 # src tree.
24550 ac_file_inputs=`IFS=:
24551 for f in $ac_file_in; do
24552 case $f in
micky3879b9f5e72025-07-08 18:04:53 -040024553 -) echo "$tmp"/stdin ;;
Steve Kondikae271bc2015-11-15 02:50:53 +010024554 [\\/$]*)
24555 # Absolute (can't be DOS-style, as IFS=:)
micky3879b9f5e72025-07-08 18:04:53 -040024556 test -f "$f" || { { echo "$as_me:24556: error: cannot find input file: $f" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010024557echo "$as_me: error: cannot find input file: $f" >&2;}
24558 { (exit 1); exit 1; }; }
micky3879b9f5e72025-07-08 18:04:53 -040024559 echo "$f";;
Steve Kondikae271bc2015-11-15 02:50:53 +010024560 *) # Relative
24561 if test -f "$f"; then
24562 # Build tree
micky3879b9f5e72025-07-08 18:04:53 -040024563 echo "$f"
Steve Kondikae271bc2015-11-15 02:50:53 +010024564 elif test -f "$srcdir/$f"; then
24565 # Source tree
micky3879b9f5e72025-07-08 18:04:53 -040024566 echo "$srcdir/$f"
Steve Kondikae271bc2015-11-15 02:50:53 +010024567 else
24568 # /dev/null tree
micky3879b9f5e72025-07-08 18:04:53 -040024569 { { echo "$as_me:24569: error: cannot find input file: $f" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010024570echo "$as_me: error: cannot find input file: $f" >&2;}
24571 { (exit 1); exit 1; }; }
24572 fi;;
24573 esac
24574 done` || { (exit 1); exit 1; }
24575EOF
micky3879b9f5e72025-07-08 18:04:53 -040024576cat >>"$CONFIG_STATUS" <<\EOF
Steve Kondikae271bc2015-11-15 02:50:53 +010024577 ac_warn_datarootdir=no
24578 if test x"$ac_file" != x-; then
24579 for ac_item in $ac_file_inputs
24580 do
micky3879b9f5e72025-07-08 18:04:53 -040024581 ac_seen=`grep '@\(datadir\|mandir\|infodir\)@' "$ac_item"`
Steve Kondikae271bc2015-11-15 02:50:53 +010024582 if test -n "$ac_seen"; then
micky3879b9f5e72025-07-08 18:04:53 -040024583 ac_used=`grep '@datarootdir@' "$ac_item"`
Steve Kondikae271bc2015-11-15 02:50:53 +010024584 if test -z "$ac_used"; then
micky3879b9f5e72025-07-08 18:04:53 -040024585 { echo "$as_me:24585: WARNING: datarootdir was used implicitly but not set:
Steve Kondikae271bc2015-11-15 02:50:53 +010024586$ac_seen" >&5
24587echo "$as_me: WARNING: datarootdir was used implicitly but not set:
24588$ac_seen" >&2;}
24589 ac_warn_datarootdir=yes
24590 fi
24591 fi
micky3879b9f5e72025-07-08 18:04:53 -040024592 ac_seen=`grep '${datarootdir}' "$ac_item"`
Steve Kondikae271bc2015-11-15 02:50:53 +010024593 if test -n "$ac_seen"; then
micky3879b9f5e72025-07-08 18:04:53 -040024594 { echo "$as_me:24594: WARNING: datarootdir was used explicitly but not set:
Steve Kondikae271bc2015-11-15 02:50:53 +010024595$ac_seen" >&5
24596echo "$as_me: WARNING: datarootdir was used explicitly but not set:
24597$ac_seen" >&2;}
24598 ac_warn_datarootdir=yes
24599 fi
24600 done
24601 fi
24602
24603if test "x$ac_warn_datarootdir" = xyes; then
24604 ac_sed_cmds="$ac_sed_cmds | sed -e 's,@datarootdir@,\${prefix}/share,g' -e 's,\${datarootdir},\${prefix}/share,g'"
24605fi
24606
24607EOF
micky3879b9f5e72025-07-08 18:04:53 -040024608cat >>"$CONFIG_STATUS" <<EOF
Steve Kondikae271bc2015-11-15 02:50:53 +010024609 sed "$ac_vpsub
24610$extrasub
24611EOF
micky3879b9f5e72025-07-08 18:04:53 -040024612cat >>"$CONFIG_STATUS" <<\EOF
Steve Kondikae271bc2015-11-15 02:50:53 +010024613:t
24614/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
24615s,@configure_input@,$configure_input,;t t
24616s,@srcdir@,$ac_srcdir,;t t
24617s,@top_srcdir@,$ac_top_srcdir,;t t
24618s,@INSTALL@,$ac_INSTALL,;t t
micky3879b9f5e72025-07-08 18:04:53 -040024619" $ac_file_inputs | (eval "$ac_sed_cmds") >"$tmp"/out
24620 rm -f "$tmp"/stdin
24621EOF
24622test -n "${FGREP}" || FGREP="grep -F"
24623test -n "${EGREP}" || EGREP="grep -E"
24624cat >>"$CONFIG_STATUS" <<EOF
24625 test -n "\${FGREP}" || FGREP="$FGREP"
24626 test -n "\${EGREP}" || EGREP="$EGREP"
24627EOF
24628cat >>"$CONFIG_STATUS" <<\EOF
Steve Kondikae271bc2015-11-15 02:50:53 +010024629 if test x"$ac_file" != x-; then
micky3879b9f5e72025-07-08 18:04:53 -040024630 cp "$tmp/out" "$ac_file"
Steve Kondikae271bc2015-11-15 02:50:53 +010024631
24632 for ac_name in prefix exec_prefix datarootdir
24633 do
micky3879b9f5e72025-07-08 18:04:53 -040024634 ac_seen=`$FGREP -n '${'$ac_name'[:=].*}' "$ac_file"`
Steve Kondikae271bc2015-11-15 02:50:53 +010024635 if test -n "$ac_seen"; then
micky3879b9f5e72025-07-08 18:04:53 -040024636 ac_init=`$EGREP '[ ]*'$ac_name'[ ]*=' "$ac_file"`
Steve Kondikae271bc2015-11-15 02:50:53 +010024637 if test -z "$ac_init"; then
micky3879b9f5e72025-07-08 18:04:53 -040024638 ac_seen=`echo "$ac_seen" |sed -e 's,^,'"$ac_file"':,'`
24639 { echo "$as_me:24639: WARNING: Variable $ac_name is used but was not set:
Steve Kondikae271bc2015-11-15 02:50:53 +010024640$ac_seen" >&5
24641echo "$as_me: WARNING: Variable $ac_name is used but was not set:
24642$ac_seen" >&2;}
24643 fi
24644 fi
24645 done
micky3879b9f5e72025-07-08 18:04:53 -040024646 $EGREP -n '@[a-z_][a-z_0-9]+@' "$ac_file" >"$tmp"/out
24647 $EGREP -n '@[A-Z_][A-Z_0-9]+@' "$ac_file" >>"$tmp"/out
24648 if test -s "$tmp"/out; then
24649 ac_seen=`sed -e 's,^,'"$ac_file"':,' < "$tmp"/out`
24650 { echo "$as_me:24650: WARNING: Some variables may not be substituted:
Steve Kondikae271bc2015-11-15 02:50:53 +010024651$ac_seen" >&5
24652echo "$as_me: WARNING: Some variables may not be substituted:
24653$ac_seen" >&2;}
24654 fi
24655 else
micky3879b9f5e72025-07-08 18:04:53 -040024656 cat "$tmp"/out
Steve Kondikae271bc2015-11-15 02:50:53 +010024657 fi
micky3879b9f5e72025-07-08 18:04:53 -040024658 rm -f "$tmp"/out
Steve Kondikae271bc2015-11-15 02:50:53 +010024659
24660done
24661EOF
micky3879b9f5e72025-07-08 18:04:53 -040024662cat >>"$CONFIG_STATUS" <<\EOF
Steve Kondikae271bc2015-11-15 02:50:53 +010024663
24664#
24665# CONFIG_HEADER section.
24666#
24667
24668# These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
24669# NAME is the cpp macro being defined and VALUE is the value it is being given.
24670#
24671# ac_d sets the value in "#define NAME VALUE" lines.
24672ac_dA='s,^\([ ]*\)#\([ ]*define[ ][ ]*\)'
24673ac_dB='[ ].*$,\1#\2'
24674ac_dC=' '
24675ac_dD=',;t'
24676# ac_i turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
24677ac_iA='s,^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)'
24678ac_iB='\([ ]\),\1#\2define\3'
24679ac_iC=' '
24680ac_iD='\4,;t'
24681# ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
24682ac_uA='s,^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)'
24683ac_uB='$,\1#\2define\3'
24684ac_uC=' '
24685ac_uD=',;t'
24686
24687for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue
24688 # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
micky3879b9f5e72025-07-08 18:04:53 -040024689 case "$ac_file" in
Steve Kondikae271bc2015-11-15 02:50:53 +010024690 - | *:- | *:-:* ) # input from stdin
micky3879b9f5e72025-07-08 18:04:53 -040024691 cat >"$tmp"/stdin
Steve Kondikae271bc2015-11-15 02:50:53 +010024692 ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
24693 ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
24694 *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
24695 ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
24696 * ) ac_file_in=$ac_file.in ;;
24697 esac
24698
micky3879b9f5e72025-07-08 18:04:53 -040024699 test x"$ac_file" != x- && { echo "$as_me:24699: creating $ac_file" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010024700echo "$as_me: creating $ac_file" >&6;}
24701
24702 # First look for the input files in the build tree, otherwise in the
24703 # src tree.
24704 ac_file_inputs=`IFS=:
24705 for f in $ac_file_in; do
24706 case $f in
micky3879b9f5e72025-07-08 18:04:53 -040024707 -) echo "$tmp"/stdin ;;
Steve Kondikae271bc2015-11-15 02:50:53 +010024708 [\\/$]*)
24709 # Absolute (can't be DOS-style, as IFS=:)
micky3879b9f5e72025-07-08 18:04:53 -040024710 test -f "$f" || { { echo "$as_me:24710: error: cannot find input file: $f" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010024711echo "$as_me: error: cannot find input file: $f" >&2;}
24712 { (exit 1); exit 1; }; }
24713 echo $f;;
24714 *) # Relative
24715 if test -f "$f"; then
24716 # Build tree
24717 echo $f
24718 elif test -f "$srcdir/$f"; then
24719 # Source tree
micky3879b9f5e72025-07-08 18:04:53 -040024720 echo "$srcdir/$f"
Steve Kondikae271bc2015-11-15 02:50:53 +010024721 else
24722 # /dev/null tree
micky3879b9f5e72025-07-08 18:04:53 -040024723 { { echo "$as_me:24723: error: cannot find input file: $f" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010024724echo "$as_me: error: cannot find input file: $f" >&2;}
24725 { (exit 1); exit 1; }; }
24726 fi;;
24727 esac
24728 done` || { (exit 1); exit 1; }
24729 # Remove the trailing spaces.
micky3879b9f5e72025-07-08 18:04:53 -040024730 sed 's/[ ]*$//' $ac_file_inputs >"$tmp"/in
Steve Kondikae271bc2015-11-15 02:50:53 +010024731
24732EOF
24733
24734# Transform confdefs.h into a list of #define's. We won't use it as a sed
24735# script, but as data to insert where we see @DEFS@. We expect AC_SAVE_DEFS to
24736# be either 'cat' or 'sort'.
24737cat confdefs.h | uniq >conftest.vals
24738
24739# Break up conftest.vals because some shells have a limit on
24740# the size of here documents, and old seds have small limits too.
24741
24742rm -f conftest.tail
micky3879b9f5e72025-07-08 18:04:53 -040024743echo ' rm -f conftest.frag' >> "$CONFIG_STATUS"
Steve Kondikae271bc2015-11-15 02:50:53 +010024744while grep . conftest.vals >/dev/null
24745do
24746 # Write chunks of a limited-size here document to conftest.frag.
micky3879b9f5e72025-07-08 18:04:53 -040024747 echo ' cat >> conftest.frag <<CEOF' >> "$CONFIG_STATUS"
24748 sed "${ac_max_here_lines}q" conftest.vals | sed -e 's/#ifdef.*/#if 0/' >> "$CONFIG_STATUS"
24749 echo 'CEOF' >> "$CONFIG_STATUS"
24750 sed "1,${ac_max_here_lines}d" conftest.vals > conftest.tail
Steve Kondikae271bc2015-11-15 02:50:53 +010024751 rm -f conftest.vals
24752 mv conftest.tail conftest.vals
24753done
24754rm -f conftest.vals
24755
24756# Run sed to substitute the contents of conftest.frag into $tmp/in at the
24757# marker @DEFS@.
24758echo ' cat >> conftest.edit <<CEOF
24759/@DEFS@/r conftest.frag
24760/@DEFS@/d
24761CEOF
micky3879b9f5e72025-07-08 18:04:53 -040024762sed -f conftest.edit "$tmp"/in > "$tmp"/out
24763rm -f "$tmp"/in
24764mv "$tmp"/out "$tmp"/in
Steve Kondikae271bc2015-11-15 02:50:53 +010024765rm -f conftest.edit conftest.frag
micky3879b9f5e72025-07-08 18:04:53 -040024766' >> "$CONFIG_STATUS"
Steve Kondikae271bc2015-11-15 02:50:53 +010024767
micky3879b9f5e72025-07-08 18:04:53 -040024768cat >>"$CONFIG_STATUS" <<\EOF
Steve Kondikae271bc2015-11-15 02:50:53 +010024769 # Let's still pretend it is `configure' which instantiates (i.e., don't
24770 # use $as_me), people would be surprised to read:
24771 # /* config.h. Generated automatically by config.status. */
24772 if test x"$ac_file" = x-; then
micky3879b9f5e72025-07-08 18:04:53 -040024773 echo "/* Generated automatically by configure. */" >"$tmp"/config.h
Steve Kondikae271bc2015-11-15 02:50:53 +010024774 else
micky3879b9f5e72025-07-08 18:04:53 -040024775 echo "/* $ac_file. Generated automatically by configure. */" >"$tmp"/config.h
Steve Kondikae271bc2015-11-15 02:50:53 +010024776 fi
micky3879b9f5e72025-07-08 18:04:53 -040024777 cat "$tmp"/in >>"$tmp"/config.h
24778 rm -f "$tmp"/in
Steve Kondikae271bc2015-11-15 02:50:53 +010024779 if test x"$ac_file" != x-; then
micky3879b9f5e72025-07-08 18:04:53 -040024780 if cmp -s "$ac_file" "$tmp/config.h" 2>/dev/null; then
24781 { echo "$as_me:24781: $ac_file is unchanged" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010024782echo "$as_me: $ac_file is unchanged" >&6;}
24783 else
24784 ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
24785 X"$ac_file" : 'X\(//\)[^/]' \| \
24786 X"$ac_file" : 'X\(//\)$' \| \
24787 X"$ac_file" : 'X\(/\)' \| \
24788 . : '\(.\)' 2>/dev/null ||
24789echo X"$ac_file" |
24790 sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
24791 /^X\(\/\/\)[^/].*/{ s//\1/; q; }
24792 /^X\(\/\/\)$/{ s//\1/; q; }
24793 /^X\(\/\).*/{ s//\1/; q; }
24794 s/.*/./; q'`
24795 if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
24796 { case "$ac_dir" in
24797 [\\/]* | ?:[\\/]* ) as_incr_dir=;;
24798 *) as_incr_dir=.;;
24799esac
24800as_dummy="$ac_dir"
24801for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
24802 case $as_mkdir_dir in
24803 # Skip DOS drivespec
24804 ?:) as_incr_dir=$as_mkdir_dir ;;
24805 *)
24806 as_incr_dir=$as_incr_dir/$as_mkdir_dir
24807 test -d "$as_incr_dir" || mkdir "$as_incr_dir"
24808 ;;
24809 esac
24810done; }
24811
24812 fi
micky3879b9f5e72025-07-08 18:04:53 -040024813 rm -f "$ac_file"
24814 mv "$tmp/config.h" "$ac_file"
Steve Kondikae271bc2015-11-15 02:50:53 +010024815 fi
24816 else
micky3879b9f5e72025-07-08 18:04:53 -040024817 cat "$tmp"/config.h
24818 rm -f "$tmp"/config.h
Steve Kondikae271bc2015-11-15 02:50:53 +010024819 fi
24820done
24821EOF
micky3879b9f5e72025-07-08 18:04:53 -040024822cat >>"$CONFIG_STATUS" <<\EOF
Steve Kondikae271bc2015-11-15 02:50:53 +010024823#
24824# CONFIG_COMMANDS section.
24825#
24826for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue
24827 ac_dest=`echo "$ac_file" | sed 's,:.*,,'`
24828 ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'`
24829
micky3879b9f5e72025-07-08 18:04:53 -040024830 case "$ac_dest" in
Steve Kondikae271bc2015-11-15 02:50:53 +010024831 default )
24832
24833for cf_dir in .
24834do
micky3879b9f5e72025-07-08 18:04:53 -040024835 if test ! -d "$srcdir/$cf_dir" ; then
Steve Kondikae271bc2015-11-15 02:50:53 +010024836 continue
micky3879b9f5e72025-07-08 18:04:53 -040024837 elif test -f "$srcdir/$cf_dir/programs" ; then
24838 $AWK -f $srcdir/mk-test.awk INSTALL=yes ECHO_LINK="$ECHO_LD" "$srcdir/$cf_dir/programs" >>$cf_dir/Makefile
Steve Kondikae271bc2015-11-15 02:50:53 +010024839 fi
24840done
24841
24842 cat >>Makefile <<TEST_EOF
24843
24844# These rules are generated so we do not rely on suffix rules, which do not
24845# work consistently for different make-programs (the '\$(MODEL)/' confuses
24846# some, and the '\$x' confuses others).
24847TEST_EOF
24848
24849LIST=`sed -e 's/[ ].*//' -e '/^[#@]/d' $srcdir/modules`
24850for N in $LIST
24851do
24852 cat >>Makefile <<TEST_EOF
24853
24854\$(MODEL)/$N.o : \$(srcdir)/$N.c \\
24855 \$(srcdir)/test.priv.h \\
24856 ncurses_cfg.h
24857 $SHOW_CC
micky3879b9f5e72025-07-08 18:04:53 -040024858 $ECHO_CC\$(CC) -c \$(CFLAGS_DEFAULT) -DMODULE_NAME="$N" \$(srcdir)/$N.c
Steve Kondikae271bc2015-11-15 02:50:53 +010024859TEST_EOF
24860done
24861
24862if test -f ../config.guess && test -f ../config.sub
24863then
24864 cat >>Makefile <<TEST_EOF
24865
24866# if we used CF_INHERIT for getting these files, we can remove them
24867distclean::
24868 rm -f config.guess config.sub
24869TEST_EOF
24870fi
24871 ;;
24872 esac
24873done
24874EOF
24875
micky3879b9f5e72025-07-08 18:04:53 -040024876cat >>"$CONFIG_STATUS" <<\EOF
Steve Kondikae271bc2015-11-15 02:50:53 +010024877
24878{ (exit 0); exit 0; }
24879EOF
micky3879b9f5e72025-07-08 18:04:53 -040024880chmod +x "$CONFIG_STATUS"
Steve Kondikae271bc2015-11-15 02:50:53 +010024881ac_clean_files=$ac_clean_files_save
24882
24883# configure is writing to config.log, and then calls config.status.
24884# config.status does its own redirection, appending to config.log.
24885# Unfortunately, on DOS this fails, as config.log is still kept open
24886# by configure, so config.status won't be able to write to it; its
24887# output is simply discarded. So we exec the FD to /dev/null,
24888# effectively closing config.log, so it can be properly (re)opened and
24889# appended to by config.status. When coming back to configure, we
24890# need to make the FD available again.
24891if test "$no_create" != yes; then
24892 ac_cs_success=:
24893 exec 5>/dev/null
micky3879b9f5e72025-07-08 18:04:53 -040024894 $SHELL "$CONFIG_STATUS" || ac_cs_success=false
Steve Kondikae271bc2015-11-15 02:50:53 +010024895 exec 5>>config.log
24896 # Use ||, not &&, to avoid exiting from the if with $? = 1, which
24897 # would make configure fail if this is the last instruction.
micky3879b9f5e72025-07-08 18:04:53 -040024898 "$ac_cs_success" || { (exit 1); exit 1; }
Steve Kondikae271bc2015-11-15 02:50:53 +010024899fi
24900