blob: 8c01a2936cdca5ca6f7ca6c0cc3d9365d72ff836 [file] [log] [blame]
Steve Kondikae271bc2015-11-15 02:50:53 +01001#! /bin/sh
micky3879b9f5e72025-07-08 18:04:53 -04002# From configure.in Revision: 1.91 .
Steve Kondikae271bc2015-11-15 02:50:53 +01003# Guess values for system-dependent variables and create Makefiles.
micky3879b9f5e72025-07-08 18:04:53 -04004# Generated by Autoconf 2.52.20231210.
Steve Kondikae271bc2015-11-15 02:50:53 +01005#
micky3879b9f5e72025-07-08 18:04:53 -04006# Copyright 2003-2022,2023 Thomas E. Dickey
Steve Kondikae271bc2015-11-15 02:50:53 +01007# Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
8# Free Software Foundation, Inc.
9# This configure script is free software; the Free Software Foundation
10# gives unlimited permission to copy, distribute and modify it.
11
12# Avoid depending upon Character Ranges.
13as_cr_letters='abcdefghijklmnopqrstuvwxyz'
14as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
15as_cr_Letters=$as_cr_letters$as_cr_LETTERS
16as_cr_digits='0123456789'
17as_cr_alnum=$as_cr_Letters$as_cr_digits
18
19# Sed expression to map a string onto a valid variable name.
20as_tr_sh="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g"
21
22# Sed expression to map a string onto a valid CPP name.
23as_tr_cpp="sed y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g"
24
25# Be Bourne compatible
26if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
27 emulate sh
28 NULLCMD=:
29elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
30 set -o posix
31fi
32
33# Name of the executable.
34as_me=`echo "$0" |sed 's,.*[\\/],,'`
35
36if expr a : '\(a\)' >/dev/null 2>&1; then
micky3879b9f5e72025-07-08 18:04:53 -040037 as_expr="expr"
Steve Kondikae271bc2015-11-15 02:50:53 +010038else
micky3879b9f5e72025-07-08 18:04:53 -040039 as_expr="false"
Steve Kondikae271bc2015-11-15 02:50:53 +010040fi
41
42rm -f conf$$ conf$$.exe conf$$.file
43echo >conf$$.file
44if ln -s conf$$.file conf$$ 2>/dev/null; then
45 # We could just check for DJGPP; but this test a) works b) is more generic
46 # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
47 if test -f conf$$.exe; then
48 # Don't use ln at all; we don't have any links
49 as_ln_s='cp -p'
50 else
51 as_ln_s='ln -s'
52 fi
53elif ln conf$$.file conf$$ 2>/dev/null; then
micky3879b9f5e72025-07-08 18:04:53 -040054 as_ln_s='ln'
Steve Kondikae271bc2015-11-15 02:50:53 +010055else
56 as_ln_s='cp -p'
57fi
58rm -f conf$$ conf$$.exe conf$$.file
59
60as_executable_p="test -f"
61
62# Support unset when possible.
63if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
micky3879b9f5e72025-07-08 18:04:53 -040064 as_unset="unset"
Steve Kondikae271bc2015-11-15 02:50:53 +010065else
micky3879b9f5e72025-07-08 18:04:53 -040066 as_unset="false"
Steve Kondikae271bc2015-11-15 02:50:53 +010067fi
68
69# NLS nuisances.
70$as_unset LANG || test "${LANG+set}" != set || { LANG=C; export LANG; }
71$as_unset LC_ALL || test "${LC_ALL+set}" != set || { LC_ALL=C; export LC_ALL; }
72$as_unset LC_TIME || test "${LC_TIME+set}" != set || { LC_TIME=C; export LC_TIME; }
73$as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set || { LC_CTYPE=C; export LC_CTYPE; }
74$as_unset LANGUAGE || test "${LANGUAGE+set}" != set || { LANGUAGE=C; export LANGUAGE; }
75$as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set || { LC_COLLATE=C; export LC_COLLATE; }
76$as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set || { LC_NUMERIC=C; export LC_NUMERIC; }
77$as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set || { LC_MESSAGES=C; export LC_MESSAGES; }
78
79# IFS
80# We need space, tab and new line, in precisely that order.
81as_nl='
82'
83IFS=" $as_nl"
84
85# CDPATH.
86$as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=:; export CDPATH; }
87
88# Name of the host.
89# hostname on some systems (SVR3.2, Linux) returns a bogus exit status,
90# so uname gets run too.
91ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
92
93exec 6>&1
94
95#
96# Initializations.
97#
98ac_default_prefix=/usr/local
99cross_compiling=no
100subdirs=
micky3879b9f5e72025-07-08 18:04:53 -0400101MFLAGS=
102MAKEFLAGS=
Steve Kondikae271bc2015-11-15 02:50:53 +0100103SHELL=${CONFIG_SHELL-/bin/sh}
104
105# Maximum number of lines to put in a shell here document.
106# This variable seems obsolete. It should probably be removed, and
107# only ac_max_sed_lines should be used.
micky3879b9f5e72025-07-08 18:04:53 -0400108: "${ac_max_here_lines=38}"
Steve Kondikae271bc2015-11-15 02:50:53 +0100109
110ac_unique_file="gen/gen.c"
micky3879b9f5e72025-07-08 18:04:53 -0400111# Factoring default headers for most tests.
112ac_includes_default="\
113#include <stdio.h>
114#if HAVE_SYS_TYPES_H
115# include <sys/types.h>
116#endif
117#if HAVE_SYS_STAT_H
118# include <sys/stat.h>
119#endif
120#if STDC_HEADERS
121# include <stdlib.h>
122# include <stddef.h>
123#else
124# if HAVE_STDLIB_H
125# include <stdlib.h>
126# endif
127#endif
128#if HAVE_STRING_H
129# if !STDC_HEADERS && HAVE_MEMORY_H
130# include <memory.h>
131# endif
132# include <string.h>
133#endif
134#if HAVE_STRINGS_H
135# include <strings.h>
136#endif
137#if HAVE_INTTYPES_H
138# include <inttypes.h>
139#else
140# if HAVE_STDINT_H
141# include <stdint.h>
142# endif
143#endif
144#if HAVE_UNISTD_H
145# include <unistd.h>
146#endif"
Steve Kondikae271bc2015-11-15 02:50:53 +0100147
148# Initialize some variables set by options.
149ac_init_help=
150ac_init_version=false
151# The variables have the same names as the options, with
152# dashes changed to underlines.
153cache_file=/dev/null
154exec_prefix=NONE
155no_create=
156no_recursion=
157prefix=NONE
158program_prefix=NONE
159program_suffix=NONE
160program_transform_name=s,x,x,
161silent=
162site=
163srcdir=
164verbose=
165x_includes=NONE
166x_libraries=NONE
167
168# Installation directory options.
169# These are left unexpanded so users can "make install exec_prefix=/foo"
170# and all the variables that are supposed to be based on exec_prefix
171# by default will actually change.
172# Use braces instead of parens because sh, perl, etc. also accept them.
173bindir='${exec_prefix}/bin'
174sbindir='${exec_prefix}/sbin'
175libexecdir='${exec_prefix}/libexec'
176datarootdir='${prefix}/share'
177datadir='${datarootdir}'
178sysconfdir='${prefix}/etc'
179sharedstatedir='${prefix}/com'
180localstatedir='${prefix}/var'
micky3879b9f5e72025-07-08 18:04:53 -0400181runstatedir='${localstatedir}/run'
Steve Kondikae271bc2015-11-15 02:50:53 +0100182libdir='${exec_prefix}/lib'
183includedir='${prefix}/include'
184oldincludedir='/usr/include'
185infodir='${datarootdir}/info'
186mandir='${datarootdir}/man'
187
188# Identity of this package.
189PACKAGE_NAME=
190PACKAGE_TARNAME=
191PACKAGE_VERSION=
192PACKAGE_STRING=
193PACKAGE_BUGREPORT=
194
195ac_prev=
196for ac_option
197do
198 # If the previous option needs an argument, assign it.
199 if test -n "$ac_prev"; then
200 eval "$ac_prev=\$ac_option"
201 ac_prev=
202 continue
203 fi
204
205 ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'`
206
207 # Accept the important Cygnus configure options, so we can diagnose typos.
208
micky3879b9f5e72025-07-08 18:04:53 -0400209 case "$ac_option" in
Steve Kondikae271bc2015-11-15 02:50:53 +0100210
211 -bindir | --bindir | --bindi | --bind | --bin | --bi)
212 ac_prev=bindir ;;
213 -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
214 bindir=$ac_optarg ;;
215
216 -build | --build | --buil | --bui | --bu)
217 ac_prev=build_alias ;;
218 -build=* | --build=* | --buil=* | --bui=* | --bu=*)
219 build_alias=$ac_optarg ;;
220
221 -cache-file | --cache-file | --cache-fil | --cache-fi \
222 | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
223 ac_prev=cache_file ;;
224 -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
225 | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
226 cache_file=$ac_optarg ;;
227
228 --config-cache | -C)
229 cache_file=config.cache ;;
230
231 -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
232 ac_prev=datadir ;;
233 -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
234 | --da=*)
235 datadir=$ac_optarg ;;
236
237 -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \
238 | --dataroo | --dataro | --datar)
239 ac_prev=datarootdir ;;
240 -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \
241 | --dataroot=* | --dataroo=* | --dataro=* | --datar=*)
242 datarootdir=$ac_optarg ;;
243
244 -disable-* | --disable-*)
245 ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
246 # Reject names that are not valid shell variable names.
247 expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
248 { echo "$as_me: error: invalid feature name: $ac_feature" >&2
249 { (exit 1); exit 1; }; }
micky3879b9f5e72025-07-08 18:04:53 -0400250 ac_feature=`echo "$ac_feature" | sed 's/-/_/g'`
Steve Kondikae271bc2015-11-15 02:50:53 +0100251 eval "enable_$ac_feature=no" ;;
252
253 -enable-* | --enable-*)
254 ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
255 # Reject names that are not valid shell variable names.
256 expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
257 { echo "$as_me: error: invalid feature name: $ac_feature" >&2
258 { (exit 1); exit 1; }; }
micky3879b9f5e72025-07-08 18:04:53 -0400259 ac_feature=`echo "$ac_feature" | sed 's/-/_/g'`
260 case "$ac_option" in
Steve Kondikae271bc2015-11-15 02:50:53 +0100261 *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
262 *) ac_optarg=yes ;;
263 esac
264 eval "enable_$ac_feature='$ac_optarg'" ;;
265
266 -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
267 | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
268 | --exec | --exe | --ex)
269 ac_prev=exec_prefix ;;
270 -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
271 | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
272 | --exec=* | --exe=* | --ex=*)
273 exec_prefix=$ac_optarg ;;
274
275 -gas | --gas | --ga | --g)
276 # Obsolete; use --with-gas.
277 with_gas=yes ;;
278
279 -help | --help | --hel | --he | -h)
280 ac_init_help=long ;;
281 -help=r* | --help=r* | --hel=r* | --he=r* | -hr*)
282 ac_init_help=recursive ;;
283 -help=s* | --help=s* | --hel=s* | --he=s* | -hs*)
284 ac_init_help=short ;;
285
286 -host | --host | --hos | --ho)
287 ac_prev=host_alias ;;
288 -host=* | --host=* | --hos=* | --ho=*)
289 host_alias=$ac_optarg ;;
290
291 -includedir | --includedir | --includedi | --included | --include \
292 | --includ | --inclu | --incl | --inc)
293 ac_prev=includedir ;;
294 -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
295 | --includ=* | --inclu=* | --incl=* | --inc=*)
296 includedir=$ac_optarg ;;
297
298 -infodir | --infodir | --infodi | --infod | --info | --inf)
299 ac_prev=infodir ;;
300 -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
301 infodir=$ac_optarg ;;
302
303 -libdir | --libdir | --libdi | --libd)
304 ac_prev=libdir ;;
305 -libdir=* | --libdir=* | --libdi=* | --libd=*)
306 libdir=$ac_optarg ;;
307
308 -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
309 | --libexe | --libex | --libe)
310 ac_prev=libexecdir ;;
311 -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
312 | --libexe=* | --libex=* | --libe=*)
313 libexecdir=$ac_optarg ;;
314
315 -localstatedir | --localstatedir | --localstatedi | --localstated \
316 | --localstate | --localstat | --localsta | --localst \
317 | --locals | --local | --loca | --loc | --lo)
318 ac_prev=localstatedir ;;
319 -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
320 | --localstate=* | --localstat=* | --localsta=* | --localst=* \
321 | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
322 localstatedir=$ac_optarg ;;
323
micky3879b9f5e72025-07-08 18:04:53 -0400324 -runstatedir | --runstatedir | --runstatedi | --runstated \
325 | --runstate | --runstat | --runsta | --runst \
326 | --runs | --run | --ru)
327 ac_prev=runstatedir ;;
328 -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \
329 | --runstate=* | --runstat=* | --runsta=* | --runst=* \
330 | --runs=* | --run=* | --ru=*)
331 runstatedir=$ac_optarg ;;
332
Steve Kondikae271bc2015-11-15 02:50:53 +0100333 -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
334 ac_prev=mandir ;;
335 -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
336 mandir=$ac_optarg ;;
337
338 -nfp | --nfp | --nf)
339 # Obsolete; use --without-fp.
340 with_fp=no ;;
341
342 -no-create | --no-create | --no-creat | --no-crea | --no-cre \
343 | --no-cr | --no-c)
344 no_create=yes ;;
345
346 -no-recursion | --no-recursion | --no-recursio | --no-recursi \
347 | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
348 no_recursion=yes ;;
349
350 -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
351 | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
352 | --oldin | --oldi | --old | --ol | --o)
353 ac_prev=oldincludedir ;;
354 -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
355 | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
356 | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
357 oldincludedir=$ac_optarg ;;
358
359 -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
360 ac_prev=prefix ;;
361 -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
362 prefix=$ac_optarg ;;
363
364 -program-prefix | --program-prefix | --program-prefi | --program-pref \
365 | --program-pre | --program-pr | --program-p)
366 ac_prev=program_prefix ;;
367 -program-prefix=* | --program-prefix=* | --program-prefi=* \
368 | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
369 program_prefix=$ac_optarg ;;
370
371 -program-suffix | --program-suffix | --program-suffi | --program-suff \
372 | --program-suf | --program-su | --program-s)
373 ac_prev=program_suffix ;;
374 -program-suffix=* | --program-suffix=* | --program-suffi=* \
375 | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
376 program_suffix=$ac_optarg ;;
377
378 -program-transform-name | --program-transform-name \
379 | --program-transform-nam | --program-transform-na \
380 | --program-transform-n | --program-transform- \
381 | --program-transform | --program-transfor \
382 | --program-transfo | --program-transf \
383 | --program-trans | --program-tran \
384 | --progr-tra | --program-tr | --program-t)
385 ac_prev=program_transform_name ;;
386 -program-transform-name=* | --program-transform-name=* \
387 | --program-transform-nam=* | --program-transform-na=* \
388 | --program-transform-n=* | --program-transform-=* \
389 | --program-transform=* | --program-transfor=* \
390 | --program-transfo=* | --program-transf=* \
391 | --program-trans=* | --program-tran=* \
392 | --progr-tra=* | --program-tr=* | --program-t=*)
393 program_transform_name=$ac_optarg ;;
394
395 -q | -quiet | --quiet | --quie | --qui | --qu | --q \
396 | -silent | --silent | --silen | --sile | --sil)
397 silent=yes ;;
398
399 -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
400 ac_prev=sbindir ;;
401 -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
402 | --sbi=* | --sb=*)
403 sbindir=$ac_optarg ;;
404
405 -sharedstatedir | --sharedstatedir | --sharedstatedi \
406 | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
407 | --sharedst | --shareds | --shared | --share | --shar \
408 | --sha | --sh)
409 ac_prev=sharedstatedir ;;
410 -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
411 | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
412 | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
413 | --sha=* | --sh=*)
414 sharedstatedir=$ac_optarg ;;
415
416 -site | --site | --sit)
417 ac_prev=site ;;
418 -site=* | --site=* | --sit=*)
419 site=$ac_optarg ;;
420
421 -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
422 ac_prev=srcdir ;;
423 -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
424 srcdir=$ac_optarg ;;
425
426 -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
427 | --syscon | --sysco | --sysc | --sys | --sy)
428 ac_prev=sysconfdir ;;
429 -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
430 | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
431 sysconfdir=$ac_optarg ;;
432
433 -target | --target | --targe | --targ | --tar | --ta | --t)
434 ac_prev=target_alias ;;
435 -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
436 target_alias=$ac_optarg ;;
437
438 -v | -verbose | --verbose | --verbos | --verbo | --verb)
439 verbose=yes ;;
440
441 -version | --version | --versio | --versi | --vers | -V)
442 ac_init_version=: ;;
443
444 -with-* | --with-*)
445 ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
446 # Reject names that are not valid shell variable names.
447 expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
448 { echo "$as_me: error: invalid package name: $ac_package" >&2
449 { (exit 1); exit 1; }; }
micky3879b9f5e72025-07-08 18:04:53 -0400450 ac_package=`echo "$ac_package" | sed 's/-/_/g'`
451 case "$ac_option" in
Steve Kondikae271bc2015-11-15 02:50:53 +0100452 *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
453 *) ac_optarg=yes ;;
454 esac
455 eval "with_$ac_package='$ac_optarg'" ;;
456
457 -without-* | --without-*)
458 ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'`
459 # Reject names that are not valid shell variable names.
460 expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
461 { echo "$as_me: error: invalid package name: $ac_package" >&2
462 { (exit 1); exit 1; }; }
micky3879b9f5e72025-07-08 18:04:53 -0400463 ac_package=`echo "$ac_package" | sed 's/-/_/g'`
Steve Kondikae271bc2015-11-15 02:50:53 +0100464 eval "with_$ac_package=no" ;;
465
466 --x)
467 # Obsolete; use --with-x.
468 with_x=yes ;;
469
470 -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
471 | --x-incl | --x-inc | --x-in | --x-i)
472 ac_prev=x_includes ;;
473 -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
474 | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
475 x_includes=$ac_optarg ;;
476
477 -x-libraries | --x-libraries | --x-librarie | --x-librari \
478 | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
479 ac_prev=x_libraries ;;
480 -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
481 | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
482 x_libraries=$ac_optarg ;;
483
484 -*) { echo "$as_me: error: unrecognized option: $ac_option
485Try \`$0 --help' for more information." >&2
486 { (exit 1); exit 1; }; }
487 ;;
488
489 *=*)
490 ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
491 # Reject names that are not valid shell variable names.
492 expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null &&
493 { echo "$as_me: error: invalid variable name: $ac_envvar" >&2
494 { (exit 1); exit 1; }; }
495 ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`
496 eval "$ac_envvar='$ac_optarg'"
micky3879b9f5e72025-07-08 18:04:53 -0400497 export "$ac_envvar" ;;
Steve Kondikae271bc2015-11-15 02:50:53 +0100498
499 *)
500 # FIXME: should be removed in autoconf 3.0.
501 echo "$as_me: WARNING: you should use --build, --host, --target" >&2
502 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
503 echo "$as_me: WARNING: invalid host type: $ac_option" >&2
micky3879b9f5e72025-07-08 18:04:53 -0400504 : "${build_alias=$ac_option}" "${host_alias=$ac_option}" "${target_alias=$ac_option}"
Steve Kondikae271bc2015-11-15 02:50:53 +0100505 ;;
506
507 esac
508done
509
510if test -n "$ac_prev"; then
micky3879b9f5e72025-07-08 18:04:53 -0400511 ac_option=--`echo "$ac_prev" | sed 's/_/-/g'`
Steve Kondikae271bc2015-11-15 02:50:53 +0100512 { echo "$as_me: error: missing argument to $ac_option" >&2
513 { (exit 1); exit 1; }; }
514fi
515
516# Be sure to have absolute paths.
517for ac_var in exec_prefix prefix
518do
micky3879b9f5e72025-07-08 18:04:53 -0400519 eval ac_val=$`echo "$ac_var"`
520 case "$ac_val" in
Steve Kondikae271bc2015-11-15 02:50:53 +0100521 [\\/$]* | ?:[\\/]* | NONE | '' ) ;;
522 *) { echo "$as_me: error: expected an absolute path for --$ac_var: $ac_val" >&2
523 { (exit 1); exit 1; }; };;
524 esac
525done
526
527# Be sure to have absolute paths.
528for ac_var in bindir sbindir libexecdir datarootdir datadir sysconfdir sharedstatedir \
529 localstatedir libdir includedir oldincludedir infodir mandir
530do
micky3879b9f5e72025-07-08 18:04:53 -0400531 eval ac_val=$`echo "$ac_var"`
532 case "$ac_val" in
Steve Kondikae271bc2015-11-15 02:50:53 +0100533 [\\/$]* | ?:[\\/]* ) ;;
534 *) { echo "$as_me: error: expected an absolute path for --$ac_var: $ac_val" >&2
535 { (exit 1); exit 1; }; };;
536 esac
537done
538
539# There might be people who depend on the old broken behavior: `$host'
540# used to hold the argument of --host etc.
541build=$build_alias
542host=$host_alias
543target=$target_alias
544
545# FIXME: should be removed in autoconf 3.0.
546if test "x$host_alias" != x; then
547 if test "x$build_alias" = x; then
548 cross_compiling=maybe
549 echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host.
550 If a cross compiler is detected then cross compile mode will be used." >&2
551 elif test "x$build_alias" != "x$host_alias"; then
552 cross_compiling=yes
553 fi
554fi
555
556ac_tool_prefix=
557test -n "$host_alias" && ac_tool_prefix=$host_alias-
558
559test "$silent" = yes && exec 6>/dev/null
560
561# Find the source files, if location was not specified.
562if test -z "$srcdir"; then
563 ac_srcdir_defaulted=yes
564 # Try the directory containing this script, then its parent.
565 ac_prog=$0
566 ac_confdir=`echo "$ac_prog" | sed 's%[\\/][^\\/][^\\/]*$%%'`
567 test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
568 srcdir=$ac_confdir
micky3879b9f5e72025-07-08 18:04:53 -0400569 if test ! -r "$srcdir/$ac_unique_file"; then
Steve Kondikae271bc2015-11-15 02:50:53 +0100570 srcdir=..
571 fi
572else
573 ac_srcdir_defaulted=no
574fi
micky3879b9f5e72025-07-08 18:04:53 -0400575if test ! -r "$srcdir/$ac_unique_file"; then
Steve Kondikae271bc2015-11-15 02:50:53 +0100576 if test "$ac_srcdir_defaulted" = yes; then
577 { echo "$as_me: error: cannot find sources in $ac_confdir or .." >&2
578 { (exit 1); exit 1; }; }
579 else
580 { echo "$as_me: error: cannot find sources in $srcdir" >&2
581 { (exit 1); exit 1; }; }
582 fi
583fi
584srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'`
585ac_env_build_alias_set=${build_alias+set}
586ac_env_build_alias_value=$build_alias
587ac_cv_env_build_alias_set=${build_alias+set}
588ac_cv_env_build_alias_value=$build_alias
589ac_env_host_alias_set=${host_alias+set}
590ac_env_host_alias_value=$host_alias
591ac_cv_env_host_alias_set=${host_alias+set}
592ac_cv_env_host_alias_value=$host_alias
593ac_env_target_alias_set=${target_alias+set}
594ac_env_target_alias_value=$target_alias
595ac_cv_env_target_alias_set=${target_alias+set}
596ac_cv_env_target_alias_value=$target_alias
597ac_env_CC_set=${CC+set}
598ac_env_CC_value=$CC
599ac_cv_env_CC_set=${CC+set}
600ac_cv_env_CC_value=$CC
601ac_env_CFLAGS_set=${CFLAGS+set}
602ac_env_CFLAGS_value=$CFLAGS
603ac_cv_env_CFLAGS_set=${CFLAGS+set}
604ac_cv_env_CFLAGS_value=$CFLAGS
605ac_env_LDFLAGS_set=${LDFLAGS+set}
606ac_env_LDFLAGS_value=$LDFLAGS
607ac_cv_env_LDFLAGS_set=${LDFLAGS+set}
608ac_cv_env_LDFLAGS_value=$LDFLAGS
609ac_env_CPPFLAGS_set=${CPPFLAGS+set}
610ac_env_CPPFLAGS_value=$CPPFLAGS
611ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set}
612ac_cv_env_CPPFLAGS_value=$CPPFLAGS
613ac_env_CPP_set=${CPP+set}
614ac_env_CPP_value=$CPP
615ac_cv_env_CPP_set=${CPP+set}
616ac_cv_env_CPP_value=$CPP
617
618#
619# Report the --help message.
620#
621if test "$ac_init_help" = "long"; then
622 # Omit some internal or obsolete options to make the list less imposing.
623 # This message is too long to be a string in the A/UX 3.1 sh.
624 cat <<EOF
625\`configure' configures this package to adapt to many kinds of systems.
626
627Usage: $0 [OPTION]... [VAR=VALUE]...
628
629To assign environment variables (e.g., CC, CFLAGS...), specify them as
630VAR=VALUE. See below for descriptions of some of the useful variables.
631
632Defaults for the options are specified in brackets.
633
634Configuration:
635 -h, --help display this help and exit
636 --help=short display options specific to this package
637 --help=recursive display the short help of all the included packages
638 -V, --version display version information and exit
639 -q, --quiet, --silent do not print \`checking...' messages
640 --cache-file=FILE cache test results in FILE [disabled]
641 -C, --config-cache alias for \`--cache-file=config.cache'
642 -n, --no-create do not create output files
643 --srcdir=DIR find the sources in DIR [configure dir or \`..']
644
645EOF
646
647 cat <<EOF
648Installation directories:
649 --prefix=PREFIX install architecture-independent files in PREFIX
650 [$ac_default_prefix]
651 --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX
652 [PREFIX]
653
654By default, \`make install' will install all the files in
655\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify
656an installation prefix other than \`$ac_default_prefix' using \`--prefix',
657for instance \`--prefix=\$HOME'.
658
659For better control, use the options below.
660
661Fine tuning of the installation directories:
662 --bindir=DIR user executables [EPREFIX/bin]
663 --sbindir=DIR system admin executables [EPREFIX/sbin]
664 --libexecdir=DIR program executables [EPREFIX/libexec]
665 --datarootdir=DIR read-only architecture-independent data [PREFIX/share]
666 --datadir=DIR read-only architecture-independent data [DATAROOTDIR]
667 --sysconfdir=DIR read-only single-machine data [PREFIX/etc]
668 --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
669 --localstatedir=DIR modifiable single-machine data [PREFIX/var]
micky3879b9f5e72025-07-08 18:04:53 -0400670 --runstatedir=DIR extra definition of runtime data [LOCALSTATEDIR/run]
Steve Kondikae271bc2015-11-15 02:50:53 +0100671 --libdir=DIR object code libraries [EPREFIX/lib]
672 --includedir=DIR C header files [PREFIX/include]
673 --oldincludedir=DIR C header files for non-gcc [/usr/include]
674 --infodir=DIR info documentation [DATAROOTDIR/info]
675 --mandir=DIR man documentation [DATAROOTDIR/man]
676EOF
677
678 cat <<\EOF
679
680Program names:
681 --program-prefix=PREFIX prepend PREFIX to installed program names
682 --program-suffix=SUFFIX append SUFFIX to installed program names
683 --program-transform-name=PROGRAM run sed PROGRAM on installed program names
684
685System types:
686 --build=BUILD configure for building on BUILD [guessed]
687 --host=HOST build programs to run on HOST [BUILD]
688 --target=TARGET configure for building compilers for TARGET [HOST]
689EOF
690fi
691
692if test -n "$ac_init_help"; then
693
694 cat <<\EOF
695
696Optional Packages:
697 --with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
698 --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
699
700Optional Features:
701 --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
702 --enable-FEATURE[=ARG] include FEATURE [ARG=yes]
703
micky3879b9f5e72025-07-08 18:04:53 -0400704General Options:
Steve Kondikae271bc2015-11-15 02:50:53 +0100705 --with-system-type=XXX test: override derived host system-type
micky3879b9f5e72025-07-08 18:04:53 -0400706 --disable-stripping do not strip (debug info) installed executables
707 --with-strip-program=XX specify program to use when stripping in install
708 --with-pkg-config[=CMD] enable/disable use of pkg-config and its name CMD
709 --with-pkg-config-libdir[=XXX] use given directory for installing pc-files
Steve Kondikae271bc2015-11-15 02:50:53 +0100710 --without-tests suppress build with test-programs
711 --enable-mixed-case tic should assume mixed-case filenames
712 --with-install-prefix prefixes actual install-location ($DESTDIR)
713Build-Tools Needed to Compile Temporary Applications for Cross-compiling:
714 --with-build-cc=XXX the build C compiler ($BUILD_CC)
715 --with-build-cpp=XXX the build C preprocessor ($BUILD_CPP)
716 --with-build-cflags=XXX the build C compiler-flags ($BUILD_CFLAGS)
717 --with-build-cppflags=XXX the build C preprocessor-flags ($BUILD_CPPFLAGS)
718 --with-build-ldflags=XXX the build linker-flags ($BUILD_LDFLAGS)
719 --with-build-libs=XXX the build libraries (${BUILD_LIBS})
720Options to Specify the Libraries Built/Used:
721 --with-shared generate shared C-objects (needed for --with-ada-sharedlib)
722 --with-curses-dir=DIR directory in which (n)curses is installed
723 --enable-widec compile with wide-char/UTF-8 code
724 --with-lib-prefix override library-prefix
micky3879b9f5e72025-07-08 18:04:53 -0400725 --with-shlib-version[={rel|abi}] use release or ABI version in shared library file names
Steve Kondikae271bc2015-11-15 02:50:53 +0100726 --enable-rpath-link link sample programs with rpath option
727Fine-Tuning Your Configuration:
728 --enable-broken_linker compile with broken-linker support code
729 --disable-largefile omit support for large files
730 --with-rcs-ids compile-in RCS identifiers
731Extensions:
732 --disable-ext-funcs disable function-extensions
733 --enable-const compile with extra/non-standard const
734Development Code:
735 --without-develop disable development options
736Experimental Code:
737 --with-pthread use POSIX thread library
738 --enable-weak-symbols enable weak-symbols for pthreads
739 --enable-reentrant compile with experimental reentrant code
740 --with-wrap-prefix=XXX override prefix used for public variables
741Testing/development Options:
742 --disable-echo do not display "compiling" commands
micky3879b9f5e72025-07-08 18:04:53 -0400743 --enable-warnings test: turn on gcc compiler warnings
744 --enable-stdnoreturn enable C11 _Noreturn feature for diagnostics
Steve Kondikae271bc2015-11-15 02:50:53 +0100745 --enable-assertions test: turn on generation of assertion code
746 --enable-expanded test: generate functions for certain macros
747 --disable-macros test: use functions rather than macros
748 --with-trace test: add trace() function to all models of ncurses
749 --disable-gnat-projects test: disable GNAT projects even if usable
750Ada95 Binding Options:
micky3879b9f5e72025-07-08 18:04:53 -0400751 --with-ada-compiler[=CMD] use CMD as Ada95 compiler (default: gnatmake)
752 --with-ada-include=DIR find Ada95 includes in DIR (default: PREFIX/share/ada/adainclude)
753 --with-ada-objects=DIR find Ada95 objects in DIR (default: PREFIX/lib/ada/adalib)
754 --with-ada-sharedlib build Ada95 shared library; requires GNAT project support
755 --with-ada-libname[=XXX] use XXX as Ada95 library name
Steve Kondikae271bc2015-11-15 02:50:53 +0100756
757Some influential environment variables:
758 CC C compiler command
759 CFLAGS C compiler flags
760 LDFLAGS linker flags, e.g. -L<lib dir> if you have libraries in a
761 nonstandard directory <lib dir>
762 CPPFLAGS C/C++ preprocessor flags, e.g. -I<include dir> if you have
763 headers in a nonstandard directory <include dir>
764 CPP C preprocessor
765
766Use these variables to override the choices made by `configure' or to help
767it to find libraries and programs with nonstandard names/locations.
768
769EOF
770fi
771
772if test "$ac_init_help" = "recursive"; then
773 # If there are subdirs, report their specific --help.
774 ac_popdir=`pwd`
775 for ac_subdir in : $ac_subdirs_all; do test "x$ac_subdir" = x: && continue
micky3879b9f5e72025-07-08 18:04:53 -0400776 cd "$ac_subdir"
Steve Kondikae271bc2015-11-15 02:50:53 +0100777 # A "../" for each directory in /$ac_subdir.
micky3879b9f5e72025-07-08 18:04:53 -0400778 ac_dots=`echo "$ac_subdir" |
Steve Kondikae271bc2015-11-15 02:50:53 +0100779 sed 's,^\./,,;s,[^/]$,&/,;s,[^/]*/,../,g'`
780
micky3879b9f5e72025-07-08 18:04:53 -0400781 case "$srcdir" in
Steve Kondikae271bc2015-11-15 02:50:53 +0100782 .) # No --srcdir option. We are building in place.
micky3879b9f5e72025-07-08 18:04:53 -0400783 ac_sub_srcdir="$srcdir" ;;
Steve Kondikae271bc2015-11-15 02:50:53 +0100784 [\\/]* | ?:[\\/]* ) # Absolute path.
micky3879b9f5e72025-07-08 18:04:53 -0400785 ac_sub_srcdir="$srcdir/$ac_subdir" ;;
Steve Kondikae271bc2015-11-15 02:50:53 +0100786 *) # Relative path.
micky3879b9f5e72025-07-08 18:04:53 -0400787 ac_sub_srcdir="$ac_dots$srcdir/$ac_subdir" ;;
Steve Kondikae271bc2015-11-15 02:50:53 +0100788 esac
789
790 # Check for guested configure; otherwise get Cygnus style configure.
micky3879b9f5e72025-07-08 18:04:53 -0400791 if test -f "$ac_sub_srcdir/configure.gnu"; then
Steve Kondikae271bc2015-11-15 02:50:53 +0100792 echo
micky3879b9f5e72025-07-08 18:04:53 -0400793 $SHELL "$ac_sub_srcdir/configure.gnu" --help=recursive
794 elif test -f "$ac_sub_srcdir/configure"; then
Steve Kondikae271bc2015-11-15 02:50:53 +0100795 echo
micky3879b9f5e72025-07-08 18:04:53 -0400796 $SHELL "$ac_sub_srcdir/configure" --help=recursive
797 elif test -f "$ac_sub_srcdir/configure.ac" ||
798 test -f "$ac_sub_srcdir/configure.in"; then
Steve Kondikae271bc2015-11-15 02:50:53 +0100799 echo
micky3879b9f5e72025-07-08 18:04:53 -0400800 "$ac_configure" --help
Steve Kondikae271bc2015-11-15 02:50:53 +0100801 else
802 echo "$as_me: WARNING: no configuration information is in $ac_subdir" >&2
803 fi
micky3879b9f5e72025-07-08 18:04:53 -0400804 cd "$ac_popdir"
Steve Kondikae271bc2015-11-15 02:50:53 +0100805 done
806fi
807
808test -n "$ac_init_help" && exit 0
micky3879b9f5e72025-07-08 18:04:53 -0400809if "$ac_init_version"; then
Steve Kondikae271bc2015-11-15 02:50:53 +0100810 cat <<\EOF
811
micky3879b9f5e72025-07-08 18:04:53 -0400812Copyright 2003-2022,2023 Thomas E. Dickey
Steve Kondikae271bc2015-11-15 02:50:53 +0100813Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
814Free Software Foundation, Inc.
815This configure script is free software; the Free Software Foundation
816gives unlimited permission to copy, distribute and modify it.
817EOF
818 exit 0
819fi
820exec 5>config.log
821cat >&5 <<EOF
822This file contains any messages produced by compilers while
823running configure, to aid debugging if configure makes a mistake.
824
825It was created by $as_me, which was
micky3879b9f5e72025-07-08 18:04:53 -0400826generated by GNU Autoconf 2.52.20231210. Invocation command line was
Steve Kondikae271bc2015-11-15 02:50:53 +0100827
828 $ $0 $@
829
830EOF
831{
832cat <<_ASUNAME
833## ---------- ##
834## Platform. ##
835## ---------- ##
836
837hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
838uname -m = `(uname -m) 2>/dev/null || echo unknown`
839uname -r = `(uname -r) 2>/dev/null || echo unknown`
840uname -s = `(uname -s) 2>/dev/null || echo unknown`
841uname -v = `(uname -v) 2>/dev/null || echo unknown`
842
843/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
844/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown`
845
846/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown`
847/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown`
848/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
849hostinfo = `(hostinfo) 2>/dev/null || echo unknown`
850/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown`
851/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown`
852/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown`
853
854PATH = $PATH
855
856_ASUNAME
857} >&5
858
859cat >&5 <<EOF
860## ------------ ##
861## Core tests. ##
862## ------------ ##
863
864EOF
865
866# Keep a trace of the command line.
867# Strip out --no-create and --no-recursion so they do not pile up.
868# Also quote any args containing shell meta-characters.
869ac_configure_args=
870ac_sep=
871for ac_arg
872do
micky3879b9f5e72025-07-08 18:04:53 -0400873 case "$ac_arg" in
Steve Kondikae271bc2015-11-15 02:50:53 +0100874 -no-create | --no-create | --no-creat | --no-crea | --no-cre \
875 | --no-cr | --no-c) ;;
876 -no-recursion | --no-recursion | --no-recursio | --no-recursi \
877 | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
878 *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
879 ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"`
880 ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'"
881 ac_sep=" " ;;
882 *) ac_configure_args="$ac_configure_args$ac_sep$ac_arg"
883 ac_sep=" " ;;
884 esac
885 # Get rid of the leading space.
886done
887
888# When interrupted or exit'd, cleanup temporary files, and complete
889# config.log. We remove comments because anyway the quotes in there
890# would cause problems or look ugly.
891trap 'exit_status=$?
892 # Save into config.log some information that might help in debugging.
893 echo >&5
894 echo "## ----------------- ##" >&5
895 echo "## Cache variables. ##" >&5
896 echo "## ----------------- ##" >&5
897 echo >&5
898 # The following way of writing the cache mishandles newlines in values,
899{
900 (set) 2>&1 |
901 case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in
902 *ac_space=\ *)
903 sed -n \
904 "s/'"'"'/'"'"'\\\\'"'"''"'"'/g;
905 s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p"
906 ;;
907 *)
908 sed -n \
909 "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
910 ;;
911 esac;
912} >&5
913 sed "/^$/d" confdefs.h >conftest.log
914 if test -s conftest.log; then
915 echo >&5
916 echo "## ------------ ##" >&5
917 echo "## confdefs.h. ##" >&5
918 echo "## ------------ ##" >&5
919 echo >&5
920 cat conftest.log >&5
921 fi
922 (echo; echo) >&5
923 test "$ac_signal" != 0 &&
924 echo "$as_me: caught signal $ac_signal" >&5
925 echo "$as_me: exit $exit_status" >&5
926 rm -rf conftest* confdefs* core core.* *.core conf$$* $ac_clean_files &&
927 exit $exit_status
928 ' 0
929for ac_signal in 1 2 13 15; do
micky3879b9f5e72025-07-08 18:04:53 -0400930 trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' "$ac_signal"
Steve Kondikae271bc2015-11-15 02:50:53 +0100931done
932ac_signal=0
933
934# confdefs.h avoids OS command line length limits that DEFS can exceed.
935rm -rf conftest* confdefs.h
936# AIX cpp loses on an empty file, so make sure it contains at least a newline.
937echo >confdefs.h
938
939# Let the site file select an alternate cache file if it wants to.
940# Prefer explicitly selected file to automatically selected ones.
941if test -z "$CONFIG_SITE"; then
942 if test "x$prefix" != xNONE; then
943 CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
944 else
945 CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
946 fi
947fi
948for ac_site_file in $CONFIG_SITE; do
949 if test -r "$ac_site_file"; then
micky3879b9f5e72025-07-08 18:04:53 -0400950 { echo "$as_me:950: loading site script $ac_site_file" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +0100951echo "$as_me: loading site script $ac_site_file" >&6;}
952 cat "$ac_site_file" >&5
953 . "$ac_site_file"
954 fi
955done
956
957if test -r "$cache_file"; then
958 # Some versions of bash will fail to source /dev/null (special
959 # files actually), so we avoid doing that.
960 if test -f "$cache_file"; then
micky3879b9f5e72025-07-08 18:04:53 -0400961 { echo "$as_me:961: loading cache $cache_file" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +0100962echo "$as_me: loading cache $cache_file" >&6;}
963 case $cache_file in
964 [\\/]* | ?:[\\/]* ) . $cache_file;;
965 *) . ./$cache_file;;
966 esac
967 fi
968else
micky3879b9f5e72025-07-08 18:04:53 -0400969 { echo "$as_me:969: creating cache $cache_file" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +0100970echo "$as_me: creating cache $cache_file" >&6;}
971 >$cache_file
972fi
973
974# Check that the precious variables saved in the cache have kept the same
975# value.
976ac_cache_corrupted=false
977for ac_var in `(set) 2>&1 |
978 sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do
979 eval ac_old_set=\$ac_cv_env_${ac_var}_set
980 eval ac_new_set=\$ac_env_${ac_var}_set
981 eval ac_old_val="\$ac_cv_env_${ac_var}_value"
982 eval ac_new_val="\$ac_env_${ac_var}_value"
micky3879b9f5e72025-07-08 18:04:53 -0400983 case "$ac_old_set,$ac_new_set" in
Steve Kondikae271bc2015-11-15 02:50:53 +0100984 set,)
micky3879b9f5e72025-07-08 18:04:53 -0400985 { echo "$as_me:985: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +0100986echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
987 ac_cache_corrupted=: ;;
988 ,set)
micky3879b9f5e72025-07-08 18:04:53 -0400989 { echo "$as_me:989: error: \`$ac_var' was not set in the previous run" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +0100990echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
991 ac_cache_corrupted=: ;;
992 ,);;
993 *)
994 if test "x$ac_old_val" != "x$ac_new_val"; then
micky3879b9f5e72025-07-08 18:04:53 -0400995 { echo "$as_me:995: error: \`$ac_var' has changed since the previous run:" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +0100996echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
micky3879b9f5e72025-07-08 18:04:53 -0400997 { echo "$as_me:997: former value: $ac_old_val" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +0100998echo "$as_me: former value: $ac_old_val" >&2;}
micky3879b9f5e72025-07-08 18:04:53 -0400999 { echo "$as_me:999: current value: $ac_new_val" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01001000echo "$as_me: current value: $ac_new_val" >&2;}
1001 ac_cache_corrupted=:
1002 fi;;
1003 esac
1004 # Pass precious variables to config.status. It doesn't matter if
1005 # we pass some twice (in addition to the command line arguments).
1006 if test "$ac_new_set" = set; then
micky3879b9f5e72025-07-08 18:04:53 -04001007 case "$ac_new_val" in
Steve Kondikae271bc2015-11-15 02:50:53 +01001008 *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
1009 ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"`
1010 ac_configure_args="$ac_configure_args '$ac_arg'"
1011 ;;
1012 *) ac_configure_args="$ac_configure_args $ac_var=$ac_new_val"
1013 ;;
1014 esac
1015 fi
1016done
micky3879b9f5e72025-07-08 18:04:53 -04001017if "$ac_cache_corrupted"; then
1018 { echo "$as_me:1018: error: changes in the environment can compromise the build" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01001019echo "$as_me: error: changes in the environment can compromise the build" >&2;}
micky3879b9f5e72025-07-08 18:04:53 -04001020 { { echo "$as_me:1020: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01001021echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;}
1022 { (exit 1); exit 1; }; }
1023fi
1024
1025ac_ext=c
1026ac_cpp='$CPP $CPPFLAGS'
micky3879b9f5e72025-07-08 18:04:53 -04001027ac_compile='$CC -c $CFLAGS $CPPFLAGS "conftest.$ac_ext" >&5'
1028ac_link='$CC -o "conftest$ac_exeext" $CFLAGS $CPPFLAGS $LDFLAGS "conftest.$ac_ext" $LIBS >&5'
Steve Kondikae271bc2015-11-15 02:50:53 +01001029ac_compiler_gnu=$ac_cv_c_compiler_gnu
micky3879b9f5e72025-07-08 18:04:53 -04001030ac_main_return="return"
Steve Kondikae271bc2015-11-15 02:50:53 +01001031
1032case `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 -04001033 *c*,-n*) ECHO_N=
1034 ECHO_C= # newlines do not sed ;-) only broken shells would use this case anyway
1035 ECHO_T=' '
1036 ;;
1037 *c*,* ) ECHO_N=-n
1038 ECHO_C=
1039 ECHO_T=
1040 ;;
1041 *) ECHO_N=
1042 ECHO_C='\c'
1043 ECHO_T=
1044 ;;
Steve Kondikae271bc2015-11-15 02:50:53 +01001045esac
1046echo "#! $SHELL" >conftest.sh
1047echo "exit 0" >>conftest.sh
1048chmod +x conftest.sh
micky3879b9f5e72025-07-08 18:04:53 -04001049if { (echo "$as_me:1049: PATH=\".;.\"; conftest.sh") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01001050 (PATH=".;."; conftest.sh) 2>&5
1051 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -04001052 echo "$as_me:1052: \$? = $ac_status" >&5
1053 (exit "$ac_status"); }; then
Steve Kondikae271bc2015-11-15 02:50:53 +01001054 ac_path_separator=';'
1055else
1056 ac_path_separator=:
1057fi
1058PATH_SEPARATOR="$ac_path_separator"
1059rm -f conftest.sh
1060
1061ac_config_headers="$ac_config_headers include/ncurses_cfg.h:include/ncurses_cfg.hin"
1062
micky3879b9f5e72025-07-08 18:04:53 -04001063PACKAGE="AdaCurses"
1064
Steve Kondikae271bc2015-11-15 02:50:53 +01001065top_builddir=`pwd`
1066
1067ac_aux_dir=
1068for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
micky3879b9f5e72025-07-08 18:04:53 -04001069 if test -f "$ac_dir/install-sh"; then
Steve Kondikae271bc2015-11-15 02:50:53 +01001070 ac_aux_dir=$ac_dir
1071 ac_install_sh="$ac_aux_dir/install-sh -c"
1072 break
micky3879b9f5e72025-07-08 18:04:53 -04001073 elif test -f "$ac_dir/install.sh"; then
Steve Kondikae271bc2015-11-15 02:50:53 +01001074 ac_aux_dir=$ac_dir
1075 ac_install_sh="$ac_aux_dir/install.sh -c"
1076 break
micky3879b9f5e72025-07-08 18:04:53 -04001077 elif test -f "$ac_dir/shtool"; then
Steve Kondikae271bc2015-11-15 02:50:53 +01001078 ac_aux_dir=$ac_dir
1079 ac_install_sh="$ac_aux_dir/shtool install -c"
1080 break
1081 fi
1082done
1083if test -z "$ac_aux_dir"; then
micky3879b9f5e72025-07-08 18:04:53 -04001084 { { echo "$as_me:1084: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01001085echo "$as_me: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&2;}
1086 { (exit 1); exit 1; }; }
1087fi
1088ac_config_guess="$SHELL $ac_aux_dir/config.guess"
1089ac_config_sub="$SHELL $ac_aux_dir/config.sub"
1090ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure.
1091
1092# Make sure we can run config.sub.
1093$ac_config_sub sun4 >/dev/null 2>&1 ||
micky3879b9f5e72025-07-08 18:04:53 -04001094 { { echo "$as_me:1094: error: cannot run $ac_config_sub" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01001095echo "$as_me: error: cannot run $ac_config_sub" >&2;}
1096 { (exit 1); exit 1; }; }
1097
micky3879b9f5e72025-07-08 18:04:53 -04001098echo "$as_me:1098: checking build system type" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01001099echo $ECHO_N "checking build system type... $ECHO_C" >&6
1100if test "${ac_cv_build+set}" = set; then
1101 echo $ECHO_N "(cached) $ECHO_C" >&6
1102else
1103 ac_cv_build_alias=$build_alias
1104test -z "$ac_cv_build_alias" &&
1105 ac_cv_build_alias=`$ac_config_guess`
1106test -z "$ac_cv_build_alias" &&
micky3879b9f5e72025-07-08 18:04:53 -04001107 { { echo "$as_me:1107: error: cannot guess build type; you must specify one" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01001108echo "$as_me: error: cannot guess build type; you must specify one" >&2;}
1109 { (exit 1); exit 1; }; }
micky3879b9f5e72025-07-08 18:04:53 -04001110ac_cv_build=`$ac_config_sub "$ac_cv_build_alias"` ||
1111 { { echo "$as_me:1111: error: $ac_config_sub $ac_cv_build_alias failed." >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01001112echo "$as_me: error: $ac_config_sub $ac_cv_build_alias failed." >&2;}
1113 { (exit 1); exit 1; }; }
1114
1115fi
micky3879b9f5e72025-07-08 18:04:53 -04001116echo "$as_me:1116: result: $ac_cv_build" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01001117echo "${ECHO_T}$ac_cv_build" >&6
1118build=$ac_cv_build
micky3879b9f5e72025-07-08 18:04:53 -04001119build_cpu=`echo "$ac_cv_build" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
1120build_vendor=`echo "$ac_cv_build" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
1121build_os=`echo "$ac_cv_build" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
Steve Kondikae271bc2015-11-15 02:50:53 +01001122
micky3879b9f5e72025-07-08 18:04:53 -04001123echo "$as_me:1123: checking host system type" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01001124echo $ECHO_N "checking host system type... $ECHO_C" >&6
1125if test "${ac_cv_host+set}" = set; then
1126 echo $ECHO_N "(cached) $ECHO_C" >&6
1127else
1128 ac_cv_host_alias=$host_alias
1129test -z "$ac_cv_host_alias" &&
1130 ac_cv_host_alias=$ac_cv_build_alias
micky3879b9f5e72025-07-08 18:04:53 -04001131ac_cv_host=`$ac_config_sub "$ac_cv_host_alias"` ||
1132 { { echo "$as_me:1132: error: $ac_config_sub $ac_cv_host_alias failed" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01001133echo "$as_me: error: $ac_config_sub $ac_cv_host_alias failed" >&2;}
1134 { (exit 1); exit 1; }; }
1135
1136fi
micky3879b9f5e72025-07-08 18:04:53 -04001137echo "$as_me:1137: result: $ac_cv_host" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01001138echo "${ECHO_T}$ac_cv_host" >&6
1139host=$ac_cv_host
micky3879b9f5e72025-07-08 18:04:53 -04001140host_cpu=`echo "$ac_cv_host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
1141host_vendor=`echo "$ac_cv_host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
1142host_os=`echo "$ac_cv_host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
Steve Kondikae271bc2015-11-15 02:50:53 +01001143
micky3879b9f5e72025-07-08 18:04:53 -04001144if test -f "$srcdir/config.guess" || test -f "$ac_aux_dir/config.guess" ; then
1145 echo "$as_me:1145: checking target system type" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01001146echo $ECHO_N "checking target system type... $ECHO_C" >&6
1147if test "${ac_cv_target+set}" = set; then
1148 echo $ECHO_N "(cached) $ECHO_C" >&6
1149else
1150 ac_cv_target_alias=$target_alias
1151test "x$ac_cv_target_alias" = "x" &&
1152 ac_cv_target_alias=$ac_cv_host_alias
micky3879b9f5e72025-07-08 18:04:53 -04001153ac_cv_target=`$ac_config_sub "$ac_cv_target_alias"` ||
1154 { { echo "$as_me:1154: error: $ac_config_sub $ac_cv_target_alias failed" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01001155echo "$as_me: error: $ac_config_sub $ac_cv_target_alias failed" >&2;}
1156 { (exit 1); exit 1; }; }
1157
1158fi
micky3879b9f5e72025-07-08 18:04:53 -04001159echo "$as_me:1159: result: $ac_cv_target" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01001160echo "${ECHO_T}$ac_cv_target" >&6
1161target=$ac_cv_target
micky3879b9f5e72025-07-08 18:04:53 -04001162target_cpu=`echo "$ac_cv_target" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
1163target_vendor=`echo "$ac_cv_target" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
1164target_os=`echo "$ac_cv_target" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
Steve Kondikae271bc2015-11-15 02:50:53 +01001165
1166# The aliases save the names the user supplied, while $host etc.
1167# will get canonicalized.
1168test -n "$target_alias" &&
1169 test "$program_prefix$program_suffix$program_transform_name" = \
1170 NONENONEs,x,x, &&
1171 program_prefix=${target_alias}-
1172 system_name="$host_os"
1173else
1174 system_name="`(uname -s -r) 2>/dev/null`"
1175 if test -z "$system_name" ; then
1176 system_name="`(hostname) 2>/dev/null`"
1177 fi
1178fi
1179test -n "$system_name" &&
1180cat >>confdefs.h <<EOF
1181#define SYSTEM_NAME "$system_name"
1182EOF
1183
1184if test "${cf_cv_system_name+set}" = set; then
1185 echo $ECHO_N "(cached) $ECHO_C" >&6
1186else
1187 cf_cv_system_name="$system_name"
1188fi
1189
1190test -z "$system_name" && system_name="$cf_cv_system_name"
micky3879b9f5e72025-07-08 18:04:53 -04001191test -n "$cf_cv_system_name" && echo "$as_me:1191: result: Configuring for $cf_cv_system_name" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01001192echo "${ECHO_T}Configuring for $cf_cv_system_name" >&6
1193
1194if test ".$system_name" != ".$cf_cv_system_name" ; then
micky3879b9f5e72025-07-08 18:04:53 -04001195 echo "$as_me:1195: result: Cached system name ($system_name) does not agree with actual ($cf_cv_system_name)" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01001196echo "${ECHO_T}Cached system name ($system_name) does not agree with actual ($cf_cv_system_name)" >&6
micky3879b9f5e72025-07-08 18:04:53 -04001197 { { echo "$as_me:1197: error: \"Please remove config.cache and try again.\"" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01001198echo "$as_me: error: \"Please remove config.cache and try again.\"" >&2;}
1199 { (exit 1); exit 1; }; }
1200fi
1201
1202# Check whether --with-system-type or --without-system-type was given.
1203if test "${with_system_type+set}" = set; then
1204 withval="$with_system_type"
micky3879b9f5e72025-07-08 18:04:53 -04001205 { echo "$as_me:1205: WARNING: overriding system type to $withval" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01001206echo "$as_me: WARNING: overriding system type to $withval" >&2;}
1207 cf_cv_system_name=$withval
1208 host_os=$withval
1209
1210fi;
1211
1212### Save the given $CFLAGS to allow user-override.
1213cf_user_CFLAGS="$CFLAGS"
1214
1215### Default install-location
micky3879b9f5e72025-07-08 18:04:53 -04001216for ac_prog in ggrep grep
1217do
1218 # Extract the first word of "$ac_prog", so it can be a program name with args.
1219set dummy $ac_prog; ac_word=$2
1220echo "$as_me:1220: checking for $ac_word" >&5
1221echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1222if test "${ac_cv_prog_GREP+set}" = set; then
1223 echo $ECHO_N "(cached) $ECHO_C" >&6
1224else
1225 if test -n "$GREP"; then
1226 ac_cv_prog_GREP="$GREP" # Let the user override the test.
1227else
1228 ac_save_IFS=$IFS; IFS=$ac_path_separator
1229ac_dummy="$PATH"
1230for ac_dir in $ac_dummy; do
1231 IFS=$ac_save_IFS
1232 test -z "$ac_dir" && ac_dir=.
1233 $as_executable_p "$ac_dir/$ac_word" || continue
1234ac_cv_prog_GREP="$ac_prog"
1235echo "$as_me:1235: found $ac_dir/$ac_word" >&5
1236break
1237done
Steve Kondikae271bc2015-11-15 02:50:53 +01001238
micky3879b9f5e72025-07-08 18:04:53 -04001239fi
1240fi
1241GREP=$ac_cv_prog_GREP
1242if test -n "$GREP"; then
1243 echo "$as_me:1243: result: $GREP" >&5
1244echo "${ECHO_T}$GREP" >&6
1245else
1246 echo "$as_me:1246: result: no" >&5
1247echo "${ECHO_T}no" >&6
1248fi
1249
1250 test -n "$GREP" && break
1251done
1252test -n "$GREP" || GREP=": "
1253
1254echo "$as_me:1254: checking for fgrep" >&5
1255echo $ECHO_N "checking for fgrep... $ECHO_C" >&6
1256if test "${ac_cv_path_FGREP+set}" = set; then
1257 echo $ECHO_N "(cached) $ECHO_C" >&6
1258else
1259 if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1
1260 then ac_cv_path_FGREP="$GREP -F"
1261 else
1262 for ac_prog in gfgrep fgrep
1263do
1264 # Extract the first word of "$ac_prog", so it can be a program name with args.
1265set dummy $ac_prog; ac_word=$2
1266echo "$as_me:1266: checking for $ac_word" >&5
1267echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1268if test "${ac_cv_path_FGREP+set}" = set; then
1269 echo $ECHO_N "(cached) $ECHO_C" >&6
1270else
1271 case $FGREP in
1272 [\\/]* | ?:[\\/]*)
1273 ac_cv_path_FGREP="$FGREP" # Let the user override the test with a path.
1274 ;;
1275 *)
1276 ac_save_IFS=$IFS; IFS=$ac_path_separator
1277ac_dummy="$PATH"
1278for ac_dir in $ac_dummy; do
1279 IFS=$ac_save_IFS
1280 test -z "$ac_dir" && ac_dir=.
1281 if $as_executable_p "$ac_dir/$ac_word"; then
1282 ac_cv_path_FGREP="$ac_dir/$ac_word"
1283 echo "$as_me:1283: found $ac_dir/$ac_word" >&5
1284 break
1285fi
1286done
1287
1288 ;;
1289esac
1290fi
1291FGREP=$ac_cv_path_FGREP
1292
1293if test -n "$FGREP"; then
1294 echo "$as_me:1294: result: $FGREP" >&5
1295echo "${ECHO_T}$FGREP" >&6
1296else
1297 echo "$as_me:1297: result: no" >&5
1298echo "${ECHO_T}no" >&6
1299fi
1300
1301 test -n "$FGREP" && break
1302done
1303test -n "$FGREP" || FGREP=": "
1304
1305 test "x$ac_cv_path_FGREP" = "x:" && { { echo "$as_me:1305: error: cannot find workable fgrep" >&5
1306echo "$as_me: error: cannot find workable fgrep" >&2;}
1307 { (exit 1); exit 1; }; }
1308 fi
1309fi
1310echo "$as_me:1310: result: $ac_cv_path_FGREP" >&5
1311echo "${ECHO_T}$ac_cv_path_FGREP" >&6
1312 FGREP="$ac_cv_path_FGREP"
1313
1314echo "$as_me:1314: checking for prefix" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01001315echo $ECHO_N "checking for prefix... $ECHO_C" >&6
1316if test "x$prefix" = "xNONE" ; then
1317 case "$cf_cv_system_name" in
1318 # non-vendor systems don't have a conflict
1319 (openbsd*|freebsd*|mirbsd*|linux*|cygwin*|msys*|k*bsd*-gnu|mingw*)
1320 prefix=/usr
1321 ;;
1322 (*) prefix=$ac_default_prefix
1323 ;;
1324 esac
1325fi
micky3879b9f5e72025-07-08 18:04:53 -04001326echo "$as_me:1326: result: $prefix" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01001327echo "${ECHO_T}$prefix" >&6
1328
1329if test "x$prefix" = "xNONE" ; then
micky3879b9f5e72025-07-08 18:04:53 -04001330echo "$as_me:1330: checking for default include-directory" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01001331echo $ECHO_N "checking for default include-directory... $ECHO_C" >&6
1332test -n "$verbose" && echo 1>&6
1333for cf_symbol in \
micky3879b9f5e72025-07-08 18:04:53 -04001334 "$includedir" \
1335 "$includedir/ncurses" \
1336 "$prefix/include" \
1337 "$prefix/include/ncurses" \
Steve Kondikae271bc2015-11-15 02:50:53 +01001338 /usr/local/include \
1339 /usr/local/include/ncurses \
1340 /usr/include \
1341 /usr/include/ncurses
1342do
micky3879b9f5e72025-07-08 18:04:53 -04001343 cf_dir=`eval echo "$cf_symbol"`
1344 if test -f "$cf_dir/curses.h" ; then
1345 if ( ${FGREP-fgrep} NCURSES_VERSION "$cf_dir/curses.h" >/dev/null 2>&1 ) ; then
Steve Kondikae271bc2015-11-15 02:50:53 +01001346 includedir="$cf_symbol"
micky3879b9f5e72025-07-08 18:04:53 -04001347 test -n "$verbose" && echo $ECHO_N " found " 1>&6
Steve Kondikae271bc2015-11-15 02:50:53 +01001348 break
1349 fi
1350 fi
1351 test -n "$verbose" && echo " tested $cf_dir" 1>&6
1352done
micky3879b9f5e72025-07-08 18:04:53 -04001353echo "$as_me:1353: result: $includedir" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01001354echo "${ECHO_T}$includedir" >&6
1355fi
1356
1357### Checks for programs.
1358
1359ac_ext=c
1360ac_cpp='$CPP $CPPFLAGS'
micky3879b9f5e72025-07-08 18:04:53 -04001361ac_compile='$CC -c $CFLAGS $CPPFLAGS "conftest.$ac_ext" >&5'
1362ac_link='$CC -o "conftest$ac_exeext" $CFLAGS $CPPFLAGS $LDFLAGS "conftest.$ac_ext" $LIBS >&5'
Steve Kondikae271bc2015-11-15 02:50:53 +01001363ac_compiler_gnu=$ac_cv_c_compiler_gnu
micky3879b9f5e72025-07-08 18:04:53 -04001364ac_main_return="return"
Steve Kondikae271bc2015-11-15 02:50:53 +01001365if test -n "$ac_tool_prefix"; then
1366 for ac_prog in gnatgcc gcc cc
1367 do
1368 # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
1369set dummy $ac_tool_prefix$ac_prog; ac_word=$2
micky3879b9f5e72025-07-08 18:04:53 -04001370echo "$as_me:1370: checking for $ac_word" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01001371echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1372if test "${ac_cv_prog_CC+set}" = set; then
1373 echo $ECHO_N "(cached) $ECHO_C" >&6
1374else
1375 if test -n "$CC"; then
1376 ac_cv_prog_CC="$CC" # Let the user override the test.
1377else
1378 ac_save_IFS=$IFS; IFS=$ac_path_separator
1379ac_dummy="$PATH"
1380for ac_dir in $ac_dummy; do
1381 IFS=$ac_save_IFS
1382 test -z "$ac_dir" && ac_dir=.
1383 $as_executable_p "$ac_dir/$ac_word" || continue
1384ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
micky3879b9f5e72025-07-08 18:04:53 -04001385echo "$as_me:1385: found $ac_dir/$ac_word" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01001386break
1387done
1388
1389fi
1390fi
1391CC=$ac_cv_prog_CC
1392if test -n "$CC"; then
micky3879b9f5e72025-07-08 18:04:53 -04001393 echo "$as_me:1393: result: $CC" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01001394echo "${ECHO_T}$CC" >&6
1395else
micky3879b9f5e72025-07-08 18:04:53 -04001396 echo "$as_me:1396: result: no" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01001397echo "${ECHO_T}no" >&6
1398fi
1399
1400 test -n "$CC" && break
1401 done
1402fi
1403if test -z "$CC"; then
1404 ac_ct_CC=$CC
1405 for ac_prog in gnatgcc gcc cc
1406do
1407 # Extract the first word of "$ac_prog", so it can be a program name with args.
1408set dummy $ac_prog; ac_word=$2
micky3879b9f5e72025-07-08 18:04:53 -04001409echo "$as_me:1409: checking for $ac_word" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01001410echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1411if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
1412 echo $ECHO_N "(cached) $ECHO_C" >&6
1413else
1414 if test -n "$ac_ct_CC"; then
1415 ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
1416else
1417 ac_save_IFS=$IFS; IFS=$ac_path_separator
1418ac_dummy="$PATH"
1419for ac_dir in $ac_dummy; do
1420 IFS=$ac_save_IFS
1421 test -z "$ac_dir" && ac_dir=.
1422 $as_executable_p "$ac_dir/$ac_word" || continue
1423ac_cv_prog_ac_ct_CC="$ac_prog"
micky3879b9f5e72025-07-08 18:04:53 -04001424echo "$as_me:1424: found $ac_dir/$ac_word" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01001425break
1426done
1427
1428fi
1429fi
1430ac_ct_CC=$ac_cv_prog_ac_ct_CC
1431if test -n "$ac_ct_CC"; then
micky3879b9f5e72025-07-08 18:04:53 -04001432 echo "$as_me:1432: result: $ac_ct_CC" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01001433echo "${ECHO_T}$ac_ct_CC" >&6
1434else
micky3879b9f5e72025-07-08 18:04:53 -04001435 echo "$as_me:1435: result: no" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01001436echo "${ECHO_T}no" >&6
1437fi
1438
1439 test -n "$ac_ct_CC" && break
1440done
1441
1442 CC=$ac_ct_CC
1443fi
1444
micky3879b9f5e72025-07-08 18:04:53 -04001445test -z "$CC" && { { echo "$as_me:1445: error: no acceptable cc found in \$PATH" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01001446echo "$as_me: error: no acceptable cc found in \$PATH" >&2;}
1447 { (exit 1); exit 1; }; }
1448
1449# Provide some information about the compiler.
micky3879b9f5e72025-07-08 18:04:53 -04001450echo "$as_me:1450:" \
Steve Kondikae271bc2015-11-15 02:50:53 +01001451 "checking for C compiler version" >&5
micky3879b9f5e72025-07-08 18:04:53 -04001452ac_compiler=`set X $ac_compile; echo "$2"`
1453{ (eval echo "$as_me:1453: \"$ac_compiler --version </dev/null >&5\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01001454 (eval $ac_compiler --version </dev/null >&5) 2>&5
1455 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -04001456 echo "$as_me:1456: \$? = $ac_status" >&5
1457 (exit "$ac_status"); }
1458{ (eval echo "$as_me:1458: \"$ac_compiler -v </dev/null >&5\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01001459 (eval $ac_compiler -v </dev/null >&5) 2>&5
1460 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -04001461 echo "$as_me:1461: \$? = $ac_status" >&5
1462 (exit "$ac_status"); }
1463{ (eval echo "$as_me:1463: \"$ac_compiler -V </dev/null >&5\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01001464 (eval $ac_compiler -V </dev/null >&5) 2>&5
1465 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -04001466 echo "$as_me:1466: \$? = $ac_status" >&5
1467 (exit "$ac_status"); }
Steve Kondikae271bc2015-11-15 02:50:53 +01001468
micky3879b9f5e72025-07-08 18:04:53 -04001469cat >"conftest.$ac_ext" <<_ACEOF
1470#line 1470 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +01001471#include "confdefs.h"
1472
1473int
micky3879b9f5e72025-07-08 18:04:53 -04001474main (void)
Steve Kondikae271bc2015-11-15 02:50:53 +01001475{
1476
1477 ;
1478 return 0;
1479}
1480_ACEOF
1481ac_clean_files_save=$ac_clean_files
1482ac_clean_files="$ac_clean_files a.out a.exe"
1483# Try to create an executable without -o first, disregard a.out.
1484# It will help us diagnose broken compilers, and finding out an intuition
1485# of exeext.
micky3879b9f5e72025-07-08 18:04:53 -04001486echo "$as_me:1486: checking for C compiler default output" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01001487echo $ECHO_N "checking for C compiler default output... $ECHO_C" >&6
micky3879b9f5e72025-07-08 18:04:53 -04001488ac_link_default=`echo "$ac_link" | sed 's/ -o *"conftest[^"]*"//'`
1489if { (eval echo "$as_me:1489: \"$ac_link_default\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01001490 (eval $ac_link_default) 2>&5
1491 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -04001492 echo "$as_me:1492: \$? = $ac_status" >&5
1493 (exit "$ac_status"); }; then
Steve Kondikae271bc2015-11-15 02:50:53 +01001494 # Find the output, starting from the most likely. This scheme is
1495# not robust to junk in `.', hence go to wildcards (a.*) only as a last
1496# resort.
1497for ac_file in `ls a.exe conftest.exe 2>/dev/null;
1498 ls a.out conftest 2>/dev/null;
1499 ls a.* conftest.* 2>/dev/null`; do
1500 case $ac_file in
1501 *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;;
1502 a.out ) # We found the default executable, but exeext='' is most
1503 # certainly right.
1504 break;;
1505 *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
1506 # FIXME: I believe we export ac_cv_exeext for Libtool --akim.
1507 export ac_cv_exeext
1508 break;;
1509 * ) break;;
1510 esac
1511done
1512else
1513 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -04001514cat "conftest.$ac_ext" >&5
1515{ { echo "$as_me:1515: error: C compiler cannot create executables" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01001516echo "$as_me: error: C compiler cannot create executables" >&2;}
1517 { (exit 77); exit 77; }; }
1518fi
1519
1520ac_exeext=$ac_cv_exeext
micky3879b9f5e72025-07-08 18:04:53 -04001521echo "$as_me:1521: result: $ac_file" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01001522echo "${ECHO_T}$ac_file" >&6
1523
1524# Check the compiler produces executables we can run. If not, either
1525# the compiler is broken, or we cross compile.
micky3879b9f5e72025-07-08 18:04:53 -04001526echo "$as_me:1526: checking whether the C compiler works" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01001527echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6
1528# FIXME: These cross compiler hacks should be removed for Autoconf 3.0
1529# If not cross compiling, check that we can run a simple program.
1530if test "$cross_compiling" != yes; then
1531 if { ac_try='./$ac_file'
micky3879b9f5e72025-07-08 18:04:53 -04001532 { (eval echo "$as_me:1532: \"$ac_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01001533 (eval $ac_try) 2>&5
1534 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -04001535 echo "$as_me:1535: \$? = $ac_status" >&5
1536 (exit "$ac_status"); }; }; then
Steve Kondikae271bc2015-11-15 02:50:53 +01001537 cross_compiling=no
1538 else
1539 if test "$cross_compiling" = maybe; then
1540 cross_compiling=yes
1541 else
micky3879b9f5e72025-07-08 18:04:53 -04001542 { { echo "$as_me:1542: error: cannot run C compiled programs.
Steve Kondikae271bc2015-11-15 02:50:53 +01001543If you meant to cross compile, use \`--host'." >&5
1544echo "$as_me: error: cannot run C compiled programs.
1545If you meant to cross compile, use \`--host'." >&2;}
1546 { (exit 1); exit 1; }; }
1547 fi
1548 fi
1549fi
micky3879b9f5e72025-07-08 18:04:53 -04001550echo "$as_me:1550: result: yes" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01001551echo "${ECHO_T}yes" >&6
1552
micky3879b9f5e72025-07-08 18:04:53 -04001553rm -f a.out a.exe "conftest$ac_cv_exeext"
Steve Kondikae271bc2015-11-15 02:50:53 +01001554ac_clean_files=$ac_clean_files_save
1555# Check the compiler produces executables we can run. If not, either
1556# the compiler is broken, or we cross compile.
micky3879b9f5e72025-07-08 18:04:53 -04001557echo "$as_me:1557: checking whether we are cross compiling" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01001558echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6
micky3879b9f5e72025-07-08 18:04:53 -04001559echo "$as_me:1559: result: $cross_compiling" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01001560echo "${ECHO_T}$cross_compiling" >&6
1561
micky3879b9f5e72025-07-08 18:04:53 -04001562echo "$as_me:1562: checking for executable suffix" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01001563echo $ECHO_N "checking for executable suffix... $ECHO_C" >&6
micky3879b9f5e72025-07-08 18:04:53 -04001564if { (eval echo "$as_me:1564: \"$ac_link\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01001565 (eval $ac_link) 2>&5
1566 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -04001567 echo "$as_me:1567: \$? = $ac_status" >&5
1568 (exit "$ac_status"); }; then
Steve Kondikae271bc2015-11-15 02:50:53 +01001569 # If both `conftest.exe' and `conftest' are `present' (well, observable)
1570# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will
1571# work properly (i.e., refer to `conftest.exe'), while it won't with
1572# `rm'.
1573for ac_file in `(ls conftest.exe; ls conftest; ls conftest.*) 2>/dev/null`; do
1574 case $ac_file in
1575 *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;;
1576 *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
1577 export ac_cv_exeext
1578 break;;
1579 * ) break;;
1580 esac
1581done
1582else
micky3879b9f5e72025-07-08 18:04:53 -04001583 { { echo "$as_me:1583: error: cannot compute EXEEXT: cannot compile and link" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01001584echo "$as_me: error: cannot compute EXEEXT: cannot compile and link" >&2;}
1585 { (exit 1); exit 1; }; }
1586fi
1587
micky3879b9f5e72025-07-08 18:04:53 -04001588rm -f "conftest$ac_cv_exeext"
1589echo "$as_me:1589: result: $ac_cv_exeext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01001590echo "${ECHO_T}$ac_cv_exeext" >&6
1591
micky3879b9f5e72025-07-08 18:04:53 -04001592rm -f "conftest.$ac_ext"
Steve Kondikae271bc2015-11-15 02:50:53 +01001593EXEEXT=$ac_cv_exeext
1594ac_exeext=$EXEEXT
micky3879b9f5e72025-07-08 18:04:53 -04001595echo "$as_me:1595: checking for object suffix" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01001596echo $ECHO_N "checking for object suffix... $ECHO_C" >&6
1597if test "${ac_cv_objext+set}" = set; then
1598 echo $ECHO_N "(cached) $ECHO_C" >&6
1599else
micky3879b9f5e72025-07-08 18:04:53 -04001600 cat >"conftest.$ac_ext" <<_ACEOF
1601#line 1601 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +01001602#include "confdefs.h"
1603
1604int
micky3879b9f5e72025-07-08 18:04:53 -04001605main (void)
Steve Kondikae271bc2015-11-15 02:50:53 +01001606{
1607
1608 ;
1609 return 0;
1610}
1611_ACEOF
1612rm -f conftest.o conftest.obj
micky3879b9f5e72025-07-08 18:04:53 -04001613if { (eval echo "$as_me:1613: \"$ac_compile\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01001614 (eval $ac_compile) 2>&5
1615 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -04001616 echo "$as_me:1616: \$? = $ac_status" >&5
1617 (exit "$ac_status"); }; then
Steve Kondikae271bc2015-11-15 02:50:53 +01001618 for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do
1619 case $ac_file in
1620 *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.map | *.inf ) ;;
1621 *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
1622 break;;
1623 esac
1624done
1625else
1626 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -04001627cat "conftest.$ac_ext" >&5
1628{ { echo "$as_me:1628: error: cannot compute OBJEXT: cannot compile" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01001629echo "$as_me: error: cannot compute OBJEXT: cannot compile" >&2;}
1630 { (exit 1); exit 1; }; }
1631fi
1632
micky3879b9f5e72025-07-08 18:04:53 -04001633rm -f "conftest.$ac_cv_objext" "conftest.$ac_ext"
Steve Kondikae271bc2015-11-15 02:50:53 +01001634fi
micky3879b9f5e72025-07-08 18:04:53 -04001635echo "$as_me:1635: result: $ac_cv_objext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01001636echo "${ECHO_T}$ac_cv_objext" >&6
1637OBJEXT=$ac_cv_objext
1638ac_objext=$OBJEXT
micky3879b9f5e72025-07-08 18:04:53 -04001639echo "$as_me:1639: checking whether we are using the GNU C compiler" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01001640echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6
1641if test "${ac_cv_c_compiler_gnu+set}" = set; then
1642 echo $ECHO_N "(cached) $ECHO_C" >&6
1643else
micky3879b9f5e72025-07-08 18:04:53 -04001644 cat >"conftest.$ac_ext" <<_ACEOF
1645#line 1645 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +01001646#include "confdefs.h"
1647
1648int
micky3879b9f5e72025-07-08 18:04:53 -04001649main (void)
Steve Kondikae271bc2015-11-15 02:50:53 +01001650{
1651#ifndef __GNUC__
1652 choke me
1653#endif
1654
1655 ;
1656 return 0;
1657}
1658_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -04001659rm -f "conftest.$ac_objext"
1660if { (eval echo "$as_me:1660: \"$ac_compile\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01001661 (eval $ac_compile) 2>&5
1662 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -04001663 echo "$as_me:1663: \$? = $ac_status" >&5
1664 (exit "$ac_status"); } &&
1665 { ac_try='test -s "conftest.$ac_objext"'
1666 { (eval echo "$as_me:1666: \"$ac_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01001667 (eval $ac_try) 2>&5
1668 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -04001669 echo "$as_me:1669: \$? = $ac_status" >&5
1670 (exit "$ac_status"); }; }; then
Steve Kondikae271bc2015-11-15 02:50:53 +01001671 ac_compiler_gnu=yes
1672else
1673 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -04001674cat "conftest.$ac_ext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01001675ac_compiler_gnu=no
1676fi
micky3879b9f5e72025-07-08 18:04:53 -04001677rm -f "conftest.$ac_objext" "conftest.$ac_ext"
Steve Kondikae271bc2015-11-15 02:50:53 +01001678ac_cv_c_compiler_gnu=$ac_compiler_gnu
1679
1680fi
micky3879b9f5e72025-07-08 18:04:53 -04001681echo "$as_me:1681: result: $ac_cv_c_compiler_gnu" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01001682echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6
1683GCC=`test $ac_compiler_gnu = yes && echo yes`
1684ac_test_CFLAGS=${CFLAGS+set}
1685ac_save_CFLAGS=$CFLAGS
1686CFLAGS="-g"
micky3879b9f5e72025-07-08 18:04:53 -04001687echo "$as_me:1687: checking whether $CC accepts -g" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01001688echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6
1689if test "${ac_cv_prog_cc_g+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
1700 ;
1701 return 0;
1702}
1703_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -04001704rm -f "conftest.$ac_objext"
1705if { (eval echo "$as_me:1705: \"$ac_compile\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01001706 (eval $ac_compile) 2>&5
1707 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -04001708 echo "$as_me:1708: \$? = $ac_status" >&5
1709 (exit "$ac_status"); } &&
1710 { ac_try='test -s "conftest.$ac_objext"'
1711 { (eval echo "$as_me:1711: \"$ac_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01001712 (eval $ac_try) 2>&5
1713 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -04001714 echo "$as_me:1714: \$? = $ac_status" >&5
1715 (exit "$ac_status"); }; }; then
Steve Kondikae271bc2015-11-15 02:50:53 +01001716 ac_cv_prog_cc_g=yes
1717else
1718 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -04001719cat "conftest.$ac_ext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01001720ac_cv_prog_cc_g=no
1721fi
micky3879b9f5e72025-07-08 18:04:53 -04001722rm -f "conftest.$ac_objext" "conftest.$ac_ext"
Steve Kondikae271bc2015-11-15 02:50:53 +01001723fi
micky3879b9f5e72025-07-08 18:04:53 -04001724echo "$as_me:1724: result: $ac_cv_prog_cc_g" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01001725echo "${ECHO_T}$ac_cv_prog_cc_g" >&6
1726if test "$ac_test_CFLAGS" = set; then
1727 CFLAGS=$ac_save_CFLAGS
1728elif test $ac_cv_prog_cc_g = yes; then
1729 if test "$GCC" = yes; then
1730 CFLAGS="-g -O2"
1731 else
1732 CFLAGS="-g"
1733 fi
1734else
1735 if test "$GCC" = yes; then
1736 CFLAGS="-O2"
1737 else
1738 CFLAGS=
1739 fi
1740fi
1741# Some people use a C++ compiler to compile C. Since we use `exit',
1742# in C++ we need to declare it. In case someone uses the same compiler
1743# for both compiling C and C++ we need to have the C++ compiler decide
1744# the declaration of exit, since it's the most demanding environment.
micky3879b9f5e72025-07-08 18:04:53 -04001745cat >"conftest.$ac_ext" <<_ACEOF
Steve Kondikae271bc2015-11-15 02:50:53 +01001746#ifndef __cplusplus
1747 choke me
1748#endif
1749_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -04001750rm -f "conftest.$ac_objext"
1751if { (eval echo "$as_me:1751: \"$ac_compile\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01001752 (eval $ac_compile) 2>&5
1753 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -04001754 echo "$as_me:1754: \$? = $ac_status" >&5
1755 (exit "$ac_status"); } &&
1756 { ac_try='test -s "conftest.$ac_objext"'
1757 { (eval echo "$as_me:1757: \"$ac_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01001758 (eval $ac_try) 2>&5
1759 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -04001760 echo "$as_me:1760: \$? = $ac_status" >&5
1761 (exit "$ac_status"); }; }; then
Steve Kondikae271bc2015-11-15 02:50:53 +01001762 for ac_declaration in \
1763 ''\
1764 '#include <stdlib.h>' \
1765 'extern "C" void std::exit (int) throw (); using std::exit;' \
1766 'extern "C" void std::exit (int); using std::exit;' \
1767 'extern "C" void exit (int) throw ();' \
1768 'extern "C" void exit (int);' \
1769 'void exit (int);'
1770do
micky3879b9f5e72025-07-08 18:04:53 -04001771 cat >"conftest.$ac_ext" <<_ACEOF
1772#line 1772 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +01001773#include "confdefs.h"
1774#include <stdlib.h>
1775$ac_declaration
1776int
micky3879b9f5e72025-07-08 18:04:53 -04001777main (void)
Steve Kondikae271bc2015-11-15 02:50:53 +01001778{
1779exit (42);
1780 ;
1781 return 0;
1782}
1783_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -04001784rm -f "conftest.$ac_objext"
1785if { (eval echo "$as_me:1785: \"$ac_compile\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01001786 (eval $ac_compile) 2>&5
1787 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -04001788 echo "$as_me:1788: \$? = $ac_status" >&5
1789 (exit "$ac_status"); } &&
1790 { ac_try='test -s "conftest.$ac_objext"'
1791 { (eval echo "$as_me:1791: \"$ac_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01001792 (eval $ac_try) 2>&5
1793 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -04001794 echo "$as_me:1794: \$? = $ac_status" >&5
1795 (exit "$ac_status"); }; }; then
Steve Kondikae271bc2015-11-15 02:50:53 +01001796 :
1797else
1798 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -04001799cat "conftest.$ac_ext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01001800continue
1801fi
micky3879b9f5e72025-07-08 18:04:53 -04001802rm -f "conftest.$ac_objext" "conftest.$ac_ext"
1803 cat >"conftest.$ac_ext" <<_ACEOF
1804#line 1804 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +01001805#include "confdefs.h"
1806$ac_declaration
1807int
micky3879b9f5e72025-07-08 18:04:53 -04001808main (void)
Steve Kondikae271bc2015-11-15 02:50:53 +01001809{
1810exit (42);
1811 ;
1812 return 0;
1813}
1814_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -04001815rm -f "conftest.$ac_objext"
1816if { (eval echo "$as_me:1816: \"$ac_compile\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01001817 (eval $ac_compile) 2>&5
1818 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -04001819 echo "$as_me:1819: \$? = $ac_status" >&5
1820 (exit "$ac_status"); } &&
1821 { ac_try='test -s "conftest.$ac_objext"'
1822 { (eval echo "$as_me:1822: \"$ac_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01001823 (eval $ac_try) 2>&5
1824 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -04001825 echo "$as_me:1825: \$? = $ac_status" >&5
1826 (exit "$ac_status"); }; }; then
Steve Kondikae271bc2015-11-15 02:50:53 +01001827 break
1828else
1829 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -04001830cat "conftest.$ac_ext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01001831fi
micky3879b9f5e72025-07-08 18:04:53 -04001832rm -f "conftest.$ac_objext" "conftest.$ac_ext"
Steve Kondikae271bc2015-11-15 02:50:53 +01001833done
1834rm -rf conftest*
1835if test -n "$ac_declaration"; then
1836 echo '#ifdef __cplusplus' >>confdefs.h
micky3879b9f5e72025-07-08 18:04:53 -04001837 echo "$ac_declaration" >>confdefs.h
Steve Kondikae271bc2015-11-15 02:50:53 +01001838 echo '#endif' >>confdefs.h
1839fi
1840
1841else
1842 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -04001843cat "conftest.$ac_ext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01001844fi
micky3879b9f5e72025-07-08 18:04:53 -04001845rm -f "conftest.$ac_objext" "conftest.$ac_ext"
Steve Kondikae271bc2015-11-15 02:50:53 +01001846ac_ext=c
1847ac_cpp='$CPP $CPPFLAGS'
micky3879b9f5e72025-07-08 18:04:53 -04001848ac_compile='$CC -c $CFLAGS $CPPFLAGS "conftest.$ac_ext" >&5'
1849ac_link='$CC -o "conftest$ac_exeext" $CFLAGS $CPPFLAGS $LDFLAGS "conftest.$ac_ext" $LIBS >&5'
Steve Kondikae271bc2015-11-15 02:50:53 +01001850ac_compiler_gnu=$ac_cv_c_compiler_gnu
micky3879b9f5e72025-07-08 18:04:53 -04001851ac_main_return="return"
Steve Kondikae271bc2015-11-15 02:50:53 +01001852
1853GCC_VERSION=none
1854if test "$GCC" = yes ; then
micky3879b9f5e72025-07-08 18:04:53 -04001855 echo "$as_me:1855: checking version of $CC" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01001856echo $ECHO_N "checking version of $CC... $ECHO_C" >&6
micky3879b9f5e72025-07-08 18:04:53 -04001857 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 +01001858 test -z "$GCC_VERSION" && GCC_VERSION=unknown
micky3879b9f5e72025-07-08 18:04:53 -04001859 echo "$as_me:1859: result: $GCC_VERSION" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01001860echo "${ECHO_T}$GCC_VERSION" >&6
1861fi
1862
micky3879b9f5e72025-07-08 18:04:53 -04001863INTEL_COMPILER=no
1864
1865if test "$GCC" = yes ; then
1866 case "$host_os" in
1867 (linux*|gnu*)
1868 echo "$as_me:1868: checking if this is really Intel C compiler" >&5
1869echo $ECHO_N "checking if this is really Intel C compiler... $ECHO_C" >&6
1870 cf_save_CFLAGS="$CFLAGS"
1871 CFLAGS="$CFLAGS -no-gcc"
1872 cat >"conftest.$ac_ext" <<_ACEOF
1873#line 1873 "configure"
1874#include "confdefs.h"
1875
1876int
1877main (void)
1878{
1879
1880#ifdef __INTEL_COMPILER
1881#else
1882#error __INTEL_COMPILER is not defined
1883#endif
1884
1885 ;
1886 return 0;
1887}
1888_ACEOF
1889rm -f "conftest.$ac_objext"
1890if { (eval echo "$as_me:1890: \"$ac_compile\"") >&5
1891 (eval $ac_compile) 2>&5
1892 ac_status=$?
1893 echo "$as_me:1893: \$? = $ac_status" >&5
1894 (exit "$ac_status"); } &&
1895 { ac_try='test -s "conftest.$ac_objext"'
1896 { (eval echo "$as_me:1896: \"$ac_try\"") >&5
1897 (eval $ac_try) 2>&5
1898 ac_status=$?
1899 echo "$as_me:1899: \$? = $ac_status" >&5
1900 (exit "$ac_status"); }; }; then
1901 INTEL_COMPILER=yes
1902cf_save_CFLAGS="$cf_save_CFLAGS -we147"
1903
1904else
1905 echo "$as_me: failed program was:" >&5
1906cat "conftest.$ac_ext" >&5
1907fi
1908rm -f "conftest.$ac_objext" "conftest.$ac_ext"
1909 CFLAGS="$cf_save_CFLAGS"
1910 echo "$as_me:1910: result: $INTEL_COMPILER" >&5
1911echo "${ECHO_T}$INTEL_COMPILER" >&6
1912 ;;
1913 esac
1914fi
1915
1916CLANG_COMPILER=no
1917
1918if test "$GCC" = yes ; then
1919 echo "$as_me:1919: checking if this is really Clang C compiler" >&5
1920echo $ECHO_N "checking if this is really Clang C compiler... $ECHO_C" >&6
1921 cf_save_CFLAGS="$CFLAGS"
1922 cat >"conftest.$ac_ext" <<_ACEOF
1923#line 1923 "configure"
1924#include "confdefs.h"
1925
1926int
1927main (void)
1928{
1929
1930#ifdef __clang__
1931#else
1932#error __clang__ is not defined
1933#endif
1934
1935 ;
1936 return 0;
1937}
1938_ACEOF
1939rm -f "conftest.$ac_objext"
1940if { (eval echo "$as_me:1940: \"$ac_compile\"") >&5
1941 (eval $ac_compile) 2>&5
1942 ac_status=$?
1943 echo "$as_me:1943: \$? = $ac_status" >&5
1944 (exit "$ac_status"); } &&
1945 { ac_try='test -s "conftest.$ac_objext"'
1946 { (eval echo "$as_me:1946: \"$ac_try\"") >&5
1947 (eval $ac_try) 2>&5
1948 ac_status=$?
1949 echo "$as_me:1949: \$? = $ac_status" >&5
1950 (exit "$ac_status"); }; }; then
1951 CLANG_COMPILER=yes
1952
1953else
1954 echo "$as_me: failed program was:" >&5
1955cat "conftest.$ac_ext" >&5
1956fi
1957rm -f "conftest.$ac_objext" "conftest.$ac_ext"
1958 CFLAGS="$cf_save_CFLAGS"
1959 echo "$as_me:1959: result: $CLANG_COMPILER" >&5
1960echo "${ECHO_T}$CLANG_COMPILER" >&6
1961fi
1962
1963CLANG_VERSION=none
1964
1965if test "x$CLANG_COMPILER" = "xyes" ; then
1966 case "$CC" in
1967 (c[1-9][0-9]|*/c[1-9][0-9])
1968 { echo "$as_me:1968: WARNING: replacing broken compiler alias $CC" >&5
1969echo "$as_me: WARNING: replacing broken compiler alias $CC" >&2;}
1970 CFLAGS="$CFLAGS -std=`echo "$CC" | sed -e 's%.*/%%'`"
1971 CC=clang
1972 ;;
1973 esac
1974
1975 echo "$as_me:1975: checking version of $CC" >&5
1976echo $ECHO_N "checking version of $CC... $ECHO_C" >&6
1977 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.].*//'`"
1978 test -z "$CLANG_VERSION" && CLANG_VERSION=unknown
1979 echo "$as_me:1979: result: $CLANG_VERSION" >&5
1980echo "${ECHO_T}$CLANG_VERSION" >&6
1981
1982 for cf_clang_opt in \
1983 -Qunused-arguments \
1984 -Wno-error=implicit-function-declaration
1985 do
1986 echo "$as_me:1986: checking if option $cf_clang_opt works" >&5
1987echo $ECHO_N "checking if option $cf_clang_opt works... $ECHO_C" >&6
1988 cf_save_CFLAGS="$CFLAGS"
1989 CFLAGS="$CFLAGS $cf_clang_opt"
1990 cat >"conftest.$ac_ext" <<_ACEOF
1991#line 1991 "configure"
1992#include "confdefs.h"
1993
1994 #include <stdio.h>
1995int
1996main (void)
1997{
1998
1999 printf("hello!\\n");
2000 ;
2001 return 0;
2002}
2003_ACEOF
2004rm -f "conftest.$ac_objext" "conftest$ac_exeext"
2005if { (eval echo "$as_me:2005: \"$ac_link\"") >&5
2006 (eval $ac_link) 2>&5
2007 ac_status=$?
2008 echo "$as_me:2008: \$? = $ac_status" >&5
2009 (exit "$ac_status"); } &&
2010 { ac_try='test -s "conftest$ac_exeext"'
2011 { (eval echo "$as_me:2011: \"$ac_try\"") >&5
2012 (eval $ac_try) 2>&5
2013 ac_status=$?
2014 echo "$as_me:2014: \$? = $ac_status" >&5
2015 (exit "$ac_status"); }; }; then
2016
2017 cf_clang_optok=yes
2018else
2019 echo "$as_me: failed program was:" >&5
2020cat "conftest.$ac_ext" >&5
2021
2022 cf_clang_optok=no
2023fi
2024rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
2025 echo "$as_me:2025: result: $cf_clang_optok" >&5
2026echo "${ECHO_T}$cf_clang_optok" >&6
2027 CFLAGS="$cf_save_CFLAGS"
2028 if test "$cf_clang_optok" = yes; then
2029 test -n "$verbose" && echo " adding option $cf_clang_opt" 1>&6
2030
2031echo "${as_me:-configure}:2031: testing adding option $cf_clang_opt ..." 1>&5
2032
2033 test -n "$CFLAGS" && CFLAGS="$CFLAGS "
2034 CFLAGS="${CFLAGS}$cf_clang_opt"
2035
2036 fi
2037 done
2038fi
2039
2040echo "$as_me:2040: checking for $CC option to accept ANSI C" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01002041echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6
2042if test "${ac_cv_prog_cc_stdc+set}" = set; then
2043 echo $ECHO_N "(cached) $ECHO_C" >&6
2044else
2045 ac_cv_prog_cc_stdc=no
2046ac_save_CC=$CC
micky3879b9f5e72025-07-08 18:04:53 -04002047cat >"conftest.$ac_ext" <<_ACEOF
2048#line 2048 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +01002049#include "confdefs.h"
2050#include <stdarg.h>
2051#include <stdio.h>
2052#include <sys/types.h>
2053#include <sys/stat.h>
2054/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */
2055struct buf { int x; };
2056FILE * (*rcsopen) (struct buf *, struct stat *, int);
micky3879b9f5e72025-07-08 18:04:53 -04002057static char *e (char **p, int i)
Steve Kondikae271bc2015-11-15 02:50:53 +01002058{
2059 return p[i];
2060}
2061static char *f (char * (*g) (char **, int), char **p, ...)
2062{
2063 char *s;
2064 va_list v;
2065 va_start (v,p);
2066 s = g (p, va_arg (v,int));
2067 va_end (v);
2068 return s;
2069}
2070int test (int i, double x);
2071struct s1 {int (*f) (int a);};
2072struct s2 {int (*f) (double a);};
2073int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
2074int argc;
2075char **argv;
2076int
micky3879b9f5e72025-07-08 18:04:53 -04002077main (void)
Steve Kondikae271bc2015-11-15 02:50:53 +01002078{
2079return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1];
2080 ;
2081 return 0;
2082}
2083_ACEOF
2084# Don't try gcc -ansi; that turns off useful extensions and
2085# breaks some systems' header files.
2086# AIX -qlanglvl=ansi
2087# Ultrix and OSF/1 -std1
2088# HP-UX 10.20 and later -Ae
2089# HP-UX older versions -Aa -D_HPUX_SOURCE
2090# SVR4 -Xc -D__EXTENSIONS__
2091for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
2092do
2093 CC="$ac_save_CC $ac_arg"
micky3879b9f5e72025-07-08 18:04:53 -04002094 rm -f "conftest.$ac_objext"
2095if { (eval echo "$as_me:2095: \"$ac_compile\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01002096 (eval $ac_compile) 2>&5
2097 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -04002098 echo "$as_me:2098: \$? = $ac_status" >&5
2099 (exit "$ac_status"); } &&
2100 { ac_try='test -s "conftest.$ac_objext"'
2101 { (eval echo "$as_me:2101: \"$ac_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01002102 (eval $ac_try) 2>&5
2103 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -04002104 echo "$as_me:2104: \$? = $ac_status" >&5
2105 (exit "$ac_status"); }; }; then
Steve Kondikae271bc2015-11-15 02:50:53 +01002106 ac_cv_prog_cc_stdc=$ac_arg
2107break
2108else
2109 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -04002110cat "conftest.$ac_ext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01002111fi
micky3879b9f5e72025-07-08 18:04:53 -04002112rm -f "conftest.$ac_objext"
Steve Kondikae271bc2015-11-15 02:50:53 +01002113done
micky3879b9f5e72025-07-08 18:04:53 -04002114rm -f "conftest.$ac_ext" "conftest.$ac_objext"
Steve Kondikae271bc2015-11-15 02:50:53 +01002115CC=$ac_save_CC
2116
2117fi
2118
2119case "x$ac_cv_prog_cc_stdc" in
2120 x|xno)
micky3879b9f5e72025-07-08 18:04:53 -04002121 echo "$as_me:2121: result: none needed" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01002122echo "${ECHO_T}none needed" >&6 ;;
2123 *)
micky3879b9f5e72025-07-08 18:04:53 -04002124 echo "$as_me:2124: result: $ac_cv_prog_cc_stdc" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01002125echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6
2126 CC="$CC $ac_cv_prog_cc_stdc" ;;
2127esac
2128
2129# This should have been defined by AC_PROG_CC
micky3879b9f5e72025-07-08 18:04:53 -04002130: "${CC:=cc}"
Steve Kondikae271bc2015-11-15 02:50:53 +01002131
micky3879b9f5e72025-07-08 18:04:53 -04002132echo "$as_me:2132: checking \$CFLAGS variable" >&5
2133echo $ECHO_N "checking \$CFLAGS variable... $ECHO_C" >&6
2134case "x$CFLAGS" in
2135(*-[IUD]*)
2136 echo "$as_me:2136: result: broken" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01002137echo "${ECHO_T}broken" >&6
micky3879b9f5e72025-07-08 18:04:53 -04002138 { echo "$as_me:2138: WARNING: your environment uses the CFLAGS variable to hold CPPFLAGS options" >&5
2139echo "$as_me: WARNING: your environment uses the CFLAGS variable to hold CPPFLAGS options" >&2;}
2140 cf_flags="$CFLAGS"
2141 CFLAGS=
2142 for cf_arg in $cf_flags
2143 do
Steve Kondikae271bc2015-11-15 02:50:53 +01002144
2145cf_fix_cppflags=no
2146cf_new_cflags=
2147cf_new_cppflags=
2148cf_new_extra_cppflags=
2149
micky3879b9f5e72025-07-08 18:04:53 -04002150for cf_add_cflags in $cf_arg
Steve Kondikae271bc2015-11-15 02:50:53 +01002151do
micky3879b9f5e72025-07-08 18:04:53 -04002152case "$cf_fix_cppflags" in
Steve Kondikae271bc2015-11-15 02:50:53 +01002153(no)
micky3879b9f5e72025-07-08 18:04:53 -04002154 case "$cf_add_cflags" in
Steve Kondikae271bc2015-11-15 02:50:53 +01002155 (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
micky3879b9f5e72025-07-08 18:04:53 -04002156 case "$cf_add_cflags" in
Steve Kondikae271bc2015-11-15 02:50:53 +01002157 (-D*)
micky3879b9f5e72025-07-08 18:04:53 -04002158 cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
Steve Kondikae271bc2015-11-15 02:50:53 +01002159
2160 test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
2161 && test -z "${cf_tst_cflags}" \
2162 && cf_fix_cppflags=yes
2163
micky3879b9f5e72025-07-08 18:04:53 -04002164 if test "$cf_fix_cppflags" = yes ; then
2165
2166 test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
2167 cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
2168
Steve Kondikae271bc2015-11-15 02:50:53 +01002169 continue
2170 elif test "${cf_tst_cflags}" = "\"'" ; then
micky3879b9f5e72025-07-08 18:04:53 -04002171
2172 test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
2173 cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
2174
Steve Kondikae271bc2015-11-15 02:50:53 +01002175 continue
2176 fi
2177 ;;
2178 esac
2179 case "$CPPFLAGS" in
2180 (*$cf_add_cflags)
2181 ;;
2182 (*)
micky3879b9f5e72025-07-08 18:04:53 -04002183 case "$cf_add_cflags" in
Steve Kondikae271bc2015-11-15 02:50:53 +01002184 (-D*)
2185 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
2186
2187CPPFLAGS=`echo "$CPPFLAGS" | \
2188 sed -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?[ ]/ /g' \
2189 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?$//g'`
2190
2191 ;;
2192 esac
micky3879b9f5e72025-07-08 18:04:53 -04002193
2194 test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
2195 cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
2196
Steve Kondikae271bc2015-11-15 02:50:53 +01002197 ;;
2198 esac
2199 ;;
2200 (*)
micky3879b9f5e72025-07-08 18:04:53 -04002201
2202 test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
2203 cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
2204
Steve Kondikae271bc2015-11-15 02:50:53 +01002205 ;;
2206 esac
2207 ;;
2208(yes)
Steve Kondikae271bc2015-11-15 02:50:53 +01002209
micky3879b9f5e72025-07-08 18:04:53 -04002210 test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
2211 cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
2212
2213 cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
Steve Kondikae271bc2015-11-15 02:50:53 +01002214
2215 test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
2216 && test -z "${cf_tst_cflags}" \
2217 && cf_fix_cppflags=no
2218 ;;
2219esac
2220done
2221
2222if test -n "$cf_new_cflags" ; then
2223
micky3879b9f5e72025-07-08 18:04:53 -04002224 test -n "$CFLAGS" && CFLAGS="$CFLAGS "
2225 CFLAGS="${CFLAGS}$cf_new_cflags"
2226
Steve Kondikae271bc2015-11-15 02:50:53 +01002227fi
2228
2229if test -n "$cf_new_cppflags" ; then
2230
micky3879b9f5e72025-07-08 18:04:53 -04002231 test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
2232 CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
2233
Steve Kondikae271bc2015-11-15 02:50:53 +01002234fi
2235
2236if test -n "$cf_new_extra_cppflags" ; then
2237
micky3879b9f5e72025-07-08 18:04:53 -04002238 test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
2239 EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
2240
Steve Kondikae271bc2015-11-15 02:50:53 +01002241fi
2242
micky3879b9f5e72025-07-08 18:04:53 -04002243 done
Steve Kondikae271bc2015-11-15 02:50:53 +01002244 ;;
2245(*)
micky3879b9f5e72025-07-08 18:04:53 -04002246 echo "$as_me:2246: result: ok" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01002247echo "${ECHO_T}ok" >&6
2248 ;;
2249esac
2250
micky3879b9f5e72025-07-08 18:04:53 -04002251echo "$as_me:2251: checking \$CC variable" >&5
2252echo $ECHO_N "checking \$CC variable... $ECHO_C" >&6
2253case "$CC" in
2254(*[\ \ ]-*)
2255 echo "$as_me:2255: result: broken" >&5
2256echo "${ECHO_T}broken" >&6
2257 { echo "$as_me:2257: WARNING: your environment uses the CC variable to hold CFLAGS/CPPFLAGS options" >&5
2258echo "$as_me: WARNING: your environment uses the CC variable to hold CFLAGS/CPPFLAGS options" >&2;}
2259 # humor him...
2260 cf_prog=`echo "$CC" | sed -e 's/ / /g' -e 's/[ ]* / /g' -e 's/[ ]*[ ]-[^ ].*//'`
2261 cf_flags=`echo "$CC" | sed -e "s%^$cf_prog%%"`
2262 CC="$cf_prog"
2263 for cf_arg in $cf_flags
2264 do
2265 case "x$cf_arg" in
2266 (x-[IUDfgOW]*)
2267
2268cf_fix_cppflags=no
2269cf_new_cflags=
2270cf_new_cppflags=
2271cf_new_extra_cppflags=
2272
2273for cf_add_cflags in $cf_arg
2274do
2275case "$cf_fix_cppflags" in
2276(no)
2277 case "$cf_add_cflags" in
2278 (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
2279 case "$cf_add_cflags" in
2280 (-D*)
2281 cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
2282
2283 test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
2284 && test -z "${cf_tst_cflags}" \
2285 && cf_fix_cppflags=yes
2286
2287 if test "$cf_fix_cppflags" = yes ; then
2288
2289 test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
2290 cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
2291
2292 continue
2293 elif test "${cf_tst_cflags}" = "\"'" ; then
2294
2295 test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
2296 cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
2297
2298 continue
2299 fi
2300 ;;
2301 esac
2302 case "$CPPFLAGS" in
2303 (*$cf_add_cflags)
2304 ;;
2305 (*)
2306 case "$cf_add_cflags" in
2307 (-D*)
2308 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
2309
2310CPPFLAGS=`echo "$CPPFLAGS" | \
2311 sed -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?[ ]/ /g' \
2312 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?$//g'`
2313
2314 ;;
2315 esac
2316
2317 test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
2318 cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
2319
2320 ;;
2321 esac
2322 ;;
2323 (*)
2324
2325 test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
2326 cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
2327
2328 ;;
2329 esac
2330 ;;
2331(yes)
2332
2333 test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
2334 cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
2335
2336 cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
2337
2338 test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
2339 && test -z "${cf_tst_cflags}" \
2340 && cf_fix_cppflags=no
2341 ;;
2342esac
2343done
2344
2345if test -n "$cf_new_cflags" ; then
2346
2347 test -n "$CFLAGS" && CFLAGS="$CFLAGS "
2348 CFLAGS="${CFLAGS}$cf_new_cflags"
2349
2350fi
2351
2352if test -n "$cf_new_cppflags" ; then
2353
2354 test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
2355 CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
2356
2357fi
2358
2359if test -n "$cf_new_extra_cppflags" ; then
2360
2361 test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
2362 EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
2363
2364fi
2365
2366 ;;
2367 (*)
2368 CC="$CC $cf_arg"
2369 ;;
2370 esac
2371 done
2372 test -n "$verbose" && echo " resulting CC: '$CC'" 1>&6
2373
2374echo "${as_me:-configure}:2374: testing resulting CC: '$CC' ..." 1>&5
2375
2376 test -n "$verbose" && echo " resulting CFLAGS: '$CFLAGS'" 1>&6
2377
2378echo "${as_me:-configure}:2378: testing resulting CFLAGS: '$CFLAGS' ..." 1>&5
2379
2380 test -n "$verbose" && echo " resulting CPPFLAGS: '$CPPFLAGS'" 1>&6
2381
2382echo "${as_me:-configure}:2382: testing resulting CPPFLAGS: '$CPPFLAGS' ..." 1>&5
2383
2384 ;;
2385(*)
2386 echo "$as_me:2386: result: ok" >&5
2387echo "${ECHO_T}ok" >&6
2388 ;;
2389esac
2390
2391echo "$as_me:2391: checking for egrep" >&5
2392echo $ECHO_N "checking for egrep... $ECHO_C" >&6
2393if test "${ac_cv_path_EGREP+set}" = set; then
2394 echo $ECHO_N "(cached) $ECHO_C" >&6
2395else
2396 if echo a | $GREP -E '(a|b)' >/dev/null 2>&1
2397 then ac_cv_path_EGREP="$GREP -E"
2398 else
2399 for ac_prog in gegrep egrep
2400do
2401 # Extract the first word of "$ac_prog", so it can be a program name with args.
2402set dummy $ac_prog; ac_word=$2
2403echo "$as_me:2403: checking for $ac_word" >&5
2404echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2405if test "${ac_cv_path_EGREP+set}" = set; then
2406 echo $ECHO_N "(cached) $ECHO_C" >&6
2407else
2408 case $EGREP in
2409 [\\/]* | ?:[\\/]*)
2410 ac_cv_path_EGREP="$EGREP" # Let the user override the test with a path.
2411 ;;
2412 *)
2413 ac_save_IFS=$IFS; IFS=$ac_path_separator
2414ac_dummy="$PATH"
2415for ac_dir in $ac_dummy; do
2416 IFS=$ac_save_IFS
2417 test -z "$ac_dir" && ac_dir=.
2418 if $as_executable_p "$ac_dir/$ac_word"; then
2419 ac_cv_path_EGREP="$ac_dir/$ac_word"
2420 echo "$as_me:2420: found $ac_dir/$ac_word" >&5
2421 break
2422fi
2423done
2424
2425 ;;
2426esac
2427fi
2428EGREP=$ac_cv_path_EGREP
2429
2430if test -n "$EGREP"; then
2431 echo "$as_me:2431: result: $EGREP" >&5
2432echo "${ECHO_T}$EGREP" >&6
2433else
2434 echo "$as_me:2434: result: no" >&5
2435echo "${ECHO_T}no" >&6
2436fi
2437
2438 test -n "$EGREP" && break
2439done
2440test -n "$EGREP" || EGREP=": "
2441
2442 test "x$ac_cv_path_EGREP" = "x:" && { { echo "$as_me:2442: error: cannot find workable egrep" >&5
2443echo "$as_me: error: cannot find workable egrep" >&2;}
2444 { (exit 1); exit 1; }; }
2445 fi
2446fi
2447echo "$as_me:2447: result: $ac_cv_path_EGREP" >&5
2448echo "${ECHO_T}$ac_cv_path_EGREP" >&6
2449 EGREP="$ac_cv_path_EGREP"
2450
Steve Kondikae271bc2015-11-15 02:50:53 +01002451ac_ext=c
2452ac_cpp='$CPP $CPPFLAGS'
micky3879b9f5e72025-07-08 18:04:53 -04002453ac_compile='$CC -c $CFLAGS $CPPFLAGS "conftest.$ac_ext" >&5'
2454ac_link='$CC -o "conftest$ac_exeext" $CFLAGS $CPPFLAGS $LDFLAGS "conftest.$ac_ext" $LIBS >&5'
Steve Kondikae271bc2015-11-15 02:50:53 +01002455ac_compiler_gnu=$ac_cv_c_compiler_gnu
micky3879b9f5e72025-07-08 18:04:53 -04002456ac_main_return="return"
2457echo "$as_me:2457: checking how to run the C preprocessor" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01002458echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6
2459# On Suns, sometimes $CPP names a directory.
2460if test -n "$CPP" && test -d "$CPP"; then
2461 CPP=
2462fi
2463if test -z "$CPP"; then
2464 if test "${ac_cv_prog_CPP+set}" = set; then
2465 echo $ECHO_N "(cached) $ECHO_C" >&6
2466else
2467 # Double quotes because CPP needs to be expanded
2468 for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
2469 do
2470 ac_preproc_ok=false
2471for ac_c_preproc_warn_flag in '' yes
2472do
2473 # Use a header file that comes with gcc, so configuring glibc
2474 # with a fresh cross-compiler works.
2475 # On the NeXT, cc -E runs the code through the compiler's parser,
2476 # not just through cpp. "Syntax error" is here to catch this case.
micky3879b9f5e72025-07-08 18:04:53 -04002477 cat >"conftest.$ac_ext" <<_ACEOF
2478#line 2478 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +01002479#include "confdefs.h"
2480#include <assert.h>
2481 Syntax error
2482_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -04002483if { (eval echo "$as_me:2483: \"$ac_cpp "conftest.$ac_ext"\"") >&5
2484 (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
Steve Kondikae271bc2015-11-15 02:50:53 +01002485 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -04002486 $EGREP -v '^ *\+' conftest.er1 >conftest.err
Steve Kondikae271bc2015-11-15 02:50:53 +01002487 rm -f conftest.er1
2488 cat conftest.err >&5
micky3879b9f5e72025-07-08 18:04:53 -04002489 echo "$as_me:2489: \$? = $ac_status" >&5
2490 (exit "$ac_status"); } >/dev/null; then
Steve Kondikae271bc2015-11-15 02:50:53 +01002491 if test -s conftest.err; then
2492 ac_cpp_err=$ac_c_preproc_warn_flag
2493 else
2494 ac_cpp_err=
2495 fi
2496else
2497 ac_cpp_err=yes
2498fi
2499if test -z "$ac_cpp_err"; then
2500 :
2501else
2502 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -04002503 cat "conftest.$ac_ext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01002504 # Broken: fails on valid input.
2505continue
2506fi
micky3879b9f5e72025-07-08 18:04:53 -04002507rm -f conftest.err "conftest.$ac_ext"
Steve Kondikae271bc2015-11-15 02:50:53 +01002508
2509 # OK, works on sane cases. Now check whether non-existent headers
2510 # can be detected and how.
micky3879b9f5e72025-07-08 18:04:53 -04002511 cat >"conftest.$ac_ext" <<_ACEOF
2512#line 2512 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +01002513#include "confdefs.h"
2514#include <ac_nonexistent.h>
2515_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -04002516if { (eval echo "$as_me:2516: \"$ac_cpp "conftest.$ac_ext"\"") >&5
2517 (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
Steve Kondikae271bc2015-11-15 02:50:53 +01002518 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -04002519 $EGREP -v '^ *\+' conftest.er1 >conftest.err
Steve Kondikae271bc2015-11-15 02:50:53 +01002520 rm -f conftest.er1
2521 cat conftest.err >&5
micky3879b9f5e72025-07-08 18:04:53 -04002522 echo "$as_me:2522: \$? = $ac_status" >&5
2523 (exit "$ac_status"); } >/dev/null; then
Steve Kondikae271bc2015-11-15 02:50:53 +01002524 if test -s conftest.err; then
2525 ac_cpp_err=$ac_c_preproc_warn_flag
2526 else
2527 ac_cpp_err=
2528 fi
2529else
2530 ac_cpp_err=yes
2531fi
2532if test -z "$ac_cpp_err"; then
2533 # Broken: success on invalid input.
2534continue
2535else
2536 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -04002537 cat "conftest.$ac_ext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01002538 # Passes both tests.
2539ac_preproc_ok=:
2540break
2541fi
micky3879b9f5e72025-07-08 18:04:53 -04002542rm -f conftest.err "conftest.$ac_ext"
Steve Kondikae271bc2015-11-15 02:50:53 +01002543
2544done
2545# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
micky3879b9f5e72025-07-08 18:04:53 -04002546rm -f conftest.err "conftest.$ac_ext"
Steve Kondikae271bc2015-11-15 02:50:53 +01002547if $ac_preproc_ok; then
2548 break
2549fi
2550
2551 done
2552 ac_cv_prog_CPP=$CPP
2553
2554fi
2555 CPP=$ac_cv_prog_CPP
2556else
2557 ac_cv_prog_CPP=$CPP
2558fi
micky3879b9f5e72025-07-08 18:04:53 -04002559echo "$as_me:2559: result: $CPP" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01002560echo "${ECHO_T}$CPP" >&6
2561ac_preproc_ok=false
2562for ac_c_preproc_warn_flag in '' yes
2563do
2564 # Use a header file that comes with gcc, so configuring glibc
2565 # with a fresh cross-compiler works.
2566 # On the NeXT, cc -E runs the code through the compiler's parser,
2567 # not just through cpp. "Syntax error" is here to catch this case.
micky3879b9f5e72025-07-08 18:04:53 -04002568 cat >"conftest.$ac_ext" <<_ACEOF
2569#line 2569 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +01002570#include "confdefs.h"
2571#include <assert.h>
2572 Syntax error
2573_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -04002574if { (eval echo "$as_me:2574: \"$ac_cpp "conftest.$ac_ext"\"") >&5
2575 (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
Steve Kondikae271bc2015-11-15 02:50:53 +01002576 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -04002577 $EGREP -v '^ *\+' conftest.er1 >conftest.err
Steve Kondikae271bc2015-11-15 02:50:53 +01002578 rm -f conftest.er1
2579 cat conftest.err >&5
micky3879b9f5e72025-07-08 18:04:53 -04002580 echo "$as_me:2580: \$? = $ac_status" >&5
2581 (exit "$ac_status"); } >/dev/null; then
Steve Kondikae271bc2015-11-15 02:50:53 +01002582 if test -s conftest.err; then
2583 ac_cpp_err=$ac_c_preproc_warn_flag
2584 else
2585 ac_cpp_err=
2586 fi
2587else
2588 ac_cpp_err=yes
2589fi
2590if test -z "$ac_cpp_err"; then
2591 :
2592else
2593 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -04002594 cat "conftest.$ac_ext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01002595 # Broken: fails on valid input.
2596continue
2597fi
micky3879b9f5e72025-07-08 18:04:53 -04002598rm -f conftest.err "conftest.$ac_ext"
Steve Kondikae271bc2015-11-15 02:50:53 +01002599
2600 # OK, works on sane cases. Now check whether non-existent headers
2601 # can be detected and how.
micky3879b9f5e72025-07-08 18:04:53 -04002602 cat >"conftest.$ac_ext" <<_ACEOF
2603#line 2603 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +01002604#include "confdefs.h"
2605#include <ac_nonexistent.h>
2606_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -04002607if { (eval echo "$as_me:2607: \"$ac_cpp "conftest.$ac_ext"\"") >&5
2608 (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
Steve Kondikae271bc2015-11-15 02:50:53 +01002609 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -04002610 $EGREP -v '^ *\+' conftest.er1 >conftest.err
Steve Kondikae271bc2015-11-15 02:50:53 +01002611 rm -f conftest.er1
2612 cat conftest.err >&5
micky3879b9f5e72025-07-08 18:04:53 -04002613 echo "$as_me:2613: \$? = $ac_status" >&5
2614 (exit "$ac_status"); } >/dev/null; then
Steve Kondikae271bc2015-11-15 02:50:53 +01002615 if test -s conftest.err; then
2616 ac_cpp_err=$ac_c_preproc_warn_flag
2617 else
2618 ac_cpp_err=
2619 fi
2620else
2621 ac_cpp_err=yes
2622fi
2623if test -z "$ac_cpp_err"; then
2624 # Broken: success on invalid input.
2625continue
2626else
2627 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -04002628 cat "conftest.$ac_ext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01002629 # Passes both tests.
2630ac_preproc_ok=:
2631break
2632fi
micky3879b9f5e72025-07-08 18:04:53 -04002633rm -f conftest.err "conftest.$ac_ext"
Steve Kondikae271bc2015-11-15 02:50:53 +01002634
2635done
2636# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
micky3879b9f5e72025-07-08 18:04:53 -04002637rm -f conftest.err "conftest.$ac_ext"
Steve Kondikae271bc2015-11-15 02:50:53 +01002638if $ac_preproc_ok; then
2639 :
2640else
micky3879b9f5e72025-07-08 18:04:53 -04002641 { { echo "$as_me:2641: error: C preprocessor \"$CPP\" fails sanity check" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01002642echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check" >&2;}
2643 { (exit 1); exit 1; }; }
2644fi
2645
2646ac_ext=c
2647ac_cpp='$CPP $CPPFLAGS'
micky3879b9f5e72025-07-08 18:04:53 -04002648ac_compile='$CC -c $CFLAGS $CPPFLAGS "conftest.$ac_ext" >&5'
2649ac_link='$CC -o "conftest$ac_exeext" $CFLAGS $CPPFLAGS $LDFLAGS "conftest.$ac_ext" $LIBS >&5'
Steve Kondikae271bc2015-11-15 02:50:53 +01002650ac_compiler_gnu=$ac_cv_c_compiler_gnu
micky3879b9f5e72025-07-08 18:04:53 -04002651ac_main_return="return"
Steve Kondikae271bc2015-11-15 02:50:53 +01002652
2653if test $ac_cv_c_compiler_gnu = yes; then
micky3879b9f5e72025-07-08 18:04:53 -04002654 echo "$as_me:2654: checking whether $CC needs -traditional" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01002655echo $ECHO_N "checking whether $CC needs -traditional... $ECHO_C" >&6
2656if test "${ac_cv_prog_gcc_traditional+set}" = set; then
2657 echo $ECHO_N "(cached) $ECHO_C" >&6
2658else
2659 ac_pattern="Autoconf.*'x'"
micky3879b9f5e72025-07-08 18:04:53 -04002660 cat >"conftest.$ac_ext" <<_ACEOF
2661#line 2661 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +01002662#include "confdefs.h"
2663#include <sgtty.h>
2664int Autoconf = TIOCGETP;
2665_ACEOF
2666if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
micky3879b9f5e72025-07-08 18:04:53 -04002667 $EGREP "$ac_pattern" >/dev/null 2>&1; then
Steve Kondikae271bc2015-11-15 02:50:53 +01002668 ac_cv_prog_gcc_traditional=yes
2669else
2670 ac_cv_prog_gcc_traditional=no
2671fi
2672rm -rf conftest*
2673
2674 if test $ac_cv_prog_gcc_traditional = no; then
micky3879b9f5e72025-07-08 18:04:53 -04002675 cat >"conftest.$ac_ext" <<_ACEOF
2676#line 2676 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +01002677#include "confdefs.h"
2678#include <termio.h>
2679int Autoconf = TCGETA;
2680_ACEOF
2681if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
micky3879b9f5e72025-07-08 18:04:53 -04002682 $EGREP "$ac_pattern" >/dev/null 2>&1; then
Steve Kondikae271bc2015-11-15 02:50:53 +01002683 ac_cv_prog_gcc_traditional=yes
2684fi
2685rm -rf conftest*
2686
2687 fi
2688fi
micky3879b9f5e72025-07-08 18:04:53 -04002689echo "$as_me:2689: result: $ac_cv_prog_gcc_traditional" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01002690echo "${ECHO_T}$ac_cv_prog_gcc_traditional" >&6
2691 if test $ac_cv_prog_gcc_traditional = yes; then
2692 CC="$CC -traditional"
2693 fi
2694fi
2695
micky3879b9f5e72025-07-08 18:04:53 -04002696echo "$as_me:2696: checking whether $CC understands -c and -o together" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01002697echo $ECHO_N "checking whether $CC understands -c and -o together... $ECHO_C" >&6
2698if test "${cf_cv_prog_CC_c_o+set}" = set; then
2699 echo $ECHO_N "(cached) $ECHO_C" >&6
2700else
2701
2702cat > conftest.$ac_ext <<CF_EOF
micky3879b9f5e72025-07-08 18:04:53 -04002703int main(void)
Steve Kondikae271bc2015-11-15 02:50:53 +01002704{
2705 ${cf_cv_main_return:-return}(0);
2706}
2707CF_EOF
2708# We do the test twice because some compilers refuse to overwrite an
2709# existing .o file with -o, though they will create one.
micky3879b9f5e72025-07-08 18:04:53 -04002710ac_try='$CC $CFLAGS $CPPFLAGS -c conftest.$ac_ext -o conftest2.$ac_objext >&5'
2711if { (eval echo "$as_me:2711: \"$ac_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01002712 (eval $ac_try) 2>&5
2713 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -04002714 echo "$as_me:2714: \$? = $ac_status" >&5
2715 (exit "$ac_status"); } &&
2716 test -f conftest2.$ac_objext && { (eval echo "$as_me:2716: \"$ac_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01002717 (eval $ac_try) 2>&5
2718 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -04002719 echo "$as_me:2719: \$? = $ac_status" >&5
2720 (exit "$ac_status"); };
Steve Kondikae271bc2015-11-15 02:50:53 +01002721then
2722 eval cf_cv_prog_CC_c_o=yes
2723else
2724 eval cf_cv_prog_CC_c_o=no
2725fi
micky3879b9f5e72025-07-08 18:04:53 -04002726rm -rf ./conftest*
Steve Kondikae271bc2015-11-15 02:50:53 +01002727
2728fi
micky3879b9f5e72025-07-08 18:04:53 -04002729if test "$cf_cv_prog_CC_c_o" = yes; then
2730 echo "$as_me:2730: result: yes" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01002731echo "${ECHO_T}yes" >&6
2732else
micky3879b9f5e72025-07-08 18:04:53 -04002733 echo "$as_me:2733: result: no" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01002734echo "${ECHO_T}no" >&6
2735fi
2736
2737test "$program_prefix" != NONE &&
2738 program_transform_name="s,^,$program_prefix,;$program_transform_name"
2739# Use a double $ so make ignores it.
2740test "$program_suffix" != NONE &&
2741 program_transform_name="s,\$,$program_suffix,;$program_transform_name"
2742# Double any \ or $. echo might interpret backslashes.
2743# By default was `s,x,x', remove it if useless.
2744cat <<\_ACEOF >conftest.sed
2745s/[\\$]/&&/g;s/;s,x,x,$//
2746_ACEOF
2747program_transform_name=`echo $program_transform_name | sed -f conftest.sed`
2748rm conftest.sed
2749
2750for ac_prog in mawk gawk nawk awk
2751do
2752 # Extract the first word of "$ac_prog", so it can be a program name with args.
2753set dummy $ac_prog; ac_word=$2
micky3879b9f5e72025-07-08 18:04:53 -04002754echo "$as_me:2754: checking for $ac_word" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01002755echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2756if test "${ac_cv_prog_AWK+set}" = set; then
2757 echo $ECHO_N "(cached) $ECHO_C" >&6
2758else
2759 if test -n "$AWK"; then
2760 ac_cv_prog_AWK="$AWK" # Let the user override the test.
2761else
2762 ac_save_IFS=$IFS; IFS=$ac_path_separator
2763ac_dummy="$PATH"
2764for ac_dir in $ac_dummy; do
2765 IFS=$ac_save_IFS
2766 test -z "$ac_dir" && ac_dir=.
2767 $as_executable_p "$ac_dir/$ac_word" || continue
2768ac_cv_prog_AWK="$ac_prog"
micky3879b9f5e72025-07-08 18:04:53 -04002769echo "$as_me:2769: found $ac_dir/$ac_word" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01002770break
2771done
2772
2773fi
2774fi
2775AWK=$ac_cv_prog_AWK
2776if test -n "$AWK"; then
micky3879b9f5e72025-07-08 18:04:53 -04002777 echo "$as_me:2777: result: $AWK" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01002778echo "${ECHO_T}$AWK" >&6
2779else
micky3879b9f5e72025-07-08 18:04:53 -04002780 echo "$as_me:2780: result: no" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01002781echo "${ECHO_T}no" >&6
2782fi
2783
2784 test -n "$AWK" && break
2785done
2786
micky3879b9f5e72025-07-08 18:04:53 -04002787test -z "$AWK" && { { echo "$as_me:2787: error: No awk program found" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01002788echo "$as_me: error: No awk program found" >&2;}
2789 { (exit 1); exit 1; }; }
2790
micky3879b9f5e72025-07-08 18:04:53 -04002791echo "$as_me:2791: checking for egrep" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01002792echo $ECHO_N "checking for egrep... $ECHO_C" >&6
2793if test "${ac_cv_prog_egrep+set}" = set; then
2794 echo $ECHO_N "(cached) $ECHO_C" >&6
2795else
2796 if echo a | (grep -E '(a|b)') >/dev/null 2>&1
2797 then ac_cv_prog_egrep='grep -E'
2798 else ac_cv_prog_egrep='egrep'
2799 fi
2800fi
micky3879b9f5e72025-07-08 18:04:53 -04002801echo "$as_me:2801: result: $ac_cv_prog_egrep" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01002802echo "${ECHO_T}$ac_cv_prog_egrep" >&6
2803 EGREP=$ac_cv_prog_egrep
2804
micky3879b9f5e72025-07-08 18:04:53 -04002805 test -z "$EGREP" && { { echo "$as_me:2805: error: No egrep program found" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01002806echo "$as_me: error: No egrep program found" >&2;}
2807 { (exit 1); exit 1; }; }
2808
2809# Find a good install program. We prefer a C program (faster),
2810# so one script is as good as another. But avoid the broken or
2811# incompatible versions:
2812# SysV /etc/install, /usr/sbin/install
2813# SunOS /usr/etc/install
2814# IRIX /sbin/install
2815# AIX /bin/install
2816# AmigaOS /C/install, which installs bootblocks on floppy discs
2817# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
2818# AFS /usr/afsws/bin/install, which mishandles nonexistent args
2819# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
2820# ./install, which can be erroneously created by make from ./install.sh.
micky3879b9f5e72025-07-08 18:04:53 -04002821echo "$as_me:2821: checking for a BSD compatible install" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01002822echo $ECHO_N "checking for a BSD compatible install... $ECHO_C" >&6
2823if test -z "$INSTALL"; then
2824if test "${ac_cv_path_install+set}" = set; then
2825 echo $ECHO_N "(cached) $ECHO_C" >&6
2826else
2827 ac_save_IFS=$IFS; IFS=$ac_path_separator
2828 for ac_dir in $PATH; do
2829 IFS=$ac_save_IFS
2830 # Account for people who put trailing slashes in PATH elements.
2831 case $ac_dir/ in
2832 / | ./ | .// | /cC/* \
2833 | /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* \
2834 | /usr/ucb/* ) ;;
2835 *)
2836 # OSF1 and SCO ODT 3.0 have their own names for install.
2837 # Don't use installbsd from OSF since it installs stuff as root
2838 # by default.
2839 for ac_prog in ginstall scoinst install; do
2840 if $as_executable_p "$ac_dir/$ac_prog"; then
2841 if test $ac_prog = install &&
2842 grep dspmsg "$ac_dir/$ac_prog" >/dev/null 2>&1; then
2843 # AIX install. It has an incompatible calling convention.
2844 :
2845 elif test $ac_prog = install &&
2846 grep pwplus "$ac_dir/$ac_prog" >/dev/null 2>&1; then
2847 # program-specific install script used by HP pwplus--don't use.
2848 :
2849 else
2850 ac_cv_path_install="$ac_dir/$ac_prog -c"
2851 break 2
2852 fi
2853 fi
2854 done
2855 ;;
2856 esac
2857 done
2858
2859fi
2860 if test "${ac_cv_path_install+set}" = set; then
2861 INSTALL=$ac_cv_path_install
2862 else
2863 # As a last resort, use the slow shell script. We don't cache a
2864 # path for INSTALL within a source directory, because that will
2865 # break other packages using the cache if that directory is
2866 # removed, or if the path is relative.
2867 INSTALL=$ac_install_sh
2868 fi
2869fi
micky3879b9f5e72025-07-08 18:04:53 -04002870echo "$as_me:2870: result: $INSTALL" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01002871echo "${ECHO_T}$INSTALL" >&6
2872
2873# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
2874# It thinks the first close brace ends the variable substitution.
2875test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
2876
2877test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
2878
2879test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
2880
micky3879b9f5e72025-07-08 18:04:53 -04002881echo "$as_me:2881: checking whether ln -s works" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01002882echo $ECHO_N "checking whether ln -s works... $ECHO_C" >&6
2883LN_S=$as_ln_s
2884if test "$LN_S" = "ln -s"; then
micky3879b9f5e72025-07-08 18:04:53 -04002885 echo "$as_me:2885: result: yes" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01002886echo "${ECHO_T}yes" >&6
2887else
micky3879b9f5e72025-07-08 18:04:53 -04002888 echo "$as_me:2888: result: no, using $LN_S" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01002889echo "${ECHO_T}no, using $LN_S" >&6
2890fi
2891
micky3879b9f5e72025-07-08 18:04:53 -04002892echo "$as_me:2892: checking if $LN_S -f options work" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01002893echo $ECHO_N "checking if $LN_S -f options work... $ECHO_C" >&6
2894
2895rm -f conf$$.src conf$$dst
2896echo >conf$$.dst
2897echo first >conf$$.src
2898if $LN_S -f conf$$.src conf$$.dst 2>/dev/null; then
2899 cf_prog_ln_sf=yes
2900else
2901 cf_prog_ln_sf=no
2902fi
2903rm -f conf$$.dst conf$$src
micky3879b9f5e72025-07-08 18:04:53 -04002904echo "$as_me:2904: result: $cf_prog_ln_sf" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01002905echo "${ECHO_T}$cf_prog_ln_sf" >&6
2906
2907test "$cf_prog_ln_sf" = yes && LN_S="$LN_S -f"
2908
micky3879b9f5e72025-07-08 18:04:53 -04002909# Find a good install program. We prefer a C program (faster),
2910# so one script is as good as another. But avoid the broken or
2911# incompatible versions:
2912# SysV /etc/install, /usr/sbin/install
2913# SunOS /usr/etc/install
2914# IRIX /sbin/install
2915# AIX /bin/install
2916# AmigaOS /C/install, which installs bootblocks on floppy discs
2917# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
2918# AFS /usr/afsws/bin/install, which mishandles nonexistent args
2919# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
2920# ./install, which can be erroneously created by make from ./install.sh.
2921echo "$as_me:2921: checking for a BSD compatible install" >&5
2922echo $ECHO_N "checking for a BSD compatible install... $ECHO_C" >&6
2923if test -z "$INSTALL"; then
2924if test "${ac_cv_path_install+set}" = set; then
2925 echo $ECHO_N "(cached) $ECHO_C" >&6
2926else
2927 ac_save_IFS=$IFS; IFS=$ac_path_separator
2928 for ac_dir in $PATH; do
2929 IFS=$ac_save_IFS
2930 # Account for people who put trailing slashes in PATH elements.
2931 case $ac_dir/ in
2932 / | ./ | .// | /cC/* \
2933 | /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* \
2934 | /usr/ucb/* ) ;;
2935 *)
2936 # OSF1 and SCO ODT 3.0 have their own names for install.
2937 # Don't use installbsd from OSF since it installs stuff as root
2938 # by default.
2939 for ac_prog in ginstall scoinst install; do
2940 if $as_executable_p "$ac_dir/$ac_prog"; then
2941 if test $ac_prog = install &&
2942 grep dspmsg "$ac_dir/$ac_prog" >/dev/null 2>&1; then
2943 # AIX install. It has an incompatible calling convention.
2944 :
2945 elif test $ac_prog = install &&
2946 grep pwplus "$ac_dir/$ac_prog" >/dev/null 2>&1; then
2947 # program-specific install script used by HP pwplus--don't use.
2948 :
2949 else
2950 ac_cv_path_install="$ac_dir/$ac_prog -c"
2951 break 2
2952 fi
2953 fi
2954 done
2955 ;;
2956 esac
2957 done
2958
2959fi
2960 if test "${ac_cv_path_install+set}" = set; then
2961 INSTALL=$ac_cv_path_install
2962 else
2963 # As a last resort, use the slow shell script. We don't cache a
2964 # path for INSTALL within a source directory, because that will
2965 # break other packages using the cache if that directory is
2966 # removed, or if the path is relative.
2967 INSTALL=$ac_install_sh
2968 fi
2969fi
2970echo "$as_me:2970: result: $INSTALL" >&5
2971echo "${ECHO_T}$INSTALL" >&6
2972
2973# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
2974# It thinks the first close brace ends the variable substitution.
2975test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
2976
2977test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
2978
2979test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
2980
2981case $INSTALL in
2982(/*)
2983 ;;
2984(*)
2985 cf_dir=`echo "$INSTALL" | sed -e 's%/[^/]*$%%'`
2986 test -z "$cf_dir" && cf_dir=.
2987 INSTALL="`cd \"$cf_dir\" && pwd`"/"`echo "$INSTALL" | sed -e 's%^.*/%%'`"
2988 ;;
2989esac
2990
2991echo "$as_me:2991: checking if you want to install stripped executables" >&5
2992echo $ECHO_N "checking if you want to install stripped executables... $ECHO_C" >&6
2993
2994# Check whether --enable-stripping or --disable-stripping was given.
2995if test "${enable_stripping+set}" = set; then
2996 enableval="$enable_stripping"
2997 test "$enableval" != no && enableval=yes
2998 if test "$enableval" != "yes" ; then
2999 enable_stripping=no
3000 else
3001 enable_stripping=yes
3002 fi
3003else
3004 enableval=yes
3005 enable_stripping=yes
3006
3007fi;
3008echo "$as_me:3008: result: $enable_stripping" >&5
3009echo "${ECHO_T}$enable_stripping" >&6
3010
3011if test "$enable_stripping" = yes
3012then
3013 INSTALL_OPT_S="-s"
3014else
3015 INSTALL_OPT_S=
3016fi
3017
3018: "${INSTALL:=install}"
3019echo "$as_me:3019: checking if install accepts -p option" >&5
3020echo $ECHO_N "checking if install accepts -p option... $ECHO_C" >&6
3021if test "${cf_cv_install_p+set}" = set; then
3022 echo $ECHO_N "(cached) $ECHO_C" >&6
3023else
3024
3025 rm -rf ./conftest*
3026 date >conftest.in
3027 mkdir conftest.out
3028 sleep 3
3029 if $INSTALL -p conftest.in conftest.out 2>/dev/null
3030 then
3031 if test -f conftest.out/conftest.in
3032 then
3033 test conftest.in -nt conftest.out/conftest.in 2>conftest.err && \
3034 test conftest.out/conftest.in -nt conftest.in 2>conftest.err
3035 if test -s conftest.err
3036 then
3037 cf_cv_install_p=no
3038 else
3039 cf_cv_install_p=yes
3040 fi
3041 else
3042 cf_cv_install_p=no
3043 fi
3044 else
3045 cf_cv_install_p=no
3046 fi
3047 rm -rf ./conftest*
3048
3049fi
3050echo "$as_me:3050: result: $cf_cv_install_p" >&5
3051echo "${ECHO_T}$cf_cv_install_p" >&6
3052
3053echo "$as_me:3053: checking if install needs to be told about ownership" >&5
3054echo $ECHO_N "checking if install needs to be told about ownership... $ECHO_C" >&6
3055case `$ac_config_guess` in
3056(*minix)
3057 with_install_o=yes
3058 ;;
3059(*)
3060 with_install_o=no
3061 ;;
3062esac
3063
3064echo "$as_me:3064: result: $with_install_o" >&5
3065echo "${ECHO_T}$with_install_o" >&6
3066if test "x$with_install_o" = xyes
3067then
3068 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'`"
3069else
3070 INSTALL_OPT_O=
3071fi
3072
3073if test -n "$INSTALL_OPT_S"
3074then
3075 echo "$as_me:3075: checking if you want to specify strip-program" >&5
3076echo $ECHO_N "checking if you want to specify strip-program... $ECHO_C" >&6
3077
3078# Check whether --with-strip-program or --without-strip-program was given.
3079if test "${with_strip_program+set}" = set; then
3080 withval="$with_strip_program"
3081 with_strip_program=$withval
3082else
3083 with_strip_program=no
3084fi;
3085 echo "$as_me:3085: result: $with_strip_program" >&5
3086echo "${ECHO_T}$with_strip_program" >&6
3087 if test "$with_strip_program" != no
3088 then
3089 echo "$as_me:3089: checking if strip-program is supported with this installer" >&5
3090echo $ECHO_N "checking if strip-program is supported with this installer... $ECHO_C" >&6
3091 cf_install_program=`echo "$INSTALL" | sed -e 's%[ ]*[ ]-.%%'`
3092 check_install_strip=no
3093 if test -f "$cf_install_program"
3094 then
3095 check_install_version=`"$cf_install_program" --version 2>/dev/null | head -n 1 | grep coreutils`
3096 if test -n "$check_install_version"
3097 then
3098 check_install_strip="option"
3099 else
3100 for check_strip_variable in STRIPBIN STRIP
3101 do
3102 if strings "$cf_install_program" | grep "^$check_strip_variable$" >/dev/null
3103 then
3104 check_install_strip="environ"
3105 break
3106 fi
3107 done
3108 fi
3109 fi
3110 echo "$as_me:3110: result: $check_install_strip" >&5
3111echo "${ECHO_T}$check_install_strip" >&6
3112 case "$check_install_strip" in
3113 (no)
3114 { echo "$as_me:3114: WARNING: $cf_install_program does not support strip program option" >&5
3115echo "$as_me: WARNING: $cf_install_program does not support strip program option" >&2;}
3116 with_strip_program=no
3117 ;;
3118 (environ)
3119 cat >install.tmp <<-CF_EOF
3120 #! $SHELL
3121 STRIPBIN="$with_strip_program" \\
3122 STRIP="$with_strip_program" \\
3123 $INSTALL "$@"
3124 CF_EOF
3125 INSTALL="`pwd`/install.tmp"
3126 chmod +x "$INSTALL"
3127 test -n "$verbose" && echo " created $INSTALL" 1>&6
3128
3129echo "${as_me:-configure}:3129: testing created $INSTALL ..." 1>&5
3130
3131 ;;
3132 (option)
3133 INSTALL_OPT_S="$INSTALL_OPT_S --strip-program=\"$with_strip_program\""
3134 ;;
3135 esac
3136 fi
3137fi
3138
3139echo "$as_me:3139: checking for long file names" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01003140echo $ECHO_N "checking for long file names... $ECHO_C" >&6
3141if test "${ac_cv_sys_long_file_names+set}" = set; then
3142 echo $ECHO_N "(cached) $ECHO_C" >&6
3143else
3144 ac_cv_sys_long_file_names=yes
3145# Test for long file names in all the places we know might matter:
3146# . the current directory, where building will happen
3147# $prefix/lib where we will be installing things
3148# $exec_prefix/lib likewise
3149# eval it to expand exec_prefix.
3150# $TMPDIR if set, where it might want to write temporary files
3151# if $TMPDIR is not set:
3152# /tmp where it might want to write temporary files
3153# /var/tmp likewise
3154# /usr/tmp likewise
3155if test -n "$TMPDIR" && test -d "$TMPDIR" && test -w "$TMPDIR"; then
3156 ac_tmpdirs=$TMPDIR
3157else
3158 ac_tmpdirs='/tmp /var/tmp /usr/tmp'
3159fi
micky3879b9f5e72025-07-08 18:04:53 -04003160for ac_dir in . $ac_tmpdirs `eval echo "$prefix/lib" "$exec_prefix/lib"` ; do
3161 test -d "$ac_dir" || continue
3162 test -w "$ac_dir" || continue # It is less confusing to not echo anything here.
Steve Kondikae271bc2015-11-15 02:50:53 +01003163 ac_xdir=$ac_dir/cf$$
micky3879b9f5e72025-07-08 18:04:53 -04003164 (umask 077 && mkdir "$ac_xdir" 2>/dev/null) || continue
Steve Kondikae271bc2015-11-15 02:50:53 +01003165 ac_tf1=$ac_xdir/conftest9012345
3166 ac_tf2=$ac_xdir/conftest9012346
micky3879b9f5e72025-07-08 18:04:53 -04003167 (echo 1 >"$ac_tf1") 2>/dev/null
3168 (echo 2 >"$ac_tf2") 2>/dev/null
3169 ac_val=`cat "$ac_tf1" 2>/dev/null`
3170 if test ! -f "$ac_tf1" || test "$ac_val" != 1; then
Steve Kondikae271bc2015-11-15 02:50:53 +01003171 ac_cv_sys_long_file_names=no
micky3879b9f5e72025-07-08 18:04:53 -04003172 rm -rf "$ac_xdir" 2>/dev/null
Steve Kondikae271bc2015-11-15 02:50:53 +01003173 break
3174 fi
micky3879b9f5e72025-07-08 18:04:53 -04003175 rm -rf "$ac_xdir" 2>/dev/null
Steve Kondikae271bc2015-11-15 02:50:53 +01003176done
3177fi
micky3879b9f5e72025-07-08 18:04:53 -04003178echo "$as_me:3178: result: $ac_cv_sys_long_file_names" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01003179echo "${ECHO_T}$ac_cv_sys_long_file_names" >&6
micky3879b9f5e72025-07-08 18:04:53 -04003180if test "$ac_cv_sys_long_file_names" = yes; then
Steve Kondikae271bc2015-11-15 02:50:53 +01003181
3182cat >>confdefs.h <<\EOF
3183#define HAVE_LONG_FILE_NAMES 1
3184EOF
3185
3186fi
3187
3188# if we find pkg-config, check if we should install the ".pc" files.
3189
micky3879b9f5e72025-07-08 18:04:53 -04003190echo "$as_me:3190: checking if you want to use pkg-config" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01003191echo $ECHO_N "checking if you want to use pkg-config... $ECHO_C" >&6
3192
3193# Check whether --with-pkg-config or --without-pkg-config was given.
3194if test "${with_pkg_config+set}" = set; then
3195 withval="$with_pkg_config"
3196 cf_pkg_config=$withval
3197else
3198 cf_pkg_config=yes
3199fi;
micky3879b9f5e72025-07-08 18:04:53 -04003200echo "$as_me:3200: result: $cf_pkg_config" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01003201echo "${ECHO_T}$cf_pkg_config" >&6
3202
micky3879b9f5e72025-07-08 18:04:53 -04003203case "$cf_pkg_config" in
Steve Kondikae271bc2015-11-15 02:50:53 +01003204(no)
3205 PKG_CONFIG=none
3206 ;;
3207(yes)
3208
3209if test -n "$ac_tool_prefix"; then
3210 # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
3211set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
micky3879b9f5e72025-07-08 18:04:53 -04003212echo "$as_me:3212: checking for $ac_word" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01003213echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3214if test "${ac_cv_path_PKG_CONFIG+set}" = set; then
3215 echo $ECHO_N "(cached) $ECHO_C" >&6
3216else
3217 case $PKG_CONFIG in
3218 [\\/]* | ?:[\\/]*)
3219 ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
3220 ;;
3221 *)
3222 ac_save_IFS=$IFS; IFS=$ac_path_separator
3223ac_dummy="$PATH"
3224for ac_dir in $ac_dummy; do
3225 IFS=$ac_save_IFS
3226 test -z "$ac_dir" && ac_dir=.
3227 if $as_executable_p "$ac_dir/$ac_word"; then
3228 ac_cv_path_PKG_CONFIG="$ac_dir/$ac_word"
micky3879b9f5e72025-07-08 18:04:53 -04003229 echo "$as_me:3229: found $ac_dir/$ac_word" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01003230 break
3231fi
3232done
3233
3234 ;;
3235esac
3236fi
3237PKG_CONFIG=$ac_cv_path_PKG_CONFIG
3238
3239if test -n "$PKG_CONFIG"; then
micky3879b9f5e72025-07-08 18:04:53 -04003240 echo "$as_me:3240: result: $PKG_CONFIG" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01003241echo "${ECHO_T}$PKG_CONFIG" >&6
3242else
micky3879b9f5e72025-07-08 18:04:53 -04003243 echo "$as_me:3243: result: no" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01003244echo "${ECHO_T}no" >&6
3245fi
3246
3247fi
3248if test -z "$ac_cv_path_PKG_CONFIG"; then
3249 ac_pt_PKG_CONFIG=$PKG_CONFIG
3250 # Extract the first word of "pkg-config", so it can be a program name with args.
3251set dummy pkg-config; ac_word=$2
micky3879b9f5e72025-07-08 18:04:53 -04003252echo "$as_me:3252: checking for $ac_word" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01003253echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3254if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then
3255 echo $ECHO_N "(cached) $ECHO_C" >&6
3256else
3257 case $ac_pt_PKG_CONFIG in
3258 [\\/]* | ?:[\\/]*)
3259 ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path.
3260 ;;
3261 *)
3262 ac_save_IFS=$IFS; IFS=$ac_path_separator
3263ac_dummy="$PATH"
3264for ac_dir in $ac_dummy; do
3265 IFS=$ac_save_IFS
3266 test -z "$ac_dir" && ac_dir=.
3267 if $as_executable_p "$ac_dir/$ac_word"; then
3268 ac_cv_path_ac_pt_PKG_CONFIG="$ac_dir/$ac_word"
micky3879b9f5e72025-07-08 18:04:53 -04003269 echo "$as_me:3269: found $ac_dir/$ac_word" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01003270 break
3271fi
3272done
3273
3274 test -z "$ac_cv_path_ac_pt_PKG_CONFIG" && ac_cv_path_ac_pt_PKG_CONFIG="none"
3275 ;;
3276esac
3277fi
3278ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
3279
3280if test -n "$ac_pt_PKG_CONFIG"; then
micky3879b9f5e72025-07-08 18:04:53 -04003281 echo "$as_me:3281: result: $ac_pt_PKG_CONFIG" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01003282echo "${ECHO_T}$ac_pt_PKG_CONFIG" >&6
3283else
micky3879b9f5e72025-07-08 18:04:53 -04003284 echo "$as_me:3284: result: no" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01003285echo "${ECHO_T}no" >&6
3286fi
3287
3288 PKG_CONFIG=$ac_pt_PKG_CONFIG
3289else
3290 PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
3291fi
3292
3293 ;;
3294(*)
3295 PKG_CONFIG=$withval
3296 ;;
3297esac
3298
3299test -z "$PKG_CONFIG" && PKG_CONFIG=none
3300if test "$PKG_CONFIG" != none ; then
3301
3302if test "x$prefix" != xNONE; then
3303 cf_path_syntax="$prefix"
3304else
3305 cf_path_syntax="$ac_default_prefix"
3306fi
3307
3308case ".$PKG_CONFIG" in
3309(.\$\(*\)*|.\'*\'*)
3310 ;;
3311(..|./*|.\\*)
3312 ;;
3313(.[a-zA-Z]:[\\/]*) # OS/2 EMX
3314 ;;
micky3879b9f5e72025-07-08 18:04:53 -04003315(.\$\{*prefix\}*|.\$\{*dir\}*)
Steve Kondikae271bc2015-11-15 02:50:53 +01003316 eval PKG_CONFIG="$PKG_CONFIG"
3317 case ".$PKG_CONFIG" in
3318 (.NONE/*)
micky3879b9f5e72025-07-08 18:04:53 -04003319 PKG_CONFIG=`echo "$PKG_CONFIG" | sed -e s%NONE%$cf_path_syntax%`
Steve Kondikae271bc2015-11-15 02:50:53 +01003320 ;;
3321 esac
3322 ;;
3323(.no|.NONE/*)
micky3879b9f5e72025-07-08 18:04:53 -04003324 PKG_CONFIG=`echo "$PKG_CONFIG" | sed -e s%NONE%$cf_path_syntax%`
Steve Kondikae271bc2015-11-15 02:50:53 +01003325 ;;
3326(*)
micky3879b9f5e72025-07-08 18:04:53 -04003327 { { echo "$as_me:3327: error: expected a pathname, not \"$PKG_CONFIG\"" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01003328echo "$as_me: error: expected a pathname, not \"$PKG_CONFIG\"" >&2;}
3329 { (exit 1); exit 1; }; }
3330 ;;
3331esac
3332
3333elif test "x$cf_pkg_config" != xno ; then
micky3879b9f5e72025-07-08 18:04:53 -04003334 { echo "$as_me:3334: WARNING: pkg-config is not installed" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01003335echo "$as_me: WARNING: pkg-config is not installed" >&2;}
3336fi
3337
micky3879b9f5e72025-07-08 18:04:53 -04003338case "$PKG_CONFIG" in
3339(no|none|yes)
3340 echo "$as_me:3340: checking for pkg-config library directory" >&5
3341echo $ECHO_N "checking for pkg-config library directory... $ECHO_C" >&6
3342 ;;
3343(*)
3344 echo "$as_me:3344: checking for $PKG_CONFIG library directory" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01003345echo $ECHO_N "checking for $PKG_CONFIG library directory... $ECHO_C" >&6
micky3879b9f5e72025-07-08 18:04:53 -04003346 ;;
3347esac
3348
3349# if $PKG_CONFIG_LIBDIR is set, try to use that
3350if test -n "$PKG_CONFIG_PATH"; then
3351 cf_search_path=`echo "$PKG_CONFIG_PATH" | sed -e 's/:/ /g' -e 's,^[ ]*,,' -e 's,[ ]*$,,'`
3352elif test -n "$PKG_CONFIG_LIBDIR"; then
3353 cf_search_path=`echo "$PKG_CONFIG_LIBDIR" | sed -e 's/:/ /g' -e 's,^[ ]*,,' -e 's,[ ]*$,,'`
3354else
3355 cf_search_path=auto
3356fi
3357
3358# if the option is used, let that override. otherwise default to "libdir"
Steve Kondikae271bc2015-11-15 02:50:53 +01003359
3360# Check whether --with-pkg-config-libdir or --without-pkg-config-libdir was given.
3361if test "${with_pkg_config_libdir+set}" = set; then
3362 withval="$with_pkg_config_libdir"
micky3879b9f5e72025-07-08 18:04:53 -04003363 cf_search_path=$withval
Steve Kondikae271bc2015-11-15 02:50:53 +01003364else
micky3879b9f5e72025-07-08 18:04:53 -04003365 test "x$PKG_CONFIG" != xnone && test -z "$cf_search_path" && cf_search_path=libdir
Steve Kondikae271bc2015-11-15 02:50:53 +01003366fi;
Steve Kondikae271bc2015-11-15 02:50:53 +01003367
micky3879b9f5e72025-07-08 18:04:53 -04003368case "x$cf_search_path" in
3369(xlibdir)
3370 PKG_CONFIG_LIBDIR='${libdir}/pkgconfig'
3371 echo "$as_me:3371: result: $PKG_CONFIG_LIBDIR" >&5
3372echo "${ECHO_T}$PKG_CONFIG_LIBDIR" >&6
3373 cf_search_path=
Steve Kondikae271bc2015-11-15 02:50:53 +01003374 ;;
micky3879b9f5e72025-07-08 18:04:53 -04003375(x)
3376 ;;
3377(x/*\ *)
3378 PKG_CONFIG_LIBDIR=
3379 ;;
3380(x/*)
3381 PKG_CONFIG_LIBDIR="$cf_search_path"
3382 echo "$as_me:3382: result: $PKG_CONFIG_LIBDIR" >&5
3383echo "${ECHO_T}$PKG_CONFIG_LIBDIR" >&6
3384 cf_search_path=
3385 ;;
3386(xyes|xauto)
3387 echo "$as_me:3387: result: auto" >&5
3388echo "${ECHO_T}auto" >&6
3389 cf_search_path=
Steve Kondikae271bc2015-11-15 02:50:53 +01003390 # Look for the library directory using the same prefix as the executable
micky3879b9f5e72025-07-08 18:04:53 -04003391 echo "$as_me:3391: checking for search-list" >&5
3392echo $ECHO_N "checking for search-list... $ECHO_C" >&6
3393 if test "x$PKG_CONFIG" != xnone
Steve Kondikae271bc2015-11-15 02:50:53 +01003394 then
micky3879b9f5e72025-07-08 18:04:53 -04003395 # works for pkg-config since version 0.24 (2009)
3396 # works for pkgconf since version 0.8.3 (2012)
3397 for cf_pkg_program in \
3398 `echo "$PKG_CONFIG" | sed -e 's,^.*/,,'` \
3399 pkg-config \
3400 pkgconf
3401 do
3402 cf_search_path=`"$PKG_CONFIG" --variable=pc_path "$cf_pkg_program" 2>/dev/null | tr : ' '`
3403 test -n "$cf_search_path" && break
3404 done
3405
3406 # works for pkg-config since import in 2005 of original 2001 HP code.
3407 test -z "$cf_search_path" && \
3408 cf_search_path=`
3409 "$PKG_CONFIG" --debug --exists no-such-package 2>&1 | $AWK "\
3410/^Scanning directory (#[1-9][0-9]* )?'.*'$/{ \
3411 sub(\"^[^']*'\",\"\"); \
3412 sub(\"'.*\",\"\"); \
3413 printf \" %s\", \\$0; } \
3414{ next; } \
3415"`
Steve Kondikae271bc2015-11-15 02:50:53 +01003416 fi
3417
micky3879b9f5e72025-07-08 18:04:53 -04003418 echo "$as_me:3418: result: $cf_search_path" >&5
3419echo "${ECHO_T}$cf_search_path" >&6
Steve Kondikae271bc2015-11-15 02:50:53 +01003420 ;;
3421(*)
micky3879b9f5e72025-07-08 18:04:53 -04003422 { { echo "$as_me:3422: error: Unexpected option value: $cf_search_path" >&5
3423echo "$as_me: error: Unexpected option value: $cf_search_path" >&2;}
3424 { (exit 1); exit 1; }; }
Steve Kondikae271bc2015-11-15 02:50:53 +01003425 ;;
3426esac
3427
micky3879b9f5e72025-07-08 18:04:53 -04003428if test -n "$cf_search_path"
3429then
3430 echo "$as_me:3430: checking for first directory" >&5
3431echo $ECHO_N "checking for first directory... $ECHO_C" >&6
3432 cf_pkg_config_path=none
3433 for cf_config in $cf_search_path
3434 do
3435 if test -d "$cf_config"
3436 then
3437 cf_pkg_config_path=$cf_config
3438 break
3439 fi
3440 done
3441 echo "$as_me:3441: result: $cf_pkg_config_path" >&5
3442echo "${ECHO_T}$cf_pkg_config_path" >&6
3443
3444 if test "x$cf_pkg_config_path" != xnone ; then
3445 # limit this to the first directory found
3446 PKG_CONFIG_LIBDIR="$cf_pkg_config_path"
3447 fi
3448
3449 if test -z "$PKG_CONFIG_LIBDIR" && test -n "$cf_search_path"
3450 then
3451 echo "$as_me:3451: checking for workaround" >&5
3452echo $ECHO_N "checking for workaround... $ECHO_C" >&6
3453 if test "$prefix" = "NONE" ; then
3454 cf_prefix="$ac_default_prefix"
3455 else
3456 cf_prefix="$prefix"
3457 fi
3458 eval cf_libdir=$libdir
3459 cf_libdir=`echo "$cf_libdir" | sed -e "s,^NONE,$cf_prefix,"`
3460 cf_backup=
3461 for cf_config in $cf_search_path
3462 do
3463 case $cf_config in
3464 $cf_libdir/pkgconfig)
3465 PKG_CONFIG_LIBDIR=$cf_libdir/pkgconfig
3466 break
3467 ;;
3468 *)
3469 test -z "$cf_backup" && cf_backup=$cf_config
3470 ;;
3471 esac
3472 done
3473 test -z "$PKG_CONFIG_LIBDIR" && PKG_CONFIG_LIBDIR=$cf_backup
3474 echo "$as_me:3474: result: $PKG_CONFIG_LIBDIR" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01003475echo "${ECHO_T}$PKG_CONFIG_LIBDIR" >&6
micky3879b9f5e72025-07-08 18:04:53 -04003476 fi
Steve Kondikae271bc2015-11-15 02:50:53 +01003477fi
3478
micky3879b9f5e72025-07-08 18:04:53 -04003479echo "$as_me:3479: checking if you want to build test-programs" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01003480echo $ECHO_N "checking if you want to build test-programs... $ECHO_C" >&6
3481
3482# Check whether --with-tests or --without-tests was given.
3483if test "${with_tests+set}" = set; then
3484 withval="$with_tests"
3485 cf_with_tests=$withval
3486else
3487 cf_with_tests=yes
3488fi;
micky3879b9f5e72025-07-08 18:04:53 -04003489echo "$as_me:3489: result: $cf_with_tests" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01003490echo "${ECHO_T}$cf_with_tests" >&6
3491
micky3879b9f5e72025-07-08 18:04:53 -04003492echo "$as_me:3492: checking if we should assume mixed-case filenames" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01003493echo $ECHO_N "checking if we should assume mixed-case filenames... $ECHO_C" >&6
3494
3495# Check whether --enable-mixed-case or --disable-mixed-case was given.
3496if test "${enable_mixed_case+set}" = set; then
3497 enableval="$enable_mixed_case"
3498 enable_mixedcase=$enableval
3499else
3500 enable_mixedcase=auto
3501fi;
micky3879b9f5e72025-07-08 18:04:53 -04003502echo "$as_me:3502: result: $enable_mixedcase" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01003503echo "${ECHO_T}$enable_mixedcase" >&6
3504if test "$enable_mixedcase" = "auto" ; then
3505
micky3879b9f5e72025-07-08 18:04:53 -04003506echo "$as_me:3506: checking if filesystem supports mixed-case filenames" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01003507echo $ECHO_N "checking if filesystem supports mixed-case filenames... $ECHO_C" >&6
3508if test "${cf_cv_mixedcase+set}" = set; then
3509 echo $ECHO_N "(cached) $ECHO_C" >&6
3510else
3511
3512if test "$cross_compiling" = yes ; then
micky3879b9f5e72025-07-08 18:04:53 -04003513 case "$target_alias" in
3514 (*-os2-emx*|*-msdosdjgpp*|*-cygwin*|*-msys*|*-mingw*|*-uwin*|darwin*)
Steve Kondikae271bc2015-11-15 02:50:53 +01003515 cf_cv_mixedcase=no
3516 ;;
3517 (*)
3518 cf_cv_mixedcase=yes
3519 ;;
3520 esac
3521else
3522 rm -f conftest CONFTEST
3523 echo test >conftest
3524 if test -f CONFTEST ; then
3525 cf_cv_mixedcase=no
3526 else
3527 cf_cv_mixedcase=yes
3528 fi
3529 rm -f conftest CONFTEST
3530fi
3531
3532fi
micky3879b9f5e72025-07-08 18:04:53 -04003533echo "$as_me:3533: result: $cf_cv_mixedcase" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01003534echo "${ECHO_T}$cf_cv_mixedcase" >&6
3535test "$cf_cv_mixedcase" = yes &&
3536cat >>confdefs.h <<\EOF
3537#define MIXEDCASE_FILENAMES 1
3538EOF
3539
3540else
3541 cf_cv_mixedcase=$enable_mixedcase
3542 if test "$enable_mixedcase" = "yes" ; then
3543 cat >>confdefs.h <<\EOF
3544#define MIXEDCASE_FILENAMES 1
3545EOF
3546
3547 fi
3548fi
3549
3550# do this after mixed-case option (tags/TAGS is not as important as tic).
micky3879b9f5e72025-07-08 18:04:53 -04003551echo "$as_me:3551: checking whether ${MAKE-make} sets \${MAKE}" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01003552echo $ECHO_N "checking whether ${MAKE-make} sets \${MAKE}... $ECHO_C" >&6
3553set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,./+-,__p_,'`
3554if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then
3555 echo $ECHO_N "(cached) $ECHO_C" >&6
3556else
3557 cat >conftest.make <<\EOF
3558all:
3559 @echo 'ac_maketemp="${MAKE}"'
3560EOF
3561# GNU make sometimes prints "make[1]: Entering...", which would confuse us.
3562eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=`
3563if test -n "$ac_maketemp"; then
3564 eval ac_cv_prog_make_${ac_make}_set=yes
3565else
3566 eval ac_cv_prog_make_${ac_make}_set=no
3567fi
3568rm -f conftest.make
3569fi
3570if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
micky3879b9f5e72025-07-08 18:04:53 -04003571 echo "$as_me:3571: result: yes" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01003572echo "${ECHO_T}yes" >&6
3573 SET_MAKE=
3574else
micky3879b9f5e72025-07-08 18:04:53 -04003575 echo "$as_me:3575: result: no" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01003576echo "${ECHO_T}no" >&6
3577 SET_MAKE="MAKE=${MAKE-make}"
3578fi
3579
micky3879b9f5e72025-07-08 18:04:53 -04003580echo "$as_me:3580: checking for \".PHONY\" make-support" >&5
3581echo $ECHO_N "checking for \".PHONY\" make-support... $ECHO_C" >&6
3582if test "${cf_cv_make_PHONY+set}" = set; then
3583 echo $ECHO_N "(cached) $ECHO_C" >&6
3584else
3585
3586 rm -rf conftest*
3587 (
3588 mkdir conftest || exit 1
3589 cd conftest
3590 cat >makefile <<'CF_EOF'
3591.PHONY: always
3592DATA=0
3593always: always.out
3594 @echo "** making $@ $(DATA)"
3595once: once.out
3596 @echo "** making $@ $(DATA)"
3597always.out:
3598 @echo "** making $@ $(DATA)"
3599 echo $(DATA) > $@
3600once.out:
3601 @echo "** making $@ $(DATA)"
3602 echo $(DATA) > $@
3603CF_EOF
3604 for cf_data in 1 2 3
3605 do
3606 ${MAKE:-make} always DATA=$cf_data
3607 ${MAKE:-make} once DATA=$cf_data
3608 ${MAKE:-make} -t always once
3609 if test -f always ; then
3610 echo "no (case 1)" > ../conftest.tmp
3611 elif test ! -f always.out ; then
3612 echo "no (case 2)" > ../conftest.tmp
3613 elif test ! -f once.out ; then
3614 echo "no (case 3)" > ../conftest.tmp
3615 elif ! cmp -s always.out once.out ; then
3616 echo "no (case 4)" > ../conftest.tmp
3617 diff always.out once.out
3618 else
3619 cf_check="`cat always.out`"
3620 if test "x$cf_check" != "x$cf_data" ; then
3621 echo "no (case 5)" > ../conftest.tmp
3622 else
3623 echo yes > ../conftest.tmp
3624 rm -f ./*.out
3625 continue
3626 fi
3627 fi
3628 break
3629 done
3630 ) >&5 2>&1
3631 cf_cv_make_PHONY="`cat conftest.tmp`"
3632 rm -rf conftest*
3633
3634fi
3635echo "$as_me:3635: result: $cf_cv_make_PHONY" >&5
3636echo "${ECHO_T}$cf_cv_make_PHONY" >&6
3637MAKE_NO_PHONY="#"
3638MAKE_PHONY="#"
3639test "x$cf_cv_make_PHONY" = xyes && MAKE_PHONY=
3640test "x$cf_cv_make_PHONY" != xyes && MAKE_NO_PHONY=
3641
Steve Kondikae271bc2015-11-15 02:50:53 +01003642for ac_prog in exctags ctags
3643do
3644 # Extract the first word of "$ac_prog", so it can be a program name with args.
3645set dummy $ac_prog; ac_word=$2
micky3879b9f5e72025-07-08 18:04:53 -04003646echo "$as_me:3646: checking for $ac_word" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01003647echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3648if test "${ac_cv_prog_CTAGS+set}" = set; then
3649 echo $ECHO_N "(cached) $ECHO_C" >&6
3650else
3651 if test -n "$CTAGS"; then
3652 ac_cv_prog_CTAGS="$CTAGS" # Let the user override the test.
3653else
3654 ac_save_IFS=$IFS; IFS=$ac_path_separator
3655ac_dummy="$PATH"
3656for ac_dir in $ac_dummy; do
3657 IFS=$ac_save_IFS
3658 test -z "$ac_dir" && ac_dir=.
3659 $as_executable_p "$ac_dir/$ac_word" || continue
3660ac_cv_prog_CTAGS="$ac_prog"
micky3879b9f5e72025-07-08 18:04:53 -04003661echo "$as_me:3661: found $ac_dir/$ac_word" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01003662break
3663done
3664
3665fi
3666fi
3667CTAGS=$ac_cv_prog_CTAGS
3668if test -n "$CTAGS"; then
micky3879b9f5e72025-07-08 18:04:53 -04003669 echo "$as_me:3669: result: $CTAGS" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01003670echo "${ECHO_T}$CTAGS" >&6
3671else
micky3879b9f5e72025-07-08 18:04:53 -04003672 echo "$as_me:3672: result: no" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01003673echo "${ECHO_T}no" >&6
3674fi
3675
3676 test -n "$CTAGS" && break
3677done
3678
3679for ac_prog in exetags etags
3680do
3681 # Extract the first word of "$ac_prog", so it can be a program name with args.
3682set dummy $ac_prog; ac_word=$2
micky3879b9f5e72025-07-08 18:04:53 -04003683echo "$as_me:3683: checking for $ac_word" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01003684echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3685if test "${ac_cv_prog_ETAGS+set}" = set; then
3686 echo $ECHO_N "(cached) $ECHO_C" >&6
3687else
3688 if test -n "$ETAGS"; then
3689 ac_cv_prog_ETAGS="$ETAGS" # Let the user override the test.
3690else
3691 ac_save_IFS=$IFS; IFS=$ac_path_separator
3692ac_dummy="$PATH"
3693for ac_dir in $ac_dummy; do
3694 IFS=$ac_save_IFS
3695 test -z "$ac_dir" && ac_dir=.
3696 $as_executable_p "$ac_dir/$ac_word" || continue
3697ac_cv_prog_ETAGS="$ac_prog"
micky3879b9f5e72025-07-08 18:04:53 -04003698echo "$as_me:3698: found $ac_dir/$ac_word" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01003699break
3700done
3701
3702fi
3703fi
3704ETAGS=$ac_cv_prog_ETAGS
3705if test -n "$ETAGS"; then
micky3879b9f5e72025-07-08 18:04:53 -04003706 echo "$as_me:3706: result: $ETAGS" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01003707echo "${ECHO_T}$ETAGS" >&6
3708else
micky3879b9f5e72025-07-08 18:04:53 -04003709 echo "$as_me:3709: result: no" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01003710echo "${ECHO_T}no" >&6
3711fi
3712
3713 test -n "$ETAGS" && break
3714done
3715
3716# Extract the first word of "${CTAGS:-ctags}", so it can be a program name with args.
3717set dummy ${CTAGS:-ctags}; ac_word=$2
micky3879b9f5e72025-07-08 18:04:53 -04003718echo "$as_me:3718: checking for $ac_word" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01003719echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3720if test "${ac_cv_prog_MAKE_LOWER_TAGS+set}" = set; then
3721 echo $ECHO_N "(cached) $ECHO_C" >&6
3722else
3723 if test -n "$MAKE_LOWER_TAGS"; then
3724 ac_cv_prog_MAKE_LOWER_TAGS="$MAKE_LOWER_TAGS" # Let the user override the test.
3725else
3726 ac_save_IFS=$IFS; IFS=$ac_path_separator
3727ac_dummy="$PATH"
3728for ac_dir in $ac_dummy; do
3729 IFS=$ac_save_IFS
3730 test -z "$ac_dir" && ac_dir=.
3731 $as_executable_p "$ac_dir/$ac_word" || continue
3732ac_cv_prog_MAKE_LOWER_TAGS="yes"
micky3879b9f5e72025-07-08 18:04:53 -04003733echo "$as_me:3733: found $ac_dir/$ac_word" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01003734break
3735done
3736
3737 test -z "$ac_cv_prog_MAKE_LOWER_TAGS" && ac_cv_prog_MAKE_LOWER_TAGS="no"
3738fi
3739fi
3740MAKE_LOWER_TAGS=$ac_cv_prog_MAKE_LOWER_TAGS
3741if test -n "$MAKE_LOWER_TAGS"; then
micky3879b9f5e72025-07-08 18:04:53 -04003742 echo "$as_me:3742: result: $MAKE_LOWER_TAGS" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01003743echo "${ECHO_T}$MAKE_LOWER_TAGS" >&6
3744else
micky3879b9f5e72025-07-08 18:04:53 -04003745 echo "$as_me:3745: result: no" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01003746echo "${ECHO_T}no" >&6
3747fi
3748
3749if test "$cf_cv_mixedcase" = yes ; then
3750 # Extract the first word of "${ETAGS:-etags}", so it can be a program name with args.
3751set dummy ${ETAGS:-etags}; ac_word=$2
micky3879b9f5e72025-07-08 18:04:53 -04003752echo "$as_me:3752: checking for $ac_word" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01003753echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3754if test "${ac_cv_prog_MAKE_UPPER_TAGS+set}" = set; then
3755 echo $ECHO_N "(cached) $ECHO_C" >&6
3756else
3757 if test -n "$MAKE_UPPER_TAGS"; then
3758 ac_cv_prog_MAKE_UPPER_TAGS="$MAKE_UPPER_TAGS" # Let the user override the test.
3759else
3760 ac_save_IFS=$IFS; IFS=$ac_path_separator
3761ac_dummy="$PATH"
3762for ac_dir in $ac_dummy; do
3763 IFS=$ac_save_IFS
3764 test -z "$ac_dir" && ac_dir=.
3765 $as_executable_p "$ac_dir/$ac_word" || continue
3766ac_cv_prog_MAKE_UPPER_TAGS="yes"
micky3879b9f5e72025-07-08 18:04:53 -04003767echo "$as_me:3767: found $ac_dir/$ac_word" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01003768break
3769done
3770
3771 test -z "$ac_cv_prog_MAKE_UPPER_TAGS" && ac_cv_prog_MAKE_UPPER_TAGS="no"
3772fi
3773fi
3774MAKE_UPPER_TAGS=$ac_cv_prog_MAKE_UPPER_TAGS
3775if test -n "$MAKE_UPPER_TAGS"; then
micky3879b9f5e72025-07-08 18:04:53 -04003776 echo "$as_me:3776: result: $MAKE_UPPER_TAGS" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01003777echo "${ECHO_T}$MAKE_UPPER_TAGS" >&6
3778else
micky3879b9f5e72025-07-08 18:04:53 -04003779 echo "$as_me:3779: result: no" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01003780echo "${ECHO_T}no" >&6
3781fi
3782
3783else
3784 MAKE_UPPER_TAGS=no
3785fi
3786
3787if test "$MAKE_UPPER_TAGS" = yes ; then
3788 MAKE_UPPER_TAGS=
3789else
3790 MAKE_UPPER_TAGS="#"
3791fi
3792
3793if test "$MAKE_LOWER_TAGS" = yes ; then
3794 MAKE_LOWER_TAGS=
3795else
3796 MAKE_LOWER_TAGS="#"
3797fi
3798
micky3879b9f5e72025-07-08 18:04:53 -04003799echo "$as_me:3799: checking for makeflags variable" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01003800echo $ECHO_N "checking for makeflags variable... $ECHO_C" >&6
3801if test "${cf_cv_makeflags+set}" = set; then
3802 echo $ECHO_N "(cached) $ECHO_C" >&6
3803else
3804
3805 cf_cv_makeflags=''
3806 for cf_option in '-${MAKEFLAGS}' '${MFLAGS}'
3807 do
3808 cat >cf_makeflags.tmp <<CF_EOF
3809SHELL = $SHELL
3810all :
3811 @ echo '.$cf_option'
3812CF_EOF
micky3879b9f5e72025-07-08 18:04:53 -04003813 cf_result=`${MAKE:-make} -k -f cf_makeflags.tmp 2>/dev/null | ${FGREP-fgrep} -v "ing directory" | sed -e 's,[ ]*$,,'`
Steve Kondikae271bc2015-11-15 02:50:53 +01003814 case "$cf_result" in
3815 (.*k|.*kw)
micky3879b9f5e72025-07-08 18:04:53 -04003816 cf_result="`${MAKE:-make} -k -f cf_makeflags.tmp CC=cc 2>/dev/null`"
Steve Kondikae271bc2015-11-15 02:50:53 +01003817 case "$cf_result" in
3818 (.*CC=*) cf_cv_makeflags=
3819 ;;
3820 (*) cf_cv_makeflags=$cf_option
3821 ;;
3822 esac
3823 break
3824 ;;
micky3879b9f5e72025-07-08 18:04:53 -04003825 (.-)
3826 ;;
3827 (*)
3828
3829echo "${as_me:-configure}:3829: testing given option \"$cf_option\",no match \"$cf_result\" ..." 1>&5
3830
Steve Kondikae271bc2015-11-15 02:50:53 +01003831 ;;
3832 esac
3833 done
3834 rm -f cf_makeflags.tmp
3835
3836fi
micky3879b9f5e72025-07-08 18:04:53 -04003837echo "$as_me:3837: result: $cf_cv_makeflags" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01003838echo "${ECHO_T}$cf_cv_makeflags" >&6
3839
3840if test -n "$ac_tool_prefix"; then
3841 # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
3842set dummy ${ac_tool_prefix}ranlib; ac_word=$2
micky3879b9f5e72025-07-08 18:04:53 -04003843echo "$as_me:3843: checking for $ac_word" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01003844echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3845if test "${ac_cv_prog_RANLIB+set}" = set; then
3846 echo $ECHO_N "(cached) $ECHO_C" >&6
3847else
3848 if test -n "$RANLIB"; then
3849 ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
3850else
3851 ac_save_IFS=$IFS; IFS=$ac_path_separator
3852ac_dummy="$PATH"
3853for ac_dir in $ac_dummy; do
3854 IFS=$ac_save_IFS
3855 test -z "$ac_dir" && ac_dir=.
3856 $as_executable_p "$ac_dir/$ac_word" || continue
3857ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
micky3879b9f5e72025-07-08 18:04:53 -04003858echo "$as_me:3858: found $ac_dir/$ac_word" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01003859break
3860done
3861
3862fi
3863fi
3864RANLIB=$ac_cv_prog_RANLIB
3865if test -n "$RANLIB"; then
micky3879b9f5e72025-07-08 18:04:53 -04003866 echo "$as_me:3866: result: $RANLIB" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01003867echo "${ECHO_T}$RANLIB" >&6
3868else
micky3879b9f5e72025-07-08 18:04:53 -04003869 echo "$as_me:3869: result: no" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01003870echo "${ECHO_T}no" >&6
3871fi
3872
3873fi
3874if test -z "$ac_cv_prog_RANLIB"; then
3875 ac_ct_RANLIB=$RANLIB
3876 # Extract the first word of "ranlib", so it can be a program name with args.
3877set dummy ranlib; ac_word=$2
micky3879b9f5e72025-07-08 18:04:53 -04003878echo "$as_me:3878: checking for $ac_word" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01003879echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3880if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then
3881 echo $ECHO_N "(cached) $ECHO_C" >&6
3882else
3883 if test -n "$ac_ct_RANLIB"; then
3884 ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
3885else
3886 ac_save_IFS=$IFS; IFS=$ac_path_separator
3887ac_dummy="$PATH"
3888for ac_dir in $ac_dummy; do
3889 IFS=$ac_save_IFS
3890 test -z "$ac_dir" && ac_dir=.
3891 $as_executable_p "$ac_dir/$ac_word" || continue
3892ac_cv_prog_ac_ct_RANLIB="ranlib"
micky3879b9f5e72025-07-08 18:04:53 -04003893echo "$as_me:3893: found $ac_dir/$ac_word" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01003894break
3895done
3896
3897 test -z "$ac_cv_prog_ac_ct_RANLIB" && ac_cv_prog_ac_ct_RANLIB="':'"
3898fi
3899fi
3900ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
3901if test -n "$ac_ct_RANLIB"; then
micky3879b9f5e72025-07-08 18:04:53 -04003902 echo "$as_me:3902: result: $ac_ct_RANLIB" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01003903echo "${ECHO_T}$ac_ct_RANLIB" >&6
3904else
micky3879b9f5e72025-07-08 18:04:53 -04003905 echo "$as_me:3905: result: no" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01003906echo "${ECHO_T}no" >&6
3907fi
3908
3909 RANLIB=$ac_ct_RANLIB
3910else
3911 RANLIB="$ac_cv_prog_RANLIB"
3912fi
3913
3914if test -n "$ac_tool_prefix"; then
3915 # Extract the first word of "${ac_tool_prefix}ld", so it can be a program name with args.
3916set dummy ${ac_tool_prefix}ld; ac_word=$2
micky3879b9f5e72025-07-08 18:04:53 -04003917echo "$as_me:3917: checking for $ac_word" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01003918echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3919if test "${ac_cv_prog_LD+set}" = set; then
3920 echo $ECHO_N "(cached) $ECHO_C" >&6
3921else
3922 if test -n "$LD"; then
3923 ac_cv_prog_LD="$LD" # Let the user override the test.
3924else
3925 ac_save_IFS=$IFS; IFS=$ac_path_separator
3926ac_dummy="$PATH"
3927for ac_dir in $ac_dummy; do
3928 IFS=$ac_save_IFS
3929 test -z "$ac_dir" && ac_dir=.
3930 $as_executable_p "$ac_dir/$ac_word" || continue
3931ac_cv_prog_LD="${ac_tool_prefix}ld"
micky3879b9f5e72025-07-08 18:04:53 -04003932echo "$as_me:3932: found $ac_dir/$ac_word" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01003933break
3934done
3935
3936fi
3937fi
3938LD=$ac_cv_prog_LD
3939if test -n "$LD"; then
micky3879b9f5e72025-07-08 18:04:53 -04003940 echo "$as_me:3940: result: $LD" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01003941echo "${ECHO_T}$LD" >&6
3942else
micky3879b9f5e72025-07-08 18:04:53 -04003943 echo "$as_me:3943: result: no" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01003944echo "${ECHO_T}no" >&6
3945fi
3946
3947fi
3948if test -z "$ac_cv_prog_LD"; then
3949 ac_ct_LD=$LD
3950 # Extract the first word of "ld", so it can be a program name with args.
3951set dummy ld; ac_word=$2
micky3879b9f5e72025-07-08 18:04:53 -04003952echo "$as_me:3952: checking for $ac_word" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01003953echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3954if test "${ac_cv_prog_ac_ct_LD+set}" = set; then
3955 echo $ECHO_N "(cached) $ECHO_C" >&6
3956else
3957 if test -n "$ac_ct_LD"; then
3958 ac_cv_prog_ac_ct_LD="$ac_ct_LD" # Let the user override the test.
3959else
3960 ac_save_IFS=$IFS; IFS=$ac_path_separator
3961ac_dummy="$PATH"
3962for ac_dir in $ac_dummy; do
3963 IFS=$ac_save_IFS
3964 test -z "$ac_dir" && ac_dir=.
3965 $as_executable_p "$ac_dir/$ac_word" || continue
3966ac_cv_prog_ac_ct_LD="ld"
micky3879b9f5e72025-07-08 18:04:53 -04003967echo "$as_me:3967: found $ac_dir/$ac_word" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01003968break
3969done
3970
3971 test -z "$ac_cv_prog_ac_ct_LD" && ac_cv_prog_ac_ct_LD="ld"
3972fi
3973fi
3974ac_ct_LD=$ac_cv_prog_ac_ct_LD
3975if test -n "$ac_ct_LD"; then
micky3879b9f5e72025-07-08 18:04:53 -04003976 echo "$as_me:3976: result: $ac_ct_LD" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01003977echo "${ECHO_T}$ac_ct_LD" >&6
3978else
micky3879b9f5e72025-07-08 18:04:53 -04003979 echo "$as_me:3979: result: no" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01003980echo "${ECHO_T}no" >&6
3981fi
3982
3983 LD=$ac_ct_LD
3984else
3985 LD="$ac_cv_prog_LD"
3986fi
3987
3988if test -n "$ac_tool_prefix"; then
3989 # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
3990set dummy ${ac_tool_prefix}ar; ac_word=$2
micky3879b9f5e72025-07-08 18:04:53 -04003991echo "$as_me:3991: checking for $ac_word" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01003992echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3993if test "${ac_cv_prog_AR+set}" = set; then
3994 echo $ECHO_N "(cached) $ECHO_C" >&6
3995else
3996 if test -n "$AR"; then
3997 ac_cv_prog_AR="$AR" # Let the user override the test.
3998else
3999 ac_save_IFS=$IFS; IFS=$ac_path_separator
4000ac_dummy="$PATH"
4001for ac_dir in $ac_dummy; do
4002 IFS=$ac_save_IFS
4003 test -z "$ac_dir" && ac_dir=.
4004 $as_executable_p "$ac_dir/$ac_word" || continue
4005ac_cv_prog_AR="${ac_tool_prefix}ar"
micky3879b9f5e72025-07-08 18:04:53 -04004006echo "$as_me:4006: found $ac_dir/$ac_word" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01004007break
4008done
4009
4010fi
4011fi
4012AR=$ac_cv_prog_AR
4013if test -n "$AR"; then
micky3879b9f5e72025-07-08 18:04:53 -04004014 echo "$as_me:4014: result: $AR" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01004015echo "${ECHO_T}$AR" >&6
4016else
micky3879b9f5e72025-07-08 18:04:53 -04004017 echo "$as_me:4017: result: no" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01004018echo "${ECHO_T}no" >&6
4019fi
4020
4021fi
4022if test -z "$ac_cv_prog_AR"; then
4023 ac_ct_AR=$AR
4024 # Extract the first word of "ar", so it can be a program name with args.
4025set dummy ar; ac_word=$2
micky3879b9f5e72025-07-08 18:04:53 -04004026echo "$as_me:4026: checking for $ac_word" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01004027echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
4028if test "${ac_cv_prog_ac_ct_AR+set}" = set; then
4029 echo $ECHO_N "(cached) $ECHO_C" >&6
4030else
4031 if test -n "$ac_ct_AR"; then
4032 ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test.
4033else
4034 ac_save_IFS=$IFS; IFS=$ac_path_separator
4035ac_dummy="$PATH"
4036for ac_dir in $ac_dummy; do
4037 IFS=$ac_save_IFS
4038 test -z "$ac_dir" && ac_dir=.
4039 $as_executable_p "$ac_dir/$ac_word" || continue
4040ac_cv_prog_ac_ct_AR="ar"
micky3879b9f5e72025-07-08 18:04:53 -04004041echo "$as_me:4041: found $ac_dir/$ac_word" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01004042break
4043done
4044
4045 test -z "$ac_cv_prog_ac_ct_AR" && ac_cv_prog_ac_ct_AR="ar"
4046fi
4047fi
4048ac_ct_AR=$ac_cv_prog_ac_ct_AR
4049if test -n "$ac_ct_AR"; then
micky3879b9f5e72025-07-08 18:04:53 -04004050 echo "$as_me:4050: result: $ac_ct_AR" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01004051echo "${ECHO_T}$ac_ct_AR" >&6
4052else
micky3879b9f5e72025-07-08 18:04:53 -04004053 echo "$as_me:4053: result: no" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01004054echo "${ECHO_T}no" >&6
4055fi
4056
4057 AR=$ac_ct_AR
4058else
4059 AR="$ac_cv_prog_AR"
4060fi
4061
4062if test -n "$ac_tool_prefix"; then
4063 # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
4064set dummy ${ac_tool_prefix}ar; ac_word=$2
micky3879b9f5e72025-07-08 18:04:53 -04004065echo "$as_me:4065: checking for $ac_word" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01004066echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
4067if test "${ac_cv_prog_AR+set}" = set; then
4068 echo $ECHO_N "(cached) $ECHO_C" >&6
4069else
4070 if test -n "$AR"; then
4071 ac_cv_prog_AR="$AR" # Let the user override the test.
4072else
4073 ac_save_IFS=$IFS; IFS=$ac_path_separator
4074ac_dummy="$PATH"
4075for ac_dir in $ac_dummy; do
4076 IFS=$ac_save_IFS
4077 test -z "$ac_dir" && ac_dir=.
4078 $as_executable_p "$ac_dir/$ac_word" || continue
4079ac_cv_prog_AR="${ac_tool_prefix}ar"
micky3879b9f5e72025-07-08 18:04:53 -04004080echo "$as_me:4080: found $ac_dir/$ac_word" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01004081break
4082done
4083
4084fi
4085fi
4086AR=$ac_cv_prog_AR
4087if test -n "$AR"; then
micky3879b9f5e72025-07-08 18:04:53 -04004088 echo "$as_me:4088: result: $AR" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01004089echo "${ECHO_T}$AR" >&6
4090else
micky3879b9f5e72025-07-08 18:04:53 -04004091 echo "$as_me:4091: result: no" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01004092echo "${ECHO_T}no" >&6
4093fi
4094
4095fi
4096if test -z "$ac_cv_prog_AR"; then
4097 ac_ct_AR=$AR
4098 # Extract the first word of "ar", so it can be a program name with args.
4099set dummy ar; ac_word=$2
micky3879b9f5e72025-07-08 18:04:53 -04004100echo "$as_me:4100: checking for $ac_word" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01004101echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
4102if test "${ac_cv_prog_ac_ct_AR+set}" = set; then
4103 echo $ECHO_N "(cached) $ECHO_C" >&6
4104else
4105 if test -n "$ac_ct_AR"; then
4106 ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test.
4107else
4108 ac_save_IFS=$IFS; IFS=$ac_path_separator
4109ac_dummy="$PATH"
4110for ac_dir in $ac_dummy; do
4111 IFS=$ac_save_IFS
4112 test -z "$ac_dir" && ac_dir=.
4113 $as_executable_p "$ac_dir/$ac_word" || continue
4114ac_cv_prog_ac_ct_AR="ar"
micky3879b9f5e72025-07-08 18:04:53 -04004115echo "$as_me:4115: found $ac_dir/$ac_word" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01004116break
4117done
4118
4119 test -z "$ac_cv_prog_ac_ct_AR" && ac_cv_prog_ac_ct_AR="ar"
4120fi
4121fi
4122ac_ct_AR=$ac_cv_prog_ac_ct_AR
4123if test -n "$ac_ct_AR"; then
micky3879b9f5e72025-07-08 18:04:53 -04004124 echo "$as_me:4124: result: $ac_ct_AR" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01004125echo "${ECHO_T}$ac_ct_AR" >&6
4126else
micky3879b9f5e72025-07-08 18:04:53 -04004127 echo "$as_me:4127: result: no" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01004128echo "${ECHO_T}no" >&6
4129fi
4130
4131 AR=$ac_ct_AR
4132else
4133 AR="$ac_cv_prog_AR"
4134fi
4135
micky3879b9f5e72025-07-08 18:04:53 -04004136echo "$as_me:4136: checking for options to update archives" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01004137echo $ECHO_N "checking for options to update archives... $ECHO_C" >&6
4138if test "${cf_cv_ar_flags+set}" = set; then
4139 echo $ECHO_N "(cached) $ECHO_C" >&6
4140else
4141
micky3879b9f5e72025-07-08 18:04:53 -04004142 case "$cf_cv_system_name" in
4143 (*-msvc*)
4144 cf_cv_ar_flags=''
4145 cat >mk_static_lib.sh <<-EOF
4146 #!$SHELL
4147 MSVC_BIN="$AR"
4148 out="\$1"
4149 shift
4150 exec \$MSVC_BIN -out:"\$out" \$@
4151 EOF
4152 chmod +x mk_static_lib.sh
4153 AR=`pwd`/mk_static_lib.sh
4154 ;;
4155 (*)
4156 cf_cv_ar_flags=unknown
4157 for cf_ar_flags in -curvU -curv curv -crv crv -cqv cqv -rv rv
4158 do
Steve Kondikae271bc2015-11-15 02:50:53 +01004159
micky3879b9f5e72025-07-08 18:04:53 -04004160 # check if $ARFLAGS already contains this choice
4161 if test "x$ARFLAGS" != "x" ; then
4162 cf_check_ar_flags=`echo "x$ARFLAGS" | sed -e "s/$cf_ar_flags\$//" -e "s/$cf_ar_flags / /"`
4163 if test "x$ARFLAGS" != "$cf_check_ar_flags" ; then
4164 cf_cv_ar_flags=
4165 break
4166 fi
Steve Kondikae271bc2015-11-15 02:50:53 +01004167 fi
Steve Kondikae271bc2015-11-15 02:50:53 +01004168
micky3879b9f5e72025-07-08 18:04:53 -04004169 rm -f "conftest.$ac_cv_objext"
4170 rm -f conftest.a
Steve Kondikae271bc2015-11-15 02:50:53 +01004171
micky3879b9f5e72025-07-08 18:04:53 -04004172 cat >"conftest.$ac_ext" <<EOF
4173#line 4173 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +01004174int testdata[3] = { 123, 456, 789 };
4175EOF
micky3879b9f5e72025-07-08 18:04:53 -04004176 if { (eval echo "$as_me:4176: \"$ac_compile\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01004177 (eval $ac_compile) 2>&5
4178 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -04004179 echo "$as_me:4179: \$? = $ac_status" >&5
4180 (exit "$ac_status"); } ; then
4181 echo "$AR $ARFLAGS $cf_ar_flags conftest.a conftest.$ac_cv_objext" >&5
4182 $AR $ARFLAGS "$cf_ar_flags" conftest.a "conftest.$ac_cv_objext" 2>&5 1>/dev/null
4183 if test -f conftest.a ; then
4184 cf_cv_ar_flags="$cf_ar_flags"
4185 break
4186 fi
4187 else
4188 test -n "$verbose" && echo " cannot compile test-program" 1>&6
4189
4190echo "${as_me:-configure}:4190: testing cannot compile test-program ..." 1>&5
4191
Steve Kondikae271bc2015-11-15 02:50:53 +01004192 break
4193 fi
micky3879b9f5e72025-07-08 18:04:53 -04004194 done
4195 rm -f conftest.a "conftest.$ac_ext" "conftest.$ac_cv_objext"
4196 ;;
4197 esac
Steve Kondikae271bc2015-11-15 02:50:53 +01004198
4199fi
micky3879b9f5e72025-07-08 18:04:53 -04004200echo "$as_me:4200: result: $cf_cv_ar_flags" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01004201echo "${ECHO_T}$cf_cv_ar_flags" >&6
4202
4203if test -n "$ARFLAGS" ; then
4204 if test -n "$cf_cv_ar_flags" ; then
4205 ARFLAGS="$ARFLAGS $cf_cv_ar_flags"
4206 fi
4207else
4208 ARFLAGS=$cf_cv_ar_flags
4209fi
4210
micky3879b9f5e72025-07-08 18:04:53 -04004211 echo "$as_me:4211: checking for PATH separator" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01004212echo $ECHO_N "checking for PATH separator... $ECHO_C" >&6
micky3879b9f5e72025-07-08 18:04:53 -04004213 case "$cf_cv_system_name" in
Steve Kondikae271bc2015-11-15 02:50:53 +01004214 (os2*) PATH_SEPARATOR=';' ;;
4215 (*) ${PATH_SEPARATOR:=':'} ;;
4216 esac
4217
micky3879b9f5e72025-07-08 18:04:53 -04004218 echo "$as_me:4218: result: $PATH_SEPARATOR" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01004219echo "${ECHO_T}$PATH_SEPARATOR" >&6
4220
micky3879b9f5e72025-07-08 18:04:53 -04004221echo "$as_me:4221: checking if you have specified an install-prefix" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01004222echo $ECHO_N "checking if you have specified an install-prefix... $ECHO_C" >&6
4223
4224# Check whether --with-install-prefix or --without-install-prefix was given.
4225if test "${with_install_prefix+set}" = set; then
4226 withval="$with_install_prefix"
4227 case "$withval" in
4228 (yes|no)
4229 ;;
4230 (*) DESTDIR="$withval"
4231 ;;
4232 esac
4233fi;
micky3879b9f5e72025-07-08 18:04:53 -04004234echo "$as_me:4234: result: $DESTDIR" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01004235echo "${ECHO_T}$DESTDIR" >&6
4236
4237###############################################################################
4238
4239# If we're cross-compiling, allow the user to override the tools and their
4240# options. The configure script is oriented toward identifying the host
4241# compiler, etc., but we need a build compiler to generate parts of the source.
4242
4243if test "$cross_compiling" = yes ; then
4244
4245 # defaults that we might want to override
4246 : ${BUILD_CFLAGS:=''}
4247 : ${BUILD_CPPFLAGS:=''}
4248 : ${BUILD_LDFLAGS:=''}
4249 : ${BUILD_LIBS:=''}
4250 : ${BUILD_EXEEXT:='$x'}
4251 : ${BUILD_OBJEXT:='o'}
4252
4253# Check whether --with-build-cc or --without-build-cc was given.
4254if test "${with_build_cc+set}" = set; then
4255 withval="$with_build_cc"
4256 BUILD_CC="$withval"
4257else
micky3879b9f5e72025-07-08 18:04:53 -04004258 for ac_prog in gcc clang c99 c89 cc cl
Steve Kondikae271bc2015-11-15 02:50:53 +01004259do
4260 # Extract the first word of "$ac_prog", so it can be a program name with args.
4261set dummy $ac_prog; ac_word=$2
micky3879b9f5e72025-07-08 18:04:53 -04004262echo "$as_me:4262: checking for $ac_word" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01004263echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
4264if test "${ac_cv_prog_BUILD_CC+set}" = set; then
4265 echo $ECHO_N "(cached) $ECHO_C" >&6
4266else
4267 if test -n "$BUILD_CC"; then
4268 ac_cv_prog_BUILD_CC="$BUILD_CC" # Let the user override the test.
4269else
4270 ac_save_IFS=$IFS; IFS=$ac_path_separator
4271ac_dummy="$PATH"
4272for ac_dir in $ac_dummy; do
4273 IFS=$ac_save_IFS
4274 test -z "$ac_dir" && ac_dir=.
4275 $as_executable_p "$ac_dir/$ac_word" || continue
4276ac_cv_prog_BUILD_CC="$ac_prog"
micky3879b9f5e72025-07-08 18:04:53 -04004277echo "$as_me:4277: found $ac_dir/$ac_word" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01004278break
4279done
4280
4281fi
4282fi
4283BUILD_CC=$ac_cv_prog_BUILD_CC
4284if test -n "$BUILD_CC"; then
micky3879b9f5e72025-07-08 18:04:53 -04004285 echo "$as_me:4285: result: $BUILD_CC" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01004286echo "${ECHO_T}$BUILD_CC" >&6
4287else
micky3879b9f5e72025-07-08 18:04:53 -04004288 echo "$as_me:4288: result: no" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01004289echo "${ECHO_T}no" >&6
4290fi
4291
4292 test -n "$BUILD_CC" && break
4293done
micky3879b9f5e72025-07-08 18:04:53 -04004294test -n "$BUILD_CC" || BUILD_CC="none"
Steve Kondikae271bc2015-11-15 02:50:53 +01004295
4296fi;
micky3879b9f5e72025-07-08 18:04:53 -04004297 echo "$as_me:4297: checking for native build C compiler" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01004298echo $ECHO_N "checking for native build C compiler... $ECHO_C" >&6
micky3879b9f5e72025-07-08 18:04:53 -04004299 echo "$as_me:4299: result: $BUILD_CC" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01004300echo "${ECHO_T}$BUILD_CC" >&6
4301
micky3879b9f5e72025-07-08 18:04:53 -04004302 echo "$as_me:4302: checking for native build C preprocessor" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01004303echo $ECHO_N "checking for native build C preprocessor... $ECHO_C" >&6
4304
4305# Check whether --with-build-cpp or --without-build-cpp was given.
4306if test "${with_build_cpp+set}" = set; then
4307 withval="$with_build_cpp"
4308 BUILD_CPP="$withval"
4309else
4310 BUILD_CPP='${BUILD_CC} -E'
4311fi;
micky3879b9f5e72025-07-08 18:04:53 -04004312 echo "$as_me:4312: result: $BUILD_CPP" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01004313echo "${ECHO_T}$BUILD_CPP" >&6
4314
micky3879b9f5e72025-07-08 18:04:53 -04004315 echo "$as_me:4315: checking for native build C flags" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01004316echo $ECHO_N "checking for native build C flags... $ECHO_C" >&6
4317
4318# Check whether --with-build-cflags or --without-build-cflags was given.
4319if test "${with_build_cflags+set}" = set; then
4320 withval="$with_build_cflags"
4321 BUILD_CFLAGS="$withval"
4322fi;
micky3879b9f5e72025-07-08 18:04:53 -04004323 echo "$as_me:4323: result: $BUILD_CFLAGS" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01004324echo "${ECHO_T}$BUILD_CFLAGS" >&6
4325
micky3879b9f5e72025-07-08 18:04:53 -04004326 echo "$as_me:4326: checking for native build C preprocessor-flags" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01004327echo $ECHO_N "checking for native build C preprocessor-flags... $ECHO_C" >&6
4328
4329# Check whether --with-build-cppflags or --without-build-cppflags was given.
4330if test "${with_build_cppflags+set}" = set; then
4331 withval="$with_build_cppflags"
4332 BUILD_CPPFLAGS="$withval"
4333fi;
micky3879b9f5e72025-07-08 18:04:53 -04004334 echo "$as_me:4334: result: $BUILD_CPPFLAGS" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01004335echo "${ECHO_T}$BUILD_CPPFLAGS" >&6
4336
micky3879b9f5e72025-07-08 18:04:53 -04004337 echo "$as_me:4337: checking for native build linker-flags" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01004338echo $ECHO_N "checking for native build linker-flags... $ECHO_C" >&6
4339
4340# Check whether --with-build-ldflags or --without-build-ldflags was given.
4341if test "${with_build_ldflags+set}" = set; then
4342 withval="$with_build_ldflags"
4343 BUILD_LDFLAGS="$withval"
4344fi;
micky3879b9f5e72025-07-08 18:04:53 -04004345 echo "$as_me:4345: result: $BUILD_LDFLAGS" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01004346echo "${ECHO_T}$BUILD_LDFLAGS" >&6
4347
micky3879b9f5e72025-07-08 18:04:53 -04004348 echo "$as_me:4348: checking for native build linker-libraries" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01004349echo $ECHO_N "checking for native build linker-libraries... $ECHO_C" >&6
4350
4351# Check whether --with-build-libs or --without-build-libs was given.
4352if test "${with_build_libs+set}" = set; then
4353 withval="$with_build_libs"
4354 BUILD_LIBS="$withval"
4355fi;
micky3879b9f5e72025-07-08 18:04:53 -04004356 echo "$as_me:4356: result: $BUILD_LIBS" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01004357echo "${ECHO_T}$BUILD_LIBS" >&6
4358
4359 # this assumes we're on Unix.
4360 BUILD_EXEEXT=
4361 BUILD_OBJEXT=o
4362
4363 : ${BUILD_CC:='${CC}'}
4364
micky3879b9f5e72025-07-08 18:04:53 -04004365 echo "$as_me:4365: checking if the build-compiler \"$BUILD_CC\" works" >&5
4366echo $ECHO_N "checking if the build-compiler \"$BUILD_CC\" works... $ECHO_C" >&6
4367
4368 cf_save_crossed=$cross_compiling
4369 cf_save_ac_link=$ac_link
4370 cross_compiling=no
4371 cf_build_cppflags=$BUILD_CPPFLAGS
4372 test "$cf_build_cppflags" = "#" && cf_build_cppflags=
4373 ac_link='$BUILD_CC -o "conftest$ac_exeext" $BUILD_CFLAGS $cf_build_cppflags $BUILD_LDFLAGS "conftest.$ac_ext" $BUILD_LIBS >&5'
4374
4375 if test "$cross_compiling" = yes; then
4376 cf_ok_build_cc=unknown
4377else
4378 cat >"conftest.$ac_ext" <<_ACEOF
4379#line 4379 "configure"
4380#include "confdefs.h"
4381#include <stdio.h>
4382 int main(int argc, char *argv[])
4383 {
4384 ${cf_cv_main_return:-return}(argc < 0 || argv == 0 || argv[0] == 0);
4385 }
4386
4387_ACEOF
4388rm -f "conftest$ac_exeext"
4389if { (eval echo "$as_me:4389: \"$ac_link\"") >&5
4390 (eval $ac_link) 2>&5
4391 ac_status=$?
4392 echo "$as_me:4392: \$? = $ac_status" >&5
4393 (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
4394 { (eval echo "$as_me:4394: \"$ac_try\"") >&5
4395 (eval $ac_try) 2>&5
4396 ac_status=$?
4397 echo "$as_me:4397: \$? = $ac_status" >&5
4398 (exit "$ac_status"); }; }; then
4399 cf_ok_build_cc=yes
4400else
4401 echo "$as_me: program exited with status $ac_status" >&5
4402echo "$as_me: failed program was:" >&5
4403cat "conftest.$ac_ext" >&5
4404cf_ok_build_cc=no
4405fi
4406rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
4407fi
4408
4409 cross_compiling=$cf_save_crossed
4410 ac_link=$cf_save_ac_link
4411
4412 echo "$as_me:4412: result: $cf_ok_build_cc" >&5
4413echo "${ECHO_T}$cf_ok_build_cc" >&6
4414
4415 if test "$cf_ok_build_cc" != yes
4416 then
4417 { { echo "$as_me:4417: error: Cross-build requires two compilers.
Steve Kondikae271bc2015-11-15 02:50:53 +01004418Use --with-build-cc to specify the native compiler." >&5
4419echo "$as_me: error: Cross-build requires two compilers.
4420Use --with-build-cc to specify the native compiler." >&2;}
4421 { (exit 1); exit 1; }; }
4422 fi
4423
4424else
4425 : ${BUILD_CC:='${CC}'}
4426 : ${BUILD_CPP:='${CPP}'}
4427 : ${BUILD_CFLAGS:='${CFLAGS}'}
4428 : ${BUILD_CPPFLAGS:='${CPPFLAGS}'}
4429 : ${BUILD_LDFLAGS:='${LDFLAGS}'}
4430 : ${BUILD_LIBS:='${LIBS}'}
4431 : ${BUILD_EXEEXT:='$x'}
4432 : ${BUILD_OBJEXT:='o'}
4433fi
4434
4435###############################################################################
4436
4437### Options to allow the user to specify the set of libraries which are used.
4438### Use "--without-normal --with-shared" to allow the default model to be
4439### shared, for example.
4440cf_list_models=""
4441
micky3879b9f5e72025-07-08 18:04:53 -04004442echo "$as_me:4442: checking if you want to build shared C-objects" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01004443echo $ECHO_N "checking if you want to build shared C-objects... $ECHO_C" >&6
4444
4445# Check whether --with-shared or --without-shared was given.
4446if test "${with_shared+set}" = set; then
4447 withval="$with_shared"
4448 with_shared=$withval
4449else
4450 with_shared=no
4451fi;
micky3879b9f5e72025-07-08 18:04:53 -04004452echo "$as_me:4452: result: $with_shared" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01004453echo "${ECHO_T}$with_shared" >&6
4454test "$with_shared" = "yes" && cf_list_models="$cf_list_models shared"
4455
micky3879b9f5e72025-07-08 18:04:53 -04004456echo "$as_me:4456: checking for specified models" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01004457echo $ECHO_N "checking for specified models... $ECHO_C" >&6
4458test -z "$cf_list_models" && cf_list_models=normal
micky3879b9f5e72025-07-08 18:04:53 -04004459echo "$as_me:4459: result: $cf_list_models" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01004460echo "${ECHO_T}$cf_list_models" >&6
4461
4462### Use the first model as the default, and save its suffix for use in building
4463### up test-applications.
micky3879b9f5e72025-07-08 18:04:53 -04004464echo "$as_me:4464: checking for default model" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01004465echo $ECHO_N "checking for default model... $ECHO_C" >&6
4466DFT_LWR_MODEL=`echo "$cf_list_models" | $AWK '{print $1}'`
micky3879b9f5e72025-07-08 18:04:53 -04004467echo "$as_me:4467: result: $DFT_LWR_MODEL" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01004468echo "${ECHO_T}$DFT_LWR_MODEL" >&6
4469
4470DFT_UPR_MODEL=`echo "$DFT_LWR_MODEL" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
4471
micky3879b9f5e72025-07-08 18:04:53 -04004472echo "$as_me:4472: checking for specific curses-directory" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01004473echo $ECHO_N "checking for specific curses-directory... $ECHO_C" >&6
4474
4475# Check whether --with-curses-dir or --without-curses-dir was given.
4476if test "${with_curses_dir+set}" = set; then
4477 withval="$with_curses_dir"
4478 cf_cv_curses_dir=$withval
4479else
4480 cf_cv_curses_dir=no
4481fi;
micky3879b9f5e72025-07-08 18:04:53 -04004482echo "$as_me:4482: result: $cf_cv_curses_dir" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01004483echo "${ECHO_T}$cf_cv_curses_dir" >&6
4484
micky3879b9f5e72025-07-08 18:04:53 -04004485if test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no"
Steve Kondikae271bc2015-11-15 02:50:53 +01004486then
4487
4488if test "x$prefix" != xNONE; then
4489 cf_path_syntax="$prefix"
4490else
4491 cf_path_syntax="$ac_default_prefix"
4492fi
4493
4494case ".$withval" in
4495(.\$\(*\)*|.\'*\'*)
4496 ;;
4497(..|./*|.\\*)
4498 ;;
4499(.[a-zA-Z]:[\\/]*) # OS/2 EMX
4500 ;;
micky3879b9f5e72025-07-08 18:04:53 -04004501(.\$\{*prefix\}*|.\$\{*dir\}*)
Steve Kondikae271bc2015-11-15 02:50:53 +01004502 eval withval="$withval"
4503 case ".$withval" in
4504 (.NONE/*)
micky3879b9f5e72025-07-08 18:04:53 -04004505 withval=`echo "$withval" | sed -e s%NONE%$cf_path_syntax%`
Steve Kondikae271bc2015-11-15 02:50:53 +01004506 ;;
4507 esac
4508 ;;
4509(.no|.NONE/*)
micky3879b9f5e72025-07-08 18:04:53 -04004510 withval=`echo "$withval" | sed -e s%NONE%$cf_path_syntax%`
Steve Kondikae271bc2015-11-15 02:50:53 +01004511 ;;
4512(*)
micky3879b9f5e72025-07-08 18:04:53 -04004513 { { echo "$as_me:4513: error: expected a pathname, not \"$withval\"" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01004514echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;}
4515 { (exit 1); exit 1; }; }
4516 ;;
4517esac
4518
4519 if test -d "$cf_cv_curses_dir"
4520 then
4521
4522if test -n "$cf_cv_curses_dir/include" ; then
4523 for cf_add_incdir in $cf_cv_curses_dir/include
4524 do
micky3879b9f5e72025-07-08 18:04:53 -04004525 while test "$cf_add_incdir" != /usr/include
Steve Kondikae271bc2015-11-15 02:50:53 +01004526 do
micky3879b9f5e72025-07-08 18:04:53 -04004527 if test -d "$cf_add_incdir"
Steve Kondikae271bc2015-11-15 02:50:53 +01004528 then
4529 cf_have_incdir=no
4530 if test -n "$CFLAGS$CPPFLAGS" ; then
4531 # a loop is needed to ensure we can add subdirs of existing dirs
4532 for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
4533 if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
4534 cf_have_incdir=yes; break
4535 fi
4536 done
4537 fi
4538
4539 if test "$cf_have_incdir" = no ; then
4540 if test "$cf_add_incdir" = /usr/local/include ; then
4541 if test "$GCC" = yes
4542 then
4543 cf_save_CPPFLAGS=$CPPFLAGS
micky3879b9f5e72025-07-08 18:04:53 -04004544
4545 test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4546 CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
4547
4548 cat >"conftest.$ac_ext" <<_ACEOF
4549#line 4549 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +01004550#include "confdefs.h"
4551#include <stdio.h>
4552int
micky3879b9f5e72025-07-08 18:04:53 -04004553main (void)
Steve Kondikae271bc2015-11-15 02:50:53 +01004554{
4555printf("Hello")
4556 ;
4557 return 0;
4558}
4559_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -04004560rm -f "conftest.$ac_objext"
4561if { (eval echo "$as_me:4561: \"$ac_compile\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01004562 (eval $ac_compile) 2>&5
4563 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -04004564 echo "$as_me:4564: \$? = $ac_status" >&5
4565 (exit "$ac_status"); } &&
4566 { ac_try='test -s "conftest.$ac_objext"'
4567 { (eval echo "$as_me:4567: \"$ac_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01004568 (eval $ac_try) 2>&5
4569 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -04004570 echo "$as_me:4570: \$? = $ac_status" >&5
4571 (exit "$ac_status"); }; }; then
Steve Kondikae271bc2015-11-15 02:50:53 +01004572 :
4573else
4574 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -04004575cat "conftest.$ac_ext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01004576cf_have_incdir=yes
4577fi
micky3879b9f5e72025-07-08 18:04:53 -04004578rm -f "conftest.$ac_objext" "conftest.$ac_ext"
Steve Kondikae271bc2015-11-15 02:50:53 +01004579 CPPFLAGS=$cf_save_CPPFLAGS
4580 fi
4581 fi
4582 fi
4583
4584 if test "$cf_have_incdir" = no ; then
4585 test -n "$verbose" && echo " adding $cf_add_incdir to include-path" 1>&6
4586
micky3879b9f5e72025-07-08 18:04:53 -04004587echo "${as_me:-configure}:4587: testing adding $cf_add_incdir to include-path ..." 1>&5
Steve Kondikae271bc2015-11-15 02:50:53 +01004588
4589 CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
4590
micky3879b9f5e72025-07-08 18:04:53 -04004591 cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
Steve Kondikae271bc2015-11-15 02:50:53 +01004592 test "$cf_top_incdir" = "$cf_add_incdir" && break
4593 cf_add_incdir="$cf_top_incdir"
4594 else
4595 break
4596 fi
4597 else
4598 break
4599 fi
4600 done
4601 done
4602fi
4603
4604if test -n "$cf_cv_curses_dir/lib" ; then
4605 for cf_add_libdir in $cf_cv_curses_dir/lib
4606 do
micky3879b9f5e72025-07-08 18:04:53 -04004607 if test "$cf_add_libdir" = /usr/lib ; then
Steve Kondikae271bc2015-11-15 02:50:53 +01004608 :
micky3879b9f5e72025-07-08 18:04:53 -04004609 elif test -d "$cf_add_libdir"
Steve Kondikae271bc2015-11-15 02:50:53 +01004610 then
4611 cf_have_libdir=no
4612 if test -n "$LDFLAGS$LIBS" ; then
4613 # a loop is needed to ensure we can add subdirs of existing dirs
4614 for cf_test_libdir in $LDFLAGS $LIBS ; do
4615 if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
4616 cf_have_libdir=yes; break
4617 fi
4618 done
4619 fi
4620 if test "$cf_have_libdir" = no ; then
4621 test -n "$verbose" && echo " adding $cf_add_libdir to library-path" 1>&6
4622
micky3879b9f5e72025-07-08 18:04:53 -04004623echo "${as_me:-configure}:4623: testing adding $cf_add_libdir to library-path ..." 1>&5
Steve Kondikae271bc2015-11-15 02:50:53 +01004624
4625 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
4626 fi
4627 fi
4628 done
4629fi
4630
4631 fi
4632fi
4633
4634cf_ncuconfig_root=ncurses
4635cf_have_ncuconfig=no
4636
4637if test "x${PKG_CONFIG:=none}" != xnone; then
micky3879b9f5e72025-07-08 18:04:53 -04004638 echo "$as_me:4638: checking pkg-config for $cf_ncuconfig_root" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01004639echo $ECHO_N "checking pkg-config for $cf_ncuconfig_root... $ECHO_C" >&6
4640 if "$PKG_CONFIG" --exists $cf_ncuconfig_root ; then
micky3879b9f5e72025-07-08 18:04:53 -04004641 echo "$as_me:4641: result: yes" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01004642echo "${ECHO_T}yes" >&6
4643
micky3879b9f5e72025-07-08 18:04:53 -04004644 echo "$as_me:4644: checking if the $cf_ncuconfig_root package files work" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01004645echo $ECHO_N "checking if the $cf_ncuconfig_root package files work... $ECHO_C" >&6
4646 cf_have_ncuconfig=unknown
4647
micky3879b9f5e72025-07-08 18:04:53 -04004648 cf_save_CFLAGS="$CFLAGS"
Steve Kondikae271bc2015-11-15 02:50:53 +01004649 cf_save_CPPFLAGS="$CPPFLAGS"
4650 cf_save_LIBS="$LIBS"
4651
micky3879b9f5e72025-07-08 18:04:53 -04004652 cf_pkg_cflags="`$PKG_CONFIG --cflags $cf_ncuconfig_root`"
4653 cf_pkg_libs="`$PKG_CONFIG --libs $cf_ncuconfig_root`"
Steve Kondikae271bc2015-11-15 02:50:53 +01004654
micky3879b9f5e72025-07-08 18:04:53 -04004655 # while -W for passing linker flags is prevalent, it is not "standard".
4656 # At least one wrapper for c89/c99 (in Apple's xcode) has its own
4657 # incompatible _and_ non-standard -W option which gives an error. Work
4658 # around that pitfall.
4659 case "x${CC}@@${cf_pkg_libs}@${cf_pkg_cflags}" in
4660 (x*c[89]9@@*-W*)
4661
4662cf_fix_cppflags=no
4663cf_new_cflags=
4664cf_new_cppflags=
4665cf_new_extra_cppflags=
4666
4667for cf_add_cflags in $cf_pkg_cflags
Steve Kondikae271bc2015-11-15 02:50:53 +01004668do
micky3879b9f5e72025-07-08 18:04:53 -04004669case "$cf_fix_cppflags" in
4670(no)
4671 case "$cf_add_cflags" in
4672 (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
4673 case "$cf_add_cflags" in
4674 (-D*)
4675 cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
4676
4677 test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4678 && test -z "${cf_tst_cflags}" \
4679 && cf_fix_cppflags=yes
4680
4681 if test "$cf_fix_cppflags" = yes ; then
4682
4683 test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4684 cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4685
4686 continue
4687 elif test "${cf_tst_cflags}" = "\"'" ; then
4688
4689 test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4690 cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4691
4692 continue
4693 fi
4694 ;;
4695 esac
4696 case "$CPPFLAGS" in
4697 (*$cf_add_cflags)
4698 ;;
4699 (*)
4700 case "$cf_add_cflags" in
4701 (-D*)
4702 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
4703
4704CPPFLAGS=`echo "$CPPFLAGS" | \
4705 sed -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?[ ]/ /g' \
4706 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?$//g'`
4707
4708 ;;
4709 esac
4710
4711 test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
4712 cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
4713
4714 ;;
4715 esac
4716 ;;
4717 (*)
4718
4719 test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
4720 cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
4721
4722 ;;
4723 esac
4724 ;;
4725(yes)
4726
4727 test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4728 cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4729
4730 cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
4731
4732 test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4733 && test -z "${cf_tst_cflags}" \
4734 && cf_fix_cppflags=no
4735 ;;
4736esac
4737done
4738
4739if test -n "$cf_new_cflags" ; then
4740
4741 test -n "$CFLAGS" && CFLAGS="$CFLAGS "
4742 CFLAGS="${CFLAGS}$cf_new_cflags"
4743
4744fi
4745
4746if test -n "$cf_new_cppflags" ; then
4747
4748 test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4749 CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
4750
4751fi
4752
4753if test -n "$cf_new_extra_cppflags" ; then
4754
4755 test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
4756 EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
4757
4758fi
4759
4760cf_add_libs="$LIBS"
4761# reverse order
4762cf_add_0lib=
4763for cf_add_1lib in $cf_pkg_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
4764# filter duplicates
4765for cf_add_1lib in $cf_add_0lib; do
4766 for cf_add_2lib in $cf_add_libs; do
4767 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
Steve Kondikae271bc2015-11-15 02:50:53 +01004768 cf_add_1lib=
4769 break
4770 fi
4771 done
micky3879b9f5e72025-07-08 18:04:53 -04004772 test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
Steve Kondikae271bc2015-11-15 02:50:53 +01004773done
4774LIBS="$cf_add_libs"
4775
micky3879b9f5e72025-07-08 18:04:53 -04004776 cat >"conftest.$ac_ext" <<_ACEOF
4777#line 4777 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +01004778#include "confdefs.h"
4779#include <${cf_cv_ncurses_header:-curses.h}>
4780int
micky3879b9f5e72025-07-08 18:04:53 -04004781main (void)
Steve Kondikae271bc2015-11-15 02:50:53 +01004782{
micky3879b9f5e72025-07-08 18:04:53 -04004783initscr(); mousemask(0,0); tigetstr((char *)0);
Steve Kondikae271bc2015-11-15 02:50:53 +01004784 ;
4785 return 0;
4786}
4787_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -04004788rm -f "conftest.$ac_objext" "conftest$ac_exeext"
4789if { (eval echo "$as_me:4789: \"$ac_link\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01004790 (eval $ac_link) 2>&5
4791 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -04004792 echo "$as_me:4792: \$? = $ac_status" >&5
4793 (exit "$ac_status"); } &&
4794 { ac_try='test -s "conftest$ac_exeext"'
4795 { (eval echo "$as_me:4795: \"$ac_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01004796 (eval $ac_try) 2>&5
4797 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -04004798 echo "$as_me:4798: \$? = $ac_status" >&5
4799 (exit "$ac_status"); }; }; then
4800 if test "$cross_compiling" = yes; then
4801 cf_test_ncuconfig=maybe
4802else
4803 cat >"conftest.$ac_ext" <<_ACEOF
4804#line 4804 "configure"
4805#include "confdefs.h"
4806#include <${cf_cv_ncurses_header:-curses.h}>
4807 int main(void)
4808 { const char *xx = curses_version(); return (xx == 0); }
4809_ACEOF
4810rm -f "conftest$ac_exeext"
4811if { (eval echo "$as_me:4811: \"$ac_link\"") >&5
4812 (eval $ac_link) 2>&5
4813 ac_status=$?
4814 echo "$as_me:4814: \$? = $ac_status" >&5
4815 (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
4816 { (eval echo "$as_me:4816: \"$ac_try\"") >&5
4817 (eval $ac_try) 2>&5
4818 ac_status=$?
4819 echo "$as_me:4819: \$? = $ac_status" >&5
4820 (exit "$ac_status"); }; }; then
4821 cf_test_ncuconfig=yes
4822else
4823 echo "$as_me: program exited with status $ac_status" >&5
4824echo "$as_me: failed program was:" >&5
4825cat "conftest.$ac_ext" >&5
4826cf_test_ncuconfig=no
4827fi
4828rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
4829fi
4830else
4831 echo "$as_me: failed program was:" >&5
4832cat "conftest.$ac_ext" >&5
4833cf_test_ncuconfig=no
4834fi
4835rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
4836
4837 CFLAGS="$cf_save_CFLAGS"
4838 CPPFLAGS="$cf_save_CPPFLAGS"
4839 LIBS="$cf_save_LIBS"
4840
4841 if test "x$cf_test_ncuconfig" != xyes; then
4842 cf_temp=`echo "x$cf_pkg_cflags" | sed -e s/^x// -e 's/-W[^ ]*//g'`
4843 cf_pkg_cflags="$cf_temp"
4844 cf_temp=`echo "x$cf_pkg_libs" | sed -e s/^x// -e 's/-W[^ ]*//g'`
4845 cf_pkg_libs="$cf_temp"
4846 fi
4847 ;;
4848 esac
4849
4850for cf_add_cflags in $cf_pkg_cflags
4851do
4852 case "x$cf_add_cflags" in
4853 (x-[DU]*)
4854
4855cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
4856while true
4857do
4858 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'`
4859 test "$CFLAGS" != "$cf_old_cflag" || break
4860
4861 CFLAGS="$cf_old_cflag"
4862done
4863
4864cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
4865while true
4866do
4867 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'`
4868 test "$CPPFLAGS" != "$cf_old_cflag" || break
4869
4870 CPPFLAGS="$cf_old_cflag"
4871done
4872
4873 ;;
4874 esac
4875
4876cf_fix_cppflags=no
4877cf_new_cflags=
4878cf_new_cppflags=
4879cf_new_extra_cppflags=
4880
4881for cf_add_cflags in $cf_add_cflags
4882do
4883case "$cf_fix_cppflags" in
4884(no)
4885 case "$cf_add_cflags" in
4886 (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
4887 case "$cf_add_cflags" in
4888 (-D*)
4889 cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
4890
4891 test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4892 && test -z "${cf_tst_cflags}" \
4893 && cf_fix_cppflags=yes
4894
4895 if test "$cf_fix_cppflags" = yes ; then
4896
4897 test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4898 cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4899
4900 continue
4901 elif test "${cf_tst_cflags}" = "\"'" ; then
4902
4903 test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4904 cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4905
4906 continue
4907 fi
4908 ;;
4909 esac
4910 case "$CPPFLAGS" in
4911 (*$cf_add_cflags)
4912 ;;
4913 (*)
4914 case "$cf_add_cflags" in
4915 (-D*)
4916 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
4917
4918CPPFLAGS=`echo "$CPPFLAGS" | \
4919 sed -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?[ ]/ /g' \
4920 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?$//g'`
4921
4922 ;;
4923 esac
4924
4925 test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
4926 cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
4927
4928 ;;
4929 esac
4930 ;;
4931 (*)
4932
4933 test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
4934 cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
4935
4936 ;;
4937 esac
4938 ;;
4939(yes)
4940
4941 test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4942 cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4943
4944 cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
4945
4946 test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4947 && test -z "${cf_tst_cflags}" \
4948 && cf_fix_cppflags=no
4949 ;;
4950esac
4951done
4952
4953if test -n "$cf_new_cflags" ; then
4954
4955 test -n "$CFLAGS" && CFLAGS="$CFLAGS "
4956 CFLAGS="${CFLAGS}$cf_new_cflags"
4957
4958fi
4959
4960if test -n "$cf_new_cppflags" ; then
4961
4962 test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4963 CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
4964
4965fi
4966
4967if test -n "$cf_new_extra_cppflags" ; then
4968
4969 test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
4970 EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
4971
4972fi
4973
4974done
4975
4976cf_add_libs="$LIBS"
4977# reverse order
4978cf_add_0lib=
4979for cf_add_1lib in $cf_pkg_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
4980# filter duplicates
4981for cf_add_1lib in $cf_add_0lib; do
4982 for cf_add_2lib in $cf_add_libs; do
4983 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
4984 cf_add_1lib=
4985 break
4986 fi
4987 done
4988 test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
4989done
4990LIBS="$cf_add_libs"
4991
4992 cat >"conftest.$ac_ext" <<_ACEOF
4993#line 4993 "configure"
4994#include "confdefs.h"
4995#include <${cf_cv_ncurses_header:-curses.h}>
4996int
4997main (void)
4998{
4999initscr(); mousemask(0,0); tigetstr((char *)0);
5000 ;
5001 return 0;
5002}
5003_ACEOF
5004rm -f "conftest.$ac_objext" "conftest$ac_exeext"
5005if { (eval echo "$as_me:5005: \"$ac_link\"") >&5
5006 (eval $ac_link) 2>&5
5007 ac_status=$?
5008 echo "$as_me:5008: \$? = $ac_status" >&5
5009 (exit "$ac_status"); } &&
5010 { ac_try='test -s "conftest$ac_exeext"'
5011 { (eval echo "$as_me:5011: \"$ac_try\"") >&5
5012 (eval $ac_try) 2>&5
5013 ac_status=$?
5014 echo "$as_me:5014: \$? = $ac_status" >&5
5015 (exit "$ac_status"); }; }; then
Steve Kondikae271bc2015-11-15 02:50:53 +01005016 if test "$cross_compiling" = yes; then
5017 cf_have_ncuconfig=maybe
5018else
micky3879b9f5e72025-07-08 18:04:53 -04005019 cat >"conftest.$ac_ext" <<_ACEOF
5020#line 5020 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +01005021#include "confdefs.h"
5022#include <${cf_cv_ncurses_header:-curses.h}>
5023 int main(void)
micky3879b9f5e72025-07-08 18:04:53 -04005024 { const char *xx = curses_version(); return (xx == 0); }
Steve Kondikae271bc2015-11-15 02:50:53 +01005025_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -04005026rm -f "conftest$ac_exeext"
5027if { (eval echo "$as_me:5027: \"$ac_link\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01005028 (eval $ac_link) 2>&5
5029 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -04005030 echo "$as_me:5030: \$? = $ac_status" >&5
5031 (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
5032 { (eval echo "$as_me:5032: \"$ac_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01005033 (eval $ac_try) 2>&5
5034 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -04005035 echo "$as_me:5035: \$? = $ac_status" >&5
5036 (exit "$ac_status"); }; }; then
Steve Kondikae271bc2015-11-15 02:50:53 +01005037 cf_have_ncuconfig=yes
5038else
5039 echo "$as_me: program exited with status $ac_status" >&5
5040echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -04005041cat "conftest.$ac_ext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01005042cf_have_ncuconfig=no
5043fi
micky3879b9f5e72025-07-08 18:04:53 -04005044rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
Steve Kondikae271bc2015-11-15 02:50:53 +01005045fi
5046else
5047 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -04005048cat "conftest.$ac_ext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01005049cf_have_ncuconfig=no
5050fi
micky3879b9f5e72025-07-08 18:04:53 -04005051rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
5052 echo "$as_me:5052: result: $cf_have_ncuconfig" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01005053echo "${ECHO_T}$cf_have_ncuconfig" >&6
5054 test "$cf_have_ncuconfig" = maybe && cf_have_ncuconfig=yes
5055 if test "$cf_have_ncuconfig" != "yes"
5056 then
5057 CPPFLAGS="$cf_save_CPPFLAGS"
5058 LIBS="$cf_save_LIBS"
5059 NCURSES_CONFIG_PKG=none
5060 else
5061
5062cat >>confdefs.h <<\EOF
5063#define NCURSES 1
5064EOF
5065
5066 NCURSES_CONFIG_PKG=$cf_ncuconfig_root
micky3879b9f5e72025-07-08 18:04:53 -04005067
5068echo "$as_me:5068: checking for terminfo header" >&5
5069echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
5070if test "${cf_cv_term_header+set}" = set; then
5071 echo $ECHO_N "(cached) $ECHO_C" >&6
5072else
5073
5074case "${cf_cv_ncurses_header}" in
5075(*/ncurses.h|*/ncursesw.h)
5076 cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
5077 ;;
5078(*)
5079 cf_term_header=term.h
5080 ;;
5081esac
5082
5083for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
5084do
5085cat >"conftest.$ac_ext" <<_ACEOF
5086#line 5086 "configure"
5087#include "confdefs.h"
5088#include <stdio.h>
5089#include <${cf_cv_ncurses_header:-curses.h}>
5090#include <$cf_test>
5091
5092int
5093main (void)
5094{
5095int x = auto_left_margin; (void)x
5096 ;
5097 return 0;
5098}
5099_ACEOF
5100rm -f "conftest.$ac_objext"
5101if { (eval echo "$as_me:5101: \"$ac_compile\"") >&5
5102 (eval $ac_compile) 2>&5
5103 ac_status=$?
5104 echo "$as_me:5104: \$? = $ac_status" >&5
5105 (exit "$ac_status"); } &&
5106 { ac_try='test -s "conftest.$ac_objext"'
5107 { (eval echo "$as_me:5107: \"$ac_try\"") >&5
5108 (eval $ac_try) 2>&5
5109 ac_status=$?
5110 echo "$as_me:5110: \$? = $ac_status" >&5
5111 (exit "$ac_status"); }; }; then
5112
5113 cf_cv_term_header="$cf_test"
5114else
5115 echo "$as_me: failed program was:" >&5
5116cat "conftest.$ac_ext" >&5
5117
5118 cf_cv_term_header=unknown
5119
5120fi
5121rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5122 test "$cf_cv_term_header" != unknown && break
5123done
5124
5125fi
5126echo "$as_me:5126: result: $cf_cv_term_header" >&5
5127echo "${ECHO_T}$cf_cv_term_header" >&6
5128
5129# Set definitions to allow ifdef'ing to accommodate subdirectories
5130
5131case "$cf_cv_term_header" in
5132(*term.h)
5133
5134cat >>confdefs.h <<\EOF
5135#define HAVE_TERM_H 1
5136EOF
5137
5138 ;;
5139esac
5140
5141case "$cf_cv_term_header" in
5142(ncurses/term.h)
5143
5144cat >>confdefs.h <<\EOF
5145#define HAVE_NCURSES_TERM_H 1
5146EOF
5147
5148 ;;
5149(ncursesw/term.h)
5150
5151cat >>confdefs.h <<\EOF
5152#define HAVE_NCURSESW_TERM_H 1
5153EOF
5154
5155 ;;
5156esac
5157
Steve Kondikae271bc2015-11-15 02:50:53 +01005158 fi
5159
5160 else
micky3879b9f5e72025-07-08 18:04:53 -04005161 echo "$as_me:5161: result: no" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01005162echo "${ECHO_T}no" >&6
5163 NCURSES_CONFIG_PKG=none
5164 fi
5165else
5166 NCURSES_CONFIG_PKG=none
5167fi
5168
5169if test "x$cf_have_ncuconfig" = "xno"; then
micky3879b9f5e72025-07-08 18:04:53 -04005170 cf_ncurses_config="${cf_ncuconfig_root}${NCURSES_CONFIG_SUFFIX}-config"; echo "Looking for ${cf_ncurses_config}"
Steve Kondikae271bc2015-11-15 02:50:53 +01005171
5172if test -n "$ac_tool_prefix"; then
micky3879b9f5e72025-07-08 18:04:53 -04005173 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 +01005174 do
5175 # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
5176set dummy $ac_tool_prefix$ac_prog; ac_word=$2
micky3879b9f5e72025-07-08 18:04:53 -04005177echo "$as_me:5177: checking for $ac_word" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01005178echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
5179if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
5180 echo $ECHO_N "(cached) $ECHO_C" >&6
5181else
5182 if test -n "$NCURSES_CONFIG"; then
5183 ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
5184else
5185 ac_save_IFS=$IFS; IFS=$ac_path_separator
5186ac_dummy="$PATH"
5187for ac_dir in $ac_dummy; do
5188 IFS=$ac_save_IFS
5189 test -z "$ac_dir" && ac_dir=.
5190 $as_executable_p "$ac_dir/$ac_word" || continue
5191ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
micky3879b9f5e72025-07-08 18:04:53 -04005192echo "$as_me:5192: found $ac_dir/$ac_word" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01005193break
5194done
5195
5196fi
5197fi
5198NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
5199if test -n "$NCURSES_CONFIG"; then
micky3879b9f5e72025-07-08 18:04:53 -04005200 echo "$as_me:5200: result: $NCURSES_CONFIG" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01005201echo "${ECHO_T}$NCURSES_CONFIG" >&6
5202else
micky3879b9f5e72025-07-08 18:04:53 -04005203 echo "$as_me:5203: result: no" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01005204echo "${ECHO_T}no" >&6
5205fi
5206
5207 test -n "$NCURSES_CONFIG" && break
5208 done
5209fi
5210if test -z "$NCURSES_CONFIG"; then
5211 ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
micky3879b9f5e72025-07-08 18:04:53 -04005212 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 +01005213do
5214 # Extract the first word of "$ac_prog", so it can be a program name with args.
5215set dummy $ac_prog; ac_word=$2
micky3879b9f5e72025-07-08 18:04:53 -04005216echo "$as_me:5216: checking for $ac_word" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01005217echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
5218if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
5219 echo $ECHO_N "(cached) $ECHO_C" >&6
5220else
5221 if test -n "$ac_ct_NCURSES_CONFIG"; then
5222 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
5223else
5224 ac_save_IFS=$IFS; IFS=$ac_path_separator
5225ac_dummy="$PATH"
5226for ac_dir in $ac_dummy; do
5227 IFS=$ac_save_IFS
5228 test -z "$ac_dir" && ac_dir=.
5229 $as_executable_p "$ac_dir/$ac_word" || continue
5230ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
micky3879b9f5e72025-07-08 18:04:53 -04005231echo "$as_me:5231: found $ac_dir/$ac_word" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01005232break
5233done
5234
5235fi
5236fi
5237ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
5238if test -n "$ac_ct_NCURSES_CONFIG"; then
micky3879b9f5e72025-07-08 18:04:53 -04005239 echo "$as_me:5239: result: $ac_ct_NCURSES_CONFIG" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01005240echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
5241else
micky3879b9f5e72025-07-08 18:04:53 -04005242 echo "$as_me:5242: result: no" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01005243echo "${ECHO_T}no" >&6
5244fi
5245
5246 test -n "$ac_ct_NCURSES_CONFIG" && break
5247done
5248test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
5249
5250 NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
5251fi
5252
5253 if test "$NCURSES_CONFIG" != none ; then
5254
micky3879b9f5e72025-07-08 18:04:53 -04005255for cf_add_cflags in `$NCURSES_CONFIG --cflags`
Steve Kondikae271bc2015-11-15 02:50:53 +01005256do
micky3879b9f5e72025-07-08 18:04:53 -04005257 case "x$cf_add_cflags" in
5258 (x-[DU]*)
5259
5260cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
5261while true
5262do
5263 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'`
5264 test "$CFLAGS" != "$cf_old_cflag" || break
5265
5266 CFLAGS="$cf_old_cflag"
5267done
5268
5269cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
5270while true
5271do
5272 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'`
5273 test "$CPPFLAGS" != "$cf_old_cflag" || break
5274
5275 CPPFLAGS="$cf_old_cflag"
5276done
5277
5278 ;;
5279 esac
5280
5281cf_fix_cppflags=no
5282cf_new_cflags=
5283cf_new_cppflags=
5284cf_new_extra_cppflags=
5285
5286for cf_add_cflags in $cf_add_cflags
5287do
5288case "$cf_fix_cppflags" in
5289(no)
5290 case "$cf_add_cflags" in
5291 (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
5292 case "$cf_add_cflags" in
5293 (-D*)
5294 cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
5295
5296 test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
5297 && test -z "${cf_tst_cflags}" \
5298 && cf_fix_cppflags=yes
5299
5300 if test "$cf_fix_cppflags" = yes ; then
5301
5302 test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
5303 cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
5304
5305 continue
5306 elif test "${cf_tst_cflags}" = "\"'" ; then
5307
5308 test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
5309 cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
5310
5311 continue
5312 fi
5313 ;;
5314 esac
5315 case "$CPPFLAGS" in
5316 (*$cf_add_cflags)
5317 ;;
5318 (*)
5319 case "$cf_add_cflags" in
5320 (-D*)
5321 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
5322
5323CPPFLAGS=`echo "$CPPFLAGS" | \
5324 sed -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?[ ]/ /g' \
5325 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?$//g'`
5326
5327 ;;
5328 esac
5329
5330 test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
5331 cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
5332
5333 ;;
5334 esac
5335 ;;
5336 (*)
5337
5338 test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
5339 cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
5340
5341 ;;
5342 esac
5343 ;;
5344(yes)
5345
5346 test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
5347 cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
5348
5349 cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
5350
5351 test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
5352 && test -z "${cf_tst_cflags}" \
5353 && cf_fix_cppflags=no
5354 ;;
5355esac
5356done
5357
5358if test -n "$cf_new_cflags" ; then
5359
5360 test -n "$CFLAGS" && CFLAGS="$CFLAGS "
5361 CFLAGS="${CFLAGS}$cf_new_cflags"
5362
5363fi
5364
5365if test -n "$cf_new_cppflags" ; then
5366
5367 test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
5368 CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
5369
5370fi
5371
5372if test -n "$cf_new_extra_cppflags" ; then
5373
5374 test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
5375 EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
5376
5377fi
5378
5379done
5380
5381cf_add_libs="$LIBS"
5382# reverse order
5383cf_add_0lib=
5384for cf_add_1lib in `$NCURSES_CONFIG --libs`; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
5385# filter duplicates
5386for cf_add_1lib in $cf_add_0lib; do
5387 for cf_add_2lib in $cf_add_libs; do
5388 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
Steve Kondikae271bc2015-11-15 02:50:53 +01005389 cf_add_1lib=
5390 break
5391 fi
5392 done
micky3879b9f5e72025-07-08 18:04:53 -04005393 test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
Steve Kondikae271bc2015-11-15 02:50:53 +01005394done
5395LIBS="$cf_add_libs"
5396
5397 # even with config script, some packages use no-override for curses.h
5398
micky3879b9f5e72025-07-08 18:04:53 -04005399echo "$as_me:5399: checking if we have identified curses headers" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01005400echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
5401if test "${cf_cv_ncurses_header+set}" = set; then
5402 echo $ECHO_N "(cached) $ECHO_C" >&6
5403else
5404
5405cf_cv_ncurses_header=none
5406for cf_header in \
5407 ncurses.h ncurses/ncurses.h \
5408 curses.h ncurses/curses.h
5409do
micky3879b9f5e72025-07-08 18:04:53 -04005410cat >"conftest.$ac_ext" <<_ACEOF
5411#line 5411 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +01005412#include "confdefs.h"
5413#include <${cf_header}>
5414int
micky3879b9f5e72025-07-08 18:04:53 -04005415main (void)
Steve Kondikae271bc2015-11-15 02:50:53 +01005416{
micky3879b9f5e72025-07-08 18:04:53 -04005417initscr(); endwin()
Steve Kondikae271bc2015-11-15 02:50:53 +01005418 ;
5419 return 0;
5420}
5421_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -04005422rm -f "conftest.$ac_objext"
5423if { (eval echo "$as_me:5423: \"$ac_compile\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01005424 (eval $ac_compile) 2>&5
5425 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -04005426 echo "$as_me:5426: \$? = $ac_status" >&5
5427 (exit "$ac_status"); } &&
5428 { ac_try='test -s "conftest.$ac_objext"'
5429 { (eval echo "$as_me:5429: \"$ac_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01005430 (eval $ac_try) 2>&5
5431 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -04005432 echo "$as_me:5432: \$? = $ac_status" >&5
5433 (exit "$ac_status"); }; }; then
Steve Kondikae271bc2015-11-15 02:50:53 +01005434 cf_cv_ncurses_header=$cf_header; break
5435else
5436 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -04005437cat "conftest.$ac_ext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01005438fi
micky3879b9f5e72025-07-08 18:04:53 -04005439rm -f "conftest.$ac_objext" "conftest.$ac_ext"
Steve Kondikae271bc2015-11-15 02:50:53 +01005440done
5441
5442fi
micky3879b9f5e72025-07-08 18:04:53 -04005443echo "$as_me:5443: result: $cf_cv_ncurses_header" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01005444echo "${ECHO_T}$cf_cv_ncurses_header" >&6
5445
5446if test "$cf_cv_ncurses_header" = none ; then
micky3879b9f5e72025-07-08 18:04:53 -04005447 { { echo "$as_me:5447: error: No curses header-files found" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01005448echo "$as_me: error: No curses header-files found" >&2;}
5449 { (exit 1); exit 1; }; }
5450fi
5451
5452# cheat, to get the right #define's for HAVE_NCURSES_H, etc.
5453
5454for ac_header in $cf_cv_ncurses_header
5455do
5456as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
micky3879b9f5e72025-07-08 18:04:53 -04005457echo "$as_me:5457: checking for $ac_header" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01005458echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
5459if eval "test \"\${$as_ac_Header+set}\" = set"; then
5460 echo $ECHO_N "(cached) $ECHO_C" >&6
5461else
micky3879b9f5e72025-07-08 18:04:53 -04005462 cat >"conftest.$ac_ext" <<_ACEOF
5463#line 5463 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +01005464#include "confdefs.h"
5465#include <$ac_header>
5466_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -04005467if { (eval echo "$as_me:5467: \"$ac_cpp "conftest.$ac_ext"\"") >&5
5468 (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
Steve Kondikae271bc2015-11-15 02:50:53 +01005469 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -04005470 $EGREP -v '^ *\+' conftest.er1 >conftest.err
Steve Kondikae271bc2015-11-15 02:50:53 +01005471 rm -f conftest.er1
5472 cat conftest.err >&5
micky3879b9f5e72025-07-08 18:04:53 -04005473 echo "$as_me:5473: \$? = $ac_status" >&5
5474 (exit "$ac_status"); } >/dev/null; then
Steve Kondikae271bc2015-11-15 02:50:53 +01005475 if test -s conftest.err; then
5476 ac_cpp_err=$ac_c_preproc_warn_flag
5477 else
5478 ac_cpp_err=
5479 fi
5480else
5481 ac_cpp_err=yes
5482fi
5483if test -z "$ac_cpp_err"; then
5484 eval "$as_ac_Header=yes"
5485else
5486 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -04005487 cat "conftest.$ac_ext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01005488 eval "$as_ac_Header=no"
5489fi
micky3879b9f5e72025-07-08 18:04:53 -04005490rm -f conftest.err "conftest.$ac_ext"
Steve Kondikae271bc2015-11-15 02:50:53 +01005491fi
micky3879b9f5e72025-07-08 18:04:53 -04005492echo "$as_me:5492: result: `eval echo '${'"$as_ac_Header"'}'`" >&5
5493echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6
5494if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then
Steve Kondikae271bc2015-11-15 02:50:53 +01005495 cat >>confdefs.h <<EOF
5496#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
5497EOF
5498
5499fi
5500done
5501
5502cat >>confdefs.h <<\EOF
5503#define NCURSES 1
5504EOF
5505
5506cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
5507
5508 cat >>confdefs.h <<EOF
5509#define $cf_nculib_ROOT 1
5510EOF
5511
micky3879b9f5e72025-07-08 18:04:53 -04005512 cf_cv_ncurses_version="`$NCURSES_CONFIG --version`"
Steve Kondikae271bc2015-11-15 02:50:53 +01005513
5514 else
5515
5516cf_ncuhdr_root=ncurses
5517
5518test -n "$cf_cv_curses_dir" && \
5519test "$cf_cv_curses_dir" != "no" && { \
5520
5521if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
5522 for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
5523 do
micky3879b9f5e72025-07-08 18:04:53 -04005524 while test "$cf_add_incdir" != /usr/include
Steve Kondikae271bc2015-11-15 02:50:53 +01005525 do
micky3879b9f5e72025-07-08 18:04:53 -04005526 if test -d "$cf_add_incdir"
Steve Kondikae271bc2015-11-15 02:50:53 +01005527 then
5528 cf_have_incdir=no
5529 if test -n "$CFLAGS$CPPFLAGS" ; then
5530 # a loop is needed to ensure we can add subdirs of existing dirs
5531 for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
5532 if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
5533 cf_have_incdir=yes; break
5534 fi
5535 done
5536 fi
5537
5538 if test "$cf_have_incdir" = no ; then
5539 if test "$cf_add_incdir" = /usr/local/include ; then
5540 if test "$GCC" = yes
5541 then
5542 cf_save_CPPFLAGS=$CPPFLAGS
micky3879b9f5e72025-07-08 18:04:53 -04005543
5544 test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
5545 CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
5546
5547 cat >"conftest.$ac_ext" <<_ACEOF
5548#line 5548 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +01005549#include "confdefs.h"
5550#include <stdio.h>
5551int
micky3879b9f5e72025-07-08 18:04:53 -04005552main (void)
Steve Kondikae271bc2015-11-15 02:50:53 +01005553{
5554printf("Hello")
5555 ;
5556 return 0;
5557}
5558_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -04005559rm -f "conftest.$ac_objext"
5560if { (eval echo "$as_me:5560: \"$ac_compile\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01005561 (eval $ac_compile) 2>&5
5562 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -04005563 echo "$as_me:5563: \$? = $ac_status" >&5
5564 (exit "$ac_status"); } &&
5565 { ac_try='test -s "conftest.$ac_objext"'
5566 { (eval echo "$as_me:5566: \"$ac_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01005567 (eval $ac_try) 2>&5
5568 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -04005569 echo "$as_me:5569: \$? = $ac_status" >&5
5570 (exit "$ac_status"); }; }; then
Steve Kondikae271bc2015-11-15 02:50:53 +01005571 :
5572else
5573 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -04005574cat "conftest.$ac_ext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01005575cf_have_incdir=yes
5576fi
micky3879b9f5e72025-07-08 18:04:53 -04005577rm -f "conftest.$ac_objext" "conftest.$ac_ext"
Steve Kondikae271bc2015-11-15 02:50:53 +01005578 CPPFLAGS=$cf_save_CPPFLAGS
5579 fi
5580 fi
5581 fi
5582
5583 if test "$cf_have_incdir" = no ; then
5584 test -n "$verbose" && echo " adding $cf_add_incdir to include-path" 1>&6
5585
micky3879b9f5e72025-07-08 18:04:53 -04005586echo "${as_me:-configure}:5586: testing adding $cf_add_incdir to include-path ..." 1>&5
Steve Kondikae271bc2015-11-15 02:50:53 +01005587
5588 CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
5589
micky3879b9f5e72025-07-08 18:04:53 -04005590 cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
Steve Kondikae271bc2015-11-15 02:50:53 +01005591 test "$cf_top_incdir" = "$cf_add_incdir" && break
5592 cf_add_incdir="$cf_top_incdir"
5593 else
5594 break
5595 fi
5596 else
5597 break
5598 fi
5599 done
5600 done
5601fi
5602
5603}
5604
micky3879b9f5e72025-07-08 18:04:53 -04005605echo "$as_me:5605: checking for $cf_ncuhdr_root header in include-path" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01005606echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
5607if test "${cf_cv_ncurses_h+set}" = set; then
5608 echo $ECHO_N "(cached) $ECHO_C" >&6
5609else
5610
5611 cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
micky3879b9f5e72025-07-08 18:04:53 -04005612 { 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 +01005613 for cf_header in $cf_header_list
5614 do
5615
micky3879b9f5e72025-07-08 18:04:53 -04005616 cat >"conftest.$ac_ext" <<_ACEOF
5617#line 5617 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +01005618#include "confdefs.h"
5619
5620#include <$cf_header>
5621int
micky3879b9f5e72025-07-08 18:04:53 -04005622main (void)
Steve Kondikae271bc2015-11-15 02:50:53 +01005623{
5624
5625#ifdef NCURSES_VERSION
5626
micky3879b9f5e72025-07-08 18:04:53 -04005627printf("%s\\n", NCURSES_VERSION);
Steve Kondikae271bc2015-11-15 02:50:53 +01005628#else
5629#ifdef __NCURSES_H
micky3879b9f5e72025-07-08 18:04:53 -04005630printf("old\\n");
Steve Kondikae271bc2015-11-15 02:50:53 +01005631#else
micky3879b9f5e72025-07-08 18:04:53 -04005632 #error __NCURSES_H is not defined
Steve Kondikae271bc2015-11-15 02:50:53 +01005633#endif
5634#endif
5635
5636 ;
5637 return 0;
5638}
5639_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -04005640rm -f "conftest.$ac_objext"
5641if { (eval echo "$as_me:5641: \"$ac_compile\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01005642 (eval $ac_compile) 2>&5
5643 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -04005644 echo "$as_me:5644: \$? = $ac_status" >&5
5645 (exit "$ac_status"); } &&
5646 { ac_try='test -s "conftest.$ac_objext"'
5647 { (eval echo "$as_me:5647: \"$ac_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01005648 (eval $ac_try) 2>&5
5649 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -04005650 echo "$as_me:5650: \$? = $ac_status" >&5
5651 (exit "$ac_status"); }; }; then
Steve Kondikae271bc2015-11-15 02:50:53 +01005652 cf_cv_ncurses_h=$cf_header
5653
5654else
5655 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -04005656cat "conftest.$ac_ext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01005657cf_cv_ncurses_h=no
5658fi
micky3879b9f5e72025-07-08 18:04:53 -04005659rm -f "conftest.$ac_objext" "conftest.$ac_ext"
Steve Kondikae271bc2015-11-15 02:50:53 +01005660
5661 test "$cf_cv_ncurses_h" != no && break
5662 done
5663
5664fi
micky3879b9f5e72025-07-08 18:04:53 -04005665echo "$as_me:5665: result: $cf_cv_ncurses_h" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01005666echo "${ECHO_T}$cf_cv_ncurses_h" >&6
5667
5668if test "$cf_cv_ncurses_h" != no ; then
5669 cf_cv_ncurses_header=$cf_cv_ncurses_h
5670else
5671
micky3879b9f5e72025-07-08 18:04:53 -04005672echo "$as_me:5672: checking for $cf_ncuhdr_root include-path" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01005673echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
5674if test "${cf_cv_ncurses_h2+set}" = set; then
5675 echo $ECHO_N "(cached) $ECHO_C" >&6
5676else
5677
5678 test -n "$verbose" && echo
5679
5680cf_search=
5681
5682# collect the current set of include-directories from compiler flags
5683cf_header_path_list=""
5684if test -n "${CFLAGS}${CPPFLAGS}" ; then
5685 for cf_header_path in $CPPFLAGS $CFLAGS
5686 do
micky3879b9f5e72025-07-08 18:04:53 -04005687 case "$cf_header_path" in
Steve Kondikae271bc2015-11-15 02:50:53 +01005688 (-I*)
5689 cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
5690
5691test "x$cf_header_path" != "xNONE" && \
5692test -d "$cf_header_path" && \
5693 {
5694 test -n "$verbose" && echo " ... testing for include-directories under $cf_header_path"
micky3879b9f5e72025-07-08 18:04:53 -04005695 test -d "$cf_header_path/include" && cf_search="$cf_search $cf_header_path/include"
5696 test -d "$cf_header_path/include/$cf_ncuhdr_root" && cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
5697 test -d "$cf_header_path/include/$cf_ncuhdr_root/include" && cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
5698 test -d "$cf_header_path/$cf_ncuhdr_root/include" && cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
5699 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 +01005700}
5701
5702 cf_header_path_list="$cf_header_path_list $cf_search"
5703 ;;
5704 esac
5705 done
5706fi
5707
5708# add the variations for the package we are looking for
5709
5710cf_search=
5711
5712test "x$prefix" != "xNONE" && \
5713test -d "$prefix" && \
5714 {
5715 test -n "$verbose" && echo " ... testing for include-directories under $prefix"
micky3879b9f5e72025-07-08 18:04:53 -04005716 test -d "$prefix/include" && cf_search="$cf_search $prefix/include"
5717 test -d "$prefix/include/$cf_ncuhdr_root" && cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
5718 test -d "$prefix/include/$cf_ncuhdr_root/include" && cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
5719 test -d "$prefix/$cf_ncuhdr_root/include" && cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
5720 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 +01005721}
5722
5723for cf_subdir_prefix in \
5724 /usr \
5725 /usr/local \
5726 /usr/pkg \
5727 /opt \
5728 /opt/local \
5729 $HOME
5730do
5731
5732test "x$cf_subdir_prefix" != "x$prefix" && \
5733test -d "$cf_subdir_prefix" && \
micky3879b9f5e72025-07-08 18:04:53 -04005734{ test -z "$prefix" || test "x$prefix" = xNONE || test "x$cf_subdir_prefix" != "x$prefix"; } && {
Steve Kondikae271bc2015-11-15 02:50:53 +01005735 test -n "$verbose" && echo " ... testing for include-directories under $cf_subdir_prefix"
micky3879b9f5e72025-07-08 18:04:53 -04005736 test -d "$cf_subdir_prefix/include" && cf_search="$cf_search $cf_subdir_prefix/include"
5737 test -d "$cf_subdir_prefix/include/$cf_ncuhdr_root" && cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root"
5738 test -d "$cf_subdir_prefix/include/$cf_ncuhdr_root/include" && cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root/include"
5739 test -d "$cf_subdir_prefix/$cf_ncuhdr_root/include" && cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include"
5740 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 +01005741}
5742
5743done
5744
5745test "$includedir" != NONE && \
5746test "$includedir" != "/usr/include" && \
5747test -d "$includedir" && {
micky3879b9f5e72025-07-08 18:04:53 -04005748 test -d "$includedir" && cf_search="$cf_search $includedir"
5749 test -d "$includedir/$cf_ncuhdr_root" && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
Steve Kondikae271bc2015-11-15 02:50:53 +01005750}
5751
5752test "$oldincludedir" != NONE && \
5753test "$oldincludedir" != "/usr/include" && \
5754test -d "$oldincludedir" && {
micky3879b9f5e72025-07-08 18:04:53 -04005755 test -d "$oldincludedir" && cf_search="$cf_search $oldincludedir"
5756 test -d "$oldincludedir/$cf_ncuhdr_root" && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
Steve Kondikae271bc2015-11-15 02:50:53 +01005757}
5758
5759cf_search="$cf_search $cf_header_path_list"
5760
micky3879b9f5e72025-07-08 18:04:53 -04005761 test -n "$verbose" && echo "search path $cf_search"
Steve Kondikae271bc2015-11-15 02:50:53 +01005762 cf_save2_CPPFLAGS="$CPPFLAGS"
5763 for cf_incdir in $cf_search
5764 do
5765
5766if test -n "$cf_incdir" ; then
5767 for cf_add_incdir in $cf_incdir
5768 do
micky3879b9f5e72025-07-08 18:04:53 -04005769 while test "$cf_add_incdir" != /usr/include
Steve Kondikae271bc2015-11-15 02:50:53 +01005770 do
micky3879b9f5e72025-07-08 18:04:53 -04005771 if test -d "$cf_add_incdir"
Steve Kondikae271bc2015-11-15 02:50:53 +01005772 then
5773 cf_have_incdir=no
5774 if test -n "$CFLAGS$CPPFLAGS" ; then
5775 # a loop is needed to ensure we can add subdirs of existing dirs
5776 for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
5777 if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
5778 cf_have_incdir=yes; break
5779 fi
5780 done
5781 fi
5782
5783 if test "$cf_have_incdir" = no ; then
5784 if test "$cf_add_incdir" = /usr/local/include ; then
5785 if test "$GCC" = yes
5786 then
5787 cf_save_CPPFLAGS=$CPPFLAGS
micky3879b9f5e72025-07-08 18:04:53 -04005788
5789 test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
5790 CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
5791
5792 cat >"conftest.$ac_ext" <<_ACEOF
5793#line 5793 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +01005794#include "confdefs.h"
5795#include <stdio.h>
5796int
micky3879b9f5e72025-07-08 18:04:53 -04005797main (void)
Steve Kondikae271bc2015-11-15 02:50:53 +01005798{
5799printf("Hello")
5800 ;
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 :
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_have_incdir=yes
5821fi
micky3879b9f5e72025-07-08 18:04:53 -04005822rm -f "conftest.$ac_objext" "conftest.$ac_ext"
Steve Kondikae271bc2015-11-15 02:50:53 +01005823 CPPFLAGS=$cf_save_CPPFLAGS
5824 fi
5825 fi
5826 fi
5827
5828 if test "$cf_have_incdir" = no ; then
5829 test -n "$verbose" && echo " adding $cf_add_incdir to include-path" 1>&6
5830
micky3879b9f5e72025-07-08 18:04:53 -04005831echo "${as_me:-configure}:5831: testing adding $cf_add_incdir to include-path ..." 1>&5
Steve Kondikae271bc2015-11-15 02:50:53 +01005832
5833 CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
5834
micky3879b9f5e72025-07-08 18:04:53 -04005835 cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
Steve Kondikae271bc2015-11-15 02:50:53 +01005836 test "$cf_top_incdir" = "$cf_add_incdir" && break
5837 cf_add_incdir="$cf_top_incdir"
5838 else
5839 break
5840 fi
5841 else
5842 break
5843 fi
5844 done
5845 done
5846fi
5847
5848 for cf_header in \
5849 ncurses.h \
5850 curses.h
5851 do
5852
micky3879b9f5e72025-07-08 18:04:53 -04005853 cat >"conftest.$ac_ext" <<_ACEOF
5854#line 5854 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +01005855#include "confdefs.h"
5856
5857#include <$cf_header>
5858int
micky3879b9f5e72025-07-08 18:04:53 -04005859main (void)
Steve Kondikae271bc2015-11-15 02:50:53 +01005860{
5861
5862#ifdef NCURSES_VERSION
5863
micky3879b9f5e72025-07-08 18:04:53 -04005864printf("%s\\n", NCURSES_VERSION);
Steve Kondikae271bc2015-11-15 02:50:53 +01005865#else
5866#ifdef __NCURSES_H
micky3879b9f5e72025-07-08 18:04:53 -04005867printf("old\\n");
Steve Kondikae271bc2015-11-15 02:50:53 +01005868#else
micky3879b9f5e72025-07-08 18:04:53 -04005869 #error __NCURSES_H is not defined
Steve Kondikae271bc2015-11-15 02:50:53 +01005870#endif
5871#endif
5872
5873 ;
5874 return 0;
5875}
5876_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -04005877rm -f "conftest.$ac_objext"
5878if { (eval echo "$as_me:5878: \"$ac_compile\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01005879 (eval $ac_compile) 2>&5
5880 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -04005881 echo "$as_me:5881: \$? = $ac_status" >&5
5882 (exit "$ac_status"); } &&
5883 { ac_try='test -s "conftest.$ac_objext"'
5884 { (eval echo "$as_me:5884: \"$ac_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01005885 (eval $ac_try) 2>&5
5886 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -04005887 echo "$as_me:5887: \$? = $ac_status" >&5
5888 (exit "$ac_status"); }; }; then
Steve Kondikae271bc2015-11-15 02:50:53 +01005889 cf_cv_ncurses_h2=$cf_header
5890
5891else
5892 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -04005893cat "conftest.$ac_ext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01005894cf_cv_ncurses_h2=no
5895fi
micky3879b9f5e72025-07-08 18:04:53 -04005896rm -f "conftest.$ac_objext" "conftest.$ac_ext"
Steve Kondikae271bc2015-11-15 02:50:53 +01005897
5898 if test "$cf_cv_ncurses_h2" != no ; then
5899 cf_cv_ncurses_h2=$cf_incdir/$cf_header
micky3879b9f5e72025-07-08 18:04:53 -04005900 test -n "$verbose" && echo $ECHO_N " ... found $ECHO_C" 1>&6
Steve Kondikae271bc2015-11-15 02:50:53 +01005901 break
5902 fi
5903 test -n "$verbose" && echo " ... tested $cf_incdir/$cf_header" 1>&6
5904 done
5905 CPPFLAGS="$cf_save2_CPPFLAGS"
5906 test "$cf_cv_ncurses_h2" != no && break
5907 done
micky3879b9f5e72025-07-08 18:04:53 -04005908 test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:5908: error: not found" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01005909echo "$as_me: error: not found" >&2;}
5910 { (exit 1); exit 1; }; }
5911
5912fi
micky3879b9f5e72025-07-08 18:04:53 -04005913echo "$as_me:5913: result: $cf_cv_ncurses_h2" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01005914echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
5915
micky3879b9f5e72025-07-08 18:04:53 -04005916 cf_1st_incdir=`echo "$cf_cv_ncurses_h2" | sed -e 's%/[^/]*$%%'`
5917 cf_cv_ncurses_header="`basename "$cf_cv_ncurses_h2"`"
5918 if test "`basename "$cf_1st_incdir"`" = "$cf_ncuhdr_root" ; then
5919 cf_cv_ncurses_header="$cf_ncuhdr_root/$cf_cv_ncurses_header"
Steve Kondikae271bc2015-11-15 02:50:53 +01005920 fi
5921
5922if test -n "$cf_1st_incdir" ; then
5923 for cf_add_incdir in $cf_1st_incdir
5924 do
micky3879b9f5e72025-07-08 18:04:53 -04005925 while test "$cf_add_incdir" != /usr/include
Steve Kondikae271bc2015-11-15 02:50:53 +01005926 do
micky3879b9f5e72025-07-08 18:04:53 -04005927 if test -d "$cf_add_incdir"
Steve Kondikae271bc2015-11-15 02:50:53 +01005928 then
5929 cf_have_incdir=no
5930 if test -n "$CFLAGS$CPPFLAGS" ; then
5931 # a loop is needed to ensure we can add subdirs of existing dirs
5932 for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
5933 if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
5934 cf_have_incdir=yes; break
5935 fi
5936 done
5937 fi
5938
5939 if test "$cf_have_incdir" = no ; then
5940 if test "$cf_add_incdir" = /usr/local/include ; then
5941 if test "$GCC" = yes
5942 then
5943 cf_save_CPPFLAGS=$CPPFLAGS
micky3879b9f5e72025-07-08 18:04:53 -04005944
5945 test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
5946 CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
5947
5948 cat >"conftest.$ac_ext" <<_ACEOF
5949#line 5949 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +01005950#include "confdefs.h"
5951#include <stdio.h>
5952int
micky3879b9f5e72025-07-08 18:04:53 -04005953main (void)
Steve Kondikae271bc2015-11-15 02:50:53 +01005954{
5955printf("Hello")
5956 ;
5957 return 0;
5958}
5959_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -04005960rm -f "conftest.$ac_objext"
5961if { (eval echo "$as_me:5961: \"$ac_compile\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01005962 (eval $ac_compile) 2>&5
5963 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -04005964 echo "$as_me:5964: \$? = $ac_status" >&5
5965 (exit "$ac_status"); } &&
5966 { ac_try='test -s "conftest.$ac_objext"'
5967 { (eval echo "$as_me:5967: \"$ac_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01005968 (eval $ac_try) 2>&5
5969 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -04005970 echo "$as_me:5970: \$? = $ac_status" >&5
5971 (exit "$ac_status"); }; }; then
Steve Kondikae271bc2015-11-15 02:50:53 +01005972 :
5973else
5974 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -04005975cat "conftest.$ac_ext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01005976cf_have_incdir=yes
5977fi
micky3879b9f5e72025-07-08 18:04:53 -04005978rm -f "conftest.$ac_objext" "conftest.$ac_ext"
Steve Kondikae271bc2015-11-15 02:50:53 +01005979 CPPFLAGS=$cf_save_CPPFLAGS
5980 fi
5981 fi
5982 fi
5983
5984 if test "$cf_have_incdir" = no ; then
5985 test -n "$verbose" && echo " adding $cf_add_incdir to include-path" 1>&6
5986
micky3879b9f5e72025-07-08 18:04:53 -04005987echo "${as_me:-configure}:5987: testing adding $cf_add_incdir to include-path ..." 1>&5
Steve Kondikae271bc2015-11-15 02:50:53 +01005988
5989 CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
5990
micky3879b9f5e72025-07-08 18:04:53 -04005991 cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
Steve Kondikae271bc2015-11-15 02:50:53 +01005992 test "$cf_top_incdir" = "$cf_add_incdir" && break
5993 cf_add_incdir="$cf_top_incdir"
5994 else
5995 break
5996 fi
5997 else
5998 break
5999 fi
6000 done
6001 done
6002fi
6003
6004fi
6005
6006# Set definitions to allow ifdef'ing for ncurses.h
6007
micky3879b9f5e72025-07-08 18:04:53 -04006008case "$cf_cv_ncurses_header" in
Steve Kondikae271bc2015-11-15 02:50:53 +01006009(*ncurses.h)
6010
6011cat >>confdefs.h <<\EOF
6012#define HAVE_NCURSES_H 1
6013EOF
6014
6015 ;;
6016esac
6017
micky3879b9f5e72025-07-08 18:04:53 -04006018case "$cf_cv_ncurses_header" in
Steve Kondikae271bc2015-11-15 02:50:53 +01006019(ncurses/curses.h|ncurses/ncurses.h)
6020
6021cat >>confdefs.h <<\EOF
6022#define HAVE_NCURSES_NCURSES_H 1
6023EOF
6024
6025 ;;
6026(ncursesw/curses.h|ncursesw/ncurses.h)
6027
6028cat >>confdefs.h <<\EOF
6029#define HAVE_NCURSESW_NCURSES_H 1
6030EOF
6031
6032 ;;
6033esac
6034
micky3879b9f5e72025-07-08 18:04:53 -04006035echo "$as_me:6035: checking for terminfo header" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01006036echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
6037if test "${cf_cv_term_header+set}" = set; then
6038 echo $ECHO_N "(cached) $ECHO_C" >&6
6039else
6040
micky3879b9f5e72025-07-08 18:04:53 -04006041case "${cf_cv_ncurses_header}" in
Steve Kondikae271bc2015-11-15 02:50:53 +01006042(*/ncurses.h|*/ncursesw.h)
6043 cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
6044 ;;
6045(*)
6046 cf_term_header=term.h
6047 ;;
6048esac
6049
6050for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
6051do
micky3879b9f5e72025-07-08 18:04:53 -04006052cat >"conftest.$ac_ext" <<_ACEOF
6053#line 6053 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +01006054#include "confdefs.h"
6055#include <stdio.h>
6056#include <${cf_cv_ncurses_header:-curses.h}>
6057#include <$cf_test>
6058
6059int
micky3879b9f5e72025-07-08 18:04:53 -04006060main (void)
Steve Kondikae271bc2015-11-15 02:50:53 +01006061{
micky3879b9f5e72025-07-08 18:04:53 -04006062int x = auto_left_margin; (void)x
Steve Kondikae271bc2015-11-15 02:50:53 +01006063 ;
6064 return 0;
6065}
6066_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -04006067rm -f "conftest.$ac_objext"
6068if { (eval echo "$as_me:6068: \"$ac_compile\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01006069 (eval $ac_compile) 2>&5
6070 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -04006071 echo "$as_me:6071: \$? = $ac_status" >&5
6072 (exit "$ac_status"); } &&
6073 { ac_try='test -s "conftest.$ac_objext"'
6074 { (eval echo "$as_me:6074: \"$ac_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01006075 (eval $ac_try) 2>&5
6076 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -04006077 echo "$as_me:6077: \$? = $ac_status" >&5
6078 (exit "$ac_status"); }; }; then
Steve Kondikae271bc2015-11-15 02:50:53 +01006079
6080 cf_cv_term_header="$cf_test"
6081else
6082 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -04006083cat "conftest.$ac_ext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01006084
6085 cf_cv_term_header=unknown
6086
6087fi
micky3879b9f5e72025-07-08 18:04:53 -04006088rm -f "conftest.$ac_objext" "conftest.$ac_ext"
Steve Kondikae271bc2015-11-15 02:50:53 +01006089 test "$cf_cv_term_header" != unknown && break
6090done
6091
6092fi
micky3879b9f5e72025-07-08 18:04:53 -04006093echo "$as_me:6093: result: $cf_cv_term_header" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01006094echo "${ECHO_T}$cf_cv_term_header" >&6
6095
6096# Set definitions to allow ifdef'ing to accommodate subdirectories
6097
micky3879b9f5e72025-07-08 18:04:53 -04006098case "$cf_cv_term_header" in
Steve Kondikae271bc2015-11-15 02:50:53 +01006099(*term.h)
6100
6101cat >>confdefs.h <<\EOF
6102#define HAVE_TERM_H 1
6103EOF
6104
6105 ;;
6106esac
6107
micky3879b9f5e72025-07-08 18:04:53 -04006108case "$cf_cv_term_header" in
Steve Kondikae271bc2015-11-15 02:50:53 +01006109(ncurses/term.h)
6110
6111cat >>confdefs.h <<\EOF
6112#define HAVE_NCURSES_TERM_H 1
6113EOF
6114
6115 ;;
6116(ncursesw/term.h)
6117
6118cat >>confdefs.h <<\EOF
6119#define HAVE_NCURSESW_TERM_H 1
6120EOF
6121
6122 ;;
6123esac
6124
6125# some applications need this, but should check for NCURSES_VERSION
6126
6127cat >>confdefs.h <<\EOF
6128#define NCURSES 1
6129EOF
6130
micky3879b9f5e72025-07-08 18:04:53 -04006131echo "$as_me:6131: checking for ncurses version" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01006132echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
6133if test "${cf_cv_ncurses_version+set}" = set; then
6134 echo $ECHO_N "(cached) $ECHO_C" >&6
6135else
6136
6137 cf_cv_ncurses_version=no
6138 cf_tempfile=out$$
micky3879b9f5e72025-07-08 18:04:53 -04006139 rm -f "$cf_tempfile"
Steve Kondikae271bc2015-11-15 02:50:53 +01006140 if test "$cross_compiling" = yes; then
6141
6142 # This will not work if the preprocessor splits the line after the
6143 # Autoconf token. The 'unproto' program does that.
micky3879b9f5e72025-07-08 18:04:53 -04006144 cat > "conftest.$ac_ext" <<EOF
Steve Kondikae271bc2015-11-15 02:50:53 +01006145#include <${cf_cv_ncurses_header:-curses.h}>
6146#undef Autoconf
6147#ifdef NCURSES_VERSION
6148Autoconf NCURSES_VERSION
6149#else
6150#ifdef __NCURSES_H
6151Autoconf "old"
6152#endif
6153;
6154#endif
6155EOF
6156 cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
micky3879b9f5e72025-07-08 18:04:53 -04006157 { (eval echo "$as_me:6157: \"$cf_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01006158 (eval $cf_try) 2>&5
6159 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -04006160 echo "$as_me:6160: \$? = $ac_status" >&5
6161 (exit "$ac_status"); }
Steve Kondikae271bc2015-11-15 02:50:53 +01006162 if test -f conftest.out ; then
micky3879b9f5e72025-07-08 18:04:53 -04006163 cf_out=`sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%' conftest.out`
Steve Kondikae271bc2015-11-15 02:50:53 +01006164 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
6165 rm -f conftest.out
6166 fi
6167
6168else
micky3879b9f5e72025-07-08 18:04:53 -04006169 cat >"conftest.$ac_ext" <<_ACEOF
6170#line 6170 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +01006171#include "confdefs.h"
6172
micky3879b9f5e72025-07-08 18:04:53 -04006173$ac_includes_default
6174
Steve Kondikae271bc2015-11-15 02:50:53 +01006175#include <${cf_cv_ncurses_header:-curses.h}>
micky3879b9f5e72025-07-08 18:04:53 -04006176
6177int main(void)
Steve Kondikae271bc2015-11-15 02:50:53 +01006178{
6179 FILE *fp = fopen("$cf_tempfile", "w");
6180#ifdef NCURSES_VERSION
6181# ifdef NCURSES_VERSION_PATCH
micky3879b9f5e72025-07-08 18:04:53 -04006182 fprintf(fp, "%s.%d\\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
Steve Kondikae271bc2015-11-15 02:50:53 +01006183# else
micky3879b9f5e72025-07-08 18:04:53 -04006184 fprintf(fp, "%s\\n", NCURSES_VERSION);
Steve Kondikae271bc2015-11-15 02:50:53 +01006185# endif
6186#else
6187# ifdef __NCURSES_H
micky3879b9f5e72025-07-08 18:04:53 -04006188 fprintf(fp, "old\\n");
Steve Kondikae271bc2015-11-15 02:50:53 +01006189# else
micky3879b9f5e72025-07-08 18:04:53 -04006190 #error expected ncurses header to define __NCURSES_H
Steve Kondikae271bc2015-11-15 02:50:53 +01006191# endif
6192#endif
6193 ${cf_cv_main_return:-return}(0);
6194}
6195_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -04006196rm -f "conftest$ac_exeext"
6197if { (eval echo "$as_me:6197: \"$ac_link\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01006198 (eval $ac_link) 2>&5
6199 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -04006200 echo "$as_me:6200: \$? = $ac_status" >&5
6201 (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
6202 { (eval echo "$as_me:6202: \"$ac_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01006203 (eval $ac_try) 2>&5
6204 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -04006205 echo "$as_me:6205: \$? = $ac_status" >&5
6206 (exit "$ac_status"); }; }; then
Steve Kondikae271bc2015-11-15 02:50:53 +01006207
6208 cf_cv_ncurses_version=`cat $cf_tempfile`
6209else
6210 echo "$as_me: program exited with status $ac_status" >&5
6211echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -04006212cat "conftest.$ac_ext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01006213fi
micky3879b9f5e72025-07-08 18:04:53 -04006214rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
Steve Kondikae271bc2015-11-15 02:50:53 +01006215fi
micky3879b9f5e72025-07-08 18:04:53 -04006216 rm -f "$cf_tempfile"
Steve Kondikae271bc2015-11-15 02:50:53 +01006217
6218fi
micky3879b9f5e72025-07-08 18:04:53 -04006219echo "$as_me:6219: result: $cf_cv_ncurses_version" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01006220echo "${ECHO_T}$cf_cv_ncurses_version" >&6
6221test "$cf_cv_ncurses_version" = no ||
6222cat >>confdefs.h <<\EOF
6223#define NCURSES 1
6224EOF
6225
6226cf_nculib_root=ncurses
6227 # This works, except for the special case where we find gpm, but
6228 # ncurses is in a nonstandard location via $LIBS, and we really want
6229 # to link gpm.
6230cf_ncurses_LIBS=""
6231cf_ncurses_SAVE="$LIBS"
micky3879b9f5e72025-07-08 18:04:53 -04006232echo "$as_me:6232: checking for Gpm_Open in -lgpm" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01006233echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
6234if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
6235 echo $ECHO_N "(cached) $ECHO_C" >&6
6236else
6237 ac_check_lib_save_LIBS=$LIBS
6238LIBS="-lgpm $LIBS"
micky3879b9f5e72025-07-08 18:04:53 -04006239cat >"conftest.$ac_ext" <<_ACEOF
6240#line 6240 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +01006241#include "confdefs.h"
6242
6243/* Override any gcc2 internal prototype to avoid an error. */
6244#ifdef __cplusplus
6245extern "C"
6246#endif
6247/* We use char because int might match the return type of a gcc2
6248 builtin and then its argument prototype would still apply. */
micky3879b9f5e72025-07-08 18:04:53 -04006249char Gpm_Open (void);
Steve Kondikae271bc2015-11-15 02:50:53 +01006250int
micky3879b9f5e72025-07-08 18:04:53 -04006251main (void)
Steve Kondikae271bc2015-11-15 02:50:53 +01006252{
6253Gpm_Open ();
6254 ;
6255 return 0;
6256}
6257_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -04006258rm -f "conftest.$ac_objext" "conftest$ac_exeext"
6259if { (eval echo "$as_me:6259: \"$ac_link\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01006260 (eval $ac_link) 2>&5
6261 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -04006262 echo "$as_me:6262: \$? = $ac_status" >&5
6263 (exit "$ac_status"); } &&
6264 { ac_try='test -s "conftest$ac_exeext"'
6265 { (eval echo "$as_me:6265: \"$ac_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01006266 (eval $ac_try) 2>&5
6267 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -04006268 echo "$as_me:6268: \$? = $ac_status" >&5
6269 (exit "$ac_status"); }; }; then
Steve Kondikae271bc2015-11-15 02:50:53 +01006270 ac_cv_lib_gpm_Gpm_Open=yes
6271else
6272 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -04006273cat "conftest.$ac_ext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01006274ac_cv_lib_gpm_Gpm_Open=no
6275fi
micky3879b9f5e72025-07-08 18:04:53 -04006276rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
Steve Kondikae271bc2015-11-15 02:50:53 +01006277LIBS=$ac_check_lib_save_LIBS
6278fi
micky3879b9f5e72025-07-08 18:04:53 -04006279echo "$as_me:6279: result: $ac_cv_lib_gpm_Gpm_Open" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01006280echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
micky3879b9f5e72025-07-08 18:04:53 -04006281if test "$ac_cv_lib_gpm_Gpm_Open" = yes; then
6282 echo "$as_me:6282: checking for initscr in -lgpm" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01006283echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
6284if test "${ac_cv_lib_gpm_initscr+set}" = set; then
6285 echo $ECHO_N "(cached) $ECHO_C" >&6
6286else
6287 ac_check_lib_save_LIBS=$LIBS
6288LIBS="-lgpm $LIBS"
micky3879b9f5e72025-07-08 18:04:53 -04006289cat >"conftest.$ac_ext" <<_ACEOF
6290#line 6290 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +01006291#include "confdefs.h"
6292
6293/* Override any gcc2 internal prototype to avoid an error. */
6294#ifdef __cplusplus
6295extern "C"
6296#endif
6297/* We use char because int might match the return type of a gcc2
6298 builtin and then its argument prototype would still apply. */
micky3879b9f5e72025-07-08 18:04:53 -04006299char initscr (void);
Steve Kondikae271bc2015-11-15 02:50:53 +01006300int
micky3879b9f5e72025-07-08 18:04:53 -04006301main (void)
Steve Kondikae271bc2015-11-15 02:50:53 +01006302{
6303initscr ();
6304 ;
6305 return 0;
6306}
6307_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -04006308rm -f "conftest.$ac_objext" "conftest$ac_exeext"
6309if { (eval echo "$as_me:6309: \"$ac_link\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01006310 (eval $ac_link) 2>&5
6311 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -04006312 echo "$as_me:6312: \$? = $ac_status" >&5
6313 (exit "$ac_status"); } &&
6314 { ac_try='test -s "conftest$ac_exeext"'
6315 { (eval echo "$as_me:6315: \"$ac_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01006316 (eval $ac_try) 2>&5
6317 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -04006318 echo "$as_me:6318: \$? = $ac_status" >&5
6319 (exit "$ac_status"); }; }; then
Steve Kondikae271bc2015-11-15 02:50:53 +01006320 ac_cv_lib_gpm_initscr=yes
6321else
6322 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -04006323cat "conftest.$ac_ext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01006324ac_cv_lib_gpm_initscr=no
6325fi
micky3879b9f5e72025-07-08 18:04:53 -04006326rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
Steve Kondikae271bc2015-11-15 02:50:53 +01006327LIBS=$ac_check_lib_save_LIBS
6328fi
micky3879b9f5e72025-07-08 18:04:53 -04006329echo "$as_me:6329: result: $ac_cv_lib_gpm_initscr" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01006330echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
micky3879b9f5e72025-07-08 18:04:53 -04006331if test "$ac_cv_lib_gpm_initscr" = yes; then
Steve Kondikae271bc2015-11-15 02:50:53 +01006332 LIBS="$cf_ncurses_SAVE"
6333else
6334 cf_ncurses_LIBS="-lgpm"
6335fi
6336
6337fi
6338
micky3879b9f5e72025-07-08 18:04:53 -04006339case "$host_os" in
Steve Kondikae271bc2015-11-15 02:50:53 +01006340(freebsd*)
6341 # This is only necessary if you are linking against an obsolete
micky3879b9f5e72025-07-08 18:04:53 -04006342 # version of ncurses (but it should do no harm, since it is static).
Steve Kondikae271bc2015-11-15 02:50:53 +01006343 if test "$cf_nculib_root" = ncurses ; then
micky3879b9f5e72025-07-08 18:04:53 -04006344 echo "$as_me:6344: checking for tgoto in -lmytinfo" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01006345echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
6346if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
6347 echo $ECHO_N "(cached) $ECHO_C" >&6
6348else
6349 ac_check_lib_save_LIBS=$LIBS
6350LIBS="-lmytinfo $LIBS"
micky3879b9f5e72025-07-08 18:04:53 -04006351cat >"conftest.$ac_ext" <<_ACEOF
6352#line 6352 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +01006353#include "confdefs.h"
6354
6355/* Override any gcc2 internal prototype to avoid an error. */
6356#ifdef __cplusplus
6357extern "C"
6358#endif
6359/* We use char because int might match the return type of a gcc2
6360 builtin and then its argument prototype would still apply. */
micky3879b9f5e72025-07-08 18:04:53 -04006361char tgoto (void);
Steve Kondikae271bc2015-11-15 02:50:53 +01006362int
micky3879b9f5e72025-07-08 18:04:53 -04006363main (void)
Steve Kondikae271bc2015-11-15 02:50:53 +01006364{
6365tgoto ();
6366 ;
6367 return 0;
6368}
6369_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -04006370rm -f "conftest.$ac_objext" "conftest$ac_exeext"
6371if { (eval echo "$as_me:6371: \"$ac_link\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01006372 (eval $ac_link) 2>&5
6373 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -04006374 echo "$as_me:6374: \$? = $ac_status" >&5
6375 (exit "$ac_status"); } &&
6376 { ac_try='test -s "conftest$ac_exeext"'
6377 { (eval echo "$as_me:6377: \"$ac_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01006378 (eval $ac_try) 2>&5
6379 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -04006380 echo "$as_me:6380: \$? = $ac_status" >&5
6381 (exit "$ac_status"); }; }; then
Steve Kondikae271bc2015-11-15 02:50:53 +01006382 ac_cv_lib_mytinfo_tgoto=yes
6383else
6384 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -04006385cat "conftest.$ac_ext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01006386ac_cv_lib_mytinfo_tgoto=no
6387fi
micky3879b9f5e72025-07-08 18:04:53 -04006388rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
Steve Kondikae271bc2015-11-15 02:50:53 +01006389LIBS=$ac_check_lib_save_LIBS
6390fi
micky3879b9f5e72025-07-08 18:04:53 -04006391echo "$as_me:6391: result: $ac_cv_lib_mytinfo_tgoto" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01006392echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
micky3879b9f5e72025-07-08 18:04:53 -04006393if test "$ac_cv_lib_mytinfo_tgoto" = yes; then
Steve Kondikae271bc2015-11-15 02:50:53 +01006394 cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
6395fi
6396
6397 fi
6398 ;;
6399esac
6400
micky3879b9f5e72025-07-08 18:04:53 -04006401cf_add_libs="$LIBS"
6402# reverse order
6403cf_add_0lib=
6404for cf_add_1lib in $cf_ncurses_LIBS; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
6405# filter duplicates
6406for cf_add_1lib in $cf_add_0lib; do
6407 for cf_add_2lib in $cf_add_libs; do
6408 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
Steve Kondikae271bc2015-11-15 02:50:53 +01006409 cf_add_1lib=
6410 break
6411 fi
6412 done
micky3879b9f5e72025-07-08 18:04:53 -04006413 test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
Steve Kondikae271bc2015-11-15 02:50:53 +01006414done
6415LIBS="$cf_add_libs"
6416
micky3879b9f5e72025-07-08 18:04:53 -04006417if test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no"
Steve Kondikae271bc2015-11-15 02:50:53 +01006418then
6419
micky3879b9f5e72025-07-08 18:04:53 -04006420cf_add_libs="$LIBS"
6421# reverse order
6422cf_add_0lib=
6423for cf_add_1lib in -l$cf_nculib_root; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
6424# filter duplicates
6425for cf_add_1lib in $cf_add_0lib; do
6426 for cf_add_2lib in $cf_add_libs; do
6427 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
Steve Kondikae271bc2015-11-15 02:50:53 +01006428 cf_add_1lib=
6429 break
6430 fi
6431 done
micky3879b9f5e72025-07-08 18:04:53 -04006432 test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
Steve Kondikae271bc2015-11-15 02:50:53 +01006433done
6434LIBS="$cf_add_libs"
6435
6436else
6437
micky3879b9f5e72025-07-08 18:04:53 -04006438 eval 'cf_cv_have_lib_'"$cf_nculib_root"'=no'
Steve Kondikae271bc2015-11-15 02:50:53 +01006439 cf_libdir=""
micky3879b9f5e72025-07-08 18:04:53 -04006440 echo "$as_me:6440: checking for initscr" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01006441echo $ECHO_N "checking for initscr... $ECHO_C" >&6
6442if test "${ac_cv_func_initscr+set}" = set; then
6443 echo $ECHO_N "(cached) $ECHO_C" >&6
6444else
micky3879b9f5e72025-07-08 18:04:53 -04006445 cat >"conftest.$ac_ext" <<_ACEOF
6446#line 6446 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +01006447#include "confdefs.h"
micky3879b9f5e72025-07-08 18:04:53 -04006448#define initscr autoconf_temporary
6449#include <limits.h> /* least-intrusive standard header which defines gcc2 __stub macros */
6450#undef initscr
6451
Steve Kondikae271bc2015-11-15 02:50:53 +01006452#ifdef __cplusplus
6453extern "C"
6454#endif
micky3879b9f5e72025-07-08 18:04:53 -04006455
Steve Kondikae271bc2015-11-15 02:50:53 +01006456/* We use char because int might match the return type of a gcc2
6457 builtin and then its argument prototype would still apply. */
micky3879b9f5e72025-07-08 18:04:53 -04006458char initscr (void);
Steve Kondikae271bc2015-11-15 02:50:53 +01006459
6460int
micky3879b9f5e72025-07-08 18:04:53 -04006461main (void)
Steve Kondikae271bc2015-11-15 02:50:53 +01006462{
micky3879b9f5e72025-07-08 18:04:53 -04006463
6464/* The GNU C library defines stubs for functions which it implements
Steve Kondikae271bc2015-11-15 02:50:53 +01006465 to always fail with ENOSYS. Some functions are actually named
6466 something starting with __ and the normal name is an alias. */
6467#if defined (__stub_initscr) || defined (__stub___initscr)
micky3879b9f5e72025-07-08 18:04:53 -04006468#error found stub for initscr
Steve Kondikae271bc2015-11-15 02:50:53 +01006469#endif
6470
micky3879b9f5e72025-07-08 18:04:53 -04006471 return initscr ();
Steve Kondikae271bc2015-11-15 02:50:53 +01006472 ;
6473 return 0;
6474}
6475_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -04006476rm -f "conftest.$ac_objext" "conftest$ac_exeext"
6477if { (eval echo "$as_me:6477: \"$ac_link\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01006478 (eval $ac_link) 2>&5
6479 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -04006480 echo "$as_me:6480: \$? = $ac_status" >&5
6481 (exit "$ac_status"); } &&
6482 { ac_try='test -s "conftest$ac_exeext"'
6483 { (eval echo "$as_me:6483: \"$ac_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01006484 (eval $ac_try) 2>&5
6485 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -04006486 echo "$as_me:6486: \$? = $ac_status" >&5
6487 (exit "$ac_status"); }; }; then
Steve Kondikae271bc2015-11-15 02:50:53 +01006488 ac_cv_func_initscr=yes
6489else
6490 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -04006491cat "conftest.$ac_ext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01006492ac_cv_func_initscr=no
6493fi
micky3879b9f5e72025-07-08 18:04:53 -04006494rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
Steve Kondikae271bc2015-11-15 02:50:53 +01006495fi
micky3879b9f5e72025-07-08 18:04:53 -04006496echo "$as_me:6496: result: $ac_cv_func_initscr" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01006497echo "${ECHO_T}$ac_cv_func_initscr" >&6
micky3879b9f5e72025-07-08 18:04:53 -04006498if test "$ac_cv_func_initscr" = yes; then
6499 eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
Steve Kondikae271bc2015-11-15 02:50:53 +01006500else
6501
6502 cf_save_LIBS="$LIBS"
micky3879b9f5e72025-07-08 18:04:53 -04006503 echo "$as_me:6503: checking for initscr in -l$cf_nculib_root" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01006504echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
6505 LIBS="-l$cf_nculib_root $LIBS"
micky3879b9f5e72025-07-08 18:04:53 -04006506 cat >"conftest.$ac_ext" <<_ACEOF
6507#line 6507 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +01006508#include "confdefs.h"
6509#include <${cf_cv_ncurses_header:-curses.h}>
6510int
micky3879b9f5e72025-07-08 18:04:53 -04006511main (void)
Steve Kondikae271bc2015-11-15 02:50:53 +01006512{
6513initscr()
6514 ;
6515 return 0;
6516}
6517_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -04006518rm -f "conftest.$ac_objext" "conftest$ac_exeext"
6519if { (eval echo "$as_me:6519: \"$ac_link\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01006520 (eval $ac_link) 2>&5
6521 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -04006522 echo "$as_me:6522: \$? = $ac_status" >&5
6523 (exit "$ac_status"); } &&
6524 { ac_try='test -s "conftest$ac_exeext"'
6525 { (eval echo "$as_me:6525: \"$ac_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01006526 (eval $ac_try) 2>&5
6527 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -04006528 echo "$as_me:6528: \$? = $ac_status" >&5
6529 (exit "$ac_status"); }; }; then
6530 echo "$as_me:6530: result: yes" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01006531echo "${ECHO_T}yes" >&6
micky3879b9f5e72025-07-08 18:04:53 -04006532 eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
Steve Kondikae271bc2015-11-15 02:50:53 +01006533
6534else
6535 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -04006536cat "conftest.$ac_ext" >&5
6537echo "$as_me:6537: result: no" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01006538echo "${ECHO_T}no" >&6
6539
6540cf_search=
6541cf_library_path_list=""
6542if test -n "${LDFLAGS}${LIBS}" ; then
6543 for cf_library_path in $LDFLAGS $LIBS
6544 do
micky3879b9f5e72025-07-08 18:04:53 -04006545 case "$cf_library_path" in
Steve Kondikae271bc2015-11-15 02:50:53 +01006546 (-L*)
6547 cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
6548
6549test "x$cf_library_path" != "xNONE" && \
6550test -d "$cf_library_path" && \
6551 {
6552 test -n "$verbose" && echo " ... testing for lib-directories under $cf_library_path"
micky3879b9f5e72025-07-08 18:04:53 -04006553 test -d "$cf_library_path/lib" && cf_search="$cf_search $cf_library_path/lib"
6554 test -d "$cf_library_path/lib/$cf_nculib_root" && cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
6555 test -d "$cf_library_path/lib/$cf_nculib_root/lib" && cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
6556 test -d "$cf_library_path/$cf_nculib_root/lib" && cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
6557 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 +01006558}
6559
6560 cf_library_path_list="$cf_library_path_list $cf_search"
6561 ;;
6562 esac
6563 done
6564fi
6565
6566cf_search=
6567
6568test "x$prefix" != "xNONE" && \
6569test -d "$prefix" && \
6570 {
6571 test -n "$verbose" && echo " ... testing for lib-directories under $prefix"
micky3879b9f5e72025-07-08 18:04:53 -04006572 test -d "$prefix/lib" && cf_search="$cf_search $prefix/lib"
6573 test -d "$prefix/lib/$cf_nculib_root" && cf_search="$cf_search $prefix/lib/$cf_nculib_root"
6574 test -d "$prefix/lib/$cf_nculib_root/lib" && cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
6575 test -d "$prefix/$cf_nculib_root/lib" && cf_search="$cf_search $prefix/$cf_nculib_root/lib"
6576 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 +01006577}
6578
6579for cf_subdir_prefix in \
6580 /usr \
6581 /usr/local \
6582 /usr/pkg \
6583 /opt \
6584 /opt/local \
6585 $HOME
6586do
6587
6588test "x$cf_subdir_prefix" != "x$prefix" && \
6589test -d "$cf_subdir_prefix" && \
micky3879b9f5e72025-07-08 18:04:53 -04006590{ test -z "$prefix" || test "x$prefix" = xNONE || test "x$cf_subdir_prefix" != "x$prefix"; } && {
Steve Kondikae271bc2015-11-15 02:50:53 +01006591 test -n "$verbose" && echo " ... testing for lib-directories under $cf_subdir_prefix"
micky3879b9f5e72025-07-08 18:04:53 -04006592 test -d "$cf_subdir_prefix/lib" && cf_search="$cf_search $cf_subdir_prefix/lib"
6593 test -d "$cf_subdir_prefix/lib/$cf_nculib_root" && cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root"
6594 test -d "$cf_subdir_prefix/lib/$cf_nculib_root/lib" && cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root/lib"
6595 test -d "$cf_subdir_prefix/$cf_nculib_root/lib" && cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib"
6596 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 +01006597}
6598
6599done
6600
6601cf_search="$cf_library_path_list $cf_search"
6602
6603 for cf_libdir in $cf_search
6604 do
micky3879b9f5e72025-07-08 18:04:53 -04006605 echo "$as_me:6605: checking for -l$cf_nculib_root in $cf_libdir" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01006606echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
6607 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
micky3879b9f5e72025-07-08 18:04:53 -04006608 cat >"conftest.$ac_ext" <<_ACEOF
6609#line 6609 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +01006610#include "confdefs.h"
6611#include <${cf_cv_ncurses_header:-curses.h}>
6612int
micky3879b9f5e72025-07-08 18:04:53 -04006613main (void)
Steve Kondikae271bc2015-11-15 02:50:53 +01006614{
6615initscr()
6616 ;
6617 return 0;
6618}
6619_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -04006620rm -f "conftest.$ac_objext" "conftest$ac_exeext"
6621if { (eval echo "$as_me:6621: \"$ac_link\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01006622 (eval $ac_link) 2>&5
6623 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -04006624 echo "$as_me:6624: \$? = $ac_status" >&5
6625 (exit "$ac_status"); } &&
6626 { ac_try='test -s "conftest$ac_exeext"'
6627 { (eval echo "$as_me:6627: \"$ac_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01006628 (eval $ac_try) 2>&5
6629 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -04006630 echo "$as_me:6630: \$? = $ac_status" >&5
6631 (exit "$ac_status"); }; }; then
6632 echo "$as_me:6632: result: yes" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01006633echo "${ECHO_T}yes" >&6
micky3879b9f5e72025-07-08 18:04:53 -04006634 eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
Steve Kondikae271bc2015-11-15 02:50:53 +01006635 break
6636else
6637 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -04006638cat "conftest.$ac_ext" >&5
6639echo "$as_me:6639: result: no" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01006640echo "${ECHO_T}no" >&6
6641 LIBS="$cf_save_LIBS"
6642fi
micky3879b9f5e72025-07-08 18:04:53 -04006643rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
Steve Kondikae271bc2015-11-15 02:50:53 +01006644 done
6645
6646fi
micky3879b9f5e72025-07-08 18:04:53 -04006647rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
Steve Kondikae271bc2015-11-15 02:50:53 +01006648
6649fi
6650
micky3879b9f5e72025-07-08 18:04:53 -04006651eval 'cf_found_library="$cf_cv_have_lib_'"$cf_nculib_root"\"
Steve Kondikae271bc2015-11-15 02:50:53 +01006652
micky3879b9f5e72025-07-08 18:04:53 -04006653if test "$cf_found_library" = no ; then
6654 { { echo "$as_me:6654: error: Cannot link $cf_nculib_root library" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01006655echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
6656 { (exit 1); exit 1; }; }
6657fi
6658
6659fi
6660
6661if test -n "$cf_ncurses_LIBS" ; then
micky3879b9f5e72025-07-08 18:04:53 -04006662 echo "$as_me:6662: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01006663echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
6664 cf_ncurses_SAVE="$LIBS"
6665 for p in $cf_ncurses_LIBS ; do
micky3879b9f5e72025-07-08 18:04:53 -04006666 q=`echo "$LIBS" | sed -e "s%$p %%" -e "s%$p$%%"`
Steve Kondikae271bc2015-11-15 02:50:53 +01006667 if test "$q" != "$LIBS" ; then
6668 LIBS="$q"
6669 fi
6670 done
micky3879b9f5e72025-07-08 18:04:53 -04006671 cat >"conftest.$ac_ext" <<_ACEOF
6672#line 6672 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +01006673#include "confdefs.h"
6674#include <${cf_cv_ncurses_header:-curses.h}>
6675int
micky3879b9f5e72025-07-08 18:04:53 -04006676main (void)
Steve Kondikae271bc2015-11-15 02:50:53 +01006677{
micky3879b9f5e72025-07-08 18:04:53 -04006678initscr(); mousemask(0,0); tigetstr((char *)0);
Steve Kondikae271bc2015-11-15 02:50:53 +01006679 ;
6680 return 0;
6681}
6682_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -04006683rm -f "conftest.$ac_objext" "conftest$ac_exeext"
6684if { (eval echo "$as_me:6684: \"$ac_link\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01006685 (eval $ac_link) 2>&5
6686 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -04006687 echo "$as_me:6687: \$? = $ac_status" >&5
6688 (exit "$ac_status"); } &&
6689 { ac_try='test -s "conftest$ac_exeext"'
6690 { (eval echo "$as_me:6690: \"$ac_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01006691 (eval $ac_try) 2>&5
6692 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -04006693 echo "$as_me:6693: \$? = $ac_status" >&5
6694 (exit "$ac_status"); }; }; then
6695 echo "$as_me:6695: result: yes" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01006696echo "${ECHO_T}yes" >&6
6697else
6698 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -04006699cat "conftest.$ac_ext" >&5
6700echo "$as_me:6700: result: no" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01006701echo "${ECHO_T}no" >&6
6702 LIBS="$cf_ncurses_SAVE"
6703fi
micky3879b9f5e72025-07-08 18:04:53 -04006704rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
Steve Kondikae271bc2015-11-15 02:50:53 +01006705fi
6706
6707cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
6708
6709cat >>confdefs.h <<EOF
6710#define $cf_nculib_ROOT 1
6711EOF
6712
6713 fi
6714else
6715 NCURSES_CONFIG=none
6716fi
6717
micky3879b9f5e72025-07-08 18:04:53 -04006718echo "$as_me:6718: checking if you want wide-character code" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01006719echo $ECHO_N "checking if you want wide-character code... $ECHO_C" >&6
6720
6721# Check whether --enable-widec or --disable-widec was given.
6722if test "${enable_widec+set}" = set; then
6723 enableval="$enable_widec"
6724 with_widec=$enableval
6725else
6726 with_widec=no
6727fi;
micky3879b9f5e72025-07-08 18:04:53 -04006728echo "$as_me:6728: result: $with_widec" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01006729echo "${ECHO_T}$with_widec" >&6
6730if test "$with_widec" = yes ; then
6731
micky3879b9f5e72025-07-08 18:04:53 -04006732for ac_header in wchar.h
6733do
6734as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
6735echo "$as_me:6735: checking for $ac_header" >&5
6736echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
6737if eval "test \"\${$as_ac_Header+set}\" = set"; then
6738 echo $ECHO_N "(cached) $ECHO_C" >&6
6739else
6740 cat >"conftest.$ac_ext" <<_ACEOF
6741#line 6741 "configure"
6742#include "confdefs.h"
6743#include <$ac_header>
6744_ACEOF
6745if { (eval echo "$as_me:6745: \"$ac_cpp "conftest.$ac_ext"\"") >&5
6746 (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
6747 ac_status=$?
6748 $EGREP -v '^ *\+' conftest.er1 >conftest.err
6749 rm -f conftest.er1
6750 cat conftest.err >&5
6751 echo "$as_me:6751: \$? = $ac_status" >&5
6752 (exit "$ac_status"); } >/dev/null; then
6753 if test -s conftest.err; then
6754 ac_cpp_err=$ac_c_preproc_warn_flag
6755 else
6756 ac_cpp_err=
6757 fi
6758else
6759 ac_cpp_err=yes
6760fi
6761if test -z "$ac_cpp_err"; then
6762 eval "$as_ac_Header=yes"
6763else
6764 echo "$as_me: failed program was:" >&5
6765 cat "conftest.$ac_ext" >&5
6766 eval "$as_ac_Header=no"
6767fi
6768rm -f conftest.err "conftest.$ac_ext"
6769fi
6770echo "$as_me:6770: result: `eval echo '${'"$as_ac_Header"'}'`" >&5
6771echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6
6772if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then
6773 cat >>confdefs.h <<EOF
6774#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
6775EOF
6776
6777fi
6778done
6779
6780echo "$as_me:6780: checking for multibyte character support" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01006781echo $ECHO_N "checking for multibyte character support... $ECHO_C" >&6
6782if test "${cf_cv_utf8_lib+set}" = set; then
6783 echo $ECHO_N "(cached) $ECHO_C" >&6
6784else
6785
6786 cf_save_LIBS="$LIBS"
micky3879b9f5e72025-07-08 18:04:53 -04006787 cat >"conftest.$ac_ext" <<_ACEOF
6788#line 6788 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +01006789#include "confdefs.h"
6790
micky3879b9f5e72025-07-08 18:04:53 -04006791$ac_includes_default
6792#ifdef HAVE_WCHAR_H
6793#include <wchar.h>
6794#endif
6795
Steve Kondikae271bc2015-11-15 02:50:53 +01006796int
micky3879b9f5e72025-07-08 18:04:53 -04006797main (void)
Steve Kondikae271bc2015-11-15 02:50:53 +01006798{
6799putwc(0,0);
6800 ;
6801 return 0;
6802}
6803_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -04006804rm -f "conftest.$ac_objext" "conftest$ac_exeext"
6805if { (eval echo "$as_me:6805: \"$ac_link\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01006806 (eval $ac_link) 2>&5
6807 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -04006808 echo "$as_me:6808: \$? = $ac_status" >&5
6809 (exit "$ac_status"); } &&
6810 { ac_try='test -s "conftest$ac_exeext"'
6811 { (eval echo "$as_me:6811: \"$ac_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01006812 (eval $ac_try) 2>&5
6813 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -04006814 echo "$as_me:6814: \$? = $ac_status" >&5
6815 (exit "$ac_status"); }; }; then
Steve Kondikae271bc2015-11-15 02:50:53 +01006816 cf_cv_utf8_lib=yes
6817else
6818 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -04006819cat "conftest.$ac_ext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01006820
6821# If the linkage is not already in the $CPPFLAGS/$LDFLAGS configuration, these
6822# will be set on completion of the AC_TRY_LINK below.
6823cf_cv_header_path_utf8=
6824cf_cv_library_path_utf8=
6825
micky3879b9f5e72025-07-08 18:04:53 -04006826echo "${as_me:-configure}:6826: testing Starting FIND_LINKAGE(utf8,) ..." 1>&5
Steve Kondikae271bc2015-11-15 02:50:53 +01006827
6828cf_save_LIBS="$LIBS"
6829
micky3879b9f5e72025-07-08 18:04:53 -04006830cat >"conftest.$ac_ext" <<_ACEOF
6831#line 6831 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +01006832#include "confdefs.h"
6833
6834#include <libutf8.h>
6835int
micky3879b9f5e72025-07-08 18:04:53 -04006836main (void)
Steve Kondikae271bc2015-11-15 02:50:53 +01006837{
6838putwc(0,0);
6839 ;
6840 return 0;
6841}
6842_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -04006843rm -f "conftest.$ac_objext" "conftest$ac_exeext"
6844if { (eval echo "$as_me:6844: \"$ac_link\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01006845 (eval $ac_link) 2>&5
6846 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -04006847 echo "$as_me:6847: \$? = $ac_status" >&5
6848 (exit "$ac_status"); } &&
6849 { ac_try='test -s "conftest$ac_exeext"'
6850 { (eval echo "$as_me:6850: \"$ac_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01006851 (eval $ac_try) 2>&5
6852 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -04006853 echo "$as_me:6853: \$? = $ac_status" >&5
6854 (exit "$ac_status"); }; }; then
Steve Kondikae271bc2015-11-15 02:50:53 +01006855
6856 cf_cv_find_linkage_utf8=yes
6857 cf_cv_header_path_utf8=/usr/include
6858 cf_cv_library_path_utf8=/usr/lib
6859
6860else
6861 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -04006862cat "conftest.$ac_ext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01006863
6864LIBS="-lutf8 $cf_save_LIBS"
6865
micky3879b9f5e72025-07-08 18:04:53 -04006866cat >"conftest.$ac_ext" <<_ACEOF
6867#line 6867 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +01006868#include "confdefs.h"
6869
6870#include <libutf8.h>
6871int
micky3879b9f5e72025-07-08 18:04:53 -04006872main (void)
Steve Kondikae271bc2015-11-15 02:50:53 +01006873{
6874putwc(0,0);
6875 ;
6876 return 0;
6877}
6878_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -04006879rm -f "conftest.$ac_objext" "conftest$ac_exeext"
6880if { (eval echo "$as_me:6880: \"$ac_link\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01006881 (eval $ac_link) 2>&5
6882 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -04006883 echo "$as_me:6883: \$? = $ac_status" >&5
6884 (exit "$ac_status"); } &&
6885 { ac_try='test -s "conftest$ac_exeext"'
6886 { (eval echo "$as_me:6886: \"$ac_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01006887 (eval $ac_try) 2>&5
6888 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -04006889 echo "$as_me:6889: \$? = $ac_status" >&5
6890 (exit "$ac_status"); }; }; then
Steve Kondikae271bc2015-11-15 02:50:53 +01006891
6892 cf_cv_find_linkage_utf8=yes
6893 cf_cv_header_path_utf8=/usr/include
6894 cf_cv_library_path_utf8=/usr/lib
6895 cf_cv_library_file_utf8="-lutf8"
6896
6897else
6898 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -04006899cat "conftest.$ac_ext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01006900
6901 cf_cv_find_linkage_utf8=no
6902 LIBS="$cf_save_LIBS"
6903
6904 test -n "$verbose" && echo " find linkage for utf8 library" 1>&6
6905
micky3879b9f5e72025-07-08 18:04:53 -04006906echo "${as_me:-configure}:6906: testing find linkage for utf8 library ..." 1>&5
Steve Kondikae271bc2015-11-15 02:50:53 +01006907
micky3879b9f5e72025-07-08 18:04:53 -04006908echo "${as_me:-configure}:6908: testing Searching for headers in FIND_LINKAGE(utf8,) ..." 1>&5
Steve Kondikae271bc2015-11-15 02:50:53 +01006909
6910 cf_save_CPPFLAGS="$CPPFLAGS"
6911 cf_test_CPPFLAGS="$CPPFLAGS"
6912
6913cf_search=
6914
6915# collect the current set of include-directories from compiler flags
6916cf_header_path_list=""
6917if test -n "${CFLAGS}${CPPFLAGS}" ; then
6918 for cf_header_path in $CPPFLAGS $CFLAGS
6919 do
micky3879b9f5e72025-07-08 18:04:53 -04006920 case "$cf_header_path" in
Steve Kondikae271bc2015-11-15 02:50:53 +01006921 (-I*)
6922 cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
6923
6924test "x$cf_header_path" != "xNONE" && \
6925test -d "$cf_header_path" && \
6926 {
6927 test -n "$verbose" && echo " ... testing for include-directories under $cf_header_path"
micky3879b9f5e72025-07-08 18:04:53 -04006928 test -d "$cf_header_path/include" && cf_search="$cf_search $cf_header_path/include"
6929 test -d "$cf_header_path/include/utf8" && cf_search="$cf_search $cf_header_path/include/utf8"
6930 test -d "$cf_header_path/include/utf8/include" && cf_search="$cf_search $cf_header_path/include/utf8/include"
6931 test -d "$cf_header_path/utf8/include" && cf_search="$cf_search $cf_header_path/utf8/include"
6932 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 +01006933}
6934
6935 cf_header_path_list="$cf_header_path_list $cf_search"
6936 ;;
6937 esac
6938 done
6939fi
6940
6941# add the variations for the package we are looking for
6942
6943cf_search=
6944
6945test "x$prefix" != "xNONE" && \
6946test -d "$prefix" && \
6947 {
6948 test -n "$verbose" && echo " ... testing for include-directories under $prefix"
micky3879b9f5e72025-07-08 18:04:53 -04006949 test -d "$prefix/include" && cf_search="$cf_search $prefix/include"
6950 test -d "$prefix/include/utf8" && cf_search="$cf_search $prefix/include/utf8"
6951 test -d "$prefix/include/utf8/include" && cf_search="$cf_search $prefix/include/utf8/include"
6952 test -d "$prefix/utf8/include" && cf_search="$cf_search $prefix/utf8/include"
6953 test -d "$prefix/utf8/include/utf8" && cf_search="$cf_search $prefix/utf8/include/utf8"
Steve Kondikae271bc2015-11-15 02:50:53 +01006954}
6955
6956for cf_subdir_prefix in \
6957 /usr \
6958 /usr/local \
6959 /usr/pkg \
6960 /opt \
6961 /opt/local \
6962 $HOME
6963do
6964
6965test "x$cf_subdir_prefix" != "x$prefix" && \
6966test -d "$cf_subdir_prefix" && \
micky3879b9f5e72025-07-08 18:04:53 -04006967{ test -z "$prefix" || test "x$prefix" = xNONE || test "x$cf_subdir_prefix" != "x$prefix"; } && {
Steve Kondikae271bc2015-11-15 02:50:53 +01006968 test -n "$verbose" && echo " ... testing for include-directories under $cf_subdir_prefix"
micky3879b9f5e72025-07-08 18:04:53 -04006969 test -d "$cf_subdir_prefix/include" && cf_search="$cf_search $cf_subdir_prefix/include"
6970 test -d "$cf_subdir_prefix/include/utf8" && cf_search="$cf_search $cf_subdir_prefix/include/utf8"
6971 test -d "$cf_subdir_prefix/include/utf8/include" && cf_search="$cf_search $cf_subdir_prefix/include/utf8/include"
6972 test -d "$cf_subdir_prefix/utf8/include" && cf_search="$cf_search $cf_subdir_prefix/utf8/include"
6973 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 +01006974}
6975
6976done
6977
6978test "$includedir" != NONE && \
6979test "$includedir" != "/usr/include" && \
6980test -d "$includedir" && {
micky3879b9f5e72025-07-08 18:04:53 -04006981 test -d "$includedir" && cf_search="$cf_search $includedir"
6982 test -d "$includedir/utf8" && cf_search="$cf_search $includedir/utf8"
Steve Kondikae271bc2015-11-15 02:50:53 +01006983}
6984
6985test "$oldincludedir" != NONE && \
6986test "$oldincludedir" != "/usr/include" && \
6987test -d "$oldincludedir" && {
micky3879b9f5e72025-07-08 18:04:53 -04006988 test -d "$oldincludedir" && cf_search="$cf_search $oldincludedir"
6989 test -d "$oldincludedir/utf8" && cf_search="$cf_search $oldincludedir/utf8"
Steve Kondikae271bc2015-11-15 02:50:53 +01006990}
6991
6992cf_search="$cf_search $cf_header_path_list"
6993
6994 for cf_cv_header_path_utf8 in $cf_search
6995 do
micky3879b9f5e72025-07-08 18:04:53 -04006996 if test -d "$cf_cv_header_path_utf8" ; then
Steve Kondikae271bc2015-11-15 02:50:53 +01006997 test -n "$verbose" && echo " ... testing $cf_cv_header_path_utf8" 1>&6
6998
micky3879b9f5e72025-07-08 18:04:53 -04006999echo "${as_me:-configure}:6999: testing ... testing $cf_cv_header_path_utf8 ..." 1>&5
Steve Kondikae271bc2015-11-15 02:50:53 +01007000
micky3879b9f5e72025-07-08 18:04:53 -04007001 CPPFLAGS="$cf_save_CPPFLAGS"
7002
7003 test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
7004 CPPFLAGS="${CPPFLAGS}-I$cf_cv_header_path_utf8"
7005
7006 cat >"conftest.$ac_ext" <<_ACEOF
7007#line 7007 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +01007008#include "confdefs.h"
7009
7010#include <libutf8.h>
7011int
micky3879b9f5e72025-07-08 18:04:53 -04007012main (void)
Steve Kondikae271bc2015-11-15 02:50:53 +01007013{
7014putwc(0,0);
7015 ;
7016 return 0;
7017}
7018_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -04007019rm -f "conftest.$ac_objext"
7020if { (eval echo "$as_me:7020: \"$ac_compile\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01007021 (eval $ac_compile) 2>&5
7022 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -04007023 echo "$as_me:7023: \$? = $ac_status" >&5
7024 (exit "$ac_status"); } &&
7025 { ac_try='test -s "conftest.$ac_objext"'
7026 { (eval echo "$as_me:7026: \"$ac_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01007027 (eval $ac_try) 2>&5
7028 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -04007029 echo "$as_me:7029: \$? = $ac_status" >&5
7030 (exit "$ac_status"); }; }; then
Steve Kondikae271bc2015-11-15 02:50:53 +01007031
7032 test -n "$verbose" && echo " ... found utf8 headers in $cf_cv_header_path_utf8" 1>&6
7033
micky3879b9f5e72025-07-08 18:04:53 -04007034echo "${as_me:-configure}:7034: testing ... found utf8 headers in $cf_cv_header_path_utf8 ..." 1>&5
Steve Kondikae271bc2015-11-15 02:50:53 +01007035
7036 cf_cv_find_linkage_utf8=maybe
7037 cf_test_CPPFLAGS="$CPPFLAGS"
7038 break
7039else
7040 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -04007041cat "conftest.$ac_ext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01007042
7043 CPPFLAGS="$cf_save_CPPFLAGS"
7044
7045fi
micky3879b9f5e72025-07-08 18:04:53 -04007046rm -f "conftest.$ac_objext" "conftest.$ac_ext"
Steve Kondikae271bc2015-11-15 02:50:53 +01007047 fi
7048 done
7049
7050 if test "$cf_cv_find_linkage_utf8" = maybe ; then
7051
micky3879b9f5e72025-07-08 18:04:53 -04007052echo "${as_me:-configure}:7052: testing Searching for utf8 library in FIND_LINKAGE(utf8,) ..." 1>&5
Steve Kondikae271bc2015-11-15 02:50:53 +01007053
7054 cf_save_LIBS="$LIBS"
7055 cf_save_LDFLAGS="$LDFLAGS"
7056
7057 if test "$cf_cv_find_linkage_utf8" != yes ; then
7058
7059cf_search=
7060cf_library_path_list=""
7061if test -n "${LDFLAGS}${LIBS}" ; then
7062 for cf_library_path in $LDFLAGS $LIBS
7063 do
micky3879b9f5e72025-07-08 18:04:53 -04007064 case "$cf_library_path" in
Steve Kondikae271bc2015-11-15 02:50:53 +01007065 (-L*)
7066 cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
7067
7068test "x$cf_library_path" != "xNONE" && \
7069test -d "$cf_library_path" && \
7070 {
7071 test -n "$verbose" && echo " ... testing for lib-directories under $cf_library_path"
micky3879b9f5e72025-07-08 18:04:53 -04007072 test -d "$cf_library_path/lib" && cf_search="$cf_search $cf_library_path/lib"
7073 test -d "$cf_library_path/lib/utf8" && cf_search="$cf_search $cf_library_path/lib/utf8"
7074 test -d "$cf_library_path/lib/utf8/lib" && cf_search="$cf_search $cf_library_path/lib/utf8/lib"
7075 test -d "$cf_library_path/utf8/lib" && cf_search="$cf_search $cf_library_path/utf8/lib"
7076 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 +01007077}
7078
7079 cf_library_path_list="$cf_library_path_list $cf_search"
7080 ;;
7081 esac
7082 done
7083fi
7084
7085cf_search=
7086
7087test "x$prefix" != "xNONE" && \
7088test -d "$prefix" && \
7089 {
7090 test -n "$verbose" && echo " ... testing for lib-directories under $prefix"
micky3879b9f5e72025-07-08 18:04:53 -04007091 test -d "$prefix/lib" && cf_search="$cf_search $prefix/lib"
7092 test -d "$prefix/lib/utf8" && cf_search="$cf_search $prefix/lib/utf8"
7093 test -d "$prefix/lib/utf8/lib" && cf_search="$cf_search $prefix/lib/utf8/lib"
7094 test -d "$prefix/utf8/lib" && cf_search="$cf_search $prefix/utf8/lib"
7095 test -d "$prefix/utf8/lib/utf8" && cf_search="$cf_search $prefix/utf8/lib/utf8"
Steve Kondikae271bc2015-11-15 02:50:53 +01007096}
7097
7098for cf_subdir_prefix in \
7099 /usr \
7100 /usr/local \
7101 /usr/pkg \
7102 /opt \
7103 /opt/local \
7104 $HOME
7105do
7106
7107test "x$cf_subdir_prefix" != "x$prefix" && \
7108test -d "$cf_subdir_prefix" && \
micky3879b9f5e72025-07-08 18:04:53 -04007109{ test -z "$prefix" || test "x$prefix" = xNONE || test "x$cf_subdir_prefix" != "x$prefix"; } && {
Steve Kondikae271bc2015-11-15 02:50:53 +01007110 test -n "$verbose" && echo " ... testing for lib-directories under $cf_subdir_prefix"
micky3879b9f5e72025-07-08 18:04:53 -04007111 test -d "$cf_subdir_prefix/lib" && cf_search="$cf_search $cf_subdir_prefix/lib"
7112 test -d "$cf_subdir_prefix/lib/utf8" && cf_search="$cf_search $cf_subdir_prefix/lib/utf8"
7113 test -d "$cf_subdir_prefix/lib/utf8/lib" && cf_search="$cf_search $cf_subdir_prefix/lib/utf8/lib"
7114 test -d "$cf_subdir_prefix/utf8/lib" && cf_search="$cf_search $cf_subdir_prefix/utf8/lib"
7115 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 +01007116}
7117
7118done
7119
7120cf_search="$cf_library_path_list $cf_search"
7121
7122 for cf_cv_library_path_utf8 in $cf_search
7123 do
micky3879b9f5e72025-07-08 18:04:53 -04007124 if test -d "$cf_cv_library_path_utf8" ; then
Steve Kondikae271bc2015-11-15 02:50:53 +01007125 test -n "$verbose" && echo " ... testing $cf_cv_library_path_utf8" 1>&6
7126
micky3879b9f5e72025-07-08 18:04:53 -04007127echo "${as_me:-configure}:7127: testing ... testing $cf_cv_library_path_utf8 ..." 1>&5
Steve Kondikae271bc2015-11-15 02:50:53 +01007128
7129 CPPFLAGS="$cf_test_CPPFLAGS"
7130 LIBS="-lutf8 $cf_save_LIBS"
7131 LDFLAGS="$cf_save_LDFLAGS -L$cf_cv_library_path_utf8"
micky3879b9f5e72025-07-08 18:04:53 -04007132 cat >"conftest.$ac_ext" <<_ACEOF
7133#line 7133 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +01007134#include "confdefs.h"
7135
7136#include <libutf8.h>
7137int
micky3879b9f5e72025-07-08 18:04:53 -04007138main (void)
Steve Kondikae271bc2015-11-15 02:50:53 +01007139{
7140putwc(0,0);
7141 ;
7142 return 0;
7143}
7144_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -04007145rm -f "conftest.$ac_objext" "conftest$ac_exeext"
7146if { (eval echo "$as_me:7146: \"$ac_link\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01007147 (eval $ac_link) 2>&5
7148 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -04007149 echo "$as_me:7149: \$? = $ac_status" >&5
7150 (exit "$ac_status"); } &&
7151 { ac_try='test -s "conftest$ac_exeext"'
7152 { (eval echo "$as_me:7152: \"$ac_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01007153 (eval $ac_try) 2>&5
7154 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -04007155 echo "$as_me:7155: \$? = $ac_status" >&5
7156 (exit "$ac_status"); }; }; then
Steve Kondikae271bc2015-11-15 02:50:53 +01007157
7158 test -n "$verbose" && echo " ... found utf8 library in $cf_cv_library_path_utf8" 1>&6
7159
micky3879b9f5e72025-07-08 18:04:53 -04007160echo "${as_me:-configure}:7160: testing ... found utf8 library in $cf_cv_library_path_utf8 ..." 1>&5
Steve Kondikae271bc2015-11-15 02:50:53 +01007161
7162 cf_cv_find_linkage_utf8=yes
7163 cf_cv_library_file_utf8="-lutf8"
7164 break
7165else
7166 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -04007167cat "conftest.$ac_ext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01007168
7169 CPPFLAGS="$cf_save_CPPFLAGS"
7170 LIBS="$cf_save_LIBS"
7171 LDFLAGS="$cf_save_LDFLAGS"
7172
7173fi
micky3879b9f5e72025-07-08 18:04:53 -04007174rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
Steve Kondikae271bc2015-11-15 02:50:53 +01007175 fi
7176 done
7177 CPPFLAGS="$cf_save_CPPFLAGS"
7178 LDFLAGS="$cf_save_LDFLAGS"
7179 fi
7180
7181 else
7182 cf_cv_find_linkage_utf8=no
7183 fi
7184
7185fi
micky3879b9f5e72025-07-08 18:04:53 -04007186rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
Steve Kondikae271bc2015-11-15 02:50:53 +01007187
7188fi
micky3879b9f5e72025-07-08 18:04:53 -04007189rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
Steve Kondikae271bc2015-11-15 02:50:53 +01007190
7191LIBS="$cf_save_LIBS"
7192
7193if test "$cf_cv_find_linkage_utf8" = yes ; then
7194cf_cv_utf8_lib=add-on
7195else
7196cf_cv_utf8_lib=no
7197fi
7198
7199fi
micky3879b9f5e72025-07-08 18:04:53 -04007200rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
Steve Kondikae271bc2015-11-15 02:50:53 +01007201fi
micky3879b9f5e72025-07-08 18:04:53 -04007202echo "$as_me:7202: result: $cf_cv_utf8_lib" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01007203echo "${ECHO_T}$cf_cv_utf8_lib" >&6
7204
7205# HAVE_LIBUTF8_H is used by ncurses if curses.h is shared between
7206# ncurses/ncursesw:
7207if test "$cf_cv_utf8_lib" = "add-on" ; then
7208
7209cat >>confdefs.h <<\EOF
7210#define HAVE_LIBUTF8_H 1
7211EOF
7212
7213if test -n "$cf_cv_header_path_utf8" ; then
7214 for cf_add_incdir in $cf_cv_header_path_utf8
7215 do
micky3879b9f5e72025-07-08 18:04:53 -04007216 while test "$cf_add_incdir" != /usr/include
Steve Kondikae271bc2015-11-15 02:50:53 +01007217 do
micky3879b9f5e72025-07-08 18:04:53 -04007218 if test -d "$cf_add_incdir"
Steve Kondikae271bc2015-11-15 02:50:53 +01007219 then
7220 cf_have_incdir=no
7221 if test -n "$CFLAGS$CPPFLAGS" ; then
7222 # a loop is needed to ensure we can add subdirs of existing dirs
7223 for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
7224 if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
7225 cf_have_incdir=yes; break
7226 fi
7227 done
7228 fi
7229
7230 if test "$cf_have_incdir" = no ; then
7231 if test "$cf_add_incdir" = /usr/local/include ; then
7232 if test "$GCC" = yes
7233 then
7234 cf_save_CPPFLAGS=$CPPFLAGS
micky3879b9f5e72025-07-08 18:04:53 -04007235
7236 test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
7237 CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
7238
7239 cat >"conftest.$ac_ext" <<_ACEOF
7240#line 7240 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +01007241#include "confdefs.h"
7242#include <stdio.h>
7243int
micky3879b9f5e72025-07-08 18:04:53 -04007244main (void)
Steve Kondikae271bc2015-11-15 02:50:53 +01007245{
7246printf("Hello")
7247 ;
7248 return 0;
7249}
7250_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -04007251rm -f "conftest.$ac_objext"
7252if { (eval echo "$as_me:7252: \"$ac_compile\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01007253 (eval $ac_compile) 2>&5
7254 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -04007255 echo "$as_me:7255: \$? = $ac_status" >&5
7256 (exit "$ac_status"); } &&
7257 { ac_try='test -s "conftest.$ac_objext"'
7258 { (eval echo "$as_me:7258: \"$ac_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01007259 (eval $ac_try) 2>&5
7260 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -04007261 echo "$as_me:7261: \$? = $ac_status" >&5
7262 (exit "$ac_status"); }; }; then
Steve Kondikae271bc2015-11-15 02:50:53 +01007263 :
7264else
7265 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -04007266cat "conftest.$ac_ext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01007267cf_have_incdir=yes
7268fi
micky3879b9f5e72025-07-08 18:04:53 -04007269rm -f "conftest.$ac_objext" "conftest.$ac_ext"
Steve Kondikae271bc2015-11-15 02:50:53 +01007270 CPPFLAGS=$cf_save_CPPFLAGS
7271 fi
7272 fi
7273 fi
7274
7275 if test "$cf_have_incdir" = no ; then
7276 test -n "$verbose" && echo " adding $cf_add_incdir to include-path" 1>&6
7277
micky3879b9f5e72025-07-08 18:04:53 -04007278echo "${as_me:-configure}:7278: testing adding $cf_add_incdir to include-path ..." 1>&5
Steve Kondikae271bc2015-11-15 02:50:53 +01007279
7280 CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
7281
micky3879b9f5e72025-07-08 18:04:53 -04007282 cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
Steve Kondikae271bc2015-11-15 02:50:53 +01007283 test "$cf_top_incdir" = "$cf_add_incdir" && break
7284 cf_add_incdir="$cf_top_incdir"
7285 else
7286 break
7287 fi
7288 else
7289 break
7290 fi
7291 done
7292 done
7293fi
7294
7295if test -n "$cf_cv_library_path_utf8" ; then
7296 for cf_add_libdir in $cf_cv_library_path_utf8
7297 do
micky3879b9f5e72025-07-08 18:04:53 -04007298 if test "$cf_add_libdir" = /usr/lib ; then
Steve Kondikae271bc2015-11-15 02:50:53 +01007299 :
micky3879b9f5e72025-07-08 18:04:53 -04007300 elif test -d "$cf_add_libdir"
Steve Kondikae271bc2015-11-15 02:50:53 +01007301 then
7302 cf_have_libdir=no
7303 if test -n "$LDFLAGS$LIBS" ; then
7304 # a loop is needed to ensure we can add subdirs of existing dirs
7305 for cf_test_libdir in $LDFLAGS $LIBS ; do
7306 if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
7307 cf_have_libdir=yes; break
7308 fi
7309 done
7310 fi
7311 if test "$cf_have_libdir" = no ; then
7312 test -n "$verbose" && echo " adding $cf_add_libdir to library-path" 1>&6
7313
micky3879b9f5e72025-07-08 18:04:53 -04007314echo "${as_me:-configure}:7314: testing adding $cf_add_libdir to library-path ..." 1>&5
Steve Kondikae271bc2015-11-15 02:50:53 +01007315
7316 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
7317 fi
7318 fi
7319 done
7320fi
7321
micky3879b9f5e72025-07-08 18:04:53 -04007322cf_add_libs="$LIBS"
7323# reverse order
7324cf_add_0lib=
7325for cf_add_1lib in $cf_cv_library_file_utf8; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
7326# filter duplicates
7327for cf_add_1lib in $cf_add_0lib; do
7328 for cf_add_2lib in $cf_add_libs; do
7329 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
Steve Kondikae271bc2015-11-15 02:50:53 +01007330 cf_add_1lib=
7331 break
7332 fi
7333 done
micky3879b9f5e72025-07-08 18:04:53 -04007334 test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
Steve Kondikae271bc2015-11-15 02:50:53 +01007335done
7336LIBS="$cf_add_libs"
7337
7338fi
7339
7340cf_ncuconfig_root=ncursesw
7341cf_have_ncuconfig=no
7342
7343if test "x${PKG_CONFIG:=none}" != xnone; then
micky3879b9f5e72025-07-08 18:04:53 -04007344 echo "$as_me:7344: checking pkg-config for $cf_ncuconfig_root" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01007345echo $ECHO_N "checking pkg-config for $cf_ncuconfig_root... $ECHO_C" >&6
7346 if "$PKG_CONFIG" --exists $cf_ncuconfig_root ; then
micky3879b9f5e72025-07-08 18:04:53 -04007347 echo "$as_me:7347: result: yes" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01007348echo "${ECHO_T}yes" >&6
7349
micky3879b9f5e72025-07-08 18:04:53 -04007350 echo "$as_me:7350: checking if the $cf_ncuconfig_root package files work" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01007351echo $ECHO_N "checking if the $cf_ncuconfig_root package files work... $ECHO_C" >&6
7352 cf_have_ncuconfig=unknown
7353
micky3879b9f5e72025-07-08 18:04:53 -04007354 cf_save_CFLAGS="$CFLAGS"
Steve Kondikae271bc2015-11-15 02:50:53 +01007355 cf_save_CPPFLAGS="$CPPFLAGS"
7356 cf_save_LIBS="$LIBS"
7357
micky3879b9f5e72025-07-08 18:04:53 -04007358 cf_pkg_cflags="`$PKG_CONFIG --cflags $cf_ncuconfig_root`"
7359 cf_pkg_libs="`$PKG_CONFIG --libs $cf_ncuconfig_root`"
Steve Kondikae271bc2015-11-15 02:50:53 +01007360
micky3879b9f5e72025-07-08 18:04:53 -04007361 # while -W for passing linker flags is prevalent, it is not "standard".
7362 # At least one wrapper for c89/c99 (in Apple's xcode) has its own
7363 # incompatible _and_ non-standard -W option which gives an error. Work
7364 # around that pitfall.
7365 case "x${CC}@@${cf_pkg_libs}@${cf_pkg_cflags}" in
7366 (x*c[89]9@@*-W*)
7367
7368cf_fix_cppflags=no
7369cf_new_cflags=
7370cf_new_cppflags=
7371cf_new_extra_cppflags=
7372
7373for cf_add_cflags in $cf_pkg_cflags
Steve Kondikae271bc2015-11-15 02:50:53 +01007374do
micky3879b9f5e72025-07-08 18:04:53 -04007375case "$cf_fix_cppflags" in
7376(no)
7377 case "$cf_add_cflags" in
7378 (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
7379 case "$cf_add_cflags" in
7380 (-D*)
7381 cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
7382
7383 test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
7384 && test -z "${cf_tst_cflags}" \
7385 && cf_fix_cppflags=yes
7386
7387 if test "$cf_fix_cppflags" = yes ; then
7388
7389 test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7390 cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7391
7392 continue
7393 elif test "${cf_tst_cflags}" = "\"'" ; then
7394
7395 test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7396 cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7397
7398 continue
7399 fi
7400 ;;
7401 esac
7402 case "$CPPFLAGS" in
7403 (*$cf_add_cflags)
7404 ;;
7405 (*)
7406 case "$cf_add_cflags" in
7407 (-D*)
7408 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
7409
7410CPPFLAGS=`echo "$CPPFLAGS" | \
7411 sed -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?[ ]/ /g' \
7412 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?$//g'`
7413
7414 ;;
7415 esac
7416
7417 test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
7418 cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
7419
7420 ;;
7421 esac
7422 ;;
7423 (*)
7424
7425 test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
7426 cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
7427
7428 ;;
7429 esac
7430 ;;
7431(yes)
7432
7433 test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7434 cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7435
7436 cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
7437
7438 test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
7439 && test -z "${cf_tst_cflags}" \
7440 && cf_fix_cppflags=no
7441 ;;
7442esac
7443done
7444
7445if test -n "$cf_new_cflags" ; then
7446
7447 test -n "$CFLAGS" && CFLAGS="$CFLAGS "
7448 CFLAGS="${CFLAGS}$cf_new_cflags"
7449
7450fi
7451
7452if test -n "$cf_new_cppflags" ; then
7453
7454 test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
7455 CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
7456
7457fi
7458
7459if test -n "$cf_new_extra_cppflags" ; then
7460
7461 test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
7462 EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
7463
7464fi
7465
7466cf_add_libs="$LIBS"
7467# reverse order
7468cf_add_0lib=
7469for cf_add_1lib in $cf_pkg_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
7470# filter duplicates
7471for cf_add_1lib in $cf_add_0lib; do
7472 for cf_add_2lib in $cf_add_libs; do
7473 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
Steve Kondikae271bc2015-11-15 02:50:53 +01007474 cf_add_1lib=
7475 break
7476 fi
7477 done
micky3879b9f5e72025-07-08 18:04:53 -04007478 test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
Steve Kondikae271bc2015-11-15 02:50:53 +01007479done
7480LIBS="$cf_add_libs"
7481
micky3879b9f5e72025-07-08 18:04:53 -04007482 cat >"conftest.$ac_ext" <<_ACEOF
7483#line 7483 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +01007484#include "confdefs.h"
7485#include <${cf_cv_ncurses_header:-curses.h}>
7486int
micky3879b9f5e72025-07-08 18:04:53 -04007487main (void)
Steve Kondikae271bc2015-11-15 02:50:53 +01007488{
micky3879b9f5e72025-07-08 18:04:53 -04007489initscr(); mousemask(0,0); tigetstr((char *)0);
Steve Kondikae271bc2015-11-15 02:50:53 +01007490 ;
7491 return 0;
7492}
7493_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -04007494rm -f "conftest.$ac_objext" "conftest$ac_exeext"
7495if { (eval echo "$as_me:7495: \"$ac_link\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01007496 (eval $ac_link) 2>&5
7497 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -04007498 echo "$as_me:7498: \$? = $ac_status" >&5
7499 (exit "$ac_status"); } &&
7500 { ac_try='test -s "conftest$ac_exeext"'
7501 { (eval echo "$as_me:7501: \"$ac_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01007502 (eval $ac_try) 2>&5
7503 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -04007504 echo "$as_me:7504: \$? = $ac_status" >&5
7505 (exit "$ac_status"); }; }; then
7506 if test "$cross_compiling" = yes; then
7507 cf_test_ncuconfig=maybe
7508else
7509 cat >"conftest.$ac_ext" <<_ACEOF
7510#line 7510 "configure"
7511#include "confdefs.h"
7512#include <${cf_cv_ncurses_header:-curses.h}>
7513 int main(void)
7514 { const char *xx = curses_version(); return (xx == 0); }
7515_ACEOF
7516rm -f "conftest$ac_exeext"
7517if { (eval echo "$as_me:7517: \"$ac_link\"") >&5
7518 (eval $ac_link) 2>&5
7519 ac_status=$?
7520 echo "$as_me:7520: \$? = $ac_status" >&5
7521 (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
7522 { (eval echo "$as_me:7522: \"$ac_try\"") >&5
7523 (eval $ac_try) 2>&5
7524 ac_status=$?
7525 echo "$as_me:7525: \$? = $ac_status" >&5
7526 (exit "$ac_status"); }; }; then
7527 cf_test_ncuconfig=yes
7528else
7529 echo "$as_me: program exited with status $ac_status" >&5
7530echo "$as_me: failed program was:" >&5
7531cat "conftest.$ac_ext" >&5
7532cf_test_ncuconfig=no
7533fi
7534rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
7535fi
7536else
7537 echo "$as_me: failed program was:" >&5
7538cat "conftest.$ac_ext" >&5
7539cf_test_ncuconfig=no
7540fi
7541rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
7542
7543 CFLAGS="$cf_save_CFLAGS"
7544 CPPFLAGS="$cf_save_CPPFLAGS"
7545 LIBS="$cf_save_LIBS"
7546
7547 if test "x$cf_test_ncuconfig" != xyes; then
7548 cf_temp=`echo "x$cf_pkg_cflags" | sed -e s/^x// -e 's/-W[^ ]*//g'`
7549 cf_pkg_cflags="$cf_temp"
7550 cf_temp=`echo "x$cf_pkg_libs" | sed -e s/^x// -e 's/-W[^ ]*//g'`
7551 cf_pkg_libs="$cf_temp"
7552 fi
7553 ;;
7554 esac
7555
7556for cf_add_cflags in $cf_pkg_cflags
7557do
7558 case "x$cf_add_cflags" in
7559 (x-[DU]*)
7560
7561cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
7562while true
7563do
7564 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'`
7565 test "$CFLAGS" != "$cf_old_cflag" || break
7566
7567 CFLAGS="$cf_old_cflag"
7568done
7569
7570cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
7571while true
7572do
7573 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'`
7574 test "$CPPFLAGS" != "$cf_old_cflag" || break
7575
7576 CPPFLAGS="$cf_old_cflag"
7577done
7578
7579 ;;
7580 esac
7581
7582cf_fix_cppflags=no
7583cf_new_cflags=
7584cf_new_cppflags=
7585cf_new_extra_cppflags=
7586
7587for cf_add_cflags in $cf_add_cflags
7588do
7589case "$cf_fix_cppflags" in
7590(no)
7591 case "$cf_add_cflags" in
7592 (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
7593 case "$cf_add_cflags" in
7594 (-D*)
7595 cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
7596
7597 test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
7598 && test -z "${cf_tst_cflags}" \
7599 && cf_fix_cppflags=yes
7600
7601 if test "$cf_fix_cppflags" = yes ; then
7602
7603 test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7604 cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7605
7606 continue
7607 elif test "${cf_tst_cflags}" = "\"'" ; then
7608
7609 test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7610 cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7611
7612 continue
7613 fi
7614 ;;
7615 esac
7616 case "$CPPFLAGS" in
7617 (*$cf_add_cflags)
7618 ;;
7619 (*)
7620 case "$cf_add_cflags" in
7621 (-D*)
7622 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
7623
7624CPPFLAGS=`echo "$CPPFLAGS" | \
7625 sed -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?[ ]/ /g' \
7626 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?$//g'`
7627
7628 ;;
7629 esac
7630
7631 test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
7632 cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
7633
7634 ;;
7635 esac
7636 ;;
7637 (*)
7638
7639 test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
7640 cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
7641
7642 ;;
7643 esac
7644 ;;
7645(yes)
7646
7647 test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7648 cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7649
7650 cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
7651
7652 test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
7653 && test -z "${cf_tst_cflags}" \
7654 && cf_fix_cppflags=no
7655 ;;
7656esac
7657done
7658
7659if test -n "$cf_new_cflags" ; then
7660
7661 test -n "$CFLAGS" && CFLAGS="$CFLAGS "
7662 CFLAGS="${CFLAGS}$cf_new_cflags"
7663
7664fi
7665
7666if test -n "$cf_new_cppflags" ; then
7667
7668 test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
7669 CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
7670
7671fi
7672
7673if test -n "$cf_new_extra_cppflags" ; then
7674
7675 test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
7676 EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
7677
7678fi
7679
7680done
7681
7682cf_add_libs="$LIBS"
7683# reverse order
7684cf_add_0lib=
7685for cf_add_1lib in $cf_pkg_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
7686# filter duplicates
7687for cf_add_1lib in $cf_add_0lib; do
7688 for cf_add_2lib in $cf_add_libs; do
7689 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
7690 cf_add_1lib=
7691 break
7692 fi
7693 done
7694 test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
7695done
7696LIBS="$cf_add_libs"
7697
7698 cat >"conftest.$ac_ext" <<_ACEOF
7699#line 7699 "configure"
7700#include "confdefs.h"
7701#include <${cf_cv_ncurses_header:-curses.h}>
7702int
7703main (void)
7704{
7705initscr(); mousemask(0,0); tigetstr((char *)0);
7706 ;
7707 return 0;
7708}
7709_ACEOF
7710rm -f "conftest.$ac_objext" "conftest$ac_exeext"
7711if { (eval echo "$as_me:7711: \"$ac_link\"") >&5
7712 (eval $ac_link) 2>&5
7713 ac_status=$?
7714 echo "$as_me:7714: \$? = $ac_status" >&5
7715 (exit "$ac_status"); } &&
7716 { ac_try='test -s "conftest$ac_exeext"'
7717 { (eval echo "$as_me:7717: \"$ac_try\"") >&5
7718 (eval $ac_try) 2>&5
7719 ac_status=$?
7720 echo "$as_me:7720: \$? = $ac_status" >&5
7721 (exit "$ac_status"); }; }; then
Steve Kondikae271bc2015-11-15 02:50:53 +01007722 if test "$cross_compiling" = yes; then
7723 cf_have_ncuconfig=maybe
7724else
micky3879b9f5e72025-07-08 18:04:53 -04007725 cat >"conftest.$ac_ext" <<_ACEOF
7726#line 7726 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +01007727#include "confdefs.h"
7728#include <${cf_cv_ncurses_header:-curses.h}>
7729 int main(void)
micky3879b9f5e72025-07-08 18:04:53 -04007730 { const char *xx = curses_version(); return (xx == 0); }
Steve Kondikae271bc2015-11-15 02:50:53 +01007731_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -04007732rm -f "conftest$ac_exeext"
7733if { (eval echo "$as_me:7733: \"$ac_link\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01007734 (eval $ac_link) 2>&5
7735 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -04007736 echo "$as_me:7736: \$? = $ac_status" >&5
7737 (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
7738 { (eval echo "$as_me:7738: \"$ac_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01007739 (eval $ac_try) 2>&5
7740 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -04007741 echo "$as_me:7741: \$? = $ac_status" >&5
7742 (exit "$ac_status"); }; }; then
Steve Kondikae271bc2015-11-15 02:50:53 +01007743 cf_have_ncuconfig=yes
7744else
7745 echo "$as_me: program exited with status $ac_status" >&5
7746echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -04007747cat "conftest.$ac_ext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01007748cf_have_ncuconfig=no
7749fi
micky3879b9f5e72025-07-08 18:04:53 -04007750rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
Steve Kondikae271bc2015-11-15 02:50:53 +01007751fi
7752else
7753 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -04007754cat "conftest.$ac_ext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01007755cf_have_ncuconfig=no
7756fi
micky3879b9f5e72025-07-08 18:04:53 -04007757rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
7758 echo "$as_me:7758: result: $cf_have_ncuconfig" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01007759echo "${ECHO_T}$cf_have_ncuconfig" >&6
7760 test "$cf_have_ncuconfig" = maybe && cf_have_ncuconfig=yes
7761 if test "$cf_have_ncuconfig" != "yes"
7762 then
7763 CPPFLAGS="$cf_save_CPPFLAGS"
7764 LIBS="$cf_save_LIBS"
7765 NCURSES_CONFIG_PKG=none
7766 else
7767
7768cat >>confdefs.h <<\EOF
7769#define NCURSES 1
7770EOF
7771
7772 NCURSES_CONFIG_PKG=$cf_ncuconfig_root
micky3879b9f5e72025-07-08 18:04:53 -04007773
7774echo "$as_me:7774: checking for terminfo header" >&5
7775echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
7776if test "${cf_cv_term_header+set}" = set; then
7777 echo $ECHO_N "(cached) $ECHO_C" >&6
7778else
7779
7780case "${cf_cv_ncurses_header}" in
7781(*/ncurses.h|*/ncursesw.h)
7782 cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
7783 ;;
7784(*)
7785 cf_term_header=term.h
7786 ;;
7787esac
7788
7789for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
7790do
7791cat >"conftest.$ac_ext" <<_ACEOF
7792#line 7792 "configure"
7793#include "confdefs.h"
7794#include <stdio.h>
7795#include <${cf_cv_ncurses_header:-curses.h}>
7796#include <$cf_test>
7797
7798int
7799main (void)
7800{
7801int x = auto_left_margin; (void)x
7802 ;
7803 return 0;
7804}
7805_ACEOF
7806rm -f "conftest.$ac_objext"
7807if { (eval echo "$as_me:7807: \"$ac_compile\"") >&5
7808 (eval $ac_compile) 2>&5
7809 ac_status=$?
7810 echo "$as_me:7810: \$? = $ac_status" >&5
7811 (exit "$ac_status"); } &&
7812 { ac_try='test -s "conftest.$ac_objext"'
7813 { (eval echo "$as_me:7813: \"$ac_try\"") >&5
7814 (eval $ac_try) 2>&5
7815 ac_status=$?
7816 echo "$as_me:7816: \$? = $ac_status" >&5
7817 (exit "$ac_status"); }; }; then
7818
7819 cf_cv_term_header="$cf_test"
7820else
7821 echo "$as_me: failed program was:" >&5
7822cat "conftest.$ac_ext" >&5
7823
7824 cf_cv_term_header=unknown
7825
7826fi
7827rm -f "conftest.$ac_objext" "conftest.$ac_ext"
7828 test "$cf_cv_term_header" != unknown && break
7829done
7830
7831fi
7832echo "$as_me:7832: result: $cf_cv_term_header" >&5
7833echo "${ECHO_T}$cf_cv_term_header" >&6
7834
7835# Set definitions to allow ifdef'ing to accommodate subdirectories
7836
7837case "$cf_cv_term_header" in
7838(*term.h)
7839
7840cat >>confdefs.h <<\EOF
7841#define HAVE_TERM_H 1
7842EOF
7843
7844 ;;
7845esac
7846
7847case "$cf_cv_term_header" in
7848(ncurses/term.h)
7849
7850cat >>confdefs.h <<\EOF
7851#define HAVE_NCURSES_TERM_H 1
7852EOF
7853
7854 ;;
7855(ncursesw/term.h)
7856
7857cat >>confdefs.h <<\EOF
7858#define HAVE_NCURSESW_TERM_H 1
7859EOF
7860
7861 ;;
7862esac
7863
Steve Kondikae271bc2015-11-15 02:50:53 +01007864 fi
7865
7866 else
micky3879b9f5e72025-07-08 18:04:53 -04007867 echo "$as_me:7867: result: no" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01007868echo "${ECHO_T}no" >&6
7869 NCURSES_CONFIG_PKG=none
7870 fi
7871else
7872 NCURSES_CONFIG_PKG=none
7873fi
7874
7875if test "x$cf_have_ncuconfig" = "xno"; then
micky3879b9f5e72025-07-08 18:04:53 -04007876 cf_ncurses_config="${cf_ncuconfig_root}${NCURSES_CONFIG_SUFFIX}-config"; echo "Looking for ${cf_ncurses_config}"
Steve Kondikae271bc2015-11-15 02:50:53 +01007877
7878if test -n "$ac_tool_prefix"; then
micky3879b9f5e72025-07-08 18:04:53 -04007879 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 +01007880 do
7881 # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
7882set dummy $ac_tool_prefix$ac_prog; ac_word=$2
micky3879b9f5e72025-07-08 18:04:53 -04007883echo "$as_me:7883: checking for $ac_word" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01007884echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
7885if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
7886 echo $ECHO_N "(cached) $ECHO_C" >&6
7887else
7888 if test -n "$NCURSES_CONFIG"; then
7889 ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
7890else
7891 ac_save_IFS=$IFS; IFS=$ac_path_separator
7892ac_dummy="$PATH"
7893for ac_dir in $ac_dummy; do
7894 IFS=$ac_save_IFS
7895 test -z "$ac_dir" && ac_dir=.
7896 $as_executable_p "$ac_dir/$ac_word" || continue
7897ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
micky3879b9f5e72025-07-08 18:04:53 -04007898echo "$as_me:7898: found $ac_dir/$ac_word" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01007899break
7900done
7901
7902fi
7903fi
7904NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
7905if test -n "$NCURSES_CONFIG"; then
micky3879b9f5e72025-07-08 18:04:53 -04007906 echo "$as_me:7906: result: $NCURSES_CONFIG" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01007907echo "${ECHO_T}$NCURSES_CONFIG" >&6
7908else
micky3879b9f5e72025-07-08 18:04:53 -04007909 echo "$as_me:7909: result: no" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01007910echo "${ECHO_T}no" >&6
7911fi
7912
7913 test -n "$NCURSES_CONFIG" && break
7914 done
7915fi
7916if test -z "$NCURSES_CONFIG"; then
7917 ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
micky3879b9f5e72025-07-08 18:04:53 -04007918 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 +01007919do
7920 # Extract the first word of "$ac_prog", so it can be a program name with args.
7921set dummy $ac_prog; ac_word=$2
micky3879b9f5e72025-07-08 18:04:53 -04007922echo "$as_me:7922: checking for $ac_word" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01007923echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
7924if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
7925 echo $ECHO_N "(cached) $ECHO_C" >&6
7926else
7927 if test -n "$ac_ct_NCURSES_CONFIG"; then
7928 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
7929else
7930 ac_save_IFS=$IFS; IFS=$ac_path_separator
7931ac_dummy="$PATH"
7932for ac_dir in $ac_dummy; do
7933 IFS=$ac_save_IFS
7934 test -z "$ac_dir" && ac_dir=.
7935 $as_executable_p "$ac_dir/$ac_word" || continue
7936ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
micky3879b9f5e72025-07-08 18:04:53 -04007937echo "$as_me:7937: found $ac_dir/$ac_word" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01007938break
7939done
7940
7941fi
7942fi
7943ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
7944if test -n "$ac_ct_NCURSES_CONFIG"; then
micky3879b9f5e72025-07-08 18:04:53 -04007945 echo "$as_me:7945: result: $ac_ct_NCURSES_CONFIG" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01007946echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
7947else
micky3879b9f5e72025-07-08 18:04:53 -04007948 echo "$as_me:7948: result: no" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01007949echo "${ECHO_T}no" >&6
7950fi
7951
7952 test -n "$ac_ct_NCURSES_CONFIG" && break
7953done
7954test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
7955
7956 NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
7957fi
7958
7959 if test "$NCURSES_CONFIG" != none ; then
7960
micky3879b9f5e72025-07-08 18:04:53 -04007961for cf_add_cflags in `$NCURSES_CONFIG --cflags`
Steve Kondikae271bc2015-11-15 02:50:53 +01007962do
micky3879b9f5e72025-07-08 18:04:53 -04007963 case "x$cf_add_cflags" in
7964 (x-[DU]*)
7965
7966cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
7967while true
7968do
7969 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'`
7970 test "$CFLAGS" != "$cf_old_cflag" || break
7971
7972 CFLAGS="$cf_old_cflag"
7973done
7974
7975cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
7976while true
7977do
7978 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'`
7979 test "$CPPFLAGS" != "$cf_old_cflag" || break
7980
7981 CPPFLAGS="$cf_old_cflag"
7982done
7983
7984 ;;
7985 esac
7986
7987cf_fix_cppflags=no
7988cf_new_cflags=
7989cf_new_cppflags=
7990cf_new_extra_cppflags=
7991
7992for cf_add_cflags in $cf_add_cflags
7993do
7994case "$cf_fix_cppflags" in
7995(no)
7996 case "$cf_add_cflags" in
7997 (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
7998 case "$cf_add_cflags" in
7999 (-D*)
8000 cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
8001
8002 test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
8003 && test -z "${cf_tst_cflags}" \
8004 && cf_fix_cppflags=yes
8005
8006 if test "$cf_fix_cppflags" = yes ; then
8007
8008 test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
8009 cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
8010
8011 continue
8012 elif test "${cf_tst_cflags}" = "\"'" ; then
8013
8014 test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
8015 cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
8016
8017 continue
8018 fi
8019 ;;
8020 esac
8021 case "$CPPFLAGS" in
8022 (*$cf_add_cflags)
8023 ;;
8024 (*)
8025 case "$cf_add_cflags" in
8026 (-D*)
8027 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
8028
8029CPPFLAGS=`echo "$CPPFLAGS" | \
8030 sed -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?[ ]/ /g' \
8031 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?$//g'`
8032
8033 ;;
8034 esac
8035
8036 test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
8037 cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
8038
8039 ;;
8040 esac
8041 ;;
8042 (*)
8043
8044 test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
8045 cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
8046
8047 ;;
8048 esac
8049 ;;
8050(yes)
8051
8052 test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
8053 cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
8054
8055 cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
8056
8057 test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
8058 && test -z "${cf_tst_cflags}" \
8059 && cf_fix_cppflags=no
8060 ;;
8061esac
8062done
8063
8064if test -n "$cf_new_cflags" ; then
8065
8066 test -n "$CFLAGS" && CFLAGS="$CFLAGS "
8067 CFLAGS="${CFLAGS}$cf_new_cflags"
8068
8069fi
8070
8071if test -n "$cf_new_cppflags" ; then
8072
8073 test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
8074 CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
8075
8076fi
8077
8078if test -n "$cf_new_extra_cppflags" ; then
8079
8080 test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
8081 EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
8082
8083fi
8084
8085done
8086
8087cf_add_libs="$LIBS"
8088# reverse order
8089cf_add_0lib=
8090for cf_add_1lib in `$NCURSES_CONFIG --libs`; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
8091# filter duplicates
8092for cf_add_1lib in $cf_add_0lib; do
8093 for cf_add_2lib in $cf_add_libs; do
8094 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
Steve Kondikae271bc2015-11-15 02:50:53 +01008095 cf_add_1lib=
8096 break
8097 fi
8098 done
micky3879b9f5e72025-07-08 18:04:53 -04008099 test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
Steve Kondikae271bc2015-11-15 02:50:53 +01008100done
8101LIBS="$cf_add_libs"
8102
8103 # even with config script, some packages use no-override for curses.h
8104
micky3879b9f5e72025-07-08 18:04:53 -04008105echo "$as_me:8105: checking if we have identified curses headers" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01008106echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
8107if test "${cf_cv_ncurses_header+set}" = set; then
8108 echo $ECHO_N "(cached) $ECHO_C" >&6
8109else
8110
8111cf_cv_ncurses_header=none
8112for cf_header in \
8113 ncurses.h ncursesw/ncurses.h \
8114 curses.h ncursesw/curses.h
8115do
micky3879b9f5e72025-07-08 18:04:53 -04008116cat >"conftest.$ac_ext" <<_ACEOF
8117#line 8117 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +01008118#include "confdefs.h"
8119#include <${cf_header}>
8120int
micky3879b9f5e72025-07-08 18:04:53 -04008121main (void)
Steve Kondikae271bc2015-11-15 02:50:53 +01008122{
micky3879b9f5e72025-07-08 18:04:53 -04008123initscr(); endwin()
Steve Kondikae271bc2015-11-15 02:50:53 +01008124 ;
8125 return 0;
8126}
8127_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -04008128rm -f "conftest.$ac_objext"
8129if { (eval echo "$as_me:8129: \"$ac_compile\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01008130 (eval $ac_compile) 2>&5
8131 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -04008132 echo "$as_me:8132: \$? = $ac_status" >&5
8133 (exit "$ac_status"); } &&
8134 { ac_try='test -s "conftest.$ac_objext"'
8135 { (eval echo "$as_me:8135: \"$ac_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01008136 (eval $ac_try) 2>&5
8137 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -04008138 echo "$as_me:8138: \$? = $ac_status" >&5
8139 (exit "$ac_status"); }; }; then
Steve Kondikae271bc2015-11-15 02:50:53 +01008140 cf_cv_ncurses_header=$cf_header; break
8141else
8142 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -04008143cat "conftest.$ac_ext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01008144fi
micky3879b9f5e72025-07-08 18:04:53 -04008145rm -f "conftest.$ac_objext" "conftest.$ac_ext"
Steve Kondikae271bc2015-11-15 02:50:53 +01008146done
8147
8148fi
micky3879b9f5e72025-07-08 18:04:53 -04008149echo "$as_me:8149: result: $cf_cv_ncurses_header" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01008150echo "${ECHO_T}$cf_cv_ncurses_header" >&6
8151
8152if test "$cf_cv_ncurses_header" = none ; then
micky3879b9f5e72025-07-08 18:04:53 -04008153 { { echo "$as_me:8153: error: No curses header-files found" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01008154echo "$as_me: error: No curses header-files found" >&2;}
8155 { (exit 1); exit 1; }; }
8156fi
8157
8158# cheat, to get the right #define's for HAVE_NCURSES_H, etc.
8159
8160for ac_header in $cf_cv_ncurses_header
8161do
8162as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
micky3879b9f5e72025-07-08 18:04:53 -04008163echo "$as_me:8163: checking for $ac_header" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01008164echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
8165if eval "test \"\${$as_ac_Header+set}\" = set"; then
8166 echo $ECHO_N "(cached) $ECHO_C" >&6
8167else
micky3879b9f5e72025-07-08 18:04:53 -04008168 cat >"conftest.$ac_ext" <<_ACEOF
8169#line 8169 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +01008170#include "confdefs.h"
8171#include <$ac_header>
8172_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -04008173if { (eval echo "$as_me:8173: \"$ac_cpp "conftest.$ac_ext"\"") >&5
8174 (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
Steve Kondikae271bc2015-11-15 02:50:53 +01008175 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -04008176 $EGREP -v '^ *\+' conftest.er1 >conftest.err
Steve Kondikae271bc2015-11-15 02:50:53 +01008177 rm -f conftest.er1
8178 cat conftest.err >&5
micky3879b9f5e72025-07-08 18:04:53 -04008179 echo "$as_me:8179: \$? = $ac_status" >&5
8180 (exit "$ac_status"); } >/dev/null; then
Steve Kondikae271bc2015-11-15 02:50:53 +01008181 if test -s conftest.err; then
8182 ac_cpp_err=$ac_c_preproc_warn_flag
8183 else
8184 ac_cpp_err=
8185 fi
8186else
8187 ac_cpp_err=yes
8188fi
8189if test -z "$ac_cpp_err"; then
8190 eval "$as_ac_Header=yes"
8191else
8192 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -04008193 cat "conftest.$ac_ext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01008194 eval "$as_ac_Header=no"
8195fi
micky3879b9f5e72025-07-08 18:04:53 -04008196rm -f conftest.err "conftest.$ac_ext"
Steve Kondikae271bc2015-11-15 02:50:53 +01008197fi
micky3879b9f5e72025-07-08 18:04:53 -04008198echo "$as_me:8198: result: `eval echo '${'"$as_ac_Header"'}'`" >&5
8199echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6
8200if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then
Steve Kondikae271bc2015-11-15 02:50:53 +01008201 cat >>confdefs.h <<EOF
8202#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
8203EOF
8204
8205fi
8206done
8207
8208cat >>confdefs.h <<\EOF
8209#define NCURSES 1
8210EOF
8211
8212cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
8213
8214 cat >>confdefs.h <<EOF
8215#define $cf_nculib_ROOT 1
8216EOF
8217
micky3879b9f5e72025-07-08 18:04:53 -04008218 cf_cv_ncurses_version="`$NCURSES_CONFIG --version`"
Steve Kondikae271bc2015-11-15 02:50:53 +01008219
8220 else
8221
8222cf_ncuhdr_root=ncursesw
8223
8224test -n "$cf_cv_curses_dir" && \
8225test "$cf_cv_curses_dir" != "no" && { \
8226
8227if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
8228 for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
8229 do
micky3879b9f5e72025-07-08 18:04:53 -04008230 while test "$cf_add_incdir" != /usr/include
Steve Kondikae271bc2015-11-15 02:50:53 +01008231 do
micky3879b9f5e72025-07-08 18:04:53 -04008232 if test -d "$cf_add_incdir"
Steve Kondikae271bc2015-11-15 02:50:53 +01008233 then
8234 cf_have_incdir=no
8235 if test -n "$CFLAGS$CPPFLAGS" ; then
8236 # a loop is needed to ensure we can add subdirs of existing dirs
8237 for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
8238 if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
8239 cf_have_incdir=yes; break
8240 fi
8241 done
8242 fi
8243
8244 if test "$cf_have_incdir" = no ; then
8245 if test "$cf_add_incdir" = /usr/local/include ; then
8246 if test "$GCC" = yes
8247 then
8248 cf_save_CPPFLAGS=$CPPFLAGS
micky3879b9f5e72025-07-08 18:04:53 -04008249
8250 test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
8251 CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
8252
8253 cat >"conftest.$ac_ext" <<_ACEOF
8254#line 8254 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +01008255#include "confdefs.h"
8256#include <stdio.h>
8257int
micky3879b9f5e72025-07-08 18:04:53 -04008258main (void)
Steve Kondikae271bc2015-11-15 02:50:53 +01008259{
8260printf("Hello")
8261 ;
8262 return 0;
8263}
8264_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -04008265rm -f "conftest.$ac_objext"
8266if { (eval echo "$as_me:8266: \"$ac_compile\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01008267 (eval $ac_compile) 2>&5
8268 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -04008269 echo "$as_me:8269: \$? = $ac_status" >&5
8270 (exit "$ac_status"); } &&
8271 { ac_try='test -s "conftest.$ac_objext"'
8272 { (eval echo "$as_me:8272: \"$ac_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01008273 (eval $ac_try) 2>&5
8274 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -04008275 echo "$as_me:8275: \$? = $ac_status" >&5
8276 (exit "$ac_status"); }; }; then
Steve Kondikae271bc2015-11-15 02:50:53 +01008277 :
8278else
8279 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -04008280cat "conftest.$ac_ext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01008281cf_have_incdir=yes
8282fi
micky3879b9f5e72025-07-08 18:04:53 -04008283rm -f "conftest.$ac_objext" "conftest.$ac_ext"
Steve Kondikae271bc2015-11-15 02:50:53 +01008284 CPPFLAGS=$cf_save_CPPFLAGS
8285 fi
8286 fi
8287 fi
8288
8289 if test "$cf_have_incdir" = no ; then
8290 test -n "$verbose" && echo " adding $cf_add_incdir to include-path" 1>&6
8291
micky3879b9f5e72025-07-08 18:04:53 -04008292echo "${as_me:-configure}:8292: testing adding $cf_add_incdir to include-path ..." 1>&5
Steve Kondikae271bc2015-11-15 02:50:53 +01008293
8294 CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8295
micky3879b9f5e72025-07-08 18:04:53 -04008296 cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
Steve Kondikae271bc2015-11-15 02:50:53 +01008297 test "$cf_top_incdir" = "$cf_add_incdir" && break
8298 cf_add_incdir="$cf_top_incdir"
8299 else
8300 break
8301 fi
8302 else
8303 break
8304 fi
8305 done
8306 done
8307fi
8308
8309}
8310
micky3879b9f5e72025-07-08 18:04:53 -04008311echo "$as_me:8311: checking for $cf_ncuhdr_root header in include-path" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01008312echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
8313if test "${cf_cv_ncurses_h+set}" = set; then
8314 echo $ECHO_N "(cached) $ECHO_C" >&6
8315else
8316
8317 cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
micky3879b9f5e72025-07-08 18:04:53 -04008318 { 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 +01008319 for cf_header in $cf_header_list
8320 do
8321
micky3879b9f5e72025-07-08 18:04:53 -04008322 cat >"conftest.$ac_ext" <<_ACEOF
8323#line 8323 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +01008324#include "confdefs.h"
8325
8326#define _XOPEN_SOURCE_EXTENDED
8327#undef HAVE_LIBUTF8_H /* in case we used CF_UTF8_LIB */
8328#define HAVE_LIBUTF8_H /* to force ncurses' header file to use cchar_t */
8329
8330#include <$cf_header>
8331int
micky3879b9f5e72025-07-08 18:04:53 -04008332main (void)
Steve Kondikae271bc2015-11-15 02:50:53 +01008333{
8334
8335#ifdef NCURSES_VERSION
8336
8337#ifndef WACS_BSSB
micky3879b9f5e72025-07-08 18:04:53 -04008338 #error WACS_BSSB is not defined
Steve Kondikae271bc2015-11-15 02:50:53 +01008339#endif
8340
micky3879b9f5e72025-07-08 18:04:53 -04008341printf("%s\\n", NCURSES_VERSION);
Steve Kondikae271bc2015-11-15 02:50:53 +01008342#else
8343#ifdef __NCURSES_H
micky3879b9f5e72025-07-08 18:04:53 -04008344printf("old\\n");
Steve Kondikae271bc2015-11-15 02:50:53 +01008345#else
micky3879b9f5e72025-07-08 18:04:53 -04008346 #error __NCURSES_H is not defined
Steve Kondikae271bc2015-11-15 02:50:53 +01008347#endif
8348#endif
8349
8350 ;
8351 return 0;
8352}
8353_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -04008354rm -f "conftest.$ac_objext"
8355if { (eval echo "$as_me:8355: \"$ac_compile\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01008356 (eval $ac_compile) 2>&5
8357 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -04008358 echo "$as_me:8358: \$? = $ac_status" >&5
8359 (exit "$ac_status"); } &&
8360 { ac_try='test -s "conftest.$ac_objext"'
8361 { (eval echo "$as_me:8361: \"$ac_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01008362 (eval $ac_try) 2>&5
8363 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -04008364 echo "$as_me:8364: \$? = $ac_status" >&5
8365 (exit "$ac_status"); }; }; then
Steve Kondikae271bc2015-11-15 02:50:53 +01008366 cf_cv_ncurses_h=$cf_header
8367
8368else
8369 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -04008370cat "conftest.$ac_ext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01008371cf_cv_ncurses_h=no
8372fi
micky3879b9f5e72025-07-08 18:04:53 -04008373rm -f "conftest.$ac_objext" "conftest.$ac_ext"
Steve Kondikae271bc2015-11-15 02:50:53 +01008374
8375 test "$cf_cv_ncurses_h" != no && break
8376 done
8377
8378fi
micky3879b9f5e72025-07-08 18:04:53 -04008379echo "$as_me:8379: result: $cf_cv_ncurses_h" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01008380echo "${ECHO_T}$cf_cv_ncurses_h" >&6
8381
8382if test "$cf_cv_ncurses_h" != no ; then
8383 cf_cv_ncurses_header=$cf_cv_ncurses_h
8384else
8385
micky3879b9f5e72025-07-08 18:04:53 -04008386echo "$as_me:8386: checking for $cf_ncuhdr_root include-path" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01008387echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
8388if test "${cf_cv_ncurses_h2+set}" = set; then
8389 echo $ECHO_N "(cached) $ECHO_C" >&6
8390else
8391
8392 test -n "$verbose" && echo
8393
8394cf_search=
8395
8396# collect the current set of include-directories from compiler flags
8397cf_header_path_list=""
8398if test -n "${CFLAGS}${CPPFLAGS}" ; then
8399 for cf_header_path in $CPPFLAGS $CFLAGS
8400 do
micky3879b9f5e72025-07-08 18:04:53 -04008401 case "$cf_header_path" in
Steve Kondikae271bc2015-11-15 02:50:53 +01008402 (-I*)
8403 cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
8404
8405test "x$cf_header_path" != "xNONE" && \
8406test -d "$cf_header_path" && \
8407 {
8408 test -n "$verbose" && echo " ... testing for include-directories under $cf_header_path"
micky3879b9f5e72025-07-08 18:04:53 -04008409 test -d "$cf_header_path/include" && cf_search="$cf_search $cf_header_path/include"
8410 test -d "$cf_header_path/include/$cf_ncuhdr_root" && cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
8411 test -d "$cf_header_path/include/$cf_ncuhdr_root/include" && cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
8412 test -d "$cf_header_path/$cf_ncuhdr_root/include" && cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
8413 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 +01008414}
8415
8416 cf_header_path_list="$cf_header_path_list $cf_search"
8417 ;;
8418 esac
8419 done
8420fi
8421
8422# add the variations for the package we are looking for
8423
8424cf_search=
8425
8426test "x$prefix" != "xNONE" && \
8427test -d "$prefix" && \
8428 {
8429 test -n "$verbose" && echo " ... testing for include-directories under $prefix"
micky3879b9f5e72025-07-08 18:04:53 -04008430 test -d "$prefix/include" && cf_search="$cf_search $prefix/include"
8431 test -d "$prefix/include/$cf_ncuhdr_root" && cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
8432 test -d "$prefix/include/$cf_ncuhdr_root/include" && cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
8433 test -d "$prefix/$cf_ncuhdr_root/include" && cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
8434 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 +01008435}
8436
8437for cf_subdir_prefix in \
8438 /usr \
8439 /usr/local \
8440 /usr/pkg \
8441 /opt \
8442 /opt/local \
8443 $HOME
8444do
8445
8446test "x$cf_subdir_prefix" != "x$prefix" && \
8447test -d "$cf_subdir_prefix" && \
micky3879b9f5e72025-07-08 18:04:53 -04008448{ test -z "$prefix" || test "x$prefix" = xNONE || test "x$cf_subdir_prefix" != "x$prefix"; } && {
Steve Kondikae271bc2015-11-15 02:50:53 +01008449 test -n "$verbose" && echo " ... testing for include-directories under $cf_subdir_prefix"
micky3879b9f5e72025-07-08 18:04:53 -04008450 test -d "$cf_subdir_prefix/include" && cf_search="$cf_search $cf_subdir_prefix/include"
8451 test -d "$cf_subdir_prefix/include/$cf_ncuhdr_root" && cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root"
8452 test -d "$cf_subdir_prefix/include/$cf_ncuhdr_root/include" && cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root/include"
8453 test -d "$cf_subdir_prefix/$cf_ncuhdr_root/include" && cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include"
8454 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 +01008455}
8456
8457done
8458
8459test "$includedir" != NONE && \
8460test "$includedir" != "/usr/include" && \
8461test -d "$includedir" && {
micky3879b9f5e72025-07-08 18:04:53 -04008462 test -d "$includedir" && cf_search="$cf_search $includedir"
8463 test -d "$includedir/$cf_ncuhdr_root" && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
Steve Kondikae271bc2015-11-15 02:50:53 +01008464}
8465
8466test "$oldincludedir" != NONE && \
8467test "$oldincludedir" != "/usr/include" && \
8468test -d "$oldincludedir" && {
micky3879b9f5e72025-07-08 18:04:53 -04008469 test -d "$oldincludedir" && cf_search="$cf_search $oldincludedir"
8470 test -d "$oldincludedir/$cf_ncuhdr_root" && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
Steve Kondikae271bc2015-11-15 02:50:53 +01008471}
8472
8473cf_search="$cf_search $cf_header_path_list"
8474
micky3879b9f5e72025-07-08 18:04:53 -04008475 test -n "$verbose" && echo "search path $cf_search"
Steve Kondikae271bc2015-11-15 02:50:53 +01008476 cf_save2_CPPFLAGS="$CPPFLAGS"
8477 for cf_incdir in $cf_search
8478 do
8479
8480if test -n "$cf_incdir" ; then
8481 for cf_add_incdir in $cf_incdir
8482 do
micky3879b9f5e72025-07-08 18:04:53 -04008483 while test "$cf_add_incdir" != /usr/include
Steve Kondikae271bc2015-11-15 02:50:53 +01008484 do
micky3879b9f5e72025-07-08 18:04:53 -04008485 if test -d "$cf_add_incdir"
Steve Kondikae271bc2015-11-15 02:50:53 +01008486 then
8487 cf_have_incdir=no
8488 if test -n "$CFLAGS$CPPFLAGS" ; then
8489 # a loop is needed to ensure we can add subdirs of existing dirs
8490 for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
8491 if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
8492 cf_have_incdir=yes; break
8493 fi
8494 done
8495 fi
8496
8497 if test "$cf_have_incdir" = no ; then
8498 if test "$cf_add_incdir" = /usr/local/include ; then
8499 if test "$GCC" = yes
8500 then
8501 cf_save_CPPFLAGS=$CPPFLAGS
micky3879b9f5e72025-07-08 18:04:53 -04008502
8503 test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
8504 CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
8505
8506 cat >"conftest.$ac_ext" <<_ACEOF
8507#line 8507 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +01008508#include "confdefs.h"
8509#include <stdio.h>
8510int
micky3879b9f5e72025-07-08 18:04:53 -04008511main (void)
Steve Kondikae271bc2015-11-15 02:50:53 +01008512{
8513printf("Hello")
8514 ;
8515 return 0;
8516}
8517_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -04008518rm -f "conftest.$ac_objext"
8519if { (eval echo "$as_me:8519: \"$ac_compile\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01008520 (eval $ac_compile) 2>&5
8521 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -04008522 echo "$as_me:8522: \$? = $ac_status" >&5
8523 (exit "$ac_status"); } &&
8524 { ac_try='test -s "conftest.$ac_objext"'
8525 { (eval echo "$as_me:8525: \"$ac_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01008526 (eval $ac_try) 2>&5
8527 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -04008528 echo "$as_me:8528: \$? = $ac_status" >&5
8529 (exit "$ac_status"); }; }; then
Steve Kondikae271bc2015-11-15 02:50:53 +01008530 :
8531else
8532 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -04008533cat "conftest.$ac_ext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01008534cf_have_incdir=yes
8535fi
micky3879b9f5e72025-07-08 18:04:53 -04008536rm -f "conftest.$ac_objext" "conftest.$ac_ext"
Steve Kondikae271bc2015-11-15 02:50:53 +01008537 CPPFLAGS=$cf_save_CPPFLAGS
8538 fi
8539 fi
8540 fi
8541
8542 if test "$cf_have_incdir" = no ; then
8543 test -n "$verbose" && echo " adding $cf_add_incdir to include-path" 1>&6
8544
micky3879b9f5e72025-07-08 18:04:53 -04008545echo "${as_me:-configure}:8545: testing adding $cf_add_incdir to include-path ..." 1>&5
Steve Kondikae271bc2015-11-15 02:50:53 +01008546
8547 CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8548
micky3879b9f5e72025-07-08 18:04:53 -04008549 cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
Steve Kondikae271bc2015-11-15 02:50:53 +01008550 test "$cf_top_incdir" = "$cf_add_incdir" && break
8551 cf_add_incdir="$cf_top_incdir"
8552 else
8553 break
8554 fi
8555 else
8556 break
8557 fi
8558 done
8559 done
8560fi
8561
8562 for cf_header in \
8563 ncurses.h \
8564 curses.h
8565 do
8566
micky3879b9f5e72025-07-08 18:04:53 -04008567 cat >"conftest.$ac_ext" <<_ACEOF
8568#line 8568 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +01008569#include "confdefs.h"
8570
8571#include <$cf_header>
8572int
micky3879b9f5e72025-07-08 18:04:53 -04008573main (void)
Steve Kondikae271bc2015-11-15 02:50:53 +01008574{
8575
8576#ifdef NCURSES_VERSION
8577
micky3879b9f5e72025-07-08 18:04:53 -04008578printf("%s\\n", NCURSES_VERSION);
Steve Kondikae271bc2015-11-15 02:50:53 +01008579#else
8580#ifdef __NCURSES_H
micky3879b9f5e72025-07-08 18:04:53 -04008581printf("old\\n");
Steve Kondikae271bc2015-11-15 02:50:53 +01008582#else
micky3879b9f5e72025-07-08 18:04:53 -04008583 #error __NCURSES_H is not defined
Steve Kondikae271bc2015-11-15 02:50:53 +01008584#endif
8585#endif
8586
8587 ;
8588 return 0;
8589}
8590_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -04008591rm -f "conftest.$ac_objext"
8592if { (eval echo "$as_me:8592: \"$ac_compile\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01008593 (eval $ac_compile) 2>&5
8594 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -04008595 echo "$as_me:8595: \$? = $ac_status" >&5
8596 (exit "$ac_status"); } &&
8597 { ac_try='test -s "conftest.$ac_objext"'
8598 { (eval echo "$as_me:8598: \"$ac_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01008599 (eval $ac_try) 2>&5
8600 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -04008601 echo "$as_me:8601: \$? = $ac_status" >&5
8602 (exit "$ac_status"); }; }; then
Steve Kondikae271bc2015-11-15 02:50:53 +01008603 cf_cv_ncurses_h2=$cf_header
8604
8605else
8606 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -04008607cat "conftest.$ac_ext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01008608cf_cv_ncurses_h2=no
8609fi
micky3879b9f5e72025-07-08 18:04:53 -04008610rm -f "conftest.$ac_objext" "conftest.$ac_ext"
Steve Kondikae271bc2015-11-15 02:50:53 +01008611
8612 if test "$cf_cv_ncurses_h2" != no ; then
8613 cf_cv_ncurses_h2=$cf_incdir/$cf_header
micky3879b9f5e72025-07-08 18:04:53 -04008614 test -n "$verbose" && echo $ECHO_N " ... found $ECHO_C" 1>&6
Steve Kondikae271bc2015-11-15 02:50:53 +01008615 break
8616 fi
8617 test -n "$verbose" && echo " ... tested $cf_incdir/$cf_header" 1>&6
8618 done
8619 CPPFLAGS="$cf_save2_CPPFLAGS"
8620 test "$cf_cv_ncurses_h2" != no && break
8621 done
micky3879b9f5e72025-07-08 18:04:53 -04008622 test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:8622: error: not found" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01008623echo "$as_me: error: not found" >&2;}
8624 { (exit 1); exit 1; }; }
8625
8626fi
micky3879b9f5e72025-07-08 18:04:53 -04008627echo "$as_me:8627: result: $cf_cv_ncurses_h2" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01008628echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
8629
micky3879b9f5e72025-07-08 18:04:53 -04008630 cf_1st_incdir=`echo "$cf_cv_ncurses_h2" | sed -e 's%/[^/]*$%%'`
8631 cf_cv_ncurses_header="`basename "$cf_cv_ncurses_h2"`"
8632 if test "`basename "$cf_1st_incdir"`" = "$cf_ncuhdr_root" ; then
8633 cf_cv_ncurses_header="$cf_ncuhdr_root/$cf_cv_ncurses_header"
Steve Kondikae271bc2015-11-15 02:50:53 +01008634 fi
8635
8636if test -n "$cf_1st_incdir" ; then
8637 for cf_add_incdir in $cf_1st_incdir
8638 do
micky3879b9f5e72025-07-08 18:04:53 -04008639 while test "$cf_add_incdir" != /usr/include
Steve Kondikae271bc2015-11-15 02:50:53 +01008640 do
micky3879b9f5e72025-07-08 18:04:53 -04008641 if test -d "$cf_add_incdir"
Steve Kondikae271bc2015-11-15 02:50:53 +01008642 then
8643 cf_have_incdir=no
8644 if test -n "$CFLAGS$CPPFLAGS" ; then
8645 # a loop is needed to ensure we can add subdirs of existing dirs
8646 for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
8647 if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
8648 cf_have_incdir=yes; break
8649 fi
8650 done
8651 fi
8652
8653 if test "$cf_have_incdir" = no ; then
8654 if test "$cf_add_incdir" = /usr/local/include ; then
8655 if test "$GCC" = yes
8656 then
8657 cf_save_CPPFLAGS=$CPPFLAGS
micky3879b9f5e72025-07-08 18:04:53 -04008658
8659 test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
8660 CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
8661
8662 cat >"conftest.$ac_ext" <<_ACEOF
8663#line 8663 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +01008664#include "confdefs.h"
8665#include <stdio.h>
8666int
micky3879b9f5e72025-07-08 18:04:53 -04008667main (void)
Steve Kondikae271bc2015-11-15 02:50:53 +01008668{
8669printf("Hello")
8670 ;
8671 return 0;
8672}
8673_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -04008674rm -f "conftest.$ac_objext"
8675if { (eval echo "$as_me:8675: \"$ac_compile\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01008676 (eval $ac_compile) 2>&5
8677 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -04008678 echo "$as_me:8678: \$? = $ac_status" >&5
8679 (exit "$ac_status"); } &&
8680 { ac_try='test -s "conftest.$ac_objext"'
8681 { (eval echo "$as_me:8681: \"$ac_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01008682 (eval $ac_try) 2>&5
8683 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -04008684 echo "$as_me:8684: \$? = $ac_status" >&5
8685 (exit "$ac_status"); }; }; then
Steve Kondikae271bc2015-11-15 02:50:53 +01008686 :
8687else
8688 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -04008689cat "conftest.$ac_ext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01008690cf_have_incdir=yes
8691fi
micky3879b9f5e72025-07-08 18:04:53 -04008692rm -f "conftest.$ac_objext" "conftest.$ac_ext"
Steve Kondikae271bc2015-11-15 02:50:53 +01008693 CPPFLAGS=$cf_save_CPPFLAGS
8694 fi
8695 fi
8696 fi
8697
8698 if test "$cf_have_incdir" = no ; then
8699 test -n "$verbose" && echo " adding $cf_add_incdir to include-path" 1>&6
8700
micky3879b9f5e72025-07-08 18:04:53 -04008701echo "${as_me:-configure}:8701: testing adding $cf_add_incdir to include-path ..." 1>&5
Steve Kondikae271bc2015-11-15 02:50:53 +01008702
8703 CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8704
micky3879b9f5e72025-07-08 18:04:53 -04008705 cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
Steve Kondikae271bc2015-11-15 02:50:53 +01008706 test "$cf_top_incdir" = "$cf_add_incdir" && break
8707 cf_add_incdir="$cf_top_incdir"
8708 else
8709 break
8710 fi
8711 else
8712 break
8713 fi
8714 done
8715 done
8716fi
8717
8718fi
8719
8720# Set definitions to allow ifdef'ing for ncurses.h
8721
micky3879b9f5e72025-07-08 18:04:53 -04008722case "$cf_cv_ncurses_header" in
Steve Kondikae271bc2015-11-15 02:50:53 +01008723(*ncurses.h)
8724
8725cat >>confdefs.h <<\EOF
8726#define HAVE_NCURSES_H 1
8727EOF
8728
8729 ;;
8730esac
8731
micky3879b9f5e72025-07-08 18:04:53 -04008732case "$cf_cv_ncurses_header" in
Steve Kondikae271bc2015-11-15 02:50:53 +01008733(ncurses/curses.h|ncurses/ncurses.h)
8734
8735cat >>confdefs.h <<\EOF
8736#define HAVE_NCURSES_NCURSES_H 1
8737EOF
8738
8739 ;;
8740(ncursesw/curses.h|ncursesw/ncurses.h)
8741
8742cat >>confdefs.h <<\EOF
8743#define HAVE_NCURSESW_NCURSES_H 1
8744EOF
8745
8746 ;;
8747esac
8748
micky3879b9f5e72025-07-08 18:04:53 -04008749echo "$as_me:8749: checking for terminfo header" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01008750echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
8751if test "${cf_cv_term_header+set}" = set; then
8752 echo $ECHO_N "(cached) $ECHO_C" >&6
8753else
8754
micky3879b9f5e72025-07-08 18:04:53 -04008755case "${cf_cv_ncurses_header}" in
Steve Kondikae271bc2015-11-15 02:50:53 +01008756(*/ncurses.h|*/ncursesw.h)
8757 cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
8758 ;;
8759(*)
8760 cf_term_header=term.h
8761 ;;
8762esac
8763
8764for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
8765do
micky3879b9f5e72025-07-08 18:04:53 -04008766cat >"conftest.$ac_ext" <<_ACEOF
8767#line 8767 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +01008768#include "confdefs.h"
8769#include <stdio.h>
8770#include <${cf_cv_ncurses_header:-curses.h}>
8771#include <$cf_test>
8772
8773int
micky3879b9f5e72025-07-08 18:04:53 -04008774main (void)
Steve Kondikae271bc2015-11-15 02:50:53 +01008775{
micky3879b9f5e72025-07-08 18:04:53 -04008776int x = auto_left_margin; (void)x
Steve Kondikae271bc2015-11-15 02:50:53 +01008777 ;
8778 return 0;
8779}
8780_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -04008781rm -f "conftest.$ac_objext"
8782if { (eval echo "$as_me:8782: \"$ac_compile\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01008783 (eval $ac_compile) 2>&5
8784 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -04008785 echo "$as_me:8785: \$? = $ac_status" >&5
8786 (exit "$ac_status"); } &&
8787 { ac_try='test -s "conftest.$ac_objext"'
8788 { (eval echo "$as_me:8788: \"$ac_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01008789 (eval $ac_try) 2>&5
8790 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -04008791 echo "$as_me:8791: \$? = $ac_status" >&5
8792 (exit "$ac_status"); }; }; then
Steve Kondikae271bc2015-11-15 02:50:53 +01008793
8794 cf_cv_term_header="$cf_test"
8795else
8796 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -04008797cat "conftest.$ac_ext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01008798
8799 cf_cv_term_header=unknown
8800
8801fi
micky3879b9f5e72025-07-08 18:04:53 -04008802rm -f "conftest.$ac_objext" "conftest.$ac_ext"
Steve Kondikae271bc2015-11-15 02:50:53 +01008803 test "$cf_cv_term_header" != unknown && break
8804done
8805
8806fi
micky3879b9f5e72025-07-08 18:04:53 -04008807echo "$as_me:8807: result: $cf_cv_term_header" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01008808echo "${ECHO_T}$cf_cv_term_header" >&6
8809
8810# Set definitions to allow ifdef'ing to accommodate subdirectories
8811
micky3879b9f5e72025-07-08 18:04:53 -04008812case "$cf_cv_term_header" in
Steve Kondikae271bc2015-11-15 02:50:53 +01008813(*term.h)
8814
8815cat >>confdefs.h <<\EOF
8816#define HAVE_TERM_H 1
8817EOF
8818
8819 ;;
8820esac
8821
micky3879b9f5e72025-07-08 18:04:53 -04008822case "$cf_cv_term_header" in
Steve Kondikae271bc2015-11-15 02:50:53 +01008823(ncurses/term.h)
8824
8825cat >>confdefs.h <<\EOF
8826#define HAVE_NCURSES_TERM_H 1
8827EOF
8828
8829 ;;
8830(ncursesw/term.h)
8831
8832cat >>confdefs.h <<\EOF
8833#define HAVE_NCURSESW_TERM_H 1
8834EOF
8835
8836 ;;
8837esac
8838
8839# some applications need this, but should check for NCURSES_VERSION
8840
8841cat >>confdefs.h <<\EOF
8842#define NCURSES 1
8843EOF
8844
micky3879b9f5e72025-07-08 18:04:53 -04008845echo "$as_me:8845: checking for ncurses version" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01008846echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
8847if test "${cf_cv_ncurses_version+set}" = set; then
8848 echo $ECHO_N "(cached) $ECHO_C" >&6
8849else
8850
8851 cf_cv_ncurses_version=no
8852 cf_tempfile=out$$
micky3879b9f5e72025-07-08 18:04:53 -04008853 rm -f "$cf_tempfile"
Steve Kondikae271bc2015-11-15 02:50:53 +01008854 if test "$cross_compiling" = yes; then
8855
8856 # This will not work if the preprocessor splits the line after the
8857 # Autoconf token. The 'unproto' program does that.
micky3879b9f5e72025-07-08 18:04:53 -04008858 cat > "conftest.$ac_ext" <<EOF
Steve Kondikae271bc2015-11-15 02:50:53 +01008859#include <${cf_cv_ncurses_header:-curses.h}>
8860#undef Autoconf
8861#ifdef NCURSES_VERSION
8862Autoconf NCURSES_VERSION
8863#else
8864#ifdef __NCURSES_H
8865Autoconf "old"
8866#endif
8867;
8868#endif
8869EOF
8870 cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
micky3879b9f5e72025-07-08 18:04:53 -04008871 { (eval echo "$as_me:8871: \"$cf_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01008872 (eval $cf_try) 2>&5
8873 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -04008874 echo "$as_me:8874: \$? = $ac_status" >&5
8875 (exit "$ac_status"); }
Steve Kondikae271bc2015-11-15 02:50:53 +01008876 if test -f conftest.out ; then
micky3879b9f5e72025-07-08 18:04:53 -04008877 cf_out=`sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%' conftest.out`
Steve Kondikae271bc2015-11-15 02:50:53 +01008878 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
8879 rm -f conftest.out
8880 fi
8881
8882else
micky3879b9f5e72025-07-08 18:04:53 -04008883 cat >"conftest.$ac_ext" <<_ACEOF
8884#line 8884 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +01008885#include "confdefs.h"
8886
micky3879b9f5e72025-07-08 18:04:53 -04008887$ac_includes_default
8888
Steve Kondikae271bc2015-11-15 02:50:53 +01008889#include <${cf_cv_ncurses_header:-curses.h}>
micky3879b9f5e72025-07-08 18:04:53 -04008890
8891int main(void)
Steve Kondikae271bc2015-11-15 02:50:53 +01008892{
8893 FILE *fp = fopen("$cf_tempfile", "w");
8894#ifdef NCURSES_VERSION
8895# ifdef NCURSES_VERSION_PATCH
micky3879b9f5e72025-07-08 18:04:53 -04008896 fprintf(fp, "%s.%d\\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
Steve Kondikae271bc2015-11-15 02:50:53 +01008897# else
micky3879b9f5e72025-07-08 18:04:53 -04008898 fprintf(fp, "%s\\n", NCURSES_VERSION);
Steve Kondikae271bc2015-11-15 02:50:53 +01008899# endif
8900#else
8901# ifdef __NCURSES_H
micky3879b9f5e72025-07-08 18:04:53 -04008902 fprintf(fp, "old\\n");
Steve Kondikae271bc2015-11-15 02:50:53 +01008903# else
micky3879b9f5e72025-07-08 18:04:53 -04008904 #error expected ncurses header to define __NCURSES_H
Steve Kondikae271bc2015-11-15 02:50:53 +01008905# endif
8906#endif
8907 ${cf_cv_main_return:-return}(0);
8908}
8909_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -04008910rm -f "conftest$ac_exeext"
8911if { (eval echo "$as_me:8911: \"$ac_link\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01008912 (eval $ac_link) 2>&5
8913 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -04008914 echo "$as_me:8914: \$? = $ac_status" >&5
8915 (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
8916 { (eval echo "$as_me:8916: \"$ac_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01008917 (eval $ac_try) 2>&5
8918 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -04008919 echo "$as_me:8919: \$? = $ac_status" >&5
8920 (exit "$ac_status"); }; }; then
Steve Kondikae271bc2015-11-15 02:50:53 +01008921
8922 cf_cv_ncurses_version=`cat $cf_tempfile`
8923else
8924 echo "$as_me: program exited with status $ac_status" >&5
8925echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -04008926cat "conftest.$ac_ext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01008927fi
micky3879b9f5e72025-07-08 18:04:53 -04008928rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
Steve Kondikae271bc2015-11-15 02:50:53 +01008929fi
micky3879b9f5e72025-07-08 18:04:53 -04008930 rm -f "$cf_tempfile"
Steve Kondikae271bc2015-11-15 02:50:53 +01008931
8932fi
micky3879b9f5e72025-07-08 18:04:53 -04008933echo "$as_me:8933: result: $cf_cv_ncurses_version" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01008934echo "${ECHO_T}$cf_cv_ncurses_version" >&6
8935test "$cf_cv_ncurses_version" = no ||
8936cat >>confdefs.h <<\EOF
8937#define NCURSES 1
8938EOF
8939
8940cf_nculib_root=ncursesw
8941 # This works, except for the special case where we find gpm, but
8942 # ncurses is in a nonstandard location via $LIBS, and we really want
8943 # to link gpm.
8944cf_ncurses_LIBS=""
8945cf_ncurses_SAVE="$LIBS"
micky3879b9f5e72025-07-08 18:04:53 -04008946echo "$as_me:8946: checking for Gpm_Open in -lgpm" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01008947echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
8948if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
8949 echo $ECHO_N "(cached) $ECHO_C" >&6
8950else
8951 ac_check_lib_save_LIBS=$LIBS
8952LIBS="-lgpm $LIBS"
micky3879b9f5e72025-07-08 18:04:53 -04008953cat >"conftest.$ac_ext" <<_ACEOF
8954#line 8954 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +01008955#include "confdefs.h"
8956
8957/* Override any gcc2 internal prototype to avoid an error. */
8958#ifdef __cplusplus
8959extern "C"
8960#endif
8961/* We use char because int might match the return type of a gcc2
8962 builtin and then its argument prototype would still apply. */
micky3879b9f5e72025-07-08 18:04:53 -04008963char Gpm_Open (void);
Steve Kondikae271bc2015-11-15 02:50:53 +01008964int
micky3879b9f5e72025-07-08 18:04:53 -04008965main (void)
Steve Kondikae271bc2015-11-15 02:50:53 +01008966{
8967Gpm_Open ();
8968 ;
8969 return 0;
8970}
8971_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -04008972rm -f "conftest.$ac_objext" "conftest$ac_exeext"
8973if { (eval echo "$as_me:8973: \"$ac_link\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01008974 (eval $ac_link) 2>&5
8975 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -04008976 echo "$as_me:8976: \$? = $ac_status" >&5
8977 (exit "$ac_status"); } &&
8978 { ac_try='test -s "conftest$ac_exeext"'
8979 { (eval echo "$as_me:8979: \"$ac_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01008980 (eval $ac_try) 2>&5
8981 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -04008982 echo "$as_me:8982: \$? = $ac_status" >&5
8983 (exit "$ac_status"); }; }; then
Steve Kondikae271bc2015-11-15 02:50:53 +01008984 ac_cv_lib_gpm_Gpm_Open=yes
8985else
8986 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -04008987cat "conftest.$ac_ext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01008988ac_cv_lib_gpm_Gpm_Open=no
8989fi
micky3879b9f5e72025-07-08 18:04:53 -04008990rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
Steve Kondikae271bc2015-11-15 02:50:53 +01008991LIBS=$ac_check_lib_save_LIBS
8992fi
micky3879b9f5e72025-07-08 18:04:53 -04008993echo "$as_me:8993: result: $ac_cv_lib_gpm_Gpm_Open" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01008994echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
micky3879b9f5e72025-07-08 18:04:53 -04008995if test "$ac_cv_lib_gpm_Gpm_Open" = yes; then
8996 echo "$as_me:8996: checking for initscr in -lgpm" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01008997echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
8998if test "${ac_cv_lib_gpm_initscr+set}" = set; then
8999 echo $ECHO_N "(cached) $ECHO_C" >&6
9000else
9001 ac_check_lib_save_LIBS=$LIBS
9002LIBS="-lgpm $LIBS"
micky3879b9f5e72025-07-08 18:04:53 -04009003cat >"conftest.$ac_ext" <<_ACEOF
9004#line 9004 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +01009005#include "confdefs.h"
9006
9007/* Override any gcc2 internal prototype to avoid an error. */
9008#ifdef __cplusplus
9009extern "C"
9010#endif
9011/* We use char because int might match the return type of a gcc2
9012 builtin and then its argument prototype would still apply. */
micky3879b9f5e72025-07-08 18:04:53 -04009013char initscr (void);
Steve Kondikae271bc2015-11-15 02:50:53 +01009014int
micky3879b9f5e72025-07-08 18:04:53 -04009015main (void)
Steve Kondikae271bc2015-11-15 02:50:53 +01009016{
9017initscr ();
9018 ;
9019 return 0;
9020}
9021_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -04009022rm -f "conftest.$ac_objext" "conftest$ac_exeext"
9023if { (eval echo "$as_me:9023: \"$ac_link\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01009024 (eval $ac_link) 2>&5
9025 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -04009026 echo "$as_me:9026: \$? = $ac_status" >&5
9027 (exit "$ac_status"); } &&
9028 { ac_try='test -s "conftest$ac_exeext"'
9029 { (eval echo "$as_me:9029: \"$ac_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01009030 (eval $ac_try) 2>&5
9031 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -04009032 echo "$as_me:9032: \$? = $ac_status" >&5
9033 (exit "$ac_status"); }; }; then
Steve Kondikae271bc2015-11-15 02:50:53 +01009034 ac_cv_lib_gpm_initscr=yes
9035else
9036 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -04009037cat "conftest.$ac_ext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01009038ac_cv_lib_gpm_initscr=no
9039fi
micky3879b9f5e72025-07-08 18:04:53 -04009040rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
Steve Kondikae271bc2015-11-15 02:50:53 +01009041LIBS=$ac_check_lib_save_LIBS
9042fi
micky3879b9f5e72025-07-08 18:04:53 -04009043echo "$as_me:9043: result: $ac_cv_lib_gpm_initscr" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01009044echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
micky3879b9f5e72025-07-08 18:04:53 -04009045if test "$ac_cv_lib_gpm_initscr" = yes; then
Steve Kondikae271bc2015-11-15 02:50:53 +01009046 LIBS="$cf_ncurses_SAVE"
9047else
9048 cf_ncurses_LIBS="-lgpm"
9049fi
9050
9051fi
9052
micky3879b9f5e72025-07-08 18:04:53 -04009053case "$host_os" in
Steve Kondikae271bc2015-11-15 02:50:53 +01009054(freebsd*)
9055 # This is only necessary if you are linking against an obsolete
micky3879b9f5e72025-07-08 18:04:53 -04009056 # version of ncurses (but it should do no harm, since it is static).
Steve Kondikae271bc2015-11-15 02:50:53 +01009057 if test "$cf_nculib_root" = ncurses ; then
micky3879b9f5e72025-07-08 18:04:53 -04009058 echo "$as_me:9058: checking for tgoto in -lmytinfo" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01009059echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
9060if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
9061 echo $ECHO_N "(cached) $ECHO_C" >&6
9062else
9063 ac_check_lib_save_LIBS=$LIBS
9064LIBS="-lmytinfo $LIBS"
micky3879b9f5e72025-07-08 18:04:53 -04009065cat >"conftest.$ac_ext" <<_ACEOF
9066#line 9066 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +01009067#include "confdefs.h"
9068
9069/* Override any gcc2 internal prototype to avoid an error. */
9070#ifdef __cplusplus
9071extern "C"
9072#endif
9073/* We use char because int might match the return type of a gcc2
9074 builtin and then its argument prototype would still apply. */
micky3879b9f5e72025-07-08 18:04:53 -04009075char tgoto (void);
Steve Kondikae271bc2015-11-15 02:50:53 +01009076int
micky3879b9f5e72025-07-08 18:04:53 -04009077main (void)
Steve Kondikae271bc2015-11-15 02:50:53 +01009078{
9079tgoto ();
9080 ;
9081 return 0;
9082}
9083_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -04009084rm -f "conftest.$ac_objext" "conftest$ac_exeext"
9085if { (eval echo "$as_me:9085: \"$ac_link\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01009086 (eval $ac_link) 2>&5
9087 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -04009088 echo "$as_me:9088: \$? = $ac_status" >&5
9089 (exit "$ac_status"); } &&
9090 { ac_try='test -s "conftest$ac_exeext"'
9091 { (eval echo "$as_me:9091: \"$ac_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01009092 (eval $ac_try) 2>&5
9093 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -04009094 echo "$as_me:9094: \$? = $ac_status" >&5
9095 (exit "$ac_status"); }; }; then
Steve Kondikae271bc2015-11-15 02:50:53 +01009096 ac_cv_lib_mytinfo_tgoto=yes
9097else
9098 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -04009099cat "conftest.$ac_ext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01009100ac_cv_lib_mytinfo_tgoto=no
9101fi
micky3879b9f5e72025-07-08 18:04:53 -04009102rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
Steve Kondikae271bc2015-11-15 02:50:53 +01009103LIBS=$ac_check_lib_save_LIBS
9104fi
micky3879b9f5e72025-07-08 18:04:53 -04009105echo "$as_me:9105: result: $ac_cv_lib_mytinfo_tgoto" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01009106echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
micky3879b9f5e72025-07-08 18:04:53 -04009107if test "$ac_cv_lib_mytinfo_tgoto" = yes; then
Steve Kondikae271bc2015-11-15 02:50:53 +01009108 cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
9109fi
9110
9111 fi
9112 ;;
9113esac
9114
micky3879b9f5e72025-07-08 18:04:53 -04009115cf_add_libs="$LIBS"
9116# reverse order
9117cf_add_0lib=
9118for cf_add_1lib in $cf_ncurses_LIBS; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
9119# filter duplicates
9120for cf_add_1lib in $cf_add_0lib; do
9121 for cf_add_2lib in $cf_add_libs; do
9122 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
Steve Kondikae271bc2015-11-15 02:50:53 +01009123 cf_add_1lib=
9124 break
9125 fi
9126 done
micky3879b9f5e72025-07-08 18:04:53 -04009127 test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
Steve Kondikae271bc2015-11-15 02:50:53 +01009128done
9129LIBS="$cf_add_libs"
9130
micky3879b9f5e72025-07-08 18:04:53 -04009131if test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no"
Steve Kondikae271bc2015-11-15 02:50:53 +01009132then
9133
micky3879b9f5e72025-07-08 18:04:53 -04009134cf_add_libs="$LIBS"
9135# reverse order
9136cf_add_0lib=
9137for cf_add_1lib in -l$cf_nculib_root; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
9138# filter duplicates
9139for cf_add_1lib in $cf_add_0lib; do
9140 for cf_add_2lib in $cf_add_libs; do
9141 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
Steve Kondikae271bc2015-11-15 02:50:53 +01009142 cf_add_1lib=
9143 break
9144 fi
9145 done
micky3879b9f5e72025-07-08 18:04:53 -04009146 test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
Steve Kondikae271bc2015-11-15 02:50:53 +01009147done
9148LIBS="$cf_add_libs"
9149
9150else
9151
micky3879b9f5e72025-07-08 18:04:53 -04009152 eval 'cf_cv_have_lib_'"$cf_nculib_root"'=no'
Steve Kondikae271bc2015-11-15 02:50:53 +01009153 cf_libdir=""
micky3879b9f5e72025-07-08 18:04:53 -04009154 echo "$as_me:9154: checking for initscr" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01009155echo $ECHO_N "checking for initscr... $ECHO_C" >&6
9156if test "${ac_cv_func_initscr+set}" = set; then
9157 echo $ECHO_N "(cached) $ECHO_C" >&6
9158else
micky3879b9f5e72025-07-08 18:04:53 -04009159 cat >"conftest.$ac_ext" <<_ACEOF
9160#line 9160 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +01009161#include "confdefs.h"
micky3879b9f5e72025-07-08 18:04:53 -04009162#define initscr autoconf_temporary
9163#include <limits.h> /* least-intrusive standard header which defines gcc2 __stub macros */
9164#undef initscr
9165
Steve Kondikae271bc2015-11-15 02:50:53 +01009166#ifdef __cplusplus
9167extern "C"
9168#endif
micky3879b9f5e72025-07-08 18:04:53 -04009169
Steve Kondikae271bc2015-11-15 02:50:53 +01009170/* We use char because int might match the return type of a gcc2
9171 builtin and then its argument prototype would still apply. */
micky3879b9f5e72025-07-08 18:04:53 -04009172char initscr (void);
Steve Kondikae271bc2015-11-15 02:50:53 +01009173
9174int
micky3879b9f5e72025-07-08 18:04:53 -04009175main (void)
Steve Kondikae271bc2015-11-15 02:50:53 +01009176{
micky3879b9f5e72025-07-08 18:04:53 -04009177
9178/* The GNU C library defines stubs for functions which it implements
Steve Kondikae271bc2015-11-15 02:50:53 +01009179 to always fail with ENOSYS. Some functions are actually named
9180 something starting with __ and the normal name is an alias. */
9181#if defined (__stub_initscr) || defined (__stub___initscr)
micky3879b9f5e72025-07-08 18:04:53 -04009182#error found stub for initscr
Steve Kondikae271bc2015-11-15 02:50:53 +01009183#endif
9184
micky3879b9f5e72025-07-08 18:04:53 -04009185 return initscr ();
Steve Kondikae271bc2015-11-15 02:50:53 +01009186 ;
9187 return 0;
9188}
9189_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -04009190rm -f "conftest.$ac_objext" "conftest$ac_exeext"
9191if { (eval echo "$as_me:9191: \"$ac_link\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01009192 (eval $ac_link) 2>&5
9193 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -04009194 echo "$as_me:9194: \$? = $ac_status" >&5
9195 (exit "$ac_status"); } &&
9196 { ac_try='test -s "conftest$ac_exeext"'
9197 { (eval echo "$as_me:9197: \"$ac_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01009198 (eval $ac_try) 2>&5
9199 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -04009200 echo "$as_me:9200: \$? = $ac_status" >&5
9201 (exit "$ac_status"); }; }; then
Steve Kondikae271bc2015-11-15 02:50:53 +01009202 ac_cv_func_initscr=yes
9203else
9204 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -04009205cat "conftest.$ac_ext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01009206ac_cv_func_initscr=no
9207fi
micky3879b9f5e72025-07-08 18:04:53 -04009208rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
Steve Kondikae271bc2015-11-15 02:50:53 +01009209fi
micky3879b9f5e72025-07-08 18:04:53 -04009210echo "$as_me:9210: result: $ac_cv_func_initscr" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01009211echo "${ECHO_T}$ac_cv_func_initscr" >&6
micky3879b9f5e72025-07-08 18:04:53 -04009212if test "$ac_cv_func_initscr" = yes; then
9213 eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
Steve Kondikae271bc2015-11-15 02:50:53 +01009214else
9215
9216 cf_save_LIBS="$LIBS"
micky3879b9f5e72025-07-08 18:04:53 -04009217 echo "$as_me:9217: checking for initscr in -l$cf_nculib_root" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01009218echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
9219 LIBS="-l$cf_nculib_root $LIBS"
micky3879b9f5e72025-07-08 18:04:53 -04009220 cat >"conftest.$ac_ext" <<_ACEOF
9221#line 9221 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +01009222#include "confdefs.h"
9223#include <${cf_cv_ncurses_header:-curses.h}>
9224int
micky3879b9f5e72025-07-08 18:04:53 -04009225main (void)
Steve Kondikae271bc2015-11-15 02:50:53 +01009226{
9227initscr()
9228 ;
9229 return 0;
9230}
9231_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -04009232rm -f "conftest.$ac_objext" "conftest$ac_exeext"
9233if { (eval echo "$as_me:9233: \"$ac_link\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01009234 (eval $ac_link) 2>&5
9235 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -04009236 echo "$as_me:9236: \$? = $ac_status" >&5
9237 (exit "$ac_status"); } &&
9238 { ac_try='test -s "conftest$ac_exeext"'
9239 { (eval echo "$as_me:9239: \"$ac_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01009240 (eval $ac_try) 2>&5
9241 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -04009242 echo "$as_me:9242: \$? = $ac_status" >&5
9243 (exit "$ac_status"); }; }; then
9244 echo "$as_me:9244: result: yes" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01009245echo "${ECHO_T}yes" >&6
micky3879b9f5e72025-07-08 18:04:53 -04009246 eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
Steve Kondikae271bc2015-11-15 02:50:53 +01009247
9248else
9249 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -04009250cat "conftest.$ac_ext" >&5
9251echo "$as_me:9251: result: no" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01009252echo "${ECHO_T}no" >&6
9253
9254cf_search=
9255cf_library_path_list=""
9256if test -n "${LDFLAGS}${LIBS}" ; then
9257 for cf_library_path in $LDFLAGS $LIBS
9258 do
micky3879b9f5e72025-07-08 18:04:53 -04009259 case "$cf_library_path" in
Steve Kondikae271bc2015-11-15 02:50:53 +01009260 (-L*)
9261 cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
9262
9263test "x$cf_library_path" != "xNONE" && \
9264test -d "$cf_library_path" && \
9265 {
9266 test -n "$verbose" && echo " ... testing for lib-directories under $cf_library_path"
micky3879b9f5e72025-07-08 18:04:53 -04009267 test -d "$cf_library_path/lib" && cf_search="$cf_search $cf_library_path/lib"
9268 test -d "$cf_library_path/lib/$cf_nculib_root" && cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
9269 test -d "$cf_library_path/lib/$cf_nculib_root/lib" && cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
9270 test -d "$cf_library_path/$cf_nculib_root/lib" && cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
9271 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 +01009272}
9273
9274 cf_library_path_list="$cf_library_path_list $cf_search"
9275 ;;
9276 esac
9277 done
9278fi
9279
9280cf_search=
9281
9282test "x$prefix" != "xNONE" && \
9283test -d "$prefix" && \
9284 {
9285 test -n "$verbose" && echo " ... testing for lib-directories under $prefix"
micky3879b9f5e72025-07-08 18:04:53 -04009286 test -d "$prefix/lib" && cf_search="$cf_search $prefix/lib"
9287 test -d "$prefix/lib/$cf_nculib_root" && cf_search="$cf_search $prefix/lib/$cf_nculib_root"
9288 test -d "$prefix/lib/$cf_nculib_root/lib" && cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
9289 test -d "$prefix/$cf_nculib_root/lib" && cf_search="$cf_search $prefix/$cf_nculib_root/lib"
9290 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 +01009291}
9292
9293for cf_subdir_prefix in \
9294 /usr \
9295 /usr/local \
9296 /usr/pkg \
9297 /opt \
9298 /opt/local \
9299 $HOME
9300do
9301
9302test "x$cf_subdir_prefix" != "x$prefix" && \
9303test -d "$cf_subdir_prefix" && \
micky3879b9f5e72025-07-08 18:04:53 -04009304{ test -z "$prefix" || test "x$prefix" = xNONE || test "x$cf_subdir_prefix" != "x$prefix"; } && {
Steve Kondikae271bc2015-11-15 02:50:53 +01009305 test -n "$verbose" && echo " ... testing for lib-directories under $cf_subdir_prefix"
micky3879b9f5e72025-07-08 18:04:53 -04009306 test -d "$cf_subdir_prefix/lib" && cf_search="$cf_search $cf_subdir_prefix/lib"
9307 test -d "$cf_subdir_prefix/lib/$cf_nculib_root" && cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root"
9308 test -d "$cf_subdir_prefix/lib/$cf_nculib_root/lib" && cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root/lib"
9309 test -d "$cf_subdir_prefix/$cf_nculib_root/lib" && cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib"
9310 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 +01009311}
9312
9313done
9314
9315cf_search="$cf_library_path_list $cf_search"
9316
9317 for cf_libdir in $cf_search
9318 do
micky3879b9f5e72025-07-08 18:04:53 -04009319 echo "$as_me:9319: checking for -l$cf_nculib_root in $cf_libdir" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01009320echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
9321 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
micky3879b9f5e72025-07-08 18:04:53 -04009322 cat >"conftest.$ac_ext" <<_ACEOF
9323#line 9323 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +01009324#include "confdefs.h"
9325#include <${cf_cv_ncurses_header:-curses.h}>
9326int
micky3879b9f5e72025-07-08 18:04:53 -04009327main (void)
Steve Kondikae271bc2015-11-15 02:50:53 +01009328{
9329initscr()
9330 ;
9331 return 0;
9332}
9333_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -04009334rm -f "conftest.$ac_objext" "conftest$ac_exeext"
9335if { (eval echo "$as_me:9335: \"$ac_link\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01009336 (eval $ac_link) 2>&5
9337 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -04009338 echo "$as_me:9338: \$? = $ac_status" >&5
9339 (exit "$ac_status"); } &&
9340 { ac_try='test -s "conftest$ac_exeext"'
9341 { (eval echo "$as_me:9341: \"$ac_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01009342 (eval $ac_try) 2>&5
9343 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -04009344 echo "$as_me:9344: \$? = $ac_status" >&5
9345 (exit "$ac_status"); }; }; then
9346 echo "$as_me:9346: result: yes" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01009347echo "${ECHO_T}yes" >&6
micky3879b9f5e72025-07-08 18:04:53 -04009348 eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
Steve Kondikae271bc2015-11-15 02:50:53 +01009349 break
9350else
9351 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -04009352cat "conftest.$ac_ext" >&5
9353echo "$as_me:9353: result: no" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01009354echo "${ECHO_T}no" >&6
9355 LIBS="$cf_save_LIBS"
9356fi
micky3879b9f5e72025-07-08 18:04:53 -04009357rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
Steve Kondikae271bc2015-11-15 02:50:53 +01009358 done
9359
9360fi
micky3879b9f5e72025-07-08 18:04:53 -04009361rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
Steve Kondikae271bc2015-11-15 02:50:53 +01009362
9363fi
9364
micky3879b9f5e72025-07-08 18:04:53 -04009365eval 'cf_found_library="$cf_cv_have_lib_'"$cf_nculib_root"\"
Steve Kondikae271bc2015-11-15 02:50:53 +01009366
micky3879b9f5e72025-07-08 18:04:53 -04009367if test "$cf_found_library" = no ; then
9368 { { echo "$as_me:9368: error: Cannot link $cf_nculib_root library" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01009369echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
9370 { (exit 1); exit 1; }; }
9371fi
9372
9373fi
9374
9375if test -n "$cf_ncurses_LIBS" ; then
micky3879b9f5e72025-07-08 18:04:53 -04009376 echo "$as_me:9376: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01009377echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
9378 cf_ncurses_SAVE="$LIBS"
9379 for p in $cf_ncurses_LIBS ; do
micky3879b9f5e72025-07-08 18:04:53 -04009380 q=`echo "$LIBS" | sed -e "s%$p %%" -e "s%$p$%%"`
Steve Kondikae271bc2015-11-15 02:50:53 +01009381 if test "$q" != "$LIBS" ; then
9382 LIBS="$q"
9383 fi
9384 done
micky3879b9f5e72025-07-08 18:04:53 -04009385 cat >"conftest.$ac_ext" <<_ACEOF
9386#line 9386 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +01009387#include "confdefs.h"
9388#include <${cf_cv_ncurses_header:-curses.h}>
9389int
micky3879b9f5e72025-07-08 18:04:53 -04009390main (void)
Steve Kondikae271bc2015-11-15 02:50:53 +01009391{
micky3879b9f5e72025-07-08 18:04:53 -04009392initscr(); mousemask(0,0); tigetstr((char *)0);
Steve Kondikae271bc2015-11-15 02:50:53 +01009393 ;
9394 return 0;
9395}
9396_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -04009397rm -f "conftest.$ac_objext" "conftest$ac_exeext"
9398if { (eval echo "$as_me:9398: \"$ac_link\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01009399 (eval $ac_link) 2>&5
9400 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -04009401 echo "$as_me:9401: \$? = $ac_status" >&5
9402 (exit "$ac_status"); } &&
9403 { ac_try='test -s "conftest$ac_exeext"'
9404 { (eval echo "$as_me:9404: \"$ac_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01009405 (eval $ac_try) 2>&5
9406 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -04009407 echo "$as_me:9407: \$? = $ac_status" >&5
9408 (exit "$ac_status"); }; }; then
9409 echo "$as_me:9409: result: yes" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01009410echo "${ECHO_T}yes" >&6
9411else
9412 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -04009413cat "conftest.$ac_ext" >&5
9414echo "$as_me:9414: result: no" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01009415echo "${ECHO_T}no" >&6
9416 LIBS="$cf_ncurses_SAVE"
9417fi
micky3879b9f5e72025-07-08 18:04:53 -04009418rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
Steve Kondikae271bc2015-11-15 02:50:53 +01009419fi
9420
9421cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
9422
9423cat >>confdefs.h <<EOF
9424#define $cf_nculib_ROOT 1
9425EOF
9426
9427 fi
9428else
9429 NCURSES_CONFIG=none
9430fi
9431
9432else
9433
9434cf_ncuconfig_root=ncurses
9435cf_have_ncuconfig=no
9436
9437if test "x${PKG_CONFIG:=none}" != xnone; then
micky3879b9f5e72025-07-08 18:04:53 -04009438 echo "$as_me:9438: checking pkg-config for $cf_ncuconfig_root" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01009439echo $ECHO_N "checking pkg-config for $cf_ncuconfig_root... $ECHO_C" >&6
9440 if "$PKG_CONFIG" --exists $cf_ncuconfig_root ; then
micky3879b9f5e72025-07-08 18:04:53 -04009441 echo "$as_me:9441: result: yes" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01009442echo "${ECHO_T}yes" >&6
9443
micky3879b9f5e72025-07-08 18:04:53 -04009444 echo "$as_me:9444: checking if the $cf_ncuconfig_root package files work" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01009445echo $ECHO_N "checking if the $cf_ncuconfig_root package files work... $ECHO_C" >&6
9446 cf_have_ncuconfig=unknown
9447
micky3879b9f5e72025-07-08 18:04:53 -04009448 cf_save_CFLAGS="$CFLAGS"
Steve Kondikae271bc2015-11-15 02:50:53 +01009449 cf_save_CPPFLAGS="$CPPFLAGS"
9450 cf_save_LIBS="$LIBS"
9451
micky3879b9f5e72025-07-08 18:04:53 -04009452 cf_pkg_cflags="`$PKG_CONFIG --cflags $cf_ncuconfig_root`"
9453 cf_pkg_libs="`$PKG_CONFIG --libs $cf_ncuconfig_root`"
Steve Kondikae271bc2015-11-15 02:50:53 +01009454
micky3879b9f5e72025-07-08 18:04:53 -04009455 # while -W for passing linker flags is prevalent, it is not "standard".
9456 # At least one wrapper for c89/c99 (in Apple's xcode) has its own
9457 # incompatible _and_ non-standard -W option which gives an error. Work
9458 # around that pitfall.
9459 case "x${CC}@@${cf_pkg_libs}@${cf_pkg_cflags}" in
9460 (x*c[89]9@@*-W*)
9461
9462cf_fix_cppflags=no
9463cf_new_cflags=
9464cf_new_cppflags=
9465cf_new_extra_cppflags=
9466
9467for cf_add_cflags in $cf_pkg_cflags
Steve Kondikae271bc2015-11-15 02:50:53 +01009468do
micky3879b9f5e72025-07-08 18:04:53 -04009469case "$cf_fix_cppflags" in
9470(no)
9471 case "$cf_add_cflags" in
9472 (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
9473 case "$cf_add_cflags" in
9474 (-D*)
9475 cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
9476
9477 test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
9478 && test -z "${cf_tst_cflags}" \
9479 && cf_fix_cppflags=yes
9480
9481 if test "$cf_fix_cppflags" = yes ; then
9482
9483 test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9484 cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9485
9486 continue
9487 elif test "${cf_tst_cflags}" = "\"'" ; then
9488
9489 test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9490 cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9491
9492 continue
9493 fi
9494 ;;
9495 esac
9496 case "$CPPFLAGS" in
9497 (*$cf_add_cflags)
9498 ;;
9499 (*)
9500 case "$cf_add_cflags" in
9501 (-D*)
9502 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
9503
9504CPPFLAGS=`echo "$CPPFLAGS" | \
9505 sed -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?[ ]/ /g' \
9506 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?$//g'`
9507
9508 ;;
9509 esac
9510
9511 test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
9512 cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
9513
9514 ;;
9515 esac
9516 ;;
9517 (*)
9518
9519 test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
9520 cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
9521
9522 ;;
9523 esac
9524 ;;
9525(yes)
9526
9527 test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9528 cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9529
9530 cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
9531
9532 test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
9533 && test -z "${cf_tst_cflags}" \
9534 && cf_fix_cppflags=no
9535 ;;
9536esac
9537done
9538
9539if test -n "$cf_new_cflags" ; then
9540
9541 test -n "$CFLAGS" && CFLAGS="$CFLAGS "
9542 CFLAGS="${CFLAGS}$cf_new_cflags"
9543
9544fi
9545
9546if test -n "$cf_new_cppflags" ; then
9547
9548 test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
9549 CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
9550
9551fi
9552
9553if test -n "$cf_new_extra_cppflags" ; then
9554
9555 test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
9556 EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
9557
9558fi
9559
9560cf_add_libs="$LIBS"
9561# reverse order
9562cf_add_0lib=
9563for cf_add_1lib in $cf_pkg_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
9564# filter duplicates
9565for cf_add_1lib in $cf_add_0lib; do
9566 for cf_add_2lib in $cf_add_libs; do
9567 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
Steve Kondikae271bc2015-11-15 02:50:53 +01009568 cf_add_1lib=
9569 break
9570 fi
9571 done
micky3879b9f5e72025-07-08 18:04:53 -04009572 test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
Steve Kondikae271bc2015-11-15 02:50:53 +01009573done
9574LIBS="$cf_add_libs"
9575
micky3879b9f5e72025-07-08 18:04:53 -04009576 cat >"conftest.$ac_ext" <<_ACEOF
9577#line 9577 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +01009578#include "confdefs.h"
9579#include <${cf_cv_ncurses_header:-curses.h}>
9580int
micky3879b9f5e72025-07-08 18:04:53 -04009581main (void)
Steve Kondikae271bc2015-11-15 02:50:53 +01009582{
micky3879b9f5e72025-07-08 18:04:53 -04009583initscr(); mousemask(0,0); tigetstr((char *)0);
Steve Kondikae271bc2015-11-15 02:50:53 +01009584 ;
9585 return 0;
9586}
9587_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -04009588rm -f "conftest.$ac_objext" "conftest$ac_exeext"
9589if { (eval echo "$as_me:9589: \"$ac_link\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01009590 (eval $ac_link) 2>&5
9591 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -04009592 echo "$as_me:9592: \$? = $ac_status" >&5
9593 (exit "$ac_status"); } &&
9594 { ac_try='test -s "conftest$ac_exeext"'
9595 { (eval echo "$as_me:9595: \"$ac_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01009596 (eval $ac_try) 2>&5
9597 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -04009598 echo "$as_me:9598: \$? = $ac_status" >&5
9599 (exit "$ac_status"); }; }; then
9600 if test "$cross_compiling" = yes; then
9601 cf_test_ncuconfig=maybe
9602else
9603 cat >"conftest.$ac_ext" <<_ACEOF
9604#line 9604 "configure"
9605#include "confdefs.h"
9606#include <${cf_cv_ncurses_header:-curses.h}>
9607 int main(void)
9608 { const char *xx = curses_version(); return (xx == 0); }
9609_ACEOF
9610rm -f "conftest$ac_exeext"
9611if { (eval echo "$as_me:9611: \"$ac_link\"") >&5
9612 (eval $ac_link) 2>&5
9613 ac_status=$?
9614 echo "$as_me:9614: \$? = $ac_status" >&5
9615 (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
9616 { (eval echo "$as_me:9616: \"$ac_try\"") >&5
9617 (eval $ac_try) 2>&5
9618 ac_status=$?
9619 echo "$as_me:9619: \$? = $ac_status" >&5
9620 (exit "$ac_status"); }; }; then
9621 cf_test_ncuconfig=yes
9622else
9623 echo "$as_me: program exited with status $ac_status" >&5
9624echo "$as_me: failed program was:" >&5
9625cat "conftest.$ac_ext" >&5
9626cf_test_ncuconfig=no
9627fi
9628rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
9629fi
9630else
9631 echo "$as_me: failed program was:" >&5
9632cat "conftest.$ac_ext" >&5
9633cf_test_ncuconfig=no
9634fi
9635rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
9636
9637 CFLAGS="$cf_save_CFLAGS"
9638 CPPFLAGS="$cf_save_CPPFLAGS"
9639 LIBS="$cf_save_LIBS"
9640
9641 if test "x$cf_test_ncuconfig" != xyes; then
9642 cf_temp=`echo "x$cf_pkg_cflags" | sed -e s/^x// -e 's/-W[^ ]*//g'`
9643 cf_pkg_cflags="$cf_temp"
9644 cf_temp=`echo "x$cf_pkg_libs" | sed -e s/^x// -e 's/-W[^ ]*//g'`
9645 cf_pkg_libs="$cf_temp"
9646 fi
9647 ;;
9648 esac
9649
9650for cf_add_cflags in $cf_pkg_cflags
9651do
9652 case "x$cf_add_cflags" in
9653 (x-[DU]*)
9654
9655cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
9656while true
9657do
9658 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'`
9659 test "$CFLAGS" != "$cf_old_cflag" || break
9660
9661 CFLAGS="$cf_old_cflag"
9662done
9663
9664cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
9665while true
9666do
9667 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'`
9668 test "$CPPFLAGS" != "$cf_old_cflag" || break
9669
9670 CPPFLAGS="$cf_old_cflag"
9671done
9672
9673 ;;
9674 esac
9675
9676cf_fix_cppflags=no
9677cf_new_cflags=
9678cf_new_cppflags=
9679cf_new_extra_cppflags=
9680
9681for cf_add_cflags in $cf_add_cflags
9682do
9683case "$cf_fix_cppflags" in
9684(no)
9685 case "$cf_add_cflags" in
9686 (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
9687 case "$cf_add_cflags" in
9688 (-D*)
9689 cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
9690
9691 test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
9692 && test -z "${cf_tst_cflags}" \
9693 && cf_fix_cppflags=yes
9694
9695 if test "$cf_fix_cppflags" = yes ; then
9696
9697 test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9698 cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9699
9700 continue
9701 elif test "${cf_tst_cflags}" = "\"'" ; then
9702
9703 test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9704 cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9705
9706 continue
9707 fi
9708 ;;
9709 esac
9710 case "$CPPFLAGS" in
9711 (*$cf_add_cflags)
9712 ;;
9713 (*)
9714 case "$cf_add_cflags" in
9715 (-D*)
9716 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
9717
9718CPPFLAGS=`echo "$CPPFLAGS" | \
9719 sed -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?[ ]/ /g' \
9720 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?$//g'`
9721
9722 ;;
9723 esac
9724
9725 test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
9726 cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
9727
9728 ;;
9729 esac
9730 ;;
9731 (*)
9732
9733 test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
9734 cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
9735
9736 ;;
9737 esac
9738 ;;
9739(yes)
9740
9741 test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9742 cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9743
9744 cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
9745
9746 test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
9747 && test -z "${cf_tst_cflags}" \
9748 && cf_fix_cppflags=no
9749 ;;
9750esac
9751done
9752
9753if test -n "$cf_new_cflags" ; then
9754
9755 test -n "$CFLAGS" && CFLAGS="$CFLAGS "
9756 CFLAGS="${CFLAGS}$cf_new_cflags"
9757
9758fi
9759
9760if test -n "$cf_new_cppflags" ; then
9761
9762 test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
9763 CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
9764
9765fi
9766
9767if test -n "$cf_new_extra_cppflags" ; then
9768
9769 test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
9770 EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
9771
9772fi
9773
9774done
9775
9776cf_add_libs="$LIBS"
9777# reverse order
9778cf_add_0lib=
9779for cf_add_1lib in $cf_pkg_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
9780# filter duplicates
9781for cf_add_1lib in $cf_add_0lib; do
9782 for cf_add_2lib in $cf_add_libs; do
9783 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
9784 cf_add_1lib=
9785 break
9786 fi
9787 done
9788 test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
9789done
9790LIBS="$cf_add_libs"
9791
9792 cat >"conftest.$ac_ext" <<_ACEOF
9793#line 9793 "configure"
9794#include "confdefs.h"
9795#include <${cf_cv_ncurses_header:-curses.h}>
9796int
9797main (void)
9798{
9799initscr(); mousemask(0,0); tigetstr((char *)0);
9800 ;
9801 return 0;
9802}
9803_ACEOF
9804rm -f "conftest.$ac_objext" "conftest$ac_exeext"
9805if { (eval echo "$as_me:9805: \"$ac_link\"") >&5
9806 (eval $ac_link) 2>&5
9807 ac_status=$?
9808 echo "$as_me:9808: \$? = $ac_status" >&5
9809 (exit "$ac_status"); } &&
9810 { ac_try='test -s "conftest$ac_exeext"'
9811 { (eval echo "$as_me:9811: \"$ac_try\"") >&5
9812 (eval $ac_try) 2>&5
9813 ac_status=$?
9814 echo "$as_me:9814: \$? = $ac_status" >&5
9815 (exit "$ac_status"); }; }; then
Steve Kondikae271bc2015-11-15 02:50:53 +01009816 if test "$cross_compiling" = yes; then
9817 cf_have_ncuconfig=maybe
9818else
micky3879b9f5e72025-07-08 18:04:53 -04009819 cat >"conftest.$ac_ext" <<_ACEOF
9820#line 9820 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +01009821#include "confdefs.h"
9822#include <${cf_cv_ncurses_header:-curses.h}>
9823 int main(void)
micky3879b9f5e72025-07-08 18:04:53 -04009824 { const char *xx = curses_version(); return (xx == 0); }
Steve Kondikae271bc2015-11-15 02:50:53 +01009825_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -04009826rm -f "conftest$ac_exeext"
9827if { (eval echo "$as_me:9827: \"$ac_link\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01009828 (eval $ac_link) 2>&5
9829 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -04009830 echo "$as_me:9830: \$? = $ac_status" >&5
9831 (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
9832 { (eval echo "$as_me:9832: \"$ac_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01009833 (eval $ac_try) 2>&5
9834 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -04009835 echo "$as_me:9835: \$? = $ac_status" >&5
9836 (exit "$ac_status"); }; }; then
Steve Kondikae271bc2015-11-15 02:50:53 +01009837 cf_have_ncuconfig=yes
9838else
9839 echo "$as_me: program exited with status $ac_status" >&5
9840echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -04009841cat "conftest.$ac_ext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01009842cf_have_ncuconfig=no
9843fi
micky3879b9f5e72025-07-08 18:04:53 -04009844rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
Steve Kondikae271bc2015-11-15 02:50:53 +01009845fi
9846else
9847 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -04009848cat "conftest.$ac_ext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01009849cf_have_ncuconfig=no
9850fi
micky3879b9f5e72025-07-08 18:04:53 -04009851rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
9852 echo "$as_me:9852: result: $cf_have_ncuconfig" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01009853echo "${ECHO_T}$cf_have_ncuconfig" >&6
9854 test "$cf_have_ncuconfig" = maybe && cf_have_ncuconfig=yes
9855 if test "$cf_have_ncuconfig" != "yes"
9856 then
9857 CPPFLAGS="$cf_save_CPPFLAGS"
9858 LIBS="$cf_save_LIBS"
9859 NCURSES_CONFIG_PKG=none
9860 else
9861
9862cat >>confdefs.h <<\EOF
9863#define NCURSES 1
9864EOF
9865
9866 NCURSES_CONFIG_PKG=$cf_ncuconfig_root
micky3879b9f5e72025-07-08 18:04:53 -04009867
9868echo "$as_me:9868: checking for terminfo header" >&5
9869echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
9870if test "${cf_cv_term_header+set}" = set; then
9871 echo $ECHO_N "(cached) $ECHO_C" >&6
9872else
9873
9874case "${cf_cv_ncurses_header}" in
9875(*/ncurses.h|*/ncursesw.h)
9876 cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
9877 ;;
9878(*)
9879 cf_term_header=term.h
9880 ;;
9881esac
9882
9883for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
9884do
9885cat >"conftest.$ac_ext" <<_ACEOF
9886#line 9886 "configure"
9887#include "confdefs.h"
9888#include <stdio.h>
9889#include <${cf_cv_ncurses_header:-curses.h}>
9890#include <$cf_test>
9891
9892int
9893main (void)
9894{
9895int x = auto_left_margin; (void)x
9896 ;
9897 return 0;
9898}
9899_ACEOF
9900rm -f "conftest.$ac_objext"
9901if { (eval echo "$as_me:9901: \"$ac_compile\"") >&5
9902 (eval $ac_compile) 2>&5
9903 ac_status=$?
9904 echo "$as_me:9904: \$? = $ac_status" >&5
9905 (exit "$ac_status"); } &&
9906 { ac_try='test -s "conftest.$ac_objext"'
9907 { (eval echo "$as_me:9907: \"$ac_try\"") >&5
9908 (eval $ac_try) 2>&5
9909 ac_status=$?
9910 echo "$as_me:9910: \$? = $ac_status" >&5
9911 (exit "$ac_status"); }; }; then
9912
9913 cf_cv_term_header="$cf_test"
9914else
9915 echo "$as_me: failed program was:" >&5
9916cat "conftest.$ac_ext" >&5
9917
9918 cf_cv_term_header=unknown
9919
9920fi
9921rm -f "conftest.$ac_objext" "conftest.$ac_ext"
9922 test "$cf_cv_term_header" != unknown && break
9923done
9924
9925fi
9926echo "$as_me:9926: result: $cf_cv_term_header" >&5
9927echo "${ECHO_T}$cf_cv_term_header" >&6
9928
9929# Set definitions to allow ifdef'ing to accommodate subdirectories
9930
9931case "$cf_cv_term_header" in
9932(*term.h)
9933
9934cat >>confdefs.h <<\EOF
9935#define HAVE_TERM_H 1
9936EOF
9937
9938 ;;
9939esac
9940
9941case "$cf_cv_term_header" in
9942(ncurses/term.h)
9943
9944cat >>confdefs.h <<\EOF
9945#define HAVE_NCURSES_TERM_H 1
9946EOF
9947
9948 ;;
9949(ncursesw/term.h)
9950
9951cat >>confdefs.h <<\EOF
9952#define HAVE_NCURSESW_TERM_H 1
9953EOF
9954
9955 ;;
9956esac
9957
Steve Kondikae271bc2015-11-15 02:50:53 +01009958 fi
9959
9960 else
micky3879b9f5e72025-07-08 18:04:53 -04009961 echo "$as_me:9961: result: no" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01009962echo "${ECHO_T}no" >&6
9963 NCURSES_CONFIG_PKG=none
9964 fi
9965else
9966 NCURSES_CONFIG_PKG=none
9967fi
9968
9969if test "x$cf_have_ncuconfig" = "xno"; then
micky3879b9f5e72025-07-08 18:04:53 -04009970 cf_ncurses_config="${cf_ncuconfig_root}${NCURSES_CONFIG_SUFFIX}-config"; echo "Looking for ${cf_ncurses_config}"
Steve Kondikae271bc2015-11-15 02:50:53 +01009971
9972if test -n "$ac_tool_prefix"; then
micky3879b9f5e72025-07-08 18:04:53 -04009973 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 +01009974 do
9975 # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
9976set dummy $ac_tool_prefix$ac_prog; ac_word=$2
micky3879b9f5e72025-07-08 18:04:53 -04009977echo "$as_me:9977: checking for $ac_word" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01009978echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
9979if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
9980 echo $ECHO_N "(cached) $ECHO_C" >&6
9981else
9982 if test -n "$NCURSES_CONFIG"; then
9983 ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
9984else
9985 ac_save_IFS=$IFS; IFS=$ac_path_separator
9986ac_dummy="$PATH"
9987for ac_dir in $ac_dummy; do
9988 IFS=$ac_save_IFS
9989 test -z "$ac_dir" && ac_dir=.
9990 $as_executable_p "$ac_dir/$ac_word" || continue
9991ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
micky3879b9f5e72025-07-08 18:04:53 -04009992echo "$as_me:9992: found $ac_dir/$ac_word" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +01009993break
9994done
9995
9996fi
9997fi
9998NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
9999if test -n "$NCURSES_CONFIG"; then
micky3879b9f5e72025-07-08 18:04:53 -040010000 echo "$as_me:10000: result: $NCURSES_CONFIG" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010010001echo "${ECHO_T}$NCURSES_CONFIG" >&6
10002else
micky3879b9f5e72025-07-08 18:04:53 -040010003 echo "$as_me:10003: result: no" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010010004echo "${ECHO_T}no" >&6
10005fi
10006
10007 test -n "$NCURSES_CONFIG" && break
10008 done
10009fi
10010if test -z "$NCURSES_CONFIG"; then
10011 ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
micky3879b9f5e72025-07-08 18:04:53 -040010012 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 +010010013do
10014 # Extract the first word of "$ac_prog", so it can be a program name with args.
10015set dummy $ac_prog; ac_word=$2
micky3879b9f5e72025-07-08 18:04:53 -040010016echo "$as_me:10016: checking for $ac_word" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010010017echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
10018if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
10019 echo $ECHO_N "(cached) $ECHO_C" >&6
10020else
10021 if test -n "$ac_ct_NCURSES_CONFIG"; then
10022 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
10023else
10024 ac_save_IFS=$IFS; IFS=$ac_path_separator
10025ac_dummy="$PATH"
10026for ac_dir in $ac_dummy; do
10027 IFS=$ac_save_IFS
10028 test -z "$ac_dir" && ac_dir=.
10029 $as_executable_p "$ac_dir/$ac_word" || continue
10030ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
micky3879b9f5e72025-07-08 18:04:53 -040010031echo "$as_me:10031: found $ac_dir/$ac_word" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010010032break
10033done
10034
10035fi
10036fi
10037ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
10038if test -n "$ac_ct_NCURSES_CONFIG"; then
micky3879b9f5e72025-07-08 18:04:53 -040010039 echo "$as_me:10039: result: $ac_ct_NCURSES_CONFIG" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010010040echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
10041else
micky3879b9f5e72025-07-08 18:04:53 -040010042 echo "$as_me:10042: result: no" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010010043echo "${ECHO_T}no" >&6
10044fi
10045
10046 test -n "$ac_ct_NCURSES_CONFIG" && break
10047done
10048test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
10049
10050 NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
10051fi
10052
10053 if test "$NCURSES_CONFIG" != none ; then
10054
micky3879b9f5e72025-07-08 18:04:53 -040010055for cf_add_cflags in `$NCURSES_CONFIG --cflags`
Steve Kondikae271bc2015-11-15 02:50:53 +010010056do
micky3879b9f5e72025-07-08 18:04:53 -040010057 case "x$cf_add_cflags" in
10058 (x-[DU]*)
10059
10060cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
10061while true
10062do
10063 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'`
10064 test "$CFLAGS" != "$cf_old_cflag" || break
10065
10066 CFLAGS="$cf_old_cflag"
10067done
10068
10069cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
10070while true
10071do
10072 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'`
10073 test "$CPPFLAGS" != "$cf_old_cflag" || break
10074
10075 CPPFLAGS="$cf_old_cflag"
10076done
10077
10078 ;;
10079 esac
10080
10081cf_fix_cppflags=no
10082cf_new_cflags=
10083cf_new_cppflags=
10084cf_new_extra_cppflags=
10085
10086for cf_add_cflags in $cf_add_cflags
10087do
10088case "$cf_fix_cppflags" in
10089(no)
10090 case "$cf_add_cflags" in
10091 (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
10092 case "$cf_add_cflags" in
10093 (-D*)
10094 cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
10095
10096 test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10097 && test -z "${cf_tst_cflags}" \
10098 && cf_fix_cppflags=yes
10099
10100 if test "$cf_fix_cppflags" = yes ; then
10101
10102 test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
10103 cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
10104
10105 continue
10106 elif test "${cf_tst_cflags}" = "\"'" ; then
10107
10108 test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
10109 cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
10110
10111 continue
10112 fi
10113 ;;
10114 esac
10115 case "$CPPFLAGS" in
10116 (*$cf_add_cflags)
10117 ;;
10118 (*)
10119 case "$cf_add_cflags" in
10120 (-D*)
10121 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
10122
10123CPPFLAGS=`echo "$CPPFLAGS" | \
10124 sed -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?[ ]/ /g' \
10125 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?$//g'`
10126
10127 ;;
10128 esac
10129
10130 test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
10131 cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
10132
10133 ;;
10134 esac
10135 ;;
10136 (*)
10137
10138 test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
10139 cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
10140
10141 ;;
10142 esac
10143 ;;
10144(yes)
10145
10146 test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
10147 cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
10148
10149 cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
10150
10151 test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10152 && test -z "${cf_tst_cflags}" \
10153 && cf_fix_cppflags=no
10154 ;;
10155esac
10156done
10157
10158if test -n "$cf_new_cflags" ; then
10159
10160 test -n "$CFLAGS" && CFLAGS="$CFLAGS "
10161 CFLAGS="${CFLAGS}$cf_new_cflags"
10162
10163fi
10164
10165if test -n "$cf_new_cppflags" ; then
10166
10167 test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
10168 CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
10169
10170fi
10171
10172if test -n "$cf_new_extra_cppflags" ; then
10173
10174 test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
10175 EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
10176
10177fi
10178
10179done
10180
10181cf_add_libs="$LIBS"
10182# reverse order
10183cf_add_0lib=
10184for cf_add_1lib in `$NCURSES_CONFIG --libs`; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
10185# filter duplicates
10186for cf_add_1lib in $cf_add_0lib; do
10187 for cf_add_2lib in $cf_add_libs; do
10188 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
Steve Kondikae271bc2015-11-15 02:50:53 +010010189 cf_add_1lib=
10190 break
10191 fi
10192 done
micky3879b9f5e72025-07-08 18:04:53 -040010193 test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
Steve Kondikae271bc2015-11-15 02:50:53 +010010194done
10195LIBS="$cf_add_libs"
10196
10197 # even with config script, some packages use no-override for curses.h
10198
micky3879b9f5e72025-07-08 18:04:53 -040010199echo "$as_me:10199: checking if we have identified curses headers" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010010200echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
10201if test "${cf_cv_ncurses_header+set}" = set; then
10202 echo $ECHO_N "(cached) $ECHO_C" >&6
10203else
10204
10205cf_cv_ncurses_header=none
10206for cf_header in \
10207 ncurses.h ncurses/ncurses.h \
10208 curses.h ncurses/curses.h
10209do
micky3879b9f5e72025-07-08 18:04:53 -040010210cat >"conftest.$ac_ext" <<_ACEOF
10211#line 10211 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +010010212#include "confdefs.h"
10213#include <${cf_header}>
10214int
micky3879b9f5e72025-07-08 18:04:53 -040010215main (void)
Steve Kondikae271bc2015-11-15 02:50:53 +010010216{
micky3879b9f5e72025-07-08 18:04:53 -040010217initscr(); endwin()
Steve Kondikae271bc2015-11-15 02:50:53 +010010218 ;
10219 return 0;
10220}
10221_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -040010222rm -f "conftest.$ac_objext"
10223if { (eval echo "$as_me:10223: \"$ac_compile\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010010224 (eval $ac_compile) 2>&5
10225 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040010226 echo "$as_me:10226: \$? = $ac_status" >&5
10227 (exit "$ac_status"); } &&
10228 { ac_try='test -s "conftest.$ac_objext"'
10229 { (eval echo "$as_me:10229: \"$ac_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010010230 (eval $ac_try) 2>&5
10231 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040010232 echo "$as_me:10232: \$? = $ac_status" >&5
10233 (exit "$ac_status"); }; }; then
Steve Kondikae271bc2015-11-15 02:50:53 +010010234 cf_cv_ncurses_header=$cf_header; break
10235else
10236 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -040010237cat "conftest.$ac_ext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010010238fi
micky3879b9f5e72025-07-08 18:04:53 -040010239rm -f "conftest.$ac_objext" "conftest.$ac_ext"
Steve Kondikae271bc2015-11-15 02:50:53 +010010240done
10241
10242fi
micky3879b9f5e72025-07-08 18:04:53 -040010243echo "$as_me:10243: result: $cf_cv_ncurses_header" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010010244echo "${ECHO_T}$cf_cv_ncurses_header" >&6
10245
10246if test "$cf_cv_ncurses_header" = none ; then
micky3879b9f5e72025-07-08 18:04:53 -040010247 { { echo "$as_me:10247: error: No curses header-files found" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010010248echo "$as_me: error: No curses header-files found" >&2;}
10249 { (exit 1); exit 1; }; }
10250fi
10251
10252# cheat, to get the right #define's for HAVE_NCURSES_H, etc.
10253
10254for ac_header in $cf_cv_ncurses_header
10255do
10256as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
micky3879b9f5e72025-07-08 18:04:53 -040010257echo "$as_me:10257: checking for $ac_header" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010010258echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
10259if eval "test \"\${$as_ac_Header+set}\" = set"; then
10260 echo $ECHO_N "(cached) $ECHO_C" >&6
10261else
micky3879b9f5e72025-07-08 18:04:53 -040010262 cat >"conftest.$ac_ext" <<_ACEOF
10263#line 10263 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +010010264#include "confdefs.h"
10265#include <$ac_header>
10266_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -040010267if { (eval echo "$as_me:10267: \"$ac_cpp "conftest.$ac_ext"\"") >&5
10268 (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
Steve Kondikae271bc2015-11-15 02:50:53 +010010269 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040010270 $EGREP -v '^ *\+' conftest.er1 >conftest.err
Steve Kondikae271bc2015-11-15 02:50:53 +010010271 rm -f conftest.er1
10272 cat conftest.err >&5
micky3879b9f5e72025-07-08 18:04:53 -040010273 echo "$as_me:10273: \$? = $ac_status" >&5
10274 (exit "$ac_status"); } >/dev/null; then
Steve Kondikae271bc2015-11-15 02:50:53 +010010275 if test -s conftest.err; then
10276 ac_cpp_err=$ac_c_preproc_warn_flag
10277 else
10278 ac_cpp_err=
10279 fi
10280else
10281 ac_cpp_err=yes
10282fi
10283if test -z "$ac_cpp_err"; then
10284 eval "$as_ac_Header=yes"
10285else
10286 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -040010287 cat "conftest.$ac_ext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010010288 eval "$as_ac_Header=no"
10289fi
micky3879b9f5e72025-07-08 18:04:53 -040010290rm -f conftest.err "conftest.$ac_ext"
Steve Kondikae271bc2015-11-15 02:50:53 +010010291fi
micky3879b9f5e72025-07-08 18:04:53 -040010292echo "$as_me:10292: result: `eval echo '${'"$as_ac_Header"'}'`" >&5
10293echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6
10294if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then
Steve Kondikae271bc2015-11-15 02:50:53 +010010295 cat >>confdefs.h <<EOF
10296#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
10297EOF
10298
10299fi
10300done
10301
10302cat >>confdefs.h <<\EOF
10303#define NCURSES 1
10304EOF
10305
10306cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
10307
10308 cat >>confdefs.h <<EOF
10309#define $cf_nculib_ROOT 1
10310EOF
10311
micky3879b9f5e72025-07-08 18:04:53 -040010312 cf_cv_ncurses_version="`$NCURSES_CONFIG --version`"
Steve Kondikae271bc2015-11-15 02:50:53 +010010313
10314 else
10315
10316cf_ncuhdr_root=ncurses
10317
10318test -n "$cf_cv_curses_dir" && \
10319test "$cf_cv_curses_dir" != "no" && { \
10320
10321if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
10322 for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
10323 do
micky3879b9f5e72025-07-08 18:04:53 -040010324 while test "$cf_add_incdir" != /usr/include
Steve Kondikae271bc2015-11-15 02:50:53 +010010325 do
micky3879b9f5e72025-07-08 18:04:53 -040010326 if test -d "$cf_add_incdir"
Steve Kondikae271bc2015-11-15 02:50:53 +010010327 then
10328 cf_have_incdir=no
10329 if test -n "$CFLAGS$CPPFLAGS" ; then
10330 # a loop is needed to ensure we can add subdirs of existing dirs
10331 for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
10332 if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
10333 cf_have_incdir=yes; break
10334 fi
10335 done
10336 fi
10337
10338 if test "$cf_have_incdir" = no ; then
10339 if test "$cf_add_incdir" = /usr/local/include ; then
10340 if test "$GCC" = yes
10341 then
10342 cf_save_CPPFLAGS=$CPPFLAGS
micky3879b9f5e72025-07-08 18:04:53 -040010343
10344 test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
10345 CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
10346
10347 cat >"conftest.$ac_ext" <<_ACEOF
10348#line 10348 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +010010349#include "confdefs.h"
10350#include <stdio.h>
10351int
micky3879b9f5e72025-07-08 18:04:53 -040010352main (void)
Steve Kondikae271bc2015-11-15 02:50:53 +010010353{
10354printf("Hello")
10355 ;
10356 return 0;
10357}
10358_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -040010359rm -f "conftest.$ac_objext"
10360if { (eval echo "$as_me:10360: \"$ac_compile\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010010361 (eval $ac_compile) 2>&5
10362 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040010363 echo "$as_me:10363: \$? = $ac_status" >&5
10364 (exit "$ac_status"); } &&
10365 { ac_try='test -s "conftest.$ac_objext"'
10366 { (eval echo "$as_me:10366: \"$ac_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010010367 (eval $ac_try) 2>&5
10368 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040010369 echo "$as_me:10369: \$? = $ac_status" >&5
10370 (exit "$ac_status"); }; }; then
Steve Kondikae271bc2015-11-15 02:50:53 +010010371 :
10372else
10373 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -040010374cat "conftest.$ac_ext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010010375cf_have_incdir=yes
10376fi
micky3879b9f5e72025-07-08 18:04:53 -040010377rm -f "conftest.$ac_objext" "conftest.$ac_ext"
Steve Kondikae271bc2015-11-15 02:50:53 +010010378 CPPFLAGS=$cf_save_CPPFLAGS
10379 fi
10380 fi
10381 fi
10382
10383 if test "$cf_have_incdir" = no ; then
10384 test -n "$verbose" && echo " adding $cf_add_incdir to include-path" 1>&6
10385
micky3879b9f5e72025-07-08 18:04:53 -040010386echo "${as_me:-configure}:10386: testing adding $cf_add_incdir to include-path ..." 1>&5
Steve Kondikae271bc2015-11-15 02:50:53 +010010387
10388 CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
10389
micky3879b9f5e72025-07-08 18:04:53 -040010390 cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
Steve Kondikae271bc2015-11-15 02:50:53 +010010391 test "$cf_top_incdir" = "$cf_add_incdir" && break
10392 cf_add_incdir="$cf_top_incdir"
10393 else
10394 break
10395 fi
10396 else
10397 break
10398 fi
10399 done
10400 done
10401fi
10402
10403}
10404
micky3879b9f5e72025-07-08 18:04:53 -040010405echo "$as_me:10405: checking for $cf_ncuhdr_root header in include-path" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010010406echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
10407if test "${cf_cv_ncurses_h+set}" = set; then
10408 echo $ECHO_N "(cached) $ECHO_C" >&6
10409else
10410
10411 cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
micky3879b9f5e72025-07-08 18:04:53 -040010412 { 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 +010010413 for cf_header in $cf_header_list
10414 do
10415
micky3879b9f5e72025-07-08 18:04:53 -040010416 cat >"conftest.$ac_ext" <<_ACEOF
10417#line 10417 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +010010418#include "confdefs.h"
10419
10420#include <$cf_header>
10421int
micky3879b9f5e72025-07-08 18:04:53 -040010422main (void)
Steve Kondikae271bc2015-11-15 02:50:53 +010010423{
10424
10425#ifdef NCURSES_VERSION
10426
micky3879b9f5e72025-07-08 18:04:53 -040010427printf("%s\\n", NCURSES_VERSION);
Steve Kondikae271bc2015-11-15 02:50:53 +010010428#else
10429#ifdef __NCURSES_H
micky3879b9f5e72025-07-08 18:04:53 -040010430printf("old\\n");
Steve Kondikae271bc2015-11-15 02:50:53 +010010431#else
micky3879b9f5e72025-07-08 18:04:53 -040010432 #error __NCURSES_H is not defined
Steve Kondikae271bc2015-11-15 02:50:53 +010010433#endif
10434#endif
10435
10436 ;
10437 return 0;
10438}
10439_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -040010440rm -f "conftest.$ac_objext"
10441if { (eval echo "$as_me:10441: \"$ac_compile\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010010442 (eval $ac_compile) 2>&5
10443 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040010444 echo "$as_me:10444: \$? = $ac_status" >&5
10445 (exit "$ac_status"); } &&
10446 { ac_try='test -s "conftest.$ac_objext"'
10447 { (eval echo "$as_me:10447: \"$ac_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010010448 (eval $ac_try) 2>&5
10449 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040010450 echo "$as_me:10450: \$? = $ac_status" >&5
10451 (exit "$ac_status"); }; }; then
Steve Kondikae271bc2015-11-15 02:50:53 +010010452 cf_cv_ncurses_h=$cf_header
10453
10454else
10455 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -040010456cat "conftest.$ac_ext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010010457cf_cv_ncurses_h=no
10458fi
micky3879b9f5e72025-07-08 18:04:53 -040010459rm -f "conftest.$ac_objext" "conftest.$ac_ext"
Steve Kondikae271bc2015-11-15 02:50:53 +010010460
10461 test "$cf_cv_ncurses_h" != no && break
10462 done
10463
10464fi
micky3879b9f5e72025-07-08 18:04:53 -040010465echo "$as_me:10465: result: $cf_cv_ncurses_h" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010010466echo "${ECHO_T}$cf_cv_ncurses_h" >&6
10467
10468if test "$cf_cv_ncurses_h" != no ; then
10469 cf_cv_ncurses_header=$cf_cv_ncurses_h
10470else
10471
micky3879b9f5e72025-07-08 18:04:53 -040010472echo "$as_me:10472: checking for $cf_ncuhdr_root include-path" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010010473echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
10474if test "${cf_cv_ncurses_h2+set}" = set; then
10475 echo $ECHO_N "(cached) $ECHO_C" >&6
10476else
10477
10478 test -n "$verbose" && echo
10479
10480cf_search=
10481
10482# collect the current set of include-directories from compiler flags
10483cf_header_path_list=""
10484if test -n "${CFLAGS}${CPPFLAGS}" ; then
10485 for cf_header_path in $CPPFLAGS $CFLAGS
10486 do
micky3879b9f5e72025-07-08 18:04:53 -040010487 case "$cf_header_path" in
Steve Kondikae271bc2015-11-15 02:50:53 +010010488 (-I*)
10489 cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
10490
10491test "x$cf_header_path" != "xNONE" && \
10492test -d "$cf_header_path" && \
10493 {
10494 test -n "$verbose" && echo " ... testing for include-directories under $cf_header_path"
micky3879b9f5e72025-07-08 18:04:53 -040010495 test -d "$cf_header_path/include" && cf_search="$cf_search $cf_header_path/include"
10496 test -d "$cf_header_path/include/$cf_ncuhdr_root" && cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
10497 test -d "$cf_header_path/include/$cf_ncuhdr_root/include" && cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
10498 test -d "$cf_header_path/$cf_ncuhdr_root/include" && cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
10499 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 +010010500}
10501
10502 cf_header_path_list="$cf_header_path_list $cf_search"
10503 ;;
10504 esac
10505 done
10506fi
10507
10508# add the variations for the package we are looking for
10509
10510cf_search=
10511
10512test "x$prefix" != "xNONE" && \
10513test -d "$prefix" && \
10514 {
10515 test -n "$verbose" && echo " ... testing for include-directories under $prefix"
micky3879b9f5e72025-07-08 18:04:53 -040010516 test -d "$prefix/include" && cf_search="$cf_search $prefix/include"
10517 test -d "$prefix/include/$cf_ncuhdr_root" && cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
10518 test -d "$prefix/include/$cf_ncuhdr_root/include" && cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
10519 test -d "$prefix/$cf_ncuhdr_root/include" && cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
10520 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 +010010521}
10522
10523for cf_subdir_prefix in \
10524 /usr \
10525 /usr/local \
10526 /usr/pkg \
10527 /opt \
10528 /opt/local \
10529 $HOME
10530do
10531
10532test "x$cf_subdir_prefix" != "x$prefix" && \
10533test -d "$cf_subdir_prefix" && \
micky3879b9f5e72025-07-08 18:04:53 -040010534{ test -z "$prefix" || test "x$prefix" = xNONE || test "x$cf_subdir_prefix" != "x$prefix"; } && {
Steve Kondikae271bc2015-11-15 02:50:53 +010010535 test -n "$verbose" && echo " ... testing for include-directories under $cf_subdir_prefix"
micky3879b9f5e72025-07-08 18:04:53 -040010536 test -d "$cf_subdir_prefix/include" && cf_search="$cf_search $cf_subdir_prefix/include"
10537 test -d "$cf_subdir_prefix/include/$cf_ncuhdr_root" && cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root"
10538 test -d "$cf_subdir_prefix/include/$cf_ncuhdr_root/include" && cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root/include"
10539 test -d "$cf_subdir_prefix/$cf_ncuhdr_root/include" && cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include"
10540 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 +010010541}
10542
10543done
10544
10545test "$includedir" != NONE && \
10546test "$includedir" != "/usr/include" && \
10547test -d "$includedir" && {
micky3879b9f5e72025-07-08 18:04:53 -040010548 test -d "$includedir" && cf_search="$cf_search $includedir"
10549 test -d "$includedir/$cf_ncuhdr_root" && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
Steve Kondikae271bc2015-11-15 02:50:53 +010010550}
10551
10552test "$oldincludedir" != NONE && \
10553test "$oldincludedir" != "/usr/include" && \
10554test -d "$oldincludedir" && {
micky3879b9f5e72025-07-08 18:04:53 -040010555 test -d "$oldincludedir" && cf_search="$cf_search $oldincludedir"
10556 test -d "$oldincludedir/$cf_ncuhdr_root" && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
Steve Kondikae271bc2015-11-15 02:50:53 +010010557}
10558
10559cf_search="$cf_search $cf_header_path_list"
10560
micky3879b9f5e72025-07-08 18:04:53 -040010561 test -n "$verbose" && echo "search path $cf_search"
Steve Kondikae271bc2015-11-15 02:50:53 +010010562 cf_save2_CPPFLAGS="$CPPFLAGS"
10563 for cf_incdir in $cf_search
10564 do
10565
10566if test -n "$cf_incdir" ; then
10567 for cf_add_incdir in $cf_incdir
10568 do
micky3879b9f5e72025-07-08 18:04:53 -040010569 while test "$cf_add_incdir" != /usr/include
Steve Kondikae271bc2015-11-15 02:50:53 +010010570 do
micky3879b9f5e72025-07-08 18:04:53 -040010571 if test -d "$cf_add_incdir"
Steve Kondikae271bc2015-11-15 02:50:53 +010010572 then
10573 cf_have_incdir=no
10574 if test -n "$CFLAGS$CPPFLAGS" ; then
10575 # a loop is needed to ensure we can add subdirs of existing dirs
10576 for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
10577 if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
10578 cf_have_incdir=yes; break
10579 fi
10580 done
10581 fi
10582
10583 if test "$cf_have_incdir" = no ; then
10584 if test "$cf_add_incdir" = /usr/local/include ; then
10585 if test "$GCC" = yes
10586 then
10587 cf_save_CPPFLAGS=$CPPFLAGS
micky3879b9f5e72025-07-08 18:04:53 -040010588
10589 test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
10590 CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
10591
10592 cat >"conftest.$ac_ext" <<_ACEOF
10593#line 10593 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +010010594#include "confdefs.h"
10595#include <stdio.h>
10596int
micky3879b9f5e72025-07-08 18:04:53 -040010597main (void)
Steve Kondikae271bc2015-11-15 02:50:53 +010010598{
10599printf("Hello")
10600 ;
10601 return 0;
10602}
10603_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -040010604rm -f "conftest.$ac_objext"
10605if { (eval echo "$as_me:10605: \"$ac_compile\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010010606 (eval $ac_compile) 2>&5
10607 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040010608 echo "$as_me:10608: \$? = $ac_status" >&5
10609 (exit "$ac_status"); } &&
10610 { ac_try='test -s "conftest.$ac_objext"'
10611 { (eval echo "$as_me:10611: \"$ac_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010010612 (eval $ac_try) 2>&5
10613 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040010614 echo "$as_me:10614: \$? = $ac_status" >&5
10615 (exit "$ac_status"); }; }; then
Steve Kondikae271bc2015-11-15 02:50:53 +010010616 :
10617else
10618 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -040010619cat "conftest.$ac_ext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010010620cf_have_incdir=yes
10621fi
micky3879b9f5e72025-07-08 18:04:53 -040010622rm -f "conftest.$ac_objext" "conftest.$ac_ext"
Steve Kondikae271bc2015-11-15 02:50:53 +010010623 CPPFLAGS=$cf_save_CPPFLAGS
10624 fi
10625 fi
10626 fi
10627
10628 if test "$cf_have_incdir" = no ; then
10629 test -n "$verbose" && echo " adding $cf_add_incdir to include-path" 1>&6
10630
micky3879b9f5e72025-07-08 18:04:53 -040010631echo "${as_me:-configure}:10631: testing adding $cf_add_incdir to include-path ..." 1>&5
Steve Kondikae271bc2015-11-15 02:50:53 +010010632
10633 CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
10634
micky3879b9f5e72025-07-08 18:04:53 -040010635 cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
Steve Kondikae271bc2015-11-15 02:50:53 +010010636 test "$cf_top_incdir" = "$cf_add_incdir" && break
10637 cf_add_incdir="$cf_top_incdir"
10638 else
10639 break
10640 fi
10641 else
10642 break
10643 fi
10644 done
10645 done
10646fi
10647
10648 for cf_header in \
10649 ncurses.h \
10650 curses.h
10651 do
10652
micky3879b9f5e72025-07-08 18:04:53 -040010653 cat >"conftest.$ac_ext" <<_ACEOF
10654#line 10654 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +010010655#include "confdefs.h"
10656
10657#include <$cf_header>
10658int
micky3879b9f5e72025-07-08 18:04:53 -040010659main (void)
Steve Kondikae271bc2015-11-15 02:50:53 +010010660{
10661
10662#ifdef NCURSES_VERSION
10663
micky3879b9f5e72025-07-08 18:04:53 -040010664printf("%s\\n", NCURSES_VERSION);
Steve Kondikae271bc2015-11-15 02:50:53 +010010665#else
10666#ifdef __NCURSES_H
micky3879b9f5e72025-07-08 18:04:53 -040010667printf("old\\n");
Steve Kondikae271bc2015-11-15 02:50:53 +010010668#else
micky3879b9f5e72025-07-08 18:04:53 -040010669 #error __NCURSES_H is not defined
Steve Kondikae271bc2015-11-15 02:50:53 +010010670#endif
10671#endif
10672
10673 ;
10674 return 0;
10675}
10676_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -040010677rm -f "conftest.$ac_objext"
10678if { (eval echo "$as_me:10678: \"$ac_compile\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010010679 (eval $ac_compile) 2>&5
10680 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040010681 echo "$as_me:10681: \$? = $ac_status" >&5
10682 (exit "$ac_status"); } &&
10683 { ac_try='test -s "conftest.$ac_objext"'
10684 { (eval echo "$as_me:10684: \"$ac_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010010685 (eval $ac_try) 2>&5
10686 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040010687 echo "$as_me:10687: \$? = $ac_status" >&5
10688 (exit "$ac_status"); }; }; then
Steve Kondikae271bc2015-11-15 02:50:53 +010010689 cf_cv_ncurses_h2=$cf_header
10690
10691else
10692 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -040010693cat "conftest.$ac_ext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010010694cf_cv_ncurses_h2=no
10695fi
micky3879b9f5e72025-07-08 18:04:53 -040010696rm -f "conftest.$ac_objext" "conftest.$ac_ext"
Steve Kondikae271bc2015-11-15 02:50:53 +010010697
10698 if test "$cf_cv_ncurses_h2" != no ; then
10699 cf_cv_ncurses_h2=$cf_incdir/$cf_header
micky3879b9f5e72025-07-08 18:04:53 -040010700 test -n "$verbose" && echo $ECHO_N " ... found $ECHO_C" 1>&6
Steve Kondikae271bc2015-11-15 02:50:53 +010010701 break
10702 fi
10703 test -n "$verbose" && echo " ... tested $cf_incdir/$cf_header" 1>&6
10704 done
10705 CPPFLAGS="$cf_save2_CPPFLAGS"
10706 test "$cf_cv_ncurses_h2" != no && break
10707 done
micky3879b9f5e72025-07-08 18:04:53 -040010708 test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:10708: error: not found" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010010709echo "$as_me: error: not found" >&2;}
10710 { (exit 1); exit 1; }; }
10711
10712fi
micky3879b9f5e72025-07-08 18:04:53 -040010713echo "$as_me:10713: result: $cf_cv_ncurses_h2" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010010714echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
10715
micky3879b9f5e72025-07-08 18:04:53 -040010716 cf_1st_incdir=`echo "$cf_cv_ncurses_h2" | sed -e 's%/[^/]*$%%'`
10717 cf_cv_ncurses_header="`basename "$cf_cv_ncurses_h2"`"
10718 if test "`basename "$cf_1st_incdir"`" = "$cf_ncuhdr_root" ; then
10719 cf_cv_ncurses_header="$cf_ncuhdr_root/$cf_cv_ncurses_header"
Steve Kondikae271bc2015-11-15 02:50:53 +010010720 fi
10721
10722if test -n "$cf_1st_incdir" ; then
10723 for cf_add_incdir in $cf_1st_incdir
10724 do
micky3879b9f5e72025-07-08 18:04:53 -040010725 while test "$cf_add_incdir" != /usr/include
Steve Kondikae271bc2015-11-15 02:50:53 +010010726 do
micky3879b9f5e72025-07-08 18:04:53 -040010727 if test -d "$cf_add_incdir"
Steve Kondikae271bc2015-11-15 02:50:53 +010010728 then
10729 cf_have_incdir=no
10730 if test -n "$CFLAGS$CPPFLAGS" ; then
10731 # a loop is needed to ensure we can add subdirs of existing dirs
10732 for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
10733 if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
10734 cf_have_incdir=yes; break
10735 fi
10736 done
10737 fi
10738
10739 if test "$cf_have_incdir" = no ; then
10740 if test "$cf_add_incdir" = /usr/local/include ; then
10741 if test "$GCC" = yes
10742 then
10743 cf_save_CPPFLAGS=$CPPFLAGS
micky3879b9f5e72025-07-08 18:04:53 -040010744
10745 test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
10746 CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
10747
10748 cat >"conftest.$ac_ext" <<_ACEOF
10749#line 10749 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +010010750#include "confdefs.h"
10751#include <stdio.h>
10752int
micky3879b9f5e72025-07-08 18:04:53 -040010753main (void)
Steve Kondikae271bc2015-11-15 02:50:53 +010010754{
10755printf("Hello")
10756 ;
10757 return 0;
10758}
10759_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -040010760rm -f "conftest.$ac_objext"
10761if { (eval echo "$as_me:10761: \"$ac_compile\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010010762 (eval $ac_compile) 2>&5
10763 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040010764 echo "$as_me:10764: \$? = $ac_status" >&5
10765 (exit "$ac_status"); } &&
10766 { ac_try='test -s "conftest.$ac_objext"'
10767 { (eval echo "$as_me:10767: \"$ac_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010010768 (eval $ac_try) 2>&5
10769 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040010770 echo "$as_me:10770: \$? = $ac_status" >&5
10771 (exit "$ac_status"); }; }; then
Steve Kondikae271bc2015-11-15 02:50:53 +010010772 :
10773else
10774 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -040010775cat "conftest.$ac_ext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010010776cf_have_incdir=yes
10777fi
micky3879b9f5e72025-07-08 18:04:53 -040010778rm -f "conftest.$ac_objext" "conftest.$ac_ext"
Steve Kondikae271bc2015-11-15 02:50:53 +010010779 CPPFLAGS=$cf_save_CPPFLAGS
10780 fi
10781 fi
10782 fi
10783
10784 if test "$cf_have_incdir" = no ; then
10785 test -n "$verbose" && echo " adding $cf_add_incdir to include-path" 1>&6
10786
micky3879b9f5e72025-07-08 18:04:53 -040010787echo "${as_me:-configure}:10787: testing adding $cf_add_incdir to include-path ..." 1>&5
Steve Kondikae271bc2015-11-15 02:50:53 +010010788
10789 CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
10790
micky3879b9f5e72025-07-08 18:04:53 -040010791 cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
Steve Kondikae271bc2015-11-15 02:50:53 +010010792 test "$cf_top_incdir" = "$cf_add_incdir" && break
10793 cf_add_incdir="$cf_top_incdir"
10794 else
10795 break
10796 fi
10797 else
10798 break
10799 fi
10800 done
10801 done
10802fi
10803
10804fi
10805
10806# Set definitions to allow ifdef'ing for ncurses.h
10807
micky3879b9f5e72025-07-08 18:04:53 -040010808case "$cf_cv_ncurses_header" in
Steve Kondikae271bc2015-11-15 02:50:53 +010010809(*ncurses.h)
10810
10811cat >>confdefs.h <<\EOF
10812#define HAVE_NCURSES_H 1
10813EOF
10814
10815 ;;
10816esac
10817
micky3879b9f5e72025-07-08 18:04:53 -040010818case "$cf_cv_ncurses_header" in
Steve Kondikae271bc2015-11-15 02:50:53 +010010819(ncurses/curses.h|ncurses/ncurses.h)
10820
10821cat >>confdefs.h <<\EOF
10822#define HAVE_NCURSES_NCURSES_H 1
10823EOF
10824
10825 ;;
10826(ncursesw/curses.h|ncursesw/ncurses.h)
10827
10828cat >>confdefs.h <<\EOF
10829#define HAVE_NCURSESW_NCURSES_H 1
10830EOF
10831
10832 ;;
10833esac
10834
micky3879b9f5e72025-07-08 18:04:53 -040010835echo "$as_me:10835: checking for terminfo header" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010010836echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
10837if test "${cf_cv_term_header+set}" = set; then
10838 echo $ECHO_N "(cached) $ECHO_C" >&6
10839else
10840
micky3879b9f5e72025-07-08 18:04:53 -040010841case "${cf_cv_ncurses_header}" in
Steve Kondikae271bc2015-11-15 02:50:53 +010010842(*/ncurses.h|*/ncursesw.h)
10843 cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
10844 ;;
10845(*)
10846 cf_term_header=term.h
10847 ;;
10848esac
10849
10850for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
10851do
micky3879b9f5e72025-07-08 18:04:53 -040010852cat >"conftest.$ac_ext" <<_ACEOF
10853#line 10853 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +010010854#include "confdefs.h"
10855#include <stdio.h>
10856#include <${cf_cv_ncurses_header:-curses.h}>
10857#include <$cf_test>
10858
10859int
micky3879b9f5e72025-07-08 18:04:53 -040010860main (void)
Steve Kondikae271bc2015-11-15 02:50:53 +010010861{
micky3879b9f5e72025-07-08 18:04:53 -040010862int x = auto_left_margin; (void)x
Steve Kondikae271bc2015-11-15 02:50:53 +010010863 ;
10864 return 0;
10865}
10866_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -040010867rm -f "conftest.$ac_objext"
10868if { (eval echo "$as_me:10868: \"$ac_compile\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010010869 (eval $ac_compile) 2>&5
10870 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040010871 echo "$as_me:10871: \$? = $ac_status" >&5
10872 (exit "$ac_status"); } &&
10873 { ac_try='test -s "conftest.$ac_objext"'
10874 { (eval echo "$as_me:10874: \"$ac_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010010875 (eval $ac_try) 2>&5
10876 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040010877 echo "$as_me:10877: \$? = $ac_status" >&5
10878 (exit "$ac_status"); }; }; then
Steve Kondikae271bc2015-11-15 02:50:53 +010010879
10880 cf_cv_term_header="$cf_test"
10881else
10882 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -040010883cat "conftest.$ac_ext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010010884
10885 cf_cv_term_header=unknown
10886
10887fi
micky3879b9f5e72025-07-08 18:04:53 -040010888rm -f "conftest.$ac_objext" "conftest.$ac_ext"
Steve Kondikae271bc2015-11-15 02:50:53 +010010889 test "$cf_cv_term_header" != unknown && break
10890done
10891
10892fi
micky3879b9f5e72025-07-08 18:04:53 -040010893echo "$as_me:10893: result: $cf_cv_term_header" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010010894echo "${ECHO_T}$cf_cv_term_header" >&6
10895
10896# Set definitions to allow ifdef'ing to accommodate subdirectories
10897
micky3879b9f5e72025-07-08 18:04:53 -040010898case "$cf_cv_term_header" in
Steve Kondikae271bc2015-11-15 02:50:53 +010010899(*term.h)
10900
10901cat >>confdefs.h <<\EOF
10902#define HAVE_TERM_H 1
10903EOF
10904
10905 ;;
10906esac
10907
micky3879b9f5e72025-07-08 18:04:53 -040010908case "$cf_cv_term_header" in
Steve Kondikae271bc2015-11-15 02:50:53 +010010909(ncurses/term.h)
10910
10911cat >>confdefs.h <<\EOF
10912#define HAVE_NCURSES_TERM_H 1
10913EOF
10914
10915 ;;
10916(ncursesw/term.h)
10917
10918cat >>confdefs.h <<\EOF
10919#define HAVE_NCURSESW_TERM_H 1
10920EOF
10921
10922 ;;
10923esac
10924
10925# some applications need this, but should check for NCURSES_VERSION
10926
10927cat >>confdefs.h <<\EOF
10928#define NCURSES 1
10929EOF
10930
micky3879b9f5e72025-07-08 18:04:53 -040010931echo "$as_me:10931: checking for ncurses version" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010010932echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
10933if test "${cf_cv_ncurses_version+set}" = set; then
10934 echo $ECHO_N "(cached) $ECHO_C" >&6
10935else
10936
10937 cf_cv_ncurses_version=no
10938 cf_tempfile=out$$
micky3879b9f5e72025-07-08 18:04:53 -040010939 rm -f "$cf_tempfile"
Steve Kondikae271bc2015-11-15 02:50:53 +010010940 if test "$cross_compiling" = yes; then
10941
10942 # This will not work if the preprocessor splits the line after the
10943 # Autoconf token. The 'unproto' program does that.
micky3879b9f5e72025-07-08 18:04:53 -040010944 cat > "conftest.$ac_ext" <<EOF
Steve Kondikae271bc2015-11-15 02:50:53 +010010945#include <${cf_cv_ncurses_header:-curses.h}>
10946#undef Autoconf
10947#ifdef NCURSES_VERSION
10948Autoconf NCURSES_VERSION
10949#else
10950#ifdef __NCURSES_H
10951Autoconf "old"
10952#endif
10953;
10954#endif
10955EOF
10956 cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
micky3879b9f5e72025-07-08 18:04:53 -040010957 { (eval echo "$as_me:10957: \"$cf_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010010958 (eval $cf_try) 2>&5
10959 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040010960 echo "$as_me:10960: \$? = $ac_status" >&5
10961 (exit "$ac_status"); }
Steve Kondikae271bc2015-11-15 02:50:53 +010010962 if test -f conftest.out ; then
micky3879b9f5e72025-07-08 18:04:53 -040010963 cf_out=`sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%' conftest.out`
Steve Kondikae271bc2015-11-15 02:50:53 +010010964 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
10965 rm -f conftest.out
10966 fi
10967
10968else
micky3879b9f5e72025-07-08 18:04:53 -040010969 cat >"conftest.$ac_ext" <<_ACEOF
10970#line 10970 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +010010971#include "confdefs.h"
10972
micky3879b9f5e72025-07-08 18:04:53 -040010973$ac_includes_default
10974
Steve Kondikae271bc2015-11-15 02:50:53 +010010975#include <${cf_cv_ncurses_header:-curses.h}>
micky3879b9f5e72025-07-08 18:04:53 -040010976
10977int main(void)
Steve Kondikae271bc2015-11-15 02:50:53 +010010978{
10979 FILE *fp = fopen("$cf_tempfile", "w");
10980#ifdef NCURSES_VERSION
10981# ifdef NCURSES_VERSION_PATCH
micky3879b9f5e72025-07-08 18:04:53 -040010982 fprintf(fp, "%s.%d\\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
Steve Kondikae271bc2015-11-15 02:50:53 +010010983# else
micky3879b9f5e72025-07-08 18:04:53 -040010984 fprintf(fp, "%s\\n", NCURSES_VERSION);
Steve Kondikae271bc2015-11-15 02:50:53 +010010985# endif
10986#else
10987# ifdef __NCURSES_H
micky3879b9f5e72025-07-08 18:04:53 -040010988 fprintf(fp, "old\\n");
Steve Kondikae271bc2015-11-15 02:50:53 +010010989# else
micky3879b9f5e72025-07-08 18:04:53 -040010990 #error expected ncurses header to define __NCURSES_H
Steve Kondikae271bc2015-11-15 02:50:53 +010010991# endif
10992#endif
10993 ${cf_cv_main_return:-return}(0);
10994}
10995_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -040010996rm -f "conftest$ac_exeext"
10997if { (eval echo "$as_me:10997: \"$ac_link\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010010998 (eval $ac_link) 2>&5
10999 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040011000 echo "$as_me:11000: \$? = $ac_status" >&5
11001 (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
11002 { (eval echo "$as_me:11002: \"$ac_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010011003 (eval $ac_try) 2>&5
11004 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040011005 echo "$as_me:11005: \$? = $ac_status" >&5
11006 (exit "$ac_status"); }; }; then
Steve Kondikae271bc2015-11-15 02:50:53 +010011007
11008 cf_cv_ncurses_version=`cat $cf_tempfile`
11009else
11010 echo "$as_me: program exited with status $ac_status" >&5
11011echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -040011012cat "conftest.$ac_ext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010011013fi
micky3879b9f5e72025-07-08 18:04:53 -040011014rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
Steve Kondikae271bc2015-11-15 02:50:53 +010011015fi
micky3879b9f5e72025-07-08 18:04:53 -040011016 rm -f "$cf_tempfile"
Steve Kondikae271bc2015-11-15 02:50:53 +010011017
11018fi
micky3879b9f5e72025-07-08 18:04:53 -040011019echo "$as_me:11019: result: $cf_cv_ncurses_version" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010011020echo "${ECHO_T}$cf_cv_ncurses_version" >&6
11021test "$cf_cv_ncurses_version" = no ||
11022cat >>confdefs.h <<\EOF
11023#define NCURSES 1
11024EOF
11025
11026cf_nculib_root=ncurses
11027 # This works, except for the special case where we find gpm, but
11028 # ncurses is in a nonstandard location via $LIBS, and we really want
11029 # to link gpm.
11030cf_ncurses_LIBS=""
11031cf_ncurses_SAVE="$LIBS"
micky3879b9f5e72025-07-08 18:04:53 -040011032echo "$as_me:11032: checking for Gpm_Open in -lgpm" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010011033echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
11034if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
11035 echo $ECHO_N "(cached) $ECHO_C" >&6
11036else
11037 ac_check_lib_save_LIBS=$LIBS
11038LIBS="-lgpm $LIBS"
micky3879b9f5e72025-07-08 18:04:53 -040011039cat >"conftest.$ac_ext" <<_ACEOF
11040#line 11040 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +010011041#include "confdefs.h"
11042
11043/* Override any gcc2 internal prototype to avoid an error. */
11044#ifdef __cplusplus
11045extern "C"
11046#endif
11047/* We use char because int might match the return type of a gcc2
11048 builtin and then its argument prototype would still apply. */
micky3879b9f5e72025-07-08 18:04:53 -040011049char Gpm_Open (void);
Steve Kondikae271bc2015-11-15 02:50:53 +010011050int
micky3879b9f5e72025-07-08 18:04:53 -040011051main (void)
Steve Kondikae271bc2015-11-15 02:50:53 +010011052{
11053Gpm_Open ();
11054 ;
11055 return 0;
11056}
11057_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -040011058rm -f "conftest.$ac_objext" "conftest$ac_exeext"
11059if { (eval echo "$as_me:11059: \"$ac_link\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010011060 (eval $ac_link) 2>&5
11061 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040011062 echo "$as_me:11062: \$? = $ac_status" >&5
11063 (exit "$ac_status"); } &&
11064 { ac_try='test -s "conftest$ac_exeext"'
11065 { (eval echo "$as_me:11065: \"$ac_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010011066 (eval $ac_try) 2>&5
11067 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040011068 echo "$as_me:11068: \$? = $ac_status" >&5
11069 (exit "$ac_status"); }; }; then
Steve Kondikae271bc2015-11-15 02:50:53 +010011070 ac_cv_lib_gpm_Gpm_Open=yes
11071else
11072 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -040011073cat "conftest.$ac_ext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010011074ac_cv_lib_gpm_Gpm_Open=no
11075fi
micky3879b9f5e72025-07-08 18:04:53 -040011076rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
Steve Kondikae271bc2015-11-15 02:50:53 +010011077LIBS=$ac_check_lib_save_LIBS
11078fi
micky3879b9f5e72025-07-08 18:04:53 -040011079echo "$as_me:11079: result: $ac_cv_lib_gpm_Gpm_Open" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010011080echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
micky3879b9f5e72025-07-08 18:04:53 -040011081if test "$ac_cv_lib_gpm_Gpm_Open" = yes; then
11082 echo "$as_me:11082: checking for initscr in -lgpm" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010011083echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
11084if test "${ac_cv_lib_gpm_initscr+set}" = set; then
11085 echo $ECHO_N "(cached) $ECHO_C" >&6
11086else
11087 ac_check_lib_save_LIBS=$LIBS
11088LIBS="-lgpm $LIBS"
micky3879b9f5e72025-07-08 18:04:53 -040011089cat >"conftest.$ac_ext" <<_ACEOF
11090#line 11090 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +010011091#include "confdefs.h"
11092
11093/* Override any gcc2 internal prototype to avoid an error. */
11094#ifdef __cplusplus
11095extern "C"
11096#endif
11097/* We use char because int might match the return type of a gcc2
11098 builtin and then its argument prototype would still apply. */
micky3879b9f5e72025-07-08 18:04:53 -040011099char initscr (void);
Steve Kondikae271bc2015-11-15 02:50:53 +010011100int
micky3879b9f5e72025-07-08 18:04:53 -040011101main (void)
Steve Kondikae271bc2015-11-15 02:50:53 +010011102{
11103initscr ();
11104 ;
11105 return 0;
11106}
11107_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -040011108rm -f "conftest.$ac_objext" "conftest$ac_exeext"
11109if { (eval echo "$as_me:11109: \"$ac_link\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010011110 (eval $ac_link) 2>&5
11111 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040011112 echo "$as_me:11112: \$? = $ac_status" >&5
11113 (exit "$ac_status"); } &&
11114 { ac_try='test -s "conftest$ac_exeext"'
11115 { (eval echo "$as_me:11115: \"$ac_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010011116 (eval $ac_try) 2>&5
11117 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040011118 echo "$as_me:11118: \$? = $ac_status" >&5
11119 (exit "$ac_status"); }; }; then
Steve Kondikae271bc2015-11-15 02:50:53 +010011120 ac_cv_lib_gpm_initscr=yes
11121else
11122 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -040011123cat "conftest.$ac_ext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010011124ac_cv_lib_gpm_initscr=no
11125fi
micky3879b9f5e72025-07-08 18:04:53 -040011126rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
Steve Kondikae271bc2015-11-15 02:50:53 +010011127LIBS=$ac_check_lib_save_LIBS
11128fi
micky3879b9f5e72025-07-08 18:04:53 -040011129echo "$as_me:11129: result: $ac_cv_lib_gpm_initscr" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010011130echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
micky3879b9f5e72025-07-08 18:04:53 -040011131if test "$ac_cv_lib_gpm_initscr" = yes; then
Steve Kondikae271bc2015-11-15 02:50:53 +010011132 LIBS="$cf_ncurses_SAVE"
11133else
11134 cf_ncurses_LIBS="-lgpm"
11135fi
11136
11137fi
11138
micky3879b9f5e72025-07-08 18:04:53 -040011139case "$host_os" in
Steve Kondikae271bc2015-11-15 02:50:53 +010011140(freebsd*)
11141 # This is only necessary if you are linking against an obsolete
micky3879b9f5e72025-07-08 18:04:53 -040011142 # version of ncurses (but it should do no harm, since it is static).
Steve Kondikae271bc2015-11-15 02:50:53 +010011143 if test "$cf_nculib_root" = ncurses ; then
micky3879b9f5e72025-07-08 18:04:53 -040011144 echo "$as_me:11144: checking for tgoto in -lmytinfo" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010011145echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
11146if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
11147 echo $ECHO_N "(cached) $ECHO_C" >&6
11148else
11149 ac_check_lib_save_LIBS=$LIBS
11150LIBS="-lmytinfo $LIBS"
micky3879b9f5e72025-07-08 18:04:53 -040011151cat >"conftest.$ac_ext" <<_ACEOF
11152#line 11152 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +010011153#include "confdefs.h"
11154
11155/* Override any gcc2 internal prototype to avoid an error. */
11156#ifdef __cplusplus
11157extern "C"
11158#endif
11159/* We use char because int might match the return type of a gcc2
11160 builtin and then its argument prototype would still apply. */
micky3879b9f5e72025-07-08 18:04:53 -040011161char tgoto (void);
Steve Kondikae271bc2015-11-15 02:50:53 +010011162int
micky3879b9f5e72025-07-08 18:04:53 -040011163main (void)
Steve Kondikae271bc2015-11-15 02:50:53 +010011164{
11165tgoto ();
11166 ;
11167 return 0;
11168}
11169_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -040011170rm -f "conftest.$ac_objext" "conftest$ac_exeext"
11171if { (eval echo "$as_me:11171: \"$ac_link\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010011172 (eval $ac_link) 2>&5
11173 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040011174 echo "$as_me:11174: \$? = $ac_status" >&5
11175 (exit "$ac_status"); } &&
11176 { ac_try='test -s "conftest$ac_exeext"'
11177 { (eval echo "$as_me:11177: \"$ac_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010011178 (eval $ac_try) 2>&5
11179 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040011180 echo "$as_me:11180: \$? = $ac_status" >&5
11181 (exit "$ac_status"); }; }; then
Steve Kondikae271bc2015-11-15 02:50:53 +010011182 ac_cv_lib_mytinfo_tgoto=yes
11183else
11184 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -040011185cat "conftest.$ac_ext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010011186ac_cv_lib_mytinfo_tgoto=no
11187fi
micky3879b9f5e72025-07-08 18:04:53 -040011188rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
Steve Kondikae271bc2015-11-15 02:50:53 +010011189LIBS=$ac_check_lib_save_LIBS
11190fi
micky3879b9f5e72025-07-08 18:04:53 -040011191echo "$as_me:11191: result: $ac_cv_lib_mytinfo_tgoto" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010011192echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
micky3879b9f5e72025-07-08 18:04:53 -040011193if test "$ac_cv_lib_mytinfo_tgoto" = yes; then
Steve Kondikae271bc2015-11-15 02:50:53 +010011194 cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
11195fi
11196
11197 fi
11198 ;;
11199esac
11200
micky3879b9f5e72025-07-08 18:04:53 -040011201cf_add_libs="$LIBS"
11202# reverse order
11203cf_add_0lib=
11204for cf_add_1lib in $cf_ncurses_LIBS; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
11205# filter duplicates
11206for cf_add_1lib in $cf_add_0lib; do
11207 for cf_add_2lib in $cf_add_libs; do
11208 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
Steve Kondikae271bc2015-11-15 02:50:53 +010011209 cf_add_1lib=
11210 break
11211 fi
11212 done
micky3879b9f5e72025-07-08 18:04:53 -040011213 test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
Steve Kondikae271bc2015-11-15 02:50:53 +010011214done
11215LIBS="$cf_add_libs"
11216
micky3879b9f5e72025-07-08 18:04:53 -040011217if test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no"
Steve Kondikae271bc2015-11-15 02:50:53 +010011218then
11219
micky3879b9f5e72025-07-08 18:04:53 -040011220cf_add_libs="$LIBS"
11221# reverse order
11222cf_add_0lib=
11223for cf_add_1lib in -l$cf_nculib_root; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
11224# filter duplicates
11225for cf_add_1lib in $cf_add_0lib; do
11226 for cf_add_2lib in $cf_add_libs; do
11227 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
Steve Kondikae271bc2015-11-15 02:50:53 +010011228 cf_add_1lib=
11229 break
11230 fi
11231 done
micky3879b9f5e72025-07-08 18:04:53 -040011232 test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
Steve Kondikae271bc2015-11-15 02:50:53 +010011233done
11234LIBS="$cf_add_libs"
11235
11236else
11237
micky3879b9f5e72025-07-08 18:04:53 -040011238 eval 'cf_cv_have_lib_'"$cf_nculib_root"'=no'
Steve Kondikae271bc2015-11-15 02:50:53 +010011239 cf_libdir=""
micky3879b9f5e72025-07-08 18:04:53 -040011240 echo "$as_me:11240: checking for initscr" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010011241echo $ECHO_N "checking for initscr... $ECHO_C" >&6
11242if test "${ac_cv_func_initscr+set}" = set; then
11243 echo $ECHO_N "(cached) $ECHO_C" >&6
11244else
micky3879b9f5e72025-07-08 18:04:53 -040011245 cat >"conftest.$ac_ext" <<_ACEOF
11246#line 11246 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +010011247#include "confdefs.h"
micky3879b9f5e72025-07-08 18:04:53 -040011248#define initscr autoconf_temporary
11249#include <limits.h> /* least-intrusive standard header which defines gcc2 __stub macros */
11250#undef initscr
11251
Steve Kondikae271bc2015-11-15 02:50:53 +010011252#ifdef __cplusplus
11253extern "C"
11254#endif
micky3879b9f5e72025-07-08 18:04:53 -040011255
Steve Kondikae271bc2015-11-15 02:50:53 +010011256/* We use char because int might match the return type of a gcc2
11257 builtin and then its argument prototype would still apply. */
micky3879b9f5e72025-07-08 18:04:53 -040011258char initscr (void);
Steve Kondikae271bc2015-11-15 02:50:53 +010011259
11260int
micky3879b9f5e72025-07-08 18:04:53 -040011261main (void)
Steve Kondikae271bc2015-11-15 02:50:53 +010011262{
micky3879b9f5e72025-07-08 18:04:53 -040011263
11264/* The GNU C library defines stubs for functions which it implements
Steve Kondikae271bc2015-11-15 02:50:53 +010011265 to always fail with ENOSYS. Some functions are actually named
11266 something starting with __ and the normal name is an alias. */
11267#if defined (__stub_initscr) || defined (__stub___initscr)
micky3879b9f5e72025-07-08 18:04:53 -040011268#error found stub for initscr
Steve Kondikae271bc2015-11-15 02:50:53 +010011269#endif
11270
micky3879b9f5e72025-07-08 18:04:53 -040011271 return initscr ();
Steve Kondikae271bc2015-11-15 02:50:53 +010011272 ;
11273 return 0;
11274}
11275_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -040011276rm -f "conftest.$ac_objext" "conftest$ac_exeext"
11277if { (eval echo "$as_me:11277: \"$ac_link\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010011278 (eval $ac_link) 2>&5
11279 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040011280 echo "$as_me:11280: \$? = $ac_status" >&5
11281 (exit "$ac_status"); } &&
11282 { ac_try='test -s "conftest$ac_exeext"'
11283 { (eval echo "$as_me:11283: \"$ac_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010011284 (eval $ac_try) 2>&5
11285 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040011286 echo "$as_me:11286: \$? = $ac_status" >&5
11287 (exit "$ac_status"); }; }; then
Steve Kondikae271bc2015-11-15 02:50:53 +010011288 ac_cv_func_initscr=yes
11289else
11290 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -040011291cat "conftest.$ac_ext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010011292ac_cv_func_initscr=no
11293fi
micky3879b9f5e72025-07-08 18:04:53 -040011294rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
Steve Kondikae271bc2015-11-15 02:50:53 +010011295fi
micky3879b9f5e72025-07-08 18:04:53 -040011296echo "$as_me:11296: result: $ac_cv_func_initscr" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010011297echo "${ECHO_T}$ac_cv_func_initscr" >&6
micky3879b9f5e72025-07-08 18:04:53 -040011298if test "$ac_cv_func_initscr" = yes; then
11299 eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
Steve Kondikae271bc2015-11-15 02:50:53 +010011300else
11301
11302 cf_save_LIBS="$LIBS"
micky3879b9f5e72025-07-08 18:04:53 -040011303 echo "$as_me:11303: checking for initscr in -l$cf_nculib_root" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010011304echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
11305 LIBS="-l$cf_nculib_root $LIBS"
micky3879b9f5e72025-07-08 18:04:53 -040011306 cat >"conftest.$ac_ext" <<_ACEOF
11307#line 11307 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +010011308#include "confdefs.h"
11309#include <${cf_cv_ncurses_header:-curses.h}>
11310int
micky3879b9f5e72025-07-08 18:04:53 -040011311main (void)
Steve Kondikae271bc2015-11-15 02:50:53 +010011312{
11313initscr()
11314 ;
11315 return 0;
11316}
11317_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -040011318rm -f "conftest.$ac_objext" "conftest$ac_exeext"
11319if { (eval echo "$as_me:11319: \"$ac_link\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010011320 (eval $ac_link) 2>&5
11321 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040011322 echo "$as_me:11322: \$? = $ac_status" >&5
11323 (exit "$ac_status"); } &&
11324 { ac_try='test -s "conftest$ac_exeext"'
11325 { (eval echo "$as_me:11325: \"$ac_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010011326 (eval $ac_try) 2>&5
11327 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040011328 echo "$as_me:11328: \$? = $ac_status" >&5
11329 (exit "$ac_status"); }; }; then
11330 echo "$as_me:11330: result: yes" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010011331echo "${ECHO_T}yes" >&6
micky3879b9f5e72025-07-08 18:04:53 -040011332 eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
Steve Kondikae271bc2015-11-15 02:50:53 +010011333
11334else
11335 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -040011336cat "conftest.$ac_ext" >&5
11337echo "$as_me:11337: result: no" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010011338echo "${ECHO_T}no" >&6
11339
11340cf_search=
11341cf_library_path_list=""
11342if test -n "${LDFLAGS}${LIBS}" ; then
11343 for cf_library_path in $LDFLAGS $LIBS
11344 do
micky3879b9f5e72025-07-08 18:04:53 -040011345 case "$cf_library_path" in
Steve Kondikae271bc2015-11-15 02:50:53 +010011346 (-L*)
11347 cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
11348
11349test "x$cf_library_path" != "xNONE" && \
11350test -d "$cf_library_path" && \
11351 {
11352 test -n "$verbose" && echo " ... testing for lib-directories under $cf_library_path"
micky3879b9f5e72025-07-08 18:04:53 -040011353 test -d "$cf_library_path/lib" && cf_search="$cf_search $cf_library_path/lib"
11354 test -d "$cf_library_path/lib/$cf_nculib_root" && cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
11355 test -d "$cf_library_path/lib/$cf_nculib_root/lib" && cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
11356 test -d "$cf_library_path/$cf_nculib_root/lib" && cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
11357 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 +010011358}
11359
11360 cf_library_path_list="$cf_library_path_list $cf_search"
11361 ;;
11362 esac
11363 done
11364fi
11365
11366cf_search=
11367
11368test "x$prefix" != "xNONE" && \
11369test -d "$prefix" && \
11370 {
11371 test -n "$verbose" && echo " ... testing for lib-directories under $prefix"
micky3879b9f5e72025-07-08 18:04:53 -040011372 test -d "$prefix/lib" && cf_search="$cf_search $prefix/lib"
11373 test -d "$prefix/lib/$cf_nculib_root" && cf_search="$cf_search $prefix/lib/$cf_nculib_root"
11374 test -d "$prefix/lib/$cf_nculib_root/lib" && cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
11375 test -d "$prefix/$cf_nculib_root/lib" && cf_search="$cf_search $prefix/$cf_nculib_root/lib"
11376 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 +010011377}
11378
11379for cf_subdir_prefix in \
11380 /usr \
11381 /usr/local \
11382 /usr/pkg \
11383 /opt \
11384 /opt/local \
11385 $HOME
11386do
11387
11388test "x$cf_subdir_prefix" != "x$prefix" && \
11389test -d "$cf_subdir_prefix" && \
micky3879b9f5e72025-07-08 18:04:53 -040011390{ test -z "$prefix" || test "x$prefix" = xNONE || test "x$cf_subdir_prefix" != "x$prefix"; } && {
Steve Kondikae271bc2015-11-15 02:50:53 +010011391 test -n "$verbose" && echo " ... testing for lib-directories under $cf_subdir_prefix"
micky3879b9f5e72025-07-08 18:04:53 -040011392 test -d "$cf_subdir_prefix/lib" && cf_search="$cf_search $cf_subdir_prefix/lib"
11393 test -d "$cf_subdir_prefix/lib/$cf_nculib_root" && cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root"
11394 test -d "$cf_subdir_prefix/lib/$cf_nculib_root/lib" && cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root/lib"
11395 test -d "$cf_subdir_prefix/$cf_nculib_root/lib" && cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib"
11396 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 +010011397}
11398
11399done
11400
11401cf_search="$cf_library_path_list $cf_search"
11402
11403 for cf_libdir in $cf_search
11404 do
micky3879b9f5e72025-07-08 18:04:53 -040011405 echo "$as_me:11405: checking for -l$cf_nculib_root in $cf_libdir" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010011406echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
11407 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
micky3879b9f5e72025-07-08 18:04:53 -040011408 cat >"conftest.$ac_ext" <<_ACEOF
11409#line 11409 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +010011410#include "confdefs.h"
11411#include <${cf_cv_ncurses_header:-curses.h}>
11412int
micky3879b9f5e72025-07-08 18:04:53 -040011413main (void)
Steve Kondikae271bc2015-11-15 02:50:53 +010011414{
11415initscr()
11416 ;
11417 return 0;
11418}
11419_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -040011420rm -f "conftest.$ac_objext" "conftest$ac_exeext"
11421if { (eval echo "$as_me:11421: \"$ac_link\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010011422 (eval $ac_link) 2>&5
11423 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040011424 echo "$as_me:11424: \$? = $ac_status" >&5
11425 (exit "$ac_status"); } &&
11426 { ac_try='test -s "conftest$ac_exeext"'
11427 { (eval echo "$as_me:11427: \"$ac_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010011428 (eval $ac_try) 2>&5
11429 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040011430 echo "$as_me:11430: \$? = $ac_status" >&5
11431 (exit "$ac_status"); }; }; then
11432 echo "$as_me:11432: result: yes" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010011433echo "${ECHO_T}yes" >&6
micky3879b9f5e72025-07-08 18:04:53 -040011434 eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
Steve Kondikae271bc2015-11-15 02:50:53 +010011435 break
11436else
11437 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -040011438cat "conftest.$ac_ext" >&5
11439echo "$as_me:11439: result: no" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010011440echo "${ECHO_T}no" >&6
11441 LIBS="$cf_save_LIBS"
11442fi
micky3879b9f5e72025-07-08 18:04:53 -040011443rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
Steve Kondikae271bc2015-11-15 02:50:53 +010011444 done
11445
11446fi
micky3879b9f5e72025-07-08 18:04:53 -040011447rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
Steve Kondikae271bc2015-11-15 02:50:53 +010011448
11449fi
11450
micky3879b9f5e72025-07-08 18:04:53 -040011451eval 'cf_found_library="$cf_cv_have_lib_'"$cf_nculib_root"\"
Steve Kondikae271bc2015-11-15 02:50:53 +010011452
micky3879b9f5e72025-07-08 18:04:53 -040011453if test "$cf_found_library" = no ; then
11454 { { echo "$as_me:11454: error: Cannot link $cf_nculib_root library" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010011455echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
11456 { (exit 1); exit 1; }; }
11457fi
11458
11459fi
11460
11461if test -n "$cf_ncurses_LIBS" ; then
micky3879b9f5e72025-07-08 18:04:53 -040011462 echo "$as_me:11462: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010011463echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
11464 cf_ncurses_SAVE="$LIBS"
11465 for p in $cf_ncurses_LIBS ; do
micky3879b9f5e72025-07-08 18:04:53 -040011466 q=`echo "$LIBS" | sed -e "s%$p %%" -e "s%$p$%%"`
Steve Kondikae271bc2015-11-15 02:50:53 +010011467 if test "$q" != "$LIBS" ; then
11468 LIBS="$q"
11469 fi
11470 done
micky3879b9f5e72025-07-08 18:04:53 -040011471 cat >"conftest.$ac_ext" <<_ACEOF
11472#line 11472 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +010011473#include "confdefs.h"
11474#include <${cf_cv_ncurses_header:-curses.h}>
11475int
micky3879b9f5e72025-07-08 18:04:53 -040011476main (void)
Steve Kondikae271bc2015-11-15 02:50:53 +010011477{
micky3879b9f5e72025-07-08 18:04:53 -040011478initscr(); mousemask(0,0); tigetstr((char *)0);
Steve Kondikae271bc2015-11-15 02:50:53 +010011479 ;
11480 return 0;
11481}
11482_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -040011483rm -f "conftest.$ac_objext" "conftest$ac_exeext"
11484if { (eval echo "$as_me:11484: \"$ac_link\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010011485 (eval $ac_link) 2>&5
11486 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040011487 echo "$as_me:11487: \$? = $ac_status" >&5
11488 (exit "$ac_status"); } &&
11489 { ac_try='test -s "conftest$ac_exeext"'
11490 { (eval echo "$as_me:11490: \"$ac_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010011491 (eval $ac_try) 2>&5
11492 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040011493 echo "$as_me:11493: \$? = $ac_status" >&5
11494 (exit "$ac_status"); }; }; then
11495 echo "$as_me:11495: result: yes" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010011496echo "${ECHO_T}yes" >&6
11497else
11498 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -040011499cat "conftest.$ac_ext" >&5
11500echo "$as_me:11500: result: no" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010011501echo "${ECHO_T}no" >&6
11502 LIBS="$cf_ncurses_SAVE"
11503fi
micky3879b9f5e72025-07-08 18:04:53 -040011504rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
Steve Kondikae271bc2015-11-15 02:50:53 +010011505fi
11506
11507cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
11508
11509cat >>confdefs.h <<EOF
11510#define $cf_nculib_ROOT 1
11511EOF
11512
11513 fi
11514else
11515 NCURSES_CONFIG=none
11516fi
11517
11518fi
11519
11520if test "$NCURSES_CONFIG_PKG" != none ; then
11521 cf_version=`$PKG_CONFIG --modversion $NCURSES_CONFIG_PKG 2>/dev/null`
11522
11523 NCURSES_MAJOR=`echo "$cf_version" | sed -e 's/\..*//'`
11524 NCURSES_MINOR=`echo "$cf_version" | sed -e 's/^[0-9][0-9]*\.//' -e 's/\..*//'`
11525 NCURSES_PATCH=`echo "$cf_version" | sed -e 's/^[0-9][0-9]*\.[0-9][0-9]*\.//'`
11526
11527 cf_cv_abi_version=`$PKG_CONFIG --variable=abi_version $NCURSES_CONFIG_PKG 2>/dev/null`
11528 if test -z "$cf_cv_abi_version"
11529 then
11530 cf_cv_abi_version=`$PKG_CONFIG --variable=major_version $NCURSES_CONFIG_PKG 2>/dev/null`
11531 fi
11532
11533elif test "$NCURSES_CONFIG" != none ; then
11534
11535 cf_version=`$NCURSES_CONFIG --version 2>/dev/null`
11536
11537 NCURSES_MAJOR=`echo "$cf_version" | sed -e 's/\..*//'`
11538 NCURSES_MINOR=`echo "$cf_version" | sed -e 's/^[0-9][0-9]*\.//' -e 's/\..*//'`
11539 NCURSES_PATCH=`echo "$cf_version" | sed -e 's/^[0-9][0-9]*\.[0-9][0-9]*\.//'`
11540
11541 # ABI version is not available from headers
11542 cf_cv_abi_version=`$NCURSES_CONFIG --abi-version 2>/dev/null`
11543
11544else
11545
11546 for cf_name in MAJOR MINOR PATCH
11547 do
11548 cat >conftest.$ac_ext <<CF_EOF
11549 #include <${cf_cv_ncurses_header:-curses.h}>
11550 AUTOCONF_$cf_name NCURSES_VERSION_$cf_name
11551CF_EOF
11552 cf_try="$ac_cpp conftest.$ac_ext 2>&5 | fgrep AUTOCONF_$cf_name >conftest.out"
micky3879b9f5e72025-07-08 18:04:53 -040011553 { (eval echo "$as_me:11553: \"$cf_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010011554 (eval $cf_try) 2>&5
11555 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040011556 echo "$as_me:11556: \$? = $ac_status" >&5
11557 (exit "$ac_status"); }
Steve Kondikae271bc2015-11-15 02:50:53 +010011558 if test -f conftest.out ; then
micky3879b9f5e72025-07-08 18:04:53 -040011559 cf_result=`sed -e "s/^.*AUTOCONF_${cf_name}[ ][ ]*//" conftest.out`
Steve Kondikae271bc2015-11-15 02:50:53 +010011560 eval NCURSES_$cf_name=\"$cf_result\"
11561 # cat conftest.$ac_ext
11562 # cat conftest.out
11563 fi
11564 done
11565
11566 cf_cv_abi_version=${NCURSES_MAJOR}
11567
11568fi
11569
11570cf_cv_rel_version=${NCURSES_MAJOR}.${NCURSES_MINOR}
11571
11572cf_cv_timestamp=`date`
11573
micky3879b9f5e72025-07-08 18:04:53 -040011574echo "$as_me:11574: result: Configuring NCURSES $cf_cv_rel_version ABI $cf_cv_abi_version ($cf_cv_timestamp)" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010011575echo "${ECHO_T}Configuring NCURSES $cf_cv_rel_version ABI $cf_cv_abi_version ($cf_cv_timestamp)" >&6
11576
micky3879b9f5e72025-07-08 18:04:53 -040011577echo "$as_me:11577: checking if you want to have a library-prefix" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010011578echo $ECHO_N "checking if you want to have a library-prefix... $ECHO_C" >&6
11579
11580# Check whether --with-lib-prefix or --without-lib-prefix was given.
11581if test "${with_lib_prefix+set}" = set; then
11582 withval="$with_lib_prefix"
11583 with_lib_prefix=$withval
11584else
11585 with_lib_prefix=auto
11586fi;
micky3879b9f5e72025-07-08 18:04:53 -040011587echo "$as_me:11587: result: $with_lib_prefix" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010011588echo "${ECHO_T}$with_lib_prefix" >&6
11589
micky3879b9f5e72025-07-08 18:04:53 -040011590if test "$with_lib_prefix" = auto
Steve Kondikae271bc2015-11-15 02:50:53 +010011591then
11592
micky3879b9f5e72025-07-08 18:04:53 -040011593 case "$cf_cv_system_name" in
Steve Kondikae271bc2015-11-15 02:50:53 +010011594 (OS/2*|os2*)
micky3879b9f5e72025-07-08 18:04:53 -040011595 if test "$DFT_LWR_MODEL" = libtool; then
11596 LIB_PREFIX='lib'
11597 else
11598 LIB_PREFIX=''
11599 fi
11600 ;;
11601 (*-msvc*)
Steve Kondikae271bc2015-11-15 02:50:53 +010011602 LIB_PREFIX=''
11603 ;;
11604 (*) LIB_PREFIX='lib'
11605 ;;
11606 esac
11607cf_prefix=$LIB_PREFIX
11608
micky3879b9f5e72025-07-08 18:04:53 -040011609elif test "$with_lib_prefix" = no
Steve Kondikae271bc2015-11-15 02:50:53 +010011610then
11611 LIB_PREFIX=
11612else
11613 LIB_PREFIX=$with_lib_prefix
11614fi
11615
11616LIB_SUFFIX=
11617
11618###############################################################################
11619
11620if test X"$CC_G_OPT" = X"" ; then
11621 CC_G_OPT='-g'
11622 test -n "$GCC" && test "${ac_cv_prog_cc_g}" != yes && CC_G_OPT=''
11623fi
11624
micky3879b9f5e72025-07-08 18:04:53 -040011625echo "$as_me:11625: checking for default loader flags" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010011626echo $ECHO_N "checking for default loader flags... $ECHO_C" >&6
11627case $DFT_LWR_MODEL in
11628(normal) LD_MODEL='' ;;
11629(debug) LD_MODEL=$CC_G_OPT ;;
11630(profile) LD_MODEL='-pg';;
11631(shared) LD_MODEL='' ;;
11632esac
micky3879b9f5e72025-07-08 18:04:53 -040011633echo "$as_me:11633: result: $LD_MODEL" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010011634echo "${ECHO_T}$LD_MODEL" >&6
11635
11636LD_RPATH_OPT=
micky3879b9f5e72025-07-08 18:04:53 -040011637if test "x$cf_cv_enable_rpath" != xno
11638then
11639 echo "$as_me:11639: checking for an rpath option" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010011640echo $ECHO_N "checking for an rpath option... $ECHO_C" >&6
micky3879b9f5e72025-07-08 18:04:53 -040011641 case "$cf_cv_system_name" in
11642 (irix*)
11643 if test "$GCC" = yes; then
11644 LD_RPATH_OPT="-Wl,-rpath,"
11645 else
11646 LD_RPATH_OPT="-rpath "
11647 fi
11648 ;;
11649 (linux*|gnu*|k*bsd*-gnu|freebsd*)
Steve Kondikae271bc2015-11-15 02:50:53 +010011650 LD_RPATH_OPT="-Wl,-rpath,"
micky3879b9f5e72025-07-08 18:04:53 -040011651 ;;
11652 (openbsd[2-9].*|mirbsd*)
11653 LD_RPATH_OPT="-Wl,-rpath,"
11654 ;;
11655 (dragonfly*)
Steve Kondikae271bc2015-11-15 02:50:53 +010011656 LD_RPATH_OPT="-rpath "
micky3879b9f5e72025-07-08 18:04:53 -040011657 ;;
11658 (netbsd*)
11659 LD_RPATH_OPT="-Wl,-rpath,"
11660 ;;
11661 (osf*|mls+*)
11662 LD_RPATH_OPT="-rpath "
11663 ;;
11664 (solaris2*)
11665 LD_RPATH_OPT="-R"
11666 ;;
11667 (*)
11668 ;;
11669 esac
11670 echo "$as_me:11670: result: $LD_RPATH_OPT" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010011671echo "${ECHO_T}$LD_RPATH_OPT" >&6
11672
micky3879b9f5e72025-07-08 18:04:53 -040011673 case "x$LD_RPATH_OPT" in
11674 (x-R*)
11675 echo "$as_me:11675: checking if we need a space after rpath option" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010011676echo $ECHO_N "checking if we need a space after rpath option... $ECHO_C" >&6
micky3879b9f5e72025-07-08 18:04:53 -040011677 cf_save_LIBS="$LIBS"
Steve Kondikae271bc2015-11-15 02:50:53 +010011678
micky3879b9f5e72025-07-08 18:04:53 -040011679cf_add_libs="$LIBS"
11680# reverse order
11681cf_add_0lib=
11682for cf_add_1lib in ${LD_RPATH_OPT}$libdir; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
11683# filter duplicates
11684for cf_add_1lib in $cf_add_0lib; do
11685 for cf_add_2lib in $cf_add_libs; do
11686 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
Steve Kondikae271bc2015-11-15 02:50:53 +010011687 cf_add_1lib=
11688 break
11689 fi
11690 done
micky3879b9f5e72025-07-08 18:04:53 -040011691 test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
Steve Kondikae271bc2015-11-15 02:50:53 +010011692done
11693LIBS="$cf_add_libs"
11694
micky3879b9f5e72025-07-08 18:04:53 -040011695 cat >"conftest.$ac_ext" <<_ACEOF
11696#line 11696 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +010011697#include "confdefs.h"
11698
11699int
micky3879b9f5e72025-07-08 18:04:53 -040011700main (void)
Steve Kondikae271bc2015-11-15 02:50:53 +010011701{
11702
11703 ;
11704 return 0;
11705}
11706_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -040011707rm -f "conftest.$ac_objext" "conftest$ac_exeext"
11708if { (eval echo "$as_me:11708: \"$ac_link\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010011709 (eval $ac_link) 2>&5
11710 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040011711 echo "$as_me:11711: \$? = $ac_status" >&5
11712 (exit "$ac_status"); } &&
11713 { ac_try='test -s "conftest$ac_exeext"'
11714 { (eval echo "$as_me:11714: \"$ac_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010011715 (eval $ac_try) 2>&5
11716 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040011717 echo "$as_me:11717: \$? = $ac_status" >&5
11718 (exit "$ac_status"); }; }; then
Steve Kondikae271bc2015-11-15 02:50:53 +010011719 cf_rpath_space=no
11720else
11721 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -040011722cat "conftest.$ac_ext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010011723cf_rpath_space=yes
11724fi
micky3879b9f5e72025-07-08 18:04:53 -040011725rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
11726 LIBS="$cf_save_LIBS"
11727 echo "$as_me:11727: result: $cf_rpath_space" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010011728echo "${ECHO_T}$cf_rpath_space" >&6
micky3879b9f5e72025-07-08 18:04:53 -040011729 test "$cf_rpath_space" = yes && LD_RPATH_OPT="$LD_RPATH_OPT "
11730 ;;
11731 esac
11732fi
Steve Kondikae271bc2015-11-15 02:50:53 +010011733
11734 RM_SHARED_OPTS=
11735 LOCAL_LDFLAGS=
11736 LOCAL_LDFLAGS2=
11737 LD_SHARED_OPTS=
11738 INSTALL_LIB="-m 644"
11739 : ${rel_builddir:=.}
11740
11741 shlibdir=$libdir
11742
11743 MAKE_DLLS="#"
11744
11745 cf_cv_do_symlinks=no
11746 cf_ld_rpath_opt=
11747 test "$cf_cv_enable_rpath" = yes && cf_ld_rpath_opt="$LD_RPATH_OPT"
11748
micky3879b9f5e72025-07-08 18:04:53 -040011749 echo "$as_me:11749: checking whether to use release or ABI version in shared library file names" >&5
11750echo $ECHO_N "checking whether to use release or ABI version in shared library file names... $ECHO_C" >&6
Steve Kondikae271bc2015-11-15 02:50:53 +010011751
11752# Check whether --with-shlib-version or --without-shlib-version was given.
11753if test "${with_shlib_version+set}" = set; then
11754 withval="$with_shlib_version"
11755 test -z "$withval" && withval=auto
micky3879b9f5e72025-07-08 18:04:53 -040011756 case "$withval" in
Steve Kondikae271bc2015-11-15 02:50:53 +010011757 (yes)
11758 cf_cv_shlib_version=auto
11759 ;;
micky3879b9f5e72025-07-08 18:04:53 -040011760 (rel|abi|auto)
Steve Kondikae271bc2015-11-15 02:50:53 +010011761 cf_cv_shlib_version=$withval
11762 ;;
11763 (*)
micky3879b9f5e72025-07-08 18:04:53 -040011764 echo "$as_me:11764: result: $withval" >&5
11765echo "${ECHO_T}$withval" >&6
11766 { { echo "$as_me:11766: error: option value must be one of: rel, abi, or auto" >&5
11767echo "$as_me: error: option value must be one of: rel, abi, or auto" >&2;}
Steve Kondikae271bc2015-11-15 02:50:53 +010011768 { (exit 1); exit 1; }; }
11769 ;;
11770 esac
11771
11772else
11773 cf_cv_shlib_version=auto
11774fi;
micky3879b9f5e72025-07-08 18:04:53 -040011775 echo "$as_me:11775: result: $cf_cv_shlib_version" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010011776echo "${ECHO_T}$cf_cv_shlib_version" >&6
11777
11778 cf_cv_rm_so_locs=no
11779 cf_try_cflags=
11780
11781 # Some less-capable ports of gcc support only -fpic
11782 CC_SHARED_OPTS=
micky3879b9f5e72025-07-08 18:04:53 -040011783
11784 cf_try_fPIC=no
Steve Kondikae271bc2015-11-15 02:50:53 +010011785 if test "$GCC" = yes
11786 then
micky3879b9f5e72025-07-08 18:04:53 -040011787 cf_try_fPIC=yes
11788 else
11789 case "$cf_cv_system_name" in
11790 (*linux*) # e.g., PGI compiler
11791 cf_try_fPIC=yes
11792 ;;
11793 esac
11794 fi
11795
11796 if test "$cf_try_fPIC" = yes
11797 then
11798 echo "$as_me:11798: checking which $CC option to use" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010011799echo $ECHO_N "checking which $CC option to use... $ECHO_C" >&6
11800 cf_save_CFLAGS="$CFLAGS"
11801 for CC_SHARED_OPTS in -fPIC -fpic ''
11802 do
11803 CFLAGS="$cf_save_CFLAGS $CC_SHARED_OPTS"
micky3879b9f5e72025-07-08 18:04:53 -040011804 cat >"conftest.$ac_ext" <<_ACEOF
11805#line 11805 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +010011806#include "confdefs.h"
11807#include <stdio.h>
11808int
micky3879b9f5e72025-07-08 18:04:53 -040011809main (void)
Steve Kondikae271bc2015-11-15 02:50:53 +010011810{
micky3879b9f5e72025-07-08 18:04:53 -040011811int x = 1; (void)x
Steve Kondikae271bc2015-11-15 02:50:53 +010011812 ;
11813 return 0;
11814}
11815_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -040011816rm -f "conftest.$ac_objext"
11817if { (eval echo "$as_me:11817: \"$ac_compile\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010011818 (eval $ac_compile) 2>&5
11819 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040011820 echo "$as_me:11820: \$? = $ac_status" >&5
11821 (exit "$ac_status"); } &&
11822 { ac_try='test -s "conftest.$ac_objext"'
11823 { (eval echo "$as_me:11823: \"$ac_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010011824 (eval $ac_try) 2>&5
11825 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040011826 echo "$as_me:11826: \$? = $ac_status" >&5
11827 (exit "$ac_status"); }; }; then
Steve Kondikae271bc2015-11-15 02:50:53 +010011828 break
11829else
11830 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -040011831cat "conftest.$ac_ext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010011832fi
micky3879b9f5e72025-07-08 18:04:53 -040011833rm -f "conftest.$ac_objext" "conftest.$ac_ext"
Steve Kondikae271bc2015-11-15 02:50:53 +010011834 done
micky3879b9f5e72025-07-08 18:04:53 -040011835 echo "$as_me:11835: result: $CC_SHARED_OPTS" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010011836echo "${ECHO_T}$CC_SHARED_OPTS" >&6
11837 CFLAGS="$cf_save_CFLAGS"
11838 fi
11839
11840 cf_cv_shlib_version_infix=no
11841
micky3879b9f5e72025-07-08 18:04:53 -040011842 case "$cf_cv_system_name" in
Steve Kondikae271bc2015-11-15 02:50:53 +010011843 (aix4.3-9*|aix[5-7]*)
11844 if test "$GCC" = yes; then
11845 CC_SHARED_OPTS='-Wl,-brtl'
micky3879b9f5e72025-07-08 18:04:53 -040011846 MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-brtl -Wl,-blibpath:${RPATH_LIST}:/usr/lib -o $@'
Steve Kondikae271bc2015-11-15 02:50:53 +010011847 else
11848 CC_SHARED_OPTS='-brtl'
11849 # as well as '-qpic=large -G' or perhaps "-bM:SRE -bnoentry -bexpall"
micky3879b9f5e72025-07-08 18:04:53 -040011850 MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -G -Wl,-brtl -Wl,-blibpath:${RPATH_LIST}:/usr/lib -o $@'
Steve Kondikae271bc2015-11-15 02:50:53 +010011851 fi
11852 ;;
11853 (beos*)
micky3879b9f5e72025-07-08 18:04:53 -040011854 MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -o $@ -Xlinker -soname=`basename $@` -nostart -e 0'
Steve Kondikae271bc2015-11-15 02:50:53 +010011855 ;;
11856 (cygwin*)
11857 CC_SHARED_OPTS=
11858 MK_SHARED_LIB=$SHELL' '$rel_builddir'/mk_shared_lib.sh $@ ${CC} ${CFLAGS}'
11859 RM_SHARED_OPTS="$RM_SHARED_OPTS $rel_builddir/mk_shared_lib.sh *.dll.a"
11860 cf_cv_shlib_version=cygdll
11861 cf_cv_shlib_version_infix=cygdll
11862 shlibdir=$bindir
11863 MAKE_DLLS=
11864 cat >mk_shared_lib.sh <<-CF_EOF
11865 #!$SHELL
11866 SHARED_LIB=\$1
11867 IMPORT_LIB=\`echo "\$1" | sed -e 's/cyg/lib/' -e 's/[0-9]*\.dll$/.dll.a/'\`
11868 shift
11869 cat <<-EOF
11870 Linking shared library
11871 ** SHARED_LIB \$SHARED_LIB
11872 ** IMPORT_LIB \$IMPORT_LIB
11873EOF
micky3879b9f5e72025-07-08 18:04:53 -040011874 exec \$* ${LDFLAGS} -shared -Wl,--out-implib=\${IMPORT_LIB} -Wl,--export-all-symbols -o \${SHARED_LIB}
Steve Kondikae271bc2015-11-15 02:50:53 +010011875CF_EOF
11876 chmod +x mk_shared_lib.sh
11877 ;;
11878 (msys*)
11879 CC_SHARED_OPTS=
11880 MK_SHARED_LIB=$SHELL' '$rel_builddir'/mk_shared_lib.sh $@ ${CC} ${CFLAGS}'
11881 RM_SHARED_OPTS="$RM_SHARED_OPTS $rel_builddir/mk_shared_lib.sh *.dll.a"
11882 cf_cv_shlib_version=msysdll
11883 cf_cv_shlib_version_infix=msysdll
11884 shlibdir=$bindir
11885 MAKE_DLLS=
11886 cat >mk_shared_lib.sh <<-CF_EOF
11887 #!$SHELL
11888 SHARED_LIB=\$1
11889 IMPORT_LIB=\`echo "\$1" | sed -e 's/msys-/lib/' -e 's/[0-9]*\.dll$/.dll.a/'\`
11890 shift
11891 cat <<-EOF
11892 Linking shared library
11893 ** SHARED_LIB \$SHARED_LIB
11894 ** IMPORT_LIB \$IMPORT_LIB
11895EOF
micky3879b9f5e72025-07-08 18:04:53 -040011896 exec \$* ${LDFLAGS} -shared -Wl,--out-implib=\${IMPORT_LIB} -Wl,--export-all-symbols -o \${SHARED_LIB}
Steve Kondikae271bc2015-11-15 02:50:53 +010011897CF_EOF
11898 chmod +x mk_shared_lib.sh
11899 ;;
11900 (darwin*)
11901 cf_try_cflags="no-cpp-precomp"
11902 CC_SHARED_OPTS="-dynamic"
micky3879b9f5e72025-07-08 18:04:53 -040011903 MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -dynamiclib -install_name ${libdir}/`basename $@` -compatibility_version ${ABI_VERSION} -current_version ${ABI_VERSION} -o $@'
Steve Kondikae271bc2015-11-15 02:50:53 +010011904 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=abi
11905 cf_cv_shlib_version_infix=yes
micky3879b9f5e72025-07-08 18:04:53 -040011906 echo "$as_me:11906: checking if ld -search_paths_first works" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010011907echo $ECHO_N "checking if ld -search_paths_first works... $ECHO_C" >&6
11908if test "${cf_cv_ldflags_search_paths_first+set}" = set; then
11909 echo $ECHO_N "(cached) $ECHO_C" >&6
11910else
11911
11912 cf_save_LDFLAGS=$LDFLAGS
11913 LDFLAGS="$LDFLAGS -Wl,-search_paths_first"
micky3879b9f5e72025-07-08 18:04:53 -040011914 cat >"conftest.$ac_ext" <<_ACEOF
11915#line 11915 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +010011916#include "confdefs.h"
11917
11918int
micky3879b9f5e72025-07-08 18:04:53 -040011919main (void)
Steve Kondikae271bc2015-11-15 02:50:53 +010011920{
11921int i;
11922 ;
11923 return 0;
11924}
11925_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -040011926rm -f "conftest.$ac_objext" "conftest$ac_exeext"
11927if { (eval echo "$as_me:11927: \"$ac_link\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010011928 (eval $ac_link) 2>&5
11929 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040011930 echo "$as_me:11930: \$? = $ac_status" >&5
11931 (exit "$ac_status"); } &&
11932 { ac_try='test -s "conftest$ac_exeext"'
11933 { (eval echo "$as_me:11933: \"$ac_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010011934 (eval $ac_try) 2>&5
11935 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040011936 echo "$as_me:11936: \$? = $ac_status" >&5
11937 (exit "$ac_status"); }; }; then
Steve Kondikae271bc2015-11-15 02:50:53 +010011938 cf_cv_ldflags_search_paths_first=yes
11939else
11940 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -040011941cat "conftest.$ac_ext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010011942cf_cv_ldflags_search_paths_first=no
11943fi
micky3879b9f5e72025-07-08 18:04:53 -040011944rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
Steve Kondikae271bc2015-11-15 02:50:53 +010011945 LDFLAGS=$cf_save_LDFLAGS
11946fi
micky3879b9f5e72025-07-08 18:04:53 -040011947echo "$as_me:11947: result: $cf_cv_ldflags_search_paths_first" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010011948echo "${ECHO_T}$cf_cv_ldflags_search_paths_first" >&6
micky3879b9f5e72025-07-08 18:04:53 -040011949 if test "$cf_cv_ldflags_search_paths_first" = yes; then
Steve Kondikae271bc2015-11-15 02:50:53 +010011950 LDFLAGS="$LDFLAGS -Wl,-search_paths_first"
11951 fi
11952 ;;
micky3879b9f5e72025-07-08 18:04:53 -040011953 (haiku*)
11954
11955 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
11956 if test "$cf_cv_shlib_version" = rel; then
11957 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
11958 else
11959 cf_cv_shared_soname='`basename $@`'
11960 fi
11961
11962 MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-soname,'$cf_cv_shared_soname',-stats,-lc -o $@'
11963 ;;
Steve Kondikae271bc2015-11-15 02:50:53 +010011964 (hpux[7-8]*)
11965 # HP-UX 8.07 ld lacks "+b" option used for libdir search-list
11966 if test "$GCC" != yes; then
11967 CC_SHARED_OPTS='+Z'
11968 fi
micky3879b9f5e72025-07-08 18:04:53 -040011969 MK_SHARED_LIB='${LD} ${LDFLAGS} -b -o $@'
Steve Kondikae271bc2015-11-15 02:50:53 +010011970 INSTALL_LIB="-m 555"
11971 ;;
11972 (hpux*)
11973 # (tested with gcc 2.7.2 -- I don't have c89)
11974 if test "$GCC" = yes; then
11975 LD_SHARED_OPTS='-Xlinker +b -Xlinker ${libdir}'
11976 else
11977 CC_SHARED_OPTS='+Z'
11978 LD_SHARED_OPTS='-Wl,+b,${libdir}'
11979 fi
micky3879b9f5e72025-07-08 18:04:53 -040011980 MK_SHARED_LIB='${LD} ${LDFLAGS} +b ${libdir} -b -o $@'
Steve Kondikae271bc2015-11-15 02:50:53 +010011981 # HP-UX shared libraries must be executable, and should be
11982 # readonly to exploit a quirk in the memory manager.
11983 INSTALL_LIB="-m 555"
11984 ;;
11985 (interix*)
11986 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
11987 if test "$cf_cv_shlib_version" = rel; then
micky3879b9f5e72025-07-08 18:04:53 -040011988 cf_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
Steve Kondikae271bc2015-11-15 02:50:53 +010011989 else
micky3879b9f5e72025-07-08 18:04:53 -040011990 cf_shared_soname='`basename $@`'
Steve Kondikae271bc2015-11-15 02:50:53 +010011991 fi
11992 CC_SHARED_OPTS=
micky3879b9f5e72025-07-08 18:04:53 -040011993 MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-rpath,${RPATH_LIST} -Wl,-h,'$cf_shared_soname' -o $@'
Steve Kondikae271bc2015-11-15 02:50:53 +010011994 ;;
11995 (irix*)
11996 if test "$cf_cv_enable_rpath" = yes ; then
11997 EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
11998 fi
11999 # tested with IRIX 5.2 and 'cc'.
12000 if test "$GCC" != yes; then
12001 CC_SHARED_OPTS='-KPIC'
micky3879b9f5e72025-07-08 18:04:53 -040012002 MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -rdata_shared -soname `basename $@` -o $@'
Steve Kondikae271bc2015-11-15 02:50:53 +010012003 else
micky3879b9f5e72025-07-08 18:04:53 -040012004 MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-soname,`basename $@` -o $@'
Steve Kondikae271bc2015-11-15 02:50:53 +010012005 fi
12006 cf_cv_rm_so_locs=yes
12007 ;;
12008 (linux*|gnu*|k*bsd*-gnu)
micky3879b9f5e72025-07-08 18:04:53 -040012009 if test "$DFT_LWR_MODEL" = "shared" && test -n "$LD_RPATH_OPT" ; then
Steve Kondikae271bc2015-11-15 02:50:53 +010012010 LOCAL_LDFLAGS="${LD_RPATH_OPT}\$(LOCAL_LIBDIR)"
12011 LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
12012 fi
12013 if test "$cf_cv_enable_rpath" = yes ; then
12014 EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
12015 fi
12016
12017 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
12018 if test "$cf_cv_shlib_version" = rel; then
12019 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
12020 else
12021 cf_cv_shared_soname='`basename $@`'
12022 fi
12023
micky3879b9f5e72025-07-08 18:04:53 -040012024 MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-soname,'$cf_cv_shared_soname',-stats,-lc -o $@'
12025 ;;
12026 (mingw*msvc*)
12027 cf_cv_shlib_version=msvcdll
12028 cf_cv_shlib_version_infix=msvcdll
12029 shlibdir=$bindir
12030 MAKE_DLLS=
12031 if test "$DFT_LWR_MODEL" = "shared" ; then
12032 LOCAL_LDFLAGS="-link -dll"
12033 LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
12034 EXTRA_LDFLAGS="-link -dll $EXTRA_LDFLAGS"
12035 fi
12036 CC_SHARED_OPTS=
12037 MK_SHARED_LIB=$SHELL' '$rel_builddir'/mk_shared_lib.sh $@ ${LD} ${CFLAGS}'
12038 RM_SHARED_OPTS="$RM_SHARED_OPTS $rel_builddir/mk_shared_lib.sh *.dll.lib"
12039 cat >mk_shared_lib.sh <<-CF_EOF
12040 #!$SHELL
12041 SHARED_LIB=\$1
12042 IMPORT_LIB=\`echo "\$1" | sed -e 's/[0-9]*\.dll$/.dll.lib/'\`
12043 shift
12044 my_ld=\$1
12045 shift
12046 cat <<-EOF
12047 Linking shared library
12048 ** SHARED LIB \$SHARED_LIB
12049 ** IMPORT_LIB \$IMPORT_LIB
12050EOF
12051 args=\$(echo \$* | sed -E "s#-l(\w*)#\1.dll.lib#g" | sed -E "s#-L(\w*)#-LIBPATH:\1#g")
12052 exec \$my_ld -DLL -IMPLIB:"\${IMPORT_LIB}" -OUT:"\${SHARED_LIB}" ${LDFLAGS} \$args
12053 mv "\${IMPORT_LIB}" "\${IMPORT_LIB}"
12054CF_EOF
12055 chmod +x mk_shared_lib.sh
12056 cat >mk_prog.sh <<-CF_EOF
12057 #!$SHELL
12058 shift
12059 # Ignore first argument (compiler) and use LD (link.exe) unconditionally
12060 LD="$LD"
12061 clopts=()
12062 ldopts=("/subsystem:console")
12063 libs=()
12064 isdll=0
12065 while test \$# -gt 0; do
12066 case "\$1" in
12067 -link)
12068 # ignore -link argument
12069 ;;
12070 -M[TD] | -M[TD]d)
12071 # ignore runtime-library option
12072 ;;
12073 -dll)
12074 isdll=1
12075 ;;
12076 -W* | -w*)
12077 # ignore warnings
12078 ;;
12079 -D*)
12080 clopts+=("\$1")
12081 ;;
12082 -I*)
12083 clopts+=("\$1")
12084 ;;
12085 -l*)
12086 libs+=("\`echo \"\$1\" | sed \"s/^-l//\"\`")
12087 ;;
12088 -L*)
12089 ldopts+=("\`echo \"\$1\" | sed \"s/^-L/-LIBPATH:/\"\`")
12090 ;;
12091 *.obj | *.o)
12092 ldopts+=("\$1")
12093 ;;
12094 -Wl,*)
12095 for linkarg in \`echo '\$1' | sed -e 's/-Wl,//' -e 's/,/ /'\`; do
12096 ldopts+=("\${linkarg}")
12097 done
12098 ;;
12099 *.lib)
12100 ldopts+=("\$1")
12101 ;;
12102 -o)
12103 shift
12104 ldopts+=("-out:\$1")
12105 ;;
12106 *)
12107 clopts+=("\$1")
12108 ldopts+=("\$1")
12109 ;;
12110 esac
12111 shift
12112 done
12113 if [ "\$isdll" -ne 0 ]; then
12114 for lib in \${libs[*]}; do
12115 ldopts+=("\$lib.dll.lib")
12116 done
12117 else
12118 for lib in \${libs[*]}; do
12119 ldopts+=("\$lib.lib")
12120 done
12121 fi
12122 cat <<-EOF
12123 Creating program
12124 ** ld options: "\${ldopts[@]}"
12125EOF
12126 exec \$LD \${ldopts[@]}
12127CF_EOF
12128 chmod +x mk_prog.sh
12129 LINK_PROGS="$SHELL ${rel_builddir}/mk_prog.sh"
12130 LINK_TESTS="$SHELL ${rel_builddir}/mk_prog.sh"
Steve Kondikae271bc2015-11-15 02:50:53 +010012131 ;;
12132 (mingw*)
12133 cf_cv_shlib_version=mingw
12134 cf_cv_shlib_version_infix=mingw
12135 shlibdir=$bindir
12136 MAKE_DLLS=
12137 if test "$DFT_LWR_MODEL" = "shared" ; then
12138 LOCAL_LDFLAGS="-Wl,--enable-auto-import"
12139 LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
12140 EXTRA_LDFLAGS="-Wl,--enable-auto-import $EXTRA_LDFLAGS"
12141 fi
12142 CC_SHARED_OPTS=
12143 MK_SHARED_LIB=$SHELL' '$rel_builddir'/mk_shared_lib.sh $@ ${CC} ${CFLAGS}'
12144 RM_SHARED_OPTS="$RM_SHARED_OPTS $rel_builddir/mk_shared_lib.sh *.dll.a"
12145 cat >mk_shared_lib.sh <<-CF_EOF
12146 #!$SHELL
12147 SHARED_LIB=\$1
12148 IMPORT_LIB=\`echo "\$1" | sed -e 's/[0-9]*\.dll$/.dll.a/'\`
12149 shift
12150 cat <<-EOF
12151 Linking shared library
12152 ** SHARED_LIB \$SHARED_LIB
12153 ** IMPORT_LIB \$IMPORT_LIB
12154EOF
micky3879b9f5e72025-07-08 18:04:53 -040012155 exec \$* ${LDFLAGS} -shared -Wl,--enable-auto-import,--out-implib=\${IMPORT_LIB} -Wl,--export-all-symbols -o \${SHARED_LIB}
Steve Kondikae271bc2015-11-15 02:50:53 +010012156CF_EOF
12157 chmod +x mk_shared_lib.sh
12158 ;;
12159 (openbsd[2-9].*|mirbsd*)
micky3879b9f5e72025-07-08 18:04:53 -040012160 if test "$DFT_LWR_MODEL" = "shared" && test -n "$LD_RPATH_OPT" ; then
Steve Kondikae271bc2015-11-15 02:50:53 +010012161 LOCAL_LDFLAGS="${LD_RPATH_OPT}\$(LOCAL_LIBDIR)"
12162 LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
12163 fi
12164 if test "$cf_cv_enable_rpath" = yes ; then
12165 EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
12166 fi
12167 CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
12168
12169 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
12170 if test "$cf_cv_shlib_version" = rel; then
12171 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
12172 else
12173 cf_cv_shared_soname='`basename $@`'
12174 fi
12175
micky3879b9f5e72025-07-08 18:04:53 -040012176 MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-Bshareable,-soname,'$cf_cv_shared_soname',-stats,-lc -o $@'
12177 ;;
12178 (nskJ*)
12179 CC_SHARED_OPTS=
12180 MK_SHARED_LIB='${LD} -Wshared -Weld=-export_all -o $@'
12181 ;;
12182 (nskL*)
12183 CC_SHARED_OPTS=
12184 MK_SHARED_LIB='${LD} -Wshared -Wxld=-export_all -o $@'
Steve Kondikae271bc2015-11-15 02:50:53 +010012185 ;;
12186 (nto-qnx*|openbsd*|freebsd[12].*)
12187 CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
micky3879b9f5e72025-07-08 18:04:53 -040012188 MK_SHARED_LIB='${LD} ${LDFLAGS} -Bshareable -o $@'
Steve Kondikae271bc2015-11-15 02:50:53 +010012189 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
12190 ;;
12191 (dragonfly*|freebsd*)
12192 CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
12193 if test "$DFT_LWR_MODEL" = "shared" && test "$cf_cv_enable_rpath" = yes ; then
12194 LOCAL_LDFLAGS="${cf_ld_rpath_opt}\$(LOCAL_LIBDIR)"
12195 LOCAL_LDFLAGS2="${cf_ld_rpath_opt}\${RPATH_LIST} $LOCAL_LDFLAGS"
12196 EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
12197 fi
12198
12199 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
12200 if test "$cf_cv_shlib_version" = rel; then
12201 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
12202 else
12203 cf_cv_shared_soname='`basename $@`'
12204 fi
12205
micky3879b9f5e72025-07-08 18:04:53 -040012206 MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-soname,'$cf_cv_shared_soname',-stats,-lc -o $@'
Steve Kondikae271bc2015-11-15 02:50:53 +010012207 ;;
12208 (netbsd*)
12209 CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
12210 if test "$DFT_LWR_MODEL" = "shared" && test "$cf_cv_enable_rpath" = yes ; then
12211 LOCAL_LDFLAGS="${cf_ld_rpath_opt}\$(LOCAL_LIBDIR)"
12212 LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
12213 EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
12214 if test "$cf_cv_shlib_version" = auto; then
12215 if test -f /usr/libexec/ld.elf_so; then
12216 cf_cv_shlib_version=abi
12217 else
12218 cf_cv_shlib_version=rel
12219 fi
12220 fi
12221
12222 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
12223 if test "$cf_cv_shlib_version" = rel; then
12224 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
12225 else
12226 cf_cv_shared_soname='`basename $@`'
12227 fi
12228
micky3879b9f5e72025-07-08 18:04:53 -040012229 MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-soname,'$cf_cv_shared_soname' -o $@'
Steve Kondikae271bc2015-11-15 02:50:53 +010012230 else
micky3879b9f5e72025-07-08 18:04:53 -040012231 MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -o $@'
Steve Kondikae271bc2015-11-15 02:50:53 +010012232 fi
12233 ;;
12234 (osf*|mls+*)
12235 # tested with OSF/1 V3.2 and 'cc'
12236 # tested with OSF/1 V3.2 and gcc 2.6.3 (but the c++ demo didn't
12237 # link with shared libs).
micky3879b9f5e72025-07-08 18:04:53 -040012238 MK_SHARED_LIB='${LD} ${LDFLAGS} -set_version ${REL_VERSION}:${ABI_VERSION} -expect_unresolved "*" -shared -soname `basename $@`'
12239 case "$host_os" in
Steve Kondikae271bc2015-11-15 02:50:53 +010012240 (osf4*)
12241 MK_SHARED_LIB="${MK_SHARED_LIB} -msym"
12242 ;;
12243 esac
12244 MK_SHARED_LIB="${MK_SHARED_LIB}"' -o $@'
micky3879b9f5e72025-07-08 18:04:53 -040012245 if test "$DFT_LWR_MODEL" = "shared" && test -n "$LD_RPATH_OPT" ; then
Steve Kondikae271bc2015-11-15 02:50:53 +010012246 LOCAL_LDFLAGS="${LD_RPATH_OPT}\$(LOCAL_LIBDIR)"
12247 LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
12248 fi
12249 cf_cv_rm_so_locs=yes
12250 ;;
12251 (sco3.2v5*) # also uw2* and UW7: hops 13-Apr-98
12252 # tested with osr5.0.5
12253 if test "$GCC" != yes; then
12254 CC_SHARED_OPTS='-belf -KPIC'
12255 fi
micky3879b9f5e72025-07-08 18:04:53 -040012256 MK_SHARED_LIB='${LD} ${LDFLAGS} -dy -G -h `basename $@ .${REL_VERSION}`.${ABI_VERSION} -o $@'
Steve Kondikae271bc2015-11-15 02:50:53 +010012257 if test "$cf_cv_enable_rpath" = yes ; then
12258 # only way is to set LD_RUN_PATH but no switch for it
12259 RUN_PATH=$libdir
12260 fi
12261 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
12262 LINK_PROGS='LD_RUN_PATH=${libdir}'
12263 LINK_TESTS='Pwd=`pwd`;LD_RUN_PATH=`dirname $${Pwd}`/lib'
12264 ;;
12265 (sunos4*)
12266 # tested with SunOS 4.1.1 and gcc 2.7.0
12267 if test "$GCC" != yes; then
12268 CC_SHARED_OPTS='-KPIC'
12269 fi
micky3879b9f5e72025-07-08 18:04:53 -040012270 MK_SHARED_LIB='${LD} ${LDFLAGS} -assert pure-text -o $@'
Steve Kondikae271bc2015-11-15 02:50:53 +010012271 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
12272 ;;
12273 (solaris2*)
12274 # tested with SunOS 5.5.1 (solaris 2.5.1) and gcc 2.7.2
12275 # tested with SunOS 5.10 (solaris 10) and gcc 3.4.3
12276 if test "$DFT_LWR_MODEL" = "shared" ; then
micky3879b9f5e72025-07-08 18:04:53 -040012277 LOCAL_LDFLAGS="-R\$(LOCAL_LIBDIR):\${libdir}"
Steve Kondikae271bc2015-11-15 02:50:53 +010012278 LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
12279 fi
12280 if test "$cf_cv_enable_rpath" = yes ; then
micky3879b9f5e72025-07-08 18:04:53 -040012281 EXTRA_LDFLAGS="-R\${libdir} $EXTRA_LDFLAGS"
Steve Kondikae271bc2015-11-15 02:50:53 +010012282 fi
12283
12284 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
12285 if test "$cf_cv_shlib_version" = rel; then
12286 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
12287 else
12288 cf_cv_shared_soname='`basename $@`'
12289 fi
12290
12291 if test "$GCC" != yes; then
12292 cf_save_CFLAGS="$CFLAGS"
12293 for cf_shared_opts in -xcode=pic32 -xcode=pic13 -KPIC -Kpic -O
12294 do
12295 CFLAGS="$cf_shared_opts $cf_save_CFLAGS"
micky3879b9f5e72025-07-08 18:04:53 -040012296 cat >"conftest.$ac_ext" <<_ACEOF
12297#line 12297 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +010012298#include "confdefs.h"
12299#include <stdio.h>
12300int
micky3879b9f5e72025-07-08 18:04:53 -040012301main (void)
Steve Kondikae271bc2015-11-15 02:50:53 +010012302{
micky3879b9f5e72025-07-08 18:04:53 -040012303printf("Hello\\n");
Steve Kondikae271bc2015-11-15 02:50:53 +010012304 ;
12305 return 0;
12306}
12307_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -040012308rm -f "conftest.$ac_objext"
12309if { (eval echo "$as_me:12309: \"$ac_compile\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010012310 (eval $ac_compile) 2>&5
12311 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040012312 echo "$as_me:12312: \$? = $ac_status" >&5
12313 (exit "$ac_status"); } &&
12314 { ac_try='test -s "conftest.$ac_objext"'
12315 { (eval echo "$as_me:12315: \"$ac_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010012316 (eval $ac_try) 2>&5
12317 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040012318 echo "$as_me:12318: \$? = $ac_status" >&5
12319 (exit "$ac_status"); }; }; then
Steve Kondikae271bc2015-11-15 02:50:53 +010012320 break
12321else
12322 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -040012323cat "conftest.$ac_ext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010012324fi
micky3879b9f5e72025-07-08 18:04:53 -040012325rm -f "conftest.$ac_objext" "conftest.$ac_ext"
Steve Kondikae271bc2015-11-15 02:50:53 +010012326 done
12327 CFLAGS="$cf_save_CFLAGS"
12328 CC_SHARED_OPTS=$cf_shared_opts
micky3879b9f5e72025-07-08 18:04:53 -040012329 MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -dy -G -Wl,-h,'$cf_cv_shared_soname' -o $@'
Steve Kondikae271bc2015-11-15 02:50:53 +010012330 else
micky3879b9f5e72025-07-08 18:04:53 -040012331 MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -dy -G -Wl,-h,'$cf_cv_shared_soname' -o $@'
Steve Kondikae271bc2015-11-15 02:50:53 +010012332 fi
12333 ;;
12334 (sysv5uw7*|unix_sv*)
12335 # tested with UnixWare 7.1.0 (gcc 2.95.2 and cc)
12336 if test "$GCC" != yes; then
12337 CC_SHARED_OPTS='-KPIC'
12338 fi
micky3879b9f5e72025-07-08 18:04:53 -040012339 MK_SHARED_LIB='${LD} ${LDFLAGS} -d y -G -o $@'
Steve Kondikae271bc2015-11-15 02:50:53 +010012340 ;;
12341 (*)
12342 CC_SHARED_OPTS='unknown'
12343 MK_SHARED_LIB='echo unknown'
12344 ;;
12345 esac
12346
12347 # This works if the last tokens in $MK_SHARED_LIB are the -o target.
12348 case "$cf_cv_shlib_version" in
12349 (rel|abi)
12350 case "$MK_SHARED_LIB" in
12351 (*'-o $@')
12352 test "$cf_cv_do_symlinks" = no && cf_cv_do_symlinks=yes
12353 ;;
12354 (*)
micky3879b9f5e72025-07-08 18:04:53 -040012355 { echo "$as_me:12355: WARNING: ignored --with-shlib-version" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010012356echo "$as_me: WARNING: ignored --with-shlib-version" >&2;}
12357 ;;
12358 esac
12359 ;;
12360 esac
12361
12362 if test -n "$cf_try_cflags"
12363 then
12364cat > conftest.$ac_ext <<EOF
micky3879b9f5e72025-07-08 18:04:53 -040012365#line 12365 "${as_me:-configure}"
Steve Kondikae271bc2015-11-15 02:50:53 +010012366#include <stdio.h>
12367int main(int argc, char *argv[])
12368{
micky3879b9f5e72025-07-08 18:04:53 -040012369 printf("hello\\n");
Steve Kondikae271bc2015-11-15 02:50:53 +010012370 return (argv[argc-1] == 0) ;
12371}
12372EOF
12373 cf_save_CFLAGS="$CFLAGS"
12374 for cf_opt in $cf_try_cflags
12375 do
12376 CFLAGS="$cf_save_CFLAGS -$cf_opt"
micky3879b9f5e72025-07-08 18:04:53 -040012377 echo "$as_me:12377: checking if CFLAGS option -$cf_opt works" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010012378echo $ECHO_N "checking if CFLAGS option -$cf_opt works... $ECHO_C" >&6
micky3879b9f5e72025-07-08 18:04:53 -040012379 if { (eval echo "$as_me:12379: \"$ac_compile\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010012380 (eval $ac_compile) 2>&5
12381 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040012382 echo "$as_me:12382: \$? = $ac_status" >&5
12383 (exit "$ac_status"); }; then
12384 echo "$as_me:12384: result: yes" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010012385echo "${ECHO_T}yes" >&6
12386 cf_save_CFLAGS="$CFLAGS"
12387 else
micky3879b9f5e72025-07-08 18:04:53 -040012388 echo "$as_me:12388: result: no" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010012389echo "${ECHO_T}no" >&6
12390 fi
12391 done
12392 CFLAGS="$cf_save_CFLAGS"
12393 fi
12394
12395 # RPATH_LIST is a colon-separated list of directories
12396 test -n "$cf_ld_rpath_opt" && MK_SHARED_LIB="$MK_SHARED_LIB $cf_ld_rpath_opt\${RPATH_LIST}"
12397 test -z "$RPATH_LIST" && RPATH_LIST="\${libdir}"
12398
micky3879b9f5e72025-07-08 18:04:53 -040012399 test "$cf_cv_rm_so_locs" = yes && RM_SHARED_OPTS="$RM_SHARED_OPTS so_locations"
Steve Kondikae271bc2015-11-15 02:50:53 +010012400
12401 test -n "$verbose" && echo " CC_SHARED_OPTS: $CC_SHARED_OPTS" 1>&6
12402
micky3879b9f5e72025-07-08 18:04:53 -040012403echo "${as_me:-configure}:12403: testing CC_SHARED_OPTS: $CC_SHARED_OPTS ..." 1>&5
Steve Kondikae271bc2015-11-15 02:50:53 +010012404
12405 test -n "$verbose" && echo " MK_SHARED_LIB: $MK_SHARED_LIB" 1>&6
12406
micky3879b9f5e72025-07-08 18:04:53 -040012407echo "${as_me:-configure}:12407: testing MK_SHARED_LIB: $MK_SHARED_LIB ..." 1>&5
Steve Kondikae271bc2015-11-15 02:50:53 +010012408
12409# The test/sample programs in the original tree link using rpath option.
12410# Make it optional for packagers.
12411if test -n "$LOCAL_LDFLAGS"
12412then
micky3879b9f5e72025-07-08 18:04:53 -040012413 echo "$as_me:12413: checking if you want to link sample programs with rpath option" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010012414echo $ECHO_N "checking if you want to link sample programs with rpath option... $ECHO_C" >&6
12415
12416# Check whether --enable-rpath-link or --disable-rpath-link was given.
12417if test "${enable_rpath_link+set}" = set; then
12418 enableval="$enable_rpath_link"
12419 with_rpath_link=$enableval
12420else
12421 with_rpath_link=yes
12422fi;
micky3879b9f5e72025-07-08 18:04:53 -040012423 echo "$as_me:12423: result: $with_rpath_link" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010012424echo "${ECHO_T}$with_rpath_link" >&6
12425 if test "$with_rpath_link" = no
12426 then
12427 LOCAL_LDFLAGS=
12428 LOCAL_LDFLAGS2=
12429 fi
12430fi
12431
12432###############################################################################
12433
12434### use option --enable-broken-linker to force on use of broken-linker support
micky3879b9f5e72025-07-08 18:04:53 -040012435
12436echo "$as_me:12436: checking if you want broken-linker support code" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010012437echo $ECHO_N "checking if you want broken-linker support code... $ECHO_C" >&6
12438
12439# Check whether --enable-broken_linker or --disable-broken_linker was given.
12440if test "${enable_broken_linker+set}" = set; then
12441 enableval="$enable_broken_linker"
12442 with_broken_linker=$enableval
12443else
micky3879b9f5e72025-07-08 18:04:53 -040012444 with_broken_linker=no
Steve Kondikae271bc2015-11-15 02:50:53 +010012445fi;
micky3879b9f5e72025-07-08 18:04:53 -040012446echo "$as_me:12446: result: $with_broken_linker" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010012447echo "${ECHO_T}$with_broken_linker" >&6
12448
micky3879b9f5e72025-07-08 18:04:53 -040012449: "${BROKEN_LINKER:=0}"
12450if test "x$with_broken_linker" = xyes ; then
12451
12452cat >>confdefs.h <<\EOF
Steve Kondikae271bc2015-11-15 02:50:53 +010012453#define BROKEN_LINKER 1
12454EOF
12455
12456 BROKEN_LINKER=1
Steve Kondikae271bc2015-11-15 02:50:53 +010012457fi
12458
12459# Check to define _XOPEN_SOURCE "automatically"
12460
micky3879b9f5e72025-07-08 18:04:53 -040012461echo "$as_me:12461: checking if the POSIX test-macros are already defined" >&5
12462echo $ECHO_N "checking if the POSIX test-macros are already defined... $ECHO_C" >&6
12463if test "${cf_cv_posix_visible+set}" = set; then
12464 echo $ECHO_N "(cached) $ECHO_C" >&6
12465else
12466
12467cat >"conftest.$ac_ext" <<_ACEOF
12468#line 12468 "configure"
12469#include "confdefs.h"
12470#include <stdio.h>
12471int
12472main (void)
12473{
12474
12475#if defined(__POSIX_VISIBLE) && ((__POSIX_VISIBLE - 0L) > 0) \
12476 && defined(__XSI_VISIBLE) && ((__XSI_VISIBLE - 0L) > 0) \
12477 && defined(__BSD_VISIBLE) && ((__BSD_VISIBLE - 0L) > 0) \
12478 && defined(__ISO_C_VISIBLE) && ((__ISO_C_VISIBLE - 0L) > 0)
12479#error conflicting symbols found
12480#endif
12481
12482 ;
12483 return 0;
12484}
12485_ACEOF
12486rm -f "conftest.$ac_objext"
12487if { (eval echo "$as_me:12487: \"$ac_compile\"") >&5
12488 (eval $ac_compile) 2>&5
12489 ac_status=$?
12490 echo "$as_me:12490: \$? = $ac_status" >&5
12491 (exit "$ac_status"); } &&
12492 { ac_try='test -s "conftest.$ac_objext"'
12493 { (eval echo "$as_me:12493: \"$ac_try\"") >&5
12494 (eval $ac_try) 2>&5
12495 ac_status=$?
12496 echo "$as_me:12496: \$? = $ac_status" >&5
12497 (exit "$ac_status"); }; }; then
12498 cf_cv_posix_visible=no
12499else
12500 echo "$as_me: failed program was:" >&5
12501cat "conftest.$ac_ext" >&5
12502cf_cv_posix_visible=yes
12503fi
12504rm -f "conftest.$ac_objext" "conftest.$ac_ext"
12505
12506fi
12507echo "$as_me:12507: result: $cf_cv_posix_visible" >&5
12508echo "${ECHO_T}$cf_cv_posix_visible" >&6
12509
12510if test "$cf_cv_posix_visible" = no; then
12511
12512cf_XOPEN_SOURCE=600
Steve Kondikae271bc2015-11-15 02:50:53 +010012513cf_POSIX_C_SOURCE=199506L
12514cf_xopen_source=
12515
micky3879b9f5e72025-07-08 18:04:53 -040012516case "$host_os" in
Steve Kondikae271bc2015-11-15 02:50:53 +010012517(aix[4-7]*)
12518 cf_xopen_source="-D_ALL_SOURCE"
12519 ;;
Steve Kondikae271bc2015-11-15 02:50:53 +010012520(darwin[0-8].*)
12521 cf_xopen_source="-D_APPLE_C_SOURCE"
12522 ;;
12523(darwin*)
12524 cf_xopen_source="-D_DARWIN_C_SOURCE"
12525 cf_XOPEN_SOURCE=
12526 ;;
micky3879b9f5e72025-07-08 18:04:53 -040012527(freebsd*|dragonfly*|midnightbsd*)
Steve Kondikae271bc2015-11-15 02:50:53 +010012528 # 5.x headers associate
12529 # _XOPEN_SOURCE=600 with _POSIX_C_SOURCE=200112L
12530 # _XOPEN_SOURCE=500 with _POSIX_C_SOURCE=199506L
12531 cf_POSIX_C_SOURCE=200112L
12532 cf_XOPEN_SOURCE=600
12533 cf_xopen_source="-D_BSD_TYPES -D__BSD_VISIBLE -D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
12534 ;;
12535(hpux11*)
12536 cf_xopen_source="-D_HPUX_SOURCE -D_XOPEN_SOURCE=500"
12537 ;;
12538(hpux*)
12539 cf_xopen_source="-D_HPUX_SOURCE"
12540 ;;
12541(irix[56].*)
12542 cf_xopen_source="-D_SGI_SOURCE"
12543 cf_XOPEN_SOURCE=
12544 ;;
micky3879b9f5e72025-07-08 18:04:53 -040012545(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 +010012546
micky3879b9f5e72025-07-08 18:04:53 -040012547cf_gnu_xopen_source=$cf_XOPEN_SOURCE
12548
12549echo "$as_me:12549: checking if this is the GNU C library" >&5
12550echo $ECHO_N "checking if this is the GNU C library... $ECHO_C" >&6
12551if test "${cf_cv_gnu_library+set}" = set; then
12552 echo $ECHO_N "(cached) $ECHO_C" >&6
12553else
12554
12555cat >"conftest.$ac_ext" <<_ACEOF
12556#line 12556 "configure"
12557#include "confdefs.h"
12558#include <sys/types.h>
12559int
12560main (void)
12561{
12562
12563 #if __GLIBC__ > 0 && __GLIBC_MINOR__ >= 0
12564 return 0;
12565 #elif __NEWLIB__ > 0 && __NEWLIB_MINOR__ >= 0
12566 return 0;
12567 #else
12568 # error not GNU C library
12569 #endif
12570 ;
12571 return 0;
12572}
12573_ACEOF
12574rm -f "conftest.$ac_objext"
12575if { (eval echo "$as_me:12575: \"$ac_compile\"") >&5
12576 (eval $ac_compile) 2>&5
12577 ac_status=$?
12578 echo "$as_me:12578: \$? = $ac_status" >&5
12579 (exit "$ac_status"); } &&
12580 { ac_try='test -s "conftest.$ac_objext"'
12581 { (eval echo "$as_me:12581: \"$ac_try\"") >&5
12582 (eval $ac_try) 2>&5
12583 ac_status=$?
12584 echo "$as_me:12584: \$? = $ac_status" >&5
12585 (exit "$ac_status"); }; }; then
12586 cf_cv_gnu_library=yes
12587else
12588 echo "$as_me: failed program was:" >&5
12589cat "conftest.$ac_ext" >&5
12590cf_cv_gnu_library=no
12591fi
12592rm -f "conftest.$ac_objext" "conftest.$ac_ext"
12593
12594fi
12595echo "$as_me:12595: result: $cf_cv_gnu_library" >&5
12596echo "${ECHO_T}$cf_cv_gnu_library" >&6
12597
12598if test x$cf_cv_gnu_library = xyes; then
12599
12600 # With glibc 2.19 (13 years after this check was begun), _DEFAULT_SOURCE
12601 # was changed to help a little. newlib incorporated the change about 4
12602 # years later.
12603 echo "$as_me:12603: checking if _DEFAULT_SOURCE can be used as a basis" >&5
12604echo $ECHO_N "checking if _DEFAULT_SOURCE can be used as a basis... $ECHO_C" >&6
12605if test "${cf_cv_gnu_library_219+set}" = set; then
12606 echo $ECHO_N "(cached) $ECHO_C" >&6
12607else
12608
12609 cf_save="$CPPFLAGS"
12610
12611 test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12612 CPPFLAGS="${CPPFLAGS}-D_DEFAULT_SOURCE"
12613
12614 cat >"conftest.$ac_ext" <<_ACEOF
12615#line 12615 "configure"
12616#include "confdefs.h"
12617#include <sys/types.h>
12618int
12619main (void)
12620{
12621
12622 #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 19) || (__GLIBC__ > 2)
12623 return 0;
12624 #elif (__NEWLIB__ == 2 && __NEWLIB_MINOR__ >= 4) || (__GLIBC__ > 3)
12625 return 0;
12626 #else
12627 # error GNU C library __GLIBC__.__GLIBC_MINOR__ is too old
12628 #endif
12629 ;
12630 return 0;
12631}
12632_ACEOF
12633rm -f "conftest.$ac_objext"
12634if { (eval echo "$as_me:12634: \"$ac_compile\"") >&5
12635 (eval $ac_compile) 2>&5
12636 ac_status=$?
12637 echo "$as_me:12637: \$? = $ac_status" >&5
12638 (exit "$ac_status"); } &&
12639 { ac_try='test -s "conftest.$ac_objext"'
12640 { (eval echo "$as_me:12640: \"$ac_try\"") >&5
12641 (eval $ac_try) 2>&5
12642 ac_status=$?
12643 echo "$as_me:12643: \$? = $ac_status" >&5
12644 (exit "$ac_status"); }; }; then
12645 cf_cv_gnu_library_219=yes
12646else
12647 echo "$as_me: failed program was:" >&5
12648cat "conftest.$ac_ext" >&5
12649cf_cv_gnu_library_219=no
12650fi
12651rm -f "conftest.$ac_objext" "conftest.$ac_ext"
12652 CPPFLAGS="$cf_save"
12653
12654fi
12655echo "$as_me:12655: result: $cf_cv_gnu_library_219" >&5
12656echo "${ECHO_T}$cf_cv_gnu_library_219" >&6
12657
12658 if test "x$cf_cv_gnu_library_219" = xyes; then
12659 cf_save="$CPPFLAGS"
12660 echo "$as_me:12660: checking if _XOPEN_SOURCE=$cf_gnu_xopen_source works with _DEFAULT_SOURCE" >&5
12661echo $ECHO_N "checking if _XOPEN_SOURCE=$cf_gnu_xopen_source works with _DEFAULT_SOURCE... $ECHO_C" >&6
12662if test "${cf_cv_gnu_dftsrc_219+set}" = set; then
12663 echo $ECHO_N "(cached) $ECHO_C" >&6
12664else
12665
12666cf_fix_cppflags=no
12667cf_new_cflags=
12668cf_new_cppflags=
12669cf_new_extra_cppflags=
12670
12671for cf_add_cflags in -D_DEFAULT_SOURCE -D_XOPEN_SOURCE=$cf_gnu_xopen_source
12672do
12673case "$cf_fix_cppflags" in
12674(no)
12675 case "$cf_add_cflags" in
12676 (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
12677 case "$cf_add_cflags" in
12678 (-D*)
12679 cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
12680
12681 test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12682 && test -z "${cf_tst_cflags}" \
12683 && cf_fix_cppflags=yes
12684
12685 if test "$cf_fix_cppflags" = yes ; then
12686
12687 test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12688 cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12689
12690 continue
12691 elif test "${cf_tst_cflags}" = "\"'" ; then
12692
12693 test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12694 cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12695
12696 continue
12697 fi
12698 ;;
12699 esac
12700 case "$CPPFLAGS" in
12701 (*$cf_add_cflags)
12702 ;;
12703 (*)
12704 case "$cf_add_cflags" in
12705 (-D*)
12706 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
12707
12708CPPFLAGS=`echo "$CPPFLAGS" | \
12709 sed -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?[ ]/ /g' \
12710 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?$//g'`
12711
12712 ;;
12713 esac
12714
12715 test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
12716 cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
12717
12718 ;;
12719 esac
12720 ;;
12721 (*)
12722
12723 test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
12724 cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
12725
12726 ;;
12727 esac
12728 ;;
12729(yes)
12730
12731 test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12732 cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12733
12734 cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
12735
12736 test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12737 && test -z "${cf_tst_cflags}" \
12738 && cf_fix_cppflags=no
12739 ;;
12740esac
12741done
12742
12743if test -n "$cf_new_cflags" ; then
12744
12745 test -n "$CFLAGS" && CFLAGS="$CFLAGS "
12746 CFLAGS="${CFLAGS}$cf_new_cflags"
12747
12748fi
12749
12750if test -n "$cf_new_cppflags" ; then
12751
12752 test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12753 CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
12754
12755fi
12756
12757if test -n "$cf_new_extra_cppflags" ; then
12758
12759 test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
12760 EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
12761
12762fi
12763
12764 cat >"conftest.$ac_ext" <<_ACEOF
12765#line 12765 "configure"
12766#include "confdefs.h"
12767
12768 #include <limits.h>
12769 #include <sys/types.h>
12770
12771int
12772main (void)
12773{
12774
12775 #if (_XOPEN_SOURCE >= $cf_gnu_xopen_source) && (MB_LEN_MAX > 1)
12776 return 0;
12777 #else
12778 # error GNU C library is too old
12779 #endif
12780 ;
12781 return 0;
12782}
12783_ACEOF
12784rm -f "conftest.$ac_objext"
12785if { (eval echo "$as_me:12785: \"$ac_compile\"") >&5
12786 (eval $ac_compile) 2>&5
12787 ac_status=$?
12788 echo "$as_me:12788: \$? = $ac_status" >&5
12789 (exit "$ac_status"); } &&
12790 { ac_try='test -s "conftest.$ac_objext"'
12791 { (eval echo "$as_me:12791: \"$ac_try\"") >&5
12792 (eval $ac_try) 2>&5
12793 ac_status=$?
12794 echo "$as_me:12794: \$? = $ac_status" >&5
12795 (exit "$ac_status"); }; }; then
12796 cf_cv_gnu_dftsrc_219=yes
12797else
12798 echo "$as_me: failed program was:" >&5
12799cat "conftest.$ac_ext" >&5
12800cf_cv_gnu_dftsrc_219=no
12801fi
12802rm -f "conftest.$ac_objext" "conftest.$ac_ext"
12803
12804fi
12805echo "$as_me:12805: result: $cf_cv_gnu_dftsrc_219" >&5
12806echo "${ECHO_T}$cf_cv_gnu_dftsrc_219" >&6
12807 test "x$cf_cv_gnu_dftsrc_219" = "xyes" || CPPFLAGS="$cf_save"
12808 else
12809 cf_cv_gnu_dftsrc_219=maybe
12810 fi
12811
12812 if test "x$cf_cv_gnu_dftsrc_219" != xyes; then
12813
12814 echo "$as_me:12814: checking if we must define _GNU_SOURCE" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010012815echo $ECHO_N "checking if we must define _GNU_SOURCE... $ECHO_C" >&6
12816if test "${cf_cv_gnu_source+set}" = set; then
12817 echo $ECHO_N "(cached) $ECHO_C" >&6
12818else
12819
micky3879b9f5e72025-07-08 18:04:53 -040012820 cat >"conftest.$ac_ext" <<_ACEOF
12821#line 12821 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +010012822#include "confdefs.h"
12823#include <sys/types.h>
12824int
micky3879b9f5e72025-07-08 18:04:53 -040012825main (void)
Steve Kondikae271bc2015-11-15 02:50:53 +010012826{
12827
micky3879b9f5e72025-07-08 18:04:53 -040012828 #ifndef _XOPEN_SOURCE
12829 #error expected _XOPEN_SOURCE to be defined
12830 #endif
Steve Kondikae271bc2015-11-15 02:50:53 +010012831 ;
12832 return 0;
12833}
12834_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -040012835rm -f "conftest.$ac_objext"
12836if { (eval echo "$as_me:12836: \"$ac_compile\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010012837 (eval $ac_compile) 2>&5
12838 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040012839 echo "$as_me:12839: \$? = $ac_status" >&5
12840 (exit "$ac_status"); } &&
12841 { ac_try='test -s "conftest.$ac_objext"'
12842 { (eval echo "$as_me:12842: \"$ac_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010012843 (eval $ac_try) 2>&5
12844 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040012845 echo "$as_me:12845: \$? = $ac_status" >&5
12846 (exit "$ac_status"); }; }; then
Steve Kondikae271bc2015-11-15 02:50:53 +010012847 cf_cv_gnu_source=no
12848else
12849 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -040012850cat "conftest.$ac_ext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010012851cf_save="$CPPFLAGS"
micky3879b9f5e72025-07-08 18:04:53 -040012852
12853cf_fix_cppflags=no
12854cf_new_cflags=
12855cf_new_cppflags=
12856cf_new_extra_cppflags=
12857
12858for cf_add_cflags in -D_GNU_SOURCE
12859do
12860case "$cf_fix_cppflags" in
12861(no)
12862 case "$cf_add_cflags" in
12863 (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
12864 case "$cf_add_cflags" in
12865 (-D*)
12866 cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
12867
12868 test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12869 && test -z "${cf_tst_cflags}" \
12870 && cf_fix_cppflags=yes
12871
12872 if test "$cf_fix_cppflags" = yes ; then
12873
12874 test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12875 cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12876
12877 continue
12878 elif test "${cf_tst_cflags}" = "\"'" ; then
12879
12880 test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12881 cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12882
12883 continue
12884 fi
12885 ;;
12886 esac
12887 case "$CPPFLAGS" in
12888 (*$cf_add_cflags)
12889 ;;
12890 (*)
12891 case "$cf_add_cflags" in
12892 (-D*)
12893 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
12894
12895CPPFLAGS=`echo "$CPPFLAGS" | \
12896 sed -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?[ ]/ /g' \
12897 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?$//g'`
12898
12899 ;;
12900 esac
12901
12902 test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
12903 cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
12904
12905 ;;
12906 esac
12907 ;;
12908 (*)
12909
12910 test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
12911 cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
12912
12913 ;;
12914 esac
12915 ;;
12916(yes)
12917
12918 test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12919 cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12920
12921 cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
12922
12923 test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12924 && test -z "${cf_tst_cflags}" \
12925 && cf_fix_cppflags=no
12926 ;;
12927esac
12928done
12929
12930if test -n "$cf_new_cflags" ; then
12931
12932 test -n "$CFLAGS" && CFLAGS="$CFLAGS "
12933 CFLAGS="${CFLAGS}$cf_new_cflags"
12934
12935fi
12936
12937if test -n "$cf_new_cppflags" ; then
12938
12939 test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12940 CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
12941
12942fi
12943
12944if test -n "$cf_new_extra_cppflags" ; then
12945
12946 test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
12947 EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
12948
12949fi
12950
12951 cat >"conftest.$ac_ext" <<_ACEOF
12952#line 12952 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +010012953#include "confdefs.h"
12954#include <sys/types.h>
12955int
micky3879b9f5e72025-07-08 18:04:53 -040012956main (void)
Steve Kondikae271bc2015-11-15 02:50:53 +010012957{
12958
micky3879b9f5e72025-07-08 18:04:53 -040012959 #ifdef _XOPEN_SOURCE
12960 #error expected _XOPEN_SOURCE to be undefined
12961 #endif
Steve Kondikae271bc2015-11-15 02:50:53 +010012962 ;
12963 return 0;
12964}
12965_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -040012966rm -f "conftest.$ac_objext"
12967if { (eval echo "$as_me:12967: \"$ac_compile\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010012968 (eval $ac_compile) 2>&5
12969 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040012970 echo "$as_me:12970: \$? = $ac_status" >&5
12971 (exit "$ac_status"); } &&
12972 { ac_try='test -s "conftest.$ac_objext"'
12973 { (eval echo "$as_me:12973: \"$ac_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010012974 (eval $ac_try) 2>&5
12975 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040012976 echo "$as_me:12976: \$? = $ac_status" >&5
12977 (exit "$ac_status"); }; }; then
Steve Kondikae271bc2015-11-15 02:50:53 +010012978 cf_cv_gnu_source=no
12979else
12980 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -040012981cat "conftest.$ac_ext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010012982cf_cv_gnu_source=yes
12983fi
micky3879b9f5e72025-07-08 18:04:53 -040012984rm -f "conftest.$ac_objext" "conftest.$ac_ext"
12985 CPPFLAGS="$cf_save"
Steve Kondikae271bc2015-11-15 02:50:53 +010012986
12987fi
micky3879b9f5e72025-07-08 18:04:53 -040012988rm -f "conftest.$ac_objext" "conftest.$ac_ext"
Steve Kondikae271bc2015-11-15 02:50:53 +010012989
12990fi
micky3879b9f5e72025-07-08 18:04:53 -040012991echo "$as_me:12991: result: $cf_cv_gnu_source" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010012992echo "${ECHO_T}$cf_cv_gnu_source" >&6
micky3879b9f5e72025-07-08 18:04:53 -040012993
12994 if test "$cf_cv_gnu_source" = yes
12995 then
12996 echo "$as_me:12996: checking if we should also define _DEFAULT_SOURCE" >&5
12997echo $ECHO_N "checking if we should also define _DEFAULT_SOURCE... $ECHO_C" >&6
12998if test "${cf_cv_default_source+set}" = set; then
12999 echo $ECHO_N "(cached) $ECHO_C" >&6
13000else
13001
13002 test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13003 CPPFLAGS="${CPPFLAGS}-D_GNU_SOURCE"
13004
13005 cat >"conftest.$ac_ext" <<_ACEOF
13006#line 13006 "configure"
13007#include "confdefs.h"
13008#include <sys/types.h>
13009int
13010main (void)
13011{
13012
13013 #ifdef _DEFAULT_SOURCE
13014 #error expected _DEFAULT_SOURCE to be undefined
13015 #endif
13016 ;
13017 return 0;
13018}
13019_ACEOF
13020rm -f "conftest.$ac_objext"
13021if { (eval echo "$as_me:13021: \"$ac_compile\"") >&5
13022 (eval $ac_compile) 2>&5
13023 ac_status=$?
13024 echo "$as_me:13024: \$? = $ac_status" >&5
13025 (exit "$ac_status"); } &&
13026 { ac_try='test -s "conftest.$ac_objext"'
13027 { (eval echo "$as_me:13027: \"$ac_try\"") >&5
13028 (eval $ac_try) 2>&5
13029 ac_status=$?
13030 echo "$as_me:13030: \$? = $ac_status" >&5
13031 (exit "$ac_status"); }; }; then
13032 cf_cv_default_source=no
13033else
13034 echo "$as_me: failed program was:" >&5
13035cat "conftest.$ac_ext" >&5
13036cf_cv_default_source=yes
13037fi
13038rm -f "conftest.$ac_objext" "conftest.$ac_ext"
13039
13040fi
13041echo "$as_me:13041: result: $cf_cv_default_source" >&5
13042echo "${ECHO_T}$cf_cv_default_source" >&6
13043 if test "$cf_cv_default_source" = yes
13044 then
13045
13046 test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13047 CPPFLAGS="${CPPFLAGS}-D_DEFAULT_SOURCE"
13048
13049 fi
13050 fi
13051 fi
13052
13053fi
Steve Kondikae271bc2015-11-15 02:50:53 +010013054
13055 ;;
13056(minix*)
13057 cf_xopen_source="-D_NETBSD_SOURCE" # POSIX.1-2001 features are ifdef'd with this...
13058 ;;
13059(mirbsd*)
13060 # setting _XOPEN_SOURCE or _POSIX_SOURCE breaks <sys/select.h> and other headers which use u_int / u_short types
13061 cf_XOPEN_SOURCE=
13062
micky3879b9f5e72025-07-08 18:04:53 -040013063if test "$cf_cv_posix_visible" = no; then
13064
Steve Kondikae271bc2015-11-15 02:50:53 +010013065cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE
13066
13067cf_save_CFLAGS="$CFLAGS"
13068cf_save_CPPFLAGS="$CPPFLAGS"
13069
13070cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \
13071 sed -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^ ]*\)\?[ ]/ /g' \
13072 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^ ]*\)\?$//g'`
13073
13074cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \
13075 sed -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^ ]*\)\?[ ]/ /g' \
13076 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^ ]*\)\?$//g'`
13077
micky3879b9f5e72025-07-08 18:04:53 -040013078echo "$as_me:13078: checking if we should define _POSIX_C_SOURCE" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010013079echo $ECHO_N "checking if we should define _POSIX_C_SOURCE... $ECHO_C" >&6
13080if test "${cf_cv_posix_c_source+set}" = set; then
13081 echo $ECHO_N "(cached) $ECHO_C" >&6
13082else
13083
micky3879b9f5e72025-07-08 18:04:53 -040013084echo "${as_me:-configure}:13084: testing if the symbol is already defined go no further ..." 1>&5
Steve Kondikae271bc2015-11-15 02:50:53 +010013085
micky3879b9f5e72025-07-08 18:04:53 -040013086 cat >"conftest.$ac_ext" <<_ACEOF
13087#line 13087 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +010013088#include "confdefs.h"
13089#include <sys/types.h>
13090int
micky3879b9f5e72025-07-08 18:04:53 -040013091main (void)
Steve Kondikae271bc2015-11-15 02:50:53 +010013092{
13093
13094#ifndef _POSIX_C_SOURCE
micky3879b9f5e72025-07-08 18:04:53 -040013095#error _POSIX_C_SOURCE is not defined
Steve Kondikae271bc2015-11-15 02:50:53 +010013096#endif
13097 ;
13098 return 0;
13099}
13100_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -040013101rm -f "conftest.$ac_objext"
13102if { (eval echo "$as_me:13102: \"$ac_compile\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010013103 (eval $ac_compile) 2>&5
13104 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040013105 echo "$as_me:13105: \$? = $ac_status" >&5
13106 (exit "$ac_status"); } &&
13107 { ac_try='test -s "conftest.$ac_objext"'
13108 { (eval echo "$as_me:13108: \"$ac_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010013109 (eval $ac_try) 2>&5
13110 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040013111 echo "$as_me:13111: \$? = $ac_status" >&5
13112 (exit "$ac_status"); }; }; then
Steve Kondikae271bc2015-11-15 02:50:53 +010013113 cf_cv_posix_c_source=no
13114else
13115 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -040013116cat "conftest.$ac_ext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010013117cf_want_posix_source=no
13118 case .$cf_POSIX_C_SOURCE in
13119 (.[12]??*)
13120 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
13121 ;;
13122 (.2)
13123 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
13124 cf_want_posix_source=yes
13125 ;;
13126 (.*)
13127 cf_want_posix_source=yes
13128 ;;
13129 esac
13130 if test "$cf_want_posix_source" = yes ; then
micky3879b9f5e72025-07-08 18:04:53 -040013131 cat >"conftest.$ac_ext" <<_ACEOF
13132#line 13132 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +010013133#include "confdefs.h"
13134#include <sys/types.h>
13135int
micky3879b9f5e72025-07-08 18:04:53 -040013136main (void)
Steve Kondikae271bc2015-11-15 02:50:53 +010013137{
13138
13139#ifdef _POSIX_SOURCE
micky3879b9f5e72025-07-08 18:04:53 -040013140#error _POSIX_SOURCE is defined
Steve Kondikae271bc2015-11-15 02:50:53 +010013141#endif
13142 ;
13143 return 0;
13144}
13145_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -040013146rm -f "conftest.$ac_objext"
13147if { (eval echo "$as_me:13147: \"$ac_compile\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010013148 (eval $ac_compile) 2>&5
13149 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040013150 echo "$as_me:13150: \$? = $ac_status" >&5
13151 (exit "$ac_status"); } &&
13152 { ac_try='test -s "conftest.$ac_objext"'
13153 { (eval echo "$as_me:13153: \"$ac_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010013154 (eval $ac_try) 2>&5
13155 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040013156 echo "$as_me:13156: \$? = $ac_status" >&5
13157 (exit "$ac_status"); }; }; then
Steve Kondikae271bc2015-11-15 02:50:53 +010013158 :
13159else
13160 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -040013161cat "conftest.$ac_ext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010013162cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE"
13163fi
micky3879b9f5e72025-07-08 18:04:53 -040013164rm -f "conftest.$ac_objext" "conftest.$ac_ext"
Steve Kondikae271bc2015-11-15 02:50:53 +010013165 fi
13166
micky3879b9f5e72025-07-08 18:04:53 -040013167echo "${as_me:-configure}:13167: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
Steve Kondikae271bc2015-11-15 02:50:53 +010013168
13169 CFLAGS="$cf_trim_CFLAGS"
micky3879b9f5e72025-07-08 18:04:53 -040013170 CPPFLAGS="$cf_trim_CPPFLAGS"
Steve Kondikae271bc2015-11-15 02:50:53 +010013171
micky3879b9f5e72025-07-08 18:04:53 -040013172 test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13173 CPPFLAGS="${CPPFLAGS}$cf_cv_posix_c_source"
Steve Kondikae271bc2015-11-15 02:50:53 +010013174
micky3879b9f5e72025-07-08 18:04:53 -040013175echo "${as_me:-configure}:13175: testing if the second compile does not leave our definition intact error ..." 1>&5
13176
13177 cat >"conftest.$ac_ext" <<_ACEOF
13178#line 13178 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +010013179#include "confdefs.h"
13180#include <sys/types.h>
13181int
micky3879b9f5e72025-07-08 18:04:53 -040013182main (void)
Steve Kondikae271bc2015-11-15 02:50:53 +010013183{
13184
13185#ifndef _POSIX_C_SOURCE
micky3879b9f5e72025-07-08 18:04:53 -040013186#error _POSIX_C_SOURCE is not defined
Steve Kondikae271bc2015-11-15 02:50:53 +010013187#endif
13188 ;
13189 return 0;
13190}
13191_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -040013192rm -f "conftest.$ac_objext"
13193if { (eval echo "$as_me:13193: \"$ac_compile\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010013194 (eval $ac_compile) 2>&5
13195 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040013196 echo "$as_me:13196: \$? = $ac_status" >&5
13197 (exit "$ac_status"); } &&
13198 { ac_try='test -s "conftest.$ac_objext"'
13199 { (eval echo "$as_me:13199: \"$ac_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010013200 (eval $ac_try) 2>&5
13201 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040013202 echo "$as_me:13202: \$? = $ac_status" >&5
13203 (exit "$ac_status"); }; }; then
Steve Kondikae271bc2015-11-15 02:50:53 +010013204 :
13205else
13206 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -040013207cat "conftest.$ac_ext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010013208cf_cv_posix_c_source=no
13209fi
micky3879b9f5e72025-07-08 18:04:53 -040013210rm -f "conftest.$ac_objext" "conftest.$ac_ext"
Steve Kondikae271bc2015-11-15 02:50:53 +010013211 CFLAGS="$cf_save_CFLAGS"
13212 CPPFLAGS="$cf_save_CPPFLAGS"
13213
13214fi
micky3879b9f5e72025-07-08 18:04:53 -040013215rm -f "conftest.$ac_objext" "conftest.$ac_ext"
Steve Kondikae271bc2015-11-15 02:50:53 +010013216
13217fi
micky3879b9f5e72025-07-08 18:04:53 -040013218echo "$as_me:13218: result: $cf_cv_posix_c_source" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010013219echo "${ECHO_T}$cf_cv_posix_c_source" >&6
13220
13221if test "$cf_cv_posix_c_source" != no ; then
13222 CFLAGS="$cf_trim_CFLAGS"
13223 CPPFLAGS="$cf_trim_CPPFLAGS"
13224
13225cf_fix_cppflags=no
13226cf_new_cflags=
13227cf_new_cppflags=
13228cf_new_extra_cppflags=
13229
13230for cf_add_cflags in $cf_cv_posix_c_source
13231do
micky3879b9f5e72025-07-08 18:04:53 -040013232case "$cf_fix_cppflags" in
Steve Kondikae271bc2015-11-15 02:50:53 +010013233(no)
micky3879b9f5e72025-07-08 18:04:53 -040013234 case "$cf_add_cflags" in
Steve Kondikae271bc2015-11-15 02:50:53 +010013235 (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
micky3879b9f5e72025-07-08 18:04:53 -040013236 case "$cf_add_cflags" in
Steve Kondikae271bc2015-11-15 02:50:53 +010013237 (-D*)
micky3879b9f5e72025-07-08 18:04:53 -040013238 cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
Steve Kondikae271bc2015-11-15 02:50:53 +010013239
13240 test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13241 && test -z "${cf_tst_cflags}" \
13242 && cf_fix_cppflags=yes
13243
micky3879b9f5e72025-07-08 18:04:53 -040013244 if test "$cf_fix_cppflags" = yes ; then
13245
13246 test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13247 cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13248
Steve Kondikae271bc2015-11-15 02:50:53 +010013249 continue
13250 elif test "${cf_tst_cflags}" = "\"'" ; then
micky3879b9f5e72025-07-08 18:04:53 -040013251
13252 test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13253 cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13254
Steve Kondikae271bc2015-11-15 02:50:53 +010013255 continue
13256 fi
13257 ;;
13258 esac
13259 case "$CPPFLAGS" in
13260 (*$cf_add_cflags)
13261 ;;
13262 (*)
micky3879b9f5e72025-07-08 18:04:53 -040013263 case "$cf_add_cflags" in
Steve Kondikae271bc2015-11-15 02:50:53 +010013264 (-D*)
13265 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13266
13267CPPFLAGS=`echo "$CPPFLAGS" | \
13268 sed -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?[ ]/ /g' \
13269 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?$//g'`
13270
13271 ;;
13272 esac
micky3879b9f5e72025-07-08 18:04:53 -040013273
13274 test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13275 cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
13276
Steve Kondikae271bc2015-11-15 02:50:53 +010013277 ;;
13278 esac
13279 ;;
13280 (*)
micky3879b9f5e72025-07-08 18:04:53 -040013281
13282 test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
13283 cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
13284
Steve Kondikae271bc2015-11-15 02:50:53 +010013285 ;;
13286 esac
13287 ;;
13288(yes)
Steve Kondikae271bc2015-11-15 02:50:53 +010013289
micky3879b9f5e72025-07-08 18:04:53 -040013290 test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13291 cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13292
13293 cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
Steve Kondikae271bc2015-11-15 02:50:53 +010013294
13295 test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13296 && test -z "${cf_tst_cflags}" \
13297 && cf_fix_cppflags=no
13298 ;;
13299esac
13300done
13301
13302if test -n "$cf_new_cflags" ; then
13303
micky3879b9f5e72025-07-08 18:04:53 -040013304 test -n "$CFLAGS" && CFLAGS="$CFLAGS "
13305 CFLAGS="${CFLAGS}$cf_new_cflags"
13306
Steve Kondikae271bc2015-11-15 02:50:53 +010013307fi
13308
13309if test -n "$cf_new_cppflags" ; then
13310
micky3879b9f5e72025-07-08 18:04:53 -040013311 test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13312 CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
13313
Steve Kondikae271bc2015-11-15 02:50:53 +010013314fi
13315
13316if test -n "$cf_new_extra_cppflags" ; then
13317
micky3879b9f5e72025-07-08 18:04:53 -040013318 test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
13319 EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
13320
Steve Kondikae271bc2015-11-15 02:50:53 +010013321fi
13322
13323fi
13324
micky3879b9f5e72025-07-08 18:04:53 -040013325fi # cf_cv_posix_visible
13326
Steve Kondikae271bc2015-11-15 02:50:53 +010013327 ;;
13328(netbsd*)
13329 cf_xopen_source="-D_NETBSD_SOURCE" # setting _XOPEN_SOURCE breaks IPv6 for lynx on NetBSD 1.6, breaks xterm, is not needed for ncursesw
13330 ;;
micky3879b9f5e72025-07-08 18:04:53 -040013331(openbsd[6-9]*)
13332 # OpenBSD 6.x has broken locale support, both compile-time and runtime.
13333 # see https://www.mail-archive.com/bugs@openbsd.org/msg13200.html
13334 # Abusing the conformance level is a workaround.
13335 { echo "$as_me:13335: WARNING: this system does not provide usable locale support" >&5
13336echo "$as_me: WARNING: this system does not provide usable locale support" >&2;}
13337 cf_xopen_source="-D_BSD_SOURCE"
13338 cf_XOPEN_SOURCE=700
13339 ;;
13340(openbsd[4-5]*)
Steve Kondikae271bc2015-11-15 02:50:53 +010013341 # setting _XOPEN_SOURCE lower than 500 breaks g++ compile with wchar.h, needed for ncursesw
13342 cf_xopen_source="-D_BSD_SOURCE"
13343 cf_XOPEN_SOURCE=600
13344 ;;
13345(openbsd*)
13346 # setting _XOPEN_SOURCE breaks xterm on OpenBSD 2.8, is not needed for ncursesw
13347 ;;
13348(osf[45]*)
13349 cf_xopen_source="-D_OSF_SOURCE"
13350 ;;
13351(nto-qnx*)
13352 cf_xopen_source="-D_QNX_SOURCE"
13353 ;;
13354(sco*)
13355 # setting _XOPEN_SOURCE breaks Lynx on SCO Unix / OpenServer
13356 ;;
13357(solaris2.*)
13358 cf_xopen_source="-D__EXTENSIONS__"
13359 cf_cv_xopen_source=broken
13360 ;;
13361(sysv4.2uw2.*) # Novell/SCO UnixWare 2.x (tested on 2.1.2)
13362 cf_XOPEN_SOURCE=
13363 cf_POSIX_C_SOURCE=
13364 ;;
13365(*)
13366
micky3879b9f5e72025-07-08 18:04:53 -040013367echo "$as_me:13367: checking if we should define _XOPEN_SOURCE" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010013368echo $ECHO_N "checking if we should define _XOPEN_SOURCE... $ECHO_C" >&6
13369if test "${cf_cv_xopen_source+set}" = set; then
13370 echo $ECHO_N "(cached) $ECHO_C" >&6
13371else
13372
micky3879b9f5e72025-07-08 18:04:53 -040013373 cat >"conftest.$ac_ext" <<_ACEOF
13374#line 13374 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +010013375#include "confdefs.h"
13376
micky3879b9f5e72025-07-08 18:04:53 -040013377$ac_includes_default
Steve Kondikae271bc2015-11-15 02:50:53 +010013378
13379int
micky3879b9f5e72025-07-08 18:04:53 -040013380main (void)
Steve Kondikae271bc2015-11-15 02:50:53 +010013381{
13382
13383#ifndef _XOPEN_SOURCE
micky3879b9f5e72025-07-08 18:04:53 -040013384#error _XOPEN_SOURCE is not defined
Steve Kondikae271bc2015-11-15 02:50:53 +010013385#endif
micky3879b9f5e72025-07-08 18:04:53 -040013386
Steve Kondikae271bc2015-11-15 02:50:53 +010013387 ;
13388 return 0;
13389}
13390_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -040013391rm -f "conftest.$ac_objext"
13392if { (eval echo "$as_me:13392: \"$ac_compile\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010013393 (eval $ac_compile) 2>&5
13394 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040013395 echo "$as_me:13395: \$? = $ac_status" >&5
13396 (exit "$ac_status"); } &&
13397 { ac_try='test -s "conftest.$ac_objext"'
13398 { (eval echo "$as_me:13398: \"$ac_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010013399 (eval $ac_try) 2>&5
13400 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040013401 echo "$as_me:13401: \$? = $ac_status" >&5
13402 (exit "$ac_status"); }; }; then
Steve Kondikae271bc2015-11-15 02:50:53 +010013403 cf_cv_xopen_source=no
13404else
13405 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -040013406cat "conftest.$ac_ext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010013407cf_save="$CPPFLAGS"
micky3879b9f5e72025-07-08 18:04:53 -040013408
13409 test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13410 CPPFLAGS="${CPPFLAGS}-D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
13411
13412 cat >"conftest.$ac_ext" <<_ACEOF
13413#line 13413 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +010013414#include "confdefs.h"
13415
micky3879b9f5e72025-07-08 18:04:53 -040013416$ac_includes_default
Steve Kondikae271bc2015-11-15 02:50:53 +010013417
13418int
micky3879b9f5e72025-07-08 18:04:53 -040013419main (void)
Steve Kondikae271bc2015-11-15 02:50:53 +010013420{
13421
micky3879b9f5e72025-07-08 18:04:53 -040013422#ifndef _XOPEN_SOURCE
13423#error _XOPEN_SOURCE is not defined
Steve Kondikae271bc2015-11-15 02:50:53 +010013424#endif
micky3879b9f5e72025-07-08 18:04:53 -040013425
Steve Kondikae271bc2015-11-15 02:50:53 +010013426 ;
13427 return 0;
13428}
13429_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -040013430rm -f "conftest.$ac_objext"
13431if { (eval echo "$as_me:13431: \"$ac_compile\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010013432 (eval $ac_compile) 2>&5
13433 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040013434 echo "$as_me:13434: \$? = $ac_status" >&5
13435 (exit "$ac_status"); } &&
13436 { ac_try='test -s "conftest.$ac_objext"'
13437 { (eval echo "$as_me:13437: \"$ac_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010013438 (eval $ac_try) 2>&5
13439 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040013440 echo "$as_me:13440: \$? = $ac_status" >&5
13441 (exit "$ac_status"); }; }; then
Steve Kondikae271bc2015-11-15 02:50:53 +010013442 cf_cv_xopen_source=no
13443else
13444 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -040013445cat "conftest.$ac_ext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010013446cf_cv_xopen_source=$cf_XOPEN_SOURCE
13447fi
micky3879b9f5e72025-07-08 18:04:53 -040013448rm -f "conftest.$ac_objext" "conftest.$ac_ext"
13449 CPPFLAGS="$cf_save"
Steve Kondikae271bc2015-11-15 02:50:53 +010013450
13451fi
micky3879b9f5e72025-07-08 18:04:53 -040013452rm -f "conftest.$ac_objext" "conftest.$ac_ext"
Steve Kondikae271bc2015-11-15 02:50:53 +010013453
13454fi
micky3879b9f5e72025-07-08 18:04:53 -040013455echo "$as_me:13455: result: $cf_cv_xopen_source" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010013456echo "${ECHO_T}$cf_cv_xopen_source" >&6
13457
13458if test "$cf_cv_xopen_source" != no ; then
13459
13460CFLAGS=`echo "$CFLAGS" | \
13461 sed -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^ ]*\)\?[ ]/ /g' \
13462 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^ ]*\)\?$//g'`
13463
13464CPPFLAGS=`echo "$CPPFLAGS" | \
13465 sed -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^ ]*\)\?[ ]/ /g' \
13466 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^ ]*\)\?$//g'`
13467
13468 cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source"
13469
micky3879b9f5e72025-07-08 18:04:53 -040013470for cf_add_cflags in $cf_temp_xopen_source
13471do
13472 case "x$cf_add_cflags" in
13473 (x-[DU]*)
13474
13475cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
13476while true
13477do
13478 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'`
13479 test "$CFLAGS" != "$cf_old_cflag" || break
13480
13481 CFLAGS="$cf_old_cflag"
13482done
13483
13484cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
13485while true
13486do
13487 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'`
13488 test "$CPPFLAGS" != "$cf_old_cflag" || break
13489
13490 CPPFLAGS="$cf_old_cflag"
13491done
13492
13493 ;;
13494 esac
13495
Steve Kondikae271bc2015-11-15 02:50:53 +010013496cf_fix_cppflags=no
13497cf_new_cflags=
13498cf_new_cppflags=
13499cf_new_extra_cppflags=
13500
micky3879b9f5e72025-07-08 18:04:53 -040013501for cf_add_cflags in $cf_add_cflags
Steve Kondikae271bc2015-11-15 02:50:53 +010013502do
micky3879b9f5e72025-07-08 18:04:53 -040013503case "$cf_fix_cppflags" in
Steve Kondikae271bc2015-11-15 02:50:53 +010013504(no)
micky3879b9f5e72025-07-08 18:04:53 -040013505 case "$cf_add_cflags" in
Steve Kondikae271bc2015-11-15 02:50:53 +010013506 (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
micky3879b9f5e72025-07-08 18:04:53 -040013507 case "$cf_add_cflags" in
Steve Kondikae271bc2015-11-15 02:50:53 +010013508 (-D*)
micky3879b9f5e72025-07-08 18:04:53 -040013509 cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
Steve Kondikae271bc2015-11-15 02:50:53 +010013510
13511 test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13512 && test -z "${cf_tst_cflags}" \
13513 && cf_fix_cppflags=yes
13514
micky3879b9f5e72025-07-08 18:04:53 -040013515 if test "$cf_fix_cppflags" = yes ; then
13516
13517 test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13518 cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13519
Steve Kondikae271bc2015-11-15 02:50:53 +010013520 continue
13521 elif test "${cf_tst_cflags}" = "\"'" ; then
micky3879b9f5e72025-07-08 18:04:53 -040013522
13523 test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13524 cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13525
Steve Kondikae271bc2015-11-15 02:50:53 +010013526 continue
13527 fi
13528 ;;
13529 esac
13530 case "$CPPFLAGS" in
13531 (*$cf_add_cflags)
13532 ;;
13533 (*)
micky3879b9f5e72025-07-08 18:04:53 -040013534 case "$cf_add_cflags" in
Steve Kondikae271bc2015-11-15 02:50:53 +010013535 (-D*)
13536 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13537
13538CPPFLAGS=`echo "$CPPFLAGS" | \
13539 sed -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?[ ]/ /g' \
13540 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?$//g'`
13541
13542 ;;
13543 esac
micky3879b9f5e72025-07-08 18:04:53 -040013544
13545 test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13546 cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
13547
Steve Kondikae271bc2015-11-15 02:50:53 +010013548 ;;
13549 esac
13550 ;;
13551 (*)
micky3879b9f5e72025-07-08 18:04:53 -040013552
13553 test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
13554 cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
13555
Steve Kondikae271bc2015-11-15 02:50:53 +010013556 ;;
13557 esac
13558 ;;
13559(yes)
Steve Kondikae271bc2015-11-15 02:50:53 +010013560
micky3879b9f5e72025-07-08 18:04:53 -040013561 test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13562 cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13563
13564 cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
Steve Kondikae271bc2015-11-15 02:50:53 +010013565
13566 test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13567 && test -z "${cf_tst_cflags}" \
13568 && cf_fix_cppflags=no
13569 ;;
13570esac
13571done
13572
13573if test -n "$cf_new_cflags" ; then
13574
micky3879b9f5e72025-07-08 18:04:53 -040013575 test -n "$CFLAGS" && CFLAGS="$CFLAGS "
13576 CFLAGS="${CFLAGS}$cf_new_cflags"
13577
Steve Kondikae271bc2015-11-15 02:50:53 +010013578fi
13579
13580if test -n "$cf_new_cppflags" ; then
13581
micky3879b9f5e72025-07-08 18:04:53 -040013582 test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13583 CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
13584
Steve Kondikae271bc2015-11-15 02:50:53 +010013585fi
13586
13587if test -n "$cf_new_extra_cppflags" ; then
13588
micky3879b9f5e72025-07-08 18:04:53 -040013589 test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
13590 EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
Steve Kondikae271bc2015-11-15 02:50:53 +010013591
13592fi
13593
micky3879b9f5e72025-07-08 18:04:53 -040013594done
13595
13596fi
13597
13598 cf_save_xopen_cppflags="$CPPFLAGS"
13599
13600if test "$cf_cv_posix_visible" = no; then
13601
Steve Kondikae271bc2015-11-15 02:50:53 +010013602cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE
13603
13604cf_save_CFLAGS="$CFLAGS"
13605cf_save_CPPFLAGS="$CPPFLAGS"
13606
13607cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \
13608 sed -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^ ]*\)\?[ ]/ /g' \
13609 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^ ]*\)\?$//g'`
13610
13611cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \
13612 sed -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^ ]*\)\?[ ]/ /g' \
13613 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^ ]*\)\?$//g'`
13614
micky3879b9f5e72025-07-08 18:04:53 -040013615echo "$as_me:13615: checking if we should define _POSIX_C_SOURCE" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010013616echo $ECHO_N "checking if we should define _POSIX_C_SOURCE... $ECHO_C" >&6
13617if test "${cf_cv_posix_c_source+set}" = set; then
13618 echo $ECHO_N "(cached) $ECHO_C" >&6
13619else
13620
micky3879b9f5e72025-07-08 18:04:53 -040013621echo "${as_me:-configure}:13621: testing if the symbol is already defined go no further ..." 1>&5
Steve Kondikae271bc2015-11-15 02:50:53 +010013622
micky3879b9f5e72025-07-08 18:04:53 -040013623 cat >"conftest.$ac_ext" <<_ACEOF
13624#line 13624 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +010013625#include "confdefs.h"
13626#include <sys/types.h>
13627int
micky3879b9f5e72025-07-08 18:04:53 -040013628main (void)
Steve Kondikae271bc2015-11-15 02:50:53 +010013629{
13630
13631#ifndef _POSIX_C_SOURCE
micky3879b9f5e72025-07-08 18:04:53 -040013632#error _POSIX_C_SOURCE is not defined
Steve Kondikae271bc2015-11-15 02:50:53 +010013633#endif
13634 ;
13635 return 0;
13636}
13637_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -040013638rm -f "conftest.$ac_objext"
13639if { (eval echo "$as_me:13639: \"$ac_compile\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010013640 (eval $ac_compile) 2>&5
13641 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040013642 echo "$as_me:13642: \$? = $ac_status" >&5
13643 (exit "$ac_status"); } &&
13644 { ac_try='test -s "conftest.$ac_objext"'
13645 { (eval echo "$as_me:13645: \"$ac_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010013646 (eval $ac_try) 2>&5
13647 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040013648 echo "$as_me:13648: \$? = $ac_status" >&5
13649 (exit "$ac_status"); }; }; then
Steve Kondikae271bc2015-11-15 02:50:53 +010013650 cf_cv_posix_c_source=no
13651else
13652 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -040013653cat "conftest.$ac_ext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010013654cf_want_posix_source=no
13655 case .$cf_POSIX_C_SOURCE in
13656 (.[12]??*)
13657 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
13658 ;;
13659 (.2)
13660 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
13661 cf_want_posix_source=yes
13662 ;;
13663 (.*)
13664 cf_want_posix_source=yes
13665 ;;
13666 esac
13667 if test "$cf_want_posix_source" = yes ; then
micky3879b9f5e72025-07-08 18:04:53 -040013668 cat >"conftest.$ac_ext" <<_ACEOF
13669#line 13669 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +010013670#include "confdefs.h"
13671#include <sys/types.h>
13672int
micky3879b9f5e72025-07-08 18:04:53 -040013673main (void)
Steve Kondikae271bc2015-11-15 02:50:53 +010013674{
13675
13676#ifdef _POSIX_SOURCE
micky3879b9f5e72025-07-08 18:04:53 -040013677#error _POSIX_SOURCE is defined
Steve Kondikae271bc2015-11-15 02:50:53 +010013678#endif
13679 ;
13680 return 0;
13681}
13682_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -040013683rm -f "conftest.$ac_objext"
13684if { (eval echo "$as_me:13684: \"$ac_compile\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010013685 (eval $ac_compile) 2>&5
13686 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040013687 echo "$as_me:13687: \$? = $ac_status" >&5
13688 (exit "$ac_status"); } &&
13689 { ac_try='test -s "conftest.$ac_objext"'
13690 { (eval echo "$as_me:13690: \"$ac_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010013691 (eval $ac_try) 2>&5
13692 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040013693 echo "$as_me:13693: \$? = $ac_status" >&5
13694 (exit "$ac_status"); }; }; then
Steve Kondikae271bc2015-11-15 02:50:53 +010013695 :
13696else
13697 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -040013698cat "conftest.$ac_ext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010013699cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE"
13700fi
micky3879b9f5e72025-07-08 18:04:53 -040013701rm -f "conftest.$ac_objext" "conftest.$ac_ext"
Steve Kondikae271bc2015-11-15 02:50:53 +010013702 fi
13703
micky3879b9f5e72025-07-08 18:04:53 -040013704echo "${as_me:-configure}:13704: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
Steve Kondikae271bc2015-11-15 02:50:53 +010013705
13706 CFLAGS="$cf_trim_CFLAGS"
micky3879b9f5e72025-07-08 18:04:53 -040013707 CPPFLAGS="$cf_trim_CPPFLAGS"
Steve Kondikae271bc2015-11-15 02:50:53 +010013708
micky3879b9f5e72025-07-08 18:04:53 -040013709 test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13710 CPPFLAGS="${CPPFLAGS}$cf_cv_posix_c_source"
Steve Kondikae271bc2015-11-15 02:50:53 +010013711
micky3879b9f5e72025-07-08 18:04:53 -040013712echo "${as_me:-configure}:13712: testing if the second compile does not leave our definition intact error ..." 1>&5
13713
13714 cat >"conftest.$ac_ext" <<_ACEOF
13715#line 13715 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +010013716#include "confdefs.h"
13717#include <sys/types.h>
13718int
micky3879b9f5e72025-07-08 18:04:53 -040013719main (void)
Steve Kondikae271bc2015-11-15 02:50:53 +010013720{
13721
13722#ifndef _POSIX_C_SOURCE
micky3879b9f5e72025-07-08 18:04:53 -040013723#error _POSIX_C_SOURCE is not defined
Steve Kondikae271bc2015-11-15 02:50:53 +010013724#endif
13725 ;
13726 return 0;
13727}
13728_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -040013729rm -f "conftest.$ac_objext"
13730if { (eval echo "$as_me:13730: \"$ac_compile\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010013731 (eval $ac_compile) 2>&5
13732 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040013733 echo "$as_me:13733: \$? = $ac_status" >&5
13734 (exit "$ac_status"); } &&
13735 { ac_try='test -s "conftest.$ac_objext"'
13736 { (eval echo "$as_me:13736: \"$ac_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010013737 (eval $ac_try) 2>&5
13738 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040013739 echo "$as_me:13739: \$? = $ac_status" >&5
13740 (exit "$ac_status"); }; }; then
Steve Kondikae271bc2015-11-15 02:50:53 +010013741 :
13742else
13743 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -040013744cat "conftest.$ac_ext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010013745cf_cv_posix_c_source=no
13746fi
micky3879b9f5e72025-07-08 18:04:53 -040013747rm -f "conftest.$ac_objext" "conftest.$ac_ext"
Steve Kondikae271bc2015-11-15 02:50:53 +010013748 CFLAGS="$cf_save_CFLAGS"
13749 CPPFLAGS="$cf_save_CPPFLAGS"
13750
13751fi
micky3879b9f5e72025-07-08 18:04:53 -040013752rm -f "conftest.$ac_objext" "conftest.$ac_ext"
Steve Kondikae271bc2015-11-15 02:50:53 +010013753
13754fi
micky3879b9f5e72025-07-08 18:04:53 -040013755echo "$as_me:13755: result: $cf_cv_posix_c_source" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010013756echo "${ECHO_T}$cf_cv_posix_c_source" >&6
13757
13758if test "$cf_cv_posix_c_source" != no ; then
13759 CFLAGS="$cf_trim_CFLAGS"
13760 CPPFLAGS="$cf_trim_CPPFLAGS"
13761
13762cf_fix_cppflags=no
13763cf_new_cflags=
13764cf_new_cppflags=
13765cf_new_extra_cppflags=
13766
13767for cf_add_cflags in $cf_cv_posix_c_source
13768do
micky3879b9f5e72025-07-08 18:04:53 -040013769case "$cf_fix_cppflags" in
Steve Kondikae271bc2015-11-15 02:50:53 +010013770(no)
micky3879b9f5e72025-07-08 18:04:53 -040013771 case "$cf_add_cflags" in
Steve Kondikae271bc2015-11-15 02:50:53 +010013772 (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
micky3879b9f5e72025-07-08 18:04:53 -040013773 case "$cf_add_cflags" in
Steve Kondikae271bc2015-11-15 02:50:53 +010013774 (-D*)
micky3879b9f5e72025-07-08 18:04:53 -040013775 cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
Steve Kondikae271bc2015-11-15 02:50:53 +010013776
13777 test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13778 && test -z "${cf_tst_cflags}" \
13779 && cf_fix_cppflags=yes
13780
micky3879b9f5e72025-07-08 18:04:53 -040013781 if test "$cf_fix_cppflags" = yes ; then
13782
13783 test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13784 cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13785
Steve Kondikae271bc2015-11-15 02:50:53 +010013786 continue
13787 elif test "${cf_tst_cflags}" = "\"'" ; then
micky3879b9f5e72025-07-08 18:04:53 -040013788
13789 test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13790 cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13791
Steve Kondikae271bc2015-11-15 02:50:53 +010013792 continue
13793 fi
13794 ;;
13795 esac
13796 case "$CPPFLAGS" in
13797 (*$cf_add_cflags)
13798 ;;
13799 (*)
micky3879b9f5e72025-07-08 18:04:53 -040013800 case "$cf_add_cflags" in
Steve Kondikae271bc2015-11-15 02:50:53 +010013801 (-D*)
13802 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13803
13804CPPFLAGS=`echo "$CPPFLAGS" | \
13805 sed -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?[ ]/ /g' \
13806 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?$//g'`
13807
13808 ;;
13809 esac
micky3879b9f5e72025-07-08 18:04:53 -040013810
13811 test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13812 cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
13813
Steve Kondikae271bc2015-11-15 02:50:53 +010013814 ;;
13815 esac
13816 ;;
13817 (*)
micky3879b9f5e72025-07-08 18:04:53 -040013818
13819 test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
13820 cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
13821
Steve Kondikae271bc2015-11-15 02:50:53 +010013822 ;;
13823 esac
13824 ;;
13825(yes)
Steve Kondikae271bc2015-11-15 02:50:53 +010013826
micky3879b9f5e72025-07-08 18:04:53 -040013827 test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13828 cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13829
13830 cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
Steve Kondikae271bc2015-11-15 02:50:53 +010013831
13832 test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13833 && test -z "${cf_tst_cflags}" \
13834 && cf_fix_cppflags=no
13835 ;;
13836esac
13837done
13838
13839if test -n "$cf_new_cflags" ; then
13840
micky3879b9f5e72025-07-08 18:04:53 -040013841 test -n "$CFLAGS" && CFLAGS="$CFLAGS "
13842 CFLAGS="${CFLAGS}$cf_new_cflags"
13843
Steve Kondikae271bc2015-11-15 02:50:53 +010013844fi
13845
13846if test -n "$cf_new_cppflags" ; then
13847
micky3879b9f5e72025-07-08 18:04:53 -040013848 test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13849 CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
13850
Steve Kondikae271bc2015-11-15 02:50:53 +010013851fi
13852
13853if test -n "$cf_new_extra_cppflags" ; then
13854
micky3879b9f5e72025-07-08 18:04:53 -040013855 test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
13856 EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
13857
Steve Kondikae271bc2015-11-15 02:50:53 +010013858fi
13859
13860fi
13861
micky3879b9f5e72025-07-08 18:04:53 -040013862fi # cf_cv_posix_visible
13863
13864 # Some of these niche implementations use copy/paste, double-check...
13865 if test "$cf_cv_xopen_source" = no ; then
13866 test -n "$verbose" && echo " checking if _POSIX_C_SOURCE interferes with _XOPEN_SOURCE" 1>&6
13867
13868echo "${as_me:-configure}:13868: testing checking if _POSIX_C_SOURCE interferes with _XOPEN_SOURCE ..." 1>&5
13869
13870 cat >"conftest.$ac_ext" <<_ACEOF
13871#line 13871 "configure"
13872#include "confdefs.h"
13873
13874$ac_includes_default
13875
13876int
13877main (void)
13878{
13879
13880#ifndef _XOPEN_SOURCE
13881#error _XOPEN_SOURCE is not defined
13882#endif
13883
13884 ;
13885 return 0;
13886}
13887_ACEOF
13888rm -f "conftest.$ac_objext"
13889if { (eval echo "$as_me:13889: \"$ac_compile\"") >&5
13890 (eval $ac_compile) 2>&5
13891 ac_status=$?
13892 echo "$as_me:13892: \$? = $ac_status" >&5
13893 (exit "$ac_status"); } &&
13894 { ac_try='test -s "conftest.$ac_objext"'
13895 { (eval echo "$as_me:13895: \"$ac_try\"") >&5
13896 (eval $ac_try) 2>&5
13897 ac_status=$?
13898 echo "$as_me:13898: \$? = $ac_status" >&5
13899 (exit "$ac_status"); }; }; then
13900 :
13901else
13902 echo "$as_me: failed program was:" >&5
13903cat "conftest.$ac_ext" >&5
13904
13905 { echo "$as_me:13905: WARNING: _POSIX_C_SOURCE definition is not usable" >&5
13906echo "$as_me: WARNING: _POSIX_C_SOURCE definition is not usable" >&2;}
13907 CPPFLAGS="$cf_save_xopen_cppflags"
13908fi
13909rm -f "conftest.$ac_objext" "conftest.$ac_ext"
13910 fi
Steve Kondikae271bc2015-11-15 02:50:53 +010013911 ;;
13912esac
13913
13914if test -n "$cf_xopen_source" ; then
13915
micky3879b9f5e72025-07-08 18:04:53 -040013916for cf_add_cflags in $cf_xopen_source
13917do
13918 case "x$cf_add_cflags" in
13919 (x-[DU]*)
13920
13921cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
13922while true
13923do
13924 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'`
13925 test "$CFLAGS" != "$cf_old_cflag" || break
13926 test -n "$verbose" && echo " removing old option $cf_add_cflags from CFLAGS" 1>&6
13927
13928echo "${as_me:-configure}:13928: testing removing old option $cf_add_cflags from CFLAGS ..." 1>&5
13929
13930 CFLAGS="$cf_old_cflag"
13931done
13932
13933cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
13934while true
13935do
13936 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'`
13937 test "$CPPFLAGS" != "$cf_old_cflag" || break
13938 test -n "$verbose" && echo " removing old option $cf_add_cflags from CPPFLAGS" 1>&6
13939
13940echo "${as_me:-configure}:13940: testing removing old option $cf_add_cflags from CPPFLAGS ..." 1>&5
13941
13942 CPPFLAGS="$cf_old_cflag"
13943done
13944
13945 ;;
13946 esac
13947
Steve Kondikae271bc2015-11-15 02:50:53 +010013948cf_fix_cppflags=no
13949cf_new_cflags=
13950cf_new_cppflags=
13951cf_new_extra_cppflags=
13952
micky3879b9f5e72025-07-08 18:04:53 -040013953for cf_add_cflags in $cf_add_cflags
Steve Kondikae271bc2015-11-15 02:50:53 +010013954do
micky3879b9f5e72025-07-08 18:04:53 -040013955case "$cf_fix_cppflags" in
Steve Kondikae271bc2015-11-15 02:50:53 +010013956(no)
micky3879b9f5e72025-07-08 18:04:53 -040013957 case "$cf_add_cflags" in
Steve Kondikae271bc2015-11-15 02:50:53 +010013958 (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
micky3879b9f5e72025-07-08 18:04:53 -040013959 case "$cf_add_cflags" in
Steve Kondikae271bc2015-11-15 02:50:53 +010013960 (-D*)
micky3879b9f5e72025-07-08 18:04:53 -040013961 cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
Steve Kondikae271bc2015-11-15 02:50:53 +010013962
13963 test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13964 && test -z "${cf_tst_cflags}" \
13965 && cf_fix_cppflags=yes
13966
micky3879b9f5e72025-07-08 18:04:53 -040013967 if test "$cf_fix_cppflags" = yes ; then
13968
13969 test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13970 cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13971
Steve Kondikae271bc2015-11-15 02:50:53 +010013972 continue
13973 elif test "${cf_tst_cflags}" = "\"'" ; then
micky3879b9f5e72025-07-08 18:04:53 -040013974
13975 test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13976 cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13977
Steve Kondikae271bc2015-11-15 02:50:53 +010013978 continue
13979 fi
13980 ;;
13981 esac
13982 case "$CPPFLAGS" in
13983 (*$cf_add_cflags)
13984 ;;
13985 (*)
micky3879b9f5e72025-07-08 18:04:53 -040013986 case "$cf_add_cflags" in
Steve Kondikae271bc2015-11-15 02:50:53 +010013987 (-D*)
13988 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13989
13990CPPFLAGS=`echo "$CPPFLAGS" | \
13991 sed -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?[ ]/ /g' \
13992 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?$//g'`
13993
13994 ;;
13995 esac
micky3879b9f5e72025-07-08 18:04:53 -040013996
13997 test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13998 cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
13999
Steve Kondikae271bc2015-11-15 02:50:53 +010014000 ;;
14001 esac
14002 ;;
14003 (*)
micky3879b9f5e72025-07-08 18:04:53 -040014004
14005 test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
14006 cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
14007
Steve Kondikae271bc2015-11-15 02:50:53 +010014008 ;;
14009 esac
14010 ;;
14011(yes)
Steve Kondikae271bc2015-11-15 02:50:53 +010014012
micky3879b9f5e72025-07-08 18:04:53 -040014013 test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14014 cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14015
14016 cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
Steve Kondikae271bc2015-11-15 02:50:53 +010014017
14018 test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14019 && test -z "${cf_tst_cflags}" \
14020 && cf_fix_cppflags=no
14021 ;;
14022esac
14023done
14024
14025if test -n "$cf_new_cflags" ; then
14026 test -n "$verbose" && echo " add to \$CFLAGS $cf_new_cflags" 1>&6
14027
micky3879b9f5e72025-07-08 18:04:53 -040014028echo "${as_me:-configure}:14028: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
Steve Kondikae271bc2015-11-15 02:50:53 +010014029
micky3879b9f5e72025-07-08 18:04:53 -040014030 test -n "$CFLAGS" && CFLAGS="$CFLAGS "
14031 CFLAGS="${CFLAGS}$cf_new_cflags"
14032
Steve Kondikae271bc2015-11-15 02:50:53 +010014033fi
14034
14035if test -n "$cf_new_cppflags" ; then
14036 test -n "$verbose" && echo " add to \$CPPFLAGS $cf_new_cppflags" 1>&6
14037
micky3879b9f5e72025-07-08 18:04:53 -040014038echo "${as_me:-configure}:14038: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
Steve Kondikae271bc2015-11-15 02:50:53 +010014039
micky3879b9f5e72025-07-08 18:04:53 -040014040 test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14041 CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
14042
Steve Kondikae271bc2015-11-15 02:50:53 +010014043fi
14044
14045if test -n "$cf_new_extra_cppflags" ; then
14046 test -n "$verbose" && echo " add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6
14047
micky3879b9f5e72025-07-08 18:04:53 -040014048echo "${as_me:-configure}:14048: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
Steve Kondikae271bc2015-11-15 02:50:53 +010014049
micky3879b9f5e72025-07-08 18:04:53 -040014050 test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
14051 EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
14052
Steve Kondikae271bc2015-11-15 02:50:53 +010014053fi
14054
micky3879b9f5e72025-07-08 18:04:53 -040014055done
14056
Steve Kondikae271bc2015-11-15 02:50:53 +010014057fi
14058
14059if test -n "$cf_XOPEN_SOURCE" && test -z "$cf_cv_xopen_source" ; then
micky3879b9f5e72025-07-08 18:04:53 -040014060 echo "$as_me:14060: checking if _XOPEN_SOURCE really is set" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010014061echo $ECHO_N "checking if _XOPEN_SOURCE really is set... $ECHO_C" >&6
micky3879b9f5e72025-07-08 18:04:53 -040014062 cat >"conftest.$ac_ext" <<_ACEOF
14063#line 14063 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +010014064#include "confdefs.h"
14065#include <stdlib.h>
14066int
micky3879b9f5e72025-07-08 18:04:53 -040014067main (void)
Steve Kondikae271bc2015-11-15 02:50:53 +010014068{
14069
14070#ifndef _XOPEN_SOURCE
micky3879b9f5e72025-07-08 18:04:53 -040014071#error _XOPEN_SOURCE is not defined
Steve Kondikae271bc2015-11-15 02:50:53 +010014072#endif
14073 ;
14074 return 0;
14075}
14076_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -040014077rm -f "conftest.$ac_objext"
14078if { (eval echo "$as_me:14078: \"$ac_compile\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010014079 (eval $ac_compile) 2>&5
14080 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040014081 echo "$as_me:14081: \$? = $ac_status" >&5
14082 (exit "$ac_status"); } &&
14083 { ac_try='test -s "conftest.$ac_objext"'
14084 { (eval echo "$as_me:14084: \"$ac_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010014085 (eval $ac_try) 2>&5
14086 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040014087 echo "$as_me:14087: \$? = $ac_status" >&5
14088 (exit "$ac_status"); }; }; then
Steve Kondikae271bc2015-11-15 02:50:53 +010014089 cf_XOPEN_SOURCE_set=yes
14090else
14091 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -040014092cat "conftest.$ac_ext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010014093cf_XOPEN_SOURCE_set=no
14094fi
micky3879b9f5e72025-07-08 18:04:53 -040014095rm -f "conftest.$ac_objext" "conftest.$ac_ext"
14096 echo "$as_me:14096: result: $cf_XOPEN_SOURCE_set" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010014097echo "${ECHO_T}$cf_XOPEN_SOURCE_set" >&6
micky3879b9f5e72025-07-08 18:04:53 -040014098 if test "$cf_XOPEN_SOURCE_set" = yes
Steve Kondikae271bc2015-11-15 02:50:53 +010014099 then
micky3879b9f5e72025-07-08 18:04:53 -040014100 cat >"conftest.$ac_ext" <<_ACEOF
14101#line 14101 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +010014102#include "confdefs.h"
14103#include <stdlib.h>
14104int
micky3879b9f5e72025-07-08 18:04:53 -040014105main (void)
Steve Kondikae271bc2015-11-15 02:50:53 +010014106{
14107
14108#if (_XOPEN_SOURCE - 0) < $cf_XOPEN_SOURCE
micky3879b9f5e72025-07-08 18:04:53 -040014109#error (_XOPEN_SOURCE - 0) < $cf_XOPEN_SOURCE
Steve Kondikae271bc2015-11-15 02:50:53 +010014110#endif
14111 ;
14112 return 0;
14113}
14114_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -040014115rm -f "conftest.$ac_objext"
14116if { (eval echo "$as_me:14116: \"$ac_compile\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010014117 (eval $ac_compile) 2>&5
14118 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040014119 echo "$as_me:14119: \$? = $ac_status" >&5
14120 (exit "$ac_status"); } &&
14121 { ac_try='test -s "conftest.$ac_objext"'
14122 { (eval echo "$as_me:14122: \"$ac_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010014123 (eval $ac_try) 2>&5
14124 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040014125 echo "$as_me:14125: \$? = $ac_status" >&5
14126 (exit "$ac_status"); }; }; then
Steve Kondikae271bc2015-11-15 02:50:53 +010014127 cf_XOPEN_SOURCE_set_ok=yes
14128else
14129 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -040014130cat "conftest.$ac_ext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010014131cf_XOPEN_SOURCE_set_ok=no
14132fi
micky3879b9f5e72025-07-08 18:04:53 -040014133rm -f "conftest.$ac_objext" "conftest.$ac_ext"
14134 if test "$cf_XOPEN_SOURCE_set_ok" = no
Steve Kondikae271bc2015-11-15 02:50:53 +010014135 then
micky3879b9f5e72025-07-08 18:04:53 -040014136 { echo "$as_me:14136: WARNING: _XOPEN_SOURCE is lower than requested" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010014137echo "$as_me: WARNING: _XOPEN_SOURCE is lower than requested" >&2;}
14138 fi
14139 else
14140
micky3879b9f5e72025-07-08 18:04:53 -040014141echo "$as_me:14141: checking if we should define _XOPEN_SOURCE" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010014142echo $ECHO_N "checking if we should define _XOPEN_SOURCE... $ECHO_C" >&6
14143if test "${cf_cv_xopen_source+set}" = set; then
14144 echo $ECHO_N "(cached) $ECHO_C" >&6
14145else
14146
micky3879b9f5e72025-07-08 18:04:53 -040014147 cat >"conftest.$ac_ext" <<_ACEOF
14148#line 14148 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +010014149#include "confdefs.h"
14150
micky3879b9f5e72025-07-08 18:04:53 -040014151$ac_includes_default
Steve Kondikae271bc2015-11-15 02:50:53 +010014152
14153int
micky3879b9f5e72025-07-08 18:04:53 -040014154main (void)
Steve Kondikae271bc2015-11-15 02:50:53 +010014155{
14156
14157#ifndef _XOPEN_SOURCE
micky3879b9f5e72025-07-08 18:04:53 -040014158#error _XOPEN_SOURCE is not defined
Steve Kondikae271bc2015-11-15 02:50:53 +010014159#endif
micky3879b9f5e72025-07-08 18:04:53 -040014160
Steve Kondikae271bc2015-11-15 02:50:53 +010014161 ;
14162 return 0;
14163}
14164_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -040014165rm -f "conftest.$ac_objext"
14166if { (eval echo "$as_me:14166: \"$ac_compile\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010014167 (eval $ac_compile) 2>&5
14168 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040014169 echo "$as_me:14169: \$? = $ac_status" >&5
14170 (exit "$ac_status"); } &&
14171 { ac_try='test -s "conftest.$ac_objext"'
14172 { (eval echo "$as_me:14172: \"$ac_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010014173 (eval $ac_try) 2>&5
14174 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040014175 echo "$as_me:14175: \$? = $ac_status" >&5
14176 (exit "$ac_status"); }; }; then
Steve Kondikae271bc2015-11-15 02:50:53 +010014177 cf_cv_xopen_source=no
14178else
14179 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -040014180cat "conftest.$ac_ext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010014181cf_save="$CPPFLAGS"
micky3879b9f5e72025-07-08 18:04:53 -040014182
14183 test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14184 CPPFLAGS="${CPPFLAGS}-D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
14185
14186 cat >"conftest.$ac_ext" <<_ACEOF
14187#line 14187 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +010014188#include "confdefs.h"
14189
micky3879b9f5e72025-07-08 18:04:53 -040014190$ac_includes_default
Steve Kondikae271bc2015-11-15 02:50:53 +010014191
14192int
micky3879b9f5e72025-07-08 18:04:53 -040014193main (void)
Steve Kondikae271bc2015-11-15 02:50:53 +010014194{
14195
micky3879b9f5e72025-07-08 18:04:53 -040014196#ifndef _XOPEN_SOURCE
14197#error _XOPEN_SOURCE is not defined
Steve Kondikae271bc2015-11-15 02:50:53 +010014198#endif
micky3879b9f5e72025-07-08 18:04:53 -040014199
Steve Kondikae271bc2015-11-15 02:50:53 +010014200 ;
14201 return 0;
14202}
14203_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -040014204rm -f "conftest.$ac_objext"
14205if { (eval echo "$as_me:14205: \"$ac_compile\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010014206 (eval $ac_compile) 2>&5
14207 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040014208 echo "$as_me:14208: \$? = $ac_status" >&5
14209 (exit "$ac_status"); } &&
14210 { ac_try='test -s "conftest.$ac_objext"'
14211 { (eval echo "$as_me:14211: \"$ac_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010014212 (eval $ac_try) 2>&5
14213 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040014214 echo "$as_me:14214: \$? = $ac_status" >&5
14215 (exit "$ac_status"); }; }; then
Steve Kondikae271bc2015-11-15 02:50:53 +010014216 cf_cv_xopen_source=no
14217else
14218 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -040014219cat "conftest.$ac_ext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010014220cf_cv_xopen_source=$cf_XOPEN_SOURCE
14221fi
micky3879b9f5e72025-07-08 18:04:53 -040014222rm -f "conftest.$ac_objext" "conftest.$ac_ext"
14223 CPPFLAGS="$cf_save"
Steve Kondikae271bc2015-11-15 02:50:53 +010014224
14225fi
micky3879b9f5e72025-07-08 18:04:53 -040014226rm -f "conftest.$ac_objext" "conftest.$ac_ext"
Steve Kondikae271bc2015-11-15 02:50:53 +010014227
14228fi
micky3879b9f5e72025-07-08 18:04:53 -040014229echo "$as_me:14229: result: $cf_cv_xopen_source" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010014230echo "${ECHO_T}$cf_cv_xopen_source" >&6
14231
14232if test "$cf_cv_xopen_source" != no ; then
14233
14234CFLAGS=`echo "$CFLAGS" | \
14235 sed -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^ ]*\)\?[ ]/ /g' \
14236 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^ ]*\)\?$//g'`
14237
14238CPPFLAGS=`echo "$CPPFLAGS" | \
14239 sed -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^ ]*\)\?[ ]/ /g' \
14240 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^ ]*\)\?$//g'`
14241
14242 cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source"
14243
micky3879b9f5e72025-07-08 18:04:53 -040014244for cf_add_cflags in $cf_temp_xopen_source
14245do
14246 case "x$cf_add_cflags" in
14247 (x-[DU]*)
14248
14249cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
14250while true
14251do
14252 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'`
14253 test "$CFLAGS" != "$cf_old_cflag" || break
14254
14255 CFLAGS="$cf_old_cflag"
14256done
14257
14258cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
14259while true
14260do
14261 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'`
14262 test "$CPPFLAGS" != "$cf_old_cflag" || break
14263
14264 CPPFLAGS="$cf_old_cflag"
14265done
14266
14267 ;;
14268 esac
14269
Steve Kondikae271bc2015-11-15 02:50:53 +010014270cf_fix_cppflags=no
14271cf_new_cflags=
14272cf_new_cppflags=
14273cf_new_extra_cppflags=
14274
micky3879b9f5e72025-07-08 18:04:53 -040014275for cf_add_cflags in $cf_add_cflags
Steve Kondikae271bc2015-11-15 02:50:53 +010014276do
micky3879b9f5e72025-07-08 18:04:53 -040014277case "$cf_fix_cppflags" in
Steve Kondikae271bc2015-11-15 02:50:53 +010014278(no)
micky3879b9f5e72025-07-08 18:04:53 -040014279 case "$cf_add_cflags" in
Steve Kondikae271bc2015-11-15 02:50:53 +010014280 (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
micky3879b9f5e72025-07-08 18:04:53 -040014281 case "$cf_add_cflags" in
Steve Kondikae271bc2015-11-15 02:50:53 +010014282 (-D*)
micky3879b9f5e72025-07-08 18:04:53 -040014283 cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
Steve Kondikae271bc2015-11-15 02:50:53 +010014284
14285 test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14286 && test -z "${cf_tst_cflags}" \
14287 && cf_fix_cppflags=yes
14288
micky3879b9f5e72025-07-08 18:04:53 -040014289 if test "$cf_fix_cppflags" = yes ; then
14290
14291 test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14292 cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14293
Steve Kondikae271bc2015-11-15 02:50:53 +010014294 continue
14295 elif test "${cf_tst_cflags}" = "\"'" ; then
micky3879b9f5e72025-07-08 18:04:53 -040014296
14297 test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14298 cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14299
Steve Kondikae271bc2015-11-15 02:50:53 +010014300 continue
14301 fi
14302 ;;
14303 esac
14304 case "$CPPFLAGS" in
14305 (*$cf_add_cflags)
14306 ;;
14307 (*)
micky3879b9f5e72025-07-08 18:04:53 -040014308 case "$cf_add_cflags" in
Steve Kondikae271bc2015-11-15 02:50:53 +010014309 (-D*)
14310 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
14311
14312CPPFLAGS=`echo "$CPPFLAGS" | \
14313 sed -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?[ ]/ /g' \
14314 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?$//g'`
14315
14316 ;;
14317 esac
micky3879b9f5e72025-07-08 18:04:53 -040014318
14319 test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
14320 cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
14321
Steve Kondikae271bc2015-11-15 02:50:53 +010014322 ;;
14323 esac
14324 ;;
14325 (*)
micky3879b9f5e72025-07-08 18:04:53 -040014326
14327 test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
14328 cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
14329
Steve Kondikae271bc2015-11-15 02:50:53 +010014330 ;;
14331 esac
14332 ;;
14333(yes)
Steve Kondikae271bc2015-11-15 02:50:53 +010014334
micky3879b9f5e72025-07-08 18:04:53 -040014335 test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14336 cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14337
14338 cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
Steve Kondikae271bc2015-11-15 02:50:53 +010014339
14340 test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14341 && test -z "${cf_tst_cflags}" \
14342 && cf_fix_cppflags=no
14343 ;;
14344esac
14345done
14346
14347if test -n "$cf_new_cflags" ; then
14348
micky3879b9f5e72025-07-08 18:04:53 -040014349 test -n "$CFLAGS" && CFLAGS="$CFLAGS "
14350 CFLAGS="${CFLAGS}$cf_new_cflags"
14351
Steve Kondikae271bc2015-11-15 02:50:53 +010014352fi
14353
14354if test -n "$cf_new_cppflags" ; then
14355
micky3879b9f5e72025-07-08 18:04:53 -040014356 test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14357 CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
14358
Steve Kondikae271bc2015-11-15 02:50:53 +010014359fi
14360
14361if test -n "$cf_new_extra_cppflags" ; then
14362
micky3879b9f5e72025-07-08 18:04:53 -040014363 test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
14364 EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
14365
Steve Kondikae271bc2015-11-15 02:50:53 +010014366fi
14367
micky3879b9f5e72025-07-08 18:04:53 -040014368done
14369
Steve Kondikae271bc2015-11-15 02:50:53 +010014370fi
14371
14372 fi
14373fi
micky3879b9f5e72025-07-08 18:04:53 -040014374fi # cf_cv_posix_visible
14375
14376echo "$as_me:14376: checking for ANSI C header files" >&5
14377echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
14378if test "${ac_cv_header_stdc+set}" = set; then
14379 echo $ECHO_N "(cached) $ECHO_C" >&6
14380else
14381 cat >"conftest.$ac_ext" <<_ACEOF
14382#line 14382 "configure"
14383#include "confdefs.h"
14384#include <stdlib.h>
14385#include <stdarg.h>
14386#include <string.h>
14387#include <float.h>
14388
14389_ACEOF
14390if { (eval echo "$as_me:14390: \"$ac_cpp "conftest.$ac_ext"\"") >&5
14391 (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
14392 ac_status=$?
14393 $EGREP -v '^ *\+' conftest.er1 >conftest.err
14394 rm -f conftest.er1
14395 cat conftest.err >&5
14396 echo "$as_me:14396: \$? = $ac_status" >&5
14397 (exit "$ac_status"); } >/dev/null; then
14398 if test -s conftest.err; then
14399 ac_cpp_err=$ac_c_preproc_warn_flag
14400 else
14401 ac_cpp_err=
14402 fi
14403else
14404 ac_cpp_err=yes
14405fi
14406if test -z "$ac_cpp_err"; then
14407 ac_cv_header_stdc=yes
14408else
14409 echo "$as_me: failed program was:" >&5
14410 cat "conftest.$ac_ext" >&5
14411 ac_cv_header_stdc=no
14412fi
14413rm -f conftest.err "conftest.$ac_ext"
14414
14415if test $ac_cv_header_stdc = yes; then
14416 # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
14417 cat >"conftest.$ac_ext" <<_ACEOF
14418#line 14418 "configure"
14419#include "confdefs.h"
14420#include <string.h>
14421
14422_ACEOF
14423if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
14424 $EGREP "memchr" >/dev/null 2>&1; then
14425 :
14426else
14427 ac_cv_header_stdc=no
14428fi
14429rm -rf conftest*
14430
14431fi
14432
14433if test $ac_cv_header_stdc = yes; then
14434 # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
14435 cat >"conftest.$ac_ext" <<_ACEOF
14436#line 14436 "configure"
14437#include "confdefs.h"
14438#include <stdlib.h>
14439
14440_ACEOF
14441if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
14442 $EGREP "free" >/dev/null 2>&1; then
14443 :
14444else
14445 ac_cv_header_stdc=no
14446fi
14447rm -rf conftest*
14448
14449fi
14450
14451if test $ac_cv_header_stdc = yes; then
14452 # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
14453 if test "$cross_compiling" = yes; then
14454 :
14455else
14456 cat >"conftest.$ac_ext" <<_ACEOF
14457#line 14457 "configure"
14458#include "confdefs.h"
14459#include <ctype.h>
14460#if ((' ' & 0x0FF) == 0x020)
14461# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
14462# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
14463#else
14464# define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
14465 || ('j' <= (c) && (c) <= 'r') \
14466 || ('s' <= (c) && (c) <= 'z'))
14467# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
14468#endif
14469
14470#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
14471int
14472main (void)
14473{
14474 int i;
14475 for (i = 0; i < 256; i++)
14476 if (XOR (islower (i), ISLOWER (i))
14477 || toupper (i) != TOUPPER (i))
14478 $ac_main_return(2);
14479 $ac_main_return (0);
14480}
14481_ACEOF
14482rm -f "conftest$ac_exeext"
14483if { (eval echo "$as_me:14483: \"$ac_link\"") >&5
14484 (eval $ac_link) 2>&5
14485 ac_status=$?
14486 echo "$as_me:14486: \$? = $ac_status" >&5
14487 (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
14488 { (eval echo "$as_me:14488: \"$ac_try\"") >&5
14489 (eval $ac_try) 2>&5
14490 ac_status=$?
14491 echo "$as_me:14491: \$? = $ac_status" >&5
14492 (exit "$ac_status"); }; }; then
14493 :
14494else
14495 echo "$as_me: program exited with status $ac_status" >&5
14496echo "$as_me: failed program was:" >&5
14497cat "conftest.$ac_ext" >&5
14498ac_cv_header_stdc=no
14499fi
14500rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
14501fi
14502fi
14503fi
14504echo "$as_me:14504: result: $ac_cv_header_stdc" >&5
14505echo "${ECHO_T}$ac_cv_header_stdc" >&6
14506if test $ac_cv_header_stdc = yes; then
14507
14508cat >>confdefs.h <<\EOF
14509#define STDC_HEADERS 1
14510EOF
14511
14512fi
14513
14514# On IRIX 5.3, sys/types and inttypes.h are conflicting.
14515
14516for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
14517 inttypes.h stdint.h unistd.h
14518do
14519as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
14520echo "$as_me:14520: checking for $ac_header" >&5
14521echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
14522if eval "test \"\${$as_ac_Header+set}\" = set"; then
14523 echo $ECHO_N "(cached) $ECHO_C" >&6
14524else
14525 cat >"conftest.$ac_ext" <<_ACEOF
14526#line 14526 "configure"
14527#include "confdefs.h"
14528$ac_includes_default
14529#include <$ac_header>
14530_ACEOF
14531rm -f "conftest.$ac_objext"
14532if { (eval echo "$as_me:14532: \"$ac_compile\"") >&5
14533 (eval $ac_compile) 2>&5
14534 ac_status=$?
14535 echo "$as_me:14535: \$? = $ac_status" >&5
14536 (exit "$ac_status"); } &&
14537 { ac_try='test -s "conftest.$ac_objext"'
14538 { (eval echo "$as_me:14538: \"$ac_try\"") >&5
14539 (eval $ac_try) 2>&5
14540 ac_status=$?
14541 echo "$as_me:14541: \$? = $ac_status" >&5
14542 (exit "$ac_status"); }; }; then
14543 eval "$as_ac_Header=yes"
14544else
14545 echo "$as_me: failed program was:" >&5
14546cat "conftest.$ac_ext" >&5
14547eval "$as_ac_Header=no"
14548fi
14549rm -f "conftest.$ac_objext" "conftest.$ac_ext"
14550fi
14551echo "$as_me:14551: result: `eval echo '${'"$as_ac_Header"'}'`" >&5
14552echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6
14553if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then
14554 cat >>confdefs.h <<EOF
14555#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
14556EOF
14557
14558fi
14559done
14560
14561echo "$as_me:14561: checking whether exit is declared" >&5
14562echo $ECHO_N "checking whether exit is declared... $ECHO_C" >&6
14563if test "${ac_cv_have_decl_exit+set}" = set; then
14564 echo $ECHO_N "(cached) $ECHO_C" >&6
14565else
14566 cat >"conftest.$ac_ext" <<_ACEOF
14567#line 14567 "configure"
14568#include "confdefs.h"
14569$ac_includes_default
14570int
14571main (void)
14572{
14573#ifndef exit
14574 (void) exit;
14575#endif
14576
14577 ;
14578 return 0;
14579}
14580_ACEOF
14581rm -f "conftest.$ac_objext"
14582if { (eval echo "$as_me:14582: \"$ac_compile\"") >&5
14583 (eval $ac_compile) 2>&5
14584 ac_status=$?
14585 echo "$as_me:14585: \$? = $ac_status" >&5
14586 (exit "$ac_status"); } &&
14587 { ac_try='test -s "conftest.$ac_objext"'
14588 { (eval echo "$as_me:14588: \"$ac_try\"") >&5
14589 (eval $ac_try) 2>&5
14590 ac_status=$?
14591 echo "$as_me:14591: \$? = $ac_status" >&5
14592 (exit "$ac_status"); }; }; then
14593 ac_cv_have_decl_exit=yes
14594else
14595 echo "$as_me: failed program was:" >&5
14596cat "conftest.$ac_ext" >&5
14597ac_cv_have_decl_exit=no
14598fi
14599rm -f "conftest.$ac_objext" "conftest.$ac_ext"
14600fi
14601echo "$as_me:14601: result: $ac_cv_have_decl_exit" >&5
14602echo "${ECHO_T}$ac_cv_have_decl_exit" >&6
Steve Kondikae271bc2015-11-15 02:50:53 +010014603
14604# Check whether --enable-largefile or --disable-largefile was given.
14605if test "${enable_largefile+set}" = set; then
14606 enableval="$enable_largefile"
14607
14608fi;
14609if test "$enable_largefile" != no; then
14610
micky3879b9f5e72025-07-08 18:04:53 -040014611 echo "$as_me:14611: checking for special C compiler options needed for large files" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010014612echo $ECHO_N "checking for special C compiler options needed for large files... $ECHO_C" >&6
14613if test "${ac_cv_sys_largefile_CC+set}" = set; then
14614 echo $ECHO_N "(cached) $ECHO_C" >&6
14615else
14616 ac_cv_sys_largefile_CC=no
14617 if test "$GCC" != yes; then
14618 ac_save_CC=$CC
14619 while :; do
14620 # IRIX 6.2 and later do not support large files by default,
14621 # so use the C compiler's -n32 option if that helps.
micky3879b9f5e72025-07-08 18:04:53 -040014622 cat >"conftest.$ac_ext" <<_ACEOF
14623#line 14623 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +010014624#include "confdefs.h"
14625#include <sys/types.h>
14626 /* Check that off_t can represent 2**63 - 1 correctly.
14627 We can't simply define LARGE_OFF_T to be 9223372036854775807,
14628 since some C++ compilers masquerading as C compilers
14629 incorrectly reject 9223372036854775807. */
14630#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
14631 int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
14632 && LARGE_OFF_T % 2147483647 == 1)
14633 ? 1 : -1];
14634int
micky3879b9f5e72025-07-08 18:04:53 -040014635main (void)
Steve Kondikae271bc2015-11-15 02:50:53 +010014636{
14637
14638 ;
14639 return 0;
14640}
14641_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -040014642 rm -f "conftest.$ac_objext"
14643if { (eval echo "$as_me:14643: \"$ac_compile\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010014644 (eval $ac_compile) 2>&5
14645 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040014646 echo "$as_me:14646: \$? = $ac_status" >&5
14647 (exit "$ac_status"); } &&
14648 { ac_try='test -s "conftest.$ac_objext"'
14649 { (eval echo "$as_me:14649: \"$ac_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010014650 (eval $ac_try) 2>&5
14651 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040014652 echo "$as_me:14652: \$? = $ac_status" >&5
14653 (exit "$ac_status"); }; }; then
Steve Kondikae271bc2015-11-15 02:50:53 +010014654 break
14655else
14656 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -040014657cat "conftest.$ac_ext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010014658fi
micky3879b9f5e72025-07-08 18:04:53 -040014659rm -f "conftest.$ac_objext"
Steve Kondikae271bc2015-11-15 02:50:53 +010014660 CC="$CC -n32"
micky3879b9f5e72025-07-08 18:04:53 -040014661 rm -f "conftest.$ac_objext"
14662if { (eval echo "$as_me:14662: \"$ac_compile\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010014663 (eval $ac_compile) 2>&5
14664 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040014665 echo "$as_me:14665: \$? = $ac_status" >&5
14666 (exit "$ac_status"); } &&
14667 { ac_try='test -s "conftest.$ac_objext"'
14668 { (eval echo "$as_me:14668: \"$ac_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010014669 (eval $ac_try) 2>&5
14670 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040014671 echo "$as_me:14671: \$? = $ac_status" >&5
14672 (exit "$ac_status"); }; }; then
Steve Kondikae271bc2015-11-15 02:50:53 +010014673 ac_cv_sys_largefile_CC=' -n32'; break
14674else
14675 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -040014676cat "conftest.$ac_ext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010014677fi
micky3879b9f5e72025-07-08 18:04:53 -040014678rm -f "conftest.$ac_objext"
Steve Kondikae271bc2015-11-15 02:50:53 +010014679 break
14680 done
14681 CC=$ac_save_CC
micky3879b9f5e72025-07-08 18:04:53 -040014682 rm -f "conftest.$ac_ext"
Steve Kondikae271bc2015-11-15 02:50:53 +010014683 fi
14684fi
micky3879b9f5e72025-07-08 18:04:53 -040014685echo "$as_me:14685: result: $ac_cv_sys_largefile_CC" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010014686echo "${ECHO_T}$ac_cv_sys_largefile_CC" >&6
14687 if test "$ac_cv_sys_largefile_CC" != no; then
14688 CC=$CC$ac_cv_sys_largefile_CC
14689 fi
14690
micky3879b9f5e72025-07-08 18:04:53 -040014691 echo "$as_me:14691: checking for _FILE_OFFSET_BITS value needed for large files" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010014692echo $ECHO_N "checking for _FILE_OFFSET_BITS value needed for large files... $ECHO_C" >&6
14693if test "${ac_cv_sys_file_offset_bits+set}" = set; then
14694 echo $ECHO_N "(cached) $ECHO_C" >&6
14695else
14696 while :; do
14697 ac_cv_sys_file_offset_bits=no
micky3879b9f5e72025-07-08 18:04:53 -040014698 cat >"conftest.$ac_ext" <<_ACEOF
14699#line 14699 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +010014700#include "confdefs.h"
14701#include <sys/types.h>
14702 /* Check that off_t can represent 2**63 - 1 correctly.
14703 We can't simply define LARGE_OFF_T to be 9223372036854775807,
14704 since some C++ compilers masquerading as C compilers
14705 incorrectly reject 9223372036854775807. */
14706#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
14707 int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
14708 && LARGE_OFF_T % 2147483647 == 1)
14709 ? 1 : -1];
14710int
micky3879b9f5e72025-07-08 18:04:53 -040014711main (void)
Steve Kondikae271bc2015-11-15 02:50:53 +010014712{
14713
14714 ;
14715 return 0;
14716}
14717_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -040014718rm -f "conftest.$ac_objext"
14719if { (eval echo "$as_me:14719: \"$ac_compile\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010014720 (eval $ac_compile) 2>&5
14721 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040014722 echo "$as_me:14722: \$? = $ac_status" >&5
14723 (exit "$ac_status"); } &&
14724 { ac_try='test -s "conftest.$ac_objext"'
14725 { (eval echo "$as_me:14725: \"$ac_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010014726 (eval $ac_try) 2>&5
14727 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040014728 echo "$as_me:14728: \$? = $ac_status" >&5
14729 (exit "$ac_status"); }; }; then
Steve Kondikae271bc2015-11-15 02:50:53 +010014730 break
14731else
14732 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -040014733cat "conftest.$ac_ext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010014734fi
micky3879b9f5e72025-07-08 18:04:53 -040014735rm -f "conftest.$ac_objext" "conftest.$ac_ext"
14736 cat >"conftest.$ac_ext" <<_ACEOF
14737#line 14737 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +010014738#include "confdefs.h"
14739#define _FILE_OFFSET_BITS 64
14740#include <sys/types.h>
14741 /* Check that off_t can represent 2**63 - 1 correctly.
14742 We can't simply define LARGE_OFF_T to be 9223372036854775807,
14743 since some C++ compilers masquerading as C compilers
14744 incorrectly reject 9223372036854775807. */
14745#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
14746 int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
14747 && LARGE_OFF_T % 2147483647 == 1)
14748 ? 1 : -1];
14749int
micky3879b9f5e72025-07-08 18:04:53 -040014750main (void)
Steve Kondikae271bc2015-11-15 02:50:53 +010014751{
14752
14753 ;
14754 return 0;
14755}
14756_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -040014757rm -f "conftest.$ac_objext"
14758if { (eval echo "$as_me:14758: \"$ac_compile\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010014759 (eval $ac_compile) 2>&5
14760 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040014761 echo "$as_me:14761: \$? = $ac_status" >&5
14762 (exit "$ac_status"); } &&
14763 { ac_try='test -s "conftest.$ac_objext"'
14764 { (eval echo "$as_me:14764: \"$ac_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010014765 (eval $ac_try) 2>&5
14766 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040014767 echo "$as_me:14767: \$? = $ac_status" >&5
14768 (exit "$ac_status"); }; }; then
Steve Kondikae271bc2015-11-15 02:50:53 +010014769 ac_cv_sys_file_offset_bits=64; break
14770else
14771 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -040014772cat "conftest.$ac_ext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010014773fi
micky3879b9f5e72025-07-08 18:04:53 -040014774rm -f "conftest.$ac_objext" "conftest.$ac_ext"
Steve Kondikae271bc2015-11-15 02:50:53 +010014775 break
14776done
14777fi
micky3879b9f5e72025-07-08 18:04:53 -040014778echo "$as_me:14778: result: $ac_cv_sys_file_offset_bits" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010014779echo "${ECHO_T}$ac_cv_sys_file_offset_bits" >&6
14780if test "$ac_cv_sys_file_offset_bits" != no; then
14781
14782cat >>confdefs.h <<EOF
14783#define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits
14784EOF
14785
14786fi
14787rm -rf conftest*
micky3879b9f5e72025-07-08 18:04:53 -040014788 echo "$as_me:14788: checking for _LARGE_FILES value needed for large files" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010014789echo $ECHO_N "checking for _LARGE_FILES value needed for large files... $ECHO_C" >&6
14790if test "${ac_cv_sys_large_files+set}" = set; then
14791 echo $ECHO_N "(cached) $ECHO_C" >&6
14792else
14793 while :; do
14794 ac_cv_sys_large_files=no
micky3879b9f5e72025-07-08 18:04:53 -040014795 cat >"conftest.$ac_ext" <<_ACEOF
14796#line 14796 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +010014797#include "confdefs.h"
14798#include <sys/types.h>
14799 /* Check that off_t can represent 2**63 - 1 correctly.
14800 We can't simply define LARGE_OFF_T to be 9223372036854775807,
14801 since some C++ compilers masquerading as C compilers
14802 incorrectly reject 9223372036854775807. */
14803#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
14804 int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
14805 && LARGE_OFF_T % 2147483647 == 1)
14806 ? 1 : -1];
14807int
micky3879b9f5e72025-07-08 18:04:53 -040014808main (void)
Steve Kondikae271bc2015-11-15 02:50:53 +010014809{
14810
14811 ;
14812 return 0;
14813}
14814_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -040014815rm -f "conftest.$ac_objext"
14816if { (eval echo "$as_me:14816: \"$ac_compile\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010014817 (eval $ac_compile) 2>&5
14818 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040014819 echo "$as_me:14819: \$? = $ac_status" >&5
14820 (exit "$ac_status"); } &&
14821 { ac_try='test -s "conftest.$ac_objext"'
14822 { (eval echo "$as_me:14822: \"$ac_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010014823 (eval $ac_try) 2>&5
14824 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040014825 echo "$as_me:14825: \$? = $ac_status" >&5
14826 (exit "$ac_status"); }; }; then
Steve Kondikae271bc2015-11-15 02:50:53 +010014827 break
14828else
14829 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -040014830cat "conftest.$ac_ext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010014831fi
micky3879b9f5e72025-07-08 18:04:53 -040014832rm -f "conftest.$ac_objext" "conftest.$ac_ext"
14833 cat >"conftest.$ac_ext" <<_ACEOF
14834#line 14834 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +010014835#include "confdefs.h"
14836#define _LARGE_FILES 1
14837#include <sys/types.h>
14838 /* Check that off_t can represent 2**63 - 1 correctly.
14839 We can't simply define LARGE_OFF_T to be 9223372036854775807,
14840 since some C++ compilers masquerading as C compilers
14841 incorrectly reject 9223372036854775807. */
14842#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
14843 int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
14844 && LARGE_OFF_T % 2147483647 == 1)
14845 ? 1 : -1];
14846int
micky3879b9f5e72025-07-08 18:04:53 -040014847main (void)
Steve Kondikae271bc2015-11-15 02:50:53 +010014848{
14849
14850 ;
14851 return 0;
14852}
14853_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -040014854rm -f "conftest.$ac_objext"
14855if { (eval echo "$as_me:14855: \"$ac_compile\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010014856 (eval $ac_compile) 2>&5
14857 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040014858 echo "$as_me:14858: \$? = $ac_status" >&5
14859 (exit "$ac_status"); } &&
14860 { ac_try='test -s "conftest.$ac_objext"'
14861 { (eval echo "$as_me:14861: \"$ac_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010014862 (eval $ac_try) 2>&5
14863 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040014864 echo "$as_me:14864: \$? = $ac_status" >&5
14865 (exit "$ac_status"); }; }; then
Steve Kondikae271bc2015-11-15 02:50:53 +010014866 ac_cv_sys_large_files=1; break
14867else
14868 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -040014869cat "conftest.$ac_ext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010014870fi
micky3879b9f5e72025-07-08 18:04:53 -040014871rm -f "conftest.$ac_objext" "conftest.$ac_ext"
Steve Kondikae271bc2015-11-15 02:50:53 +010014872 break
14873done
14874fi
micky3879b9f5e72025-07-08 18:04:53 -040014875echo "$as_me:14875: result: $ac_cv_sys_large_files" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010014876echo "${ECHO_T}$ac_cv_sys_large_files" >&6
14877if test "$ac_cv_sys_large_files" != no; then
14878
14879cat >>confdefs.h <<EOF
14880#define _LARGE_FILES $ac_cv_sys_large_files
14881EOF
14882
14883fi
14884rm -rf conftest*
14885fi
14886
14887 if test "$enable_largefile" != no ; then
micky3879b9f5e72025-07-08 18:04:53 -040014888 echo "$as_me:14888: checking for _LARGEFILE_SOURCE value needed for large files" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010014889echo $ECHO_N "checking for _LARGEFILE_SOURCE value needed for large files... $ECHO_C" >&6
14890if test "${ac_cv_sys_largefile_source+set}" = set; then
14891 echo $ECHO_N "(cached) $ECHO_C" >&6
14892else
14893 while :; do
14894 ac_cv_sys_largefile_source=no
micky3879b9f5e72025-07-08 18:04:53 -040014895 cat >"conftest.$ac_ext" <<_ACEOF
14896#line 14896 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +010014897#include "confdefs.h"
14898#include <stdio.h>
micky3879b9f5e72025-07-08 18:04:53 -040014899 #include <sys/types.h>
Steve Kondikae271bc2015-11-15 02:50:53 +010014900int
micky3879b9f5e72025-07-08 18:04:53 -040014901main (void)
Steve Kondikae271bc2015-11-15 02:50:53 +010014902{
micky3879b9f5e72025-07-08 18:04:53 -040014903
14904 int (*my_fseeko)(FILE *, off_t, int) = fseeko;
14905 return my_fseeko(stdin, 0, 0);
Steve Kondikae271bc2015-11-15 02:50:53 +010014906 ;
14907 return 0;
14908}
14909_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -040014910rm -f "conftest.$ac_objext"
14911if { (eval echo "$as_me:14911: \"$ac_compile\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010014912 (eval $ac_compile) 2>&5
14913 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040014914 echo "$as_me:14914: \$? = $ac_status" >&5
14915 (exit "$ac_status"); } &&
14916 { ac_try='test -s "conftest.$ac_objext"'
14917 { (eval echo "$as_me:14917: \"$ac_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010014918 (eval $ac_try) 2>&5
14919 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040014920 echo "$as_me:14920: \$? = $ac_status" >&5
14921 (exit "$ac_status"); }; }; then
Steve Kondikae271bc2015-11-15 02:50:53 +010014922 break
14923else
14924 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -040014925cat "conftest.$ac_ext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010014926fi
micky3879b9f5e72025-07-08 18:04:53 -040014927rm -f "conftest.$ac_objext" "conftest.$ac_ext"
14928 cat >"conftest.$ac_ext" <<_ACEOF
14929#line 14929 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +010014930#include "confdefs.h"
14931#define _LARGEFILE_SOURCE 1
14932#include <stdio.h>
micky3879b9f5e72025-07-08 18:04:53 -040014933 #include <sys/types.h>
Steve Kondikae271bc2015-11-15 02:50:53 +010014934int
micky3879b9f5e72025-07-08 18:04:53 -040014935main (void)
Steve Kondikae271bc2015-11-15 02:50:53 +010014936{
micky3879b9f5e72025-07-08 18:04:53 -040014937
14938 int (*my_fseeko)(FILE *, off_t, int) = fseeko;
14939 return my_fseeko(stdin, 0, 0);
Steve Kondikae271bc2015-11-15 02:50:53 +010014940 ;
14941 return 0;
14942}
14943_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -040014944rm -f "conftest.$ac_objext"
14945if { (eval echo "$as_me:14945: \"$ac_compile\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010014946 (eval $ac_compile) 2>&5
14947 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040014948 echo "$as_me:14948: \$? = $ac_status" >&5
14949 (exit "$ac_status"); } &&
14950 { ac_try='test -s "conftest.$ac_objext"'
14951 { (eval echo "$as_me:14951: \"$ac_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010014952 (eval $ac_try) 2>&5
14953 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040014954 echo "$as_me:14954: \$? = $ac_status" >&5
14955 (exit "$ac_status"); }; }; then
Steve Kondikae271bc2015-11-15 02:50:53 +010014956 ac_cv_sys_largefile_source=1; break
14957else
14958 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -040014959cat "conftest.$ac_ext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010014960fi
micky3879b9f5e72025-07-08 18:04:53 -040014961rm -f "conftest.$ac_objext" "conftest.$ac_ext"
Steve Kondikae271bc2015-11-15 02:50:53 +010014962 break
14963done
14964fi
micky3879b9f5e72025-07-08 18:04:53 -040014965echo "$as_me:14965: result: $ac_cv_sys_largefile_source" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010014966echo "${ECHO_T}$ac_cv_sys_largefile_source" >&6
14967if test "$ac_cv_sys_largefile_source" != no; then
14968
14969cat >>confdefs.h <<EOF
14970#define _LARGEFILE_SOURCE $ac_cv_sys_largefile_source
14971EOF
14972
14973fi
14974rm -rf conftest*
14975
14976# We used to try defining _XOPEN_SOURCE=500 too, to work around a bug
14977# in glibc 2.1.3, but that breaks too many other things.
14978# If you want fseeko and ftello with glibc, upgrade to a fixed glibc.
micky3879b9f5e72025-07-08 18:04:53 -040014979echo "$as_me:14979: checking for fseeko" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010014980echo $ECHO_N "checking for fseeko... $ECHO_C" >&6
14981if test "${ac_cv_func_fseeko+set}" = set; then
14982 echo $ECHO_N "(cached) $ECHO_C" >&6
14983else
micky3879b9f5e72025-07-08 18:04:53 -040014984 cat >"conftest.$ac_ext" <<_ACEOF
14985#line 14985 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +010014986#include "confdefs.h"
14987#include <stdio.h>
micky3879b9f5e72025-07-08 18:04:53 -040014988 #include <sys/types.h>
Steve Kondikae271bc2015-11-15 02:50:53 +010014989int
micky3879b9f5e72025-07-08 18:04:53 -040014990main (void)
Steve Kondikae271bc2015-11-15 02:50:53 +010014991{
micky3879b9f5e72025-07-08 18:04:53 -040014992int (*my_fseeko)(FILE *, off_t, int) = fseeko;
14993 return my_fseeko && my_fseeko (stdin, 0, 0);
Steve Kondikae271bc2015-11-15 02:50:53 +010014994 ;
14995 return 0;
14996}
14997_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -040014998rm -f "conftest.$ac_objext" "conftest$ac_exeext"
14999if { (eval echo "$as_me:14999: \"$ac_link\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010015000 (eval $ac_link) 2>&5
15001 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040015002 echo "$as_me:15002: \$? = $ac_status" >&5
15003 (exit "$ac_status"); } &&
15004 { ac_try='test -s "conftest$ac_exeext"'
15005 { (eval echo "$as_me:15005: \"$ac_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010015006 (eval $ac_try) 2>&5
15007 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040015008 echo "$as_me:15008: \$? = $ac_status" >&5
15009 (exit "$ac_status"); }; }; then
Steve Kondikae271bc2015-11-15 02:50:53 +010015010 ac_cv_func_fseeko=yes
15011else
15012 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -040015013cat "conftest.$ac_ext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010015014ac_cv_func_fseeko=no
15015fi
micky3879b9f5e72025-07-08 18:04:53 -040015016rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
Steve Kondikae271bc2015-11-15 02:50:53 +010015017fi
micky3879b9f5e72025-07-08 18:04:53 -040015018echo "$as_me:15018: result: $ac_cv_func_fseeko" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010015019echo "${ECHO_T}$ac_cv_func_fseeko" >&6
15020if test $ac_cv_func_fseeko = yes; then
15021
15022cat >>confdefs.h <<\EOF
15023#define HAVE_FSEEKO 1
15024EOF
15025
15026fi
15027
15028 # Normally we would collect these definitions in the config.h,
15029 # but (like _XOPEN_SOURCE), some environments rely on having these
15030 # defined before any of the system headers are included. Another
15031 # case comes up with C++, e.g., on AIX the compiler compiles the
15032 # header files by themselves before looking at the body files it is
15033 # told to compile. For ncurses, those header files do not include
15034 # the config.h
micky3879b9f5e72025-07-08 18:04:53 -040015035 if test "$ac_cv_sys_large_files" != no
15036 then
Steve Kondikae271bc2015-11-15 02:50:53 +010015037
micky3879b9f5e72025-07-08 18:04:53 -040015038 test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
15039 CPPFLAGS="${CPPFLAGS}-D_LARGE_FILES"
15040
15041 fi
15042 if test "$ac_cv_sys_largefile_source" != no
15043 then
15044
15045 test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
15046 CPPFLAGS="${CPPFLAGS}-D_LARGEFILE_SOURCE"
15047
15048 fi
15049 if test "$ac_cv_sys_file_offset_bits" != no
15050 then
15051
15052 test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
15053 CPPFLAGS="${CPPFLAGS}-D_FILE_OFFSET_BITS=$ac_cv_sys_file_offset_bits"
15054
15055 fi
15056
15057 echo "$as_me:15057: checking whether to use struct dirent64" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010015058echo $ECHO_N "checking whether to use struct dirent64... $ECHO_C" >&6
15059if test "${cf_cv_struct_dirent64+set}" = set; then
15060 echo $ECHO_N "(cached) $ECHO_C" >&6
15061else
15062
micky3879b9f5e72025-07-08 18:04:53 -040015063 cat >"conftest.$ac_ext" <<_ACEOF
15064#line 15064 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +010015065#include "confdefs.h"
15066
micky3879b9f5e72025-07-08 18:04:53 -040015067#pragma GCC diagnostic error "-Wincompatible-pointer-types"
Steve Kondikae271bc2015-11-15 02:50:53 +010015068#include <sys/types.h>
15069#include <dirent.h>
15070
micky3879b9f5e72025-07-08 18:04:53 -040015071#ifndef __REDIRECT
15072/* if transitional largefile support is setup, this is true */
15073extern struct dirent64 * readdir(DIR *);
15074#endif
15075
Steve Kondikae271bc2015-11-15 02:50:53 +010015076int
micky3879b9f5e72025-07-08 18:04:53 -040015077main (void)
Steve Kondikae271bc2015-11-15 02:50:53 +010015078{
15079
micky3879b9f5e72025-07-08 18:04:53 -040015080 DIR *dp = opendir(".");
15081 struct dirent64 *x = readdir(dp);
15082 struct dirent *y = readdir(dp);
Steve Kondikae271bc2015-11-15 02:50:53 +010015083 int z = x - y;
micky3879b9f5e72025-07-08 18:04:53 -040015084 (void)z;
Steve Kondikae271bc2015-11-15 02:50:53 +010015085
15086 ;
15087 return 0;
15088}
15089_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -040015090rm -f "conftest.$ac_objext"
15091if { (eval echo "$as_me:15091: \"$ac_compile\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010015092 (eval $ac_compile) 2>&5
15093 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040015094 echo "$as_me:15094: \$? = $ac_status" >&5
15095 (exit "$ac_status"); } &&
15096 { ac_try='test -s "conftest.$ac_objext"'
15097 { (eval echo "$as_me:15097: \"$ac_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010015098 (eval $ac_try) 2>&5
15099 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040015100 echo "$as_me:15100: \$? = $ac_status" >&5
15101 (exit "$ac_status"); }; }; then
Steve Kondikae271bc2015-11-15 02:50:53 +010015102 cf_cv_struct_dirent64=yes
15103else
15104 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -040015105cat "conftest.$ac_ext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010015106cf_cv_struct_dirent64=no
15107fi
micky3879b9f5e72025-07-08 18:04:53 -040015108rm -f "conftest.$ac_objext" "conftest.$ac_ext"
Steve Kondikae271bc2015-11-15 02:50:53 +010015109
15110fi
micky3879b9f5e72025-07-08 18:04:53 -040015111echo "$as_me:15111: result: $cf_cv_struct_dirent64" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010015112echo "${ECHO_T}$cf_cv_struct_dirent64" >&6
15113 test "$cf_cv_struct_dirent64" = yes &&
15114cat >>confdefs.h <<\EOF
15115#define HAVE_STRUCT_DIRENT64 1
15116EOF
15117
15118 fi
15119
15120### Enable compiling-in rcs id's
micky3879b9f5e72025-07-08 18:04:53 -040015121echo "$as_me:15121: checking if RCS identifiers should be compiled-in" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010015122echo $ECHO_N "checking if RCS identifiers should be compiled-in... $ECHO_C" >&6
15123
15124# Check whether --with-rcs-ids or --without-rcs-ids was given.
15125if test "${with_rcs_ids+set}" = set; then
15126 withval="$with_rcs_ids"
15127 with_rcs_ids=$withval
15128else
15129 with_rcs_ids=no
15130fi;
micky3879b9f5e72025-07-08 18:04:53 -040015131echo "$as_me:15131: result: $with_rcs_ids" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010015132echo "${ECHO_T}$with_rcs_ids" >&6
15133test "$with_rcs_ids" = yes &&
15134cat >>confdefs.h <<\EOF
15135#define USE_RCS_IDS 1
15136EOF
15137
15138###############################################################################
15139
15140### Note that some functions (such as const) are normally disabled anyway.
micky3879b9f5e72025-07-08 18:04:53 -040015141echo "$as_me:15141: checking if you want to build with function extensions" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010015142echo $ECHO_N "checking if you want to build with function extensions... $ECHO_C" >&6
15143
15144# Check whether --enable-ext-funcs or --disable-ext-funcs was given.
15145if test "${enable_ext_funcs+set}" = set; then
15146 enableval="$enable_ext_funcs"
15147 with_ext_funcs=$enableval
15148else
15149 with_ext_funcs=yes
15150fi;
micky3879b9f5e72025-07-08 18:04:53 -040015151echo "$as_me:15151: result: $with_ext_funcs" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010015152echo "${ECHO_T}$with_ext_funcs" >&6
15153if test "$with_ext_funcs" = yes ; then
15154 NCURSES_EXT_FUNCS=1
15155
15156cat >>confdefs.h <<\EOF
15157#define HAVE_USE_DEFAULT_COLORS 1
15158EOF
15159
15160cat >>confdefs.h <<\EOF
15161#define NCURSES_EXT_FUNCS 1
15162EOF
15163
15164else
15165 NCURSES_EXT_FUNCS=0
15166fi
15167
15168### use option --enable-const to turn on use of const beyond that in XSI.
micky3879b9f5e72025-07-08 18:04:53 -040015169echo "$as_me:15169: checking for extended use of const keyword" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010015170echo $ECHO_N "checking for extended use of const keyword... $ECHO_C" >&6
15171
15172# Check whether --enable-const or --disable-const was given.
15173if test "${enable_const+set}" = set; then
15174 enableval="$enable_const"
15175 with_ext_const=$enableval
15176else
15177 with_ext_const=no
15178fi;
micky3879b9f5e72025-07-08 18:04:53 -040015179echo "$as_me:15179: result: $with_ext_const" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010015180echo "${ECHO_T}$with_ext_const" >&6
15181NCURSES_CONST='/*nothing*/'
15182if test "$with_ext_const" = yes ; then
15183 NCURSES_CONST=const
15184fi
15185
15186###############################################################################
15187# These options are relatively safe to experiment with.
15188
micky3879b9f5e72025-07-08 18:04:53 -040015189echo "$as_me:15189: checking if you want all development code" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010015190echo $ECHO_N "checking if you want all development code... $ECHO_C" >&6
15191
15192# Check whether --with-develop or --without-develop was given.
15193if test "${with_develop+set}" = set; then
15194 withval="$with_develop"
15195 with_develop=$withval
15196else
15197 with_develop=no
15198fi;
micky3879b9f5e72025-07-08 18:04:53 -040015199echo "$as_me:15199: result: $with_develop" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010015200echo "${ECHO_T}$with_develop" >&6
15201
15202###############################################################################
15203# These are just experimental, probably should not be in a package:
15204
15205# This is still experimental (20080329), but should ultimately be moved to
15206# the script-block --with-normal, etc.
15207
micky3879b9f5e72025-07-08 18:04:53 -040015208echo "$as_me:15208: checking if you want to link with the pthread library" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010015209echo $ECHO_N "checking if you want to link with the pthread library... $ECHO_C" >&6
15210
15211# Check whether --with-pthread or --without-pthread was given.
15212if test "${with_pthread+set}" = set; then
15213 withval="$with_pthread"
15214 with_pthread=$withval
15215else
15216 with_pthread=no
15217fi;
micky3879b9f5e72025-07-08 18:04:53 -040015218echo "$as_me:15218: result: $with_pthread" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010015219echo "${ECHO_T}$with_pthread" >&6
15220
15221if test "$with_pthread" != no ; then
micky3879b9f5e72025-07-08 18:04:53 -040015222 echo "$as_me:15222: checking for pthread.h" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010015223echo $ECHO_N "checking for pthread.h... $ECHO_C" >&6
15224if test "${ac_cv_header_pthread_h+set}" = set; then
15225 echo $ECHO_N "(cached) $ECHO_C" >&6
15226else
micky3879b9f5e72025-07-08 18:04:53 -040015227 cat >"conftest.$ac_ext" <<_ACEOF
15228#line 15228 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +010015229#include "confdefs.h"
15230#include <pthread.h>
15231_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -040015232if { (eval echo "$as_me:15232: \"$ac_cpp "conftest.$ac_ext"\"") >&5
15233 (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
Steve Kondikae271bc2015-11-15 02:50:53 +010015234 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040015235 $EGREP -v '^ *\+' conftest.er1 >conftest.err
Steve Kondikae271bc2015-11-15 02:50:53 +010015236 rm -f conftest.er1
15237 cat conftest.err >&5
micky3879b9f5e72025-07-08 18:04:53 -040015238 echo "$as_me:15238: \$? = $ac_status" >&5
15239 (exit "$ac_status"); } >/dev/null; then
Steve Kondikae271bc2015-11-15 02:50:53 +010015240 if test -s conftest.err; then
15241 ac_cpp_err=$ac_c_preproc_warn_flag
15242 else
15243 ac_cpp_err=
15244 fi
15245else
15246 ac_cpp_err=yes
15247fi
15248if test -z "$ac_cpp_err"; then
15249 ac_cv_header_pthread_h=yes
15250else
15251 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -040015252 cat "conftest.$ac_ext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010015253 ac_cv_header_pthread_h=no
15254fi
micky3879b9f5e72025-07-08 18:04:53 -040015255rm -f conftest.err "conftest.$ac_ext"
Steve Kondikae271bc2015-11-15 02:50:53 +010015256fi
micky3879b9f5e72025-07-08 18:04:53 -040015257echo "$as_me:15257: result: $ac_cv_header_pthread_h" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010015258echo "${ECHO_T}$ac_cv_header_pthread_h" >&6
micky3879b9f5e72025-07-08 18:04:53 -040015259if test "$ac_cv_header_pthread_h" = yes; then
Steve Kondikae271bc2015-11-15 02:50:53 +010015260
15261cat >>confdefs.h <<\EOF
15262#define HAVE_PTHREADS_H 1
15263EOF
15264
15265 for cf_lib_pthread in pthread c_r
15266 do
micky3879b9f5e72025-07-08 18:04:53 -040015267 echo "$as_me:15267: checking if we can link with the $cf_lib_pthread library" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010015268echo $ECHO_N "checking if we can link with the $cf_lib_pthread library... $ECHO_C" >&6
15269 cf_save_LIBS="$LIBS"
15270
micky3879b9f5e72025-07-08 18:04:53 -040015271cf_add_libs="$LIBS"
15272# reverse order
15273cf_add_0lib=
15274for cf_add_1lib in -l$cf_lib_pthread; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
15275# filter duplicates
15276for cf_add_1lib in $cf_add_0lib; do
15277 for cf_add_2lib in $cf_add_libs; do
15278 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
Steve Kondikae271bc2015-11-15 02:50:53 +010015279 cf_add_1lib=
15280 break
15281 fi
15282 done
micky3879b9f5e72025-07-08 18:04:53 -040015283 test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
Steve Kondikae271bc2015-11-15 02:50:53 +010015284done
15285LIBS="$cf_add_libs"
15286
micky3879b9f5e72025-07-08 18:04:53 -040015287 cat >"conftest.$ac_ext" <<_ACEOF
15288#line 15288 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +010015289#include "confdefs.h"
15290
15291#include <pthread.h>
15292
15293int
micky3879b9f5e72025-07-08 18:04:53 -040015294main (void)
Steve Kondikae271bc2015-11-15 02:50:53 +010015295{
15296
15297 int rc = pthread_create(0,0,0,0);
15298 int r2 = pthread_mutexattr_settype(0, 0);
15299
15300 ;
15301 return 0;
15302}
15303_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -040015304rm -f "conftest.$ac_objext" "conftest$ac_exeext"
15305if { (eval echo "$as_me:15305: \"$ac_link\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010015306 (eval $ac_link) 2>&5
15307 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040015308 echo "$as_me:15308: \$? = $ac_status" >&5
15309 (exit "$ac_status"); } &&
15310 { ac_try='test -s "conftest$ac_exeext"'
15311 { (eval echo "$as_me:15311: \"$ac_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010015312 (eval $ac_try) 2>&5
15313 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040015314 echo "$as_me:15314: \$? = $ac_status" >&5
15315 (exit "$ac_status"); }; }; then
Steve Kondikae271bc2015-11-15 02:50:53 +010015316 with_pthread=yes
15317else
15318 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -040015319cat "conftest.$ac_ext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010015320with_pthread=no
15321fi
micky3879b9f5e72025-07-08 18:04:53 -040015322rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
Steve Kondikae271bc2015-11-15 02:50:53 +010015323 LIBS="$cf_save_LIBS"
micky3879b9f5e72025-07-08 18:04:53 -040015324 echo "$as_me:15324: result: $with_pthread" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010015325echo "${ECHO_T}$with_pthread" >&6
15326 test "$with_pthread" = yes && break
15327 done
15328
15329 if test "$with_pthread" = yes ; then
15330
micky3879b9f5e72025-07-08 18:04:53 -040015331cf_add_libs="$LIBS"
15332# reverse order
15333cf_add_0lib=
15334for cf_add_1lib in -l$cf_lib_pthread; 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
15347cat >>confdefs.h <<\EOF
15348#define HAVE_LIBPTHREADS 1
15349EOF
15350
15351 else
micky3879b9f5e72025-07-08 18:04:53 -040015352 { { echo "$as_me:15352: error: Cannot link with pthread library" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010015353echo "$as_me: error: Cannot link with pthread library" >&2;}
15354 { (exit 1); exit 1; }; }
15355 fi
15356
15357fi
15358
15359fi
15360
micky3879b9f5e72025-07-08 18:04:53 -040015361echo "$as_me:15361: checking if you want to use weak-symbols for pthreads" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010015362echo $ECHO_N "checking if you want to use weak-symbols for pthreads... $ECHO_C" >&6
15363
15364# Check whether --enable-weak-symbols or --disable-weak-symbols was given.
15365if test "${enable_weak_symbols+set}" = set; then
15366 enableval="$enable_weak_symbols"
15367 use_weak_symbols=$withval
15368else
15369 use_weak_symbols=no
15370fi;
micky3879b9f5e72025-07-08 18:04:53 -040015371echo "$as_me:15371: result: $use_weak_symbols" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010015372echo "${ECHO_T}$use_weak_symbols" >&6
15373if test "$use_weak_symbols" = yes ; then
15374
micky3879b9f5e72025-07-08 18:04:53 -040015375echo "$as_me:15375: checking if $CC supports weak symbols" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010015376echo $ECHO_N "checking if $CC supports weak symbols... $ECHO_C" >&6
15377if test "${cf_cv_weak_symbols+set}" = set; then
15378 echo $ECHO_N "(cached) $ECHO_C" >&6
15379else
15380
micky3879b9f5e72025-07-08 18:04:53 -040015381cat >"conftest.$ac_ext" <<_ACEOF
15382#line 15382 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +010015383#include "confdefs.h"
15384
15385#include <stdio.h>
15386int
micky3879b9f5e72025-07-08 18:04:53 -040015387main (void)
Steve Kondikae271bc2015-11-15 02:50:53 +010015388{
15389
15390#if defined(__GNUC__)
15391# if defined __USE_ISOC99
15392# define _cat_pragma(exp) _Pragma(#exp)
15393# define _weak_pragma(exp) _cat_pragma(weak name)
15394# else
15395# define _weak_pragma(exp)
15396# endif
15397# define _declare(name) __extension__ extern __typeof__(name) name
15398# define weak_symbol(name) _weak_pragma(name) _declare(name) __attribute__((weak))
15399#endif
15400
15401weak_symbol(fopen);
15402
15403 ;
15404 return 0;
15405}
15406_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -040015407rm -f "conftest.$ac_objext"
15408if { (eval echo "$as_me:15408: \"$ac_compile\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010015409 (eval $ac_compile) 2>&5
15410 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040015411 echo "$as_me:15411: \$? = $ac_status" >&5
15412 (exit "$ac_status"); } &&
15413 { ac_try='test -s "conftest.$ac_objext"'
15414 { (eval echo "$as_me:15414: \"$ac_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010015415 (eval $ac_try) 2>&5
15416 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040015417 echo "$as_me:15417: \$? = $ac_status" >&5
15418 (exit "$ac_status"); }; }; then
Steve Kondikae271bc2015-11-15 02:50:53 +010015419 cf_cv_weak_symbols=yes
15420else
15421 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -040015422cat "conftest.$ac_ext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010015423cf_cv_weak_symbols=no
15424fi
micky3879b9f5e72025-07-08 18:04:53 -040015425rm -f "conftest.$ac_objext" "conftest.$ac_ext"
Steve Kondikae271bc2015-11-15 02:50:53 +010015426
15427fi
micky3879b9f5e72025-07-08 18:04:53 -040015428echo "$as_me:15428: result: $cf_cv_weak_symbols" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010015429echo "${ECHO_T}$cf_cv_weak_symbols" >&6
15430
15431else
15432 cf_cv_weak_symbols=no
15433fi
15434
15435if test $cf_cv_weak_symbols = yes ; then
15436
15437cat >>confdefs.h <<\EOF
15438#define USE_WEAK_SYMBOLS 1
15439EOF
15440
15441fi
15442
15443PTHREAD=
15444if test "$with_pthread" = "yes" ; then
15445
15446cat >>confdefs.h <<\EOF
15447#define USE_PTHREADS 1
15448EOF
15449
15450 enable_reentrant=yes
15451 if test $cf_cv_weak_symbols = yes ; then
15452 PTHREAD=-lpthread
15453 fi
15454fi
15455
15456# OpenSUSE is installing ncurses6, using reentrant option.
micky3879b9f5e72025-07-08 18:04:53 -040015457echo "$as_me:15457: checking for _nc_TABSIZE" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010015458echo $ECHO_N "checking for _nc_TABSIZE... $ECHO_C" >&6
15459if test "${ac_cv_func__nc_TABSIZE+set}" = set; then
15460 echo $ECHO_N "(cached) $ECHO_C" >&6
15461else
micky3879b9f5e72025-07-08 18:04:53 -040015462 cat >"conftest.$ac_ext" <<_ACEOF
15463#line 15463 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +010015464#include "confdefs.h"
micky3879b9f5e72025-07-08 18:04:53 -040015465#define _nc_TABSIZE autoconf_temporary
15466#include <limits.h> /* least-intrusive standard header which defines gcc2 __stub macros */
15467#undef _nc_TABSIZE
15468
Steve Kondikae271bc2015-11-15 02:50:53 +010015469#ifdef __cplusplus
15470extern "C"
15471#endif
micky3879b9f5e72025-07-08 18:04:53 -040015472
Steve Kondikae271bc2015-11-15 02:50:53 +010015473/* We use char because int might match the return type of a gcc2
15474 builtin and then its argument prototype would still apply. */
micky3879b9f5e72025-07-08 18:04:53 -040015475char _nc_TABSIZE (void);
Steve Kondikae271bc2015-11-15 02:50:53 +010015476
15477int
micky3879b9f5e72025-07-08 18:04:53 -040015478main (void)
Steve Kondikae271bc2015-11-15 02:50:53 +010015479{
micky3879b9f5e72025-07-08 18:04:53 -040015480
15481/* The GNU C library defines stubs for functions which it implements
Steve Kondikae271bc2015-11-15 02:50:53 +010015482 to always fail with ENOSYS. Some functions are actually named
15483 something starting with __ and the normal name is an alias. */
15484#if defined (__stub__nc_TABSIZE) || defined (__stub____nc_TABSIZE)
micky3879b9f5e72025-07-08 18:04:53 -040015485#error found stub for _nc_TABSIZE
Steve Kondikae271bc2015-11-15 02:50:53 +010015486#endif
15487
micky3879b9f5e72025-07-08 18:04:53 -040015488 return _nc_TABSIZE ();
Steve Kondikae271bc2015-11-15 02:50:53 +010015489 ;
15490 return 0;
15491}
15492_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -040015493rm -f "conftest.$ac_objext" "conftest$ac_exeext"
15494if { (eval echo "$as_me:15494: \"$ac_link\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010015495 (eval $ac_link) 2>&5
15496 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040015497 echo "$as_me:15497: \$? = $ac_status" >&5
15498 (exit "$ac_status"); } &&
15499 { ac_try='test -s "conftest$ac_exeext"'
15500 { (eval echo "$as_me:15500: \"$ac_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010015501 (eval $ac_try) 2>&5
15502 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040015503 echo "$as_me:15503: \$? = $ac_status" >&5
15504 (exit "$ac_status"); }; }; then
Steve Kondikae271bc2015-11-15 02:50:53 +010015505 ac_cv_func__nc_TABSIZE=yes
15506else
15507 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -040015508cat "conftest.$ac_ext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010015509ac_cv_func__nc_TABSIZE=no
15510fi
micky3879b9f5e72025-07-08 18:04:53 -040015511rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
Steve Kondikae271bc2015-11-15 02:50:53 +010015512fi
micky3879b9f5e72025-07-08 18:04:53 -040015513echo "$as_me:15513: result: $ac_cv_func__nc_TABSIZE" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010015514echo "${ECHO_T}$ac_cv_func__nc_TABSIZE" >&6
micky3879b9f5e72025-07-08 18:04:53 -040015515if test "$ac_cv_func__nc_TABSIZE" = yes; then
Steve Kondikae271bc2015-11-15 02:50:53 +010015516 assume_reentrant=yes
15517else
15518 assume_reentrant=no
15519fi
15520
15521# Reentrant code has to be opaque; there's little advantage to making ncurses
15522# opaque outside of that, so there is no --enable-opaque option. We can use
15523# this option without --with-pthreads, but this will be always set for
15524# pthreads.
micky3879b9f5e72025-07-08 18:04:53 -040015525echo "$as_me:15525: checking if you want experimental reentrant code" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010015526echo $ECHO_N "checking if you want experimental reentrant code... $ECHO_C" >&6
15527
15528# Check whether --enable-reentrant or --disable-reentrant was given.
15529if test "${enable_reentrant+set}" = set; then
15530 enableval="$enable_reentrant"
15531 with_reentrant=$enableval
15532else
15533 with_reentrant=$assume_reentrant
15534fi;
micky3879b9f5e72025-07-08 18:04:53 -040015535echo "$as_me:15535: result: $with_reentrant" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010015536echo "${ECHO_T}$with_reentrant" >&6
15537if test "$with_reentrant" = yes ; then
15538 cf_cv_enable_reentrant=1
15539 if test $cf_cv_weak_symbols = yes ; then
15540
15541# remove pthread library from $LIBS
15542LIBS=`echo "$LIBS" | sed -e 's/-lpthread[ ]//g' -e 's/-lpthread$//'`
15543
15544 elif test "$assume_reentrant" = no ; then
15545 LIB_SUFFIX="t${LIB_SUFFIX}"
15546 fi
15547
15548cat >>confdefs.h <<\EOF
15549#define USE_REENTRANT 1
15550EOF
15551
15552else
15553 cf_cv_enable_reentrant=0
15554fi
15555
15556### Allow using a different wrap-prefix
15557if test "$cf_cv_enable_reentrant" != 0 || test "$BROKEN_LINKER" = 1 ; then
micky3879b9f5e72025-07-08 18:04:53 -040015558 echo "$as_me:15558: checking for prefix used to wrap public variables" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010015559echo $ECHO_N "checking for prefix used to wrap public variables... $ECHO_C" >&6
15560
15561# Check whether --with-wrap-prefix or --without-wrap-prefix was given.
15562if test "${with_wrap_prefix+set}" = set; then
15563 withval="$with_wrap_prefix"
15564 NCURSES_WRAP_PREFIX=$withval
15565else
15566 NCURSES_WRAP_PREFIX=_nc_
15567fi;
micky3879b9f5e72025-07-08 18:04:53 -040015568 echo "$as_me:15568: result: $NCURSES_WRAP_PREFIX" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010015569echo "${ECHO_T}$NCURSES_WRAP_PREFIX" >&6
15570else
15571 NCURSES_WRAP_PREFIX=_nc_
15572fi
15573
15574cat >>confdefs.h <<EOF
15575#define NCURSES_WRAP_PREFIX "$NCURSES_WRAP_PREFIX"
15576EOF
15577
15578###############################################################################
15579
15580### use option --disable-echo to suppress full display compiling commands
15581
micky3879b9f5e72025-07-08 18:04:53 -040015582echo "$as_me:15582: checking if you want to see long compiling messages" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010015583echo $ECHO_N "checking if you want to see long compiling messages... $ECHO_C" >&6
15584
15585# Check whether --enable-echo or --disable-echo was given.
15586if test "${enable_echo+set}" = set; then
15587 enableval="$enable_echo"
15588 test "$enableval" != no && enableval=yes
15589 if test "$enableval" != "yes" ; then
15590
15591 ECHO_LT='--silent'
15592 ECHO_LD='@echo linking $@;'
15593 RULE_CC='@echo compiling $<'
15594 SHOW_CC='@echo compiling $@'
15595 ECHO_CC='@'
15596
15597 else
15598
15599 ECHO_LT=''
15600 ECHO_LD=''
15601 RULE_CC=''
15602 SHOW_CC=''
15603 ECHO_CC=''
15604
15605 fi
15606else
15607 enableval=yes
15608
15609 ECHO_LT=''
15610 ECHO_LD=''
15611 RULE_CC=''
15612 SHOW_CC=''
15613 ECHO_CC=''
15614
15615fi;
micky3879b9f5e72025-07-08 18:04:53 -040015616echo "$as_me:15616: result: $enableval" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010015617echo "${ECHO_T}$enableval" >&6
15618
micky3879b9f5e72025-07-08 18:04:53 -040015619echo "$as_me:15619: checking if you want to use C11 _Noreturn feature" >&5
15620echo $ECHO_N "checking if you want to use C11 _Noreturn feature... $ECHO_C" >&6
Steve Kondikae271bc2015-11-15 02:50:53 +010015621
micky3879b9f5e72025-07-08 18:04:53 -040015622# Check whether --enable-stdnoreturn or --disable-stdnoreturn was given.
15623if test "${enable_stdnoreturn+set}" = set; then
15624 enableval="$enable_stdnoreturn"
15625 test "$enableval" != yes && enableval=no
15626 if test "$enableval" != "no" ; then
15627 enable_stdnoreturn=yes
15628 else
15629 enable_stdnoreturn=no
15630 fi
15631else
15632 enableval=no
15633 enable_stdnoreturn=no
15634
Steve Kondikae271bc2015-11-15 02:50:53 +010015635fi;
micky3879b9f5e72025-07-08 18:04:53 -040015636echo "$as_me:15636: result: $enable_stdnoreturn" >&5
15637echo "${ECHO_T}$enable_stdnoreturn" >&6
Steve Kondikae271bc2015-11-15 02:50:53 +010015638
micky3879b9f5e72025-07-08 18:04:53 -040015639if test $enable_stdnoreturn = yes; then
15640echo "$as_me:15640: checking for C11 _Noreturn feature" >&5
15641echo $ECHO_N "checking for C11 _Noreturn feature... $ECHO_C" >&6
15642if test "${cf_cv_c11_noreturn+set}" = set; then
15643 echo $ECHO_N "(cached) $ECHO_C" >&6
15644else
15645 cat >"conftest.$ac_ext" <<_ACEOF
15646#line 15646 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +010015647#include "confdefs.h"
15648
micky3879b9f5e72025-07-08 18:04:53 -040015649$ac_includes_default
15650#include <stdnoreturn.h>
15651static _Noreturn void giveup(void) { exit(0); }
15652
Steve Kondikae271bc2015-11-15 02:50:53 +010015653int
micky3879b9f5e72025-07-08 18:04:53 -040015654main (void)
Steve Kondikae271bc2015-11-15 02:50:53 +010015655{
micky3879b9f5e72025-07-08 18:04:53 -040015656if (feof(stdin)) giveup()
Steve Kondikae271bc2015-11-15 02:50:53 +010015657 ;
15658 return 0;
15659}
15660_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -040015661rm -f "conftest.$ac_objext"
15662if { (eval echo "$as_me:15662: \"$ac_compile\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010015663 (eval $ac_compile) 2>&5
15664 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040015665 echo "$as_me:15665: \$? = $ac_status" >&5
15666 (exit "$ac_status"); } &&
15667 { ac_try='test -s "conftest.$ac_objext"'
15668 { (eval echo "$as_me:15668: \"$ac_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010015669 (eval $ac_try) 2>&5
15670 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040015671 echo "$as_me:15671: \$? = $ac_status" >&5
15672 (exit "$ac_status"); }; }; then
15673 cf_cv_c11_noreturn=yes
Steve Kondikae271bc2015-11-15 02:50:53 +010015674else
15675 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -040015676cat "conftest.$ac_ext" >&5
15677cf_cv_c11_noreturn=no
Steve Kondikae271bc2015-11-15 02:50:53 +010015678fi
micky3879b9f5e72025-07-08 18:04:53 -040015679rm -f "conftest.$ac_objext" "conftest.$ac_ext"
15680
15681fi
15682echo "$as_me:15682: result: $cf_cv_c11_noreturn" >&5
15683echo "${ECHO_T}$cf_cv_c11_noreturn" >&6
15684else
15685 cf_cv_c11_noreturn=no,
15686fi
15687
15688if test "$cf_cv_c11_noreturn" = yes; then
15689
15690cat >>confdefs.h <<\EOF
15691#define HAVE_STDNORETURN_H 1
15692EOF
15693
15694cat >>confdefs.h <<EOF
15695#define STDC_NORETURN _Noreturn
15696EOF
15697
15698 HAVE_STDNORETURN_H=1
15699else
15700 HAVE_STDNORETURN_H=0
15701fi
15702
15703if test "$GCC" = yes || test "$GXX" = yes
15704then
15705
15706if test "$GCC" = yes || test "$GXX" = yes
15707then
15708 case $CFLAGS in
15709 (*-Werror=*)
15710 cf_temp_flags=
15711 for cf_temp_scan in $CFLAGS
15712 do
15713 case "x$cf_temp_scan" in
15714 (x-Werror=format*)
15715
15716 test -n "$cf_temp_flags" && cf_temp_flags="$cf_temp_flags "
15717 cf_temp_flags="${cf_temp_flags}$cf_temp_scan"
15718
15719 ;;
15720 (x-Werror=*)
15721
15722 test -n "$EXTRA_CFLAGS" && EXTRA_CFLAGS="$EXTRA_CFLAGS "
15723 EXTRA_CFLAGS="${EXTRA_CFLAGS}$cf_temp_scan"
15724
15725 ;;
15726 (*)
15727
15728 test -n "$cf_temp_flags" && cf_temp_flags="$cf_temp_flags "
15729 cf_temp_flags="${cf_temp_flags}$cf_temp_scan"
15730
15731 ;;
15732 esac
15733 done
15734 if test "x$CFLAGS" != "x$cf_temp_flags"
15735 then
15736 test -n "$verbose" && echo " repairing CFLAGS: $CFLAGS" 1>&6
15737
15738echo "${as_me:-configure}:15738: testing repairing CFLAGS: $CFLAGS ..." 1>&5
15739
15740 CFLAGS="$cf_temp_flags"
15741 test -n "$verbose" && echo " ... fixed $CFLAGS" 1>&6
15742
15743echo "${as_me:-configure}:15743: testing ... fixed $CFLAGS ..." 1>&5
15744
15745 test -n "$verbose" && echo " ... extra $EXTRA_CFLAGS" 1>&6
15746
15747echo "${as_me:-configure}:15747: testing ... extra $EXTRA_CFLAGS ..." 1>&5
15748
15749 fi
Steve Kondikae271bc2015-11-15 02:50:53 +010015750 ;;
15751 esac
15752fi
15753
micky3879b9f5e72025-07-08 18:04:53 -040015754if test "$GCC" = yes || test "$GXX" = yes
15755then
15756 case $CPPFLAGS in
15757 (*-Werror=*)
15758 cf_temp_flags=
15759 for cf_temp_scan in $CPPFLAGS
15760 do
15761 case "x$cf_temp_scan" in
15762 (x-Werror=format*)
Steve Kondikae271bc2015-11-15 02:50:53 +010015763
micky3879b9f5e72025-07-08 18:04:53 -040015764 test -n "$cf_temp_flags" && cf_temp_flags="$cf_temp_flags "
15765 cf_temp_flags="${cf_temp_flags}$cf_temp_scan"
15766
15767 ;;
15768 (x-Werror=*)
15769
15770 test -n "$EXTRA_CFLAGS" && EXTRA_CFLAGS="$EXTRA_CFLAGS "
15771 EXTRA_CFLAGS="${EXTRA_CFLAGS}$cf_temp_scan"
15772
15773 ;;
15774 (*)
15775
15776 test -n "$cf_temp_flags" && cf_temp_flags="$cf_temp_flags "
15777 cf_temp_flags="${cf_temp_flags}$cf_temp_scan"
15778
15779 ;;
15780 esac
15781 done
15782 if test "x$CPPFLAGS" != "x$cf_temp_flags"
15783 then
15784 test -n "$verbose" && echo " repairing CPPFLAGS: $CPPFLAGS" 1>&6
15785
15786echo "${as_me:-configure}:15786: testing repairing CPPFLAGS: $CPPFLAGS ..." 1>&5
15787
15788 CPPFLAGS="$cf_temp_flags"
15789 test -n "$verbose" && echo " ... fixed $CPPFLAGS" 1>&6
15790
15791echo "${as_me:-configure}:15791: testing ... fixed $CPPFLAGS ..." 1>&5
15792
15793 test -n "$verbose" && echo " ... extra $EXTRA_CFLAGS" 1>&6
15794
15795echo "${as_me:-configure}:15795: testing ... extra $EXTRA_CFLAGS ..." 1>&5
15796
15797 fi
15798 ;;
15799 esac
15800fi
15801
15802if test "$GCC" = yes || test "$GXX" = yes
15803then
15804 case $LDFLAGS in
15805 (*-Werror=*)
15806 cf_temp_flags=
15807 for cf_temp_scan in $LDFLAGS
15808 do
15809 case "x$cf_temp_scan" in
15810 (x-Werror=format*)
15811
15812 test -n "$cf_temp_flags" && cf_temp_flags="$cf_temp_flags "
15813 cf_temp_flags="${cf_temp_flags}$cf_temp_scan"
15814
15815 ;;
15816 (x-Werror=*)
15817
15818 test -n "$EXTRA_CFLAGS" && EXTRA_CFLAGS="$EXTRA_CFLAGS "
15819 EXTRA_CFLAGS="${EXTRA_CFLAGS}$cf_temp_scan"
15820
15821 ;;
15822 (*)
15823
15824 test -n "$cf_temp_flags" && cf_temp_flags="$cf_temp_flags "
15825 cf_temp_flags="${cf_temp_flags}$cf_temp_scan"
15826
15827 ;;
15828 esac
15829 done
15830 if test "x$LDFLAGS" != "x$cf_temp_flags"
15831 then
15832 test -n "$verbose" && echo " repairing LDFLAGS: $LDFLAGS" 1>&6
15833
15834echo "${as_me:-configure}:15834: testing repairing LDFLAGS: $LDFLAGS ..." 1>&5
15835
15836 LDFLAGS="$cf_temp_flags"
15837 test -n "$verbose" && echo " ... fixed $LDFLAGS" 1>&6
15838
15839echo "${as_me:-configure}:15839: testing ... fixed $LDFLAGS ..." 1>&5
15840
15841 test -n "$verbose" && echo " ... extra $EXTRA_CFLAGS" 1>&6
15842
15843echo "${as_me:-configure}:15843: testing ... extra $EXTRA_CFLAGS ..." 1>&5
15844
15845 fi
15846 ;;
15847 esac
15848fi
15849
15850echo "$as_me:15850: checking if you want to turn on gcc warnings" >&5
15851echo $ECHO_N "checking if you want to turn on gcc warnings... $ECHO_C" >&6
15852
15853# Check whether --enable-warnings or --disable-warnings was given.
15854if test "${enable_warnings+set}" = set; then
15855 enableval="$enable_warnings"
15856 test "$enableval" != yes && enableval=no
15857 if test "$enableval" != "no" ; then
15858 enable_warnings=yes
15859 else
15860 enable_warnings=no
15861 fi
15862else
15863 enableval=no
15864 enable_warnings=no
15865
15866fi;
15867echo "$as_me:15867: result: $enable_warnings" >&5
15868echo "${ECHO_T}$enable_warnings" >&6
15869if test "$enable_warnings" = "yes"
15870then
15871
15872if test "x$have_x" = xyes; then
15873
15874cf_save_LIBS_CF_CONST_X_STRING="$LIBS"
15875cf_save_CFLAGS_CF_CONST_X_STRING="$CFLAGS"
15876cf_save_CPPFLAGS_CF_CONST_X_STRING="$CPPFLAGS"
15877LIBS="$LIBS ${X_PRE_LIBS} ${X_LIBS} ${X_EXTRA_LIBS}"
15878for cf_X_CFLAGS in $X_CFLAGS
15879do
15880 case "x$cf_X_CFLAGS" in
15881 x-[IUD]*)
15882 CPPFLAGS="$CPPFLAGS $cf_X_CFLAGS"
15883 ;;
15884 *)
15885 CFLAGS="$CFLAGS $cf_X_CFLAGS"
15886 ;;
15887 esac
15888done
15889
15890cat >"conftest.$ac_ext" <<_ACEOF
15891#line 15891 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +010015892#include "confdefs.h"
15893
micky3879b9f5e72025-07-08 18:04:53 -040015894#include <stdlib.h>
15895#include <X11/Intrinsic.h>
15896
Steve Kondikae271bc2015-11-15 02:50:53 +010015897int
micky3879b9f5e72025-07-08 18:04:53 -040015898main (void)
Steve Kondikae271bc2015-11-15 02:50:53 +010015899{
micky3879b9f5e72025-07-08 18:04:53 -040015900String foo = malloc(1); free((void*)foo)
Steve Kondikae271bc2015-11-15 02:50:53 +010015901 ;
15902 return 0;
15903}
15904_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -040015905rm -f "conftest.$ac_objext"
15906if { (eval echo "$as_me:15906: \"$ac_compile\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010015907 (eval $ac_compile) 2>&5
15908 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040015909 echo "$as_me:15909: \$? = $ac_status" >&5
15910 (exit "$ac_status"); } &&
15911 { ac_try='test -s "conftest.$ac_objext"'
15912 { (eval echo "$as_me:15912: \"$ac_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010015913 (eval $ac_try) 2>&5
15914 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040015915 echo "$as_me:15915: \$? = $ac_status" >&5
15916 (exit "$ac_status"); }; }; then
15917
15918echo "$as_me:15918: checking for X11/Xt const-feature" >&5
15919echo $ECHO_N "checking for X11/Xt const-feature... $ECHO_C" >&6
15920if test "${cf_cv_const_x_string+set}" = set; then
15921 echo $ECHO_N "(cached) $ECHO_C" >&6
15922else
15923
15924 cat >"conftest.$ac_ext" <<_ACEOF
15925#line 15925 "configure"
15926#include "confdefs.h"
15927
15928#undef _CONST_X_STRING
15929#define _CONST_X_STRING /* X11R7.8 (perhaps) */
15930#undef XTSTRINGDEFINES /* X11R5 and later */
15931#include <stdlib.h>
15932#include <X11/Intrinsic.h>
15933
15934int
15935main (void)
15936{
15937String foo = malloc(1); *foo = 0
15938 ;
15939 return 0;
15940}
15941_ACEOF
15942rm -f "conftest.$ac_objext"
15943if { (eval echo "$as_me:15943: \"$ac_compile\"") >&5
15944 (eval $ac_compile) 2>&5
15945 ac_status=$?
15946 echo "$as_me:15946: \$? = $ac_status" >&5
15947 (exit "$ac_status"); } &&
15948 { ac_try='test -s "conftest.$ac_objext"'
15949 { (eval echo "$as_me:15949: \"$ac_try\"") >&5
15950 (eval $ac_try) 2>&5
15951 ac_status=$?
15952 echo "$as_me:15952: \$? = $ac_status" >&5
15953 (exit "$ac_status"); }; }; then
15954
15955 cf_cv_const_x_string=no
Steve Kondikae271bc2015-11-15 02:50:53 +010015956
15957else
15958 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -040015959cat "conftest.$ac_ext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010015960
micky3879b9f5e72025-07-08 18:04:53 -040015961 cf_cv_const_x_string=yes
15962
15963fi
15964rm -f "conftest.$ac_objext" "conftest.$ac_ext"
15965
15966fi
15967echo "$as_me:15967: result: $cf_cv_const_x_string" >&5
15968echo "${ECHO_T}$cf_cv_const_x_string" >&6
15969
15970LIBS="$cf_save_LIBS_CF_CONST_X_STRING"
15971CFLAGS="$cf_save_CFLAGS_CF_CONST_X_STRING"
15972CPPFLAGS="$cf_save_CPPFLAGS_CF_CONST_X_STRING"
15973
15974case "$cf_cv_const_x_string" in
15975(no)
15976
15977 test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
15978 CPPFLAGS="${CPPFLAGS}-DXTSTRINGDEFINES"
15979
15980 ;;
15981(*)
15982
15983 test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
15984 CPPFLAGS="${CPPFLAGS}-D_CONST_X_STRING"
15985
15986 ;;
15987esac
15988
15989else
15990 echo "$as_me: failed program was:" >&5
15991cat "conftest.$ac_ext" >&5
15992fi
15993rm -f "conftest.$ac_objext" "conftest.$ac_ext"
15994 fi
15995cat > "conftest.$ac_ext" <<EOF
15996#line 15996 "${as_me:-configure}"
Steve Kondikae271bc2015-11-15 02:50:53 +010015997int main(int argc, char *argv[]) { return (argv[argc-1] == 0) ; }
15998EOF
Steve Kondikae271bc2015-11-15 02:50:53 +010015999if test "$INTEL_COMPILER" = yes
16000then
16001# The "-wdXXX" options suppress warnings:
16002# remark #1419: external declaration in primary source file
16003# remark #1683: explicit conversion of a 64-bit integral type to a smaller integral type (potential portability problem)
16004# remark #1684: conversion from pointer to same-sized integral type (potential portability problem)
16005# remark #193: zero used for undefined preprocessing identifier
16006# remark #593: variable "curs_sb_left_arrow" was set but never used
16007# remark #810: conversion from "int" to "Dimension={unsigned short}" may lose significant bits
16008# remark #869: parameter "tw" was never referenced
16009# remark #981: operands are evaluated in unspecified order
16010# warning #279: controlling expression is constant
16011
micky3879b9f5e72025-07-08 18:04:53 -040016012 { echo "$as_me:16012: checking for $CC warning options..." >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010016013echo "$as_me: checking for $CC warning options..." >&6;}
16014 cf_save_CFLAGS="$CFLAGS"
micky3879b9f5e72025-07-08 18:04:53 -040016015 EXTRA_CFLAGS="$EXTRA_CFLAGS -Wall"
Steve Kondikae271bc2015-11-15 02:50:53 +010016016 for cf_opt in \
16017 wd1419 \
16018 wd1683 \
16019 wd1684 \
16020 wd193 \
16021 wd593 \
16022 wd279 \
16023 wd810 \
16024 wd869 \
16025 wd981
16026 do
16027 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
micky3879b9f5e72025-07-08 18:04:53 -040016028 if { (eval echo "$as_me:16028: \"$ac_compile\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010016029 (eval $ac_compile) 2>&5
16030 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040016031 echo "$as_me:16031: \$? = $ac_status" >&5
16032 (exit "$ac_status"); }; then
16033 test -n "$verbose" && echo "$as_me:16033: result: ... -$cf_opt" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010016034echo "${ECHO_T}... -$cf_opt" >&6
16035 EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
16036 fi
16037 done
16038 CFLAGS="$cf_save_CFLAGS"
micky3879b9f5e72025-07-08 18:04:53 -040016039elif test "$GCC" = yes && test "$GCC_VERSION" != "unknown"
Steve Kondikae271bc2015-11-15 02:50:53 +010016040then
micky3879b9f5e72025-07-08 18:04:53 -040016041 { echo "$as_me:16041: checking for $CC warning options..." >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010016042echo "$as_me: checking for $CC warning options..." >&6;}
16043 cf_save_CFLAGS="$CFLAGS"
Steve Kondikae271bc2015-11-15 02:50:53 +010016044 cf_warn_CONST=""
16045 test "$with_ext_const" = yes && cf_warn_CONST="Wwrite-strings"
16046 cf_gcc_warnings="Wignored-qualifiers Wlogical-op Wvarargs"
16047 test "x$CLANG_COMPILER" = xyes && cf_gcc_warnings=
16048 for cf_opt in W Wall \
16049 Wbad-function-cast \
16050 Wcast-align \
16051 Wcast-qual \
16052 Wdeclaration-after-statement \
16053 Wextra \
16054 Winline \
16055 Wmissing-declarations \
16056 Wmissing-prototypes \
16057 Wnested-externs \
16058 Wpointer-arith \
16059 Wshadow \
16060 Wstrict-prototypes \
micky3879b9f5e72025-07-08 18:04:53 -040016061 Wundef Wno-inline $cf_gcc_warnings $cf_warn_CONST Wno-unknown-pragmas Wswitch-enum
Steve Kondikae271bc2015-11-15 02:50:53 +010016062 do
16063 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
micky3879b9f5e72025-07-08 18:04:53 -040016064 if { (eval echo "$as_me:16064: \"$ac_compile\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010016065 (eval $ac_compile) 2>&5
16066 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040016067 echo "$as_me:16067: \$? = $ac_status" >&5
16068 (exit "$ac_status"); }; then
16069 test -n "$verbose" && echo "$as_me:16069: result: ... -$cf_opt" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010016070echo "${ECHO_T}... -$cf_opt" >&6
micky3879b9f5e72025-07-08 18:04:53 -040016071 case "$cf_opt" in
Steve Kondikae271bc2015-11-15 02:50:53 +010016072 (Winline)
micky3879b9f5e72025-07-08 18:04:53 -040016073 case "$GCC_VERSION" in
Steve Kondikae271bc2015-11-15 02:50:53 +010016074 ([34].*)
16075 test -n "$verbose" && echo " feature is broken in gcc $GCC_VERSION" 1>&6
16076
micky3879b9f5e72025-07-08 18:04:53 -040016077echo "${as_me:-configure}:16077: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
Steve Kondikae271bc2015-11-15 02:50:53 +010016078
16079 continue;;
16080 esac
16081 ;;
16082 (Wpointer-arith)
micky3879b9f5e72025-07-08 18:04:53 -040016083 case "$GCC_VERSION" in
Steve Kondikae271bc2015-11-15 02:50:53 +010016084 ([12].*)
16085 test -n "$verbose" && echo " feature is broken in gcc $GCC_VERSION" 1>&6
16086
micky3879b9f5e72025-07-08 18:04:53 -040016087echo "${as_me:-configure}:16087: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
Steve Kondikae271bc2015-11-15 02:50:53 +010016088
16089 continue;;
16090 esac
16091 ;;
16092 esac
16093 EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
16094 fi
16095 done
16096 CFLAGS="$cf_save_CFLAGS"
16097fi
micky3879b9f5e72025-07-08 18:04:53 -040016098rm -rf ./conftest*
Steve Kondikae271bc2015-11-15 02:50:53 +010016099
16100fi
16101
micky3879b9f5e72025-07-08 18:04:53 -040016102if test "$GCC" = yes || test "$GXX" = yes
Steve Kondikae271bc2015-11-15 02:50:53 +010016103then
16104cat > conftest.i <<EOF
16105#ifndef GCC_PRINTF
16106#define GCC_PRINTF 0
16107#endif
16108#ifndef GCC_SCANF
16109#define GCC_SCANF 0
16110#endif
16111#ifndef GCC_NORETURN
16112#define GCC_NORETURN /* nothing */
16113#endif
16114#ifndef GCC_UNUSED
16115#define GCC_UNUSED /* nothing */
16116#endif
16117EOF
16118if test "$GCC" = yes
16119then
micky3879b9f5e72025-07-08 18:04:53 -040016120 { echo "$as_me:16120: checking for $CC __attribute__ directives..." >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010016121echo "$as_me: checking for $CC __attribute__ directives..." >&6;}
micky3879b9f5e72025-07-08 18:04:53 -040016122cat > "conftest.$ac_ext" <<EOF
16123#line 16123 "${as_me:-configure}"
16124#include <stdio.h>
Steve Kondikae271bc2015-11-15 02:50:53 +010016125#include "confdefs.h"
16126#include "conftest.h"
16127#include "conftest.i"
16128#if GCC_PRINTF
16129#define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
16130#else
16131#define GCC_PRINTFLIKE(fmt,var) /*nothing*/
16132#endif
16133#if GCC_SCANF
16134#define GCC_SCANFLIKE(fmt,var) __attribute__((format(scanf,fmt,var)))
16135#else
16136#define GCC_SCANFLIKE(fmt,var) /*nothing*/
16137#endif
16138extern void wow(char *,...) GCC_SCANFLIKE(1,2);
micky3879b9f5e72025-07-08 18:04:53 -040016139extern GCC_NORETURN void oops(char *,...) GCC_PRINTFLIKE(1,2);
16140extern GCC_NORETURN void foo(void);
16141int main(int argc GCC_UNUSED, char *argv[] GCC_UNUSED) { (void)argc; (void)argv; return 0; }
Steve Kondikae271bc2015-11-15 02:50:53 +010016142EOF
16143 cf_printf_attribute=no
16144 cf_scanf_attribute=no
16145 for cf_attribute in scanf printf unused noreturn
16146 do
16147
16148cf_ATTRIBUTE=`echo "$cf_attribute" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
16149
16150 cf_directive="__attribute__(($cf_attribute))"
16151 echo "checking for $CC $cf_directive" 1>&5
16152
micky3879b9f5e72025-07-08 18:04:53 -040016153 case "$cf_attribute" in
Steve Kondikae271bc2015-11-15 02:50:53 +010016154 (printf)
16155 cf_printf_attribute=yes
16156 cat >conftest.h <<EOF
16157#define GCC_$cf_ATTRIBUTE 1
16158EOF
16159 ;;
16160 (scanf)
16161 cf_scanf_attribute=yes
16162 cat >conftest.h <<EOF
16163#define GCC_$cf_ATTRIBUTE 1
16164EOF
16165 ;;
16166 (*)
16167 cat >conftest.h <<EOF
16168#define GCC_$cf_ATTRIBUTE $cf_directive
16169EOF
16170 ;;
16171 esac
16172
micky3879b9f5e72025-07-08 18:04:53 -040016173 if { (eval echo "$as_me:16173: \"$ac_compile\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010016174 (eval $ac_compile) 2>&5
16175 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040016176 echo "$as_me:16176: \$? = $ac_status" >&5
16177 (exit "$ac_status"); }; then
16178 test -n "$verbose" && echo "$as_me:16178: result: ... $cf_attribute" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010016179echo "${ECHO_T}... $cf_attribute" >&6
16180 cat conftest.h >>confdefs.h
micky3879b9f5e72025-07-08 18:04:53 -040016181 case "$cf_attribute" in
Steve Kondikae271bc2015-11-15 02:50:53 +010016182 (noreturn)
16183
16184cat >>confdefs.h <<EOF
16185#define GCC_NORETURN $cf_directive
16186EOF
16187
16188 ;;
16189 (printf)
16190 cf_value='/* nothing */'
16191 if test "$cf_printf_attribute" != no ; then
16192 cf_value='__attribute__((format(printf,fmt,var)))'
16193
16194cat >>confdefs.h <<\EOF
16195#define GCC_PRINTF 1
16196EOF
16197
16198 fi
16199
16200cat >>confdefs.h <<EOF
16201#define GCC_PRINTFLIKE(fmt,var) $cf_value
16202EOF
16203
16204 ;;
16205 (scanf)
16206 cf_value='/* nothing */'
16207 if test "$cf_scanf_attribute" != no ; then
16208 cf_value='__attribute__((format(scanf,fmt,var)))'
16209
16210cat >>confdefs.h <<\EOF
16211#define GCC_SCANF 1
16212EOF
16213
16214 fi
16215
16216cat >>confdefs.h <<EOF
16217#define GCC_SCANFLIKE(fmt,var) $cf_value
16218EOF
16219
16220 ;;
16221 (unused)
16222
16223cat >>confdefs.h <<EOF
16224#define GCC_UNUSED $cf_directive
16225EOF
16226
16227 ;;
16228 esac
16229 fi
16230 done
16231else
micky3879b9f5e72025-07-08 18:04:53 -040016232 ${FGREP-fgrep} define conftest.i >>confdefs.h
Steve Kondikae271bc2015-11-15 02:50:53 +010016233fi
micky3879b9f5e72025-07-08 18:04:53 -040016234rm -rf ./conftest*
16235fi
16236
16237fi
16238
16239if test "x$enable_warnings" = "xyes"; then
16240
16241 ADAFLAGS="$ADAFLAGS -gnatwa -gnatyg"
16242
Steve Kondikae271bc2015-11-15 02:50:53 +010016243fi
16244
16245### use option --enable-assertions to turn on generation of assertion code
micky3879b9f5e72025-07-08 18:04:53 -040016246echo "$as_me:16246: checking if you want to enable runtime assertions" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010016247echo $ECHO_N "checking if you want to enable runtime assertions... $ECHO_C" >&6
16248
16249# Check whether --enable-assertions or --disable-assertions was given.
16250if test "${enable_assertions+set}" = set; then
16251 enableval="$enable_assertions"
16252 with_assertions=$enableval
16253else
16254 with_assertions=no
16255fi;
micky3879b9f5e72025-07-08 18:04:53 -040016256echo "$as_me:16256: result: $with_assertions" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010016257echo "${ECHO_T}$with_assertions" >&6
16258if test -n "$GCC"
16259then
16260 if test "$with_assertions" = no
16261 then
16262 CPPFLAGS="$CPPFLAGS -DNDEBUG"
16263 else
16264
16265 ADAFLAGS="$ADAFLAGS -gnata"
16266
16267 fi
16268fi
16269
16270### use option --disable-leaks to suppress "permanent" leaks, for testing
16271
16272cat >>confdefs.h <<\EOF
16273#define HAVE_NC_ALLOC_H 1
16274EOF
16275
16276### use option --enable-expanded to generate certain macros as functions
16277
16278# Check whether --enable-expanded or --disable-expanded was given.
16279if test "${enable_expanded+set}" = set; then
16280 enableval="$enable_expanded"
16281 test "$enableval" = yes &&
16282cat >>confdefs.h <<\EOF
16283#define NCURSES_EXPANDED 1
16284EOF
16285
16286fi;
16287
16288### use option --disable-macros to suppress macros in favor of functions
16289
16290# Check whether --enable-macros or --disable-macros was given.
16291if test "${enable_macros+set}" = set; then
16292 enableval="$enable_macros"
16293 test "$enableval" = no &&
16294cat >>confdefs.h <<\EOF
16295#define NCURSES_NOMACROS 1
16296EOF
16297
16298fi;
16299
16300# Normally we only add trace() to the debug-library. Allow this to be
16301# extended to all models of the ncurses library:
16302cf_all_traces=no
16303case "$CFLAGS $CPPFLAGS" in
16304(*-DTRACE*)
16305 cf_all_traces=yes
16306 ;;
16307esac
16308
micky3879b9f5e72025-07-08 18:04:53 -040016309echo "$as_me:16309: checking whether to add trace feature to all models" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010016310echo $ECHO_N "checking whether to add trace feature to all models... $ECHO_C" >&6
16311
16312# Check whether --with-trace or --without-trace was given.
16313if test "${with_trace+set}" = set; then
16314 withval="$with_trace"
16315 cf_with_trace=$withval
16316else
16317 cf_with_trace=$cf_all_traces
16318fi;
micky3879b9f5e72025-07-08 18:04:53 -040016319echo "$as_me:16319: result: $cf_with_trace" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010016320echo "${ECHO_T}$cf_with_trace" >&6
16321
16322if test "$cf_with_trace" = yes ; then
16323 ADA_TRACE=TRUE
16324
16325cf_fix_cppflags=no
16326cf_new_cflags=
16327cf_new_cppflags=
16328cf_new_extra_cppflags=
16329
16330for cf_add_cflags in -DTRACE
16331do
micky3879b9f5e72025-07-08 18:04:53 -040016332case "$cf_fix_cppflags" in
Steve Kondikae271bc2015-11-15 02:50:53 +010016333(no)
micky3879b9f5e72025-07-08 18:04:53 -040016334 case "$cf_add_cflags" in
Steve Kondikae271bc2015-11-15 02:50:53 +010016335 (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
micky3879b9f5e72025-07-08 18:04:53 -040016336 case "$cf_add_cflags" in
Steve Kondikae271bc2015-11-15 02:50:53 +010016337 (-D*)
micky3879b9f5e72025-07-08 18:04:53 -040016338 cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
Steve Kondikae271bc2015-11-15 02:50:53 +010016339
16340 test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
16341 && test -z "${cf_tst_cflags}" \
16342 && cf_fix_cppflags=yes
16343
micky3879b9f5e72025-07-08 18:04:53 -040016344 if test "$cf_fix_cppflags" = yes ; then
16345
16346 test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
16347 cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
16348
Steve Kondikae271bc2015-11-15 02:50:53 +010016349 continue
16350 elif test "${cf_tst_cflags}" = "\"'" ; then
micky3879b9f5e72025-07-08 18:04:53 -040016351
16352 test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
16353 cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
16354
Steve Kondikae271bc2015-11-15 02:50:53 +010016355 continue
16356 fi
16357 ;;
16358 esac
16359 case "$CPPFLAGS" in
16360 (*$cf_add_cflags)
16361 ;;
16362 (*)
micky3879b9f5e72025-07-08 18:04:53 -040016363 case "$cf_add_cflags" in
Steve Kondikae271bc2015-11-15 02:50:53 +010016364 (-D*)
16365 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
16366
16367CPPFLAGS=`echo "$CPPFLAGS" | \
16368 sed -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?[ ]/ /g' \
16369 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?$//g'`
16370
16371 ;;
16372 esac
micky3879b9f5e72025-07-08 18:04:53 -040016373
16374 test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
16375 cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
16376
Steve Kondikae271bc2015-11-15 02:50:53 +010016377 ;;
16378 esac
16379 ;;
16380 (*)
micky3879b9f5e72025-07-08 18:04:53 -040016381
16382 test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
16383 cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
16384
Steve Kondikae271bc2015-11-15 02:50:53 +010016385 ;;
16386 esac
16387 ;;
16388(yes)
Steve Kondikae271bc2015-11-15 02:50:53 +010016389
micky3879b9f5e72025-07-08 18:04:53 -040016390 test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
16391 cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
16392
16393 cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
Steve Kondikae271bc2015-11-15 02:50:53 +010016394
16395 test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
16396 && test -z "${cf_tst_cflags}" \
16397 && cf_fix_cppflags=no
16398 ;;
16399esac
16400done
16401
16402if test -n "$cf_new_cflags" ; then
16403
micky3879b9f5e72025-07-08 18:04:53 -040016404 test -n "$CFLAGS" && CFLAGS="$CFLAGS "
16405 CFLAGS="${CFLAGS}$cf_new_cflags"
16406
Steve Kondikae271bc2015-11-15 02:50:53 +010016407fi
16408
16409if test -n "$cf_new_cppflags" ; then
16410
micky3879b9f5e72025-07-08 18:04:53 -040016411 test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
16412 CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
16413
Steve Kondikae271bc2015-11-15 02:50:53 +010016414fi
16415
16416if test -n "$cf_new_extra_cppflags" ; then
16417
micky3879b9f5e72025-07-08 18:04:53 -040016418 test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
16419 EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
16420
Steve Kondikae271bc2015-11-15 02:50:53 +010016421fi
16422
16423else
16424 ADA_TRACE=FALSE
16425fi
16426
micky3879b9f5e72025-07-08 18:04:53 -040016427echo "$as_me:16427: checking if we want to use GNAT projects" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010016428echo $ECHO_N "checking if we want to use GNAT projects... $ECHO_C" >&6
16429
16430# Check whether --enable-gnat-projects or --disable-gnat-projects was given.
16431if test "${enable_gnat_projects+set}" = set; then
16432 enableval="$enable_gnat_projects"
16433 test "$enableval" != no && enableval=yes
16434 if test "$enableval" != "yes" ; then
16435 enable_gnat_projects=no
16436 else
16437 enable_gnat_projects=yes
16438 fi
16439else
16440 enableval=yes
16441 enable_gnat_projects=yes
16442
16443fi;
micky3879b9f5e72025-07-08 18:04:53 -040016444echo "$as_me:16444: result: $enable_gnat_projects" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010016445echo "${ECHO_T}$enable_gnat_projects" >&6
16446
16447### Checks for libraries.
16448case $cf_cv_system_name in
16449(*mingw32*)
micky3879b9f5e72025-07-08 18:04:53 -040016450
16451echo "$as_me:16451: checking if ssp library is needed" >&5
16452echo $ECHO_N "checking if ssp library is needed... $ECHO_C" >&6
16453if test "${cf_cv_need_libssp+set}" = set; then
Steve Kondikae271bc2015-11-15 02:50:53 +010016454 echo $ECHO_N "(cached) $ECHO_C" >&6
16455else
micky3879b9f5e72025-07-08 18:04:53 -040016456
16457cat >"conftest.$ac_ext" <<_ACEOF
16458#line 16458 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +010016459#include "confdefs.h"
micky3879b9f5e72025-07-08 18:04:53 -040016460
16461#include <sys/types.h>
16462#include <dirent.h>
Steve Kondikae271bc2015-11-15 02:50:53 +010016463
16464int
micky3879b9f5e72025-07-08 18:04:53 -040016465main (void)
Steve Kondikae271bc2015-11-15 02:50:53 +010016466{
micky3879b9f5e72025-07-08 18:04:53 -040016467
16468 DIR *dp = opendir(".");
Steve Kondikae271bc2015-11-15 02:50:53 +010016469
16470 ;
16471 return 0;
16472}
16473_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -040016474rm -f "conftest.$ac_objext" "conftest$ac_exeext"
16475if { (eval echo "$as_me:16475: \"$ac_link\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010016476 (eval $ac_link) 2>&5
16477 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040016478 echo "$as_me:16478: \$? = $ac_status" >&5
16479 (exit "$ac_status"); } &&
16480 { ac_try='test -s "conftest$ac_exeext"'
16481 { (eval echo "$as_me:16481: \"$ac_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010016482 (eval $ac_try) 2>&5
16483 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040016484 echo "$as_me:16484: \$? = $ac_status" >&5
16485 (exit "$ac_status"); }; }; then
16486 cf_cv_need_libssp=no
16487else
16488 echo "$as_me: failed program was:" >&5
16489cat "conftest.$ac_ext" >&5
16490
16491 cf_save_LIBS="$LIBS"
16492 LIBS="$LIBS -lssp"
16493 cat >"conftest.$ac_ext" <<_ACEOF
16494#line 16494 "configure"
16495#include "confdefs.h"
16496
16497#include <sys/types.h>
16498#include <dirent.h>
16499
16500int
16501main (void)
16502{
16503
16504 DIR *dp = opendir(".");
16505
16506 ;
16507 return 0;
16508}
16509_ACEOF
16510rm -f "conftest.$ac_objext" "conftest$ac_exeext"
16511if { (eval echo "$as_me:16511: \"$ac_link\"") >&5
16512 (eval $ac_link) 2>&5
16513 ac_status=$?
16514 echo "$as_me:16514: \$? = $ac_status" >&5
16515 (exit "$ac_status"); } &&
16516 { ac_try='test -s "conftest$ac_exeext"'
16517 { (eval echo "$as_me:16517: \"$ac_try\"") >&5
16518 (eval $ac_try) 2>&5
16519 ac_status=$?
16520 echo "$as_me:16520: \$? = $ac_status" >&5
16521 (exit "$ac_status"); }; }; then
16522 cf_cv_need_libssp=yes
16523else
16524 echo "$as_me: failed program was:" >&5
16525cat "conftest.$ac_ext" >&5
16526cf_cv_need_libssp=maybe
16527fi
16528rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
16529 LIBS="$cf_save_LIBS"
16530
16531fi
16532rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
16533fi
16534echo "$as_me:16534: result: $cf_cv_need_libssp" >&5
16535echo "${ECHO_T}$cf_cv_need_libssp" >&6
16536
16537if test "x$cf_cv_need_libssp" = xyes
16538then
16539
16540cf_add_libs="$LIBS"
16541# reverse order
16542cf_add_0lib=
16543for cf_add_1lib in -lssp; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
16544# filter duplicates
16545for cf_add_1lib in $cf_add_0lib; do
16546 for cf_add_2lib in $cf_add_libs; do
16547 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
16548 cf_add_1lib=
16549 break
16550 fi
16551 done
16552 test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
16553done
16554LIBS="$cf_add_libs"
16555
16556fi
16557
16558 ;;
16559(*)
16560
16561echo "$as_me:16561: checking for clock_gettime" >&5
16562echo $ECHO_N "checking for clock_gettime... $ECHO_C" >&6
16563if test "${cf_cv_func_clock_gettime+set}" = set; then
16564 echo $ECHO_N "(cached) $ECHO_C" >&6
16565else
16566
16567 cat >"conftest.$ac_ext" <<_ACEOF
16568#line 16568 "configure"
16569#include "confdefs.h"
16570#include <time.h>
16571int
16572main (void)
16573{
16574struct timespec ts;
16575 int rc = clock_gettime(CLOCK_REALTIME, &ts); (void) rc; (void)ts
16576 ;
16577 return 0;
16578}
16579_ACEOF
16580rm -f "conftest.$ac_objext" "conftest$ac_exeext"
16581if { (eval echo "$as_me:16581: \"$ac_link\"") >&5
16582 (eval $ac_link) 2>&5
16583 ac_status=$?
16584 echo "$as_me:16584: \$? = $ac_status" >&5
16585 (exit "$ac_status"); } &&
16586 { ac_try='test -s "conftest$ac_exeext"'
16587 { (eval echo "$as_me:16587: \"$ac_try\"") >&5
16588 (eval $ac_try) 2>&5
16589 ac_status=$?
16590 echo "$as_me:16590: \$? = $ac_status" >&5
16591 (exit "$ac_status"); }; }; then
16592 cf_cv_func_clock_gettime=yes
16593else
16594 echo "$as_me: failed program was:" >&5
16595cat "conftest.$ac_ext" >&5
16596cf_cv_func_clock_gettime=no
16597fi
16598rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
16599
16600fi
16601echo "$as_me:16601: result: $cf_cv_func_clock_gettime" >&5
16602echo "${ECHO_T}$cf_cv_func_clock_gettime" >&6
16603
16604if test "$cf_cv_func_clock_gettime" = yes
16605then
16606
16607cat >>confdefs.h <<\EOF
16608#define HAVE_CLOCK_GETTIME 1
16609EOF
16610
16611else
16612echo "$as_me:16612: checking for gettimeofday" >&5
16613echo $ECHO_N "checking for gettimeofday... $ECHO_C" >&6
16614if test "${ac_cv_func_gettimeofday+set}" = set; then
16615 echo $ECHO_N "(cached) $ECHO_C" >&6
16616else
16617 cat >"conftest.$ac_ext" <<_ACEOF
16618#line 16618 "configure"
16619#include "confdefs.h"
16620#define gettimeofday autoconf_temporary
16621#include <limits.h> /* least-intrusive standard header which defines gcc2 __stub macros */
16622#undef gettimeofday
16623
16624#ifdef __cplusplus
16625extern "C"
16626#endif
16627
16628/* We use char because int might match the return type of a gcc2
16629 builtin and then its argument prototype would still apply. */
16630char gettimeofday (void);
16631
16632int
16633main (void)
16634{
16635
16636/* The GNU C library defines stubs for functions which it implements
16637 to always fail with ENOSYS. Some functions are actually named
16638 something starting with __ and the normal name is an alias. */
16639#if defined (__stub_gettimeofday) || defined (__stub___gettimeofday)
16640#error found stub for gettimeofday
16641#endif
16642
16643 return gettimeofday ();
16644 ;
16645 return 0;
16646}
16647_ACEOF
16648rm -f "conftest.$ac_objext" "conftest$ac_exeext"
16649if { (eval echo "$as_me:16649: \"$ac_link\"") >&5
16650 (eval $ac_link) 2>&5
16651 ac_status=$?
16652 echo "$as_me:16652: \$? = $ac_status" >&5
16653 (exit "$ac_status"); } &&
16654 { ac_try='test -s "conftest$ac_exeext"'
16655 { (eval echo "$as_me:16655: \"$ac_try\"") >&5
16656 (eval $ac_try) 2>&5
16657 ac_status=$?
16658 echo "$as_me:16658: \$? = $ac_status" >&5
16659 (exit "$ac_status"); }; }; then
Steve Kondikae271bc2015-11-15 02:50:53 +010016660 ac_cv_func_gettimeofday=yes
16661else
16662 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -040016663cat "conftest.$ac_ext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010016664ac_cv_func_gettimeofday=no
16665fi
micky3879b9f5e72025-07-08 18:04:53 -040016666rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
Steve Kondikae271bc2015-11-15 02:50:53 +010016667fi
micky3879b9f5e72025-07-08 18:04:53 -040016668echo "$as_me:16668: result: $ac_cv_func_gettimeofday" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010016669echo "${ECHO_T}$ac_cv_func_gettimeofday" >&6
micky3879b9f5e72025-07-08 18:04:53 -040016670if test "$ac_cv_func_gettimeofday" = yes; then
16671
16672cat >>confdefs.h <<\EOF
Steve Kondikae271bc2015-11-15 02:50:53 +010016673#define HAVE_GETTIMEOFDAY 1
16674EOF
16675
16676else
16677
micky3879b9f5e72025-07-08 18:04:53 -040016678echo "$as_me:16678: checking for gettimeofday in -lbsd" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010016679echo $ECHO_N "checking for gettimeofday in -lbsd... $ECHO_C" >&6
16680if test "${ac_cv_lib_bsd_gettimeofday+set}" = set; then
16681 echo $ECHO_N "(cached) $ECHO_C" >&6
16682else
16683 ac_check_lib_save_LIBS=$LIBS
16684LIBS="-lbsd $LIBS"
micky3879b9f5e72025-07-08 18:04:53 -040016685cat >"conftest.$ac_ext" <<_ACEOF
16686#line 16686 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +010016687#include "confdefs.h"
16688
16689/* Override any gcc2 internal prototype to avoid an error. */
16690#ifdef __cplusplus
16691extern "C"
16692#endif
16693/* We use char because int might match the return type of a gcc2
16694 builtin and then its argument prototype would still apply. */
micky3879b9f5e72025-07-08 18:04:53 -040016695char gettimeofday (void);
Steve Kondikae271bc2015-11-15 02:50:53 +010016696int
micky3879b9f5e72025-07-08 18:04:53 -040016697main (void)
Steve Kondikae271bc2015-11-15 02:50:53 +010016698{
16699gettimeofday ();
16700 ;
16701 return 0;
16702}
16703_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -040016704rm -f "conftest.$ac_objext" "conftest$ac_exeext"
16705if { (eval echo "$as_me:16705: \"$ac_link\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010016706 (eval $ac_link) 2>&5
16707 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040016708 echo "$as_me:16708: \$? = $ac_status" >&5
16709 (exit "$ac_status"); } &&
16710 { ac_try='test -s "conftest$ac_exeext"'
16711 { (eval echo "$as_me:16711: \"$ac_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010016712 (eval $ac_try) 2>&5
16713 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040016714 echo "$as_me:16714: \$? = $ac_status" >&5
16715 (exit "$ac_status"); }; }; then
Steve Kondikae271bc2015-11-15 02:50:53 +010016716 ac_cv_lib_bsd_gettimeofday=yes
16717else
16718 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -040016719cat "conftest.$ac_ext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010016720ac_cv_lib_bsd_gettimeofday=no
16721fi
micky3879b9f5e72025-07-08 18:04:53 -040016722rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
Steve Kondikae271bc2015-11-15 02:50:53 +010016723LIBS=$ac_check_lib_save_LIBS
16724fi
micky3879b9f5e72025-07-08 18:04:53 -040016725echo "$as_me:16725: result: $ac_cv_lib_bsd_gettimeofday" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010016726echo "${ECHO_T}$ac_cv_lib_bsd_gettimeofday" >&6
micky3879b9f5e72025-07-08 18:04:53 -040016727if test "$ac_cv_lib_bsd_gettimeofday" = yes; then
Steve Kondikae271bc2015-11-15 02:50:53 +010016728
16729cat >>confdefs.h <<\EOF
16730#define HAVE_GETTIMEOFDAY 1
16731EOF
16732
micky3879b9f5e72025-07-08 18:04:53 -040016733cf_add_libs="$LIBS"
16734# reverse order
16735cf_add_0lib=
16736for cf_add_1lib in -lbsd; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
16737# filter duplicates
16738for cf_add_1lib in $cf_add_0lib; do
16739 for cf_add_2lib in $cf_add_libs; do
16740 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
16741 cf_add_1lib=
16742 break
16743 fi
16744 done
16745 test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
16746done
16747LIBS="$cf_add_libs"
16748
Steve Kondikae271bc2015-11-15 02:50:53 +010016749fi
16750
16751fi
micky3879b9f5e72025-07-08 18:04:53 -040016752fi
16753
Steve Kondikae271bc2015-11-15 02:50:53 +010016754 ;;
16755esac
16756
16757### Checks for header files.
micky3879b9f5e72025-07-08 18:04:53 -040016758echo "$as_me:16758: checking for signed char" >&5
16759echo $ECHO_N "checking for signed char... $ECHO_C" >&6
16760if test "${ac_cv_type_signed_char+set}" = set; then
Steve Kondikae271bc2015-11-15 02:50:53 +010016761 echo $ECHO_N "(cached) $ECHO_C" >&6
16762else
micky3879b9f5e72025-07-08 18:04:53 -040016763 cat >"conftest.$ac_ext" <<_ACEOF
16764#line 16764 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +010016765#include "confdefs.h"
micky3879b9f5e72025-07-08 18:04:53 -040016766$ac_includes_default
Steve Kondikae271bc2015-11-15 02:50:53 +010016767int
micky3879b9f5e72025-07-08 18:04:53 -040016768main (void)
Steve Kondikae271bc2015-11-15 02:50:53 +010016769{
micky3879b9f5e72025-07-08 18:04:53 -040016770if ((signed char *) 0)
16771 return 0;
16772if (sizeof (signed char))
16773 return 0;
16774 ;
16775 return 0;
Steve Kondikae271bc2015-11-15 02:50:53 +010016776}
16777_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -040016778rm -f "conftest.$ac_objext"
16779if { (eval echo "$as_me:16779: \"$ac_compile\"") >&5
16780 (eval $ac_compile) 2>&5
Steve Kondikae271bc2015-11-15 02:50:53 +010016781 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040016782 echo "$as_me:16782: \$? = $ac_status" >&5
16783 (exit "$ac_status"); } &&
16784 { ac_try='test -s "conftest.$ac_objext"'
16785 { (eval echo "$as_me:16785: \"$ac_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010016786 (eval $ac_try) 2>&5
16787 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040016788 echo "$as_me:16788: \$? = $ac_status" >&5
16789 (exit "$ac_status"); }; }; then
16790 ac_cv_type_signed_char=yes
16791else
16792 echo "$as_me: failed program was:" >&5
16793cat "conftest.$ac_ext" >&5
16794ac_cv_type_signed_char=no
16795fi
16796rm -f "conftest.$ac_objext" "conftest.$ac_ext"
16797fi
16798echo "$as_me:16798: result: $ac_cv_type_signed_char" >&5
16799echo "${ECHO_T}$ac_cv_type_signed_char" >&6
16800
16801echo "$as_me:16801: checking size of signed char" >&5
16802echo $ECHO_N "checking size of signed char... $ECHO_C" >&6
16803if test "${ac_cv_sizeof_signed_char+set}" = set; then
16804 echo $ECHO_N "(cached) $ECHO_C" >&6
16805else
16806 if test "$ac_cv_type_signed_char" = yes; then
16807 if test "$cross_compiling" = yes; then
16808 # Depending upon the size, compute the lo and hi bounds.
16809cat >"conftest.$ac_ext" <<_ACEOF
16810#line 16810 "configure"
16811#include "confdefs.h"
16812$ac_includes_default
16813int
16814main (void)
16815{
16816int _array_ [1 - 2 * !((sizeof (signed char)) >= 0)]
16817 ;
16818 return 0;
16819}
16820_ACEOF
16821rm -f "conftest.$ac_objext"
16822if { (eval echo "$as_me:16822: \"$ac_compile\"") >&5
16823 (eval $ac_compile) 2>&5
16824 ac_status=$?
16825 echo "$as_me:16825: \$? = $ac_status" >&5
16826 (exit "$ac_status"); } &&
16827 { ac_try='test -s "conftest.$ac_objext"'
16828 { (eval echo "$as_me:16828: \"$ac_try\"") >&5
16829 (eval $ac_try) 2>&5
16830 ac_status=$?
16831 echo "$as_me:16831: \$? = $ac_status" >&5
16832 (exit "$ac_status"); }; }; then
16833 ac_lo=0 ac_mid=0
16834 while :; do
16835 cat >"conftest.$ac_ext" <<_ACEOF
16836#line 16836 "configure"
16837#include "confdefs.h"
16838$ac_includes_default
16839int
16840main (void)
16841{
16842int _array_ [1 - 2 * !((sizeof (signed char)) <= $ac_mid)]
16843 ;
16844 return 0;
16845}
16846_ACEOF
16847rm -f "conftest.$ac_objext"
16848if { (eval echo "$as_me:16848: \"$ac_compile\"") >&5
16849 (eval $ac_compile) 2>&5
16850 ac_status=$?
16851 echo "$as_me:16851: \$? = $ac_status" >&5
16852 (exit "$ac_status"); } &&
16853 { ac_try='test -s "conftest.$ac_objext"'
16854 { (eval echo "$as_me:16854: \"$ac_try\"") >&5
16855 (eval $ac_try) 2>&5
16856 ac_status=$?
16857 echo "$as_me:16857: \$? = $ac_status" >&5
16858 (exit "$ac_status"); }; }; then
16859 ac_hi=$ac_mid; break
16860else
16861 echo "$as_me: failed program was:" >&5
16862cat "conftest.$ac_ext" >&5
16863ac_lo=`expr "$ac_mid" + 1`; ac_mid=`expr 2 '*' "$ac_mid" + 1`
16864fi
16865rm -f "conftest.$ac_objext" "conftest.$ac_ext"
16866 done
16867else
16868 echo "$as_me: failed program was:" >&5
16869cat "conftest.$ac_ext" >&5
16870ac_hi=-1 ac_mid=-1
16871 while :; do
16872 cat >"conftest.$ac_ext" <<_ACEOF
16873#line 16873 "configure"
16874#include "confdefs.h"
16875$ac_includes_default
16876int
16877main (void)
16878{
16879int _array_ [1 - 2 * !((sizeof (signed char)) >= $ac_mid)]
16880 ;
16881 return 0;
16882}
16883_ACEOF
16884rm -f "conftest.$ac_objext"
16885if { (eval echo "$as_me:16885: \"$ac_compile\"") >&5
16886 (eval $ac_compile) 2>&5
16887 ac_status=$?
16888 echo "$as_me:16888: \$? = $ac_status" >&5
16889 (exit "$ac_status"); } &&
16890 { ac_try='test -s "conftest.$ac_objext"'
16891 { (eval echo "$as_me:16891: \"$ac_try\"") >&5
16892 (eval $ac_try) 2>&5
16893 ac_status=$?
16894 echo "$as_me:16894: \$? = $ac_status" >&5
16895 (exit "$ac_status"); }; }; then
16896 ac_lo=$ac_mid; break
16897else
16898 echo "$as_me: failed program was:" >&5
16899cat "conftest.$ac_ext" >&5
16900ac_hi=`expr "$ac_mid" - 1`; ac_mid=`expr 2 '*' "$ac_mid"`
16901fi
16902rm -f "conftest.$ac_objext" "conftest.$ac_ext"
16903 done
16904fi
16905rm -f "conftest.$ac_objext" "conftest.$ac_ext"
16906# Binary search between lo and hi bounds.
16907while test "x$ac_lo" != "x$ac_hi"; do
16908 ac_mid=`expr '(' "$ac_hi" - "$ac_lo" ')' / 2 + "$ac_lo"`
16909 cat >"conftest.$ac_ext" <<_ACEOF
16910#line 16910 "configure"
16911#include "confdefs.h"
16912$ac_includes_default
16913int
16914main (void)
16915{
16916int _array_ [1 - 2 * !((sizeof (signed char)) <= $ac_mid)]
16917 ;
16918 return 0;
16919}
16920_ACEOF
16921rm -f "conftest.$ac_objext"
16922if { (eval echo "$as_me:16922: \"$ac_compile\"") >&5
16923 (eval $ac_compile) 2>&5
16924 ac_status=$?
16925 echo "$as_me:16925: \$? = $ac_status" >&5
16926 (exit "$ac_status"); } &&
16927 { ac_try='test -s "conftest.$ac_objext"'
16928 { (eval echo "$as_me:16928: \"$ac_try\"") >&5
16929 (eval $ac_try) 2>&5
16930 ac_status=$?
16931 echo "$as_me:16931: \$? = $ac_status" >&5
16932 (exit "$ac_status"); }; }; then
16933 ac_hi=$ac_mid
16934else
16935 echo "$as_me: failed program was:" >&5
16936cat "conftest.$ac_ext" >&5
16937ac_lo=`expr "$ac_mid" + 1`
16938fi
16939rm -f "conftest.$ac_objext" "conftest.$ac_ext"
16940done
16941ac_cv_sizeof_signed_char=$ac_lo
16942else
16943 if test "$cross_compiling" = yes; then
16944 { { echo "$as_me:16944: error: cannot run test program while cross compiling" >&5
16945echo "$as_me: error: cannot run test program while cross compiling" >&2;}
16946 { (exit 1); exit 1; }; }
16947else
16948 cat >"conftest.$ac_ext" <<_ACEOF
16949#line 16949 "configure"
16950#include "confdefs.h"
16951$ac_includes_default
16952int
16953main (void)
16954{
16955FILE *f = fopen ("conftest.val", "w");
16956if (!f)
16957 $ac_main_return (1);
16958fprintf (f, "%ld", (long)(sizeof (signed char)));
16959fclose (f);
16960 ;
16961 return 0;
16962}
16963_ACEOF
16964rm -f "conftest$ac_exeext"
16965if { (eval echo "$as_me:16965: \"$ac_link\"") >&5
16966 (eval $ac_link) 2>&5
16967 ac_status=$?
16968 echo "$as_me:16968: \$? = $ac_status" >&5
16969 (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
16970 { (eval echo "$as_me:16970: \"$ac_try\"") >&5
16971 (eval $ac_try) 2>&5
16972 ac_status=$?
16973 echo "$as_me:16973: \$? = $ac_status" >&5
16974 (exit "$ac_status"); }; }; then
16975 ac_cv_sizeof_signed_char=`cat conftest.val`
Steve Kondikae271bc2015-11-15 02:50:53 +010016976else
16977 echo "$as_me: program exited with status $ac_status" >&5
16978echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -040016979cat "conftest.$ac_ext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010016980fi
micky3879b9f5e72025-07-08 18:04:53 -040016981rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
Steve Kondikae271bc2015-11-15 02:50:53 +010016982fi
16983fi
micky3879b9f5e72025-07-08 18:04:53 -040016984rm -f conftest.val
16985else
16986 ac_cv_sizeof_signed_char=0
Steve Kondikae271bc2015-11-15 02:50:53 +010016987fi
micky3879b9f5e72025-07-08 18:04:53 -040016988fi
16989echo "$as_me:16989: result: $ac_cv_sizeof_signed_char" >&5
16990echo "${ECHO_T}$ac_cv_sizeof_signed_char" >&6
16991cat >>confdefs.h <<EOF
16992#define SIZEOF_SIGNED_CHAR $ac_cv_sizeof_signed_char
Steve Kondikae271bc2015-11-15 02:50:53 +010016993EOF
16994
Steve Kondikae271bc2015-11-15 02:50:53 +010016995ac_header_dirent=no
16996for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h; do
16997 as_ac_Header=`echo "ac_cv_header_dirent_$ac_hdr" | $as_tr_sh`
micky3879b9f5e72025-07-08 18:04:53 -040016998echo "$as_me:16998: checking for $ac_hdr that defines DIR" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010016999echo $ECHO_N "checking for $ac_hdr that defines DIR... $ECHO_C" >&6
17000if eval "test \"\${$as_ac_Header+set}\" = set"; then
17001 echo $ECHO_N "(cached) $ECHO_C" >&6
17002else
micky3879b9f5e72025-07-08 18:04:53 -040017003 cat >"conftest.$ac_ext" <<_ACEOF
17004#line 17004 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +010017005#include "confdefs.h"
17006#include <sys/types.h>
17007#include <$ac_hdr>
17008
17009int
micky3879b9f5e72025-07-08 18:04:53 -040017010main (void)
Steve Kondikae271bc2015-11-15 02:50:53 +010017011{
17012if ((DIR *) 0)
17013return 0;
17014 ;
17015 return 0;
17016}
17017_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -040017018rm -f "conftest.$ac_objext"
17019if { (eval echo "$as_me:17019: \"$ac_compile\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010017020 (eval $ac_compile) 2>&5
17021 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040017022 echo "$as_me:17022: \$? = $ac_status" >&5
17023 (exit "$ac_status"); } &&
17024 { ac_try='test -s "conftest.$ac_objext"'
17025 { (eval echo "$as_me:17025: \"$ac_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010017026 (eval $ac_try) 2>&5
17027 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040017028 echo "$as_me:17028: \$? = $ac_status" >&5
17029 (exit "$ac_status"); }; }; then
Steve Kondikae271bc2015-11-15 02:50:53 +010017030 eval "$as_ac_Header=yes"
17031else
17032 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -040017033cat "conftest.$ac_ext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010017034eval "$as_ac_Header=no"
17035fi
micky3879b9f5e72025-07-08 18:04:53 -040017036rm -f "conftest.$ac_objext" "conftest.$ac_ext"
Steve Kondikae271bc2015-11-15 02:50:53 +010017037fi
micky3879b9f5e72025-07-08 18:04:53 -040017038echo "$as_me:17038: result: `eval echo '${'"$as_ac_Header"'}'`" >&5
17039echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6
17040if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then
Steve Kondikae271bc2015-11-15 02:50:53 +010017041 cat >>confdefs.h <<EOF
17042#define `echo "HAVE_$ac_hdr" | $as_tr_cpp` 1
17043EOF
17044
17045ac_header_dirent=$ac_hdr; break
17046fi
17047
17048done
17049# Two versions of opendir et al. are in -ldir and -lx on SCO Xenix.
17050if test $ac_header_dirent = dirent.h; then
micky3879b9f5e72025-07-08 18:04:53 -040017051 echo "$as_me:17051: checking for opendir in -ldir" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010017052echo $ECHO_N "checking for opendir in -ldir... $ECHO_C" >&6
17053if test "${ac_cv_lib_dir_opendir+set}" = set; then
17054 echo $ECHO_N "(cached) $ECHO_C" >&6
17055else
17056 ac_check_lib_save_LIBS=$LIBS
17057LIBS="-ldir $LIBS"
micky3879b9f5e72025-07-08 18:04:53 -040017058cat >"conftest.$ac_ext" <<_ACEOF
17059#line 17059 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +010017060#include "confdefs.h"
17061
17062/* Override any gcc2 internal prototype to avoid an error. */
17063#ifdef __cplusplus
17064extern "C"
17065#endif
17066/* We use char because int might match the return type of a gcc2
17067 builtin and then its argument prototype would still apply. */
micky3879b9f5e72025-07-08 18:04:53 -040017068char opendir (void);
Steve Kondikae271bc2015-11-15 02:50:53 +010017069int
micky3879b9f5e72025-07-08 18:04:53 -040017070main (void)
Steve Kondikae271bc2015-11-15 02:50:53 +010017071{
17072opendir ();
17073 ;
17074 return 0;
17075}
17076_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -040017077rm -f "conftest.$ac_objext" "conftest$ac_exeext"
17078if { (eval echo "$as_me:17078: \"$ac_link\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010017079 (eval $ac_link) 2>&5
17080 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040017081 echo "$as_me:17081: \$? = $ac_status" >&5
17082 (exit "$ac_status"); } &&
17083 { ac_try='test -s "conftest$ac_exeext"'
17084 { (eval echo "$as_me:17084: \"$ac_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010017085 (eval $ac_try) 2>&5
17086 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040017087 echo "$as_me:17087: \$? = $ac_status" >&5
17088 (exit "$ac_status"); }; }; then
Steve Kondikae271bc2015-11-15 02:50:53 +010017089 ac_cv_lib_dir_opendir=yes
17090else
17091 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -040017092cat "conftest.$ac_ext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010017093ac_cv_lib_dir_opendir=no
17094fi
micky3879b9f5e72025-07-08 18:04:53 -040017095rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
Steve Kondikae271bc2015-11-15 02:50:53 +010017096LIBS=$ac_check_lib_save_LIBS
17097fi
micky3879b9f5e72025-07-08 18:04:53 -040017098echo "$as_me:17098: result: $ac_cv_lib_dir_opendir" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010017099echo "${ECHO_T}$ac_cv_lib_dir_opendir" >&6
micky3879b9f5e72025-07-08 18:04:53 -040017100if test "$ac_cv_lib_dir_opendir" = yes; then
Steve Kondikae271bc2015-11-15 02:50:53 +010017101 LIBS="$LIBS -ldir"
17102fi
17103
17104else
micky3879b9f5e72025-07-08 18:04:53 -040017105 echo "$as_me:17105: checking for opendir in -lx" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010017106echo $ECHO_N "checking for opendir in -lx... $ECHO_C" >&6
17107if test "${ac_cv_lib_x_opendir+set}" = set; then
17108 echo $ECHO_N "(cached) $ECHO_C" >&6
17109else
17110 ac_check_lib_save_LIBS=$LIBS
17111LIBS="-lx $LIBS"
micky3879b9f5e72025-07-08 18:04:53 -040017112cat >"conftest.$ac_ext" <<_ACEOF
17113#line 17113 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +010017114#include "confdefs.h"
17115
17116/* Override any gcc2 internal prototype to avoid an error. */
17117#ifdef __cplusplus
17118extern "C"
17119#endif
17120/* We use char because int might match the return type of a gcc2
17121 builtin and then its argument prototype would still apply. */
micky3879b9f5e72025-07-08 18:04:53 -040017122char opendir (void);
Steve Kondikae271bc2015-11-15 02:50:53 +010017123int
micky3879b9f5e72025-07-08 18:04:53 -040017124main (void)
Steve Kondikae271bc2015-11-15 02:50:53 +010017125{
17126opendir ();
17127 ;
17128 return 0;
17129}
17130_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -040017131rm -f "conftest.$ac_objext" "conftest$ac_exeext"
17132if { (eval echo "$as_me:17132: \"$ac_link\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010017133 (eval $ac_link) 2>&5
17134 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040017135 echo "$as_me:17135: \$? = $ac_status" >&5
17136 (exit "$ac_status"); } &&
17137 { ac_try='test -s "conftest$ac_exeext"'
17138 { (eval echo "$as_me:17138: \"$ac_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010017139 (eval $ac_try) 2>&5
17140 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040017141 echo "$as_me:17141: \$? = $ac_status" >&5
17142 (exit "$ac_status"); }; }; then
Steve Kondikae271bc2015-11-15 02:50:53 +010017143 ac_cv_lib_x_opendir=yes
17144else
17145 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -040017146cat "conftest.$ac_ext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010017147ac_cv_lib_x_opendir=no
17148fi
micky3879b9f5e72025-07-08 18:04:53 -040017149rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
Steve Kondikae271bc2015-11-15 02:50:53 +010017150LIBS=$ac_check_lib_save_LIBS
17151fi
micky3879b9f5e72025-07-08 18:04:53 -040017152echo "$as_me:17152: result: $ac_cv_lib_x_opendir" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010017153echo "${ECHO_T}$ac_cv_lib_x_opendir" >&6
micky3879b9f5e72025-07-08 18:04:53 -040017154if test "$ac_cv_lib_x_opendir" = yes; then
Steve Kondikae271bc2015-11-15 02:50:53 +010017155 LIBS="$LIBS -lx"
17156fi
17157
17158fi
17159
micky3879b9f5e72025-07-08 18:04:53 -040017160echo "$as_me:17160: checking whether time.h and sys/time.h may both be included" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010017161echo $ECHO_N "checking whether time.h and sys/time.h may both be included... $ECHO_C" >&6
17162if test "${ac_cv_header_time+set}" = set; then
17163 echo $ECHO_N "(cached) $ECHO_C" >&6
17164else
micky3879b9f5e72025-07-08 18:04:53 -040017165 cat >"conftest.$ac_ext" <<_ACEOF
17166#line 17166 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +010017167#include "confdefs.h"
17168#include <sys/types.h>
17169#include <sys/time.h>
17170#include <time.h>
17171
17172int
micky3879b9f5e72025-07-08 18:04:53 -040017173main (void)
Steve Kondikae271bc2015-11-15 02:50:53 +010017174{
17175if ((struct tm *) 0)
17176return 0;
17177 ;
17178 return 0;
17179}
17180_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -040017181rm -f "conftest.$ac_objext"
17182if { (eval echo "$as_me:17182: \"$ac_compile\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010017183 (eval $ac_compile) 2>&5
17184 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040017185 echo "$as_me:17185: \$? = $ac_status" >&5
17186 (exit "$ac_status"); } &&
17187 { ac_try='test -s "conftest.$ac_objext"'
17188 { (eval echo "$as_me:17188: \"$ac_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010017189 (eval $ac_try) 2>&5
17190 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040017191 echo "$as_me:17191: \$? = $ac_status" >&5
17192 (exit "$ac_status"); }; }; then
Steve Kondikae271bc2015-11-15 02:50:53 +010017193 ac_cv_header_time=yes
17194else
17195 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -040017196cat "conftest.$ac_ext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010017197ac_cv_header_time=no
17198fi
micky3879b9f5e72025-07-08 18:04:53 -040017199rm -f "conftest.$ac_objext" "conftest.$ac_ext"
Steve Kondikae271bc2015-11-15 02:50:53 +010017200fi
micky3879b9f5e72025-07-08 18:04:53 -040017201echo "$as_me:17201: result: $ac_cv_header_time" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010017202echo "${ECHO_T}$ac_cv_header_time" >&6
17203if test $ac_cv_header_time = yes; then
17204
17205cat >>confdefs.h <<\EOF
17206#define TIME_WITH_SYS_TIME 1
17207EOF
17208
17209fi
17210
17211### checks for compiler characteristics
17212ac_ext=c
17213ac_cpp='$CPP $CPPFLAGS'
micky3879b9f5e72025-07-08 18:04:53 -040017214ac_compile='$CC -c $CFLAGS $CPPFLAGS "conftest.$ac_ext" >&5'
17215ac_link='$CC -o "conftest$ac_exeext" $CFLAGS $CPPFLAGS $LDFLAGS "conftest.$ac_ext" $LIBS >&5'
Steve Kondikae271bc2015-11-15 02:50:53 +010017216ac_compiler_gnu=$ac_cv_c_compiler_gnu
micky3879b9f5e72025-07-08 18:04:53 -040017217ac_main_return="return"
Steve Kondikae271bc2015-11-15 02:50:53 +010017218
micky3879b9f5e72025-07-08 18:04:53 -040017219echo "$as_me:17219: checking for an ANSI C-conforming const" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010017220echo $ECHO_N "checking for an ANSI C-conforming const... $ECHO_C" >&6
17221if test "${ac_cv_c_const+set}" = set; then
17222 echo $ECHO_N "(cached) $ECHO_C" >&6
17223else
micky3879b9f5e72025-07-08 18:04:53 -040017224 cat >"conftest.$ac_ext" <<_ACEOF
17225#line 17225 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +010017226#include "confdefs.h"
17227
17228int
micky3879b9f5e72025-07-08 18:04:53 -040017229main (void)
Steve Kondikae271bc2015-11-15 02:50:53 +010017230{
17231/* FIXME: Include the comments suggested by Paul. */
17232#ifndef __cplusplus
17233 /* Ultrix mips cc rejects this. */
17234 typedef int charset[2];
micky3879b9f5e72025-07-08 18:04:53 -040017235 const charset x; (void)x;
Steve Kondikae271bc2015-11-15 02:50:53 +010017236 /* SunOS 4.1.1 cc rejects this. */
17237 char const *const *ccp;
17238 char **p;
17239 /* NEC SVR4.0.2 mips cc rejects this. */
17240 struct point {int x, y;};
micky3879b9f5e72025-07-08 18:04:53 -040017241 static struct point const zero = {0,0}; (void)zero;
Steve Kondikae271bc2015-11-15 02:50:53 +010017242 /* AIX XL C 1.02.0.0 rejects this.
17243 It does not let you subtract one const X* pointer from another in
17244 an arm of an if-expression whose if-part is not a constant
17245 expression */
17246 const char *g = "string";
17247 ccp = &g + (g ? g-g : 0);
17248 /* HPUX 7.0 cc rejects these. */
17249 ++ccp;
17250 p = (char**) ccp;
17251 ccp = (char const *const *) p;
17252 { /* SCO 3.2v4 cc rejects this. */
17253 char *t;
17254 char const *s = 0 ? (char *) 0 : (char const *) 0;
17255
17256 *t++ = 0;
micky3879b9f5e72025-07-08 18:04:53 -040017257 (void)s;
Steve Kondikae271bc2015-11-15 02:50:53 +010017258 }
17259 { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */
17260 int x[] = {25, 17};
17261 const int *foo = &x[0];
17262 ++foo;
micky3879b9f5e72025-07-08 18:04:53 -040017263 (void)foo;
Steve Kondikae271bc2015-11-15 02:50:53 +010017264 }
17265 { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
17266 typedef const int *iptr;
17267 iptr p = 0;
17268 ++p;
micky3879b9f5e72025-07-08 18:04:53 -040017269 (void)p;
Steve Kondikae271bc2015-11-15 02:50:53 +010017270 }
17271 { /* AIX XL C 1.02.0.0 rejects this saying
17272 "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
17273 struct s { int j; const int *ap[3]; };
17274 struct s *b; b->j = 5;
17275 }
17276 { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
17277 const int foo = 10;
micky3879b9f5e72025-07-08 18:04:53 -040017278 (void)foo;
Steve Kondikae271bc2015-11-15 02:50:53 +010017279 }
17280#endif
17281
17282 ;
17283 return 0;
17284}
17285_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -040017286rm -f "conftest.$ac_objext"
17287if { (eval echo "$as_me:17287: \"$ac_compile\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010017288 (eval $ac_compile) 2>&5
17289 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040017290 echo "$as_me:17290: \$? = $ac_status" >&5
17291 (exit "$ac_status"); } &&
17292 { ac_try='test -s "conftest.$ac_objext"'
17293 { (eval echo "$as_me:17293: \"$ac_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010017294 (eval $ac_try) 2>&5
17295 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040017296 echo "$as_me:17296: \$? = $ac_status" >&5
17297 (exit "$ac_status"); }; }; then
Steve Kondikae271bc2015-11-15 02:50:53 +010017298 ac_cv_c_const=yes
17299else
17300 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -040017301cat "conftest.$ac_ext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010017302ac_cv_c_const=no
17303fi
micky3879b9f5e72025-07-08 18:04:53 -040017304rm -f "conftest.$ac_objext" "conftest.$ac_ext"
Steve Kondikae271bc2015-11-15 02:50:53 +010017305fi
micky3879b9f5e72025-07-08 18:04:53 -040017306echo "$as_me:17306: result: $ac_cv_c_const" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010017307echo "${ECHO_T}$ac_cv_c_const" >&6
17308if test $ac_cv_c_const = no; then
17309
17310cat >>confdefs.h <<\EOF
17311#define const
17312EOF
17313
17314fi
17315
17316### Checks for external-data
17317
micky3879b9f5e72025-07-08 18:04:53 -040017318echo "$as_me:17318: checking if data-only library module links" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010017319echo $ECHO_N "checking if data-only library module links... $ECHO_C" >&6
17320if test "${cf_cv_link_dataonly+set}" = set; then
17321 echo $ECHO_N "(cached) $ECHO_C" >&6
17322else
17323
17324 rm -f conftest.a
17325 cat >conftest.$ac_ext <<EOF
micky3879b9f5e72025-07-08 18:04:53 -040017326#line 17326 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +010017327int testdata[3] = { 123, 456, 789 };
17328EOF
micky3879b9f5e72025-07-08 18:04:53 -040017329 if { (eval echo "$as_me:17329: \"$ac_compile\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010017330 (eval $ac_compile) 2>&5
17331 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040017332 echo "$as_me:17332: \$? = $ac_status" >&5
17333 (exit "$ac_status"); } ; then
Steve Kondikae271bc2015-11-15 02:50:53 +010017334 mv conftest.o data.o && \
17335 ( $AR $ARFLAGS conftest.a data.o ) 2>&5 1>/dev/null
17336 fi
17337 rm -f conftest.$ac_ext data.o
17338 cat >conftest.$ac_ext <<EOF
micky3879b9f5e72025-07-08 18:04:53 -040017339#line 17339 "configure"
17340extern int testfunc(void);
Steve Kondikae271bc2015-11-15 02:50:53 +010017341#if defined(NeXT)
micky3879b9f5e72025-07-08 18:04:53 -040017342int testfunc(void)
17343{
Steve Kondikae271bc2015-11-15 02:50:53 +010017344 ${cf_cv_main_return:-return}(1); /* I'm told this linker is broken */
micky3879b9f5e72025-07-08 18:04:53 -040017345}
Steve Kondikae271bc2015-11-15 02:50:53 +010017346#else
micky3879b9f5e72025-07-08 18:04:53 -040017347extern int testdata[3];
17348int testfunc(void)
17349{
Steve Kondikae271bc2015-11-15 02:50:53 +010017350 return testdata[0] == 123
17351 && testdata[1] == 456
17352 && testdata[2] == 789;
Steve Kondikae271bc2015-11-15 02:50:53 +010017353}
micky3879b9f5e72025-07-08 18:04:53 -040017354#endif
Steve Kondikae271bc2015-11-15 02:50:53 +010017355EOF
micky3879b9f5e72025-07-08 18:04:53 -040017356 if { (eval echo "$as_me:17356: \"$ac_compile\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010017357 (eval $ac_compile) 2>&5
17358 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040017359 echo "$as_me:17359: \$? = $ac_status" >&5
17360 (exit "$ac_status"); }; then
Steve Kondikae271bc2015-11-15 02:50:53 +010017361 mv conftest.o func.o && \
17362 ( $AR $ARFLAGS conftest.a func.o ) 2>&5 1>/dev/null
17363 fi
17364 rm -f conftest.$ac_ext func.o
17365 ( eval $RANLIB conftest.a ) 2>&5 >/dev/null
17366 cf_saveLIBS="$LIBS"
17367 LIBS="conftest.a $LIBS"
17368 if test "$cross_compiling" = yes; then
17369 cf_cv_link_dataonly=unknown
17370else
micky3879b9f5e72025-07-08 18:04:53 -040017371 cat >"conftest.$ac_ext" <<_ACEOF
17372#line 17372 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +010017373#include "confdefs.h"
17374
micky3879b9f5e72025-07-08 18:04:53 -040017375 extern int testfunc(void);
17376 int main(void)
Steve Kondikae271bc2015-11-15 02:50:53 +010017377 {
Steve Kondikae271bc2015-11-15 02:50:53 +010017378 ${cf_cv_main_return:-return} (!testfunc());
17379 }
17380
17381_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -040017382rm -f "conftest$ac_exeext"
17383if { (eval echo "$as_me:17383: \"$ac_link\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010017384 (eval $ac_link) 2>&5
17385 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040017386 echo "$as_me:17386: \$? = $ac_status" >&5
17387 (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
17388 { (eval echo "$as_me:17388: \"$ac_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010017389 (eval $ac_try) 2>&5
17390 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040017391 echo "$as_me:17391: \$? = $ac_status" >&5
17392 (exit "$ac_status"); }; }; then
Steve Kondikae271bc2015-11-15 02:50:53 +010017393 cf_cv_link_dataonly=yes
17394else
17395 echo "$as_me: program exited with status $ac_status" >&5
17396echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -040017397cat "conftest.$ac_ext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010017398cf_cv_link_dataonly=no
17399fi
micky3879b9f5e72025-07-08 18:04:53 -040017400rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
Steve Kondikae271bc2015-11-15 02:50:53 +010017401fi
17402 LIBS="$cf_saveLIBS"
17403
17404fi
17405
micky3879b9f5e72025-07-08 18:04:53 -040017406echo "$as_me:17406: result: $cf_cv_link_dataonly" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010017407echo "${ECHO_T}$cf_cv_link_dataonly" >&6
17408
17409if test "$cf_cv_link_dataonly" = no ; then
17410
17411cat >>confdefs.h <<\EOF
17412#define BROKEN_LINKER 1
17413EOF
17414
17415 BROKEN_LINKER=1
17416fi
17417
17418### Checks for library functions.
17419
micky3879b9f5e72025-07-08 18:04:53 -040017420for ac_header in \
17421unistd.h \
17422
17423do
17424as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
17425echo "$as_me:17425: checking for $ac_header" >&5
17426echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
17427if eval "test \"\${$as_ac_Header+set}\" = set"; then
17428 echo $ECHO_N "(cached) $ECHO_C" >&6
17429else
17430 cat >"conftest.$ac_ext" <<_ACEOF
17431#line 17431 "configure"
17432#include "confdefs.h"
17433#include <$ac_header>
17434_ACEOF
17435if { (eval echo "$as_me:17435: \"$ac_cpp "conftest.$ac_ext"\"") >&5
17436 (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
17437 ac_status=$?
17438 $EGREP -v '^ *\+' conftest.er1 >conftest.err
17439 rm -f conftest.er1
17440 cat conftest.err >&5
17441 echo "$as_me:17441: \$? = $ac_status" >&5
17442 (exit "$ac_status"); } >/dev/null; then
17443 if test -s conftest.err; then
17444 ac_cpp_err=$ac_c_preproc_warn_flag
17445 else
17446 ac_cpp_err=
17447 fi
17448else
17449 ac_cpp_err=yes
17450fi
17451if test -z "$ac_cpp_err"; then
17452 eval "$as_ac_Header=yes"
17453else
17454 echo "$as_me: failed program was:" >&5
17455 cat "conftest.$ac_ext" >&5
17456 eval "$as_ac_Header=no"
17457fi
17458rm -f conftest.err "conftest.$ac_ext"
17459fi
17460echo "$as_me:17460: result: `eval echo '${'"$as_ac_Header"'}'`" >&5
17461echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6
17462if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then
17463 cat >>confdefs.h <<EOF
17464#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
17465EOF
17466
17467fi
17468done
17469
17470echo "$as_me:17470: checking for working mkstemp" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010017471echo $ECHO_N "checking for working mkstemp... $ECHO_C" >&6
17472if test "${cf_cv_func_mkstemp+set}" = set; then
17473 echo $ECHO_N "(cached) $ECHO_C" >&6
17474else
17475
micky3879b9f5e72025-07-08 18:04:53 -040017476rm -rf ./conftest*
Steve Kondikae271bc2015-11-15 02:50:53 +010017477if test "$cross_compiling" = yes; then
17478 cf_cv_func_mkstemp=maybe
17479else
micky3879b9f5e72025-07-08 18:04:53 -040017480 cat >"conftest.$ac_ext" <<_ACEOF
17481#line 17481 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +010017482#include "confdefs.h"
17483
micky3879b9f5e72025-07-08 18:04:53 -040017484$ac_includes_default
17485
17486int main(void)
Steve Kondikae271bc2015-11-15 02:50:53 +010017487{
micky3879b9f5e72025-07-08 18:04:53 -040017488 static char tmpl[] = "conftestXXXXXX";
Steve Kondikae271bc2015-11-15 02:50:53 +010017489 char name[2][80];
17490 int n;
17491 int result = 0;
17492 int fd;
17493 struct stat sb;
17494
17495 umask(077);
17496 for (n = 0; n < 2; ++n) {
17497 strcpy(name[n], tmpl);
17498 if ((fd = mkstemp(name[n])) >= 0) {
17499 if (!strcmp(name[n], tmpl)
17500 || stat(name[n], &sb) != 0
17501 || (sb.st_mode & S_IFMT) != S_IFREG
17502 || (sb.st_mode & 077) != 0) {
17503 result = 1;
17504 }
17505 close(fd);
17506 }
17507 }
17508 if (result == 0
17509 && !strcmp(name[0], name[1]))
17510 result = 1;
17511 ${cf_cv_main_return:-return}(result);
17512}
17513
17514_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -040017515rm -f "conftest$ac_exeext"
17516if { (eval echo "$as_me:17516: \"$ac_link\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010017517 (eval $ac_link) 2>&5
17518 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040017519 echo "$as_me:17519: \$? = $ac_status" >&5
17520 (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
17521 { (eval echo "$as_me:17521: \"$ac_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010017522 (eval $ac_try) 2>&5
17523 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040017524 echo "$as_me:17524: \$? = $ac_status" >&5
17525 (exit "$ac_status"); }; }; then
Steve Kondikae271bc2015-11-15 02:50:53 +010017526 cf_cv_func_mkstemp=yes
17527
17528else
17529 echo "$as_me: program exited with status $ac_status" >&5
17530echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -040017531cat "conftest.$ac_ext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010017532cf_cv_func_mkstemp=no
17533
17534fi
micky3879b9f5e72025-07-08 18:04:53 -040017535rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
Steve Kondikae271bc2015-11-15 02:50:53 +010017536fi
17537
17538fi
micky3879b9f5e72025-07-08 18:04:53 -040017539echo "$as_me:17539: result: $cf_cv_func_mkstemp" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010017540echo "${ECHO_T}$cf_cv_func_mkstemp" >&6
17541if test "x$cf_cv_func_mkstemp" = xmaybe ; then
micky3879b9f5e72025-07-08 18:04:53 -040017542 echo "$as_me:17542: checking for mkstemp" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010017543echo $ECHO_N "checking for mkstemp... $ECHO_C" >&6
17544if test "${ac_cv_func_mkstemp+set}" = set; then
17545 echo $ECHO_N "(cached) $ECHO_C" >&6
17546else
micky3879b9f5e72025-07-08 18:04:53 -040017547 cat >"conftest.$ac_ext" <<_ACEOF
17548#line 17548 "configure"
Steve Kondikae271bc2015-11-15 02:50:53 +010017549#include "confdefs.h"
micky3879b9f5e72025-07-08 18:04:53 -040017550#define mkstemp autoconf_temporary
17551#include <limits.h> /* least-intrusive standard header which defines gcc2 __stub macros */
17552#undef mkstemp
17553
Steve Kondikae271bc2015-11-15 02:50:53 +010017554#ifdef __cplusplus
17555extern "C"
17556#endif
micky3879b9f5e72025-07-08 18:04:53 -040017557
Steve Kondikae271bc2015-11-15 02:50:53 +010017558/* We use char because int might match the return type of a gcc2
17559 builtin and then its argument prototype would still apply. */
micky3879b9f5e72025-07-08 18:04:53 -040017560char mkstemp (void);
Steve Kondikae271bc2015-11-15 02:50:53 +010017561
17562int
micky3879b9f5e72025-07-08 18:04:53 -040017563main (void)
Steve Kondikae271bc2015-11-15 02:50:53 +010017564{
micky3879b9f5e72025-07-08 18:04:53 -040017565
17566/* The GNU C library defines stubs for functions which it implements
Steve Kondikae271bc2015-11-15 02:50:53 +010017567 to always fail with ENOSYS. Some functions are actually named
17568 something starting with __ and the normal name is an alias. */
17569#if defined (__stub_mkstemp) || defined (__stub___mkstemp)
micky3879b9f5e72025-07-08 18:04:53 -040017570#error found stub for mkstemp
Steve Kondikae271bc2015-11-15 02:50:53 +010017571#endif
17572
micky3879b9f5e72025-07-08 18:04:53 -040017573 return mkstemp ();
Steve Kondikae271bc2015-11-15 02:50:53 +010017574 ;
17575 return 0;
17576}
17577_ACEOF
micky3879b9f5e72025-07-08 18:04:53 -040017578rm -f "conftest.$ac_objext" "conftest$ac_exeext"
17579if { (eval echo "$as_me:17579: \"$ac_link\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010017580 (eval $ac_link) 2>&5
17581 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040017582 echo "$as_me:17582: \$? = $ac_status" >&5
17583 (exit "$ac_status"); } &&
17584 { ac_try='test -s "conftest$ac_exeext"'
17585 { (eval echo "$as_me:17585: \"$ac_try\"") >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010017586 (eval $ac_try) 2>&5
17587 ac_status=$?
micky3879b9f5e72025-07-08 18:04:53 -040017588 echo "$as_me:17588: \$? = $ac_status" >&5
17589 (exit "$ac_status"); }; }; then
Steve Kondikae271bc2015-11-15 02:50:53 +010017590 ac_cv_func_mkstemp=yes
17591else
17592 echo "$as_me: failed program was:" >&5
micky3879b9f5e72025-07-08 18:04:53 -040017593cat "conftest.$ac_ext" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010017594ac_cv_func_mkstemp=no
17595fi
micky3879b9f5e72025-07-08 18:04:53 -040017596rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
Steve Kondikae271bc2015-11-15 02:50:53 +010017597fi
micky3879b9f5e72025-07-08 18:04:53 -040017598echo "$as_me:17598: result: $ac_cv_func_mkstemp" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010017599echo "${ECHO_T}$ac_cv_func_mkstemp" >&6
17600
17601fi
17602if test "x$cf_cv_func_mkstemp" = xyes || test "x$ac_cv_func_mkstemp" = xyes ; then
17603
17604cat >>confdefs.h <<\EOF
17605#define HAVE_MKSTEMP 1
17606EOF
17607
17608fi
17609
17610if test -z "$cf_user_CFLAGS" && test "$with_no_leaks" = no ; then
micky3879b9f5e72025-07-08 18:04:53 -040017611 CFLAGS=`echo "${CFLAGS}" | sed -e 's%-g %%' -e 's%-g$%%' -e 's%[ ]% %g' -e 's% [ ]*% %g' -e 's%^ %%' -e 's% $%%'`
17612 CXXFLAGS=`echo "${CXXFLAGS}" | sed -e 's%-g %%' -e 's%-g$%%' -e 's%[ ]% %g' -e 's% [ ]*% %g' -e 's%^ %%' -e 's% $%%'`
Steve Kondikae271bc2015-11-15 02:50:53 +010017613fi
17614
17615cf_with_ada=yes
17616if test "$cf_with_ada" != "no" ; then
17617
micky3879b9f5e72025-07-08 18:04:53 -040017618for cf_prog_gnat in gnat gnatmake gprconfig gprbuild
17619do
17620
17621cf_upper_prog_gnat=`echo "${cf_prog_gnat}" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
17622
17623 unset ac_cv_path_cf_TEMP_gnat
17624 unset cf_TEMP_gnat
17625 # Extract the first word of "$cf_prog_gnat", so it can be a program name with args.
17626set dummy $cf_prog_gnat; ac_word=$2
17627echo "$as_me:17627: checking for $ac_word" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010017628echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
micky3879b9f5e72025-07-08 18:04:53 -040017629if test "${ac_cv_path_cf_TEMP_gnat+set}" = set; then
Steve Kondikae271bc2015-11-15 02:50:53 +010017630 echo $ECHO_N "(cached) $ECHO_C" >&6
17631else
micky3879b9f5e72025-07-08 18:04:53 -040017632 case $cf_TEMP_gnat in
17633 [\\/]* | ?:[\\/]*)
17634 ac_cv_path_cf_TEMP_gnat="$cf_TEMP_gnat" # Let the user override the test with a path.
17635 ;;
17636 *)
Steve Kondikae271bc2015-11-15 02:50:53 +010017637 ac_save_IFS=$IFS; IFS=$ac_path_separator
17638ac_dummy="$PATH"
17639for ac_dir in $ac_dummy; do
17640 IFS=$ac_save_IFS
17641 test -z "$ac_dir" && ac_dir=.
micky3879b9f5e72025-07-08 18:04:53 -040017642 if $as_executable_p "$ac_dir/$ac_word"; then
17643 ac_cv_path_cf_TEMP_gnat="$ac_dir/$ac_word"
17644 echo "$as_me:17644: found $ac_dir/$ac_word" >&5
17645 break
17646fi
Steve Kondikae271bc2015-11-15 02:50:53 +010017647done
17648
micky3879b9f5e72025-07-08 18:04:53 -040017649 test -z "$ac_cv_path_cf_TEMP_gnat" && ac_cv_path_cf_TEMP_gnat="no"
17650 ;;
17651esac
Steve Kondikae271bc2015-11-15 02:50:53 +010017652fi
micky3879b9f5e72025-07-08 18:04:53 -040017653cf_TEMP_gnat=$ac_cv_path_cf_TEMP_gnat
17654
17655if test -n "$cf_TEMP_gnat"; then
17656 echo "$as_me:17656: result: $cf_TEMP_gnat" >&5
17657echo "${ECHO_T}$cf_TEMP_gnat" >&6
Steve Kondikae271bc2015-11-15 02:50:53 +010017658else
micky3879b9f5e72025-07-08 18:04:53 -040017659 echo "$as_me:17659: result: no" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010017660echo "${ECHO_T}no" >&6
17661fi
17662
micky3879b9f5e72025-07-08 18:04:53 -040017663 eval "cf_cv_PATH_$cf_upper_prog_gnat=$ac_cv_path_cf_TEMP_gnat"
17664
17665 if test "x$cf_TEMP_gnat" != xno; then
17666 unset cf_cv_gnat_version
17667 unset cf_TEMP_gnat
17668
17669echo "$as_me:17669: checking for $cf_prog_gnat version" >&5
17670echo $ECHO_N "checking for $cf_prog_gnat version... $ECHO_C" >&6
17671if test "${cf_cv_gnat_version+set}" = set; then
17672 echo $ECHO_N "(cached) $ECHO_C" >&6
17673else
17674
17675cf_cv_gnat_version=`$cf_prog_gnat --version 2>&1 | \
17676 grep '[0-9].[0-9][0-9]*' |\
17677 sed -e '2,$d' -e 's/[^0-9 \.]//g' -e 's/^[ ]*//' -e 's/ .*//'`
17678
17679fi
17680echo "$as_me:17680: result: $cf_cv_gnat_version" >&5
17681echo "${ECHO_T}$cf_cv_gnat_version" >&6
17682test -z "$cf_cv_gnat_version" && cf_cv_gnat_version=no
17683eval cf_TEMP_gnat=$cf_cv_gnat_version; unset cf_cv_gnat_version
17684
17685 fi
17686 eval "cf_cv_VERSION_$cf_upper_prog_gnat=$cf_TEMP_gnat"
17687
17688 unset cf_TEMP_gnat
17689 unset cf_cv_gnat_version
17690 unset ac_cv_path_cf_TEMP_gnat
17691done
17692
17693if test "x$cf_cv_VERSION_GNATMAKE" = "xno"; then
Steve Kondikae271bc2015-11-15 02:50:53 +010017694 cf_ada_make=
17695 cf_cv_prog_gnat_correct=no
17696else
micky3879b9f5e72025-07-08 18:04:53 -040017697 cf_ada_make=gnatmake
17698 if test "x$cf_cv_VERSION_GPRCONFIG" = "xno"; then
17699 # gprconfig is newer than gnatmake; we can continue...
17700 cf_ada_config="##"
17701 else
17702 rm -rf ./conftest* ./*~conftest*
17703 if mkdir conftest.src
17704 then
17705 cf_ada_config=""
17706 cd conftest.src
17707 for cf_gprconfig in Ada C
17708 do
17709 echo "$as_me:17709: checking for gprconfig name for $cf_gprconfig" >&5
17710echo $ECHO_N "checking for gprconfig name for $cf_gprconfig... $ECHO_C" >&6
17711 if test "$cf_gprconfig" = C
17712 then
17713 for cf_gprconfig_param in \
17714 "$cf_gprconfig,,,,GNATGCC" \
17715 "$cf_gprconfig,,,,GCC" \
17716 "$cf_gprconfig"
17717 do
17718 cf_gprconfig_value=`echo s| gprconfig --config=$cf_gprconfig_param 2>&5 | ${AWK:-awk} '/^\*/{print $3;}' | head -n 1`
17719 test -n "$cf_gprconfig_value" && break
17720 done
17721 else
17722 cf_gprconfig_param=$cf_gprconfig
17723 cf_gprconfig_value=`echo s| gprconfig --config=$cf_gprconfig_param 2>&5 | ${AWK:-awk} '/^\*/{print $3;}' | head -n 1`
17724 fi
17725 if test -n "$cf_gprconfig_value"
17726 then
17727 eval "cf_ada_config_$cf_gprconfig=$cf_gprconfig_value"
17728 echo "$as_me:17728: result: $cf_gprconfig_value" >&5
17729echo "${ECHO_T}$cf_gprconfig_value" >&6
17730 else
17731 echo "$as_me:17731: result: missing" >&5
17732echo "${ECHO_T}missing" >&6
17733 cf_ada_config="#"
17734 break
17735 fi
17736 done
17737 cd ..
17738 rm -rf ./conftest* ./*~conftest*
17739 fi
17740 fi
17741 if test "x$cf_ada_config" != "x#"
17742 then
Steve Kondikae271bc2015-11-15 02:50:53 +010017743
micky3879b9f5e72025-07-08 18:04:53 -040017744echo "$as_me:17744: checking for gnat version" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010017745echo $ECHO_N "checking for gnat version... $ECHO_C" >&6
micky3879b9f5e72025-07-08 18:04:53 -040017746if test "${cf_cv_gnat_version+set}" = set; then
17747 echo $ECHO_N "(cached) $ECHO_C" >&6
17748else
17749
17750cf_cv_gnat_version=`${cf_ada_make:-gnatmake} --version 2>&1 | \
Steve Kondikae271bc2015-11-15 02:50:53 +010017751 grep '[0-9].[0-9][0-9]*' |\
17752 sed -e '2,$d' -e 's/[^0-9 \.]//g' -e 's/^[ ]*//' -e 's/ .*//'`
Steve Kondikae271bc2015-11-15 02:50:53 +010017753
micky3879b9f5e72025-07-08 18:04:53 -040017754fi
17755echo "$as_me:17755: result: $cf_cv_gnat_version" >&5
17756echo "${ECHO_T}$cf_cv_gnat_version" >&6
17757test -z "$cf_cv_gnat_version" && cf_cv_gnat_version=no
17758
17759case "$cf_cv_gnat_version" in
17760(3.1[1-9]*|3.[2-9]*|[4-9].*|[1-9][0-9].[0-9]*|20[0-9][0-9])
Steve Kondikae271bc2015-11-15 02:50:53 +010017761 cf_cv_prog_gnat_correct=yes
17762 ;;
17763(*)
micky3879b9f5e72025-07-08 18:04:53 -040017764 { echo "$as_me:17764: WARNING: Unsupported GNAT version $cf_cv_gnat_version. We require 3.11 or better. Disabling Ada95 binding." >&5
17765echo "$as_me: WARNING: Unsupported GNAT version $cf_cv_gnat_version. We require 3.11 or better. Disabling Ada95 binding." >&2;}
Steve Kondikae271bc2015-11-15 02:50:53 +010017766 cf_cv_prog_gnat_correct=no
17767 ;;
17768esac
17769
micky3879b9f5e72025-07-08 18:04:53 -040017770 # Extract the first word of "m4", so it can be a program name with args.
Steve Kondikae271bc2015-11-15 02:50:53 +010017771set dummy m4; ac_word=$2
micky3879b9f5e72025-07-08 18:04:53 -040017772echo "$as_me:17772: checking for $ac_word" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010017773echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
17774if test "${ac_cv_prog_M4_exists+set}" = set; then
17775 echo $ECHO_N "(cached) $ECHO_C" >&6
17776else
17777 if test -n "$M4_exists"; then
17778 ac_cv_prog_M4_exists="$M4_exists" # Let the user override the test.
17779else
17780 ac_save_IFS=$IFS; IFS=$ac_path_separator
17781ac_dummy="$PATH"
17782for ac_dir in $ac_dummy; do
17783 IFS=$ac_save_IFS
17784 test -z "$ac_dir" && ac_dir=.
17785 $as_executable_p "$ac_dir/$ac_word" || continue
17786ac_cv_prog_M4_exists="yes"
micky3879b9f5e72025-07-08 18:04:53 -040017787echo "$as_me:17787: found $ac_dir/$ac_word" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010017788break
17789done
17790
17791 test -z "$ac_cv_prog_M4_exists" && ac_cv_prog_M4_exists="no"
17792fi
17793fi
17794M4_exists=$ac_cv_prog_M4_exists
17795if test -n "$M4_exists"; then
micky3879b9f5e72025-07-08 18:04:53 -040017796 echo "$as_me:17796: result: $M4_exists" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010017797echo "${ECHO_T}$M4_exists" >&6
17798else
micky3879b9f5e72025-07-08 18:04:53 -040017799 echo "$as_me:17799: result: no" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010017800echo "${ECHO_T}no" >&6
17801fi
17802
micky3879b9f5e72025-07-08 18:04:53 -040017803 if test "$ac_cv_prog_M4_exists" = no; then
17804 cf_cv_prog_gnat_correct=no
17805 { echo "$as_me:17805: WARNING: Ada95 binding required program m4 not found. Ada95 binding disabled" >&5
17806echo "$as_me: WARNING: Ada95 binding required program m4 not found. Ada95 binding disabled" >&2;}
17807 fi
17808 if test "$cf_cv_prog_gnat_correct" = yes; then
17809 echo "$as_me:17809: checking if GNAT works" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010017810echo $ECHO_N "checking if GNAT works... $ECHO_C" >&6
17811
micky3879b9f5e72025-07-08 18:04:53 -040017812rm -rf ./conftest* ./*~conftest*
Steve Kondikae271bc2015-11-15 02:50:53 +010017813cat >>conftest.ads <<CF_EOF
17814procedure conftest;
17815CF_EOF
17816cat >>conftest.adb <<CF_EOF
17817with Text_IO;
17818with GNAT.OS_Lib;
17819procedure conftest is
17820begin
17821 Text_IO.Put ("Hello World");
17822 Text_IO.New_Line;
17823 GNAT.OS_Lib.OS_Exit (0);
17824end conftest;
17825CF_EOF
micky3879b9f5e72025-07-08 18:04:53 -040017826if ( "$cf_ada_make" $ADAFLAGS conftest 1>&5 2>&1 ) ; then
Steve Kondikae271bc2015-11-15 02:50:53 +010017827 if ( ./conftest 1>&5 2>&1 ) ; then
17828 cf_cv_prog_gnat_correct=yes
17829 else
17830 cf_cv_prog_gnat_correct=no
17831 fi
17832else
17833 cf_cv_prog_gnat_correct=no
17834fi
micky3879b9f5e72025-07-08 18:04:53 -040017835rm -rf ./conftest* ./*~conftest*
Steve Kondikae271bc2015-11-15 02:50:53 +010017836
micky3879b9f5e72025-07-08 18:04:53 -040017837 echo "$as_me:17837: result: $cf_cv_prog_gnat_correct" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010017838echo "${ECHO_T}$cf_cv_prog_gnat_correct" >&6
micky3879b9f5e72025-07-08 18:04:53 -040017839 fi
17840 else
17841 cf_cv_prog_gnat_correct=no
Steve Kondikae271bc2015-11-15 02:50:53 +010017842 fi
17843fi
17844
17845 if test "$cf_cv_prog_gnat_correct" = yes; then
17846
micky3879b9f5e72025-07-08 18:04:53 -040017847 echo "$as_me:17847: checking optimization options for ADAFLAGS" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010017848echo $ECHO_N "checking optimization options for ADAFLAGS... $ECHO_C" >&6
17849 case "$CFLAGS" in
17850 (*-g*)
17851
17852 ADAFLAGS="$ADAFLAGS -g"
17853
17854 ;;
17855 esac
17856 case "$CFLAGS" in
17857 (*-O*)
17858 cf_O_flag=`echo "$CFLAGS" |sed -e 's/^.*-O/-O/' -e 's/[ ].*//'`
17859
17860 ADAFLAGS="$ADAFLAGS $cf_O_flag"
17861
17862 ;;
17863 esac
micky3879b9f5e72025-07-08 18:04:53 -040017864 echo "$as_me:17864: result: $ADAFLAGS" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010017865echo "${ECHO_T}$ADAFLAGS" >&6
17866
micky3879b9f5e72025-07-08 18:04:53 -040017867echo "$as_me:17867: checking if GNATPREP supports -T option" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010017868echo $ECHO_N "checking if GNATPREP supports -T option... $ECHO_C" >&6
17869if test "${cf_cv_gnatprep_opt_t+set}" = set; then
17870 echo $ECHO_N "(cached) $ECHO_C" >&6
17871else
17872
17873cf_cv_gnatprep_opt_t=no
17874gnatprep -T 2>/dev/null >/dev/null && cf_cv_gnatprep_opt_t=yes
17875
17876fi
micky3879b9f5e72025-07-08 18:04:53 -040017877echo "$as_me:17877: result: $cf_cv_gnatprep_opt_t" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010017878echo "${ECHO_T}$cf_cv_gnatprep_opt_t" >&6
17879test "$cf_cv_gnatprep_opt_t" = yes && GNATPREP_OPTS="-T $GNATPREP_OPTS"
17880
micky3879b9f5e72025-07-08 18:04:53 -040017881echo "$as_me:17881: checking if GNAT supports generics" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010017882echo $ECHO_N "checking if GNAT supports generics... $ECHO_C" >&6
micky3879b9f5e72025-07-08 18:04:53 -040017883case "$cf_cv_gnat_version" in
17884(3.1[1-9]*|3.[2-9]*|[4-9].*|[1-9][0-9].[0-9]*|20[0-9][0-9])
Steve Kondikae271bc2015-11-15 02:50:53 +010017885 cf_gnat_generics=yes
17886 ;;
17887(*)
17888 cf_gnat_generics=no
17889 ;;
17890esac
micky3879b9f5e72025-07-08 18:04:53 -040017891echo "$as_me:17891: result: $cf_gnat_generics" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010017892echo "${ECHO_T}$cf_gnat_generics" >&6
17893
17894if test "$cf_gnat_generics" = yes
17895then
17896 cf_compile_generics=generics
17897 cf_generic_objects="\${GENOBJS}"
17898else
17899 cf_compile_generics=
17900 cf_generic_objects=
17901fi
17902
micky3879b9f5e72025-07-08 18:04:53 -040017903echo "$as_me:17903: checking if GNAT supports SIGINT" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010017904echo $ECHO_N "checking if GNAT supports SIGINT... $ECHO_C" >&6
17905if test "${cf_cv_gnat_sigint+set}" = set; then
17906 echo $ECHO_N "(cached) $ECHO_C" >&6
17907else
17908
micky3879b9f5e72025-07-08 18:04:53 -040017909rm -rf ./conftest* ./*~conftest*
Steve Kondikae271bc2015-11-15 02:50:53 +010017910cat >>conftest.ads <<CF_EOF
17911with Ada.Interrupts.Names;
17912
17913package ConfTest is
17914
17915 pragma Warnings (Off); -- the next pragma exists since 3.11p
17916 pragma Unreserve_All_Interrupts;
17917 pragma Warnings (On);
17918
17919 protected Process is
17920 procedure Stop;
17921 function Continue return Boolean;
17922 pragma Attach_Handler (Stop, Ada.Interrupts.Names.SIGINT);
17923 private
17924 Done : Boolean := False;
17925 end Process;
17926
17927end ConfTest;
17928CF_EOF
17929cat >>conftest.adb <<CF_EOF
17930package body ConfTest is
17931 protected body Process is
17932 procedure Stop is
17933 begin
17934 Done := True;
17935 end Stop;
17936 function Continue return Boolean is
17937 begin
17938 return not Done;
17939 end Continue;
17940 end Process;
17941end ConfTest;
17942CF_EOF
micky3879b9f5e72025-07-08 18:04:53 -040017943if ( "$cf_ada_make" $ADAFLAGS conftest 1>&5 2>&1 ) ; then
Steve Kondikae271bc2015-11-15 02:50:53 +010017944 cf_cv_gnat_sigint=yes
17945else
17946 cf_cv_gnat_sigint=no
17947fi
micky3879b9f5e72025-07-08 18:04:53 -040017948rm -rf ./conftest* ./*~conftest*
Steve Kondikae271bc2015-11-15 02:50:53 +010017949
17950fi
micky3879b9f5e72025-07-08 18:04:53 -040017951echo "$as_me:17951: result: $cf_cv_gnat_sigint" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010017952echo "${ECHO_T}$cf_cv_gnat_sigint" >&6
17953
micky3879b9f5e72025-07-08 18:04:53 -040017954if test "$cf_cv_gnat_sigint" = yes ; then
Steve Kondikae271bc2015-11-15 02:50:53 +010017955 USE_GNAT_SIGINT=""
17956else
17957 USE_GNAT_SIGINT="#"
17958fi
17959
17960cf_gnat_libraries=no
17961cf_gnat_projects=no
17962
17963if test "$enable_gnat_projects" != no ; then
micky3879b9f5e72025-07-08 18:04:53 -040017964echo "$as_me:17964: checking if GNAT supports project files" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010017965echo $ECHO_N "checking if GNAT supports project files... $ECHO_C" >&6
micky3879b9f5e72025-07-08 18:04:53 -040017966case "$cf_cv_gnat_version" in
Steve Kondikae271bc2015-11-15 02:50:53 +010017967(3.[0-9]*)
17968 ;;
17969(*)
micky3879b9f5e72025-07-08 18:04:53 -040017970 case "$cf_cv_system_name" in
Steve Kondikae271bc2015-11-15 02:50:53 +010017971 (cygwin*|msys*)
17972 ;;
17973 (*)
micky3879b9f5e72025-07-08 18:04:53 -040017974 rm -rf ./conftest* ./*~conftest*
17975 if mkdir conftest.src conftest.bin conftest.lib
17976 then
17977 cd conftest.src
17978 rm -rf ./conftest* ./*~conftest*
17979 cat >>library.gpr <<CF_EOF
Steve Kondikae271bc2015-11-15 02:50:53 +010017980project Library is
17981 Kind := External ("LIB_KIND");
17982 for Library_Name use "ConfTest";
17983 for Object_Dir use ".";
17984 for Library_ALI_Dir use External("LIBRARY_DIR");
17985 for Library_Version use External ("SONAME");
17986 for Library_Kind use Kind;
17987 for Library_Dir use External("BUILD_DIR");
17988 Source_Dir := External ("SOURCE_DIR");
17989 for Source_Dirs use (Source_Dir);
17990end Library;
17991CF_EOF
micky3879b9f5e72025-07-08 18:04:53 -040017992 cat >>confpackage.ads <<CF_EOF
Steve Kondikae271bc2015-11-15 02:50:53 +010017993package ConfPackage is
17994 procedure conftest;
17995end ConfPackage;
17996CF_EOF
micky3879b9f5e72025-07-08 18:04:53 -040017997 cat >>confpackage.adb <<CF_EOF
Steve Kondikae271bc2015-11-15 02:50:53 +010017998with Text_IO;
17999package body ConfPackage is
18000 procedure conftest is
18001 begin
18002 Text_IO.Put ("Hello World");
18003 Text_IO.New_Line;
18004 end conftest;
18005end ConfPackage;
18006CF_EOF
micky3879b9f5e72025-07-08 18:04:53 -040018007 if ( "$cf_ada_make" $ADAFLAGS \
18008 -Plibrary.gpr \
18009 -XBUILD_DIR="`cd ../conftest.bin;pwd`" \
18010 -XLIBRARY_DIR="`cd ../conftest.lib;pwd`" \
18011 -XSOURCE_DIR="`pwd`" \
18012 -XSONAME=libConfTest.so.1 \
18013 -XLIB_KIND=static 1>&5 2>&1 ) ; then
18014 cf_gnat_projects=yes
18015 fi
18016 cd ..
Steve Kondikae271bc2015-11-15 02:50:53 +010018017 fi
Steve Kondikae271bc2015-11-15 02:50:53 +010018018 if test -f conftest.lib/confpackage.ali
18019 then
18020 cf_gnat_libraries=yes
18021 fi
micky3879b9f5e72025-07-08 18:04:53 -040018022 rm -rf ./conftest* ./*~conftest*
Steve Kondikae271bc2015-11-15 02:50:53 +010018023 ;;
18024 esac
18025 ;;
18026esac
micky3879b9f5e72025-07-08 18:04:53 -040018027echo "$as_me:18027: result: $cf_gnat_projects" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010018028echo "${ECHO_T}$cf_gnat_projects" >&6
18029fi # enable_gnat_projects
18030
micky3879b9f5e72025-07-08 18:04:53 -040018031if test "$cf_gnat_projects" = yes
Steve Kondikae271bc2015-11-15 02:50:53 +010018032then
micky3879b9f5e72025-07-08 18:04:53 -040018033 echo "$as_me:18033: checking if GNAT supports libraries" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010018034echo $ECHO_N "checking if GNAT supports libraries... $ECHO_C" >&6
micky3879b9f5e72025-07-08 18:04:53 -040018035 echo "$as_me:18035: result: $cf_gnat_libraries" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010018036echo "${ECHO_T}$cf_gnat_libraries" >&6
18037fi
18038
micky3879b9f5e72025-07-08 18:04:53 -040018039USE_OLD_MAKERULES=""
18040USE_GNAT_PROJECTS="#"
18041USE_GNAT_MAKE_GPR="#"
18042USE_GNAT_GPRBUILD="#"
18043
Steve Kondikae271bc2015-11-15 02:50:53 +010018044if test "$cf_gnat_projects" = yes
18045then
18046 USE_OLD_MAKERULES="#"
18047 USE_GNAT_PROJECTS=""
micky3879b9f5e72025-07-08 18:04:53 -040018048 if test "$cf_cv_VERSION_GPRBUILD" != no
18049 then
18050 USE_GNAT_GPRBUILD=""
18051 elif test "$cf_cv_VERSION_GNATMAKE" != no
18052 then
18053 USE_GNAT_MAKE_GPR=""
18054 else
18055 { echo "$as_me:18055: WARNING: use old makefile rules since tools are missing" >&5
18056echo "$as_me: WARNING: use old makefile rules since tools are missing" >&2;}
18057 fi
Steve Kondikae271bc2015-11-15 02:50:53 +010018058fi
18059
18060if test "$cf_gnat_libraries" = yes
18061then
18062 USE_GNAT_LIBRARIES=""
18063else
18064 USE_GNAT_LIBRARIES="#"
18065fi
18066
micky3879b9f5e72025-07-08 18:04:53 -040018067echo "$as_me:18067: checking for Ada95 compiler" >&5
18068echo $ECHO_N "checking for Ada95 compiler... $ECHO_C" >&6
Steve Kondikae271bc2015-11-15 02:50:53 +010018069
18070# Check whether --with-ada-compiler or --without-ada-compiler was given.
18071if test "${with_ada_compiler+set}" = set; then
18072 withval="$with_ada_compiler"
18073 cf_ada_compiler=$withval
18074else
18075 cf_ada_compiler=gnatmake
18076fi;
18077
micky3879b9f5e72025-07-08 18:04:53 -040018078echo "$as_me:18078: result: $cf_ada_compiler" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010018079echo "${ECHO_T}$cf_ada_compiler" >&6
18080
18081 cf_ada_package=terminal_interface
18082
micky3879b9f5e72025-07-08 18:04:53 -040018083echo "$as_me:18083: checking for Ada95 include directory" >&5
18084echo $ECHO_N "checking for Ada95 include directory... $ECHO_C" >&6
Steve Kondikae271bc2015-11-15 02:50:53 +010018085
18086# Check whether --with-ada-include or --without-ada-include was given.
18087if test "${with_ada_include+set}" = set; then
18088 withval="$with_ada_include"
18089
18090else
18091 withval="${ADA_INCLUDE:-$prefix/share/ada/adainclude}"
18092fi; if test -n "$prefix/share/ada/adainclude" ; then
18093
18094if test "x$prefix" != xNONE; then
18095 cf_path_syntax="$prefix"
18096else
18097 cf_path_syntax="$ac_default_prefix"
18098fi
18099
18100case ".$withval" in
18101(.\$\(*\)*|.\'*\'*)
18102 ;;
18103(..|./*|.\\*)
18104 ;;
18105(.[a-zA-Z]:[\\/]*) # OS/2 EMX
18106 ;;
micky3879b9f5e72025-07-08 18:04:53 -040018107(.\$\{*prefix\}*|.\$\{*dir\}*)
Steve Kondikae271bc2015-11-15 02:50:53 +010018108 eval withval="$withval"
18109 case ".$withval" in
18110 (.NONE/*)
micky3879b9f5e72025-07-08 18:04:53 -040018111 withval=`echo "$withval" | sed -e s%NONE%$cf_path_syntax%`
Steve Kondikae271bc2015-11-15 02:50:53 +010018112 ;;
18113 esac
18114 ;;
18115(.no|.NONE/*)
micky3879b9f5e72025-07-08 18:04:53 -040018116 withval=`echo "$withval" | sed -e s%NONE%$cf_path_syntax%`
Steve Kondikae271bc2015-11-15 02:50:53 +010018117 ;;
18118(*)
micky3879b9f5e72025-07-08 18:04:53 -040018119 { { echo "$as_me:18119: error: expected a pathname, not \"$withval\"" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010018120echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;}
18121 { (exit 1); exit 1; }; }
18122 ;;
18123esac
18124
18125fi
18126eval ADA_INCLUDE="$withval"
18127
micky3879b9f5e72025-07-08 18:04:53 -040018128echo "$as_me:18128: result: $ADA_INCLUDE" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010018129echo "${ECHO_T}$ADA_INCLUDE" >&6
18130
micky3879b9f5e72025-07-08 18:04:53 -040018131echo "$as_me:18131: checking for Ada95 object directory" >&5
18132echo $ECHO_N "checking for Ada95 object directory... $ECHO_C" >&6
Steve Kondikae271bc2015-11-15 02:50:53 +010018133
18134# Check whether --with-ada-objects or --without-ada-objects was given.
18135if test "${with_ada_objects+set}" = set; then
18136 withval="$with_ada_objects"
18137
18138else
18139 withval="${ADA_OBJECTS:-$prefix/lib/ada/adalib}"
18140fi; if test -n "$prefix/lib/ada/adalib" ; then
18141
18142if test "x$prefix" != xNONE; then
18143 cf_path_syntax="$prefix"
18144else
18145 cf_path_syntax="$ac_default_prefix"
18146fi
18147
18148case ".$withval" in
18149(.\$\(*\)*|.\'*\'*)
18150 ;;
18151(..|./*|.\\*)
18152 ;;
18153(.[a-zA-Z]:[\\/]*) # OS/2 EMX
18154 ;;
micky3879b9f5e72025-07-08 18:04:53 -040018155(.\$\{*prefix\}*|.\$\{*dir\}*)
Steve Kondikae271bc2015-11-15 02:50:53 +010018156 eval withval="$withval"
18157 case ".$withval" in
18158 (.NONE/*)
micky3879b9f5e72025-07-08 18:04:53 -040018159 withval=`echo "$withval" | sed -e s%NONE%$cf_path_syntax%`
Steve Kondikae271bc2015-11-15 02:50:53 +010018160 ;;
18161 esac
18162 ;;
18163(.no|.NONE/*)
micky3879b9f5e72025-07-08 18:04:53 -040018164 withval=`echo "$withval" | sed -e s%NONE%$cf_path_syntax%`
Steve Kondikae271bc2015-11-15 02:50:53 +010018165 ;;
18166(*)
micky3879b9f5e72025-07-08 18:04:53 -040018167 { { echo "$as_me:18167: error: expected a pathname, not \"$withval\"" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010018168echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;}
18169 { (exit 1); exit 1; }; }
18170 ;;
18171esac
18172
18173fi
18174eval ADA_OBJECTS="$withval"
18175
micky3879b9f5e72025-07-08 18:04:53 -040018176echo "$as_me:18176: result: $ADA_OBJECTS" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010018177echo "${ECHO_T}$ADA_OBJECTS" >&6
18178
micky3879b9f5e72025-07-08 18:04:53 -040018179echo "$as_me:18179: checking whether to build an Ada95 shared library" >&5
18180echo $ECHO_N "checking whether to build an Ada95 shared library... $ECHO_C" >&6
Steve Kondikae271bc2015-11-15 02:50:53 +010018181
18182# Check whether --with-ada-sharedlib or --without-ada-sharedlib was given.
18183if test "${with_ada_sharedlib+set}" = set; then
18184 withval="$with_ada_sharedlib"
18185 with_ada_sharedlib=$withval
18186else
18187 with_ada_sharedlib=no
18188fi;
micky3879b9f5e72025-07-08 18:04:53 -040018189cf_ada_sharedlib_warn=no
18190
18191if test "x$with_ada_sharedlib" != xno
18192then
18193 if test "x$cf_gnat_projects" != xyes
18194 then
18195 with_ada_sharedlib=no
18196 cf_ada_sharedlib_warn=yes
18197 fi
18198fi
18199
18200echo "$as_me:18200: result: $with_ada_sharedlib" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010018201echo "${ECHO_T}$with_ada_sharedlib" >&6
micky3879b9f5e72025-07-08 18:04:53 -040018202if test "x$cf_ada_sharedlib_warn" != xno
18203then
18204 { echo "$as_me:18204: WARNING: disabling Ada95 shared library since GNAT projects are not supported" >&5
18205echo "$as_me: WARNING: disabling Ada95 shared library since GNAT projects are not supported" >&2;}
18206fi
Steve Kondikae271bc2015-11-15 02:50:53 +010018207
18208ADA_SHAREDLIB='lib$(LIB_NAME).so.1'
18209MAKE_ADA_SHAREDLIB="#"
18210
18211if test "x$with_ada_sharedlib" != xno
18212then
18213 MAKE_ADA_SHAREDLIB=
18214 if test "x$with_ada_sharedlib" != xyes
18215 then
18216 ADA_SHAREDLIB="$with_ada_sharedlib"
18217 fi
18218fi
18219
micky3879b9f5e72025-07-08 18:04:53 -040018220 # allow the Ada binding to be renamed
18221
18222echo "$as_me:18222: checking for Ada95 curses library name" >&5
18223echo $ECHO_N "checking for Ada95 curses library name... $ECHO_C" >&6
18224
18225# Check whether --with-ada-libname or --without-ada-libname was given.
18226if test "${with_ada_libname+set}" = set; then
18227 withval="$with_ada_libname"
18228 ADA_LIBNAME=$withval
18229else
18230 ADA_LIBNAME=AdaCurses
18231fi;
18232case "x$ADA_LIBNAME" in
18233(x|xyes|xno)
18234 ADA_LIBNAME=AdaCurses
18235 ;;
18236esac
18237
18238echo "$as_me:18238: result: $ADA_LIBNAME" >&5
18239echo "${ECHO_T}$ADA_LIBNAME" >&6
18240
Steve Kondikae271bc2015-11-15 02:50:53 +010018241 else
micky3879b9f5e72025-07-08 18:04:53 -040018242 { { echo "$as_me:18242: error: No usable Ada compiler found" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010018243echo "$as_me: error: No usable Ada compiler found" >&2;}
18244 { (exit 1); exit 1; }; }
18245 fi
18246else
micky3879b9f5e72025-07-08 18:04:53 -040018247 { { echo "$as_me:18247: error: The Ada compiler is needed for this package" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010018248echo "$as_me: error: The Ada compiler is needed for this package" >&2;}
18249 { (exit 1); exit 1; }; }
18250fi
18251
18252################################################################################
18253
18254# not needed
18255TINFO_LDFLAGS2=
18256
18257TINFO_LIBS=
18258
18259### Construct the list of include-directories to be generated
18260
18261if test "$srcdir" != "."; then
18262 CPPFLAGS="-I\${srcdir}/../include $CPPFLAGS"
18263fi
18264CPPFLAGS="-I../include $CPPFLAGS"
18265if test "$srcdir" != "."; then
18266 CPPFLAGS="-I\${srcdir} $CPPFLAGS"
18267fi
18268CPPFLAGS="-I. $CPPFLAGS"
18269
18270ACPPFLAGS="-I. -I../include -I../../include $ACPPFLAGS"
18271if test "$srcdir" != "."; then
18272 ACPPFLAGS="-I\${srcdir}/../../include $ACPPFLAGS"
18273fi
18274if test "$GCC" != yes; then
18275 ACPPFLAGS="$ACPPFLAGS -I\${includedir}"
18276elif test "$includedir" != "/usr/include"; then
18277 if test "$includedir" = '${prefix}/include' ; then
18278 if test x$prefix != x/usr ; then
18279 ACPPFLAGS="$ACPPFLAGS -I\${includedir}"
18280 fi
18281 else
18282 ACPPFLAGS="$ACPPFLAGS -I\${includedir}"
18283 fi
18284fi
18285
18286### Build up pieces for makefile rules
micky3879b9f5e72025-07-08 18:04:53 -040018287echo "$as_me:18287: checking default library suffix" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010018288echo $ECHO_N "checking default library suffix... $ECHO_C" >&6
18289
18290 case $DFT_LWR_MODEL in
18291 (libtool) DFT_ARG_SUFFIX='' ;;
18292 (normal) DFT_ARG_SUFFIX='' ;;
18293 (debug) DFT_ARG_SUFFIX='_g' ;;
18294 (profile) DFT_ARG_SUFFIX='_p' ;;
18295 (shared) DFT_ARG_SUFFIX='' ;;
18296 esac
18297 test -n "$LIB_SUFFIX" && DFT_ARG_SUFFIX="${LIB_SUFFIX}${DFT_ARG_SUFFIX}"
micky3879b9f5e72025-07-08 18:04:53 -040018298echo "$as_me:18298: result: $DFT_ARG_SUFFIX" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010018299echo "${ECHO_T}$DFT_ARG_SUFFIX" >&6
18300
micky3879b9f5e72025-07-08 18:04:53 -040018301echo "$as_me:18301: checking default library-dependency suffix" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010018302echo $ECHO_N "checking default library-dependency suffix... $ECHO_C" >&6
18303
18304 case X$DFT_LWR_MODEL in
18305 (Xlibtool)
18306 DFT_LIB_SUFFIX='.la'
18307 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
18308 ;;
18309 (Xdebug)
micky3879b9f5e72025-07-08 18:04:53 -040018310 case "$cf_cv_system_name" in
18311 (*-msvc*)
18312 DFT_LIB_SUFFIX='_g.lib'
18313 ;;
18314 (*)
18315 DFT_LIB_SUFFIX='_g.a'
18316 ;;
18317 esac
Steve Kondikae271bc2015-11-15 02:50:53 +010018318 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
18319 ;;
18320 (Xprofile)
micky3879b9f5e72025-07-08 18:04:53 -040018321 case "$cf_cv_system_name" in
18322 (*-msvc*)
18323 DFT_LIB_SUFFIX='_p.lib'
18324 ;;
18325 (*)
18326 DFT_LIB_SUFFIX='_p.a'
18327 ;;
18328 esac
Steve Kondikae271bc2015-11-15 02:50:53 +010018329 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
18330 ;;
18331 (Xshared)
micky3879b9f5e72025-07-08 18:04:53 -040018332 case "$cf_cv_system_name" in
Steve Kondikae271bc2015-11-15 02:50:53 +010018333 (aix[5-7]*)
18334 DFT_LIB_SUFFIX='.so'
18335 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
18336 ;;
micky3879b9f5e72025-07-08 18:04:53 -040018337 (*-msvc*)
18338 DFT_LIB_SUFFIX='.dll'
18339 DFT_DEP_SUFFIX='.dll.lib'
18340 ;;
Steve Kondikae271bc2015-11-15 02:50:53 +010018341 (cygwin*|msys*|mingw*)
18342 DFT_LIB_SUFFIX='.dll'
18343 DFT_DEP_SUFFIX='.dll.a'
18344 ;;
18345 (darwin*)
18346 DFT_LIB_SUFFIX='.dylib'
18347 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
18348 ;;
18349 (hpux*)
micky3879b9f5e72025-07-08 18:04:53 -040018350 case "$target" in
Steve Kondikae271bc2015-11-15 02:50:53 +010018351 (ia64*)
18352 DFT_LIB_SUFFIX='.so'
18353 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
18354 ;;
18355 (*)
18356 DFT_LIB_SUFFIX='.sl'
18357 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
18358 ;;
18359 esac
18360 ;;
18361 (*)
18362 DFT_LIB_SUFFIX='.so'
18363 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
18364 ;;
18365 esac
18366 ;;
18367 (*)
micky3879b9f5e72025-07-08 18:04:53 -040018368 case "$target" in
18369 (*-msvc*)
18370 DFT_LIB_SUFFIX='.lib'
18371 ;;
18372 (*)
18373 DFT_LIB_SUFFIX='.a'
18374 ;;
18375 esac
Steve Kondikae271bc2015-11-15 02:50:53 +010018376 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
18377 ;;
18378 esac
18379 if test -n "${LIB_SUFFIX}${EXTRA_SUFFIX}"
18380 then
18381 DFT_LIB_SUFFIX="${LIB_SUFFIX}${EXTRA_SUFFIX}${DFT_LIB_SUFFIX}"
18382 DFT_DEP_SUFFIX="${LIB_SUFFIX}${EXTRA_SUFFIX}${DFT_DEP_SUFFIX}"
18383 fi
micky3879b9f5e72025-07-08 18:04:53 -040018384echo "$as_me:18384: result: $DFT_DEP_SUFFIX" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010018385echo "${ECHO_T}$DFT_DEP_SUFFIX" >&6
18386
micky3879b9f5e72025-07-08 18:04:53 -040018387echo "$as_me:18387: checking default object directory" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010018388echo $ECHO_N "checking default object directory... $ECHO_C" >&6
18389
18390 case $DFT_LWR_MODEL in
18391 (libtool) DFT_OBJ_SUBDIR='obj_lo' ;;
18392 (normal) DFT_OBJ_SUBDIR='objects' ;;
18393 (debug) DFT_OBJ_SUBDIR='obj_g' ;;
18394 (profile) DFT_OBJ_SUBDIR='obj_p' ;;
18395 (shared)
micky3879b9f5e72025-07-08 18:04:53 -040018396 case "$cf_cv_system_name" in
Steve Kondikae271bc2015-11-15 02:50:53 +010018397 (cygwin|msys)
18398 DFT_OBJ_SUBDIR='objects' ;;
18399 (*)
18400 DFT_OBJ_SUBDIR='obj_s' ;;
18401 esac
18402 esac
micky3879b9f5e72025-07-08 18:04:53 -040018403echo "$as_me:18403: result: $DFT_OBJ_SUBDIR" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010018404echo "${ECHO_T}$DFT_OBJ_SUBDIR" >&6
18405
18406### Set up low-level terminfo dependencies for makefiles.
18407
18408if test "$DFT_LWR_MODEL" = shared ; then
18409 case $cf_cv_system_name in
18410 (cygwin*)
18411 # "lib" files have ".dll.a" suffix, "cyg" files have ".dll"
18412 ;;
18413 (msys*)
18414 # "lib" files have ".dll.a" suffix, "msys-" files have ".dll"
18415 ;;
18416 esac
18417fi
18418
micky3879b9f5e72025-07-08 18:04:53 -040018419USE_ARG_SUFFIX=${DFT_ARG_SUFFIX}
18420
18421USE_LIB_SUFFIX=${DFT_ARG_SUFFIX}
18422
Steve Kondikae271bc2015-11-15 02:50:53 +010018423USE_CFG_SUFFIX=${DFT_ARG_SUFFIX}
18424
18425### Construct the list of subdirectories for which we'll customize makefiles
18426### with the appropriate compile-rules.
18427
18428SUB_MAKEFILES="gen/adacurses${USE_ARG_SUFFIX}-config:gen/adacurses-config.in"
18429
18430cat >>confdefs.h <<EOF
18431#define NCURSES_PATHSEP '$PATH_SEPARATOR'
18432EOF
18433
Steve Kondikae271bc2015-11-15 02:50:53 +010018434################################################################################
18435
18436TEST_ARG2=
18437
18438TEST_LIBS2=
18439
18440NCURSES_SHLIB2="sh -c"
18441
18442ADA_SUBDIRS="include gen src doc"
18443if test "x$cf_with_tests" != "xno" ; then
18444 ADA_SUBDIRS="$ADA_SUBDIRS samples"
18445fi
18446for cf_dir in $ADA_SUBDIRS
18447do
18448 SUB_MAKEFILES="$SUB_MAKEFILES $cf_dir/Makefile"
18449done
18450
18451NCURSES_TREE="#"
18452
18453EXTERNAL_TREE=
18454
18455# match layout used by make-tar.sh
18456ADAHTML_DIR=../doc/ada
18457
micky3879b9f5e72025-07-08 18:04:53 -040018458if test "x$cross_compiling" = xyes ; then
18459 ADAGEN_LDFLAGS='$(CROSS_LDFLAGS)'
18460else
18461 ADAGEN_LDFLAGS='$(NATIVE_LDFLAGS)'
18462fi
18463
18464ac_config_files="$ac_config_files $SUB_MAKEFILES src/library.gpr:src/library.gpr.in doc/adacurses${DFT_ARG_SUFFIX}-config.1:doc/MKada_config.in Makefile"
Steve Kondikae271bc2015-11-15 02:50:53 +010018465ac_config_commands="$ac_config_commands default"
18466cat >confcache <<\_ACEOF
18467# This file is a shell script that caches the results of configure
18468# tests run on this system so they can be shared between configure
18469# scripts and configure runs, see configure's option --config-cache.
18470# It is not useful on other systems. If it contains results you don't
18471# want to keep, you may remove or edit it.
18472#
18473# config.status only pays attention to the cache file if you give it
18474# the --recheck option to rerun configure.
18475#
micky3879b9f5e72025-07-08 18:04:53 -040018476# `ac_cv_env_foo' variables (set or unset) will be overridden when
Steve Kondikae271bc2015-11-15 02:50:53 +010018477# loading this file, other *unset* `ac_cv_foo' will be assigned the
18478# following values.
18479
18480_ACEOF
18481
18482# The following way of writing the cache mishandles newlines in values,
18483# but we know of no workaround that is simple, portable, and efficient.
18484# So, don't put newlines in cache variables' values.
18485# Ultrix sh set writes to stderr and can't be redirected directly,
18486# and sets the high bit in the cache file unless we assign to the vars.
18487{
18488 (set) 2>&1 |
18489 case `(ac_space=' '; set | grep ac_space) 2>&1` in
18490 *ac_space=\ *)
18491 # `set' does not quote correctly, so add quotes (double-quote
18492 # substitution turns \\\\ into \\, and sed turns \\ into \).
18493 sed -n \
18494 "s/'/'\\\\''/g;
18495 s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
18496 ;;
18497 *)
18498 # `set' quotes correctly as required by POSIX, so do not add quotes.
18499 sed -n \
18500 "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
18501 ;;
18502 esac;
18503} |
18504 sed '
18505 t clear
18506 : clear
18507 s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
18508 t end
18509 /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
18510 : end' >>confcache
18511if cmp -s $cache_file confcache; then :; else
18512 if test -w $cache_file; then
18513 test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file"
18514 cat confcache >$cache_file
18515 else
18516 echo "not updating unwritable cache $cache_file"
18517 fi
18518fi
18519rm -f confcache
18520
18521test "x$prefix" = xNONE && prefix=$ac_default_prefix
18522# Let make expand exec_prefix.
18523test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
18524
18525# VPATH may cause trouble with some makes, so we remove $(srcdir),
18526# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
18527# trailing colons and then remove the whole line if VPATH becomes empty
18528# (actually we leave an empty line to preserve line numbers).
18529if test "x$srcdir" = x.; then
18530 ac_vpsub='/^[ ]*VPATH[ ]*=/{
18531s/:*\$(srcdir):*/:/;
18532s/:*\${srcdir}:*/:/;
18533s/:*@srcdir@:*/:/;
18534s/^\([^=]*=[ ]*\):*/\1/;
18535s/:*$//;
18536s/^[^=]*=[ ]*$//;
18537}'
18538fi
18539
18540DEFS=-DHAVE_CONFIG_H
18541
micky3879b9f5e72025-07-08 18:04:53 -040018542: "${CONFIG_STATUS=./config.status}"
Steve Kondikae271bc2015-11-15 02:50:53 +010018543ac_clean_files_save=$ac_clean_files
18544ac_clean_files="$ac_clean_files $CONFIG_STATUS"
micky3879b9f5e72025-07-08 18:04:53 -040018545{ echo "$as_me:18545: creating $CONFIG_STATUS" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010018546echo "$as_me: creating $CONFIG_STATUS" >&6;}
micky3879b9f5e72025-07-08 18:04:53 -040018547cat >"$CONFIG_STATUS" <<_ACEOF
Steve Kondikae271bc2015-11-15 02:50:53 +010018548#! $SHELL
18549# Generated automatically by configure.
18550# Run this file to recreate the current configuration.
18551# Compiler output produced by configure, useful for debugging
18552# configure, is in config.log if it exists.
18553
micky3879b9f5e72025-07-08 18:04:53 -040018554me=\`echo "\$0" | sed -e 's,.*\\/,,'\`
18555
Steve Kondikae271bc2015-11-15 02:50:53 +010018556debug=false
18557SHELL=\${CONFIG_SHELL-$SHELL}
18558ac_cs_invocation="\$0 \$@"
18559
micky3879b9f5e72025-07-08 18:04:53 -040018560CLICOLOR_FORCE= GREP_OPTIONS=
18561unset CLICOLOR_FORCE GREP_OPTIONS
Steve Kondikae271bc2015-11-15 02:50:53 +010018562_ACEOF
18563
micky3879b9f5e72025-07-08 18:04:53 -040018564cat >>"$CONFIG_STATUS" <<\_ACEOF
Steve Kondikae271bc2015-11-15 02:50:53 +010018565# Be Bourne compatible
18566if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
18567 emulate sh
18568 NULLCMD=:
18569elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
18570 set -o posix
18571fi
18572
18573# Name of the executable.
18574as_me=`echo "$0" |sed 's,.*[\\/],,'`
18575
18576if expr a : '\(a\)' >/dev/null 2>&1; then
micky3879b9f5e72025-07-08 18:04:53 -040018577 as_expr="expr"
Steve Kondikae271bc2015-11-15 02:50:53 +010018578else
micky3879b9f5e72025-07-08 18:04:53 -040018579 as_expr="false"
Steve Kondikae271bc2015-11-15 02:50:53 +010018580fi
18581
18582rm -f conf$$ conf$$.exe conf$$.file
18583echo >conf$$.file
18584if ln -s conf$$.file conf$$ 2>/dev/null; then
18585 # We could just check for DJGPP; but this test a) works b) is more generic
18586 # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
18587 if test -f conf$$.exe; then
18588 # Don't use ln at all; we don't have any links
18589 as_ln_s='cp -p'
18590 else
18591 as_ln_s='ln -s'
18592 fi
18593elif ln conf$$.file conf$$ 2>/dev/null; then
micky3879b9f5e72025-07-08 18:04:53 -040018594 as_ln_s='ln'
Steve Kondikae271bc2015-11-15 02:50:53 +010018595else
18596 as_ln_s='cp -p'
18597fi
18598rm -f conf$$ conf$$.exe conf$$.file
18599
18600as_executable_p="test -f"
18601
18602# Support unset when possible.
18603if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
micky3879b9f5e72025-07-08 18:04:53 -040018604 as_unset="unset"
Steve Kondikae271bc2015-11-15 02:50:53 +010018605else
micky3879b9f5e72025-07-08 18:04:53 -040018606 as_unset="false"
Steve Kondikae271bc2015-11-15 02:50:53 +010018607fi
18608
18609# NLS nuisances.
18610$as_unset LANG || test "${LANG+set}" != set || { LANG=C; export LANG; }
18611$as_unset LC_ALL || test "${LC_ALL+set}" != set || { LC_ALL=C; export LC_ALL; }
18612$as_unset LC_TIME || test "${LC_TIME+set}" != set || { LC_TIME=C; export LC_TIME; }
18613$as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set || { LC_CTYPE=C; export LC_CTYPE; }
18614$as_unset LANGUAGE || test "${LANGUAGE+set}" != set || { LANGUAGE=C; export LANGUAGE; }
18615$as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set || { LC_COLLATE=C; export LC_COLLATE; }
18616$as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set || { LC_NUMERIC=C; export LC_NUMERIC; }
18617$as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set || { LC_MESSAGES=C; export LC_MESSAGES; }
18618
18619# IFS
18620# We need space, tab and new line, in precisely that order.
18621as_nl='
18622'
18623IFS=" $as_nl"
18624
18625# CDPATH.
18626$as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=:; export CDPATH; }
18627
18628exec 6>&1
18629
18630_ACEOF
18631
18632# Files that config.status was made for.
18633if test -n "$ac_config_files"; then
micky3879b9f5e72025-07-08 18:04:53 -040018634 echo "config_files=\"$ac_config_files\"" >>"$CONFIG_STATUS"
Steve Kondikae271bc2015-11-15 02:50:53 +010018635fi
18636
18637if test -n "$ac_config_headers"; then
micky3879b9f5e72025-07-08 18:04:53 -040018638 echo "config_headers=\"$ac_config_headers\"" >>"$CONFIG_STATUS"
Steve Kondikae271bc2015-11-15 02:50:53 +010018639fi
18640
18641if test -n "$ac_config_links"; then
micky3879b9f5e72025-07-08 18:04:53 -040018642 echo "config_links=\"$ac_config_links\"" >>"$CONFIG_STATUS"
Steve Kondikae271bc2015-11-15 02:50:53 +010018643fi
18644
18645if test -n "$ac_config_commands"; then
micky3879b9f5e72025-07-08 18:04:53 -040018646 echo "config_commands=\"$ac_config_commands\"" >>"$CONFIG_STATUS"
Steve Kondikae271bc2015-11-15 02:50:53 +010018647fi
18648
micky3879b9f5e72025-07-08 18:04:53 -040018649cat >>"$CONFIG_STATUS" <<\EOF
Steve Kondikae271bc2015-11-15 02:50:53 +010018650
18651ac_cs_usage="\
18652\`$as_me' instantiates files from templates according to the
18653current configuration.
18654
18655Usage: $0 [OPTIONS] [FILE]...
18656
18657 -h, --help print this help, then exit
18658 -V, --version print version number, then exit
18659 -d, --debug don't remove temporary files
18660 --recheck update $as_me by reconfiguring in the same conditions
18661 --file=FILE[:TEMPLATE]
18662 instantiate the configuration file FILE
18663 --header=FILE[:TEMPLATE]
18664 instantiate the configuration header FILE
18665
18666Configuration files:
18667$config_files
18668
18669Configuration headers:
18670$config_headers
18671
18672Configuration commands:
18673$config_commands
18674
18675Report bugs to <dickey@invisible-island.net>."
18676EOF
18677
micky3879b9f5e72025-07-08 18:04:53 -040018678cat >>"$CONFIG_STATUS" <<EOF
Steve Kondikae271bc2015-11-15 02:50:53 +010018679ac_cs_version="\\
18680config.status
micky3879b9f5e72025-07-08 18:04:53 -040018681configured by $0, generated by GNU Autoconf 2.52.20231210,
Steve Kondikae271bc2015-11-15 02:50:53 +010018682 with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
18683
micky3879b9f5e72025-07-08 18:04:53 -040018684Copyright 2003-2022,2023 Thomas E. Dickey
Steve Kondikae271bc2015-11-15 02:50:53 +010018685Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
18686Free Software Foundation, Inc.
18687This config.status script is free software; the Free Software Foundation
18688gives unlimited permission to copy, distribute and modify it."
micky3879b9f5e72025-07-08 18:04:53 -040018689srcdir="$srcdir"
Steve Kondikae271bc2015-11-15 02:50:53 +010018690INSTALL="$INSTALL"
18691EOF
18692
micky3879b9f5e72025-07-08 18:04:53 -040018693cat >>"$CONFIG_STATUS" <<\EOF
Steve Kondikae271bc2015-11-15 02:50:53 +010018694# If no file are specified by the user, then we need to provide default
18695# value. By we need to know if files were specified by the user.
18696ac_need_defaults=:
18697while test $# != 0
18698do
18699 case $1 in
18700 --*=*)
18701 ac_option=`expr "x$1" : 'x\([^=]*\)='`
18702 ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'`
18703 shift
18704 set dummy "$ac_option" "$ac_optarg" ${1+"$@"}
18705 shift
18706 ;;
18707 -*);;
18708 *) # This is not an option, so the user has probably given explicit
18709 # arguments.
18710 ac_need_defaults=false;;
18711 esac
18712
18713 case $1 in
18714 # Handling of the options.
18715EOF
micky3879b9f5e72025-07-08 18:04:53 -040018716cat >>"$CONFIG_STATUS" <<EOF
Steve Kondikae271bc2015-11-15 02:50:53 +010018717 -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
18718 echo "running $SHELL $0 " $ac_configure_args " --no-create --no-recursion"
18719 exec $SHELL $0 $ac_configure_args --no-create --no-recursion ;;
18720EOF
micky3879b9f5e72025-07-08 18:04:53 -040018721cat >>"$CONFIG_STATUS" <<\EOF
Steve Kondikae271bc2015-11-15 02:50:53 +010018722 --version | --vers* | -V )
18723 echo "$ac_cs_version"; exit 0 ;;
18724 --he | --h)
18725 # Conflict between --help and --header
micky3879b9f5e72025-07-08 18:04:53 -040018726 { { echo "$as_me:18726: error: ambiguous option: $1
Steve Kondikae271bc2015-11-15 02:50:53 +010018727Try \`$0 --help' for more information." >&5
18728echo "$as_me: error: ambiguous option: $1
18729Try \`$0 --help' for more information." >&2;}
18730 { (exit 1); exit 1; }; };;
18731 --help | --hel | -h )
18732 echo "$ac_cs_usage"; exit 0 ;;
18733 --debug | --d* | -d )
18734 debug=: ;;
18735 --file | --fil | --fi | --f )
18736 shift
18737 CONFIG_FILES="$CONFIG_FILES $1"
18738 ac_need_defaults=false;;
18739 --header | --heade | --head | --hea )
18740 shift
18741 CONFIG_HEADERS="$CONFIG_HEADERS $1"
18742 ac_need_defaults=false;;
18743
18744 # This is an error.
micky3879b9f5e72025-07-08 18:04:53 -040018745 -*) { { echo "$as_me:18745: error: unrecognized option: $1
Steve Kondikae271bc2015-11-15 02:50:53 +010018746Try \`$0 --help' for more information." >&5
18747echo "$as_me: error: unrecognized option: $1
18748Try \`$0 --help' for more information." >&2;}
18749 { (exit 1); exit 1; }; } ;;
18750
18751 *) ac_config_targets="$ac_config_targets $1" ;;
18752
18753 esac
18754 shift
18755done
18756
18757exec 5>>config.log
18758cat >&5 << _ACEOF
18759
18760## ----------------------- ##
18761## Running config.status. ##
18762## ----------------------- ##
18763
micky3879b9f5e72025-07-08 18:04:53 -040018764This file was extended by $as_me 2.52.20231210, executed with
Steve Kondikae271bc2015-11-15 02:50:53 +010018765 CONFIG_FILES = $CONFIG_FILES
18766 CONFIG_HEADERS = $CONFIG_HEADERS
18767 CONFIG_LINKS = $CONFIG_LINKS
18768 CONFIG_COMMANDS = $CONFIG_COMMANDS
micky3879b9f5e72025-07-08 18:04:53 -040018769 > "$ac_cs_invocation"
Steve Kondikae271bc2015-11-15 02:50:53 +010018770on `(hostname || uname -n) 2>/dev/null | sed 1q`
18771
18772_ACEOF
18773EOF
18774
micky3879b9f5e72025-07-08 18:04:53 -040018775cat >>"$CONFIG_STATUS" <<EOF
Steve Kondikae271bc2015-11-15 02:50:53 +010018776#
18777# INIT-COMMANDS section.
18778#
18779
18780### Special initialization commands, used to pass information from the
18781### configuration-run into config.status
18782
18783AWK="$AWK"
18784DFT_ARG_SUFFIX="$DFT_ARG_SUFFIX"
18785DFT_LWR_MODEL="$DFT_LWR_MODEL"
18786LIB_NAME="$LIB_NAME"
18787LIB_PREFIX="$LIB_PREFIX"
18788LIB_SUFFIX="$LIB_SUFFIX"
18789LN_S="$LN_S"
18790NCURSES_MAJOR="$NCURSES_MAJOR"
18791NCURSES_MINOR="$NCURSES_MINOR"
18792NCURSES_PATCH="$NCURSES_PATCH"
micky3879b9f5e72025-07-08 18:04:53 -040018793PACKAGE="$PACKAGE"
Steve Kondikae271bc2015-11-15 02:50:53 +010018794USE_OLD_MAKERULES="$USE_OLD_MAKERULES"
micky3879b9f5e72025-07-08 18:04:53 -040018795cf_cv_VERSION_GNATMAKE=$cf_cv_VERSION_GNATMAKE
18796cf_cv_VERSION_GPRBUILD=$cf_cv_VERSION_GPRBUILD
Steve Kondikae271bc2015-11-15 02:50:53 +010018797cf_cv_abi_version="$cf_cv_abi_version"
18798cf_cv_rel_version="$cf_cv_rel_version"
18799cf_cv_rm_so_locs="$cf_cv_rm_so_locs"
18800cf_cv_shared_soname='$cf_cv_shared_soname'
18801cf_cv_shlib_version="$cf_cv_shlib_version"
18802cf_cv_shlib_version_infix="$cf_cv_shlib_version_infix"
18803cf_cv_system_name="$cf_cv_system_name"
18804host="$host"
18805target="$target"
18806
18807EOF
18808
micky3879b9f5e72025-07-08 18:04:53 -040018809cat >>"$CONFIG_STATUS" <<\EOF
Steve Kondikae271bc2015-11-15 02:50:53 +010018810for ac_config_target in $ac_config_targets
18811do
18812 case "$ac_config_target" in
18813 # Handling of arguments.
18814 "$SUB_MAKEFILES" ) CONFIG_FILES="$CONFIG_FILES $SUB_MAKEFILES" ;;
micky3879b9f5e72025-07-08 18:04:53 -040018815 "src/library.gpr" ) CONFIG_FILES="$CONFIG_FILES src/library.gpr:src/library.gpr.in" ;;
Steve Kondikae271bc2015-11-15 02:50:53 +010018816 "doc/adacurses${DFT_ARG_SUFFIX}-config.1" ) CONFIG_FILES="$CONFIG_FILES doc/adacurses${DFT_ARG_SUFFIX}-config.1:doc/MKada_config.in" ;;
18817 "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;;
18818 "default" ) CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;;
18819 "include/ncurses_cfg.h" ) CONFIG_HEADERS="$CONFIG_HEADERS include/ncurses_cfg.h:include/ncurses_cfg.hin" ;;
micky3879b9f5e72025-07-08 18:04:53 -040018820 *) { { echo "$as_me:18820: error: invalid argument: $ac_config_target" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010018821echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
18822 { (exit 1); exit 1; }; };;
18823 esac
18824done
18825
18826# If the user did not use the arguments to specify the items to instantiate,
18827# then the envvar interface is used. Set only those that are not.
18828# We use the long form for the default assignment because of an extremely
18829# bizarre bug on SunOS 4.1.3.
micky3879b9f5e72025-07-08 18:04:53 -040018830if "$ac_need_defaults"; then
Steve Kondikae271bc2015-11-15 02:50:53 +010018831 test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
18832 test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
18833 test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
18834fi
18835
18836# Create a temporary directory, and hook for its removal unless debugging.
18837$debug ||
18838{
18839 trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0
18840 trap '{ (exit 1); exit 1; }' 1 2 13 15
18841}
18842
18843# Create a (secure) tmp directory for tmp files.
micky3879b9f5e72025-07-08 18:04:53 -040018844: "${TMPDIR=/tmp}"
Steve Kondikae271bc2015-11-15 02:50:53 +010018845{
18846 tmp=`(umask 077 && mktemp -d -q "$TMPDIR/csXXXXXX") 2>/dev/null` &&
18847 test -n "$tmp" && test -d "$tmp"
18848} ||
18849{
18850 tmp=$TMPDIR/cs$$-$RANDOM
micky3879b9f5e72025-07-08 18:04:53 -040018851 (umask 077 && mkdir "$tmp")
Steve Kondikae271bc2015-11-15 02:50:53 +010018852} ||
18853{
18854 echo "$me: cannot create a temporary directory in $TMPDIR" >&2
18855 { (exit 1); exit 1; }
18856}
18857
18858EOF
18859
micky3879b9f5e72025-07-08 18:04:53 -040018860cat >>"$CONFIG_STATUS" <<EOF
Steve Kondikae271bc2015-11-15 02:50:53 +010018861
18862#
18863# CONFIG_FILES section.
18864#
18865
18866# No need to generate the scripts if there are no CONFIG_FILES.
18867# This happens for instance when ./config.status config.h
18868if test -n "\$CONFIG_FILES"; then
18869 # Protect against being on the right side of a sed subst in config.status.
18870 sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g;
micky3879b9f5e72025-07-08 18:04:53 -040018871 s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >"\$tmp"/subs.sed <<\\CEOF
Steve Kondikae271bc2015-11-15 02:50:53 +010018872s,@SHELL@,$SHELL,;t t
18873s,@exec_prefix@,$exec_prefix,;t t
18874s,@prefix@,$prefix,;t t
18875s,@program_transform_name@,$program_transform_name,;t t
18876s,@bindir@,$bindir,;t t
18877s,@sbindir@,$sbindir,;t t
18878s,@libexecdir@,$libexecdir,;t t
18879s,@datarootdir@,$datarootdir,;t t
18880s,@datadir@,$datadir,;t t
18881s,@sysconfdir@,$sysconfdir,;t t
18882s,@sharedstatedir@,$sharedstatedir,;t t
18883s,@localstatedir@,$localstatedir,;t t
micky3879b9f5e72025-07-08 18:04:53 -040018884s,@runstatedir@,$runstatedir,;t t
Steve Kondikae271bc2015-11-15 02:50:53 +010018885s,@libdir@,$libdir,;t t
18886s,@includedir@,$includedir,;t t
18887s,@oldincludedir@,$oldincludedir,;t t
18888s,@infodir@,$infodir,;t t
18889s,@mandir@,$mandir,;t t
18890s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t
18891s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t
18892s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t
18893s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t
18894s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t
18895s,@build_alias@,$build_alias,;t t
18896s,@host_alias@,$host_alias,;t t
18897s,@target_alias@,$target_alias,;t t
18898s,@ECHO_C@,$ECHO_C,;t t
18899s,@ECHO_N@,$ECHO_N,;t t
18900s,@ECHO_T@,$ECHO_T,;t t
18901s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t
18902s,@DEFS@,$DEFS,;t t
18903s,@LIBS@,$LIBS,;t t
micky3879b9f5e72025-07-08 18:04:53 -040018904s,@PACKAGE@,$PACKAGE,;t t
Steve Kondikae271bc2015-11-15 02:50:53 +010018905s,@top_builddir@,$top_builddir,;t t
18906s,@build@,$build,;t t
18907s,@build_cpu@,$build_cpu,;t t
18908s,@build_vendor@,$build_vendor,;t t
18909s,@build_os@,$build_os,;t t
18910s,@host@,$host,;t t
18911s,@host_cpu@,$host_cpu,;t t
18912s,@host_vendor@,$host_vendor,;t t
18913s,@host_os@,$host_os,;t t
18914s,@target@,$target,;t t
18915s,@target_cpu@,$target_cpu,;t t
18916s,@target_vendor@,$target_vendor,;t t
18917s,@target_os@,$target_os,;t t
micky3879b9f5e72025-07-08 18:04:53 -040018918s,@GREP@,$GREP,;t t
18919s,@FGREP@,$FGREP,;t t
Steve Kondikae271bc2015-11-15 02:50:53 +010018920s,@CC@,$CC,;t t
18921s,@CFLAGS@,$CFLAGS,;t t
18922s,@LDFLAGS@,$LDFLAGS,;t t
18923s,@CPPFLAGS@,$CPPFLAGS,;t t
18924s,@ac_ct_CC@,$ac_ct_CC,;t t
18925s,@EXEEXT@,$EXEEXT,;t t
18926s,@OBJEXT@,$OBJEXT,;t t
18927s,@EXTRA_CPPFLAGS@,$EXTRA_CPPFLAGS,;t t
18928s,@CPP@,$CPP,;t t
Steve Kondikae271bc2015-11-15 02:50:53 +010018929s,@EGREP@,$EGREP,;t t
micky3879b9f5e72025-07-08 18:04:53 -040018930s,@AWK@,$AWK,;t t
Steve Kondikae271bc2015-11-15 02:50:53 +010018931s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t
18932s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t
18933s,@INSTALL_DATA@,$INSTALL_DATA,;t t
18934s,@LN_S@,$LN_S,;t t
micky3879b9f5e72025-07-08 18:04:53 -040018935s,@INSTALL_OPT_S@,$INSTALL_OPT_S,;t t
18936s,@INSTALL_OPT_O@,$INSTALL_OPT_O,;t t
Steve Kondikae271bc2015-11-15 02:50:53 +010018937s,@PKG_CONFIG@,$PKG_CONFIG,;t t
18938s,@ac_pt_PKG_CONFIG@,$ac_pt_PKG_CONFIG,;t t
18939s,@PKG_CONFIG_LIBDIR@,$PKG_CONFIG_LIBDIR,;t t
18940s,@SET_MAKE@,$SET_MAKE,;t t
micky3879b9f5e72025-07-08 18:04:53 -040018941s,@MAKE_NO_PHONY@,$MAKE_NO_PHONY,;t t
18942s,@MAKE_PHONY@,$MAKE_PHONY,;t t
Steve Kondikae271bc2015-11-15 02:50:53 +010018943s,@CTAGS@,$CTAGS,;t t
18944s,@ETAGS@,$ETAGS,;t t
18945s,@MAKE_LOWER_TAGS@,$MAKE_LOWER_TAGS,;t t
18946s,@MAKE_UPPER_TAGS@,$MAKE_UPPER_TAGS,;t t
18947s,@cf_cv_makeflags@,$cf_cv_makeflags,;t t
18948s,@RANLIB@,$RANLIB,;t t
18949s,@ac_ct_RANLIB@,$ac_ct_RANLIB,;t t
18950s,@LD@,$LD,;t t
18951s,@ac_ct_LD@,$ac_ct_LD,;t t
18952s,@AR@,$AR,;t t
18953s,@ac_ct_AR@,$ac_ct_AR,;t t
18954s,@ARFLAGS@,$ARFLAGS,;t t
18955s,@DESTDIR@,$DESTDIR,;t t
18956s,@BUILD_CC@,$BUILD_CC,;t t
18957s,@BUILD_CPP@,$BUILD_CPP,;t t
18958s,@BUILD_CFLAGS@,$BUILD_CFLAGS,;t t
18959s,@BUILD_CPPFLAGS@,$BUILD_CPPFLAGS,;t t
18960s,@BUILD_LDFLAGS@,$BUILD_LDFLAGS,;t t
18961s,@BUILD_LIBS@,$BUILD_LIBS,;t t
18962s,@BUILD_EXEEXT@,$BUILD_EXEEXT,;t t
18963s,@BUILD_OBJEXT@,$BUILD_OBJEXT,;t t
18964s,@DFT_LWR_MODEL@,$DFT_LWR_MODEL,;t t
18965s,@DFT_UPR_MODEL@,$DFT_UPR_MODEL,;t t
18966s,@NCURSES_CONFIG@,$NCURSES_CONFIG,;t t
18967s,@ac_ct_NCURSES_CONFIG@,$ac_ct_NCURSES_CONFIG,;t t
18968s,@NCURSES_MAJOR@,$NCURSES_MAJOR,;t t
18969s,@NCURSES_MINOR@,$NCURSES_MINOR,;t t
18970s,@NCURSES_PATCH@,$NCURSES_PATCH,;t t
18971s,@cf_cv_rel_version@,$cf_cv_rel_version,;t t
18972s,@cf_cv_abi_version@,$cf_cv_abi_version,;t t
18973s,@cf_cv_builtin_bool@,$cf_cv_builtin_bool,;t t
18974s,@cf_cv_header_stdbool_h@,$cf_cv_header_stdbool_h,;t t
18975s,@cf_cv_type_of_bool@,$cf_cv_type_of_bool,;t t
18976s,@LIB_PREFIX@,$LIB_PREFIX,;t t
18977s,@LIB_SUFFIX@,$LIB_SUFFIX,;t t
18978s,@CC_G_OPT@,$CC_G_OPT,;t t
18979s,@LD_MODEL@,$LD_MODEL,;t t
18980s,@shlibdir@,$shlibdir,;t t
18981s,@MAKE_DLLS@,$MAKE_DLLS,;t t
18982s,@CC_SHARED_OPTS@,$CC_SHARED_OPTS,;t t
18983s,@LD_RPATH_OPT@,$LD_RPATH_OPT,;t t
18984s,@LD_SHARED_OPTS@,$LD_SHARED_OPTS,;t t
18985s,@MK_SHARED_LIB@,$MK_SHARED_LIB,;t t
18986s,@RM_SHARED_OPTS@,$RM_SHARED_OPTS,;t t
18987s,@LINK_PROGS@,$LINK_PROGS,;t t
18988s,@LINK_TESTS@,$LINK_TESTS,;t t
18989s,@EXTRA_LDFLAGS@,$EXTRA_LDFLAGS,;t t
18990s,@LOCAL_LDFLAGS@,$LOCAL_LDFLAGS,;t t
18991s,@LOCAL_LDFLAGS2@,$LOCAL_LDFLAGS2,;t t
18992s,@INSTALL_LIB@,$INSTALL_LIB,;t t
18993s,@RPATH_LIST@,$RPATH_LIST,;t t
18994s,@BROKEN_LINKER@,$BROKEN_LINKER,;t t
18995s,@NCURSES_EXT_FUNCS@,$NCURSES_EXT_FUNCS,;t t
18996s,@NCURSES_CONST@,$NCURSES_CONST,;t t
18997s,@PTHREAD@,$PTHREAD,;t t
18998s,@cf_cv_enable_reentrant@,$cf_cv_enable_reentrant,;t t
18999s,@NCURSES_WRAP_PREFIX@,$NCURSES_WRAP_PREFIX,;t t
19000s,@ECHO_LT@,$ECHO_LT,;t t
19001s,@ECHO_LD@,$ECHO_LD,;t t
19002s,@RULE_CC@,$RULE_CC,;t t
19003s,@SHOW_CC@,$SHOW_CC,;t t
19004s,@ECHO_CC@,$ECHO_CC,;t t
Steve Kondikae271bc2015-11-15 02:50:53 +010019005s,@EXTRA_CFLAGS@,$EXTRA_CFLAGS,;t t
micky3879b9f5e72025-07-08 18:04:53 -040019006s,@HAVE_STDNORETURN_H@,$HAVE_STDNORETURN_H,;t t
19007s,@STDC_NORETURN@,$STDC_NORETURN,;t t
19008s,@ADAFLAGS@,$ADAFLAGS,;t t
Steve Kondikae271bc2015-11-15 02:50:53 +010019009s,@ADA_TRACE@,$ADA_TRACE,;t t
micky3879b9f5e72025-07-08 18:04:53 -040019010s,@cf_TEMP_gnat@,$cf_TEMP_gnat,;t t
Steve Kondikae271bc2015-11-15 02:50:53 +010019011s,@M4_exists@,$M4_exists,;t t
19012s,@cf_ada_make@,$cf_ada_make,;t t
micky3879b9f5e72025-07-08 18:04:53 -040019013s,@cf_ada_config@,$cf_ada_config,;t t
19014s,@cf_ada_config_Ada@,$cf_ada_config_Ada,;t t
19015s,@cf_ada_config_C@,$cf_ada_config_C,;t t
Steve Kondikae271bc2015-11-15 02:50:53 +010019016s,@GNATPREP_OPTS@,$GNATPREP_OPTS,;t t
19017s,@cf_compile_generics@,$cf_compile_generics,;t t
19018s,@cf_generic_objects@,$cf_generic_objects,;t t
19019s,@USE_GNAT_SIGINT@,$USE_GNAT_SIGINT,;t t
19020s,@USE_OLD_MAKERULES@,$USE_OLD_MAKERULES,;t t
19021s,@USE_GNAT_PROJECTS@,$USE_GNAT_PROJECTS,;t t
19022s,@USE_GNAT_LIBRARIES@,$USE_GNAT_LIBRARIES,;t t
micky3879b9f5e72025-07-08 18:04:53 -040019023s,@USE_GNAT_MAKE_GPR@,$USE_GNAT_MAKE_GPR,;t t
19024s,@USE_GNAT_GPRBUILD@,$USE_GNAT_GPRBUILD,;t t
Steve Kondikae271bc2015-11-15 02:50:53 +010019025s,@cf_ada_compiler@,$cf_ada_compiler,;t t
19026s,@cf_ada_package@,$cf_ada_package,;t t
19027s,@ADA_INCLUDE@,$ADA_INCLUDE,;t t
19028s,@ADA_OBJECTS@,$ADA_OBJECTS,;t t
19029s,@ADA_SHAREDLIB@,$ADA_SHAREDLIB,;t t
19030s,@MAKE_ADA_SHAREDLIB@,$MAKE_ADA_SHAREDLIB,;t t
micky3879b9f5e72025-07-08 18:04:53 -040019031s,@ADA_LIBNAME@,$ADA_LIBNAME,;t t
Steve Kondikae271bc2015-11-15 02:50:53 +010019032s,@TINFO_LDFLAGS2@,$TINFO_LDFLAGS2,;t t
19033s,@TINFO_LIBS@,$TINFO_LIBS,;t t
19034s,@ACPPFLAGS@,$ACPPFLAGS,;t t
19035s,@DFT_ARG_SUFFIX@,$DFT_ARG_SUFFIX,;t t
19036s,@DFT_DEP_SUFFIX@,$DFT_DEP_SUFFIX,;t t
19037s,@DFT_OBJ_SUBDIR@,$DFT_OBJ_SUBDIR,;t t
micky3879b9f5e72025-07-08 18:04:53 -040019038s,@USE_ARG_SUFFIX@,$USE_ARG_SUFFIX,;t t
19039s,@USE_LIB_SUFFIX@,$USE_LIB_SUFFIX,;t t
Steve Kondikae271bc2015-11-15 02:50:53 +010019040s,@USE_CFG_SUFFIX@,$USE_CFG_SUFFIX,;t t
19041s,@TEST_ARG2@,$TEST_ARG2,;t t
19042s,@TEST_LIBS2@,$TEST_LIBS2,;t t
19043s,@NCURSES_SHLIB2@,$NCURSES_SHLIB2,;t t
19044s,@ADA_SUBDIRS@,$ADA_SUBDIRS,;t t
19045s,@NCURSES_TREE@,$NCURSES_TREE,;t t
19046s,@EXTERNAL_TREE@,$EXTERNAL_TREE,;t t
19047s,@ADAHTML_DIR@,$ADAHTML_DIR,;t t
micky3879b9f5e72025-07-08 18:04:53 -040019048s,@ADAGEN_LDFLAGS@,$ADAGEN_LDFLAGS,;t t
Steve Kondikae271bc2015-11-15 02:50:53 +010019049CEOF
19050
19051EOF
19052
micky3879b9f5e72025-07-08 18:04:53 -040019053 cat >>"$CONFIG_STATUS" <<\EOF
Steve Kondikae271bc2015-11-15 02:50:53 +010019054 # Split the substitutions into bite-sized pieces for seds with
19055 # small command number limits, like on Digital OSF/1 and HP-UX.
19056 ac_max_sed_lines=48
19057 ac_sed_frag=1 # Number of current file.
19058 ac_beg=1 # First line for current file.
19059 ac_end=$ac_max_sed_lines # Line after last line for current file.
19060 ac_more_lines=:
19061 ac_sed_cmds=
micky3879b9f5e72025-07-08 18:04:53 -040019062 while "$ac_more_lines"; do
19063 if test "$ac_beg" -gt 1; then
19064 sed "1,${ac_beg}d; ${ac_end}q" "$tmp"/subs.sed >"$tmp"/subs.frag
Steve Kondikae271bc2015-11-15 02:50:53 +010019065 else
micky3879b9f5e72025-07-08 18:04:53 -040019066 sed "${ac_end}q" "$tmp"/subs.sed >"$tmp"/subs.frag
Steve Kondikae271bc2015-11-15 02:50:53 +010019067 fi
micky3879b9f5e72025-07-08 18:04:53 -040019068 if test ! -s "$tmp"/subs.frag; then
Steve Kondikae271bc2015-11-15 02:50:53 +010019069 ac_more_lines=false
19070 else
19071 # The purpose of the label and of the branching condition is to
19072 # speed up the sed processing (if there are no `@' at all, there
19073 # is no need to browse any of the substitutions).
19074 # These are the two extra sed commands mentioned above.
19075 (echo ':t
micky3879b9f5e72025-07-08 18:04:53 -040019076 /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat "$tmp"/subs.frag) >"$tmp"/subs-$ac_sed_frag.sed
19077 # It is possible to make a multiline substitution using escaped newlines.
19078 # Ensure that we do not split the substitution between script fragments.
19079 ac_BEG=$ac_end
19080 ac_END=`expr "$ac_end" + "$ac_max_sed_lines"`
19081 sed "1,${ac_BEG}d; ${ac_END}p; q" "$tmp"/subs.sed >"$tmp"/subs.next
19082 if test -s "$tmp"/subs.next; then
19083 grep '^s,@[^@,][^@,]*@,.*\\$' "$tmp"/subs.next >"$tmp"/subs.edit
19084 if test ! -s "$tmp"/subs.edit; then
19085 grep "^s,@[^@,][^@,]*@,.*,;t t$" "$tmp"/subs.next >"$tmp"/subs.edit
19086 if test ! -s "$tmp"/subs.edit; then
19087 if test "$ac_beg" -gt 1; then
19088 ac_end=`expr "$ac_end" - 1`
19089 continue
19090 fi
19091 fi
19092 fi
Steve Kondikae271bc2015-11-15 02:50:53 +010019093 fi
micky3879b9f5e72025-07-08 18:04:53 -040019094
19095 if test -z "$ac_sed_cmds"; then
19096 ac_sed_cmds="sed -f \"$tmp\"/subs-$ac_sed_frag.sed"
19097 else
19098 ac_sed_cmds="$ac_sed_cmds | sed -f \"$tmp\"/subs-$ac_sed_frag.sed"
19099 fi
19100 ac_sed_frag=`expr "$ac_sed_frag" + 1`
Steve Kondikae271bc2015-11-15 02:50:53 +010019101 ac_beg=$ac_end
micky3879b9f5e72025-07-08 18:04:53 -040019102 ac_end=`expr "$ac_end" + "$ac_max_sed_lines"`
Steve Kondikae271bc2015-11-15 02:50:53 +010019103 fi
19104 done
19105 if test -z "$ac_sed_cmds"; then
micky3879b9f5e72025-07-08 18:04:53 -040019106 ac_sed_cmds="cat"
Steve Kondikae271bc2015-11-15 02:50:53 +010019107 fi
19108fi # test -n "$CONFIG_FILES"
19109
19110EOF
micky3879b9f5e72025-07-08 18:04:53 -040019111cat >>"$CONFIG_STATUS" <<\EOF
Steve Kondikae271bc2015-11-15 02:50:53 +010019112for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue
19113 # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
micky3879b9f5e72025-07-08 18:04:53 -040019114 case "$ac_file" in
Steve Kondikae271bc2015-11-15 02:50:53 +010019115 - | *:- | *:-:* ) # input from stdin
micky3879b9f5e72025-07-08 18:04:53 -040019116 cat >"$tmp"/stdin
Steve Kondikae271bc2015-11-15 02:50:53 +010019117 ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
19118 ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
19119 *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
19120 ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
19121 * ) ac_file_in=$ac_file.in ;;
19122 esac
19123
19124 # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories.
19125 ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
19126 X"$ac_file" : 'X\(//\)[^/]' \| \
19127 X"$ac_file" : 'X\(//\)$' \| \
19128 X"$ac_file" : 'X\(/\)' \| \
19129 . : '\(.\)' 2>/dev/null ||
19130echo X"$ac_file" |
19131 sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
19132 /^X\(\/\/\)[^/].*/{ s//\1/; q; }
19133 /^X\(\/\/\)$/{ s//\1/; q; }
19134 /^X\(\/\).*/{ s//\1/; q; }
19135 s/.*/./; q'`
19136 if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
19137 { case "$ac_dir" in
19138 [\\/]* | ?:[\\/]* ) as_incr_dir=;;
19139 *) as_incr_dir=.;;
19140esac
19141as_dummy="$ac_dir"
19142for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
19143 case $as_mkdir_dir in
19144 # Skip DOS drivespec
19145 ?:) as_incr_dir=$as_mkdir_dir ;;
19146 *)
19147 as_incr_dir=$as_incr_dir/$as_mkdir_dir
19148 test -d "$as_incr_dir" || mkdir "$as_incr_dir"
19149 ;;
19150 esac
19151done; }
19152
micky3879b9f5e72025-07-08 18:04:53 -040019153 ac_dir_suffix="/`echo "$ac_dir"|sed 's,^\./,,'`"
Steve Kondikae271bc2015-11-15 02:50:53 +010019154 # A "../" for each directory in $ac_dir_suffix.
19155 ac_dots=`echo "$ac_dir_suffix" | sed 's,/[^/]*,../,g'`
19156 else
19157 ac_dir_suffix= ac_dots=
19158 fi
19159
micky3879b9f5e72025-07-08 18:04:53 -040019160 case "$srcdir" in
Steve Kondikae271bc2015-11-15 02:50:53 +010019161 .) ac_srcdir=.
19162 if test -z "$ac_dots"; then
19163 ac_top_srcdir=.
19164 else
micky3879b9f5e72025-07-08 18:04:53 -040019165 ac_top_srcdir=`echo "$ac_dots" | sed 's,/$,,'`
Steve Kondikae271bc2015-11-15 02:50:53 +010019166 fi ;;
19167 [\\/]* | ?:[\\/]* )
micky3879b9f5e72025-07-08 18:04:53 -040019168 ac_srcdir="$srcdir$ac_dir_suffix";
19169 ac_top_srcdir="$srcdir" ;;
Steve Kondikae271bc2015-11-15 02:50:53 +010019170 *) # Relative path.
micky3879b9f5e72025-07-08 18:04:53 -040019171 ac_srcdir="$ac_dots$srcdir$ac_dir_suffix"
19172 ac_top_srcdir="$ac_dots$srcdir" ;;
Steve Kondikae271bc2015-11-15 02:50:53 +010019173 esac
19174
19175 case $INSTALL in
19176 [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
19177 *) ac_INSTALL=$ac_dots$INSTALL ;;
19178 esac
19179
19180 if test x"$ac_file" != x-; then
micky3879b9f5e72025-07-08 18:04:53 -040019181 { echo "$as_me:19181: creating $ac_file" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010019182echo "$as_me: creating $ac_file" >&6;}
19183 rm -f "$ac_file"
19184 fi
19185 # Let's still pretend it is `configure' which instantiates (i.e., don't
19186 # use $as_me), people would be surprised to read:
19187 # /* config.h. Generated automatically by config.status. */
19188 configure_input="Generated automatically from `echo $ac_file_in |
19189 sed 's,.*/,,'` by configure."
19190
19191 # First look for the input files in the build tree, otherwise in the
19192 # src tree.
19193 ac_file_inputs=`IFS=:
19194 for f in $ac_file_in; do
19195 case $f in
micky3879b9f5e72025-07-08 18:04:53 -040019196 -) echo "$tmp"/stdin ;;
Steve Kondikae271bc2015-11-15 02:50:53 +010019197 [\\/$]*)
19198 # Absolute (can't be DOS-style, as IFS=:)
micky3879b9f5e72025-07-08 18:04:53 -040019199 test -f "$f" || { { echo "$as_me:19199: error: cannot find input file: $f" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010019200echo "$as_me: error: cannot find input file: $f" >&2;}
19201 { (exit 1); exit 1; }; }
micky3879b9f5e72025-07-08 18:04:53 -040019202 echo "$f";;
Steve Kondikae271bc2015-11-15 02:50:53 +010019203 *) # Relative
19204 if test -f "$f"; then
19205 # Build tree
micky3879b9f5e72025-07-08 18:04:53 -040019206 echo "$f"
Steve Kondikae271bc2015-11-15 02:50:53 +010019207 elif test -f "$srcdir/$f"; then
19208 # Source tree
micky3879b9f5e72025-07-08 18:04:53 -040019209 echo "$srcdir/$f"
Steve Kondikae271bc2015-11-15 02:50:53 +010019210 else
19211 # /dev/null tree
micky3879b9f5e72025-07-08 18:04:53 -040019212 { { echo "$as_me:19212: error: cannot find input file: $f" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010019213echo "$as_me: error: cannot find input file: $f" >&2;}
19214 { (exit 1); exit 1; }; }
19215 fi;;
19216 esac
19217 done` || { (exit 1); exit 1; }
19218EOF
micky3879b9f5e72025-07-08 18:04:53 -040019219cat >>"$CONFIG_STATUS" <<\EOF
Steve Kondikae271bc2015-11-15 02:50:53 +010019220 ac_warn_datarootdir=no
19221 if test x"$ac_file" != x-; then
19222 for ac_item in $ac_file_inputs
19223 do
micky3879b9f5e72025-07-08 18:04:53 -040019224 ac_seen=`grep '@\(datadir\|mandir\|infodir\)@' "$ac_item"`
Steve Kondikae271bc2015-11-15 02:50:53 +010019225 if test -n "$ac_seen"; then
micky3879b9f5e72025-07-08 18:04:53 -040019226 ac_used=`grep '@datarootdir@' "$ac_item"`
Steve Kondikae271bc2015-11-15 02:50:53 +010019227 if test -z "$ac_used"; then
micky3879b9f5e72025-07-08 18:04:53 -040019228 { echo "$as_me:19228: WARNING: datarootdir was used implicitly but not set:
Steve Kondikae271bc2015-11-15 02:50:53 +010019229$ac_seen" >&5
19230echo "$as_me: WARNING: datarootdir was used implicitly but not set:
19231$ac_seen" >&2;}
19232 ac_warn_datarootdir=yes
19233 fi
19234 fi
micky3879b9f5e72025-07-08 18:04:53 -040019235 ac_seen=`grep '${datarootdir}' "$ac_item"`
Steve Kondikae271bc2015-11-15 02:50:53 +010019236 if test -n "$ac_seen"; then
micky3879b9f5e72025-07-08 18:04:53 -040019237 { echo "$as_me:19237: WARNING: datarootdir was used explicitly but not set:
Steve Kondikae271bc2015-11-15 02:50:53 +010019238$ac_seen" >&5
19239echo "$as_me: WARNING: datarootdir was used explicitly but not set:
19240$ac_seen" >&2;}
19241 ac_warn_datarootdir=yes
19242 fi
19243 done
19244 fi
19245
19246if test "x$ac_warn_datarootdir" = xyes; then
19247 ac_sed_cmds="$ac_sed_cmds | sed -e 's,@datarootdir@,\${prefix}/share,g' -e 's,\${datarootdir},\${prefix}/share,g'"
19248fi
19249
19250EOF
micky3879b9f5e72025-07-08 18:04:53 -040019251cat >>"$CONFIG_STATUS" <<EOF
Steve Kondikae271bc2015-11-15 02:50:53 +010019252 sed "$ac_vpsub
19253$extrasub
19254EOF
micky3879b9f5e72025-07-08 18:04:53 -040019255cat >>"$CONFIG_STATUS" <<\EOF
Steve Kondikae271bc2015-11-15 02:50:53 +010019256:t
19257/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
19258s,@configure_input@,$configure_input,;t t
19259s,@srcdir@,$ac_srcdir,;t t
19260s,@top_srcdir@,$ac_top_srcdir,;t t
19261s,@INSTALL@,$ac_INSTALL,;t t
micky3879b9f5e72025-07-08 18:04:53 -040019262" $ac_file_inputs | (eval "$ac_sed_cmds") >"$tmp"/out
19263 rm -f "$tmp"/stdin
19264EOF
19265test -n "${FGREP}" || FGREP="grep -F"
19266test -n "${EGREP}" || EGREP="grep -E"
19267cat >>"$CONFIG_STATUS" <<EOF
19268 test -n "\${FGREP}" || FGREP="$FGREP"
19269 test -n "\${EGREP}" || EGREP="$EGREP"
19270EOF
19271cat >>"$CONFIG_STATUS" <<\EOF
Steve Kondikae271bc2015-11-15 02:50:53 +010019272 if test x"$ac_file" != x-; then
micky3879b9f5e72025-07-08 18:04:53 -040019273 cp "$tmp/out" "$ac_file"
Steve Kondikae271bc2015-11-15 02:50:53 +010019274
19275 for ac_name in prefix exec_prefix datarootdir
19276 do
micky3879b9f5e72025-07-08 18:04:53 -040019277 ac_seen=`$FGREP -n '${'$ac_name'[:=].*}' "$ac_file"`
Steve Kondikae271bc2015-11-15 02:50:53 +010019278 if test -n "$ac_seen"; then
micky3879b9f5e72025-07-08 18:04:53 -040019279 ac_init=`$EGREP '[ ]*'$ac_name'[ ]*=' "$ac_file"`
Steve Kondikae271bc2015-11-15 02:50:53 +010019280 if test -z "$ac_init"; then
micky3879b9f5e72025-07-08 18:04:53 -040019281 ac_seen=`echo "$ac_seen" |sed -e 's,^,'"$ac_file"':,'`
19282 { echo "$as_me:19282: WARNING: Variable $ac_name is used but was not set:
Steve Kondikae271bc2015-11-15 02:50:53 +010019283$ac_seen" >&5
19284echo "$as_me: WARNING: Variable $ac_name is used but was not set:
19285$ac_seen" >&2;}
19286 fi
19287 fi
19288 done
micky3879b9f5e72025-07-08 18:04:53 -040019289 $EGREP -n '@[a-z_][a-z_0-9]+@' "$ac_file" >"$tmp"/out
19290 $EGREP -n '@[A-Z_][A-Z_0-9]+@' "$ac_file" >>"$tmp"/out
19291 if test -s "$tmp"/out; then
19292 ac_seen=`sed -e 's,^,'"$ac_file"':,' < "$tmp"/out`
19293 { echo "$as_me:19293: WARNING: Some variables may not be substituted:
Steve Kondikae271bc2015-11-15 02:50:53 +010019294$ac_seen" >&5
19295echo "$as_me: WARNING: Some variables may not be substituted:
19296$ac_seen" >&2;}
19297 fi
19298 else
micky3879b9f5e72025-07-08 18:04:53 -040019299 cat "$tmp"/out
Steve Kondikae271bc2015-11-15 02:50:53 +010019300 fi
micky3879b9f5e72025-07-08 18:04:53 -040019301 rm -f "$tmp"/out
Steve Kondikae271bc2015-11-15 02:50:53 +010019302
19303done
19304EOF
micky3879b9f5e72025-07-08 18:04:53 -040019305cat >>"$CONFIG_STATUS" <<\EOF
Steve Kondikae271bc2015-11-15 02:50:53 +010019306
19307#
19308# CONFIG_HEADER section.
19309#
19310
19311# These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
19312# NAME is the cpp macro being defined and VALUE is the value it is being given.
19313#
19314# ac_d sets the value in "#define NAME VALUE" lines.
19315ac_dA='s,^\([ ]*\)#\([ ]*define[ ][ ]*\)'
19316ac_dB='[ ].*$,\1#\2'
19317ac_dC=' '
19318ac_dD=',;t'
19319# ac_i turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
19320ac_iA='s,^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)'
19321ac_iB='\([ ]\),\1#\2define\3'
19322ac_iC=' '
19323ac_iD='\4,;t'
19324# ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
19325ac_uA='s,^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)'
19326ac_uB='$,\1#\2define\3'
19327ac_uC=' '
19328ac_uD=',;t'
19329
19330for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue
19331 # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
micky3879b9f5e72025-07-08 18:04:53 -040019332 case "$ac_file" in
Steve Kondikae271bc2015-11-15 02:50:53 +010019333 - | *:- | *:-:* ) # input from stdin
micky3879b9f5e72025-07-08 18:04:53 -040019334 cat >"$tmp"/stdin
Steve Kondikae271bc2015-11-15 02:50:53 +010019335 ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
19336 ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
19337 *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
19338 ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
19339 * ) ac_file_in=$ac_file.in ;;
19340 esac
19341
micky3879b9f5e72025-07-08 18:04:53 -040019342 test x"$ac_file" != x- && { echo "$as_me:19342: creating $ac_file" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010019343echo "$as_me: creating $ac_file" >&6;}
19344
19345 # First look for the input files in the build tree, otherwise in the
19346 # src tree.
19347 ac_file_inputs=`IFS=:
19348 for f in $ac_file_in; do
19349 case $f in
micky3879b9f5e72025-07-08 18:04:53 -040019350 -) echo "$tmp"/stdin ;;
Steve Kondikae271bc2015-11-15 02:50:53 +010019351 [\\/$]*)
19352 # Absolute (can't be DOS-style, as IFS=:)
micky3879b9f5e72025-07-08 18:04:53 -040019353 test -f "$f" || { { echo "$as_me:19353: error: cannot find input file: $f" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010019354echo "$as_me: error: cannot find input file: $f" >&2;}
19355 { (exit 1); exit 1; }; }
19356 echo $f;;
19357 *) # Relative
19358 if test -f "$f"; then
19359 # Build tree
19360 echo $f
19361 elif test -f "$srcdir/$f"; then
19362 # Source tree
micky3879b9f5e72025-07-08 18:04:53 -040019363 echo "$srcdir/$f"
Steve Kondikae271bc2015-11-15 02:50:53 +010019364 else
19365 # /dev/null tree
micky3879b9f5e72025-07-08 18:04:53 -040019366 { { echo "$as_me:19366: error: cannot find input file: $f" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010019367echo "$as_me: error: cannot find input file: $f" >&2;}
19368 { (exit 1); exit 1; }; }
19369 fi;;
19370 esac
19371 done` || { (exit 1); exit 1; }
19372 # Remove the trailing spaces.
micky3879b9f5e72025-07-08 18:04:53 -040019373 sed 's/[ ]*$//' $ac_file_inputs >"$tmp"/in
Steve Kondikae271bc2015-11-15 02:50:53 +010019374
19375EOF
19376
19377# Transform confdefs.h into a list of #define's. We won't use it as a sed
19378# script, but as data to insert where we see @DEFS@. We expect AC_SAVE_DEFS to
19379# be either 'cat' or 'sort'.
19380cat confdefs.h | uniq >conftest.vals
19381
19382# Break up conftest.vals because some shells have a limit on
19383# the size of here documents, and old seds have small limits too.
19384
19385rm -f conftest.tail
micky3879b9f5e72025-07-08 18:04:53 -040019386echo ' rm -f conftest.frag' >> "$CONFIG_STATUS"
Steve Kondikae271bc2015-11-15 02:50:53 +010019387while grep . conftest.vals >/dev/null
19388do
19389 # Write chunks of a limited-size here document to conftest.frag.
micky3879b9f5e72025-07-08 18:04:53 -040019390 echo ' cat >> conftest.frag <<CEOF' >> "$CONFIG_STATUS"
19391 sed "${ac_max_here_lines}q" conftest.vals | sed -e 's/#ifdef.*/#if 0/' >> "$CONFIG_STATUS"
19392 echo 'CEOF' >> "$CONFIG_STATUS"
19393 sed "1,${ac_max_here_lines}d" conftest.vals > conftest.tail
Steve Kondikae271bc2015-11-15 02:50:53 +010019394 rm -f conftest.vals
19395 mv conftest.tail conftest.vals
19396done
19397rm -f conftest.vals
19398
19399# Run sed to substitute the contents of conftest.frag into $tmp/in at the
19400# marker @DEFS@.
19401echo ' cat >> conftest.edit <<CEOF
19402/@DEFS@/r conftest.frag
19403/@DEFS@/d
19404CEOF
micky3879b9f5e72025-07-08 18:04:53 -040019405sed -f conftest.edit "$tmp"/in > "$tmp"/out
19406rm -f "$tmp"/in
19407mv "$tmp"/out "$tmp"/in
Steve Kondikae271bc2015-11-15 02:50:53 +010019408rm -f conftest.edit conftest.frag
micky3879b9f5e72025-07-08 18:04:53 -040019409' >> "$CONFIG_STATUS"
Steve Kondikae271bc2015-11-15 02:50:53 +010019410
micky3879b9f5e72025-07-08 18:04:53 -040019411cat >>"$CONFIG_STATUS" <<\EOF
Steve Kondikae271bc2015-11-15 02:50:53 +010019412 # Let's still pretend it is `configure' which instantiates (i.e., don't
19413 # use $as_me), people would be surprised to read:
19414 # /* config.h. Generated automatically by config.status. */
19415 if test x"$ac_file" = x-; then
micky3879b9f5e72025-07-08 18:04:53 -040019416 echo "/* Generated automatically by configure. */" >"$tmp"/config.h
Steve Kondikae271bc2015-11-15 02:50:53 +010019417 else
micky3879b9f5e72025-07-08 18:04:53 -040019418 echo "/* $ac_file. Generated automatically by configure. */" >"$tmp"/config.h
Steve Kondikae271bc2015-11-15 02:50:53 +010019419 fi
micky3879b9f5e72025-07-08 18:04:53 -040019420 cat "$tmp"/in >>"$tmp"/config.h
19421 rm -f "$tmp"/in
Steve Kondikae271bc2015-11-15 02:50:53 +010019422 if test x"$ac_file" != x-; then
micky3879b9f5e72025-07-08 18:04:53 -040019423 if cmp -s "$ac_file" "$tmp/config.h" 2>/dev/null; then
19424 { echo "$as_me:19424: $ac_file is unchanged" >&5
Steve Kondikae271bc2015-11-15 02:50:53 +010019425echo "$as_me: $ac_file is unchanged" >&6;}
19426 else
19427 ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
19428 X"$ac_file" : 'X\(//\)[^/]' \| \
19429 X"$ac_file" : 'X\(//\)$' \| \
19430 X"$ac_file" : 'X\(/\)' \| \
19431 . : '\(.\)' 2>/dev/null ||
19432echo X"$ac_file" |
19433 sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
19434 /^X\(\/\/\)[^/].*/{ s//\1/; q; }
19435 /^X\(\/\/\)$/{ s//\1/; q; }
19436 /^X\(\/\).*/{ s//\1/; q; }
19437 s/.*/./; q'`
19438 if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
19439 { case "$ac_dir" in
19440 [\\/]* | ?:[\\/]* ) as_incr_dir=;;
19441 *) as_incr_dir=.;;
19442esac
19443as_dummy="$ac_dir"
19444for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
19445 case $as_mkdir_dir in
19446 # Skip DOS drivespec
19447 ?:) as_incr_dir=$as_mkdir_dir ;;
19448 *)
19449 as_incr_dir=$as_incr_dir/$as_mkdir_dir
19450 test -d "$as_incr_dir" || mkdir "$as_incr_dir"
19451 ;;
19452 esac
19453done; }
19454
19455 fi
micky3879b9f5e72025-07-08 18:04:53 -040019456 rm -f "$ac_file"
19457 mv "$tmp/config.h" "$ac_file"
Steve Kondikae271bc2015-11-15 02:50:53 +010019458 fi
19459 else
micky3879b9f5e72025-07-08 18:04:53 -040019460 cat "$tmp"/config.h
19461 rm -f "$tmp"/config.h
Steve Kondikae271bc2015-11-15 02:50:53 +010019462 fi
19463done
19464EOF
micky3879b9f5e72025-07-08 18:04:53 -040019465cat >>"$CONFIG_STATUS" <<\EOF
Steve Kondikae271bc2015-11-15 02:50:53 +010019466#
19467# CONFIG_COMMANDS section.
19468#
19469for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue
19470 ac_dest=`echo "$ac_file" | sed 's,:.*,,'`
19471 ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'`
19472
micky3879b9f5e72025-07-08 18:04:53 -040019473 case "$ac_dest" in
Steve Kondikae271bc2015-11-15 02:50:53 +010019474 default )
micky3879b9f5e72025-07-08 18:04:53 -040019475$AWK -v PACKAGE=$PACKAGE -f $srcdir/mk-pkg.awk </dev/null >> Makefile
Steve Kondikae271bc2015-11-15 02:50:53 +010019476if test -z "$USE_OLD_MAKERULES" ; then
19477 $AWK -f $srcdir/mk-1st.awk <$srcdir/src/modules >>src/Makefile
19478fi
19479 ;;
19480 esac
19481done
19482EOF
19483
micky3879b9f5e72025-07-08 18:04:53 -040019484cat >>"$CONFIG_STATUS" <<\EOF
Steve Kondikae271bc2015-11-15 02:50:53 +010019485
19486{ (exit 0); exit 0; }
19487EOF
micky3879b9f5e72025-07-08 18:04:53 -040019488chmod +x "$CONFIG_STATUS"
Steve Kondikae271bc2015-11-15 02:50:53 +010019489ac_clean_files=$ac_clean_files_save
19490
19491# configure is writing to config.log, and then calls config.status.
19492# config.status does its own redirection, appending to config.log.
19493# Unfortunately, on DOS this fails, as config.log is still kept open
19494# by configure, so config.status won't be able to write to it; its
19495# output is simply discarded. So we exec the FD to /dev/null,
19496# effectively closing config.log, so it can be properly (re)opened and
19497# appended to by config.status. When coming back to configure, we
19498# need to make the FD available again.
19499if test "$no_create" != yes; then
19500 ac_cs_success=:
19501 exec 5>/dev/null
micky3879b9f5e72025-07-08 18:04:53 -040019502 $SHELL "$CONFIG_STATUS" || ac_cs_success=false
Steve Kondikae271bc2015-11-15 02:50:53 +010019503 exec 5>>config.log
19504 # Use ||, not &&, to avoid exiting from the if with $? = 1, which
19505 # would make configure fail if this is the last instruction.
micky3879b9f5e72025-07-08 18:04:53 -040019506 "$ac_cs_success" || { (exit 1); exit 1; }
Steve Kondikae271bc2015-11-15 02:50:53 +010019507fi
19508${MAKE:-make} preinstall