Less wrong handling of JIM_EMBEDDED, follow Jim Tcl doc's and only use JIM_EMBEDDED in a single .c file. Still broken w/-fno-common(i.e. Mac OS).

git-svn-id: svn://svn.berlios.de/openocd/trunk@1794 b42882b7-edfa-0310-969c-e2dbd0fdcd60
This commit is contained in:
oharboe 2009-05-15 20:35:53 +00:00
parent b9522f0e78
commit 4dcd58724a
2 changed files with 8 additions and 4 deletions

View File

@ -30,6 +30,11 @@
#include "config.h" #include "config.h"
#endif #endif
#if !BUILD_ECOSBOARD
/* see Embedder-HOWTO.txt in Jim Tcl project hosted on BerliOS*/
#define JIM_EMBEDDED
#endif
// @todo the inclusion of target.h here is a layering violation // @todo the inclusion of target.h here is a layering violation
#include "target.h" #include "target.h"
#include "command.h" #include "command.h"
@ -675,7 +680,7 @@ command_context_t* command_init()
context->output_handler = NULL; context->output_handler = NULL;
context->output_handler_priv = NULL; context->output_handler_priv = NULL;
#ifdef JIM_EMBEDDED #if !BUILD_ECOSBOARD
Jim_InitEmbedded(); Jim_InitEmbedded();
/* Create an interpreter */ /* Create an interpreter */
interp = Jim_CreateInterp(); interp = Jim_CreateInterp();
@ -721,7 +726,7 @@ command_context_t* command_init()
add_default_dirs(); add_default_dirs();
#ifdef JIM_EMBEDDED #if !BUILD_ECOSBOARD
Jim_EventLoopOnLoad(interp); Jim_EventLoopOnLoad(interp);
#endif #endif
if (Jim_Eval_Named(interp, startup_tcl, "embedded:startup.tcl",1)==JIM_ERR) if (Jim_Eval_Named(interp, startup_tcl, "embedded:startup.tcl",1)==JIM_ERR)
@ -800,7 +805,7 @@ int handle_fast_command(struct command_context_s *cmd_ctx, char *cmd, char **arg
void process_jim_events(void) void process_jim_events(void)
{ {
#ifdef JIM_EMBEDDED #if !BUILD_ECOSBOARD
static int recursion = 0; static int recursion = 0;
if (!recursion) if (!recursion)

View File

@ -32,7 +32,6 @@
/* Jim is provied by eCos */ /* Jim is provied by eCos */
#include <cyg/jimtcl/jim.h> #include <cyg/jimtcl/jim.h>
#else #else
#define JIM_EMBEDDED
#include "jim.h" #include "jim.h"
#endif #endif