@@ -59,12 +59,19 @@ ifneq ($(UNAME_S),$(filter $(UNAME_S),Linux Darwin))
5959 ENABLE_VIRTIOSND := 0
6060endif
6161
62- # Check ALSA installation
62+ ENABLE_PULSEAUDIO ?= 1
6363ifeq ($(UNAME_S ) ,Linux)
64+ # Check ALSA installation
6465 ifeq (0, $(call check-alsa))
6566 $(warning No libasound installed. Check libasound in advance.)
6667 ENABLE_VIRTIOSND := 0
6768 endif
69+
70+ # Check PulseAudio installation
71+ ifeq (0, $(call check-pa))
72+ $(warning No PulseAudio installed.)
73+ ENABLE_PULSEAUDIO := 0
74+ endif
6875endif
6976ifeq ($(UNAME_S ) ,Darwin)
7077 ifeq (0, $(call check-ca))
@@ -77,11 +84,11 @@ ifeq ($(call has, VIRTIOSND), 1)
7784 OBJS_EXTRA += virtio-snd.o
7885
7986 PORTAUDIOLIB := portaudio/lib/.libs/libportaudio.a
80- LDFLAGS += $(PORTAUDIOLIB)
87+ LDFLAGS += $(PORTAUDIOLIB )
8188
8289 ifeq ($(UNAME_S),Linux)
8390 LDFLAGS += -lasound -lrt
84- ifeq (1, $(call check-pa ))
91+ ifeq (1, $(ENABLE_PULSEAUDIO ))
8592 LDFLAGS += -lpulse
8693 endif
8794 endif
@@ -100,7 +107,7 @@ portaudio/Makefile:
100107$(PORTAUDIOLIB ) : portaudio/Makefile
101108 @cd $(dir $< ) && ./configure
102109 @cd $(dir $< ) && $(MAKE )
103- main.o : $(PORTAUDIOLIB )
110+ $( OBJS ) : $(PORTAUDIOLIB )
104111
105112# suppress warning when compiling PortAudio
106113virtio-snd.o : CFLAGS += -Wno-unused-parameter
0 commit comments