From 218e29301f3655aae3081522bdc7b55bfcda9ff7 Mon Sep 17 00:00:00 2001 From: Pierre Pronchery Date: Fri, 27 Sep 2019 03:00:25 +0200 Subject: [PATCH] Add support for OBJDIR --- tests/transport.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/transport.c b/tests/transport.c index 908419f..e06a2df 100644 --- a/tests/transport.c +++ b/tests/transport.c @@ -70,6 +70,7 @@ static int _usage(void); static int _transport(char const * protocol, char const * name) { char * cwd; + char const * p; Plugin * plugin; AppTransport transport; AppTransportPluginHelper * helper = &transport.helper; @@ -79,7 +80,10 @@ static int _transport(char const * protocol, char const * name) if((cwd = getcwd(NULL, 0)) == NULL) return error_set_print(PROGNAME, 2, "%s", strerror(errno)); /* XXX rather ugly but does the trick */ - plugin = plugin_new(cwd, "../src", "transport", protocol); + if((p = getenv("OBJDIR")) != NULL) + plugin = plugin_new(p, "../src", "transport", protocol); + else + plugin = plugin_new(cwd, "../src", "transport", protocol); free(cwd); if(plugin == NULL) return error_print(PROGNAME);