diff options
-rw-r--r-- | Makefile.in | 9 | ||||
-rwxr-xr-x | configure | 95 | ||||
-rw-r--r-- | configure.ac | 120 | ||||
-rw-r--r-- | manifest | 23 | ||||
-rw-r--r-- | manifest.uuid | 2 | ||||
-rw-r--r-- | src/os_unix.c | 52 | ||||
-rw-r--r-- | src/shell.c.in | 6 | ||||
-rw-r--r-- | src/sqlite.h.in | 13 |
8 files changed, 255 insertions, 65 deletions
diff --git a/Makefile.in b/Makefile.in index 205b45536..6a6b5a8e1 100644 --- a/Makefile.in +++ b/Makefile.in @@ -623,10 +623,17 @@ FUZZCHECK_SRC += $(TOP)/test/vt02.c DBFUZZ_OPT = ST_OPT = -DSQLITE_OS_KV_OPTIONAL + +# In wasi-sdk builds, disable the CLI shell build in the "all" target. +SQLITE3_SHELL_TARGET_ = sqlite3$(TEXE) +SQLITE3_SHELL_TARGET_1 = +SQLITE3_SHELL_TARGET = $(SQLITE3_SHELL_TARGET_@HAVE_WASI_SDK@) + # This is the default Makefile target. The objects listed here # are what get build when you type just "make" with no arguments. # -all: sqlite3.h libsqlite3.la sqlite3$(TEXE) $(HAVE_TCL:1=libtclsqlite3.la) +all: sqlite3.h libsqlite3.la $(SQLITE3_SHELL_TARGET) \ + $(HAVE_TCL:1=libtclsqlite3.la) Makefile: $(TOP)/Makefile.in ./config.status @@ -800,6 +800,7 @@ TEMP_STORE ALLOWRELEASE SQLITE_THREADSAFE BUILD_CC +HAVE_WASI_SDK RELEASE VERSION program_prefix @@ -892,6 +893,7 @@ enable_fast_install with_gnu_ld enable_libtool_lock enable_largefile +with_wasi_sdk enable_threadsafe enable_releasemode enable_tempstore @@ -1579,6 +1581,8 @@ Optional Packages: --with-pic try to use only PIC/non-PIC objects [default=use both] --with-gnu-ld assume the C compiler uses GNU ld [default=no] + --with-wasi-sdk=DIR directory containing the WASI SDK. Triggers + cross-compile to WASM. --with-tcl=DIR directory containing tcl configuration (tclConfig.sh) --with-readline-lib specify readline library @@ -3938,13 +3942,13 @@ if ${lt_cv_nm_interface+:} false; then : else lt_cv_nm_interface="BSD nm" echo "int some_variable = 0;" > conftest.$ac_ext - (eval echo "\"\$as_me:3941: $ac_compile\"" >&5) + (eval echo "\"\$as_me:3945: $ac_compile\"" >&5) (eval "$ac_compile" 2>conftest.err) cat conftest.err >&5 - (eval echo "\"\$as_me:3944: $NM \\\"conftest.$ac_objext\\\"\"" >&5) + (eval echo "\"\$as_me:3948: $NM \\\"conftest.$ac_objext\\\"\"" >&5) (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) cat conftest.err >&5 - (eval echo "\"\$as_me:3947: output\"" >&5) + (eval echo "\"\$as_me:3951: output\"" >&5) cat conftest.out >&5 if $GREP 'External.*some_variable' conftest.out > /dev/null; then lt_cv_nm_interface="MS dumpbin" @@ -5150,7 +5154,7 @@ ia64-*-hpux*) ;; *-*-irix6*) # Find out which ABI we are using. - echo '#line 5153 "configure"' > conftest.$ac_ext + echo '#line 5157 "configure"' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? @@ -6675,11 +6679,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:6678: $lt_compile\"" >&5) + (eval echo "\"\$as_me:6682: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:6682: \$? = $ac_status" >&5 + echo "$as_me:6686: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -7014,11 +7018,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:7017: $lt_compile\"" >&5) + (eval echo "\"\$as_me:7021: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:7021: \$? = $ac_status" >&5 + echo "$as_me:7025: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -7119,11 +7123,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:7122: $lt_compile\"" >&5) + (eval echo "\"\$as_me:7126: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:7126: \$? = $ac_status" >&5 + echo "$as_me:7130: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -7174,11 +7178,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:7177: $lt_compile\"" >&5) + (eval echo "\"\$as_me:7181: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:7181: \$? = $ac_status" >&5 + echo "$as_me:7185: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -9554,7 +9558,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 9557 "configure" +#line 9561 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -9650,7 +9654,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 9653 "configure" +#line 9657 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -10393,6 +10397,68 @@ RELEASE=`cat $srcdir/VERSION` $as_echo "$as_me: Release set to $RELEASE" >&6;} +########## +# Handle --with-wasi-sdk=DIR +# +# This must be early because it changes the toolchain. +# + +# Check whether --with-wasi-sdk was given. +if test "${with_wasi_sdk+set}" = set; then : + withval=$with_wasi_sdk; with_wasisdk=${withval} +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for WASI SDK directory" >&5 +$as_echo_n "checking for WASI SDK directory... " >&6; } +if ${ac_cv_c_wasi_sdk+:} false; then : + $as_echo_n "(cached) " >&6 +else + + # First check to see if --with-tcl was specified. + if test x"${with_wasi_sdk}" != x ; then + if ! test -d "${with_wasi_sdk}" ; then + as_fn_error $? "${with_wasi_sdk} directory doesn't exist" "$LINENO" 5 + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${with_wasi_sdk}: using wasi-sdk clang, disabling: tcl, CLI shell, DLL" >&5 +$as_echo "${with_wasi_sdk}: using wasi-sdk clang, disabling: tcl, CLI shell, DLL" >&6; } + use_wasi_sdk=yes + else + use_wasi_sdk=no + fi + +fi + +if test "${use_wasi_sdk}" = "no" ; then + HAVE_WASI_SDK="" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +else + HAVE_WASI_SDK=1 +# Changing --host and --target have no effect here except to possibly +# cause confusion. autoconf has finished processing them by this +# point. +# +# host_alias=wasm32-wasi +# target=wasm32-wasi +# +# Merely changing CC and LD to the wasi-sdk's is enough to get +# sqlite3.o building in WASM format. + CC="${with_wasi_sdk}/bin/clang" + LD="${with_wasi_sdk}/bin/wasm-ld" + RANLIB="${with_wasi_sdk}/bin/llvm-ranlib" + cross_compiling=yes + enable_threadsafe=no + use_tcl=no + enable_tcl=no + # libtool is apparently hard-coded to use gcc for linking DLLs, so + # we disable the DLL build... + enable_shared=no + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +fi + + + ######### # Locate a compiler for the build machine. This compiler should # generate command-line programs that run on the build machine. @@ -11267,6 +11333,7 @@ fi ######### # See whether we should use the amalgamation to build + # Check whether --enable-amalgamation was given. if test "${enable_amalgamation+set}" = set; then : enableval=$enable_amalgamation; diff --git a/configure.ac b/configure.ac index 5f905db40..53be0a686 100644 --- a/configure.ac +++ b/configure.ac @@ -70,11 +70,11 @@ # target platform. "" for Unix and ".exe" for windows. # # This configure.in file is easy to reuse on other projects. Just -# change the argument to AC_INIT(). And disable any features that +# change the argument to AC_INIT. And disable any features that # you don't need (for example BLT) by erasing or commenting out # the corresponding code. # -AC_INIT(sqlite, m4_esyscmd([cat VERSION | tr -d '\n'])) +AC_INIT([sqlite],[m4_esyscmd(cat VERSION | tr -d '\n')]) dnl Make sure the local VERSION file matches this configure script sqlite_version_sanity_check=`cat $srcdir/VERSION | tr -d '\n'` @@ -88,7 +88,7 @@ fi ######### # Programs needed # -AC_PROG_LIBTOOL +LT_INIT AC_PROG_INSTALL ######### @@ -158,6 +158,56 @@ RELEASE=`cat $srcdir/VERSION` AC_MSG_NOTICE(Release set to $RELEASE) AC_SUBST(RELEASE) +########## +# Handle --with-wasi-sdk=DIR +# +# This must be early because it changes the toolchain. +# +AC_ARG_WITH(wasi-sdk, +AS_HELP_STRING([--with-wasi-sdk=DIR], + [directory containing the WASI SDK. Triggers cross-compile to WASM.]), with_wasisdk=${withval}) +AC_MSG_CHECKING([for WASI SDK directory]) +AC_CACHE_VAL(ac_cv_c_wasi_sdk,[ + # First check to see if --with-tcl was specified. + if test x"${with_wasi_sdk}" != x ; then + if ! test -d "${with_wasi_sdk}" ; then + AC_MSG_ERROR([${with_wasi_sdk} directory doesn't exist]) + fi + AC_MSG_RESULT([${with_wasi_sdk}: using wasi-sdk clang, disabling: tcl, CLI shell, DLL]) + use_wasi_sdk=yes + else + use_wasi_sdk=no + fi +]) +if test "${use_wasi_sdk}" = "no" ; then + HAVE_WASI_SDK="" + AC_MSG_RESULT([no]) +else + HAVE_WASI_SDK=1 +# Changing --host and --target have no effect here except to possibly +# cause confusion. autoconf has finished processing them by this +# point. +# +# host_alias=wasm32-wasi +# target=wasm32-wasi +# +# Merely changing CC and LD to the wasi-sdk's is enough to get +# sqlite3.o building in WASM format. + CC="${with_wasi_sdk}/bin/clang" + LD="${with_wasi_sdk}/bin/wasm-ld" + RANLIB="${with_wasi_sdk}/bin/llvm-ranlib" + cross_compiling=yes + enable_threadsafe=no + use_tcl=no + enable_tcl=no + # libtool is apparently hard-coded to use gcc for linking DLLs, so + # we disable the DLL build... + enable_shared=no + AC_MSG_RESULT([yes]) +fi +AC_SUBST(HAVE_WASI_SDK) + + ######### # Locate a compiler for the build machine. This compiler should # generate command-line programs that run on the build machine. @@ -179,7 +229,7 @@ AC_SUBST(BUILD_CC) # Do we want to support multithreaded use of sqlite # AC_ARG_ENABLE(threadsafe, -AC_HELP_STRING([--disable-threadsafe],[Disable mutexing])) +AS_HELP_STRING([--disable-threadsafe],[Disable mutexing])) AC_MSG_CHECKING([whether to support threadsafe operation]) if test "$enable_threadsafe" = "no"; then SQLITE_THREADSAFE=0 @@ -199,7 +249,7 @@ fi # Do we want to support release # AC_ARG_ENABLE(releasemode, -AC_HELP_STRING([--enable-releasemode],[Support libtool link to release mode]),,enable_releasemode=no) +AS_HELP_STRING([--enable-releasemode],[Support libtool link to release mode]),,enable_releasemode=no) AC_MSG_CHECKING([whether to support shared library linked as release mode or not]) if test "$enable_releasemode" = "no"; then ALLOWRELEASE="" @@ -214,7 +264,7 @@ AC_SUBST(ALLOWRELEASE) # Do we want temporary databases in memory # AC_ARG_ENABLE(tempstore, -AC_HELP_STRING([--enable-tempstore],[Use an in-ram database for temporary tables (never,no,yes,always)]),,enable_tempstore=no) +AS_HELP_STRING([--enable-tempstore],[Use an in-ram database for temporary tables (never,no,yes,always)]),,enable_tempstore=no) AC_MSG_CHECKING([whether to use an in-ram database for temporary tables]) case "$enable_tempstore" in never ) @@ -254,7 +304,15 @@ else AC_MSG_RESULT(unknown) fi if test "$CYGWIN" != "yes"; then - AC_CYGWIN + m4_warn([obsolete], +[AC_CYGWIN is obsolete: use AC_CANONICAL_HOST and check if $host_os +matches *cygwin*])dnl +AC_CANONICAL_HOST +case $host_os in + *cygwin* ) CYGWIN=yes;; + * ) CYGWIN=no;; +esac + fi if test "$CYGWIN" = "yes"; then BUILD_EXEEXT=.exe @@ -289,10 +347,10 @@ AC_SUBST(TARGET_EXEEXT) # Those macros could not be used directly since we have to make some # minor changes to accomodate systems that do not have TCL installed. # -AC_ARG_ENABLE(tcl, AC_HELP_STRING([--disable-tcl],[do not build TCL extension]), +AC_ARG_ENABLE(tcl, AS_HELP_STRING([--disable-tcl],[do not build TCL extension]), [use_tcl=$enableval],[use_tcl=yes]) if test "${use_tcl}" = "yes" ; then - AC_ARG_WITH(tcl, AC_HELP_STRING([--with-tcl=DIR],[directory containing tcl configuration (tclConfig.sh)]), with_tclconfig=${withval}) + AC_ARG_WITH(tcl, AS_HELP_STRING([--with-tcl=DIR],[directory containing tcl configuration (tclConfig.sh)]), with_tclconfig=${withval}) AC_MSG_CHECKING([for Tcl configuration]) AC_CACHE_VAL(ac_cv_c_tclconfig,[ # First check to see if --with-tcl was specified. @@ -474,11 +532,11 @@ TARGET_READLINE_INC="" TARGET_HAVE_READLINE=0 TARGET_HAVE_EDITLINE=0 AC_ARG_ENABLE([editline], - [AC_HELP_STRING([--enable-editline],[enable BSD editline support])], + [AS_HELP_STRING([--enable-editline],[enable BSD editline support])], [with_editline=$enableval], [with_editline=auto]) AC_ARG_ENABLE([readline], - [AC_HELP_STRING([--disable-readline],[disable readline support])], + [AS_HELP_STRING([--disable-readline],[disable readline support])], [with_readline=$enableval], [with_readline=auto]) @@ -494,7 +552,7 @@ if test x"$with_readline" != xno; then found="yes" AC_ARG_WITH([readline-lib], - [AC_HELP_STRING([--with-readline-lib],[specify readline library])], + [AS_HELP_STRING([--with-readline-lib],[specify readline library])], [with_readline_lib=$withval], [with_readline_lib="auto"]) if test "x$with_readline_lib" = xauto; then @@ -509,7 +567,7 @@ if test x"$with_readline" != xno; then fi AC_ARG_WITH([readline-inc], - [AC_HELP_STRING([--with-readline-inc],[specify readline include paths])], + [AS_HELP_STRING([--with-readline-inc],[specify readline include paths])], [with_readline_inc=$withval], [with_readline_inc="auto"]) if test "x$with_readline_inc" = xauto; then @@ -554,7 +612,7 @@ AC_SEARCH_LIBS(fdatasync, [rt]) ######### # check for debug enabled -AC_ARG_ENABLE(debug, AC_HELP_STRING([--enable-debug],[enable debugging & verbose explain])) +AC_ARG_ENABLE(debug, AS_HELP_STRING([--enable-debug],[enable debugging & verbose explain])) AC_MSG_CHECKING([build type]) if test "${enable_debug}" = "yes" ; then TARGET_DEBUG="-DSQLITE_DEBUG=1 -DSQLITE_ENABLE_SELECTTRACE -DSQLITE_ENABLE_WHERETRACE -O0" @@ -567,7 +625,8 @@ AC_SUBST(TARGET_DEBUG) ######### # See whether we should use the amalgamation to build -AC_ARG_ENABLE(amalgamation, AC_HELP_STRING([--disable-amalgamation], + +AC_ARG_ENABLE(amalgamation, AS_HELP_STRING([--disable-amalgamation], [Disable the amalgamation and instead build all files separately])) if test "${enable_amalgamation}" = "no" ; then USE_AMALGAMATION=0 @@ -582,7 +641,7 @@ AC_SUBST(HAVE_ZLIB) ######### # See whether we should allow loadable extensions -AC_ARG_ENABLE(load-extension, AC_HELP_STRING([--disable-load-extension], +AC_ARG_ENABLE(load-extension, AS_HELP_STRING([--disable-load-extension], [Disable loading of external extensions]),,[enable_load_extension=yes]) if test "${enable_load_extension}" = "yes" ; then OPT_FEATURE_FLAGS="" @@ -595,7 +654,7 @@ fi # Do we want to support math functions # AC_ARG_ENABLE(math, -AC_HELP_STRING([--disable-math],[Disable math functions])) +AS_HELP_STRING([--disable-math],[Disable math functions])) AC_MSG_CHECKING([whether to support math functions]) if test "$enable_math" = "no"; then AC_MSG_RESULT([no]) @@ -609,7 +668,7 @@ fi # Do we want to support JSON functions # AC_ARG_ENABLE(json, -AC_HELP_STRING([--disable-json],[Disable JSON functions])) +AS_HELP_STRING([--disable-json],[Disable JSON functions])) AC_MSG_CHECKING([whether to support JSON functions]) if test "$enable_json" = "no"; then AC_MSG_RESULT([no]) @@ -621,14 +680,14 @@ fi ######## # The --enable-all argument is short-hand to enable # multiple extensions. -AC_ARG_ENABLE(all, AC_HELP_STRING([--enable-all], +AC_ARG_ENABLE(all, AS_HELP_STRING([--enable-all], [Enable FTS4, FTS5, Geopoly, RTree, Sessions])) ########## # Do we want to support memsys3 and/or memsys5 # AC_ARG_ENABLE(memsys5, - AC_HELP_STRING([--enable-memsys5],[Enable MEMSYS5])) + AS_HELP_STRING([--enable-memsys5],[Enable MEMSYS5])) AC_MSG_CHECKING([whether to support MEMSYS5]) if test "${enable_memsys5}" = "yes"; then OPT_FEATURE_FLAGS="${OPT_FEATURE_FLAGS} -DSQLITE_ENABLE_MEMSYS5" @@ -637,7 +696,7 @@ else AC_MSG_RESULT([no]) fi AC_ARG_ENABLE(memsys3, - AC_HELP_STRING([--enable-memsys3],[Enable MEMSYS3])) + AS_HELP_STRING([--enable-memsys3],[Enable MEMSYS3])) AC_MSG_CHECKING([whether to support MEMSYS3]) if test "${enable_memsys3}" = "yes" -a "${enable_memsys5}" = "no"; then OPT_FEATURE_FLAGS="${OPT_FEATURE_FLAGS} -DSQLITE_ENABLE_MEMSYS3" @@ -648,7 +707,7 @@ fi ######### # See whether we should enable Full Text Search extensions -AC_ARG_ENABLE(fts3, AC_HELP_STRING([--enable-fts3], +AC_ARG_ENABLE(fts3, AS_HELP_STRING([--enable-fts3], [Enable the FTS3 extension])) AC_MSG_CHECKING([whether to support FTS3]) if test "${enable_fts3}" = "yes" ; then @@ -657,7 +716,7 @@ if test "${enable_fts3}" = "yes" ; then else AC_MSG_RESULT([no]) fi -AC_ARG_ENABLE(fts4, AC_HELP_STRING([--enable-fts4], +AC_ARG_ENABLE(fts4, AS_HELP_STRING([--enable-fts4], [Enable the FTS4 extension])) AC_MSG_CHECKING([whether to support FTS4]) if test "${enable_fts4}" = "yes" -o "${enable_all}" = "yes" ; then @@ -667,7 +726,7 @@ if test "${enable_fts4}" = "yes" -o "${enable_all}" = "yes" ; then else AC_MSG_RESULT([no]) fi -AC_ARG_ENABLE(fts5, AC_HELP_STRING([--enable-fts5], +AC_ARG_ENABLE(fts5, AS_HELP_STRING([--enable-fts5], [Enable the FTS5 extension])) AC_MSG_CHECKING([whether to support FTS5]) if test "${enable_fts5}" = "yes" -o "${enable_all}" = "yes" ; then @@ -681,7 +740,7 @@ fi ######### # See whether we should enable the LIMIT clause on UPDATE and DELETE # statements. -AC_ARG_ENABLE(update-limit, AC_HELP_STRING([--enable-update-limit], +AC_ARG_ENABLE(update-limit, AS_HELP_STRING([--enable-update-limit], [Enable the UPDATE/DELETE LIMIT clause])) AC_MSG_CHECKING([whether to support LIMIT on UPDATE and DELETE statements]) if test "${enable_update_limit}" = "yes" ; then @@ -693,7 +752,7 @@ fi ######### # See whether we should enable GEOPOLY -AC_ARG_ENABLE(geopoly, AC_HELP_STRING([--enable-geopoly], +AC_ARG_ENABLE(geopoly, AS_HELP_STRING([--enable-geopoly], [Enable the GEOPOLY extension]), [enable_geopoly=yes],[enable_geopoly=no]) AC_MSG_CHECKING([whether to support GEOPOLY]) @@ -707,7 +766,7 @@ fi ######### # See whether we should enable RTREE -AC_ARG_ENABLE(rtree, AC_HELP_STRING([--enable-rtree], +AC_ARG_ENABLE(rtree, AS_HELP_STRING([--enable-rtree], [Enable the RTREE extension])) AC_MSG_CHECKING([whether to support RTREE]) if test "${enable_rtree}" = "yes" ; then @@ -719,7 +778,7 @@ fi ######### # See whether we should enable the SESSION extension -AC_ARG_ENABLE(session, AC_HELP_STRING([--enable-session], +AC_ARG_ENABLE(session, AS_HELP_STRING([--enable-session], [Enable the SESSION extension])) AC_MSG_CHECKING([whether to support SESSION]) if test "${enable_session}" = "yes" -o "${enable_all}" = "yes" ; then @@ -783,7 +842,7 @@ BUILD_CFLAGS=$ac_temp_BUILD_CFLAGS ######### # See whether we should use GCOV -AC_ARG_ENABLE(gcov, AC_HELP_STRING([--enable-gcov], +AC_ARG_ENABLE(gcov, AS_HELP_STRING([--enable-gcov], [Enable coverage testing using gcov])) if test "${use_gcov}" = "yes" ; then USE_GCOV=1 @@ -812,7 +871,8 @@ AC_CONFIG_HEADERS(sqlite_cfg.h) # Generate the output files. # AC_SUBST(BUILD_CFLAGS) -AC_OUTPUT([ +AC_CONFIG_FILES([ Makefile sqlite3.pc ]) +AC_OUTPUT @@ -1,9 +1,9 @@ -C Cherrypick\s[fa784101775b7|emscripten\sticket\s#18609\sworkaround]\sinto\strunk. -D 2023-01-27T05:17:10.270 +C Merge\strunk\sinto\swasi-patches\sbranch. +D 2023-01-27T05:37:24.147 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724 -F Makefile.in 4bba1e74ea2ffc95b9f299d72aebec06dc55c2d93948c93a2f356cc9682912ea +F Makefile.in 7608208f680a288a7e84717a74d05db789dbf4deba2c905ef7c17482f2bc4ef6 F Makefile.linux-gcc f609543700659711fbd230eced1f01353117621dccae7b9fb70daa64236c5241 F Makefile.msc 6de67bb5a8e849f9a7a11085366cc8daf99845fa21368e89b3cd195abd62cd2a F README.md 8b8df9ca852aeac4864eb1e400002633ee6db84065bd01b78c33817f97d31f5e @@ -33,8 +33,8 @@ F autoconf/tea/win/nmakehlp.c b01f822eabbe1ed2b64e70882d97d48402b42d2689a1ea0034 F autoconf/tea/win/rules.vc c511f222b80064096b705dbeb97060ee1d6b6d63 F config.guess 883205ddf25b46f10c181818bf42c09da9888884af96f79e1719264345053bd6 F config.sub c2d0260f17f3e4bc0b6808fccf1b291cb5e9126c14fc5890efc77b9fd0175559 -F configure 9cbf6a15a4b5f2b3551a466420e5f51ce04c40aaed7f90c886402bf0b66ec110 x -F configure.ac 48dc6bfee293eef05910faf085760f2fd79b680aa47b50e8e6a22ca40bb026bb +F configure 6ba84abf7878bb072d460766d29e492028468775d4c09464940343092eb6493c x +F configure.ac 4654d32ac0a0d0b48f1e1e79bdc3d777b723cf2f63c33eb1d7c4ed8b435938e8 F contrib/sqlitecon.tcl 210a913ad63f9f991070821e599d600bd913e0ad F doc/F2FS.txt c1d4a0ae9711cfe0e1d8b019d154f1c29e0d3abfe820787ba1e9ed7691160fcd F doc/json-enhancements.md e356fc834781f1f1aa22ee300027a270b2c960122468499bf347bb123ce1ea4f @@ -604,7 +604,7 @@ F src/os.h 1ff5ae51d339d0e30d8a9d814f4b8f8e448169304d83a7ed9db66a65732f3e63 F src/os_common.h 6c0eb8dd40ef3e12fe585a13e709710267a258e2c8dd1c40b1948a1d14582e06 F src/os_kv.c 4d39e1f1c180b11162c6dc4aa8ad34053873a639bac6baae23272fc03349986a F src/os_setup.h 6011ad7af5db4e05155f385eb3a9b4470688de6f65d6166b8956e58a3d872107 -F src/os_unix.c 9107314500e44908e8d2cdf1ed3333ca5fa17dcfdf9c6a079002b4df90d5f806 +F src/os_unix.c 2ab48df80d598e11fe216dcae5cdf28d2b4c7ab195a685bd4047b9e534c3aaf6 F src/os_win.c 295fe45f18bd86f2477f4cd79f3377c6f883ceb941b1f46808665c73747f2345 F src/os_win.h 7b073010f1451abe501be30d12f6bc599824944a F src/pager.c fc6d3ec7017d7369ab5dc5421ad1763ff224551c9381866b6da69040db62e406 @@ -621,8 +621,8 @@ F src/random.c 606b00941a1d7dd09c381d3279a058d771f406c5213c9932bbd93d5587be4b9c F src/resolve.c 5a98a7bf277aa60584b6bb4c5dd6a9ef2b19537910612c34f596e2901e88596d F src/rowset.c ba9515a922af32abe1f7d39406b9d35730ed65efab9443dc5702693b60854c92 F src/select.c d389ccdb96855dbfaadc22d936889e1f0652ffca17e31a6b6522b45d99daa8ce -F src/shell.c.in f7fd28e68269a58690c665e8a5e96ba242201267925fbd335f08695c79fc6db7 -F src/sqlite.h.in d2a5fc1f6740bd02b571d33d2eb308fa7d1b0fac5b86f6f1fe8310cd49bca97d +F src/shell.c.in afe1b3762f7f33752d9c51ebc92c9ba8de21c3470af9ae03e961b380d1521ecf +F src/sqlite.h.in 2b41f4908dd16cecb3754fe3fa2287a27ee825fb75d508ff2d7546b14e5a6ae6 F src/sqlite3.rc 5121c9e10c3964d5755191c80dd1180c122fc3a8 F src/sqlite3ext.h da473ce2b3d0ae407a6300c4a164589b9a6bfdbec9462688a8593ff16f3bb6e4 F src/sqliteInt.h 43eeee1ea80543a0e40444bf53643ca259a2b1158ccfe859a6a6435b7358ecdd @@ -2044,9 +2044,8 @@ F vsixtest/vsixtest.tcl 6a9a6ab600c25a91a7acc6293828957a386a8a93 F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0 -P bdfd72a083fadd724030c4c89adae71426e1ddd402c6bc5abf40801ecf3253cf -Q +fa784101775b795077a23c211b5b16f51ad5a13967c284511f310dfcbfa9f77a -R f546cb30f93859da1452256662a169a1 +P 6fc20d75d49310aedbc3351a4a5f1aa9ef5b4100501c7bfbe556aca2be2e44d7 9a26fae545b9c97129893b83ff97e62b1c477eccd1379af1dce4a3cc4fa9f932 +R 145aa0c23a71f0a1d2cc97d60c0a4a1e U stephan -Z 2937fe2d7bb3aa79ea588267ef9524d2 +Z ecd9a24931c0cd6ff26d46c7f1fc2570 # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index ca24ae6fe..baa286d94 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -9a26fae545b9c97129893b83ff97e62b1c477eccd1379af1dce4a3cc4fa9f932
\ No newline at end of file +2ce89f5efcdb8b4c58eb2d30833a76d79ae0134c31d5ab8564be9e1cf5a1f4f0
\ No newline at end of file diff --git a/src/os_unix.c b/src/os_unix.c index c3359f1bc..e430e5df3 100644 --- a/src/os_unix.c +++ b/src/os_unix.c @@ -95,7 +95,8 @@ #include <time.h> #include <sys/time.h> /* amalgamator: keep */ #include <errno.h> -#if !defined(SQLITE_OMIT_WAL) || SQLITE_MAX_MMAP_SIZE>0 +#if (!defined(SQLITE_OMIT_WAL) || SQLITE_MAX_MMAP_SIZE>0) \ + && !defined(SQLITE_WASI) # include <sys/mman.h> #endif @@ -183,9 +184,46 @@ */ #define SQLITE_MAX_SYMLINKS 100 +/* +** Remove and stub certain info for WASI (WebAssembly System +** Interface) builds. +*/ +#ifdef SQLITE_WASI +# undef HAVE_FCHMOD +# undef HAVE_FCHOWN +# undef HAVE_MREMAP +# define HAVE_MREMAP 0 +# ifndef SQLITE_DEFAULT_UNIX_VFS +# define SQLITE_DEFAULT_UNIX_VFS "unix-dotfile" + /* ^^^ should SQLITE_DEFAULT_UNIX_VFS be "unix-none"? */ +# endif +# ifndef F_RDLCK +# define F_RDLCK 0 +# define F_WRLCK 1 +# define F_UNLCK 2 +# if __LONG_MAX == 0x7fffffffL +# define F_GETLK 12 +# define F_SETLK 13 +# define F_SETLKW 14 +# else +# define F_GETLK 5 +# define F_SETLK 6 +# define F_SETLKW 7 +# endif +# endif +#else /* !SQLITE_WASI */ +# ifndef HAVE_FCHMOD +# define HAVE_FCHMOD +# endif +#endif /* SQLITE_WASI */ + +#ifdef SQLITE_WASI +# define osGetpid(X) (pid_t)1 +#else /* Always cast the getpid() return type for compatibility with ** kernel modules in VxWorks. */ -#define osGetpid(X) (pid_t)getpid() +# define osGetpid(X) (pid_t)getpid() +#endif /* ** Only set the lastErrno if the error code is a real error and not @@ -457,7 +495,11 @@ static struct unix_syscall { #define osPwrite64 ((ssize_t(*)(int,const void*,size_t,off64_t))\ aSyscall[13].pCurrent) +#if defined(HAVE_FCHMOD) { "fchmod", (sqlite3_syscall_ptr)fchmod, 0 }, +#else + { "fchmod", (sqlite3_syscall_ptr)0, 0 }, +#endif #define osFchmod ((int(*)(int,mode_t))aSyscall[14].pCurrent) #if defined(HAVE_POSIX_FALLOCATE) && HAVE_POSIX_FALLOCATE @@ -493,14 +535,16 @@ static struct unix_syscall { #endif #define osGeteuid ((uid_t(*)(void))aSyscall[21].pCurrent) -#if !defined(SQLITE_OMIT_WAL) || SQLITE_MAX_MMAP_SIZE>0 +#if (!defined(SQLITE_OMIT_WAL) || SQLITE_MAX_MMAP_SIZE>0) \ + && !defined(SQLITE_WASI) { "mmap", (sqlite3_syscall_ptr)mmap, 0 }, #else { "mmap", (sqlite3_syscall_ptr)0, 0 }, #endif #define osMmap ((void*(*)(void*,size_t,int,int,int,off_t))aSyscall[22].pCurrent) -#if !defined(SQLITE_OMIT_WAL) || SQLITE_MAX_MMAP_SIZE>0 +#if (!defined(SQLITE_OMIT_WAL) || SQLITE_MAX_MMAP_SIZE>0) \ + && !defined(SQLITE_WASI) { "munmap", (sqlite3_syscall_ptr)munmap, 0 }, #else { "munmap", (sqlite3_syscall_ptr)0, 0 }, diff --git a/src/shell.c.in b/src/shell.c.in index 402a01d50..3da0bf3b9 100644 --- a/src/shell.c.in +++ b/src/shell.c.in @@ -111,7 +111,7 @@ typedef unsigned char u8; #if !defined(_WIN32) && !defined(WIN32) # include <signal.h> -# if !defined(__RTP__) && !defined(_WRS_KERNEL) +# if !defined(__RTP__) && !defined(_WRS_KERNEL) && !defined(SQLITE_WASI) # include <pwd.h> # endif #endif @@ -200,7 +200,7 @@ typedef unsigned char u8; /* Make sure isatty() has a prototype. */ extern int isatty(int); -# if !defined(__RTP__) && !defined(_WRS_KERNEL) +# if !defined(__RTP__) && !defined(_WRS_KERNEL) && !defined(SQLITE_WASI) /* popen and pclose are not C89 functions and so are ** sometimes omitted from the <stdio.h> header */ extern FILE *popen(const char*,const char*); @@ -11499,7 +11499,7 @@ static char *find_home_dir(int clearFlag){ if( home_dir ) return home_dir; #if !defined(_WIN32) && !defined(WIN32) && !defined(_WIN32_WCE) \ - && !defined(__RTP__) && !defined(_WRS_KERNEL) + && !defined(__RTP__) && !defined(_WRS_KERNEL) && !defined(SQLITE_WASI) { struct passwd *pwent; uid_t uid = getuid(); diff --git a/src/sqlite.h.in b/src/sqlite.h.in index 0ae65aa75..ba8306ce1 100644 --- a/src/sqlite.h.in +++ b/src/sqlite.h.in @@ -10532,6 +10532,19 @@ int sqlite3_deserialize( # undef double #endif +#if defined(__wasi__) +# undef SQLITE_WASI +# define SQLITE_WASI 1 +# undef SQLITE_OMIT_WAL +# define SQLITE_OMIT_WAL 1/* because it requires shared memory APIs */ +# ifndef SQLITE_OMIT_LOAD_EXTENSION +# define SQLITE_OMIT_LOAD_EXTENSION +# endif +# ifndef SQLITE_THREADSAFE +# define SQLITE_THREADSAFE 0 +# endif +#endif + #ifdef __cplusplus } /* End of the 'extern "C"' block */ #endif |