@@ -77,33 +77,50 @@ $(call set-feature, VIRTIOSND)
7777ifeq ($(call has, VIRTIOSND) , 1)
7878 OBJS_EXTRA += virtio-snd.o
7979
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 )
8285
8386 ifeq ($(UNAME_S),Linux)
8487 LDFLAGS += -lasound -lrt
88+ PA_CONFIG_PARAMS += --with-alsa
8589 # Check PulseAudio installation
8690 ifeq (0, $(call check-pa))
8791 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
8897 endif
8998 endif
9099 ifeq ($(UNAME_S),Darwin)
91100 LDFLAGS += -framework CoreServices -framework CoreFoundation -framework AudioUnit -framework AudioToolbox -framework CoreAudio
92101 endif
93102
94- CFLAGS += -Iportaudio/include
95103 # PortAudio requires libm, yet we set -lm in the end of LDFLAGS
96104 # so that the other libraries will be benefited for no need to set
97105 # -lm separately.
98106 LDFLAGS += -lpthread
99107
100108portaudio/Makefile :
101109 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)
104121 $(MAKE) -C $(dir $<)
105- main.o : $(PORTAUDIOLIB )
106-
122+ main.o : $(PA_LIB )
123+ virtio-snd.o : $( PA_LIB )
107124# suppress warning when compiling PortAudio
108125virtio-snd.o : CFLAGS += -Wno-unused-parameter
109126endif
0 commit comments