X-Git-Url: https://ncurses.scripts.mit.edu/?p=ncurses.git;a=blobdiff_plain;f=aclocal.m4;h=c2c3ca4ca509362169170e04aa1041738ff8c695;hp=96cae09c942cf831435fbe95f8d0749f0b80f703;hb=8f4cd91a25f1569f73651062aaaf5fb969182eab;hpb=4a864172ab2e7d301d9db9e80fb4c617e3ed7b6e diff --git a/aclocal.m4 b/aclocal.m4 index 96cae09c..c2c3ca4c 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.981 2021/10/17 15:14:04 tom Exp $ +dnl $Id: aclocal.m4,v 1.992 2021/11/07 15:31:47 tom Exp $ dnl Macros used in NCURSES auto-configuration script. dnl dnl These macros are maintained separately from NCURSES. The copyright on @@ -1347,6 +1347,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 +2072,7 @@ fi AC_SUBST(BROKEN_LINKER) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_ENABLE_PC_FILES version: 14 updated: 2021/10/17 11:12:47 +dnl CF_ENABLE_PC_FILES version: 15 updated: 2021/10/25 19:21:54 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,7 +2097,7 @@ if test "x$enable_pc_files" != xno then MAKE_PC_FILES= case "x$PKG_CONFIG_LIBDIR" in - (xno|xnone|xyes) + (xno|xnone|xyes|x) AC_MSG_WARN(no PKG_CONFIG_LIBDIR was found) ;; (*) @@ -9206,7 +9237,7 @@ if test "x$with_pcre2" != xno ; then fi ])dnl dnl --------------------------------------------------------------------------- -dnl CF_WITH_PKG_CONFIG_LIBDIR version: 13 updated: 2021/10/17 11:12:47 +dnl CF_WITH_PKG_CONFIG_LIBDIR version: 17 updated: 2021/11/07 10:30:15 dnl ------------------------- dnl Allow the choice of the pkg-config library directory to be overridden. dnl @@ -9243,62 +9274,31 @@ case x$cf_search_path in 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 + 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]* '.*'$/{ \ + "$PKG_CONFIG" --debug --exists no-such-package 2>&1 | $AWK "\ +/^Scanning directory (#[1-9][0-9]* )?'.*'$/{ \ sub(\"^[[^']]*'\",\"\"); \ sub(\"'.*\",\"\"); \ printf \" %s\", \\[$]0; } \ -/trying path:/{ - sub(\"^.* trying path: \",\"\"); - sub(\" for no-such-package.*$\",\"\"); - printf \" %s\", \\[$]0; -} { next; } \ "` fi - if test -z "$cf_search_path" - then - # 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_test_path="\ - $cf_path/lib/*64-linux-gnu \ - $cf_path/share \ - $cf_path/lib64 \ - $cf_path/lib32 \ - $cf_path/lib" - ;; - (*) - cf_test_path="\ - $cf_path/lib/*-linux-gnu \ - $cf_path/share \ - $cf_path/lib32 \ - $cf_path/lib \ - $cf_path/libdata" - ;; - esac - for cf_config in $cf_test_path - do - test -d "$cf_config/pkgconfig" && cf_search_path="$cf_search_path $cf_config/pkgconfig" - done - fi - AC_MSG_RESULT($cf_search_path) ;; @@ -9323,6 +9323,33 @@ if test "x$cf_pkg_config_path" != xnone ; then 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 + AC_SUBST(PKG_CONFIG_LIBDIR) ])dnl dnl ---------------------------------------------------------------------------