Index: Makefile.in ================================================================== --- Makefile.in +++ Makefile.in @@ -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 ; \ Index: generic/tls.c ================================================================== --- generic/tls.c +++ generic/tls.c @@ -24,10 +24,11 @@ #include "tlsInt.h" #include "tclOpts.h" #include #include +#include "tlsUuid.h" #include #include /* Min OpenSSL version */ #if OPENSSL_VERSION_NUMBER < 0x10101000L @@ -2806,18 +2807,25 @@ * Side effects: * create the ssl command, initialize ssl context * *------------------------------------------------------------------- */ + +#ifndef STRINGIFY +# define STRINGIFY(x) STRINGIFY1(x) +# define STRINGIFY1(x) #x +#endif + +static const char tlsTclInitScript[] = { +#include "tls.tcl.h" + 0x00 +}; DLLEXPORT int Tls_Init( Tcl_Interp *interp) { - const char tlsTclInitScript[] = { -#include "tls.tcl.h" - 0x00 - }; + Tcl_CmdInfo info; dprintf("Called"); if (Tcl_InitStubs(interp, "8.6-", 0) == NULL) { return TCL_ERROR; @@ -2837,14 +2845,74 @@ Tcl_CreateObjCommand(interp, "tls::version", VersionObjCmd, NULL, 0); Tcl_CreateObjCommand(interp, "tls::misc", MiscObjCmd, NULL, 0); Tcl_CreateObjCommand(interp, "tls::protocols", ProtocolsObjCmd, NULL, 0); if (interp) { - Tcl_Eval(interp, tlsTclInitScript); + if (Tcl_Eval(interp, tlsTclInitScript) != TCL_OK) { + return TCL_ERROR; + } + } + + if (Tcl_GetCommandInfo(interp, "::tcl::build-info", &info)) { + Tcl_CreateObjCommand(interp, "::tls::build-info", + info.objProc, (void *)( + PACKAGE_VERSION "+" STRINGIFY(TLS_VERSION_UUID) + ".bohagan" +#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_PkgProvide(interp, PACKAGE_NAME, PACKAGE_VERSION); + return Tcl_PkgProvideEx(interp, PACKAGE_NAME, PACKAGE_VERSION, NULL); } /* *------------------------------------------------------* * Index: win/makefile.vc ================================================================== --- win/makefile.vc +++ win/makefile.vc @@ -49,22 +49,33 @@ "$(SSL_INSTALL_FOLDER)\lib\libssl.lib" \ "$(SSL_INSTALL_FOLDER)\lib\libcrypto.lib" \ WS2_32.LIB GDI32.LIB ADVAPI32.LIB CRYPT32.LIB USER32.LIB # Define the standard targets -!include "targets.vc" +!include "$(_RULESDIR)\targets.vc" # Project specific targets # 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 + +$(ROOT)\manifest.uuid: + copy $(WIN_DIR)\gitmanifest.in $(ROOT)\manifest.uuid + git rev-parse HEAD >>$(ROOT)\manifest.uuid + +$(TMP_DIR)\tlsUuid.h: $(ROOT)\manifest.uuid + copy $(WIN_DIR)\tlsUuid.h.in+$(ROOT)\manifest.uuid $(TMP_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. install: default-pkgindex-tea default-install default-install-docs-html +# Explicit dependency rules +$(GENERICDIR)\tls.c : $(GENERICDIR)\dh_params.h $(TMP_DIR)\tlsUuid.h + # Test package test: default-test ADDED win/tlsUuid.h.in Index: win/tlsUuid.h.in ================================================================== --- /dev/null +++ win/tlsUuid.h.in @@ -0,0 +1,1 @@ +#define TLS_VERSION_UUID \