5555
5656# virtio-snd
5757ENABLE_VIRTIOSND ?= 1
58- ifneq ($(UNAME_S ) ,$(filter $(UNAME_S ) ,Linux) )
58+ ifneq ($(UNAME_S ) ,$(filter $(UNAME_S ) ,Linux Darwin ) )
5959 ENABLE_VIRTIOSND := 0
6060endif
6161
@@ -66,19 +66,34 @@ ifeq ($(UNAME_S),Linux)
6666 ENABLE_VIRTIOSND := 0
6767 endif
6868endif
69+ ifeq ($(UNAME_S ) ,Darwin)
70+ ifeq (0, $(call check-ca))
71+ $(warning No CoreAudio installed Check AudioToolbox in advance.)
72+ ENABLE_VIRTIOSND := 0
73+ endif
74+ endif
6975$(call set-feature, VIRTIOSND)
7076ifeq ($(call has, VIRTIOSND) , 1)
7177 OBJS_EXTRA += virtio-snd.o
7278
7379 PORTAUDIOLIB := portaudio/lib/.libs/libportaudio.a
80+ LDFLAGS += $(PORTAUDIOLIB)
81+
82+ ifeq ($(UNAME_S),Linux)
83+ LDFLAGS += -lasound -lrt
84+ ifeq (1, $(call check-pa))
85+ LDFLAGS += -lpulse
86+ endif
87+ endif
88+ ifeq ($(UNAME_S),Darwin)
89+ LDFLAGS += -framework AudioToolbox
90+ endif
91+
92+ CFLAGS += -Iportaudio/include
7493 # PortAudio requires libm, yet we set -lm in the end of LDFLAGS
7594 # so that the other libraries will be benefited for no need to set
7695 # -lm separately.
77- LDFLAGS += $(PORTAUDIOLIB ) -lasound -lpthread -lrt
78- ifeq (1, $(call check-pa))
79- LDFLAGS += -lpulse
80- endif
81- CFLAGS += -Iportaudio/include
96+ LDFLAGS += -lpthread
8297
8398portaudio/Makefile :
8499 git submodule update --init portaudio
0 commit comments