1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-08 14:02:16 +03:00

Merge all the latest trunk enhancements into the bedrock branch.

FossilOrigin-Name: 1cef92de5059e468e0b1282425f50b089629c4f74671763bcefcb835798a9124
This commit is contained in:
drh
2025-02-03 15:11:11 +00:00
99 changed files with 4199 additions and 2608 deletions

View File

@@ -289,7 +289,7 @@ if {$build} {
# Tcl package index file, version ???
#
package ifneeded sqlite3 $VERSION \\
[list load [file join \$dir $OUT] sqlite3]
[list load [file join \$dir $OUT] Sqlite3]
}]
close $fd

View File

@@ -63,4 +63,4 @@ if [ x = "x${emcc}" ]; then
fi
fi
exec emcc "$@"
exec $emcc "$@"

View File

@@ -13,7 +13,7 @@
#
# Bail out of the script if any command returns a non-zero exit
# Bail out of the script if any command returns a non-zero exit
# status. Or if the script tries to use an unset variable. These
# may fail for old /bin/sh interpreters.
#
@@ -22,8 +22,8 @@ set -u
TMPSPACE=./mkpkg_tmp_dir
VERSION=`cat $TOP/VERSION`
HASH=`sed 's/^\(..........\).*/\1/' $TOP/manifest.uuid`
DATETIME=`grep '^D' $TOP/manifest | sed -e 's/[^0-9]//g' -e 's/\(............\).*/\1/'`
HASH=`cut -c1-10 $TOP/manifest.uuid`
DATETIME=`grep '^D' $TOP/manifest | tr -c -d '[0-9]' | cut -c1-12`
# Verify that the version number in the TEA autoconf file is correct.
# Fail with an error if not.
@@ -34,12 +34,12 @@ else echo "TEA version number mismatch. Should be $VERSION"; exit 1
fi
# If this script is given an argument of --snapshot, then generate a
# snapshot tarball named for the current checkout SHA1 hash, rather than
# snapshot tarball named for the current checkout SHA hash, rather than
# the version number.
#
if test "$#" -ge 1 -a x$1 != x--snapshot
then
# Set global variable $ARTIFACT to the "3xxyyzz" string incorporated
# Set global variable $ARTIFACT to the "3xxyyzz" string incorporated
# into artifact filenames. And $VERSION2 to the "3.x.y[.z]" form.
xx=`echo $VERSION|sed 's/3\.\([0-9]*\)\..*/\1/'`
yy=`echo $VERSION|sed 's/3\.[^.]*\.\([0-9]*\).*/\1/'`
@@ -54,6 +54,8 @@ fi
rm -rf $TMPSPACE
cp -R $TOP/autoconf $TMPSPACE
cp -R $TOP/autosetup $TMPSPACE
cp -p $TOP/configure $TMPSPACE
cp sqlite3.c $TMPSPACE
cp sqlite3.h $TMPSPACE
cp sqlite3ext.h $TMPSPACE
@@ -63,28 +65,33 @@ cp $TOP/sqlite3.pc.in $TMPSPACE
cp shell.c $TMPSPACE
cp $TOP/src/sqlite3.rc $TMPSPACE
cp $TOP/tool/Replace.cs $TMPSPACE
cat $TMPSPACE/configure.ac |
sed "s/--SQLITE-VERSION--/$VERSION/" > $TMPSPACE/tmp
mv $TMPSPACE/tmp $TMPSPACE/configure.ac
cp $TOP/VERSION $TMPSPACE
cp $TOP/main.mk $TMPSPACE
cd $TMPSPACE
autoreconf -i
#libtoolize
#aclocal
#autoconf
#automake --add-missing
# Clean up emacs-generated backup files from the target
rm -f ./autosetup/*~
rm -f ./*~
#if true; then
# Clean up *~ files (emacs-generated backups).
# This bit is only for use during development of
# the autoconf bundle.
# find . -name '*~' -exec rm \{} \;
#fi
mkdir -p tea/generic
echo "#ifdef USE_SYSTEM_SQLITE" > tea/generic/tclsqlite3.c
echo "# include <sqlite3.h>" >> tea/generic/tclsqlite3.c
echo "#else" >> tea/generic/tclsqlite3.c
echo "#include \"sqlite3.c\"" >> tea/generic/tclsqlite3.c
echo "#endif" >> tea/generic/tclsqlite3.c
cat <<EOF > tea/generic/tclsqlite3.c
#ifdef USE_SYSTEM_SQLITE
# include <sqlite3.h>
#else
# include "sqlite3.c"
#endif
EOF
cat $TOP/src/tclsqlite.c >> tea/generic/tclsqlite3.c
cat tea/configure.ac |
sed "s/AC_INIT(\[sqlite\], .*)/AC_INIT([sqlite], [$VERSION])/" > tmp
sed "s/AC_INIT(\[sqlite\], .*)/AC_INIT([sqlite], [$VERSION])/" tea/configure.ac > tmp
mv tmp tea/configure.ac
cd tea
@@ -93,9 +100,9 @@ rm -rf autom4te.cache
cd ../
./configure && make dist
tar -xzf sqlite-$VERSION.tar.gz
tar xzf sqlite-$VERSION.tar.gz
mv sqlite-$VERSION $TARBALLNAME
tar -czf $TARBALLNAME.tar.gz $TARBALLNAME
tar czf $TARBALLNAME.tar.gz $TARBALLNAME
mv $TARBALLNAME.tar.gz ..
cd ..
ls -l $TARBALLNAME.tar.gz

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 */"

View File

@@ -111,7 +111,24 @@ void do_it_all(void){
}
else if(slash == ch){
/* MARKER(("state 0 ==> 1 @ %d:%d\n", line, col)); */
state = S_SLASH1;
if( '\\'==prev ){
/**
JS regexes may contain slash-asterisks, as happened at:
https://github.com/emscripten-core/emscripten/issues/23412
Such regexes will always necessarily be preceeded by a
backslash, though.
It is hypothetically possible for a legitimate comment
slash-asterisk to appear immediately before a
backslash, but that seems like an even rarer corner
case than the JS regex case.
*/
fputc(ch, out);
}else{
state = S_SLASH1;
}
break;
}
fputc(ch, out);