Skip to content

Commit 6d9c0af

Browse files
committed
Test
1 parent c6cda7f commit 6d9c0af

File tree

1 file changed

+24
-10
lines changed

1 file changed

+24
-10
lines changed

Makefile

Lines changed: 24 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -77,38 +77,52 @@ $(call set-feature, VIRTIOSND)
7777
ifeq ($(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
88-
else ifeq (0, $(call check-jack2))
89-
$(warning Detect JACK)
92+
PA_CONFIG_PARAMS += --with-pulseaudio
93+
endif
94+
ifeq (0, $(call check-jack2))
9095
LDFLAGS += -ljack
96+
PA_CONFIG_PARAMS += --with-jack
9197
endif
9298
endif
9399
ifeq ($(UNAME_S),Darwin)
94100
LDFLAGS += -framework CoreServices -framework CoreFoundation -framework AudioUnit -framework AudioToolbox -framework CoreAudio
95101
endif
96102

97-
CFLAGS += -Iportaudio/include
98103
# PortAudio requires libm, yet we set -lm in the end of LDFLAGS
99104
# so that the other libraries will be benefited for no need to set
100105
# -lm separately.
101106
LDFLAGS += -lpthread
102107

103108
portaudio/Makefile:
104109
git submodule update --init portaudio
105-
$(PORTAUDIOLIB): portaudio/Makefile
106-
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)
107121
$(MAKE) -C $(dir $<)
108-
main.o: $(PORTAUDIOLIB)
109-
122+
main.o: $(PA_LIB)
123+
virtio-snd.o: $(PA_LIB)
110124
# suppress warning when compiling PortAudio
111-
virtio-snd.o: CFLAGS += -Wno-unused-parameter
125+
#virtio-snd.o: CFLAGS += -Wno-unused-parameter
112126
endif
113127

114128
# Set libm as the last dependency so that no need to set -lm seperately.

0 commit comments

Comments
 (0)