Debian Codegraph @

m4/getusershell.m4

raw
1 # getusershell.m4
2 # serial 8
3 dnl Copyright (C) 2002-2003, 2006, 2008-2026 Free Software Foundation, Inc.
4 dnl This file is free software; the Free Software Foundation
5 dnl gives unlimited permission to copy and/or distribute it,
6 dnl with or without modifications, as long as this notice is preserved.
7 dnl This file is offered as-is, without any warranty.
8
9 AC_DEFUN([gl_FUNC_GETUSERSHELL],
10 [
11 AC_REQUIRE([gl_UNISTD_H_DEFAULTS])
12 AC_REQUIRE([AC_CANONICAL_HOST])
13
14 dnl Persuade glibc <unistd.h> to declare {get,set,end}usershell().
15 AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
16
17 dnl Check whether the getusershell function exists.
18 AC_CHECK_FUNCS_ONCE([getusershell])
19 if test $ac_cv_func_getusershell = yes; then
20 HAVE_GETUSERSHELL=1
21 dnl Check whether getusershell is declared.
22 AC_CHECK_DECLS([getusershell])
23 if test $ac_cv_have_decl_getusershell = no; then
24 HAVE_DECL_GETUSERSHELL=0
25 fi
26 else
27 HAVE_GETUSERSHELL=0
28 dnl Assume that on platforms which declare it, the function exists.
29 HAVE_DECL_GETUSERSHELL=0
30 fi
31 dnl Replace the function on musl unconditionally.
32 dnl See: https://www.openwall.com/lists/musl/2024/05/18/1
33 case "$host_os" in
34 *-musl* | midipix*) REPLACE_GETUSERSHELL=1 ;;
35 esac
36 ])
37
38 # Prerequisites of lib/getusershell.c.
39 AC_DEFUN([gl_PREREQ_GETUSERSHELL], [:])