X-Git-Url: https://git.cworth.org/git?p=tar;a=blobdiff_plain;f=m4%2Fsys_stat_h.m4;h=20c82edf931d700ee16f6cca4b66ef74cb318be6;hp=1bc08a17261f8785e7352a9b1c1a91ce48e48cbb;hb=cf7169a2ede9bb08b71de68fe0c8bbecf827abe6;hpb=138fc7e67e3d9845cd7d81aad0e9c7724784f9b9 diff --git a/m4/sys_stat_h.m4 b/m4/sys_stat_h.m4 index 1bc08a1..20c82ed 100644 --- a/m4/sys_stat_h.m4 +++ b/m4/sys_stat_h.m4 @@ -1,5 +1,5 @@ -# sys_stat_h.m4 serial 6 -*- Autoconf -*- -dnl Copyright (C) 2006-2007 Free Software Foundation, Inc. +# sys_stat_h.m4 serial 10 -*- Autoconf -*- +dnl Copyright (C) 2006-2008 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -9,6 +9,8 @@ dnl Test whether contains lstat and mkdir or must be substituted. AC_DEFUN([gl_HEADER_SYS_STAT_H], [ + AC_REQUIRE([gl_SYS_STAT_H_DEFAULTS]) + dnl Check for lstat. Systems that lack it (mingw) also lack symlinks, so dnl stat is a good replacement. AC_CHECK_FUNCS_ONCE([lstat]) @@ -19,24 +21,7 @@ AC_DEFUN([gl_HEADER_SYS_STAT_H], fi AC_SUBST([HAVE_LSTAT]) - dnl Check for mkdir. Mingw has _mkdir(name) in the nonstandard - dnl instead. - AC_CHECK_DECLS([mkdir], - [], - [AC_CHECK_HEADERS([io.h])], - [#include ]) - if test $ac_cv_have_decl_mkdir = yes; then - HAVE_DECL_MKDIR=1 - else - HAVE_DECL_MKDIR=0 - fi - AC_SUBST([HAVE_DECL_MKDIR]) - if test "$ac_cv_header_io_h" = yes; then - HAVE_IO_H=1 - else - HAVE_IO_H=0 - fi - AC_SUBST([HAVE_IO_H]) + dnl For the mkdir substitute. AC_REQUIRE([AC_C_INLINE]) dnl Check for broken stat macros. @@ -45,4 +30,30 @@ AC_DEFUN([gl_HEADER_SYS_STAT_H], gl_CHECK_NEXT_HEADERS([sys/stat.h]) SYS_STAT_H='sys/stat.h' AC_SUBST([SYS_STAT_H]) + + dnl Define types that are supposed to be defined in or + dnl . + AC_CHECK_TYPE([nlink_t], [], + [AC_DEFINE([nlink_t], [int], + [Define to the type of st_nlink in struct stat, or a supertype.])], + [#include + #include ]) + ]) # gl_HEADER_SYS_STAT_H + +AC_DEFUN([gl_SYS_STAT_MODULE_INDICATOR], +[ + dnl Use AC_REQUIRE here, so that the default settings are expanded once only. + AC_REQUIRE([gl_SYS_STAT_H_DEFAULTS]) + GNULIB_[]m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./-],[ABCDEFGHIJKLMNOPQRSTUVWXYZ___])=1 +]) + +AC_DEFUN([gl_SYS_STAT_H_DEFAULTS], +[ + GNULIB_LCHMOD=0; AC_SUBST([GNULIB_LCHMOD]) + GNULIB_LSTAT=0; AC_SUBST([GNULIB_LSTAT]) + dnl Assume proper GNU behavior unless another module says otherwise. + HAVE_LCHMOD=1; AC_SUBST([HAVE_LCHMOD]) + REPLACE_LSTAT=0; AC_SUBST([REPLACE_LSTAT]) + REPLACE_MKDIR=0; AC_SUBST([REPLACE_MKDIR]) +])