diff --git a/Makefile b/Makefile index 36c91e1..9c6881a 100644 --- a/Makefile +++ b/Makefile @@ -46,22 +46,33 @@ endif # virtio-snd ENABLE_VIRTIOSND ?= 1 -ifneq ($(UNAME_S),Linux) +ifneq ($(UNAME_S),$(filter $(UNAME_S),Linux Darwin)) ENABLE_VIRTIOSND := 0 endif -ifeq (0, $(call check-alsa)) -$(warning No libasound installed. Check libasound in advance.) - ENABLE_VIRTIOSND := 0 +# Check ALSA installation +ifeq ($(UNAME_S),Linux) + ifeq (0, $(call check-alsa)) + $(warning No libasound installed. Check libasound in advance.) + ENABLE_VIRTIOSND := 0 + endif +endif +# Check core audio installation +ifeq ($(UNAME_S),Darwin) + ifeq (0, $(call check-coreaudio)) + $(warning No CoreAudio framework installed.) + ENABLE_VIRTIOSND := 0 endif -#ifeq (0, $(call check-coreaudio)) -#$(warning No CoreAudio framework installed.) -# ENABLE_VIRTIOSND := 0 -#endif $(call set-feature, VIRTIOSND) ifeq ($(call has, VIRTIOSND), 1) OBJS_EXTRA += virtio-snd.o - LDFLAGS += -lasound -lpthread + + ifeq ($(UNAME_S),Linux) + LDFLAGS += -lasound -lpthread + else ifeq($(UNAME_S),Darwin) + LDFLAGS += lpthread + CFLAGS += -framework CoreAudio + endif CFLAGS += -Icnfa cnfa/Makefile: