df: avoid stat() for dummy file systems with -l
[coreutils.git] / m4 / check-decl.m4
blob2bcf1d4648b3755f413cf7d14817c9fa7106ae0b
1 #serial 26
2 # Check declarations for this package.
4 dnl Copyright (C) 1997-2017 Free Software Foundation, Inc.
6 dnl This file is free software; the Free Software Foundation
7 dnl gives unlimited permission to copy and/or distribute it,
8 dnl with or without modifications, as long as this notice is preserved.
11 dnl This is just a wrapper function to encapsulate this kludge.
12 dnl Putting it in a separate file like this helps share it between
13 dnl different packages.
14 AC_DEFUN([gl_CHECK_DECLS],
16   AC_REQUIRE([AC_HEADER_TIME])
18   AC_CHECK_HEADERS_ONCE([grp.h pwd.h])
19   headers='
20 #include <sys/types.h>
22 #include <unistd.h>
24 #if HAVE_GRP_H
25 # include <grp.h>
26 #endif
28 #if HAVE_PWD_H
29 # include <pwd.h>
30 #endif
32   AC_CHECK_DECLS([
33     getgrgid,
34     getpwuid,
35     ttyname], , , $headers)
37   AC_CHECK_DECLS_ONCE([geteuid])
38   AC_CHECK_DECLS_ONCE([getlogin])
39   AC_CHECK_DECLS_ONCE([getuid])