1
0
mirror of https://github.com/sqlite/sqlite.git synced 2026-01-06 08:01:16 +03:00

Adjust the build process to avoid extra CR characters inserted by jimsh

on Windows.

FossilOrigin-Name: 1f54853932cec9ba20e9be48a59f1817b8b45e4c4d6ef8a06d34f86dd688e28e
This commit is contained in:
drh
2025-02-03 13:20:11 +00:00
parent 4170780a82
commit 3cf467a3ec
7 changed files with 45 additions and 23 deletions

View File

@@ -12,6 +12,9 @@
set topdir [file dir [file dir [file normal $argv0]]]
set out stdout
fconfigure stdout -translation binary
if {[lindex $argv 0]!=""} {
set out [open [lindex $argv 0] wb]
}
puts $out {/* DO NOT EDIT!
** This file is automatically generated by the script in the canonical
** SQLite source tree at tool/mkshellc.tcl. That script combines source

View File

@@ -130,7 +130,7 @@ if {[file executable $vsrcprog] && [file readable $srcroot/manifest]} {
} else {
puts $out " with changes in files:\n**"
foreach f [lrange $res 1 end] {
puts $out "** $f"
puts $out "** [string trim $f]"
}
}
} else {

View File

@@ -24,18 +24,36 @@
# 6) Adds the SQLITE_CALLBACK calling convention macro in front of all
# callback declarations.
#
# This script outputs to stdout.
# This script outputs to stdout unless the -o FILENAME option is used.
#
# Example usage:
#
# tclsh mksqlite3h.tcl ../sqlite >sqlite3.h
# tclsh mksqlite3h.tcl ../sqlite [OPTIONS]
# ^^^^^^^^^
# Root of source tree
#
# Where options are:
#
# --enable-recover Include the sqlite3recover extension
# -o FILENAME Write results to FILENAME instead of stdout
# --useapicall SQLITE_APICALL instead of SQLITE_CDECL
#
# Default output stream
set out stdout
# Get the source tree root directory from the command-line
#
set TOP [lindex $argv 0]
# If the -o FILENAME option is present, use FILENAME for output.
#
set x [lsearch $argv -o]
if {$x>0} {
incr x
set out [open [lindex $argv $x] wb]
}
# Enable use of SQLITE_APICALL macros at the right points?
#
set useapicall 0
@@ -44,6 +62,7 @@ set useapicall 0
#
set enable_recover 0
# Process command-line arguments
if {[lsearch -regexp [lrange $argv 1 end] {^-+useapicall}] != -1} {
set useapicall 1
}
@@ -118,7 +137,7 @@ set cdecllist {
foreach file $filelist {
set in [open $file rb]
if {![regexp {sqlite\.h\.in} $file]} {
puts "/******** Begin file [file tail $file] *********/"
puts $out "/******** Begin file [file tail $file] *********/"
}
while {![eof $in]} {
@@ -161,11 +180,11 @@ foreach file $filelist {
"(SQLITE_SYSAPI *sqlite3_syscall_ptr)"] $line]
regsub {\(\*} $line {(SQLITE_CALLBACK *} line
}
puts $line
puts $out $line
}
close $in
if {![regexp {sqlite\.h\.in} $file]} {
puts "/******** End of [file tail $file] *********/"
puts $out "/******** End of [file tail $file] *********/"
}
}
puts "#endif /* SQLITE3_H */"
puts $out "#endif /* SQLITE3_H */"