summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Muir <muirj@google.com>2016-04-04 14:06:52 -0700
committerchrome-bot <chrome-bot@chromium.org>2016-04-27 23:58:02 -0700
commitec89399871571297c854a0a1fbdd6e0d4385b450 (patch)
tree022aa0af7169c546829c3ba2c15e9201ce4ba20e
parent54d7d7c2c921c0e264b1b22d4f5ffe642e3d4f9d (diff)
downloadadhd-ec89399871571297c854a0a1fbdd6e0d4385b450.tar.gz
CRAS: Make the CRAS_CONFIG_FILE_DIR configurable.
Now it is defined by the configure script as ${sysconfdir}/cras which is normally /etc/cras. Required in order to enable CRAS on Brillo. BUG=None TEST=Build passes with default configuration. Build passes on Brillo with custom CRAS_CONFIG_FILE_DIR. CRAS executes on Brillo. Change-Id: Ie467fb5a7526761bb3f127800e50f7ff1fe6efa5 Reviewed-on: https://chromium-review.googlesource.com/339404 Commit-Ready: John Muir <muirj@google.com> Tested-by: John Muir <muirj@google.com> Reviewed-by: Cheng-Yi Chiang <cychiang@chromium.org>
-rw-r--r--cras/configure.ac5
-rw-r--r--cras/src/common/cras_config.h4
2 files changed, 8 insertions, 1 deletions
diff --git a/cras/configure.ac b/cras/configure.ac
index 3102cf5f..89485412 100644
--- a/cras/configure.ac
+++ b/cras/configure.ac
@@ -64,6 +64,11 @@ AC_DEFINE_UNQUOTED(ALSA_PLUGIN_DIR, "$plugindir",
ALSA_PLUGIN_DIR="$plugindir"
AC_SUBST(ALSA_PLUGIN_DIR)
+# Determine CRAS configuration directory.
+eval cras_config_file_dir="$sysconfdir/cras"
+AC_DEFINE_UNQUOTED(CRAS_CONFIG_FILE_DIR, "$cras_config_file_dir",
+ [directory containing CRAS configuration])
+
# Get iniparser library and include locations
AC_ARG_WITH([iniparser-include-path],
[AS_HELP_STRING([--with-iniparser-include-path],
diff --git a/cras/src/common/cras_config.h b/cras/src/common/cras_config.h
index 96a84c78..c1731c73 100644
--- a/cras/src/common/cras_config.h
+++ b/cras/src/common/cras_config.h
@@ -12,7 +12,9 @@
#define CRAS_CLIENT_RT_THREAD_PRIORITY 10
#define CRAS_CLIENT_NICENESS_LEVEL -10
#define CRAS_SOCKET_FILE ".cras_socket"
-#define CRAS_CONFIG_FILE_DIR "/etc/cras"
+
+/* CRAS_CONFIG_FILE_DIR is defined as $sysconfdir/cras by the configure
+ script. */
/* Gets the path to save UDS socket files. */
const char *cras_config_get_system_socket_file_dir();