diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2007-12-03 15:30:36 -0800 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2007-12-03 15:30:36 -0800 |
commit | 0a9d9877fef46e7bc0a3eff16081d37016569981 (patch) | |
tree | 5db08bb19412a91a572692de2a7e3cbfa8e5fbb8 /m4/acl.m4 | |
parent | 07dcdcf7743b1664cb49ee7f0922f314f011a3af (diff) | |
download | gnulib-0a9d9877fef46e7bc0a3eff16081d37016569981.tar.gz |
Add support for Solaris 10 ACLs. Also, ACLs are Gnulib, not Autoconf.
* modules/acl (configure.ac): Rename AC_FUNC_ACL to gl_FUNC_ACL.
* m4/acl.m4 (gl_FUNC_ACL): Renamed from AC_FUNC_ACL. On Solaris,
put -lsec in even for programs other than 'ls'. This fixes a problem
for gettext reported by Bruno Haible in
<http://lists.gnu.org/archive/html/bug-gnulib/2007-12/msg00007.html>.
* lib/acl.c (copy_acl, qset_acl) [USE_ACL && defined ACL_NO_TRIVIAL]:
Add support for Solaris 10. This isn't efficient, but should get the
job done for now.
Diffstat (limited to 'm4/acl.m4')
-rw-r--r-- | m4/acl.m4 | 76 |
1 files changed, 40 insertions, 36 deletions
@@ -7,50 +7,54 @@ # Written by Paul Eggert and Jim Meyering. -AC_DEFUN([AC_FUNC_ACL], +AC_DEFUN([gl_FUNC_ACL], [ AC_LIBOBJ([acl]) AC_LIBOBJ([file-has-acl]) dnl Prerequisites of lib/acl.c. + LIB_ACL= + use_acl=0 AC_CHECK_HEADERS(sys/acl.h) - AC_CHECK_FUNCS(acl) - ac_save_LIBS="$LIBS" - AC_SEARCH_LIBS(acl_get_file, acl, - [test "$ac_cv_search_acl_get_file" = "none required" || - LIB_ACL=$ac_cv_search_acl_get_file]) - AC_SUBST(LIB_ACL) - AC_CHECK_HEADERS(acl/libacl.h) - AC_CHECK_FUNCS(acl_get_file acl_get_fd acl_set_file acl_set_fd \ - acl_free acl_from_mode acl_from_text \ - acl_delete_def_file acl_extended_file) - if test $ac_cv_header_sys_acl_h = yes; then - use_acl=1 - if test $ac_cv_func_acl_get_file = yes; then - # If we detect the acl_get_file bug, disable ACL support altogether. - gl_ACL_GET_FILE( , [use_acl=0]) - fi - else - use_acl=0 - fi - if test $use_acl = 1 && - test $ac_cv_func_acl_get_file = yes && - test $ac_cv_func_acl_free = yes; then - AC_REPLACE_FUNCS([acl_entries]) - fi - LIBS="$ac_save_LIBS" - if test $use_acl = 1; then - ac_save_LIBS="$LIBS" + if test $ac_cv_header_sys_acl_h = yes; then + ac_save_LIBS=$LIBS + AC_CHECK_FUNCS([acl]) + use_acl=1 AC_SEARCH_LIBS([acl_trivial], [sec], - [AC_DEFINE([HAVE_ACL_TRIVIAL], 1, - [Define to 1 if you have the `acl_trivial' function.]) - test "$ac_cv_search_acl_trivial" = "none required" || - LIB_ACL_TRIVIAL="$ac_cv_search_acl_trivial"]) - AC_SUBST([LIB_ACL_TRIVIAL]) - LIBS="$ac_save_LIBS" + [test "$ac_cv_search_acl_trivial" = "none required" || + LIB_ACL=$ac_cv_search_acl_trivial + AC_CHECK_FUNCS([acl_trivial])], + [if test $ac_cv_func_acl_trivial != yes; then + AC_SEARCH_LIBS([acl_get_file], [acl], + [test "$ac_cv_search_acl_get_file" = "none required" || + LIB_ACL=$ac_cv_search_acl_get_file + AC_CHECK_FUNCS( + [acl_get_file acl_get_fd acl_set_file acl_set_fd \ + acl_free acl_from_mode acl_from_text \ + acl_delete_def_file acl_extended_file]) + if test $ac_cv_func_acl_get_file = yes; then + # If the acl_get_file bug is detected, disable all ACL support. + gl_ACL_GET_FILE( , [use_acl=0]) + fi + if test $use_acl = 1; then + AC_CHECK_HEADERS([acl/libacl.h]) + if test $ac_cv_func_acl_get_file = yes && + test $ac_cv_func_acl_free = yes; then + AC_REPLACE_FUNCS([acl_entries]) + fi + else + LIB_ACL= + fi]) + fi]) + LIBS=$ac_save_LIBS fi - AC_DEFINE_UNQUOTED(USE_ACL, $use_acl, - [Define if you want access control list support.]) + AC_SUBST([LIB_ACL]) + AC_DEFINE_UNQUOTED([USE_ACL], [$use_acl], + [Define to nonzero if you want access control list support.]) + + # This is for backwards compatibility; remove this by the end of 2007. + LIB_ACL_TRIVIAL= + AC_SUBST([LIB_ACL_TRIVIAL]) ]) # gl_ACL_GET_FILE(IF-WORKS, IF-NOT) |