diff --git a/Makefile.detect b/Makefile.detect index eb47c99e..00236460 100644 --- a/Makefile.detect +++ b/Makefile.detect @@ -10,6 +10,12 @@ else ifeq ($(shell uname),FreeBSD) PLATFORM=bsd else +ifeq ($(shell uname),NetBSD) +PLATFORM=bsd +else +ifeq ($(shell uname),OpenBSD) +PLATFORM=bsd +else ifeq ($(shell uname),DragonFly) PLATFORM=bsd else @@ -33,6 +39,8 @@ endif endif endif endif +endif +endif ######################################################################## # Set default variables for the platform. @@ -45,6 +53,12 @@ EXE = CLIBFLAGS = -dynamiclib STATICFLAGS = -static-libgcc -DSEXP_USE_DL=0 else +ifeq ($(PLATFORM),bsd) +SO = .so +EXE = +CLIBFLAGS = -fPIC -shared +LIBDL = +else ifeq ($(PLATFORM),mingw) SO = .dll EXE = .exe @@ -75,6 +89,7 @@ endif endif endif endif +endif ifeq ($(PLATFORM),unix) #RLDFLAGS=-rpath $(LIBDIR) diff --git a/lib/chibi/signal.c b/lib/chibi/signal.c index 379728fa..c82cf16b 100644 --- a/lib/chibi/signal.c +++ b/lib/chibi/signal.c @@ -62,6 +62,8 @@ static sexp sexp_set_signal_action (sexp ctx, sexp self, sexp signum, sexp newac #include #ifndef __DragonFly__ +#include +#include #include #endif #include @@ -72,8 +74,10 @@ static sexp sexp_pid_cmdline (sexp ctx, int pid) { struct kinfo_proc res; int name[4] = {CTL_KERN, KERN_PROC, KERN_PROC_PID, pid}; if (sysctl(name, 4, &res, &reslen, NULL, 0) >= 0) { -#ifdef __APPLE__ +#if defined(__APPLE__) || defined(__NetBSD__) return sexp_c_string(ctx, res.kp_proc.p_comm, -1); +#elif __OpenBSD__ + return sexp_c_string(ctx, res.p_comm, -1); #elif __DragonFly__ return sexp_c_string(ctx, res.kp_comm, -1); #else