Skip to content
Commits on Source (5)
......@@ -12,6 +12,8 @@ on user-visible changes.
== Repository head ==
Pthread support is now required. --disable-dns-lookup is gone.
NIST lockclock mode is now a runtime option set by the (previously unused)
flag1 mode bit of the local-clock driver.
......
......@@ -29,6 +29,7 @@ const char* digests[] = {
"RMD160", "RIPEMD160",
"SHA224", "SHA256", "SHA384", "SHA512",
"MDC2", "GOST", "DSS1",
"ChaCha20", "Poly1305",
NULL };
unsigned char pkt[100];
......
......@@ -9,6 +9,6 @@ def build(ctx):
features="c cprogram bld_include src_include",
source=[name + ".c"],
includes=["%s/%s/" % (bldnode, name)],
use="ntp M SSL CRYPTO RT THR PTHREAD",
use="ntp M CRYPTO RT PTHREAD",
install_path=None,
)
......@@ -2266,7 +2266,6 @@ io_handler(void)
errno = EINTR;
}
pthread_sigmask(SIG_SETMASK, &runMask, NULL);
sigprocmask(SIG_SETMASK, &runMask, NULL);
if (nfound > 0) {
input_handler(&rdfdes);
......
from waflib.Logs import pprint
PTHREAD_FRAG = """
#include <pthread.h>
int main(void) {
pthread_mutex_t mutex;
pthread_mutex_init(&mutex, NULL);
pthread_mutex_destroy(&mutex);
return 0;
}
"""
def check_pthread_header_lib(ctx):
ctx.check(header_name="pthread.h", includes=ctx.env.PLATFORM_INCLUDES,
mandatory=False, comment="pthread header")
ctx.check(feature="c cshlib", lib="pthread",
libpath=ctx.env.PLATFORM_LIBPATH, mandatory=False,
comment="pthread library")
# FreeBSD uses libthr rather than libpthread
# There may be some magic to translate
ctx.check_cc(lib="thr", mandatory=False,
comment="thr library, required by some operating systems.")
if (ctx.get_define("HAVE_PTHREAD_H") and
(ctx.env.LIB_PTHREAD or ctx.env.LIB_THR)):
ctx.env.PTHREAD_HEADER_LIB = True
def check_pthread_run(ctx):
if ctx.env.ENABLE_CROSS:
if ctx.env.PTHREAD_HEADER_LIB: # XXX Remove when variant builds exist
ctx.define("HAVE_PTHREAD", 1, comment="pthread support")
ctx.env.PTHREAD_ENABLE = True
return
ctx.check(
fragment=PTHREAD_FRAG,
define_name="HAVE_PTHREAD",
features="c",
use="PTHREAD THR",
msg="Checking if pthread works",
includes=ctx.env.PLATFORM_INCLUDES,
export_includes=ctx.env.PLATFORM_INCLUDES,
mandatory=False,
comment="pthread support"
)
check_sanity(ctx, ctx.env.PTHREAD_HEADER_LIB, "pthread")
# XXX if pthread is part of 'libc' this will pass
# even if the header isn't detected.
if not ctx.get_define("HAVE_PTHREAD"):
ctx.fatal("Error: POSIX threads are required in order to build.")
else:
ctx.env.PTHREAD_ENABLE = True
ctx.define("HAVE_PTHREAD", 1, comment="pthread support")
def check_sanity(ctx, cond, lib):
define = "HAVE_%s" % lib.upper()
if cond and (not ctx.get_define(define)):
pprint("RED",
"Warning %s headers detected, binaries do not build/run"
% lib)
elif (not cond) and ctx.get_define(define):
pprint("RED",
"Warning %s headers not detected, binaries build/run"
% lib)
......@@ -296,6 +296,7 @@ def configure(ctx):
# may depend on some libs, like -lssp
ctx.check_cc(lib="m", comment="Math library")
ctx.check_cc(lib="rt", mandatory=False, comment="realtime library")
ctx.check_cc(lib="pthread", mandatory=False, comment="threads library")
ctx.check_cc(lib="execinfo", mandatory=False,
comment="BSD backtrace library")
ret = ctx.check_cc(lib="bsd", mandatory=False,
......@@ -802,16 +803,10 @@ int main(int argc, char **argv) {
ctx.check_cc(header_name="seccomp.h")
ctx.check_cc(lib="seccomp")
from wafhelpers.check_pthread import check_pthread_header_lib
check_pthread_header_lib(ctx)
if not ctx.options.disable_mdns_registration:
ctx.check_cc(header_name="dns_sd.h", lib="dns_sd", mandatory=False,
uselib_store="DNS_SD")
from wafhelpers.check_pthread import check_pthread_run
check_pthread_run(ctx)
# Solaris needs -lsocket and -lnsl for socket code
if ctx.env.DEST_OS == "sunos":
ctx.check(features="c cshlib", lib="socket", mandatory=False)
......