ggerganov commited on
Commit
51936e8
·
unverified ·
1 Parent(s): 92e3777

make : fix MUSL Linux build (#576)

Browse files
Files changed (1) hide show
  1. Makefile +6 -0
Makefile CHANGED
@@ -34,6 +34,12 @@ CFLAGS = -I. -O3 -DNDEBUG -std=c11 -fPIC
34
  CXXFLAGS = -I. -I./examples -O3 -DNDEBUG -std=c++11 -fPIC
35
  LDFLAGS =
36
 
 
 
 
 
 
 
37
  # OS specific
38
  # TODO: support Windows
39
  ifeq ($(UNAME_S),Linux)
 
34
  CXXFLAGS = -I. -I./examples -O3 -DNDEBUG -std=c++11 -fPIC
35
  LDFLAGS =
36
 
37
+ # ref: https://github.com/ggerganov/whisper.cpp/issues/37
38
+ ifneq ($(wildcard /usr/include/musl/*),)
39
+ CFLAGS += -D_POSIX_SOURCE -D_GNU_SOURCE
40
+ CXXFLAGS += -D_POSIX_SOURCE -D_GNU_SOURCE
41
+ endif
42
+
43
  # OS specific
44
  # TODO: support Windows
45
  ifeq ($(UNAME_S),Linux)