From b6f167d3194144f474f4e56ccb6591d80b029e99 Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Sat, 23 Mar 2019 21:24:50 +0100 Subject: [PATCH] Clarify that cross-compilation guesses are guesses. * m4/chown.m4 (gl_FUNC_CHOWN_FOLLOWS_SYMLINK): When cross-compiling, add prefix 'guessing ' to gl_cv_func_chown_follows_symlink. * m4/fchownat.m4 (gl_FUNC_FCHOWNAT_DEREF_BUG): When cross-compiling, add prefix 'guessing ' to gl_cv_func_fchownat_nofollow_works. * m4/getcwd-abort-bug.m4 (gl_FUNC_GETCWD_ABORT_BUG): When cross-compiling, add prefix 'guessing ' to gl_cv_func_getcwd_abort_bug. * m4/glob.m4 (gl_GLOB): When cross-compiling, add prefix 'guessing ' to gl_cv_glob_lists_symlinks. * m4/malloc.m4 (_AC_FUNC_MALLOC_IF): When cross-compiling, add prefix 'guessing ' to ac_cv_func_malloc_0_nonnull. * m4/realloc.m4 (_AC_FUNC_REALLOC_IF): When cross-compiling, add prefix 'guessing ' to ac_cv_func_realloc_0_nonnull. * m4/poll.m4 (gl_FUNC_POLL): When cross-compiling, add prefix 'guessing ' to gl_cv_func_poll. * m4/iconv_open-utf.m4 (gl_FUNC_ICONV_OPEN_UTF_SUPPORT): When cross- compiling, add prefix 'guessing ' to gl_cv_func_iconv_supports_utf. * m4/iconv_open.m4 (gl_FUNC_ICONV_OPEN): Update accordingly. --- ChangeLog | 21 +++++++++++++++++++++ m4/chown.m4 | 15 +++++++++------ m4/fchownat.m4 | 6 +++--- m4/getcwd-abort-bug.m4 | 16 ++++++++++++---- m4/glob.m4 | 11 ++++++----- m4/iconv_open-utf.m4 | 9 +++++---- m4/iconv_open.m4 | 19 +++++++++++-------- m4/malloc.m4 | 15 +++++++++++---- m4/poll.m4 | 23 +++++++++++++---------- m4/realloc.m4 | 15 +++++++++++---- 10 files changed, 102 insertions(+), 48 deletions(-) diff --git a/ChangeLog b/ChangeLog index d66415458c..b6524815fc 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,24 @@ +2019-03-23 Bruno Haible + + Clarify that cross-compilation guesses are guesses. + * m4/chown.m4 (gl_FUNC_CHOWN_FOLLOWS_SYMLINK): When cross-compiling, add + prefix 'guessing ' to gl_cv_func_chown_follows_symlink. + * m4/fchownat.m4 (gl_FUNC_FCHOWNAT_DEREF_BUG): When cross-compiling, add + prefix 'guessing ' to gl_cv_func_fchownat_nofollow_works. + * m4/getcwd-abort-bug.m4 (gl_FUNC_GETCWD_ABORT_BUG): When + cross-compiling, add prefix 'guessing ' to gl_cv_func_getcwd_abort_bug. + * m4/glob.m4 (gl_GLOB): When cross-compiling, add prefix 'guessing ' to + gl_cv_glob_lists_symlinks. + * m4/malloc.m4 (_AC_FUNC_MALLOC_IF): When cross-compiling, add prefix + 'guessing ' to ac_cv_func_malloc_0_nonnull. + * m4/realloc.m4 (_AC_FUNC_REALLOC_IF): When cross-compiling, add prefix + 'guessing ' to ac_cv_func_realloc_0_nonnull. + * m4/poll.m4 (gl_FUNC_POLL): When cross-compiling, add prefix + 'guessing ' to gl_cv_func_poll. + * m4/iconv_open-utf.m4 (gl_FUNC_ICONV_OPEN_UTF_SUPPORT): When cross- + compiling, add prefix 'guessing ' to gl_cv_func_iconv_supports_utf. + * m4/iconv_open.m4 (gl_FUNC_ICONV_OPEN): Update accordingly. + 2019-03-23 Bruno Haible strtold: Fix typo. diff --git a/m4/chown.m4 b/m4/chown.m4 index d92fd1c195..ecfc0c0d7a 100644 --- a/m4/chown.m4 +++ b/m4/chown.m4 @@ -1,4 +1,4 @@ -# serial 30 +# serial 31 # Determine whether we need the chown wrapper. dnl Copyright (C) 1997-2001, 2003-2005, 2007, 2009-2019 Free Software @@ -196,13 +196,16 @@ AC_DEFUN_ONCE([gl_FUNC_CHOWN_FOLLOWS_SYMLINK], ]])], [gl_cv_func_chown_follows_symlink=yes], [gl_cv_func_chown_follows_symlink=no], - [gl_cv_func_chown_follows_symlink=yes] + [gl_cv_func_chown_follows_symlink="guessing yes"] ) ] ) - if test $gl_cv_func_chown_follows_symlink = no; then - AC_DEFINE([CHOWN_MODIFIES_SYMLINK], [1], - [Define if chown modifies symlinks.]) - fi + case "$gl_cv_func_chown_follows_symlink" in + *yes) ;; + *) + AC_DEFINE([CHOWN_MODIFIES_SYMLINK], [1], + [Define if chown modifies symlinks.]) + ;; + esac ]) diff --git a/m4/fchownat.m4 b/m4/fchownat.m4 index 023e3cb41d..042ef17ff9 100644 --- a/m4/fchownat.m4 +++ b/m4/fchownat.m4 @@ -1,4 +1,4 @@ -# fchownat.m4 serial 3 +# fchownat.m4 serial 4 dnl Copyright (C) 2004-2019 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -71,9 +71,9 @@ main () ]])], [gl_cv_func_fchownat_nofollow_works=yes], [gl_cv_func_fchownat_nofollow_works=no], - [gl_cv_func_fchownat_nofollow_works=no]) + [gl_cv_func_fchownat_nofollow_works="guessing no"]) ]) - AS_IF([test $gl_cv_func_fchownat_nofollow_works = no], [$1], [$2]) + AS_IF([test "$gl_cv_func_fchownat_nofollow_works" != yes], [$1], [$2]) ]) # gl_FUNC_FCHOWNAT_EMPTY_FILENAME_BUG([ACTION-IF-BUGGY[, ACTION-IF-NOT_BUGGY]]) diff --git a/m4/getcwd-abort-bug.m4 b/m4/getcwd-abort-bug.m4 index 7929b674c8..f0f24a5b9e 100644 --- a/m4/getcwd-abort-bug.m4 +++ b/m4/getcwd-abort-bug.m4 @@ -1,4 +1,4 @@ -# serial 9 +# serial 10 # Determine whether getcwd aborts when the length of the working directory # name is unusually large. Any length between 4k and 16k trigger the bug # when using glibc-2.4.90-9 or older. @@ -139,8 +139,16 @@ main () gl_cv_func_getcwd_abort_bug=yes else gl_cv_func_getcwd_abort_bug=no - fi], - [gl_cv_func_getcwd_abort_bug=yes]) + fi + ], + [gl_cv_func_getcwd_abort_bug="guessing yes"]) ]) - AS_IF([test $gl_cv_func_getcwd_abort_bug = yes], [$1], [$2]) + case "$gl_cv_func_getcwd_abort_bug" in + *yes) + $1 + ;; + *) + $2 + ;; + esac ]) diff --git a/m4/glob.m4 b/m4/glob.m4 index 93567af059..00b429722e 100644 --- a/m4/glob.m4 +++ b/m4/glob.m4 @@ -1,4 +1,4 @@ -# glob.m4 serial 21 +# glob.m4 serial 22 dnl Copyright (C) 2005-2007, 2009-2019 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -49,13 +49,14 @@ char a[_GNU_GLOB_INTERFACE_VERSION == 1 || _GNU_GLOB_INTERFACE_VERSION == 2 ? 1 ]])], [gl_cv_glob_lists_symlinks=yes], [gl_cv_glob_lists_symlinks=no], - [gl_cv_glob_lists_symlinks=no]) + [gl_cv_glob_lists_symlinks="guessing no"]) fi rm -f conf$$-globtest ]) - if test $gl_cv_glob_lists_symlinks = no; then - REPLACE_GLOB=1 - fi + case "$gl_cv_glob_lists_symlinks" in + *yes) ;; + *) REPLACE_GLOB=1 ;; + esac fi fi diff --git a/m4/iconv_open-utf.m4 b/m4/iconv_open-utf.m4 index b6547f7946..df171324a2 100644 --- a/m4/iconv_open-utf.m4 +++ b/m4/iconv_open-utf.m4 @@ -1,4 +1,4 @@ -# iconv_open-utf.m4 serial 1 +# iconv_open-utf.m4 serial 2 dnl Copyright (C) 2007-2019 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -214,13 +214,14 @@ int main () dnl We know that GNU libiconv, GNU libc, and Solaris >= 9 do. dnl OSF/1 5.1 has these encodings, but inserts a BOM in the "to" dnl direction. - gl_cv_func_iconv_supports_utf=no + gl_cv_func_iconv_supports_utf="guessing no" if test $gl_func_iconv_gnu = yes; then - gl_cv_func_iconv_supports_utf=yes + gl_cv_func_iconv_supports_utf="guessing yes" else changequote(,)dnl case "$host_os" in - solaris2.9 | solaris2.1[0-9]) gl_cv_func_iconv_supports_utf=yes ;; + solaris2.9 | solaris2.1[0-9]) + gl_cv_func_iconv_supports_utf="guessing yes" ;; esac changequote([,])dnl fi diff --git a/m4/iconv_open.m4 b/m4/iconv_open.m4 index 710a8ae886..bfcd3543a5 100644 --- a/m4/iconv_open.m4 +++ b/m4/iconv_open.m4 @@ -1,4 +1,4 @@ -# iconv_open.m4 serial 14 +# iconv_open.m4 serial 15 dnl Copyright (C) 2007-2019 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -38,13 +38,16 @@ AC_DEFUN([gl_FUNC_ICONV_OPEN], fi m4_ifdef([gl_FUNC_ICONV_OPEN_UTF_SUPPORT], [ gl_FUNC_ICONV_OPEN_UTF_SUPPORT - if test $gl_cv_func_iconv_supports_utf = no; then - REPLACE_ICONV_UTF=1 - AC_DEFINE([REPLACE_ICONV_UTF], [1], - [Define if the iconv() functions are enhanced to handle the UTF-{16,32}{BE,LE} encodings.]) - REPLACE_ICONV=1 - gl_REPLACE_ICONV_OPEN - fi + case "$gl_cv_func_iconv_supports_utf" in + *yes) ;; + *) + REPLACE_ICONV_UTF=1 + AC_DEFINE([REPLACE_ICONV_UTF], [1], + [Define if the iconv() functions are enhanced to handle the UTF-{16,32}{BE,LE} encodings.]) + REPLACE_ICONV=1 + gl_REPLACE_ICONV_OPEN + ;; + esac ]) fi ]) diff --git a/m4/malloc.m4 b/m4/malloc.m4 index f78a484f1f..b9b8d4b46e 100644 --- a/m4/malloc.m4 +++ b/m4/malloc.m4 @@ -1,4 +1,4 @@ -# malloc.m4 serial 17 +# malloc.m4 serial 18 dnl Copyright (C) 2007, 2009-2019 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -34,13 +34,20 @@ AC_DEFUN([_AC_FUNC_MALLOC_IF], # Guess yes on platforms where we know the result. *-gnu* | gnu* | freebsd* | netbsd* | openbsd* \ | hpux* | solaris* | cygwin* | mingw*) - ac_cv_func_malloc_0_nonnull=yes ;; + ac_cv_func_malloc_0_nonnull="guessing yes" ;; # If we don't know, assume the worst. - *) ac_cv_func_malloc_0_nonnull=no ;; + *) ac_cv_func_malloc_0_nonnull="guessing no" ;; esac ]) ]) - AS_IF([test $ac_cv_func_malloc_0_nonnull = yes], [$1], [$2]) + case "$ac_cv_func_malloc_0_nonnull" in + *yes) + $1 + ;; + *) + $2 + ;; + esac ])# _AC_FUNC_MALLOC_IF ]) diff --git a/m4/poll.m4 b/m4/poll.m4 index 1fb6ef0025..354d1666bc 100644 --- a/m4/poll.m4 +++ b/m4/poll.m4 @@ -1,4 +1,4 @@ -# poll.m4 serial 18 +# poll.m4 serial 19 dnl Copyright (c) 2003, 2005-2007, 2009-2019 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -54,16 +54,19 @@ AC_DEFUN([gl_FUNC_POLL], #if (defined(__APPLE__) && defined(__MACH__)) || defined(_AIX) This is MacOSX or AIX #endif -], [gl_cv_func_poll=no], [gl_cv_func_poll=yes])])]) - fi - if test $gl_cv_func_poll != yes; then - AC_CHECK_FUNC([poll], [ac_cv_func_poll=yes], [ac_cv_func_poll=no]) - if test $ac_cv_func_poll = no; then - HAVE_POLL=0 - else - REPLACE_POLL=1 - fi +], [gl_cv_func_poll="guessing no"], [gl_cv_func_poll="guessing yes"])])]) fi + case "$gl_cv_func_poll" in + *yes) ;; + *) + AC_CHECK_FUNC([poll], [ac_cv_func_poll=yes], [ac_cv_func_poll=no]) + if test $ac_cv_func_poll = no; then + HAVE_POLL=0 + else + REPLACE_POLL=1 + fi + ;; + esac if test $HAVE_POLL = 0 || test $REPLACE_POLL = 1; then : else diff --git a/m4/realloc.m4 b/m4/realloc.m4 index 1281a3539f..f9f15adedb 100644 --- a/m4/realloc.m4 +++ b/m4/realloc.m4 @@ -1,4 +1,4 @@ -# realloc.m4 serial 15 +# realloc.m4 serial 16 dnl Copyright (C) 2007, 2009-2019 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -34,13 +34,20 @@ AC_DEFUN([_AC_FUNC_REALLOC_IF], # Guess yes on platforms where we know the result. *-gnu* | gnu* | freebsd* | netbsd* | openbsd* \ | hpux* | solaris* | cygwin* | mingw*) - ac_cv_func_realloc_0_nonnull=yes ;; + ac_cv_func_realloc_0_nonnull="guessing yes" ;; # If we don't know, assume the worst. - *) ac_cv_func_realloc_0_nonnull=no ;; + *) ac_cv_func_realloc_0_nonnull="guessing no" ;; esac ]) ]) - AS_IF([test $ac_cv_func_realloc_0_nonnull = yes], [$1], [$2]) + case "$ac_cv_func_realloc_0_nonnull" in + *yes) + $1 + ;; + *) + $2 + ;; + esac ])# AC_FUNC_REALLOC ]) -- 2.39.5