check_memlimit_support.m4 864 B

123456789101112131415161718192021
  1. # CHECK_MEMLIMIT_SUPPORT
  2. # ----------------------
  3. AC_DEFUN([CHECK_MEMLIMIT_SUPPORT], [
  4. # Check for a linuxy sysinfo syscall; and while we're doing that,
  5. # check if struct sysinfo is the old version (total RAM == totalmem)
  6. # or the new version (total RAM == totalmem * mem_unit).
  7. AC_CHECK_HEADERS_ONCE([sys/sysinfo.h])
  8. AC_CHECK_FUNCS_ONCE([sysinfo])
  9. AC_CHECK_TYPES([struct sysinfo], [], [], [[#include <sys/sysinfo.h>]])
  10. AC_CHECK_MEMBERS([struct sysinfo.totalram, struct sysinfo.mem_unit],
  11. [], [], [[#include <sys/sysinfo.h>]])
  12. # Check if we have <sys/param.h>, since some systems require it for
  13. # sysctl to work.
  14. AC_CHECK_HEADERS_ONCE([sys/param.h])
  15. # Check for <sys/sysctl.h>. If it exists and it defines HW_USERMEM
  16. # and/or HW_MEMSIZE, we'll try using those as memory limits.
  17. AC_CHECK_HEADERS_ONCE([sys/sysctl.h])
  18. ])# CHECK_MEMLIMIT_SUPPORT