Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

selftest: alsa: check if user has alsa installed

Currently, if alsa development package is not installed on the user's
system then the make command would print a `pagefull` of errors. In
particular one error message is repeated 3 times. This error is returned
by `pkg-config` and since it is not being handeled appropriately,
repeated calls to `pkg-config` prints the same message again.

This patch adds check for alsa package installation. If alsa is not
installed, a short and consize error is returned. Also, it does not
affect the compilation of other tests.

Signed-off-by: Abdul Rahim <abdul.rahim@myyahoo.com>
Reviewed-by: Shuah Khan <skhan@linuxfoundation.org>
Link: https://patch.msgid.link/20240922225824.18918-1-abdul.rahim@myyahoo.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>

authored by

Abdul Rahim and committed by
Takashi Iwai
2a94a089 bf36793f

+4
+4
tools/testing/selftests/alsa/Makefile
··· 1 1 # SPDX-License-Identifier: GPL-2.0 2 2 # 3 + ifneq ($(shell pkg-config --exists alsa && echo 0 || echo 1),0) 4 + $(error Package alsa not found, please install alsa development package or \ 5 + add directory containing `alsa.pc` in PKG_CONFIG_PATH) 6 + endif 3 7 4 8 CFLAGS += $(shell pkg-config --cflags alsa) $(KHDR_INCLUDES) 5 9 LDLIBS += $(shell pkg-config --libs alsa)