From 6ac7c225882390521bf2cc09da3a35c9a93c00e0 Mon Sep 17 00:00:00 2001 From: c vw Date: Sun, 23 May 2021 10:35:09 +0200 Subject: [PATCH] Made "pulseaudio" the default for Linux, but keep ALSA option --- Makefile | 43 +++++++++++++++++++++++++++++++++++-------- 1 file changed, 35 insertions(+), 8 deletions(-) diff --git a/Makefile b/Makefile index 4a11f84..54ad9aa 100644 --- a/Makefile +++ b/Makefile @@ -14,7 +14,7 @@ GIT_VERSION := $(shell git describe --abbrev=0 --tags) # CONTROLLER2_V1 single encoders with MCP23017 switches # CONTROLLER2_V2 dual encoders with MCP23017 switches # -#GPIO_INCLUDE=GPIO +GPIO_INCLUDE=GPIO # uncomment the line below to include Pure Signal support PURESIGNAL_INCLUDE=PURESIGNAL @@ -26,7 +26,7 @@ MIDI_INCLUDE=MIDI # USBOZY_INCLUDE=USBOZY # uncomment the line to below include support local CW keyer -LOCALCW_INCLUDE=LOCALCW +#LOCALCW_INCLUDE=LOCALCW # uncomment the line below for SoapySDR #SOAPYSDR_INCLUDE=SOAPYSDR @@ -40,6 +40,9 @@ LOCALCW_INCLUDE=LOCALCW # uncomment the line below to include support for STEMlab discovery (WITHOUT AVAHI) #STEMLAB_DISCOVERY=STEMLAB_DISCOVERY_NOAVAHI +# uncomment to get ALSA audio module on Linux (default is now to use pulseaudio) +#AUDIO_MODULE=ALSA + # uncomment the line below for various debug facilities #DEBUG_OPTION=-D DEBUG @@ -186,15 +189,39 @@ endif GTKINCLUDES=$(shell $(PKG_CONFIG) --cflags gtk+-3.0) GTKLIBS=$(shell $(PKG_CONFIG) --libs gtk+-3.0) +# +# MacOS: only PORTAUDIO +# +ifeq ($(UNAME_S), Darwin) + AUDIO_MODULE=PORTAUDIO +endif + +# +# default audio for LINUX is PULSEAUDIO but we can also use ALSA +# ifeq ($(UNAME_S), Linux) -#AUDIO_LIBS=-lpulse-simple -lpulse -lpulse-mainloop-glib -#AUDIO_SOURCES=pulseaudio.c -#AUDIO_OBJS=pulseaudio.o -AUDIO_LIBS= + ifeq ($(AUDIO_MODULE) , ALSA) + AUDIO_MODULE=ALSA + else + AUDIO_MODULE=PULSEAUDIO + endif +endif + +ifeq ($(AUDIO_MODULE), PULSEAUDIO) +AUDIO_OPTIONS=-DPULSEAUDIO +AUDIO_LIBS=-lpulse-simple -lpulse -lpulse-mainloop-glib +AUDIO_SOURCES=pulseaudio.c +AUDIO_OBJS=pulseaudio.o +endif + +ifeq ($(AUDIO_MODULE), ALSA) +AUDIO_OPTIONS=-DALSA +AUDIO_LIBS=-lasound AUDIO_SOURCES=audio.c AUDIO_OBJS=audio.o endif -ifeq ($(UNAME_S), Darwin) + +ifeq ($(AUDIO_MODULE), PORTAUDIO) AUDIO_OPTIONS=-DPORTAUDIO $(shell $(PKG_CONFIG) --cflags portaudio-2.0) AUDIO_LIBS=$(shell $(PKG_CONFIG) --libs portaudio-2.0) AUDIO_SOURCES=portaudio.c @@ -542,7 +569,7 @@ debian: ############################################################################# .PHONY: app -app: $(OBJS) $(REMOTE_OBJS) \ +app: $(OBJS) $(REMOTE_OBJS) $(AUDIO_OBJS) \ $(USBOZY_OBJS) $(SOAPYSDR_OBJS) \ $(LOCALCW_OBJS) $(PURESIGNAL_OBJS) \ $(MIDI_OBJS) $(STEMLAB_OBJS) $(SERVER_OBJS) -- 2.45.2