Browse Source
vqtcl was an old-tclkit experiment with no confirmed public upstream - wiring, helper module, staging and docs removed (future tclkit work: TEMP_REFERENCE/ metakit + KitCreator). New 'test' action runs tests/all.tcl on the suite-built static shell with -testargs passthrough; verified assocd/util/lindex: 557 run, 357 passed, 200 constraint-skipped (no C test commands in a release shell), 0 failed. install-libraries tm filenames synced to the tree's provided versions (tcltest-2.5.11, http-2.10.2, platform-1.1.1) - the 2024-era names made 'package require tcltest' fail on a filename/provide version conflict. Assisted-by: harness=claude; primary-model=claude-fable-5; api-location=anthropic.commaster
5 changed files with 44 additions and 121 deletions
@ -1,80 +0,0 @@ |
|||||||
const std = @import("std"); |
|
||||||
const fs = std.fs; |
|
||||||
|
|
||||||
const vqtcl_dotversion = "4.1"; |
|
||||||
const vqtcl_nodotversion = "41"; |
|
||||||
|
|
||||||
pub fn vfsadd_vqtcl_files(comptime tcldir: []const u8, comptime subdir: []const u8, b: *std.Build, vfswrite: *std.Build.Step.WriteFile) !*std.Build.Step.WriteFile { |
|
||||||
//_ = tcldir; |
|
||||||
//recursive copy |
|
||||||
//_ = make_vfs_root.addCopyDirectory(b.path(tcl_source_folder ++ "/../tclvfs/library"), "base/lib/vfs1.4.2", .{}); |
|
||||||
_ = vfswrite.addCopyDirectory(b.path(tcldir ++ "/" ++ subdir ++ "/library"), b.pathJoin(&.{ "base", "lib", "vqtcl" ++ vqtcl_dotversion }), .{}); |
|
||||||
|
|
||||||
return vfswrite; |
|
||||||
} |
|
||||||
pub fn build_vqtcl(comptime tcldir: []const u8, comptime subdir: []const u8, b: *std.Build, target: std.Build.ResolvedTarget, optimize: std.builtin.OptimizeMode, stublib: *std.Build.Step.Compile) !*std.Build.Step.Compile { |
|
||||||
const lib = b.addSharedLibrary(.{ |
|
||||||
.name = "tcl9vlerq" ++ vqtcl_nodotversion, |
|
||||||
.target = target, |
|
||||||
.optimize = optimize, |
|
||||||
}); |
|
||||||
//_ = stublib; |
|
||||||
var flags = std.ArrayList([]const u8).init(b.allocator); |
|
||||||
defer flags.deinit(); |
|
||||||
//try flags.appendSlice(&.{ "-Wall", "-O3" }); |
|
||||||
//try flags.appendSlice(&.{ "-Wall", "-O2", "-fomit-frame-pointer" }); |
|
||||||
try flags.appendSlice(&.{ "-O3", "-fomit-frame-pointer" }); |
|
||||||
try flags.appendSlice(&.{ |
|
||||||
"-DPACKAGE_NAME=\"vfs\"", |
|
||||||
"-DPACKAGE_TARNAME=\"vfs\"", |
|
||||||
"-DPACKAGE_VERSION=\"" ++ vqtcl_dotversion ++ "\"", |
|
||||||
"-DPACKAGE_STRING=\"vfs " ++ vqtcl_dotversion ++ "\"", |
|
||||||
"-DPACKAGE_BUGREPORT=\"\"", |
|
||||||
"-DPACKAGE_URL=\"\"", |
|
||||||
"-DTCL_CFG_OPTIMIZED=1", |
|
||||||
"-DUSE_TCL_STUBS=1", |
|
||||||
"-DZIPFS_BUILD=1", |
|
||||||
"-DTCL_WIDE_INT_TYPE=long long", |
|
||||||
}); |
|
||||||
// "-DTCL_MEM_DEBUG=1", //define for all or none of modules that are linked together |
|
||||||
|
|
||||||
// "-DTCL_MAJOR_VERSION=9", |
|
||||||
//"-static-libgcc", //argument unused - review |
|
||||||
|
|
||||||
var sources = std.ArrayList([]const u8).init(b.allocator); |
|
||||||
try sources.append(subdir ++ "/generic/vlerq.c"); |
|
||||||
lib.addIncludePath(b.path(subdir)); |
|
||||||
lib.addIncludePath(b.path(subdir ++ "/generic")); |
|
||||||
lib.addIncludePath(b.path(subdir ++ "/win")); //header for MSVC only - possibly not needed here - unless zig build can use it? |
|
||||||
lib.addIncludePath(b.path(tcldir ++ "/generic")); |
|
||||||
lib.addIncludePath(b.path(tcldir ++ "/generic")); |
|
||||||
if (target.result.os.tag == .windows) { |
|
||||||
lib.addIncludePath(b.path(tcldir ++ "/win")); |
|
||||||
} else { |
|
||||||
lib.addIncludePath(b.path(tcldir ++ "/unix")); |
|
||||||
} |
|
||||||
lib.addCSourceFiles(.{ |
|
||||||
.files = sources.items, |
|
||||||
.flags = flags.items, |
|
||||||
}); |
|
||||||
|
|
||||||
lib.linkLibrary(stublib); |
|
||||||
lib.linkLibC(); |
|
||||||
|
|
||||||
// no resource file - todo - make one? |
|
||||||
//lib.addWin32ResourceFile(.{ |
|
||||||
// .file = b.path(subdir ++ "/win/tclvfs.rc"), |
|
||||||
// .flags = &.{ |
|
||||||
// "-DPACKAGE_MAJOR=1", |
|
||||||
// "-DPACKAGE_MINOR=4", |
|
||||||
// "-DPACKAGE_VERSION=" ++ vqtcl_dotversion, |
|
||||||
// "-DDOTVERSION=" ++ vqtcl_dotversion, |
|
||||||
// "-DCOMMAVERSION=" ++ vqtcl_dotversion, |
|
||||||
// "-DVERSION=" ++ vqtcl_nodotversion, |
|
||||||
// }, |
|
||||||
//}); //ignored for non-windows targets |
|
||||||
// COMMAVERSION??? VERSION??? |
|
||||||
|
|
||||||
b.installArtifact(lib); |
|
||||||
return lib; //static library |
|
||||||
} |
|
||||||
Loading…
Reference in new issue