* tools/snippet/_Noreturn.h, tools/snippet/c++defs.h, tools/snippet/arg-nonnull.h, tools/snippet/warn-on-use.h: Rename to... * lib/_Noreturn.h, lib/c++defs.h, lib/arg-nonnull.h, lib/warn-on-use.h: ... these. * lib/filename.h, lib/getopt-cdefs.in.h, lib/getopt-core.h, lib/getopt-ext.h, lib/getopt-pfx-core.h, lib/getopt-pfx-ext.h, lib/localtime-buffer.c, lib/localtime-buffer.h, lib/malloca.c, lib/malloca.h, lib/malloca.valgrind, lib/stat-w32.c, lib/stat-w32.h, m4/eealloc.m4, m4/localtime-buffer.m4, m4/malloca.m4: New files. * lib/argp-help.c, lib/argp-parse.c, lib/error.c, lib/float.in.h, lib/getopt1.c, lib/getopt.c, lib/getopt.in.h, lib/getopt_int.h, lib/gettext.h, lib/gettimeofday.c, lib/intprops.h, lib/isatty.c, lib/limits.in.h, lib/localcharset.c, lib/Makefile.am, lib/mbrtowc.c, lib/mbsinit.c, lib/msvc-nothrow.c, lib/quotearg.c, lib/stat.c, lib/stdalign.in.h, lib/stdint.in.h, lib/string.in.h, lib/sys_stat.in.h, lib/sys_types.in.h, lib/tempname.c, lib/time.in.h, lib/unistd.in.h, lib/vasnprintf.c, lib/wchar.in.h, lib/wctype.in.h, lib/xalloc.h, lib/xalloc-oversized.h, m4/fcntl-o.m4, m4/float_h.m4, m4/getopt.m4, m4/gettimeofday.m4, m4/gnulib-common.m4, m4/gnulib-comp.m4, m4/include_next.m4, m4/largefile.m4, m4/lstat.m4, m4/mbrtowc.m4, m4/memchr.m4, m4/mkstemp.m4, m4/printf.m4, m4/sleep.m4, m4/stat.m4, m4/stdalign.m4, m4/stdint.m4, m4/strerror.m4, m4/string_h.m4, m4/sys_stat_h.m4, m4/sys_time_h.m4, m4/sys_types_h.m4, m4/time_h.m4, m4/unistd_h.m4, m4/wchar_h.m4, m4/wctype_h.m4, m4/wint_t.m4: Update.
67 lines
2.3 KiB
Text
67 lines
2.3 KiB
Text
# serial 12
|
|
|
|
# Copyright (C) 2009-2017 Free Software Foundation, Inc.
|
|
#
|
|
# This file is free software; the Free Software Foundation
|
|
# gives unlimited permission to copy and/or distribute it,
|
|
# with or without modifications, as long as this notice is preserved.
|
|
|
|
AC_DEFUN([gl_FUNC_STAT],
|
|
[
|
|
AC_REQUIRE([AC_CANONICAL_HOST])
|
|
AC_REQUIRE([gl_SYS_STAT_H_DEFAULTS])
|
|
AC_CHECK_FUNCS_ONCE([lstat])
|
|
case "$host_os" in
|
|
mingw*)
|
|
dnl On this platform, the original stat() returns st_atime, st_mtime,
|
|
dnl st_ctime values that are affected by the time zone.
|
|
REPLACE_STAT=1
|
|
;;
|
|
*)
|
|
dnl AIX 7.1, Solaris 9, mingw64 mistakenly succeed on stat("file/").
|
|
dnl (For mingw, this is due to a broken stat() override in libmingwex.a.)
|
|
dnl FreeBSD 7.2 mistakenly succeeds on stat("link-to-file/").
|
|
AC_CACHE_CHECK([whether stat handles trailing slashes on files],
|
|
[gl_cv_func_stat_file_slash],
|
|
[touch conftest.tmp
|
|
# Assume that if we have lstat, we can also check symlinks.
|
|
if test $ac_cv_func_lstat = yes; then
|
|
ln -s conftest.tmp conftest.lnk
|
|
fi
|
|
AC_RUN_IFELSE(
|
|
[AC_LANG_PROGRAM(
|
|
[[#include <sys/stat.h>
|
|
]], [[int result = 0;
|
|
struct stat st;
|
|
if (!stat ("conftest.tmp/", &st))
|
|
result |= 1;
|
|
#if HAVE_LSTAT
|
|
if (!stat ("conftest.lnk/", &st))
|
|
result |= 2;
|
|
#endif
|
|
return result;
|
|
]])],
|
|
[gl_cv_func_stat_file_slash=yes], [gl_cv_func_stat_file_slash=no],
|
|
[case "$host_os" in
|
|
# Guess yes on glibc systems.
|
|
*-gnu*) gl_cv_func_stat_file_slash="guessing yes" ;;
|
|
# If we don't know, assume the worst.
|
|
*) gl_cv_func_stat_file_slash="guessing no" ;;
|
|
esac
|
|
])
|
|
rm -f conftest.tmp conftest.lnk])
|
|
case $gl_cv_func_stat_file_slash in
|
|
*no)
|
|
REPLACE_STAT=1
|
|
AC_DEFINE([REPLACE_FUNC_STAT_FILE], [1], [Define to 1 if stat needs
|
|
help when passed a file name with a trailing slash]);;
|
|
esac
|
|
;;
|
|
esac
|
|
])
|
|
|
|
# Prerequisites of lib/stat.c and lib/stat-w32.c.
|
|
AC_DEFUN([gl_PREREQ_STAT], [
|
|
AC_REQUIRE([gl_HEADER_SYS_STAT_H])
|
|
:
|
|
])
|