make : enable BSD extensions for DragonFlyBSD to expose RLIMIT_MEMLOCK

This commit is contained in:
Przemyslaw Pawelczyk 2023-09-06 00:15:23 +02:00
parent 5e47277633
commit 09b7e8000e

View file

@ -111,10 +111,15 @@ endif
# RLIMIT_MEMLOCK came in BSD, is not specified in POSIX.1,
# and on macOS its availability depends on enabling Darwin extensions
# similarly on DragonFly, enabling BSD extensions is necessary
ifeq ($(UNAME_S),Darwin)
MK_CFLAGS += -D_DARWIN_C_SOURCE
MK_CXXFLAGS += -D_DARWIN_C_SOURCE
endif
ifeq ($(UNAME_S),DragonFly)
MK_CFLAGS += -D__BSD_VISIBLE
MK_CXXFLAGS += -D__BSD_VISIBLE
endif
ifdef LLAMA_DEBUG
MK_CFLAGS += -O0 -g