diff options
author | Jonathan Larmour <jifl@eCosCentric.com> | 2015-10-06 21:47:35 +0100 |
---|---|---|
committer | Freddie Chopin <freddie.chopin@gmail.com> | 2015-11-03 22:19:36 +0000 |
commit | 03e240f3bfb973968961c1ed21cac748f0d771da (patch) | |
tree | d19dc7bd6c4229ae0eb8a59d9850fe5da47ff223 /src/helper | |
parent | d651d7109f368f66eba481404e9d063ec1219a69 (diff) |
helper/options: Use OPENOCD_SCRIPTS dir if set.
This makes it easier to relocate the install tree of OpenOCD from where
it was originally built (for example, if put onto a different machine),
without having to change scripts or add something to the command line
every time.
Change-Id: Ia5edf0eba166f7a999f267bd6a92402dab9b399e
Signed-off-by: Jonathan Larmour <jifl@eCosCentric.com>
Reviewed-on: http://openocd.zylin.com/3004
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
Diffstat (limited to 'src/helper')
-rw-r--r-- | src/helper/options.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/helper/options.c b/src/helper/options.c index bbd071fd..b13d466d 100644 --- a/src/helper/options.c +++ b/src/helper/options.c @@ -113,6 +113,12 @@ static void add_default_dirs(void) free(path); } } + + path = getenv("OPENOCD_SCRIPTS"); + + if (path) + add_script_search_dir(path); + #ifdef _WIN32 const char *appdata = getenv("APPDATA"); |