summaryrefslogtreecommitdiff
path: root/m4/nproc.m4
diff options
context:
space:
mode:
authorBruno Haible <bruno@clisp.org>2009-10-18 10:13:58 +0200
committerBruno Haible <bruno@clisp.org>2009-10-18 10:13:58 +0200
commite841c33e13f765327b1d2cd98b5934e337ab44d9 (patch)
treeb5799347ac2566683e2d6f1da269dffd6e544607 /m4/nproc.m4
parentbb0465fcf85351b8b7bea0507d9c326319f3b94a (diff)
downloadgnulib-e841c33e13f765327b1d2cd98b5934e337ab44d9.tar.gz
Implement nproc for NetBSD, OpenBSD.
Diffstat (limited to 'm4/nproc.m4')
-rw-r--r--m4/nproc.m424
1 files changed, 24 insertions, 0 deletions
diff --git a/m4/nproc.m4 b/m4/nproc.m4
new file mode 100644
index 0000000000..73b812dd21
--- /dev/null
+++ b/m4/nproc.m4
@@ -0,0 +1,24 @@
+# nproc.m4 serial 1
+dnl Copyright (C) 2009 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([gl_NPROC],
+[
+ gl_PREREQ_NPROC
+])
+
+# Prerequisites of lib/nproc.c.
+AC_DEFUN([gl_PREREQ_NPROC],
+[
+ AC_CHECK_HEADERS([sys/param.h],,, [AC_INCLUDES_DEFAULT])
+ dnl <sys/sysctl.h> requires <sys/param.h> on OpenBSD 4.0.
+ AC_CHECK_HEADERS([sys/sysctl.h],,,
+ [AC_INCLUDES_DEFAULT
+ #if HAVE_SYS_PARAM_H
+ # include <sys/param.h>
+ #endif
+ ])
+ AC_CHECK_FUNCS([sysctl])
+])