{
struct weston_config_section *section;
int duration;
- char *s;
+ char *s, *client;
section = weston_config_get_section(shell->compositor->config,
"screensaver", NULL, NULL);
section = weston_config_get_section(shell->compositor->config,
"shell", NULL, NULL);
+ asprintf(&client, "%s/%s", weston_config_get_libexec_dir(),
+ WESTON_SHELL_CLIENT);
weston_config_section_get_string(section,
- "client", &s, LIBEXECDIR "/" WESTON_SHELL_CLIENT);
+ "client", &s, client);
+ free(client);
shell->client = s;
weston_config_section_get_string(section,
"binding-modifier", &s, "super");
return 0;
}
+WL_EXPORT
+const char *
+weston_config_get_libexec_dir(void)
+{
+ const char *path = getenv("WESTON_BUILD_DIR");
+
+ if (path)
+ return path;
+
+ return LIBEXECDIR;
+}
+
static struct weston_config_section *
config_add_section(struct weston_config *config, const char *name)
{
weston_config_section_get_bool(struct weston_config_section *section,
const char *key,
int *value, int default_value);
+const char *
+weston_config_get_libexec_dir(void);
+
struct weston_config *
weston_config_parse(const char *name);
void *data)
{
struct screenshooter *shooter = data;
- const char *screenshooter_exe = LIBEXECDIR "/weston-screenshooter";
+ char *screenshooter_exe;
+
+ asprintf(&screenshooter_exe, "%s/%s", weston_config_get_libexec_dir(),
+ "/weston-screenshooter");
if (!shooter->client)
shooter->client = weston_client_launch(shooter->ec,
&shooter->process,
screenshooter_exe, screenshooter_sigchld);
+ free(screenshooter_exe);
}
struct weston_recorder {
text_backend_configuration(struct text_backend *text_backend)
{
struct weston_config_section *section;
+ char *client;
section = weston_config_get_section(text_backend->compositor->config,
"input-method", NULL, NULL);
+ asprintf(&client, "%s/weston-keyboard",
+ weston_config_get_libexec_dir());
weston_config_section_get_string(section, "path",
&text_backend->input_method.path,
- LIBEXECDIR "/weston-keyboard");
+ client);
+ free(client);
}
static void
case $TESTNAME in
*.la|*.so)
+ WESTON_BUILD_DIR=$abs_builddir \
$WESTON --backend=$BACKEND \
--no-config \
--shell=$SHELL_PLUGIN \
&> "$OUTLOG"
;;
*)
+ WESTON_BUILD_DIR=$abs_builddir \
WESTON_TEST_CLIENT_PATH=$abs_builddir/$TESTNAME $WESTON \
--socket=test-$(basename $TESTNAME) \
--backend=$BACKEND \