@@ -77,33 +77,50 @@ $(call set-feature, VIRTIOSND)
77
77
ifeq ($(call has, VIRTIOSND) , 1)
78
78
OBJS_EXTRA += virtio-snd.o
79
79
80
- PORTAUDIOLIB := portaudio/lib/.libs/libportaudio.a
81
- LDFLAGS += $(PORTAUDIOLIB )
80
+ PA_LIB := portaudio/lib/.libs/libportaudio.a
81
+ PA_CFLAGS := -Iportaudio/include
82
+ PA_CONFIG_PARAMS :=
83
+ LDFLAGS += $(PA_LIB )
84
+ CFLAGS += $(PA_CFLAGS )
82
85
83
86
ifeq ($(UNAME_S),Linux)
84
87
LDFLAGS += -lasound -lrt
88
+ PA_CONFIG_PARAMS += --with-alsa
85
89
# Check PulseAudio installation
86
90
ifeq (0, $(call check-pa))
87
91
LDFLAGS += -lpulse
92
+ PA_CONFIG_PARAMS += --with-pulseaudio
93
+ endif
94
+ ifeq (0, $(call check-jack2))
95
+ LDFLAGS += -ljack
96
+ PA_CONFIG_PARAMS += --with-jack
88
97
endif
89
98
endif
90
99
ifeq ($(UNAME_S),Darwin)
91
100
LDFLAGS += -framework CoreServices -framework CoreFoundation -framework AudioUnit -framework AudioToolbox -framework CoreAudio
92
101
endif
93
102
94
- CFLAGS += -Iportaudio/include
95
103
# PortAudio requires libm, yet we set -lm in the end of LDFLAGS
96
104
# so that the other libraries will be benefited for no need to set
97
105
# -lm separately.
98
106
LDFLAGS += -lpthread
99
107
100
108
portaudio/Makefile :
101
109
git submodule update --init portaudio
102
- $(PORTAUDIOLIB ) : portaudio/Makefile
103
- cd $(dir $< ) && LDFLAGS=" " ./configure --without-sndio
110
+ $(PA_LIB ) : portaudio/Makefile
111
+ cd $(dir $< ) && git clean -fdx && git reset --hard HEAD
112
+ cd $(dir $< ) && ./configure \
113
+ --enable-static \
114
+ --disable-shared \
115
+ --without-samples \
116
+ --without-tests \
117
+ --without-oss \
118
+ --without-sndio \
119
+ --disable-dependency-tracking \
120
+ $(PA_CONFIG_PARAMS)
104
121
$(MAKE) -C $(dir $<)
105
- main.o : $(PORTAUDIOLIB )
106
-
122
+ main.o : $(PA_LIB )
123
+ virtio-snd.o : $( PA_LIB )
107
124
# suppress warning when compiling PortAudio
108
125
virtio-snd.o : CFLAGS += -Wno-unused-parameter
109
126
endif
0 commit comments