X-Git-Url: https://ncurses.scripts.mit.edu/?a=blobdiff_plain;f=aclocal.m4;h=a967246d323cc028f4bae70c1a81ec1538093b67;hb=141bf9b4f451aaab76480a358dec96cf60a66ec6;hp=b1e5ab64bf01d3c352767274538030f056d027e7;hpb=22b110664918b4fba48ae4237bafb81621bc5f5b;p=ncurses.git diff --git a/aclocal.m4 b/aclocal.m4 index b1e5ab64..a967246d 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -1,5 +1,5 @@ dnl*************************************************************************** -dnl Copyright 2018-2021,2022 Thomas E. Dickey * +dnl Copyright 2018-2022,2023 Thomas E. Dickey * dnl Copyright 1998-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 1995-on dnl -dnl $Id: aclocal.m4,v 1.1001 2022/01/23 00:15:35 tom Exp $ +dnl $Id: aclocal.m4,v 1.1026 2023/01/14 14:00:15 tom Exp $ dnl Macros used in NCURSES auto-configuration script. dnl dnl These macros are maintained separately from NCURSES. The copyright on @@ -42,7 +42,7 @@ dnl https://invisible-island.net/autoconf/my-autoconf.html dnl dnl --------------------------------------------------------------------------- dnl --------------------------------------------------------------------------- -dnl AM_LANGINFO_CODESET version: 6 updated: 2021/01/01 16:53:59 +dnl AM_LANGINFO_CODESET version: 7 updated: 2023/01/11 04:05:23 dnl ------------------- dnl Inserted as requested by gettext 0.10.40 dnl File from /usr/share/aclocal @@ -54,7 +54,9 @@ dnl From Bruno Haible. AC_DEFUN([AM_LANGINFO_CODESET], [ AC_CACHE_CHECK([for nl_langinfo and CODESET], am_cv_langinfo_codeset, - [AC_TRY_LINK([#include ], + [AC_TRY_LINK([ +$ac_includes_default +#include ], [char* cs = nl_langinfo(CODESET); (void)cs], am_cv_langinfo_codeset=yes, am_cv_langinfo_codeset=no) @@ -65,7 +67,7 @@ AC_CACHE_CHECK([for nl_langinfo and CODESET], am_cv_langinfo_codeset, fi ])dnl dnl --------------------------------------------------------------------------- -dnl CF_ABI_DEFAULTS version: 3 updated: 2022/01/22 19:13:38 +dnl CF_ABI_DEFAULTS version: 4 updated: 2023/01/07 16:32:06 dnl --------------- dnl Provide configure-script defaults for different ncurses ABIs. AC_DEFUN([CF_ABI_DEFAULTS],[ @@ -89,7 +91,7 @@ cf_dft_tparm_arg=long cf_dft_with_lp64=no # ABI 6 defaults: -case x$cf_cv_abi_version in +case x$cf_cv_abi_default in (x[[6789]]) cf_dft_chtype=uint32_t cf_dft_ext_colors=yes @@ -106,7 +108,7 @@ case x$cf_cv_abi_version in esac # ABI 7 defaults: -case x$cf_cv_abi_version in +case x$cf_cv_abi_default in (x[[789]]) cf_dft_ccharw_max=6 cf_dft_mmask_t=uint64_t @@ -641,7 +643,7 @@ else AC_MSG_RESULT(no) fi ])dnl dnl --------------------------------------------------------------------------- -dnl CF_BOOL_SIZE version: 18 updated: 2021/09/04 06:35:04 +dnl CF_BOOL_SIZE version: 19 updated: 2023/01/05 18:00:14 dnl ------------ dnl Test for the size of 'bool' in the configured C++ compiler (e.g., a type). dnl Don't bother looking for bool.h, since it has been deprecated. @@ -676,8 +678,7 @@ AC_CHECK_SIZEOF(bool,,[ AC_CACHE_CHECK(for type of bool, cf_cv_type_of_bool,[ rm -f cf_test.out AC_TRY_RUN([ -#include -#include +$ac_includes_default #if defined(__cplusplus) @@ -739,7 +740,7 @@ if test "$cf_cv_type_of_bool" = unknown ; then fi ])dnl dnl --------------------------------------------------------------------------- -dnl CF_BUILD_CC version: 9 updated: 2021/01/02 09:31:20 +dnl CF_BUILD_CC version: 11 updated: 2022/12/04 15:40:08 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 @@ -805,7 +806,32 @@ if test "$cross_compiling" = yes ; then : ${BUILD_CC:='${CC}'} - if { test "$BUILD_CC" = "$CC" || test "$BUILD_CC" = '${CC}'; } ; then + AC_MSG_CHECKING(if the build-compiler "$BUILD_CC" works) + + cf_save_crossed=$cross_compiling + cf_save_ac_link=$ac_link + cross_compiling=no + cf_build_cppflags=$BUILD_CPPFLAGS + test "$cf_build_cppflags" = "#" && cf_build_cppflags= + ac_link='$BUILD_CC -o "conftest$ac_exeext" $BUILD_CFLAGS $cf_build_cppflags $BUILD_LDFLAGS "conftest.$ac_ext" $BUILD_LIBS >&AS_MESSAGE_LOG_FD' + + AC_TRY_RUN([#include + int main(int argc, char *argv[]) + { + ${cf_cv_main_return:-return}(argc < 0 || argv == 0 || argv[0] == 0); + } + ], + cf_ok_build_cc=yes, + cf_ok_build_cc=no, + cf_ok_build_cc=unknown) + + cross_compiling=$cf_save_crossed + ac_link=$cf_save_ac_link + + AC_MSG_RESULT($cf_ok_build_cc) + + if test "$cf_ok_build_cc" != yes + then AC_MSG_ERROR([Cross-build requires two compilers. Use --with-build-cc to specify the native compiler.]) fi @@ -1069,7 +1095,7 @@ if test ".$system_name" != ".$cf_cv_system_name" ; then fi ])dnl dnl --------------------------------------------------------------------------- -dnl CF_CHECK_ENVIRON version: 3 updated: 2010/05/26 16:44:57 +dnl CF_CHECK_ENVIRON version: 4 updated: 2023/01/14 07:48:15 dnl ---------------- dnl Check for data that is usually declared in , e.g., the 'environ' dnl variable. Define a DECL_xxx symbol if we must declare it ourselves. @@ -1084,7 +1110,7 @@ AC_CACHE_CHECK(if external $1 is declared, cf_cv_dcl_$1,[ #include #endif #include ], - ifelse([$2],,int,[$2]) x = (ifelse([$2],,int,[$2])) $1, + ifelse([$2],,void*,[$2]) x = (ifelse([$2],,void*,[$2])) $1; (void)x, [cf_cv_dcl_$1=yes], [cf_cv_dcl_$1=no]) ]) @@ -1177,7 +1203,7 @@ __attribute__ ((visibility("default"))) int somefunc() {return 42;} ]) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_CHECK_GETENV version: 2 updated: 2021/01/02 17:09:14 +dnl CF_CHECK_GETENV version: 3 updated: 2023/01/05 17:47:56 dnl --------------- dnl Check if repeated getenv calls return the same pointer, e.g., it does not dnl discard the previous pointer when returning a new one. @@ -1188,11 +1214,7 @@ AC_CHECK_FUNC( getenv, ,, AC_MSG_ERROR(getenv not found) ) AC_CHECK_FUNCS( putenv setenv strdup ) AC_CACHE_CHECK(if getenv returns consistent values,cf_cv_consistent_getenv,[ AC_TRY_RUN([ -#include -#include -#include -#include -#include +$ac_includes_default #if defined(HAVE_ENVIRON) && defined(DECL_ENVIRON) && !defined(environ) extern char **environ; /* POSIX, but some systems are not... */ @@ -1460,7 +1482,7 @@ then fi ])dnl dnl --------------------------------------------------------------------------- -dnl CF_CHECK_WCWIDTH_GRAPHICS version: 2 updated: 2021/01/02 17:09:14 +dnl CF_CHECK_WCWIDTH_GRAPHICS version: 3 updated: 2023/01/05 18:01:30 dnl ------------------------- dnl Most "modern" terminal emulators are based to some degree on VT100, and dnl should support line-drawing. Even with Unicode. There is a problem. @@ -1558,8 +1580,9 @@ cat >conftest.in < -#include #include #define MY_LEN 80 @@ -1731,6 +1754,42 @@ esac ]) ])dnl dnl --------------------------------------------------------------------------- +dnl CF_CPP_OVERRIDE version: 1 updated: 2022/08/20 16:07:10 +dnl --------------- +dnl Check if the C++ compiler accepts the override keyword. This is a C++-11 +dnl feature. +AC_DEFUN([CF_CPP_OVERRIDE], +[ +if test -n "$CXX"; then +AC_CACHE_CHECK(if $CXX accepts override keyword,cf_cv_cpp_override,[ + AC_LANG_SAVE + AC_LANG_CPLUSPLUS + AC_TRY_RUN([ + +class base +{ +public: + virtual int foo(float x) = 0; +}; + + +class derived: public base +{ +public: + int foo(float x) override { return x != 0.0 ? 1 : 0; } +}; + +int main(void) { } +], + [cf_cv_cpp_override=yes], + [cf_cv_cpp_override=no], + [cf_cv_cpp_override=unknown]) + AC_LANG_RESTORE +]) +fi +test "$cf_cv_cpp_override" = yes && AC_DEFINE(CPP_HAS_OVERRIDE,1,[Define to 1 if C++ has override keyword]) +])dnl +dnl --------------------------------------------------------------------------- dnl CF_CPP_PARAM_INIT version: 7 updated: 2017/01/21 11:06:25 dnl ----------------- dnl Check if the C++ compiler accepts duplicate parameter initialization. This @@ -2481,7 +2540,7 @@ fi AC_SUBST(EXTRA_CFLAGS) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_FOPEN_BIN_R version: 2 updated: 2019/12/31 08:53:54 +dnl CF_FOPEN_BIN_R version: 3 updated: 2023/01/05 18:05:46 dnl -------------- dnl Check if fopen works when the "b" (binary) flag is added to the mode dnl parameter. POSIX ignores the "b", which c89 specified. Some very old @@ -2489,8 +2548,10 @@ dnl systems do not accept it. AC_DEFUN([CF_FOPEN_BIN_R],[ AC_CACHE_CHECK(if fopen accepts explicit binary mode,cf_cv_fopen_bin_r,[ AC_TRY_RUN([ -#include -int main(void) { +$ac_includes_default + +int main(void) +{ FILE *fp = fopen("conftest.tmp", "wb"); int rc = 0; if (fp != 0) { @@ -2568,7 +2629,7 @@ else fi ]) dnl --------------------------------------------------------------------------- -dnl CF_FUNC_GETTTYNAM version: 1 updated: 2021/12/04 18:29:47 +dnl CF_FUNC_GETTTYNAM version: 2 updated: 2023/01/05 18:06:28 dnl ----------------- dnl Check if the 4.3BSD function getttyname exists, as well as if dnl defines the _PATH_TTYS symbol. If the corresponding file exists, but the @@ -2599,8 +2660,10 @@ if test $cf_cv_PATH_TTYS != no then AC_CACHE_CHECK(if _PATH_TTYS file exists,cf_cv_have_PATH_TTYS,[ AC_TRY_RUN([ -#include +$ac_includes_default + #include + int main(void) { FILE *fp = fopen(_PATH_TTYS, "r"); ${cf_cv_main_return:-return} (fp == 0); @@ -2623,7 +2686,7 @@ then fi ])dnl dnl --------------------------------------------------------------------------- -dnl CF_FUNC_MEMMOVE version: 9 updated: 2017/01/21 11:06:25 +dnl CF_FUNC_MEMMOVE version: 10 updated: 2023/01/05 18:51:28 dnl --------------- dnl Check for memmove, or a bcopy that can handle overlapping copy. If neither dnl is found, add our own version of memmove to the list of objects. @@ -2633,6 +2696,8 @@ AC_CHECK_FUNC(memmove,,[ AC_CHECK_FUNC(bcopy,[ AC_CACHE_CHECK(if bcopy does overlapping moves,cf_cv_good_bcopy,[ AC_TRY_RUN([ +$ac_includes_default + int main(void) { static char data[] = "abcdefghijklmnopqrstuwwxyz"; char temp[40]; @@ -2654,14 +2719,15 @@ int main(void) { fi ])])dnl dnl --------------------------------------------------------------------------- -dnl CF_FUNC_NANOSLEEP version: 5 updated: 2017/01/21 11:06:25 +dnl CF_FUNC_NANOSLEEP version: 6 updated: 2023/01/05 18:51:33 dnl ----------------- dnl Check for existence of workable nanosleep() function. Some systems, e.g., dnl AIX 4.x, provide a non-working version. AC_DEFUN([CF_FUNC_NANOSLEEP],[ AC_CACHE_CHECK(if nanosleep really works,cf_cv_func_nanosleep,[ AC_TRY_RUN([ -#include +$ac_includes_default + #include #include @@ -2716,7 +2782,7 @@ AC_CACHE_CHECK(for openpty header,cf_cv_func_openpty,[ ]) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_FUNC_POLL version: 10 updated: 2021/01/04 19:13:57 +dnl CF_FUNC_POLL version: 11 updated: 2023/01/05 18:51:40 dnl ------------ dnl See if the poll function really works. Some platforms have poll(), but dnl it does not work for terminals or files. @@ -2724,15 +2790,16 @@ AC_DEFUN([CF_FUNC_POLL],[ tty >/dev/null 2>&1 || { AC_CHECK_FUNCS(posix_openpt) } AC_CACHE_CHECK(if poll really works,cf_cv_working_poll,[ AC_TRY_RUN([ -#include -#include -#include +$ac_includes_default + #include + #ifdef HAVE_POLL_H #include #else #include #endif + int main(void) { struct pollfd myfds; int ret; @@ -2881,6 +2948,7 @@ then AC_CHECKING([for $CC __attribute__ directives]) cat > "conftest.$ac_ext" < #include "confdefs.h" #include "conftest.h" #include "conftest.i" @@ -4273,7 +4341,7 @@ then fi ])dnl dnl --------------------------------------------------------------------------- -dnl CF_LD_SEARCHPATH version: 3 updated: 2021/03/05 19:13:35 +dnl CF_LD_SEARCHPATH version: 4 updated: 2022/08/27 15:43:08 dnl ---------------- dnl Try to obtain the linker's search-path, for use in scripts. dnl @@ -4284,7 +4352,7 @@ AC_CACHE_CHECK(for linker search path,cf_cv_ld_searchpath,[ if test "$cross_compiling" != yes ; then # GNU binutils' ld does not involve permissions which may stop ldconfig. -cf_pathlist=`ld --verbose 2>/dev/null | grep SEARCH_DIR | sed -e 's,SEARCH_DIR[[("=]][[("=]]*,,g' -e 's/"[[)]];//gp' | sort -u` +cf_pathlist=`${LD:-ld} --verbose 2>/dev/null | grep SEARCH_DIR | sed -e 's,SEARCH_DIR[[("=]][[("=]]*,,g' -e 's/"[[)]];//gp' | sort -u` # The -NX options tell newer versions of Linux ldconfig to not attempt to # update the cache, which makes it run faster. @@ -4432,7 +4500,7 @@ ifelse($1,,,[$1=$LIB_PREFIX]) AC_SUBST(LIB_PREFIX) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_LIB_RULES version: 97 updated: 2021/07/17 13:10:54 +dnl CF_LIB_RULES version: 98 updated: 2023/01/07 16:32:06 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 @@ -4487,11 +4555,11 @@ do SHARED_LIB= Libs_To_Make= cf_awk_program= - if test -n "${cf_cv_abi_version}" && test "x${cf_cv_abi_version}" != "x5" + if test -n "${cf_cv_abi_default}" && test "x${cf_cv_abi_default}" != "x5" then cf_awk_program="$cf_awk_program\ -/deprecated in ABI${cf_cv_abi_version}/ { next; }\ -{ sub(\"NCURSES([[WT]]+)?\", \"&${cf_cv_abi_version}\"); }\ +/deprecated in ABI${cf_cv_abi_default}/ { next; }\ +{ sub(\"NCURSES([[WT]]+)?\", \"&${cf_cv_abi_default}\"); }\ " fi @@ -5288,7 +5356,7 @@ AC_SUBST(BROKEN_LINKER) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_LINK_FUNCS version: 11 updated: 2021/04/18 14:08:47 +dnl CF_LINK_FUNCS version: 12 updated: 2023/01/05 17:51:41 dnl ------------- dnl Most Unix systems have both link and symlink, a few don't have symlink. dnl A few non-Unix systems implement symlink, but not link. @@ -5314,12 +5382,8 @@ else cf_cv_link_funcs= for cf_func in link symlink ; do AC_TRY_RUN([ -#include -#include -#include -#ifdef HAVE_UNISTD_H -#include -#endif +$ac_includes_default + int main(void) { int fail = 0; @@ -5522,13 +5586,16 @@ AC_SUBST(MAKE_UPPER_TAGS) AC_SUBST(MAKE_LOWER_TAGS) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_MANPAGE_FORMAT version: 15 updated: 2021/09/04 06:35:04 +dnl CF_MANPAGE_FORMAT version: 16 updated: 2022/11/05 16:12:11 dnl ----------------- dnl Option to allow user to override automatic configuration of manpage format. dnl There are several special cases: dnl -dnl gzip - man checks for, can display gzip'd files dnl compress - man checks for, can display compressed files +dnl bzip2 - man checks for, can display bzip2'd files +dnl gzip - man checks for, can display gzip'd files +dnl xz - man checks for, can display xz'd files +dnl dnl BSDI - files in the cat-directories are suffixed ".0" dnl formatted - installer should format (put files in cat-directory) dnl catonly - installer should only format, e.g., for a turnkey system. @@ -5542,8 +5609,9 @@ AC_REQUIRE([CF_PATHSEP]) AC_MSG_CHECKING(format of man-pages) AC_ARG_WITH(manpage-format, - [ --with-manpage-format specify manpage-format: gzip/compress/BSDI/normal and - optionally formatted/catonly, e.g., gzip,formatted], + [ --with-manpage-format specify manpage-format: gzip/compress/bzip2/xz, + BSDI/normal and optionally formatted/catonly, + e.g., gzip,formatted], [MANPAGE_FORMAT=$withval], [MANPAGE_FORMAT=unknown]) @@ -5573,10 +5641,12 @@ case "$MANPAGE_FORMAT" in if test "x$cf_test" = "x$cf_name" ; then case "$cf_name" in - (*.gz) MANPAGE_FORMAT="$MANPAGE_FORMAT gzip";; - (*.Z) MANPAGE_FORMAT="$MANPAGE_FORMAT compress";; - (*.0) MANPAGE_FORMAT="$MANPAGE_FORMAT BSDI";; - (*) MANPAGE_FORMAT="$MANPAGE_FORMAT normal";; + (*.bz2) MANPAGE_FORMAT="$MANPAGE_FORMAT bzip2";; + (*.xz) MANPAGE_FORMAT="$MANPAGE_FORMAT xz";; + (*.gz) MANPAGE_FORMAT="$MANPAGE_FORMAT gzip";; + (*.Z) MANPAGE_FORMAT="$MANPAGE_FORMAT compress";; + (*.0) MANPAGE_FORMAT="$MANPAGE_FORMAT BSDI";; + (*) MANPAGE_FORMAT="$MANPAGE_FORMAT normal";; esac case "$cf_name" in @@ -5615,7 +5685,7 @@ case "$MANPAGE_FORMAT" in (*) for cf_option in $MANPAGE_FORMAT; do case "$cf_option" in - (gzip|compress|BSDI|normal|formatted|catonly) + (xz|bzip2|gzip|compress|BSDI|normal|formatted|catonly) ;; (*) cf_unknown="$cf_unknown $cf_option" @@ -5631,7 +5701,7 @@ if test -n "$cf_unknown" ; then fi ])dnl dnl --------------------------------------------------------------------------- -dnl CF_MANPAGE_RENAMES version: 12 updated: 2021/01/01 16:53:59 +dnl CF_MANPAGE_RENAMES version: 17 updated: 2022/10/23 07:46:29 dnl ------------------ dnl The Debian people have their own naming convention for manpages. This dnl option lets us override the name of the file containing renaming, or @@ -5651,27 +5721,19 @@ case ".$MANPAGE_RENAMES" in (.|.yes) # Debian 'man' program? if test -f /etc/debian_version ; then - MANPAGE_RENAMES=`cd "$srcdir" && pwd`/man/man_db.renames + MANPAGE_RENAMES=man/man_db.renames else MANPAGE_RENAMES=no fi ;; esac -if test "$MANPAGE_RENAMES" != no ; then - if test -f "$srcdir/man/$MANPAGE_RENAMES" ; then - MANPAGE_RENAMES=`cd "$srcdir/man" && pwd`/$MANPAGE_RENAMES - elif test ! -f "$MANPAGE_RENAMES" ; then - AC_MSG_ERROR(not a filename: $MANPAGE_RENAMES) - fi - - test ! -d man && mkdir man - - # Construct a sed-script to perform renaming within man-pages - if test -n "$MANPAGE_RENAMES" ; then - test ! -d man && mkdir man - $SHELL "$srcdir/man/make_sed.sh" "$MANPAGE_RENAMES" >./edit_man.sed - fi +if test "$MANPAGE_RENAMES" = man/man_db.renames ; then + MANPAGE_RENAMES=`pwd`/$MANPAGE_RENAMES +elif test "$MANPAGE_RENAMES" = no ; then + : +elif test ! -f "$MANPAGE_RENAMES" ; then + AC_MSG_ERROR(not a filename: $MANPAGE_RENAMES) fi AC_MSG_RESULT($MANPAGE_RENAMES) @@ -5740,7 +5802,7 @@ AC_ARG_WITH(manpage-tbl, AC_MSG_RESULT($MANPAGE_TBL) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_MAN_PAGES version: 51 updated: 2021/01/05 16:29:19 +dnl CF_MAN_PAGES version: 54 updated: 2022/11/05 16:12:11 dnl ------------ dnl Try to determine if the man-pages on the system are compressed, and if dnl so, what format is used. Use this information to construct a script that @@ -5778,16 +5840,27 @@ test ! -d man && mkdir man cf_so_strip= cf_compress= -case "$MANPAGE_FORMAT" in -(*compress*) +for cf_manpage_format in $MANPAGE_FORMAT +do +case "$cf_manpage_format" in +(compress) cf_so_strip="Z" cf_compress=compress ;; -(*gzip*) +(gzip) cf_so_strip="gz" cf_compress=gzip ;; +(bzip2) + cf_so_strip="bz2" + cf_compress=bzip2 + ;; +(xz) + cf_so_strip="xz" + cf_compress=xz + ;; esac +done cf_edit_man=./edit_man.sh cf_man_alias=`pwd`/man_alias.sed @@ -5813,7 +5886,8 @@ INSTALL_DATA="$INSTALL_DATA" transform="$program_transform_name" TMP=\${TMPDIR:=/tmp}/man\$\$ -trap "rm -f \$TMP" 0 1 2 3 15 +trap "rm -f \$TMP; exit 1" 1 2 3 15 +trap "rm -f \$TMP" 0 form=\[$]1 shift || exit 1 @@ -5923,7 +5997,7 @@ cat >>$cf_edit_man <>$cf_edit_man <\$TMP CF_EOF @@ -6093,7 +6167,7 @@ CF_UPPER(cf_map_lib_basename,$2) eval $1="\$${cf_map_lib_basename}_NAME" ])dnl dnl --------------------------------------------------------------------------- -dnl CF_MATH_LIB version: 10 updated: 2020/12/31 18:40:20 +dnl CF_MATH_LIB version: 11 updated: 2022/07/27 19:01:48 dnl ----------- dnl Checks for libraries. At least one UNIX system, Apple Macintosh dnl Rhapsody 5.5, does not have -lm. We cannot use the simpler @@ -6103,18 +6177,42 @@ AC_DEFUN([CF_MATH_LIB], AC_CACHE_CHECK(if -lm needed for math functions, cf_cv_need_libm,[ AC_TRY_LINK([ - #include - #include - #include + #include + #include + #include ], [double x = rand(); printf("result = %g\\n", ]ifelse([$2],,sin(x),$2)[)], [cf_cv_need_libm=no], [cf_cv_need_libm=yes])]) + if test "$cf_cv_need_libm" = yes then -ifelse($1,,[ - CF_ADD_LIB(m) -],[$1=-lm]) + + cf_save_LIBS="$LIBS" + LIBS="$LIBS -lm" + AC_CACHE_CHECK(if -lm is available for math functions, + cf_cv_have_libm,[ + AC_TRY_LINK([ + #include + #include + #include + ], + [double x = rand(); printf("result = %g\\n", ]ifelse([$2],,sin(x),$2)[)], + [cf_cv_have_libm=yes], + [cf_cv_have_libm=no])]) + LIBS="$cf_save_LIBS" + + if test "$cf_cv_have_libm" = yes + then + ifelse($1,,[CF_ADD_LIB(m)],[$1=-lm]) + fi +else + cf_cv_have_libm=yes +fi + +if test "$cf_cv_have_libm" = yes +then + AC_DEFINE(HAVE_MATH_FUNCS,1,[Define to 1 if math functions are available]) fi ]) dnl --------------------------------------------------------------------------- @@ -6148,7 +6246,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: 11 updated: 2021/01/01 13:31:04 +dnl CF_MKSTEMP version: 12 updated: 2023/01/05 17:53:11 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). @@ -6159,14 +6257,8 @@ unistd.h \ AC_CACHE_CHECK(for working mkstemp, cf_cv_func_mkstemp,[ rm -rf ./conftest* AC_TRY_RUN([ -#include -#ifdef HAVE_UNISTD_H -#include -#endif -#include -#include -#include -#include +$ac_includes_default + int main(void) { char *tmpl = "conftestXXXXXX"; @@ -6214,7 +6306,7 @@ AC_DEFUN([CF_MSG_LOG],[ echo "${as_me:-configure}:__oline__: testing $* ..." 1>&AC_FD_CC ])dnl dnl --------------------------------------------------------------------------- -dnl CF_NCURSES_ABI_6 version: 4 updated: 2021/01/01 13:31:04 +dnl CF_NCURSES_ABI_6 version: 5 updated: 2023/01/07 16:32:06 dnl ---------------- dnl Set ncurses' ABI to 6 unless overridden by explicit configure option, and dnl warn about this. @@ -6224,7 +6316,8 @@ if test "${with_abi_version+set}" != set; then (5.*) cf_cv_rel_version=6.0 cf_cv_abi_version=6 - AC_MSG_WARN(overriding ABI version to $cf_cv_abi_version) + cf_cv_abi_default=6 + AC_MSG_WARN(overriding ABI version to $cf_cv_abi_default) ;; esac fi @@ -6328,6 +6421,21 @@ AC_DEFUN([CF_OBJ_SUBDIR], esac ])dnl dnl --------------------------------------------------------------------------- +dnl CF_OUTPUT_MANPAGE_RENAMES version: 2 updated: 2022/10/22 19:12:31 +dnl ------------------------- +dnl This runs in the output step to config.status, after man_db.renames has +dnl been generated. +AC_DEFUN([CF_OUTPUT_MANPAGE_RENAMES], +[ +AC_REQUIRE([CF_MANPAGE_RENAMES]) +if test "$MANPAGE_RENAMES" != no ; then + # Construct a sed-script to perform renaming within man-pages + test -n "$verbose" && echo "creating edit_man.sed" + test ! -d man && mkdir man + FGREP="${FGREP-grep -F}" $SHELL "$srcdir/man/make_sed.sh" "$MANPAGE_RENAMES" >./edit_man.sed +fi +])dnl +dnl --------------------------------------------------------------------------- dnl CF_PATHSEP version: 8 updated: 2021/01/01 13:31:04 dnl ---------- dnl Provide a value for the $PATH and similar separator (or amend the value @@ -6844,7 +6952,7 @@ fi AC_SUBST(LDCONFIG) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_PROG_LINT version: 4 updated: 2019/11/20 18:55:37 +dnl CF_PROG_LINT version: 5 updated: 2022/08/20 15:44:13 dnl ------------ AC_DEFUN([CF_PROG_LINT], [ @@ -6855,6 +6963,7 @@ case "x$LINT" in ;; esac AC_SUBST(LINT_OPTS) +AC_SUBST(LINT_LIBS) ])dnl dnl --------------------------------------------------------------------------- dnl CF_PROG_LN_S version: 2 updated: 2010/08/14 18:25:37 @@ -8223,7 +8332,7 @@ fi AC_SUBST($2) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_SUBST_NCURSES_VERSION version: 10 updated: 2021/01/04 18:48:01 +dnl CF_SUBST_NCURSES_VERSION version: 11 updated: 2023/01/07 16:32:06 dnl ------------------------ dnl Get the version-number for use in shared-library naming, etc. AC_DEFUN([CF_SUBST_NCURSES_VERSION], @@ -8233,10 +8342,11 @@ NCURSES_MAJOR="`${EGREP-egrep} '^NCURSES_MAJOR[[ ]]*=' "$srcdir/dist.mk" | sed NCURSES_MINOR="`${EGREP-egrep} '^NCURSES_MINOR[[ ]]*=' "$srcdir/dist.mk" | sed -e 's/^[[^0-9]]*//'`" NCURSES_PATCH="`${EGREP-egrep} '^NCURSES_PATCH[[ ]]*=' "$srcdir/dist.mk" | sed -e 's/^[[^0-9]]*//'`" cf_cv_abi_version=${NCURSES_MAJOR} +cf_cv_abi_default=${NCURSES_MAJOR} cf_cv_rel_version=${NCURSES_MAJOR}.${NCURSES_MINOR} dnl Show the computed version, for logging cf_cv_timestamp=`date` -AC_MSG_RESULT(Configuring NCURSES $cf_cv_rel_version ABI $cf_cv_abi_version ($cf_cv_timestamp)) +AC_MSG_RESULT(Configuring NCURSES $cf_cv_rel_version ABI $cf_cv_abi_default ($cf_cv_timestamp)) dnl We need these values in the generated headers AC_SUBST(NCURSES_MAJOR) AC_SUBST(NCURSES_MINOR) @@ -8244,6 +8354,7 @@ AC_SUBST(NCURSES_PATCH) dnl We need these values in the generated makefiles AC_SUBST(cf_cv_rel_version) AC_SUBST(cf_cv_abi_version) +AC_SUBST(cf_cv_abi_default) AC_SUBST(cf_cv_builtin_bool) AC_SUBST(cf_cv_header_stdbool_h) AC_SUBST(cf_cv_type_of_bool)dnl @@ -8308,34 +8419,20 @@ else fi ]) dnl --------------------------------------------------------------------------- -dnl CF_TRY_XOPEN_SOURCE version: 3 updated: 2021/08/28 15:20:37 +dnl CF_TRY_XOPEN_SOURCE version: 4 updated: 2022/09/10 15:16:16 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([ -#include -#include -#include -],[ -#ifndef _XOPEN_SOURCE -make an error -#endif], + AC_TRY_COMPILE(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([ -#include -#include -#include -],[ -#ifdef _XOPEN_SOURCE -make an error -#endif], - [cf_cv_xopen_source=no], - [cf_cv_xopen_source=$cf_XOPEN_SOURCE]) - CPPFLAGS="$cf_save" + AC_TRY_COMPILE(CF__XOPEN_SOURCE_HEAD,CF__XOPEN_SOURCE_BODY, + [cf_cv_xopen_source=no], + [cf_cv_xopen_source=$cf_XOPEN_SOURCE]) + CPPFLAGS="$cf_save" ]) ]) @@ -8347,7 +8444,7 @@ if test "$cf_cv_xopen_source" != no ; then fi ]) dnl --------------------------------------------------------------------------- -dnl CF_TYPEOF_CHTYPE version: 10 updated: 2017/01/21 11:06:25 +dnl CF_TYPEOF_CHTYPE version: 11 updated: 2023/01/05 17:57:59 dnl ---------------- dnl Determine the type we should use for chtype (and attr_t, which is treated dnl as the same thing). We want around 32 bits, so on most machines want a @@ -8358,8 +8455,8 @@ AC_DEFUN([CF_TYPEOF_CHTYPE], AC_MSG_CHECKING([for type of chtype]) AC_CACHE_VAL(cf_cv_typeof_chtype,[ AC_TRY_RUN([ +$ac_includes_default #define WANT_BITS 31 -#include int main(void) { FILE *fp = fopen("cf_test.out", "w"); @@ -8439,7 +8536,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], @@ -8448,8 +8545,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 @@ -8728,7 +8824,25 @@ weak_symbol(fopen); ]) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_WITH_ABI_VERSION version: 4 updated: 2021/01/01 13:31:04 +dnl CF_WITH_ABI_ALTERED version: 1 updated: 2023/01/07 16:32:06 +dnl ------------------- +dnl Provide a way to override the displayed ABI version, e.g., in filenames. +dnl Check this option after using the ABI version in configuration decisions. +AC_DEFUN([CF_WITH_ABI_ALTERED],[ +AC_REQUIRE([CF_WITH_ABI_VERSION]) +AC_REQUIRE([CF_ABI_DEFAULTS]) +AC_ARG_WITH(abi-altered, +[ --with-abi-altered=XXX override visible ABI version, for packaging],[ + CF_NUMBER_SYNTAX($withval,ABI altered) + if test "$cf_cv_abi_version" != "$withval" + then + AC_MSG_WARN(altering visible ABI from $cf_cv_abi_version to $withval) + cf_cv_abi_version=$withval + fi +])dnl +])dnl +dnl --------------------------------------------------------------------------- +dnl CF_WITH_ABI_VERSION version: 5 updated: 2023/01/07 16:32:06 dnl ------------------- dnl Allow library's ABI to be overridden. Generally this happens when a dnl packager has incremented the ABI past that used in the original package, @@ -8757,6 +8871,7 @@ AC_ARG_WITH(abi-version, ifelse($1,,,[ $1_ABI=$cf_cv_abi_version ]) +cf_cv_abi_default=$cf_cv_abi_version ])dnl dnl --------------------------------------------------------------------------- dnl CF_WITH_ADA_COMPILER version: 2 updated: 2010/06/26 17:35:58 @@ -9317,7 +9432,7 @@ if test "x$with_pcre2" != xno ; then fi ])dnl dnl --------------------------------------------------------------------------- -dnl CF_WITH_PKG_CONFIG_LIBDIR version: 19 updated: 2021/11/20 14:57:36 +dnl CF_WITH_PKG_CONFIG_LIBDIR version: 20 updated: 2022/01/29 17:03:42 dnl ------------------------- dnl Allow the choice of the pkg-config library directory to be overridden. dnl @@ -9349,7 +9464,7 @@ AC_ARG_WITH(pkg-config-libdir, [cf_search_path=$withval], [test "x$PKG_CONFIG" != xnone && test -z "$cf_search_path" && cf_search_path=libdir]) -case x$cf_search_path in +case "x$cf_search_path" in (xlibdir) PKG_CONFIG_LIBDIR='${libdir}/pkgconfig' AC_MSG_RESULT($PKG_CONFIG_LIBDIR) @@ -9357,6 +9472,9 @@ case x$cf_search_path in ;; (x) ;; +(x/*\ *) + PKG_CONFIG_LIBDIR= + ;; (x/*) PKG_CONFIG_LIBDIR="$cf_search_path" AC_MSG_RESULT($PKG_CONFIG_LIBDIR) @@ -9799,7 +9917,7 @@ fi AC_SUBST(no_x11_rgb) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_XOPEN_SOURCE version: 59 updated: 2021/08/28 15:20:37 +dnl CF_XOPEN_SOURCE version: 63 updated: 2022/12/29 10:10:26 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, @@ -9850,7 +9968,7 @@ case "$host_os" in cf_xopen_source="-D_SGI_SOURCE" cf_XOPEN_SOURCE= ;; -(linux*|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) CF_GNU_SOURCE($cf_XOPEN_SOURCE) ;; (minix*) @@ -9899,7 +10017,15 @@ case "$host_os" in ;; (*) CF_TRY_XOPEN_SOURCE + 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) + 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"]) + fi ;; esac @@ -9943,3 +10069,23 @@ dnl ------------------ 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 --------------------- +dnl body of test when test-compiling for _XOPEN_SOURCE check +define([CF__XOPEN_SOURCE_BODY], +[ +#ifndef _XOPEN_SOURCE +make an error +#endif +]) +dnl --------------------------------------------------------------------------- +dnl CF__XOPEN_SOURCE_HEAD version: 1 updated: 2022/09/10 15:17:03 +dnl --------------------- +dnl headers to include when test-compiling for _XOPEN_SOURCE check +define([CF__XOPEN_SOURCE_HEAD], +[ +#include +#include +#include +])