--- src/Makefile.am~	2024-02-05 19:09:26.000000000 +0800
+++ src/Makefile.am	2024-03-15 23:54:52.000000000 +0800
@@ -31,6 +31,7 @@
 endif
 
 libnpth_la_SOURCES = npth.c npth-sigev.c
+libnpth_la_SOURCES += darwin_compat.h darwin_compat.c
 
 # AM_CPPFLAGS =
 # AM_CFLAGS =
--- src/npth.c~	2018-07-16 09:15:59.000000000 +0200
+++ src/npth.c	2020-09-02 10:33:58.000000000 +0200
@@ -63,7 +63,7 @@
   return 0;
 }
 #else
-# include <semaphore.h>
+# include "darwin_compat.h"
 #endif
 #ifdef HAVE_UNISTD_H
 # include <unistd.h>
