diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2012-05-26 16:14:36 -0700 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2012-05-26 16:14:36 -0700 |
commit | caf8a9b2b301aba06735d403317b75b41df59bfe (patch) | |
tree | bfafb3cc0cf8a2f2394b4ed721e7c3d4891b78ab /m4/lstat.m4 | |
parent | fe453991eafc32a890297a2003ac532b9f579f92 (diff) | |
download | emacs-caf8a9b2b301aba06735d403317b75b41df59bfe.tar.gz |
Merge from gnulib.
Fixes: debbugs:11527
Diffstat (limited to 'm4/lstat.m4')
-rw-r--r-- | m4/lstat.m4 | 35 |
1 files changed, 21 insertions, 14 deletions
diff --git a/m4/lstat.m4 b/m4/lstat.m4 index fe161d40101..b7335bda1b2 100644 --- a/m4/lstat.m4 +++ b/m4/lstat.m4 @@ -1,6 +1,6 @@ -# serial 23 +# serial 25 -# Copyright (C) 1997-2001, 2003-2011 Free Software Foundation, Inc. +# Copyright (C) 1997-2001, 2003-2012 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -16,9 +16,11 @@ AC_DEFUN([gl_FUNC_LSTAT], AC_CHECK_FUNCS_ONCE([lstat]) if test $ac_cv_func_lstat = yes; then AC_REQUIRE([gl_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK]) - if test $gl_cv_func_lstat_dereferences_slashed_symlink = no; then - REPLACE_LSTAT=1 - fi + case "$gl_cv_func_lstat_dereferences_slashed_symlink" in + *no) + REPLACE_LSTAT=1 + ;; + esac else HAVE_LSTAT=0 fi @@ -51,20 +53,25 @@ AC_DEFUN([gl_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK], ]])], [gl_cv_func_lstat_dereferences_slashed_symlink=yes], [gl_cv_func_lstat_dereferences_slashed_symlink=no], - [# When cross-compiling, be pessimistic so we will end up using the - # replacement version of lstat that checks for trailing slashes and - # calls lstat a second time when necessary. - gl_cv_func_lstat_dereferences_slashed_symlink=no + [case "$host_os" in + # Guess yes on glibc systems. + *-gnu*) gl_cv_func_lstat_dereferences_slashed_symlink="guessing yes" ;; + # If we don't know, assume the worst. + *) gl_cv_func_lstat_dereferences_slashed_symlink="guessing no" ;; + esac ]) else # If the 'ln -s' command failed, then we probably don't even # have an lstat function. - gl_cv_func_lstat_dereferences_slashed_symlink=no + gl_cv_func_lstat_dereferences_slashed_symlink="guessing no" fi rm -f conftest.sym conftest.file ]) - test $gl_cv_func_lstat_dereferences_slashed_symlink = yes && - AC_DEFINE_UNQUOTED([LSTAT_FOLLOWS_SLASHED_SYMLINK], [1], - [Define to 1 if `lstat' dereferences a symlink specified - with a trailing slash.]) + case "$gl_cv_func_lstat_dereferences_slashed_symlink" in + *yes) + AC_DEFINE_UNQUOTED([LSTAT_FOLLOWS_SLASHED_SYMLINK], [1], + [Define to 1 if 'lstat' dereferences a symlink specified + with a trailing slash.]) + ;; + esac ]) |