1
0
mirror of git://git.sv.gnu.org/coreutils.git synced 2026-04-20 10:51:48 +02:00
Files
coreutils/m4/check-decl.m4

86 lines
1.4 KiB
Plaintext
Raw Normal View History

#serial 18
1997-12-14 15:03:38 +00:00
1997-10-24 01:42:27 +00:00
dnl This is just a wrapper function to encapsulate this kludge.
dnl Putting it in a separate file like this helps share it between
dnl different packages.
AC_DEFUN([jm_CHECK_DECLS],
1997-10-24 01:42:27 +00:00
[
AC_REQUIRE([_jm_DECL_HEADERS])
AC_REQUIRE([AC_HEADER_TIME])
headers='
#include <stdio.h>
#if HAVE_STRING_H
# if !STDC_HEADERS && HAVE_MEMORY_H
# include <memory.h>
# endif
# include <string.h>
#else
# if HAVE_STRINGS_H
# include <strings.h>
# endif
#endif
#if HAVE_STDLIB_H
# include <stdlib.h>
#endif
#if HAVE_UNISTD_H
# include <unistd.h>
#endif
#include <sys/types.h>
#if TIME_WITH_SYS_TIME
# include <sys/time.h>
# include <time.h>
#else
# if HAVE_SYS_TIME_H
# include <sys/time.h>
# else
# include <time.h>
# endif
#endif
#if HAVE_UTMP_H
# include <utmp.h>
#endif
#if HAVE_GRP_H
# include <grp.h>
#endif
#if HAVE_PWD_H
# include <pwd.h>
#endif
'
AC_CHECK_DECLS([
free,
getenv,
geteuid,
2000-07-23 18:44:35 +00:00
getgrgid,
getlogin,
2000-07-23 18:44:35 +00:00
getpwuid,
getuid,
2000-04-05 15:22:04 +00:00
getutent,
lseek,
malloc,
memchr,
memrchr,
nanosleep,
realloc,
stpcpy,
2000-05-03 08:37:03 +00:00
strndup,
2000-07-04 09:03:26 +00:00
strnlen,
strstr,
strtoul,
strtoull,
ttyname], , , $headers)
1997-10-24 01:42:27 +00:00
])
dnl FIXME: when autoconf has support for it.
dnl This is a little helper so we can require these header checks.
AC_DEFUN([_jm_DECL_HEADERS],
[
AC_REQUIRE([AC_HEADER_STDC])
AC_CHECK_HEADERS(grp.h memory.h pwd.h string.h strings.h stdlib.h \
unistd.h sys/time.h utmp.h utmpx.h)
])