From 4aa3bcf8a4d18fefab7f72eba0cdad1889dba08a Mon Sep 17 00:00:00 2001 From: Georgi Gerganov Date: Wed, 22 Mar 2023 20:51:42 +0200 Subject: [PATCH] make : fix MUSL Linux build (#576) --- Makefile | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Makefile b/Makefile index 15094a4..929d45b 100644 --- a/Makefile +++ b/Makefile @@ -34,6 +34,12 @@ CFLAGS = -I. -O3 -DNDEBUG -std=c11 -fPIC CXXFLAGS = -I. -I./examples -O3 -DNDEBUG -std=c++11 -fPIC LDFLAGS = +# ref: https://github.com/ggerganov/whisper.cpp/issues/37 +ifneq ($(wildcard /usr/include/musl/*),) + CFLAGS += -D_POSIX_SOURCE -D_GNU_SOURCE + CXXFLAGS += -D_POSIX_SOURCE -D_GNU_SOURCE +endif + # OS specific # TODO: support Windows ifeq ($(UNAME_S),Linux)