alsa-utils/alsactl/Makefile.am
Jaroslav Kysela 8116639e56 alsactl: 90-alsa-restore.rules - add support for AMD ACP digital microphone
The UCM configuration for AMD ACP digital microphones combines HDA analog card
with ASoC AMD ACP digital microphone card. When the ACP microphone card
is detected later than HDA analog card, the UCM initialization for HDA
analog card should be executed again.

Additional changes:

Added --with-alsactl-udev-extra-test argument to handle the tests for
directories. The default value was kept.

Added --alsactl-udev-args argument to pass extra arguments to alsactl
in the udev rule.

Note: The autoconf does not handle correctly spaces so configure
call like 'configure --alsactl-udev-args="-E ENV=abcd"' is not allowed.
Substitue '__' string as ' ' for this reason.

Example:

   configure --with-alsactl-udev-args="-E__ENV=abcd" \
             --with-alsactl-udev-extra-test='TEST=="/abcd",__TEST=="/xyz",'

Closes: https://github.com/alsa-project/alsa-utils/issues/278
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2024-11-11 16:27:40 +01:00

76 lines
2 KiB
Makefile

SUBDIRS = init
sbin_PROGRAMS=alsactl
man_MANS=alsactl.1
if USE_XMLTO
man_MANS += alsactl_init.7
endif
EXTRA_DIST=alsactl.1 alsactl_init.xml
AM_CFLAGS = -D_GNU_SOURCE
AM_CPPFLAGS = -I$(top_srcdir)/include
alsactl_SOURCES=alsactl.c state.c lock.c utils.c init_parse.c init_ucm.c \
daemon.c monitor.c clean.c info.c
alsactl_CFLAGS=$(AM_CFLAGS) -D__USE_GNU \
-DSYS_ASOUNDRC=\"$(ASOUND_STATE_DIR)/asound.state\" \
-DSYS_LOCKPATH=\"$(ASOUND_LOCK_DIR)\" \
-DSYS_LOCKFILE=\"asound.state.lock\" \
-DSYS_PIDFILE=\"$(ALSACTL_PIDFILE_DIR)/alsactl.pid\"
noinst_HEADERS=alsactl.h list.h init_sysdeps.c init_utils_string.c \
init_utils_run.c init_sysfs.c
udevrules_DATA = \
90-alsa-restore.rules
if HAVE_SYSTEMD
systemdsystemunit_DATA = \
alsa-state.service \
alsa-restore.service
install-data-hook:
$(MKDIR_P) -m 0755 \
$(DESTDIR)$(systemdsystemunitdir)/sound.target.wants
( cd $(DESTDIR)$(systemdsystemunitdir)/sound.target.wants && \
rm -f alsa-state.service alsa-restore.service && \
$(LN_S) ../alsa-state.service alsa-state.service && \
$(LN_S) ../alsa-restore.service alsa-restore.service)
endif
edit = \
extratest=$$(echo ' $(ALSACTL_UDEV_EXTRATEST)' | sed -e 's/__/ /g' -e 's/^ $$//'); \
args=$$(echo ' $(ALSACTL_UDEV_ARGS)' | sed -e 's/__/ /g' -e 's/^ $$//'); \
$(SED) -r -e 's,@sbindir\@,$(sbindir),g' \
-e 's,@mydatadir\@,$(mydatadir),g' \
-e 's,@daemonswitch\@,$(ALSACTL_DAEMONSWITCH),g' \
-e 's,@asoundrcfile\@,$(ASOUND_STATE_DIR)/asound.state,g' \
-e "s;@extratest\@;$${extratest};g" \
-e "s;@args\@;$${args};g" \
< $< > $@ || rm $@
alsa-state.service: alsa-state.service.in
$(edit)
alsa-restore.service: alsa-restore.service.in
$(edit)
90-alsa-restore.rules: 90-alsa-restore.rules.in
$(edit)
EXTRA_DIST += \
alsa-state.service.in \
alsa-restore.service.in \
90-alsa-restore.rules.in
CLEANFILES = \
alsa-state.service \
alsa-restore.service \
90-alsa-restore.rules
%.7: %.xml
xmlto man $?