From 2bf04d1f045f27a265ed1b1916e5eef929c13bae Mon Sep 17 00:00:00 2001 From: Thomas Klausner Date: Sun, 2 Feb 2025 19:07:13 +0100 Subject: [PATCH] build: do not define _POSIX_C_SOURCE on NetBSD It leads to missing symbols, see #4180. --- Makefile | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 0c99eeef..0f5431c7 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,7 @@ ifeq ($(OS),Windows_NT) $(error Windows is not supported) +else + detected_OS := $(shell uname -s) endif VERSION := 0.25.1 @@ -27,7 +29,10 @@ OBJ := $(SRC:.c=.o) ARFLAGS := rcs CFLAGS ?= -O3 -Wall -Wextra -Wshadow -Wpedantic -Werror=incompatible-pointer-types override CFLAGS += -std=c11 -fPIC -fvisibility=hidden -override CFLAGS += -D_POSIX_C_SOURCE=200112L -D_DEFAULT_SOURCE +ifneq ($(detected_OS),NetBSD) +override CFLAGS += -D_POSIX_C_SOURCE=200112L +endif +override CFLAGS += -D_DEFAULT_SOURCE override CFLAGS += -Ilib/src -Ilib/src/wasm -Ilib/include # ABI versioning