Index: Makefile.in ================================================================== --- Makefile.in +++ Makefile.in @@ -322,15 +322,12 @@ VPATH = $(srcdir):$(srcdir)/generic:$(srcdir)/unix:$(srcdir)/win:$(srcdir)/macosx # Create a C-source-ified version of the script resources # for TclTLS so that we only need a single file to enable # this extension -tls.tcl.h: @srcdir@/library/tls.tcl Makefile - od -A n -v -t xC < '@srcdir@/library/tls.tcl' > tls.tcl.h.new.1 - sed 's@[^0-9A-Fa-f]@@g;s@..@0x&, @g' < tls.tcl.h.new.1 > tls.tcl.h.new.2 - rm -f tls.tcl.h.new.1 - mv tls.tcl.h.new.2 @srcdir@/generic/tls.tcl.h +tls.tcl.h: $(srcdir)/library/tls.tcl + sed -e '/^\\s*\#/d' -e '/^\\s*$$/d' -e 's/\\/\\\\/g' -e 's/\"/\\"/g' -e 's/^/"/' -e 's/$$/\\n\"/' < `@CYGPATH@ $<` > $@ || { rm -f $@; exit 1; } $(srcdir)/manifest.uuid: printf "git-" >$(srcdir)/manifest.uuid (cd $(srcdir); git rev-parse HEAD >>$(srcdir)/manifest.uuid || \ (printf "svn-r" >$(srcdir)/manifest.uuid ; \ Index: generic/tls.c ================================================================== --- generic/tls.c +++ generic/tls.c @@ -2892,10 +2892,15 @@ ), NULL); } return TCL_OK; } +/* Init script */ +static const char tlsTclInitScript[] = { +#include "tls.tcl.h" +}; + /* *------------------------------------------------------------------- * * Tls_Init -- * @@ -2914,15 +2919,10 @@ #define MIN_VERSION "9.0" #else #define MIN_VERSION "8.5" #endif -static const char tlsTclInitScript[] = { -#include "tls.tcl.h" - 0x00 - }; - DLLEXPORT int Tls_Init(Tcl_Interp *interp) { dprintf("Called"); #ifdef USE_TCL_STUBS Index: generic/tlsInt.h ================================================================== --- generic/tlsInt.h +++ generic/tlsInt.h @@ -49,21 +49,23 @@ /* * Backwards compatibility for size type change */ #if TCL_MAJOR_VERSION < 9 && TCL_MINOR_VERSION < 7 - #include - #define TCL_SIZE_MAX INT_MAX - - #ifndef Tcl_Size - typedef int Tcl_Size; - #endif - - #define TCL_SIZE_MODIFIER "" - #define Tcl_GetSizeIntFromObj Tcl_GetIntFromObj - #define Tcl_NewSizeIntObj Tcl_NewIntObj - #define Tcl_NewSizeIntFromObj Tcl_NewWideIntObj +#include +#ifndef TCL_SIZE_MAX +#define TCL_SIZE_MAX INT_MAX +#endif + +#ifndef Tcl_Size + typedef int Tcl_Size; +#endif + +#define TCL_SIZE_MODIFIER "" +#define Tcl_GetSizeIntFromObj Tcl_GetIntFromObj +#define Tcl_NewSizeIntObj Tcl_NewIntObj +#define Tcl_NewSizeIntFromObj Tcl_NewWideIntObj #endif /* Define missing POSIX error codes */ #ifndef ECONNABORTED #define ECONNABORTED 130 /* Software caused connection abort */ ADDED manifest.uuid Index: manifest.uuid ================================================================== --- /dev/null +++ manifest.uuid @@ -0,0 +1,1 @@ +git- Index: win/README.txt ================================================================== --- win/README.txt +++ win/README.txt @@ -67,18 +67,11 @@ set INSTALLDIR=%TCLINSTALL%\lib set SSLINSTALL=\path\to\openssl\dir 2a) Unzip distribution to %BUILDDIR% -2b) Start BASH shell (MinGW62 Git shell) - - cd %BUILDDIR% - od -A n -v -t xC < 'library/tls.tcl' > tls.tcl.h.new.1 - sed 's@[^0-9A-Fa-f]@@g;s@..@0x&, @g' < tls.tcl.h.new.1 > generic/tls.tcl.h - rm -f tls.tcl.h.new.1 - -2c) Start Visual Studio shell +2b) Start Visual Studio shell At Visual Studio x64 native prompt: cd %BUILDDIR%\win Index: win/makefile.vc ================================================================== --- win/makefile.vc +++ win/makefile.vc @@ -66,14 +66,28 @@ clean: default-clean realclean: default-hose +# Explicit dependency rules +$(PRJ_OBJS): $(TMP_DIR)\tls.tcl.h $(TMP_DIR)\tlsUuid.h + # We must define a pkgindex target that will create a pkgIndex.tcl # file in the $(OUT_DIR) directory. We can just redirect to the # default-pkgindex target for our sample extension. pkgindex: default-pkgindex-tea + +$(TMP_DIR)\tls.tcl.h: $(LIBDIR)\tls.tcl + "$(TCLSH)" << $(LIBDIR)\tls.tcl >$(TMP_DIR)\tls.tcl.h + set in [open [lindex $$argv 0] r] + while {[gets $$in line] != -1} { + switch -regexp -- $$line "^$$" - {^\s*#} continue + regsub -all {\\} $$line {\\\\} line + regsub -all {"} $$line {\"} line + puts "\"$$line\\n\"" + } +<< # Manifest which defines fossil/git commit id for build-info command $(ROOT)\manifest.uuid: if not exist $(ROOT)\manifest.uuid ( copy $(WIN_DIR)\gitmanifest.in $(ROOT)\manifest.uuid @@ -100,10 +114,7 @@ ) if exist "$(SSL_INSTALL_FOLDER)\bin\libssl-*-x64.dll" ( xcopy /c /y "$(SSL_INSTALL_FOLDER)\bin\libssl-*-x64.dll" "$(PRJ_INSTALL_DIR)" ) -# Explicit dependency rules -$(GENERICDIR)\tls.c: $(TMP_DIR)\tlsUuid.h - # Test package test: default-test