Skip to contentSkip to conversation

selftests: alsa: Handle pkg-config failure more gracefully

PATCH Applied Mark Brown 2 participants 2 messages May 31, 2022

Subsystems (3)
lore
Share & tools
lore

Mark Brown

author maintainer
#0 lore raw

PATCH 1/1 selftests: alsa: Handle pkg-config failure more gracefully

Follow the pattern used by other selftests like memfd and fall back on the standard toolchain options to build with a system installed alsa-lib if we don't get anything from pkg-config. This reduces our build dependencies a bit in the common case while still allowing use of pkg-config in case there is a need for it.

---
 tools/testing/selftests/alsa/Makefile | 3 +++
 1 file changed, 3 insertions(+)
tools/testing/selftests/alsa/Makefile +3 -0
index f64d9090426d..fd8ddce2b1a6 100644
@@ -3,6 +3,9 @@
 
 CFLAGS += $(shell pkg-config --cflags alsa)
 LDLIBS += $(shell pkg-config --libs alsa)
+ifeq ($(LDLIBS),)
+LDLIBS += -lasound
+endif
 
 TEST_GEN_PROGS := mixer-test
 
Signature · 1 line
2.30.2
Applied
#1 lore raw
Quoted 8 lines · Mark Brown

Follow the pattern used by other selftests like memfd and fall back on the standard toolchain options to build with a system installed alsa-lib if we don't get anything from pkg-config. This reduces our build dependencies a bit in the common case while still allowing use of pkg-config in case there is a need for it.

Thanks, applied now.

Takashi