]> git.ipfire.org Git - thirdparty/sqlite.git/commitdiff
Add --with-wasi-sdk=DIR flag to configure.ac. This mode compiles but fails to link...
authorstephan <stephan@noemail.net>
Sat, 10 Dec 2022 06:44:48 +0000 (06:44 +0000)
committerstephan <stephan@noemail.net>
Sat, 10 Dec 2022 06:44:48 +0000 (06:44 +0000)
FossilOrigin-Name: 39c9f441519d3b3c365c52293a73cdf4af86de639e0009170c27725aad6653f6

Makefile.in
configure
configure.ac
manifest
manifest.uuid

index f808312c695b5f9a80e2bd049399c69f747f7d94..c146461e8587f1f015942f8183194a57649a3767 100644 (file)
@@ -649,10 +649,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
index 908bba9c5bf896307ed753842473f149baad5ecf..5cd4a2bd1427b3a0df5d5fb8e5a851e757506161 100755 (executable)
--- a/configure
+++ b/configure
@@ -827,6 +827,7 @@ TEMP_STORE
 ALLOWRELEASE
 SQLITE_THREADSAFE
 BUILD_CC
+HAVE_WASI_SDK
 RELEASE
 VERSION
 program_prefix
@@ -919,6 +920,7 @@ enable_fast_install
 with_gnu_ld
 enable_libtool_lock
 enable_largefile
+with_wasi_sdk
 enable_threadsafe
 enable_releasemode
 enable_tempstore
@@ -1614,6 +1616,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
@@ -4458,13 +4462,13 @@ then :
 else $as_nop
   lt_cv_nm_interface="BSD nm"
   echo "int some_variable = 0;" > conftest.$ac_ext
-  (eval echo "\"\$as_me:4461: $ac_compile\"" >&5)
+  (eval echo "\"\$as_me:4465: $ac_compile\"" >&5)
   (eval "$ac_compile" 2>conftest.err)
   cat conftest.err >&5
-  (eval echo "\"\$as_me:4464: $NM \\\"conftest.$ac_objext\\\"\"" >&5)
+  (eval echo "\"\$as_me:4468: $NM \\\"conftest.$ac_objext\\\"\"" >&5)
   (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
   cat conftest.err >&5
-  (eval echo "\"\$as_me:4467: output\"" >&5)
+  (eval echo "\"\$as_me:4471: output\"" >&5)
   cat conftest.out >&5
   if $GREP 'External.*some_variable' conftest.out > /dev/null; then
     lt_cv_nm_interface="MS dumpbin"
@@ -5715,7 +5719,7 @@ ia64-*-hpux*)
   ;;
 *-*-irix6*)
   # Find out which ABI we are using.
-  echo '#line 5718 "configure"' > conftest.$ac_ext
+  echo '#line 5722 "configure"' > conftest.$ac_ext
   if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
@@ -7058,11 +7062,11 @@ else $as_nop
    -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:7061: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:7065: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&5
-   echo "$as_me:7065: \$? = $ac_status" >&5
+   echo "$as_me:7069: \$? = $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.
@@ -7398,11 +7402,11 @@ else $as_nop
    -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:7401: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:7405: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&5
-   echo "$as_me:7405: \$? = $ac_status" >&5
+   echo "$as_me:7409: \$? = $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.
@@ -7505,11 +7509,11 @@ else $as_nop
    -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:7508: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:7512: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>out/conftest.err)
    ac_status=$?
    cat out/conftest.err >&5
-   echo "$as_me:7512: \$? = $ac_status" >&5
+   echo "$as_me:7516: \$? = $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
@@ -7561,11 +7565,11 @@ else $as_nop
    -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:7564: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:7568: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>out/conftest.err)
    ac_status=$?
    cat out/conftest.err >&5
-   echo "$as_me:7568: \$? = $ac_status" >&5
+   echo "$as_me:7572: \$? = $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
@@ -9949,7 +9953,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 9952 "configure"
+#line 9956 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -10046,7 +10050,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 10049 "configure"
+#line 10053 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -10879,6 +10883,62 @@ RELEASE=`cat $srcdir/VERSION`
 printf "%s\n" "$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+y}
