annotate m4/acl.m4 @ 37206:9a5e8b72769e

acl: allow cross-compilation to Gentoo Problem reported by Gabriel Marcano in <http://lists.gnu.org/archive/html/bug-gnulib/2013-10/msg00058.html>. * m4/acl.m4 (gl_ACL_GET_FILE): When cross-compiling, test only whether it links.
author Paul Eggert <eggert@cs.ucla.edu>
date Mon, 14 Oct 2013 14:25:06 -0700
parents c741bc27922a
children 344018b6e5d7
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
23451
809294d2b96f *** empty log message ***
Jim Meyering <jim@meyering.net>
parents:
diff changeset
1 # acl.m4 - check for access control list (ACL) primitives
37206
9a5e8b72769e acl: allow cross-compilation to Gentoo
Paul Eggert <eggert@cs.ucla.edu>
parents: 36940
diff changeset
2 # serial 16
23451
809294d2b96f *** empty log message ***
Jim Meyering <jim@meyering.net>
parents:
diff changeset
3
36940
c741bc27922a maint: update all copyright year number ranges
Eric Blake <eblake@redhat.com>
parents: 36789
diff changeset
4 # Copyright (C) 2002, 2004-2013 Free Software Foundation, Inc.
25302
15c495e03a92 Use an all-permissive copyright notice, recommended by RMS.
Paul Eggert <eggert@cs.ucla.edu>
parents: 24850
diff changeset
5 # This file is free software; the Free Software Foundation
15c495e03a92 Use an all-permissive copyright notice, recommended by RMS.
Paul Eggert <eggert@cs.ucla.edu>
parents: 24850
diff changeset
6 # gives unlimited permission to copy and/or distribute it,
15c495e03a92 Use an all-permissive copyright notice, recommended by RMS.
Paul Eggert <eggert@cs.ucla.edu>
parents: 24850
diff changeset
7 # with or without modifications, as long as this notice is preserved.
23451
809294d2b96f *** empty log message ***
Jim Meyering <jim@meyering.net>
parents:
diff changeset
8
27062
8561bd94a9c9 * acl.m4 (AC_FUNC_ACL): Disable ACL support altogether
Jim Meyering <jim@meyering.net>
parents: 26863
diff changeset
9 # Written by Paul Eggert and Jim Meyering.
23451
809294d2b96f *** empty log message ***
Jim Meyering <jim@meyering.net>
parents:
diff changeset
10
29192
6e29897cb8b7 Add support for Solaris 10 ACLs. Also, ACLs are Gnulib, not Autoconf.
Paul Eggert <eggert@cs.ucla.edu>
parents: 28167
diff changeset
11 AC_DEFUN([gl_FUNC_ACL],
23799
8821dc8fb5c7 An independent .m4 file for each module.
Bruno Haible <bruno@clisp.org>
parents: 23451
diff changeset
12 [
29273
fa206fc2b477 Add a configure time option: --disable-acl.
Mike Frysinger <vapier@gentoo.org>
parents: 29200
diff changeset
13 AC_ARG_ENABLE([acl],
29570
9c231eaf6239 Avoid some more autoconf warnings.
Eric Blake <ebb9@byu.net>
parents: 29273
diff changeset
14 AS_HELP_STRING([--disable-acl], [do not support ACLs]),
29273
fa206fc2b477 Add a configure time option: --disable-acl.
Mike Frysinger <vapier@gentoo.org>
parents: 29200
diff changeset
15 , [enable_acl=auto])
fa206fc2b477 Add a configure time option: --disable-acl.
Mike Frysinger <vapier@gentoo.org>
parents: 29200
diff changeset
16
29192
6e29897cb8b7 Add support for Solaris 10 ACLs. Also, ACLs are Gnulib, not Autoconf.
Paul Eggert <eggert@cs.ucla.edu>
parents: 28167
diff changeset
17 LIB_ACL=
6e29897cb8b7 Add support for Solaris 10 ACLs. Also, ACLs are Gnulib, not Autoconf.
Paul Eggert <eggert@cs.ucla.edu>
parents: 28167
diff changeset
18 use_acl=0
29273
fa206fc2b477 Add a configure time option: --disable-acl.
Mike Frysinger <vapier@gentoo.org>
parents: 29200
diff changeset
19 if test "x$enable_acl" != "xno"; then
29837
daad1d35a245 Extend ACL support tests to support OSF/1, MacOS X, HP-UX, AIX.
Bruno Haible <bruno@clisp.org>
parents: 29816
diff changeset
20 dnl On all platforms, the ACL related API is declared in <sys/acl.h>.
daad1d35a245 Extend ACL support tests to support OSF/1, MacOS X, HP-UX, AIX.
Bruno Haible <bruno@clisp.org>
parents: 29816
diff changeset
21 AC_CHECK_HEADERS([sys/acl.h])
29273
fa206fc2b477 Add a configure time option: --disable-acl.
Mike Frysinger <vapier@gentoo.org>
parents: 29200
diff changeset
22 if test $ac_cv_header_sys_acl_h = yes; then
fa206fc2b477 Add a configure time option: --disable-acl.
Mike Frysinger <vapier@gentoo.org>
parents: 29200
diff changeset
23 ac_save_LIBS=$LIBS
29837
daad1d35a245 Extend ACL support tests to support OSF/1, MacOS X, HP-UX, AIX.
Bruno Haible <bruno@clisp.org>
parents: 29816
diff changeset
24
36626
fa36c6a7c96f Write "Mac OS X" instead of "MacOS X".
Bruno Haible <bruno@clisp.org>
parents: 35926
diff changeset
25 dnl Test for POSIX-draft-like API (Linux, FreeBSD, Mac OS X, IRIX, Tru64).
29837
daad1d35a245 Extend ACL support tests to support OSF/1, MacOS X, HP-UX, AIX.
Bruno Haible <bruno@clisp.org>
parents: 29816
diff changeset
26 dnl -lacl is needed on Linux, -lpacl is needed on OSF/1.
daad1d35a245 Extend ACL support tests to support OSF/1, MacOS X, HP-UX, AIX.
Bruno Haible <bruno@clisp.org>
parents: 29816
diff changeset
27 if test $use_acl = 0; then
32112
dc7644a1c024 Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents: 31881
diff changeset
28 AC_SEARCH_LIBS([acl_get_file], [acl pacl],
dc7644a1c024 Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents: 31881
diff changeset
29 [if test "$ac_cv_search_acl_get_file" != "none required"; then
dc7644a1c024 Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents: 31881
diff changeset
30 LIB_ACL=$ac_cv_search_acl_get_file
29837
daad1d35a245 Extend ACL support tests to support OSF/1, MacOS X, HP-UX, AIX.
Bruno Haible <bruno@clisp.org>
parents: 29816
diff changeset
31 fi
32112
dc7644a1c024 Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents: 31881
diff changeset
32 AC_CHECK_FUNCS(
dc7644a1c024 Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents: 31881
diff changeset
33 [acl_get_file acl_get_fd acl_set_file acl_set_fd \
dc7644a1c024 Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents: 31881
diff changeset
34 acl_free acl_from_mode acl_from_text \
35517
7c4111963a0f file-has-acl: revert both recent changes, 80af92af and 95f7c57f
Jim Meyering <meyering@redhat.com>
parents: 35130
diff changeset
35 acl_delete_def_file acl_extended_file \
32112
dc7644a1c024 Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents: 31881
diff changeset
36 acl_delete_fd_np acl_delete_file_np \
dc7644a1c024 Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents: 31881
diff changeset
37 acl_copy_ext_native acl_create_entry_np \
dc7644a1c024 Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents: 31881
diff changeset
38 acl_to_short_text acl_free_text])
dc7644a1c024 Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents: 31881
diff changeset
39 # If the acl_get_file bug is detected, don't enable the ACL support.
dc7644a1c024 Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents: 31881
diff changeset
40 gl_ACL_GET_FILE([use_acl=1], [])
dc7644a1c024 Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents: 31881
diff changeset
41 if test $use_acl = 1; then
dc7644a1c024 Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents: 31881
diff changeset
42 dnl On Linux, additional API is declared in <acl/libacl.h>.
dc7644a1c024 Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents: 31881
diff changeset
43 AC_CHECK_HEADERS([acl/libacl.h])
dc7644a1c024 Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents: 31881
diff changeset
44 AC_REPLACE_FUNCS([acl_entries])
dc7644a1c024 Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents: 31881
diff changeset
45 AC_CACHE_CHECK([for ACL_FIRST_ENTRY],
dc7644a1c024 Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents: 31881
diff changeset
46 [gl_cv_acl_ACL_FIRST_ENTRY],
33271
91ff2dad8373 acl: fix compilation test
Eric Blake <eblake@redhat.com>
parents: 32250
diff changeset
47 [AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
29837
daad1d35a245 Extend ACL support tests to support OSF/1, MacOS X, HP-UX, AIX.
Bruno Haible <bruno@clisp.org>
parents: 29816
diff changeset
48 [[#include <sys/types.h>
daad1d35a245 Extend ACL support tests to support OSF/1, MacOS X, HP-UX, AIX.
Bruno Haible <bruno@clisp.org>
parents: 29816
diff changeset
49 #include <sys/acl.h>
33271
91ff2dad8373 acl: fix compilation test
Eric Blake <eblake@redhat.com>
parents: 32250
diff changeset
50 int type = ACL_FIRST_ENTRY;]])],
32112
dc7644a1c024 Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents: 31881
diff changeset
51 [gl_cv_acl_ACL_FIRST_ENTRY=yes],
dc7644a1c024 Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents: 31881
diff changeset
52 [gl_cv_acl_ACL_FIRST_ENTRY=no])])
dc7644a1c024 Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents: 31881
diff changeset
53 if test $gl_cv_acl_ACL_FIRST_ENTRY = yes; then
dc7644a1c024 Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents: 31881
diff changeset
54 AC_DEFINE([HAVE_ACL_FIRST_ENTRY], [1],
dc7644a1c024 Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents: 31881
diff changeset
55 [Define to 1 if the constant ACL_FIRST_ENTRY exists.])
dc7644a1c024 Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents: 31881
diff changeset
56 fi
36626
fa36c6a7c96f Write "Mac OS X" instead of "MacOS X".
Bruno Haible <bruno@clisp.org>
parents: 35926
diff changeset
57 dnl On Mac OS X, other types of ACLs are supported.
32112
dc7644a1c024 Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents: 31881
diff changeset
58 AC_CACHE_CHECK([for ACL_TYPE_EXTENDED],
dc7644a1c024 Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents: 31881
diff changeset
59 [gl_cv_acl_ACL_TYPE_EXTENDED],
33271
91ff2dad8373 acl: fix compilation test
Eric Blake <eblake@redhat.com>
parents: 32250
diff changeset
60 [AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
29837
daad1d35a245 Extend ACL support tests to support OSF/1, MacOS X, HP-UX, AIX.
Bruno Haible <bruno@clisp.org>
parents: 29816
diff changeset
61 [[#include <sys/types.h>
daad1d35a245 Extend ACL support tests to support OSF/1, MacOS X, HP-UX, AIX.
Bruno Haible <bruno@clisp.org>
parents: 29816
diff changeset
62 #include <sys/acl.h>
33271
91ff2dad8373 acl: fix compilation test
Eric Blake <eblake@redhat.com>
parents: 32250
diff changeset
63 int type = ACL_TYPE_EXTENDED;]])],
32112
dc7644a1c024 Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents: 31881
diff changeset
64 [gl_cv_acl_ACL_TYPE_EXTENDED=yes],
dc7644a1c024 Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents: 31881
diff changeset
65 [gl_cv_acl_ACL_TYPE_EXTENDED=no])])
dc7644a1c024 Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents: 31881
diff changeset
66 if test $gl_cv_acl_ACL_TYPE_EXTENDED = yes; then
dc7644a1c024 Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents: 31881
diff changeset
67 AC_DEFINE([HAVE_ACL_TYPE_EXTENDED], [1],
dc7644a1c024 Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents: 31881
diff changeset
68 [Define to 1 if the ACL type ACL_TYPE_EXTENDED exists.])
dc7644a1c024 Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents: 31881
diff changeset
69 fi
dc7644a1c024 Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents: 31881
diff changeset
70 else
dc7644a1c024 Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents: 31881
diff changeset
71 LIB_ACL=
dc7644a1c024 Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents: 31881
diff changeset
72 fi
dc7644a1c024 Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents: 31881
diff changeset
73 ])
29837
daad1d35a245 Extend ACL support tests to support OSF/1, MacOS X, HP-UX, AIX.
Bruno Haible <bruno@clisp.org>
parents: 29816
diff changeset
74 fi
daad1d35a245 Extend ACL support tests to support OSF/1, MacOS X, HP-UX, AIX.
Bruno Haible <bruno@clisp.org>
parents: 29816
diff changeset
75
daad1d35a245 Extend ACL support tests to support OSF/1, MacOS X, HP-UX, AIX.
Bruno Haible <bruno@clisp.org>
parents: 29816
diff changeset
76 dnl Test for Solaris API (Solaris, Cygwin).
daad1d35a245 Extend ACL support tests to support OSF/1, MacOS X, HP-UX, AIX.
Bruno Haible <bruno@clisp.org>
parents: 29816
diff changeset
77 if test $use_acl = 0; then
33448
dbbf0a64f6dc acl: Add support for ACLs on NonStop Kernel.
Bruno Haible <bruno@clisp.org>
parents: 33271
diff changeset
78 AC_CHECK_FUNCS([facl])
dbbf0a64f6dc acl: Add support for ACLs on NonStop Kernel.
Bruno Haible <bruno@clisp.org>
parents: 33271
diff changeset
79 if test $ac_cv_func_facl = yes; then
32112
dc7644a1c024 Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents: 31881
diff changeset
80 AC_SEARCH_LIBS([acl_trivial], [sec],
dc7644a1c024 Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents: 31881
diff changeset
81 [if test "$ac_cv_search_acl_trivial" != "none required"; then
dc7644a1c024 Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents: 31881
diff changeset
82 LIB_ACL=$ac_cv_search_acl_trivial
dc7644a1c024 Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents: 31881
diff changeset
83 fi
dc7644a1c024 Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents: 31881
diff changeset
84 ])
dc7644a1c024 Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents: 31881
diff changeset
85 AC_CHECK_FUNCS([acl_trivial])
dc7644a1c024 Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents: 31881
diff changeset
86 use_acl=1
dc7644a1c024 Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents: 31881
diff changeset
87 fi
29837
daad1d35a245 Extend ACL support tests to support OSF/1, MacOS X, HP-UX, AIX.
Bruno Haible <bruno@clisp.org>
parents: 29816
diff changeset
88 fi
daad1d35a245 Extend ACL support tests to support OSF/1, MacOS X, HP-UX, AIX.
Bruno Haible <bruno@clisp.org>
parents: 29816
diff changeset
89
daad1d35a245 Extend ACL support tests to support OSF/1, MacOS X, HP-UX, AIX.
Bruno Haible <bruno@clisp.org>
parents: 29816
diff changeset
90 dnl Test for HP-UX API.
33448
dbbf0a64f6dc acl: Add support for ACLs on NonStop Kernel.
Bruno Haible <bruno@clisp.org>
parents: 33271
diff changeset
91 if test $use_acl = 0; then
32112
dc7644a1c024 Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents: 31881
diff changeset
92 AC_CHECK_FUNCS([getacl])
dc7644a1c024 Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents: 31881
diff changeset
93 if test $ac_cv_func_getacl = yes; then
dc7644a1c024 Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents: 31881
diff changeset
94 use_acl=1
dc7644a1c024 Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents: 31881
diff changeset
95 fi
34596
b0b4a24a0ad1 acl: Add support for HP-UX >= 11.11 JFS ACLs.
Bruno Haible <bruno@clisp.org>
parents: 33770
diff changeset
96 dnl Test for HP-UX 11.11 API.
b0b4a24a0ad1 acl: Add support for HP-UX >= 11.11 JFS ACLs.
Bruno Haible <bruno@clisp.org>
parents: 33770
diff changeset
97 AC_CHECK_HEADERS([aclv.h], [], [], [#include <sys/types.h>])
29837
daad1d35a245 Extend ACL support tests to support OSF/1, MacOS X, HP-UX, AIX.
Bruno Haible <bruno@clisp.org>
parents: 29816
diff changeset
98 fi
daad1d35a245 Extend ACL support tests to support OSF/1, MacOS X, HP-UX, AIX.
Bruno Haible <bruno@clisp.org>
parents: 29816
diff changeset
99
daad1d35a245 Extend ACL support tests to support OSF/1, MacOS X, HP-UX, AIX.
Bruno Haible <bruno@clisp.org>
parents: 29816
diff changeset
100 dnl Test for AIX API (AIX 5.3 or newer).
daad1d35a245 Extend ACL support tests to support OSF/1, MacOS X, HP-UX, AIX.
Bruno Haible <bruno@clisp.org>
parents: 29816
diff changeset
101 if test $use_acl = 0; then
32112
dc7644a1c024 Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents: 31881
diff changeset
102 AC_CHECK_FUNCS([aclx_get])
dc7644a1c024 Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents: 31881
diff changeset
103 if test $ac_cv_func_aclx_get = yes; then
dc7644a1c024 Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents: 31881
diff changeset
104 use_acl=1
dc7644a1c024 Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents: 31881
diff changeset
105 fi
29837
daad1d35a245 Extend ACL support tests to support OSF/1, MacOS X, HP-UX, AIX.
Bruno Haible <bruno@clisp.org>
parents: 29816
diff changeset
106 fi
daad1d35a245 Extend ACL support tests to support OSF/1, MacOS X, HP-UX, AIX.
Bruno Haible <bruno@clisp.org>
parents: 29816
diff changeset
107
daad1d35a245 Extend ACL support tests to support OSF/1, MacOS X, HP-UX, AIX.
Bruno Haible <bruno@clisp.org>
parents: 29816
diff changeset
108 dnl Test for older AIX API.
daad1d35a245 Extend ACL support tests to support OSF/1, MacOS X, HP-UX, AIX.
Bruno Haible <bruno@clisp.org>
parents: 29816
diff changeset
109 if test $use_acl = 0 || test "$ac_cv_func_aclx_get" = yes; then
32112
dc7644a1c024 Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents: 31881
diff changeset
110 AC_CHECK_FUNCS([statacl])
dc7644a1c024 Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents: 31881
diff changeset
111 if test $ac_cv_func_statacl = yes; then
dc7644a1c024 Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents: 31881
diff changeset
112 use_acl=1
dc7644a1c024 Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents: 31881
diff changeset
113 fi
29837
daad1d35a245 Extend ACL support tests to support OSF/1, MacOS X, HP-UX, AIX.
Bruno Haible <bruno@clisp.org>
parents: 29816
diff changeset
114 fi
daad1d35a245 Extend ACL support tests to support OSF/1, MacOS X, HP-UX, AIX.
Bruno Haible <bruno@clisp.org>
parents: 29816
diff changeset
115
33448
dbbf0a64f6dc acl: Add support for ACLs on NonStop Kernel.
Bruno Haible <bruno@clisp.org>
parents: 33271
diff changeset
116 dnl Test for NonStop Kernel API.
dbbf0a64f6dc acl: Add support for ACLs on NonStop Kernel.
Bruno Haible <bruno@clisp.org>
parents: 33271
diff changeset
117 if test $use_acl = 0; then
dbbf0a64f6dc acl: Add support for ACLs on NonStop Kernel.
Bruno Haible <bruno@clisp.org>
parents: 33271
diff changeset
118 AC_CHECK_FUNCS([aclsort])
dbbf0a64f6dc acl: Add support for ACLs on NonStop Kernel.
Bruno Haible <bruno@clisp.org>
parents: 33271
diff changeset
119 if test $ac_cv_func_aclsort = yes; then
dbbf0a64f6dc acl: Add support for ACLs on NonStop Kernel.
Bruno Haible <bruno@clisp.org>
parents: 33271
diff changeset
120 use_acl=1
dbbf0a64f6dc acl: Add support for ACLs on NonStop Kernel.
Bruno Haible <bruno@clisp.org>
parents: 33271
diff changeset
121 fi
dbbf0a64f6dc acl: Add support for ACLs on NonStop Kernel.
Bruno Haible <bruno@clisp.org>
parents: 33271
diff changeset
122 fi
dbbf0a64f6dc acl: Add support for ACLs on NonStop Kernel.
Bruno Haible <bruno@clisp.org>
parents: 33271
diff changeset
123
29273
fa206fc2b477 Add a configure time option: --disable-acl.
Mike Frysinger <vapier@gentoo.org>
parents: 29200
diff changeset
124 LIBS=$ac_save_LIBS
fa206fc2b477 Add a configure time option: --disable-acl.
Mike Frysinger <vapier@gentoo.org>
parents: 29200
diff changeset
125 fi
fa206fc2b477 Add a configure time option: --disable-acl.
Mike Frysinger <vapier@gentoo.org>
parents: 29200
diff changeset
126 if test "x$enable_acl$use_acl" = "xyes0"; then
fa206fc2b477 Add a configure time option: --disable-acl.
Mike Frysinger <vapier@gentoo.org>
parents: 29200
diff changeset
127 AC_MSG_ERROR([ACLs enabled but support not detected])
31881
5a29d973e371 acl: warn if ACL support is not detected
Pádraig Brady <P@draigBrady.com>
parents: 30698
diff changeset
128 elif test "x$enable_acl$use_acl" = "xauto0"; then
5a29d973e371 acl: warn if ACL support is not detected
Pádraig Brady <P@draigBrady.com>
parents: 30698
diff changeset
129 AC_MSG_WARN([libacl development library was not found or not usable.])
5a29d973e371 acl: warn if ACL support is not detected
Pádraig Brady <P@draigBrady.com>
parents: 30698
diff changeset
130 AC_MSG_WARN([AC_PACKAGE_NAME will be built without ACL support.])
29273
fa206fc2b477 Add a configure time option: --disable-acl.
Mike Frysinger <vapier@gentoo.org>
parents: 29200
diff changeset
131 fi
28167
42911303950a Add limited support for Solaris 10 ZFS-style ACLs: just enough to
Paul Eggert <eggert@cs.ucla.edu>
parents: 27416
diff changeset
132 fi
29192
6e29897cb8b7 Add support for Solaris 10 ACLs. Also, ACLs are Gnulib, not Autoconf.
Paul Eggert <eggert@cs.ucla.edu>
parents: 28167
diff changeset
133 AC_SUBST([LIB_ACL])
6e29897cb8b7 Add support for Solaris 10 ACLs. Also, ACLs are Gnulib, not Autoconf.
Paul Eggert <eggert@cs.ucla.edu>
parents: 28167
diff changeset
134 AC_DEFINE_UNQUOTED([USE_ACL], [$use_acl],
6e29897cb8b7 Add support for Solaris 10 ACLs. Also, ACLs are Gnulib, not Autoconf.
Paul Eggert <eggert@cs.ucla.edu>
parents: 28167
diff changeset
135 [Define to nonzero if you want access control list support.])
30135
7b4e990d9c2c avoid spurious test failure when library is built without ACL support
Jim Meyering <meyering@redhat.com>
parents: 29837
diff changeset
136 USE_ACL=$use_acl
7b4e990d9c2c avoid spurious test failure when library is built without ACL support
Jim Meyering <meyering@redhat.com>
parents: 29837
diff changeset
137 AC_SUBST([USE_ACL])
23799
8821dc8fb5c7 An independent .m4 file for each module.
Bruno Haible <bruno@clisp.org>
parents: 23451
diff changeset
138 ])
27062
8561bd94a9c9 * acl.m4 (AC_FUNC_ACL): Disable ACL support altogether
Jim Meyering <jim@meyering.net>
parents: 26863
diff changeset
139
8561bd94a9c9 * acl.m4 (AC_FUNC_ACL): Disable ACL support altogether
Jim Meyering <jim@meyering.net>
parents: 26863
diff changeset
140 # gl_ACL_GET_FILE(IF-WORKS, IF-NOT)
8561bd94a9c9 * acl.m4 (AC_FUNC_ACL): Disable ACL support altogether
Jim Meyering <jim@meyering.net>
parents: 26863
diff changeset
141 # -------------------------------------
35926
382eb53c160b In commentary, do not use ` to quote.
Paul Eggert <eggert@cs.ucla.edu>
parents: 35892
diff changeset
142 # If 'acl_get_file' works (does not have a particular bug),
27062
8561bd94a9c9 * acl.m4 (AC_FUNC_ACL): Disable ACL support altogether
Jim Meyering <jim@meyering.net>
parents: 26863
diff changeset
143 # run IF-WORKS, otherwise, IF-NOT.
37206
9a5e8b72769e acl: allow cross-compilation to Gentoo
Paul Eggert <eggert@cs.ucla.edu>
parents: 36940
diff changeset
144 # When building natively, test for a Darwin 8.7.0 bug, whereby acl_get_file
9a5e8b72769e acl: allow cross-compilation to Gentoo
Paul Eggert <eggert@cs.ucla.edu>
parents: 36940
diff changeset
145 # returns NULL, but sets errno = ENOENT for an existing file or directory.
9a5e8b72769e acl: allow cross-compilation to Gentoo
Paul Eggert <eggert@cs.ucla.edu>
parents: 36940
diff changeset
146 # When cross-compiling, assume that this old bug no longer applies.
27062
8561bd94a9c9 * acl.m4 (AC_FUNC_ACL): Disable ACL support altogether
Jim Meyering <jim@meyering.net>
parents: 26863
diff changeset
147 AC_DEFUN([gl_ACL_GET_FILE],
8561bd94a9c9 * acl.m4 (AC_FUNC_ACL): Disable ACL support altogether
Jim Meyering <jim@meyering.net>
parents: 26863
diff changeset
148 [
30698
2798e1a19fcc many *.m4 files: improve m4 quoting
Jim Meyering <meyering@redhat.com>
parents: 30135
diff changeset
149 AC_CACHE_CHECK([for working acl_get_file], [gl_cv_func_working_acl_get_file],
37206
9a5e8b72769e acl: allow cross-compilation to Gentoo
Paul Eggert <eggert@cs.ucla.edu>
parents: 36940
diff changeset
150 [gl_cv_func_working_acl_get_file=no
9a5e8b72769e acl: allow cross-compilation to Gentoo
Paul Eggert <eggert@cs.ucla.edu>
parents: 36940
diff changeset
151 AC_LINK_IFELSE(
27062
8561bd94a9c9 * acl.m4 (AC_FUNC_ACL): Disable ACL support altogether
Jim Meyering <jim@meyering.net>
parents: 26863
diff changeset
152 [AC_LANG_PROGRAM(
32112
dc7644a1c024 Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents: 31881
diff changeset
153 [[#include <sys/types.h>
dc7644a1c024 Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents: 31881
diff changeset
154 #include <sys/acl.h>
dc7644a1c024 Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents: 31881
diff changeset
155 #include <errno.h>
dc7644a1c024 Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents: 31881
diff changeset
156 ]],
33609
c0a1fe70f448 Put more information about failed tests into the test return codes.
Bruno Haible <bruno@clisp.org>
parents: 33448
diff changeset
157 [[if (!acl_get_file (".", ACL_TYPE_ACCESS) && errno == ENOENT)
c0a1fe70f448 Put more information about failed tests into the test return codes.
Bruno Haible <bruno@clisp.org>
parents: 33448
diff changeset
158 return 1;
c0a1fe70f448 Put more information about failed tests into the test return codes.
Bruno Haible <bruno@clisp.org>
parents: 33448
diff changeset
159 return 0;
c0a1fe70f448 Put more information about failed tests into the test return codes.
Bruno Haible <bruno@clisp.org>
parents: 33448
diff changeset
160 ]])],
37206
9a5e8b72769e acl: allow cross-compilation to Gentoo
Paul Eggert <eggert@cs.ucla.edu>
parents: 36940
diff changeset
161 [if test $cross_compiling = yes; then
9a5e8b72769e acl: allow cross-compilation to Gentoo
Paul Eggert <eggert@cs.ucla.edu>
parents: 36940
diff changeset
162 gl_cv_func_working_acl_get_file="guessing yes"
9a5e8b72769e acl: allow cross-compilation to Gentoo
Paul Eggert <eggert@cs.ucla.edu>
parents: 36940
diff changeset
163 elif ./conftest$ac_exeext; then
9a5e8b72769e acl: allow cross-compilation to Gentoo
Paul Eggert <eggert@cs.ucla.edu>
parents: 36940
diff changeset
164 gl_cv_func_working_acl_get_file=yes
9a5e8b72769e acl: allow cross-compilation to Gentoo
Paul Eggert <eggert@cs.ucla.edu>
parents: 36940
diff changeset
165 fi])])
9a5e8b72769e acl: allow cross-compilation to Gentoo
Paul Eggert <eggert@cs.ucla.edu>
parents: 36940
diff changeset
166 AS_IF([test "$gl_cv_func_working_acl_get_file" != no], [$1], [$2])
27062
8561bd94a9c9 * acl.m4 (AC_FUNC_ACL): Disable ACL support altogether
Jim Meyering <jim@meyering.net>
parents: 26863
diff changeset
167 ])