X-Git-Url: http://ncurses.scripts.mit.edu/?p=ncurses.git;a=blobdiff_plain;f=aclocal.m4;h=8d9a3ba2361b768c99c5a735592b4359c5470b7d;hp=c2c3ca4ca509362169170e04aa1041738ff8c695;hb=4782c5a046effbd91a3742a312dfdecfc06647aa;hpb=8f4cd91a25f1569f73651062aaaf5fb969182eab diff --git a/aclocal.m4 b/aclocal.m4 index c2c3ca4c..8d9a3ba2 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.992 2021/11/07 15:31:47 tom Exp $ +dnl $Id: aclocal.m4,v 1.999 2021/12/04 23:30:56 tom Exp $ dnl Macros used in NCURSES auto-configuration script. dnl dnl These macros are maintained separately from NCURSES. The copyright on @@ -2072,7 +2072,7 @@ fi AC_SUBST(BROKEN_LINKER) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_ENABLE_PC_FILES version: 15 updated: 2021/10/25 19:21:54 +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. @@ -2101,7 +2101,8 @@ then 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 @@ -2543,6 +2544,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 @@ -9237,7 +9293,7 @@ if test "x$with_pcre2" != xno ; then fi ])dnl dnl --------------------------------------------------------------------------- -dnl CF_WITH_PKG_CONFIG_LIBDIR version: 17 updated: 2021/11/07 10:30:15 +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 @@ -9260,18 +9316,31 @@ case "$PKG_CONFIG" in ;; esac +# 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], [cf_search_path=$withval], - [test "x$PKG_CONFIG" != xnone && cf_search_path=yes]) + [test "x$PKG_CONFIG" != xnone && test -z "$cf_search_path" && cf_search_path=libdir]) 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= - CF_VERBOSE(auto...) # Look for the library directory using the same prefix as the executable AC_MSG_CHECKING(for search-list) if test "x$PKG_CONFIG" != xnone @@ -9300,54 +9369,57 @@ case x$cf_search_path in fi AC_MSG_RESULT($cf_search_path) - ;; (*) + AC_MSG_ERROR(Unexpected option value: $cf_search_path) ;; esac -AC_MSG_CHECKING(for first directory) -cf_pkg_config_path=none -for cf_config in $cf_search_path -do - if test -d "$cf_config" - then - cf_pkg_config_path=$cf_config - break - fi -done -AC_MSG_RESULT($cf_pkg_config_path) - -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" +if 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= + AC_MSG_CHECKING(for first directory) + cf_pkg_config_path=none for cf_config in $cf_search_path do - case $cf_config in - $cf_libdir/pkgconfig) - PKG_CONFIG_LIBDIR=$cf_libdir/pkgconfig + if test -d "$cf_config" + then + cf_pkg_config_path=$cf_config break - ;; - *) - test -z "$cf_backup" && cf_backup=$cf_config - ;; - esac + fi done - test -z "$PKG_CONFIG_LIBDIR" && PKG_CONFIG_LIBDIR=$cf_backup - AC_MSG_RESULT($PKG_CONFIG_LIBDIR) + AC_MSG_RESULT($cf_pkg_config_path) + + 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)