X-Git-Url: http://ncurses.scripts.mit.edu/?p=ncurses.git;a=blobdiff_plain;f=aclocal.m4;h=b2bfcd5fe9746c895ec37f95d4b7e37de33487bd;hp=87d508e34353bcd585c041e33d8bd7a36c1ab10c;hb=7f4b9f390624835ceb0849965a7f6ff2dcb39d00;hpb=4546e76f7d630a849ac9e17deda7bee36919f800;ds=sidebyside diff --git a/aclocal.m4 b/aclocal.m4 index 87d508e3..b2bfcd5f 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -29,7 +29,7 @@ dnl*************************************************************************** dnl dnl Author: Thomas E. Dickey 1995-on dnl -dnl $Id: aclocal.m4,v 1.949 2021/01/23 20:39:11 tom Exp $ +dnl $Id: aclocal.m4,v 1.958 2021/04/18 18:12:13 tom Exp $ dnl Macros used in NCURSES auto-configuration script. dnl dnl These macros are maintained separately from NCURSES. The copyright on @@ -794,6 +794,45 @@ AC_SUBST(BUILD_EXEEXT) AC_SUBST(BUILD_OBJEXT) ])dnl dnl --------------------------------------------------------------------------- +dnl CF_C11_NORETURN version: 3 updated: 2021/03/28 11:36:23 +dnl --------------- +AC_DEFUN([CF_C11_NORETURN], +[ +AC_MSG_CHECKING(if you want to use C11 _Noreturn feature) +CF_ARG_ENABLE(stdnoreturn, + [ --enable-stdnoreturn enable C11 _Noreturn feature for diagnostics], + [enable_stdnoreturn=yes], + [enable_stdnoreturn=no]) +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 +#include +static _Noreturn void giveup(void) { exit(0); } + ], + [if (feof(stdin)) giveup()], + cf_cv_c11_noreturn=yes, + cf_cv_c11_noreturn=no) + ]) +else + cf_cv_c11_noreturn=no, +fi + +if test "$cf_cv_c11_noreturn" = yes; then + AC_DEFINE(HAVE_STDNORETURN_H, 1,[Define if header is available and working]) + AC_DEFINE_UNQUOTED(STDC_NORETURN,_Noreturn,[Define if C11 _Noreturn keyword is supported]) + HAVE_STDNORETURN_H=1 +else + HAVE_STDNORETURN_H=0 +fi + +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 --------------- dnl Check for user's environment-breakage by stuffing CFLAGS/CPPFLAGS content @@ -1860,7 +1899,7 @@ CF_ARG_DISABLE(gnat-projects, AC_MSG_RESULT($enable_gnat_projects) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_DISABLE_LEAKS version: 8 updated: 2021/01/05 20:05:09 +dnl CF_DISABLE_LEAKS version: 9 updated: 2021/04/03 16:41:50 dnl ---------------- dnl Combine no-leak checks with the libraries or tools that are used for the dnl checks. @@ -1873,9 +1912,9 @@ AC_REQUIRE([CF_WITH_VALGRIND]) AC_MSG_CHECKING(if you want to perform memory-leak testing) AC_ARG_ENABLE(leaks, [ --disable-leaks test: free permanent memory, analyze leaks], - [enable_leaks=no], + [enable_leaks=$enableval], [enable_leaks=yes]) -dnl TODO - drop with_no_leaks +dnl with_no_leaks is more readable... if test "x$enable_leaks" = xno; then with_no_leaks=yes; else with_no_leaks=no; fi AC_MSG_RESULT($with_no_leaks) @@ -2669,13 +2708,14 @@ esac ])dnl dnl --------------------------------------------------------------------------- -dnl CF_GCC_ATTRIBUTES version: 23 updated: 2021/01/03 18:30:50 +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 dnl compiler warnings. Though useful, not all are supported -- and contrary dnl to documentation, unrecognized directives cause older compilers to barf. AC_DEFUN([CF_GCC_ATTRIBUTES], [AC_REQUIRE([AC_PROG_FGREP])dnl +AC_REQUIRE([CF_C11_NORETURN])dnl if test "$GCC" = yes || test "$GXX" = yes then @@ -2712,8 +2752,8 @@ cat > "conftest.$ac_ext" </dev/null | grep SEARCH_DIR | sed -e 's,SEARCH_DIR[[ # The -NX options tell newer versions of Linux ldconfig to not attempt to # update the cache, which makes it run faster. test -z "$cf_pathlist" && \ - cf_pathlist=`ldconfig -NX -v 2>/dev/null | sed -e '/^[[ ]]/d' -e 's/:$//' | sort -u` + cf_pathlist=`(ldconfig -NX -v) 2>/dev/null | sed -e '/^[[ ]]/d' -e 's/:$//' | sort -u` test -z "$cf_pathlist" && - cf_pathlist=`ldconfig -v 2>/dev/null | sed -n -e '/^[[ ]]/d' -e 's/:$//p' | sort -u` + cf_pathlist=`(ldconfig -v) 2>/dev/null | sed -n -e '/^[[ ]]/d' -e 's/:$//p' | sort -u` # This works with OpenBSD 6.5, which lists only filenames test -z "$cf_pathlist" && - cf_pathlist=`ldconfig -v 2>/dev/null | sed -n -e 's,^Adding \(.*\)/.*[$],\1,p' | sort -u` + cf_pathlist=`(ldconfig -v) 2>/dev/null | sed -n -e 's,^Adding \(.*\)/.*[$],\1,p' | sort -u` if test -z "$cf_pathlist" then @@ -4128,13 +4168,37 @@ fi if test -z "$cf_pathlist" then - # Solaris is hardcoded - if test -d /opt/SUNWspro/lib + # Solaris is "SunOS" + if test -f /usr/bin/isainfo && test "x`uname -s`" = xSunOS then - cf_pathlist="/opt/SUNWspro/lib /usr/ccs/lib /usr/lib" - elif test -d /usr/ccs/lib + case x`(isainfo -b)` in + (x64) + cf_pathlist="$cf_pathlist /lib/64 /usr/lib/64" + ;; + (x32) + test -d /usr/ccs/lib && cf_pathlist="$cf_pathlist /usr/ccs/lib" + cf_pathlist="$cf_pathlist /lib /usr/lib" + ;; + (*) + AC_MSG_WARN(problem with Solaris architecture) + ;; + esac + fi +fi + +if test -z "$cf_pathlist" +then + # HP-UX + if test x"`uname -s`" = xHP-UX then - cf_pathlist="/usr/ccs/lib /usr/lib" + case x`getconf LONG_BIT` in + (x64) + cf_pathlist="/usr/lib/hpux64" + ;; + (x*) + cf_pathlist="/usr/lib/hpux32" + ;; + esac fi fi @@ -4225,7 +4289,7 @@ ifelse($1,,,[$1=$LIB_PREFIX]) AC_SUBST(LIB_PREFIX) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_LIB_RULES version: 94 updated: 2021/01/23 15:37:41 +dnl CF_LIB_RULES version: 95 updated: 2021/03/20 12:00:25 dnl ------------ dnl Append definitions and rules for the given models to the subdirectory dnl Makefiles, and the recursion rule for the top-level Makefile. If the @@ -4634,9 +4698,9 @@ install.includes \\ uninstall.includes \\ CF_EOF fi -if test "$cf_dir" != "c++" ; then + echo 'lint \' >> Makefile -fi + cat >> Makefile < #include #include #ifdef HAVE_UNISTD_H @@ -5061,19 +5129,26 @@ else int main(void) { int fail = 0; - char *src = "config.log"; + char *src = "conftest.tmp"; char *dst = "conftest.chk"; - struct stat src_sb; - struct stat dst_sb; - - stat(src, &src_sb); - fail = ($cf_func("config.log", "conftest.chk") < 0) - || (stat(dst, &dst_sb) < 0) - || (dst_sb.st_mtime != src_sb.st_mtime); + struct stat src_sb, dst_sb; + FILE *fp = fopen(src, "w"); + if (fp == 0) { fail = 3; } else { + fclose(fp); stat(src, &src_sb); + if ($cf_func(src, dst) < 0) { + fail = 1; + } else if (stat(dst, &dst_sb) < 0) { + fail = 2; + } else { + long diff = (dst_sb.st_mtime - src_sb.st_mtime); + if (diff < 0) diff = -diff; + if (diff > 2) fail = 3; + } + } #ifdef HAVE_UNLINK - unlink(dst); + unlink(dst); unlink(src); #else - remove(dst); + remove(dst); remove(src); #endif ${cf_cv_main_return:-return} (fail); } @@ -8879,7 +8954,7 @@ AC_ARG_WITH($2-path, ]) ]) dnl --------------------------------------------------------------------------- -dnl CF_WITH_PCRE2 version: 4 updated: 2021/01/01 16:53:59 +dnl CF_WITH_PCRE2 version: 5 updated: 2021/01/26 18:45:12 dnl ------------- dnl Add PCRE2 (Perl-compatible regular expressions v2) to the build if it is dnl available and the user requests it. Assume the application will otherwise @@ -8897,9 +8972,12 @@ test -z "$with_pcre2" && with_pcre2=no AC_MSG_RESULT($with_pcre2) if test "x$with_pcre2" != xno ; then - CF_TRY_PKG_CONFIG(libpcre2,,[ - CF_TRY_PKG_CONFIG(libpcre,,[ - AC_MSG_ERROR(Cannot find PCRE2 library)])]) + cf_with_pcre2_ok=no + for cf_with_pcre2 in libpcre2 libpcre2-posix libpcre + do + CF_TRY_PKG_CONFIG($cf_with_pcre2,[cf_with_pcre2_ok=yes; break]) + done + cf_with_pcre2_ok=yes || AC_MSG_ERROR(Cannot find PCRE2 library) AC_DEFINE(HAVE_LIB_PCRE2,1,[Define to 1 if we can/should compile with the PCRE2 library])