Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
Cuda-Chen committed Feb 24, 2025
1 parent 937d2fc commit 6d42303
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,19 @@ ifneq ($(UNAME_S),$(filter $(UNAME_S),Linux Darwin))
ENABLE_VIRTIOSND := 0
endif

# Check ALSA installation
ENABLE_PULSEAUDIO ?= 1
ifeq ($(UNAME_S),Linux)
# Check ALSA installation
ifeq (0, $(call check-alsa))
$(warning No libasound installed. Check libasound in advance.)
ENABLE_VIRTIOSND := 0
endif

# Check PulseAudio installation
ifeq (0, $(call check-pa))
$(warning No PulseAudio installed.)
ENABLE_PULSEAUDIO := 0
endif
endif
ifeq ($(UNAME_S),Darwin)
ifeq (0, $(call check-ca))
Expand All @@ -77,11 +84,11 @@ ifeq ($(call has, VIRTIOSND), 1)
OBJS_EXTRA += virtio-snd.o

PORTAUDIOLIB := portaudio/lib/.libs/libportaudio.a
LDFLAGS += $(PORTAUDIOLIB)
LDFLAGS += $(PORTAUDIOLIB)

ifeq ($(UNAME_S),Linux)
LDFLAGS += -lasound -lrt
ifeq (1, $(call check-pa))
ifeq (1, $(ENABLE_PULSEAUDIO))
LDFLAGS += -lpulse
endif
endif
Expand All @@ -100,7 +107,7 @@ portaudio/Makefile:
$(PORTAUDIOLIB): portaudio/Makefile
@cd $(dir $<) && ./configure
@cd $(dir $<) && $(MAKE)
main.o: $(PORTAUDIOLIB)
$(OBJS): $(PORTAUDIOLIB)

# suppress warning when compiling PortAudio
virtio-snd.o: CFLAGS += -Wno-unused-parameter
Expand Down

0 comments on commit 6d42303

Please sign in to comment.