]> ncurses.scripts.mit.edu Git - ncurses.git/blobdiff - Ada95/aclocal.m4
ncurses 6.2 - patch 20211017
[ncurses.git] / Ada95 / aclocal.m4
index 374b05ef160d1b7e87d0450eb578459072705195..75e68c75f56b8b47022a09a6f3f91a13ba1cd99f 100644 (file)
@@ -29,7 +29,7 @@ dnl***************************************************************************
 dnl
 dnl Author: Thomas E. Dickey
 dnl
-dnl $Id: aclocal.m4,v 1.173 2021/03/23 00:37:21 tom Exp $
+dnl $Id: aclocal.m4,v 1.185 2021/10/17 15:16:03 tom Exp $
 dnl Macros used in NCURSES Ada95 auto-configuration script.
 dnl
 dnl These macros are maintained separately from NCURSES.  The copyright on
@@ -189,9 +189,9 @@ AC_SUBST(EXTRA_CPPFLAGS)
 
 ])dnl
 dnl ---------------------------------------------------------------------------
-dnl CF_ADD_INCDIR version: 16 updated: 2020/12/31 20:19:42
+dnl CF_ADD_INCDIR version: 17 updated: 2021/09/04 06:35:04
 dnl -------------
-dnl Add an include-directory to $CPPFLAGS.  Don't add /usr/include, since it's
+dnl Add an include-directory to $CPPFLAGS.  Don't add /usr/include, since it is
 dnl redundant.  We don't normally need to add -I/usr/local/include for gcc,
 dnl but old versions (and some misinstalled ones) need that.  To make things
 dnl worse, gcc 3.x may give error messages if -I/usr/local/include is added to
@@ -340,6 +340,25 @@ ifelse([$5],NONE,,[{ test -z "$5" || test "x$5" = xNONE || test "x$4" != "x$5";
 }
 ])dnl
 dnl ---------------------------------------------------------------------------
+dnl CF_APPEND_CFLAGS version: 3 updated: 2021/09/05 17:25:40
+dnl ----------------
+dnl Use CF_ADD_CFLAGS after first checking for potential redefinitions.
+dnl $1 = flags to add
+dnl $2 = if given makes this macro verbose.
+define([CF_APPEND_CFLAGS],
+[
+for cf_add_cflags in $1
+do
+       case "x$cf_add_cflags" in
+       (x-[[DU]]*)
+               CF_REMOVE_CFLAGS($cf_add_cflags,CFLAGS,[$2])
+               CF_REMOVE_CFLAGS($cf_add_cflags,CPPFLAGS,[$2])
+               ;;
+       esac
+       CF_ADD_CFLAGS([$cf_add_cflags],[$2])
+done
+])dnl
+dnl ---------------------------------------------------------------------------
 dnl CF_APPEND_TEXT version: 1 updated: 2017/02/25 18:58:55
 dnl --------------
 dnl use this macro for appending text without introducing an extra blank at
@@ -550,7 +569,7 @@ AC_SUBST(BUILD_EXEEXT)
 AC_SUBST(BUILD_OBJEXT)
 ])dnl
 dnl ---------------------------------------------------------------------------
-dnl CF_C11_NORETURN version: 2 updated: 2021/03/22 20:37:21
+dnl CF_C11_NORETURN version: 3 updated: 2021/03/28 11:36:23
 dnl ---------------
 AC_DEFUN([CF_C11_NORETURN],
 [
@@ -567,7 +586,7 @@ AC_CACHE_CHECK([for C11 _Noreturn feature], cf_cv_c11_noreturn,
 #include <stdio.h>
 #include <stdlib.h>
 #include <stdnoreturn.h>
-static void giveup(void) { exit(0); }
+static _Noreturn void giveup(void) { exit(0); }
        ],
        [if (feof(stdin)) giveup()],
        cf_cv_c11_noreturn=yes,
@@ -578,7 +597,7 @@ else
 fi
 
 if test "$cf_cv_c11_noreturn" = yes; then
-       AC_DEFINE(HAVE_STDNORETURN_H, 1)
+       AC_DEFINE(HAVE_STDNORETURN_H, 1,[Define if <stdnoreturn.h> header is available and working])
        AC_DEFINE_UNQUOTED(STDC_NORETURN,_Noreturn,[Define if C11 _Noreturn keyword is supported])
        HAVE_STDNORETURN_H=1
 else
@@ -586,6 +605,7 @@ else
 fi
 
 AC_SUBST(HAVE_STDNORETURN_H)
+AC_SUBST(STDC_NORETURN)
 ])dnl
 dnl ---------------------------------------------------------------------------
 dnl CF_CC_ENV_FLAGS version: 10 updated: 2020/12/31 18:40:20
