Tizen 2.0 Release
[external/tizen-coreutils.git] / m4 / check-decl.m4
1 #serial 23
2 # Check declarations for this package.
3
4 dnl Copyright (C) 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006
5 dnl Free Software Foundation, Inc.
6
7 dnl This file is free software; the Free Software Foundation
8 dnl gives unlimited permission to copy and/or distribute it,
9 dnl with or without modifications, as long as this notice is preserved.
10
11
12 dnl This is just a wrapper function to encapsulate this kludge.
13 dnl Putting it in a separate file like this helps share it between
14 dnl different packages.
15 AC_DEFUN([gl_CHECK_DECLS],
16 [
17   AC_REQUIRE([AC_HEADER_TIME])
18
19   AC_CHECK_HEADERS_ONCE(grp.h pwd.h)
20   headers='
21 #include <sys/types.h>
22
23 #include <unistd.h>
24
25 #if HAVE_GRP_H
26 # include <grp.h>
27 #endif
28
29 #if HAVE_PWD_H
30 # include <pwd.h>
31 #endif
32 '
33   AC_CHECK_DECLS([
34     getgrgid,
35     getpwuid,
36     ttyname], , , $headers)
37
38   AC_CHECK_DECLS([isblank], [], [], [#include <ctype.h>])
39
40   AC_CHECK_DECLS_ONCE([free])
41   AC_CHECK_DECLS_ONCE([getenv])
42   AC_CHECK_DECLS_ONCE([geteuid])
43   AC_CHECK_DECLS_ONCE([getlogin])
44   AC_CHECK_DECLS_ONCE([getuid])
45   AC_CHECK_DECLS_ONCE([lseek])
46   AC_CHECK_DECLS_ONCE([malloc])
47   AC_CHECK_DECLS_ONCE([memchr])
48   AC_CHECK_DECLS_ONCE([realloc])
49 ])