]> ncurses.scripts.mit.edu Git - ncurses.git/blobdiff - Ada95/aclocal.m4
ncurses 6.3 - patch 20220129
[ncurses.git] / Ada95 / aclocal.m4
index 022776545aced3b956746df9f75f96f2876aa834..d81405d440917a88f991531b3936bf734c8791fd 100644 (file)
@@ -1,5 +1,5 @@
 dnl***************************************************************************
-dnl Copyright 2018-2020,2021 Thomas E. Dickey                                *
+dnl Copyright 2018-2021,2022 Thomas E. Dickey                                *
 dnl Copyright 2010-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
 dnl
-dnl $Id: aclocal.m4,v 1.188 2021/10/30 20:49:04 tom Exp $
+dnl $Id: aclocal.m4,v 1.193 2022/01/29 22:06:07 tom Exp $
 dnl Macros used in NCURSES Ada95 auto-configuration script.
 dnl
 dnl These macros are maintained separately from NCURSES.  The copyright on
@@ -1329,7 +1329,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
@@ -1341,11 +1341,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)
                                ;;
@@ -1354,9 +1356,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
@@ -4802,7 +4808,7 @@ eval $3="$withval"
 AC_SUBST($3)dnl
 ])dnl
 dnl ---------------------------------------------------------------------------
-dnl CF_WITH_PKG_CONFIG_LIBDIR version: 16 updated: 2021/10/26 16:50:11
+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
@@ -4825,29 +4831,48 @@ 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
+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=
+       ;;
 (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
        then
                # works for pkg-config since version 0.24 (2009)
-               cf_pkg_program=`echo "$PKG_CONFIG" | sed -e 's,^.*/,,'`
-               cf_search_path=`"$PKG_CONFIG" --variable=pc_path "$cf_pkg_program" 2>/dev/null | tr : ' '`
-
                # works for pkgconf since version 0.8.3 (2012)
-               test -z "$cf_search_path" && \
-               cf_search_path=`pkgconf --variable=pc_path pkgconf 2>/dev/null | tr : ' '`
+               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" && \
@@ -4862,54 +4887,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)