@@ -59,12 +59,19 @@ ifneq ($(UNAME_S),$(filter $(UNAME_S),Linux Darwin))
59
59
ENABLE_VIRTIOSND := 0
60
60
endif
61
61
62
- # Check ALSA installation
62
+ ENABLE_PULSEAUDIO ?= 1
63
63
ifeq ($(UNAME_S ) ,Linux)
64
+ # Check ALSA installation
64
65
ifeq (0, $(call check-alsa))
65
66
$(warning No libasound installed. Check libasound in advance.)
66
67
ENABLE_VIRTIOSND := 0
67
68
endif
69
+
70
+ # Check PulseAudio installation
71
+ ifeq (0, $(call check-pa))
72
+ $(warning No PulseAudio installed.)
73
+ ENABLE_PULSEAUDIO := 0
74
+ endif
68
75
endif
69
76
ifeq ($(UNAME_S ) ,Darwin)
70
77
ifeq (0, $(call check-ca))
@@ -77,11 +84,11 @@ ifeq ($(call has, VIRTIOSND), 1)
77
84
OBJS_EXTRA += virtio-snd.o
78
85
79
86
PORTAUDIOLIB := portaudio/lib/.libs/libportaudio.a
80
- LDFLAGS += $(PORTAUDIOLIB)
87
+ LDFLAGS += $(PORTAUDIOLIB )
81
88
82
89
ifeq ($(UNAME_S),Linux)
83
90
LDFLAGS += -lasound -lrt
84
- ifeq (1, $(call check-pa ))
91
+ ifeq (1, $(ENABLE_PULSEAUDIO ))
85
92
LDFLAGS += -lpulse
86
93
endif
87
94
endif
@@ -100,7 +107,7 @@ portaudio/Makefile:
100
107
$(PORTAUDIOLIB ) : portaudio/Makefile
101
108
@cd $(dir $< ) && ./configure
102
109
@cd $(dir $< ) && $(MAKE )
103
- main.o : $(PORTAUDIOLIB )
110
+ $( OBJS ) : $(PORTAUDIOLIB )
104
111
105
112
# suppress warning when compiling PortAudio
106
113
virtio-snd.o : CFLAGS += -Wno-unused-parameter
0 commit comments