From ccb1b71fda6241eb2ca07ff1f0b4570972835629 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Deuc=D0=B5?= <shurd@sasktel.net>
Date: Wed, 18 Dec 2024 18:16:22 -0500
Subject: [PATCH] Move USE_ALSA_SOUND detection into Common.gmake

---
 src/xpdev/Common.gmake | 8 +++++---
 src/xpdev/GNUmakefile  | 5 -----
 2 files changed, 5 insertions(+), 8 deletions(-)

diff --git a/src/xpdev/Common.gmake b/src/xpdev/Common.gmake
index f7e9b825e0..1bf8c62a71 100644
--- a/src/xpdev/Common.gmake
+++ b/src/xpdev/Common.gmake
@@ -214,9 +214,11 @@ ifndef WITHOUT_PORTAUDIO
   endif
  endif
 endif
-ifeq ($(shell if [ -f /usr/include/alsa/asoundlib.h ] ; then echo YES ; fi),YES)
- XPDEV-MT_LIBS += -ldl
- XPDEV_LIBS += -ldl
+ifndef WITHOUT_ALSA_SOUND
+	ifeq ($(shell if [ -f /usr/include/alsa/asoundlib.h ] ; then echo YES ; fi),YES)
+		XPDEV-MT_CFLAGS	+= -DUSE_ALSA_SOUND
+		XPDEV-MT_LIBS += -ldl
+	endif
 endif
 
 ifndef NO_PULSEAUDIO
diff --git a/src/xpdev/GNUmakefile b/src/xpdev/GNUmakefile
index 16d7a036a0..4d9b9e3a51 100644
--- a/src/xpdev/GNUmakefile
+++ b/src/xpdev/GNUmakefile
@@ -9,11 +9,6 @@ ifndef win
 endif
 
 CFLAGS +=  -I. $(XPDEV_CFLAGS)
-ifndef WITHOUT_ALSA_SOUND
-	ifeq ($(shell if [ -f /usr/include/alsa/asoundlib.h ] ; then echo YES ; fi),YES)
-		CFLAGS	+=	-DUSE_ALSA_SOUND
-	endif
-endif
 MT_CFLAGS	+=	$(XPDEV-MT_CFLAGS)
 
 ifdef WITH_SDL_AUDIO
-- 
GitLab