X-Git-Url: https://ncurses.scripts.mit.edu/?p=ncurses.git;a=blobdiff_plain;f=aclocal.m4;h=5878b039313530f9f2c74e559f104844e3ceac0e;hp=eaaf235cab576a30e8322c51a020acefe3ca0c7f;hb=a5fe3726f7d4374e9b1551b535c8617b423996f2;hpb=152c5a605234b7ea36ba3a03ec07e124bb6aac75 diff --git a/aclocal.m4 b/aclocal.m4 index eaaf235c..5878b039 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.947 2021/01/09 10:23:08 tom Exp $ +dnl $Id: aclocal.m4,v 1.957 2021/04/03 20:43:02 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: 93 updated: 2021/01/04 18:48:01 +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 @@ -4606,7 +4670,7 @@ CF_EOF done fi - echo ' cd '$cf_dir' && ${MAKE} ${TOP_MFLAGS} [$]@' >>Makefile + echo ' ( cd '$cf_dir' && ${MAKE} ${TOP_MFLAGS} [$]@ )' >>Makefile done for cf_dir in $SRC_SUBDIRS @@ -4621,7 +4685,7 @@ do echo 'libs \' >> Makefile echo 'install.libs \' >> Makefile echo 'uninstall.libs ::' >> Makefile - echo ' cd '$cf_dir' && ${MAKE} ${TOP_MFLAGS} [$]@' >> Makefile + echo ' ( cd '$cf_dir' && ${MAKE} ${TOP_MFLAGS} [$]@ )' >> Makefile ;; esac fi @@ -4634,9 +4698,9 @@ install.includes \\ uninstall.includes \\ CF_EOF fi -if test "$cf_dir" != "c++" ; then + echo 'lint \' >> Makefile -fi + cat >> Makefile <> Makefile <> Makefile <> Makefile <> Makefile <> Makefile < 2) + fail = 3; + } #ifdef HAVE_UNLINK unlink(dst); #else @@ -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])