summaryrefslogtreecommitdiff
path: root/vendor/modernc.org/sqlite/generator.go
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/modernc.org/sqlite/generator.go')
-rw-r--r--vendor/modernc.org/sqlite/generator.go46
1 files changed, 34 insertions, 12 deletions
diff --git a/vendor/modernc.org/sqlite/generator.go b/vendor/modernc.org/sqlite/generator.go
index a00df7805..e6a72b5f6 100644
--- a/vendor/modernc.org/sqlite/generator.go
+++ b/vendor/modernc.org/sqlite/generator.go
@@ -168,6 +168,7 @@ var (
"-DSQLITE_ENABLE_UNLOCK_NOTIFY", // Adds sqlite3_unlock_notify().
"-DSQLITE_LIKE_DOESNT_MATCH_BLOBS",
"-DSQLITE_MUTEX_APPDEF=1",
+ "-DSQLITE_MUTEX_NOOP",
"-DSQLITE_SOUNDEX",
"-DSQLITE_THREADSAFE=1",
//DONT "-DNDEBUG", // To enable GO_GENERATE=-DSQLITE_DEBUG
@@ -221,6 +222,7 @@ var (
"-DSQLITE_HAVE_ZLIB=1", // testfixture
"-DSQLITE_LIKE_DOESNT_MATCH_BLOBS",
"-DSQLITE_MUTEX_APPDEF=1",
+ "-DSQLITE_MUTEX_NOOP",
"-DSQLITE_SOUNDEX",
"-DSQLITE_TEMP_STORE=1", // testfixture
"-DSQLITE_TEST",
@@ -252,12 +254,12 @@ var (
sz int
dev bool
}{
- {sqliteDir, "https://www.sqlite.org/2021/sqlite-amalgamation-3360000.zip", 2457, false},
- {sqliteSrcDir, "https://www.sqlite.org/2021/sqlite-src-3360000.zip", 12814, false},
+ {sqliteDir, "https://www.sqlite.org/2021/sqlite-amalgamation-3370000.zip", 2457, false},
+ {sqliteSrcDir, "https://www.sqlite.org/2021/sqlite-src-3370000.zip", 12814, false},
}
- sqliteDir = filepath.FromSlash("testdata/sqlite-amalgamation-3360000")
- sqliteSrcDir = filepath.FromSlash("testdata/sqlite-src-3360000")
+ sqliteDir = filepath.FromSlash("testdata/sqlite-amalgamation-3370000")
+ sqliteSrcDir = filepath.FromSlash("testdata/sqlite-src-3370000")
)
func download() {
@@ -394,16 +396,27 @@ func main() {
}
more = append(more, ndebug...)
download()
- switch fmt.Sprintf("%s/%s", goos, goarch) {
- case "linux/amd64":
- // experimental pthreads support currently only on linux/amd64
- default:
- configProduction = append(configProduction, "-DSQLITE_MUTEX_NOOP")
- configTest = append(configTest, "-DSQLITE_MUTEX_NOOP")
- }
switch goos {
- case "linux", "freebsd", "netbsd":
+ case "linux", "freebsd":
configProduction = append(configProduction, "-DSQLITE_OS_UNIX=1")
+ case "netbsd":
+ configProduction = append(configProduction, []string{
+ "-DSQLITE_OS_UNIX=1",
+ "-D__libc_cond_broadcast=pthread_cond_broadcast",
+ "-D__libc_cond_destroy=pthread_cond_destroy",
+ "-D__libc_cond_init=pthread_cond_init",
+ "-D__libc_cond_signal=pthread_cond_signal",
+ "-D__libc_cond_wait=pthread_cond_wait",
+ "-D__libc_mutex_destroy=pthread_mutex_destroy",
+ "-D__libc_mutex_init=pthread_mutex_init",
+ "-D__libc_mutex_lock=pthread_mutex_lock",
+ "-D__libc_mutex_trylock=pthread_mutex_trylock",
+ "-D__libc_mutex_unlock=pthread_mutex_unlock",
+ "-D__libc_mutexattr_destroy=pthread_mutexattr_destroy",
+ "-D__libc_mutexattr_init=pthread_mutexattr_init",
+ "-D__libc_mutexattr_settype=pthread_mutexattr_settype",
+ "-D__libc_thr_yield=sched_yield",
+ }...)
case "darwin":
configProduction = append(configProduction,
"-DSQLITE_OS_UNIX=1",
@@ -524,6 +537,7 @@ func makeTestfixture(goos, goarch string, more []string) {
"ext/misc/wholenumber.c",
"ext/misc/zipfile.c",
"ext/rbu/test_rbu.c",
+ "ext/rtree/test_rtreedoc.c",
"ext/session/test_session.c",
"ext/userauth/userauth.c",
"src/tclsqlite.c",
@@ -600,6 +614,9 @@ func makeTestfixture(goos, goarch string, more []string) {
"-D__libc_mutex_lock=pthread_mutex_lock",
"-D__libc_mutex_trylock=pthread_mutex_trylock",
"-D__libc_mutex_unlock=pthread_mutex_unlock",
+ "-D__libc_mutexattr_destroy=pthread_mutexattr_destroy",
+ "-D__libc_mutexattr_init=pthread_mutexattr_init",
+ "-D__libc_mutexattr_settype=pthread_mutexattr_settype",
"-D__libc_thr_yield=sched_yield",
}
}
@@ -618,6 +635,7 @@ func makeTestfixture(goos, goarch string, more []string) {
[]string{
"-export-defines", "",
"-export-fields", "F",
+ "-ignore-unsupported-alignment",
"-trace-translation-units",
volatiles,
"-lmodernc.org/sqlite/libtest",
@@ -650,6 +668,7 @@ func makeSpeedTest(goos, goarch string, more []string) {
[]string{
"ccgo",
"-export-defines", "",
+ "-ignore-unsupported-alignment",
"-o", filepath.FromSlash(fmt.Sprintf("speedtest1/main_%s_%s.go", goos, goarch)),
"-trace-translation-units",
filepath.Join(sqliteSrcDir, "test", "speedtest1.c"),
@@ -673,6 +692,7 @@ func makeMpTest(goos, goarch string, more []string) {
[]string{
"ccgo",
"-export-defines", "",
+ "-ignore-unsupported-alignment",
"-o", filepath.FromSlash(fmt.Sprintf("internal/mptest/main_%s_%s.go", goos, goarch)),
"-trace-translation-units",
filepath.Join(sqliteSrcDir, "mptest", "mptest.c"),
@@ -701,6 +721,7 @@ func makeSqliteProduction(goos, goarch string, more []string) {
"-export-externs", "X",
"-export-fields", "F",
"-export-typedefs", "",
+ "-ignore-unsupported-alignment",
"-pkgname", "sqlite3",
"-o", filepath.FromSlash(fmt.Sprintf("lib/sqlite_%s_%s.go", goos, goarch)),
"-trace-translation-units",
@@ -728,6 +749,7 @@ func makeSqliteTest(goos, goarch string, more []string) {
"-export-externs", "X",
"-export-fields", "F",
"-export-typedefs", "",
+ "-ignore-unsupported-alignment",
"-pkgname", "sqlite3",
"-o", filepath.FromSlash(fmt.Sprintf("libtest/sqlite_%s_%s.go", goos, goarch)),
"-trace-translation-units",