Mercurial > hg > octave-kai > gnulib-hg
changeset 15027:475b62531f9b
lstat, openat: Respect rules for use of AC_LIBOBJ.
* m4/lstat.m4 (gl_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK): Renamed from
AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK. Set variable
gl_cv_func_lstat_dereferences_slashed_symlink. Don't invoke AC_LIBOBJ.
(gl_PREREQ_LSTAT): New macro, extracted from gl_FUNC_LSTAT.
(gl_FUNC_LSTAT): Update. Remove gl_PREREQ_LSTAT code.
* modules/lstat (configure.ac): Invoke AC_LIBOBJ and gl_PREREQ_LSTAT
here.
* m4/openat.m4 (gl_FUNC_OPENAT): Update.
author | Bruno Haible <bruno@clisp.org> |
---|---|
date | Sat, 21 May 2011 14:02:06 +0200 |
parents | a5ed10e5034d |
children | 34c3292ae98c |
files | ChangeLog m4/lstat.m4 m4/openat.m4 modules/lstat |
diffstat | 4 files changed, 37 insertions(+), 20 deletions(-) [+] |
line wrap: on
line diff
--- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,15 @@ +2011-05-21 Bruno Haible <bruno@clisp.org> + + lstat, openat: Respect rules for use of AC_LIBOBJ. + * m4/lstat.m4 (gl_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK): Renamed from + AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK. Set variable + gl_cv_func_lstat_dereferences_slashed_symlink. Don't invoke AC_LIBOBJ. + (gl_PREREQ_LSTAT): New macro, extracted from gl_FUNC_LSTAT. + (gl_FUNC_LSTAT): Update. Remove gl_PREREQ_LSTAT code. + * modules/lstat (configure.ac): Invoke AC_LIBOBJ and gl_PREREQ_LSTAT + here. + * m4/openat.m4 (gl_FUNC_OPENAT): Update. + 2011-05-21 Bruno Haible <bruno@clisp.org> lseek: Move AC_LIBOBJ invocations to module description.
--- a/m4/lstat.m4 +++ b/m4/lstat.m4 @@ -1,4 +1,4 @@ -# serial 21 +# serial 22 # Copyright (C) 1997-2001, 2003-2011 Free Software Foundation, Inc. # @@ -16,23 +16,27 @@ AC_CHECK_FUNCS_ONCE([lstat]) if test $ac_cv_func_lstat = yes; then AC_REQUIRE([AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK]) - if test $ac_cv_func_lstat_dereferences_slashed_symlink = no; then - dnl Note: AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK does AC_LIBOBJ([lstat]). + if test $gl_cv_func_lstat_dereferences_slashed_symlink = no; then REPLACE_LSTAT=1 fi - # Prerequisites of lib/lstat.c. - AC_REQUIRE([AC_C_INLINE]) else HAVE_LSTAT=0 fi ]) -# Redefine AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK, because it is no longer -# maintained in Autoconf. -AC_DEFUN([AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK], +# Prerequisites of lib/lstat.c. +AC_DEFUN([gl_PREREQ_LSTAT], [ + AC_REQUIRE([AC_C_INLINE]) + : +]) + +AC_DEFUN([gl_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK], +[ + dnl We don't use AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK any more, because it + dnl is no longer maintained in Autoconf and because it invokes AC_LIBOBJ. AC_CACHE_CHECK([whether lstat correctly handles trailing slash], - [ac_cv_func_lstat_dereferences_slashed_symlink], + [gl_cv_func_lstat_dereferences_slashed_symlink], [rm -f conftest.sym conftest.file echo >conftest.file if test "$as_ln_s" = "ln -s" && ln -s conftest.file conftest.sym; then @@ -45,25 +49,22 @@ have to compile and use the lstat wrapper. */ return lstat ("conftest.sym/", &sbuf) == 0; ]])], - [ac_cv_func_lstat_dereferences_slashed_symlink=yes], - [ac_cv_func_lstat_dereferences_slashed_symlink=no], + [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. - ac_cv_func_lstat_dereferences_slashed_symlink=no + gl_cv_func_lstat_dereferences_slashed_symlink=no ]) else # If the 'ln -s' command failed, then we probably don't even # have an lstat function. - ac_cv_func_lstat_dereferences_slashed_symlink=no + gl_cv_func_lstat_dereferences_slashed_symlink=no fi rm -f conftest.sym conftest.file ]) - test $ac_cv_func_lstat_dereferences_slashed_symlink = yes && + 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.]) - if test "x$ac_cv_func_lstat_dereferences_slashed_symlink" = xno; then - AC_LIBOBJ([lstat]) - fi ])
--- a/m4/openat.m4 +++ b/m4/openat.m4 @@ -1,4 +1,4 @@ -# serial 31 +# serial 32 # See if we need to use our replacement for Solaris' openat et al functions. dnl Copyright (C) 2004-2011 Free Software Foundation, Inc. @@ -26,9 +26,9 @@ AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS]) AC_CHECK_FUNCS_ONCE([lchmod]) AC_REPLACE_FUNCS([fchmodat fstatat mkdirat openat unlinkat]) - AC_REQUIRE([AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK]) + AC_REQUIRE([gl_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK]) AC_REQUIRE([gl_FUNC_UNLINK]) - case $ac_cv_func_openat+$ac_cv_func_lstat_dereferences_slashed_symlink in + case $ac_cv_func_openat+$gl_cv_func_lstat_dereferences_slashed_symlink in yes+yes) # GNU/Hurd has unlinkat, but it has the same bug as unlink. if test $REPLACE_UNLINK = 1; then