Changes On Branch stubbed-tcl
Not logged in

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Changes In Branch stubbed-tcl Excluding Merge-Ins

This is equivalent to a diff from a0da8b3873 to ba91fe5f9e

2012-09-28
20:15
Refinements to the Tcl stubs integration. check-in: a0b3507d6c user: mistachkin tags: tclStubsV2
10:18
Update to the latest SQLite amalgamation, for the purpose of testing recent changes in SQLite. check-in: c0f245de25 user: drh tags: trunk
07:26
load Tcl dynamically using the Stubs mechanism in stead of linking in the library statically. Closed-Leaf check-in: ba91fe5f9e user: jan.nijtmans tags: stubbed-tcl
2012-09-27
21:16
Merge the partialCommitPerms branch which fixes an issue with permission bit changes of non-specified files being picked up by a partial commit. check-in: a0da8b3873 user: drh tags: trunk
17:29
Update the pre-checkin checklist to talk about the new --tk option to the diff command. check-in: 394177917c user: drh tags: trunk
2012-09-25
11:48
Candidate fix for maintaining existing permission bits for partial check-ins. Closed-Leaf check-in: 33ffb32cb8 user: mistachkin tags: partialCommitPerms

Changes to src/makemake.tcl.

422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
...
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
#    used if the FOSSIL_TCL_SOURCE macro is not defined.
#
TCLINCDIR = $(TCLDIR)/include
TCLLIBDIR = $(TCLDIR)/lib

#### Tcl: Which Tcl library do we want to use (8.4, 8.5, 8.6, etc)?
#
LIBTCL = -ltcl86

#### C Compile and options for use in building executables that
#    will run on the target platform.  This is usually the same
#    as BCC, unless you are cross-compiling.  This C compiler builds
#    the finished binary for fossil.  The BCC compiler above is used
#    for building intermediate code-generator tools.
#
................................................................................

# With HTTPS support
ifdef FOSSIL_ENABLE_SSL
TCC += -DFOSSIL_ENABLE_SSL=1
RCC += -DFOSSIL_ENABLE_SSL=1
endif

# With Tcl support (statically linked)
ifdef FOSSIL_ENABLE_TCL
TCC += -DFOSSIL_ENABLE_TCL=1 -DSTATIC_BUILD
RCC += -DFOSSIL_ENABLE_TCL=1
endif

# With JSON support
ifdef FOSSIL_ENABLE_JSON
TCC += -DFOSSIL_ENABLE_JSON=1
RCC += -DFOSSIL_ENABLE_JSON=1






|







 







|

|







422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
...
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
#    used if the FOSSIL_TCL_SOURCE macro is not defined.
#
TCLINCDIR = $(TCLDIR)/include
TCLLIBDIR = $(TCLDIR)/lib

#### Tcl: Which Tcl library do we want to use (8.4, 8.5, 8.6, etc)?
#
LIBTCL = -ltclstub86

#### C Compile and options for use in building executables that
#    will run on the target platform.  This is usually the same
#    as BCC, unless you are cross-compiling.  This C compiler builds
#    the finished binary for fossil.  The BCC compiler above is used
#    for building intermediate code-generator tools.
#
................................................................................

# With HTTPS support
ifdef FOSSIL_ENABLE_SSL
TCC += -DFOSSIL_ENABLE_SSL=1
RCC += -DFOSSIL_ENABLE_SSL=1
endif

# With Tcl support
ifdef FOSSIL_ENABLE_TCL
TCC += -DFOSSIL_ENABLE_TCL=1 -DUSE_TCL_STUBS
RCC += -DFOSSIL_ENABLE_TCL=1
endif

# With JSON support
ifdef FOSSIL_ENABLE_JSON
TCC += -DFOSSIL_ENABLE_JSON=1
RCC += -DFOSSIL_ENABLE_JSON=1

Changes to src/th_tcl.c.

33
34
35
36
37
38
39






40
41
42
43
44
45
46
...
443
444
445
446
447
448
449


















450
451
452
453
454
455
456
...
458
459
460
461
462
463
464

























465
466

467
468
469
470
471

472
473
474
475
476
477
478
/*
** Workaround NRE-specific issue in Tcl_EvalObjCmd (SF bug #3399564) by using
** Tcl_EvalObjv instead of invoking the objProc directly.
 */
#define USE_TCL_EVALOBJV   1
#endif







/*
** These macros are designed to reduce the redundant code required to marshal
** arguments from TH1 to Tcl.
 */
#define USE_ARGV_TO_OBJV() \
  int objc;                \
  Tcl_Obj **objv;          \