+then :
+  withval=$with_wasi_sdk; with_wasisdk=${withval}
+fi
+
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for WASI SDK directory" >&5
+printf %s "checking for WASI SDK directory... " >&6; }
+if test ${ac_cv_c_wasi_sdk+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+
+  # 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
+    { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: ${with_wasi_sdk}: using wasi-sdk clang, disabling tcl, disabling sqlite3 CLI app" >&5
+printf "%s\n" "${with_wasi_sdk}: using wasi-sdk clang, disabling tcl, disabling sqlite3 CLI app" >&6; }
+    use_wasi_sdk=yes
+  else
+    use_wasi_sdk=no
+  fi
+
+fi
+
+if test "${use_wasi_sdk}" = "no" ; then
+  HAVE_WASI_SDK=""
+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"
+  cross_compiling=yes
+  enable_threadsafe=no
+  use_tcl=no
+  enable_tcl=no
+fi
+
+
+
 #########
 # Locate a compiler for the build machine.  This compiler should
 # generate command-line programs that run on the build machine.
index 9eaf6bcadbbd111760ac3e5f8565d8165205c919..9cd68dd63ca73c17f523dba7498bc4b9dd556e10 100644 (file)
@@ -158,6 +158,50 @@ 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, disabling sqlite3 CLI app])
+    use_wasi_sdk=yes
+  else
+    use_wasi_sdk=no
+  fi
+])
+if test "${use_wasi_sdk}" = "no" ; then
+  HAVE_WASI_SDK=""
+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"
+  cross_compiling=yes
+  enable_threadsafe=no
+  use_tcl=no
+  enable_tcl=no
+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.
index e4c7685cf09eea934a43499a91753d654d17295f..73290a5f260fd8652aeb19afab8acb0184eee1f3 100644 (file)
--- a/manifest
+++ b/manifest
@@ -1,9 +1,9 @@
-C Run\sconfigure.ac\sthrough\sautoupdate,\sas\srequired\sby\sautoconf\sfor\srebuilding\sconfigure.\sThese\s(many)\schanges\swere\smade\sentirely\sby\sthe\sautotools,\sexcept\sthat\ssome\swhitespace-only\schanges\swere\sreverted\sby\shand\sto\sreduce\snoise,\sand\sare\sa\spreliminary\sstep\sto\sadding\sa\snew\sflag\sto\sconfigure.ac.
-D 2022-12-10T05:52:02.526
+C Add\s--with-wasi-sdk=DIR\sflag\sto\sconfigure.ac.\sThis\smode\scompiles\sbut\sfails\sto\slink\sthe\sDLL\sbecause\slibtool\sis\sapparently\shard-coded\sto\sgcc\sfor\sthe\sDLL.
+D 2022-12-10T06:44:48.363
 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1
 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea
 F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724
-F Makefile.in c223963d7b0828f26cb62ea3e0f583d26839b7d3ef0d1cca87f35c4b222ff01b
+F Makefile.in 05d97a13bf8e50162f5aff3f1ca22b2af6af7f9bba49525db0906c807422fd15
 F Makefile.linux-gcc f609543700659711fbd230eced1f01353117621dccae7b9fb70daa64236c5241
 F Makefile.msc e86ec21328921721dd6f777da435c62a5469cda1a654f5ecefacf87ddb3dfeb3
 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 e24b3bc7cd06e0462d90aba856c3cdddbac3a0d85a86f0c3402866d579798f4c x
-F configure.ac c36bbc3f2604fc9b64a1e39e8c1897e395307ee624e95d4def8d7dcc8ef82918
+F configure a4d3f20148c5cefd1d569a3c83368909a6250f107687c69e41161f418cf0632b x
+F configure.ac b7785dcc6e5c15c45ca1ffc7dc72db61f67cbdce7b7564d097a1cb79d4cefd53
 F contrib/sqlitecon.tcl 210a913ad63f9f991070821e599d600bd913e0ad
 F doc/F2FS.txt c1d4a0ae9711cfe0e1d8b019d154f1c29e0d3abfe820787ba1e9ed7691160fcd
 F doc/json-enhancements.md e356fc834781f1f1aa22ee300027a270b2c960122468499bf347bb123ce1ea4f
@@ -2067,8 +2067,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 13dade955d46020ab408734123261e9fadb8bccbaf67003b111112af4789d8c0
-R fc46c79a94547ce08fe3cd195462d6fd
+P 2be2d5d428acd538e44d7b9345b64470131bef40f67ba3190f5cd42f9949f355
+R 764c0bd85411c14594ad3a6f3ef07d68
 U stephan
-Z 3477295956a0e931748d4f484704cfa0
+Z 6513e2f83a7c258ce48894809c0f7313
 # Remove this line to create a well-formed Fossil manifest.
index 05bb16dbd78133df2788ca8c99983eaee0ed7f8e..bfa81c9f46bf1d696b93c94ae3557c7cce8e4887 100644 (file)
@@ -1 +1 @@
-2be2d5d428acd538e44d7b9345b64470131bef40f67ba3190f5cd42f9949f355
\ No newline at end of file
+39c9f441519d3b3c365c52293a73cdf4af86de639e0009170c27725aad6653f6
\ No newline at end of file