X-Git-Url: http://ncurses.scripts.mit.edu/?p=ncurses.git;a=blobdiff_plain;f=aclocal.m4;h=b1e5ab64bf01d3c352767274538030f056d027e7;hp=df1aebbbd05d8f9a297ecb5dc791a6b80037935b;hb=22b110664918b4fba48ae4237bafb81621bc5f5b;hpb=60cbc89987842cf6036aabced6618988b5117810 diff --git a/aclocal.m4 b/aclocal.m4 index df1aebbb..b1e5ab64 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.977 2021/09/05 21:32:31 tom Exp $ +dnl $Id: aclocal.m4,v 1.1001 2022/01/23 00:15:35 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 @@ -1347,6 +1365,37 @@ if test "$cf_cv_check_gpm_wgetch" != yes ; then fi ])])dnl dnl --------------------------------------------------------------------------- +dnl CF_CHECK_LIBSSP version: 1 updated: 2021/10/30 10:40:19 +dnl --------------- +dnl Check if libssp is needed, e.g., to work around misconfigured libraries +dnl used in cross-compiling to MinGW. +AC_DEFUN([CF_CHECK_LIBSSP],[ +AC_CACHE_CHECK(if ssp library is needed,cf_cv_need_libssp,[ +AC_TRY_LINK([ +#include +#include +],[ + DIR *dp = opendir("."); +],cf_cv_need_libssp=no,[ + cf_save_LIBS="$LIBS" + LIBS="$LIBS -lssp" + AC_TRY_LINK([ +#include +#include + ],[ + DIR *dp = opendir("."); + ],cf_cv_need_libssp=yes, + cf_cv_need_libssp=maybe) + LIBS="$cf_save_LIBS" +])dnl +]) + +if test "x$cf_cv_need_libssp" = xyes +then + CF_ADD_LIB(ssp) +fi +])dnl +dnl --------------------------------------------------------------------------- dnl CF_CHECK_LIBTOOL_VERSION version: 2 updated: 2021/05/01 16:24:34 dnl ------------------------ dnl Show the version of libtool @@ -2041,7 +2090,7 @@ fi AC_SUBST(BROKEN_LINKER) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_ENABLE_PC_FILES version: 13 updated: 2015/11/01 05:27:39 +dnl CF_ENABLE_PC_FILES version: 16 updated: 2021/11/20 12:48:37 dnl ------------------ dnl This is the "--enable-pc-files" option, which is available if there is a dnl pkg-config configuration on the local machine. @@ -2066,11 +2115,12 @@ if test "x$enable_pc_files" != xno then MAKE_PC_FILES= case "x$PKG_CONFIG_LIBDIR" in - (xno|xyes) + (xno|xnone|xyes|x) AC_MSG_WARN(no PKG_CONFIG_LIBDIR was found) ;; (*) - CF_PATH_SYNTAX(PKG_CONFIG_LIBDIR) + cf_pkg_config_libdir="$PKG_CONFIG_LIBDIR" + CF_PATH_SYNTAX(cf_pkg_config_libdir) ;; esac else @@ -2391,7 +2441,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 @@ -2403,11 +2453,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) ;; @@ -2416,9 +2468,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 @@ -2512,6 +2568,61 @@ else fi ]) dnl --------------------------------------------------------------------------- +dnl CF_FUNC_GETTTYNAM version: 1 updated: 2021/12/04 18:29:47 +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 +dnl other checks fail, just define HAVE_PATH_TTYS. +AC_DEFUN([CF_FUNC_GETTTYNAM],[ +AC_CACHE_CHECK(if _PATH_TTYS is defined in ttyent.h,cf_cv_PATH_TTYS,[ +AC_TRY_COMPILE([ +#include +#include ],[ +FILE *fp = fopen(_PATH_TTYS, "r"); (void)fp], + [cf_cv_PATH_TTYS=yes], + [cf_cv_PATH_TTYS=no])]) + +if test $cf_cv_PATH_TTYS = no +then + for cf_ttys in /etc/ttytype /etc/ttys + do + if test -f $cf_ttys + then + cf_cv_PATH_TTYS=maybe + AC_DEFINE(_PATH_TTYS,$cf_ttys,[define to pathname of file containing mapping from tty name to terminal type]) + break + fi + done +fi + +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 +#include +int main(void) { + FILE *fp = fopen(_PATH_TTYS, "r"); + ${cf_cv_main_return:-return} (fp == 0); +}], + [cf_cv_have_PATH_TTYS=yes], + [cf_cv_have_PATH_TTYS=no], + [cf_cv_have_PATH_TTYS=unknown])]) + test "$cf_cv_have_PATH_TTYS" = no && cf_cv_PATH_TTYS=no +fi + +if test $cf_cv_PATH_TTYS != no +then + AC_DEFINE(HAVE_PATH_TTYS,1,[define to 1 if system can map tty name to terminal type]) + AC_CACHE_CHECK(for getttynam,cf_cv_func_getttynam,[ + AC_TRY_LINK([#include ], + [struct ttyent *fp = getttynam("/dev/tty"); (void)fp], + [cf_cv_func_getttynam=yes], + [cf_cv_func_getttynam=no])]) + test "$cf_cv_func_getttynam" = yes && AC_DEFINE(HAVE_GETTTYNAM) +fi +])dnl +dnl --------------------------------------------------------------------------- dnl CF_FUNC_MEMMOVE version: 9 updated: 2017/01/21 11:06:25 dnl --------------- dnl Check for memmove, or a bcopy that can handle overlapping copy. If neither @@ -6315,9 +6426,11 @@ case ".[$]$1" in esac ])dnl dnl --------------------------------------------------------------------------- -dnl CF_PKG_CONFIG version: 11 updated: 2021/01/01 13:31:04 +dnl CF_PKG_CONFIG version: 12 updated: 2021/10/10 20:18:09 dnl ------------- dnl Check for the package-config program, unless disabled by command-line. +dnl +dnl Sets $PKG_CONFIG to the pathname of the pkg-config program. AC_DEFUN([CF_PKG_CONFIG], [ AC_MSG_CHECKING(if you want to use pkg-config) @@ -9204,9 +9317,18 @@ if test "x$with_pcre2" != xno ; then fi ])dnl dnl --------------------------------------------------------------------------- -dnl CF_WITH_PKG_CONFIG_LIBDIR version: 11 updated: 2021/01/01 16:16:30 +dnl CF_WITH_PKG_CONFIG_LIBDIR version: 19 updated: 2021/11/20 14:57:36 dnl ------------------------- dnl Allow the choice of the pkg-config library directory to be overridden. +dnl +dnl pkg-config uses a search-list built from these colon-separated lists of +dnl directories: +dnl a) $PKG_CONFIG_PATH (tested first, added if set) +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. AC_DEFUN([CF_WITH_PKG_CONFIG_LIBDIR],[ case "$PKG_CONFIG" in @@ -9218,68 +9340,110 @@ case "$PKG_CONFIG" in ;; esac -PKG_CONFIG_LIBDIR=no +# if $PKG_CONFIG_LIBDIR is set, try to use that +cf_search_path=`echo "$PKG_CONFIG_LIBDIR" | sed -e 's/:/ /g' -e 's,^[[ ]]*,,'` + +# 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], - [PKG_CONFIG_LIBDIR=$withval], - [test "x$PKG_CONFIG" != xnone && PKG_CONFIG_LIBDIR=yes]) + [cf_search_path=$withval], + [test "x$PKG_CONFIG" != xnone && test -z "$cf_search_path" && cf_search_path=libdir]) -case x$PKG_CONFIG_LIBDIR in +case x$cf_search_path in +(xlibdir) + PKG_CONFIG_LIBDIR='${libdir}/pkgconfig' + AC_MSG_RESULT($PKG_CONFIG_LIBDIR) + cf_search_path= + ;; +(x) + ;; (x/*) + PKG_CONFIG_LIBDIR="$cf_search_path" + AC_MSG_RESULT($PKG_CONFIG_LIBDIR) + cf_search_path= ;; -(xyes) +(xyes|xauto) + AC_MSG_RESULT(auto) + cf_search_path= # Look for the library directory using the same prefix as the executable - if test "x$PKG_CONFIG" = xnone + AC_MSG_CHECKING(for search-list) + if test "x$PKG_CONFIG" != xnone then - cf_path=$prefix - else - cf_path=`echo "$PKG_CONFIG" | sed -e 's,/[[^/]]*/[[^/]]*$,,'` + # works for pkg-config since version 0.24 (2009) + # works for pkgconf since version 0.8.3 (2012) + for cf_pkg_program in \ + `echo "$PKG_CONFIG" | sed -e 's,^.*/,,'` \ + pkg-config \ + pkgconf + do + cf_search_path=`"$PKG_CONFIG" --variable=pc_path "$cf_pkg_program" 2>/dev/null | tr : ' '` + test -n "$cf_search_path" && break + done + + # works for pkg-config since import in 2005 of original 2001 HP code. + test -z "$cf_search_path" && \ + cf_search_path=` + "$PKG_CONFIG" --debug --exists no-such-package 2>&1 | $AWK "\ +/^Scanning directory (#[1-9][0-9]* )?'.*'$/{ \ + sub(\"^[[^']]*'\",\"\"); \ + sub(\"'.*\",\"\"); \ + printf \" %s\", \\[$]0; } \ +{ next; } \ +"` fi - # If you don't like using the default architecture, you have to specify the - # intended library directory and corresponding compiler/linker options. - # - # This case allows for Debian's 2014-flavor of multiarch, along with the - # most common variations before that point. Some other variants spell the - # directory differently, e.g., "pkg-config", and put it in unusual places. - # pkg-config has always been poorly standardized, which is ironic... - case x`(arch) 2>/dev/null` in - (*64) - cf_search_path="\ - $cf_path/lib/*64-linux-gnu \ - $cf_path/share \ - $cf_path/lib64 \ - $cf_path/lib32 \ - $cf_path/lib" - ;; - (*) - cf_search_path="\ - $cf_path/lib/*-linux-gnu \ - $cf_path/share \ - $cf_path/lib32 \ - $cf_path/lib \ - $cf_path/libdata" - ;; - esac + AC_MSG_RESULT($cf_search_path) + ;; +(*) + AC_MSG_ERROR(Unexpected option value: $cf_search_path) + ;; +esac - CF_VERBOSE(list...) +if test -n "$cf_search_path" +then + AC_MSG_CHECKING(for first directory) + cf_pkg_config_path=none for cf_config in $cf_search_path do - CF_VERBOSE(checking $cf_config/pkgconfig) - if test -d "$cf_config/pkgconfig" + if test -d "$cf_config" then - PKG_CONFIG_LIBDIR=$cf_config/pkgconfig - AC_MSG_CHECKING(done) + cf_pkg_config_path=$cf_config break fi done - ;; -(*) - ;; -esac + AC_MSG_RESULT($cf_pkg_config_path) -if test "x$PKG_CONFIG_LIBDIR" != xno ; then - AC_MSG_RESULT($PKG_CONFIG_LIBDIR) + if test "x$cf_pkg_config_path" != xnone ; then + # limit this to the first directory found + PKG_CONFIG_LIBDIR="$cf_pkg_config_path" + fi + + if test -z "$PKG_CONFIG_LIBDIR" && test -n "$cf_search_path" + then + AC_MSG_CHECKING(for workaround) + if test "$prefix" = "NONE" ; then + cf_prefix="$ac_default_prefix" + else + cf_prefix="$prefix" + fi + eval cf_libdir=$libdir + cf_libdir=`echo "$cf_libdir" | sed -e "s,^NONE,$cf_prefix,"` + cf_backup= + for cf_config in $cf_search_path + do + case $cf_config in + $cf_libdir/pkgconfig) + PKG_CONFIG_LIBDIR=$cf_libdir/pkgconfig + break + ;; + *) + test -z "$cf_backup" && cf_backup=$cf_config + ;; + esac + done + test -z "$PKG_CONFIG_LIBDIR" && PKG_CONFIG_LIBDIR=$cf_backup + AC_MSG_RESULT($PKG_CONFIG_LIBDIR) + fi fi AC_SUBST(PKG_CONFIG_LIBDIR)