diff mbox series

selftests: alsa: Handle pkg-config failure more gracefully

Message ID 20220531151337.2933810-1-broonie@kernel.org (mailing list archive)
State Accepted
Commit 079d93b7dba8373920ad8b50e01616ce8ab3c927
Headers show
Series selftests: alsa: Handle pkg-config failure more gracefully | expand

Commit Message

Mark Brown May 31, 2022, 3:13 p.m. UTC
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.

Signed-off-by: Mark Brown <broonie@kernel.org>
---
 tools/testing/selftests/alsa/Makefile | 3 +++
 1 file changed, 3 insertions(+)

Comments

Takashi Iwai May 31, 2022, 4:02 p.m. UTC | #1
On Tue, 31 May 2022 17:13:37 +0200,
Mark Brown wrote:
> 
> 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.
> 
> Signed-off-by: Mark Brown <broonie@kernel.org>

Thanks, applied now.


Takashi
diff mbox series

Patch

diff --git a/tools/testing/selftests/alsa/Makefile b/tools/testing/selftests/alsa/Makefile
index f64d9090426d..fd8ddce2b1a6 100644
--- a/tools/testing/selftests/alsa/Makefile
+++ b/tools/testing/selftests/alsa/Makefile
@@ -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