Blame m4/lchown.m4

Packit 8f70b4
# serial 17
Packit 8f70b4
# Determine whether we need the lchown wrapper.
Packit 8f70b4
Packit 8f70b4
dnl Copyright (C) 1998, 2001, 2003-2007, 2009-2018 Free Software Foundation,
Packit 8f70b4
dnl Inc.
Packit 8f70b4
Packit 8f70b4
dnl This file is free software; the Free Software Foundation
Packit 8f70b4
dnl gives unlimited permission to copy and/or distribute it,
Packit 8f70b4
dnl with or without modifications, as long as this notice is preserved.
Packit 8f70b4
Packit 8f70b4
dnl From Jim Meyering.
Packit 8f70b4
dnl Provide lchown on systems that lack it, and work around bugs
Packit 8f70b4
dnl on systems that have it.
Packit 8f70b4
Packit 8f70b4
AC_DEFUN([gl_FUNC_LCHOWN],
Packit 8f70b4
[
Packit 8f70b4
  AC_REQUIRE([gl_UNISTD_H_DEFAULTS])
Packit 8f70b4
  AC_REQUIRE([gl_FUNC_CHOWN])
Packit 8f70b4
  AC_CHECK_FUNCS_ONCE([lchmod])
Packit 8f70b4
  AC_CHECK_FUNCS([lchown])
Packit 8f70b4
  if test $ac_cv_func_lchown = no; then
Packit 8f70b4
    HAVE_LCHOWN=0
Packit 8f70b4
  else
Packit 8f70b4
    dnl Trailing slash and ctime bugs in chown also occur in lchown.
Packit 8f70b4
    case "$gl_cv_func_chown_slash_works" in
Packit 8f70b4
      *yes) ;;
Packit 8f70b4
      *)
Packit 8f70b4
        REPLACE_LCHOWN=1
Packit 8f70b4
        ;;
Packit 8f70b4
    esac
Packit 8f70b4
    case "$gl_cv_func_chown_ctime_works" in
Packit 8f70b4
      *yes) ;;
Packit 8f70b4
      *)
Packit 8f70b4
        REPLACE_LCHOWN=1
Packit 8f70b4
        ;;
Packit 8f70b4
    esac
Packit 8f70b4
  fi
Packit 8f70b4
])