................................................................................
  Th_Interp *interp,
  void *pContext
){
  struct TclContext *tclContext = (struct TclContext *)pContext;
  int argc;
  char **argv;
  char *argv0 = 0;


















  Tcl_Interp *tclInterp;

  if ( !tclContext ){
    Th_ErrorMessage(interp,
        "Invalid Tcl context", (const char *)"", 0);
    return TH_ERROR;
  }
................................................................................
    return TH_OK;
  }
  argc = tclContext->argc;
  argv = tclContext->argv;
  if( argc>0 && argv ){
    argv0 = argv[0];
  }

























  Tcl_FindExecutable(argv0);
  tclInterp = tclContext->interp = Tcl_CreateInterp();

  if( !tclInterp || Tcl_InterpDeleted(tclInterp) ){
    Th_ErrorMessage(interp,
        "Could not create Tcl interpreter", (const char *)"", 0);
    return TH_ERROR;
  }

  if( Tcl_Init(tclInterp)!=TCL_OK ){
    Th_ErrorMessage(interp,
        "Tcl initialization error:", Tcl_GetStringResult(tclInterp), -1);
    Tcl_DeleteInterp(tclInterp);
    tclContext->interp = tclInterp = 0;
    return TH_ERROR;
  }






>
>
>
>
>
>







 







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







 







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>

|
>
|




>







33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
...
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
...
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
/*
** Workaround NRE-specific issue in Tcl_EvalObjCmd (SF bug #3399564) by using
** Tcl_EvalObjv instead of invoking the objProc directly.
 */
#define USE_TCL_EVALOBJV   1
#endif

#ifdef _WIN32
# include <windows.h>
#else
# include <dlfcn.h>
#endif

/*
** These macros are designed to reduce the redundant code required to marshal
** arguments from TH1 to Tcl.
 */
#define USE_ARGV_TO_OBJV() \
  int objc;                \
  Tcl_Obj **objv;          \
................................................................................
  Th_Interp *interp,
  void *pContext
){
  struct TclContext *tclContext = (struct TclContext *)pContext;
  int argc;
  char **argv;
  char *argv0 = 0;
#ifdef USE_TCL_STUBS
#ifdef _WIN32
  WCHAR lib[] = L"tcl87.dll";
#define minver lib[4]
#define dlopen(a,b) (void *)LoadLibraryW(a);
#define dlsym(a,b) GetProcAddress((HANDLE)(a),b);
#else
#ifdef __CYGWIN__
  char lib[] = "libtcl8.7.dll";
#else
  char lib[] = "libtcl8.7.so";
#endif
#define minver lib[8]
#endif
  void *handle = NULL;
  void (*findExecutable)(const char *) = 0;
  Tcl_Interp *(*createInterp)() = 0;
#endif /* USE_TCL_STUBS */
  Tcl_Interp *tclInterp;

  if ( !tclContext ){
    Th_ErrorMessage(interp,
        "Invalid Tcl context", (const char *)"", 0);
    return TH_ERROR;
  }
................................................................................
    return TH_OK;
  }
  argc = tclContext->argc;
  argv = tclContext->argv;
  if( argc>0 && argv ){
    argv0 = argv[0];
  }
#ifdef USE_TCL_STUBS
  while( --minver>'3' ){
    handle = dlopen(lib, RTLD_NOW | RTLD_LOCAL);
    if( handle ) {
      const char *sym = "_Tcl_FindExecutable";
      findExecutable = (void (*)(const char *)) dlsym(handle, sym+1);
      if (!findExecutable)
        findExecutable = (void (*)(const char *)) dlsym(handle, sym);
      sym = "_Tcl_CreateInterp";
      createInterp = (Tcl_Interp * (*)(void)) dlsym(handle, sym+1);
      if (!createInterp)
        createInterp = (Tcl_Interp * (*)(void)) dlsym(handle, sym);
      break;
    }
  }
  if( !handle ){
    Th_ErrorMessage(interp,
        "Could not create Tcl interpreter", (const char *)"", 0);
    return TH_ERROR;
  }
#  undef Tcl_FindExecutable
#  define Tcl_FindExecutable findExecutable
#  undef Tcl_CreateInterp
#  define Tcl_CreateInterp createInterp
#endif /* USE_TCL_STUBS */
  Tcl_FindExecutable(argv0);
  tclInterp = Tcl_CreateInterp();
  if( !tclInterp || !Tcl_InitStubs(tclInterp, "8.4", 0)
      || Tcl_InterpDeleted(tclInterp) ){
    Th_ErrorMessage(interp,
        "Could not create Tcl interpreter", (const char *)"", 0);
    return TH_ERROR;
  }
  tclContext->interp = tclInterp;
  if( Tcl_Init(tclInterp)!=TCL_OK ){
    Th_ErrorMessage(interp,
        "Tcl initialization error:", Tcl_GetStringResult(tclInterp), -1);
    Tcl_DeleteInterp(tclInterp);
    tclContext->interp = tclInterp = 0;
    return TH_ERROR;
  }

Changes to win/Makefile.mingw.

94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
...
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
#    used if the FOSSIL_TCL_SOURCE macro is not defined.
#
TCLINCDIR = $(TCLDIR)/include
TCLLIBDIR = $(TCLDIR)/lib

