update win32 script search path

The default script search path on Windows is out of date with
the current layout (from installation and documentation), which
makes the standard script library not be found after a normal

	./configure && make && make install

under msys/MinGW. The same should hold true for cygwin native builds
(not verified).

Update search path to ../share/openocd/scripts not ../lib/openocd,
relative to the openocd executable.

Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
This commit is contained in:
Andreas Fritiofson 2009-11-21 16:53:31 +01:00 committed by David Brownell
parent fb4239866c
commit 4f310aa0c9

View File

@ -74,21 +74,21 @@ static void add_default_dirs(void)
add_script_search_dir(strExePath);
}
/*
* Add support for the default (as of 20080121) layout when
* using autotools and cygwin to build native MinGW binary.
* Add support for the default (as of 20091118) layout when
* using autotools and cygwin/MinGW to build native binary.
* Path separator is converted to UNIX style so that MinGW is
* pleased.
*
* bin/openocd.exe
* lib/openocd/event/at91eb40a_reset.cfg
* lib/openocd/target/at91eb40a.cfg
* share/openocd/scripts/interface/dummy.cfg
* share/openocd/scripts/target/at91eb40a.cfg
*/
{
char strExePath [MAX_PATH];
char *p;
GetModuleFileName (NULL, strExePath, MAX_PATH);
*strrchr(strExePath, '\\') = 0;
strcat(strExePath, "/../lib/"PACKAGE);
strcat(strExePath, "/../share/"PACKAGE"/scripts");
for (p = strExePath; *p; p++) {
if (*p == '\\')
*p = '/';