From 3e8ab07d25da1310db86cfca7e18eb0ad1987c8d Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 10 Feb 2023 12:02:47 +0200 Subject: Make buildable on *BSD --- manifest | 2 +- openssl/agent/pkcs11/agent.cxx | 16 ++++++++++++++-- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/manifest b/manifest index 0fad2d5..6fa2a77 100644 --- a/manifest +++ b/manifest @@ -13,7 +13,7 @@ doc-url: https://build2.org/doc.xhtml src-url: https://git.build2.org/cgit/openssl-agent/tree/ email: users@build2.org build-warning-email: builds@build2.org -builds: host : &linux ; Currently only supported on Linux. +builds: host : &( +linux +freebsd ); Currently only supported on Linux and BSD. requires: c++14 depends: * build2 >= 0.15.0- depends: * bpkg >= 0.15.0- diff --git a/openssl/agent/pkcs11/agent.cxx b/openssl/agent/pkcs11/agent.cxx index 8d61208..273414e 100644 --- a/openssl/agent/pkcs11/agent.cxx +++ b/openssl/agent/pkcs11/agent.cxx @@ -6,6 +6,20 @@ #include #include // kill(), sigaction(), sigemptyset(), SIG* + +// _NSIG is Linux-specific but *BSD appear to have NSIG/_NSIG. +// +#if defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__) +# include +# ifndef _NSIG +# ifdef NSIG +# define _NSIG NSIG +# else +# error neither _NSIG nor NSIG defined +# endif +# endif +#endif + #include // fork(), getpid(), dup2(), setsid() #include // tcgetattr(), tcsetattr() @@ -235,8 +249,6 @@ namespace openssl // future versions. Thus, we will provide our own implementation of the // function that is inspired by the openssh implementation. // - // Note: _NSIG is Linux-specic. - // static volatile sig_atomic_t received_signals[_NSIG]; extern "C" void -- cgit v1.1