@@ -826,7 +846,7 @@ if test "x$ifelse([$2],,CLANG_COMPILER,[$2])" = "xyes" ; then
 fi
 ])
 dnl ---------------------------------------------------------------------------
-dnl CF_CONST_X_STRING version: 6 updated: 2021/01/01 13:31:04
+dnl CF_CONST_X_STRING version: 7 updated: 2021/06/07 17:39:17
 dnl -----------------
 dnl The X11R4-X11R6 Xt specification uses an ambiguous String type for most
 dnl character-strings.
@@ -856,7 +876,7 @@ AC_TRY_COMPILE(
 #include <stdlib.h>
 #include <X11/Intrinsic.h>
 ],
-[String foo = malloc(1); (void)foo],[
+[String foo = malloc(1); free((void*)foo)],[
 
 AC_CACHE_CHECK(for X11/Xt const-feature,cf_cv_const_x_string,[
        AC_TRY_COMPILE(
@@ -886,7 +906,7 @@ esac
 ])
 ])dnl
 dnl ---------------------------------------------------------------------------
-dnl CF_CONST_X_STRING version: 6 updated: 2021/01/01 13:31:04
+dnl CF_CONST_X_STRING version: 7 updated: 2021/06/07 17:39:17
 dnl -----------------
 dnl The X11R4-X11R6 Xt specification uses an ambiguous String type for most
 dnl character-strings.
@@ -916,7 +936,7 @@ AC_TRY_COMPILE(
 #include <stdlib.h>
 #include <X11/Intrinsic.h>
 ],
-[String foo = malloc(1); (void)foo],[
+[String foo = malloc(1); free((void*)foo)],[
 
 AC_CACHE_CHECK(for X11/Xt const-feature,cf_cv_const_x_string,[
        AC_TRY_COMPILE(
@@ -978,9 +998,9 @@ dnl ----------
 dnl "dirname" is not portable, so we fake it with a shell script.
 AC_DEFUN([CF_DIRNAME],[$1=`echo "$2" | sed -e 's%/[[^/]]*$%%'`])dnl
 dnl ---------------------------------------------------------------------------
-dnl CF_DISABLE_ECHO version: 13 updated: 2015/04/18 08:56:57
+dnl CF_DISABLE_ECHO version: 14 updated: 2021/09/04 06:35:04
 dnl ---------------
-dnl You can always use "make -n" to see the actual options, but it's hard to
+dnl You can always use "make -n" to see the actual options, but it is hard to
 dnl pick out/analyze warning messages when the compile-line is long.
 dnl
 dnl Sets:
@@ -2482,10 +2502,10 @@ AC_SUBST(BROKEN_LINKER)
 
 ])dnl
 dnl ---------------------------------------------------------------------------
-dnl CF_MAKEFLAGS version: 20 updated: 2021/01/03 19:29:49
+dnl CF_MAKEFLAGS version: 21 updated: 2021/09/04 06:47:34
 dnl ------------
 dnl Some 'make' programs support ${MAKEFLAGS}, some ${MFLAGS}, to pass 'make'
-dnl options to lower-levels.  It's very useful for "make -n" -- if we have it.
+dnl options to lower-levels.  It is very useful for "make -n" -- if we have it.
 dnl (GNU 'make' does both, something POSIX 'make', which happens to make the
 dnl ${MAKEFLAGS} variable incompatible because it adds the assignments :-)
 AC_DEFUN([CF_MAKEFLAGS],
@@ -2525,6 +2545,89 @@ CF_EOF
 AC_SUBST(cf_cv_makeflags)
 ])dnl
 dnl ---------------------------------------------------------------------------
+dnl CF_MAKE_PHONY version: 3 updated: 2021/01/08 16:08:21
+dnl -------------
+dnl Check if the make-program handles a ".PHONY" target, e.g,. a target which
+dnl acts as a placeholder.
+dnl
+dnl The ".PHONY" feature was proposed in 2011 here
+dnl     https://www.austingroupbugs.net/view.php?id=523
+dnl and is scheduled for release in P1003.1 Issue 8 (late 2022).
+dnl
+dnl This is not supported by SVr4 make (or SunOS 4, 4.3SD, etc), but works with
+dnl a few others (i.e., GNU make and the non-POSIX "BSD" make):
+dnl
+dnl + This is a GNU make feature (since April 1988, but in turn from binutils,
+dnl   date unspecified).
+dnl
+dnl + It was adopted in NetBSD make in June 1995.
+dnl
+dnl + The other BSD make programs are derived from the NetBSD make (and for
+dnl   that reason are not actually different "implementations").
+dnl
+dnl + Some features of NetBSD make were actually adapted from pmake, which
+dnl   began as a modified GNU make starting in 1993.
+dnl
+dnl + Version 3.8 of the dmake program in January 1992 also implemented this
+dnl   GNU make extension, but is less well known than the BSD make.
+AC_DEFUN([CF_MAKE_PHONY],[
+AC_CACHE_CHECK(for \".PHONY\" make-support, cf_cv_make_PHONY,[
+       rm -rf conftest*
+       (
+               mkdir conftest || exit 1
+               cd conftest
+               cat >makefile <<'CF_EOF'
+.PHONY: always
+DATA=0
+always:        always.out
+       @echo "** making [$]@ [$](DATA)"
+once: once.out
+       @echo "** making [$]@ [$](DATA)"
+always.out:
+       @echo "** making [$]@ [$](DATA)"
+       echo [$](DATA) > [$]@
+once.out:
+       @echo "** making [$]@ [$](DATA)"
+       echo [$](DATA) > [$]@
+CF_EOF
+               for cf_data in 1 2 3
+               do
+                       ${MAKE:-make} always DATA=$cf_data
+                       ${MAKE:-make} once   DATA=$cf_data
+                       ${MAKE:-make} -t always once
+                       if test -f always ; then
+                               echo "no (case 1)" > ../conftest.tmp
+                       elif test ! -f always.out ; then
+                               echo "no (case 2)" > ../conftest.tmp
+                       elif test ! -f once.out ; then
+                               echo "no (case 3)" > ../conftest.tmp
+                       elif ! cmp -s always.out once.out ; then
+                               echo "no (case 4)" > ../conftest.tmp
+                               diff always.out once.out
+                       else
+                               cf_check="`cat always.out`"
+                               if test "x$cf_check" != "x$cf_data" ; then
+                                       echo "no (case 5)" > ../conftest.tmp
+                               else
+                                       echo yes > ../conftest.tmp
+                                       rm -f ./*.out
+                                       continue
+                               fi
+                       fi
+                       break
+               done
+       ) >&AC_FD_CC 2>&1
+       cf_cv_make_PHONY="`cat conftest.tmp`"
+       rm -rf conftest*
+])
+MAKE_NO_PHONY="#"
+MAKE_PHONY="#"
+test "x$cf_cv_make_PHONY" = xyes && MAKE_PHONY=
+test "x$cf_cv_make_PHONY" != xyes && MAKE_NO_PHONY=
+AC_SUBST(MAKE_NO_PHONY)
+AC_SUBST(MAKE_PHONY)
+])dnl
+dnl ---------------------------------------------------------------------------
 dnl CF_MAKE_TAGS version: 6 updated: 2010/10/23 15:52:32
 dnl ------------
 dnl Generate tags/TAGS targets for makefiles.  Do not generate TAGS if we have
@@ -2781,7 +2884,7 @@ printf("old\\n");
        ,[$1=no])
 ])dnl
 dnl ---------------------------------------------------------------------------
-dnl CF_NCURSES_CONFIG version: 26 updated: 2021/01/03 08:05:37
+dnl CF_NCURSES_CONFIG version: 28 updated: 2021/08/28 15:20:37
 dnl -----------------
 dnl Tie together the configure-script macros for ncurses, preferring these in
 dnl order:
@@ -2823,7 +2926,7 @@ if test "x${PKG_CONFIG:=none}" != xnone; then
                                [initscr(); mousemask(0,0); tigetstr((char *)0);],
                                [AC_TRY_RUN([#include <${cf_cv_ncurses_header:-curses.h}>
                                        int main(void)
-                                       { char *xx = curses_version(); return (xx == 0); }],
+                                       { const char *xx = curses_version(); return (xx == 0); }],
                                        [cf_test_ncuconfig=yes],
                                        [cf_test_ncuconfig=no],
                                        [cf_test_ncuconfig=maybe])],
@@ -2842,14 +2945,14 @@ if test "x${PKG_CONFIG:=none}" != xnone; then
                        ;;
                esac
 
-               CF_ADD_CFLAGS($cf_pkg_cflags)
+               CF_APPEND_CFLAGS($cf_pkg_cflags)
                CF_ADD_LIBS($cf_pkg_libs)
 
                AC_TRY_LINK([#include <${cf_cv_ncurses_header:-curses.h}>],
                        [initscr(); mousemask(0,0); tigetstr((char *)0);],
                        [AC_TRY_RUN([#include <${cf_cv_ncurses_header:-curses.h}>
                                int main(void)
-                               { char *xx = curses_version(); return (xx == 0); }],
+                               { const char *xx = curses_version(); return (xx == 0); }],
                                [cf_have_ncuconfig=yes],
                                [cf_have_ncuconfig=no],
                                [cf_have_ncuconfig=maybe])],
@@ -2884,7 +2987,7 @@ if test "x$cf_have_ncuconfig" = "xno"; then
 
        if test "$NCURSES_CONFIG" != none ; then
 
-               CF_ADD_CFLAGS(`$NCURSES_CONFIG --cflags`)
+               CF_APPEND_CFLAGS(`$NCURSES_CONFIG --cflags`)
                CF_ADD_LIBS(`$NCURSES_CONFIG --libs`)
 
                # even with config script, some packages use no-override for curses.h
@@ -3028,7 +3131,7 @@ esac
 
 ])dnl
 dnl ---------------------------------------------------------------------------
-dnl CF_NCURSES_LIBS version: 20 updated: 2021/01/03 08:05:37
+dnl CF_NCURSES_LIBS version: 21 updated: 2021/09/04 06:37:12
 dnl ---------------
 dnl Look for the ncurses library.  This is a little complicated on Linux,
 dnl because it may be linked with the gpm (general purpose mouse) library.
@@ -3057,7 +3160,7 @@ AC_CHECK_LIB(gpm,Gpm_Open,
 case "$host_os" in
 (freebsd*)
        # This is only necessary if you are linking against an obsolete
-       # version of ncurses (but it should do no harm, since it's static).
+       # version of ncurses (but it should do no harm, since it is static).
        if test "$cf_nculib_root" = ncurses ; then
                AC_CHECK_LIB(mytinfo,tgoto,[cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"])
        fi
@@ -3231,9 +3334,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)
@@ -3632,6 +3737,24 @@ AC_MSG_RESULT($cf_prog_ln_sf)
 test "$cf_prog_ln_sf" = yes && LN_S="$LN_S -f"
 ])dnl
 dnl ---------------------------------------------------------------------------
+dnl CF_REMOVE_CFLAGS version: 3 updated: 2021/09/05 17:25:40
+dnl ----------------
+dnl Remove a given option from CFLAGS/CPPFLAGS
+dnl $1 = option to remove
+dnl $2 = variable to update
+dnl $3 = nonempty to allow verbose message
+define([CF_REMOVE_CFLAGS],
+[
+cf_tmp_cflag=`echo "x$1" | sed -e 's/^.//' -e 's/=.*//'`
+while true
+do
+       cf_old_cflag=`echo "x[$]$2" | sed -e 's/^.//' -e 's/[[  ]][[    ]]*-/ -/g' -e "s%$cf_tmp_cflag\\(=[[^   ]][[^   ]]*\\)\?%%" -e 's/^[[   ]]*//' -e 's%[[ ]][[ ]]*-D% -D%g' -e 's%[[ ]][[ ]]*-I% -I%g'`
+       test "[$]$2" != "$cf_old_cflag" || break
+       ifelse([$3],,,[CF_VERBOSE(removing old option $1 from $2)])
+       $2="$cf_old_cflag"
+done
+])dnl
+dnl ---------------------------------------------------------------------------
 dnl CF_REMOVE_DEFINE version: 3 updated: 2010/01/09 11:05:50
 dnl ----------------
 dnl Remove all -U and -D options that refer to the given symbol from a list
@@ -3698,7 +3821,7 @@ do
 done
 ])dnl
 dnl ---------------------------------------------------------------------------
-dnl CF_SHARED_OPTS version: 105 updated: 2021/01/02 17:09:14
+dnl CF_SHARED_OPTS version: 107 updated: 2021/09/04 06:47:34
 dnl --------------
 dnl --------------
 dnl Attempt to determine the appropriate CC/LD options for creating a shared
@@ -3722,7 +3845,7 @@ dnl The variable 'cf_cv_shlib_version_infix' controls whether shared library
 dnl version numbers are infix (ex: libncurses.<ver>.dylib) or postfix
 dnl (ex: libncurses.so.<ver>).
 dnl
-dnl Some loaders leave 'so_locations' lying around.  It's nice to clean up.
+dnl Some loaders leave 'so_locations' lying around.  It is nice to clean up.
 AC_DEFUN([CF_SHARED_OPTS],
 [
        AC_REQUIRE([CF_LD_RPATH_OPT])
@@ -3869,6 +3992,10 @@ CF_EOF
                        LDFLAGS="$LDFLAGS -Wl,-search_paths_first"
                fi
                ;;
+       (haiku*)
+               CF_SHARED_SONAME
+               MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-soname,'$cf_cv_shared_soname',-stats,-lc -o $[@]'
+               ;;
        (hpux[[7-8]]*)
                # HP-UX 8.07 ld lacks "+b" option used for libdir search-list
                if test "$GCC" != yes; then
@@ -4359,7 +4486,7 @@ top_builddir=ifelse($1,,`pwd`,$1)
 AC_SUBST(top_builddir)
 ])dnl
 dnl ---------------------------------------------------------------------------
-dnl CF_TRY_XOPEN_SOURCE version: 2 updated: 2018/06/20 20:23:13
+dnl CF_TRY_XOPEN_SOURCE version: 3 updated: 2021/08/28 15:20:37
 dnl -------------------
 dnl If _XOPEN_SOURCE is not defined in the compile environment, check if we
 dnl can define it successfully.
@@ -4394,7 +4521,7 @@ if test "$cf_cv_xopen_source" != no ; then
        CF_REMOVE_DEFINE(CFLAGS,$CFLAGS,_XOPEN_SOURCE)
        CF_REMOVE_DEFINE(CPPFLAGS,$CPPFLAGS,_XOPEN_SOURCE)
        cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source"
-       CF_ADD_CFLAGS($cf_temp_xopen_source)
+       CF_APPEND_CFLAGS($cf_temp_xopen_source)
 fi
 ])
 dnl ---------------------------------------------------------------------------
@@ -4407,15 +4534,21 @@ AC_DEFUN([CF_UPPER],
 $1=`echo "$2" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
 ])dnl
 dnl ---------------------------------------------------------------------------
-dnl CF_UTF8_LIB version: 8 updated: 2012/10/06 08:57:51
+dnl CF_UTF8_LIB version: 9 updated: 2021/05/19 19:35:25
 dnl -----------
 dnl Check for multibyte support, and if not found, utf8 compatibility library
 AC_DEFUN([CF_UTF8_LIB],
 [
+AC_HAVE_HEADERS(wchar.h)
 AC_CACHE_CHECK(for multibyte character support,cf_cv_utf8_lib,[
        cf_save_LIBS="$LIBS"
        AC_TRY_LINK([
-#include <stdlib.h>],[putwc(0,0);],
+#include <stdlib.h>
+#include <stdio.h>
+#ifdef HAVE_WCHAR_H
+#include <wchar.h>
+#endif
+],[putwc(0,0);],
        [cf_cv_utf8_lib=yes],
        [CF_FIND_LINKAGE([
 #include <libutf8.h>],[putwc(0,0);],utf8,
@@ -4617,7 +4750,7 @@ else
 fi
 ])dnl
 dnl ---------------------------------------------------------------------------
-dnl CF_WITH_PATH version: 11 updated: 2012/09/29 15:04:19
+dnl CF_WITH_PATH version: 12 updated: 2021/09/04 06:35:04
 dnl ------------
 dnl Wrapper for AC_ARG_WITH to ensure that user supplies a pathname, not just
 dnl defaulting to yes/no.
@@ -4626,7 +4759,7 @@ dnl $1 = option name
 dnl $2 = help-text
 dnl $3 = environment variable to set
 dnl $4 = default value, shown in the help-message, must be a constant
-dnl $5 = default value, if it's an expression & cannot be in the help-message
+dnl $5 = default value, if it is an expression & cannot be in the help-message
 dnl
 AC_DEFUN([CF_WITH_PATH],
 [AC_ARG_WITH($1,[$2 ](default: ifelse([$4],,empty,[$4])),,
@@ -4638,9 +4771,18 @@ eval $3="$withval"
 AC_SUBST($3)dnl
 ])dnl
 dnl ---------------------------------------------------------------------------
-dnl CF_WITH_PKG_CONFIG_LIBDIR version: 11 updated: 2021/01/01 16:16:30
+dnl CF_WITH_PKG_CONFIG_LIBDIR version: 13 updated: 2021/10/17 11:12:47
 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
@@ -4652,68 +4794,98 @@ case "$PKG_CONFIG" in
        ;;
 esac
 
-PKG_CONFIG_LIBDIR=no
+cf_search_path=`echo "$PKG_CONFIG_LIBDIR" | sed -e 's/:/ /g' -e 's,^[[         ]]*,,'`
 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 && cf_search_path=yes])
 
-case x$PKG_CONFIG_LIBDIR in
+case x$cf_search_path in
 (x/*)
        ;;
 (xyes)
+       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
        then
                cf_path=$prefix
        else
                cf_path=`echo "$PKG_CONFIG" | sed -e 's,/[[^/]]*/[[^/]]*$,,'`
+               cf_search_path=`
+               "$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 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
+       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)
 
-       CF_VERBOSE(list...)
-       for cf_config in $cf_search_path
-       do
-               CF_VERBOSE(checking $cf_config/pkgconfig)
-               if test -d "$cf_config/pkgconfig"
-               then
-                       PKG_CONFIG_LIBDIR=$cf_config/pkgconfig
-                       AC_MSG_CHECKING(done)
-                       break
-               fi
-       done
        ;;
 (*)
        ;;
 esac
 
-if test "x$PKG_CONFIG_LIBDIR" != xno ; then
-       AC_MSG_RESULT($PKG_CONFIG_LIBDIR)
+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
 
 AC_SUBST(PKG_CONFIG_LIBDIR)
@@ -4781,7 +4953,7 @@ AC_ARG_WITH(system-type,
 ])
 ])dnl
 dnl ---------------------------------------------------------------------------
