summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2007-05-03 20:55:54 +0200
committerTakashi Iwai <tiwai@suse.de>2007-05-03 20:55:54 +0200
commit21888c5f509323b481f321a8d4242540d6aaf9b4 (patch)
treefad9c7159b4f52bd623fd020effba0c302b953f1 /src
parent4c9e869ea38eaccd2deb77e371bea71cdcf1b758 (diff)
downloadalsa-lib-21888c5f509323b481f321a8d4242540d6aaf9b4.tar.gz
Add config and plugin directory options to configure
Added --with-configdir and --with-plugindir options to configure which specify the directories for config files and plugin objects respectively. The default paths when these options are not specified are unchanged.
Diffstat (limited to 'src')
-rw-r--r--src/alisp/alisp.c2
-rw-r--r--src/conf.c6
-rw-r--r--src/conf/Makefile.am2
-rw-r--r--src/conf/cards/Makefile.am4
-rw-r--r--src/conf/pcm/Makefile.am2
-rw-r--r--src/confmisc.c2
-rw-r--r--src/control/control.c4
-rw-r--r--src/mixer/simple_abst.c4
-rw-r--r--src/pcm/Makefile.am2
-rw-r--r--src/pcm/pcm.c4
-rw-r--r--src/pcm/pcm_rate.c2
11 files changed, 17 insertions, 17 deletions
diff --git a/src/alisp/alisp.c b/src/alisp/alisp.c
index 73f49bf8..50136ab3 100644
--- a/src/alisp/alisp.c
+++ b/src/alisp/alisp.c
@@ -2395,7 +2395,7 @@ struct alisp_object * F_path(struct alisp_instance *instance, struct alisp_objec
}
if (!strcmp(p1->value.s, "data")) {
delete_tree(instance, p1);
- return new_string(instance, DATADIR);
+ return new_string(instance, ALSA_CONFIG_DIR);
}
delete_tree(instance, p1);
return &alsa_lisp_nil;
diff --git a/src/conf.c b/src/conf.c
index 030b6291..e24b08d3 100644
--- a/src/conf.c
+++ b/src/conf.c
@@ -580,12 +580,12 @@ static int get_char_skip_comments(input_t *input)
if (err < 0)
return err;
if (!strncmp(str, "confdir:", 8)) {
- char *tmp = malloc(strlen(DATADIR "/alsa") + 1 + strlen(str + 8) + 1);
+ char *tmp = malloc(strlen(ALSA_CONFIG_DIR) + 1 + strlen(str + 8) + 1);
if (tmp == NULL) {
free(str);
return -ENOMEM;
}
- sprintf(tmp, DATADIR "/alsa/%s", str + 8);
+ sprintf(tmp, ALSA_CONFIG_DIR "/%s", str + 8);
free(str);
str = tmp;
}
@@ -2606,7 +2606,7 @@ int snd_config_search_alias_hooks(snd_config_t *config,
#define ALSA_CONFIG_PATH_VAR "ALSA_CONFIG_PATH"
/** The name of the default files used by #snd_config_update. */
-#define ALSA_CONFIG_PATH_DEFAULT DATADIR "/alsa/alsa.conf"
+#define ALSA_CONFIG_PATH_DEFAULT ALSA_CONFIG_DIR "/alsa.conf"
/**
* \ingroup Config
diff --git a/src/conf/Makefile.am b/src/conf/Makefile.am
index 33607d3c..8698d291 100644
--- a/src/conf/Makefile.am
+++ b/src/conf/Makefile.am
@@ -10,5 +10,5 @@ endif
EXTRA_DIST = $(cfg_files)
-alsadir = $(datadir)/alsa
+alsadir = @ALSA_CONFIG_DIR@
alsa_DATA = $(cfg_files)
diff --git a/src/conf/cards/Makefile.am b/src/conf/cards/Makefile.am
index e3ec7ebc..8677bca6 100644
--- a/src/conf/cards/Makefile.am
+++ b/src/conf/cards/Makefile.am
@@ -1,4 +1,4 @@
-alsadir = $(datadir)/alsa/cards
+alsadir = @ALSA_CONFIG_DIR@/cards
cfg_files = aliases.conf \
AACI.conf \
ATIIXP.conf \
@@ -56,7 +56,7 @@ endif
alsa_DATA = $(cfg_files)
if BUILD_ALISP
-SI7018dir = $(datadir)/alsa/cards/SI7018
+SI7018dir = @ALSA_CONFIG_DIR@/cards/SI7018
SI7018_files = \
SI7018/sndoc-mixer.alisp \
SI7018/sndop-mixer.alisp
diff --git a/src/conf/pcm/Makefile.am b/src/conf/pcm/Makefile.am
index 0b2c7e6e..7d9c0772 100644
--- a/src/conf/pcm/Makefile.am
+++ b/src/conf/pcm/Makefile.am
@@ -7,5 +7,5 @@ cfg_files = default.conf front.conf rear.conf center_lfe.conf side.conf\
EXTRA_DIST = $(cfg_files)
-alsadir = $(datadir)/alsa/pcm
+alsadir = @ALSA_CONFIG_DIR@/pcm
alsa_DATA = $(cfg_files)
diff --git a/src/confmisc.c b/src/confmisc.c
index 86b8de9c..b0b03019 100644
--- a/src/confmisc.c
+++ b/src/confmisc.c
@@ -588,7 +588,7 @@ int snd_func_datadir(snd_config_t **dst, snd_config_t *root ATTRIBUTE_UNUSED,
err = snd_config_get_id(src, &id);
if (err < 0)
return err;
- return snd_config_imake_string(dst, id, DATADIR "/alsa");
+ return snd_config_imake_string(dst, id, ALSA_CONFIG_DIR);
}
#ifndef DOC_HIDDEN
SND_DLSYM_BUILD_VERSION(snd_func_datadir, SND_CONFIG_DLSYM_VERSION_EVALUATE);
diff --git a/src/control/control.c b/src/control/control.c
index 785bb94d..085dc634 100644
--- a/src/control/control.c
+++ b/src/control/control.c
@@ -849,13 +849,13 @@ static int snd_ctl_open_conf(snd_ctl_t **ctlp, const char *name,
build_in++;
}
if (*build_in == NULL) {
- buf1 = malloc(strlen(str) + sizeof(PKGLIBDIR) + 32);
+ buf1 = malloc(strlen(str) + sizeof(ALSA_PLUGIN_DIR) + 32);
if (buf1 == NULL) {
err = -ENOMEM;
goto _err;
}
lib = buf1;
- sprintf(buf1, "%s/libasound_module_ctl_%s.so", PKGLIBDIR, str);
+ sprintf(buf1, "%s/libasound_module_ctl_%s.so", ALSA_PLUGIN_DIR, str);
}
}
#ifndef PIC
diff --git a/src/mixer/simple_abst.c b/src/mixer/simple_abst.c
index 26f620b2..5de2018b 100644
--- a/src/mixer/simple_abst.c
+++ b/src/mixer/simple_abst.c
@@ -41,7 +41,7 @@
#ifndef DOC_HIDDEN
-#define SO_PATH PKGLIBDIR "/smixer"
+#define SO_PATH ALSA_PLUGIN_DIR "/smixer"
typedef struct _class_priv {
char *device;
@@ -239,7 +239,7 @@ int snd_mixer_simple_basic_register(snd_mixer_t *mixer,
goto __error;
file = getenv("ALSA_MIXER_SIMPLE");
if (!file)
- file = DATADIR "/alsa/smixer.conf";
+ file = ALSA_CONFIG_DIR "/smixer.conf";
err = snd_config_top(&top);
if (err >= 0) {
err = snd_input_stdio_open(&input, file, "r");
diff --git a/src/pcm/Makefile.am b/src/pcm/Makefile.am
index 95e7ad04..204b012f 100644
--- a/src/pcm/Makefile.am
+++ b/src/pcm/Makefile.am
@@ -11,7 +11,7 @@ if BUILD_PCM_PLUGIN
libpcm_la_SOURCES += pcm_generic.c pcm_plugin.c
endif
if BUILD_PCM_PLUGIN_COPY
-libpcm_la_SOURCES += pcm_copy.c
+libpcm_la_SOURCES += pcm_copy.c pcm_demux.c
endif
if BUILD_PCM_PLUGIN_LINEAR
libpcm_la_SOURCES += pcm_linear.c
diff --git a/src/pcm/pcm.c b/src/pcm/pcm.c
index fa29ceff..4c72d1c2 100644
--- a/src/pcm/pcm.c
+++ b/src/pcm/pcm.c
@@ -2080,13 +2080,13 @@ static int snd_pcm_open_conf(snd_pcm_t **pcmp, const char *name,
build_in++;
}
if (*build_in == NULL) {
- buf1 = malloc(strlen(str) + sizeof(PKGLIBDIR) + 32);
+ buf1 = malloc(strlen(str) + sizeof(ALSA_PLUGIN_DIR) + 32);
if (buf1 == NULL) {
err = -ENOMEM;
goto _err;
}
lib = buf1;
- sprintf(buf1, "%s/libasound_module_pcm_%s.so", PKGLIBDIR, str);
+ sprintf(buf1, "%s/libasound_module_pcm_%s.so", ALSA_PLUGIN_DIR, str);
}
}
#ifndef PIC
diff --git a/src/pcm/pcm_rate.c b/src/pcm/pcm_rate.c
index 8e8fb06a..1eefad40 100644
--- a/src/pcm/pcm_rate.c
+++ b/src/pcm/pcm_rate.c
@@ -1284,7 +1284,7 @@ static int rate_open_func(snd_pcm_rate_t *rate, const char *type)
char lib_name[128], *lib = NULL;
if (!is_builtin_plugin(type)) {
snprintf(lib_name, sizeof(lib_name),
- "%s/libasound_module_rate_%s.so", PKGLIBDIR, type);
+ "%s/libasound_module_rate_%s.so", ALSA_PLUGIN_DIR, type);
lib = lib_name;
}
h = snd_dlopen(lib, RTLD_NOW);