Rename a pipe method, add docs
[carla.git] / source / Makefile.deps.mk
blob590009672fcff53c7ad3254b8f0e4bd4b9123acb
1 #!/usr/bin/make -f
2 # Makefile for Carla C++ code #
3 # --------------------------- #
4 # Created by falkTX
7 # ---------------------------------------------------------------------------------------------------------------------
8 # Base environment vars
10 AR ?= ar
11 CC ?= gcc
12 CXX ?= g++
14 # ---------------------------------------------------------------------------------------------------------------------
15 # Auto-detect OS if not defined
17 TARGET_MACHINE := $(shell $(CC) -dumpmachine)
19 ifneq ($(BSD),true)
20 ifneq ($(HAIKU),true)
21 ifneq ($(HURD),true)
22 ifneq ($(LINUX),true)
23 ifneq ($(MACOS),true)
24 ifneq ($(WASM),true)
25 ifneq ($(WINDOWS),true)
27 ifneq (,$(findstring bsd,$(TARGET_MACHINE)))
28 BSD = true
29 else ifneq (,$(findstring haiku,$(TARGET_MACHINE)))
30 HAIKU = true
31 else ifneq (,$(findstring linux,$(TARGET_MACHINE)))
32 LINUX = true
33 else ifneq (,$(findstring gnu,$(TARGET_MACHINE)))
34 HURD = true
35 else ifneq (,$(findstring apple,$(TARGET_MACHINE)))
36 MACOS = true
37 else ifneq (,$(findstring mingw,$(TARGET_MACHINE)))
38 WINDOWS = true
39 else ifneq (,$(findstring msys,$(TARGET_MACHINE)))
40 WINDOWS = true
41 else ifneq (,$(findstring wasm,$(TARGET_MACHINE)))
42 WASM = true
43 else ifneq (,$(findstring windows,$(TARGET_MACHINE)))
44 WINDOWS = true
45 endif
47 endif # WINDOWS
48 endif # WASM
49 endif # MACOS
50 endif # LINUX
51 endif # HURD
52 endif # HAIKU
53 endif # BSD
55 # ---------------------------------------------------------------------------------------------------------------------
56 # Auto-detect the processor
58 TARGET_PROCESSOR := $(firstword $(subst -, ,$(TARGET_MACHINE)))
60 ifneq (,$(filter i%86,$(TARGET_PROCESSOR)))
61 CPU_I386 = true
62 CPU_I386_OR_X86_64 = true
63 endif
64 ifneq (,$(filter wasm32,$(TARGET_PROCESSOR)))
65 CPU_I386 = true
66 CPU_I386_OR_X86_64 = true
67 endif
68 ifneq (,$(filter x86_64,$(TARGET_PROCESSOR)))
69 CPU_X86_64 = true
70 CPU_I386_OR_X86_64 = true
71 endif
72 ifneq (,$(filter arm%,$(TARGET_PROCESSOR)))
73 CPU_ARM = true
74 CPU_ARM_OR_AARCH64 = true
75 endif
76 ifneq (,$(filter arm64%,$(TARGET_PROCESSOR)))
77 CPU_ARM64 = true
78 CPU_ARM_OR_AARCH64 = true
79 endif
80 ifneq (,$(filter aarch64%,$(TARGET_PROCESSOR)))
81 CPU_AARCH64 = true
82 CPU_ARM_OR_AARCH64 = true
83 endif
84 ifneq (,$(filter riscv64%,$(TARGET_PROCESSOR)))
85 CPU_RISCV64 = true
86 endif
88 # ---------------------------------------------------------------------------------------------------------------------
89 # Set PKG_CONFIG (can be overridden by environment variable)
91 ifeq ($(WASM),true)
92 # Skip on wasm by default
93 PKG_CONFIG ?= false
94 else ifeq ($(WINDOWS),true)
95 # Build statically on Windows by default
96 PKG_CONFIG ?= pkg-config --static
97 else
98 PKG_CONFIG ?= pkg-config
99 endif
101 # ---------------------------------------------------------------------------------------------------------------------
102 # Set cross compiling flag
104 ifeq ($(WASM),true)
105 CROSS_COMPILING = true
106 endif
108 # ---------------------------------------------------------------------------------------------------------------------
109 # Set LINUX_OR_MACOS
111 ifeq ($(LINUX),true)
112 LINUX_OR_MACOS = true
113 endif
115 ifeq ($(MACOS),true)
116 LINUX_OR_MACOS = true
117 endif
119 # ---------------------------------------------------------------------------------------------------------------------
120 # Set HAIKU_OR_MACOS_OR_WASM_OR_WINDOWS, HAIKU_OR_MACOS_OR_WINDOWS, MACOS_OR_WASM_OR_WINDOWS and MACOS_OR_WINDOWS
122 ifeq ($(HAIKU),true)
123 HAIKU_OR_MACOS_OR_WASM_OR_WINDOWS = true
124 HAIKU_OR_MACOS_OR_WINDOWS = true
125 endif
127 ifeq ($(MACOS),true)
128 HAIKU_OR_MACOS_OR_WASM_OR_WINDOWS = true
129 HAIKU_OR_MACOS_OR_WINDOWS = true
130 MACOS_OR_WASM_OR_WINDOWS = true
131 MACOS_OR_WINDOWS = true
132 endif
134 ifeq ($(WASM),true)
135 HAIKU_OR_MACOS_OR_WASM_OR_WINDOWS = true
136 MACOS_OR_WASM_OR_WINDOWS = true
137 endif
139 ifeq ($(WINDOWS),true)
140 HAIKU_OR_MACOS_OR_WASM_OR_WINDOWS = true
141 HAIKU_OR_MACOS_OR_WINDOWS = true
142 MACOS_OR_WASM_OR_WINDOWS = true
143 MACOS_OR_WINDOWS = true
144 endif
146 # ---------------------------------------------------------------------------------------------------------------------
147 # Set UNIX
149 ifeq ($(BSD),true)
150 UNIX = true
151 endif
153 ifeq ($(HURD),true)
154 UNIX = true
155 endif
157 ifeq ($(LINUX),true)
158 UNIX = true
159 endif
161 ifeq ($(MACOS),true)
162 UNIX = true
163 endif
165 # ---------------------------------------------------------------------------------------------------------------------
166 # Check for optional libs (required by backend or bridges)
168 ifeq ($(LINUX),true)
169 HAVE_ALSA = $(shell $(PKG_CONFIG) --exists alsa && echo true)
170 HAVE_HYLIA = true
171 else ifeq ($(MACOS),true)
172 HAVE_HYLIA = true
173 else ifeq ($(WINDOWS),true)
174 HAVE_HYLIA = true
175 endif
177 ifeq ($(MACOS_OR_WASM_OR_WINDOWS),true)
178 HAVE_DGL = true
179 HAVE_YSFXGUI = true
180 else
181 HAVE_DBUS = $(shell $(PKG_CONFIG) --exists dbus-1 && echo true)
182 HAVE_DGL = $(shell $(PKG_CONFIG) --exists gl x11 xcursor xext xrandr && echo true)
183 HAVE_YSFXGUI = $(shell $(PKG_CONFIG) --exists freetype2 fontconfig gl x11 && echo true)
184 HAVE_X11 = $(shell $(PKG_CONFIG) --exists x11 && echo true)
185 HAVE_XCURSOR = $(shell $(PKG_CONFIG) --exists xcursor && echo true)
186 HAVE_XEXT = $(shell $(PKG_CONFIG) --exists xext && echo true)
187 HAVE_XRANDR = $(shell $(PKG_CONFIG) --exists xrandr && echo true)
188 endif
190 # FIXME update to DGL with wasm compat
191 ifeq ($(WASM),true)
192 HAVE_DGL = false
193 endif
195 # NOTE opt-out rather than opt-in
196 HAVE_YSFX = true
198 # NOTE not yet implemented, disabled for now
199 HAVE_YSFXGUI = false
201 ifeq ($(UNIX),true)
202 ifneq ($(MACOS),true)
203 HAVE_PULSEAUDIO = $(shell $(PKG_CONFIG) --exists libpulse-simple && echo true)
204 endif
205 endif
207 # ffmpeg values taken from https://ffmpeg.org/download.html (v2.8.15 maximum)
208 HAVE_FFMPEG = $(shell $(PKG_CONFIG) --max-version=56.60.100 libavcodec && \
209 $(PKG_CONFIG) --max-version=56.40.101 libavformat && \
210 $(PKG_CONFIG) --max-version=54.31.100 libavutil && echo true)
211 HAVE_FLUIDSYNTH = $(shell $(PKG_CONFIG) --atleast-version=1.1.7 fluidsynth && echo true)
212 HAVE_LIBLO = $(shell $(PKG_CONFIG) --exists liblo && echo true)
213 HAVE_QT4 = $(shell $(PKG_CONFIG) --exists QtCore QtGui && echo true)
214 HAVE_QT5 = $(shell $(PKG_CONFIG) --exists Qt5Core Qt5Gui Qt5Widgets && \
215 $(PKG_CONFIG) --variable=qt_config Qt5Core | grep -q -v "static" && echo true)
216 HAVE_QT5PKG = $(shell $(PKG_CONFIG) --silence-errors --variable=prefix Qt5OpenGLExtensions 1>/dev/null && echo true)
217 HAVE_SNDFILE = $(shell $(PKG_CONFIG) --exists sndfile && echo true)
219 ifeq ($(HAVE_FLUIDSYNTH),true)
220 HAVE_FLUIDSYNTH_INSTPATCH = $(shell $(PKG_CONFIG) --atleast-version=2.1.0 fluidsynth && \
221 $(PKG_CONFIG) --atleast-version=1.1.4 libinstpatch-1.0 && echo true)
222 endif
224 ifeq ($(JACKBRIDGE_DIRECT),true)
225 HAVE_JACK = $(shell $(PKG_CONFIG) --exists jack && echo true)
226 HAVE_JACKLIB = $(HAVE_JACK)
227 else ifeq ($(WASM),true)
228 HAVE_JACK = false
229 HAVE_JACKLIB = false
230 else
231 HAVE_JACK = true
232 HAVE_JACKLIB = false
233 endif
235 ifeq ($(WASM),true)
236 HAVE_SDL1 = false
237 HAVE_SDL2 = true
238 else
239 HAVE_SDL1 = $(shell $(PKG_CONFIG) --exists sdl && echo true)
240 HAVE_SDL2 = $(shell $(PKG_CONFIG) --exists sdl2 && echo true)
241 endif
243 # ---------------------------------------------------------------------------------------------------------------------
244 # Check for optional libs (special non-pkgconfig tests)
246 ifneq ($(WASM),true)
247 ifneq ($(WINDOWS),true)
249 ifeq ($(shell $(PKG_CONFIG) --exists libmagic && echo true),true)
250 HAVE_LIBMAGIC = true
251 HAVE_LIBMAGICPKG = true
252 else
253 # old libmagic versions don't have a pkg-config file, so we need to call the compiler to test it
254 CFLAGS_WITHOUT_ARCH = $(subst -arch arm64,,$(CFLAGS))
255 HAVE_LIBMAGIC = $(shell echo '\#include <magic.h>' | $(CC) $(CFLAGS_WITHOUT_ARCH) -x c -w -c - -o /dev/null 2>/dev/null && echo true)
256 endif
258 endif
259 endif
261 # ---------------------------------------------------------------------------------------------------------------------
262 # Set Qt tools
264 ifeq ($(HAVE_QT4),true)
265 MOC_QT4 ?= $(shell $(PKG_CONFIG) --variable=moc_location QtCore)
266 RCC_QT4 ?= $(shell $(PKG_CONFIG) --variable=rcc_location QtCore)
267 ifeq (,$(wildcard $(MOC_QT4)))
268 HAVE_QT4 = false
269 endif
270 ifeq (,$(wildcard $(RCC_QT4)))
271 HAVE_QT4 = false
272 endif
273 endif
275 ifeq ($(HAVE_QT5),true)
276 QT5_HOSTBINS = $(shell $(PKG_CONFIG) --variable=host_bins Qt5Core)
277 else ifeq ($(HAVE_QT5PKG),true)
278 QT5_HOSTBINS = $(shell $(PKG_CONFIG) --variable=prefix Qt5OpenGLExtensions)/bin
279 endif
281 MOC_QT5 ?= $(QT5_HOSTBINS)/moc
282 RCC_QT5 ?= $(QT5_HOSTBINS)/rcc
283 UIC_QT5 ?= $(QT5_HOSTBINS)/uic
285 ifeq (,$(wildcard $(MOC_QT5)))
286 HAVE_QT5 = false
287 endif
288 ifeq (,$(wildcard $(RCC_QT5)))
289 HAVE_QT5 = false
290 endif
291 ifeq (,$(wildcard $(UIC_QT5)))
292 HAVE_QT5 = false
293 endif
295 ifeq ($(HAVE_QT4),true)
296 HAVE_QT = true
297 else ifeq ($(HAVE_QT5),true)
298 HAVE_QT = true
299 # FIXME
300 else ifeq ($(WINDOWS),true)
301 HAVE_QT = true
302 endif
304 ifneq (,$(findstring true,$(HAVE_QT5)$(HAVE_QT5PKG)))
305 HAVE_THEME = true
306 endif
308 # ---------------------------------------------------------------------------------------------------------------------
309 # Set PyQt tools
311 PYRCC5 ?= $(shell which pyrcc5 2>/dev/null)
312 PYUIC5 ?= $(shell which pyuic5 2>/dev/null)
314 ifneq ($(PYUIC5),)
315 ifneq ($(PYRCC5),)
316 HAVE_PYQT = true
317 ifneq (,$(findstring true,$(HAVE_QT5)$(HAVE_QT5PKG)))
318 HAVE_FRONTEND = true
319 endif
320 endif
321 endif
323 # ---------------------------------------------------------------------------------------------------------------------
324 # Set PyQt tools, part2
326 PYRCC ?= $(PYRCC5)
327 PYUIC ?= $(PYUIC5)
329 # ---------------------------------------------------------------------------------------------------------------------
330 # Set USING_JUCE
332 ifeq ($(MACOS_OR_WINDOWS),true)
333 USING_JUCE = true
334 USING_JUCE_AUDIO_DEVICES = true
335 endif
337 # ---------------------------------------------------------------------------------------------------------------------
338 # Set USING_RTAUDIO
340 ifneq ($(HAIKU),true)
341 ifneq ($(WASM),true)
342 ifneq ($(USING_JUCE_AUDIO_DEVICES),true)
343 USING_RTAUDIO = true
344 endif
345 endif
346 endif
348 # ---------------------------------------------------------------------------------------------------------------------
349 # Disable features for static plugin target
351 ifeq ($(STATIC_PLUGIN_TARGET),true)
352 HAVE_ALSA = false
353 HAVE_JACK = false
354 HAVE_JACKLIB = false
355 HAVE_FRONTEND = false
356 HAVE_HYLIA = false
357 HAVE_LIBLO = false
358 HAVE_PULSEAUDIO = false
359 HAVE_PYQT = false
360 HAVE_QT4 = false
361 HAVE_QT5 = false
362 HAVE_QT5PKG = false
363 HAVE_SDL = false
364 HAVE_SDL1 = false
365 HAVE_SDL2 = false
366 USING_JUCE = false
367 USING_JUCE_AUDIO_DEVICES = false
368 USING_RTAUDIO = false
369 endif
371 # ---------------------------------------------------------------------------------------------------------------------
372 # Set libs stuff (part 1)
374 ifneq ($(HAIKU_OR_MACOS_OR_WINDOWS),true)
375 LIBDL_LIBS = -ldl
376 endif
378 ifeq ($(HAVE_LIBLO),true)
379 LIBLO_FLAGS = $(shell $(PKG_CONFIG) --cflags liblo)
380 LIBLO_LIBS = $(shell $(PKG_CONFIG) --libs liblo)
381 endif
383 ifeq ($(HAVE_FFMPEG),true)
384 FFMPEG_FLAGS = $(shell $(PKG_CONFIG) --cflags libavcodec libavformat libavutil)
385 FFMPEG_LIBS = $(shell $(PKG_CONFIG) --libs libavcodec libavformat libavutil)
386 endif
388 ifeq ($(HAVE_FLUIDSYNTH),true)
389 FLUIDSYNTH_FLAGS = $(shell $(PKG_CONFIG) --cflags fluidsynth)
390 FLUIDSYNTH_LIBS = $(shell $(PKG_CONFIG) --libs fluidsynth)
391 endif
393 ifeq ($(HAVE_JACKLIB),true)
394 JACK_FLAGS = $(shell $(PKG_CONFIG) --cflags jack)
395 JACK_LIBS = $(shell $(PKG_CONFIG) --libs jack)
396 JACK_LIBDIR = $(shell $(PKG_CONFIG) --variable=libdir jack)/jack
397 endif
399 ifeq ($(HAVE_QT5),true)
400 QT5_FLAGS = $(shell $(PKG_CONFIG) --cflags Qt5Core Qt5Gui Qt5Widgets)
401 QT5_LIBS = $(shell $(PKG_CONFIG) --libs Qt5Core Qt5Gui Qt5Widgets)
402 endif
404 ifeq ($(WASM),true)
405 HAVE_SDL = true
406 SDL_FLAGS = -sUSE_SDL=2
407 SDL_LIBS = -sUSE_SDL=2
408 else ifeq ($(HAVE_SDL2),true)
409 HAVE_SDL = true
410 SDL_FLAGS = $(shell $(PKG_CONFIG) $(PKG_CONFIG_FLAGS) --cflags sdl2)
411 SDL_LIBS = $(shell $(PKG_CONFIG) $(PKG_CONFIG_FLAGS) --libs sdl2)
412 else ifeq ($(HAVE_SDL1),true)
413 HAVE_SDL = true
414 SDL_FLAGS = $(shell $(PKG_CONFIG) $(PKG_CONFIG_FLAGS) --cflags sdl)
415 SDL_LIBS = $(shell $(PKG_CONFIG) $(PKG_CONFIG_FLAGS) --libs sdl)
416 endif
418 ifeq ($(HAVE_SNDFILE),true)
419 SNDFILE_FLAGS = $(shell $(PKG_CONFIG) --cflags sndfile)
420 SNDFILE_LIBS = $(shell $(PKG_CONFIG) --libs sndfile)
421 endif
423 # ifeq ($(HAVE_YSFXGUI),true)
424 # ifeq ($(MACOS),true)
425 # YSFX_LIBS = -framework Cocoa -framework Carbon -framework Metal -framework Foundation
426 # else ifeq ($(WASM),true)
427 # # TODO
428 # YSFX_LIBS =
429 # else
430 # YSFX_FLAGS = $(shell $(PKG_CONFIG) --cflags freetype2 fontconfig)
431 # YSFX_LIBS = $(shell $(PKG_CONFIG) --libs freetype2 fontconfig gl x11)
432 # endif
433 # endif
435 ifeq ($(HAVE_X11),true)
436 X11_FLAGS = $(shell $(PKG_CONFIG) --cflags x11)
437 X11_LIBS = $(shell $(PKG_CONFIG) --libs x11)
438 endif
440 # ---------------------------------------------------------------------------------------------------------------------
441 # Set libs stuff (dgl)
443 ifeq ($(HAVE_DGL),true)
445 DGL_FLAGS = -DHAVE_OPENGL -DDGL_OPENGL -DHAVE_DGL
447 ifeq ($(HAIKU),true)
448 DGL_FLAGS += $(shell $(PKG_CONFIG) --cflags gl)
449 DGL_LIBS = $(shell $(PKG_CONFIG) --libs gl) -lbe
450 else ifeq ($(MACOS),true)
451 DGL_FLAGS += -DGL_SILENCE_DEPRECATION=1 -Wno-deprecated-declarations
452 DGL_LIBS = -framework OpenGL -framework Cocoa -framework CoreVideo
453 else ifeq ($(WASM),true)
454 ifneq ($(USE_GLES2)$(USE_GLES3),true)
455 DGL_LIBS = -sLEGACY_GL_EMULATION -sGL_UNSAFE_OPTS=0
456 endif
457 else ifeq ($(WINDOWS),true)
458 DGL_LIBS = -lopengl32 -lgdi32
459 else
460 DGL_FLAGS += -DHAVE_X11 -DHAVE_XCURSOR -DHAVE_XEXT -DHAVE_XSYNC -DHAVE_XRANDR
461 DGL_FLAGS += $(shell $(PKG_CONFIG) --cflags gl x11 xcursor xext xrandr)
462 DGL_LIBS = $(shell $(PKG_CONFIG) --libs gl x11 xcursor xext xrandr)
463 ifeq ($(HAVE_DBUS)$(STATIC_PLUGIN_TARGET)$(USING_CUSTOM_DPF),truetruetrue)
464 DGL_FLAGS += -DHAVE_DBUS
465 DGL_FLAGS += $(shell $(PKG_CONFIG) --cflags dbus-1)
466 DGL_LIBS += $(shell $(PKG_CONFIG) --libs dbus-1)
467 endif
468 endif
470 endif
472 # ---------------------------------------------------------------------------------------------------------------------
473 # Set libs stuff (libmagic)
475 ifeq ($(HAVE_LIBMAGICPKG),true)
477 MAGIC_FLAGS = $(shell $(PKG_CONFIG) --cflags libmagic)
478 # this is missing in upstream pkg-config
479 MAGIC_FLAGS += -I$(shell $(PKG_CONFIG) --variable=includedir libmagic)
480 MAGIC_LIBS = $(shell $(PKG_CONFIG) --libs libmagic)
482 else ifeq ($(HAVE_LIBMAGIC),true)
484 MAGIC_LIBS += -lmagic
485 ifeq ($(LINUX_OR_MACOS),true)
486 MAGIC_LIBS += -lz
487 endif
489 endif
491 # ---------------------------------------------------------------------------------------------------------------------
492 # Set libs stuff (juce)
494 ifeq ($(USING_JUCE),true)
496 ifeq ($(MACOS),true)
497 JUCE_AUDIO_BASICS_LIBS = -framework Accelerate
498 JUCE_AUDIO_DEVICES_LIBS = -framework AppKit -framework AudioToolbox -framework CoreAudio -framework CoreMIDI
499 JUCE_AUDIO_FORMATS_LIBS = -framework AudioToolbox -framework CoreFoundation
500 JUCE_AUDIO_PROCESSORS_LIBS = -framework AudioToolbox -framework AudioUnit -framework CoreAudio -framework CoreAudioKit -framework Cocoa
501 JUCE_CORE_LIBS = -framework AppKit
502 JUCE_EVENTS_LIBS = -framework AppKit
503 JUCE_GRAPHICS_LIBS = -framework Cocoa -framework QuartzCore
504 JUCE_GUI_BASICS_LIBS = -framework Cocoa
505 JUCE_GUI_EXTRA_LIBS = -framework IOKit
506 else ifeq ($(WINDOWS),true)
507 JUCE_AUDIO_BASICS_LIBS =
508 JUCE_AUDIO_DEVICES_LIBS = -lwinmm -lole32
509 JUCE_AUDIO_FORMATS_LIBS =
510 JUCE_AUDIO_PROCESSORS_LIBS =
511 JUCE_CORE_LIBS = -luuid -lwsock32 -lwininet -lversion -lole32 -lws2_32 -loleaut32 -limm32 -lcomdlg32 -lshlwapi -lrpcrt4 -lwinmm
512 JUCE_EVENTS_LIBS = -lole32
513 JUCE_GRAPHICS_LIBS = -lgdi32
514 JUCE_GUI_BASICS_LIBS = -lgdi32 -limm32 -lcomdlg32 -lole32
515 JUCE_GUI_EXTRA_LIBS =
516 endif
518 endif
520 # ---------------------------------------------------------------------------------------------------------------------
521 # Set libs stuff (rtaudio)
523 ifeq ($(USING_RTAUDIO),true)
525 RTAUDIO_FLAGS = -DHAVE_GETTIMEOFDAY
526 RTMIDI_FLAGS =
528 ifeq ($(DEBUG),true)
529 RTAUDIO_FLAGS += -D__RTAUDIO_DEBUG__
530 RTMIDI_FLAGS += -D__RTMIDI_DEBUG__
531 endif
533 ifeq ($(HAVE_ALSA),true)
534 RTAUDIO_FLAGS += $(shell $(PKG_CONFIG) --cflags alsa) -D__LINUX_ALSA__
535 RTAUDIO_LIBS += $(shell $(PKG_CONFIG) --libs alsa) -pthread
536 RTMIDI_FLAGS += $(shell $(PKG_CONFIG) --cflags alsa) -D__LINUX_ALSA__
537 RTMIDI_LIBS += $(shell $(PKG_CONFIG) --libs alsa)
538 endif
540 ifeq ($(HAVE_JACK),true)
541 ifeq ($(UNIX),true)
542 RTAUDIO_FLAGS += -D__UNIX_JACK__
543 endif
544 endif
546 ifeq ($(HAVE_PULSEAUDIO),true)
547 RTAUDIO_FLAGS += $(shell $(PKG_CONFIG) --cflags libpulse-simple) -D__UNIX_PULSE__
548 RTAUDIO_LIBS += $(shell $(PKG_CONFIG) --libs libpulse-simple)
549 endif
551 ifeq ($(MACOS),true)
552 RTAUDIO_FLAGS += -D__MACOSX_CORE__
553 RTAUDIO_LIBS += -framework CoreAudio
554 RTMIDI_FLAGS += -D__MACOSX_CORE__
555 RTMIDI_LIBS += -framework CoreMIDI
556 else ifeq ($(WINDOWS),true)
557 RTAUDIO_FLAGS += -D__WINDOWS_ASIO__ -D__WINDOWS_DS__ -D__WINDOWS_WASAPI__
558 RTAUDIO_LIBS += -ldsound -luuid -lksuser
559 RTMIDI_FLAGS += -D__WINDOWS_MM__
560 RTMIDI_LIBS += -lwinmm
561 endif
563 endif
565 # ---------------------------------------------------------------------------------------------------------------------
566 # Set libs stuff (extra)
568 ifeq ($(BSD),true)
570 HYLIA_FLAGS =
571 HYLIA_LIBS =
572 JACKBRIDGE_LIBS = -pthread -lrt
573 LILV_LIBS = -lm -lrt
574 RTMEMPOOL_LIBS = -pthread
575 WATER_LIBS = -pthread -lrt
577 else ifeq ($(HAIKU),true)
579 HYLIA_FLAGS =
580 HYLIA_LIBS =
581 JACKBRIDGE_LIBS = -lpthread
582 LILV_LIBS = -lm
583 RTMEMPOOL_LIBS = -lpthread
584 WATER_LIBS = -lpthread
586 else ifeq ($(HURD),true)
588 HYLIA_FLAGS =
589 HYLIA_LIBS =
590 JACKBRIDGE_LIBS = -ldl -pthread -lrt
591 LILV_LIBS = -ldl -lm -lrt
592 RTMEMPOOL_LIBS = -pthread -lrt
593 WATER_LIBS = -ldl -pthread -lrt
595 else ifeq ($(LINUX),true)
597 HYLIA_FLAGS = -DLINK_PLATFORM_LINUX=1
598 HYLIA_LIBS =
599 JACKBRIDGE_LIBS = -ldl -pthread -lrt
600 LILV_LIBS = -ldl -lm -lrt
601 RTMEMPOOL_LIBS = -pthread -lrt
602 WATER_LIBS = -ldl -pthread -lrt
604 else ifeq ($(MACOS),true)
606 HYLIA_FLAGS = -DLINK_PLATFORM_MACOSX=1
607 HYLIA_LIBS =
608 JACKBRIDGE_LIBS = -pthread
609 LILV_LIBS = -lm
610 RTMEMPOOL_LIBS = -pthread
611 WATER_LIBS = -pthread -framework AppKit
613 else ifeq ($(WASM),true)
615 HYLIA_FLAGS =
616 HYLIA_LIBS =
617 JACKBRIDGE_LIBS =
618 LILV_LIBS = -ldl -lm
619 RTMEMPOOL_LIBS =
620 WATER_LIBS =
622 else ifeq ($(WINDOWS),true)
624 HYLIA_FLAGS = -DLINK_PLATFORM_WINDOWS=1
625 HYLIA_LIBS = -liphlpapi
626 JACKBRIDGE_LIBS = -pthread
627 LILV_LIBS = -lm
628 RTMEMPOOL_LIBS = -pthread
629 WATER_LIBS = -pthread -luuid -lwsock32 -lwininet -lversion -lole32 -lws2_32 -loleaut32 -limm32 -lcomdlg32 -lshlwapi -lrpcrt4 -lwinmm
631 endif
633 # ---------------------------------------------------------------------------------------------------------------------
635 AUDIO_DECODER_LIBS = $(FFMPEG_LIBS)
636 AUDIO_DECODER_LIBS += $(SNDFILE_LIBS)
638 NATIVE_PLUGINS_LIBS += $(DGL_LIBS)
639 NATIVE_PLUGINS_LIBS += $(FFMPEG_LIBS)
640 NATIVE_PLUGINS_LIBS += $(SNDFILE_LIBS)
642 STATIC_CARLA_PLUGIN_LIBS = $(AUDIO_DECODER_LIBS)
643 STATIC_CARLA_PLUGIN_LIBS += $(NATIVE_PLUGINS_LIBS)
644 STATIC_CARLA_PLUGIN_LIBS += $(FLUIDSYNTH_LIBS)
645 STATIC_CARLA_PLUGIN_LIBS += $(HYLIA_LIBS)
646 STATIC_CARLA_PLUGIN_LIBS += $(LIBLO_LIBS)
647 STATIC_CARLA_PLUGIN_LIBS += $(LILV_LIBS)
648 STATIC_CARLA_PLUGIN_LIBS += $(MAGIC_LIBS)
649 STATIC_CARLA_PLUGIN_LIBS += $(RTMEMPOOL_LIBS)
650 STATIC_CARLA_PLUGIN_LIBS += $(WATER_LIBS)
651 STATIC_CARLA_PLUGIN_LIBS += $(YSFX_LIBS)
653 ifeq ($(USING_JUCE),true)
654 STATIC_CARLA_PLUGIN_LIBS += $(JUCE_AUDIO_BASICS_LIBS)
655 STATIC_CARLA_PLUGIN_LIBS += $(JUCE_AUDIO_FORMATS_LIBS)
656 STATIC_CARLA_PLUGIN_LIBS += $(JUCE_AUDIO_PROCESSORS_LIBS)
657 STATIC_CARLA_PLUGIN_LIBS += $(JUCE_CORE_LIBS)
658 STATIC_CARLA_PLUGIN_LIBS += $(JUCE_EVENTS_LIBS)
659 STATIC_CARLA_PLUGIN_LIBS += $(JUCE_GRAPHICS_LIBS)
660 STATIC_CARLA_PLUGIN_LIBS += $(JUCE_GUI_BASICS_LIBS)
661 STATIC_CARLA_PLUGIN_LIBS += $(JUCE_GUI_EXTRA_LIBS)
662 endif
664 ifeq ($(EXTERNAL_PLUGINS),true)
665 ifneq ($(DEBUG),true)
666 ifneq ($(TESTBUILD),true)
667 ifeq ($(shell $(PKG_CONFIG) --exists liblo fftw3 mxml zlib && echo true),true)
668 STATIC_CARLA_PLUGIN_LIBS += $(filter-out -lpthread,$(shell $(PKG_CONFIG) --libs liblo fftw3 mxml zlib))
669 ifneq ($(WASM),true)
670 STATIC_CARLA_PLUGIN_LIBS += -pthread
671 endif
672 endif
673 endif
674 endif
675 endif
677 # ---------------------------------------------------------------------------------------------------------------------