Index: src/Makefile --- src/Makefile.orig 2017-03-17 13:07:24.163175000 +0100 +++ src/Makefile 2017-03-17 13:08:42.339338000 +0100 @@ -62,7 +62,7 @@ flags_unix: - $(eval CFLAGS := -I. -Iregexp -Wall -W $(CFLAGS_ADDTL)) + $(eval CFLAGS := -I. -Iregexp $(CFLAGS_ADDTL)) $(eval LDFLAGS := -Lregexp $(LDFLAGS_ADDTL)) $(eval BOXES_EXECUTABLE_NAME := boxes) $(eval ALL_OBJ := $(GEN_SRC:.c=.o) $(ORIG_NORM:.c=.o)) Index: src/boxes.c --- src/boxes.c.orig 2017-03-17 10:24:58.000000000 +0100 +++ src/boxes.c 2017-03-17 13:07:24.163546000 +0100 @@ -49,7 +49,13 @@ #include #include #include +#if defined(__NetBSD__) +#define _NETBSD_SOURCE #include +#undef _NETBSD_SOURCE +#else +#include +#endif #include #include "shape.h" #include "boxes.h" Index: src/tools.c --- src/tools.c.orig 2017-03-17 10:24:58.000000000 +0100 +++ src/tools.c 2017-03-17 13:07:24.163694000 +0100 @@ -30,6 +30,7 @@ #include #include #include +#include #include "shape.h" #include "boxes.h" #include "tools.h"