Collection of DPF-based plugins for packaging
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

42 lines
1.4KB

  1. # ===========================================================================
  2. # https://www.gnu.org/software/autoconf-archive/ax_check_posix_sysinfo.html
  3. # ===========================================================================
  4. #
  5. # SYNOPSIS
  6. #
  7. # AX_CHECK_POSIX_SYSINFO
  8. #
  9. # DESCRIPTION
  10. #
  11. # Check that the POSIX compliant sysinfo(2) call works properly. Linux has
  12. # its own weirdo alternative.
  13. #
  14. # LICENSE
  15. #
  16. # Copyright (c) 2008 Bruce Korb <bkorb@gnu.org>
  17. #
  18. # Copying and distribution of this file, with or without modification, are
  19. # permitted in any medium without royalty provided the copyright notice
  20. # and this notice are preserved. This file is offered as-is, without any
  21. # warranty.
  22. #serial 6
  23. AU_ALIAS([AG_CHECK_POSIX_SYSINFO], [AX_CHECK_POSIX_SYSINFO])
  24. AC_DEFUN([AX_CHECK_POSIX_SYSINFO],[
  25. AC_MSG_CHECKING([whether sysinfo(2) is POSIX])
  26. AC_CACHE_VAL([ax_cv_posix_sysinfo],[
  27. AC_TRY_RUN([#include <sys/systeminfo.h>
  28. int main() { char z[ 256 ];
  29. long sz = sysinfo( SI_SYSNAME, z, sizeof( z ));
  30. return (sz > 0) ? 0 : 1; }],[ax_cv_posix_sysinfo=yes],[ax_cv_posix_sysinfo=no],[ax_cv_posix_sysinfo=no]
  31. ) # end of TRY_RUN]) # end of CACHE_VAL
  32. AC_MSG_RESULT([$ax_cv_posix_sysinfo])
  33. if test x$ax_cv_posix_sysinfo = xyes
  34. then
  35. AC_DEFINE(HAVE_POSIX_SYSINFO, 1,
  36. [Define this if sysinfo(2) is POSIX])
  37. fi
  38. ]) # end of AC_DEFUN of AX_CHECK_POSIX_SYSINFO