From effeec623c46f26540a54acb77ad4003f255eaed Mon Sep 17 00:00:00 2001 From: lotherk Date: Mon, 23 Nov 2026 10:55:55 +0000 Subject: [PATCH] pkgsrc: -D_NETBSD_SOURCE (usleep is hidden without it on NetBSD) Co-Authored-By: Claude Sonnet 5.5 --- pkgsrc/Makefile | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pkgsrc/Makefile b/pkgsrc/Makefile index 8aff79c..b47f15f 100644 --- a/pkgsrc/Makefile +++ b/pkgsrc/Makefile @@ -28,9 +28,11 @@ MAKE_PROGRAM= ${GMAKE} # variable on the command line, so they are repeated here. TLS: the Makefile # looks for openssl/ssl.h on the BUILD host, which in a cross build is the # wrong place; the target's base system has libssl and libcrypto, so J_HAVE_TLS -# and the libraries are given outright. No -Werror. +# and the libraries are given outright. -D_NETBSD_SOURCE: NetBSD's headers hide +# usleep(3) behind it (src/mcp.c:640, measured 2026-11-23); _DEFAULT_SOURCE is +# glibc's. No -Werror. MAKE_FLAGS+= CFLAGS=${CFLAGS:Q}\ -std=c99\ -pthread -MAKE_FLAGS+= CPPFLAGS=-D_POSIX_C_SOURCE=200809L\ -D_DEFAULT_SOURCE\ -DJ_HAVE_TLS +MAKE_FLAGS+= CPPFLAGS=-D_POSIX_C_SOURCE=200809L\ -D_DEFAULT_SOURCE\ -D_NETBSD_SOURCE\ -DJ_HAVE_TLS MAKE_FLAGS+= LDFLAGS=${LDFLAGS:Q}\ -pthread MAKE_FLAGS+= TLS_LIBS=-lssl\ -lcrypto