summaryrefslogtreecommitdiff
path: root/m4
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2011-02-20 02:51:50 -0800
committerPaul Eggert <eggert@cs.ucla.edu>2011-02-20 02:51:50 -0800
commit5fa4ac767c6aaf9203d2ec6ff2f90a061b401930 (patch)
treec433fefa9db8edd699775cbd61cf21bc2883cd10 /m4
parent61353ac8cdbdda53d75f5ab9aa7f0b637aee5a00 (diff)
downloademacs-5fa4ac767c6aaf9203d2ec6ff2f90a061b401930.tar.gz
Import filemode module from gnulib.
* .bzrignore: Add lib/sys/. * Makefile.in (GNULIB_MODULES): Add filemode. * lib/Makefile.am (MOSTLYCLEANDIRS): New macro. * lib/filemode.c: Renamed from src/filemode.c and regenerated from gnulib. This adds support for some more file types, e.g., Cray DMF migrated files. * lisp/emacs-lisp/find-gc.el (find-gc-source-files): Remove filemode.c. * lib/filemode.h, lib/sys_stat.in.h, m4/filemode.m4, m4/st_dm_mode.m4: * m4/sys_stat_h.m4: New files, generated from gnulib. * aclocal.m4, configure, lib/Makefile.in, lib/gnulib.mk, m4/gl-comp.m4: Regenerate. 2011-02-20 Paul Eggert <eggert@cs.ucla.edu>
Diffstat (limited to 'm4')
-rw-r--r--m4/filemode.m412
-rw-r--r--m4/gl-comp.m413
-rw-r--r--m4/st_dm_mode.m423
-rw-r--r--m4/sys_stat_h.m482
4 files changed, 130 insertions, 0 deletions
diff --git a/m4/filemode.m4 b/m4/filemode.m4
new file mode 100644
index 00000000000..4147fd01e28
--- /dev/null
+++ b/m4/filemode.m4
@@ -0,0 +1,12 @@
+# filemode.m4 serial 7
+dnl Copyright (C) 2002, 2005-2006, 2009-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,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([gl_FILEMODE],
+[
+ AC_REQUIRE([AC_STRUCT_ST_DM_MODE])
+ AC_LIBOBJ([filemode])
+ AC_CHECK_DECLS_ONCE([strmode])
+])
diff --git a/m4/gl-comp.m4 b/m4/gl-comp.m4
index 43ff36558b5..10ec34da386 100644
--- a/m4/gl-comp.m4
+++ b/m4/gl-comp.m4
@@ -32,6 +32,7 @@ AC_DEFUN([gl_EARLY],
# Code from module dtoastr:
# Code from module extensions:
AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
+ # Code from module filemode:
# Code from module getloadavg:
# Code from module getopt-gnu:
# Code from module getopt-posix:
@@ -46,6 +47,7 @@ AC_DEFUN([gl_EARLY],
# Code from module stdint:
# Code from module stdlib:
# Code from module strftime:
+ # Code from module sys_stat:
# Code from module time:
# Code from module time_r:
# Code from module unistd:
@@ -75,6 +77,8 @@ AC_DEFUN([gl_INIT],
# Code from module dtoastr:
AC_REQUIRE([gl_C99_STRTOLD])
# Code from module extensions:
+ # Code from module filemode:
+ gl_FILEMODE
# Code from module getloadavg:
gl_GETLOADAVG([$gl_source_base])
gl_STDLIB_MODULE_INDICATOR([getloadavg])
@@ -105,6 +109,9 @@ AC_DEFUN([gl_INIT],
gl_STDLIB_H
# Code from module strftime:
gl_FUNC_GNU_STRFTIME
+ # Code from module sys_stat:
+ gl_HEADER_SYS_STAT_H
+ AC_PROG_MKDIR_P
# Code from module time:
gl_HEADER_TIME_H
# Code from module time_r:
@@ -257,6 +264,8 @@ AC_DEFUN([gl_FILE_LIST], [
build-aux/c++defs.h
build-aux/warn-on-use.h
lib/dtoastr.c
+ lib/filemode.c
+ lib/filemode.h
lib/ftoastr.c
lib/ftoastr.h
lib/getloadavg.c
@@ -277,12 +286,14 @@ AC_DEFUN([gl_FILE_LIST], [
lib/stdlib.in.h
lib/strftime.c
lib/strftime.h
+ lib/sys_stat.in.h
lib/time.in.h
lib/time_r.c
lib/unistd.in.h
m4/00gnulib.m4
m4/c-strtod.m4
m4/extensions.m4
+ m4/filemode.m4
m4/getloadavg.m4
m4/getopt.m4
m4/gnulib-common.m4
@@ -291,11 +302,13 @@ AC_DEFUN([gl_FILE_LIST], [
m4/md5.m4
m4/mktime.m4
m4/multiarch.m4
+ m4/st_dm_mode.m4
m4/stdbool.m4
m4/stddef_h.m4
m4/stdint.m4
m4/stdlib_h.m4
m4/strftime.m4
+ m4/sys_stat_h.m4
m4/time_h.m4
m4/time_r.m4
m4/tm_gmtoff.m4
diff --git a/m4/st_dm_mode.m4 b/m4/st_dm_mode.m4
new file mode 100644
index 00000000000..84f74638f12
--- /dev/null
+++ b/m4/st_dm_mode.m4
@@ -0,0 +1,23 @@
+# serial 6
+
+# Copyright (C) 1998-1999, 2001, 2009-2011 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.
+
+# Define HAVE_ST_DM_MODE if struct stat has an st_dm_mode member.
+
+AC_DEFUN([AC_STRUCT_ST_DM_MODE],
+ [AC_CACHE_CHECK([for st_dm_mode in struct stat], [ac_cv_struct_st_dm_mode],
+ [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
+#include <sys/types.h>
+#include <sys/stat.h>]], [[struct stat s; s.st_dm_mode;]])],
+ [ac_cv_struct_st_dm_mode=yes],
+ [ac_cv_struct_st_dm_mode=no])])
+
+ if test $ac_cv_struct_st_dm_mode = yes; then
+ AC_DEFINE([HAVE_ST_DM_MODE], [1],
+ [Define if struct stat has an st_dm_mode member. ])
+ fi
+ ]
+)
diff --git a/m4/sys_stat_h.m4 b/m4/sys_stat_h.m4
new file mode 100644
index 00000000000..fc419129e98
--- /dev/null
+++ b/m4/sys_stat_h.m4
@@ -0,0 +1,82 @@
+# sys_stat_h.m4 serial 24 -*- Autoconf -*-
+dnl Copyright (C) 2006-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,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl From Eric Blake.
+dnl Provide a GNU-like <sys/stat.h>.
+
+AC_DEFUN([gl_HEADER_SYS_STAT_H],
+[
+ AC_REQUIRE([gl_SYS_STAT_H_DEFAULTS])
+
+ dnl For the mkdir substitute.
+ AC_REQUIRE([AC_C_INLINE])
+
+ dnl Check for broken stat macros.
+ AC_REQUIRE([AC_HEADER_STAT])
+
+ gl_CHECK_NEXT_HEADERS([sys/stat.h])
+
+ dnl Define types that are supposed to be defined in <sys/types.h> or
+ dnl <sys/stat.h>.
+ AC_CHECK_TYPE([nlink_t], [],
+ [AC_DEFINE([nlink_t], [int],
+ [Define to the type of st_nlink in struct stat, or a supertype.])],
+ [#include <sys/types.h>
+ #include <sys/stat.h>])
+
+ dnl Check for declarations of anything we want to poison if the
+ dnl corresponding gnulib module is not in use.
+ gl_WARN_ON_USE_PREPARE([[#include <sys/stat.h>
+ ]], [fchmodat fstatat futimens lchmod lstat mkdirat mkfifo mkfifoat
+ mknod mknodat stat utimensat])
+]) # 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])
+ gl_MODULE_INDICATOR_SET_VARIABLE([$1])
+ dnl Define it also as a C macro, for the benefit of the unit tests.
+ gl_MODULE_INDICATOR_FOR_TESTS([$1])
+])
+
+AC_DEFUN([gl_SYS_STAT_H_DEFAULTS],
+[
+ AC_REQUIRE([gl_UNISTD_H_DEFAULTS]) dnl for REPLACE_FCHDIR
+ GNULIB_FCHMODAT=0; AC_SUBST([GNULIB_FCHMODAT])
+ GNULIB_FSTATAT=0; AC_SUBST([GNULIB_FSTATAT])
+ GNULIB_FUTIMENS=0; AC_SUBST([GNULIB_FUTIMENS])
+ GNULIB_LCHMOD=0; AC_SUBST([GNULIB_LCHMOD])
+ GNULIB_LSTAT=0; AC_SUBST([GNULIB_LSTAT])
+ GNULIB_MKDIRAT=0; AC_SUBST([GNULIB_MKDIRAT])
+ GNULIB_MKFIFO=0; AC_SUBST([GNULIB_MKFIFO])
+ GNULIB_MKFIFOAT=0; AC_SUBST([GNULIB_MKFIFOAT])
+ GNULIB_MKNOD=0; AC_SUBST([GNULIB_MKNOD])
+ GNULIB_MKNODAT=0; AC_SUBST([GNULIB_MKNODAT])
+ GNULIB_STAT=0; AC_SUBST([GNULIB_STAT])
+ GNULIB_UTIMENSAT=0; AC_SUBST([GNULIB_UTIMENSAT])
+ dnl Assume proper GNU behavior unless another module says otherwise.
+ HAVE_FCHMODAT=1; AC_SUBST([HAVE_FCHMODAT])
+ HAVE_FSTATAT=1; AC_SUBST([HAVE_FSTATAT])
+ HAVE_FUTIMENS=1; AC_SUBST([HAVE_FUTIMENS])
+ HAVE_LCHMOD=1; AC_SUBST([HAVE_LCHMOD])
+ HAVE_LSTAT=1; AC_SUBST([HAVE_LSTAT])
+ HAVE_MKDIRAT=1; AC_SUBST([HAVE_MKDIRAT])
+ HAVE_MKFIFO=1; AC_SUBST([HAVE_MKFIFO])
+ HAVE_MKFIFOAT=1; AC_SUBST([HAVE_MKFIFOAT])
+ HAVE_MKNOD=1; AC_SUBST([HAVE_MKNOD])
+ HAVE_MKNODAT=1; AC_SUBST([HAVE_MKNODAT])
+ HAVE_UTIMENSAT=1; AC_SUBST([HAVE_UTIMENSAT])
+ REPLACE_FSTAT=0; AC_SUBST([REPLACE_FSTAT])
+ REPLACE_FSTATAT=0; AC_SUBST([REPLACE_FSTATAT])
+ REPLACE_FUTIMENS=0; AC_SUBST([REPLACE_FUTIMENS])
+ REPLACE_LSTAT=0; AC_SUBST([REPLACE_LSTAT])
+ REPLACE_MKDIR=0; AC_SUBST([REPLACE_MKDIR])
+ REPLACE_MKFIFO=0; AC_SUBST([REPLACE_MKFIFO])
+ REPLACE_MKNOD=0; AC_SUBST([REPLACE_MKNOD])
+ REPLACE_STAT=0; AC_SUBST([REPLACE_STAT])
+ REPLACE_UTIMENSAT=0; AC_SUBST([REPLACE_UTIMENSAT])
+])