all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
blob 61e3f11228729733a551713e06c989227ac169dd 2555 bytes (raw)
name: m4/lchmod.m4 	 # note: path name is non-authoritative(*)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
 
#serial 6

dnl Copyright (C) 2005-2006, 2008-2020 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.

dnl From Paul Eggert.
dnl Provide a replacement for lchmod on hosts that lack a working version.

AC_DEFUN([gl_FUNC_LCHMOD],
[
  AC_REQUIRE([gl_SYS_STAT_H_DEFAULTS])

  dnl Persuade glibc <sys/stat.h> to declare lchmod().
  AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])

  AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles

  AC_CHECK_FUNCS_ONCE([fchmodat lchmod lstat])
  if test "$ac_cv_func_lchmod" = no; then
    HAVE_LCHMOD=0
  else
    AC_CACHE_CHECK([whether lchmod works on non-symlinks],
      [gl_cv_func_lchmod_works],
      [AC_RUN_IFELSE(
         [AC_LANG_PROGRAM(
            [
              AC_INCLUDES_DEFAULT[
              #ifndef S_IRUSR
               #define S_IRUSR 0400
              #endif
              #ifndef S_IWUSR
               #define S_IWUSR 0200
              #endif
              #ifndef S_IRWXU
               #define S_IRWXU 0700
              #endif
              #ifndef S_IRWXG
               #define S_IRWXG 0070
              #endif
              #ifndef S_IRWXO
               #define S_IRWXO 0007
              #endif
            ]],
            [[
              int permissive = S_IRWXU | S_IRWXG | S_IRWXO;
              int desired = S_IRUSR | S_IWUSR;
              static char const f[] = "conftest.lchmod";
              struct stat st;
              if (creat (f, permissive) < 0)
                return 1;
              if (lchmod (f, desired) != 0)
                return 1;
              if (stat (f, &st) != 0)
                return 1;
              return ! ((st.st_mode & permissive) == desired);
            ]])],
         [gl_cv_func_lchmod_works=yes],
         [gl_cv_func_lchmod_works=no],
         [case "$host_os" in
            dnl Guess no on Linux with glibc, yes otherwise.
            linux-gnu*) gl_cv_func_lchmod_works="guessing no" ;;
            *)          gl_cv_func_lchmod_works="$gl_cross_guess_normal" ;;
          esac
         ])
       rm -f conftest.lchmod])
    case $gl_cv_func_lchmod_works in
      *yes) ;;
      *)
        AC_DEFINE([NEED_LCHMOD_NONSYMLINK_FIX], [1],
          [Define to 1 if lchmod does not work right on non-symlinks.])
        REPLACE_LCHMOD=1
        ;;
    esac
  fi
])

# Prerequisites of lib/lchmod.c.
AC_DEFUN([gl_PREREQ_LCHMOD],
[
  AC_REQUIRE([AC_C_INLINE])
  :
])

debug log:

solving 61e3f11228 ...
found 61e3f11228 in https://yhetil.org/emacs/20200220003400.265566-1-eggert@cs.ucla.edu/

applying [1/1] https://yhetil.org/emacs/20200220003400.265566-1-eggert@cs.ucla.edu/
diff --git a/m4/lchmod.m4 b/m4/lchmod.m4
new file mode 100644
index 0000000000..61e3f11228

Checking patch m4/lchmod.m4...
Applied patch m4/lchmod.m4 cleanly.

index at:
100644 61e3f11228729733a551713e06c989227ac169dd	m4/lchmod.m4

(*) Git path names are given by the tree(s) the blob belongs to.
    Blobs themselves have no identifier aside from the hash of its contents.^

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.