sysinfo.m4 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. dnl Bunch of extra macros to make dpkg more portable
  2. dnl Copyright (C) 1999 Wichert Akkerman <wakkerma@debian.org>
  3. dnl
  4. dnl This program is free software; you can redistribute it and/or modify
  5. dnl it under the terms of the GNU General Public License as published by
  6. dnl the Free Software Foundation; either version 2, or (at your option)
  7. dnl any later version.
  8. dnl
  9. dnl This program is distributed in the hope that it will be useful,
  10. dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. dnl GNU General Public License for more details.
  13. dnl
  14. dnl You should have received a copy of the GNU General Public License
  15. dnl along with this program; if not, write to the Free Software
  16. dnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
  17. dnl 02111-1307, USA.
  18. AC_DEFUN(AC_HAVE_SYSINFO,
  19. [AC_CACHE_CHECK(whether sysinfo is available,
  20. ac_cv_func_sysinfo,
  21. [ AC_CHECK_FUNC(sysinfo,ac_cv_func_sysinfo=yes,ac_cv_func_sysinfo=no)])
  22. if test "$ac_cv_func_sysinfo" = "yes" ; then
  23. AC_DEFINE(HAVE_SYSINFO)
  24. fi
  25. ])
  26. AC_DEFUN(AC_MEMINFO_IN_SYSINFO,
  27. [AC_REQUIRE([AC_HAVE_SYSINFO])dnl
  28. if test "$ac_cv_header_sys_sysinfo" = "" ; then
  29. AC_CHECK_HEADERS(sys/sysinfo.h)
  30. fi
  31. AC_CACHE_CHECK(whether struct sysinfo contains memory information,
  32. ac_cv_meminfo_in_sysinfo,
  33. [AC_TRY_COMPILE([
  34. #ifdef HAVE_SYS_SYSINFO_H
  35. #include <sys/sysinfo.h>
  36. #endif
  37. ], [struct sysinfo si ; si.freeram;si.sharedram;si.bufferram;],
  38. ac_cv_meminfo_in_sysinfo=yes, ac_cv_meminfo_in_sysinfo=no)])
  39. if test "$ac_cv_have_sysinfo_meminfo" = yes ; then
  40. AC_DEFINE(MEMINFO_IN_SYSINFO)
  41. fi
  42. ])