diff Makefile @ 19:5c6155c8e9b6

Handle signals Handled signals are generally blocked and only unblocked when doing blocking I/O, i.e. either when reading commands or printing results. A (possibly queued) signal will then interrupt I/O and can be dealt with in the main loop.
author Guido Berhoerster <guido+pwm@berhoerster.name>
date Fri, 01 Sep 2017 22:33:41 +0200
parents 1e39a251cbe9
children eb5ce870eb16
line wrap: on
line diff
--- a/Makefile	Thu Aug 24 13:10:56 2017 +0200
+++ b/Makefile	Fri Sep 01 22:33:41 2017 +0200
@@ -79,6 +79,7 @@
 ifeq ($(OS_NAME),Linux)
   HAVE_ARC4RANDOM ?=	0
   HAVE_ASPRINTF ?=	1
+  HAVE_CLOSEFROM ?=	0
   HAVE_ERR_H ?=		1
   HAVE_GETRANDOM ?=	0
   HAVE_SYS_QUEUE_H ?=	0
@@ -87,6 +88,7 @@
 else ifneq ($(findstring $(OS_NAME),FreeBSD DragonFly),)
   HAVE_ARC4RANDOM ?=	1
   HAVE_ASPRINTF ?=	1
+  HAVE_CLOSEFROM ?=	1
   HAVE_ERR_H ?=		1
   HAVE_GETRANDOM ?=	0
   HAVE_SYS_QUEUE_H ?=	1
@@ -95,6 +97,7 @@
 else ifeq ($(OS_NAME),NetBSD)
   HAVE_ARC4RANDOM ?=	1
   HAVE_ASPRINTF ?=	1
+  HAVE_CLOSEFROM ?=	1
   HAVE_ERR_H ?=		1
   HAVE_GETRANDOM ?=	0
   HAVE_SYS_QUEUE_H ?=	1
@@ -103,6 +106,7 @@
 else ifeq ($(OS_NAME),OpenBSD)
   HAVE_ARC4RANDOM ?=	1
   HAVE_ASPRINTF ?=	1
+  HAVE_CLOSEFROM ?=	1
   HAVE_ERR_H ?=		1
   HAVE_GETRANDOM ?=	0
   HAVE_SYS_QUEUE_H ?=	1
@@ -120,12 +124,14 @@
     HAVE_ERR_H ?=	1
     HAVE_GETRANDOM ?=	1
   endif
+  HAVE_CLOSEFROM ?=	1
   HAVE_SYS_QUEUE_H ?=	0
   HAVE_SYS_TREE_H ?=	0
   HAVE_SETPROGNAME ?=	0
 else
   HAVE_ARC4RANDOM ?=	0
   HAVE_ASPRINTF ?=	0
+  HAVE_CLOSEFROM ?=	0
   HAVE_ERR_H ?=		0
   HAVE_GETRANDOM ?=	0
   HAVE_SYS_QUEUE_H ?=	0
@@ -134,7 +140,9 @@
 endif
 
 OBJS =	cmd.o \
+	io.o \
 	pager.o \
+	proc.o \
 	pw.o \
 	pwfile.o \
 	pwm.o \
@@ -166,6 +174,11 @@
 else
   OBJS +=	rand-dev-random.o
 endif
+ifeq ($(HAVE_CLOSEFROM),1)
+  XCPPFLAGS +=	-DHAVE_CLOSEFROM
+else
+  OBJS +=	compat/closefrom.o
+endif
 ifeq ($(HAVE_ERR_H),1)
   XCPPFLAGS +=	-DHAVE_ERR_H
 else