X-Git-Url: https://ncurses.scripts.mit.edu/?a=blobdiff_plain;f=Ada95%2Faclocal.m4;h=c675b6a310b78d9a57a7e50d74cb32b3afe2e795;hb=HEAD;hp=5f565f18e77ed36e3d3631217b74554b75d36ae2;hpb=2632b47fdcf4dcd101962c92acafaac69630388f;p=ncurses.git diff --git a/Ada95/aclocal.m4 b/Ada95/aclocal.m4 index 5f565f18..b6d9f27c 100644 --- a/Ada95/aclocal.m4 +++ b/Ada95/aclocal.m4 @@ -1,5 +1,5 @@ dnl*************************************************************************** -dnl Copyright 2018-2022,2023 Thomas E. Dickey * +dnl Copyright 2018-2023,2024 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.197 2023/01/07 17:53:15 tom Exp $ +dnl $Id: aclocal.m4,v 1.216 2024/06/01 21:38:29 tom Exp $ dnl Macros used in NCURSES Ada95 auto-configuration script. dnl dnl These macros are maintained separately from NCURSES. The copyright on @@ -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: 12 updated: 2024/03/17 09:17:26 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 @@ -577,9 +577,9 @@ else : ${BUILD_CC:='${CC}'} : ${BUILD_CPP:='${CPP}'} : ${BUILD_CFLAGS:='${CFLAGS}'} - : ${BUILD_CPPFLAGS:='${CPPFLAGS}'} + : ${BUILD_CPPFLAGS:='ifelse([$1],,'${CPPFLAGS}',[$1])'} : ${BUILD_LDFLAGS:='${LDFLAGS}'} - : ${BUILD_LIBS:='${LIBS}'} + : ${BUILD_LIBS:='ifelse([$2],,'${LIBS}',[$2])'} : ${BUILD_EXEEXT:='$x'} : ${BUILD_OBJEXT:='o'} fi @@ -594,7 +594,7 @@ AC_SUBST(BUILD_EXEEXT) AC_SUBST(BUILD_OBJEXT) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_C11_NORETURN version: 3 updated: 2021/03/28 11:36:23 +dnl CF_C11_NORETURN version: 4 updated: 2023/02/18 17:41:25 dnl --------------- AC_DEFUN([CF_C11_NORETURN], [ @@ -608,8 +608,7 @@ 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([ -#include -#include +$ac_includes_default #include static _Noreturn void giveup(void) { exit(0); } ], @@ -633,7 +632,7 @@ AC_SUBST(HAVE_STDNORETURN_H) AC_SUBST(STDC_NORETURN) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_CC_ENV_FLAGS version: 10 updated: 2020/12/31 18:40:20 +dnl CF_CC_ENV_FLAGS version: 11 updated: 2023/02/20 11:15:46 dnl --------------- dnl Check for user's environment-breakage by stuffing CFLAGS/CPPFLAGS content dnl into CC. This will not help with broken scripts that wrap the compiler @@ -674,7 +673,7 @@ case "$CC" in AC_MSG_WARN(your environment uses the CC variable to hold CFLAGS/CPPFLAGS options) # humor him... cf_prog=`echo "$CC" | sed -e 's/ / /g' -e 's/[[ ]]* / /g' -e 's/[[ ]]*[[ ]]-[[^ ]].*//'` - cf_flags=`echo "$CC" | ${AWK:-awk} -v prog="$cf_prog" '{ printf("%s", [substr]([$]0,1+length(prog))); }'` + cf_flags=`echo "$CC" | sed -e "s%^$cf_prog%%"` CC="$cf_prog" for cf_arg in $cf_flags do @@ -834,7 +833,7 @@ then fi ])dnl dnl --------------------------------------------------------------------------- -dnl CF_CLANG_COMPILER version: 8 updated: 2021/01/01 13:31:04 +dnl CF_CLANG_COMPILER version: 9 updated: 2023/02/18 17:41:25 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 @@ -856,7 +855,7 @@ if test "$ifelse([$1],,[$1],GCC)" = yes ; then AC_TRY_COMPILE([],[ #ifdef __clang__ #else -make an error +#error __clang__ is not defined #endif ],[ifelse([$2],,CLANG_COMPILER,[$2])=yes ],[]) @@ -902,67 +901,7 @@ if test "x$ifelse([$2],,CLANG_COMPILER,[$2])" = "xyes" ; then fi ]) dnl --------------------------------------------------------------------------- -dnl CF_CONST_X_STRING version: 7 updated: 2021/06/07 17:39:17 -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( -[ -#include -#include -], -[String foo = malloc(1); free((void*)foo)],[ - -AC_CACHE_CHECK(for X11/Xt const-feature,cf_cv_const_x_string,[ - AC_TRY_COMPILE( - [ -#define _CONST_X_STRING /* X11R7.8 (perhaps) */ -#undef XTSTRINGDEFINES /* X11R5 and later */ -#include -#include - ],[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]) - -case "$cf_cv_const_x_string" in -(no) - CF_APPEND_TEXT(CPPFLAGS,-DXTSTRINGDEFINES) - ;; -(*) - CF_APPEND_TEXT(CPPFLAGS,-D_CONST_X_STRING) - ;; -esac - -]) -])dnl -dnl --------------------------------------------------------------------------- -dnl CF_CONST_X_STRING version: 7 updated: 2021/06/07 17:39:17 +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. @@ -997,6 +936,7 @@ AC_TRY_COMPILE( 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 @@ -1394,6 +1334,50 @@ fi AC_SUBST(EXTRA_CFLAGS) ])dnl dnl --------------------------------------------------------------------------- +dnl CF_FUNC_GETTIME version: 3 updated: 2024/05/11 13:40:02 +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],[ +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_TRY_LINK([ +$ac_includes_default +#include + ], + [struct timespec 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 + AC_DEFINE(HAVE_CLOCK_GETTIME,1,[Define to 1 if we have clock_gettime function]) +else +AC_CHECK_FUNC(gettimeofday, + AC_DEFINE(HAVE_GETTIMEOFDAY,1,[Define to 1 if we have gettimeofday function]),[ + +AC_CHECK_LIB(bsd, gettimeofday, + AC_DEFINE(HAVE_GETTIMEOFDAY,1,[Define to 1 if we have gettimeofday function]) + CF_ADD_LIB(bsd))])dnl CLIX: bzero, select, gettimeofday +fi +])dnl +dnl --------------------------------------------------------------------------- dnl CF_GCC_ATTRIBUTES version: 24 updated: 2021/03/20 12:00:25 dnl ----------------- dnl Test for availability of useful gcc __attribute__ directives to quiet @@ -1507,7 +1491,7 @@ rm -rf ./conftest* fi ])dnl dnl --------------------------------------------------------------------------- -dnl CF_GCC_VERSION version: 8 updated: 2019/09/07 13:38:36 +dnl CF_GCC_VERSION version: 9 updated: 2023/03/05 14:30:13 dnl -------------- dnl Find version of gcc, and (because icc/clang pretend to be gcc without being dnl compatible), attempt to determine if icc/clang is actually used. @@ -1516,7 +1500,7 @@ AC_REQUIRE([AC_PROG_CC]) GCC_VERSION=none if test "$GCC" = yes ; then AC_MSG_CHECKING(version of $CC) - 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.]].*//'`" + GCC_VERSION="`${CC} --version 2>/dev/null | sed -e '2,$d' -e 's/^[[^(]]*([[^)]][[^)]]*) //' -e 's/^[[^0-9.]]*//' -e 's/[[^0-9.]].*//'`" test -z "$GCC_VERSION" && GCC_VERSION=unknown AC_MSG_RESULT($GCC_VERSION) fi @@ -2100,7 +2084,7 @@ CPPFLAGS="-I. $CPPFLAGS" AC_SUBST(CPPFLAGS) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_INSTALL_OPTS version: 2 updated: 2018/08/18 12:19:21 +dnl CF_INSTALL_OPTS version: 3 updated: 2023/06/03 15:17:30 dnl --------------- dnl prompt for/fill-in useful install-program options AC_DEFUN([CF_INSTALL_OPTS], @@ -2108,6 +2092,7 @@ AC_DEFUN([CF_INSTALL_OPTS], CF_INSTALL_OPT_S CF_INSTALL_OPT_P CF_INSTALL_OPT_O +CF_INSTALL_OPT_STRIP_PROG ])dnl dnl --------------------------------------------------------------------------- dnl CF_INSTALL_OPT_O version: 3 updated: 2020/12/31 20:19:42 @@ -2194,7 +2179,73 @@ fi AC_SUBST(INSTALL_OPT_S) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_INTEL_COMPILER version: 8 updated: 2021/01/01 16:53:59 +dnl CF_INSTALL_OPT_STRIP_PROG version: 1 updated: 2023/06/03 15:17:30 +dnl ------------------------- +dnl Provide an option for overriding the strip program used in install "-s" +dnl +dnl coreutils install provides a --strip-program option +dnl FreeBSD uses STRIPBIN environment variable, while NetBSD and OpenBSD use +dnl STRIP environment variable. Other versions of install do not support this. +AC_DEFUN([CF_INSTALL_OPT_STRIP_PROG], +[ +AC_REQUIRE([CF_INSTALL_OPT_S]) +if test -n "$INSTALL_OPT_S" +then + AC_MSG_CHECKING(if you want to specify strip-program) + AC_ARG_WITH(strip-program, + [ --with-strip-program=XX specify program to use when stripping in install], + [with_strip_program=$withval], + [with_strip_program=no]) + AC_MSG_RESULT($with_strip_program) + if test "$with_strip_program" != no + then + AC_MSG_CHECKING(if strip-program is supported with this installer) + cf_install_program=`echo "$INSTALL" | sed -e 's%[[ ]]*[[ ]]-.%%'` + check_install_strip=no + if test -f "$cf_install_program" + then + check_install_version=`"$cf_install_program" --version 2>/dev/null | head -n 1 | grep coreutils` + if test -n "$check_install_version" + then + check_install_strip="option" + else + for check_strip_variable in STRIPBIN STRIP + do + if strings "$cf_install_program" | grep "^$check_strip_variable[$]" >/dev/null + then + check_install_strip="environ" + break + fi + done + fi + fi + AC_MSG_RESULT($check_install_strip) + case "$check_install_strip" in + (no) + AC_MSG_WARN($cf_install_program does not support strip program option) + with_strip_program=no + ;; + (environ) + cat >install.tmp <<-CF_EOF + #! $SHELL + STRIPBIN="$with_strip_program" \\ + STRIP="$with_strip_program" \\ + $INSTALL "[$]@" + CF_EOF + INSTALL="`pwd`/install.tmp" + chmod +x "$INSTALL" + CF_VERBOSE(created $INSTALL) + ;; + (option) + INSTALL_OPT_S="$INSTALL_OPT_S --strip-program=\"$with_strip_program\"" + ;; + esac + fi +fi +AC_SUBST(INSTALL_OPT_S) +])dnl +dnl --------------------------------------------------------------------------- +dnl CF_INTEL_COMPILER version: 9 updated: 2023/02/18 17:41:25 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 @@ -2220,7 +2271,7 @@ if test "$ifelse([$1],,[$1],GCC)" = yes ; then AC_TRY_COMPILE([],[ #ifdef __INTEL_COMPILER #else -make an error +#error __INTEL_COMPILER is not defined #endif ],[ifelse([$2],,INTEL_COMPILER,[$2])=yes cf_save_CFLAGS="$cf_save_CFLAGS -we147" @@ -2232,7 +2283,7 @@ cf_save_CFLAGS="$cf_save_CFLAGS -we147" fi ])dnl dnl --------------------------------------------------------------------------- -dnl CF_LARGEFILE version: 12 updated: 2020/03/19 20:23:48 +dnl CF_LARGEFILE version: 13 updated: 2023/12/03 19:09:59 dnl ------------ dnl Add checks for large file support. AC_DEFUN([CF_LARGEFILE],[ @@ -2266,11 +2317,15 @@ ifdef([AC_FUNC_FSEEKO],[ #pragma GCC diagnostic error "-Wincompatible-pointer-types" #include #include + +#ifndef __REDIRECT +/* if transitional largefile support is setup, this is true */ +extern struct dirent64 * readdir(DIR *); +#endif ],[ - /* if transitional largefile support is setup, this is true */ - extern struct dirent64 * readdir(DIR *); - struct dirent64 *x = readdir((DIR *)0); - struct dirent *y = readdir((DIR *)0); + DIR *dp = opendir("."); + struct dirent64 *x = readdir(dp); + struct dirent *y = readdir(dp); int z = x - y; (void)z; ], @@ -2501,7 +2556,7 @@ AC_DEFUN([CF_LIB_TYPE], test -n "$LIB_SUFFIX" && $2="${LIB_SUFFIX}[$]{$2}" ])dnl dnl --------------------------------------------------------------------------- -dnl CF_LINK_DATAONLY version: 13 updated: 2020/02/08 15:59:30 +dnl CF_LINK_DATAONLY version: 15 updated: 2023/12/03 10:03:10 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 @@ -2523,17 +2578,21 @@ EOF rm -f conftest.$ac_ext data.o cat >conftest.$ac_ext <&AC_FD_CC ])dnl dnl --------------------------------------------------------------------------- -dnl CF_NCURSES_ADDON version: 6 updated: 2021/01/04 19:33:05 +dnl CF_NCURSES_ADDON version: 7 updated: 2024/06/01 17:37:13 dnl ---------------- dnl Configure an ncurses add-on, built outside the ncurses tree. AC_DEFUN([CF_NCURSES_ADDON],[ @@ -2826,18 +2885,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` @@ -2906,9 +2976,17 @@ 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_TRY_COMPILE([#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: 5 updated: 2020/12/31 20:19:42 +dnl CF_NCURSES_CC_CHECK version: 6 updated: 2023/02/18 17:47:58 dnl ------------------- dnl Check if we can compile with ncurses' header file dnl $1 is the cache variable to set @@ -2925,7 +3003,7 @@ AC_DEFUN([CF_NCURSES_CC_CHECK],[ #ifdef NCURSES_VERSION ]ifelse($3,ncursesw,[ #ifndef WACS_BSSB - make an error + #error WACS_BSSB is not defined #endif ])[ printf("%s\\n", NCURSES_VERSION); @@ -2933,7 +3011,7 @@ printf("%s\\n", NCURSES_VERSION); #ifdef __NCURSES_H printf("old\\n"); #else - make an error + #error __NCURSES_H is not defined #endif #endif ] @@ -3256,7 +3334,7 @@ CF_UPPER(cf_nculib_ROOT,HAVE_LIB$cf_nculib_root) AC_DEFINE_UNQUOTED($cf_nculib_ROOT) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_NCURSES_VERSION version: 17 updated: 2023/01/05 18:54:02 +dnl CF_NCURSES_VERSION version: 18 updated: 2024/01/07 06:34:16 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 @@ -3286,7 +3364,7 @@ int main(void) # ifdef __NCURSES_H fprintf(fp, "old\\n"); # else - make an error + #error expected ncurses header to define __NCURSES_H # endif #endif ${cf_cv_main_return:-return}(0); @@ -3393,7 +3471,7 @@ case ".[$]$1" in esac ])dnl dnl --------------------------------------------------------------------------- -dnl CF_PKG_CONFIG version: 12 updated: 2021/10/10 20:18:09 +dnl CF_PKG_CONFIG version: 13 updated: 2023/10/28 11:59:01 dnl ------------- dnl Check for the package-config program, unless disabled by command-line. dnl @@ -3402,7 +3480,7 @@ AC_DEFUN([CF_PKG_CONFIG], [ AC_MSG_CHECKING(if you want to use pkg-config) AC_ARG_WITH(pkg-config, - [ --with-pkg-config{=path} enable/disable use of pkg-config], + [[ --with-pkg-config[=CMD] enable/disable use of pkg-config and its name CMD]], [cf_pkg_config=$withval], [cf_pkg_config=yes]) AC_MSG_RESULT($cf_pkg_config) @@ -3431,7 +3509,7 @@ fi AC_SUBST(PKG_CONFIG) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_POSIX_C_SOURCE version: 11 updated: 2018/12/31 20:46:17 +dnl CF_POSIX_C_SOURCE version: 12 updated: 2023/02/18 17:41:25 dnl ----------------- dnl Define _POSIX_C_SOURCE to the given level, and _POSIX_SOURCE if needed. dnl @@ -3462,7 +3540,7 @@ 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 ],[ #ifndef _POSIX_C_SOURCE -make an error +#error _POSIX_C_SOURCE is not defined #endif], [cf_cv_posix_c_source=no], [cf_want_posix_source=no @@ -3481,7 +3559,7 @@ make an error if test "$cf_want_posix_source" = yes ; then AC_TRY_COMPILE([#include ],[ #ifdef _POSIX_SOURCE -make an error +#error _POSIX_SOURCE is defined #endif],[], cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE") fi @@ -3492,7 +3570,7 @@ make an error CF_MSG_LOG(if the second compile does not leave our definition intact error) AC_TRY_COMPILE([#include ],[ #ifndef _POSIX_C_SOURCE -make an error +#error _POSIX_C_SOURCE is not defined #endif],, [cf_cv_posix_c_source=no]) CFLAGS="$cf_save_CFLAGS" @@ -3880,7 +3958,7 @@ do done ])dnl dnl --------------------------------------------------------------------------- -dnl CF_SHARED_OPTS version: 107 updated: 2021/09/04 06:47:34 +dnl CF_SHARED_OPTS version: 111 updated: 2024/03/29 20:08:49 dnl -------------- dnl -------------- dnl Attempt to determine the appropriate CC/LD options for creating a shared @@ -3926,9 +4004,9 @@ AC_DEFUN([CF_SHARED_OPTS], cf_ld_rpath_opt= test "$cf_cv_enable_rpath" = yes && cf_ld_rpath_opt="$LD_RPATH_OPT" - AC_MSG_CHECKING(if release/abi version should be used for shared libs) + AC_MSG_CHECKING(whether to use release or ABI version in shared library file names) AC_ARG_WITH(shlib-version, - [ --with-shlib-version=X Specify rel or abi version for shared libs], + [[ --with-shlib-version[={rel|abi}] use release or ABI version in shared library file names]], [test -z "$withval" && withval=auto case "$withval" in (yes) @@ -3970,7 +4048,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 ],[int x = 1],[break],[]) + AC_TRY_COMPILE([#include ],[int x = 1; (void)x],[break],[]) done AC_MSG_RESULT($CC_SHARED_OPTS) CFLAGS="$cf_save_CFLAGS" @@ -4340,11 +4418,11 @@ CF_EOF # tested with SunOS 5.5.1 (solaris 2.5.1) and gcc 2.7.2 # tested with SunOS 5.10 (solaris 10) and gcc 3.4.3 if test "$DFT_LWR_MODEL" = "shared" ; then - LOCAL_LDFLAGS="-R \$(LOCAL_LIBDIR):\${libdir}" + LOCAL_LDFLAGS="-R\$(LOCAL_LIBDIR):\${libdir}" LOCAL_LDFLAGS2="$LOCAL_LDFLAGS" fi if test "$cf_cv_enable_rpath" = yes ; then - EXTRA_LDFLAGS="-R \${libdir} $EXTRA_LDFLAGS" + EXTRA_LDFLAGS="-R\${libdir} $EXTRA_LDFLAGS" fi CF_SHARED_SONAME if test "$GCC" != yes; then @@ -4356,9 +4434,9 @@ CF_EOF done CFLAGS="$cf_save_CFLAGS" CC_SHARED_OPTS=$cf_shared_opts - MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -dy -G -h '$cf_cv_shared_soname' -o $[@]' + MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -dy -G -Wl,-h,'$cf_cv_shared_soname' -o $[@]' else - MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -dy -G -h '$cf_cv_shared_soname' -o $[@]' + MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -dy -G -Wl,-h,'$cf_cv_shared_soname' -o $[@]' fi ;; (sysv5uw7*|unix_sv*) @@ -4579,7 +4657,7 @@ AC_DEFUN([CF_UPPER], $1=`echo "$2" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%` ])dnl dnl --------------------------------------------------------------------------- -dnl CF_UTF8_LIB version: 9 updated: 2021/05/19 19:35:25 +dnl CF_UTF8_LIB version: 10 updated: 2023/01/11 04:05:23 dnl ----------- dnl Check for multibyte support, and if not found, utf8 compatibility library AC_DEFUN([CF_UTF8_LIB], @@ -4588,8 +4666,7 @@ AC_HAVE_HEADERS(wchar.h) AC_CACHE_CHECK(for multibyte character support,cf_cv_utf8_lib,[ cf_save_LIBS="$LIBS" AC_TRY_LINK([ -#include -#include +$ac_includes_default #ifdef HAVE_WCHAR_H #include #endif @@ -4645,26 +4722,76 @@ weak_symbol(fopen); ]) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_WITH_ADA_COMPILER version: 2 updated: 2010/06/26 17:35:58 +dnl CF_WITH_ADA version: 1 updated: 2024/05/18 13:55:23 +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. AC_DEFUN([CF_WITH_ADA_COMPILER],[ -AC_MSG_CHECKING(for ada-compiler) +AC_MSG_CHECKING(for Ada95 compiler) AC_ARG_WITH(ada-compiler, - [ --with-ada-compiler=CMD specify Ada95 compiler command (default gnatmake)], + [[ --with-ada-compiler[=CMD] use CMD as Ada95 compiler (default: gnatmake)]], [cf_ada_compiler=$withval], [cf_ada_compiler=gnatmake]) AC_SUBST(cf_ada_compiler) AC_MSG_RESULT($cf_ada_compiler) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_WITH_ADA_INCLUDE version: 2 updated: 2010/06/26 17:35:58 +dnl CF_WITH_ADA_INCLUDE version: 3 updated: 2023/10/28 11:59:01 dnl ------------------- dnl Command-line option to specify where Ada includes will install. AC_DEFUN([CF_WITH_ADA_INCLUDE],[ -AC_MSG_CHECKING(for ada-include) +AC_MSG_CHECKING(for Ada95 include directory) CF_WITH_PATH(ada-include, - [ --with-ada-include=DIR Ada includes are in DIR], + [ --with-ada-include=DIR find Ada95 includes in DIR], ADA_INCLUDE, PREFIX/share/ada/adainclude, [$]prefix/share/ada/adainclude) @@ -4672,16 +4799,16 @@ AC_SUBST(ADA_INCLUDE) AC_MSG_RESULT($ADA_INCLUDE) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_WITH_ADA_LIBNAME version: 1 updated: 2019/09/07 18:59:41 +dnl CF_WITH_ADA_LIBNAME version: 3 updated: 2023/11/22 20:48:30 dnl ------------------- dnl CF_WITH_ADA_LIBNAME dnl ------------------- dnl Command-line option to specify how to name the resulting Ada library. dnl $1 = default value AC_DEFUN([CF_WITH_ADA_LIBNAME],[ -AC_MSG_CHECKING(for ada-libname) +AC_MSG_CHECKING(for Ada95 curses library name) AC_ARG_WITH(ada-libname, - [ --with-ada-libname=XXX override default Ada library-name], + [[ --with-ada-libname[=XXX] use XXX as Ada95 library name]], ADA_LIBNAME=[$]withval, ADA_LIBNAME=$1) case "x$ADA_LIBNAME" in @@ -4693,13 +4820,13 @@ AC_SUBST(ADA_LIBNAME) AC_MSG_RESULT($ADA_LIBNAME) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_WITH_ADA_OBJECTS version: 2 updated: 2010/06/26 17:35:58 +dnl CF_WITH_ADA_OBJECTS version: 3 updated: 2023/10/28 11:59:01 dnl ------------------- dnl Command-line option to specify where Ada objects will install. AC_DEFUN([CF_WITH_ADA_OBJECTS],[ -AC_MSG_CHECKING(for ada-objects) +AC_MSG_CHECKING(for Ada95 object directory) CF_WITH_PATH(ada-objects, - [ --with-ada-objects=DIR Ada objects are in DIR], + [ --with-ada-objects=DIR find Ada95 objects in DIR], ADA_OBJECTS, PREFIX/lib/ada/adalib, [$]prefix/lib/ada/adalib) @@ -4707,28 +4834,34 @@ AC_SUBST(ADA_OBJECTS) AC_MSG_RESULT($ADA_OBJECTS) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_WITH_ADA_SHAREDLIB version: 5 updated: 2018/07/21 19:10:35 +dnl CF_WITH_ADA_SHAREDLIB version: 6 updated: 2023/10/28 11:59:01 dnl --------------------- -dnl Command-line option to specify if an Ada95 shared-library should be built, +dnl Command-line option to specify if an Ada95 shared library should be built, dnl and optionally what its soname should be. AC_DEFUN([CF_WITH_ADA_SHAREDLIB],[ AC_REQUIRE([CF_GNAT_PROJECTS]) -AC_MSG_CHECKING(if an Ada95 shared-library should be built) +AC_MSG_CHECKING(whether to build an Ada95 shared library) AC_ARG_WITH(ada-sharedlib, - [ --with-ada-sharedlib=soname build shared-library (requires GNAT projects)], + [ --with-ada-sharedlib build Ada95 shared library; requires GNAT project support], [with_ada_sharedlib=$withval], [with_ada_sharedlib=no]) -AC_MSG_RESULT($with_ada_sharedlib) +cf_ada_sharedlib_warn=no if test "x$with_ada_sharedlib" != xno then if test "x$cf_gnat_projects" != xyes then - AC_MSG_WARN(disabling shared-library since GNAT projects are not supported) with_ada_sharedlib=no + cf_ada_sharedlib_warn=yes fi fi +AC_MSG_RESULT($with_ada_sharedlib) +if test "x$cf_ada_sharedlib_warn" != xno +then + AC_MSG_WARN(disabling Ada95 shared library since GNAT projects are not supported) +fi + ADA_SHAREDLIB='lib$(LIB_NAME).so.1' MAKE_ADA_SHAREDLIB="#" @@ -4816,7 +4949,7 @@ eval $3="$withval" AC_SUBST($3)dnl ])dnl dnl --------------------------------------------------------------------------- -dnl CF_WITH_PKG_CONFIG_LIBDIR version: 20 updated: 2022/01/29 17:03:42 +dnl CF_WITH_PKG_CONFIG_LIBDIR version: 23 updated: 2023/11/22 20:48:30 dnl ------------------------- dnl Allow the choice of the pkg-config library directory to be overridden. dnl @@ -4827,7 +4960,8 @@ dnl b) $PKG_CONFIG_LIBDIR (tested second, added if set) dnl c) builtin-list (added if $PKG_CONFIG_LIBDIR is not set) dnl dnl pkgconf (used with some systems such as FreeBSD in place of pkg-config) -dnl optionally ignores $PKG_CONFIG_LIBDIR. +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],[ case "$PKG_CONFIG" in @@ -4840,11 +4974,17 @@ case "$PKG_CONFIG" in esac # if $PKG_CONFIG_LIBDIR is set, try to use that -cf_search_path=`echo "$PKG_CONFIG_LIBDIR" | sed -e 's/:/ /g' -e 's,^[[ ]]*,,'` +if test -n "$PKG_CONFIG_PATH"; then + cf_search_path=`echo "$PKG_CONFIG_PATH" | sed -e 's/:/ /g' -e 's,^[[ ]]*,,' -e 's,[[ ]]*$,,'` +elif test -n "$PKG_CONFIG_LIBDIR"; then + cf_search_path=`echo "$PKG_CONFIG_LIBDIR" | sed -e 's/:/ /g' -e 's,^[[ ]]*,,' -e 's,[[ ]]*$,,'` +else + cf_search_path=auto +fi # if the option is used, let that override. otherwise default to "libdir" AC_ARG_WITH(pkg-config-libdir, - [ --with-pkg-config-libdir=XXX use given directory for installing pc-files], + [[ --with-pkg-config-libdir[=XXX] use given directory for installing pc-files]], [cf_search_path=$withval], [test "x$PKG_CONFIG" != xnone && test -z "$cf_search_path" && cf_search_path=libdir]) @@ -5013,7 +5153,7 @@ AC_ARG_WITH(system-type, ]) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_XOPEN_SOURCE version: 63 updated: 2022/12/29 10:10:26 +dnl CF_XOPEN_SOURCE version: 67 updated: 2023/09/06 18:55:27 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, @@ -5022,6 +5162,18 @@ dnl dnl Parameters: dnl $1 is the nominal value for _XOPEN_SOURCE dnl $2 is the nominal value for _POSIX_C_SOURCE +dnl +dnl The default case prefers _XOPEN_SOURCE over _POSIX_C_SOURCE if the +dnl implementation predefines it, because X/Open and most implementations agree +dnl that the latter is a legacy or "aligned" value. +dnl +dnl Because _XOPEN_SOURCE is preferred, if defining _POSIX_C_SOURCE turns +dnl that off, then refrain from setting _POSIX_C_SOURCE explicitly. +dnl +dnl References: +dnl https://pubs.opengroup.org/onlinepubs/007904975/functions/xsh_chap02_02.html +dnl https://docs.oracle.com/cd/E19253-01/816-5175/standards-5/index.html +dnl https://www.gnu.org/software/libc/manual/html_node/Feature-Test-Macros.html AC_DEFUN([CF_XOPEN_SOURCE],[ AC_REQUIRE([AC_CANONICAL_HOST]) AC_REQUIRE([CF_POSIX_VISIBLE]) @@ -5036,9 +5188,6 @@ case "$host_os" in (aix[[4-7]]*) cf_xopen_source="-D_ALL_SOURCE" ;; -(msys) - cf_XOPEN_SOURCE=600 - ;; (darwin[[0-8]].*) cf_xopen_source="-D_APPLE_C_SOURCE" ;; @@ -5064,7 +5213,7 @@ 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) +(linux*gnu|linux*gnuabi64|linux*gnuabin32|linux*gnueabi|linux*gnueabihf|linux*gnux32|uclinux*|gnu*|mint*|k*bsd*-gnu|cygwin|msys|mingw*|linux*uclibc) CF_GNU_SOURCE($cf_XOPEN_SOURCE) ;; (minix*) @@ -5116,8 +5265,8 @@ case "$host_os" in cf_save_xopen_cppflags="$CPPFLAGS" CF_POSIX_C_SOURCE($cf_POSIX_C_SOURCE) # 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 inteferes) + 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_MSG_WARN(_POSIX_C_SOURCE definition is not usable) CPPFLAGS="$cf_save_xopen_cppflags"]) @@ -5136,7 +5285,7 @@ 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 ],[ #ifndef _XOPEN_SOURCE -make an error +#error _XOPEN_SOURCE is not defined #endif], [cf_XOPEN_SOURCE_set=yes], [cf_XOPEN_SOURCE_set=no]) @@ -5145,7 +5294,7 @@ make an error then AC_TRY_COMPILE([#include ],[ #if (_XOPEN_SOURCE - 0) < $cf_XOPEN_SOURCE -make an error +#error (_XOPEN_SOURCE - 0) < $cf_XOPEN_SOURCE #endif], [cf_XOPEN_SOURCE_set_ok=yes], [cf_XOPEN_SOURCE_set_ok=no]) @@ -5166,22 +5315,20 @@ dnl Trim something using sed, then trim extra whitespace dnl $1 = extra parameters, e.g., in CF_STRIP_G_OPT define([CF__SED_TRIMBLANKS],[sed ifelse($1,,,[$1] )-e 's%[[ ]]% %g' -e 's% [[ ]]*% %g' -e 's%^ %%' -e 's% [$]%%'])dnl dnl --------------------------------------------------------------------------- -dnl CF__XOPEN_SOURCE_BODY version: 1 updated: 2022/09/10 15:17:35 +dnl CF__XOPEN_SOURCE_BODY version: 2 updated: 2023/02/18 17:41:25 dnl --------------------- dnl body of test when test-compiling for _XOPEN_SOURCE check define([CF__XOPEN_SOURCE_BODY], [ #ifndef _XOPEN_SOURCE -make an error +#error _XOPEN_SOURCE is not defined #endif ]) dnl --------------------------------------------------------------------------- -dnl CF__XOPEN_SOURCE_HEAD version: 1 updated: 2022/09/10 15:17:03 +dnl CF__XOPEN_SOURCE_HEAD version: 2 updated: 2023/02/18 17:41:25 dnl --------------------- dnl headers to include when test-compiling for _XOPEN_SOURCE check define([CF__XOPEN_SOURCE_HEAD], [ -#include -#include -#include +$ac_includes_default ])