1 dnl macros used for DIALOG configure script
2 dnl $Id: aclocal.m4,v 1.150 2021/01/11 09:03:36 tom Exp $
3 dnl ---------------------------------------------------------------------------
4 dnl Copyright 1999-2020,2021 -- Thomas E. Dickey
6 dnl Permission is hereby granted, free of charge, to any person obtaining a
7 dnl copy of this software and associated documentation files (the
8 dnl "Software"), to deal in the Software without restriction, including
9 dnl without limitation the rights to use, copy, modify, merge, publish,
10 dnl distribute, distribute with modifications, sublicense, and/or sell
11 dnl copies of the Software, and to permit persons to whom the Software is
12 dnl furnished to do so, subject to the following conditions:
14 dnl The above copyright notice and this permission notice shall be included
15 dnl in all copies or portions of the Software.
17 dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
18 dnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
19 dnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
20 dnl IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
21 dnl DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
22 dnl OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR
23 dnl THE USE OR OTHER DEALINGS IN THE SOFTWARE.
25 dnl Except as contained in this notice, the name(s) of the above copyright
26 dnl holders shall not be used in advertising or otherwise to promote the
27 dnl sale, use or other dealings in this Software without prior written
31 dnl https://invisible-island.net/autoconf/
32 dnl ---------------------------------------------------------------------------
33 dnl ---------------------------------------------------------------------------
34 dnl AM_GNU_GETTEXT version: 15 updated: 2021/01/02 09:31:20
36 dnl Usage: Just like AM_WITH_NLS, which see.
37 AC_DEFUN([AM_GNU_GETTEXT],
38 [AC_REQUIRE([AC_PROG_MAKE_SET])dnl
39 AC_REQUIRE([AC_CANONICAL_HOST])dnl
40 AC_REQUIRE([AC_PROG_RANLIB])dnl
41 AC_REQUIRE([AC_HEADER_STDC])dnl
42 AC_REQUIRE([AC_C_INLINE])dnl
43 AC_REQUIRE([AC_TYPE_OFF_T])dnl
44 AC_REQUIRE([AC_TYPE_SIZE_T])dnl
45 AC_REQUIRE([AC_FUNC_ALLOCA])dnl
46 AC_REQUIRE([AC_FUNC_MMAP])dnl
47 AC_REQUIRE([jm_GLIBC21])dnl
48 AC_REQUIRE([CF_PROG_CC])dnl
50 AC_CHECK_HEADERS([argz.h limits.h locale.h nl_types.h malloc.h stddef.h \
51 stdlib.h string.h unistd.h sys/param.h])
52 AC_CHECK_FUNCS([feof_unlocked fgets_unlocked getcwd getegid geteuid \
53 getgid getuid mempcpy munmap putenv setenv setlocale stpcpy strchr strcasecmp \
54 strdup strtoul tsearch __argz_count __argz_stringify __argz_next])
59 AM_WITH_NLS([$1],[$2],[$3],[$4])
61 if test "x$CATOBJEXT" != "x"; then
62 if test "x$ALL_LINGUAS" = "x"; then
65 AC_MSG_CHECKING(for catalogs to be installed)
67 for presentlang in $ALL_LINGUAS; do
69 for desiredlang in ${LINGUAS-$ALL_LINGUAS}; do
70 # Use the presentlang catalog if desiredlang is
71 # a. equal to presentlang, or
72 # b. a variant of presentlang (because in this case,
73 # presentlang can be used as a fallback for messages
74 # which are not translated in the desiredlang catalog).
75 case "$desiredlang" in
76 ("$presentlang"*) useit=yes;;
79 if test "$useit" = yes; then
80 NEW_LINGUAS="$NEW_LINGUAS $presentlang"
84 AC_MSG_RESULT($LINGUAS)
87 dnl Construct list of names of catalog files to be constructed.
88 if test -n "$LINGUAS"; then
89 for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done
93 dnl Enable libtool support if the surrounding package wishes it.
94 INTL_LIBTOOL_SUFFIX_PREFIX=ifelse([$1], use-libtool, [l], [])
95 AC_SUBST(INTL_LIBTOOL_SUFFIX_PREFIX)
97 dnl ---------------------------------------------------------------------------
98 dnl AM_ICONV version: 12 updated: 2007/07/30 19:12:03
100 dnl Inserted as requested by gettext 0.10.40
101 dnl File from /usr/share/aclocal
103 dnl ====================
106 dnl From Bruno Haible.
108 dnl ====================
109 dnl Modified to use CF_FIND_LINKAGE and CF_ADD_SEARCHPATH, to broaden the
110 dnl range of locations searched. Retain the same cache-variable naming to
111 dnl allow reuse with the other gettext macros -Thomas E Dickey
114 dnl Some systems have iconv in libc, some have it in libiconv (OSF/1 and
115 dnl those with the standalone portable GNU libiconv installed).
117 AC_ARG_WITH([libiconv-prefix],
118 [ --with-libiconv-prefix=DIR
119 search for libiconv in DIR/include and DIR/lib], [
120 CF_ADD_OPTIONAL_PATH($withval, libiconv)
123 AC_CACHE_CHECK(for iconv, am_cv_func_iconv, [
124 CF_FIND_LINKAGE(CF__ICONV_HEAD,
127 am_cv_func_iconv=yes,
128 am_cv_func_iconv=["no, consider installing GNU libiconv"])])
130 if test "$am_cv_func_iconv" = yes; then
131 AC_DEFINE(HAVE_ICONV, 1, [Define if you have the iconv() function.])
133 AC_CACHE_CHECK([if the declaration of iconv() needs const.],
134 am_cv_proto_iconv_const,[
135 AC_TRY_COMPILE(CF__ICONV_HEAD [
140 #if defined(__STDC__) || defined(__cplusplus)
141 size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
145 ],[], am_cv_proto_iconv_const=no,
146 am_cv_proto_iconv_const=yes)])
148 if test "$am_cv_proto_iconv_const" = yes ; then
149 am_cv_proto_iconv_arg1="const"
151 am_cv_proto_iconv_arg1=""
154 AC_DEFINE_UNQUOTED(ICONV_CONST, $am_cv_proto_iconv_arg1,
155 [Define as const if the declaration of iconv() needs const.])
159 if test "$cf_cv_find_linkage_iconv" = yes; then
160 CF_ADD_INCDIR($cf_cv_header_path_iconv)
161 if test -n "$cf_cv_library_file_iconv" ; then
163 CF_ADD_LIBDIR($cf_cv_library_path_iconv)
169 dnl ---------------------------------------------------------------------------
170 dnl AM_LANGINFO_CODESET version: 6 updated: 2021/01/01 16:53:59
171 dnl -------------------
172 dnl Inserted as requested by gettext 0.10.40
173 dnl File from /usr/share/aclocal
175 dnl ====================
178 dnl From Bruno Haible.
179 AC_DEFUN([AM_LANGINFO_CODESET],
181 AC_CACHE_CHECK([for nl_langinfo and CODESET], am_cv_langinfo_codeset,
182 [AC_TRY_LINK([#include <langinfo.h>],
183 [char* cs = nl_langinfo(CODESET); (void)cs],
184 am_cv_langinfo_codeset=yes,
185 am_cv_langinfo_codeset=no)
187 if test "$am_cv_langinfo_codeset" = yes; then
188 AC_DEFINE(HAVE_LANGINFO_CODESET, 1,
189 [Define if you have <langinfo.h> and nl_langinfo(CODESET).])
192 dnl ---------------------------------------------------------------------------
193 dnl AM_LC_MESSAGES version: 6 updated: 2021/01/02 09:31:20
195 dnl Inserted as requested by gettext 0.10.40
196 dnl File from /usr/share/aclocal
198 dnl ====================
199 dnl Check whether LC_MESSAGES is available in <locale.h>.
200 dnl Ulrich Drepper <drepper@cygnus.com>, 1995.
202 dnl This file can be copied and used freely without restrictions. It can
203 dnl be used in projects which are not available under the GNU General Public
204 dnl License or the GNU Library General Public License but which still want
205 dnl to provide support for the GNU gettext functionality.
206 dnl Please note that the actual code of the GNU gettext library is covered
207 dnl by the GNU Library General Public License, and the rest of the GNU
208 dnl gettext package package is covered by the GNU General Public License.
209 dnl They are *not* in the public domain.
213 AC_DEFUN([AM_LC_MESSAGES],
214 [if test "$ac_cv_header_locale_h" = yes; then
215 AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES,
216 [AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
217 am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)])
218 if test "$am_cv_val_LC_MESSAGES" = yes; then
219 AC_DEFINE(HAVE_LC_MESSAGES, 1,
220 [Define if your <locale.h> file defines LC_MESSAGES.])
223 dnl ---------------------------------------------------------------------------
224 dnl AM_PATH_PROG_WITH_TEST version: 10 updated: 2021/01/02 09:31:20
225 dnl ----------------------
226 dnl Inserted as requested by gettext 0.10.40
227 dnl File from /usr/share/aclocal
229 dnl ====================
230 dnl Search path for a program which passes the given test.
231 dnl Ulrich Drepper <drepper@cygnus.com>, 1996.
233 dnl This file can be copied and used freely without restrictions. It can
234 dnl be used in projects which are not available under the GNU General Public
235 dnl License or the GNU Library General Public License but which still want
236 dnl to provide support for the GNU gettext functionality.
237 dnl Please note that the actual code of the GNU gettext library is covered
238 dnl by the GNU Library General Public License, and the rest of the GNU
239 dnl gettext package package is covered by the GNU General Public License.
240 dnl They are *not* in the public domain.
244 dnl AM_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR,
245 dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
246 AC_DEFUN([AM_PATH_PROG_WITH_TEST],
247 [# Extract the first word of "$2", so it can be a program name with args.
248 AC_REQUIRE([CF_PATHSEP])
249 set dummy $2; ac_word=[$]2
250 AC_MSG_CHECKING([for $ac_word])
251 AC_CACHE_VAL(ac_cv_path_$1,
254 ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
257 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR}"
258 for ac_dir in ifelse([$5], , $PATH, [$5]); do
259 test -z "$ac_dir" && ac_dir=.
260 if test -f "$ac_dir/$ac_word$ac_exeext" ; then
262 ac_cv_path_$1="$ac_dir/$ac_word$ac_exeext"
268 dnl If no 4th arg is given, leave the cache variable unset,
269 dnl so AC_PATH_PROGS will keep looking.
270 ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
275 if test ifelse([$4], , [-n "[$]$1"], ["[$]$1" != "$4"]); then
282 dnl ---------------------------------------------------------------------------
283 dnl AM_WITH_NLS version: 31 updated: 2021/01/04 17:48:08
285 dnl Inserted as requested by gettext 0.10.40
286 dnl File from /usr/share/aclocal
288 dnl ====================
289 dnl Macro to add for using GNU gettext.
290 dnl Ulrich Drepper <drepper@cygnus.com>, 1995.
291 dnl ====================
292 dnl Modified to use CF_FIND_LINKAGE and CF_ADD_SEARCHPATH, to broaden the
293 dnl range of locations searched. Retain the same cache-variable naming to
294 dnl allow reuse with the other gettext macros -Thomas E Dickey
295 dnl ====================
297 dnl This file can be copied and used freely without restrictions. It can
298 dnl be used in projects which are not available under the GNU General Public
299 dnl License or the GNU Library General Public License but which still want
300 dnl to provide support for the GNU gettext functionality.
301 dnl Please note that the actual code of the GNU gettext library is covered
302 dnl by the GNU Library General Public License, and the rest of the GNU
303 dnl gettext package package is covered by the GNU General Public License.
304 dnl They are *not* in the public domain.
308 dnl Usage: AM_WITH_NLS([TOOLSYMBOL], [NEEDSYMBOL], [LIBDIR], [ENABLED]).
309 dnl If TOOLSYMBOL is specified and is 'use-libtool', then a libtool library
310 dnl $(top_builddir)/intl/libintl.la will be created (shared and/or static,
311 dnl depending on --{enable,disable}-{shared,static} and on the presence of
312 dnl AM-DISABLE-SHARED). Otherwise, a static library
313 dnl $(top_builddir)/intl/libintl.a will be created.
314 dnl If NEEDSYMBOL is specified and is 'need-ngettext', then GNU gettext
315 dnl implementations (in libc or libintl) without the ngettext() function
317 dnl LIBDIR is used to find the intl libraries. If empty,
318 dnl the value `$(top_builddir)/intl/' is used.
319 dnl ENABLED is used to control the default for the related --enable-nls, since
320 dnl not all application developers want this feature by default, e.g., lynx.
322 dnl The result of the configuration is one of three cases:
323 dnl 1) GNU gettext, as included in the intl subdirectory, will be compiled
325 dnl Catalog format: GNU --> install in $(datadir)
326 dnl Catalog extension: .mo after installation, .gmo in source tree
327 dnl 2) GNU gettext has been found in the system's C library.
328 dnl Catalog format: GNU --> install in $(datadir)
329 dnl Catalog extension: .mo after installation, .gmo in source tree
330 dnl 3) No internationalization, always use English msgid.
331 dnl Catalog format: none
332 dnl Catalog extension: none
333 dnl The use of .gmo is historical (it was needed to avoid overwriting the
334 dnl GNU format catalogs when building on a platform with an X/Open gettext),
335 dnl but we keep it in order not to force irrelevant filename changes on the
338 AC_DEFUN([AM_WITH_NLS],
339 [AC_MSG_CHECKING([whether NLS is requested])
340 dnl Default is enabled NLS
343 [ --disable-nls do not use Native Language Support],
344 USE_NLS=$enableval, USE_NLS=yes)],[
346 [ --enable-nls use Native Language Support],
347 USE_NLS=$enableval, USE_NLS=no)])
348 AC_MSG_RESULT($USE_NLS)
351 BUILD_INCLUDED_LIBINTL=no
352 USE_INCLUDED_LIBINTL=no
355 dnl If we use NLS figure out what method
356 if test "$USE_NLS" = "yes"; then
357 dnl We need to process the po/ directory.
359 AC_DEFINE(ENABLE_NLS, 1,
360 [Define to 1 if translation of program messages to the user's native language
362 AC_MSG_CHECKING([whether included gettext is requested])
363 AC_ARG_WITH(included-gettext,
364 [ --with-included-gettext use the GNU gettext library included here],
365 nls_cv_force_use_gnu_gettext=$withval,
366 nls_cv_force_use_gnu_gettext=no)
367 AC_MSG_RESULT($nls_cv_force_use_gnu_gettext)
369 nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext"
370 if test "$nls_cv_force_use_gnu_gettext" != "yes"; then
371 dnl User does not insist on using GNU NLS library. Figure out what
372 dnl to use. If GNU gettext is available we use this. Else we may have
373 dnl to fall back to GNU NLS library.
376 dnl Save these (possibly-set) variables for reference. If the user
377 dnl overrode these to provide full pathnames, then warn if not actually
378 dnl GNU gettext, but do not override their values. Also, if they were
379 dnl overridden, suppress the part of the library test which prevents it
380 dnl from finding anything other than GNU gettext. Doing this also
381 dnl suppresses a bogus search for the intl library.
382 cf_save_msgfmt_path="$MSGFMT"
383 cf_save_xgettext_path="$XGETTEXT"
385 dnl Search for GNU msgfmt in the PATH.
386 AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
387 ["$ac_dir/$ac_word" --statistics /dev/null >/dev/null 2>&1], :)
388 AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
391 dnl Search for GNU xgettext in the PATH.
392 AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
393 ["$ac_dir/$ac_word" --omit-header /dev/null >/dev/null 2>&1], :)
395 cf_save_OPTS_1="$CPPFLAGS"
396 if test "x$cf_save_msgfmt_path" = "x$MSGFMT" && \
397 test "x$cf_save_xgettext_path" = "x$XGETTEXT" ; then
398 CF_ADD_CFLAGS(-DIGNORE_MSGFMT_HACK)
401 cf_save_LIBS_1="$LIBS"
402 CF_ADD_LIBS($LIBICONV)
404 CF_FIND_LINKAGE(CF__INTL_HEAD,
407 cf_cv_func_gettext=yes,
408 cf_cv_func_gettext=no)
410 AC_MSG_CHECKING([for libintl.h and gettext()])
411 AC_MSG_RESULT($cf_cv_func_gettext)
413 LIBS="$cf_save_LIBS_1"
414 CPPFLAGS="$cf_save_OPTS_1"
416 if test "$cf_cv_func_gettext" = yes ; then
417 AC_DEFINE(HAVE_LIBINTL_H,1,[Define to 1 if we have libintl.h])
419 dnl If an already present or preinstalled GNU gettext() is found,
420 dnl use it. But if this macro is used in GNU gettext, and GNU
421 dnl gettext is already preinstalled in libintl, we update this
422 dnl libintl. (Cf. the install rule in intl/Makefile.in.)
423 if test "$PACKAGE" != gettext; then
424 AC_DEFINE(HAVE_GETTEXT, 1,
425 [Define if the GNU gettext() function is already present or preinstalled.])
427 CF_ADD_INCDIR($cf_cv_header_path_intl)
429 if test -n "$cf_cv_library_file_intl" ; then
430 dnl If iconv() is in a separate libiconv library, then anyone
431 dnl linking with libintl{.a,.so} also needs to link with
433 INTLLIBS="$cf_cv_library_file_intl $LIBICONV"
434 CF_ADD_LIBDIR($cf_cv_library_path_intl,INTLLIBS)
438 LIBS="$LIBS $INTLLIBS"
439 AC_CHECK_FUNCS(dcgettext)
444 elif test -z "$MSGFMT" || test -z "$XGETTEXT" ; then
445 AC_MSG_WARN(disabling NLS feature)
446 sed -e /ENABLE_NLS/d confdefs.h >confdefs.tmp
447 mv confdefs.tmp confdefs.h
454 BUILD_INCLUDED_LIBINTL=no
455 USE_INCLUDED_LIBINTL=no
457 nls_cv_use_gnu_gettext=no
460 if test "$CATOBJEXT" = "NONE"; then
461 dnl GNU gettext is not found in the C library.
462 dnl Fall back on GNU gettext library.
463 nls_cv_use_gnu_gettext=maybe
467 if test "$nls_cv_use_gnu_gettext" != "no"; then
469 if test -f "$srcdir/intl/libintl.h" ; then
470 dnl Mark actions used to generate GNU NLS library.
471 INTLOBJS="\$(GETTOBJS)"
472 BUILD_INCLUDED_LIBINTL=yes
473 USE_INCLUDED_LIBINTL=yes
474 INTLLIBS="ifelse([$3],[],\$(top_builddir)/intl,[$3])/libintl.ifelse([$1], use-libtool, [l], [])a $LIBICONV"
475 LIBS=`echo " $LIBS " | sed -e 's/ -lintl / /' -e 's/^ //' -e 's/ $//'`
476 elif test "$nls_cv_use_gnu_gettext" = "yes"; then
477 nls_cv_use_gnu_gettext=no
478 AC_MSG_WARN(no NLS library is packaged with this application)
482 dnl Test whether we really found GNU msgfmt.
483 if test "$GMSGFMT" != ":"; then
484 if $GMSGFMT --statistics /dev/null >/dev/null 2>&1; then
487 AC_MSG_WARN([found msgfmt program is not GNU msgfmt])
491 dnl Test whether we really found GNU xgettext.
492 if test "$XGETTEXT" != ":"; then
493 if $XGETTEXT --omit-header /dev/null >/dev/null 2>&1; then
496 AC_MSG_WARN([found xgettext program is not GNU xgettext])
501 if test "$XGETTEXT" != ":"; then
503 [for ac_file in $CONFIG_FILES; do
505 # Support "outfile[:infile[:infile...]]"
507 (*:*) ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
510 # PO directories have a Makefile.in generated from Makefile.inn.
513 # Adjust a relative srcdir.
514 ac_dir="`echo "$ac_file"|sed 's%/[^/][^/]*$%%'`"
515 ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`"
516 ac_dots="`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'`"
517 ac_base="`basename $ac_file .in`"
518 # In autoconf-2.13 it is called $ac_given_srcdir.
519 # In autoconf-2.50 it is called $srcdir.
520 test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir"
522 case "$ac_given_srcdir" in
523 (.) top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;;
524 (/*) top_srcdir="$ac_given_srcdir" ;;
525 (*) top_srcdir="$ac_dots$ac_given_srcdir" ;;
528 if test -f "$ac_given_srcdir/$ac_dir/POTFILES.in"; then
529 rm -f "$ac_dir/POTFILES"
530 test -n "$as_me" && echo "$as_me: creating $ac_dir/POTFILES" || echo "creating $ac_dir/POTFILES"
531 sed -e "/^#/d" -e "/^[ ]*\$/d" -e "s,.*, $top_srcdir/& \\\\," -e "\$s/\(.*\) \\\\/\1/" < "$ac_given_srcdir/$ac_dir/POTFILES.in" > "$ac_dir/POTFILES"
532 test -n "$as_me" && echo "$as_me: creating $ac_dir/$ac_base" || echo "creating $ac_dir/$ac_base"
533 sed -e "/POTFILES =/r $ac_dir/POTFILES" "$ac_dir/$ac_base.in" > "$ac_dir/$ac_base"
539 dnl If this is used in GNU gettext we have to set BUILD_INCLUDED_LIBINTL
540 dnl to 'yes' because some of the testsuite requires it.
541 if test "$PACKAGE" = gettext; then
542 BUILD_INCLUDED_LIBINTL=yes
545 dnl intl/plural.c is generated from intl/plural.y. It requires bison,
546 dnl because plural.y uses bison specific features. It requires at least
547 dnl bison-1.26 because earlier versions generate a plural.c that doesn't
549 dnl bison is only needed for the maintainer (who touches plural.y). But in
550 dnl order to avoid separate Makefiles or --enable-maintainer-mode, we put
551 dnl the rule in general Makefile. Now, some people carelessly touch the
552 dnl files or have a broken "make" program, hence the plural.c rule will
553 dnl sometimes fire. To avoid an error, defines BISON to ":" if it is not
554 dnl present or too old.
555 if test "$nls_cv_use_gnu_gettext" = "yes"; then
556 AC_CHECK_PROGS([INTLBISON], [bison])
557 if test -z "$INTLBISON"; then
560 dnl Found it, now check the version.
561 AC_MSG_CHECKING([version of bison])
562 changequote(<<,>>)dnl
563 ac_prog_version=`$INTLBISON --version 2>&1 | sed -n 's/^.*GNU Bison.* \([0-9]*\.[0-9.]*\).*$/\1/p'`
564 case "$ac_prog_version" in
565 ('') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;;
566 (1.2[6-9]*|1.[3-9][0-9]*|[2-9].*)
568 ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;;
569 (*) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;;
571 AC_MSG_RESULT([$ac_prog_version])
573 if test "$ac_verc_fail" = yes; then
578 dnl These rules are solely for the distribution goal. While doing this
579 dnl we only have to keep exactly one list of the available catalogs
581 for lang in $ALL_LINGUAS; do
582 GMOFILES="$GMOFILES $lang.gmo"
583 POFILES="$POFILES $lang.po"
587 dnl Make all variables we use known to autoconf.
588 AC_SUBST(BUILD_INCLUDED_LIBINTL)
589 AC_SUBST(USE_INCLUDED_LIBINTL)
598 dnl For backward compatibility. Some configure.ins may be using this.
602 dnl For backward compatibility. Some Makefiles may be using this.
604 AC_SUBST(DATADIRNAME)
606 dnl For backward compatibility. Some Makefiles may be using this.
610 dnl For backward compatibility. Some Makefiles may be using this.
614 dnl ---------------------------------------------------------------------------
615 dnl CF_ACVERSION_CHECK version: 5 updated: 2014/06/04 19:11:49
616 dnl ------------------
617 dnl Conditionally generate script according to whether we're using a given autoconf.
619 dnl $1 = version to compare against
620 dnl $2 = code to use if AC_ACVERSION is at least as high as $1.
621 dnl $3 = code to use if AC_ACVERSION is older than $1.
622 define([CF_ACVERSION_CHECK],
624 ifdef([AC_ACVERSION], ,[ifdef([AC_AUTOCONF_VERSION],[m4_copy([AC_AUTOCONF_VERSION],[AC_ACVERSION])],[m4_copy([m4_PACKAGE_VERSION],[AC_ACVERSION])])])dnl
625 ifdef([m4_version_compare],
626 [m4_if(m4_version_compare(m4_defn([AC_ACVERSION]), [$1]), -1, [$3], [$2])],
627 [CF_ACVERSION_COMPARE(
628 AC_PREREQ_CANON(AC_PREREQ_SPLIT([$1])),
629 AC_PREREQ_CANON(AC_PREREQ_SPLIT(AC_ACVERSION)), AC_ACVERSION, [$2], [$3])])])dnl
630 dnl ---------------------------------------------------------------------------
631 dnl CF_ACVERSION_COMPARE version: 3 updated: 2012/10/03 18:39:53
632 dnl --------------------
633 dnl CF_ACVERSION_COMPARE(MAJOR1, MINOR1, TERNARY1,
634 dnl MAJOR2, MINOR2, TERNARY2,
635 dnl PRINTABLE2, not FOUND, FOUND)
636 define([CF_ACVERSION_COMPARE],
637 [ifelse(builtin([eval], [$2 < $5]), 1,
638 [ifelse([$8], , ,[$8])],
639 [ifelse([$9], , ,[$9])])])dnl
640 dnl ---------------------------------------------------------------------------
641 dnl CF_ADD_CFLAGS version: 15 updated: 2020/12/31 10:54:15
643 dnl Copy non-preprocessor flags to $CFLAGS, preprocessor flags to $CPPFLAGS
644 dnl $1 = flags to add
645 dnl $2 = if given makes this macro verbose.
647 dnl Put any preprocessor definitions that use quoted strings in $EXTRA_CPPFLAGS,
648 dnl to simplify use of $CPPFLAGS in compiler checks, etc., that are easily
649 dnl confused by the quotes (which require backslashes to keep them usable).
650 AC_DEFUN([CF_ADD_CFLAGS],
655 cf_new_extra_cppflags=
657 for cf_add_cflags in $1
659 case "$cf_fix_cppflags" in
661 case "$cf_add_cflags" in
662 (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
663 case "$cf_add_cflags" in
665 cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[[^=]]*='\''\"[[^"]]*//'`
667 test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
668 && test -z "${cf_tst_cflags}" \
669 && cf_fix_cppflags=yes
671 if test "$cf_fix_cppflags" = yes ; then
672 CF_APPEND_TEXT(cf_new_extra_cppflags,$cf_add_cflags)
674 elif test "${cf_tst_cflags}" = "\"'" ; then
675 CF_APPEND_TEXT(cf_new_extra_cppflags,$cf_add_cflags)
684 case "$cf_add_cflags" in
686 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
687 CF_REMOVE_DEFINE(CPPFLAGS,$CPPFLAGS,$cf_tst_cppflags)
690 CF_APPEND_TEXT(cf_new_cppflags,$cf_add_cflags)
695 CF_APPEND_TEXT(cf_new_cflags,$cf_add_cflags)
700 CF_APPEND_TEXT(cf_new_extra_cppflags,$cf_add_cflags)
702 cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[[^"]]*"'\''//'`
704 test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
705 && test -z "${cf_tst_cflags}" \
706 && cf_fix_cppflags=no
711 if test -n "$cf_new_cflags" ; then
712 ifelse([$2],,,[CF_VERBOSE(add to \$CFLAGS $cf_new_cflags)])
713 CF_APPEND_TEXT(CFLAGS,$cf_new_cflags)
716 if test -n "$cf_new_cppflags" ; then
717 ifelse([$2],,,[CF_VERBOSE(add to \$CPPFLAGS $cf_new_cppflags)])
718 CF_APPEND_TEXT(CPPFLAGS,$cf_new_cppflags)
721 if test -n "$cf_new_extra_cppflags" ; then
722 ifelse([$2],,,[CF_VERBOSE(add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags)])
723 CF_APPEND_TEXT(EXTRA_CPPFLAGS,$cf_new_extra_cppflags)
726 AC_SUBST(EXTRA_CPPFLAGS)
729 dnl ---------------------------------------------------------------------------
730 dnl CF_ADD_INCDIR version: 16 updated: 2020/12/31 20:19:42
732 dnl Add an include-directory to $CPPFLAGS. Don't add /usr/include, since it's
733 dnl redundant. We don't normally need to add -I/usr/local/include for gcc,
734 dnl but old versions (and some misinstalled ones) need that. To make things
735 dnl worse, gcc 3.x may give error messages if -I/usr/local/include is added to
736 dnl the include-path).
737 AC_DEFUN([CF_ADD_INCDIR],
739 if test -n "$1" ; then
740 for cf_add_incdir in $1
742 while test "$cf_add_incdir" != /usr/include
744 if test -d "$cf_add_incdir"
747 if test -n "$CFLAGS$CPPFLAGS" ; then
748 # a loop is needed to ensure we can add subdirs of existing dirs
749 for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
750 if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
751 cf_have_incdir=yes; break
756 if test "$cf_have_incdir" = no ; then
757 if test "$cf_add_incdir" = /usr/local/include ; then
760 cf_save_CPPFLAGS=$CPPFLAGS
761 CF_APPEND_TEXT(CPPFLAGS,-I$cf_add_incdir)
762 AC_TRY_COMPILE([#include <stdio.h>],
765 [cf_have_incdir=yes])
766 CPPFLAGS=$cf_save_CPPFLAGS
771 if test "$cf_have_incdir" = no ; then
772 CF_VERBOSE(adding $cf_add_incdir to include-path)
773 ifelse([$2],,CPPFLAGS,[$2])="$ifelse([$2],,CPPFLAGS,[$2]) -I$cf_add_incdir"
775 cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
776 test "$cf_top_incdir" = "$cf_add_incdir" && break
777 cf_add_incdir="$cf_top_incdir"
788 dnl ---------------------------------------------------------------------------
789 dnl CF_ADD_LIB version: 2 updated: 2010/06/02 05:03:05
791 dnl Add a library, used to enforce consistency.
793 dnl $1 = library to add, without the "-l"
794 dnl $2 = variable to update (default $LIBS)
795 AC_DEFUN([CF_ADD_LIB],[CF_ADD_LIBS(-l$1,ifelse($2,,LIBS,[$2]))])dnl
796 dnl ---------------------------------------------------------------------------
797 dnl CF_ADD_LIBDIR version: 11 updated: 2020/12/31 20:19:42
799 dnl Adds to the library-path
801 dnl Some machines have trouble with multiple -L options.
803 dnl $1 is the (list of) directory(s) to add
804 dnl $2 is the optional name of the variable to update (default LDFLAGS)
806 AC_DEFUN([CF_ADD_LIBDIR],
808 if test -n "$1" ; then
809 for cf_add_libdir in $1
811 if test "$cf_add_libdir" = /usr/lib ; then
813 elif test -d "$cf_add_libdir"
816 if test -n "$LDFLAGS$LIBS" ; then
817 # a loop is needed to ensure we can add subdirs of existing dirs
818 for cf_test_libdir in $LDFLAGS $LIBS ; do
819 if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
820 cf_have_libdir=yes; break
824 if test "$cf_have_libdir" = no ; then
825 CF_VERBOSE(adding $cf_add_libdir to library-path)
826 ifelse([$2],,LDFLAGS,[$2])="-L$cf_add_libdir $ifelse([$2],,LDFLAGS,[$2])"
832 dnl ---------------------------------------------------------------------------
833 dnl CF_ADD_LIBS version: 3 updated: 2019/11/02 16:47:33
835 dnl Add one or more libraries, used to enforce consistency. Libraries are
836 dnl prepended to an existing list, since their dependencies are assumed to
837 dnl already exist in the list.
839 dnl $1 = libraries to add, with the "-l", etc.
840 dnl $2 = variable to update (default $LIBS)
841 AC_DEFUN([CF_ADD_LIBS],[
842 cf_add_libs="[$]ifelse($2,,LIBS,[$2])"
845 for cf_add_1lib in $1; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
847 for cf_add_1lib in $cf_add_0lib; do
848 for cf_add_2lib in $cf_add_libs; do
849 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
854 test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
856 ifelse($2,,LIBS,[$2])="$cf_add_libs"
858 dnl ---------------------------------------------------------------------------
859 dnl CF_ADD_LIB_AFTER version: 3 updated: 2013/07/09 21:27:22
861 dnl Add a given library after another, e.g., following the one it satisfies a
864 dnl $1 = the first library
865 dnl $2 = its dependency
866 AC_DEFUN([CF_ADD_LIB_AFTER],[
867 CF_VERBOSE(...before $LIBS)
868 LIBS=`echo "$LIBS" | sed -e "s/[[ ]][[ ]]*/ /g" -e "s%$1 %$1 $2 %" -e 's% % %g'`
869 CF_VERBOSE(...after $LIBS)
871 dnl ---------------------------------------------------------------------------
872 dnl CF_ADD_OPTIONAL_PATH version: 3 updated: 2015/05/10 19:52:14
873 dnl --------------------
874 dnl Add an optional search-path to the compile/link variables.
877 dnl $1 = shell variable containing the result of --with-XXX=[DIR]
878 dnl $2 = module to look for.
879 AC_DEFUN([CF_ADD_OPTIONAL_PATH],[
886 CF_ADD_SEARCHPATH([$1], [AC_MSG_ERROR(cannot find $2 under $1)])
890 dnl ---------------------------------------------------------------------------
891 dnl CF_ADD_SEARCHPATH version: 6 updated: 2020/12/31 20:19:42
892 dnl -----------------
893 dnl Set $CPPFLAGS and $LDFLAGS with the directories given via the parameter.
894 dnl They can be either the common root of include- and lib-directories, or the
895 dnl lib-directory (to allow for things like lib64 directories).
896 dnl See also CF_FIND_LINKAGE.
898 dnl $1 is the list of colon-separated directory names to search.
899 dnl $2 is the action to take if a parameter does not yield a directory.
900 AC_DEFUN([CF_ADD_SEARCHPATH],
902 AC_REQUIRE([CF_PATHSEP])
903 for cf_searchpath in `echo "$1" | tr $PATH_SEPARATOR ' '`; do
904 if test -d "$cf_searchpath/include" ; then
905 CF_ADD_INCDIR($cf_searchpath/include)
906 elif test -d "$cf_searchpath/../include" ; then
907 CF_ADD_INCDIR($cf_searchpath/../include)
911 if test -d "$cf_searchpath/lib" ; then
912 CF_ADD_LIBDIR($cf_searchpath/lib)
913 elif test -d "$cf_searchpath" ; then
914 CF_ADD_LIBDIR($cf_searchpath)
920 dnl ---------------------------------------------------------------------------
921 dnl CF_ADD_SUBDIR_PATH version: 5 updated: 2020/12/31 20:19:42
922 dnl ------------------
923 dnl Append to a search-list for a nonstandard header/lib-file
924 dnl $1 = the variable to return as result
925 dnl $2 = the package name
926 dnl $3 = the subdirectory, e.g., bin, include or lib
927 dnl $4 = the directory under which we will test for subdirectories
928 dnl $5 = a directory that we do not want $4 to match
929 AC_DEFUN([CF_ADD_SUBDIR_PATH],
931 test "x$4" != "x$5" && \
933 ifelse([$5],NONE,,[{ test -z "$5" || test "x$5" = xNONE || test "x$4" != "x$5"; } &&]) {
934 test -n "$verbose" && echo " ... testing for $3-directories under $4"
935 test -d "$4/$3" && $1="[$]$1 $4/$3"
936 test -d "$4/$3/$2" && $1="[$]$1 $4/$3/$2"
937 test -d "$4/$3/$2/$3" && $1="[$]$1 $4/$3/$2/$3"
938 test -d "$4/$2/$3" && $1="[$]$1 $4/$2/$3"
939 test -d "$4/$2/$3/$2" && $1="[$]$1 $4/$2/$3/$2"
942 dnl ---------------------------------------------------------------------------
943 dnl CF_APPEND_TEXT version: 1 updated: 2017/02/25 18:58:55
945 dnl use this macro for appending text without introducing an extra blank at
947 define([CF_APPEND_TEXT],
949 test -n "[$]$1" && $1="[$]$1 "
952 dnl ---------------------------------------------------------------------------
953 dnl CF_ARG_DISABLE version: 3 updated: 1999/03/30 17:24:31
955 dnl Allow user to disable a normally-on option.
956 AC_DEFUN([CF_ARG_DISABLE],
957 [CF_ARG_OPTION($1,[$2],[$3],[$4],yes)])dnl
958 dnl ---------------------------------------------------------------------------
959 dnl CF_ARG_ENABLE version: 3 updated: 1999/03/30 17:24:31
961 dnl Allow user to enable a normally-off option.
962 AC_DEFUN([CF_ARG_ENABLE],
963 [CF_ARG_OPTION($1,[$2],[$3],[$4],no)])dnl
964 dnl ---------------------------------------------------------------------------
965 dnl CF_ARG_MSG_ENABLE version: 2 updated: 2000/07/29 19:32:03
966 dnl -----------------
967 dnl Verbose form of AC_ARG_ENABLE:
973 dnl $4 = action to perform if option is enabled
974 dnl $5 = action if perform if option is disabled
975 dnl $6 = default option value (either 'yes' or 'no')
976 AC_DEFUN([CF_ARG_MSG_ENABLE],[
978 AC_ARG_ENABLE($2,[$3],,enableval=ifelse($6,,no,$6))
979 AC_MSG_RESULT($enableval)
980 if test "$enableval" != no ; then
986 dnl ---------------------------------------------------------------------------
987 dnl CF_ARG_OPTION version: 5 updated: 2015/05/10 19:52:14
989 dnl Restricted form of AC_ARG_ENABLE that ensures user doesn't give bogus
995 dnl $3 = action to perform if option is not default
996 dnl $4 = action if perform if option is default
997 dnl $5 = default option value (either 'yes' or 'no')
998 AC_DEFUN([CF_ARG_OPTION],
999 [AC_ARG_ENABLE([$1],[$2],[test "$enableval" != ifelse([$5],no,yes,no) && enableval=ifelse([$5],no,no,yes)
1000 if test "$enableval" != "$5" ; then
1001 ifelse([$3],,[ :]dnl
1002 ,[ $3]) ifelse([$4],,,[
1005 fi],[enableval=$5 ifelse([$4],,,[
1009 dnl ---------------------------------------------------------------------------
1010 dnl CF_AR_FLAGS version: 9 updated: 2021/01/01 13:31:04
1012 dnl Check for suitable "ar" (archiver) options for updating an archive.
1014 dnl In particular, handle some obsolete cases where the "-" might be omitted,
1015 dnl as well as a workaround for breakage of make's archive rules by the GNU
1016 dnl binutils "ar" program.
1017 AC_DEFUN([CF_AR_FLAGS],[
1018 AC_REQUIRE([CF_PROG_AR])
1020 AC_CACHE_CHECK(for options to update archives, cf_cv_ar_flags,[
1021 case "$cf_cv_system_name" in
1024 cat >mk_static_lib.sh <<-EOF
1029 exec \[$]MSVC_BIN -out:"\[$]out" \[$]@
1031 chmod +x mk_static_lib.sh
1032 AR=`pwd`/mk_static_lib.sh
1035 cf_cv_ar_flags=unknown
1036 for cf_ar_flags in -curvU -curv curv -crv crv -cqv cqv -rv rv
1039 # check if $ARFLAGS already contains this choice
1040 if test "x$ARFLAGS" != "x" ; then
1041 cf_check_ar_flags=`echo "x$ARFLAGS" | sed -e "s/$cf_ar_flags\$//" -e "s/$cf_ar_flags / /"`
1042 if test "x$ARFLAGS" != "$cf_check_ar_flags" ; then
1048 rm -f "conftest.$ac_cv_objext"
1051 cat >"conftest.$ac_ext" <<EOF
1052 #line __oline__ "configure"
1053 int testdata[[3]] = { 123, 456, 789 };
1055 if AC_TRY_EVAL(ac_compile) ; then
1056 echo "$AR $ARFLAGS $cf_ar_flags conftest.a conftest.$ac_cv_objext" >&AC_FD_CC
1057 $AR $ARFLAGS "$cf_ar_flags" conftest.a "conftest.$ac_cv_objext" 2>&AC_FD_CC 1>/dev/null
1058 if test -f conftest.a ; then
1059 cf_cv_ar_flags="$cf_ar_flags"
1063 CF_VERBOSE(cannot compile test-program)
1067 rm -f conftest.a "conftest.$ac_ext" "conftest.$ac_cv_objext"
1072 if test -n "$ARFLAGS" ; then
1073 if test -n "$cf_cv_ar_flags" ; then
1074 ARFLAGS="$ARFLAGS $cf_cv_ar_flags"
1077 ARFLAGS=$cf_cv_ar_flags
1082 dnl ---------------------------------------------------------------------------
1083 dnl CF_BUNDLED_INTL version: 20 updated: 2021/01/02 09:31:20
1085 dnl Top-level macro for configuring an application with a bundled copy of
1086 dnl the intl and po directories for gettext.
1088 dnl $1 specifies either Makefile or makefile, defaulting to the former.
1089 dnl $2 if nonempty sets the option to --enable-nls rather than to --disable-nls
1091 dnl Sets variables which can be used to substitute in makefiles:
1092 dnl GT_YES - "#" comment unless building intl library, otherwise empty
1093 dnl GT_NO - "#" comment if building intl library, otherwise empty
1094 dnl INTLDIR_MAKE - to make ./intl directory
1095 dnl MSG_DIR_MAKE - to make ./po directory
1096 dnl SUB_MAKEFILE - list of makefiles in ./intl, ./po directories
1099 dnl HAVE_LIBGETTEXT_H if we're using ./intl
1103 dnl ALL_LINGUAS if set, lists the root names of the ".po" files.
1104 dnl CONFIG_H assumed to be "config.h"
1105 dnl PACKAGE must be set, used as default for textdomain
1106 dnl VERSION may be set, otherwise extract from "VERSION" file.
1108 AC_DEFUN([CF_BUNDLED_INTL],[
1109 cf_makefile=ifelse($1,,Makefile,$1)
1111 dnl Set of available languages (based on source distribution). Note that
1112 dnl setting $LINGUAS overrides $ALL_LINGUAS. Some environments set $LINGUAS
1113 dnl rather than $LC_ALL
1114 test -z "$ALL_LINGUAS" && ALL_LINGUAS=`test -d "$srcdir/po" && cd "$srcdir/po" && echo *.po|sed -e 's/\.po//g' -e 's/*//'`
1116 # Allow override of "config.h" definition:
1117 : ${CONFIG_H:=config.h}
1120 if test -z "$PACKAGE" ; then
1121 AC_MSG_ERROR([[CF_BUNDLED_INTL] used without setting [PACKAGE] variable])
1124 if test -z "$VERSION" ; then
1125 if test -f "$srcdir/VERSION" ; then
1126 VERSION=`sed -e '2,$d' "$srcdir/VERSION" |cut -f1`
1133 AM_GNU_GETTEXT(,,,[$2])
1135 if test "$USE_NLS" = yes ; then
1136 AC_ARG_WITH(textdomain,
1137 [ --with-textdomain=PKG NLS text-domain (default is package name)],
1138 [NLS_TEXTDOMAIN=$withval],
1139 [NLS_TEXTDOMAIN=$PACKAGE])
1140 AC_DEFINE_UNQUOTED(NLS_TEXTDOMAIN,"$NLS_TEXTDOMAIN",[Define to the nls textdomain value])
1141 AC_SUBST(NLS_TEXTDOMAIN)
1148 dnl this updates SUB_MAKEFILE and MSG_DIR_MAKE:
1151 if test "$USE_INCLUDED_LIBINTL" = yes ; then
1152 if test "$nls_cv_force_use_gnu_gettext" = yes ; then
1154 elif test "$nls_cv_use_gnu_gettext" = yes ; then
1159 if test -z "$INTLDIR_MAKE"; then
1160 AC_DEFINE(HAVE_LIBGETTEXT_H,1,[Define to 1 if we have libgettext.h])
1161 for cf_makefile in \
1162 $srcdir/intl/Makefile.in \
1163 $srcdir/intl/makefile.in
1165 if test -f "$cf_makefile" ; then
1166 SUB_MAKEFILE="$SUB_MAKEFILE `echo \"${cf_makefile}\"|sed -e 's,^'$srcdir/',,' -e 's/\.in$//'`:${cf_makefile}"
1173 if test "$USE_NLS" = yes ; then
1174 AC_CHECK_HEADERS(libintl.h)
1178 if test -z "$INTLDIR_MAKE" ; then
1179 CF_APPEND_TEXT(CPPFLAGS,-I../intl)
1182 dnl FIXME: we use this in lynx (the alternative is a spurious dependency upon
1184 if test "$BUILD_INCLUDED_LIBINTL" = yes ; then
1192 AC_SUBST(INTLDIR_MAKE)
1193 AC_SUBST(MSG_DIR_MAKE)
1197 dnl FIXME: the underlying AM_GNU_GETTEXT macro either needs some fixes or a
1198 dnl little documentation. It doesn't define anything so that we can ifdef our
1199 dnl own code, except ENABLE_NLS, which is too vague to be of any use.
1201 if test "$USE_INCLUDED_LIBINTL" = yes ; then
1202 if test "$nls_cv_force_use_gnu_gettext" = yes ; then
1203 AC_DEFINE(HAVE_GETTEXT,1,[Define to 1 if we have gettext function])
1204 elif test "$nls_cv_use_gnu_gettext" = yes ; then
1205 AC_DEFINE(HAVE_GETTEXT,1,[Define to 1 if we have gettext function])
1207 if test -n "$nls_cv_header_intl" ; then
1208 AC_DEFINE(HAVE_LIBINTL_H,1,[Define to 1 if we have header-file for libintl])
1212 dnl ---------------------------------------------------------------------------
1213 dnl CF_CC_ENV_FLAGS version: 10 updated: 2020/12/31 18:40:20
1215 dnl Check for user's environment-breakage by stuffing CFLAGS/CPPFLAGS content
1216 dnl into CC. This will not help with broken scripts that wrap the compiler
1217 dnl with options, but eliminates a more common category of user confusion.
1219 dnl In particular, it addresses the problem of being able to run the C
1220 dnl preprocessor in a consistent manner.
1222 dnl Caveat: this also disallows blanks in the pathname for the compiler, but
1223 dnl the nuisance of having inconsistent settings for compiler and preprocessor
1224 dnl outweighs that limitation.
1225 AC_DEFUN([CF_CC_ENV_FLAGS],
1227 # This should have been defined by AC_PROG_CC
1230 AC_MSG_CHECKING(\$CFLAGS variable)
1233 AC_MSG_RESULT(broken)
1234 AC_MSG_WARN(your environment uses the CFLAGS variable to hold CPPFLAGS options)
1237 for cf_arg in $cf_flags
1239 CF_ADD_CFLAGS($cf_arg)
1247 AC_MSG_CHECKING(\$CC variable)
1250 AC_MSG_RESULT(broken)
1251 AC_MSG_WARN(your environment uses the CC variable to hold CFLAGS/CPPFLAGS options)
1253 cf_prog=`echo "$CC" | sed -e 's/ / /g' -e 's/[[ ]]* / /g' -e 's/[[ ]]*[[ ]]-[[^ ]].*//'`
1254 cf_flags=`echo "$CC" | ${AWK:-awk} -v prog="$cf_prog" '{ printf("%s", [substr]([$]0,1+length(prog))); }'`
1256 for cf_arg in $cf_flags
1260 CF_ADD_CFLAGS($cf_arg)
1267 CF_VERBOSE(resulting CC: '$CC')
1268 CF_VERBOSE(resulting CFLAGS: '$CFLAGS')
1269 CF_VERBOSE(resulting CPPFLAGS: '$CPPFLAGS')
1276 dnl ---------------------------------------------------------------------------
1277 dnl CF_CHECK_CACHE version: 13 updated: 2020/12/31 10:54:15
1279 dnl Check if we're accidentally using a cache from a different machine.
1280 dnl Derive the system name, as a check for reusing the autoconf cache.
1282 dnl If we've packaged config.guess and config.sub, run that (since it does a
1283 dnl better job than uname). Normally we'll use AC_CANONICAL_HOST, but allow
1284 dnl an extra parameter that we may override, e.g., for AC_CANONICAL_SYSTEM
1285 dnl which is useful in cross-compiles.
1287 dnl Note: we would use $ac_config_sub, but that is one of the places where
1288 dnl autoconf 2.5x broke compatibility with autoconf 2.13
1289 AC_DEFUN([CF_CHECK_CACHE],
1291 if test -f "$srcdir/config.guess" || test -f "$ac_aux_dir/config.guess" ; then
1292 ifelse([$1],,[AC_CANONICAL_HOST],[$1])
1293 system_name="$host_os"
1295 system_name="`(uname -s -r) 2>/dev/null`"
1296 if test -z "$system_name" ; then
1297 system_name="`(hostname) 2>/dev/null`"
1300 test -n "$system_name" && AC_DEFINE_UNQUOTED(SYSTEM_NAME,"$system_name",[Define to the system name.])
1301 AC_CACHE_VAL(cf_cv_system_name,[cf_cv_system_name="$system_name"])
1303 test -z "$system_name" && system_name="$cf_cv_system_name"
1304 test -n "$cf_cv_system_name" && AC_MSG_RESULT(Configuring for $cf_cv_system_name)
1306 if test ".$system_name" != ".$cf_cv_system_name" ; then
1307 AC_MSG_RESULT(Cached system name ($system_name) does not agree with actual ($cf_cv_system_name))
1308 AC_MSG_ERROR("Please remove config.cache and try again.")
1311 dnl ---------------------------------------------------------------------------
1312 dnl CF_CHECK_CFLAGS version: 4 updated: 2021/01/02 19:22:58
1314 dnl Conditionally add to $CFLAGS and $CPPFLAGS values which are derived from
1315 dnl a build-configuration such as imake. These have the pitfall that they
1316 dnl often contain compiler-specific options which we cannot use, mixed with
1317 dnl preprocessor options that we usually can.
1318 AC_DEFUN([CF_CHECK_CFLAGS],
1320 CF_VERBOSE(checking additions to CFLAGS)
1321 cf_check_cflags="$CFLAGS"
1322 cf_check_cppflags="$CPPFLAGS"
1323 CF_ADD_CFLAGS($1,yes)
1324 if test "x$cf_check_cflags" != "x$CFLAGS" ; then
1325 AC_TRY_LINK([#include <stdio.h>],[printf("Hello world");],,
1326 [CF_VERBOSE(test-compile failed. Undoing change to \$CFLAGS)
1327 if test "x$cf_check_cppflags" != "x$CPPFLAGS" ; then
1328 CF_VERBOSE(but keeping change to \$CPPFLAGS)
1330 CFLAGS="$cf_check_cflags"])
1333 dnl ---------------------------------------------------------------------------
1334 dnl CF_CHECK_LIBTOOL_VERSION version: 1 updated: 2013/04/06 18:03:09
1335 dnl ------------------------
1336 dnl Show the version of libtool
1338 dnl Save the version in a cache variable - this is not entirely a good thing,
1339 dnl but the version string from libtool is very ugly, and for bug reports it
1340 dnl might be useful to have the original string.
1341 AC_DEFUN([CF_CHECK_LIBTOOL_VERSION],[
1342 if test -n "$LIBTOOL" && test "$LIBTOOL" != none
1344 AC_MSG_CHECKING(version of $LIBTOOL)
1346 AC_MSG_RESULT($cf_cv_libtool_version)
1347 if test -z "$cf_cv_libtool_version" ; then
1348 AC_MSG_ERROR(This is not GNU libtool)
1351 AC_MSG_ERROR(GNU libtool has not been found)
1354 dnl ---------------------------------------------------------------------------
1355 dnl CF_CLANG_COMPILER version: 8 updated: 2021/01/01 13:31:04
1356 dnl -----------------
1357 dnl Check if the given compiler is really clang. clang's C driver defines
1358 dnl __GNUC__ (fooling the configure script into setting $GCC to yes) but does
1359 dnl not ignore some gcc options.
1361 dnl This macro should be run "soon" after AC_PROG_CC or AC_PROG_CPLUSPLUS, to
1362 dnl ensure that it is not mistaken for gcc/g++. It is normally invoked from
1363 dnl the wrappers for gcc and g++ warnings.
1365 dnl $1 = GCC (default) or GXX
1366 dnl $2 = CLANG_COMPILER (default)
1367 dnl $3 = CFLAGS (default) or CXXFLAGS
1368 AC_DEFUN([CF_CLANG_COMPILER],[
1369 ifelse([$2],,CLANG_COMPILER,[$2])=no
1371 if test "$ifelse([$1],,[$1],GCC)" = yes ; then
1372 AC_MSG_CHECKING(if this is really Clang ifelse([$1],GXX,C++,C) compiler)
1373 cf_save_CFLAGS="$ifelse([$3],,CFLAGS,[$3])"
1379 ],[ifelse([$2],,CLANG_COMPILER,[$2])=yes
1381 ifelse([$3],,CFLAGS,[$3])="$cf_save_CFLAGS"
1382 AC_MSG_RESULT($ifelse([$2],,CLANG_COMPILER,[$2]))
1387 if test "x$ifelse([$2],,CLANG_COMPILER,[$2])" = "xyes" ; then
1389 (c[[1-9]][[0-9]]|*/c[[1-9]][[0-9]])
1390 AC_MSG_WARN(replacing broken compiler alias $CC)
1391 CFLAGS="$CFLAGS -std=`echo "$CC" | sed -e 's%.*/%%'`"
1396 AC_MSG_CHECKING(version of $CC)
1397 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.]].*//'`"
1398 test -z "$CLANG_VERSION" && CLANG_VERSION=unknown
1399 AC_MSG_RESULT($CLANG_VERSION)
1401 for cf_clang_opt in \
1402 -Qunused-arguments \
1403 -Wno-error=implicit-function-declaration
1405 AC_MSG_CHECKING(if option $cf_clang_opt works)
1406 cf_save_CFLAGS="$CFLAGS"
1407 CFLAGS="$CFLAGS $cf_clang_opt"
1409 #include <stdio.h>],[
1410 printf("hello!\\n");],[
1411 cf_clang_optok=yes],[
1413 AC_MSG_RESULT($cf_clang_optok)
1414 CFLAGS="$cf_save_CFLAGS"
1415 if test "$cf_clang_optok" = yes; then
1416 CF_VERBOSE(adding option $cf_clang_opt)
1417 CF_APPEND_TEXT(CFLAGS,$cf_clang_opt)
1422 dnl ---------------------------------------------------------------------------
1423 dnl CF_CONST_X_STRING version: 6 updated: 2021/01/01 13:31:04
1424 dnl -----------------
1425 dnl The X11R4-X11R6 Xt specification uses an ambiguous String type for most
1426 dnl character-strings.
1428 dnl It is ambiguous because the specification accommodated the pre-ANSI
1429 dnl compilers bundled by more than one vendor in lieu of providing a standard C
1430 dnl compiler other than by costly add-ons. Because of this, the specification
1431 dnl did not take into account the use of const for telling the compiler that
1432 dnl string literals would be in readonly memory.
1434 dnl As a workaround, one could (starting with X11R5) define XTSTRINGDEFINES, to
1435 dnl let the compiler decide how to represent Xt's strings which were #define'd.
1436 dnl That does not solve the problem of using the block of Xt's strings which
1437 dnl are compiled into the library (and is less efficient than one might want).
1439 dnl Xt specification 7 introduces the _CONST_X_STRING symbol which is used both
1440 dnl when compiling the library and compiling using the library, to tell the
1441 dnl compiler that String is const.
1442 AC_DEFUN([CF_CONST_X_STRING],
1444 AC_REQUIRE([AC_PATH_XTRA])
1446 CF_SAVE_XTRA_FLAGS([CF_CONST_X_STRING])
1451 #include <X11/Intrinsic.h>
1453 [String foo = malloc(1); (void)foo],[
1455 AC_CACHE_CHECK(for X11/Xt const-feature,cf_cv_const_x_string,[
1458 #define _CONST_X_STRING /* X11R7.8 (perhaps) */
1459 #undef XTSTRINGDEFINES /* X11R5 and later */
1461 #include <X11/Intrinsic.h>
1462 ],[String foo = malloc(1); *foo = 0],[
1463 cf_cv_const_x_string=no
1465 cf_cv_const_x_string=yes
1469 CF_RESTORE_XTRA_FLAGS([CF_CONST_X_STRING])
1471 case "$cf_cv_const_x_string" in
1473 CF_APPEND_TEXT(CPPFLAGS,-DXTSTRINGDEFINES)
1476 CF_APPEND_TEXT(CPPFLAGS,-D_CONST_X_STRING)
1482 dnl ---------------------------------------------------------------------------
1483 dnl CF_CURSES_CHTYPE version: 11 updated: 2021/01/02 09:31:20
1484 dnl ----------------
1485 dnl Test if curses defines 'chtype' (usually a 'long' type for SysV curses).
1486 AC_DEFUN([CF_CURSES_CHTYPE],
1488 AC_REQUIRE([CF_CURSES_CPPFLAGS])dnl
1489 AC_CACHE_CHECK(for chtype typedef,cf_cv_chtype_decl,[
1490 AC_TRY_COMPILE([#include <${cf_cv_ncurses_header:-curses.h}>],
1491 [chtype foo; (void)foo],
1492 [cf_cv_chtype_decl=yes],
1493 [cf_cv_chtype_decl=no])])
1494 if test "$cf_cv_chtype_decl" = yes ; then
1495 AC_DEFINE(HAVE_TYPE_CHTYPE,1,[Define to 1 if chtype is declared])
1496 AC_CACHE_CHECK(if chtype is scalar or struct,cf_cv_chtype_type,[
1497 AC_TRY_COMPILE([#include <${cf_cv_ncurses_header:-curses.h}>],
1498 [static chtype foo; long x = foo; (void)x],
1499 [cf_cv_chtype_type=scalar],
1500 [cf_cv_chtype_type=struct])])
1501 if test "$cf_cv_chtype_type" = scalar ; then
1502 AC_DEFINE(TYPE_CHTYPE_IS_SCALAR,1,[Define to 1 if chtype is a scaler/integer])
1506 dnl ---------------------------------------------------------------------------
1507 dnl CF_CURSES_CONFIG version: 2 updated: 2006/10/29 11:06:27
1508 dnl ----------------
1509 dnl Tie together the configure-script macros for curses. It may be ncurses,
1510 dnl but unless asked, we do not make a special search for ncurses. However,
1511 dnl still check for the ncurses version number, for use in other macros.
1512 AC_DEFUN([CF_CURSES_CONFIG],
1518 dnl ---------------------------------------------------------------------------
1519 dnl CF_CURSES_CPPFLAGS version: 14 updated: 2021/01/02 09:31:20
1520 dnl ------------------
1521 dnl Look for the curses headers.
1522 AC_DEFUN([CF_CURSES_CPPFLAGS],[
1524 AC_CACHE_CHECK(for extra include directories,cf_cv_curses_incdir,[
1525 cf_cv_curses_incdir=no
1528 if test "x$cf_cv_screen" = "xcurses_colr"
1530 test -d /usr/include/curses_colr && \
1531 cf_cv_curses_incdir="-I/usr/include/curses_colr"
1535 if test "x$cf_cv_screen" = "xcurses_5lib"
1537 test -d /usr/5lib && \
1538 test -d /usr/5include && \
1539 cf_cv_curses_incdir="-I/usr/5include"
1544 if test "$cf_cv_curses_incdir" != no
1546 CF_APPEND_TEXT(CPPFLAGS,$cf_cv_curses_incdir)
1552 dnl ---------------------------------------------------------------------------
1553 dnl CF_CURSES_EXIT version: 1 updated: 2020/03/26 19:15:16
1555 dnl Check for ncurses memory-leak/debug feature. Starting with ncurses 6.2,
1556 dnl the curses_exit() function is always present, simplifying linkage changes
1557 dnl when switching to/from a debug-library.
1558 AC_DEFUN([CF_CURSES_EXIT],
1565 dnl ---------------------------------------------------------------------------
1566 dnl CF_CURSES_FUNCS version: 20 updated: 2020/12/31 20:19:42
1568 dnl Curses-functions are a little complicated, since a lot of them are macros.
1569 AC_DEFUN([CF_CURSES_FUNCS],
1571 AC_REQUIRE([CF_CURSES_CPPFLAGS])dnl
1572 AC_REQUIRE([CF_XOPEN_CURSES])
1573 AC_REQUIRE([CF_CURSES_TERM_H])
1574 AC_REQUIRE([CF_CURSES_UNCTRL_H])
1577 CF_UPPER(cf_tr_func,$cf_func)
1578 AC_MSG_CHECKING(for ${cf_func})
1579 CF_MSG_LOG(${cf_func})
1580 AC_CACHE_VAL(cf_cv_func_$cf_func,[
1581 eval cf_result='$ac_cv_func_'$cf_func
1582 if test ".$cf_result" != ".no"; then
1583 AC_TRY_LINK(CF__CURSES_HEAD,
1586 long foo = (long)(&${cf_func});
1587 fprintf(stderr, "testing linkage of $cf_func:%p\\n", (void *)foo);
1588 if (foo + 1234L > 5678L)
1589 ${cf_cv_main_return:-return}(foo != 0);
1595 eval 'cf_cv_func_'$cf_func'="$cf_result"'
1597 # use the computed/retrieved cache-value:
1598 eval 'cf_result=$cf_cv_func_'$cf_func
1599 AC_MSG_RESULT($cf_result)
1600 if test "$cf_result" != no; then
1601 AC_DEFINE_UNQUOTED(HAVE_${cf_tr_func})
1605 dnl ---------------------------------------------------------------------------
1606 dnl CF_CURSES_HEADER version: 5 updated: 2015/04/23 20:35:30
1607 dnl ----------------
1608 dnl Find a "curses" header file, e.g,. "curses.h", or one of the more common
1609 dnl variations of ncurses' installs.
1611 dnl $1 = ncurses when looking for ncurses, or is empty
1612 AC_DEFUN([CF_CURSES_HEADER],[
1613 AC_CACHE_CHECK(if we have identified curses headers,cf_cv_ncurses_header,[
1614 cf_cv_ncurses_header=none
1616 ncurses.h ifelse($1,,,[$1/ncurses.h]) \
1617 curses.h ifelse($1,,,[$1/curses.h]) ifelse($1,,[ncurses/ncurses.h ncurses/curses.h])
1619 AC_TRY_COMPILE([#include <${cf_header}>],
1620 [initscr(); tgoto("?", 0,0)],
1621 [cf_cv_ncurses_header=$cf_header; break],[])
1625 if test "$cf_cv_ncurses_header" = none ; then
1626 AC_MSG_ERROR(No curses header-files found)
1629 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
1630 AC_CHECK_HEADERS($cf_cv_ncurses_header)
1632 dnl ---------------------------------------------------------------------------
1633 dnl CF_CURSES_LIBS version: 44 updated: 2021/01/02 09:31:20
1635 dnl Look for the curses libraries. Older curses implementations may require
1636 dnl termcap/termlib to be linked as well. Call CF_CURSES_CPPFLAGS first.
1637 AC_DEFUN([CF_CURSES_LIBS],[
1639 AC_REQUIRE([CF_CURSES_CPPFLAGS])dnl
1640 AC_MSG_CHECKING(if we have identified curses libraries)
1641 AC_TRY_LINK([#include <${cf_cv_ncurses_header:-curses.h}>],
1642 [initscr(); tgoto("?", 0,0)],
1645 AC_MSG_RESULT($cf_result)
1647 if test "$cf_result" = no ; then
1650 AC_CHECK_LIB(mytinfo,tgoto,[CF_ADD_LIBS(-lmytinfo)])
1653 # Looking at HPUX 10.20, the Hcurses library is the oldest (1997), cur_colr
1654 # next (1998), and xcurses "newer" (2000). There is no header file for
1655 # Hcurses; the subdirectory curses_colr has the headers (curses.h and
1656 # term.h) for cur_colr
1657 if test "x$cf_cv_screen" = "xcurses_colr"
1659 AC_CHECK_LIB(cur_colr,initscr,[
1660 CF_ADD_LIBS(-lcur_colr)
1661 ac_cv_func_initscr=yes
1663 AC_CHECK_LIB(Hcurses,initscr,[
1664 # HP's header uses __HP_CURSES, but user claims _HP_CURSES.
1665 CF_ADD_LIBS(-lHcurses)
1666 CF_APPEND_TEXT(CPPFLAGS,-D__HP_CURSES -D_HP_CURSES)
1667 ac_cv_func_initscr=yes
1672 case `arch 2>/dev/null` in
1676 CF_ADD_LIBDIR(/lib64)
1687 if test "x$cf_cv_screen" = "xcurses_5lib"
1689 if test -d /usr/5lib ; then
1690 CF_ADD_LIBDIR(/usr/5lib)
1691 CF_ADD_LIBS(-lcurses -ltermcap)
1694 ac_cv_func_initscr=yes
1698 if test ".$ac_cv_func_initscr" != .yes ; then
1699 cf_save_LIBS="$LIBS"
1701 if test ".${cf_cv_ncurses_version:-no}" != .no
1703 cf_check_list="ncurses curses cursesX"
1705 cf_check_list="cursesX curses ncurses"
1708 # Check for library containing tgoto. Do this before curses library
1709 # because it may be needed to link the test-case for initscr.
1710 if test "x$cf_term_lib" = x
1712 AC_CHECK_FUNC(tgoto,[cf_term_lib=predefined],[
1713 for cf_term_lib in $cf_check_list otermcap termcap tinfo termlib unknown
1715 AC_CHECK_LIB($cf_term_lib,tgoto,[
1716 : "${cf_nculib_root:=$cf_term_lib}"
1723 # Check for library containing initscr
1724 test "$cf_term_lib" != predefined && test "$cf_term_lib" != unknown && LIBS="-l$cf_term_lib $cf_save_LIBS"
1725 if test "x$cf_curs_lib" = x
1727 for cf_curs_lib in $cf_check_list xcurses jcurses pdcurses unknown
1729 LIBS="-l$cf_curs_lib $cf_save_LIBS"
1730 if test "$cf_term_lib" = unknown || test "$cf_term_lib" = "$cf_curs_lib" ; then
1731 AC_MSG_CHECKING(if we can link with $cf_curs_lib library)
1732 AC_TRY_LINK([#include <${cf_cv_ncurses_header:-curses.h}>],
1736 AC_MSG_RESULT($cf_result)
1737 test "$cf_result" = yes && break
1738 elif test "$cf_curs_lib" = "$cf_term_lib" ; then
1740 elif test "$cf_term_lib" != predefined ; then
1741 AC_MSG_CHECKING(if we need both $cf_curs_lib and $cf_term_lib libraries)
1742 AC_TRY_LINK([#include <${cf_cv_ncurses_header:-curses.h}>],
1743 [initscr(); tgoto((char *)0, 0, 0);],
1746 LIBS="-l$cf_curs_lib -l$cf_term_lib $cf_save_LIBS"
1747 AC_TRY_LINK([#include <${cf_cv_ncurses_header:-curses.h}>],
1752 AC_MSG_RESULT($cf_result)
1753 test "$cf_result" != error && break
1757 test "$cf_curs_lib" = unknown && AC_MSG_ERROR(no curses library found)
1762 dnl ---------------------------------------------------------------------------
1763 dnl CF_CURSES_TERM_H version: 15 updated: 2021/01/02 09:31:20
1764 dnl ----------------
1765 dnl SVr4 curses should have term.h as well (where it puts the definitions of
1766 dnl the low-level interface). This may not be true in old/broken implementations,
1767 dnl as well as in misconfigured systems (e.g., gcc configured for Solaris 2.4
1768 dnl running with Solaris 2.5.1).
1769 AC_DEFUN([CF_CURSES_TERM_H],
1771 AC_REQUIRE([CF_CURSES_CPPFLAGS])dnl
1773 AC_CACHE_CHECK(for term.h, cf_cv_term_header,[
1775 # If we found <ncurses/curses.h>, look for <ncurses/term.h>, but always look
1776 # for <term.h> if we do not find the variant.
1778 cf_header_list="term.h ncurses/term.h ncursesw/term.h"
1780 case "${cf_cv_ncurses_header:-curses.h}" in
1782 cf_header_item=`echo "${cf_cv_ncurses_header:-curses.h}" | sed -e 's%\..*%%' -e 's%/.*%/%'`term.h
1783 cf_header_list="$cf_header_item $cf_header_list"
1787 for cf_header in $cf_header_list
1790 #include <${cf_cv_ncurses_header:-curses.h}>
1791 #include <${cf_header}>],
1792 [WINDOW *x; (void)x],
1793 [cf_cv_term_header=$cf_header
1795 [cf_cv_term_header=no])
1798 case "$cf_cv_term_header" in
1800 # If curses is ncurses, some packagers still mess it up by trying to make
1801 # us use GNU termcap. This handles the most common case.
1802 for cf_header in ncurses/term.h ncursesw/term.h
1805 #include <${cf_cv_ncurses_header:-curses.h}>
1806 #ifdef NCURSES_VERSION
1807 #include <${cf_header}>
1811 [WINDOW *x; (void)x],
1812 [cf_cv_term_header=$cf_header
1814 [cf_cv_term_header=no])
1820 case "$cf_cv_term_header" in
1822 AC_DEFINE(HAVE_TERM_H,1,[Define to 1 if we have term.h])
1825 AC_DEFINE(HAVE_NCURSES_TERM_H,1,[Define to 1 if we have ncurses/term.h])
1828 AC_DEFINE(HAVE_NCURSESW_TERM_H,1,[Define to 1 if we have ncursesw/term.h])
1832 dnl ---------------------------------------------------------------------------
1833 dnl CF_CURSES_UNCTRL_H version: 8 updated: 2021/01/02 09:31:20
1834 dnl ------------------
1835 dnl Any X/Open curses implementation must have unctrl.h, but ncurses packages
1836 dnl may put it in a subdirectory (along with ncurses' other headers, of
1837 dnl course). Packages which put the headers in inconsistent locations are
1839 AC_DEFUN([CF_CURSES_UNCTRL_H],
1841 AC_REQUIRE([CF_CURSES_CPPFLAGS])dnl
1843 AC_CACHE_CHECK(for unctrl.h, cf_cv_unctrl_header,[
1845 # If we found <ncurses/curses.h>, look for <ncurses/unctrl.h>, but always look
1846 # for <unctrl.h> if we do not find the variant.
1848 cf_header_list="unctrl.h ncurses/unctrl.h ncursesw/unctrl.h"
1850 case "${cf_cv_ncurses_header:-curses.h}" in
1852 cf_header_item=`echo "${cf_cv_ncurses_header:-curses.h}" | sed -e 's%\..*%%' -e 's%/.*%/%'`unctrl.h
1853 cf_header_list="$cf_header_item $cf_header_list"
1857 for cf_header in $cf_header_list
1860 #include <${cf_cv_ncurses_header:-curses.h}>
1861 #include <${cf_header}>],
1862 [WINDOW *x; (void)x],
1863 [cf_cv_unctrl_header=$cf_header
1865 [cf_cv_unctrl_header=no])
1869 case "$cf_cv_unctrl_header" in
1871 AC_MSG_WARN(unctrl.h header not found)
1875 case "$cf_cv_unctrl_header" in
1877 AC_DEFINE(HAVE_UNCTRL_H,1,[Define to 1 if we have unctrl.h])
1880 AC_DEFINE(HAVE_NCURSES_UNCTRL_H,1,[Define to 1 if we have ncurses/unctrl.h])
1883 AC_DEFINE(HAVE_NCURSESW_UNCTRL_H,1,[Define to 1 if we have ncursesw/unctrl.h])
1887 dnl ---------------------------------------------------------------------------
1888 dnl CF_CURSES_WACS_MAP version: 8 updated: 2021/01/04 19:45:09
1889 dnl ------------------
1890 dnl Check for likely values of wacs_map[].
1891 AC_DEFUN([CF_CURSES_WACS_MAP],
1893 AC_CACHE_CHECK(for wide alternate character set array, cf_cv_curses_wacs_map,[
1894 cf_cv_curses_wacs_map=unknown
1895 for name in wacs_map _wacs_map __wacs_map _nc_wacs _wacs_char
1898 #ifndef _XOPEN_SOURCE_EXTENDED
1899 #define _XOPEN_SOURCE_EXTENDED
1901 #include <${cf_cv_ncurses_header:-curses.h}>],
1902 [void *foo = &(${name}['k']); (void)foo],
1903 [cf_cv_curses_wacs_map=$name
1907 test "$cf_cv_curses_wacs_map" != unknown && AC_DEFINE_UNQUOTED(CURSES_WACS_ARRAY,$cf_cv_curses_wacs_map,[Define to name of (n)curses wide-character array])
1909 dnl ---------------------------------------------------------------------------
1910 dnl CF_CURSES_WACS_SYMBOLS version: 4 updated: 2021/01/04 19:45:09
1911 dnl ----------------------
1912 dnl Do a check to see if the WACS_xxx constants are defined compatibly with
1913 dnl X/Open Curses. In particular, NetBSD's implementation of the WACS_xxx
1914 dnl constants is broken since those constants do not point to cchar_t's.
1915 AC_DEFUN([CF_CURSES_WACS_SYMBOLS],
1917 AC_REQUIRE([CF_CURSES_WACS_MAP])
1919 AC_CACHE_CHECK(for wide alternate character constants, cf_cv_curses_wacs_symbols,[
1920 cf_cv_curses_wacs_symbols=no
1921 if test "$cf_cv_curses_wacs_map" != unknown
1924 #ifndef _XOPEN_SOURCE_EXTENDED
1925 #define _XOPEN_SOURCE_EXTENDED
1927 #include <${cf_cv_ncurses_header:-curses.h}>],
1928 [cchar_t *foo = WACS_PLUS;
1929 ${cf_cv_curses_wacs_map}['k'] = *WACS_PLUS; (void)foo],
1930 [cf_cv_curses_wacs_symbols=yes])
1933 #ifndef _XOPEN_SOURCE_EXTENDED
1934 #define _XOPEN_SOURCE_EXTENDED
1936 #include <${cf_cv_ncurses_header:-curses.h}>],
1937 [cchar_t *foo = WACS_PLUS; (void)foo],
1938 [cf_cv_curses_wacs_symbols=yes])
1942 test "$cf_cv_curses_wacs_symbols" != no && AC_DEFINE(CURSES_WACS_SYMBOLS,1,[Define to 1 if (n)curses supports wide-character WACS_ symbols])
1944 dnl ---------------------------------------------------------------------------
1945 dnl CF_CURSES_WGETPARENT version: 4 updated: 2020/03/19 20:23:48
1946 dnl --------------------
1947 dnl Check for curses support for directly determining the parent of a given
1948 dnl window. Some implementations make this difficult, so we provide for
1949 dnl defining an application-specific function that gives this functionality.
1951 dnl $1 = name of function to use if the feature is missing
1952 AC_DEFUN([CF_CURSES_WGETPARENT],[
1953 CF_CURSES_FUNCS(wgetparent)
1954 if test "x$cf_cv_func_wgetparent" != xyes
1956 AC_MSG_CHECKING(if WINDOW has _parent member)
1957 AC_TRY_COMPILE([#include <${cf_cv_ncurses_header:-curses.h}>],
1958 [WINDOW *p = stdscr->_parent; (void)p],
1959 [cf_window__parent=yes],
1960 [cf_window__parent=no])
1961 AC_MSG_RESULT($cf_window__parent)
1962 if test "$cf_window__parent" = yes
1964 AC_DEFINE(HAVE_WINDOW__PARENT,1,[Define to 1 if WINDOW struct has _parent member])
1968 dnl ---------------------------------------------------------------------------
1969 dnl CF_DIRNAME version: 5 updated: 2020/12/31 20:19:42
1971 dnl "dirname" is not portable, so we fake it with a shell script.
1972 AC_DEFUN([CF_DIRNAME],[$1=`echo "$2" | sed -e 's%/[[^/]]*$%%'`])dnl
1973 dnl ---------------------------------------------------------------------------
1974 dnl CF_DISABLE_ECHO version: 13 updated: 2015/04/18 08:56:57
1976 dnl You can always use "make -n" to see the actual options, but it's hard to
1977 dnl pick out/analyze warning messages when the compile-line is long.
1980 dnl ECHO_LT - symbol to control if libtool is verbose
1981 dnl ECHO_LD - symbol to prefix "cc -o" lines
1982 dnl RULE_CC - symbol to put before implicit "cc -c" lines (e.g., .c.o)
1983 dnl SHOW_CC - symbol to put before explicit "cc -c" lines
1984 dnl ECHO_CC - symbol to put before any "cc" line
1986 AC_DEFUN([CF_DISABLE_ECHO],[
1987 AC_MSG_CHECKING(if you want to see long compiling messages)
1988 CF_ARG_DISABLE(echo,
1989 [ --disable-echo do not display "compiling" commands],
1992 ECHO_LD='@echo linking [$]@;'
1993 RULE_CC='@echo compiling [$]<'
1994 SHOW_CC='@echo compiling [$]@'
2003 AC_MSG_RESULT($enableval)
2010 dnl ---------------------------------------------------------------------------
2011 dnl CF_DISABLE_LIBTOOL_VERSION version: 3 updated: 2015/04/17 21:13:04
2012 dnl --------------------------
2013 dnl Check if we should use the libtool 1.5 feature "-version-number" instead of
2014 dnl the older "-version-info" feature. The newer feature allows us to use
2015 dnl version numbering on shared libraries which make them compatible with
2016 dnl various systems.
2017 AC_DEFUN([CF_DISABLE_LIBTOOL_VERSION],
2019 AC_MSG_CHECKING(if libtool -version-number should be used)
2020 CF_ARG_DISABLE(libtool-version,
2021 [ --disable-libtool-version enable to use libtool's incompatible naming scheme],
2022 [cf_libtool_version=no],
2023 [cf_libtool_version=yes])
2024 AC_MSG_RESULT($cf_libtool_version)
2026 if test "$cf_libtool_version" = yes ; then
2027 LIBTOOL_VERSION="-version-number"
2029 LIBTOOL_VERSION="-version-info"
2032 AC_MSG_WARN(VERSION was not set)
2035 ABI_VERSION="$VERSION"
2036 CF_VERBOSE(ABI_VERSION: $ABI_VERSION)
2039 ABI_VERSION=`echo "$VERSION" | sed -e 's/:/./g'`
2040 CF_VERBOSE(ABI_VERSION: $ABI_VERSION)
2043 AC_MSG_WARN(unexpected VERSION value: $VERSION)
2048 AC_SUBST(ABI_VERSION)
2049 AC_SUBST(LIBTOOL_VERSION)
2051 dnl ---------------------------------------------------------------------------
2052 dnl CF_DISABLE_RPATH_HACK version: 3 updated: 2021/01/05 20:14:44
2053 dnl ---------------------
2054 dnl The rpath-hack makes it simpler to build programs, particularly with the
2055 dnl *BSD ports which may have essential libraries in unusual places. But it
2056 dnl can interfere with building an executable for the base system. Use this
2057 dnl option in that case.
2058 AC_DEFUN([CF_DISABLE_RPATH_HACK],
2060 AC_MSG_CHECKING(if rpath-hack should be disabled)
2061 CF_ARG_DISABLE(rpath-hack,
2062 [ --disable-rpath-hack don't add rpath options for additional libraries],
2063 [enable_rpath_hack=no],
2064 [enable_rpath_hack=yes])
2065 dnl TODO - drop cf_disable_rpath_hack
2066 if test "x$enable_rpath_hack" = xno; then cf_disable_rpath_hack=yes; else cf_disable_rpath_hack=no; fi
2067 AC_MSG_RESULT($cf_disable_rpath_hack)
2069 if test "$enable_rpath_hack" = yes ; then
2073 dnl ---------------------------------------------------------------------------
2074 dnl CF_ENABLE_RPATH version: 2 updated: 2010/03/27 18:39:42
2076 dnl Check if the rpath option should be used, setting cache variable
2077 dnl cf_cv_enable_rpath if so.
2078 AC_DEFUN([CF_ENABLE_RPATH],
2080 AC_MSG_CHECKING(if rpath option should be used)
2081 AC_ARG_ENABLE(rpath,
2082 [ --enable-rpath use rpath option when generating shared libraries],
2083 [cf_cv_enable_rpath=$enableval],
2084 [cf_cv_enable_rpath=no])
2085 AC_MSG_RESULT($cf_cv_enable_rpath)
2087 dnl ---------------------------------------------------------------------------
2088 dnl CF_ENABLE_WARNINGS version: 9 updated: 2021/01/05 19:40:50
2089 dnl ------------------
2090 dnl Configure-option to enable gcc warnings
2092 dnl $1 = extra options to add, if supported
2093 dnl $2 = option for checking attributes. By default, this is done when
2094 dnl warnings are enabled. For other values:
2095 dnl yes: always do this, e.g., to use in generated library-headers
2096 dnl no: never do this
2097 AC_DEFUN([CF_ENABLE_WARNINGS],[
2098 if test "$GCC" = yes || test "$GXX" = yes
2100 CF_FIX_WARNINGS(CFLAGS)
2101 CF_FIX_WARNINGS(CPPFLAGS)
2102 CF_FIX_WARNINGS(LDFLAGS)
2103 AC_MSG_CHECKING(if you want to turn on gcc warnings)
2104 CF_ARG_ENABLE(warnings,
2105 [ --enable-warnings test: turn on gcc compiler warnings],
2106 [enable_warnings=yes],
2107 [enable_warnings=no])
2108 AC_MSG_RESULT($enable_warnings)
2109 if test "$enable_warnings" = "yes"
2111 ifelse($2,,[CF_GCC_ATTRIBUTES])
2114 ifelse($2,yes,[CF_GCC_ATTRIBUTES])
2117 dnl ---------------------------------------------------------------------------
2118 dnl CF_FIND_LIBRARY version: 11 updated: 2021/01/02 09:31:20
2120 dnl Look for a non-standard library, given parameters for AC_TRY_LINK. We
2121 dnl prefer a standard location, and use -L options only if we do not find the
2122 dnl library in the standard library location(s).
2123 dnl $1 = library name
2124 dnl $2 = library class, usually the same as library name
2126 dnl $4 = code fragment to compile/link
2127 dnl $5 = corresponding function-name
2128 dnl $6 = flag, nonnull if failure should not cause an error-exit
2130 dnl Sets the variable "$cf_libdir" as a side-effect, so we can see if we had
2131 dnl to use a -L option.
2132 AC_DEFUN([CF_FIND_LIBRARY],
2134 eval 'cf_cv_have_lib_'"$1"'=no'
2137 eval 'cf_cv_have_lib_'"$1"'=yes',[
2138 cf_save_LIBS="$LIBS"
2139 AC_MSG_CHECKING(for $5 in -l$1)
2141 AC_TRY_LINK([$3],[$4],
2143 eval 'cf_cv_have_lib_'"$1"'=yes'
2146 CF_LIBRARY_PATH(cf_search,$2)
2147 for cf_libdir in $cf_search
2149 AC_MSG_CHECKING(for -l$1 in $cf_libdir)
2150 LIBS="-L$cf_libdir -l$1 $cf_save_LIBS"
2151 AC_TRY_LINK([$3],[$4],
2153 eval 'cf_cv_have_lib_'"$1"'=yes'
2156 LIBS="$cf_save_LIBS"])
2160 eval 'cf_found_library="[$]cf_cv_have_lib_'"$1"\"
2162 if test "$cf_found_library" = no ; then
2163 AC_MSG_ERROR(Cannot link $1 library)
2167 dnl ---------------------------------------------------------------------------
2168 dnl CF_FIND_LINKAGE version: 22 updated: 2020/12/31 20:19:42
2170 dnl Find a library (specifically the linkage used in the code fragment),
2171 dnl searching for it if it is not already in the library path.
2172 dnl See also CF_ADD_SEARCHPATH.
2174 dnl Parameters (4-on are optional):
2175 dnl $1 = headers for library entrypoint
2176 dnl $2 = code fragment for library entrypoint
2177 dnl $3 = the library name without the "-l" option or ".so" suffix.
2178 dnl $4 = action to perform if successful (default: update CPPFLAGS, etc)
2179 dnl $5 = action to perform if not successful
2180 dnl $6 = module name, if not the same as the library name
2181 dnl $7 = extra libraries
2183 dnl Sets these variables:
2184 dnl $cf_cv_find_linkage_$3 - yes/no according to whether linkage is found
2185 dnl $cf_cv_header_path_$3 - include-directory if needed
2186 dnl $cf_cv_library_path_$3 - library-directory if needed
2187 dnl $cf_cv_library_file_$3 - library-file if needed, e.g., -l$3
2188 AC_DEFUN([CF_FIND_LINKAGE],[
2190 # If the linkage is not already in the $CPPFLAGS/$LDFLAGS configuration, these
2191 # will be set on completion of the AC_TRY_LINK below.
2192 cf_cv_header_path_$3=
2193 cf_cv_library_path_$3=
2195 CF_MSG_LOG([Starting [FIND_LINKAGE]($3,$6)])
2197 cf_save_LIBS="$LIBS"
2199 AC_TRY_LINK([$1],[$2],[
2200 cf_cv_find_linkage_$3=yes
2201 cf_cv_header_path_$3=/usr/include
2202 cf_cv_library_path_$3=/usr/lib
2205 LIBS="-l$3 $7 $cf_save_LIBS"
2207 AC_TRY_LINK([$1],[$2],[
2208 cf_cv_find_linkage_$3=yes
2209 cf_cv_header_path_$3=/usr/include
2210 cf_cv_library_path_$3=/usr/lib
2211 cf_cv_library_file_$3="-l$3"
2213 cf_cv_find_linkage_$3=no
2214 LIBS="$cf_save_LIBS"
2216 CF_VERBOSE(find linkage for $3 library)
2217 CF_MSG_LOG([Searching for headers in [FIND_LINKAGE]($3,$6)])
2219 cf_save_CPPFLAGS="$CPPFLAGS"
2220 cf_test_CPPFLAGS="$CPPFLAGS"
2222 CF_HEADER_PATH(cf_search,ifelse([$6],,[$3],[$6]))
2223 for cf_cv_header_path_$3 in $cf_search
2225 if test -d "$cf_cv_header_path_$3" ; then
2226 CF_VERBOSE(... testing $cf_cv_header_path_$3)
2227 CPPFLAGS="$cf_save_CPPFLAGS"
2228 CF_APPEND_TEXT(CPPFLAGS,-I$cf_cv_header_path_$3)
2229 AC_TRY_COMPILE([$1],[$2],[
2230 CF_VERBOSE(... found $3 headers in $cf_cv_header_path_$3)
2231 cf_cv_find_linkage_$3=maybe
2232 cf_test_CPPFLAGS="$CPPFLAGS"
2234 CPPFLAGS="$cf_save_CPPFLAGS"
2239 if test "$cf_cv_find_linkage_$3" = maybe ; then
2241 CF_MSG_LOG([Searching for $3 library in [FIND_LINKAGE]($3,$6)])
2243 cf_save_LIBS="$LIBS"
2244 cf_save_LDFLAGS="$LDFLAGS"
2247 CPPFLAGS="$cf_test_CPPFLAGS"
2248 LIBS="-l$3 $7 $cf_save_LIBS"
2249 AC_TRY_LINK([$1],[$2],[
2250 CF_VERBOSE(... found $3 library in system)
2251 cf_cv_find_linkage_$3=yes])
2252 CPPFLAGS="$cf_save_CPPFLAGS"
2253 LIBS="$cf_save_LIBS"
2256 if test "$cf_cv_find_linkage_$3" != yes ; then
2257 CF_LIBRARY_PATH(cf_search,$3)
2258 for cf_cv_library_path_$3 in $cf_search
2260 if test -d "$cf_cv_library_path_$3" ; then
2261 CF_VERBOSE(... testing $cf_cv_library_path_$3)
2262 CPPFLAGS="$cf_test_CPPFLAGS"
2263 LIBS="-l$3 $7 $cf_save_LIBS"
2264 LDFLAGS="$cf_save_LDFLAGS -L$cf_cv_library_path_$3"
2265 AC_TRY_LINK([$1],[$2],[
2266 CF_VERBOSE(... found $3 library in $cf_cv_library_path_$3)
2267 cf_cv_find_linkage_$3=yes
2268 cf_cv_library_file_$3="-l$3"
2270 CPPFLAGS="$cf_save_CPPFLAGS"
2271 LIBS="$cf_save_LIBS"
2272 LDFLAGS="$cf_save_LDFLAGS"
2276 CPPFLAGS="$cf_save_CPPFLAGS"
2277 LDFLAGS="$cf_save_LDFLAGS"
2281 cf_cv_find_linkage_$3=no
2286 LIBS="$cf_save_LIBS"
2288 if test "$cf_cv_find_linkage_$3" = yes ; then
2290 CF_ADD_INCDIR($cf_cv_header_path_$3)
2291 CF_ADD_LIBDIR($cf_cv_library_path_$3)
2295 ifelse([$5],,AC_MSG_WARN(Cannot find $3 library),[$5])
2298 dnl ---------------------------------------------------------------------------
2299 dnl CF_FIX_WARNINGS version: 3 updated: 2020/12/31 18:40:20
2301 dnl Warning flags do not belong in CFLAGS, CPPFLAGS, etc. Any of gcc's
2302 dnl "-Werror" flags can interfere with configure-checks. Those go into
2305 dnl $1 = variable name to repair
2306 define([CF_FIX_WARNINGS],[
2307 if test "$GCC" = yes || test "$GXX" = yes
2311 CF_VERBOSE(repairing $1: [$]$1)
2313 for cf_temp_scan in [$]$1
2315 case "x$cf_temp_scan" in
2317 CF_APPEND_TEXT(EXTRA_CFLAGS,$cf_temp_scan)
2320 CF_APPEND_TEXT(cf_temp_flags,$cf_temp_scan)
2325 CF_VERBOSE(... fixed [$]$1)
2326 CF_VERBOSE(... extra $EXTRA_CFLAGS)
2330 AC_SUBST(EXTRA_CFLAGS)
2332 dnl ---------------------------------------------------------------------------
2333 dnl CF_FORGET_TOOL version: 1 updated: 2013/04/06 18:03:09
2335 dnl Forget that we saw the given tool.
2336 AC_DEFUN([CF_FORGET_TOOL],[
2337 unset ac_cv_prog_ac_ct_$1
2341 dnl ---------------------------------------------------------------------------
2342 dnl CF_FUNC_WAIT version: 4 updated: 2021/01/02 09:31:20
2344 dnl Test for the presence of <sys/wait.h>, 'union wait', arg-type of 'wait()'
2345 dnl and/or 'waitpid()'.
2347 dnl Note that we cannot simply grep for 'union wait' in the wait.h file,
2348 dnl because some Posix systems turn this on only when a BSD variable is
2351 dnl I don't use AC_HEADER_SYS_WAIT, because it defines HAVE_SYS_WAIT_H, which
2352 dnl would conflict with an attempt to test that header directly.
2354 AC_DEFUN([CF_FUNC_WAIT],
2356 AC_REQUIRE([CF_UNION_WAIT])
2357 if test "$cf_cv_type_unionwait" = yes; then
2359 AC_MSG_CHECKING(if union wait can be used as wait-arg)
2360 AC_CACHE_VAL(cf_cv_arg_union_wait,[
2361 AC_TRY_COMPILE($cf_wait_headers,
2362 [union wait x; wait(&x)],
2363 [cf_cv_arg_union_wait=yes],
2364 [cf_cv_arg_union_wait=no])
2366 AC_MSG_RESULT($cf_cv_arg_union_wait)
2367 test "$cf_cv_arg_union_wait" = yes && AC_DEFINE(WAIT_USES_UNION,1,[Define to 1 if wait() uses a union parameter])
2369 AC_MSG_CHECKING(if union wait can be used as waitpid-arg)
2370 AC_CACHE_VAL(cf_cv_arg_union_waitpid,[
2371 AC_TRY_COMPILE($cf_wait_headers,
2372 [union wait x; waitpid(0, &x, 0)],
2373 [cf_cv_arg_union_waitpid=yes],
2374 [cf_cv_arg_union_waitpid=no])
2376 AC_MSG_RESULT($cf_cv_arg_union_waitpid)
2377 test "$cf_cv_arg_union_waitpid" = yes && AC_DEFINE(WAITPID_USES_UNION,1,[Define to 1 if waitpid() uses a union parameter])
2381 dnl ---------------------------------------------------------------------------
2382 dnl CF_GCC_ATTRIBUTES version: 23 updated: 2021/01/03 18:30:50
2383 dnl -----------------
2384 dnl Test for availability of useful gcc __attribute__ directives to quiet
2385 dnl compiler warnings. Though useful, not all are supported -- and contrary
2386 dnl to documentation, unrecognized directives cause older compilers to barf.
2387 AC_DEFUN([CF_GCC_ATTRIBUTES],
2388 [AC_REQUIRE([AC_PROG_FGREP])dnl
2390 if test "$GCC" = yes || test "$GXX" = yes
2392 cat > conftest.i <<EOF
2394 #define GCC_PRINTF 0
2399 #ifndef GCC_NORETURN
2400 #define GCC_NORETURN /* nothing */
2403 #define GCC_UNUSED /* nothing */
2406 if test "$GCC" = yes
2408 AC_CHECKING([for $CC __attribute__ directives])
2409 cat > "conftest.$ac_ext" <<EOF
2410 #line __oline__ "${as_me:-configure}"
2411 #include "confdefs.h"
2412 #include "conftest.h"
2413 #include "conftest.i"
2415 #define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
2417 #define GCC_PRINTFLIKE(fmt,var) /*nothing*/
2420 #define GCC_SCANFLIKE(fmt,var) __attribute__((format(scanf,fmt,var)))
2422 #define GCC_SCANFLIKE(fmt,var) /*nothing*/
2424 extern void wow(char *,...) GCC_SCANFLIKE(1,2);
2425 extern void oops(char *,...) GCC_PRINTFLIKE(1,2) GCC_NORETURN;
2426 extern void foo(void) GCC_NORETURN;
2427 int main(int argc GCC_UNUSED, char *argv[[]] GCC_UNUSED) { (void)argc; (void)argv; return 0; }
2429 cf_printf_attribute=no
2430 cf_scanf_attribute=no
2431 for cf_attribute in scanf printf unused noreturn
2433 CF_UPPER(cf_ATTRIBUTE,$cf_attribute)
2434 cf_directive="__attribute__(($cf_attribute))"
2435 echo "checking for $CC $cf_directive" 1>&AC_FD_CC
2437 case "$cf_attribute" in
2439 cf_printf_attribute=yes
2440 cat >conftest.h <<EOF
2441 #define GCC_$cf_ATTRIBUTE 1
2445 cf_scanf_attribute=yes
2446 cat >conftest.h <<EOF
2447 #define GCC_$cf_ATTRIBUTE 1
2451 cat >conftest.h <<EOF
2452 #define GCC_$cf_ATTRIBUTE $cf_directive
2457 if AC_TRY_EVAL(ac_compile); then
2458 test -n "$verbose" && AC_MSG_RESULT(... $cf_attribute)
2459 cat conftest.h >>confdefs.h
2460 case "$cf_attribute" in
2462 AC_DEFINE_UNQUOTED(GCC_NORETURN,$cf_directive,[Define to noreturn-attribute for gcc])
2465 cf_value='/* nothing */'
2466 if test "$cf_printf_attribute" != no ; then
2467 cf_value='__attribute__((format(printf,fmt,var)))'
2468 AC_DEFINE(GCC_PRINTF,1,[Define to 1 if the compiler supports gcc-like printf attribute.])
2470 AC_DEFINE_UNQUOTED(GCC_PRINTFLIKE(fmt,var),$cf_value,[Define to printf-attribute for gcc])
2473 cf_value='/* nothing */'
2474 if test "$cf_scanf_attribute" != no ; then
2475 cf_value='__attribute__((format(scanf,fmt,var)))'
2476 AC_DEFINE(GCC_SCANF,1,[Define to 1 if the compiler supports gcc-like scanf attribute.])
2478 AC_DEFINE_UNQUOTED(GCC_SCANFLIKE(fmt,var),$cf_value,[Define to sscanf-attribute for gcc])
2481 AC_DEFINE_UNQUOTED(GCC_UNUSED,$cf_directive,[Define to unused-attribute for gcc])
2487 ${FGREP-fgrep} define conftest.i >>confdefs.h
2492 dnl ---------------------------------------------------------------------------
2493 dnl CF_GCC_VERSION version: 8 updated: 2019/09/07 13:38:36
2495 dnl Find version of gcc, and (because icc/clang pretend to be gcc without being
2496 dnl compatible), attempt to determine if icc/clang is actually used.
2497 AC_DEFUN([CF_GCC_VERSION],[
2498 AC_REQUIRE([AC_PROG_CC])
2500 if test "$GCC" = yes ; then
2501 AC_MSG_CHECKING(version of $CC)
2502 GCC_VERSION="`${CC} --version 2>/dev/null | sed -e '2,$d' -e 's/^.*(GCC[[^)]]*) //' -e 's/^.*(Debian[[^)]]*) //' -e 's/^[[^0-9.]]*//' -e 's/[[^0-9.]].*//'`"
2503 test -z "$GCC_VERSION" && GCC_VERSION=unknown
2504 AC_MSG_RESULT($GCC_VERSION)
2506 CF_INTEL_COMPILER(GCC,INTEL_COMPILER,CFLAGS)
2507 CF_CLANG_COMPILER(GCC,CLANG_COMPILER,CFLAGS)
2509 dnl ---------------------------------------------------------------------------
2510 dnl CF_GCC_WARNINGS version: 41 updated: 2021/01/01 16:53:59
2512 dnl Check if the compiler supports useful warning options. There's a few that
2513 dnl we don't use, simply because they're too noisy:
2515 dnl -Wconversion (useful in older versions of gcc, but not in gcc 2.7.x)
2516 dnl -Winline (usually not worthwhile)
2517 dnl -Wredundant-decls (system headers make this too noisy)
2518 dnl -Wtraditional (combines too many unrelated messages, only a few useful)
2519 dnl -Wwrite-strings (too noisy, but should review occasionally). This
2520 dnl is enabled for ncurses using "--enable-const".
2524 dnl $1 is an optional list of gcc warning flags that a particular
2525 dnl application might want to use, e.g., "no-unused" for
2528 dnl If $with_ext_const is "yes", add a check for -Wwrite-strings
2530 AC_DEFUN([CF_GCC_WARNINGS],
2532 AC_REQUIRE([CF_GCC_VERSION])
2533 if test "x$have_x" = xyes; then CF_CONST_X_STRING fi
2534 cat > "conftest.$ac_ext" <<EOF
2535 #line __oline__ "${as_me:-configure}"
2536 int main(int argc, char *argv[[]]) { return (argv[[argc-1]] == 0) ; }
2538 if test "$INTEL_COMPILER" = yes
2540 # The "-wdXXX" options suppress warnings:
2541 # remark #1419: external declaration in primary source file
2542 # remark #1683: explicit conversion of a 64-bit integral type to a smaller integral type (potential portability problem)
2543 # remark #1684: conversion from pointer to same-sized integral type (potential portability problem)
2544 # remark #193: zero used for undefined preprocessing identifier
2545 # remark #593: variable "curs_sb_left_arrow" was set but never used
2546 # remark #810: conversion from "int" to "Dimension={unsigned short}" may lose significant bits
2547 # remark #869: parameter "tw" was never referenced
2548 # remark #981: operands are evaluated in unspecified order
2549 # warning #279: controlling expression is constant
2551 AC_CHECKING([for $CC warning options])
2552 cf_save_CFLAGS="$CFLAGS"
2553 EXTRA_CFLAGS="$EXTRA_CFLAGS -Wall"
2565 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
2566 if AC_TRY_EVAL(ac_compile); then
2567 test -n "$verbose" && AC_MSG_RESULT(... -$cf_opt)
2568 EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
2571 CFLAGS="$cf_save_CFLAGS"
2572 elif test "$GCC" = yes && test "$GCC_VERSION" != "unknown"
2574 AC_CHECKING([for $CC warning options])
2575 cf_save_CFLAGS="$CFLAGS"
2577 test "$with_ext_const" = yes && cf_warn_CONST="Wwrite-strings"
2578 cf_gcc_warnings="Wignored-qualifiers Wlogical-op Wvarargs"
2579 test "x$CLANG_COMPILER" = xyes && cf_gcc_warnings=
2580 for cf_opt in W Wall \
2581 Wbad-function-cast \
2584 Wdeclaration-after-statement \
2587 Wmissing-declarations \
2588 Wmissing-prototypes \
2592 Wstrict-prototypes \
2593 Wundef Wno-inline $cf_gcc_warnings $cf_warn_CONST $1
2595 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
2596 if AC_TRY_EVAL(ac_compile); then
2597 test -n "$verbose" && AC_MSG_RESULT(... -$cf_opt)
2600 case "$GCC_VERSION" in
2602 CF_VERBOSE(feature is broken in gcc $GCC_VERSION)
2607 case "$GCC_VERSION" in
2609 CF_VERBOSE(feature is broken in gcc $GCC_VERSION)
2614 EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
2617 CFLAGS="$cf_save_CFLAGS"
2621 AC_SUBST(EXTRA_CFLAGS)
2623 dnl ---------------------------------------------------------------------------
2624 dnl CF_GNU_SOURCE version: 10 updated: 2018/12/10 20:09:41
2626 dnl Check if we must define _GNU_SOURCE to get a reasonable value for
2627 dnl _XOPEN_SOURCE, upon which many POSIX definitions depend. This is a defect
2628 dnl (or misfeature) of glibc2, which breaks portability of many applications,
2629 dnl since it is interwoven with GNU extensions.
2631 dnl Well, yes we could work around it...
2634 dnl $1 is the nominal value for _XOPEN_SOURCE
2635 AC_DEFUN([CF_GNU_SOURCE],
2637 cf_gnu_xopen_source=ifelse($1,,500,$1)
2639 AC_CACHE_CHECK(if this is the GNU C library,cf_cv_gnu_library,[
2640 AC_TRY_COMPILE([#include <sys/types.h>],[
2641 #if __GLIBC__ > 0 && __GLIBC_MINOR__ >= 0
2643 #elif __NEWLIB__ > 0 && __NEWLIB_MINOR__ >= 0
2646 # error not GNU C library
2648 [cf_cv_gnu_library=yes],
2649 [cf_cv_gnu_library=no])
2652 if test x$cf_cv_gnu_library = xyes; then
2654 # With glibc 2.19 (13 years after this check was begun), _DEFAULT_SOURCE
2655 # was changed to help a little. newlib incorporated the change about 4
2657 AC_CACHE_CHECK(if _DEFAULT_SOURCE can be used as a basis,cf_cv_gnu_library_219,[
2659 CF_APPEND_TEXT(CPPFLAGS,-D_DEFAULT_SOURCE)
2660 AC_TRY_COMPILE([#include <sys/types.h>],[
2661 #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 19) || (__GLIBC__ > 2)
2663 #elif (__NEWLIB__ == 2 && __NEWLIB_MINOR__ >= 4) || (__GLIBC__ > 3)
2666 # error GNU C library __GLIBC__.__GLIBC_MINOR__ is too old
2668 [cf_cv_gnu_library_219=yes],
2669 [cf_cv_gnu_library_219=no])
2673 if test "x$cf_cv_gnu_library_219" = xyes; then
2675 AC_CACHE_CHECK(if _XOPEN_SOURCE=$cf_gnu_xopen_source works with _DEFAULT_SOURCE,cf_cv_gnu_dftsrc_219,[
2676 CF_ADD_CFLAGS(-D_DEFAULT_SOURCE -D_XOPEN_SOURCE=$cf_gnu_xopen_source)
2679 #include <sys/types.h>
2681 #if (_XOPEN_SOURCE >= $cf_gnu_xopen_source) && (MB_LEN_MAX > 1)
2684 # error GNU C library is too old
2686 [cf_cv_gnu_dftsrc_219=yes],
2687 [cf_cv_gnu_dftsrc_219=no])
2689 test "x$cf_cv_gnu_dftsrc_219" = "xyes" || CPPFLAGS="$cf_save"
2691 cf_cv_gnu_dftsrc_219=maybe
2694 if test "x$cf_cv_gnu_dftsrc_219" != xyes; then
2696 AC_CACHE_CHECK(if we must define _GNU_SOURCE,cf_cv_gnu_source,[
2697 AC_TRY_COMPILE([#include <sys/types.h>],[
2698 #ifndef _XOPEN_SOURCE
2699 #error expected _XOPEN_SOURCE to be defined
2701 [cf_cv_gnu_source=no],
2702 [cf_save="$CPPFLAGS"
2703 CF_ADD_CFLAGS(-D_GNU_SOURCE)
2704 AC_TRY_COMPILE([#include <sys/types.h>],[
2705 #ifdef _XOPEN_SOURCE
2706 #error expected _XOPEN_SOURCE to be undefined
2708 [cf_cv_gnu_source=no],
2709 [cf_cv_gnu_source=yes])
2714 if test "$cf_cv_gnu_source" = yes
2716 AC_CACHE_CHECK(if we should also define _DEFAULT_SOURCE,cf_cv_default_source,[
2717 CF_APPEND_TEXT(CPPFLAGS,-D_GNU_SOURCE)
2718 AC_TRY_COMPILE([#include <sys/types.h>],[
2719 #ifdef _DEFAULT_SOURCE
2720 #error expected _DEFAULT_SOURCE to be undefined
2722 [cf_cv_default_source=no],
2723 [cf_cv_default_source=yes])
2725 if test "$cf_cv_default_source" = yes
2727 CF_APPEND_TEXT(CPPFLAGS,-D_DEFAULT_SOURCE)
2734 dnl ---------------------------------------------------------------------------
2735 dnl CF_HEADERS_SH version: 1 updated: 2007/07/04 15:37:05
2737 dnl Setup variables needed to construct headers-sh
2738 AC_DEFUN([CF_HEADERS_SH],[
2741 AC_SUBST(PACKAGE_PREFIX)
2742 AC_SUBST(PACKAGE_CONFIG)
2743 EXTRA_OUTPUT="$EXTRA_OUTPUT headers-sh:$srcdir/headers-sh.in"
2745 dnl ---------------------------------------------------------------------------
2746 dnl CF_HEADER_PATH version: 15 updated: 2021/01/01 13:31:04
2748 dnl Construct a search-list of directories for a nonstandard header-file
2751 dnl $1 = the variable to return as result
2752 dnl $2 = the package name
2753 AC_DEFUN([CF_HEADER_PATH],
2757 # collect the current set of include-directories from compiler flags
2758 cf_header_path_list=""
2759 if test -n "${CFLAGS}${CPPFLAGS}" ; then
2760 for cf_header_path in $CPPFLAGS $CFLAGS
2762 case "$cf_header_path" in
2764 cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
2765 CF_ADD_SUBDIR_PATH($1,$2,include,$cf_header_path,NONE)
2766 cf_header_path_list="$cf_header_path_list [$]$1"
2772 # add the variations for the package we are looking for
2773 CF_SUBDIR_PATH($1,$2,include)
2775 test "$includedir" != NONE && \
2776 test "$includedir" != "/usr/include" && \
2777 test -d "$includedir" && {
2778 test -d "$includedir" && $1="[$]$1 $includedir"
2779 test -d "$includedir/$2" && $1="[$]$1 $includedir/$2"
2782 test "$oldincludedir" != NONE && \
2783 test "$oldincludedir" != "/usr/include" && \
2784 test -d "$oldincludedir" && {
2785 test -d "$oldincludedir" && $1="[$]$1 $oldincludedir"
2786 test -d "$oldincludedir/$2" && $1="[$]$1 $oldincludedir/$2"
2789 $1="[$]$1 $cf_header_path_list"
2791 dnl ---------------------------------------------------------------------------
2792 dnl CF_INTEL_COMPILER version: 8 updated: 2021/01/01 16:53:59
2793 dnl -----------------
2794 dnl Check if the given compiler is really the Intel compiler for Linux. It
2795 dnl tries to imitate gcc, but does not return an error when it finds a mismatch
2796 dnl between prototypes, e.g., as exercised by CF_MISSING_CHECK.
2798 dnl This macro should be run "soon" after AC_PROG_CC or AC_PROG_CPLUSPLUS, to
2799 dnl ensure that it is not mistaken for gcc/g++. It is normally invoked from
2800 dnl the wrappers for gcc and g++ warnings.
2802 dnl $1 = GCC (default) or GXX
2803 dnl $2 = INTEL_COMPILER (default) or INTEL_CPLUSPLUS
2804 dnl $3 = CFLAGS (default) or CXXFLAGS
2805 AC_DEFUN([CF_INTEL_COMPILER],[
2806 AC_REQUIRE([AC_CANONICAL_HOST])
2807 ifelse([$2],,INTEL_COMPILER,[$2])=no
2809 if test "$ifelse([$1],,[$1],GCC)" = yes ; then
2812 AC_MSG_CHECKING(if this is really Intel ifelse([$1],GXX,C++,C) compiler)
2813 cf_save_CFLAGS="$ifelse([$3],,CFLAGS,[$3])"
2814 ifelse([$3],,CFLAGS,[$3])="$ifelse([$3],,CFLAGS,[$3]) -no-gcc"
2816 #ifdef __INTEL_COMPILER
2820 ],[ifelse([$2],,INTEL_COMPILER,[$2])=yes
2821 cf_save_CFLAGS="$cf_save_CFLAGS -we147"
2823 ifelse([$3],,CFLAGS,[$3])="$cf_save_CFLAGS"
2824 AC_MSG_RESULT($ifelse([$2],,INTEL_COMPILER,[$2]))
2829 dnl ---------------------------------------------------------------------------
2830 dnl CF_LARGEFILE version: 12 updated: 2020/03/19 20:23:48
2832 dnl Add checks for large file support.
2833 AC_DEFUN([CF_LARGEFILE],[
2834 ifdef([AC_FUNC_FSEEKO],[
2836 if test "$enable_largefile" != no ; then
2839 # Normally we would collect these definitions in the config.h,
2840 # but (like _XOPEN_SOURCE), some environments rely on having these
2841 # defined before any of the system headers are included. Another
2842 # case comes up with C++, e.g., on AIX the compiler compiles the
2843 # header files by themselves before looking at the body files it is
2844 # told to compile. For ncurses, those header files do not include
2846 if test "$ac_cv_sys_large_files" != no
2848 CF_APPEND_TEXT(CPPFLAGS,-D_LARGE_FILES)
2850 if test "$ac_cv_sys_largefile_source" != no
2852 CF_APPEND_TEXT(CPPFLAGS,-D_LARGEFILE_SOURCE)
2854 if test "$ac_cv_sys_file_offset_bits" != no
2856 CF_APPEND_TEXT(CPPFLAGS,-D_FILE_OFFSET_BITS=$ac_cv_sys_file_offset_bits)
2859 AC_CACHE_CHECK(whether to use struct dirent64, cf_cv_struct_dirent64,[
2861 #pragma GCC diagnostic error "-Wincompatible-pointer-types"
2862 #include <sys/types.h>
2865 /* if transitional largefile support is setup, this is true */
2866 extern struct dirent64 * readdir(DIR *);
2867 struct dirent64 *x = readdir((DIR *)0);
2868 struct dirent *y = readdir((DIR *)0);
2872 [cf_cv_struct_dirent64=yes],
2873 [cf_cv_struct_dirent64=no])
2875 test "$cf_cv_struct_dirent64" = yes && AC_DEFINE(HAVE_STRUCT_DIRENT64,1,[Define to 1 if we have struct dirent64])
2879 dnl ---------------------------------------------------------------------------
2880 dnl CF_LD_RPATH_OPT version: 9 updated: 2021/01/01 13:31:04
2882 dnl For the given system and compiler, find the compiler flags to pass to the
2883 dnl loader to use the "rpath" feature.
2884 AC_DEFUN([CF_LD_RPATH_OPT],
2886 AC_REQUIRE([CF_CHECK_CACHE])
2889 if test "x$cf_cv_enable_rpath" != xno
2891 AC_MSG_CHECKING(for an rpath option)
2892 case "$cf_cv_system_name" in
2894 if test "$GCC" = yes; then
2895 LD_RPATH_OPT="-Wl,-rpath,"
2897 LD_RPATH_OPT="-rpath "
2900 (linux*|gnu*|k*bsd*-gnu|freebsd*)
2901 LD_RPATH_OPT="-Wl,-rpath,"
2903 (openbsd[[2-9]].*|mirbsd*)
2904 LD_RPATH_OPT="-Wl,-rpath,"
2907 LD_RPATH_OPT="-rpath "
2910 LD_RPATH_OPT="-Wl,-rpath,"
2913 LD_RPATH_OPT="-rpath "
2921 AC_MSG_RESULT($LD_RPATH_OPT)
2923 case "x$LD_RPATH_OPT" in
2925 AC_MSG_CHECKING(if we need a space after rpath option)
2926 cf_save_LIBS="$LIBS"
2927 CF_ADD_LIBS(${LD_RPATH_OPT}$libdir)
2928 AC_TRY_LINK(, , cf_rpath_space=no, cf_rpath_space=yes)
2929 LIBS="$cf_save_LIBS"
2930 AC_MSG_RESULT($cf_rpath_space)
2931 test "$cf_rpath_space" = yes && LD_RPATH_OPT="$LD_RPATH_OPT "
2936 dnl ---------------------------------------------------------------------------
2937 dnl CF_LD_SEARCHPATH version: 2 updated: 2019/09/26 20:34:14
2938 dnl ----------------
2939 dnl Try to obtain the linker's search-path, for use in scripts.
2941 dnl Ignore LD_LIBRARY_PATH, etc.
2942 AC_DEFUN([CF_LD_SEARCHPATH],[
2943 AC_CACHE_CHECK(for linker search path,cf_cv_ld_searchpath,[
2945 if test "$cross_compiling" != yes ; then
2947 # GNU binutils' ld does not involve permissions which may stop ldconfig.
2948 cf_pathlist=`ld --verbose 2>/dev/null | grep SEARCH_DIR | sed -e 's,SEARCH_DIR[[("=]][[("=]]*,,g' -e 's/"[[)]];//gp' | sort -u`
2950 # The -NX options tell newer versions of Linux ldconfig to not attempt to
2951 # update the cache, which makes it run faster.
2952 test -z "$cf_pathlist" && \
2953 cf_pathlist=`ldconfig -NX -v 2>/dev/null | sed -e '/^[[ ]]/d' -e 's/:$//' | sort -u`
2955 test -z "$cf_pathlist" &&
2956 cf_pathlist=`ldconfig -v 2>/dev/null | sed -n -e '/^[[ ]]/d' -e 's/:$//p' | sort -u`
2958 # This works with OpenBSD 6.5, which lists only filenames
2959 test -z "$cf_pathlist" &&
2960 cf_pathlist=`ldconfig -v 2>/dev/null | sed -n -e 's,^Adding \(.*\)/.*[$],\1,p' | sort -u`
2962 if test -z "$cf_pathlist"
2964 # dyld default path with MacOS
2965 if test -f /usr/bin/otool && test "x`uname -s`" = xDarwin
2967 # do this to bypass check
2968 cf_cv_ld_searchpath='$HOME/lib'
2969 cf_pathlist="/usr/local/lib /lib /usr/lib"
2973 if test -z "$cf_pathlist"
2975 # Solaris is hardcoded
2976 if test -d /opt/SUNWspro/lib
2978 cf_pathlist="/opt/SUNWspro/lib /usr/ccs/lib /usr/lib"
2979 elif test -d /usr/ccs/lib
2981 cf_pathlist="/usr/ccs/lib /usr/lib"
2987 # If nothing else, assume it is conventional
2988 test -z "$cf_pathlist" && cf_pathlist="/usr/lib /lib"
2990 # Finally, check that this is only directories
2991 for cf_path in [$]0 $cf_pathlist
2993 if test -d "$cf_path"; then
2994 test -n "$cf_cv_ld_searchpath" && cf_cv_ld_searchpath="${cf_cv_ld_searchpath} "
2995 cf_cv_ld_searchpath="${cf_cv_ld_searchpath}${cf_path}"
2999 # Ensure that it is nonempty
3000 test -z "$cf_cv_ld_searchpath" && cf_cv_ld_searchpath=/usr/lib
3003 LD_SEARCHPATH=`echo "$cf_cv_ld_searchpath"|sed -e 's/ /|/g'`
3004 AC_SUBST(LD_SEARCHPATH)
3006 dnl ---------------------------------------------------------------------------
3007 dnl CF_LIBRARY_PATH version: 11 updated: 2021/01/01 13:31:04
3009 dnl Construct a search-list of directories for a nonstandard library-file
3012 dnl $1 = the variable to return as result
3013 dnl $2 = the package name
3014 AC_DEFUN([CF_LIBRARY_PATH],
3017 cf_library_path_list=""
3018 if test -n "${LDFLAGS}${LIBS}" ; then
3019 for cf_library_path in $LDFLAGS $LIBS
3021 case "$cf_library_path" in
3023 cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
3024 CF_ADD_SUBDIR_PATH($1,$2,lib,$cf_library_path,NONE)
3025 cf_library_path_list="$cf_library_path_list [$]$1"
3031 CF_SUBDIR_PATH($1,$2,lib)
3033 $1="$cf_library_path_list [$]$1"
3035 dnl ---------------------------------------------------------------------------
3036 dnl CF_LIBTOOL_VERSION version: 1 updated: 2013/04/06 18:03:09
3037 dnl ------------------
3038 AC_DEFUN([CF_LIBTOOL_VERSION],[
3039 if test -n "$LIBTOOL" && test "$LIBTOOL" != none
3041 cf_cv_libtool_version=`$LIBTOOL --version 2>&1 | sed -e '/^$/d' |sed -e '2,$d' -e 's/([[^)]]*)//g' -e 's/^[[^1-9]]*//' -e 's/[[^0-9.]].*//'`
3043 cf_cv_libtool_version=
3045 test -z "$cf_cv_libtool_version" && unset cf_cv_libtool_version
3047 dnl ---------------------------------------------------------------------------
3048 dnl CF_LIB_PREFIX version: 14 updated: 2021/01/01 13:31:04
3050 dnl Compute the library-prefix for the given host system
3051 dnl $1 = variable to set
3052 define([CF_LIB_PREFIX],
3054 case "$cf_cv_system_name" in
3056 if test "$DFT_LWR_MODEL" = libtool; then
3065 (*) LIB_PREFIX='lib'
3068 ifelse($1,,,[$1=$LIB_PREFIX])
3069 AC_SUBST(LIB_PREFIX)
3071 dnl ---------------------------------------------------------------------------
3072 dnl CF_LIB_SUFFIX version: 28 updated: 2021/01/01 16:53:59
3074 dnl Compute the library file-suffix from the given model name
3076 dnl $2 = variable to set (the nominal library suffix)
3077 dnl $3 = dependency variable to set (actual filename)
3078 dnl The variable $LIB_SUFFIX, if set, prepends the variable to set.
3079 AC_DEFUN([CF_LIB_SUFFIX],
3087 case "$cf_cv_system_name" in
3098 case "$cf_cv_system_name" in
3109 case "$cf_cv_system_name" in
3118 (cygwin*|msys*|mingw*)
3156 if test -n "${LIB_SUFFIX}${EXTRA_SUFFIX}"
3158 $2="${LIB_SUFFIX}${EXTRA_SUFFIX}[$]{$2}"
3159 $3="${LIB_SUFFIX}${EXTRA_SUFFIX}[$]{$3}"
3162 dnl ---------------------------------------------------------------------------
3163 dnl CF_MAKEFLAGS version: 20 updated: 2021/01/03 19:29:49
3165 dnl Some 'make' programs support ${MAKEFLAGS}, some ${MFLAGS}, to pass 'make'
3166 dnl options to lower-levels. It's very useful for "make -n" -- if we have it.
3167 dnl (GNU 'make' does both, something POSIX 'make', which happens to make the
3168 dnl ${MAKEFLAGS} variable incompatible because it adds the assignments :-)
3169 AC_DEFUN([CF_MAKEFLAGS],
3170 [AC_REQUIRE([AC_PROG_FGREP])dnl
3172 AC_CACHE_CHECK(for makeflags variable, cf_cv_makeflags,[
3174 for cf_option in '-${MAKEFLAGS}' '${MFLAGS}'
3176 cat >cf_makeflags.tmp <<CF_EOF
3179 @ echo '.$cf_option'
3181 cf_result=`${MAKE:-make} -k -f cf_makeflags.tmp 2>/dev/null | ${FGREP-fgrep} -v "ing directory" | sed -e 's,[[ ]]*$,,'`
3182 case "$cf_result" in
3184 cf_result="`${MAKE:-make} -k -f cf_makeflags.tmp CC=cc 2>/dev/null`"
3185 case "$cf_result" in
3186 (.*CC=*) cf_cv_makeflags=
3188 (*) cf_cv_makeflags=$cf_option
3196 CF_MSG_LOG(given option \"$cf_option\", no match \"$cf_result\")
3200 rm -f cf_makeflags.tmp
3203 AC_SUBST(cf_cv_makeflags)
3205 dnl ---------------------------------------------------------------------------
3206 dnl CF_MAKE_TAGS version: 6 updated: 2010/10/23 15:52:32
3208 dnl Generate tags/TAGS targets for makefiles. Do not generate TAGS if we have
3209 dnl a monocase filesystem.
3210 AC_DEFUN([CF_MAKE_TAGS],[
3211 AC_REQUIRE([CF_MIXEDCASE_FILENAMES])
3213 AC_CHECK_PROGS(CTAGS, exctags ctags)
3214 AC_CHECK_PROGS(ETAGS, exetags etags)
3216 AC_CHECK_PROG(MAKE_LOWER_TAGS, ${CTAGS:-ctags}, yes, no)
3218 if test "$cf_cv_mixedcase" = yes ; then
3219 AC_CHECK_PROG(MAKE_UPPER_TAGS, ${ETAGS:-etags}, yes, no)
3224 if test "$MAKE_UPPER_TAGS" = yes ; then
3230 if test "$MAKE_LOWER_TAGS" = yes ; then
3239 AC_SUBST(MAKE_UPPER_TAGS)
3240 AC_SUBST(MAKE_LOWER_TAGS)
3242 dnl ---------------------------------------------------------------------------
3243 dnl CF_MATH_LIB version: 10 updated: 2020/12/31 18:40:20
3245 dnl Checks for libraries. At least one UNIX system, Apple Macintosh
3246 dnl Rhapsody 5.5, does not have -lm. We cannot use the simpler
3247 dnl AC_CHECK_LIB(m,sin), because that fails for C++.
3248 AC_DEFUN([CF_MATH_LIB],
3250 AC_CACHE_CHECK(if -lm needed for math functions,
3257 [double x = rand(); printf("result = %g\\n", ]ifelse([$2],,sin(x),$2)[)],
3258 [cf_cv_need_libm=no],
3259 [cf_cv_need_libm=yes])])
3260 if test "$cf_cv_need_libm" = yes
3267 dnl ---------------------------------------------------------------------------
3268 dnl CF_MBSTATE_T version: 5 updated: 2020/03/19 20:23:48
3270 dnl Check if mbstate_t is declared, and if so, which header file.
3271 dnl This (including wchar.h) is needed on Tru64 5.0 to declare mbstate_t,
3272 dnl as well as include stdio.h to work around a misuse of varargs in wchar.h
3273 AC_DEFUN([CF_MBSTATE_T],
3275 AC_CACHE_CHECK(if we must include wchar.h to declare mbstate_t,cf_cv_mbstate_t,[
3279 #ifdef HAVE_LIBUTF8_H
3280 #include <libutf8.h>
3282 [mbstate_t state; (void)state],
3283 [cf_cv_mbstate_t=no],
3288 #ifdef HAVE_LIBUTF8_H
3289 #include <libutf8.h>
3291 [mbstate_t value; (void)value],
3292 [cf_cv_mbstate_t=yes],
3293 [cf_cv_mbstate_t=unknown])])])
3295 if test "$cf_cv_mbstate_t" = yes ; then
3296 AC_DEFINE(NEED_WCHAR_H,1,[Define to 1 if we must include wchar.h])
3299 if test "$cf_cv_mbstate_t" != unknown ; then
3300 AC_DEFINE(HAVE_MBSTATE_T,1,[Define to 1 if mbstate_t is declared])
3303 dnl ---------------------------------------------------------------------------
3304 dnl CF_MERGE_EXTRA_CFLAGS version: 2 updated: 2021/01/02 09:31:20
3305 dnl ---------------------
3306 dnl CF_FIX_WARNINGS moves problematic flags into EXTRA_CFLAGS, but some scripts
3307 dnl may depend on being able to override that variable at build-time. Move it
3309 define([CF_MERGE_EXTRA_CFLAGS],[
3310 if test "$GCC" = yes || test "$GXX" = yes
3312 CF_APPEND_TEXT(CFLAGS,$EXTRA_CFLAGS)
3316 dnl ---------------------------------------------------------------------------
3317 dnl CF_MIXEDCASE_FILENAMES version: 9 updated: 2021/01/01 16:53:59
3318 dnl ----------------------
3319 dnl Check if the file-system supports mixed-case filenames. If we're able to
3320 dnl create a lowercase name and see it as uppercase, it doesn't support that.
3321 AC_DEFUN([CF_MIXEDCASE_FILENAMES],
3323 AC_CACHE_CHECK(if filesystem supports mixed-case filenames,cf_cv_mixedcase,[
3324 if test "$cross_compiling" = yes ; then
3325 case "$target_alias" in
3326 (*-os2-emx*|*-msdosdjgpp*|*-cygwin*|*-msys*|*-mingw*|*-uwin*|darwin*)
3334 rm -f conftest CONFTEST
3336 if test -f CONFTEST ; then
3341 rm -f conftest CONFTEST
3344 test "$cf_cv_mixedcase" = yes && AC_DEFINE(MIXEDCASE_FILENAMES,1,[Define to 1 if filesystem supports mixed-case filenames.])
3346 dnl ---------------------------------------------------------------------------
3347 dnl CF_MSG_LOG version: 5 updated: 2010/10/23 15:52:32
3349 dnl Write a debug message to config.log, along with the line number in the
3350 dnl configure script.
3351 AC_DEFUN([CF_MSG_LOG],[
3352 echo "${as_me:-configure}:__oline__: testing $* ..." 1>&AC_FD_CC
3354 dnl ---------------------------------------------------------------------------
3355 dnl CF_NCURSES_CC_CHECK version: 5 updated: 2020/12/31 20:19:42
3356 dnl -------------------
3357 dnl Check if we can compile with ncurses' header file
3358 dnl $1 is the cache variable to set
3359 dnl $2 is the header-file to include
3360 dnl $3 is the root name (ncurses or ncursesw)
3361 AC_DEFUN([CF_NCURSES_CC_CHECK],[
3363 ]ifelse($3,ncursesw,[
3364 #define _XOPEN_SOURCE_EXTENDED
3365 #undef HAVE_LIBUTF8_H /* in case we used CF_UTF8_LIB */
3366 #define HAVE_LIBUTF8_H /* to force ncurses' header file to use cchar_t */
3369 #ifdef NCURSES_VERSION
3370 ]ifelse($3,ncursesw,[
3375 printf("%s\\n", NCURSES_VERSION);
3387 dnl ---------------------------------------------------------------------------
3388 dnl CF_NCURSES_CONFIG version: 26 updated: 2021/01/03 08:05:37
3389 dnl -----------------
3390 dnl Tie together the configure-script macros for ncurses, preferring these in
3392 dnl a) ".pc" files for pkg-config, using $NCURSES_CONFIG_PKG
3393 dnl b) the "-config" script from ncurses, using $NCURSES_CONFIG
3394 dnl c) just plain libraries
3396 dnl $1 is the root library name (default: "ncurses")
3397 AC_DEFUN([CF_NCURSES_CONFIG],[
3398 AC_REQUIRE([CF_PKG_CONFIG])
3399 cf_ncuconfig_root=ifelse($1,,ncurses,$1)
3400 cf_have_ncuconfig=no
3402 if test "x${PKG_CONFIG:=none}" != xnone; then
3403 AC_MSG_CHECKING(pkg-config for $cf_ncuconfig_root)
3404 if "$PKG_CONFIG" --exists $cf_ncuconfig_root ; then
3407 AC_MSG_CHECKING(if the $cf_ncuconfig_root package files work)
3408 cf_have_ncuconfig=unknown
3410 cf_save_CFLAGS="$CFLAGS"
3411 cf_save_CPPFLAGS="$CPPFLAGS"
3412 cf_save_LIBS="$LIBS"
3414 cf_pkg_cflags="`$PKG_CONFIG --cflags $cf_ncuconfig_root`"
3415 cf_pkg_libs="`$PKG_CONFIG --libs $cf_ncuconfig_root`"
3417 # while -W for passing linker flags is prevalent, it is not "standard".
3418 # At least one wrapper for c89/c99 (in Apple's xcode) has its own
3419 # incompatible _and_ non-standard -W option which gives an error. Work
3420 # around that pitfall.
3421 case "x${CC}@@${cf_pkg_libs}@${cf_pkg_cflags}" in
3423 CF_ADD_CFLAGS($cf_pkg_cflags)
3424 CF_ADD_LIBS($cf_pkg_libs)
3426 AC_TRY_LINK([#include <${cf_cv_ncurses_header:-curses.h}>],
3427 [initscr(); mousemask(0,0); tigetstr((char *)0);],
3428 [AC_TRY_RUN([#include <${cf_cv_ncurses_header:-curses.h}>
3430 { char *xx = curses_version(); return (xx == 0); }],
3431 [cf_test_ncuconfig=yes],
3432 [cf_test_ncuconfig=no],
3433 [cf_test_ncuconfig=maybe])],
3434 [cf_test_ncuconfig=no])
3436 CFLAGS="$cf_save_CFLAGS"
3437 CPPFLAGS="$cf_save_CPPFLAGS"
3438 LIBS="$cf_save_LIBS"
3440 if test "x$cf_test_ncuconfig" != xyes; then
3441 cf_temp=`echo "x$cf_pkg_cflags" | sed -e s/^x// -e 's/-W[[^ ]]*//g'`
3442 cf_pkg_cflags="$cf_temp"
3443 cf_temp=`echo "x$cf_pkg_libs" | sed -e s/^x// -e 's/-W[[^ ]]*//g'`
3444 cf_pkg_libs="$cf_temp"
3449 CF_ADD_CFLAGS($cf_pkg_cflags)
3450 CF_ADD_LIBS($cf_pkg_libs)
3452 AC_TRY_LINK([#include <${cf_cv_ncurses_header:-curses.h}>],
3453 [initscr(); mousemask(0,0); tigetstr((char *)0);],
3454 [AC_TRY_RUN([#include <${cf_cv_ncurses_header:-curses.h}>
3456 { char *xx = curses_version(); return (xx == 0); }],
3457 [cf_have_ncuconfig=yes],
3458 [cf_have_ncuconfig=no],
3459 [cf_have_ncuconfig=maybe])],
3460 [cf_have_ncuconfig=no])
3461 AC_MSG_RESULT($cf_have_ncuconfig)
3462 test "$cf_have_ncuconfig" = maybe && cf_have_ncuconfig=yes
3463 if test "$cf_have_ncuconfig" != "yes"
3465 CPPFLAGS="$cf_save_CPPFLAGS"
3466 LIBS="$cf_save_LIBS"
3467 NCURSES_CONFIG_PKG=none
3469 AC_DEFINE(NCURSES,1,[Define to 1 if we are using ncurses headers/libraries])
3470 NCURSES_CONFIG_PKG=$cf_ncuconfig_root
3476 NCURSES_CONFIG_PKG=none
3479 NCURSES_CONFIG_PKG=none
3482 if test "x$cf_have_ncuconfig" = "xno"; then
3483 cf_ncurses_config="${cf_ncuconfig_root}${NCURSES_CONFIG_SUFFIX}-config"; echo "Looking for ${cf_ncurses_config}"
3485 CF_ACVERSION_CHECK(2.52,
3486 [AC_CHECK_TOOLS(NCURSES_CONFIG, ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config, none)],
3487 [AC_PATH_PROGS(NCURSES_CONFIG, ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config, none)])
3489 if test "$NCURSES_CONFIG" != none ; then
3491 CF_ADD_CFLAGS(`$NCURSES_CONFIG --cflags`)
3492 CF_ADD_LIBS(`$NCURSES_CONFIG --libs`)
3494 # even with config script, some packages use no-override for curses.h
3495 CF_CURSES_HEADER(ifelse($1,,ncurses,$1))
3497 dnl like CF_NCURSES_CPPFLAGS
3498 AC_DEFINE(NCURSES,1,[Define to 1 if we are using ncurses headers/libraries])
3500 dnl like CF_NCURSES_LIBS
3501 CF_UPPER(cf_nculib_ROOT,HAVE_LIB$cf_ncuconfig_root)
3502 AC_DEFINE_UNQUOTED($cf_nculib_ROOT)
3504 dnl like CF_NCURSES_VERSION
3505 cf_cv_ncurses_version="`$NCURSES_CONFIG --version`"
3509 CF_NCURSES_CPPFLAGS(ifelse($1,,ncurses,$1))
3510 CF_NCURSES_LIBS(ifelse($1,,ncurses,$1))
3517 dnl ---------------------------------------------------------------------------
3518 dnl CF_NCURSES_CPPFLAGS version: 22 updated: 2021/01/02 09:31:20
3519 dnl -------------------
3520 dnl Look for the SVr4 curses clone 'ncurses' in the standard places, adjusting
3521 dnl the CPPFLAGS variable so we can include its header.
3523 dnl The header files may be installed as either curses.h, or ncurses.h (would
3524 dnl be obsolete, except that some packagers prefer this name to distinguish it
3525 dnl from a "native" curses implementation). If not installed for overwrite,
3526 dnl the curses.h file would be in an ncurses subdirectory (e.g.,
3527 dnl /usr/include/ncurses), but someone may have installed overwriting the
3528 dnl vendor's curses. Only very old versions (pre-1.9.2d, the first autoconf'd
3529 dnl version) of ncurses don't define either __NCURSES_H or NCURSES_VERSION in
3532 dnl If the installer has set $CFLAGS or $CPPFLAGS so that the ncurses header
3533 dnl is already in the include-path, don't even bother with this, since we cannot
3534 dnl easily determine which file it is. In this case, it has to be <curses.h>.
3536 dnl The optional parameter gives the root name of the library, in case it is
3537 dnl not installed as the default curses library. That is how the
3538 dnl wide-character version of ncurses is installed.
3539 AC_DEFUN([CF_NCURSES_CPPFLAGS],
3540 [AC_REQUIRE([CF_WITH_CURSES_DIR])
3542 AC_PROVIDE([CF_CURSES_CPPFLAGS])dnl
3543 cf_ncuhdr_root=ifelse($1,,ncurses,$1)
3545 test -n "$cf_cv_curses_dir" && \
3546 test "$cf_cv_curses_dir" != "no" && { \
3547 CF_ADD_INCDIR($cf_cv_curses_dir/include/$cf_ncuhdr_root)
3550 AC_CACHE_CHECK(for $cf_ncuhdr_root header in include-path, cf_cv_ncurses_h,[
3551 cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
3552 { test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw; } && cf_header_list="$cf_header_list curses.h ncurses.h"
3553 for cf_header in $cf_header_list
3555 CF_NCURSES_CC_CHECK(cf_cv_ncurses_h,$cf_header,$1)
3556 test "$cf_cv_ncurses_h" != no && break
3563 # some applications need this, but should check for NCURSES_VERSION
3564 AC_DEFINE(NCURSES,1,[Define to 1 if we are using ncurses headers/libraries])
3568 dnl ---------------------------------------------------------------------------
3569 dnl CF_NCURSES_HEADER version: 7 updated: 2021/01/04 19:33:05
3570 dnl -----------------
3571 dnl Find a "curses" header file, e.g,. "curses.h", or one of the more common
3572 dnl variations of ncurses' installs.
3574 dnl See also CF_CURSES_HEADER, which sets the same cache variable.
3575 AC_DEFUN([CF_NCURSES_HEADER],[
3577 if test "$cf_cv_ncurses_h" != no ; then
3578 cf_cv_ncurses_header=$cf_cv_ncurses_h
3581 AC_CACHE_CHECK(for $cf_ncuhdr_root include-path, cf_cv_ncurses_h2,[
3582 test -n "$verbose" && echo
3583 CF_HEADER_PATH(cf_search,$cf_ncuhdr_root)
3584 test -n "$verbose" && echo "search path $cf_search"
3585 cf_save2_CPPFLAGS="$CPPFLAGS"
3586 for cf_incdir in $cf_search
3588 CF_ADD_INCDIR($cf_incdir)
3593 CF_NCURSES_CC_CHECK(cf_cv_ncurses_h2,$cf_header,$1)
3594 if test "$cf_cv_ncurses_h2" != no ; then
3595 cf_cv_ncurses_h2=$cf_incdir/$cf_header
3596 test -n "$verbose" && echo $ECHO_N " ... found $ECHO_C" 1>&AC_FD_MSG
3599 test -n "$verbose" && echo " ... tested $cf_incdir/$cf_header" 1>&AC_FD_MSG
3601 CPPFLAGS="$cf_save2_CPPFLAGS"
3602 test "$cf_cv_ncurses_h2" != no && break
3604 test "$cf_cv_ncurses_h2" = no && AC_MSG_ERROR(not found)
3607 CF_DIRNAME(cf_1st_incdir,$cf_cv_ncurses_h2)
3608 cf_cv_ncurses_header="`basename "$cf_cv_ncurses_h2"`"
3609 if test "`basename "$cf_1st_incdir"`" = "$cf_ncuhdr_root" ; then
3610 cf_cv_ncurses_header="$cf_ncuhdr_root/$cf_cv_ncurses_header"
3612 CF_ADD_INCDIR($cf_1st_incdir)
3616 # Set definitions to allow ifdef'ing for ncurses.h
3618 case "$cf_cv_ncurses_header" in
3620 AC_DEFINE(HAVE_NCURSES_H,1,[Define to 1 if we have ncurses.h])
3624 case "$cf_cv_ncurses_header" in
3625 (ncurses/curses.h|ncurses/ncurses.h)
3626 AC_DEFINE(HAVE_NCURSES_NCURSES_H,1,[Define to 1 if we have ncurses/ncurses.h])
3628 (ncursesw/curses.h|ncursesw/ncurses.h)
3629 AC_DEFINE(HAVE_NCURSESW_NCURSES_H,1,[Define to 1 if we have ncursesw/ncurses.h])
3634 dnl ---------------------------------------------------------------------------
3635 dnl CF_NCURSES_LIBS version: 20 updated: 2021/01/03 08:05:37
3637 dnl Look for the ncurses library. This is a little complicated on Linux,
3638 dnl because it may be linked with the gpm (general purpose mouse) library.
3639 dnl Some distributions have gpm linked with (bsd) curses, which makes it
3640 dnl unusable with ncurses. However, we don't want to link with gpm unless
3641 dnl ncurses has a dependency, since gpm is normally set up as a shared library,
3642 dnl and the linker will record a dependency.
3644 dnl The optional parameter gives the root name of the library, in case it is
3645 dnl not installed as the default curses library. That is how the
3646 dnl wide-character version of ncurses is installed.
3647 AC_DEFUN([CF_NCURSES_LIBS],
3648 [AC_REQUIRE([CF_NCURSES_CPPFLAGS])
3650 cf_nculib_root=ifelse($1,,ncurses,$1)
3651 # This works, except for the special case where we find gpm, but
3652 # ncurses is in a nonstandard location via $LIBS, and we really want
3655 cf_ncurses_SAVE="$LIBS"
3656 AC_CHECK_LIB(gpm,Gpm_Open,
3657 [AC_CHECK_LIB(gpm,initscr,
3658 [LIBS="$cf_ncurses_SAVE"],
3659 [cf_ncurses_LIBS="-lgpm"])])
3663 # This is only necessary if you are linking against an obsolete
3664 # version of ncurses (but it should do no harm, since it's static).
3665 if test "$cf_nculib_root" = ncurses ; then
3666 AC_CHECK_LIB(mytinfo,tgoto,[cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"])
3671 CF_ADD_LIBS($cf_ncurses_LIBS)
3673 if test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no"
3675 CF_ADD_LIBS(-l$cf_nculib_root)
3677 CF_FIND_LIBRARY($cf_nculib_root,$cf_nculib_root,
3678 [#include <${cf_cv_ncurses_header:-curses.h}>],
3683 if test -n "$cf_ncurses_LIBS" ; then
3684 AC_MSG_CHECKING(if we can link $cf_nculib_root without $cf_ncurses_LIBS)
3685 cf_ncurses_SAVE="$LIBS"
3686 for p in $cf_ncurses_LIBS ; do
3687 q=`echo "$LIBS" | sed -e "s%$p %%" -e "s%$p$%%"`
3688 if test "$q" != "$LIBS" ; then
3692 AC_TRY_LINK([#include <${cf_cv_ncurses_header:-curses.h}>],
3693 [initscr(); mousemask(0,0); tigetstr((char *)0);],
3694 [AC_MSG_RESULT(yes)],
3696 LIBS="$cf_ncurses_SAVE"])
3699 CF_UPPER(cf_nculib_ROOT,HAVE_LIB$cf_nculib_root)
3700 AC_DEFINE_UNQUOTED($cf_nculib_ROOT)
3702 dnl ---------------------------------------------------------------------------
3703 dnl CF_NCURSES_PTHREADS version: 2 updated: 2016/04/22 05:07:41
3704 dnl -------------------
3705 dnl Use this followup check to ensure that we link with pthreads if ncurses
3707 AC_DEFUN([CF_NCURSES_PTHREADS],[
3708 : ${cf_nculib_root:=ifelse($1,,ncurses,$1)}
3709 AC_CHECK_LIB($cf_nculib_root,_nc_init_pthreads,
3710 cf_cv_ncurses_pthreads=yes,
3711 cf_cv_ncurses_pthreads=no)
3712 if test "$cf_cv_ncurses_pthreads" = yes
3714 CF_ADD_LIBS(-lpthread)
3717 dnl ---------------------------------------------------------------------------
3718 dnl CF_NCURSES_VERSION version: 16 updated: 2020/12/31 20:19:42
3719 dnl ------------------
3720 dnl Check for the version of ncurses, to aid in reporting bugs, etc.
3721 dnl Call CF_CURSES_CPPFLAGS first, or CF_NCURSES_CPPFLAGS. We don't use
3722 dnl AC_REQUIRE since that does not work with the shell's if/then/else/fi.
3723 AC_DEFUN([CF_NCURSES_VERSION],
3725 AC_REQUIRE([CF_CURSES_CPPFLAGS])dnl
3726 AC_CACHE_CHECK(for ncurses version, cf_cv_ncurses_version,[
3727 cf_cv_ncurses_version=no
3729 rm -f "$cf_tempfile"
3731 #include <${cf_cv_ncurses_header:-curses.h}>
3735 FILE *fp = fopen("$cf_tempfile", "w");
3736 #ifdef NCURSES_VERSION
3737 # ifdef NCURSES_VERSION_PATCH
3738 fprintf(fp, "%s.%d\\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
3740 fprintf(fp, "%s\\n", NCURSES_VERSION);
3744 fprintf(fp, "old\\n");
3749 ${cf_cv_main_return:-return}(0);
3751 cf_cv_ncurses_version=`cat $cf_tempfile`],,[
3753 # This will not work if the preprocessor splits the line after the
3754 # Autoconf token. The 'unproto' program does that.
3755 cat > "conftest.$ac_ext" <<EOF
3756 #include <${cf_cv_ncurses_header:-curses.h}>
3758 #ifdef NCURSES_VERSION
3759 Autoconf NCURSES_VERSION
3767 cf_try="$ac_cpp conftest.$ac_ext 2>&AC_FD_CC | grep '^Autoconf ' >conftest.out"
3769 if test -f conftest.out ; then
3770 cf_out=`sed -e 's%^Autoconf %%' -e 's%^[[^"]]*"%%' -e 's%".*%%' conftest.out`
3771 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
3775 rm -f "$cf_tempfile"
3777 test "$cf_cv_ncurses_version" = no || AC_DEFINE(NCURSES,1,[Define to 1 if we are using ncurses headers/libraries])
3779 dnl ---------------------------------------------------------------------------
3780 dnl CF_NL_LANGINFO_1STDAY version: 3 updated: 2020/03/19 20:23:48
3781 dnl ---------------------
3782 dnl glibc locale support has runtime extensions which might be implemented in
3784 AC_DEFUN([CF_NL_LANGINFO_1STDAY],[
3785 AC_CACHE_CHECK(if runtime has nl_langinfo support for first weekday,
3786 cf_nl_langinfo_1stday,[
3788 #include <langinfo.h>
3791 int first_weekday = nl_langinfo (_NL_TIME_FIRST_WEEKDAY)[0];
3792 long week_1stday_l = (long) nl_langinfo (_NL_TIME_WEEK_1STDAY);
3793 (void) first_weekday;
3794 (void) week_1stday_l;
3795 ],[cf_nl_langinfo_1stday=yes
3796 ],[cf_nl_langinfo_1stday=no
3799 test "x$cf_nl_langinfo_1stday" = xyes && AC_DEFINE(HAVE_NL_LANGINFO_1STDAY,1,[Define to 1 if runtime has nl_langinfo support for first weekday])
3801 dnl ---------------------------------------------------------------------------
3802 dnl CF_NO_LEAKS_OPTION version: 8 updated: 2021/01/05 20:05:09
3803 dnl ------------------
3804 dnl see CF_WITH_NO_LEAKS
3805 AC_DEFUN([CF_NO_LEAKS_OPTION],[
3806 AC_MSG_CHECKING(if you want to use $1 for testing)
3809 [AC_DEFINE_UNQUOTED($3,1,"Define to 1 if you want to use $1 for testing.")ifelse([$4],,[
3812 : "${with_cflags:=-g}"
3813 : "${enable_leaks:=no}"
3816 AC_MSG_RESULT(${with_$1:-no})
3818 case ".$with_cflags" in
3830 dnl ---------------------------------------------------------------------------
3831 dnl CF_NUMBER_SYNTAX version: 2 updated: 2015/04/17 21:13:04
3832 dnl ----------------
3833 dnl Check if the given variable is a number. If not, report an error.
3834 dnl $1 is the variable
3835 dnl $2 is the message
3836 AC_DEFUN([CF_NUMBER_SYNTAX],[
3837 if test -n "$1" ; then
3842 AC_MSG_ERROR($2 is not a number: $1)
3846 AC_MSG_ERROR($2 value is empty)
3849 dnl ---------------------------------------------------------------------------
3850 dnl CF_OUR_MESSAGES version: 8 updated: 2021/01/02 09:31:20
3852 dnl Check if we use the messages included with this program
3854 dnl $1 specifies either Makefile or makefile, defaulting to the former.
3856 dnl Sets variables which can be used to substitute in makefiles:
3857 dnl MSG_DIR_MAKE - to make ./po directory
3858 dnl SUB_MAKEFILE - makefile in ./po directory (see CF_BUNDLED_INTL)
3860 AC_DEFUN([CF_OUR_MESSAGES],
3862 cf_makefile=ifelse($1,,Makefile,$1)
3865 if test "$USE_NLS" = yes ; then
3866 if test -d "$srcdir/po" ; then
3867 AC_MSG_CHECKING(if we should use included message-library)
3868 AC_ARG_ENABLE(included-msgs,
3869 [ --disable-included-msgs use included messages, for i18n support],
3870 [use_our_messages=$enableval],
3871 [use_our_messages=yes])
3873 AC_MSG_RESULT($use_our_messages)
3877 if test "$use_our_messages" = yes
3879 SUB_MAKEFILE="$SUB_MAKEFILE po/$cf_makefile.in:$srcdir/po/$cf_makefile.inn"
3883 AC_SUBST(MSG_DIR_MAKE)
3884 AC_SUBST(SUB_MAKEFILE)
3886 dnl ---------------------------------------------------------------------------
3887 dnl CF_PATHSEP version: 8 updated: 2021/01/01 13:31:04
3889 dnl Provide a value for the $PATH and similar separator (or amend the value
3890 dnl as provided in autoconf 2.5x).
3891 AC_DEFUN([CF_PATHSEP],
3893 AC_MSG_CHECKING(for PATH separator)
3894 case "$cf_cv_system_name" in
3895 (os2*) PATH_SEPARATOR=';' ;;
3896 (*) ${PATH_SEPARATOR:=':'} ;;
3898 ifelse([$1],,,[$1=$PATH_SEPARATOR])
3899 AC_SUBST(PATH_SEPARATOR)
3900 AC_MSG_RESULT($PATH_SEPARATOR)
3902 dnl ---------------------------------------------------------------------------
3903 dnl CF_PATH_SYNTAX version: 18 updated: 2020/12/31 18:40:20
3905 dnl Check the argument to see that it looks like a pathname. Rewrite it if it
3906 dnl begins with one of the prefix/exec_prefix variables, and then again if the
3907 dnl result begins with 'NONE'. This is necessary to work around autoconf's
3908 dnl delayed evaluation of those symbols.
3909 AC_DEFUN([CF_PATH_SYNTAX],[
3910 if test "x$prefix" != xNONE; then
3911 cf_path_syntax="$prefix"
3913 cf_path_syntax="$ac_default_prefix"
3917 (.\[$]\(*\)*|.\'*\'*)
3921 (.[[a-zA-Z]]:[[\\/]]*) # OS/2 EMX
3923 (.\[$]\{*prefix\}*|.\[$]\{*dir\}*)
3927 $1=`echo "[$]$1" | sed -e s%NONE%$cf_path_syntax%`
3932 $1=`echo "[$]$1" | sed -e s%NONE%$cf_path_syntax%`
3935 ifelse([$2],,[AC_MSG_ERROR([expected a pathname, not \"[$]$1\"])],$2)
3939 dnl ---------------------------------------------------------------------------
3940 dnl CF_PDCURSES_X11 version: 15 updated: 2021/01/02 09:31:20
3942 dnl Configure for PDCurses' X11 library
3943 AC_DEFUN([CF_PDCURSES_X11],[
3944 AC_REQUIRE([CF_X_ATHENA])
3946 CF_ACVERSION_CHECK(2.52,
3947 [AC_CHECK_TOOLS(XCURSES_CONFIG, xcurses-config, none)],
3948 [AC_PATH_PROGS(XCURSES_CONFIG, xcurses-config, none)])
3950 if test "$XCURSES_CONFIG" != none ; then
3952 CF_ADD_CFLAGS(`$XCURSES_CONFIG --cflags`)
3953 CF_ADD_LIBS(`$XCURSES_CONFIG --libs`)
3955 cf_cv_lib_XCurses=yes
3959 LDFLAGS="$LDFLAGS $X_LIBS"
3960 CF_CHECK_CFLAGS($X_CFLAGS)
3961 AC_CHECK_LIB(X11,XOpenDisplay,
3962 [CF_ADD_LIBS(-lX11)],,
3963 [$X_PRE_LIBS $LIBS $X_EXTRA_LIBS])
3964 AC_CACHE_CHECK(for XCurses library,cf_cv_lib_XCurses,[
3965 CF_ADD_LIBS(-lXCurses)
3967 #include <xcurses.h>
3968 char *XCursesProgramName = "test";
3970 [cf_cv_lib_XCurses=yes],
3971 [cf_cv_lib_XCurses=no])
3976 if test "$cf_cv_lib_XCurses" = yes ; then
3977 AC_DEFINE(UNIX,1,[Define to 1 if using PDCurses on Unix])
3978 AC_DEFINE(XCURSES,1,[Define to 1 if using PDCurses on Unix])
3979 AC_CHECK_HEADER(xcurses.h, AC_DEFINE(HAVE_XCURSES,1,[Define to 1 if using PDCurses on Unix]))
3981 AC_MSG_ERROR(Cannot link with XCurses)
3984 dnl ---------------------------------------------------------------------------
3985 dnl CF_PKG_CONFIG version: 11 updated: 2021/01/01 13:31:04
3987 dnl Check for the package-config program, unless disabled by command-line.
3988 AC_DEFUN([CF_PKG_CONFIG],
3990 AC_MSG_CHECKING(if you want to use pkg-config)
3991 AC_ARG_WITH(pkg-config,
3992 [ --with-pkg-config{=path} enable/disable use of pkg-config],
3993 [cf_pkg_config=$withval],
3994 [cf_pkg_config=yes])
3995 AC_MSG_RESULT($cf_pkg_config)
3997 case "$cf_pkg_config" in
4002 CF_ACVERSION_CHECK(2.52,
4003 [AC_PATH_TOOL(PKG_CONFIG, pkg-config, none)],
4004 [AC_PATH_PROG(PKG_CONFIG, pkg-config, none)])
4011 test -z "$PKG_CONFIG" && PKG_CONFIG=none
4012 if test "$PKG_CONFIG" != none ; then
4013 CF_PATH_SYNTAX(PKG_CONFIG)
4014 elif test "x$cf_pkg_config" != xno ; then
4015 AC_MSG_WARN(pkg-config is not installed)
4018 AC_SUBST(PKG_CONFIG)
4020 dnl ---------------------------------------------------------------------------
4021 dnl CF_POSIX_C_SOURCE version: 11 updated: 2018/12/31 20:46:17
4022 dnl -----------------
4023 dnl Define _POSIX_C_SOURCE to the given level, and _POSIX_SOURCE if needed.
4025 dnl POSIX.1-1990 _POSIX_SOURCE
4026 dnl POSIX.1-1990 and _POSIX_SOURCE and
4027 dnl POSIX.2-1992 C-Language _POSIX_C_SOURCE=2
4029 dnl POSIX.1b-1993 _POSIX_C_SOURCE=199309L
4030 dnl POSIX.1c-1996 _POSIX_C_SOURCE=199506L
4031 dnl X/Open 2000 _POSIX_C_SOURCE=200112L
4034 dnl $1 is the nominal value for _POSIX_C_SOURCE
4035 AC_DEFUN([CF_POSIX_C_SOURCE],
4036 [AC_REQUIRE([CF_POSIX_VISIBLE])dnl
4038 if test "$cf_cv_posix_visible" = no; then
4040 cf_POSIX_C_SOURCE=ifelse([$1],,199506L,[$1])
4042 cf_save_CFLAGS="$CFLAGS"
4043 cf_save_CPPFLAGS="$CPPFLAGS"
4045 CF_REMOVE_DEFINE(cf_trim_CFLAGS,$cf_save_CFLAGS,_POSIX_C_SOURCE)
4046 CF_REMOVE_DEFINE(cf_trim_CPPFLAGS,$cf_save_CPPFLAGS,_POSIX_C_SOURCE)
4048 AC_CACHE_CHECK(if we should define _POSIX_C_SOURCE,cf_cv_posix_c_source,[
4049 CF_MSG_LOG(if the symbol is already defined go no further)
4050 AC_TRY_COMPILE([#include <sys/types.h>],[
4051 #ifndef _POSIX_C_SOURCE
4054 [cf_cv_posix_c_source=no],
4055 [cf_want_posix_source=no
4056 case .$cf_POSIX_C_SOURCE in
4058 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
4061 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
4062 cf_want_posix_source=yes
4065 cf_want_posix_source=yes
4068 if test "$cf_want_posix_source" = yes ; then
4069 AC_TRY_COMPILE([#include <sys/types.h>],[
4070 #ifdef _POSIX_SOURCE
4073 cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE")
4075 CF_MSG_LOG(ifdef from value $cf_POSIX_C_SOURCE)
4076 CFLAGS="$cf_trim_CFLAGS"
4077 CPPFLAGS="$cf_trim_CPPFLAGS"
4078 CF_APPEND_TEXT(CPPFLAGS,$cf_cv_posix_c_source)
4079 CF_MSG_LOG(if the second compile does not leave our definition intact error)
4080 AC_TRY_COMPILE([#include <sys/types.h>],[
4081 #ifndef _POSIX_C_SOURCE
4084 [cf_cv_posix_c_source=no])
4085 CFLAGS="$cf_save_CFLAGS"
4086 CPPFLAGS="$cf_save_CPPFLAGS"
4090 if test "$cf_cv_posix_c_source" != no ; then
4091 CFLAGS="$cf_trim_CFLAGS"
4092 CPPFLAGS="$cf_trim_CPPFLAGS"
4093 CF_ADD_CFLAGS($cf_cv_posix_c_source)
4096 fi # cf_cv_posix_visible
4099 dnl ---------------------------------------------------------------------------
4100 dnl CF_POSIX_VISIBLE version: 1 updated: 2018/12/31 20:46:17
4101 dnl ----------------
4102 dnl POSIX documents test-macros which an application may set before any system
4103 dnl headers are included to make features available.
4105 dnl Some BSD platforms (originally FreeBSD, but copied by a few others)
4106 dnl diverged from POSIX in 2002 by setting symbols which make all of the most
4107 dnl recent features visible in the system header files unless the application
4108 dnl overrides the corresponding test-macros. Doing that introduces portability
4111 dnl This macro makes a special check for the symbols used for this, to avoid a
4112 dnl conflicting definition.
4113 AC_DEFUN([CF_POSIX_VISIBLE],
4115 AC_CACHE_CHECK(if the POSIX test-macros are already defined,cf_cv_posix_visible,[
4116 AC_TRY_COMPILE([#include <stdio.h>],[
4117 #if defined(__POSIX_VISIBLE) && ((__POSIX_VISIBLE - 0L) > 0) \
4118 && defined(__XSI_VISIBLE) && ((__XSI_VISIBLE - 0L) > 0) \
4119 && defined(__BSD_VISIBLE) && ((__BSD_VISIBLE - 0L) > 0) \
4120 && defined(__ISO_C_VISIBLE) && ((__ISO_C_VISIBLE - 0L) > 0)
4121 #error conflicting symbols found
4123 ],[cf_cv_posix_visible=no],[cf_cv_posix_visible=yes])
4126 dnl ---------------------------------------------------------------------------
4127 dnl CF_PROG_AR version: 1 updated: 2009/01/01 20:15:22
4129 dnl Check for archiver "ar".
4130 AC_DEFUN([CF_PROG_AR],[
4131 AC_CHECK_TOOL(AR, ar, ar)
4133 dnl ---------------------------------------------------------------------------
4134 dnl CF_PROG_CC version: 5 updated: 2019/12/31 08:53:54
4136 dnl standard check for CC, plus followup sanity checks
4137 dnl $1 = optional parameter to pass to AC_PROG_CC to specify compiler name
4138 AC_DEFUN([CF_PROG_CC],[
4139 CF_ACVERSION_CHECK(2.53,
4140 [AC_MSG_WARN(this will incorrectly handle gnatgcc choice)
4141 AC_REQUIRE([AC_PROG_CC])],
4143 ifelse($1,,[AC_PROG_CC],[AC_PROG_CC($1)])
4145 CF_ACVERSION_CHECK(2.52,
4150 dnl ---------------------------------------------------------------------------
4151 dnl CF_PROG_EXT version: 15 updated: 2021/01/02 09:31:20
4153 dnl Compute $PROG_EXT, used for non-Unix ports, such as OS/2 EMX.
4154 AC_DEFUN([CF_PROG_EXT],
4156 AC_REQUIRE([CF_CHECK_CACHE])
4157 case "$cf_cv_system_name" in
4159 CFLAGS="$CFLAGS -Zmt"
4160 CF_APPEND_TEXT(CPPFLAGS,-D__ST_MT_ERRNO__)
4161 CXXFLAGS="$CXXFLAGS -Zmt"
4162 # autoconf's macro sets -Zexe and suffix both, which conflict:w
4163 LDFLAGS="$LDFLAGS -Zmt -Zcrtdll"
4173 test -n "$PROG_EXT" && AC_DEFINE_UNQUOTED(PROG_EXT,"$PROG_EXT",[Define to the program extension (normally blank)])
4175 dnl ---------------------------------------------------------------------------
4176 dnl CF_PROG_GROFF version: 3 updated: 2018/01/07 13:16:19
4178 dnl Check if groff is available, for cases (such as html output) where nroff
4180 AC_DEFUN([CF_PROG_GROFF],[
4181 AC_PATH_PROG(GROFF_PATH,groff,no)
4182 AC_PATH_PROGS(NROFF_PATH,nroff mandoc,no)
4183 AC_PATH_PROG(TBL_PATH,tbl,cat)
4184 if test "x$GROFF_PATH" = xno
4192 AC_SUBST(GROFF_NOTE)
4193 AC_SUBST(NROFF_NOTE)
4195 dnl ---------------------------------------------------------------------------
4196 dnl CF_PROG_LINT version: 4 updated: 2019/11/20 18:55:37
4198 AC_DEFUN([CF_PROG_LINT],
4200 AC_CHECK_PROGS(LINT, lint cppcheck splint)
4202 (xcppcheck|x*/cppcheck)
4203 test -z "$LINT_OPTS" && LINT_OPTS="--enable=all"
4208 dnl ---------------------------------------------------------------------------
4209 dnl CF_PROG_LN_S version: 2 updated: 2010/08/14 18:25:37
4211 dnl Combine checks for "ln -s" and "ln -sf", updating $LN_S to include "-f"
4212 dnl option if it is supported.
4213 AC_DEFUN([CF_PROG_LN_S],[
4215 AC_MSG_CHECKING(if $LN_S -f options work)
4217 rm -f conf$$.src conf$$dst
4219 echo first >conf$$.src
4220 if $LN_S -f conf$$.src conf$$.dst 2>/dev/null; then
4225 rm -f conf$$.dst conf$$src
4226 AC_MSG_RESULT($cf_prog_ln_sf)
4228 test "$cf_prog_ln_sf" = yes && LN_S="$LN_S -f"
4230 dnl ---------------------------------------------------------------------------
4231 dnl CF_REMOVE_DEFINE version: 3 updated: 2010/01/09 11:05:50
4232 dnl ----------------
4233 dnl Remove all -U and -D options that refer to the given symbol from a list
4234 dnl of C compiler options. This works around the problem that not all
4235 dnl compilers process -U and -D options from left-to-right, so a -U option
4236 dnl cannot be used to cancel the effect of a preceding -D option.
4238 dnl $1 = target (which could be the same as the source variable)
4239 dnl $2 = source (including '$')
4240 dnl $3 = symbol to remove
4241 define([CF_REMOVE_DEFINE],
4244 sed -e 's/-[[UD]]'"$3"'\(=[[^ ]]*\)\?[[ ]]/ /g' \
4245 -e 's/-[[UD]]'"$3"'\(=[[^ ]]*\)\?[$]//g'`
4247 dnl ---------------------------------------------------------------------------
4248 dnl CF_RESTORE_XTRA_FLAGS version: 1 updated: 2020/01/11 16:47:45
4249 dnl ---------------------
4250 dnl Restore flags saved in CF_SAVE_XTRA_FLAGS
4251 dnl $1 = name of current macro
4252 define([CF_RESTORE_XTRA_FLAGS],
4254 LIBS="$cf_save_LIBS_$1"
4255 CFLAGS="$cf_save_CFLAGS_$1"
4256 CPPFLAGS="$cf_save_CPPFLAGS_$1"
4258 dnl ---------------------------------------------------------------------------
4259 dnl CF_RPATH_HACK version: 13 updated: 2021/01/03 18:30:50
4261 AC_DEFUN([CF_RPATH_HACK],
4262 [AC_REQUIRE([AC_PROG_FGREP])dnl
4263 AC_REQUIRE([CF_LD_RPATH_OPT])dnl
4265 AC_MSG_CHECKING(for updated LDFLAGS)
4266 if test -n "$LD_RPATH_OPT" ; then
4267 AC_MSG_RESULT(maybe)
4269 AC_CHECK_PROGS(cf_ldd_prog,ldd,no)
4270 cf_rpath_list="/usr/lib /lib"
4271 if test "$cf_ldd_prog" != no
4275 AC_TRY_LINK([#include <stdio.h>],
4277 [cf_rpath_oops=`"$cf_ldd_prog" "conftest$ac_exeext" | ${FGREP-fgrep} ' not found' | sed -e 's% =>.*$%%' |sort | uniq`
4278 cf_rpath_list=`"$cf_ldd_prog" "conftest$ac_exeext" | ${FGREP-fgrep} / | sed -e 's%^.*[[ ]]/%/%' -e 's%/[[^/]][[^/]]*$%%' |sort | uniq`])
4280 # If we passed the link-test, but get a "not found" on a given library,
4281 # this could be due to inept reconfiguration of gcc to make it only
4282 # partly honor /usr/local/lib (or whatever). Sometimes this behavior
4283 # is intentional, e.g., installing gcc in /usr/bin and suppressing the
4284 # /usr/local libraries.
4285 if test -n "$cf_rpath_oops"
4287 for cf_rpath_src in $cf_rpath_oops
4289 for cf_rpath_dir in \
4294 if test -f "$cf_rpath_dir/lib/$cf_rpath_src"
4296 CF_VERBOSE(...adding -L$cf_rpath_dir/lib to LDFLAGS for $cf_rpath_src)
4297 LDFLAGS="$LDFLAGS -L$cf_rpath_dir/lib"
4305 CF_VERBOSE(...checking EXTRA_LDFLAGS $EXTRA_LDFLAGS)
4307 CF_RPATH_HACK_2(LDFLAGS)
4308 CF_RPATH_HACK_2(LIBS)
4310 CF_VERBOSE(...checked EXTRA_LDFLAGS $EXTRA_LDFLAGS)
4314 AC_SUBST(EXTRA_LDFLAGS)
4316 dnl ---------------------------------------------------------------------------
4317 dnl CF_RPATH_HACK_2 version: 8 updated: 2021/01/01 13:31:04
4319 dnl Do one set of substitutions for CF_RPATH_HACK, adding an rpath option to
4320 dnl EXTRA_LDFLAGS for each -L option found.
4322 dnl $cf_rpath_list contains a list of directories to ignore.
4324 dnl $1 = variable name to update. The LDFLAGS variable should be the only one,
4325 dnl but LIBS often has misplaced -L options.
4326 AC_DEFUN([CF_RPATH_HACK_2],
4328 CF_VERBOSE(...checking $1 [$]$1)
4331 for cf_rpath_src in [$]$1
4333 case "$cf_rpath_src" in
4336 # check if this refers to a directory which we will ignore
4338 if test -n "$cf_rpath_list"
4340 for cf_rpath_item in $cf_rpath_list
4342 if test "x$cf_rpath_src" = "x-L$cf_rpath_item"
4350 if test "$cf_rpath_skip" = no
4352 # transform the option
4353 if test "$LD_RPATH_OPT" = "-R " ; then
4354 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%-R %"`
4356 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%$LD_RPATH_OPT%"`
4359 # if we have not already added this, add it now
4360 cf_rpath_tst=`echo "$EXTRA_LDFLAGS" | sed -e "s%$cf_rpath_tmp %%"`
4361 if test "x$cf_rpath_tst" = "x$EXTRA_LDFLAGS"
4363 CF_VERBOSE(...Filter $cf_rpath_src ->$cf_rpath_tmp)
4364 EXTRA_LDFLAGS="$cf_rpath_tmp $EXTRA_LDFLAGS"
4369 cf_rpath_dst="$cf_rpath_dst $cf_rpath_src"
4373 CF_VERBOSE(...checked $1 [$]$1)
4374 AC_SUBST(EXTRA_LDFLAGS)
4376 dnl ---------------------------------------------------------------------------
4377 dnl CF_SAVE_XTRA_FLAGS version: 1 updated: 2020/01/11 16:46:44
4378 dnl ------------------
4379 dnl Use this macro to save CFLAGS/CPPFLAGS/LIBS before checks against X headers
4380 dnl and libraries which do not update those variables.
4382 dnl $1 = name of current macro
4383 define([CF_SAVE_XTRA_FLAGS],
4385 cf_save_LIBS_$1="$LIBS"
4386 cf_save_CFLAGS_$1="$CFLAGS"
4387 cf_save_CPPFLAGS_$1="$CPPFLAGS"
4388 LIBS="$LIBS ${X_PRE_LIBS} ${X_LIBS} ${X_EXTRA_LIBS}"
4389 for cf_X_CFLAGS in $X_CFLAGS
4391 case "x$cf_X_CFLAGS" in
4393 CPPFLAGS="$CPPFLAGS $cf_X_CFLAGS"
4396 CFLAGS="$CFLAGS $cf_X_CFLAGS"
4401 dnl ---------------------------------------------------------------------------
4402 dnl CF_SHARED_OPTS version: 105 updated: 2021/01/02 17:09:14
4405 dnl Attempt to determine the appropriate CC/LD options for creating a shared
4409 dnl a) ${LOCAL_LDFLAGS} is used to link executables that will run within
4410 dnl the build-tree, i.e., by making use of the libraries that are compiled in
4411 dnl $rel_builddir/lib We avoid compiling-in a $rel_builddir/lib path for the
4412 dnl shared library since that can lead to unexpected results at runtime.
4413 dnl b) ${LOCAL_LDFLAGS2} has the same intention but assumes that the shared
4414 dnl libraries are compiled in ../../lib
4416 dnl The variable 'cf_cv_do_symlinks' is used to control whether we configure
4417 dnl to install symbolic links to the rel/abi versions of shared libraries.
4419 dnl The variable 'cf_cv_shlib_version' controls whether we use the rel or abi
4420 dnl version when making symbolic links.
4422 dnl The variable 'cf_cv_shlib_version_infix' controls whether shared library
4423 dnl version numbers are infix (ex: libncurses.<ver>.dylib) or postfix
4424 dnl (ex: libncurses.so.<ver>).
4426 dnl Some loaders leave 'so_locations' lying around. It's nice to clean up.
4427 AC_DEFUN([CF_SHARED_OPTS],
4429 AC_REQUIRE([CF_LD_RPATH_OPT])
4435 INSTALL_LIB="-m 644"
4436 : ${rel_builddir:=.}
4444 cf_cv_do_symlinks=no
4446 test "$cf_cv_enable_rpath" = yes && cf_ld_rpath_opt="$LD_RPATH_OPT"
4448 AC_MSG_CHECKING(if release/abi version should be used for shared libs)
4449 AC_ARG_WITH(shlib-version,
4450 [ --with-shlib-version=X Specify rel or abi version for shared libs],
4451 [test -z "$withval" && withval=auto
4454 cf_cv_shlib_version=auto
4457 cf_cv_shlib_version=$withval
4460 AC_MSG_RESULT($withval)
4461 AC_MSG_ERROR([option value must be one of: rel, abi, or auto])
4464 ],[cf_cv_shlib_version=auto])
4465 AC_MSG_RESULT($cf_cv_shlib_version)
4470 # Some less-capable ports of gcc support only -fpic
4474 if test "$GCC" = yes
4478 case "$cf_cv_system_name" in
4479 (*linux*) # e.g., PGI compiler
4485 if test "$cf_try_fPIC" = yes
4487 AC_MSG_CHECKING(which $CC option to use)
4488 cf_save_CFLAGS="$CFLAGS"
4489 for CC_SHARED_OPTS in -fPIC -fpic ''
4491 CFLAGS="$cf_save_CFLAGS $CC_SHARED_OPTS"
4492 AC_TRY_COMPILE([#include <stdio.h>],[int x = 1],[break],[])
4494 AC_MSG_RESULT($CC_SHARED_OPTS)
4495 CFLAGS="$cf_save_CFLAGS"
4498 cf_cv_shlib_version_infix=no
4500 case "$cf_cv_system_name" in
4501 (aix4.[3-9]*|aix[[5-7]]*)
4502 if test "$GCC" = yes; then
4503 CC_SHARED_OPTS='-Wl,-brtl'
4504 MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-brtl -Wl,-blibpath:${RPATH_LIST}:/usr/lib -o [$]@'
4506 CC_SHARED_OPTS='-brtl'
4507 # as well as '-qpic=large -G' or perhaps "-bM:SRE -bnoentry -bexpall"
4508 MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -G -Wl,-brtl -Wl,-blibpath:${RPATH_LIST}:/usr/lib -o [$]@'
4512 MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -o $[@] -Xlinker -soname=`basename $[@]` -nostart -e 0'
4516 MK_SHARED_LIB=$SHELL' '$rel_builddir'/mk_shared_lib.sh [$]@ [$]{CC} [$]{CFLAGS}'
4517 RM_SHARED_OPTS="$RM_SHARED_OPTS $rel_builddir/mk_shared_lib.sh *.dll.a"
4518 cf_cv_shlib_version=cygdll
4519 cf_cv_shlib_version_infix=cygdll
4522 cat >mk_shared_lib.sh <<-CF_EOF
4525 IMPORT_LIB=\`echo "\[$]1" | sed -e 's/cyg/lib/' -e 's/[[0-9]]*\.dll[$]/.dll.a/'\`
4528 Linking shared library
4529 ** SHARED_LIB \[$]SHARED_LIB
4530 ** IMPORT_LIB \[$]IMPORT_LIB
4532 exec \[$]* ${LDFLAGS} -shared -Wl,--out-implib=\[$]{IMPORT_LIB} -Wl,--export-all-symbols -o \[$]{SHARED_LIB}
4534 chmod +x mk_shared_lib.sh
4538 MK_SHARED_LIB=$SHELL' '$rel_builddir'/mk_shared_lib.sh [$]@ [$]{CC} [$]{CFLAGS}'
4539 RM_SHARED_OPTS="$RM_SHARED_OPTS $rel_builddir/mk_shared_lib.sh *.dll.a"
4540 cf_cv_shlib_version=msysdll
4541 cf_cv_shlib_version_infix=msysdll
4544 cat >mk_shared_lib.sh <<-CF_EOF
4547 IMPORT_LIB=\`echo "\[$]1" | sed -e 's/msys-/lib/' -e 's/[[0-9]]*\.dll[$]/.dll.a/'\`
4550 Linking shared library
4551 ** SHARED_LIB \[$]SHARED_LIB
4552 ** IMPORT_LIB \[$]IMPORT_LIB
4554 exec \[$]* ${LDFLAGS} -shared -Wl,--out-implib=\[$]{IMPORT_LIB} -Wl,--export-all-symbols -o \[$]{SHARED_LIB}
4556 chmod +x mk_shared_lib.sh
4559 cf_try_cflags="no-cpp-precomp"
4560 CC_SHARED_OPTS="-dynamic"
4561 MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -dynamiclib -install_name ${libdir}/`basename $[@]` -compatibility_version ${ABI_VERSION} -current_version ${ABI_VERSION} -o $[@]'
4562 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=abi
4563 cf_cv_shlib_version_infix=yes
4564 AC_CACHE_CHECK([if ld -search_paths_first works], cf_cv_ldflags_search_paths_first, [
4565 cf_save_LDFLAGS=$LDFLAGS
4566 LDFLAGS="$LDFLAGS -Wl,-search_paths_first"
4567 AC_TRY_LINK(, [int i;], cf_cv_ldflags_search_paths_first=yes, cf_cv_ldflags_search_paths_first=no)
4568 LDFLAGS=$cf_save_LDFLAGS])
4569 if test "$cf_cv_ldflags_search_paths_first" = yes; then
4570 LDFLAGS="$LDFLAGS -Wl,-search_paths_first"
4574 # HP-UX 8.07 ld lacks "+b" option used for libdir search-list
4575 if test "$GCC" != yes; then
4578 MK_SHARED_LIB='${LD} ${LDFLAGS} -b -o $[@]'
4579 INSTALL_LIB="-m 555"
4582 # (tested with gcc 2.7.2 -- I don't have c89)
4583 if test "$GCC" = yes; then
4584 LD_SHARED_OPTS='-Xlinker +b -Xlinker ${libdir}'
4587 LD_SHARED_OPTS='-Wl,+b,${libdir}'
4589 MK_SHARED_LIB='${LD} ${LDFLAGS} +b ${libdir} -b -o $[@]'
4590 # HP-UX shared libraries must be executable, and should be
4591 # readonly to exploit a quirk in the memory manager.
4592 INSTALL_LIB="-m 555"
4595 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
4596 if test "$cf_cv_shlib_version" = rel; then
4597 cf_shared_soname='`basename $[@] .${REL_VERSION}`.${ABI_VERSION}'
4599 cf_shared_soname='`basename $[@]`'
4602 MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-rpath,${RPATH_LIST} -Wl,-h,'$cf_shared_soname' -o $[@]'
4605 if test "$cf_cv_enable_rpath" = yes ; then
4606 EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
4608 # tested with IRIX 5.2 and 'cc'.
4609 if test "$GCC" != yes; then
4610 CC_SHARED_OPTS='-KPIC'
4611 MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -rdata_shared -soname `basename $[@]` -o $[@]'
4613 MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-soname,`basename $[@]` -o $[@]'
4615 cf_cv_rm_so_locs=yes
4617 (linux*|gnu*|k*bsd*-gnu)
4618 if test "$DFT_LWR_MODEL" = "shared" && test -n "$LD_RPATH_OPT" ; then
4619 LOCAL_LDFLAGS="${LD_RPATH_OPT}\$(LOCAL_LIBDIR)"
4620 LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
4622 if test "$cf_cv_enable_rpath" = yes ; then
4623 EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
4626 MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-soname,'$cf_cv_shared_soname',-stats,-lc -o $[@]'
4629 cf_cv_shlib_version=msvcdll
4630 cf_cv_shlib_version_infix=msvcdll
4633 if test "$DFT_LWR_MODEL" = "shared" ; then
4634 LOCAL_LDFLAGS="-link -dll"
4635 LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
4636 EXTRA_LDFLAGS="-link -dll $EXTRA_LDFLAGS"
4639 MK_SHARED_LIB=$SHELL' '$rel_builddir'/mk_shared_lib.sh [$]@ ${LD} [$]{CFLAGS}'
4640 RM_SHARED_OPTS="$RM_SHARED_OPTS $rel_builddir/mk_shared_lib.sh *.dll.lib"
4641 cat >mk_shared_lib.sh <<-CF_EOF
4644 IMPORT_LIB=\`echo "\[$]1" | sed -e 's/[[0-9]]*\.dll[$]/.dll.lib/'\`
4649 Linking shared library
4650 ** SHARED LIB \$SHARED_LIB
4651 ** IMPORT_LIB \$IMPORT_LIB
4653 args=\$(echo \[$]* | sed -E "s#-l(\w*)#\1.dll.lib#g" | sed -E "s#-L(\w*)#-LIBPATH:\1#g")
4654 exec \$my_ld -DLL -IMPLIB:"\${IMPORT_LIB}" -OUT:"\${SHARED_LIB}" ${LDFLAGS} \$args
4655 mv "\${IMPORT_LIB}" "\${IMPORT_LIB}"
4657 chmod +x mk_shared_lib.sh
4658 cat >mk_prog.sh <<-CF_EOF
4661 # Ignore first argument (compiler) and use LD (link.exe) unconditionally
4664 ldopts=("/subsystem:console")
4667 while test \[$]# -gt 0; do
4670 # ignore -link argument
4672 -M[[TD]] | -M[[TD]]d)
4673 # ignore runtime-library option
4688 libs+=("\`echo \"\[$]1\" | sed \"s/^-l//\"\`")
4691 ldopts+=("\`echo \"\[$]1\" | sed \"s/^-L/-LIBPATH:/\"\`")
4697 for linkarg in \`echo '\[$]1' | sed -e 's/-Wl,//' -e 's/,/ /'\`; do
4698 ldopts+=("\[$]{linkarg}")
4706 ldopts+=("-out:\[$]1")
4715 if [[ "\$isdll" -ne 0 ]]; then
4716 for lib in \[$]{libs[[*]]}; do
4717 ldopts+=("\[$]lib.dll.lib")
4720 for lib in \[$]{libs[[*]]}; do
4721 ldopts+=("\[$]lib.lib")
4726 ** ld options: "\[$]{ldopts[[@]]}"
4728 exec \[$]LD \[$]{ldopts[[@]]}
4731 LINK_PROGS="$SHELL ${rel_builddir}/mk_prog.sh"
4732 LINK_TESTS="$SHELL ${rel_builddir}/mk_prog.sh"
4735 cf_cv_shlib_version=mingw
4736 cf_cv_shlib_version_infix=mingw
4739 if test "$DFT_LWR_MODEL" = "shared" ; then
4740 LOCAL_LDFLAGS="-Wl,--enable-auto-import"
4741 LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
4742 EXTRA_LDFLAGS="-Wl,--enable-auto-import $EXTRA_LDFLAGS"
4745 MK_SHARED_LIB=$SHELL' '$rel_builddir'/mk_shared_lib.sh [$]@ [$]{CC} [$]{CFLAGS}'
4746 RM_SHARED_OPTS="$RM_SHARED_OPTS $rel_builddir/mk_shared_lib.sh *.dll.a"
4747 cat >mk_shared_lib.sh <<-CF_EOF
4750 IMPORT_LIB=\`echo "\[$]1" | sed -e 's/[[0-9]]*\.dll[$]/.dll.a/'\`
4753 Linking shared library
4754 ** SHARED_LIB \[$]SHARED_LIB
4755 ** IMPORT_LIB \[$]IMPORT_LIB
4757 exec \[$]* ${LDFLAGS} -shared -Wl,--enable-auto-import,--out-implib=\[$]{IMPORT_LIB} -Wl,--export-all-symbols -o \[$]{SHARED_LIB}
4759 chmod +x mk_shared_lib.sh
4761 (openbsd[[2-9]].*|mirbsd*)
4762 if test "$DFT_LWR_MODEL" = "shared" && test -n "$LD_RPATH_OPT" ; then
4763 LOCAL_LDFLAGS="${LD_RPATH_OPT}\$(LOCAL_LIBDIR)"
4764 LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
4766 if test "$cf_cv_enable_rpath" = yes ; then
4767 EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
4769 CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
4771 MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-Bshareable,-soname,'$cf_cv_shared_soname',-stats,-lc -o $[@]'
4775 MK_SHARED_LIB='${LD} -Wshared -Weld=-export_all -o $[@]'
4779 MK_SHARED_LIB='${LD} -Wshared -Wxld=-export_all -o $[@]'
4781 (nto-qnx*|openbsd*|freebsd[[12]].*)
4782 CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
4783 MK_SHARED_LIB='${LD} ${LDFLAGS} -Bshareable -o $[@]'
4784 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
4786 (dragonfly*|freebsd*)
4787 CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
4788 if test "$DFT_LWR_MODEL" = "shared" && test "$cf_cv_enable_rpath" = yes ; then
4789 LOCAL_LDFLAGS="${cf_ld_rpath_opt}\$(LOCAL_LIBDIR)"
4790 LOCAL_LDFLAGS2="${cf_ld_rpath_opt}\${RPATH_LIST} $LOCAL_LDFLAGS"
4791 EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
4794 MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-soname,'$cf_cv_shared_soname',-stats,-lc -o $[@]'
4797 CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
4798 if test "$DFT_LWR_MODEL" = "shared" && test "$cf_cv_enable_rpath" = yes ; then
4799 LOCAL_LDFLAGS="${cf_ld_rpath_opt}\$(LOCAL_LIBDIR)"
4800 LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
4801 EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
4802 if test "$cf_cv_shlib_version" = auto; then
4803 if test -f /usr/libexec/ld.elf_so; then
4804 cf_cv_shlib_version=abi
4806 cf_cv_shlib_version=rel
4810 MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-soname,'$cf_cv_shared_soname' -o $[@]'
4812 MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -o $[@]'
4816 # tested with OSF/1 V3.2 and 'cc'
4817 # tested with OSF/1 V3.2 and gcc 2.6.3 (but the c++ demo didn't
4818 # link with shared libs).
4819 MK_SHARED_LIB='${LD} ${LDFLAGS} -set_version ${REL_VERSION}:${ABI_VERSION} -expect_unresolved "*" -shared -soname `basename $[@]`'
4822 MK_SHARED_LIB="${MK_SHARED_LIB} -msym"
4825 MK_SHARED_LIB="${MK_SHARED_LIB}"' -o $[@]'
4826 if test "$DFT_LWR_MODEL" = "shared" && test -n "$LD_RPATH_OPT" ; then
4827 LOCAL_LDFLAGS="${LD_RPATH_OPT}\$(LOCAL_LIBDIR)"
4828 LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
4830 cf_cv_rm_so_locs=yes
4832 (sco3.2v5*) # also uw2* and UW7: hops 13-Apr-98
4833 # tested with osr5.0.5
4834 if test "$GCC" != yes; then
4835 CC_SHARED_OPTS='-belf -KPIC'
4837 MK_SHARED_LIB='${LD} ${LDFLAGS} -dy -G -h `basename $[@] .${REL_VERSION}`.${ABI_VERSION} -o [$]@'
4838 if test "$cf_cv_enable_rpath" = yes ; then
4839 # only way is to set LD_RUN_PATH but no switch for it
4842 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
4843 LINK_PROGS='LD_RUN_PATH=${libdir}'
4844 LINK_TESTS='Pwd=`pwd`;LD_RUN_PATH=`dirname $${Pwd}`/lib'
4847 # tested with SunOS 4.1.1 and gcc 2.7.0
4848 if test "$GCC" != yes; then
4849 CC_SHARED_OPTS='-KPIC'
4851 MK_SHARED_LIB='${LD} ${LDFLAGS} -assert pure-text -o $[@]'
4852 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
4855 # tested with SunOS 5.5.1 (solaris 2.5.1) and gcc 2.7.2
4856 # tested with SunOS 5.10 (solaris 10) and gcc 3.4.3
4857 if test "$DFT_LWR_MODEL" = "shared" ; then
4858 LOCAL_LDFLAGS="-R \$(LOCAL_LIBDIR):\${libdir}"
4859 LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
4861 if test "$cf_cv_enable_rpath" = yes ; then
4862 EXTRA_LDFLAGS="-R \${libdir} $EXTRA_LDFLAGS"
4865 if test "$GCC" != yes; then
4866 cf_save_CFLAGS="$CFLAGS"
4867 for cf_shared_opts in -xcode=pic32 -xcode=pic13 -KPIC -Kpic -O
4869 CFLAGS="$cf_shared_opts $cf_save_CFLAGS"
4870 AC_TRY_COMPILE([#include <stdio.h>],[printf("Hello\\n");],[break])
4872 CFLAGS="$cf_save_CFLAGS"
4873 CC_SHARED_OPTS=$cf_shared_opts
4874 MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -dy -G -h '$cf_cv_shared_soname' -o $[@]'
4876 MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -dy -G -h '$cf_cv_shared_soname' -o $[@]'
4879 (sysv5uw7*|unix_sv*)
4880 # tested with UnixWare 7.1.0 (gcc 2.95.2 and cc)
4881 if test "$GCC" != yes; then
4882 CC_SHARED_OPTS='-KPIC'
4884 MK_SHARED_LIB='${LD} ${LDFLAGS} -d y -G -o [$]@'
4887 CC_SHARED_OPTS='unknown'
4888 MK_SHARED_LIB='echo unknown'
4892 # This works if the last tokens in $MK_SHARED_LIB are the -o target.
4893 case "$cf_cv_shlib_version" in
4895 case "$MK_SHARED_LIB" in
4897 test "$cf_cv_do_symlinks" = no && cf_cv_do_symlinks=yes
4900 AC_MSG_WARN(ignored --with-shlib-version)
4906 if test -n "$cf_try_cflags"
4908 cat > conftest.$ac_ext <<EOF
4909 #line __oline__ "${as_me:-configure}"
4911 int main(int argc, char *argv[[]])
4914 return (argv[[argc-1]] == 0) ;
4917 cf_save_CFLAGS="$CFLAGS"
4918 for cf_opt in $cf_try_cflags
4920 CFLAGS="$cf_save_CFLAGS -$cf_opt"
4921 AC_MSG_CHECKING(if CFLAGS option -$cf_opt works)
4922 if AC_TRY_EVAL(ac_compile); then
4924 cf_save_CFLAGS="$CFLAGS"
4929 CFLAGS="$cf_save_CFLAGS"
4933 # RPATH_LIST is a colon-separated list of directories
4934 test -n "$cf_ld_rpath_opt" && MK_SHARED_LIB="$MK_SHARED_LIB $cf_ld_rpath_opt\${RPATH_LIST}"
4935 test -z "$RPATH_LIST" && RPATH_LIST="\${libdir}"
4937 test "$cf_cv_rm_so_locs" = yes && RM_SHARED_OPTS="$RM_SHARED_OPTS so_locations"
4939 CF_VERBOSE(CC_SHARED_OPTS: $CC_SHARED_OPTS)
4940 CF_VERBOSE(MK_SHARED_LIB: $MK_SHARED_LIB)
4942 AC_SUBST(CC_SHARED_OPTS)
4943 AC_SUBST(LD_RPATH_OPT)
4944 AC_SUBST(LD_SHARED_OPTS)
4945 AC_SUBST(MK_SHARED_LIB)
4946 AC_SUBST(RM_SHARED_OPTS)
4948 AC_SUBST(LINK_PROGS)
4949 AC_SUBST(LINK_TESTS)
4951 AC_SUBST(EXTRA_LDFLAGS)
4952 AC_SUBST(LOCAL_LDFLAGS)
4953 AC_SUBST(LOCAL_LDFLAGS2)
4955 AC_SUBST(INSTALL_LIB)
4956 AC_SUBST(RPATH_LIST)
4958 dnl ---------------------------------------------------------------------------
4959 dnl CF_SHARED_SONAME version: 3 updated: 2008/09/08 18:34:43
4960 dnl ----------------
4961 dnl utility macro for CF_SHARED_OPTS, constructs "$cf_cv_shared_soname" for
4962 dnl substitution into MK_SHARED_LIB string for the "-soname" (or similar)
4965 dnl $1 is the default that should be used for "$cf_cv_shlib_version".
4966 dnl If missing, use "rel".
4967 define([CF_SHARED_SONAME],
4969 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=ifelse($1,,rel,$1)
4970 if test "$cf_cv_shlib_version" = rel; then
4971 cf_cv_shared_soname='`basename $[@] .${REL_VERSION}`.${ABI_VERSION}'
4973 cf_cv_shared_soname='`basename $[@]`'
4976 dnl ---------------------------------------------------------------------------
4977 dnl CF_SIZECHANGE version: 17 updated: 2021/01/01 13:31:04
4979 dnl Check for definitions & structures needed for window size-changing
4981 dnl https://stackoverflow.com/questions/18878141/difference-between-structures-ttysize-and-winsize/50769952#50769952
4982 AC_DEFUN([CF_SIZECHANGE],
4984 AC_REQUIRE([CF_STRUCT_TERMIOS])
4985 AC_CACHE_CHECK(declaration of size-change, cf_cv_sizechange,[
4986 cf_cv_sizechange=unknown
4987 cf_save_CPPFLAGS="$CPPFLAGS"
4989 for cf_opts in "" "NEED_PTEM_H"
4992 CPPFLAGS="$cf_save_CPPFLAGS"
4993 if test -n "$cf_opts"
4995 CF_APPEND_TEXT(CPPFLAGS,-D$cf_opts)
4997 AC_TRY_COMPILE([#include <sys/types.h>
4998 #ifdef HAVE_TERMIOS_H
4999 #include <termios.h>
5001 #ifdef HAVE_TERMIO_H
5007 /* This is a workaround for SCO: they neglected to define struct winsize in
5008 * termios.h -- it's only in termio.h and ptem.h
5010 #include <sys/stream.h>
5011 #include <sys/ptem.h>
5014 #ifdef HAVE_SYS_IOCTL_H
5015 #include <sys/ioctl.h>
5019 struct ttysize win; /* SunOS 3.0... */
5020 int y = win.ts_lines = 2;
5021 int x = win.ts_cols = 1;
5026 struct winsize win; /* everything else */
5027 int y = win.ws_row = 2;
5028 int x = win.ws_col = 1;
5032 no TIOCGSIZE or TIOCGWINSZ
5033 #endif /* TIOCGWINSZ */
5034 #endif /* TIOCGSIZE */
5036 [cf_cv_sizechange=yes],
5037 [cf_cv_sizechange=no])
5039 CPPFLAGS="$cf_save_CPPFLAGS"
5040 if test "$cf_cv_sizechange" = yes ; then
5041 echo "size-change succeeded ($cf_opts)" >&AC_FD_CC
5042 test -n "$cf_opts" && cf_cv_sizechange="$cf_opts"
5047 if test "$cf_cv_sizechange" != no ; then
5048 AC_DEFINE(HAVE_SIZECHANGE,1,[Define to 1 if sizechange declarations are provided])
5049 case "$cf_cv_sizechange" in
5051 AC_DEFINE_UNQUOTED($cf_cv_sizechange )
5056 dnl ---------------------------------------------------------------------------
5057 dnl CF_STRUCT_TERMIOS version: 11 updated: 2020/03/19 20:46:13
5058 dnl -----------------
5059 dnl Some machines require _POSIX_SOURCE to completely define struct termios.
5060 AC_DEFUN([CF_STRUCT_TERMIOS],[
5061 AC_REQUIRE([CF_XOPEN_SOURCE])
5071 if test "$ac_cv_header_termios_h" = yes ; then
5072 case "$CFLAGS $CPPFLAGS" in
5074 termios_bad=dunno ;;
5075 (*) termios_bad=maybe ;;
5077 if test "$termios_bad" = maybe ; then
5078 AC_MSG_CHECKING(whether termios.h needs _POSIX_SOURCE)
5079 AC_TRY_COMPILE([#include <termios.h>],
5080 [struct termios foo; int x = foo.c_iflag = 1; (void)x],
5083 #define _POSIX_SOURCE
5084 #include <termios.h>],
5085 [struct termios foo; int x = foo.c_iflag = 2; (void)x],
5086 termios_bad=unknown,
5087 termios_bad=yes AC_DEFINE(_POSIX_SOURCE,1,[Define to 1 if we must define _POSIX_SOURCE]))
5089 AC_MSG_RESULT($termios_bad)
5093 dnl ---------------------------------------------------------------------------
5094 dnl CF_SUBDIR_PATH version: 7 updated: 2014/12/04 04:33:06
5096 dnl Construct a search-list for a nonstandard header/lib-file
5097 dnl $1 = the variable to return as result
5098 dnl $2 = the package name
5099 dnl $3 = the subdirectory, e.g., bin, include or lib
5100 AC_DEFUN([CF_SUBDIR_PATH],
5104 CF_ADD_SUBDIR_PATH($1,$2,$3,$prefix,NONE)
5106 for cf_subdir_prefix in \
5114 CF_ADD_SUBDIR_PATH($1,$2,$3,$cf_subdir_prefix,$prefix)
5117 dnl ---------------------------------------------------------------------------
5118 dnl CF_TERM_HEADER version: 6 updated: 2021/01/02 09:31:20
5120 dnl Look for term.h, which is part of X/Open curses. It defines the interface
5121 dnl to terminfo database. Usually it is in the same include-path as curses.h,
5122 dnl but some packagers change this, breaking various applications.
5123 AC_DEFUN([CF_TERM_HEADER],[
5124 AC_CACHE_CHECK(for terminfo header, cf_cv_term_header,[
5125 case "${cf_cv_ncurses_header}" in
5126 (*/ncurses.h|*/ncursesw.h)
5127 cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[[^.]]*\.h$%term.h%'`
5130 cf_term_header=term.h
5134 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
5136 AC_TRY_COMPILE([#include <stdio.h>
5137 #include <${cf_cv_ncurses_header:-curses.h}>
5139 ],[int x = auto_left_margin; (void)x],[
5140 cf_cv_term_header="$cf_test"],[
5141 cf_cv_term_header=unknown
5143 test "$cf_cv_term_header" != unknown && break
5147 # Set definitions to allow ifdef'ing to accommodate subdirectories
5149 case "$cf_cv_term_header" in
5151 AC_DEFINE(HAVE_TERM_H,1,[Define to 1 if we have term.h])
5155 case "$cf_cv_term_header" in
5157 AC_DEFINE(HAVE_NCURSES_TERM_H,1,[Define to 1 if we have ncurses/term.h])
5160 AC_DEFINE(HAVE_NCURSESW_TERM_H,1,[Define to 1 if we have ncursesw/term.h])
5164 dnl ---------------------------------------------------------------------------
5165 dnl CF_TRIM_X_LIBS version: 3 updated: 2015/04/12 15:39:00
5167 dnl Trim extra base X libraries added as a workaround for inconsistent library
5168 dnl dependencies returned by "new" pkg-config files.
5169 AC_DEFUN([CF_TRIM_X_LIBS],[
5170 for cf_trim_lib in Xmu Xt X11
5173 (*-l$cf_trim_lib\ *-l$cf_trim_lib*)
5174 LIBS=`echo "$LIBS " | sed -e 's/ / /g' -e 's%-l'"$cf_trim_lib"' %%' -e 's/ $//'`
5175 CF_VERBOSE(..trimmed $LIBS)
5180 dnl ---------------------------------------------------------------------------
5181 dnl CF_TRY_PKG_CONFIG version: 6 updated: 2020/12/31 10:54:15
5182 dnl -----------------
5183 dnl This is a simple wrapper to use for pkg-config, for libraries which may be
5184 dnl available in that form.
5186 dnl $1 = package name, which may be a shell variable
5187 dnl $2 = extra logic to use, if any, after updating CFLAGS and LIBS
5188 dnl $3 = logic to use if pkg-config does not have the package
5189 AC_DEFUN([CF_TRY_PKG_CONFIG],[
5190 AC_REQUIRE([CF_PKG_CONFIG])
5192 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists "$1"; then
5193 CF_VERBOSE(found package $1)
5194 cf_pkgconfig_incs="`$PKG_CONFIG --cflags "$1" 2>/dev/null`"
5195 cf_pkgconfig_libs="`$PKG_CONFIG --libs "$1" 2>/dev/null`"
5196 CF_VERBOSE(package $1 CFLAGS: $cf_pkgconfig_incs)
5197 CF_VERBOSE(package $1 LIBS: $cf_pkgconfig_libs)
5198 CF_ADD_CFLAGS($cf_pkgconfig_incs)
5199 CF_ADD_LIBS($cf_pkgconfig_libs)
5200 ifelse([$2],,:,[$2])
5204 ifelse([$3],,:,[$3])
5207 dnl ---------------------------------------------------------------------------
5208 dnl CF_TRY_XOPEN_SOURCE version: 2 updated: 2018/06/20 20:23:13
5209 dnl -------------------
5210 dnl If _XOPEN_SOURCE is not defined in the compile environment, check if we
5211 dnl can define it successfully.
5212 AC_DEFUN([CF_TRY_XOPEN_SOURCE],[
5213 AC_CACHE_CHECK(if we should define _XOPEN_SOURCE,cf_cv_xopen_source,[
5217 #include <sys/types.h>
5219 #ifndef _XOPEN_SOURCE
5222 [cf_cv_xopen_source=no],
5223 [cf_save="$CPPFLAGS"
5224 CF_APPEND_TEXT(CPPFLAGS,-D_XOPEN_SOURCE=$cf_XOPEN_SOURCE)
5228 #include <sys/types.h>
5230 #ifdef _XOPEN_SOURCE
5233 [cf_cv_xopen_source=no],
5234 [cf_cv_xopen_source=$cf_XOPEN_SOURCE])
5239 if test "$cf_cv_xopen_source" != no ; then
5240 CF_REMOVE_DEFINE(CFLAGS,$CFLAGS,_XOPEN_SOURCE)
5241 CF_REMOVE_DEFINE(CPPFLAGS,$CPPFLAGS,_XOPEN_SOURCE)
5242 cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source"
5243 CF_ADD_CFLAGS($cf_temp_xopen_source)
5246 dnl ---------------------------------------------------------------------------
5247 dnl CF_UNION_WAIT version: 8 updated: 2021/01/02 09:31:20
5249 dnl Check to see if the BSD-style union wait is declared. Some platforms may
5250 dnl use this, though it is deprecated in favor of the 'int' type in Posix.
5251 dnl Some vendors provide a bogus implementation that declares union wait, but
5252 dnl uses the 'int' type instead; we try to spot these by checking for the
5253 dnl associated macros.
5255 dnl Ahem. Some implementers cast the status value to an int*, as an attempt to
5256 dnl use the macros for either union wait or int. So we do a check compile to
5257 dnl see if the macros are defined and apply to an int.
5259 dnl Sets: $cf_cv_type_unionwait
5260 dnl Defines: HAVE_TYPE_UNIONWAIT
5261 AC_DEFUN([CF_UNION_WAIT],
5263 AC_REQUIRE([CF_WAIT_HEADERS])
5264 AC_MSG_CHECKING([for union wait])
5265 AC_CACHE_VAL(cf_cv_type_unionwait,[
5266 AC_TRY_LINK($cf_wait_headers,
5268 int y = WEXITSTATUS(x);
5269 int z = WTERMSIG(x);
5275 [cf_cv_type_unionwait=no
5276 echo compiles ok w/o union wait 1>&AC_FD_CC
5278 AC_TRY_LINK($cf_wait_headers,
5281 int y = WEXITSTATUS(x);
5284 int z = WTERMSIG(x);
5295 [cf_cv_type_unionwait=yes
5296 echo compiles ok with union wait and possibly macros too 1>&AC_FD_CC
5298 [cf_cv_type_unionwait=no])])])
5299 AC_MSG_RESULT($cf_cv_type_unionwait)
5300 test "$cf_cv_type_unionwait" = yes && AC_DEFINE(HAVE_TYPE_UNIONWAIT,1,[Define to 1 if type unionwait is declared])
5302 dnl ---------------------------------------------------------------------------
5303 dnl CF_UPPER version: 5 updated: 2001/01/29 23:40:59
5305 dnl Make an uppercase version of a variable
5306 dnl $1=uppercase($2)
5307 AC_DEFUN([CF_UPPER],
5309 $1=`echo "$2" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
5311 dnl ---------------------------------------------------------------------------
5312 dnl CF_UTF8_LIB version: 8 updated: 2012/10/06 08:57:51
5314 dnl Check for multibyte support, and if not found, utf8 compatibility library
5315 AC_DEFUN([CF_UTF8_LIB],
5317 AC_CACHE_CHECK(for multibyte character support,cf_cv_utf8_lib,[
5318 cf_save_LIBS="$LIBS"
5320 #include <stdlib.h>],[putwc(0,0);],
5321 [cf_cv_utf8_lib=yes],
5323 #include <libutf8.h>],[putwc(0,0);],utf8,
5324 [cf_cv_utf8_lib=add-on],
5325 [cf_cv_utf8_lib=no])
5328 # HAVE_LIBUTF8_H is used by ncurses if curses.h is shared between
5330 if test "$cf_cv_utf8_lib" = "add-on" ; then
5331 AC_DEFINE(HAVE_LIBUTF8_H,1,[Define to 1 if we should include libutf8.h])
5332 CF_ADD_INCDIR($cf_cv_header_path_utf8)
5333 CF_ADD_LIBDIR($cf_cv_library_path_utf8)
5334 CF_ADD_LIBS($cf_cv_library_file_utf8)
5337 dnl ---------------------------------------------------------------------------
5338 dnl CF_VERBOSE version: 3 updated: 2007/07/29 09:55:12
5340 dnl Use AC_VERBOSE w/o the warnings
5341 AC_DEFUN([CF_VERBOSE],
5342 [test -n "$verbose" && echo " $1" 1>&AC_FD_MSG
5345 dnl ---------------------------------------------------------------------------
5346 dnl CF_VERSION_INFO version: 8 updated: 2021/01/01 13:31:04
5348 dnl Define several useful symbols derived from the VERSION file. A separate
5349 dnl file is preferred to embedding the version numbers in various scripts.
5350 dnl (automake is a textbook-example of why the latter is a bad idea, but there
5353 dnl The file contents are:
5354 dnl libtool-version release-version patch-version
5358 dnl libtool-version (see ?) consists of 3 integers separated by '.'
5359 dnl release-version consists of a major version and minor version
5360 dnl separated by '.', optionally followed by a patch-version
5361 dnl separated by '-'. The minor version need not be an
5362 dnl integer (but it is preferred).
5363 dnl patch-version is an integer in the form yyyymmdd, so ifdef's and
5364 dnl scripts can easily compare versions.
5366 dnl If libtool is used, the first form is required, since CF_WITH_LIBTOOL
5367 dnl simply extracts the first field using 'cut -f1'.
5369 dnl Optional parameters:
5370 dnl $1 = internal name for package
5371 dnl $2 = external name for package
5372 AC_DEFUN([CF_VERSION_INFO],
5374 if test -f "$srcdir/VERSION" ; then
5375 AC_MSG_CHECKING(for package version)
5377 # if there are not enough fields, cut returns the last one...
5378 cf_field1=`sed -e '2,$d' "$srcdir/VERSION" |cut -f1`
5379 cf_field2=`sed -e '2,$d' "$srcdir/VERSION" |cut -f2`
5380 cf_field3=`sed -e '2,$d' "$srcdir/VERSION" |cut -f3`
5382 # this is how CF_BUNDLED_INTL uses $VERSION:
5383 VERSION="$cf_field1"
5385 VERSION_MAJOR=`echo "$cf_field2" | sed -e 's/\..*//'`
5386 test -z "$VERSION_MAJOR" && AC_MSG_ERROR(missing major-version)
5388 VERSION_MINOR=`echo "$cf_field2" | sed -e 's/^[[^.]]*\.//' -e 's/-.*//'`
5389 test -z "$VERSION_MINOR" && AC_MSG_ERROR(missing minor-version)
5391 AC_MSG_RESULT(${VERSION_MAJOR}.${VERSION_MINOR})
5393 AC_MSG_CHECKING(for package patch date)
5394 VERSION_PATCH=`echo "$cf_field3" | sed -e 's/^[[^-]]*-//'`
5395 case .$VERSION_PATCH in
5397 AC_MSG_ERROR(missing patch-date $VERSION_PATCH)
5399 (.[[0-9]][[0-9]][[0-9]][[0-9]][[0-9]][[0-9]][[0-9]][[0-9]])
5402 AC_MSG_ERROR(illegal patch-date $VERSION_PATCH)
5405 AC_MSG_RESULT($VERSION_PATCH)
5407 AC_MSG_ERROR(did not find $srcdir/VERSION)
5410 # show the actual data that we have for versions:
5411 CF_VERBOSE(ABI VERSION $VERSION)
5412 CF_VERBOSE(VERSION_MAJOR $VERSION_MAJOR)
5413 CF_VERBOSE(VERSION_MINOR $VERSION_MINOR)
5414 CF_VERBOSE(VERSION_PATCH $VERSION_PATCH)
5417 AC_SUBST(VERSION_MAJOR)
5418 AC_SUBST(VERSION_MINOR)
5419 AC_SUBST(VERSION_PATCH)
5421 dnl if a package name is given, define its corresponding version info. We
5422 dnl need the package name to ensure that the defined symbols are unique.
5425 PACKAGE=ifelse($2,,$1,$2)
5426 AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE",[Define to the package-name])
5428 CF_UPPER(cf_PACKAGE,$cf_PACKAGE)
5429 AC_DEFINE_UNQUOTED(${cf_PACKAGE}_VERSION,"${VERSION_MAJOR}.${VERSION_MINOR}")
5430 AC_DEFINE_UNQUOTED(${cf_PACKAGE}_PATCHDATE,${VERSION_PATCH})
5433 dnl ---------------------------------------------------------------------------
5434 dnl CF_WAIT_HEADERS version: 3 updated: 2021/01/02 09:31:20
5436 dnl Build up an expression $cf_wait_headers with the header files needed to
5437 dnl compile against the prototypes for 'wait()', 'waitpid()', etc. Assume it's
5438 dnl Posix, which uses <sys/types.h> and <sys/wait.h>, but allow SVr4 variation
5440 AC_DEFUN([CF_WAIT_HEADERS],
5442 AC_HAVE_HEADERS(sys/wait.h)
5443 cf_wait_headers="#include <sys/types.h>
5445 if test "$ac_cv_header_sys_wait_h" = yes; then
5446 cf_wait_headers="$cf_wait_headers
5447 #include <sys/wait.h>
5450 AC_HAVE_HEADERS(wait.h)
5451 AC_HAVE_HEADERS(waitstatus.h)
5452 if test "$ac_cv_header_wait_h" = yes; then
5453 cf_wait_headers="$cf_wait_headers
5457 if test "$ac_cv_header_waitstatus_h" = yes; then
5458 cf_wait_headers="$cf_wait_headers
5459 #include <waitstatus.h>
5464 dnl ---------------------------------------------------------------------------
5465 dnl CF_WIDEC_CURSES version: 6 updated: 2020/03/19 20:23:48
5467 dnl Check for curses implementations that can handle wide-characters
5468 AC_DEFUN([CF_WIDEC_CURSES],
5470 AC_CACHE_CHECK(if curses supports wide characters,cf_cv_widec_curses,[
5473 #include <${cf_cv_ncurses_header:-curses.h}>],[
5477 waddnwstr(stdscr, temp, 1);
5479 [cf_cv_widec_curses=yes],
5480 [cf_cv_widec_curses=no])
5483 if test "$cf_cv_widec_curses" = yes ; then
5484 AC_DEFINE(WIDEC_CURSES,1,[Define to 1 if curses supports wide characters])
5486 # This is needed on Tru64 5.0 to declare mbstate_t
5487 AC_CACHE_CHECK(if we must include wchar.h to declare mbstate_t,cf_cv_widec_mbstate,[
5490 #include <${cf_cv_ncurses_header:-curses.h}>],
5491 [mbstate_t state; (void)state],
5492 [cf_cv_widec_mbstate=no],
5496 #include <${cf_cv_ncurses_header:-curses.h}>],
5497 [mbstate_t state; (void)state],
5498 [cf_cv_widec_mbstate=yes],
5499 [cf_cv_widec_mbstate=unknown])])])
5501 if test "$cf_cv_widec_mbstate" = yes ; then
5502 AC_DEFINE(NEED_WCHAR_H,1,[Define to 1 if we must include wchar.h])
5505 if test "$cf_cv_widec_mbstate" != unknown ; then
5506 AC_DEFINE(HAVE_MBSTATE_T,1,[Define to 1 if we have mbstate_t type])
5511 dnl ---------------------------------------------------------------------------
5512 dnl CF_WITH_ABI_VERSION version: 4 updated: 2021/01/01 13:31:04
5513 dnl -------------------
5514 dnl Allow library's ABI to be overridden. Generally this happens when a
5515 dnl packager has incremented the ABI past that used in the original package,
5516 dnl and wishes to keep doing this.
5518 dnl $1 is the package name, if any, to derive a corresponding {package}_ABI
5520 AC_DEFUN([CF_WITH_ABI_VERSION],[
5521 test -z "$cf_cv_abi_version" && cf_cv_abi_version=0
5522 AC_ARG_WITH(abi-version,
5523 [ --with-abi-version=XXX override derived ABI version],[
5524 if test "x$cf_cv_abi_version" != "x$withval"
5526 AC_MSG_WARN(overriding ABI version $cf_cv_abi_version to $withval)
5527 case "$cf_cv_rel_version" in
5529 cf_cv_rel_version=$withval.0
5532 cf_cv_rel_version=$withval.9 # FIXME: should be 10 as of 6.0 release
5536 cf_cv_abi_version=$withval])
5537 CF_NUMBER_SYNTAX($cf_cv_abi_version,ABI version)
5539 $1_ABI=$cf_cv_abi_version
5542 dnl ---------------------------------------------------------------------------
5543 dnl CF_WITH_CURSES_DIR version: 4 updated: 2021/01/02 19:22:58
5544 dnl ------------------
5545 dnl Wrapper for AC_ARG_WITH to specify directory under which to look for curses
5547 AC_DEFUN([CF_WITH_CURSES_DIR],[
5549 AC_MSG_CHECKING(for specific curses-directory)
5550 AC_ARG_WITH(curses-dir,
5551 [ --with-curses-dir=DIR directory in which (n)curses is installed],
5552 [cf_cv_curses_dir=$withval],
5553 [cf_cv_curses_dir=no])
5554 AC_MSG_RESULT($cf_cv_curses_dir)
5556 if test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no"
5558 CF_PATH_SYNTAX(withval)
5559 if test -d "$cf_cv_curses_dir"
5561 CF_ADD_INCDIR($cf_cv_curses_dir/include)
5562 CF_ADD_LIBDIR($cf_cv_curses_dir/lib)
5566 dnl ---------------------------------------------------------------------------
5567 dnl CF_WITH_DBMALLOC version: 7 updated: 2010/06/21 17:26:47
5568 dnl ----------------
5569 dnl Configure-option for dbmalloc. The optional parameter is used to override
5570 dnl the updating of $LIBS, e.g., to avoid conflict with subsequent tests.
5571 AC_DEFUN([CF_WITH_DBMALLOC],[
5572 CF_NO_LEAKS_OPTION(dbmalloc,
5573 [ --with-dbmalloc test: use Conor Cahill's dbmalloc library],
5576 if test "$with_dbmalloc" = yes ; then
5577 AC_CHECK_HEADER(dbmalloc.h,
5578 [AC_CHECK_LIB(dbmalloc,[debug_malloc]ifelse([$1],,[],[,$1]))])
5581 dnl ---------------------------------------------------------------------------
5582 dnl CF_WITH_DMALLOC version: 7 updated: 2010/06/21 17:26:47
5584 dnl Configure-option for dmalloc. The optional parameter is used to override
5585 dnl the updating of $LIBS, e.g., to avoid conflict with subsequent tests.
5586 AC_DEFUN([CF_WITH_DMALLOC],[
5587 CF_NO_LEAKS_OPTION(dmalloc,
5588 [ --with-dmalloc test: use Gray Watson's dmalloc library],
5591 if test "$with_dmalloc" = yes ; then
5592 AC_CHECK_HEADER(dmalloc.h,
5593 [AC_CHECK_LIB(dmalloc,[dmalloc_debug]ifelse([$1],,[],[,$1]))])
5596 dnl ---------------------------------------------------------------------------
5597 dnl CF_WITH_EXPORT_SYMS version: 3 updated: 2014/12/20 19:16:08
5598 dnl -------------------
5599 dnl Use this with libtool to specify the list of symbols that may be exported.
5600 dnl The input file contains one symbol per line; comments work with "#".
5602 dnl $1 = basename of the ".sym" file (default $PACKAGE)
5603 AC_DEFUN([CF_WITH_EXPORT_SYMS],
5605 AC_MSG_CHECKING(if exported-symbols file should be used)
5606 AC_ARG_WITH(export-syms,
5607 [ --with-export-syms=XXX limit exported symbols using libtool],
5608 [with_export_syms=$withval],
5609 [with_export_syms=no])
5610 if test "x$with_export_syms" = xyes
5612 with_export_syms='${top_srcdir}/package/ifelse($1,,${PACKAGE},[$1]).sym'
5615 AC_MSG_RESULT($with_export_syms)
5616 if test "x$with_export_syms" != xno
5618 EXPORT_SYMS="-export-symbols $with_export_syms"
5619 AC_SUBST(EXPORT_SYMS)
5622 dnl ---------------------------------------------------------------------------
5623 dnl CF_WITH_INSTALL_PREFIX version: 4 updated: 2010/10/23 15:52:32
5624 dnl ----------------------
5625 dnl Configure-script option to give a default value for the poorly-chosen name
5627 AC_DEFUN([CF_WITH_INSTALL_PREFIX],
5629 AC_MSG_CHECKING(for install-prefix)
5630 AC_ARG_WITH(install-prefix,
5631 [ --with-install-prefix=XXX sets DESTDIR, useful for packaging],
5632 [cf_opt_with_install_prefix=$withval],
5633 [cf_opt_with_install_prefix=${DESTDIR:-no}])
5634 AC_MSG_RESULT($cf_opt_with_install_prefix)
5635 if test "$cf_opt_with_install_prefix" != no ; then
5636 CF_PATH_SYNTAX(cf_opt_with_install_prefix)
5637 DESTDIR=$cf_opt_with_install_prefix
5641 dnl ---------------------------------------------------------------------------
5642 dnl CF_WITH_LIBTOOL version: 36 updated: 2021/01/01 13:31:04
5644 dnl Provide a configure option to incorporate libtool. Define several useful
5645 dnl symbols for the makefile rules.
5647 dnl The reference to AC_PROG_LIBTOOL does not normally work, since it uses
5648 dnl macros from libtool.m4 which is in the aclocal directory of automake.
5649 dnl Following is a simple script which turns on the AC_PROG_LIBTOOL macro.
5650 dnl But that still does not work properly since the macro is expanded outside
5651 dnl the CF_WITH_LIBTOOL macro:
5654 dnl ACLOCAL=`aclocal --print-ac-dir`
5655 dnl if test -z "$ACLOCAL" ; then
5656 dnl echo cannot find aclocal directory
5658 dnl elif test ! -f $ACLOCAL/libtool.m4 ; then
5659 dnl echo cannot find libtool.m4 file
5663 dnl LOCAL=aclocal.m4
5664 dnl ORIG=aclocal.m4.orig
5666 dnl trap "mv $ORIG $LOCAL" 0 1 2 3 15
5670 dnl # sed the LIBTOOL= assignment to omit the current directory?
5671 dnl sed -e 's/^LIBTOOL=.*/LIBTOOL=${LIBTOOL:-libtool}/' $ACLOCAL/libtool.m4 >>$LOCAL
5672 dnl cat $ORIG >>$LOCAL
5676 AC_DEFUN([CF_WITH_LIBTOOL],
5678 AC_REQUIRE([CF_DISABLE_LIBTOOL_VERSION])
5679 ifdef([AC_PROG_LIBTOOL],,[
5682 # common library maintenance symbols that are convenient for libtool scripts:
5683 LIB_CREATE='${AR} -cr'
5684 LIB_OBJECT='${OBJECTS}'
5688 # symbols used to prop libtool up to enable it to determine what it should be
5696 AC_MSG_CHECKING(if you want to build libraries with libtool)
5697 AC_ARG_WITH(libtool,
5698 [ --with-libtool generate libraries with libtool],
5699 [with_libtool=$withval],
5701 AC_MSG_RESULT($with_libtool)
5702 if test "$with_libtool" != "no"; then
5703 ifdef([AC_PROG_LIBTOOL],[
5704 # missing_content_AC_PROG_LIBTOOL{{
5706 # missing_content_AC_PROG_LIBTOOL}}
5708 if test "$with_libtool" != "yes" ; then
5709 CF_PATH_SYNTAX(with_libtool)
5710 LIBTOOL=$with_libtool
5712 AC_CHECK_TOOLS(LIBTOOL,[libtool glibtool],none)
5714 if test -z "$cf_cv_libtool_version" && test "$LIBTOOL" = libtool
5716 CF_FORGET_TOOL(LIBTOOL)
5717 AC_CHECK_TOOLS(LIBTOOL,[glibtool],none)
5721 if test -z "$LIBTOOL" ; then
5722 AC_MSG_ERROR(Cannot find libtool)
5725 LIB_CREATE='${LIBTOOL} --mode=link ${CC} -rpath ${libdir} ${LIBTOOL_VERSION} `cut -f1 ${top_srcdir}/VERSION` ${LIBTOOL_OPTS} ${LT_UNDEF} $(LIBS) -o'
5726 LIB_OBJECT='${OBJECTS:.o=.lo}'
5728 LIB_CLEAN='${LIBTOOL} --mode=clean'
5729 LIB_COMPILE='${LIBTOOL} --mode=compile'
5730 LIB_LINK='${LIBTOOL} --mode=link ${CC} ${LIBTOOL_OPTS}'
5731 LIB_INSTALL='${LIBTOOL} --mode=install'
5732 LIB_UNINSTALL='${LIBTOOL} --mode=uninstall'
5735 CF_CHECK_LIBTOOL_VERSION
5737 # special hack to add -no-undefined (which libtool should do for itself)
5739 case "$cf_cv_system_name" in
5740 (cygwin*|msys*|mingw32*|os2*|uwin*|aix[[4-7]])
5741 LT_UNDEF=-no-undefined
5744 AC_SUBST([LT_UNDEF])
5746 # special hack to add --tag option for C++ compiler
5747 case "$cf_cv_libtool_version" in
5748 (1.[[5-9]]*|[[2-9]].[[0-9.a-z]]*)
5749 LIBTOOL_CXX="$LIBTOOL --tag=CXX"
5750 LIBTOOL="$LIBTOOL --tag=CC"
5753 LIBTOOL_CXX="$LIBTOOL"
5761 test -z "$LIBTOOL" && ECHO_LT=
5764 AC_SUBST(LIBTOOL_CXX)
5765 AC_SUBST(LIBTOOL_OPTS)
5767 AC_SUBST(LIB_CREATE)
5768 AC_SUBST(LIB_OBJECT)
5769 AC_SUBST(LIB_SUFFIX)
5773 AC_SUBST(LIB_COMPILE)
5775 AC_SUBST(LIB_INSTALL)
5776 AC_SUBST(LIB_UNINSTALL)
5779 dnl ---------------------------------------------------------------------------
5780 dnl CF_WITH_LIBTOOL_OPTS version: 4 updated: 2015/04/17 21:13:04
5781 dnl --------------------
5782 dnl Allow user to pass additional libtool options into the library creation
5783 dnl and link steps. The main use for this is to do something like
5784 dnl ./configure --with-libtool-opts=-static
5785 dnl to get the same behavior as automake-flavored
5786 dnl ./configure --enable-static
5787 AC_DEFUN([CF_WITH_LIBTOOL_OPTS],[
5788 AC_MSG_CHECKING(for additional libtool options)
5789 AC_ARG_WITH(libtool-opts,
5790 [ --with-libtool-opts=XXX specify additional libtool options],
5791 [with_libtool_opts=$withval],
5792 [with_libtool_opts=no])
5793 AC_MSG_RESULT($with_libtool_opts)
5795 case .$with_libtool_opts in
5799 LIBTOOL_OPTS="$LIBTOOL_OPTS $with_libtool_opts"
5803 AC_SUBST(LIBTOOL_OPTS)
5805 dnl ---------------------------------------------------------------------------
5806 dnl CF_WITH_MAN2HTML version: 12 updated: 2021/01/03 18:30:50
5807 dnl ----------------
5808 dnl Check for man2html and groff. Prefer man2html over groff, but use groff
5809 dnl as a fallback. See
5811 dnl http://invisible-island.net/scripts/man2html.html
5813 dnl Generate a shell script which hides the differences between the two.
5815 dnl We name that "man2html.tmp".
5817 dnl The shell script can be removed later, e.g., using "make distclean".
5818 AC_DEFUN([CF_WITH_MAN2HTML],[
5819 AC_REQUIRE([CF_PROG_GROFF])dnl
5820 AC_REQUIRE([AC_PROG_FGREP])dnl
5822 case "x${with_man2html}" in
5827 AC_PATH_PROG(cf_man2html,man2html,no)
5828 case "x$cf_man2html" in
5830 AC_MSG_CHECKING(for the modified Earl Hood script)
5831 if ( $cf_man2html -help 2>&1 | grep 'Make an index of headers at the end' >/dev/null )
5838 AC_MSG_RESULT($cf_man2html_ok)
5846 AC_MSG_CHECKING(for program to convert manpage to html)
5847 AC_ARG_WITH(man2html,
5848 [ --with-man2html=XXX use XXX rather than groff],
5849 [cf_man2html=$withval],
5850 [cf_man2html=$cf_man2html])
5854 case $cf_man2html in
5856 AC_MSG_RESULT(man2html)
5857 AC_PATH_PROG(cf_man2html,man2html,no)
5861 cf_man2html=$GROFF_PATH
5862 AC_MSG_RESULT($cf_man2html)
5865 AC_MSG_RESULT($cf_man2html)
5869 MAN2HTML_TEMP="man2html.tmp"
5870 cat >$MAN2HTML_TEMP <<CF_EOF
5872 # Temporary script generated by CF_WITH_MAN2HTML
5873 # Convert inputs to html, sending result to standard output.
5876 # \${1} = rootname of file to convert
5877 # \${2} = suffix of file to convert, e.g., "1"
5878 # \${3} = macros to use, e.g., "man"
5894 if test "x$cf_with_groff" = xyes
5896 MAN2HTML_NOTE="$GROFF_NOTE"
5897 MAN2HTML_PATH="$GROFF_PATH"
5898 cat >>$MAN2HTML_TEMP <<CF_EOF
5899 $SHELL -c "$TBL_PATH \${ROOT}.\${TYPE} | $GROFF_PATH -P -o0 -I\${ROOT}_ -Thtml -\${MACS}"
5902 # disable hyphenation if this is groff
5903 if test "x$GROFF_PATH" != xno
5905 AC_MSG_CHECKING(if nroff is really groff)
5906 cf_check_groff="`$NROFF_PATH --version 2>/dev/null | grep groff`"
5907 test -n "$cf_check_groff" && cf_check_groff=yes
5908 test -n "$cf_check_groff" || cf_check_groff=no
5909 AC_MSG_RESULT($cf_check_groff)
5910 test "x$cf_check_groff" = xyes && NROFF_OPTS="-rHY=0"
5913 CF_PATH_SYNTAX(cf_man2html)
5914 MAN2HTML_PATH="$cf_man2html"
5915 AC_MSG_CHECKING(for $cf_man2html top/bottom margins)
5917 # for this example, expect 3 lines of content, the remainder is head/foot
5918 cat >conftest.in <<CF_EOF
5919 .TH HEAD1 HEAD2 HEAD3 HEAD4 HEAD5
5924 LC_ALL=C LC_CTYPE=C LANG=C LANGUAGE=C $NROFF_PATH -man conftest.in >conftest.out
5926 cf_man2html_1st="`${FGREP-fgrep} -n MARKER conftest.out |sed -e 's/^[[^0-9]]*://' -e 's/:.*//'`"
5927 cf_man2html_top=`expr "$cf_man2html_1st" - 2`
5928 cf_man2html_bot="`wc -l conftest.out |sed -e 's/[[^0-9]]//g'`"
5929 cf_man2html_bot=`expr "$cf_man2html_bot" - 2 - "$cf_man2html_top"`
5930 cf_man2html_top_bot="-topm=$cf_man2html_top -botm=$cf_man2html_bot"
5932 AC_MSG_RESULT($cf_man2html_top_bot)
5934 AC_MSG_CHECKING(for pagesize to use)
5935 for cf_block in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
5937 cat >>conftest.in <<CF_EOF
5952 LC_ALL=C LC_CTYPE=C LANG=C LANGUAGE=C $NROFF_PATH -man conftest.in >conftest.out
5953 cf_man2html_page="`${FGREP-fgrep} -n HEAD1 conftest.out |sed -n '$p' |sed -e 's/^[[^0-9]]*://' -e 's/:.*//'`"
5954 test -z "$cf_man2html_page" && cf_man2html_page=99999
5955 test "$cf_man2html_page" -gt 100 && cf_man2html_page=99999
5958 AC_MSG_RESULT($cf_man2html_page)
5960 cat >>$MAN2HTML_TEMP <<CF_EOF
5961 : \${MAN2HTML_PATH=$MAN2HTML_PATH}
5962 MAN2HTML_OPTS="\$MAN2HTML_OPTS -index -title=\"\$ROOT(\$TYPE)\" -compress -pgsize $cf_man2html_page"
5965 $TBL_PATH \${ROOT}.\${TYPE} | $NROFF_PATH $NROFF_OPTS -\${MACS} | \$MAN2HTML_PATH -topm=0 -botm=0 \$MAN2HTML_OPTS
5968 $TBL_PATH \${ROOT}.\${TYPE} | $NROFF_PATH $NROFF_OPTS -\${MACS} | \$MAN2HTML_PATH $cf_man2html_top_bot \$MAN2HTML_OPTS
5974 chmod 700 $MAN2HTML_TEMP
5976 AC_SUBST(MAN2HTML_NOTE)
5977 AC_SUBST(MAN2HTML_PATH)
5978 AC_SUBST(MAN2HTML_TEMP)
5980 dnl ---------------------------------------------------------------------------
5981 dnl CF_WITH_NCURSES_ETC version: 5 updated: 2016/02/20 19:23:20
5982 dnl -------------------
5983 dnl Use this macro for programs which use any variant of "curses", e.g.,
5984 dnl "ncurses", and "PDCurses". Programs that can use curses and some unrelated
5985 dnl library (such as slang) should use a "--with-screen=XXX" option.
5987 dnl This does not use AC_DEFUN, because that would tell autoconf to run each
5988 dnl of the macros inside this one - before this macro.
5989 define([CF_WITH_NCURSES_ETC],[
5994 AC_MSG_CHECKING(for specified curses library type)
5996 [ --with-screen=XXX use specified curses-libraries],
5997 [cf_cv_screen=$withval],[
5999 AC_ARG_WITH(ncursesw,
6000 [ --with-ncursesw use wide ncurses-libraries],
6001 [cf_cv_screen=ncursesw],[
6003 AC_ARG_WITH(ncurses,
6004 [ --with-ncurses use ncurses-libraries],
6005 [cf_cv_screen=ncurses],[
6007 AC_ARG_WITH(pdcurses,
6008 [ --with-pdcurses compile/link with pdcurses X11 library],
6009 [cf_cv_screen=pdcurses],[
6011 AC_ARG_WITH(curses-colr,
6012 [ --with-curses-colr compile/link with HPUX 10.x color-curses],
6013 [cf_cv_screen=curses_colr],[
6015 AC_ARG_WITH(curses-5lib,
6016 [ --with-curses-5lib compile/link with SunOS 5lib curses],
6017 [cf_cv_screen=curses_5lib])])])])])])
6019 AC_MSG_RESULT($cf_cv_screen)
6021 case $cf_cv_screen in
6027 CF_NCURSES_CONFIG($cf_cv_screen)
6030 CF_NCURSES_CONFIG($cf_cv_screen)
6036 AC_MSG_ERROR(unexpected screen-value: $cf_cv_screen)
6040 CF_NCURSES_PTHREADS($cf_cv_screen)
6043 dnl ---------------------------------------------------------------------------
6044 dnl CF_WITH_NO_LEAKS version: 4 updated: 2021/01/05 20:08:11
6045 dnl ----------------
6046 AC_DEFUN([CF_WITH_NO_LEAKS],[
6048 AC_REQUIRE([CF_WITH_DMALLOC])
6049 AC_REQUIRE([CF_WITH_DBMALLOC])
6050 AC_REQUIRE([CF_WITH_PURIFY])
6051 AC_REQUIRE([CF_WITH_VALGRIND])
6053 AC_MSG_CHECKING(if you want to perform memory-leak testing)
6054 AC_ARG_WITH(no-leaks,
6055 [ --with-no-leaks test: free permanent memory, analyze leaks],
6056 [AC_DEFINE(NO_LEAKS,1,[Define to 1 to enable leak-checking])
6057 cf_doalloc=".${with_dmalloc}${with_dbmalloc}${with_purify}${with_valgrind}"
6058 case ${cf_doalloc} in
6060 (*) AC_DEFINE(DOALLOC,10000,[Define to size of malloc-array]) ;;
6064 dnl TODO - drop with_no_leaks
6065 if test "x$enable_leaks" = xno; then with_no_leaks=yes; else with_no_leaks=no; fi
6066 AC_MSG_RESULT($with_no_leaks)
6068 dnl ---------------------------------------------------------------------------
6069 dnl CF_WITH_PURIFY version: 2 updated: 2006/12/14 18:43:43
6071 AC_DEFUN([CF_WITH_PURIFY],[
6072 CF_NO_LEAKS_OPTION(purify,
6073 [ --with-purify test: use Purify],
6075 [LINK_PREFIX="$LINK_PREFIX purify"])
6076 AC_SUBST(LINK_PREFIX)
6078 dnl ---------------------------------------------------------------------------
6079 dnl CF_WITH_REL_VERSION version: 1 updated: 2003/09/20 18:12:49
6080 dnl -------------------
6081 dnl Allow library's release-version to be overridden. Generally this happens when a
6082 dnl packager has incremented the release-version past that used in the original package,
6083 dnl and wishes to keep doing this.
6085 dnl $1 is the package name, if any, to derive corresponding {package}_MAJOR
6086 dnl and {package}_MINOR symbols
6088 AC_DEFUN([CF_WITH_REL_VERSION],[
6089 test -z "$cf_cv_rel_version" && cf_cv_rel_version=0.0
6090 AC_ARG_WITH(rel-version,
6091 [ --with-rel-version=XXX override derived release version],
6092 [AC_MSG_WARN(overriding release version $cf_cv_rel_version to $withval)
6093 cf_cv_rel_version=$withval])
6095 CF_NUMBER_SYNTAX($cf_cv_rel_version,Release version)
6097 $1_MAJOR=`echo "$cf_cv_rel_version" | sed -e 's/\..*//'`
6098 $1_MINOR=`echo "$cf_cv_rel_version" | sed -e 's/^[[^.]]*//' -e 's/^\.//' -e 's/\..*//'`
6099 CF_NUMBER_SYNTAX([$]$1_MAJOR,Release major-version)
6100 CF_NUMBER_SYNTAX([$]$1_MINOR,Release minor-version)
6103 dnl ---------------------------------------------------------------------------
6104 dnl CF_WITH_SCREEN_PDCURSES version: 1 updated: 2020/08/28 16:56:27
6105 dnl -----------------------
6106 dnl Call this macro before CF_ENABLE_WARNINGS for configure scripts which use
6107 dnl the "--with-screen=pdcurses" selection. Doing that allows the configure
6108 dnl script to search for the X11/Xt header files to declare (or not) the
6109 dnl symbol needed to enable "const" in those header files. If that configure
6110 dnl option is not used, then those checks are unnecessary.
6111 AC_DEFUN([CF_WITH_SCREEN_PDCURSES],[
6112 AC_PROVIDE([AC_PATH_XTRA])
6113 AC_PROVIDE([AC_PATH_X])
6114 if test -n "$with_screen" && test "x$with_screen" = "xpdcurses"
6120 dnl ---------------------------------------------------------------------------
6121 dnl CF_WITH_SHARED_OR_LIBTOOL version: 7 updated: 2014/11/02 16:11:49
6122 dnl -------------------------
6123 dnl Provide shared libraries using either autoconf macros (--with-shared) or
6124 dnl using the external libtool script (--with-libtool).
6126 dnl $1 = program name (all caps preferred)
6127 dnl $1 = release version
6128 dnl $2 = ABI version
6129 define([CF_WITH_SHARED_OR_LIBTOOL],[
6133 cf_cv_rel_version=$REL_VERSION
6134 AC_SUBST(ABI_VERSION)
6135 AC_SUBST(REL_VERSION)
6137 CF_WITH_REL_VERSION($1)
6141 DFT_LWR_MODEL=$LIB_MODEL
6144 # use to comment-out makefile lines
6155 LIB_CREATE="$LIB_CREATE \[$]@"
6157 if test "$with_libtool" = "yes" ; then
6160 DFT_LWR_MODEL=$LIB_MODEL
6162 CF_WITH_LIBTOOL_OPTS
6168 AC_MSG_CHECKING(if you want to build shared libraries)
6170 [ --with-shared generate shared-libraries],
6171 [with_shared=$withval],
6173 AC_MSG_RESULT($with_shared)
6174 if test "$with_shared" = "yes" ; then
6176 DFT_LWR_MODEL=$LIB_MODEL
6178 CF_WITH_VERSIONED_SYMS
6180 LIB_CREATE="[$]MK_SHARED_LIB"
6181 CFLAGS="$CFLAGS $CC_SHARED_OPTS"
6189 CF_LIB_SUFFIX($LIB_MODEL, DFT_LIB_SUFFIX, DFT_DEP_SUFFIX)
6190 LIB_SUFFIX=$DFT_LIB_SUFFIX
6192 AC_SUBST(DFT_LWR_MODEL)
6193 AC_SUBST(DFT_LIB_SUFFIX)
6194 AC_SUBST(DFT_DEP_SUFFIX)
6197 AC_SUBST(LIBTOOL_MAKE)
6200 AC_SUBST(MAKE_NORMAL)
6201 AC_SUBST(MAKE_SHARED)
6202 AC_SUBST(MAKE_STATIC)
6204 dnl ---------------------------------------------------------------------------
6205 dnl CF_WITH_VALGRIND version: 1 updated: 2006/12/14 18:00:21
6206 dnl ----------------
6207 AC_DEFUN([CF_WITH_VALGRIND],[
6208 CF_NO_LEAKS_OPTION(valgrind,
6209 [ --with-valgrind test: use valgrind],
6212 dnl ---------------------------------------------------------------------------
6213 dnl CF_WITH_VERSIONED_SYMS version: 10 updated: 2021/01/04 18:48:01
6214 dnl ----------------------
6215 dnl Use this when building shared library with ELF, to markup symbols with the
6216 dnl version identifier from the given input file. Generally that identifier is
6217 dnl the same as the SONAME at which the symbol was first introduced.
6219 dnl $1 = basename of the ".map" file (default $PACKAGE)
6220 AC_DEFUN([CF_WITH_VERSIONED_SYMS],
6221 [AC_REQUIRE([AC_PROG_FGREP])dnl
6222 AC_REQUIRE([AC_PROG_EGREP])dnl
6224 AC_MSG_CHECKING(if versioned-symbols file should be used)
6225 AC_ARG_WITH(versioned-syms,
6226 [ --with-versioned-syms=X markup versioned symbols using ld],
6227 [with_versioned_syms=$withval],
6228 [with_versioned_syms=no])
6229 case "x$with_versioned_syms" in
6231 with_versioned_syms='${top_srcdir}/package/ifelse($1,,${PACKAGE},[$1]).map'
6237 test -f "$with_versioned_syms" || AC_MSG_ERROR(expected a filename: $with_versioned_syms)
6240 test -f "$with_versioned_syms" || AC_MSG_ERROR(expected a filename: $with_versioned_syms)
6241 with_versioned_syms=`pwd`/"$with_versioned_syms"
6244 AC_MSG_RESULT($with_versioned_syms)
6250 if test "x$with_versioned_syms" != xno
6252 RESULTING_SYMS=$with_versioned_syms
6253 case "x$MK_SHARED_LIB" in
6255 VERSIONED_SYMS="-Wl,--version-script,\${RESULTING_SYMS}"
6256 MK_SHARED_LIB=`echo "$MK_SHARED_LIB" | sed -e "s%-Wl,%\\[$]{VERSIONED_SYMS} -Wl,%"`
6257 CF_VERBOSE(MK_SHARED_LIB: $MK_SHARED_LIB)
6260 VERSIONED_SYMS="-Wl,-M,\${RESULTING_SYMS}"
6261 MK_SHARED_LIB=`echo "$MK_SHARED_LIB" | sed -e "s%-dy%\\[$]{VERSIONED_SYMS} -dy%"`
6262 CF_VERBOSE(MK_SHARED_LIB: $MK_SHARED_LIB)
6265 AC_MSG_WARN(this system does not support versioned-symbols)
6269 # Linux ld can selectively override scope, e.g., of symbols beginning with
6270 # "_" by first declaring some as global, and then using a wildcard to
6271 # declare the others as local. Some other loaders cannot do this. Check
6272 # by constructing a (very) simple shared library and inspecting its
6274 if test "x$VERSIONED_SYMS" != "x"
6276 AC_MSG_CHECKING(if wildcards can be used to selectively omit symbols)
6282 cat >conftest.ver <<EOF
6311 cat >conftest.$ac_ext <<EOF
6312 #line __oline__ "configure"
6313 int _ismissing(void) { return 1; }
6314 int _localf1(void) { return 1; }
6315 int _localf2(void) { return 2; }
6316 int globalf1(void) { return 1; }
6317 int globalf2(void) { return 2; }
6318 int _sublocalf1(void) { return 1; }
6319 int _sublocalf2(void) { return 2; }
6320 int subglobalf1(void) { return 1; }
6321 int subglobalf2(void) { return 2; }
6323 cat >conftest.mk <<EOF
6326 CPPFLAGS=${CPPFLAGS}
6329 VERSIONED_SYMS=${VERSIONED_SYMS}
6330 RESULTING_SYMS=conftest.ver
6331 MK_SHARED_LIB=${MK_SHARED_LIB}
6332 conftest.so: conftest.$ac_cv_objext
6333 \$(MK_SHARED_LIB) conftest.$ac_cv_objext
6336 # compile source, make library
6337 if make -f conftest.mk 2>&AC_FD_CC >/dev/null
6339 # test for missing symbol in either Data or Text section
6340 cf_missing="`nm -P conftest.so 2>&AC_FD_CC |${FGREP-fgrep} _ismissing | ${EGREP-egrep} '[[ ]][[DT]][[ ]]'`"
6341 test -n "$cf_missing" && WILDCARD_SYMS=yes
6343 AC_MSG_RESULT($WILDCARD_SYMS)
6347 AC_SUBST(RESULTING_SYMS)
6348 AC_SUBST(VERSIONED_SYMS)
6349 AC_SUBST(WILDCARD_SYMS)
6351 dnl ---------------------------------------------------------------------------
6352 dnl CF_XOPEN_CURSES version: 16 updated: 2021/01/02 09:31:20
6354 dnl Test if we should define X/Open source for curses, needed on Digital Unix
6355 dnl 4.x, to see the extended functions, but breaks on IRIX 6.x.
6357 dnl The getbegyx() check is needed for HPUX, which omits legacy macros such
6358 dnl as getbegy(). The latter is better design, but the former is standard.
6359 AC_DEFUN([CF_XOPEN_CURSES],
6361 AC_REQUIRE([CF_CURSES_CPPFLAGS])dnl
6362 AC_CACHE_CHECK(definition to turn on extended curses functions,cf_cv_need_xopen_extension,[
6363 cf_cv_need_xopen_extension=unknown
6366 #include <${cf_cv_ncurses_header:-curses.h}>],[
6367 #if defined(NCURSES_VERSION_PATCH)
6368 #if (NCURSES_VERSION_PATCH < 20100501) && (NCURSES_VERSION_PATCH >= 20100403)
6372 #ifdef NCURSES_VERSION
6374 int check2 = curs_set((int)sizeof(check));
6376 long x = winnstr(stdscr, "", 0);
6378 #ifdef NCURSES_VERSION
6381 getbegyx(stdscr, y1, x1);
6386 [cf_cv_need_xopen_extension=none],
6388 for cf_try_xopen_extension in _XOPEN_SOURCE_EXTENDED NCURSES_WIDECHAR
6391 #define $cf_try_xopen_extension 1
6393 #include <${cf_cv_ncurses_header:-curses.h}>],[
6394 #ifdef NCURSES_VERSION
6396 int check2 = curs_set((int)sizeof(check));
6398 long x = winnstr(stdscr, "", 0);
6400 getbegyx(stdscr, y1, x1);
6401 #ifdef NCURSES_VERSION
6408 [cf_cv_need_xopen_extension=$cf_try_xopen_extension; break])
6413 case "$cf_cv_need_xopen_extension" in
6415 CF_APPEND_TEXT(CPPFLAGS,-D$cf_cv_need_xopen_extension)
6420 dnl ---------------------------------------------------------------------------
6421 dnl CF_XOPEN_SOURCE version: 57 updated: 2021/01/01 16:53:59
6423 dnl Try to get _XOPEN_SOURCE defined properly that we can use POSIX functions,
6424 dnl or adapt to the vendor's definitions to get equivalent functionality,
6425 dnl without losing the common non-POSIX features.
6428 dnl $1 is the nominal value for _XOPEN_SOURCE
6429 dnl $2 is the nominal value for _POSIX_C_SOURCE
6430 AC_DEFUN([CF_XOPEN_SOURCE],[
6431 AC_REQUIRE([AC_CANONICAL_HOST])
6432 AC_REQUIRE([CF_POSIX_VISIBLE])
6434 if test "$cf_cv_posix_visible" = no; then
6436 cf_XOPEN_SOURCE=ifelse([$1],,500,[$1])
6437 cf_POSIX_C_SOURCE=ifelse([$2],,199506L,[$2])
6442 cf_xopen_source="-D_ALL_SOURCE"
6448 cf_xopen_source="-D_APPLE_C_SOURCE"
6451 cf_xopen_source="-D_DARWIN_C_SOURCE"
6454 (freebsd*|dragonfly*|midnightbsd*)
6455 # 5.x headers associate
6456 # _XOPEN_SOURCE=600 with _POSIX_C_SOURCE=200112L
6457 # _XOPEN_SOURCE=500 with _POSIX_C_SOURCE=199506L
6458 cf_POSIX_C_SOURCE=200112L
6460 cf_xopen_source="-D_BSD_TYPES -D__BSD_VISIBLE -D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
6463 cf_xopen_source="-D_HPUX_SOURCE -D_XOPEN_SOURCE=500"
6466 cf_xopen_source="-D_HPUX_SOURCE"
6469 cf_xopen_source="-D_SGI_SOURCE"
6472 (linux*|uclinux*|gnu*|mint*|k*bsd*-gnu|cygwin)
6473 CF_GNU_SOURCE($cf_XOPEN_SOURCE)
6476 cf_xopen_source="-D_NETBSD_SOURCE" # POSIX.1-2001 features are ifdef'd with this...
6479 # setting _XOPEN_SOURCE or _POSIX_SOURCE breaks <sys/select.h> and other headers which use u_int / u_short types
6481 CF_POSIX_C_SOURCE($cf_POSIX_C_SOURCE)
6484 cf_xopen_source="-D_NETBSD_SOURCE" # setting _XOPEN_SOURCE breaks IPv6 for lynx on NetBSD 1.6, breaks xterm, is not needed for ncursesw
6487 # setting _XOPEN_SOURCE lower than 500 breaks g++ compile with wchar.h, needed for ncursesw
6488 cf_xopen_source="-D_BSD_SOURCE"
6492 # setting _XOPEN_SOURCE breaks xterm on OpenBSD 2.8, is not needed for ncursesw
6495 cf_xopen_source="-D_OSF_SOURCE"
6498 cf_xopen_source="-D_QNX_SOURCE"
6501 # setting _XOPEN_SOURCE breaks Lynx on SCO Unix / OpenServer
6504 cf_xopen_source="-D__EXTENSIONS__"
6505 cf_cv_xopen_source=broken
6507 (sysv4.2uw2.*) # Novell/SCO UnixWare 2.x (tested on 2.1.2)
6513 CF_POSIX_C_SOURCE($cf_POSIX_C_SOURCE)
6517 if test -n "$cf_xopen_source" ; then
6518 CF_ADD_CFLAGS($cf_xopen_source,true)
6521 dnl In anything but the default case, we may have system-specific setting
6522 dnl which is still not guaranteed to provide all of the entrypoints that
6523 dnl _XOPEN_SOURCE would yield.
6524 if test -n "$cf_XOPEN_SOURCE" && test -z "$cf_cv_xopen_source" ; then
6525 AC_MSG_CHECKING(if _XOPEN_SOURCE really is set)
6526 AC_TRY_COMPILE([#include <stdlib.h>],[
6527 #ifndef _XOPEN_SOURCE
6530 [cf_XOPEN_SOURCE_set=yes],
6531 [cf_XOPEN_SOURCE_set=no])
6532 AC_MSG_RESULT($cf_XOPEN_SOURCE_set)
6533 if test "$cf_XOPEN_SOURCE_set" = yes
6535 AC_TRY_COMPILE([#include <stdlib.h>],[
6536 #if (_XOPEN_SOURCE - 0) < $cf_XOPEN_SOURCE
6539 [cf_XOPEN_SOURCE_set_ok=yes],
6540 [cf_XOPEN_SOURCE_set_ok=no])
6541 if test "$cf_XOPEN_SOURCE_set_ok" = no
6543 AC_MSG_WARN(_XOPEN_SOURCE is lower than requested)
6549 fi # cf_cv_posix_visible
6551 dnl ---------------------------------------------------------------------------
6552 dnl CF_X_ATHENA version: 24 updated: 2020/03/10 18:53:47
6554 dnl Check for Xaw (Athena) libraries
6556 dnl Sets $cf_x_athena according to the flavor of Xaw which is used.
6557 AC_DEFUN([CF_X_ATHENA],
6559 cf_x_athena=${cf_x_athena:-Xaw}
6561 AC_MSG_CHECKING(if you want to link with Xaw 3d library)
6564 [ --with-Xaw3d link with Xaw 3d library])
6565 if test "$withval" = yes ; then
6572 AC_MSG_CHECKING(if you want to link with Xaw 3d xft library)
6574 AC_ARG_WITH(Xaw3dxft,
6575 [ --with-Xaw3dxft link with Xaw 3d xft library])
6576 if test "$withval" = yes ; then
6577 cf_x_athena=Xaw3dxft
6583 AC_MSG_CHECKING(if you want to link with neXT Athena library)
6586 [ --with-neXtaw link with neXT Athena library])
6587 if test "$withval" = yes ; then
6594 AC_MSG_CHECKING(if you want to link with Athena-Plus library)
6596 AC_ARG_WITH(XawPlus,
6597 [ --with-XawPlus link with Athena-Plus library])
6598 if test "$withval" = yes ; then
6607 if test "$PKG_CONFIG" != none ; then
6609 test "$cf_x_athena" = Xaw && cf_athena_list="xaw8 xaw7 xaw6"
6610 for cf_athena_pkg in \
6613 ${cf_x_athena}-devel \
6615 lib${cf_x_athena}-devel
6617 CF_TRY_PKG_CONFIG($cf_athena_pkg,[
6618 cf_x_athena_lib="$cf_pkgconfig_libs"
6619 CF_UPPER(cf_x_athena_LIBS,HAVE_LIB_$cf_x_athena)
6620 AC_DEFINE_UNQUOTED($cf_x_athena_LIBS)
6624 AC_CACHE_CHECK(for usable $cf_x_athena/Xmu package,cf_cv_xaw_compat,[
6626 #include <X11/Xmu/CharSet.h>
6628 int check = XmuCompareISOLatin1("big", "small");
6630 ],[cf_cv_xaw_compat=yes],[cf_cv_xaw_compat=no])])
6632 if test "$cf_cv_xaw_compat" = no
6634 # workaround for broken ".pc" files...
6635 case "$cf_x_athena_lib" in
6639 CF_VERBOSE(work around broken package)
6641 cf_first_lib=`echo "$cf_save_xmu" | sed -e 's/^[ ][ ]*//' -e 's/ .*//'`
6642 CF_TRY_PKG_CONFIG(xmu,[
6644 CF_ADD_LIB_AFTER($cf_first_lib,$cf_pkgconfig_libs)
6646 CF_ADD_LIB_AFTER($cf_first_lib,-lXmu)
6657 if test -z "$cf_x_athena_lib" ; then
6660 CF_X_ATHENA_CPPFLAGS($cf_x_athena)
6661 CF_X_ATHENA_LIBS($cf_x_athena)
6664 dnl ---------------------------------------------------------------------------
6665 dnl CF_X_ATHENA_CPPFLAGS version: 9 updated: 2020/12/31 10:54:15
6666 dnl --------------------
6667 dnl Normally invoked by CF_X_ATHENA, with $1 set to the appropriate flavor of
6668 dnl the Athena widgets, e.g., Xaw, Xaw3d, neXtaw.
6669 AC_DEFUN([CF_X_ATHENA_CPPFLAGS],
6671 AC_REQUIRE([AC_PATH_XTRA])
6672 cf_x_athena_root=ifelse([$1],,Xaw,[$1])
6675 for cf_path in default \
6676 /usr/contrib/X11R6 \
6677 /usr/contrib/X11R5 \
6681 if test -z "$cf_x_athena_inc" ; then
6682 CF_SAVE_XTRA_FLAGS([CF_X_ATHENA_CPPFLAGS])
6683 cf_test=X11/$cf_x_athena_root/SimpleMenu.h
6684 if test "$cf_path" != default ; then
6685 CF_APPEND_TEXT(CPPFLAGS,-I$cf_path/include)
6686 AC_MSG_CHECKING(for $cf_test in $cf_path)
6688 AC_MSG_CHECKING(for $cf_test)
6691 #include <X11/Intrinsic.h>
6692 #include <$cf_test>],[],
6695 AC_MSG_RESULT($cf_result)
6696 CF_RESTORE_XTRA_FLAGS([CF_X_ATHENA_CPPFLAGS])
6697 if test "$cf_result" = yes ; then
6698 test "$cf_path" = default && cf_x_athena_inc=default
6699 test "$cf_path" != default && cf_x_athena_inc="$cf_path/include"
6705 if test -z "$cf_x_athena_inc" ; then
6706 AC_MSG_WARN([Unable to find Athena header files])
6707 elif test "$cf_x_athena_inc" != default ; then
6708 CF_APPEND_TEXT(CPPFLAGS,-I$cf_x_athena_inc)
6711 dnl ---------------------------------------------------------------------------
6712 dnl CF_X_ATHENA_LIBS version: 13 updated: 2020/01/11 18:16:10
6713 dnl ----------------
6714 dnl Normally invoked by CF_X_ATHENA, with $1 set to the appropriate flavor of
6715 dnl the Athena widgets, e.g., Xaw, Xaw3d, neXtaw.
6716 AC_DEFUN([CF_X_ATHENA_LIBS],
6717 [AC_REQUIRE([CF_X_TOOLKIT])
6718 cf_x_athena_root=ifelse([$1],,Xaw,[$1])
6721 for cf_path in default \
6722 /usr/contrib/X11R6 \
6723 /usr/contrib/X11R5 \
6728 ${cf_x_athena_root} \
6729 ${cf_x_athena_root}7 \
6730 ${cf_x_athena_root}6
6734 "-l$cf_lib -lXpm -lXmu" \
6735 "-l${cf_lib}_s -lXmu_s"
6737 test -n "$cf_x_athena_lib" && break
6739 CF_SAVE_XTRA_FLAGS([CF_X_ATHENA_LIBS])
6740 cf_test=XawSimpleMenuAddGlobalActions
6741 test "$cf_path" != default && cf_libs="-L$cf_path/lib $cf_libs"
6742 CF_ADD_LIBS($cf_libs)
6743 AC_MSG_CHECKING(for $cf_test in $cf_libs)
6745 #include <X11/Intrinsic.h>
6746 #include <X11/$cf_x_athena_root/SimpleMenu.h>
6748 $cf_test((XtAppContext) 0)],
6751 AC_MSG_RESULT($cf_result)
6752 CF_RESTORE_XTRA_FLAGS([CF_X_ATHENA_LIBS])
6754 if test "$cf_result" = yes ; then
6755 cf_x_athena_lib="$cf_libs"
6759 test -n "$cf_x_athena_lib" && break
6763 if test -z "$cf_x_athena_lib" ; then
6765 [Unable to successfully link Athena library (-l$cf_x_athena_root) with test program])
6768 CF_ADD_LIBS($cf_x_athena_lib)
6769 CF_UPPER(cf_x_athena_LIBS,HAVE_LIB_$cf_x_athena)
6770 AC_DEFINE_UNQUOTED($cf_x_athena_LIBS)
6772 dnl ---------------------------------------------------------------------------
6773 dnl CF_X_EXT version: 3 updated: 2010/06/02 05:03:05
6775 AC_DEFUN([CF_X_EXT],[
6776 CF_TRY_PKG_CONFIG(Xext,,[
6777 AC_CHECK_LIB(Xext,XextCreateExtension,
6778 [CF_ADD_LIB(Xext)])])
6780 dnl ---------------------------------------------------------------------------
6781 dnl CF_X_TOOLKIT version: 26 updated: 2021/01/02 09:31:20
6783 dnl Check for X Toolkit libraries
6784 AC_DEFUN([CF_X_TOOLKIT],
6786 AC_REQUIRE([AC_PATH_XTRA])
6787 AC_REQUIRE([CF_CHECK_CACHE])
6789 # OSX is schizoid about who owns /usr/X11 (old) versus /opt/X11 (new) (and
6790 # in some cases has installed dummy files in the former, other cases replaced
6791 # it with a link to the new location). This complicates the configure script.
6792 # Check for that pitfall, and recover using pkg-config
6794 # If none of these are set, the configuration is almost certainly broken.
6795 if test -z "${X_CFLAGS}${X_PRE_LIBS}${X_LIBS}${X_EXTRA_LIBS}"
6797 CF_TRY_PKG_CONFIG(x11,,[AC_MSG_WARN(unable to find X11 library)])
6798 CF_TRY_PKG_CONFIG(ice,,[AC_MSG_WARN(unable to find ICE library)])
6799 CF_TRY_PKG_CONFIG(sm,,[AC_MSG_WARN(unable to find SM library)])
6800 CF_TRY_PKG_CONFIG(xt,,[AC_MSG_WARN(unable to find Xt library)])
6802 LIBS="$X_PRE_LIBS $LIBS $X_EXTRA_LIBS"
6807 CF_TRY_PKG_CONFIG(xt,[
6813 # we have an "xt" package, but it may omit Xt's dependency on X11
6814 AC_CACHE_CHECK(for usable X dependency,cf_cv_xt_x11_compat,[
6816 #include <X11/Xlib.h>
6818 int rc1 = XDrawLine((Display*) 0, (Drawable) 0, (GC) 0, 0, 0, 0, 0);
6819 int rc2 = XClearWindow((Display*) 0, (Window) 0);
6820 int rc3 = XMoveWindow((Display*) 0, (Window) 0, 0, 0);
6821 int rc4 = XMoveResizeWindow((Display*)0, (Window)0, 0, 0, 0, 0);
6822 ],[cf_cv_xt_x11_compat=yes],[cf_cv_xt_x11_compat=no])])
6823 if test "$cf_cv_xt_x11_compat" = no
6825 CF_VERBOSE(work around broken X11 dependency)
6826 # 2010/11/19 - good enough until a working Xt on Xcb is delivered.
6827 CF_TRY_PKG_CONFIG(x11,,[CF_ADD_LIB_AFTER(-lXt,-lX11)])
6832 AC_CACHE_CHECK(for usable X Toolkit package,cf_cv_xt_ice_compat,[
6834 #include <X11/Shell.h>
6835 ],[int num = IceConnectionNumber(0); (void) num
6836 ],[cf_cv_xt_ice_compat=yes],[cf_cv_xt_ice_compat=no])])
6838 if test "$cf_cv_xt_ice_compat" = no
6840 # workaround for broken ".pc" files used for X Toolkit.
6841 case "x$X_PRE_LIBS" in
6847 CF_VERBOSE(work around broken ICE dependency)
6848 CF_TRY_PKG_CONFIG(ice,
6849 [CF_TRY_PKG_CONFIG(sm)],
6850 [CF_ADD_LIB_AFTER(-lXt,$X_PRE_LIBS)])
6860 LDFLAGS="$X_LIBS $LDFLAGS"
6861 CF_CHECK_CFLAGS($X_CFLAGS)
6863 AC_CHECK_FUNC(XOpenDisplay,,[
6864 AC_CHECK_LIB(X11,XOpenDisplay,
6865 [CF_ADD_LIB(X11)])])
6867 AC_CHECK_FUNC(XtAppInitialize,,[
6868 AC_CHECK_LIB(Xt, XtAppInitialize,
6869 [AC_DEFINE(HAVE_LIBXT,1,[Define to 1 if we can compile with the Xt library])
6871 LIBS="-lXt $LIBS"])])
6874 if test "$cf_have_X_LIBS" = no ; then
6876 [Unable to successfully link X Toolkit library (-lXt) with
6877 test program. You will have to check and add the proper libraries by hand
6881 dnl ---------------------------------------------------------------------------
6882 dnl CF__ADD_SHLIB_RULES version: 6 updated: 2016/04/21 21:07:50
6883 dnl -------------------
6884 dnl Append rules for creating, installing, uninstalling and cleaning library.
6885 dnl In particular, this is needed for shared libraries since there are symbolic
6886 dnl links which depend on configuration choices.
6888 dnl The logic is controlled by these cache variables:
6889 dnl $cf_cv_do_symlinks
6890 dnl $cf_cv_shlib_version
6892 dnl The macro uses variables set by CF__DEFINE_SHLIB_VARS
6894 dnl $1 = makefile to append to
6895 dnl $2 = model (static, shared, libtool)
6896 dnl $3 = objects (dependencies)
6897 dnl $4 = additional libraries needed to link the shared library
6898 define([CF__ADD_SHLIB_RULES],[
6900 CF__DEFINE_LIB_TARGET
6904 cf_libdeps="ifelse($4,,,[$4])"
6913 # generated by CF__ADD_SHLIB_RULES
6915 # symlinks: $cf_cv_do_symlinks
6916 # shlibver: $cf_cv_shlib_version
6927 \$(LIBTOOL_CREATE) $3 $cf_libdeps
6930 if test "x$cf_cv_do_symlinks" = xyes
6933 \$(LN_S) $cf_libname $cf_liblink
6934 \$(LN_S) $cf_liblink $cf_libroot
6941 install.libs :: \$(DESTDIR)\$(libdir)/$cf_libname
6943 \$(DESTDIR)\$(libdir)/$cf_libname :: \\
6944 \$(DESTDIR)\$(libdir) \\
6947 \$(LIBTOOL_CREATE) $3 $cf_libdeps
6950 if test "x$cf_cv_do_symlinks" = xyes
6953 cd \$(DESTDIR)\$(libdir) && (\$(LN_S) $cf_libname $cf_liblink; \$(LN_S) $cf_liblink $cf_libroot; )
6957 if test x$2 = xshared
6960 - \$(SHELL) -c "if test -z "\$(DESTDIR)" ; then /sbin/ldconfig; fi"
6968 @echo uninstalling \$(DESTDIR)\$(libdir)/$cf_libname
6971 if test "x$cf_cv_do_symlinks" = xyes
6974 -rm -f \$(DESTDIR)\$(libdir)/$cf_libroot
6975 -rm -f \$(DESTDIR)\$(libdir)/$cf_liblink
6980 -rm -f \$(DESTDIR)\$(libdir)/$cf_libname
6986 if test "x$cf_cv_do_symlinks" = xyes
6999 # end generated by CF__ADD_SHLIB_RULES
7002 dnl ---------------------------------------------------------------------------
7003 dnl CF__CURSES_HEAD version: 2 updated: 2010/10/23 15:54:49
7005 dnl Define a reusable chunk which includes <curses.h> and <term.h> when they
7006 dnl are both available.
7007 define([CF__CURSES_HEAD],[
7009 #include <xcurses.h>
7010 char * XCursesProgramName = "test";
7012 #include <${cf_cv_ncurses_header:-curses.h}>
7013 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
7014 #include <ncursesw/term.h>
7015 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
7016 #include <ncurses/term.h>
7017 #elif defined(HAVE_TERM_H)
7022 dnl ---------------------------------------------------------------------------
7023 dnl CF__DEFINE_LIB_TARGET version: 2 updated: 2015/05/10 19:52:14
7024 dnl ---------------------
7025 define([CF__DEFINE_LIB_TARGET],[
7026 cf_libname=\${LIB_BASENAME}
7027 cf_liblink=$cf_libname
7028 cf_libroot=$cf_libname
7030 if test "x$cf_cv_do_symlinks" = xyes
7032 case "x$cf_cv_shlib_version" in
7034 cf_liblink="\${LIB_ABI_NAME}"
7035 cf_libname="\${LIB_REL_NAME}"
7038 cf_liblink="\${LIB_REL_NAME}"
7039 cf_libname="\${LIB_ABI_NAME}"
7043 LIB_TARGET=$cf_libname
7045 dnl ---------------------------------------------------------------------------
7046 dnl CF__DEFINE_SHLIB_VARS version: 4 updated: 2015/09/28 17:49:10
7047 dnl ---------------------
7048 dnl Substitute makefile variables useful for CF__ADD_SHLIB_RULES.
7050 dnl The substitution requires these variables:
7051 dnl LIB_PREFIX - "lib"
7052 dnl LIB_ROOTNAME - "foo"
7053 dnl LIB_SUFFIX - ".so"
7054 dnl REL_VERSION - "5.0"
7055 dnl ABI_VERSION - "4.2.4"
7056 define([CF__DEFINE_SHLIB_VARS],[
7057 CF__DEFINE_LIB_TARGET
7058 SET_SHLIB_VARS="# begin CF__DEFINE_SHLIB_VARS\\
7059 LIB_BASENAME = \${LIB_PREFIX}\${LIB_ROOTNAME}\${LIB_SUFFIX}\\
7060 LIB_REL_NAME = \${LIB_BASENAME}.\${REL_VERSION}\\
7061 LIB_ABI_NAME = \${LIB_BASENAME}.\${ABI_VERSION}\\
7062 LIB_TARGET = $LIB_TARGET\\
7063 RM_SHARED_OPTS = $RM_SHARED_OPTS\\
7064 # end CF__DEFINE_SHLIB_VARS"
7065 AC_SUBST(SET_SHLIB_VARS)
7066 AC_SUBST(LIB_TARGET)
7068 dnl ---------------------------------------------------------------------------
7069 dnl CF__ICONV_BODY version: 2 updated: 2007/07/26 17:35:47
7071 dnl Test-code needed for iconv compile-checks
7072 define([CF__ICONV_BODY],[
7073 iconv_t cd = iconv_open("","");
7074 iconv(cd,NULL,NULL,NULL,NULL);
7077 dnl ---------------------------------------------------------------------------
7078 dnl CF__ICONV_HEAD version: 1 updated: 2007/07/26 15:57:03
7080 dnl Header-files needed for iconv compile-checks
7081 define([CF__ICONV_HEAD],[
7085 dnl ---------------------------------------------------------------------------
7086 dnl CF__INIT_SHLIB_RULES version: 2 updated: 2013/07/27 17:38:32
7087 dnl --------------------
7088 dnl The third parameter to AC_OUTPUT, used to pass variables needed for
7089 dnl CF__ADD_SHLIB_RULES.
7090 define([CF__INIT_SHLIB_RULES],[
7091 ABI_VERSION="$ABI_VERSION"
7092 REL_VERSION="$REL_VERSION"
7093 LIB_MODEL="$LIB_MODEL"
7094 LIB_PREFIX="$LIB_PREFIX"
7095 LIB_ROOTNAME="$LIB_ROOTNAME"
7096 DFT_DEP_SUFFIX="$DFT_DEP_SUFFIX"
7097 RM_SHARED_OPTS="$RM_SHARED_OPTS"
7098 cf_cv_do_symlinks="$cf_cv_do_symlinks"
7099 cf_cv_shlib_version="$cf_cv_shlib_version"
7101 dnl ---------------------------------------------------------------------------
7102 dnl CF__INTL_BODY version: 3 updated: 2017/07/10 20:13:33
7104 dnl Test-code needed for libintl compile-checks
7105 dnl $1 = parameter 2 from AM_WITH_NLS
7106 define([CF__INTL_BODY],[
7107 bindtextdomain ("", "");
7108 return (int) gettext ("")
7109 ifelse([$1], need-ngettext, [ + (int) ngettext ("", "", 0)], [])
7110 #ifndef IGNORE_MSGFMT_HACK
7111 [ + _nl_msg_cat_cntr]
7114 dnl ---------------------------------------------------------------------------
7115 dnl CF__INTL_HEAD version: 1 updated: 2007/07/26 17:35:47
7117 dnl Header-files needed for libintl compile-checks
7118 define([CF__INTL_HEAD],[
7119 #include <libintl.h>
7120 extern int _nl_msg_cat_cntr;
7122 dnl ---------------------------------------------------------------------------
7123 dnl jm_GLIBC21 version: 4 updated: 2015/05/10 19:52:14
7125 dnl Inserted as requested by gettext 0.10.40
7126 dnl File from /usr/share/aclocal
7128 dnl ====================
7131 dnl Test for the GNU C Library, version 2.1 or newer.
7132 dnl From Bruno Haible.
7133 AC_DEFUN([jm_GLIBC21],
7135 AC_CACHE_CHECK(whether we are using the GNU C Library 2.1 or newer,
7136 ac_cv_gnu_library_2_1,
7137 [AC_EGREP_CPP([Lucky GNU user],
7139 #include <features.h>
7140 #ifdef __GNU_LIBRARY__
7141 #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1) || (__GLIBC__ > 2)
7146 ac_cv_gnu_library_2_1=yes,
7147 ac_cv_gnu_library_2_1=no)])
7149 GLIBC21="$ac_cv_gnu_library_2_1"