Index: .fossil-settings/ignore-glob ================================================================== --- .fossil-settings/ignore-glob +++ .fossil-settings/ignore-glob @@ -1,22 +1,28 @@ -aclocal.m4 -autom4te.cache -configure -config.guess -config.log -config.sub -install-sh +*.a +*.dll +*.dylib +*.exe +*.exp +*.lib +*.o +*.obj +*.res +*.sl +*.so Makefile +autom4te.cache +config.cache +config.log config.status +configure +manifest.uuid pkgIndex.tcl -tcltls.so -tcltls.a -tcltls.a.linkadd -tls.o -tlsBIO.o -tlsIO.o -tlsX509.o tls.tcl.h tls.tcl.h.new.1 tls.tcl.h.new.2 -build/work -dh_params.h +tlsUuid.h +win/versions.vc +win/Release* +win/Debug* +win/nmhlp-out.txt +*~ ADDED .fossil-settings/manifest Index: .fossil-settings/manifest ================================================================== --- /dev/null +++ .fossil-settings/manifest @@ -0,0 +1,1 @@ +u Index: Makefile.in ================================================================== --- Makefile.in +++ Makefile.in @@ -158,11 +158,11 @@ # compiled with. #DEFS = $(TCL_DEFS) @DEFS@ $(PKG_CFLAGS) DEFS = @DEFS@ $(PKG_CFLAGS) # Move pkgIndex.tcl to 'BINARIES' var if it is generated in the Makefile -CONFIG_CLEAN_FILES = Makefile pkgIndex.tcl generic/tls.tcl.h +CONFIG_CLEAN_FILES = Makefile pkgIndex.tcl generic/tls.tcl.h tlsUuid.h CLEANFILES = @CLEANFILES@ CPPFLAGS = @CPPFLAGS@ LIBS = @PKG_LIBS@ @LIBS@ AR = @AR@ @@ -319,10 +319,12 @@ 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.o: tlsUuid.h $(srcdir)/manifest.uuid: printf "git-" >$(srcdir)/manifest.uuid (cd $(srcdir); git rev-parse HEAD >>$(srcdir)/manifest.uuid || \ (printf "svn-r" >$(srcdir)/manifest.uuid ; \ @@ -371,12 +373,12 @@ $(srcdir)/configure.ac $(DIST_DIR)/ $(DIST_INSTALL_SCRIPT) $(srcdir)/configure $(DIST_DIR)/ # Extension files $(DIST_INSTALL_DATA) $(srcdir)/ChangeLog \ - $(srcdir)/license.terms $(srcdir)/README.txt \ - $(srcdir)/pkgIndex.tcl.in $(DIST_DIR)/ + $(srcdir)/license.terms $(srcdir)/manifest.uuid \ + $(srcdir)/README.txt $(srcdir)/pkgIndex.tcl.in $(DIST_DIR)/ # TEA files $(INSTALL_DATA_DIR) $(DIST_DIR)/tclconfig $(DIST_INSTALL_DATA) $(srcdir)/tclconfig/README.txt \ $(srcdir)/tclconfig/tcl.m4 $(srcdir)/tclconfig/install-sh \ @@ -383,11 +385,11 @@ $(srcdir)/license.terms $(DIST_DIR)/tclconfig/ $(INSTALL_DATA_DIR) $(DIST_DIR)/win $(DIST_INSTALL_DATA) \ $(srcdir)/win/README.txt $(srcdir)/win/*.vc \ - $(srcdir)/win/nmakehlp.c $(DIST_DIR)/win/ + $(srcdir)/win/nmakehlp.c $(srcdir)/win/*.in $(DIST_DIR)/win/ list='build demos doc generic library macosx tests unix'; \ for p in $$list; do \ if test -d $(srcdir)/$$p ; then \ $(INSTALL_DATA_DIR) $(DIST_DIR)/$$p; \ Index: generic/tls.c ================================================================== --- generic/tls.c +++ generic/tls.c @@ -22,10 +22,11 @@ * */ #include "tlsInt.h" #include "tclOpts.h" +#include "tlsUuid.h" #include #include #include #include @@ -2771,16 +2772,93 @@ } dprintf("Returning"); } -#if TCL_MAJOR_VERSION > 8 -#define MIN_VERSION "9.0" -#else -#define MIN_VERSION "8.5" +/* + *---------------------------------------------------------------------- + * + * Build Info Command -- + * + * Create command to return build info for package. + * + * Results: + * A standard Tcl result + * + * Side effects: + * Created build-info command. + * + *---------------------------------------------------------------------- + */ + +#ifndef STRINGIFY +# define STRINGIFY(x) STRINGIFY1(x) +# define STRINGIFY1(x) #x +#endif + +int +BuildInfoCommand(Tcl_Interp* interp) { + Tcl_CmdInfo info; + + if (Tcl_GetCommandInfo(interp, "::tcl::build-info", &info)) { + Tcl_CreateObjCommand(interp, "::tls::build-info", info.objProc, (void *)( + PACKAGE_VERSION "+" STRINGIFY(TLS_VERSION_UUID) +#if defined(__clang__) && defined(__clang_major__) + ".clang-" STRINGIFY(__clang_major__) +#if __clang_minor__ < 10 + "0" +#endif + STRINGIFY(__clang_minor__) +#endif +#if defined(__cplusplus) && !defined(__OBJC__) + ".cplusplus" +#endif +#ifndef NDEBUG + ".debug" +#endif +#if !defined(__clang__) && !defined(__INTEL_COMPILER) && defined(__GNUC__) + ".gcc-" STRINGIFY(__GNUC__) +#if __GNUC_MINOR__ < 10 + "0" +#endif + STRINGIFY(__GNUC_MINOR__) +#endif +#ifdef __INTEL_COMPILER + ".icc-" STRINGIFY(__INTEL_COMPILER) +#endif +#ifdef TCL_MEM_DEBUG + ".memdebug" +#endif +#if defined(_MSC_VER) + ".msvc-" STRINGIFY(_MSC_VER) +#endif +#ifdef USE_NMAKE + ".nmake" +#endif +#ifndef TCL_CFG_OPTIMIZED + ".no-optimize" +#endif +#ifdef __OBJC__ + ".objective-c" +#if defined(__cplusplus) + "plusplus" +#endif +#endif +#ifdef TCL_CFG_PROFILED + ".profile" +#endif +#ifdef PURIFY + ".purify" +#endif +#ifdef STATIC_BUILD + ".static" #endif - + ), NULL); + } + return TCL_OK; +} + /* *------------------------------------------------------------------- * * Tls_Init -- * @@ -2792,15 +2870,23 @@ * Side effects: * create the ssl command, initialize ssl context * *------------------------------------------------------------------- */ -DLLEXPORT int Tls_Init(Tcl_Interp *interp) { - const char tlsTclInitScript[] = { + +#if TCL_MAJOR_VERSION > 8 +#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 if (Tcl_InitStubs(interp, MIN_VERSION, 0) == NULL) { @@ -2823,10 +2909,12 @@ Tcl_CreateObjCommand(interp, "::tls::unimport", UnimportObjCmd, (ClientData) NULL, (Tcl_CmdDeleteProc *) NULL); Tcl_CreateObjCommand(interp, "::tls::status", StatusObjCmd, (ClientData) NULL, (Tcl_CmdDeleteProc *) NULL); Tcl_CreateObjCommand(interp, "::tls::version", VersionObjCmd, (ClientData) NULL, (Tcl_CmdDeleteProc *) NULL); Tcl_CreateObjCommand(interp, "::tls::misc", MiscObjCmd, (ClientData) NULL, (Tcl_CmdDeleteProc *) NULL); Tcl_CreateObjCommand(interp, "::tls::protocols", ProtocolsObjCmd, (ClientData) NULL, (Tcl_CmdDeleteProc *) NULL); + + BuildInfoCommand(interp); if (interp && Tcl_Eval(interp, tlsTclInitScript) != TCL_OK) { return TCL_ERROR; } ADDED win/gitmanifest.in Index: win/gitmanifest.in ================================================================== --- /dev/null +++ win/gitmanifest.in @@ -0,0 +1,1 @@ +git- Index: win/makefile.vc ================================================================== --- win/makefile.vc +++ win/makefile.vc @@ -34,11 +34,12 @@ # SSL_INSTALL_FOLDER = with the OpenSSL installation folder following. PRJ_INCLUDES = -I"$(SSL_INSTALL_FOLDER)\include" -I"$(OPENSSL_INSTALL_DIR)\include" # Define any additional compiler flags that might be required for the project PRJ_DEFINES = -D NO_SSL2 -D NO_SSL3 -D _CRT_SECURE_NO_WARNINGS - + +# # SSL Libs: # 1. ${LIBCRYPTO}.dll # 2. ${LIBSSL}.dll # Where LIBCRYPTO (#1.) and LIBSSL (#2.) are defined as follows: # v1.1: libcrypto-1.1-x64.dll and libssl-1.1-x64.dll @@ -56,17 +57,27 @@ # Project specific targets all: default-target clean: default-clean + @if exist $(WIN_DIR)\tlsUuid.h del $(WIN_DIR)\tlsUuid.h realclean: default-hose + @if exist $(WIN_DIR)\tlsUuid.h del $(WIN_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 + +$(ROOT)\manifest.uuid: + copy $(WIN_DIR)\gitmanifest.in $(ROOT)\manifest.uuid + git rev-parse HEAD >>$(ROOT)\manifest.uuid + +$(WIN_DIR)\tlsUuid.h: $(ROOT)\manifest.uuid + copy $(WIN_DIR)\tlsUuid.h.in+$(ROOT)\manifest.uuid $(WIN_DIR)\tlsUuid.h + # The default install target only installs binaries and scripts so add # an additional target for our documentation. Note this *adds* a target # since no commands are listed after it. The original targets for # install (from targets.vc) will remain. @@ -76,7 +87,10 @@ ) 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: $(WIN_DIR)\tlsUuid.h + # Test package test: default-test ADDED win/svnmanifest.in Index: win/svnmanifest.in ================================================================== --- /dev/null +++ win/svnmanifest.in @@ -0,0 +1,1 @@ +svn-r ADDED win/tlsUuid.h.in Index: win/tlsUuid.h.in ================================================================== --- /dev/null +++ win/tlsUuid.h.in @@ -0,0 +1,1 @@ +#define TLS_VERSION_UUID \