interplane.Get Omega
Read in your language

sqlite

[Ported from github.com/sqlite/sqlite] Fix bugs in and improve the interface to the ".check" command of the CLI.

Brought by drakestapleton

branch master Branches Tags History

sqlite / tool / mkwinarm64ec.tcl

45 lines · 1489 bytes Raw Blame History
1# Script to build ARM64-EC binaries on Windows.
2#
3# Run from the top-level of a check-out, on a Windows11 ARM machine that
4# has Fossil installed, using a command like this:
5#
6# tclsh tool/mmkwinarm64ec.tcl
7#
8# Output will be a file named:
9#
10# sqlite-win-arm64ec-3MMPP00.zip
11#
12# Where MM is the minor version number and PP is that patch level.
13#
14puts "Running nmake..."
15flush stdout
16exec nmake /f Makefile.msc "PLATFORM=ARM64EC" "BCC=cl -nologo -arm64EC" "TCC=cl -nologo -arm64EC -I." "CFLAGS=-nologo -arm64EC -I." clean sqlite3.exe sqldiff.exe sqlite3_rsync.exe sqlite3.dll >@ stdout 2>@ stderr
17
18proc check-type {file} {
19 set in [open "| link /dump /headers $file" rb]
20 set txt [read $in]
21 close $in
22 if {![string match {*8664 machine (x64) (ARM64X)*} $txt]} {
23 puts "$file is not an ARM64-EC binary"
24 puts "OUTPUT:\n$txt"
25 flush stdout
26 exit 1
27 }
28 puts "Confirmed: $file is an ARM64-EC binary"
29}
30check-type sqlite3.exe
31check-type sqldiff.exe
32check-type sqlite3_rsync.exe
33check-type sqlite3.dll
34
35set in [open VERSION rb]
36set VERSION [read $in]
37close $in
38regexp {3.(\d+).(\d+)} $VERSION all minor patch
39set filename [format sqlite-win-arm64ec-3%02d%02d00.zip $minor $patch]
40
41puts "Constructing $filename..."
42file delete -force $filename
43exec fossil test-filezip $filename sqlite3.def sqlite3.dll sqlite3.exe sqldiff.exe sqlite3_rsync.exe >@ stdout 2>@ stderr
44puts "$filename: [file size $filename] bytes"
45exec fossil test-filezip -l $filename >@ stdout 2>@ stderr