> 1) Cross-compilation guesses, that is, the third branch of AC_RUN_IFELSE, > should better be marked as "guessing no", rather than "no", for clarity.
This fixes most occurrences. Exempt are those that come from Autoconf (to be addressed later). Here's the proposed patch. Objections? 2012-05-01 Bruno Haible <br...@clisp.org> Say "guessing yes" or "guessing no" when cross-compiling. * m4/dup2.m4 (gl_FUNC_DUP2): When cross-compiling, set gl_cv_func_dup2_works to "guessing yes" or "guessing no". * m4/getdelim.m4 (gl_FUNC_GETDELIM): When cross-compiling, set gl_cv_func_working_getdelim to "guessing yes" or "guessing no". * m4/getline.m4 (gl_FUNC_GETLINE): When cross-compiling, set am_cv_func_working_getline to "guessing yes" or "guessing no". * m4/memmem.m4 (gl_FUNC_MEMMEM_SIMPLE): When cross-compiling, set gl_cv_func_memmem_works_always to "guessing yes" or "guessing no". (gl_FUNC_MEMMEM): When cross-compiling, set gl_cv_func_memmem_works_fast to "guessing yes" or "guessing no". * m4/stpncpy.m4 (gl_FUNC_STPNCPY): When cross-compiling, set gl_cv_func_stpncpy to "guessing yes" or "guessing no". * m4/strcasestr.m4 (gl_FUNC_STRCASESTR_SIMPLE): When cross-compiling, set gl_cv_func_strcasestr_works_always to "guessing yes" or "guessing no". (gl_FUNC_STRCASESTR): When cross-compiling, set gl_cv_func_strcasestr_linear to "guessing yes" or "guessing no". * m4/strstr.m4 (gl_FUNC_STRSTR_SIMPLE): When cross-compiling, set gl_cv_func_strstr_works_always to "guessing yes" or "guessing no". (gl_FUNC_STRSTR): When cross-compiling, set gl_cv_func_strstr_linear to "guessing yes" or "guessing no". * m4/strtod.m4 (gl_FUNC_STRTOD): When cross-compiling, set gl_cv_func_strtod_works to "guessing yes" or "guessing no". * m4/wctype_h.m4 (gl_WCTYPE_H): When cross-compiling, set gl_cv_func_iswcntrl_works to "guessing yes" or "guessing no". --- m4/dup2.m4.orig Tue May 1 21:53:12 2012 +++ m4/dup2.m4 Tue May 1 21:36:49 2012 @@ -1,4 +1,4 @@ -#serial 17 +#serial 18 dnl Copyright (C) 2002, 2005, 2007, 2009-2012 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -45,22 +45,25 @@ [gl_cv_func_dup2_works=yes], [gl_cv_func_dup2_works=no], [case "$host_os" in mingw*) # on this platform, dup2 always returns 0 for success - gl_cv_func_dup2_works=no;; + gl_cv_func_dup2_works="guessing no" ;; cygwin*) # on cygwin 1.5.x, dup2(1,1) returns 0 - gl_cv_func_dup2_works=no;; + gl_cv_func_dup2_works="guessing no" ;; linux*) # On linux between 2008-07-27 and 2009-05-11, dup2 of a # closed fd may yield -EBADF instead of -1 / errno=EBADF. - gl_cv_func_dup2_works=no;; + gl_cv_func_dup2_works="guessing no" ;; freebsd*) # on FreeBSD 6.1, dup2(1,1000000) gives EMFILE, not EBADF. - gl_cv_func_dup2_works=no;; + gl_cv_func_dup2_works="guessing no" ;; haiku*) # on Haiku alpha 2, dup2(1, 1) resets FD_CLOEXEC. - gl_cv_func_dup2_works=no;; - *) gl_cv_func_dup2_works=yes;; + gl_cv_func_dup2_works="guessing no" ;; + *) gl_cv_func_dup2_works="guessing yes" ;; esac]) ]) - if test "$gl_cv_func_dup2_works" = no; then - REPLACE_DUP2=1 - fi + case "$gl_cv_func_dup2_works" in + *yes) ;; + *) + REPLACE_DUP2=1 + ;; + esac fi dnl Replace dup2() for supporting the gnulib-defined fchdir() function, dnl to keep fchdir's bookkeeping up-to-date. --- m4/getdelim.m4.orig Tue May 1 21:53:12 2012 +++ m4/getdelim.m4 Tue May 1 20:32:40 2012 @@ -1,4 +1,4 @@ -# getdelim.m4 serial 9 +# getdelim.m4 serial 10 dnl Copyright (C) 2005-2007, 2009-2012 Free Software Foundation, Inc. dnl @@ -63,12 +63,14 @@ #endif #endif ], - [gl_cv_func_working_getdelim=yes], - [gl_cv_func_working_getdelim=no])] + [gl_cv_func_working_getdelim="guessing yes"], + [gl_cv_func_working_getdelim="guessing no"])] )]) - if test $gl_cv_func_working_getdelim = no; then - REPLACE_GETDELIM=1 - fi + case "$gl_cv_func_working_getdelim" in + *no) + REPLACE_GETDELIM=1 + ;; + esac else HAVE_GETDELIM=0 fi --- m4/getline.m4.orig Tue May 1 21:53:12 2012 +++ m4/getline.m4 Tue May 1 20:33:38 2012 @@ -1,4 +1,4 @@ -# getline.m4 serial 25 +# getline.m4 serial 26 dnl Copyright (C) 1998-2003, 2005-2007, 2009-2012 Free Software Foundation, dnl Inc. @@ -70,8 +70,8 @@ #endif #endif ], - [am_cv_func_working_getline=yes], - [am_cv_func_working_getline=no])] + [am_cv_func_working_getline="guessing yes"], + [am_cv_func_working_getline="guessing no"])] )]) fi @@ -79,12 +79,14 @@ HAVE_DECL_GETLINE=0 fi - if test $am_cv_func_working_getline = no; then - dnl Set REPLACE_GETLINE always: Even if we have not found the broken - dnl getline function among $LIBS, it may exist in libinet and the - dnl executable may be linked with -linet. - REPLACE_GETLINE=1 - fi + case "$am_cv_func_working_getline" in + *no) + dnl Set REPLACE_GETLINE always: Even if we have not found the broken + dnl getline function among $LIBS, it may exist in libinet and the + dnl executable may be linked with -linet. + REPLACE_GETLINE=1 + ;; + esac ]) # Prerequisites of lib/getline.c. --- m4/memmem.m4.orig Tue May 1 21:53:12 2012 +++ m4/memmem.m4 Tue May 1 19:37:32 2012 @@ -1,4 +1,4 @@ -# memmem.m4 serial 23 +# memmem.m4 serial 24 dnl Copyright (C) 2002-2004, 2007-2012 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -67,13 +67,16 @@ Lucky user #endif ], - [gl_cv_func_memmem_works_always=yes], + [gl_cv_func_memmem_works_always="guessing yes"], [gl_cv_func_memmem_works_always="guessing no"]) ]) ]) - if test "$gl_cv_func_memmem_works_always" != yes; then - REPLACE_MEMMEM=1 - fi + case "$gl_cv_func_memmem_works_always" in + *yes) ;; + *) + REPLACE_MEMMEM=1 + ;; + esac fi gl_PREREQ_MEMMEM ]) # gl_FUNC_MEMMEM_SIMPLE @@ -131,13 +134,16 @@ #endif #endif ], - [gl_cv_func_memmem_works_fast=yes], + [gl_cv_func_memmem_works_fast="guessing yes"], [gl_cv_func_memmem_works_fast="guessing no"]) ]) ]) - if test "$gl_cv_func_memmem_works_fast" != yes; then - REPLACE_MEMMEM=1 - fi + case "$gl_cv_func_memmem_works_fast" in + *yes) ;; + *) + REPLACE_MEMMEM=1 + ;; + esac fi ]) # gl_FUNC_MEMMEM --- m4/stpncpy.m4.orig Tue May 1 21:53:12 2012 +++ m4/stpncpy.m4 Tue May 1 20:35:04 2012 @@ -1,4 +1,4 @@ -# stpncpy.m4 serial 15 +# stpncpy.m4 serial 16 dnl Copyright (C) 2002-2003, 2005-2007, 2009-2012 Free Software Foundation, dnl Inc. dnl This file is free software; the Free Software Foundation @@ -74,15 +74,18 @@ #ifdef __GNU_LIBRARY__ Thanks for using GNU #endif -], [gl_cv_func_stpncpy=yes], [gl_cv_func_stpncpy=no]) +], [gl_cv_func_stpncpy="guessing yes"], [gl_cv_func_stpncpy="guessing no"]) ]) ]) - if test $gl_cv_func_stpncpy = yes; then - AC_DEFINE([HAVE_STPNCPY], [1], - [Define if you have the stpncpy() function and it works.]) - else - REPLACE_STPNCPY=1 - fi + case "$gl_cv_func_stpncpy" in + *yes) + AC_DEFINE([HAVE_STPNCPY], [1], + [Define if you have the stpncpy() function and it works.]) + ;; + *) + REPLACE_STPNCPY=1 + ;; + esac else HAVE_STPNCPY=0 fi --- m4/strcasestr.m4.orig Tue May 1 21:53:13 2012 +++ m4/strcasestr.m4 Tue May 1 20:36:19 2012 @@ -1,4 +1,4 @@ -# strcasestr.m4 serial 20 +# strcasestr.m4 serial 21 dnl Copyright (C) 2005, 2007-2012 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,13 +54,16 @@ Lucky user #endif ], - [gl_cv_func_strcasestr_works_always=yes], + [gl_cv_func_strcasestr_works_always="guessing yes"], [gl_cv_func_strcasestr_works_always="guessing no"]) ]) ]) - if test "$gl_cv_func_strcasestr_works_always" != yes; then - REPLACE_STRCASESTR=1 - fi + case "$gl_cv_func_strcasestr_works_always" in + *yes) ;; + *) + REPLACE_STRCASESTR=1 + ;; + esac fi fi ]) # gl_FUNC_STRCASESTR_SIMPLE @@ -120,13 +123,16 @@ #endif #endif ], - [gl_cv_func_strcasestr_linear=yes], + [gl_cv_func_strcasestr_linear="guessing yes"], [gl_cv_func_strcasestr_linear="guessing no"]) ]) ]) - if test "$gl_cv_func_strcasestr_linear" != yes; then - REPLACE_STRCASESTR=1 - fi + case "$gl_cv_func_strcasestr_linear" in + *yes) ;; + *) + REPLACE_STRCASESTR=1 + ;; + esac fi ]) # gl_FUNC_STRCASESTR --- m4/strstr.m4.orig Tue May 1 21:53:13 2012 +++ m4/strstr.m4 Tue May 1 20:37:36 2012 @@ -1,4 +1,4 @@ -# strstr.m4 serial 15 +# strstr.m4 serial 16 dnl Copyright (C) 2008-2012 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -46,13 +46,16 @@ Lucky user #endif ], - [gl_cv_func_strstr_works_always=yes], + [gl_cv_func_strstr_works_always="guessing yes"], [gl_cv_func_strstr_works_always="guessing no"]) ]) ]) - if test "$gl_cv_func_strstr_works_always" != yes; then - REPLACE_STRSTR=1 - fi + case "$gl_cv_func_strstr_works_always" in + *yes) ;; + *) + REPLACE_STRSTR=1 + ;; + esac fi ]) # gl_FUNC_STRSTR_SIMPLE @@ -113,12 +116,15 @@ #endif #endif ], - [gl_cv_func_strstr_linear=yes], + [gl_cv_func_strstr_linear="guessing yes"], [gl_cv_func_strstr_linear="guessing no"]) ]) ]) - if test "$gl_cv_func_strstr_linear" != yes; then - REPLACE_STRSTR=1 - fi + case "$gl_cv_func_strstr_linear" in + *yes) ;; + *) + REPLACE_STRSTR=1 + ;; + esac fi ]) # gl_FUNC_STRSTR --- m4/strtod.m4.orig Tue May 1 21:53:13 2012 +++ m4/strtod.m4 Tue May 1 20:38:13 2012 @@ -1,4 +1,4 @@ -# strtod.m4 serial 21 +# strtod.m4 serial 22 dnl Copyright (C) 2002-2003, 2006-2012 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -112,11 +112,14 @@ #endif #endif ], - [gl_cv_func_strtod_works=yes], + [gl_cv_func_strtod_works="guessing yes"], [gl_cv_func_strtod_works="guessing no"])])]) - if test "$gl_cv_func_strtod_works" != yes; then - REPLACE_STRTOD=1 - fi + case "$gl_cv_func_strtod_works" in + *yes) ;; + *) + REPLACE_STRTOD=1 + ;; + esac fi ]) --- m4/wctype_h.m4.orig Tue May 1 21:53:13 2012 +++ m4/wctype_h.m4 Tue May 1 20:40:05 2012 @@ -1,4 +1,4 @@ -# wctype_h.m4 serial 16 +# wctype_h.m4 serial 17 dnl A placeholder for ISO C99 <wctype.h>, for platforms that lack it. @@ -57,7 +57,8 @@ #if __GNU_LIBRARY__ == 1 Linux libc5 i18n is broken. #endif]], [])], - [gl_cv_func_iswcntrl_works=yes], [gl_cv_func_iswcntrl_works=no]) + [gl_cv_func_iswcntrl_works="guessing yes"], + [gl_cv_func_iswcntrl_works="guessing no"]) ]) ]) fi @@ -67,11 +68,10 @@ fi AC_SUBST([HAVE_WCTYPE_H]) - if test "$gl_cv_func_iswcntrl_works" = no; then - REPLACE_ISWCNTRL=1 - else - REPLACE_ISWCNTRL=0 - fi + case "$gl_cv_func_iswcntrl_works" in + *yes) REPLACE_ISWCNTRL=0 ;; + *) REPLACE_ISWCNTRL=1 ;; + esac AC_SUBST([REPLACE_ISWCNTRL]) if test $HAVE_ISWCNTRL = 0 || test $REPLACE_ISWCNTRL = 1; then