summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorAlex Xu (Hello71) <alex_y_xu@yahoo.ca>2020-02-23 22:02:59 -0500
committerCraig Small <csmall@dropbear.xyz>2020-12-22 13:13:32 +1100
commitc8384e682c1cfb3b2dc797e0f8a3cbaaccf7a3da (patch)
tree97d3b6d44574b4cd68f9436b491ef31cfd4635a6 /configure.ac
parent9f33a6bcd0bc2f0aac7ccaa686d061ea1297f4b1 (diff)
downloadprocps-ng-c8384e682c1cfb3b2dc797e0f8a3cbaaccf7a3da.tar.gz
pgrep: add pwait
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac16
1 files changed, 16 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index b8e4938..f9375d4 100644
--- a/configure.ac
+++ b/configure.ac
@@ -10,6 +10,7 @@ AM_INIT_AUTOMAKE([foreign 1.11 subdir-objects -Wall -Wno-portability tar-pax no-
AM_SILENT_RULES([yes])
AC_CONFIG_SRCDIR([free.c])
AC_CONFIG_HEADERS([config.h])
+AC_LANG([C])
# Checks for programs.
AC_USE_SYSTEM_EXTENSIONS
@@ -120,6 +121,21 @@ AC_TRY_COMPILE([#include <errno.h>],
AC_MSG_RESULT(yes),
AC_MSG_RESULT(no))
+AC_CHECK_FUNC([pidfd_open], [enable_pwait=yes], [
+ AC_MSG_CHECKING([for __NR_pidfd_open])
+ AC_COMPILE_IFELSE([AC_LANG_SOURCE([
+#include <sys/syscall.h>
+#ifndef __NR_pidfd_open
+#error __NR_pidfd_open not defined
+#endif
+ ])], [enable_pwait=yes], [enable_pwait=no])
+ AC_MSG_RESULT([$enable_pwait])
+])
+if test "$enable_pwait" = yes; then
+ AC_DEFINE([ENABLE_PWAIT], [1], [Enable pwait])
+fi
+AM_CONDITIONAL([BUILD_PWAIT], [test x$enable_pwait = xyes])
+
dnl watch8bit must be before the AC_ARG_WITH set as it sets up ncurses
AC_SUBST([WITH_WATCH8BIT])
AC_ARG_ENABLE([watch8bit],