-dnl CF_XOPEN_SOURCE version: 57 updated: 2021/01/01 16:53:59
+dnl CF_XOPEN_SOURCE version: 59 updated: 2021/08/28 15:20:37
 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,
@@ -4846,7 +5018,15 @@ case "$host_os" in
 (netbsd*)
        cf_xopen_source="-D_NETBSD_SOURCE" # setting _XOPEN_SOURCE breaks IPv6 for lynx on NetBSD 1.6, breaks xterm, is not needed for ncursesw
        ;;
-(openbsd[[4-9]]*)
+(openbsd[[6-9]]*)
+       # OpenBSD 6.x has broken locale support, both compile-time and runtime.
+       # see https://www.mail-archive.com/bugs@openbsd.org/msg13200.html
+       # Abusing the conformance level is a workaround.
+       AC_MSG_WARN(this system does not provide usable locale support)
+       cf_xopen_source="-D_BSD_SOURCE"
+       cf_XOPEN_SOURCE=700
+       ;;
+(openbsd[[4-5]]*)
        # setting _XOPEN_SOURCE lower than 500 breaks g++ compile with wchar.h, needed for ncursesw
        cf_xopen_source="-D_BSD_SOURCE"
        cf_XOPEN_SOURCE=600
@@ -4878,7 +5058,7 @@ case "$host_os" in
 esac
 
 if test -n "$cf_xopen_source" ; then
-       CF_ADD_CFLAGS($cf_xopen_source,true)
+       CF_APPEND_CFLAGS($cf_xopen_source,true)
 fi
 
 dnl In anything but the default case, we may have system-specific setting