change license from GPLv3 to GPLv3 or later
[mmq.git] / salsa.mk
blob7218a400c4cabcf22b8726f13dde5c4bb3c1ad27
1 # defaults for SALSA and ALSA, meant to be included in Makefile
3 MMQ_AO_PREFIX ?= $(prefix)
4 MMQ_AO_LIBS ?= -lsalsa
5 MMQ_AO_LDFLAGS ?= -L$(MMQ_AO_PREFIX)/lib
6 MMQ_AO_CFLAGS ?= -I$(MMQ_AO_PREFIX)/include
8 # ALSA device, raw ALSA/SALSA support only supports writing to one device
9 # MMQ_ALSA_DEVICE = default
10 ifdef MMQ_ALSA_DEVICE
11 # default is "default", values like "hw:1,0" (unquoted) are accepted here
12 MMQ_AO_CFLAGS += -DMMQ_ALSA_DEVICE='"$(MMQ_ALSA_DEVICE)"'
13 endif
15 # we disable auto-{resampling/channels/format} by default,
16 # MMQ_ALSA_MODE = NO_AUTO_RESAMPLE NO_AUTO_CHANNELS NO_AUTO_FORMAT
17 ifdef MMQ_ALSA_MODE
18 space =
19 space +=
20 alsa_mode := $(subst $(space),|,$(addprefix SND_PCM_,$(MMQ_ALSA_MODE)))
21 MMQ_AO_CFLAGS += -DMMQ_ALSA_MODE='$(alsa_mode)'
22 endif
24 # integer time in microseconds. increasing this can reduce skipping.
25 # Setting it to zero will use the device default (which may not work with mmap)
26 # The mmq default is 8 seconds
27 # MMQ_ALSA_BUFFER_TIME = 8000000
28 ifdef MMQ_ALSA_BUFFER_TIME
29 MMQ_AO_CFLAGS += -DMMQ_ALSA_BUFFER_TIME=$(MMQ_ALSA_BUFFER_TIME)
30 endif
32 # integer time in microseconds. increasing this will lower CPU usage
33 # Setting this to zero will use the default (which may not work with mmap)
34 # The mmq default is 10 milliseconds
35 # MMQ_ALSA_BUFFER_TIME = 10000
36 ifdef MMQ_ALSA_PERIOD_TIME
37 MMQ_AO_CFLAGS += -DMMQ_ALSA_PERIOD_TIME=$(MMQ_ALSA_PERIOD_TIME)
38 endif
40 # some helper targets to make custom/static distributions easier
41 salsa_dir = salsa-lib-0.0.26
42 salsa_pkg = $(salsa_dir).tar.bz2
43 salsa_url = ftp://ftp.suse.com/pub/people/tiwai/salsa-lib
45 salsa-fetch: $(salsa_pkg)
46 salsa-unpack: $(salsa_dir)/.stamp-unpack
47 salsa-configure: $(salsa_dir)/.stamp-configure
48 salsa-build: $(salsa_dir)/.stamp-build
49 salsa-install: $(salsa_dir)/.stamp-install
51 $(salsa_pkg):
52 curl -sSf $(salsa_url)/$(salsa_pkg) > $(salsa_pkg)+
53 mv $(salsa_pkg)+ $(salsa_pkg)
55 $(salsa_dir)/.stamp-unpack: $(salsa_pkg)
56 tar jxvf $(salsa_pkg)
57 > $@
59 $(salsa_dir)/.stamp-configure: $(salsa_dir)/.stamp-unpack
60 cd $(salsa_dir) && ./configure --prefix=$(prefix) --disable-mixer
61 > $@
63 $(salsa_dir)/.stamp-build: $(salsa_dir)/.stamp-configure
64 $(MAKE) -C $(salsa_dir)
65 > $@
67 $(salsa_dir)/.stamp-install: $(salsa_dir)/.stamp-build
68 $(MAKE) -C $(salsa_dir) install
69 > $@
71 .PHONY: $(addprefix salsa-,fetch unpack configure build install)