| 1 |
# lchown.m4 |
| 2 |
# serial 18 |
| 3 |
dnl Copyright (C) 1998, 2001, 2003-2007, 2009-2026 Free Software Foundation, |
| 4 |
dnl Inc. |
| 5 |
dnl This file is free software; the Free Software Foundation |
| 6 |
dnl gives unlimited permission to copy and/or distribute it, |
| 7 |
dnl with or without modifications, as long as this notice is preserved. |
| 8 |
dnl This file is offered as-is, without any warranty. |
| 9 |
|
| 10 |
# Determine whether we need the lchown wrapper. |
| 11 |
|
| 12 |
dnl From Jim Meyering. |
| 13 |
dnl Provide lchown on systems that lack it, and work around bugs |
| 14 |
dnl on systems that have it. |
| 15 |
|
| 16 |
AC_DEFUN([gl_FUNC_LCHOWN], |
| 17 |
[ |
| 18 |
AC_REQUIRE([gl_UNISTD_H_DEFAULTS]) |
| 19 |
AC_REQUIRE([gl_FUNC_CHOWN]) |
| 20 |
gl_CHECK_FUNCS_ANDROID([lchmod], [[#include <sys/stat.h>]]) |
| 21 |
AC_CHECK_FUNCS([lchown]) |
| 22 |
if test $ac_cv_func_lchown = no; then |
| 23 |
HAVE_LCHOWN=0 |
| 24 |
else |
| 25 |
dnl Trailing slash and ctime bugs in chown also occur in lchown. |
| 26 |
case "$gl_cv_func_chown_slash_works" in |
| 27 |
*yes) ;; |
| 28 |
*) |
| 29 |
REPLACE_LCHOWN=1 |
| 30 |
;; |
| 31 |
esac |
| 32 |
case "$gl_cv_func_chown_ctime_works" in |
| 33 |
*yes) ;; |
| 34 |
*) |
| 35 |
REPLACE_LCHOWN=1 |
| 36 |
;; |
| 37 |
esac |
| 38 |
fi |
| 39 |
]) |