X-Git-Url: http://ncurses.scripts.mit.edu/?a=blobdiff_plain;f=aclocal.m4;h=15631bb425b4a27497a6218fcaedcf8756902767;hb=17db5dfb5e91dbd31058d78c9c23efead6f822ea;hp=8d9a3ba2361b768c99c5a735592b4359c5470b7d;hpb=4782c5a046effbd91a3742a312dfdecfc06647aa;p=ncurses.git diff --git a/aclocal.m4 b/aclocal.m4 index 8d9a3ba2..15631bb4 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -1,5 +1,5 @@ dnl*************************************************************************** -dnl Copyright 2018-2020,2021 Thomas E. Dickey * +dnl Copyright 2018-2021,2022 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.999 2021/12/04 23:30:56 tom Exp $ +dnl $Id: aclocal.m4,v 1.1011 2022/09/10 19:23:45 tom Exp $ dnl Macros used in NCURSES auto-configuration script. dnl dnl These macros are maintained separately from NCURSES. The copyright on @@ -65,37 +65,55 @@ AC_CACHE_CHECK([for nl_langinfo and CODESET], am_cv_langinfo_codeset, fi ])dnl dnl --------------------------------------------------------------------------- -dnl CF_ABI_DEFAULTS version: 2 updated: 2015/06/06 13:49:58 +dnl CF_ABI_DEFAULTS version: 3 updated: 2022/01/22 19:13:38 dnl --------------- dnl Provide configure-script defaults for different ncurses ABIs. AC_DEFUN([CF_ABI_DEFAULTS],[ AC_REQUIRE([CF_NCURSES_WITH_ABI_VERSION]) + +# ABI 5 defaults: +cf_dft_ccharw_max=5 +cf_dft_chtype=auto +cf_dft_ext_colors=no +cf_dft_ext_const=no +cf_dft_ext_mouse=no +cf_dft_ext_putwin=no +cf_dft_ext_spfuncs=no +cf_dft_filter_syms=no +cf_dft_interop=no +cf_dft_mmask_t=auto +cf_dft_opaque_curses=no +cf_dft_ordinate_type=short +cf_dft_signed_char=no +cf_dft_tparm_arg=long +cf_dft_with_lp64=no + +# ABI 6 defaults: case x$cf_cv_abi_version in (x[[6789]]) + cf_dft_chtype=uint32_t cf_dft_ext_colors=yes cf_dft_ext_const=yes cf_dft_ext_mouse=yes cf_dft_ext_putwin=yes cf_dft_ext_spfuncs=yes cf_dft_filter_syms=yes - cf_dft_chtype=uint32_t - cf_dft_mmask_t=uint32_t cf_dft_interop=yes + cf_dft_mmask_t=uint32_t cf_dft_tparm_arg=intptr_t cf_dft_with_lp64=yes ;; -(*) - cf_dft_ext_colors=no - cf_dft_ext_const=no - cf_dft_ext_mouse=no - cf_dft_ext_putwin=no - cf_dft_ext_spfuncs=no - cf_dft_filter_syms=no - cf_dft_chtype=auto - cf_dft_mmask_t=auto - cf_dft_interop=no - cf_dft_tparm_arg=long - cf_dft_with_lp64=no +esac + +# ABI 7 defaults: +case x$cf_cv_abi_version in +(x[[789]]) + cf_dft_ccharw_max=6 + cf_dft_mmask_t=uint64_t + cf_dft_opaque_curses=yes + cf_dft_ordinate_type=int + cf_dft_signed_char=yes + # also: remove the wgetch-events feature in ABI 7 ;; esac ])dnl @@ -1713,6 +1731,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 @@ -2423,7 +2477,7 @@ AC_DEFUN([CF_FIXUP_ADAFLAGS],[ AC_MSG_RESULT($ADAFLAGS) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_FIX_WARNINGS version: 3 updated: 2020/12/31 18:40:20 +dnl CF_FIX_WARNINGS version: 4 updated: 2021/12/16 18:22:31 dnl --------------- dnl Warning flags do not belong in CFLAGS, CPPFLAGS, etc. Any of gcc's dnl "-Werror" flags can interfere with configure-checks. Those go into @@ -2435,11 +2489,13 @@ if test "$GCC" = yes || test "$GXX" = yes then case [$]$1 in (*-Werror=*) - CF_VERBOSE(repairing $1: [$]$1) cf_temp_flags= for cf_temp_scan in [$]$1 do case "x$cf_temp_scan" in + (x-Werror=format*) + CF_APPEND_TEXT(cf_temp_flags,$cf_temp_scan) + ;; (x-Werror=*) CF_APPEND_TEXT(EXTRA_CFLAGS,$cf_temp_scan) ;; @@ -2448,9 +2504,13 @@ then ;; esac done - $1="$cf_temp_flags" - CF_VERBOSE(... fixed [$]$1) - CF_VERBOSE(... extra $EXTRA_CFLAGS) + if test "x[$]$1" != "x$cf_temp_flags" + then + CF_VERBOSE(repairing $1: [$]$1) + $1="$cf_temp_flags" + CF_VERBOSE(... fixed [$]$1) + CF_VERBOSE(... extra $EXTRA_CFLAGS) + fi ;; esac fi @@ -4249,7 +4309,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 @@ -4260,7 +4320,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. @@ -5716,7 +5776,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: 52 updated: 2022/02/05 12:31:08 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 @@ -5789,7 +5849,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 @@ -6069,7 +6130,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 @@ -6079,18 +6140,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 --------------------------------------------------------------------------- @@ -6820,7 +6905,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], [ @@ -6831,6 +6916,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 @@ -8284,34 +8370,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" ]) ]) @@ -9293,7 +9365,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 @@ -9325,7 +9397,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) @@ -9333,6 +9405,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) @@ -9775,7 +9850,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: 60 updated: 2022/09/10 15:16:16 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, @@ -9826,7 +9901,7 @@ case "$host_os" in cf_xopen_source="-D_SGI_SOURCE" cf_XOPEN_SOURCE= ;; -(linux*|uclinux*|gnu*|mint*|k*bsd*-gnu|cygwin) +(linux*gnu|uclinux*|gnu*|mint*|k*bsd*-gnu|cygwin) CF_GNU_SOURCE($cf_XOPEN_SOURCE) ;; (minix*) @@ -9875,7 +9950,13 @@ 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... + 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"]) ;; esac @@ -9919,3 +10000,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 +])