aboutsummaryrefslogtreecommitdiffstats
path: root/m4
diff options
context:
space:
mode:
authorPaul Eggert2015-04-24 22:39:47 -0700
committerPaul Eggert2015-04-24 22:41:56 -0700
commit27e6afeb6fe1f0b9f083fdfeacf6d69c6936a34a (patch)
treea1bdf790a993c537044305912d3d4796789dccb0 /m4
parent52ba851db188de47b303120df00c77e3aad7e542 (diff)
downloademacs-27e6afeb6fe1f0b9f083fdfeacf6d69c6936a34a.tar.gz
emacs-27e6afeb6fe1f0b9f083fdfeacf6d69c6936a34a.zip
Merge from gnulib
This incorporates: 2015-04-24 file-has-acl: new module, split from acl 2015-04-24 manywarnings: add GCC 5.1 warnings 2015-04-21 lstat: fix cross-compilation 'ln -s' problem 2015-04-15 qacl: Simplify HP-UX acl_nontrivial check 2015-04-15 acl: On Linux, check for acls without libacl 2015-04-14 tempname: avoid unused parameter warnings (trivial) * lib/acl-internal.c: New file, from gnulib. * lib/file-has-acl.c: Remove; no longer imported from gnulib. * lib/acl-internal.h, lib/gnulib.mk, lib/qcopy-acl.c, lib/tempname.c: * m4/acl.m4, m4/gnulib-comp.m4, m4/lstat.m4, m4/manywarnings.m4: Update from gnulib.
Diffstat (limited to 'm4')
-rw-r--r--m4/acl.m447
-rw-r--r--m4/gnulib-comp.m42
-rw-r--r--m4/lstat.m448
-rw-r--r--m4/manywarnings.m423
4 files changed, 82 insertions, 38 deletions
diff --git a/m4/acl.m4 b/m4/acl.m4
index c77f0edd0e7..186353c395b 100644
--- a/m4/acl.m4
+++ b/m4/acl.m4
@@ -1,5 +1,5 @@
1# acl.m4 - check for access control list (ACL) primitives 1# acl.m4 - check for access control list (ACL) primitives
2# serial 17 2# serial 18
3 3
4# Copyright (C) 2002, 2004-2015 Free Software Foundation, Inc. 4# Copyright (C) 2002, 2004-2015 Free Software Foundation, Inc.
5# This file is free software; the Free Software Foundation 5# This file is free software; the Free Software Foundation
@@ -8,23 +8,29 @@
8 8
9# Written by Paul Eggert and Jim Meyering. 9# Written by Paul Eggert and Jim Meyering.
10 10
11AC_DEFUN([gl_FUNC_ACL], 11AC_DEFUN([gl_FUNC_ACL_ARG],
12[ 12[
13 gl_need_lib_has_acl=
13 AC_ARG_ENABLE([acl], 14 AC_ARG_ENABLE([acl],
14 AS_HELP_STRING([--disable-acl], [do not support ACLs]), 15 AS_HELP_STRING([--disable-acl], [do not support ACLs]),
15 , [enable_acl=auto]) 16 , [enable_acl=auto])
17])
18
16 19
20AC_DEFUN([gl_FUNC_ACL],
21[
22 AC_REQUIRE([gl_FUNC_ACL_ARG])
17 AC_CHECK_FUNCS_ONCE([fchmod]) 23 AC_CHECK_FUNCS_ONCE([fchmod])
18 LIB_ACL= 24 LIB_ACL=
19 use_acl=0 25 use_acl=0
20 if test "x$enable_acl" != "xno"; then 26 if test "$enable_acl" != no; then
21 dnl On all platforms, the ACL related API is declared in <sys/acl.h>. 27 dnl On all platforms, the ACL related API is declared in <sys/acl.h>.
22 AC_CHECK_HEADERS([sys/acl.h]) 28 AC_CHECK_HEADERS([sys/acl.h])
23 if test $ac_cv_header_sys_acl_h = yes; then 29 if test $ac_cv_header_sys_acl_h = yes; then
24 ac_save_LIBS=$LIBS 30 ac_save_LIBS=$LIBS
25 31
26 dnl Test for POSIX-draft-like API (Linux, FreeBSD, Mac OS X, IRIX, Tru64). 32 dnl Test for POSIX-draft-like API (GNU/Linux, FreeBSD, Mac OS X,
27 dnl -lacl is needed on Linux, -lpacl is needed on OSF/1. 33 dnl IRIX, Tru64). -lacl is needed on GNU/Linux, -lpacl on OSF/1.
28 if test $use_acl = 0; then 34 if test $use_acl = 0; then
29 AC_SEARCH_LIBS([acl_get_file], [acl pacl], 35 AC_SEARCH_LIBS([acl_get_file], [acl pacl],
30 [if test "$ac_cv_search_acl_get_file" != "none required"; then 36 [if test "$ac_cv_search_acl_get_file" != "none required"; then
@@ -40,7 +46,7 @@ AC_DEFUN([gl_FUNC_ACL],
40 # If the acl_get_file bug is detected, don't enable the ACL support. 46 # If the acl_get_file bug is detected, don't enable the ACL support.
41 gl_ACL_GET_FILE([use_acl=1], []) 47 gl_ACL_GET_FILE([use_acl=1], [])
42 if test $use_acl = 1; then 48 if test $use_acl = 1; then
43 dnl On Linux, additional API is declared in <acl/libacl.h>. 49 dnl On GNU/Linux, an additional API is declared in <acl/libacl.h>.
44 AC_CHECK_HEADERS([acl/libacl.h]) 50 AC_CHECK_HEADERS([acl/libacl.h])
45 AC_REPLACE_FUNCS([acl_entries]) 51 AC_REPLACE_FUNCS([acl_entries])
46 AC_CACHE_CHECK([for ACL_FIRST_ENTRY], 52 AC_CACHE_CHECK([for ACL_FIRST_ENTRY],
@@ -124,13 +130,15 @@ int type = ACL_TYPE_EXTENDED;]])],
124 130
125 LIBS=$ac_save_LIBS 131 LIBS=$ac_save_LIBS
126 fi 132 fi
127 if test "x$enable_acl$use_acl" = "xyes0"; then 133
134 if test "$enable_acl$use_acl" = yes0; then
128 AC_MSG_ERROR([ACLs enabled but support not detected]) 135 AC_MSG_ERROR([ACLs enabled but support not detected])
129 elif test "x$enable_acl$use_acl" = "xauto0"; then 136 elif test "$enable_acl$use_acl" = auto0; then
130 AC_MSG_WARN([libacl development library was not found or not usable.]) 137 AC_MSG_WARN([libacl development library was not found or not usable.])
131 AC_MSG_WARN([AC_PACKAGE_NAME will be built without ACL support.]) 138 AC_MSG_WARN([AC_PACKAGE_NAME will be built without ACL support.])
132 fi 139 fi
133 fi 140 fi
141 test $gl_need_lib_has_acl && LIB_HAS_ACL=$LIB_ACL
134 AC_SUBST([LIB_ACL]) 142 AC_SUBST([LIB_ACL])
135 AC_DEFINE_UNQUOTED([USE_ACL], [$use_acl], 143 AC_DEFINE_UNQUOTED([USE_ACL], [$use_acl],
136 [Define to nonzero if you want access control list support.]) 144 [Define to nonzero if you want access control list support.])
@@ -139,7 +147,7 @@ int type = ACL_TYPE_EXTENDED;]])],
139]) 147])
140 148
141# gl_ACL_GET_FILE(IF-WORKS, IF-NOT) 149# gl_ACL_GET_FILE(IF-WORKS, IF-NOT)
142# ------------------------------------- 150# ---------------------------------
143# If 'acl_get_file' works (does not have a particular bug), 151# If 'acl_get_file' works (does not have a particular bug),
144# run IF-WORKS, otherwise, IF-NOT. 152# run IF-WORKS, otherwise, IF-NOT.
145# When building natively, test for a Darwin 8.7.0 bug, whereby acl_get_file 153# When building natively, test for a Darwin 8.7.0 bug, whereby acl_get_file
@@ -166,3 +174,24 @@ AC_DEFUN([gl_ACL_GET_FILE],
166 fi])]) 174 fi])])
167 AS_IF([test "$gl_cv_func_working_acl_get_file" != no], [$1], [$2]) 175 AS_IF([test "$gl_cv_func_working_acl_get_file" != no], [$1], [$2])
168]) 176])
177
178# On GNU/Linux, testing if a file has an acl can be done with the getxattr
179# syscall which doesn't require linking against additional libraries.
180AC_DEFUN([gl_FILE_HAS_ACL],
181[
182 AC_REQUIRE([gl_FUNC_ACL_ARG])
183 if test "$enable_acl" != no; then
184 AC_CHECK_HEADERS([linux/xattr.h],
185 [AC_CHECK_HEADERS([sys/xattr.h],
186 [AC_CHECK_FUNCS([getxattr])])])
187 fi
188 if test "$ac_cv_header_sys_xattr_h,$ac_cv_header_linux_xattr_h,$ac_cv_func_getxattr" = yes,yes,yes; then
189 LIB_HAS_ACL=
190 else
191 dnl Set gl_need_lib_has_acl to a nonempty value, so that any
192 dnl later gl_FUNC_ACL call will set LIB_HAS_ACL=$LIB_ACL.
193 gl_need_lib_has_acl=1
194 LIB_HAS_ACL=$LIB_ACL
195 fi
196 AC_SUBST([LIB_HAS_ACL])
197])
diff --git a/m4/gnulib-comp.m4 b/m4/gnulib-comp.m4
index f32a4ddca5c..06636cfe76c 100644
--- a/m4/gnulib-comp.m4
+++ b/m4/gnulib-comp.m4
@@ -818,6 +818,7 @@ AC_DEFUN([gl_FILE_LIST], [
818 build-aux/snippet/warn-on-use.h 818 build-aux/snippet/warn-on-use.h
819 build-aux/update-copyright 819 build-aux/update-copyright
820 lib/acl-errno-valid.c 820 lib/acl-errno-valid.c
821 lib/acl-internal.c
821 lib/acl-internal.h 822 lib/acl-internal.h
822 lib/acl.h 823 lib/acl.h
823 lib/acl_entries.c 824 lib/acl_entries.c
@@ -856,7 +857,6 @@ AC_DEFUN([gl_FILE_LIST], [
856 lib/fcntl.in.h 857 lib/fcntl.in.h
857 lib/fdatasync.c 858 lib/fdatasync.c
858 lib/fdopendir.c 859 lib/fdopendir.c
859 lib/file-has-acl.c
860 lib/filemode.c 860 lib/filemode.c
861 lib/filemode.h 861 lib/filemode.h
862 lib/fpending.c 862 lib/fpending.c
diff --git a/m4/lstat.m4 b/m4/lstat.m4
index f6c7dd1ce44..adf752c0dfa 100644
--- a/m4/lstat.m4
+++ b/m4/lstat.m4
@@ -1,4 +1,4 @@
1# serial 26 1# serial 27
2 2
3# Copyright (C) 1997-2001, 2003-2015 Free Software Foundation, Inc. 3# Copyright (C) 1997-2001, 2003-2015 Free Software Foundation, Inc.
4# 4#
@@ -37,30 +37,28 @@ AC_DEFUN([gl_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK],
37 [gl_cv_func_lstat_dereferences_slashed_symlink], 37 [gl_cv_func_lstat_dereferences_slashed_symlink],
38 [rm -f conftest.sym conftest.file 38 [rm -f conftest.sym conftest.file
39 echo >conftest.file 39 echo >conftest.file
40 if test "$as_ln_s" = "ln -s" && ln -s conftest.file conftest.sym; then 40 AC_RUN_IFELSE(
41 AC_RUN_IFELSE( 41 [AC_LANG_PROGRAM(
42 [AC_LANG_PROGRAM( 42 [AC_INCLUDES_DEFAULT],
43 [AC_INCLUDES_DEFAULT], 43 [[struct stat sbuf;
44 [[struct stat sbuf; 44 if (symlink ("conftest.file", "conftest.sym") != 0)
45 /* Linux will dereference the symlink and fail, as required by 45 return 1;
46 POSIX. That is better in the sense that it means we will not 46 /* Linux will dereference the symlink and fail, as required by
47 have to compile and use the lstat wrapper. */ 47 POSIX. That is better in the sense that it means we will not
48 return lstat ("conftest.sym/", &sbuf) == 0; 48 have to compile and use the lstat wrapper. */
49 ]])], 49 return lstat ("conftest.sym/", &sbuf) == 0;
50 [gl_cv_func_lstat_dereferences_slashed_symlink=yes], 50 ]])],
51 [gl_cv_func_lstat_dereferences_slashed_symlink=no], 51 [gl_cv_func_lstat_dereferences_slashed_symlink=yes],
52 [case "$host_os" in 52 [gl_cv_func_lstat_dereferences_slashed_symlink=no],
53 # Guess yes on glibc systems. 53 [case "$host_os" in
54 *-gnu*) gl_cv_func_lstat_dereferences_slashed_symlink="guessing yes" ;; 54 *-gnu*)
55 # If we don't know, assume the worst. 55 # Guess yes on glibc systems.
56 *) gl_cv_func_lstat_dereferences_slashed_symlink="guessing no" ;; 56 gl_cv_func_lstat_dereferences_slashed_symlink="guessing yes" ;;
57 esac 57 *)
58 ]) 58 # If we don't know, assume the worst.
59 else 59 gl_cv_func_lstat_dereferences_slashed_symlink="guessing no" ;;
60 # If the 'ln -s' command failed, then we probably don't even 60 esac
61 # have an lstat function. 61 ])
62 gl_cv_func_lstat_dereferences_slashed_symlink="guessing no"
63 fi
64 rm -f conftest.sym conftest.file 62 rm -f conftest.sym conftest.file
65 ]) 63 ])
66 case "$gl_cv_func_lstat_dereferences_slashed_symlink" in 64 case "$gl_cv_func_lstat_dereferences_slashed_symlink" in
diff --git a/m4/manywarnings.m4 b/m4/manywarnings.m4
index 44da98e38da..b4e38d94463 100644
--- a/m4/manywarnings.m4
+++ b/m4/manywarnings.m4
@@ -108,12 +108,13 @@ AC_DEFUN([gl_MANYWARN_ALL_GCC],
108 -Waddress \ 108 -Waddress \
109 -Waggressive-loop-optimizations \ 109 -Waggressive-loop-optimizations \
110 -Wall \ 110 -Wall \
111 -Warray-bounds \
112 -Wattributes \ 111 -Wattributes \
113 -Wbad-function-cast \ 112 -Wbad-function-cast \
113 -Wbool-compare \
114 -Wbuiltin-macro-redefined \ 114 -Wbuiltin-macro-redefined \
115 -Wcast-align \ 115 -Wcast-align \
116 -Wchar-subscripts \ 116 -Wchar-subscripts \
117 -Wchkp \
117 -Wclobbered \ 118 -Wclobbered \
118 -Wcomment \ 119 -Wcomment \
119 -Wcomments \ 120 -Wcomments \
@@ -122,7 +123,10 @@ AC_DEFUN([gl_MANYWARN_ALL_GCC],
122 -Wdate-time \ 123 -Wdate-time \
123 -Wdeprecated \ 124 -Wdeprecated \
124 -Wdeprecated-declarations \ 125 -Wdeprecated-declarations \
126 -Wdesignated-init \
125 -Wdisabled-optimization \ 127 -Wdisabled-optimization \
128 -Wdiscarded-array-qualifiers \
129 -Wdiscarded-qualifiers \
126 -Wdiv-by-zero \ 130 -Wdiv-by-zero \
127 -Wdouble-promotion \ 131 -Wdouble-promotion \
128 -Wempty-body \ 132 -Wempty-body \
@@ -133,6 +137,7 @@ AC_DEFUN([gl_MANYWARN_ALL_GCC],
133 -Wformat-extra-args \ 137 -Wformat-extra-args \
134 -Wformat-nonliteral \ 138 -Wformat-nonliteral \
135 -Wformat-security \ 139 -Wformat-security \
140 -Wformat-signedness \
136 -Wformat-y2k \ 141 -Wformat-y2k \
137 -Wformat-zero-length \ 142 -Wformat-zero-length \
138 -Wfree-nonheap-object \ 143 -Wfree-nonheap-object \
@@ -140,15 +145,19 @@ AC_DEFUN([gl_MANYWARN_ALL_GCC],
140 -Wimplicit \ 145 -Wimplicit \
141 -Wimplicit-function-declaration \ 146 -Wimplicit-function-declaration \
142 -Wimplicit-int \ 147 -Wimplicit-int \
148 -Wincompatible-pointer-types \
143 -Winit-self \ 149 -Winit-self \
144 -Winline \ 150 -Winline \
151 -Wint-conversion \
145 -Wint-to-pointer-cast \ 152 -Wint-to-pointer-cast \
146 -Winvalid-memory-model \ 153 -Winvalid-memory-model \
147 -Winvalid-pch \ 154 -Winvalid-pch \
148 -Wjump-misses-init \ 155 -Wjump-misses-init \
156 -Wlogical-not-parentheses \
149 -Wlogical-op \ 157 -Wlogical-op \
150 -Wmain \ 158 -Wmain \
151 -Wmaybe-uninitialized \ 159 -Wmaybe-uninitialized \
160 -Wmemset-transposed-args \
152 -Wmissing-braces \ 161 -Wmissing-braces \
153 -Wmissing-declarations \ 162 -Wmissing-declarations \
154 -Wmissing-field-initializers \ 163 -Wmissing-field-initializers \
@@ -159,6 +168,7 @@ AC_DEFUN([gl_MANYWARN_ALL_GCC],
159 -Wnarrowing \ 168 -Wnarrowing \
160 -Wnested-externs \ 169 -Wnested-externs \
161 -Wnonnull \ 170 -Wnonnull \
171 -Wodr \
162 -Wold-style-declaration \ 172 -Wold-style-declaration \
163 -Wold-style-definition \ 173 -Wold-style-definition \
164 -Wopenmp-simd \ 174 -Wopenmp-simd \
@@ -176,6 +186,9 @@ AC_DEFUN([gl_MANYWARN_ALL_GCC],
176 -Wreturn-type \ 186 -Wreturn-type \
177 -Wsequence-point \ 187 -Wsequence-point \
178 -Wshadow \ 188 -Wshadow \
189 -Wshift-count-negative \
190 -Wshift-count-overflow \
191 -Wsizeof-array-argument \
179 -Wsizeof-pointer-memaccess \ 192 -Wsizeof-pointer-memaccess \
180 -Wstack-protector \ 193 -Wstack-protector \
181 -Wstrict-aliasing \ 194 -Wstrict-aliasing \
@@ -185,7 +198,10 @@ AC_DEFUN([gl_MANYWARN_ALL_GCC],
185 -Wsuggest-attribute=format \ 198 -Wsuggest-attribute=format \
186 -Wsuggest-attribute=noreturn \ 199 -Wsuggest-attribute=noreturn \
187 -Wsuggest-attribute=pure \ 200 -Wsuggest-attribute=pure \
201 -Wsuggest-final-methods \
202 -Wsuggest-final-types \
188 -Wswitch \ 203 -Wswitch \
204 -Wswitch-bool \
189 -Wswitch-default \ 205 -Wswitch-default \
190 -Wsync-nand \ 206 -Wsync-nand \
191 -Wsystem-headers \ 207 -Wsystem-headers \
@@ -217,8 +233,9 @@ AC_DEFUN([gl_MANYWARN_ALL_GCC],
217 gl_manywarn_set="$gl_manywarn_set $gl_manywarn_item" 233 gl_manywarn_set="$gl_manywarn_set $gl_manywarn_item"
218 done 234 done
219 235
220 # gcc --help=warnings outputs an unusual form for this option; list 236 # gcc --help=warnings outputs an unusual form for these options; list
221 # it here so that the above 'comm' command doesn't report a false match. 237 # them here so that the above 'comm' command doesn't report a false match.
238 gl_manywarn_set="$gl_manywarn_set -Warray-bounds=2"
222 gl_manywarn_set="$gl_manywarn_set -Wnormalized=nfc" 239 gl_manywarn_set="$gl_manywarn_set -Wnormalized=nfc"
223 240
224 # These are needed for older GCC versions. 241 # These are needed for older GCC versions.