diff options
author | duane <duane@b42882b7-edfa-0310-969c-e2dbd0fdcd60> | 2009-03-07 15:19:21 +0000 |
---|---|---|
committer | duane <duane@b42882b7-edfa-0310-969c-e2dbd0fdcd60> | 2009-03-07 15:19:21 +0000 |
commit | 7a731eb637316c00257e0f79a663eaf9219d7527 (patch) | |
tree | 0b90792f86546a7cc40407d17d11f2fa5f788934 /src | |
parent | 0f3c9f8f060428d07679dab3311b3337e9d10338 (diff) | |
download | openocd_libswd-7a731eb637316c00257e0f79a663eaf9219d7527.tar.gz openocd_libswd-7a731eb637316c00257e0f79a663eaf9219d7527.tar.bz2 openocd_libswd-7a731eb637316c00257e0f79a663eaf9219d7527.tar.xz openocd_libswd-7a731eb637316c00257e0f79a663eaf9219d7527.zip |
Added HostOS variable
git-svn-id: svn://svn.berlios.de/openocd/trunk@1400 b42882b7-edfa-0310-969c-e2dbd0fdcd60
Diffstat (limited to 'src')
-rw-r--r-- | src/helper/command.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/helper/command.c b/src/helper/command.c index bc1fb348..d5be42df 100644 --- a/src/helper/command.c +++ b/src/helper/command.c @@ -672,6 +672,7 @@ command_context_t* command_init() { command_context_t* context = malloc(sizeof(command_context_t)); extern const char startup_tcl[]; + const char *HostOs; context->mode = COMMAND_EXEC; context->commands = NULL; @@ -687,6 +688,28 @@ command_context_t* command_init() Jim_RegisterCoreCommands(interp); #endif +#if defined( _MSC_VER ) + /* WinXX - is generic, the forward + * looking problem is this: + * + * "win32" or "win64" + * + * "winxx" is generic. + */ + HostOs = "winxx"; +#elif defined( __LINUX__) + HostOs = "linux"; +#elif defined( __DARWIN__ ) + HostOs = "darwin"; +#elif defined( __CYGWIN__ ) + HostOs = "cygwin"; +#elif defined( __MINGW32__ ) + HostOs = "mingw32"; +#else + HostOs = "other"; +#endif + Jim_SetGlobalVariableStr( interp, "ocd_HOSTOS", Jim_NewStringObj( interp, HostOs , strlen(HostOs)) ); + Jim_CreateCommand(interp, "ocd_find", jim_find, NULL, NULL); Jim_CreateCommand(interp, "echo", jim_echo, NULL, NULL); Jim_CreateCommand(interp, "capture", jim_capture, NULL, NULL); |