# 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.
# 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.
if test "x$enable_acl" != "xno"; then
dnl On all platforms, the ACL related API is declared in <sys/acl.h>.
AC_CHECK_HEADERS([sys/acl.h])
if test $ac_cv_header_sys_acl_h = yes; then
ac_save_LIBS=$LIBS
if test "x$enable_acl" != "xno"; then
dnl On all platforms, the ACL related API is declared in <sys/acl.h>.
AC_CHECK_HEADERS([sys/acl.h])
if test $ac_cv_header_sys_acl_h = yes; then
ac_save_LIBS=$LIBS
- dnl Test for POSIX-draft-like API (Linux, FreeBSD, MacOS X, IRIX, Tru64).
+ dnl Test for POSIX-draft-like API (Linux, FreeBSD, Mac OS X, IRIX, Tru64).
dnl -lacl is needed on Linux, -lpacl is needed on OSF/1.
if test $use_acl = 0; then
AC_SEARCH_LIBS([acl_get_file], [acl pacl],
dnl -lacl is needed on Linux, -lpacl is needed on OSF/1.
if test $use_acl = 0; then
AC_SEARCH_LIBS([acl_get_file], [acl pacl],
AC_REPLACE_FUNCS([acl_entries])
AC_CACHE_CHECK([for ACL_FIRST_ENTRY],
[gl_cv_acl_ACL_FIRST_ENTRY],
AC_REPLACE_FUNCS([acl_entries])
AC_CACHE_CHECK([for ACL_FIRST_ENTRY],
[gl_cv_acl_ACL_FIRST_ENTRY],
[gl_cv_acl_ACL_FIRST_ENTRY=yes],
[gl_cv_acl_ACL_FIRST_ENTRY=no])])
if test $gl_cv_acl_ACL_FIRST_ENTRY = yes; then
AC_DEFINE([HAVE_ACL_FIRST_ENTRY], [1],
[Define to 1 if the constant ACL_FIRST_ENTRY exists.])
fi
[gl_cv_acl_ACL_FIRST_ENTRY=yes],
[gl_cv_acl_ACL_FIRST_ENTRY=no])])
if test $gl_cv_acl_ACL_FIRST_ENTRY = yes; then
AC_DEFINE([HAVE_ACL_FIRST_ENTRY], [1],
[Define to 1 if the constant ACL_FIRST_ENTRY exists.])
fi
AC_CACHE_CHECK([for ACL_TYPE_EXTENDED],
[gl_cv_acl_ACL_TYPE_EXTENDED],
AC_CACHE_CHECK([for ACL_TYPE_EXTENDED],
[gl_cv_acl_ACL_TYPE_EXTENDED],
[gl_cv_acl_ACL_TYPE_EXTENDED=yes],
[gl_cv_acl_ACL_TYPE_EXTENDED=no])])
if test $gl_cv_acl_ACL_TYPE_EXTENDED = yes; then
[gl_cv_acl_ACL_TYPE_EXTENDED=yes],
[gl_cv_acl_ACL_TYPE_EXTENDED=no])])
if test $gl_cv_acl_ACL_TYPE_EXTENDED = yes; then
dnl Test for Solaris API (Solaris, Cygwin).
if test $use_acl = 0; then
dnl Test for Solaris API (Solaris, Cygwin).
if test $use_acl = 0; then
AC_SEARCH_LIBS([acl_trivial], [sec],
[if test "$ac_cv_search_acl_trivial" != "none required"; then
LIB_ACL=$ac_cv_search_acl_trivial
AC_SEARCH_LIBS([acl_trivial], [sec],
[if test "$ac_cv_search_acl_trivial" != "none required"; then
LIB_ACL=$ac_cv_search_acl_trivial
# gl_ACL_GET_FILE(IF-WORKS, IF-NOT)
# -------------------------------------
# gl_ACL_GET_FILE(IF-WORKS, IF-NOT)
# -------------------------------------
# run IF-WORKS, otherwise, IF-NOT.
# This tests for a Darwin 8.7.0 bug, whereby acl_get_file returns NULL,
# but sets errno = ENOENT for an existing file or directory.
# run IF-WORKS, otherwise, IF-NOT.
# This tests for a Darwin 8.7.0 bug, whereby acl_get_file returns NULL,
# but sets errno = ENOENT for an existing file or directory.
- [[return !! (!acl_get_file (".", ACL_TYPE_ACCESS)
- && errno == ENOENT);]])],
+ [[if (!acl_get_file (".", ACL_TYPE_ACCESS) && errno == ENOENT)
+ return 1;
+ return 0;
+ ]])],
[gl_cv_func_working_acl_get_file=yes],
[gl_cv_func_working_acl_get_file=no],
[gl_cv_func_working_acl_get_file=cross-compiling])])
[gl_cv_func_working_acl_get_file=yes],
[gl_cv_func_working_acl_get_file=no],
[gl_cv_func_working_acl_get_file=cross-compiling])])