#### Tcl: Which Tcl library do we want to use (8.4, 8.5, 8.6, etc)?
#
LIBTCL = -ltcl86

#### C Compile and options for use in building executables that
#    will run on the target platform.  This is usually the same
#    as BCC, unless you are cross-compiling.  This C compiler builds
#    the finished binary for fossil.  The BCC compiler above is used
#    for building intermediate code-generator tools.
#
................................................................................

# With HTTPS support
ifdef FOSSIL_ENABLE_SSL
TCC += -DFOSSIL_ENABLE_SSL=1
RCC += -DFOSSIL_ENABLE_SSL=1
endif

# With Tcl support (statically linked)
ifdef FOSSIL_ENABLE_TCL
TCC += -DFOSSIL_ENABLE_TCL=1 -DSTATIC_BUILD
RCC += -DFOSSIL_ENABLE_TCL=1
endif

# With JSON support
ifdef FOSSIL_ENABLE_JSON
TCC += -DFOSSIL_ENABLE_JSON=1
RCC += -DFOSSIL_ENABLE_JSON=1






|







 







|

|







94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
...
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
#    used if the FOSSIL_TCL_SOURCE macro is not defined.
#
TCLINCDIR = $(TCLDIR)/include
TCLLIBDIR = $(TCLDIR)/lib

#### Tcl: Which Tcl library do we want to use (8.4, 8.5, 8.6, etc)?
#
LIBTCL = -ltclstub86

#### C Compile and options for use in building executables that
#    will run on the target platform.  This is usually the same
#    as BCC, unless you are cross-compiling.  This C compiler builds
#    the finished binary for fossil.  The BCC compiler above is used
#    for building intermediate code-generator tools.
#
................................................................................

# With HTTPS support
ifdef FOSSIL_ENABLE_SSL
TCC += -DFOSSIL_ENABLE_SSL=1
RCC += -DFOSSIL_ENABLE_SSL=1
endif

# With Tcl support
ifdef FOSSIL_ENABLE_TCL
TCC += -DFOSSIL_ENABLE_TCL=1 -DUSE_TCL_STUBS
RCC += -DFOSSIL_ENABLE_TCL=1
endif

# With JSON support
ifdef FOSSIL_ENABLE_JSON
TCC += -DFOSSIL_ENABLE_JSON=1
RCC += -DFOSSIL_ENABLE_JSON=1

Changes to win/Makefile.mingw.mistachkin.

94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
...
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
#    used if the FOSSIL_TCL_SOURCE macro is not defined.
#
TCLINCDIR = $(TCLDIR)/include
TCLLIBDIR = $(TCLDIR)/lib

#### Tcl: Which Tcl library do we want to use (8.4, 8.5, 8.6, etc)?
#
LIBTCL = -ltcl86

#### C Compile and options for use in building executables that
#    will run on the target platform.  This is usually the same
#    as BCC, unless you are cross-compiling.  This C compiler builds
#    the finished binary for fossil.  The BCC compiler above is used
#    for building intermediate code-generator tools.
#
................................................................................

# With HTTPS support
ifdef FOSSIL_ENABLE_SSL
TCC += -DFOSSIL_ENABLE_SSL=1
RCC += -DFOSSIL_ENABLE_SSL=1
endif

# With Tcl support (statically linked)
ifdef FOSSIL_ENABLE_TCL
TCC += -DFOSSIL_ENABLE_TCL=1 -DSTATIC_BUILD
RCC += -DFOSSIL_ENABLE_TCL=1
endif

# With JSON support
ifdef FOSSIL_ENABLE_JSON
TCC += -DFOSSIL_ENABLE_JSON=1
RCC += -DFOSSIL_ENABLE_JSON=1






|







 







|

|







94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
...
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
#    used if the FOSSIL_TCL_SOURCE macro is not defined.
#
TCLINCDIR = $(TCLDIR)/include
TCLLIBDIR = $(TCLDIR)/lib

#### Tcl: Which Tcl library do we want to use (8.4, 8.5, 8.6, etc)?
#
LIBTCL = -ltclstub86

#### C Compile and options for use in building executables that
#    will run on the target platform.  This is usually the same
#    as BCC, unless you are cross-compiling.  This C compiler builds
#    the finished binary for fossil.  The BCC compiler above is used
#    for building intermediate code-generator tools.
#
................................................................................

# With HTTPS support
ifdef FOSSIL_ENABLE_SSL
TCC += -DFOSSIL_ENABLE_SSL=1
RCC += -DFOSSIL_ENABLE_SSL=1
endif

# With Tcl support
ifdef FOSSIL_ENABLE_TCL
TCC += -DFOSSIL_ENABLE_TCL=1 -DUSE_TCL_STUBS
RCC += -DFOSSIL_ENABLE_TCL=1
endif

# With JSON support
ifdef FOSSIL_ENABLE_JSON
TCC += -DFOSSIL_ENABLE_JSON=1
RCC += -DFOSSIL_ENABLE_JSON=1