1
1
PKG_LIBS =
2
2
CXX_STD = CXX11
3
- PKG_CPPFLAGS = -pthread -DSTRICT_R_HEADERS -I./dr_libs -I./whisper_cpp
4
- PKG_CFLAGS += -D_XOPEN_SOURCE=600
5
- PKG_CPPFLAGS += -D_XOPEN_SOURCE=600
6
3
7
4
#CFLAGS = -I. -O3 -DNDEBUG -std=c11 -fPIC
8
5
#CXXFLAGS = -I. -I./examples -O3 -DNDEBUG -std=c++11 -fPIC
@@ -26,56 +23,6 @@ ifndef NVCC_VERSION
26
23
endif
27
24
endif
28
25
29
- # Somehow in OpenBSD whenever POSIX conformance is specified
30
- # some string functions rely on locale_t availability,
31
- # which was introduced in POSIX.1-2008, forcing us to go higher
32
- ifeq ($(UNAME_S),OpenBSD)
33
- PKG_CFLAGS += -U_XOPEN_SOURCE -D_XOPEN_SOURCE=700
34
- PKG_CPPFLAGS += -U_XOPEN_SOURCE -D_XOPEN_SOURCE=700
35
- endif
36
-
37
- # Data types, macros and functions related to controlling CPU affinity
38
- # are available on Linux through GNU extensions in libc
39
- ifeq ($(UNAME_S),Linux)
40
- PKG_CFLAGS += -D_GNU_SOURCE
41
- PKG_CPPFLAGS += -D_GNU_SOURCE
42
- endif
43
-
44
- # RLIMIT_MEMLOCK came in BSD, is not specified in POSIX.1,
45
- # and on macOS its availability depends on enabling Darwin extensions
46
- # similarly on DragonFly, enabling BSD extensions is necessary
47
- ifeq ($(UNAME_S),Darwin)
48
- PKG_CFLAGS += -D_DARWIN_C_SOURCE
49
- PKG_CPPFLAGS += -D_DARWIN_C_SOURCE
50
- endif
51
- ifeq ($(UNAME_S),DragonFly)
52
- PKG_CFLAGS += -D__BSD_VISIBLE
53
- PKG_CPPFLAGS += -D__BSD_VISIBLE
54
- endif
55
-
56
- # alloca is a non-standard interface that is not visible on BSDs when
57
- # POSIX conformance is specified, but not all of them provide a clean way
58
- # to enable it in such cases
59
- ifeq ($(UNAME_S),FreeBSD)
60
- PKG_CFLAGS += -D__BSD_VISIBLE
61
- PKG_CPPFLAGS += -D__BSD_VISIBLE
62
- endif
63
- ifeq ($(UNAME_S),NetBSD)
64
- PKG_CFLAGS += -D_NETBSD_SOURCE
65
- PKG_CPPFLAGS += -D_NETBSD_SOURCE
66
- endif
67
- ifeq ($(UNAME_S),OpenBSD)
68
- PKG_CFLAGS += -D_BSD_SOURCE
69
- PKG_CPPFLAGS += -D_BSD_SOURCE
70
- endif
71
-
72
- # OS specific
73
- # TODO: support Windows
74
- ifeq ($(filter $(UNAME_S),Linux Darwin DragonFly FreeBSD NetBSD OpenBSD Haiku),$(UNAME_S))
75
- PKG_CFLAGS += -pthread
76
- PKG_CPPFLAGS += -pthread
77
- endif
78
-
79
26
# Architecture specific
80
27
# TODO: probably these flags need to be tweaked on some architectures
81
28
# feel free to update the Makefile for your architecture and send a pull request or issue
@@ -231,6 +178,60 @@ ifdef WHISPER_LIBS
231
178
PKG_LIBS = $(WHISPER_LIBS)
232
179
endif
233
180
181
+ PKG_CPPFLAGS += -DSTRICT_R_HEADERS -I./dr_libs -I./whisper_cpp
182
+ PKG_CFLAGS += -D_XOPEN_SOURCE=600
183
+ PKG_CPPFLAGS += -D_XOPEN_SOURCE=600
184
+
185
+ # Somehow in OpenBSD whenever POSIX conformance is specified
186
+ # some string functions rely on locale_t availability,
187
+ # which was introduced in POSIX.1-2008, forcing us to go higher
188
+ ifeq ($(UNAME_S),OpenBSD)
189
+ PKG_CFLAGS += -U_XOPEN_SOURCE -D_XOPEN_SOURCE=700
190
+ PKG_CPPFLAGS += -U_XOPEN_SOURCE -D_XOPEN_SOURCE=700
191
+ endif
192
+
193
+ # Data types, macros and functions related to controlling CPU affinity
194
+ # are available on Linux through GNU extensions in libc
195
+ ifeq ($(UNAME_S),Linux)
196
+ PKG_CFLAGS += -D_GNU_SOURCE
197
+ PKG_CPPFLAGS += -D_GNU_SOURCE
198
+ endif
199
+
200
+ # RLIMIT_MEMLOCK came in BSD, is not specified in POSIX.1,
201
+ # and on macOS its availability depends on enabling Darwin extensions
202
+ # similarly on DragonFly, enabling BSD extensions is necessary
203
+ ifeq ($(UNAME_S),Darwin)
204
+ PKG_CFLAGS += -D_DARWIN_C_SOURCE
205
+ PKG_CPPFLAGS += -D_DARWIN_C_SOURCE
206
+ endif
207
+ ifeq ($(UNAME_S),DragonFly)
208
+ PKG_CFLAGS += -D__BSD_VISIBLE
209
+ PKG_CPPFLAGS += -D__BSD_VISIBLE
210
+ endif
211
+
212
+ # alloca is a non-standard interface that is not visible on BSDs when
213
+ # POSIX conformance is specified, but not all of them provide a clean way
214
+ # to enable it in such cases
215
+ ifeq ($(UNAME_S),FreeBSD)
216
+ PKG_CFLAGS += -D__BSD_VISIBLE
217
+ PKG_CPPFLAGS += -D__BSD_VISIBLE
218
+ endif
219
+ ifeq ($(UNAME_S),NetBSD)
220
+ PKG_CFLAGS += -D_NETBSD_SOURCE
221
+ PKG_CPPFLAGS += -D_NETBSD_SOURCE
222
+ endif
223
+ ifeq ($(UNAME_S),OpenBSD)
224
+ PKG_CFLAGS += -D_BSD_SOURCE
225
+ PKG_CPPFLAGS += -D_BSD_SOURCE
226
+ endif
227
+
228
+ # OS specific
229
+ # TODO: support Windows
230
+ ifeq ($(filter $(UNAME_S),Linux Darwin DragonFly FreeBSD NetBSD OpenBSD Haiku),$(UNAME_S))
231
+ PKG_CFLAGS += -pthread
232
+ PKG_CPPFLAGS += -pthread
233
+ endif
234
+
234
235
#PKG_CFLAGS = -mavx -mavx2 -mfma -mf16c
235
236
#PKG_CFLAGS = -msse3
236
237
#PKG_CLFAGS = -mcpu=native
0 commit comments