diff options
author | Takashi Iwai <tiwai@suse.de> | 2007-08-01 23:57:15 +0200 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2007-08-01 23:57:15 +0200 |
commit | a8575e6cf67d859b15feaf43f3ad59eedab632d7 (patch) | |
tree | e06d069b60fd8c6ab95677f9b5d36147035a044e | |
parent | dc0e189c44f9f409734d158dca20286f231303d3 (diff) | |
download | salsa-lib-a8575e6cf67d859b15feaf43f3ad59eedab632d7.tar.gz |
Add --with-alsa-devdir configure option.v0.0.9
Add SALSA_DEVPATH to recipe.h.
-rw-r--r-- | README | 3 | ||||
-rw-r--r-- | configure.ac | 11 | ||||
-rw-r--r-- | src/cards.c | 2 | ||||
-rw-r--r-- | src/control.c | 2 | ||||
-rw-r--r-- | src/hwdep.c | 3 | ||||
-rw-r--r-- | src/local.h | 2 | ||||
-rw-r--r-- | src/pcm.c | 2 | ||||
-rw-r--r-- | src/rawmidi.c | 2 | ||||
-rw-r--r-- | src/recipe.h.in | 2 | ||||
-rw-r--r-- | src/timer.c | 2 |
10 files changed, 23 insertions, 8 deletions
@@ -111,6 +111,9 @@ the description of "MISC" in the section "GENERAL"), pass The alsa-library version to be compatible can be given explicitly via --with-compat-version option. As default, 1.0.14 is set. +If the ALSA device files are not in /dev/snd, another directory can be +specified with the --with-alsa-devdir option. + The library is installed as $LIBDIR/libsalsa.so.*. This package provides also the compatible alsa.m4 and alsa.pc. If the other packages can be autoreconf'ed, you'll be able to link libsalsa diff --git a/configure.ac b/configure.ac index 64552cf..8e889de 100644 --- a/configure.ac +++ b/configure.ac @@ -35,6 +35,17 @@ AC_SUBST(SND_LIB_MINOR) AC_SUBST(SND_LIB_SUBMINOR) AC_SUBST(SND_LIB_EXTRAVER) +dnl Non-standard device files directory +AC_MSG_CHECKING([for ALSA device file directory]) +AC_ARG_WITH(alsa-devdir, + AS_HELP_STRING([--with-alsa-devdir=dir], + [directory with ALSA device files (default /dev/snd)]), + [alsa_dev_dir="$withval"], + [alsa_dev_dir="/dev/snd"]) +DEVPATH="$alsa_dev_dir" +AC_SUBST(DEVPATH) +AC_MSG_RESULT([$alsa_dev_dir]) + dnl Component selections AC_ARG_ENABLE(pcm, diff --git a/src/cards.c b/src/cards.c index 2da7c11..b87533a 100644 --- a/src/cards.c +++ b/src/cards.c @@ -44,7 +44,7 @@ int _snd_set_nonblock(int fd, int nonblock) return 0; } -#define SND_FILE_CONTROL DEVPATH "/controlC%i" +#define SND_FILE_CONTROL SALSA_DEVPATH "/controlC%i" int snd_card_load(int card) { diff --git a/src/control.c b/src/control.c index ab2dddd..0a08b45 100644 --- a/src/control.c +++ b/src/control.c @@ -48,7 +48,7 @@ int snd_ctl_open(snd_ctl_t **ctlp, const char *name, int mode) return err; snprintf(filename, sizeof(filename), "%s/controlC%d", - DEVPATH, card); + SALSA_DEVPATH, card); if (mode & SND_CTL_READONLY) fmode = O_RDONLY; else diff --git a/src/hwdep.c b/src/hwdep.c index 3aca775..0d50638 100644 --- a/src/hwdep.c +++ b/src/hwdep.c @@ -43,7 +43,8 @@ int snd_hwdep_open(snd_hwdep_t **handlep, const char *name, int mode) return err; if (card < 0 || card >= 32) return -EINVAL; - snprintf(filename, sizeof(filename), "%s/hwdepC%d", DEVPATH, card); + snprintf(filename, sizeof(filename), "%s/hwdepC%d", + SALSA_DEVPATH, card); fd = open(filename, mode); if (fd < 0) return -errno; diff --git a/src/local.h b/src/local.h index b7d14f8..abe37d3 100644 --- a/src/local.h +++ b/src/local.h @@ -1,8 +1,6 @@ #ifndef __LOCAL_H_INC #define __LOCAL_H_INC -#define DEVPATH "/dev/snd" - int _snd_dev_get_device(const char *name, int *cardp, int *devp, int *subdevp); int _snd_ctl_hw_open(snd_ctl_t **ctlp, int card); @@ -87,7 +87,7 @@ int snd_pcm_open(snd_pcm_t **pcmp, const char *name, return err; snprintf(filename, sizeof(filename), "%s/pcmC%dD%d%c", - DEVPATH, card, dev, + SALSA_DEVPATH, card, dev, (stream == SND_PCM_STREAM_PLAYBACK ? 'p' : 'c')); fmode = O_RDWR | O_NONBLOCK; if (mode & SND_PCM_ASYNC) diff --git a/src/rawmidi.c b/src/rawmidi.c index 00e837f..d1266d4 100644 --- a/src/rawmidi.c +++ b/src/rawmidi.c @@ -104,7 +104,7 @@ int snd_rawmidi_open(snd_rawmidi_t **in_rmidi, snd_rawmidi_t **out_rmidi, return err; snprintf(filename, sizeof(filename), "%s/midiC%dD%d", - DEVPATH, card, dev); + SALSA_DEVPATH, card, dev); if (!in_rmidi) fmode = O_WRONLY; diff --git a/src/recipe.h.in b/src/recipe.h.in index 4b9bf7b..bad6268 100644 --- a/src/recipe.h.in +++ b/src/recipe.h.in @@ -10,4 +10,6 @@ /* Enable deprecated attribute for non-working functions */ #define SALSA_MARK_DEPRECATED @SALSA_MARK_DEPRECATED@ +#define SALSA_DEVPATH "@DEVPATH@" + #endif /* __ALSA_RECIPE_H */ diff --git a/src/timer.c b/src/timer.c index 888596c..d9254b0 100644 --- a/src/timer.c +++ b/src/timer.c @@ -49,7 +49,7 @@ int snd_timer_open(snd_timer_t **handle, const char *name, int mode) tmode = O_RDONLY; if (mode & SND_TIMER_OPEN_NONBLOCK) tmode |= O_NONBLOCK; - fd = open(DEVPATH "/timer", tmode); + fd = open(SALSA_DEVPATH "/timer", tmode); if (fd < 0) return -errno; if (ioctl(fd, SNDRV_TIMER_IOCTL_PVERSION, &ver) < 0) { |