From: Georgi Gerganov Date: Wed, 22 Mar 2023 18:51:42 +0000 (+0200) Subject: make : fix MUSL Linux build (#576) X-Git-Tag: upstream/1.7.4~1546 X-Git-Url: https://git.djapps.eu/?a=commitdiff_plain;h=4aa3bcf8a4d18fefab7f72eba0cdad1889dba08a;p=pkg%2Fggml%2Fsources%2Fwhisper.cpp make : fix MUSL Linux build (#576) --- diff --git a/Makefile b/Makefile index 15094a4b..929d45b9 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)