2006-09-19 02:49:20 +04:00
# filesys
AC_HEADER_DIRENT
2007-03-23 13:30:51 +03:00
AC_CHECK_HEADERS(fcntl.h sys/fcntl.h sys/resource.h sys/ioctl.h sys/mode.h sys/filio.h sys/fs/s5param.h sys/filsys.h)
2010-05-30 23:44:14 +04:00
AC_CHECK_HEADERS(sys/acl.h acl/libacl.h sys/file.h)
2006-09-19 02:49:20 +04:00
# select
AC_CHECK_HEADERS(sys/select.h)
2011-02-09 21:22:25 +03:00
# poll
AC_CHECK_HEADERS(poll.h)
AC_CHECK_FUNCS(poll,[],[LIBREPLACEOBJ="${LIBREPLACEOBJ} $libreplacedir/poll.o"])
2006-09-19 02:49:20 +04:00
# time
AC_CHECK_HEADERS(sys/time.h utime.h)
AC_HEADER_TIME
2008-05-07 15:10:31 +04:00
AC_CHECK_FUNCS(utime utimes)
2006-09-19 02:49:20 +04:00
2010-08-30 16:35:49 +04:00
AC_CACHE_CHECK([if gettimeofday takes TZ argument],libreplace_cv_HAVE_GETTIMEOFDAY_TZ,[
AC_TRY_RUN([
#include <sys/time.h>
#include <unistd.h>
main() { struct timeval tv; exit(gettimeofday(&tv, NULL));}],
libreplace_cv_HAVE_GETTIMEOFDAY_TZ=yes,libreplace_cv_HAVE_GETTIMEOFDAY_TZ=no,libreplace_cv_HAVE_GETTIMEOFDAY_TZ=yes)])
if test x"$libreplace_cv_HAVE_GETTIMEOFDAY_TZ" = x"yes"; then
AC_DEFINE(HAVE_GETTIMEOFDAY_TZ,1,[Whether gettimeofday() is available])
fi
2006-09-19 02:49:20 +04:00
# wait
AC_HEADER_SYS_WAIT
# capability
AC_CHECK_HEADERS(sys/capability.h)
2007-12-03 18:43:51 +03:00
case "$host_os" in
*linux*)
2008-02-20 14:49:30 +03:00
AC_CACHE_CHECK([for broken RedHat 7.2 system header files],libreplace_cv_BROKEN_REDHAT_7_SYSTEM_HEADERS,[
2007-12-03 18:43:51 +03:00
AC_TRY_COMPILE([
2007-12-03 18:50:55 +03:00
#ifdef HAVE_SYS_VFS_H
#include <sys/vfs.h>
#endif
#ifdef HAVE_SYS_CAPABILITY_H
#include <sys/capability.h>
#endif
],[
int i;
],
2008-02-20 14:49:30 +03:00
libreplace_cv_BROKEN_REDHAT_7_SYSTEM_HEADERS=no,
libreplace_cv_BROKEN_REDHAT_7_SYSTEM_HEADERS=yes
2007-12-03 18:50:55 +03:00
)])
2008-02-20 14:49:30 +03:00
if test x"$libreplace_cv_BROKEN_REDHAT_7_SYSTEM_HEADERS" = x"yes"; then
2007-12-03 18:50:55 +03:00
AC_DEFINE(BROKEN_REDHAT_7_SYSTEM_HEADERS,1,[Broken RedHat 7.2 system header files])
2007-12-03 18:43:51 +03:00
fi
2008-02-20 14:49:30 +03:00
AC_CACHE_CHECK([for broken RHEL5 sys/capability.h],libreplace_cv_BROKEN_RHEL5_SYS_CAP_HEADER,[
2007-12-03 18:43:51 +03:00
AC_TRY_COMPILE([
2007-12-03 18:50:55 +03:00
#ifdef HAVE_SYS_CAPABILITY_H
#include <sys/capability.h>
#endif
#include <linux/types.h>
],[
__s8 i;
],
2008-02-20 14:49:30 +03:00
libreplace_cv_BROKEN_RHEL5_SYS_CAP_HEADER=no,
libreplace_cv_BROKEN_RHEL5_SYS_CAP_HEADER=yes
2007-12-03 18:50:55 +03:00
)])
2008-02-20 14:49:30 +03:00
if test x"$libreplace_cv_BROKEN_RHEL5_SYS_CAP_HEADER" = x"yes"; then
2007-12-03 18:50:55 +03:00
AC_DEFINE(BROKEN_RHEL5_SYS_CAP_HEADER,1,[Broken RHEL5 sys/capability.h])
2007-12-03 18:43:51 +03:00
fi
;;
esac
2006-09-19 02:49:20 +04:00
# passwd
AC_CHECK_HEADERS(grp.h sys/id.h compat.h shadow.h sys/priv.h pwd.h sys/security.h)
2007-11-06 10:26:12 +03:00
AC_CHECK_FUNCS(getpwnam_r getpwuid_r getpwent_r)
2007-11-06 12:15:11 +03:00
AC_HAVE_DECL(getpwent_r, [
#include <unistd.h>
#include <pwd.h>
])
AC_VERIFY_C_PROTOTYPE([struct passwd *getpwent_r(struct passwd *src, char *buf, int buflen)],
[
#ifndef HAVE_GETPWENT_R_DECL
#error missing getpwent_r prototype
#endif
return NULL;
],[
AC_DEFINE(SOLARIS_GETPWENT_R, 1, [getpwent_r solaris function prototype])
],[],[
#include <unistd.h>
#include <pwd.h>
])
2008-01-22 14:21:55 +03:00
AC_VERIFY_C_PROTOTYPE([struct passwd *getpwent_r(struct passwd *src, char *buf, size_t buflen)],
[
#ifndef HAVE_GETPWENT_R_DECL
#error missing getpwent_r prototype
#endif
return NULL;
],[
AC_DEFINE(SOLARIS_GETPWENT_R, 1, [getpwent_r irix (similar to solaris) function prototype])
],[],[
#include <unistd.h>
#include <pwd.h>
])
2007-11-06 10:26:12 +03:00
AC_CHECK_FUNCS(getgrnam_r getgrgid_r getgrent_r)
2007-11-06 12:15:11 +03:00
AC_HAVE_DECL(getgrent_r, [
#include <unistd.h>
#include <grp.h>
])
AC_VERIFY_C_PROTOTYPE([struct group *getgrent_r(struct group *src, char *buf, int buflen)],
[
#ifndef HAVE_GETGRENT_R_DECL
#error missing getgrent_r prototype
#endif
return NULL;
],[
AC_DEFINE(SOLARIS_GETGRENT_R, 1, [getgrent_r solaris function prototype])
],[],[
#include <unistd.h>
#include <grp.h>
])
2006-09-19 02:49:20 +04:00
2008-01-22 14:21:55 +03:00
AC_VERIFY_C_PROTOTYPE([struct group *getgrent_r(struct group *src, char *buf, size_t buflen)],
[
#ifndef HAVE_GETGRENT_R_DECL
#error missing getgrent_r prototype
#endif
return NULL;
],[
AC_DEFINE(SOLARIS_GETGRENT_R, 1, [getgrent_r irix (similar to solaris) function prototype])
],[],[
#include <unistd.h>
#include <grp.h>
])
2009-05-31 00:43:17 +04:00
AC_CHECK_FUNCS(getgrouplist)
2008-01-22 14:21:55 +03:00
2006-09-19 02:49:20 +04:00
# locale
2009-06-07 16:39:22 +04:00
AC_CHECK_HEADERS(ctype.h locale.h langinfo.h)
2006-09-19 02:49:20 +04:00
# glob
AC_CHECK_HEADERS(fnmatch.h)
# shmem
AC_CHECK_HEADERS(sys/ipc.h sys/mman.h sys/shm.h )
# terminal
AC_CHECK_HEADERS(termios.h termio.h sys/termio.h )