From d06aea28315d9d66f2409f13b564e9aeb3f005a1 Mon Sep 17 00:00:00 2001 From: Cory McWilliams Date: Wed, 5 Jul 2023 01:06:59 +0000 Subject: [PATCH] Expose versions of dependencies. git-svn-id: https://www.unprompted.com/svn/projects/tildefriends/trunk@4337 ed5197a5-7fde-0310-b194-c3ffbd925b24 --- Makefile | 4 +++- src/task.c | 13 +++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 5b892947..e893d6a6 100644 --- a/Makefile +++ b/Makefile @@ -247,7 +247,8 @@ SODIUM_SOURCES := \ deps/libsodium/src/libsodium/sodium/core.c \ deps/libsodium/src/libsodium/sodium/codecs.c \ deps/libsodium/src/libsodium/sodium/runtime.c \ - deps/libsodium/src/libsodium/sodium/utils.c + deps/libsodium/src/libsodium/sodium/utils.c \ + deps/libsodium/src/libsodium/sodium/version.c SODIUM_OBJS := $(call get_objs,SODIUM_SOURCES) $(SODIUM_OBJS): CFLAGS += \ -DCONFIGURED=1 \ @@ -256,6 +257,7 @@ $(SODIUM_OBJS): CFLAGS += \ -Wno-unused-variable \ -Wno-type-limits \ -Wno-unknown-pragmas \ + -Ideps/libsodium/builds/msvc \ -Ideps/libsodium/src/libsodium/include/sodium SQLITE_SOURCES := deps/sqlite/sqlite3.c diff --git a/src/task.c b/src/task.c index 0f3b6cb3..4c036378 100644 --- a/src/task.c +++ b/src/task.c @@ -21,6 +21,9 @@ #include "sqlite3.h" #include "unzip.h" #include "uv.h" +#include "zlib.h" + +#include #ifndef _WIN32 #include @@ -677,6 +680,16 @@ static JSValue _tf_task_version(JSContext* context, JSValueConst this_val, int a JSValue version = JS_NewObject(context); JS_SetPropertyStr(context, version, "number", JS_NewString(context, VERSION_NUMBER)); JS_SetPropertyStr(context, version, "name", JS_NewString(context, VERSION_NAME)); + JS_SetPropertyStr(context, version, "libuv", JS_NewString(context, uv_version_string())); + JS_SetPropertyStr(context, version, "sqlite", JS_NewString(context, sqlite3_libversion())); +#if defined(OPENSSL_VERSION_STRING) + JS_SetPropertyStr(context, version, "openssl", JS_NewString(context, OpenSSL_version(OPENSSL_VERSION_STRING))); +#else + JS_SetPropertyStr(context, version, "openssl", JS_NewString(context, OpenSSL_version(OPENSSL_VERSION))); +#endif + const char* sodium_version_string(); + JS_SetPropertyStr(context, version, "libsodium", JS_NewString(context, sodium_version_string())); + JS_SetPropertyStr(context, version, "zlib", JS_NewString(context, zlibVersion())); tf_trace_end(task->_trace); return version; }