diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2011-11-09 16:11:40 -0800 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2011-11-09 16:12:07 -0800 |
commit | c098d6b8a714de15c81ee72f86f9b7c268554682 (patch) | |
tree | 163f3134fc572e029a1d66fc665030273fde84f0 /m4 | |
parent | 8a3d36c875a56836d888d38ef5025486e61b29ab (diff) | |
download | gnulib-c098d6b8a714de15c81ee72f86f9b7c268554682.tar.gz |
fstatat: work with cross-compilation
Problem reported by Ludovic Courtès in
<http://lists.gnu.org/archive/html/bug-gnulib/2011-11/msg00136.html>.
* m4/fstatat.m4 (gl_FUNC_FSTATAT): When cross-compiling, report
"cross-compiling" and assume the bug is present. Replace
FSTATAT_ZERO_FLAG_BROKEN with HAVE_WORKING_FSTATAT_ZERO_FLAG with
an inverted sense, to be more conservative about our assumptions.
* lib/fstatat.c (rpl_fstatat): Adjust to renamed macro.
Diffstat (limited to 'm4')
-rw-r--r-- | m4/fstatat.m4 | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/m4/fstatat.m4 b/m4/fstatat.m4 index 58025372e0..df539eb8ef 100644 --- a/m4/fstatat.m4 +++ b/m4/fstatat.m4 @@ -1,4 +1,4 @@ -# fstatat.m4 serial 1 +# fstatat.m4 serial 2 dnl Copyright (C) 2004-2011 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -22,8 +22,7 @@ AC_DEFUN([gl_FUNC_FSTATAT], dnl <http://lists.gnu.org/archive/html/bug-tar/2011-09/msg00015.html>. AC_CACHE_CHECK([whether fstatat (..., 0) works], [gl_cv_func_fstatat_zero_flag], - [gl_cv_func_fstatat_zero_flag=no - AC_RUN_IFELSE( + [AC_RUN_IFELSE( [AC_LANG_SOURCE( [[ #include <fcntl.h> @@ -35,15 +34,17 @@ AC_DEFUN([gl_FUNC_FSTATAT], return fstatat (AT_FDCWD, ".", &a, 0) != 0; } ]])], - [gl_cv_func_fstatat_zero_flag=yes])]) + [gl_cv_func_fstatat_zero_flag=yes], + [gl_cv_func_fstatat_zero_flag=no], + [gl_cv_func_fstatat_zero_flag=cross-compiling])]) case $gl_cv_func_fstatat_zero_flag+$gl_cv_func_lstat_dereferences_slashed_symlink in yes+yes) ;; *) REPLACE_FSTATAT=1 - if test $gl_cv_func_fstatat_zero_flag != yes; then - AC_DEFINE([FSTATAT_ZERO_FLAG_BROKEN], [1], - [Define to 1 if fstatat (..., 0) does not work, - as in AIX 7.1.]) + if test $gl_cv_func_fstatat_zero_flag = yes; then + AC_DEFINE([HAVE_WORKING_FSTATAT_ZERO_FLAG], [1], + [Define to 1 if fstatat (..., 0) works. + For example, it does not work in AIX 7.1.]) fi ;; esac |