diff options
Diffstat (limited to 'Ada95/aclocal.m4')
| -rw-r--r-- | Ada95/aclocal.m4 | 863 |
1 files changed, 562 insertions, 301 deletions
diff --git a/Ada95/aclocal.m4 b/Ada95/aclocal.m4 index 6fe1f946e7e6..d063565c2bac 100644 --- a/Ada95/aclocal.m4 +++ b/Ada95/aclocal.m4 @@ -1,5 +1,5 @@ dnl*************************************************************************** -dnl Copyright 2018-2023,2024 Thomas E. Dickey * +dnl Copyright 2018-2024,2025 Thomas E. Dickey * dnl Copyright 2010-2017,2018 Free Software Foundation, Inc. * dnl * dnl Permission is hereby granted, free of charge, to any person obtaining a * @@ -29,7 +29,7 @@ dnl*************************************************************************** dnl dnl Author: Thomas E. Dickey dnl -dnl $Id: aclocal.m4,v 1.210 2024/03/30 22:17:13 tom Exp $ +dnl $Id: aclocal.m4,v 1.241 2025/12/25 23:45:32 tom Exp $ dnl Macros used in NCURSES Ada95 auto-configuration script. dnl dnl These macros are maintained separately from NCURSES. The copyright on @@ -189,7 +189,7 @@ AC_SUBST(EXTRA_CPPFLAGS) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_ADD_INCDIR version: 17 updated: 2021/09/04 06:35:04 +dnl CF_ADD_INCDIR version: 18 updated: 2025/12/22 04:16:14 dnl ------------- dnl Add an include-directory to $CPPFLAGS. Don't add /usr/include, since it is dnl redundant. We don't normally need to add -I/usr/local/include for gcc, @@ -221,8 +221,8 @@ if test -n "$1" ; then then cf_save_CPPFLAGS=$CPPFLAGS CF_APPEND_TEXT(CPPFLAGS,-I$cf_add_incdir) - AC_TRY_COMPILE([#include <stdio.h>], - [printf("Hello")], + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <stdio.h>], + [printf("Hello")])], [], [cf_have_incdir=yes]) CPPFLAGS=$cf_save_CPPFLAGS @@ -381,7 +381,7 @@ dnl Allow user to enable a normally-off option. AC_DEFUN([CF_ARG_ENABLE], [CF_ARG_OPTION($1,[$2],[$3],[$4],no)])dnl dnl --------------------------------------------------------------------------- -dnl CF_ARG_OPTION version: 5 updated: 2015/05/10 19:52:14 +dnl CF_ARG_OPTION version: 6 updated: 2025/08/05 04:09:09 dnl ------------- dnl Restricted form of AC_ARG_ENABLE that ensures user doesn't give bogus dnl values. @@ -390,7 +390,7 @@ dnl Parameters: dnl $1 = option name dnl $2 = help-string dnl $3 = action to perform if option is not default -dnl $4 = action if perform if option is default +dnl $4 = action to perform if option is default dnl $5 = default option value (either 'yes' or 'no') AC_DEFUN([CF_ARG_OPTION], [AC_ARG_ENABLE([$1],[$2],[test "$enableval" != ifelse([$5],no,yes,no) && enableval=ifelse([$5],no,no,yes) @@ -404,7 +404,7 @@ ifelse([$3],,[ :]dnl ])dnl ])])dnl dnl --------------------------------------------------------------------------- -dnl CF_AR_FLAGS version: 9 updated: 2021/01/01 13:31:04 +dnl CF_AR_FLAGS version: 10 updated: 2025/12/14 20:07:31 dnl ----------- dnl Check for suitable "ar" (archiver) options for updating an archive. dnl @@ -450,8 +450,8 @@ AC_CACHE_CHECK(for options to update archives, cf_cv_ar_flags,[ int testdata[[3]] = { 123, 456, 789 }; EOF if AC_TRY_EVAL(ac_compile) ; then - echo "$AR $ARFLAGS $cf_ar_flags conftest.a conftest.$ac_cv_objext" >&AC_FD_CC - $AR $ARFLAGS "$cf_ar_flags" conftest.a "conftest.$ac_cv_objext" 2>&AC_FD_CC 1>/dev/null + echo "$AR $ARFLAGS $cf_ar_flags conftest.a conftest.$ac_cv_objext" >&AS_MESSAGE_LOG_FD + $AR $ARFLAGS "$cf_ar_flags" conftest.a "conftest.$ac_cv_objext" 2>&AS_MESSAGE_LOG_FD 1>/dev/null if test -f conftest.a ; then cf_cv_ar_flags="$cf_ar_flags" break @@ -477,7 +477,7 @@ fi AC_SUBST(ARFLAGS) ]) dnl --------------------------------------------------------------------------- -dnl CF_BUILD_CC version: 11 updated: 2022/12/04 15:40:08 +dnl CF_BUILD_CC version: 14 updated: 2024/12/14 11:58:01 dnl ----------- dnl If we're cross-compiling, allow the user to override the tools and their dnl options. The configure script is oriented toward identifying the host @@ -555,7 +555,7 @@ if test "$cross_compiling" = yes ; then AC_TRY_RUN([#include <stdio.h> int main(int argc, char *argv[]) { - ${cf_cv_main_return:-return}(argc < 0 || argv == 0 || argv[0] == 0); + ${cf_cv_main_return:-return}(argc < 0 || argv == (void*)0 || argv[0] == (void*)0); } ], cf_ok_build_cc=yes, @@ -594,7 +594,7 @@ AC_SUBST(BUILD_EXEEXT) AC_SUBST(BUILD_OBJEXT) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_C11_NORETURN version: 4 updated: 2023/02/18 17:41:25 +dnl CF_C11_NORETURN version: 5 updated: 2025/12/14 17:40:20 dnl --------------- AC_DEFUN([CF_C11_NORETURN], [ @@ -607,12 +607,12 @@ AC_MSG_RESULT($enable_stdnoreturn) if test $enable_stdnoreturn = yes; then AC_CACHE_CHECK([for C11 _Noreturn feature], cf_cv_c11_noreturn, - [AC_TRY_COMPILE([ + [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([ $ac_includes_default #include <stdnoreturn.h> static _Noreturn void giveup(void) { exit(0); } ], - [if (feof(stdin)) giveup()], + [if (feof(stdin)) giveup()])], cf_cv_c11_noreturn=yes, cf_cv_c11_noreturn=no) ]) @@ -696,7 +696,7 @@ case "$CC" in esac ])dnl dnl --------------------------------------------------------------------------- -dnl CF_CFG_DEFAULTS version: 16 updated: 2021/01/04 19:33:05 +dnl CF_CFG_DEFAULTS version: 17 updated: 2025/12/24 12:27:29 dnl --------------- dnl Determine the default configuration into which we'll install ncurses. This dnl can be overridden by the user's command-line options. There's two items to @@ -726,7 +726,7 @@ AC_MSG_RESULT($prefix) if test "x$prefix" = "xNONE" ; then AC_MSG_CHECKING(for default include-directory) -test -n "$verbose" && echo 1>&AC_FD_MSG +test -n "$verbose" && echo 1>&AS_MESSAGE_FD for cf_symbol in \ "$includedir" \ "$includedir/ncurses" \ @@ -741,11 +741,11 @@ do if test -f "$cf_dir/curses.h" ; then if ( ${FGREP-fgrep} NCURSES_VERSION "$cf_dir/curses.h" >/dev/null 2>&1 ) ; then includedir="$cf_symbol" - test -n "$verbose" && echo $ECHO_N " found " 1>&AC_FD_MSG + test -n "$verbose" && echo $ECHO_N " found " 1>&AS_MESSAGE_FD break fi fi - test -n "$verbose" && echo " tested $cf_dir" 1>&AC_FD_MSG + test -n "$verbose" && echo " tested $cf_dir" 1>&AS_MESSAGE_FD done AC_MSG_RESULT($includedir) fi @@ -802,26 +802,26 @@ case "$cf_cv_gnat_version" in esac ]) dnl --------------------------------------------------------------------------- -dnl CF_CHECK_LIBSSP version: 1 updated: 2021/10/30 10:40:19 +dnl CF_CHECK_LIBSSP version: 2 updated: 2025/12/24 12:27:29 dnl --------------- dnl Check if libssp is needed, e.g., to work around misconfigured libraries dnl used in cross-compiling to MinGW. AC_DEFUN([CF_CHECK_LIBSSP],[ AC_CACHE_CHECK(if ssp library is needed,cf_cv_need_libssp,[ -AC_TRY_LINK([ +AC_LINK_IFELSE([AC_LANG_PROGRAM([ #include <sys/types.h> #include <dirent.h> ],[ DIR *dp = opendir("."); -],cf_cv_need_libssp=no,[ +])],cf_cv_need_libssp=no,[ cf_save_LIBS="$LIBS" LIBS="$LIBS -lssp" - AC_TRY_LINK([ + AC_LINK_IFELSE([AC_LANG_PROGRAM([ #include <sys/types.h> #include <dirent.h> ],[ DIR *dp = opendir("."); - ],cf_cv_need_libssp=yes, + ])],cf_cv_need_libssp=yes, cf_cv_need_libssp=maybe) LIBS="$cf_save_LIBS" ])dnl @@ -833,7 +833,7 @@ then fi ])dnl dnl --------------------------------------------------------------------------- -dnl CF_CLANG_COMPILER version: 9 updated: 2023/02/18 17:41:25 +dnl CF_CLANG_COMPILER version: 11 updated: 2025/12/14 17:46:02 dnl ----------------- dnl Check if the given compiler is really clang. clang's C driver defines dnl __GNUC__ (fooling the configure script into setting $GCC to yes) but does @@ -852,12 +852,12 @@ ifelse([$2],,CLANG_COMPILER,[$2])=no if test "$ifelse([$1],,[$1],GCC)" = yes ; then AC_MSG_CHECKING(if this is really Clang ifelse([$1],GXX,C++,C) compiler) cf_save_CFLAGS="$ifelse([$3],,CFLAGS,[$3])" - AC_TRY_COMPILE([],[ + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],[ #ifdef __clang__ #else #error __clang__ is not defined #endif -],[ifelse([$2],,CLANG_COMPILER,[$2])=yes +])],[ifelse([$2],,CLANG_COMPILER,[$2])=yes ],[]) ifelse([$3],,CFLAGS,[$3])="$cf_save_CFLAGS" AC_MSG_RESULT($ifelse([$2],,CLANG_COMPILER,[$2])) @@ -886,9 +886,9 @@ if test "x$ifelse([$2],,CLANG_COMPILER,[$2])" = "xyes" ; then AC_MSG_CHECKING(if option $cf_clang_opt works) cf_save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS $cf_clang_opt" - AC_TRY_LINK([ + AC_LINK_IFELSE([AC_LANG_PROGRAM([ #include <stdio.h>],[ - printf("hello!\\n");],[ + printf("hello!\\n");])],[ cf_clang_optok=yes],[ cf_clang_optok=no]) AC_MSG_RESULT($cf_clang_optok) @@ -901,7 +901,7 @@ if test "x$ifelse([$2],,CLANG_COMPILER,[$2])" = "xyes" ; then fi ]) dnl --------------------------------------------------------------------------- -dnl CF_CONST_X_STRING version: 8 updated: 2023/12/01 17:22:50 +dnl CF_CONST_X_STRING version: 10 updated: 2025/12/14 17:40:20 dnl ----------------- dnl The X11R4-X11R6 Xt specification uses an ambiguous String type for most dnl character-strings. @@ -926,22 +926,22 @@ AC_REQUIRE([AC_PATH_XTRA]) CF_SAVE_XTRA_FLAGS([CF_CONST_X_STRING]) -AC_TRY_COMPILE( +AC_COMPILE_IFELSE([AC_LANG_PROGRAM( [ -#include <stdlib.h> +$ac_includes_default #include <X11/Intrinsic.h> ], -[String foo = malloc(1); free((void*)foo)],[ +[String foo = malloc(1); free((void*)foo)])],[ AC_CACHE_CHECK(for X11/Xt const-feature,cf_cv_const_x_string,[ - AC_TRY_COMPILE( + AC_COMPILE_IFELSE([AC_LANG_PROGRAM( [ #undef _CONST_X_STRING #define _CONST_X_STRING /* X11R7.8 (perhaps) */ #undef XTSTRINGDEFINES /* X11R5 and later */ -#include <stdlib.h> +$ac_includes_default #include <X11/Intrinsic.h> - ],[String foo = malloc(1); *foo = 0],[ + ],[String foo = malloc(1); *foo = 0])],[ cf_cv_const_x_string=no ],[ cf_cv_const_x_string=yes @@ -962,68 +962,53 @@ esac ]) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_CONST_X_STRING version: 8 updated: 2023/12/01 17:22:50 -dnl ----------------- -dnl The X11R4-X11R6 Xt specification uses an ambiguous String type for most -dnl character-strings. -dnl -dnl It is ambiguous because the specification accommodated the pre-ANSI -dnl compilers bundled by more than one vendor in lieu of providing a standard C -dnl compiler other than by costly add-ons. Because of this, the specification -dnl did not take into account the use of const for telling the compiler that -dnl string literals would be in readonly memory. -dnl -dnl As a workaround, one could (starting with X11R5) define XTSTRINGDEFINES, to -dnl let the compiler decide how to represent Xt's strings which were #define'd. -dnl That does not solve the problem of using the block of Xt's strings which -dnl are compiled into the library (and is less efficient than one might want). -dnl -dnl Xt specification 7 introduces the _CONST_X_STRING symbol which is used both -dnl when compiling the library and compiling using the library, to tell the -dnl compiler that String is const. -AC_DEFUN([CF_CONST_X_STRING], -[ -AC_REQUIRE([AC_PATH_XTRA]) - -CF_SAVE_XTRA_FLAGS([CF_CONST_X_STRING]) - -AC_TRY_COMPILE( +dnl CF_CURSES_CONFIG version: 2 updated: 2006/10/29 11:06:27 +dnl ---------------- +dnl Tie together the configure-script macros for curses. It may be ncurses, +dnl but unless asked, we do not make a special search for ncurses. However, +dnl still check for the ncurses version number, for use in other macros. +AC_DEFUN([CF_CURSES_CONFIG], [ -#include <stdlib.h> -#include <X11/Intrinsic.h> -], -[String foo = malloc(1); free((void*)foo)],[ - -AC_CACHE_CHECK(for X11/Xt const-feature,cf_cv_const_x_string,[ - AC_TRY_COMPILE( - [ -#undef _CONST_X_STRING -#define _CONST_X_STRING /* X11R7.8 (perhaps) */ -#undef XTSTRINGDEFINES /* X11R5 and later */ -#include <stdlib.h> -#include <X11/Intrinsic.h> - ],[String foo = malloc(1); *foo = 0],[ - cf_cv_const_x_string=no - ],[ - cf_cv_const_x_string=yes - ]) -]) - -CF_RESTORE_XTRA_FLAGS([CF_CONST_X_STRING]) +CF_CURSES_CPPFLAGS +CF_NCURSES_VERSION +CF_CURSES_LIBS +])dnl +dnl --------------------------------------------------------------------------- +dnl CF_CURSES_CPPFLAGS version: 14 updated: 2021/01/02 09:31:20 +dnl ------------------ +dnl Look for the curses headers. +AC_DEFUN([CF_CURSES_CPPFLAGS],[ -case "$cf_cv_const_x_string" in -(no) - CF_APPEND_TEXT(CPPFLAGS,-DXTSTRINGDEFINES) +AC_CACHE_CHECK(for extra include directories,cf_cv_curses_incdir,[ +cf_cv_curses_incdir=no +case "$host_os" in +(hpux10.*) + if test "x$cf_cv_screen" = "xcurses_colr" + then + test -d /usr/include/curses_colr && \ + cf_cv_curses_incdir="-I/usr/include/curses_colr" + fi ;; -(*) - CF_APPEND_TEXT(CPPFLAGS,-D_CONST_X_STRING) +(sunos3*|sunos4*) + if test "x$cf_cv_screen" = "xcurses_5lib" + then + test -d /usr/5lib && \ + test -d /usr/5include && \ + cf_cv_curses_incdir="-I/usr/5include" + fi ;; esac - ]) +if test "$cf_cv_curses_incdir" != no +then + CF_APPEND_TEXT(CPPFLAGS,$cf_cv_curses_incdir) +fi + +CF_CURSES_HEADER +CF_TERM_HEADER ])dnl dnl --------------------------------------------------------------------------- -dnl CF_CURSES_HEADER version: 6 updated: 2022/12/02 20:06:52 +dnl CF_CURSES_HEADER version: 7 updated: 2025/12/22 04:16:14 dnl ---------------- dnl Find a "curses" header file, e.g,. "curses.h", or one of the more common dnl variations of ncurses' installs. @@ -1036,8 +1021,8 @@ for cf_header in \ ncurses.h ifelse($1,,,[$1/ncurses.h]) \ curses.h ifelse($1,,,[$1/curses.h]) ifelse($1,,[ncurses/ncurses.h ncurses/curses.h]) do -AC_TRY_COMPILE([#include <${cf_header}>], - [initscr(); endwin()], +AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <${cf_header}>], + [initscr(); endwin()])], [cf_cv_ncurses_header=$cf_header; break],[]) done ]) @@ -1050,6 +1035,136 @@ fi AC_CHECK_HEADERS($cf_cv_ncurses_header) ])dnl dnl --------------------------------------------------------------------------- +dnl CF_CURSES_LIBS version: 46 updated: 2025/12/22 04:16:14 +dnl -------------- +dnl Look for the curses libraries. Older curses implementations may require +dnl termcap/termlib to be linked as well. Call CF_CURSES_CPPFLAGS first. +AC_DEFUN([CF_CURSES_LIBS],[ + +AC_REQUIRE([CF_CURSES_CPPFLAGS])dnl +AC_MSG_CHECKING(if we have identified curses libraries) +AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <${cf_cv_ncurses_header:-curses.h}>], + [initscr(); endwin()])], + cf_result=yes, + cf_result=no) +AC_MSG_RESULT($cf_result) + +if test "$cf_result" = no ; then +case "$host_os" in +(freebsd*) + AC_CHECK_LIB(mytinfo,tgoto,[CF_ADD_LIBS(-lmytinfo)]) + ;; +(hpux10.*) + # Looking at HPUX 10.20, the Hcurses library is the oldest (1997), cur_colr + # next (1998), and xcurses "newer" (2000). There is no header file for + # Hcurses; the subdirectory curses_colr has the headers (curses.h and + # term.h) for cur_colr + if test "x$cf_cv_screen" = "xcurses_colr" + then + AC_CHECK_LIB(cur_colr,initscr,[ + CF_ADD_LIBS(-lcur_colr) + ac_cv_func_initscr=yes + ],[ + AC_CHECK_LIB(Hcurses,initscr,[ + # HP's header uses __HP_CURSES, but user claims _HP_CURSES. + CF_ADD_LIBS(-lHcurses) + CF_APPEND_TEXT(CPPFLAGS,-D__HP_CURSES -D_HP_CURSES) + ac_cv_func_initscr=yes + ])]) + fi + ;; +(linux*) + case `arch 2>/dev/null` in + (x86_64) + if test -d /lib64 + then + CF_ADD_LIBDIR(/lib64) + else + CF_ADD_LIBDIR(/lib) + fi + ;; + (*) + CF_ADD_LIBDIR(/lib) + ;; + esac + ;; +(sunos3*|sunos4*) + if test "x$cf_cv_screen" = "xcurses_5lib" + then + if test -d /usr/5lib ; then + CF_ADD_LIBDIR(/usr/5lib) + CF_ADD_LIBS(-lcurses -ltermcap) + fi + fi + ac_cv_func_initscr=yes + ;; +esac + +if test ".$ac_cv_func_initscr" != .yes ; then + cf_save_LIBS="$LIBS" + + if test ".${cf_cv_ncurses_version:-no}" != .no + then + cf_check_list="ncurses curses cursesX" + else + cf_check_list="cursesX curses ncurses" + fi + + # Check for library containing tgoto. Do this before curses library + # because it may be needed to link the test-case for initscr. + if test "x$cf_term_lib" = x + then + AC_CHECK_FUNC(tgoto,[cf_term_lib=predefined],[ + for cf_term_lib in $cf_check_list otermcap termcap tinfo termlib unknown + do + AC_CHECK_LIB($cf_term_lib,tgoto,[ + : "${cf_nculib_root:=$cf_term_lib}" + break + ]) + done + ]) + fi + + # Check for library containing initscr + test "$cf_term_lib" != predefined && test "$cf_term_lib" != unknown && LIBS="-l$cf_term_lib $cf_save_LIBS" + if test "x$cf_curs_lib" = x + then + for cf_curs_lib in $cf_check_list xcurses jcurses pdcurses unknown + do + LIBS="-l$cf_curs_lib $cf_save_LIBS" + if test "$cf_term_lib" = unknown || test "$cf_term_lib" = "$cf_curs_lib" ; then + AC_MSG_CHECKING(if we can link with $cf_curs_lib library) + AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <${cf_cv_ncurses_header:-curses.h}>], + [initscr()])], + [cf_result=yes], + [cf_result=no]) + AC_MSG_RESULT($cf_result) + test "$cf_result" = yes && break + elif test "$cf_curs_lib" = "$cf_term_lib" ; then + cf_result=no + elif test "$cf_term_lib" != predefined ; then + AC_MSG_CHECKING(if we need both $cf_curs_lib and $cf_term_lib libraries) + AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <${cf_cv_ncurses_header:-curses.h}>], + [initscr(); endwin();])], + [cf_result=no], + [ + LIBS="-l$cf_curs_lib -l$cf_term_lib $cf_save_LIBS" + AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <${cf_cv_ncurses_header:-curses.h}>], + [initscr()])], + [cf_result=yes], + [cf_result=error]) + ]) + AC_MSG_RESULT($cf_result) + test "$cf_result" != error && break + fi + done + fi + test "$cf_curs_lib" = unknown && AC_MSG_ERROR(no curses library found) +fi +fi + +])dnl +dnl --------------------------------------------------------------------------- dnl CF_DIRNAME version: 5 updated: 2020/12/31 20:19:42 dnl ---------- dnl "dirname" is not portable, so we fake it with a shell script. @@ -1155,9 +1270,9 @@ ifelse($2,yes,[CF_GCC_ATTRIBUTES]) fi ])dnl dnl --------------------------------------------------------------------------- -dnl CF_FIND_LIBRARY version: 11 updated: 2021/01/02 09:31:20 +dnl CF_FIND_LIBRARY version: 13 updated: 2025/12/22 04:16:14 dnl --------------- -dnl Look for a non-standard library, given parameters for AC_TRY_LINK. We +dnl Look for a non-standard library, given parameters for AC_LINK_IFELSE. We dnl prefer a standard location, and use -L options only if we do not find the dnl library in the standard library location(s). dnl $1 = library name @@ -1167,7 +1282,7 @@ dnl $4 = code fragment to compile/link dnl $5 = corresponding function-name dnl $6 = flag, nonnull if failure should not cause an error-exit dnl -dnl Sets the variable "$cf_libdir" as a side-effect, so we can see if we had +dnl Sets the variable "$cf_libdir" as a side effect, so we can see if we had dnl to use a -L option. AC_DEFUN([CF_FIND_LIBRARY], [ @@ -1178,7 +1293,7 @@ AC_DEFUN([CF_FIND_LIBRARY], cf_save_LIBS="$LIBS" AC_MSG_CHECKING(for $5 in -l$1) LIBS="-l$1 $LIBS" - AC_TRY_LINK([$3],[$4], + AC_LINK_IFELSE([AC_LANG_PROGRAM([$3],[$4])], [AC_MSG_RESULT(yes) eval 'cf_cv_have_lib_'"$1"'=yes' ], @@ -1188,7 +1303,7 @@ AC_DEFUN([CF_FIND_LIBRARY], do AC_MSG_CHECKING(for -l$1 in $cf_libdir) LIBS="-L$cf_libdir -l$1 $cf_save_LIBS" - AC_TRY_LINK([$3],[$4], + AC_LINK_IFELSE([AC_LANG_PROGRAM([$3],[$4])], [AC_MSG_RESULT(yes) eval 'cf_cv_have_lib_'"$1"'=yes' break], @@ -1205,7 +1320,7 @@ fi ]) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_FIND_LINKAGE version: 22 updated: 2020/12/31 20:19:42 +dnl CF_FIND_LINKAGE version: 23 updated: 2025/12/22 04:16:14 dnl --------------- dnl Find a library (specifically the linkage used in the code fragment), dnl searching for it if it is not already in the library path. @@ -1228,7 +1343,7 @@ dnl $cf_cv_library_file_$3 - library-file if needed, e.g., -l$3 AC_DEFUN([CF_FIND_LINKAGE],[ # If the linkage is not already in the $CPPFLAGS/$LDFLAGS configuration, these -# will be set on completion of the AC_TRY_LINK below. +# will be set on completion of the AC_LINK_IFELSE below. cf_cv_header_path_$3= cf_cv_library_path_$3= @@ -1236,7 +1351,7 @@ CF_MSG_LOG([Starting [FIND_LINKAGE]($3,$6)]) cf_save_LIBS="$LIBS" -AC_TRY_LINK([$1],[$2],[ +AC_LINK_IFELSE([AC_LANG_PROGRAM([$1],[$2])],[ cf_cv_find_linkage_$3=yes cf_cv_header_path_$3=/usr/include cf_cv_library_path_$3=/usr/lib @@ -1244,7 +1359,7 @@ AC_TRY_LINK([$1],[$2],[ LIBS="-l$3 $7 $cf_save_LIBS" -AC_TRY_LINK([$1],[$2],[ +AC_LINK_IFELSE([AC_LANG_PROGRAM([$1],[$2])],[ cf_cv_find_linkage_$3=yes cf_cv_header_path_$3=/usr/include cf_cv_library_path_$3=/usr/lib @@ -1266,7 +1381,7 @@ AC_TRY_LINK([$1],[$2],[ CF_VERBOSE(... testing $cf_cv_header_path_$3) CPPFLAGS="$cf_save_CPPFLAGS" CF_APPEND_TEXT(CPPFLAGS,-I$cf_cv_header_path_$3) - AC_TRY_COMPILE([$1],[$2],[ + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([$1],[$2])],[ CF_VERBOSE(... found $3 headers in $cf_cv_header_path_$3) cf_cv_find_linkage_$3=maybe cf_test_CPPFLAGS="$CPPFLAGS" @@ -1286,7 +1401,7 @@ AC_TRY_LINK([$1],[$2],[ ifelse([$6],,,[ CPPFLAGS="$cf_test_CPPFLAGS" LIBS="-l$3 $7 $cf_save_LIBS" - AC_TRY_LINK([$1],[$2],[ + AC_LINK_IFELSE([AC_LANG_PROGRAM([$1],[$2])],[ CF_VERBOSE(... found $3 library in system) cf_cv_find_linkage_$3=yes]) CPPFLAGS="$cf_save_CPPFLAGS" @@ -1302,7 +1417,7 @@ AC_TRY_LINK([$1],[$2],[ CPPFLAGS="$cf_test_CPPFLAGS" LIBS="-l$3 $7 $cf_save_LIBS" LDFLAGS="$cf_save_LDFLAGS -L$cf_cv_library_path_$3" - AC_TRY_LINK([$1],[$2],[ + AC_LINK_IFELSE([AC_LANG_PROGRAM([$1],[$2])],[ CF_VERBOSE(... found $3 library in $cf_cv_library_path_$3) cf_cv_find_linkage_$3=yes cf_cv_library_file_$3="-l$3" @@ -1395,19 +1510,36 @@ fi AC_SUBST(EXTRA_CFLAGS) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_FUNC_GETTIME version: 2 updated: 2023/02/25 08:45:56 +dnl CF_FUNC_GETTIME version: 4 updated: 2025/12/23 18:53:34 dnl --------------- dnl Check for gettimeofday or clock_gettime. In 2023, the former is still more dnl widely supported, but "deprecated" (2008), so we will use the latter if it dnl is available, to reduce compiler warnings. AC_DEFUN([CF_FUNC_GETTIME],[ -AC_CACHE_CHECK(for clock_gettime,cf_cv_func_clock_gettime,[ - AC_TRY_LINK([#include <time.h>], +cf_save_libs="$LIBS" +AC_CHECK_FUNC(clock_gettime, + cf_cv_test_clock_gettime=yes, + AC_CHECK_LIB(rt, clock_gettime, + [LIBS="-lrt $LIBS" + cf_cv_test_clock_gettime=yes], + cf_cv_test_clock_gettime=no)) + +if test "$cf_cv_test_clock_gettime" = yes ; then +AC_CACHE_CHECK(if clock_gettime links,cf_cv_func_clock_gettime,[ + AC_LINK_IFELSE([AC_LANG_PROGRAM([ +$ac_includes_default +#include <time.h> + ], [struct timespec ts; - int rc = clock_gettime(CLOCK_REALTIME, &ts); (void) rc; (void)ts], + int rc = clock_gettime(CLOCK_REALTIME, &ts) + + clock_gettime(CLOCK_MONOTONIC, &ts); + (void) rc; (void)ts])], [cf_cv_func_clock_gettime=yes], [cf_cv_func_clock_gettime=no]) ]) +else + cf_cv_func_clock_gettime=no +fi if test "$cf_cv_func_clock_gettime" = yes then @@ -1422,7 +1554,7 @@ AC_CHECK_LIB(bsd, gettimeofday, fi ])dnl dnl --------------------------------------------------------------------------- -dnl CF_GCC_ATTRIBUTES version: 24 updated: 2021/03/20 12:00:25 +dnl CF_GCC_ATTRIBUTES version: 28 updated: 2025/12/25 18:43:31 dnl ----------------- dnl Test for availability of useful gcc __attribute__ directives to quiet dnl compiler warnings. Though useful, not all are supported -- and contrary @@ -1449,7 +1581,8 @@ cat > conftest.i <<EOF EOF if test "$GCC" = yes then - AC_CHECKING([for $CC __attribute__ directives]) + AC_MSG_CHECKING([for $CC __attribute__ directives]) + test -n "$verbose" && AC_MSG_RESULT() cat > "conftest.$ac_ext" <<EOF #line __oline__ "${as_me:-configure}" #include <stdio.h> @@ -1477,7 +1610,7 @@ EOF do CF_UPPER(cf_ATTRIBUTE,$cf_attribute) cf_directive="__attribute__(($cf_attribute))" - echo "checking for $CC $cf_directive" 1>&AC_FD_CC + echo "checking for $CC $cf_directive" 1>&AS_MESSAGE_LOG_FD case "$cf_attribute" in (printf) @@ -1552,7 +1685,7 @@ CF_INTEL_COMPILER(GCC,INTEL_COMPILER,CFLAGS) CF_CLANG_COMPILER(GCC,CLANG_COMPILER,CFLAGS) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_GCC_WARNINGS version: 41 updated: 2021/01/01 16:53:59 +dnl CF_GCC_WARNINGS version: 45 updated: 2025/12/24 09:07:25 dnl --------------- dnl Check if the compiler supports useful warning options. There's a few that dnl we don't use, simply because they're too noisy: @@ -1593,7 +1726,8 @@ then # remark #981: operands are evaluated in unspecified order # warning #279: controlling expression is constant - AC_CHECKING([for $CC warning options]) + AC_MSG_CHECKING([for $CC warning options]) + test -n "$verbose" && AC_MSG_RESULT() cf_save_CFLAGS="$CFLAGS" EXTRA_CFLAGS="$EXTRA_CFLAGS -Wall" for cf_opt in \ @@ -1616,7 +1750,8 @@ then CFLAGS="$cf_save_CFLAGS" elif test "$GCC" = yes && test "$GCC_VERSION" != "unknown" then - AC_CHECKING([for $CC warning options]) + AC_MSG_CHECKING([for $CC warning options]) + test -n "$verbose" && AC_MSG_RESULT() cf_save_CFLAGS="$CFLAGS" cf_warn_CONST="" test "$with_ext_const" = yes && cf_warn_CONST="Wwrite-strings" @@ -1666,6 +1801,26 @@ rm -rf ./conftest* AC_SUBST(EXTRA_CFLAGS) ])dnl dnl --------------------------------------------------------------------------- +dnl CF_GLOB_FULLPATH version: 2 updated: 2024/08/03 12:34:02 +dnl ---------------- +dnl Use this in case-statements to check for pathname syntax, i.e., absolute +dnl pathnames. The "x" is assumed since we provide an alternate form for DOS. +AC_DEFUN([CF_GLOB_FULLPATH],[ +AC_REQUIRE([CF_WITH_SYSTYPE])dnl +case "$cf_cv_system_name" in +(cygwin*|msys*|mingw32*|mingw64|os2*) + GLOB_FULLPATH_POSIX='/*' + GLOB_FULLPATH_OTHER='[[a-zA-Z]]:[[\\/]]*' + ;; +(*) + GLOB_FULLPATH_POSIX='/*' + GLOB_FULLPATH_OTHER=$GLOB_FULLPATH_POSIX + ;; +esac +AC_SUBST(GLOB_FULLPATH_POSIX) +AC_SUBST(GLOB_FULLPATH_OTHER) +])dnl +dnl --------------------------------------------------------------------------- dnl CF_GNATPREP_OPT_T version: 1 updated: 2014/08/02 18:37:25 dnl ----------------- AC_DEFUN([CF_GNATPREP_OPT_T],[ @@ -1707,7 +1862,7 @@ AC_SUBST(cf_compile_generics) AC_SUBST(cf_generic_objects) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_GNAT_PROJECTS version: 13 updated: 2021/01/02 17:09:14 +dnl CF_GNAT_PROJECTS version: 14 updated: 2025/12/24 12:27:29 dnl ---------------- dnl GNAT projects are configured with ".gpr" project files. dnl GNAT libraries are a further development, using the project feature. @@ -1768,7 +1923,7 @@ CF_EOF -XLIBRARY_DIR="`cd ../conftest.lib;pwd`" \ -XSOURCE_DIR="`pwd`" \ -XSONAME=libConfTest.so.1 \ - -XLIB_KIND=static 1>&AC_FD_CC 2>&1 ) ; then + -XLIB_KIND=static 1>&AS_MESSAGE_LOG_FD 2>&1 ) ; then cf_gnat_projects=yes fi cd .. @@ -1872,7 +2027,7 @@ fi AC_SUBST(USE_GNAT_SIGINT) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_GNAT_TRY_LINK version: 4 updated: 2021/01/01 13:31:04 +dnl CF_GNAT_TRY_LINK version: 5 updated: 2025/12/24 12:27:29 dnl ---------------- dnl Verify that a test program compiles/links with GNAT. dnl $cf_ada_make is set to the program that compiles/links @@ -1891,7 +2046,7 @@ CF_EOF cat >>conftest.adb <<CF_EOF $2 CF_EOF -if ( "$cf_ada_make" $ADAFLAGS conftest 1>&AC_FD_CC 2>&1 ) ; then +if ( "$cf_ada_make" $ADAFLAGS conftest 1>&AS_MESSAGE_LOG_FD 2>&1 ) ; then ifelse($3,, :,[ $3]) ifelse($4,,,[else $4]) @@ -1899,7 +2054,7 @@ fi rm -rf ./conftest* ./*~conftest* ])dnl dnl --------------------------------------------------------------------------- -dnl CF_GNAT_TRY_RUN version: 6 updated: 2021/01/01 13:31:04 +dnl CF_GNAT_TRY_RUN version: 7 updated: 2025/12/24 12:27:29 dnl --------------- dnl Verify that a test program compiles and runs with GNAT dnl $cf_ada_make is set to the program that compiles/links @@ -1918,8 +2073,8 @@ CF_EOF cat >>conftest.adb <<CF_EOF $2 CF_EOF -if ( "$cf_ada_make" $ADAFLAGS conftest 1>&AC_FD_CC 2>&1 ) ; then - if ( ./conftest 1>&AC_FD_CC 2>&1 ) ; then +if ( "$cf_ada_make" $ADAFLAGS conftest 1>&AS_MESSAGE_LOG_FD 2>&1 ) ; then + if ( ./conftest 1>&AS_MESSAGE_LOG_FD 2>&1 ) ; then ifelse($3,, :,[ $3]) ifelse($4,,,[ else $4]) @@ -1946,7 +2101,7 @@ test -z "$cf_cv_gnat_version" && cf_cv_gnat_version=no ifelse($1,,,[eval $1=$cf_cv_gnat_version; unset cf_cv_gnat_version]) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_GNU_SOURCE version: 10 updated: 2018/12/10 20:09:41 +dnl CF_GNU_SOURCE version: 11 updated: 2025/12/14 17:40:20 dnl ------------- dnl Check if we must define _GNU_SOURCE to get a reasonable value for dnl _XOPEN_SOURCE, upon which many POSIX definitions depend. This is a defect @@ -1962,14 +2117,14 @@ AC_DEFUN([CF_GNU_SOURCE], cf_gnu_xopen_source=ifelse($1,,500,$1) AC_CACHE_CHECK(if this is the GNU C library,cf_cv_gnu_library,[ -AC_TRY_COMPILE([#include <sys/types.h>],[ +AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <sys/types.h>],[ #if __GLIBC__ > 0 && __GLIBC_MINOR__ >= 0 return 0; #elif __NEWLIB__ > 0 && __NEWLIB_MINOR__ >= 0 return 0; #else # error not GNU C library - #endif], + #endif])], [cf_cv_gnu_library=yes], [cf_cv_gnu_library=no]) ]) @@ -1982,14 +2137,14 @@ if test x$cf_cv_gnu_library = xyes; then AC_CACHE_CHECK(if _DEFAULT_SOURCE can be used as a basis,cf_cv_gnu_library_219,[ cf_save="$CPPFLAGS" CF_APPEND_TEXT(CPPFLAGS,-D_DEFAULT_SOURCE) - AC_TRY_COMPILE([#include <sys/types.h>],[ + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <sys/types.h>],[ #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 19) || (__GLIBC__ > 2) return 0; #elif (__NEWLIB__ == 2 && __NEWLIB_MINOR__ >= 4) || (__GLIBC__ > 3) return 0; #else # error GNU C library __GLIBC__.__GLIBC_MINOR__ is too old - #endif], + #endif])], [cf_cv_gnu_library_219=yes], [cf_cv_gnu_library_219=no]) CPPFLAGS="$cf_save" @@ -1999,7 +2154,7 @@ if test x$cf_cv_gnu_library = xyes; then cf_save="$CPPFLAGS" AC_CACHE_CHECK(if _XOPEN_SOURCE=$cf_gnu_xopen_source works with _DEFAULT_SOURCE,cf_cv_gnu_dftsrc_219,[ CF_ADD_CFLAGS(-D_DEFAULT_SOURCE -D_XOPEN_SOURCE=$cf_gnu_xopen_source) - AC_TRY_COMPILE([ + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([ #include <limits.h> #include <sys/types.h> ],[ @@ -2007,7 +2162,7 @@ if test x$cf_cv_gnu_library = xyes; then return 0; #else # error GNU C library is too old - #endif], + #endif])], [cf_cv_gnu_dftsrc_219=yes], [cf_cv_gnu_dftsrc_219=no]) ]) @@ -2019,17 +2174,17 @@ if test x$cf_cv_gnu_library = xyes; then if test "x$cf_cv_gnu_dftsrc_219" != xyes; then AC_CACHE_CHECK(if we must define _GNU_SOURCE,cf_cv_gnu_source,[ - AC_TRY_COMPILE([#include <sys/types.h>],[ + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <sys/types.h>],[ #ifndef _XOPEN_SOURCE #error expected _XOPEN_SOURCE to be defined - #endif], + #endif])], [cf_cv_gnu_source=no], [cf_save="$CPPFLAGS" CF_ADD_CFLAGS(-D_GNU_SOURCE) - AC_TRY_COMPILE([#include <sys/types.h>],[ + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <sys/types.h>],[ #ifdef _XOPEN_SOURCE #error expected _XOPEN_SOURCE to be undefined - #endif], + #endif])], [cf_cv_gnu_source=no], [cf_cv_gnu_source=yes]) CPPFLAGS="$cf_save" @@ -2040,10 +2195,10 @@ if test x$cf_cv_gnu_library = xyes; then then AC_CACHE_CHECK(if we should also define _DEFAULT_SOURCE,cf_cv_default_source,[ CF_APPEND_TEXT(CPPFLAGS,-D_GNU_SOURCE) - AC_TRY_COMPILE([#include <sys/types.h>],[ + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <sys/types.h>],[ #ifdef _DEFAULT_SOURCE #error expected _DEFAULT_SOURCE to be undefined - #endif], + #endif])], [cf_cv_default_source=no], [cf_cv_default_source=yes]) ]) @@ -2289,7 +2444,45 @@ fi AC_SUBST(INSTALL_OPT_S) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_INTEL_COMPILER version: 9 updated: 2023/02/18 17:41:25 +dnl CF_INSTALL_PREFIX version: 2 updated: 2025/10/18 11:14:21 +dnl ----------------- +dnl Special option for use by system-builders: the install-prefix is used to +dnl adjust the location into which the actual install is done, so that an +dnl archive can be built without modifying the host system's configuration. +AC_DEFUN([CF_INSTALL_PREFIX],[ +AC_MSG_CHECKING(for an installation directory prefix) +AC_ARG_WITH(install-prefix, + [ --with-install-prefix=DESTDIR use DESTDIR as installation directory prefix], + [case "x$withval" in + (xyes|xno) + ;; + (*) DESTDIR="$withval" + ;; + esac]) +AC_MSG_RESULT([${DESTDIR:-(none)}]) +AC_SUBST(DESTDIR) + +SET_DESTDIR= +test -n "$DESTDIR" && SET_DESTDIR="DESTDIR=$DESTDIR" +AC_SUBST(SET_DESTDIR) + +AC_MSG_CHECKING(if installation directory prefix should be merged) +CF_ARG_ENABLE(install-prefix, + [ --enable-install-prefix merge DESTDIR with installation prefix], + cf_install_prefix=yes, + cf_install_prefix=no) +AC_MSG_RESULT($cf_install_prefix) + +if test "$cf_install_prefix" = yes ; then + MERGE_PREFIX=':$(prefix)%=%' +else + MERGE_PREFIX='' +fi + +AC_SUBST(MERGE_PREFIX) +])dnl +dnl --------------------------------------------------------------------------- +dnl CF_INTEL_COMPILER version: 10 updated: 2025/12/14 17:40:20 dnl ----------------- dnl Check if the given compiler is really the Intel compiler for Linux. It dnl tries to imitate gcc, but does not return an error when it finds a mismatch @@ -2312,12 +2505,12 @@ if test "$ifelse([$1],,[$1],GCC)" = yes ; then AC_MSG_CHECKING(if this is really Intel ifelse([$1],GXX,C++,C) compiler) cf_save_CFLAGS="$ifelse([$3],,CFLAGS,[$3])" ifelse([$3],,CFLAGS,[$3])="$ifelse([$3],,CFLAGS,[$3]) -no-gcc" - AC_TRY_COMPILE([],[ + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],[ #ifdef __INTEL_COMPILER #else #error __INTEL_COMPILER is not defined #endif -],[ifelse([$2],,INTEL_COMPILER,[$2])=yes +])],[ifelse([$2],,INTEL_COMPILER,[$2])=yes cf_save_CFLAGS="$cf_save_CFLAGS -we147" ],[]) ifelse([$3],,CFLAGS,[$3])="$cf_save_CFLAGS" @@ -2327,7 +2520,7 @@ cf_save_CFLAGS="$cf_save_CFLAGS -we147" fi ])dnl dnl --------------------------------------------------------------------------- -dnl CF_LARGEFILE version: 13 updated: 2023/12/03 19:09:59 +dnl CF_LARGEFILE version: 14 updated: 2025/12/22 04:16:14 dnl ------------ dnl Add checks for large file support. AC_DEFUN([CF_LARGEFILE],[ @@ -2357,7 +2550,7 @@ ifdef([AC_FUNC_FSEEKO],[ fi AC_CACHE_CHECK(whether to use struct dirent64, cf_cv_struct_dirent64,[ - AC_TRY_COMPILE([ + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([ #pragma GCC diagnostic error "-Wincompatible-pointer-types" #include <sys/types.h> #include <dirent.h> @@ -2372,7 +2565,7 @@ extern struct dirent64 * readdir(DIR *); struct dirent *y = readdir(dp); int z = x - y; (void)z; - ], + ])], [cf_cv_struct_dirent64=yes], [cf_cv_struct_dirent64=no]) ]) @@ -2381,7 +2574,7 @@ extern struct dirent64 * readdir(DIR *); ]) ]) dnl --------------------------------------------------------------------------- -dnl CF_LD_RPATH_OPT version: 9 updated: 2021/01/01 13:31:04 +dnl CF_LD_RPATH_OPT version: 10 updated: 2025/12/15 04:04:20 dnl --------------- dnl For the given system and compiler, find the compiler flags to pass to the dnl loader to use the "rpath" feature. @@ -2429,7 +2622,7 @@ then AC_MSG_CHECKING(if we need a space after rpath option) cf_save_LIBS="$LIBS" CF_ADD_LIBS(${LD_RPATH_OPT}$libdir) - AC_TRY_LINK(, , cf_rpath_space=no, cf_rpath_space=yes) + AC_LINK_IFELSE([AC_LANG_PROGRAM([], [])], cf_rpath_space=no, cf_rpath_space=yes) LIBS="$cf_save_LIBS" AC_MSG_RESULT($cf_rpath_space) test "$cf_rpath_space" = yes && LD_RPATH_OPT="$LD_RPATH_OPT " @@ -2600,7 +2793,7 @@ AC_DEFUN([CF_LIB_TYPE], test -n "$LIB_SUFFIX" && $2="${LIB_SUFFIX}[$]{$2}" ])dnl dnl --------------------------------------------------------------------------- -dnl CF_LINK_DATAONLY version: 15 updated: 2023/12/03 10:03:10 +dnl CF_LINK_DATAONLY version: 17 updated: 2025/12/24 12:27:29 dnl ---------------- dnl Some systems have a non-ANSI linker that doesn't pull in modules that have dnl only data (i.e., no functions), for example NeXT. On those systems we'll @@ -2616,10 +2809,10 @@ AC_CACHE_VAL(cf_cv_link_dataonly,[ int testdata[[3]] = { 123, 456, 789 }; EOF if AC_TRY_EVAL(ac_compile) ; then - mv conftest.o data.o && \ - ( $AR $ARFLAGS conftest.a data.o ) 2>&AC_FD_CC 1>/dev/null + mv conftest.$OBJEXT data.$OBJEXT && \ + ( $AR $ARFLAGS conftest.a data.$OBJEXT ) 2>&AS_MESSAGE_LOG_FD 1>/dev/null fi - rm -f conftest.$ac_ext data.o + rm -f conftest.$ac_ext data.$OBJEXT cat >conftest.$ac_ext <<EOF #line __oline__ "configure" extern int testfunc(void); @@ -2639,11 +2832,11 @@ int testfunc(void) #endif EOF if AC_TRY_EVAL(ac_compile); then - mv conftest.o func.o && \ - ( $AR $ARFLAGS conftest.a func.o ) 2>&AC_FD_CC 1>/dev/null + mv conftest.$OBJEXT func.$OBJEXT && \ + ( $AR $ARFLAGS conftest.a func.$OBJEXT ) 2>&AS_MESSAGE_LOG_FD 1>/dev/null fi - rm -f conftest.$ac_ext func.o - ( eval $RANLIB conftest.a ) 2>&AC_FD_CC >/dev/null + rm -f conftest.$ac_ext func.$OBJEXT + ( eval $RANLIB conftest.a ) 2>&AS_MESSAGE_LOG_FD >/dev/null cf_saveLIBS="$LIBS" LIBS="conftest.a $LIBS" AC_TRY_RUN([ @@ -2668,50 +2861,7 @@ AC_SUBST(BROKEN_LINKER) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_MAKEFLAGS version: 21 updated: 2021/09/04 06:47:34 -dnl ------------ -dnl Some 'make' programs support ${MAKEFLAGS}, some ${MFLAGS}, to pass 'make' -dnl options to lower-levels. It is very useful for "make -n" -- if we have it. -dnl (GNU 'make' does both, something POSIX 'make', which happens to make the -dnl ${MAKEFLAGS} variable incompatible because it adds the assignments :-) -AC_DEFUN([CF_MAKEFLAGS], -[AC_REQUIRE([AC_PROG_FGREP])dnl - -AC_CACHE_CHECK(for makeflags variable, cf_cv_makeflags,[ - cf_cv_makeflags='' - for cf_option in '-${MAKEFLAGS}' '${MFLAGS}' - do - cat >cf_makeflags.tmp <<CF_EOF -SHELL = $SHELL -all : - @ echo '.$cf_option' -CF_EOF - cf_result=`${MAKE:-make} -k -f cf_makeflags.tmp 2>/dev/null | ${FGREP-fgrep} -v "ing directory" | sed -e 's,[[ ]]*$,,'` - case "$cf_result" in - (.*k|.*kw) - cf_result="`${MAKE:-make} -k -f cf_makeflags.tmp CC=cc 2>/dev/null`" - case "$cf_result" in - (.*CC=*) cf_cv_makeflags= - ;; - (*) cf_cv_makeflags=$cf_option - ;; - esac - break - ;; - (.-) - ;; - (*) - CF_MSG_LOG(given option \"$cf_option\", no match \"$cf_result\") - ;; - esac - done - rm -f cf_makeflags.tmp -]) - -AC_SUBST(cf_cv_makeflags) -])dnl -dnl --------------------------------------------------------------------------- -dnl CF_MAKE_PHONY version: 3 updated: 2021/01/08 16:08:21 +dnl CF_MAKE_PHONY version: 4 updated: 2025/12/24 12:27:29 dnl ------------- dnl Check if the make-program handles a ".PHONY" target, e.g,. a target which dnl acts as a placeholder. @@ -2782,7 +2932,7 @@ CF_EOF fi break done - ) >&AC_FD_CC 2>&1 + ) >&AS_MESSAGE_LOG_FD 2>&1 cf_cv_make_PHONY="`cat conftest.tmp`" rm -rf conftest* ]) @@ -2861,7 +3011,7 @@ fi test "$cf_cv_mixedcase" = yes && AC_DEFINE(MIXEDCASE_FILENAMES,1,[Define to 1 if filesystem supports mixed-case filenames.]) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_MKSTEMP version: 13 updated: 2023/12/01 17:22:50 +dnl CF_MKSTEMP version: 14 updated: 2025/12/14 18:08:20 dnl ---------- dnl Check for a working mkstemp. This creates two files, checks that they are dnl successfully created and distinct (AmigaOS apparently fails on the last). @@ -2871,7 +3021,7 @@ unistd.h \ ) AC_CACHE_CHECK(for working mkstemp, cf_cv_func_mkstemp,[ rm -rf ./conftest* -AC_TRY_RUN([ +AC_RUN_IFELSE([AC_LANG_SOURCE([[ $ac_includes_default int main(void) @@ -2901,7 +3051,7 @@ int main(void) result = 1; ${cf_cv_main_return:-return}(result); } -],[cf_cv_func_mkstemp=yes +]])],[cf_cv_func_mkstemp=yes ],[cf_cv_func_mkstemp=no ],[cf_cv_func_mkstemp=maybe]) ]) @@ -2913,15 +3063,15 @@ if test "x$cf_cv_func_mkstemp" = xyes || test "x$ac_cv_func_mkstemp" = xyes ; th fi ])dnl dnl --------------------------------------------------------------------------- -dnl CF_MSG_LOG version: 5 updated: 2010/10/23 15:52:32 +dnl CF_MSG_LOG version: 6 updated: 2025/12/14 17:51:46 dnl ---------- dnl Write a debug message to config.log, along with the line number in the dnl configure script. AC_DEFUN([CF_MSG_LOG],[ -echo "${as_me:-configure}:__oline__: testing $* ..." 1>&AC_FD_CC +echo "${as_me:-configure}:__oline__: testing $* ..." 1>&AS_MESSAGE_LOG_FD ])dnl dnl --------------------------------------------------------------------------- -dnl CF_NCURSES_ADDON version: 6 updated: 2021/01/04 19:33:05 +dnl CF_NCURSES_ADDON version: 9 updated: 2025/12/24 13:30:00 dnl ---------------- dnl Configure an ncurses add-on, built outside the ncurses tree. AC_DEFUN([CF_NCURSES_ADDON],[ @@ -2929,18 +3079,29 @@ AC_REQUIRE([CF_NCURSES_CONFIG]) AC_PROVIDE([CF_SUBST_NCURSES_VERSION]) -AC_MSG_CHECKING(if you want wide-character code) -AC_ARG_ENABLE(widec, - [ --enable-widec compile with wide-char/UTF-8 code], - [with_widec=$enableval], - [with_widec=no]) -AC_MSG_RESULT($with_widec) -if test "$with_widec" = yes ; then +AC_MSG_CHECKING(for specified curses library type) +AC_ARG_WITH(screen, + [ --with-screen=XXX use specified curses-libraries], + [cf_cv_screen=$withval], + [cf_cv_screen=ncurses]) + +case $cf_cv_screen in +(curses|curses_*) + CF_CURSES_CONFIG + ;; +(ncursesw*) CF_UTF8_LIB - CF_NCURSES_CONFIG(ncursesw) -else - CF_NCURSES_CONFIG(ncurses) -fi + CF_NCURSES_CONFIG($cf_cv_screen) + ;; +(ncurses*) + CF_NCURSES_CONFIG($cf_cv_screen) + ;; +(*) + AC_MSG_ERROR(unexpected screen-value: $cf_cv_screen) + ;; +esac + +AC_SUBST(cf_cv_screen) if test "$NCURSES_CONFIG_PKG" != none ; then cf_version=`$PKG_CONFIG --modversion $NCURSES_CONFIG_PKG 2>/dev/null` @@ -3004,29 +3165,32 @@ dnl We need these values in the generated makefiles AC_SUBST(cf_cv_rel_version) AC_SUBST(cf_cv_abi_version) -dnl FIXME - not needed for Ada95 -AC_SUBST(cf_cv_builtin_bool) -AC_SUBST(cf_cv_header_stdbool_h) -AC_SUBST(cf_cv_type_of_bool)dnl - +AC_CACHE_CHECK(if KEY_RESIZE is supported,cf_cv_curses_resizes,[ + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <${cf_cv_ncurses_header:-curses.h}>], + [int key = KEY_RESIZE; (void)key])], + cf_cv_curses_resizes=yes, + cf_cv_curses_resizes=no)]) +cf_cv_enable_sigwinch=0 +test "$cf_cv_curses_resizes" = yes && cf_cv_enable_sigwinch=1 +AC_SUBST(cf_cv_enable_sigwinch) ]) dnl --------------------------------------------------------------------------- -dnl CF_NCURSES_CC_CHECK version: 6 updated: 2023/02/18 17:47:58 +dnl CF_NCURSES_CC_CHECK version: 7 updated: 2025/12/22 04:16:14 dnl ------------------- dnl Check if we can compile with ncurses' header file dnl $1 is the cache variable to set dnl $2 is the header-file to include dnl $3 is the root name (ncurses or ncursesw) AC_DEFUN([CF_NCURSES_CC_CHECK],[ - AC_TRY_COMPILE([ -]ifelse($3,ncursesw,[ + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([ +]ifelse([$3],ncursesw,[ #define _XOPEN_SOURCE_EXTENDED #undef HAVE_LIBUTF8_H /* in case we used CF_UTF8_LIB */ #define HAVE_LIBUTF8_H /* to force ncurses' header file to use cchar_t */ ])[ #include <$2>],[ #ifdef NCURSES_VERSION -]ifelse($3,ncursesw,[ +]ifelse([$3],ncursesw,[ #ifndef WACS_BSSB #error WACS_BSSB is not defined #endif @@ -3039,12 +3203,12 @@ printf("old\\n"); #error __NCURSES_H is not defined #endif #endif - ] + ])]dnl ,[$1=$2] ,[$1=no]) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_NCURSES_CONFIG version: 28 updated: 2021/08/28 15:20:37 +dnl CF_NCURSES_CONFIG version: 30 updated: 2025/12/22 04:16:14 dnl ----------------- dnl Tie together the configure-script macros for ncurses, preferring these in dnl order: @@ -3082,8 +3246,8 @@ if test "x${PKG_CONFIG:=none}" != xnone; then CF_ADD_CFLAGS($cf_pkg_cflags) CF_ADD_LIBS($cf_pkg_libs) - AC_TRY_LINK([#include <${cf_cv_ncurses_header:-curses.h}>], - [initscr(); mousemask(0,0); tigetstr((char *)0);], + AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <${cf_cv_ncurses_header:-curses.h}>], + [initscr(); mousemask(0,0); tigetstr((char *)0);])], [AC_TRY_RUN([#include <${cf_cv_ncurses_header:-curses.h}> int main(void) { const char *xx = curses_version(); return (xx == 0); }], @@ -3105,11 +3269,12 @@ if test "x${PKG_CONFIG:=none}" != xnone; then ;; esac + CF_REQUIRE_PKG($cf_ncuconfig_root) CF_APPEND_CFLAGS($cf_pkg_cflags) CF_ADD_LIBS($cf_pkg_libs) - AC_TRY_LINK([#include <${cf_cv_ncurses_header:-curses.h}>], - [initscr(); mousemask(0,0); tigetstr((char *)0);], + AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <${cf_cv_ncurses_header:-curses.h}>], + [initscr(); mousemask(0,0); tigetstr((char *)0);])], [AC_TRY_RUN([#include <${cf_cv_ncurses_header:-curses.h}> int main(void) { const char *xx = curses_version(); return (xx == 0); }], @@ -3225,7 +3390,7 @@ AC_DEFINE(NCURSES,1,[Define to 1 if we are using ncurses headers/libraries]) CF_NCURSES_VERSION ])dnl dnl --------------------------------------------------------------------------- -dnl CF_NCURSES_HEADER version: 7 updated: 2021/01/04 19:33:05 +dnl CF_NCURSES_HEADER version: 8 updated: 2025/12/22 04:16:14 dnl ----------------- dnl Find a "curses" header file, e.g,. "curses.h", or one of the more common dnl variations of ncurses' installs. @@ -3252,10 +3417,10 @@ AC_CACHE_CHECK(for $cf_ncuhdr_root include-path, cf_cv_ncurses_h2,[ CF_NCURSES_CC_CHECK(cf_cv_ncurses_h2,$cf_header,$1) if test "$cf_cv_ncurses_h2" != no ; then cf_cv_ncurses_h2=$cf_incdir/$cf_header - test -n "$verbose" && echo $ECHO_N " ... found $ECHO_C" 1>&AC_FD_MSG + test -n "$verbose" && echo $ECHO_N " ... found $ECHO_C" 1>&AS_MESSAGE_FD break fi - test -n "$verbose" && echo " ... tested $cf_incdir/$cf_header" 1>&AC_FD_MSG + test -n "$verbose" && echo " ... tested $cf_incdir/$cf_header" 1>&AS_MESSAGE_FD done CPPFLAGS="$cf_save2_CPPFLAGS" test "$cf_cv_ncurses_h2" != no && break @@ -3291,7 +3456,7 @@ esac ])dnl dnl --------------------------------------------------------------------------- -dnl CF_NCURSES_LIBS version: 21 updated: 2021/09/04 06:37:12 +dnl CF_NCURSES_LIBS version: 22 updated: 2025/12/22 04:16:14 dnl --------------- dnl Look for the ncurses library. This is a little complicated on Linux, dnl because it may be linked with the gpm (general purpose mouse) library. @@ -3348,8 +3513,8 @@ if test -n "$cf_ncurses_LIBS" ; then LIBS="$q" fi done - AC_TRY_LINK([#include <${cf_cv_ncurses_header:-curses.h}>], - [initscr(); mousemask(0,0); tigetstr((char *)0);], + AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <${cf_cv_ncurses_header:-curses.h}>], + [initscr(); mousemask(0,0); tigetstr((char *)0);])], [AC_MSG_RESULT(yes)], [AC_MSG_RESULT(no) LIBS="$cf_ncurses_SAVE"]) @@ -3359,7 +3524,7 @@ CF_UPPER(cf_nculib_ROOT,HAVE_LIB$cf_nculib_root) AC_DEFINE_UNQUOTED($cf_nculib_ROOT) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_NCURSES_VERSION version: 18 updated: 2024/01/07 06:34:16 +dnl CF_NCURSES_VERSION version: 19 updated: 2025/12/22 04:16:14 dnl ------------------ dnl Check for the version of ncurses, to aid in reporting bugs, etc. dnl Call CF_CURSES_CPPFLAGS first, or CF_NCURSES_CPPFLAGS. We don't use @@ -3410,7 +3575,7 @@ Autoconf "old" ; #endif EOF - cf_try="$ac_cpp conftest.$ac_ext 2>&AC_FD_CC | grep '^Autoconf ' >conftest.out" + cf_try="$ac_cpp conftest.$ac_ext 2>&AS_MESSAGE_LOG_FD | grep '^Autoconf ' >conftest.out" AC_TRY_EVAL(cf_try) if test -f conftest.out ; then cf_out=`sed -e 's%^Autoconf %%' -e 's%^[[^"]]*"%%' -e 's%".*%%' conftest.out` @@ -3459,39 +3624,39 @@ ifelse([$1],,,[$1=$PATH_SEPARATOR]) AC_MSG_RESULT($PATH_SEPARATOR) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_PATH_SYNTAX version: 18 updated: 2020/12/31 18:40:20 +dnl CF_PATH_SYNTAX version: 20 updated: 2025/12/16 04:09:03 dnl -------------- dnl Check the argument to see that it looks like a pathname. Rewrite it if it dnl begins with one of the prefix/exec_prefix variables, and then again if the dnl result begins with 'NONE'. This is necessary to work around autoconf's dnl delayed evaluation of those symbols. AC_DEFUN([CF_PATH_SYNTAX],[ +AC_REQUIRE([CF_GLOB_FULLPATH])dnl + if test "x$prefix" != xNONE; then cf_path_syntax="$prefix" else cf_path_syntax="$ac_default_prefix" fi -case ".[$]$1" in -(.\[$]\(*\)*|.\'*\'*) - ;; -(..|./*|.\\*) +case "x[$]$1" in +(x\[$]\(*\)*|x\'*\'*) ;; -(.[[a-zA-Z]]:[[\\/]]*) # OS/2 EMX +(x.|x$GLOB_FULLPATH_POSIX|x$GLOB_FULLPATH_OTHER) ;; -(.\[$]\{*prefix\}*|.\[$]\{*dir\}*) +(x\[$]\{*prefix\}*|x\[$]\{*dir\}*) eval $1="[$]$1" - case ".[$]$1" in - (.NONE/*) + case "x[$]$1" in + (xNONE/*) $1=`echo "[$]$1" | sed -e s%NONE%$cf_path_syntax%` ;; esac ;; -(.no|.NONE/*) +(xno|xNONE/*) $1=`echo "[$]$1" | sed -e s%NONE%$cf_path_syntax%` ;; (*) - ifelse([$2],,[AC_MSG_ERROR([expected a pathname, not \"[$]$1\"])],$2) + ifelse([$2],,[AC_MSG_ERROR([expected a pathname, not "[$]$1"])],$2) ;; esac ])dnl @@ -3534,7 +3699,7 @@ fi AC_SUBST(PKG_CONFIG) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_POSIX_C_SOURCE version: 12 updated: 2023/02/18 17:41:25 +dnl CF_POSIX_C_SOURCE version: 13 updated: 2025/12/14 17:40:20 dnl ----------------- dnl Define _POSIX_C_SOURCE to the given level, and _POSIX_SOURCE if needed. dnl @@ -3563,10 +3728,10 @@ CF_REMOVE_DEFINE(cf_trim_CPPFLAGS,$cf_save_CPPFLAGS,_POSIX_C_SOURCE) AC_CACHE_CHECK(if we should define _POSIX_C_SOURCE,cf_cv_posix_c_source,[ CF_MSG_LOG(if the symbol is already defined go no further) - AC_TRY_COMPILE([#include <sys/types.h>],[ + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <sys/types.h>],[ #ifndef _POSIX_C_SOURCE #error _POSIX_C_SOURCE is not defined -#endif], +#endif])], [cf_cv_posix_c_source=no], [cf_want_posix_source=no case .$cf_POSIX_C_SOURCE in @@ -3582,10 +3747,10 @@ AC_CACHE_CHECK(if we should define _POSIX_C_SOURCE,cf_cv_posix_c_source,[ ;; esac if test "$cf_want_posix_source" = yes ; then - AC_TRY_COMPILE([#include <sys/types.h>],[ + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <sys/types.h>],[ #ifdef _POSIX_SOURCE #error _POSIX_SOURCE is defined -#endif],[], +#endif])],[], cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE") fi CF_MSG_LOG(ifdef from value $cf_POSIX_C_SOURCE) @@ -3593,10 +3758,10 @@ AC_CACHE_CHECK(if we should define _POSIX_C_SOURCE,cf_cv_posix_c_source,[ CPPFLAGS="$cf_trim_CPPFLAGS" CF_APPEND_TEXT(CPPFLAGS,$cf_cv_posix_c_source) CF_MSG_LOG(if the second compile does not leave our definition intact error) - AC_TRY_COMPILE([#include <sys/types.h>],[ + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <sys/types.h>],[ #ifndef _POSIX_C_SOURCE #error _POSIX_C_SOURCE is not defined -#endif],, +#endif])],, [cf_cv_posix_c_source=no]) CFLAGS="$cf_save_CFLAGS" CPPFLAGS="$cf_save_CPPFLAGS" @@ -3613,7 +3778,7 @@ fi # cf_cv_posix_visible ])dnl dnl --------------------------------------------------------------------------- -dnl CF_POSIX_VISIBLE version: 1 updated: 2018/12/31 20:46:17 +dnl CF_POSIX_VISIBLE version: 2 updated: 2025/12/14 17:40:20 dnl ---------------- dnl POSIX documents test-macros which an application may set before any system dnl headers are included to make features available. @@ -3629,14 +3794,14 @@ dnl conflicting definition. AC_DEFUN([CF_POSIX_VISIBLE], [ AC_CACHE_CHECK(if the POSIX test-macros are already defined,cf_cv_posix_visible,[ -AC_TRY_COMPILE([#include <stdio.h>],[ +AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <stdio.h>],[ #if defined(__POSIX_VISIBLE) && ((__POSIX_VISIBLE - 0L) > 0) \ && defined(__XSI_VISIBLE) && ((__XSI_VISIBLE - 0L) > 0) \ && defined(__BSD_VISIBLE) && ((__BSD_VISIBLE - 0L) > 0) \ && defined(__ISO_C_VISIBLE) && ((__ISO_C_VISIBLE - 0L) > 0) #error conflicting symbols found #endif -],[cf_cv_posix_visible=no],[cf_cv_posix_visible=yes]) +])],[cf_cv_posix_visible=no],[cf_cv_posix_visible=yes]) ]) ])dnl dnl --------------------------------------------------------------------------- @@ -3673,7 +3838,7 @@ CF_ACVERSION_CHECK(2.52, CF_CC_ENV_FLAGS ])dnl dnl --------------------------------------------------------------------------- -dnl CF_PROG_CC_C_O version: 6 updated: 2021/01/01 13:31:04 +dnl CF_PROG_CC_C_O version: 7 updated: 2025/12/24 12:27:29 dnl -------------- dnl Analogous to AC_PROG_CC_C_O, but more useful: tests only $CC, ensures that dnl the output file can be renamed, and allows for a shell variable that can @@ -3697,7 +3862,7 @@ int main(void) CF_EOF # We do the test twice because some compilers refuse to overwrite an # existing .o file with -o, though they will create one. -ac_try='[$]$1 $2 -c conftest.$ac_ext -o conftest2.$ac_objext >&AC_FD_CC' +ac_try='[$]$1 $2 -c conftest.$ac_ext -o conftest2.$ac_objext >&AS_MESSAGE_LOG_FD' if AC_TRY_EVAL(ac_try) && test -f conftest2.$ac_objext && AC_TRY_EVAL(ac_try); then @@ -3754,7 +3919,7 @@ AC_SUBST(PROG_EXT) test -n "$PROG_EXT" && AC_DEFINE_UNQUOTED(PROG_EXT,"$PROG_EXT",[Define to the program extension (normally blank)]) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_PROG_GNAT version: 12 updated: 2021/01/02 17:09:14 +dnl CF_PROG_GNAT version: 13 updated: 2025/12/24 12:27:29 dnl ------------ dnl Check for gnat/gnatmake/etc, ensure that the toolset is complete. AC_DEFUN([CF_PROG_GNAT],[ @@ -3803,12 +3968,12 @@ else "$cf_gprconfig,,,,GCC" \ "$cf_gprconfig" do - cf_gprconfig_value=`echo s| gprconfig --config=$cf_gprconfig_param 2>&AC_FD_CC | ${AWK:-awk} '/^\*/{print [$]3;}' | head -n 1` + cf_gprconfig_value=`echo s| gprconfig --config=$cf_gprconfig_param 2>&AS_MESSAGE_LOG_FD | ${AWK:-awk} '/^\*/{print [$]3;}' | head -n 1` test -n "$cf_gprconfig_value" && break done else cf_gprconfig_param=$cf_gprconfig - cf_gprconfig_value=`echo s| gprconfig --config=$cf_gprconfig_param 2>&AC_FD_CC | ${AWK:-awk} '/^\*/{print [$]3;}' | head -n 1` + cf_gprconfig_value=`echo s| gprconfig --config=$cf_gprconfig_param 2>&AS_MESSAGE_LOG_FD | ${AWK:-awk} '/^\*/{print [$]3;}' | head -n 1` fi if test -n "$cf_gprconfig_value" then @@ -3859,15 +4024,25 @@ AC_SUBST(cf_ada_config_Ada) AC_SUBST(cf_ada_config_C) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_PROG_INSTALL version: 10 updated: 2021/01/04 19:33:05 +dnl CF_PROG_INSTALL version: 13 updated: 2025/10/21 16:28:49 dnl --------------- dnl Force $INSTALL to be an absolute-path. Otherwise, edit_man.sh and the dnl misc/tabset install won't work properly. Usually this happens only when dnl using the fallback mkinstalldirs script AC_DEFUN([CF_PROG_INSTALL], [AC_PROG_INSTALL -case $INSTALL in -(/*) +AC_REQUIRE([CF_GLOB_FULLPATH])dnl +if test "x$INSTALL" = "x./install-sh -c"; then + if test -f /usr/sbin/install ; then + case "$host_os" in + (linux*gnu*|uclinux*|gnu*|mint*|k*bsd*-gnu|cygwin|msys|mingw*|linux*uclibc) + INSTALL=/usr/sbin/install + ;; + esac + fi +fi +case x$INSTALL in +(x$GLOB_FULLPATH_POSIX|x$GLOB_FULLPATH_OTHER) ;; (*) CF_DIRNAME(cf_dir,$INSTALL) @@ -3947,6 +4122,30 @@ define([CF_REMOVE_LIB], $1=`echo "$2" | sed -e 's/-l$3[[ ]]//g' -e 's/-l$3[$]//'` ])dnl dnl --------------------------------------------------------------------------- +dnl CF_REQUIRE_PKG version: 1 updated: 2025/01/10 19:55:54 +dnl -------------- +dnl Update $REQUIRE_PKG, which lists the known required packages for this +dnl program. +dnl +dnl $1 = package(s) to require, e.g., in the generated ".pc" file +define([CF_REQUIRE_PKG], +[ +for cf_required in $1 +do + # check for duplicates + for cf_require_pkg in $REQUIRE_PKG + do + if test "$cf_required" = "$cf_require_pkg" + then + cf_required= + break + fi + done + test -n "$cf_required" && REQUIRE_PKG="$REQUIRE_PKG $cf_required" +done +AC_SUBST(REQUIRE_PKG) +])dnl +dnl --------------------------------------------------------------------------- dnl CF_RESTORE_XTRA_FLAGS version: 1 updated: 2020/01/11 16:47:45 dnl --------------------- dnl Restore flags saved in CF_SAVE_XTRA_FLAGS @@ -3983,7 +4182,7 @@ do done ])dnl dnl --------------------------------------------------------------------------- -dnl CF_SHARED_OPTS version: 111 updated: 2024/03/29 20:08:49 +dnl CF_SHARED_OPTS version: 114 updated: 2025/12/15 04:04:20 dnl -------------- dnl -------------- dnl Attempt to determine the appropriate CC/LD options for creating a shared @@ -4073,7 +4272,7 @@ AC_DEFUN([CF_SHARED_OPTS], for CC_SHARED_OPTS in -fPIC -fpic '' do CFLAGS="$cf_save_CFLAGS $CC_SHARED_OPTS" - AC_TRY_COMPILE([#include <stdio.h>],[int x = 1; (void)x],[break],[]) + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <stdio.h>],[int x = 1; (void)x])],[break],[]) done AC_MSG_RESULT($CC_SHARED_OPTS) CFLAGS="$cf_save_CFLAGS" @@ -4148,7 +4347,7 @@ CF_EOF AC_CACHE_CHECK([if ld -search_paths_first works], cf_cv_ldflags_search_paths_first, [ cf_save_LDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS -Wl,-search_paths_first" - AC_TRY_LINK(, [int i;], cf_cv_ldflags_search_paths_first=yes, cf_cv_ldflags_search_paths_first=no) + AC_LINK_IFELSE([AC_LANG_PROGRAM([], [int i;])], cf_cv_ldflags_search_paths_first=yes, cf_cv_ldflags_search_paths_first=no) LDFLAGS=$cf_save_LDFLAGS]) if test "$cf_cv_ldflags_search_paths_first" = yes; then LDFLAGS="$LDFLAGS -Wl,-search_paths_first" @@ -4278,7 +4477,7 @@ CF_EOF -L*) ldopts+=("\`echo \"\[$]1\" | sed \"s/^-L/-LIBPATH:/\"\`") ;; - *.obj | *.o) + *.obj | *.$OBJEXT) ldopts+=("\[$]1") ;; -Wl,*) @@ -4455,7 +4654,7 @@ CF_EOF for cf_shared_opts in -xcode=pic32 -xcode=pic13 -KPIC -Kpic -O do CFLAGS="$cf_shared_opts $cf_save_CFLAGS" - AC_TRY_COMPILE([#include <stdio.h>],[printf("Hello\\n");],[break]) + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <stdio.h>],[printf("Hello\\n");])],[break]) done CFLAGS="$cf_save_CFLAGS" CC_SHARED_OPTS=$cf_shared_opts @@ -4499,7 +4698,7 @@ cat > conftest.$ac_ext <<EOF int main(int argc, char *argv[[]]) { printf("hello\\n"); - return (argv[[argc-1]] == 0) ; + return (argv[[argc-1]] == NULL) ; } EOF cf_save_CFLAGS="$CFLAGS" @@ -4592,7 +4791,7 @@ do done ])dnl dnl --------------------------------------------------------------------------- -dnl CF_TERM_HEADER version: 6 updated: 2021/01/02 09:31:20 +dnl CF_TERM_HEADER version: 7 updated: 2025/12/22 04:16:14 dnl -------------- dnl Look for term.h, which is part of X/Open curses. It defines the interface dnl to terminfo database. Usually it is in the same include-path as curses.h, @@ -4610,10 +4809,10 @@ esac for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h" do -AC_TRY_COMPILE([#include <stdio.h> +AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <stdio.h> #include <${cf_cv_ncurses_header:-curses.h}> #include <$cf_test> -],[int x = auto_left_margin; (void)x],[ +],[int x = auto_left_margin; (void)x])],[ cf_cv_term_header="$cf_test"],[ cf_cv_term_header=unknown ]) @@ -4648,17 +4847,17 @@ top_builddir=ifelse($1,,`pwd`,$1) AC_SUBST(top_builddir) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_TRY_XOPEN_SOURCE version: 4 updated: 2022/09/10 15:16:16 +dnl CF_TRY_XOPEN_SOURCE version: 5 updated: 2025/12/14 17:40:20 dnl ------------------- dnl If _XOPEN_SOURCE is not defined in the compile environment, check if we dnl can define it successfully. AC_DEFUN([CF_TRY_XOPEN_SOURCE],[ AC_CACHE_CHECK(if we should define _XOPEN_SOURCE,cf_cv_xopen_source,[ - AC_TRY_COMPILE(CF__XOPEN_SOURCE_HEAD,CF__XOPEN_SOURCE_BODY, + AC_COMPILE_IFELSE([AC_LANG_PROGRAM(CF__XOPEN_SOURCE_HEAD,CF__XOPEN_SOURCE_BODY)], [cf_cv_xopen_source=no], [cf_save="$CPPFLAGS" CF_APPEND_TEXT(CPPFLAGS,-D_XOPEN_SOURCE=$cf_XOPEN_SOURCE) - AC_TRY_COMPILE(CF__XOPEN_SOURCE_HEAD,CF__XOPEN_SOURCE_BODY, + AC_COMPILE_IFELSE([AC_LANG_PROGRAM(CF__XOPEN_SOURCE_HEAD,CF__XOPEN_SOURCE_BODY)], [cf_cv_xopen_source=no], [cf_cv_xopen_source=$cf_XOPEN_SOURCE]) CPPFLAGS="$cf_save" @@ -4682,20 +4881,20 @@ AC_DEFUN([CF_UPPER], $1=`echo "$2" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%` ])dnl dnl --------------------------------------------------------------------------- -dnl CF_UTF8_LIB version: 10 updated: 2023/01/11 04:05:23 +dnl CF_UTF8_LIB version: 12 updated: 2025/12/22 04:16:14 dnl ----------- dnl Check for multibyte support, and if not found, utf8 compatibility library AC_DEFUN([CF_UTF8_LIB], [ -AC_HAVE_HEADERS(wchar.h) +AC_CHECK_HEADERS(wchar.h) AC_CACHE_CHECK(for multibyte character support,cf_cv_utf8_lib,[ cf_save_LIBS="$LIBS" - AC_TRY_LINK([ + AC_LINK_IFELSE([AC_LANG_PROGRAM([ $ac_includes_default #ifdef HAVE_WCHAR_H #include <wchar.h> #endif -],[putwc(0,0);], +],[putwc(0,0);])], [cf_cv_utf8_lib=yes], [CF_FIND_LINKAGE([ #include <libutf8.h>],[putwc(0,0);],utf8, @@ -4713,22 +4912,22 @@ if test "$cf_cv_utf8_lib" = "add-on" ; then fi ])dnl dnl --------------------------------------------------------------------------- -dnl CF_VERBOSE version: 3 updated: 2007/07/29 09:55:12 +dnl CF_VERBOSE version: 4 updated: 2025/12/14 17:51:46 dnl ---------- dnl Use AC_VERBOSE w/o the warnings AC_DEFUN([CF_VERBOSE], -[test -n "$verbose" && echo " $1" 1>&AC_FD_MSG +[test -n "$verbose" && echo " $1" 1>&AS_MESSAGE_FD CF_MSG_LOG([$1]) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_WEAK_SYMBOLS version: 1 updated: 2008/08/16 19:18:06 +dnl CF_WEAK_SYMBOLS version: 2 updated: 2025/12/24 12:27:29 dnl --------------- dnl Check for compiler-support for weak symbols. dnl This works with "recent" gcc. AC_DEFUN([CF_WEAK_SYMBOLS],[ AC_CACHE_CHECK(if $CC supports weak symbols,cf_cv_weak_symbols,[ -AC_TRY_COMPILE([ +AC_COMPILE_IFELSE([AC_LANG_PROGRAM([ #include <stdio.h>], [ #if defined(__GNUC__) @@ -4743,10 +4942,60 @@ AC_TRY_COMPILE([ #endif weak_symbol(fopen); -],[cf_cv_weak_symbols=yes],[cf_cv_weak_symbols=no]) +])],[cf_cv_weak_symbols=yes],[cf_cv_weak_symbols=no]) ]) ])dnl dnl --------------------------------------------------------------------------- +dnl CF_WITH_ADA version: 2 updated: 2024/11/09 18:07:29 +dnl ----------- +dnl Check for the Ada compiler (unless requested to not do this), which causes +dnl a further check for a C compiler which can work with the Ada compiler. +AC_DEFUN([CF_WITH_ADA],[ +AC_ARG_WITH(ada, + [ --without-ada suppress check for Ada compiler], + [cf_with_ada=$withval], + [cf_with_ada=yes]) + +cf_prog_cc="gcc cc" +if test "x$cf_with_ada" = xyes +then + CF_PROG_GNAT + if test "x$cf_cv_prog_gnat_correct" = xyes; then + # gcc's developers chose to deprecate gnatgcc before making gprconfig + # work. They replaced gnatgcc in gcc 13 with a script which spits out + # a warning offering advice which could never work. + # + # Here is a workaround. + AC_PATH_PROG(cf_cv_path_gnatgcc,gnatgcc,no) + if test "$cf_cv_path_gnatgcc" != no + then + AC_MSG_CHECKING(for improvement) + cf_file_gnatgcc=`file -L "$cf_cv_path_gnatgcc" 2>/dev/null` + case "x$cf_file_gnatgcc" in + (*script*) + cf_cv_path_gnatgcc=`sh -x "$cf_cv_path_gnatgcc" --version 2>&1 | grep -w exec | sed -e 's/^[[ ]]*+[[ ]]*//' -e 's/exec[[ ]]//' -e 's/ .*//'` + ;; + (*) + cf_cv_path_gnatgcc=no + ;; + esac + AC_MSG_RESULT($cf_cv_path_gnatgcc) + test "$cf_cv_path_gnatgcc" = no && cf_cv_path_gnatgcc=gnatgcc + cf_prog_cc="$cf_cv_path_gnatgcc $cf_prog_cc" + fi + fi +fi +case "$cf_prog_cc" in +(*/*) + CC="$cf_prog_cc" + AC_SUBST(CC) + ;; +(*) + CF_PROG_CC($cf_prog_cc) + ;; +esac +])dnl +dnl --------------------------------------------------------------------------- dnl CF_WITH_ADA_COMPILER version: 3 updated: 2023/10/28 11:59:01 dnl -------------------- dnl Command-line option to specify the Ada95 compiler. @@ -4924,7 +5173,7 @@ eval $3="$withval" AC_SUBST($3)dnl ])dnl dnl --------------------------------------------------------------------------- -dnl CF_WITH_PKG_CONFIG_LIBDIR version: 23 updated: 2023/11/22 20:48:30 +dnl CF_WITH_PKG_CONFIG_LIBDIR version: 25 updated: 2024/08/03 13:34:29 dnl ------------------------- dnl Allow the choice of the pkg-config library directory to be overridden. dnl @@ -4938,6 +5187,7 @@ dnl pkgconf (used with some systems such as FreeBSD in place of pkg-config) dnl optionally ignores $PKG_CONFIG_LIBDIR. Very old versions of pkg-config, dnl e.g., Solaris 10 also do not recognize $PKG_CONFIG_LIBDIR. AC_DEFUN([CF_WITH_PKG_CONFIG_LIBDIR],[ +AC_REQUIRE([CF_GLOB_FULLPATH])dnl case "$PKG_CONFIG" in (no|none|yes) @@ -4971,10 +5221,10 @@ case "x$cf_search_path" in ;; (x) ;; -(x/*\ *) +(x$GLOB_FULLPATH_POSIX\ *|x$GLOB_FULLPATH_OTHER\ *) PKG_CONFIG_LIBDIR= ;; -(x/*) +(x$GLOB_FULLPATH_POSIX|x$GLOB_FULLPATH_OTHER) PKG_CONFIG_LIBDIR="$cf_search_path" AC_MSG_RESULT($PKG_CONFIG_LIBDIR) cf_search_path= @@ -4993,7 +5243,15 @@ case "x$cf_search_path" in pkg-config \ pkgconf do - cf_search_path=`"$PKG_CONFIG" --variable=pc_path "$cf_pkg_program" 2>/dev/null | tr : ' '` + cf_raw_search_path=`"$PKG_CONFIG" --variable=pc_path "$cf_pkg_program" 2>/dev/null` + case "$cf_raw_search_path" in + (*\\*) + cf_search_path=`echo "$cf_raw_search_path" | tr ';' ' ' | tr '\' '/'` + ;; + (*/*) + cf_search_path=`echo "$cf_raw_search_path" | tr : ' '` + ;; + esac test -n "$cf_search_path" && break done @@ -5066,7 +5324,7 @@ fi AC_SUBST(PKG_CONFIG_LIBDIR) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_WITH_PTHREAD version: 7 updated: 2015/04/18 08:56:57 +dnl CF_WITH_PTHREAD version: 8 updated: 2025/12/24 12:27:29 dnl --------------- dnl Check for POSIX thread library. AC_DEFUN([CF_WITH_PTHREAD], @@ -5087,12 +5345,12 @@ if test "$with_pthread" != no ; then AC_MSG_CHECKING(if we can link with the $cf_lib_pthread library) cf_save_LIBS="$LIBS" CF_ADD_LIB($cf_lib_pthread) - AC_TRY_LINK([ + AC_LINK_IFELSE([AC_LANG_PROGRAM([ #include <pthread.h> ],[ int rc = pthread_create(0,0,0,0); int r2 = pthread_mutexattr_settype(0, 0); -],[with_pthread=yes],[with_pthread=no]) +])],[with_pthread=yes],[with_pthread=no]) LIBS="$cf_save_LIBS" AC_MSG_RESULT($with_pthread) test "$with_pthread" = yes && break @@ -5108,7 +5366,7 @@ if test "$with_pthread" != no ; then fi ]) dnl --------------------------------------------------------------------------- -dnl CF_WITH_SYSTYPE version: 1 updated: 2013/01/26 16:26:12 +dnl CF_WITH_SYSTYPE version: 2 updated: 2025/12/14 18:08:20 dnl --------------- dnl For testing, override the derived host system-type which is used to decide dnl things such as the linker commands used to build shared libraries. This is @@ -5119,7 +5377,7 @@ dnl This is different from the --host option: it is used only for testing parts dnl of the configure script which would not be reachable with --host since that dnl relies on the build environment being real, rather than mocked up. AC_DEFUN([CF_WITH_SYSTYPE],[ -CF_CHECK_CACHE([AC_CANONICAL_SYSTEM]) +CF_CHECK_CACHE([AC_CANONICAL_TARGET]) AC_ARG_WITH(system-type, [ --with-system-type=XXX test: override derived host system-type], [AC_MSG_WARN(overriding system type to $withval) @@ -5128,7 +5386,7 @@ AC_ARG_WITH(system-type, ]) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_XOPEN_SOURCE version: 67 updated: 2023/09/06 18:55:27 +dnl CF_XOPEN_SOURCE version: 71 updated: 2025/12/14 17:40:20 dnl --------------- dnl Try to get _XOPEN_SOURCE defined properly that we can use POSIX functions, dnl or adapt to the vendor's definitions to get equivalent functionality, @@ -5188,9 +5446,12 @@ case "$host_os" in cf_xopen_source="-D_SGI_SOURCE" cf_XOPEN_SOURCE= ;; -(linux*gnu|linux*gnuabi64|linux*gnuabin32|linux*gnueabi|linux*gnueabihf|linux*gnux32|uclinux*|gnu*|mint*|k*bsd*-gnu|cygwin|msys|mingw*|linux*uclibc) +(linux*gnu*|uclinux*|gnu*|mint*|k*bsd*-gnu|cygwin|msys|mingw*|linux*uclibc) CF_GNU_SOURCE($cf_XOPEN_SOURCE) ;; +linux*musl) + cf_xopen_source="-D_BSD_SOURCE" + ;; (minix*) cf_xopen_source="-D_NETBSD_SOURCE" # POSIX.1-2001 features are ifdef'd with this... ;; @@ -5242,7 +5503,7 @@ case "$host_os" in # Some of these niche implementations use copy/paste, double-check... if test "$cf_cv_xopen_source" = no ; then CF_VERBOSE(checking if _POSIX_C_SOURCE interferes with _XOPEN_SOURCE) - AC_TRY_COMPILE(CF__XOPEN_SOURCE_HEAD,CF__XOPEN_SOURCE_BODY,,[ + AC_COMPILE_IFELSE([AC_LANG_PROGRAM(CF__XOPEN_SOURCE_HEAD,CF__XOPEN_SOURCE_BODY)],,[ AC_MSG_WARN(_POSIX_C_SOURCE definition is not usable) CPPFLAGS="$cf_save_xopen_cppflags"]) fi @@ -5258,19 +5519,19 @@ dnl which is still not guaranteed to provide all of the entrypoints that dnl _XOPEN_SOURCE would yield. if test -n "$cf_XOPEN_SOURCE" && test -z "$cf_cv_xopen_source" ; then AC_MSG_CHECKING(if _XOPEN_SOURCE really is set) - AC_TRY_COMPILE([#include <stdlib.h>],[ + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <stdlib.h>],[ #ifndef _XOPEN_SOURCE #error _XOPEN_SOURCE is not defined -#endif], +#endif])], [cf_XOPEN_SOURCE_set=yes], [cf_XOPEN_SOURCE_set=no]) AC_MSG_RESULT($cf_XOPEN_SOURCE_set) if test "$cf_XOPEN_SOURCE_set" = yes then - AC_TRY_COMPILE([#include <stdlib.h>],[ + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <stdlib.h>],[ #if (_XOPEN_SOURCE - 0) < $cf_XOPEN_SOURCE #error (_XOPEN_SOURCE - 0) < $cf_XOPEN_SOURCE -#endif], +#endif])], [cf_XOPEN_SOURCE_set_ok=yes], [cf_XOPEN_SOURCE_set_ok=no]) if test "$cf_XOPEN_SOURCE_set_ok" = no |
