0
0
mirror of https://github.com/sqlite/sqlite.git synced 2024-11-21 19:29:09 +01:00

Minor cleanups in the --with-wasi-sdk bits.

FossilOrigin-Name: d952c17981073cb0158b392edd9b0818dfba2456ab9997d360af56774c9f4216
This commit is contained in:
stephan 2024-10-23 02:11:52 +00:00
parent 54e1dff24b
commit fdcd599992
4 changed files with 51 additions and 52 deletions

View File

@ -301,54 +301,53 @@ if {"" eq [hwaci-bin-define install]} {
define BUILD_CC [get-define CC_FOR_BUILD]
define BUILD_CFLAGS [get-env CFLAGS {-g}]
define ENABLE_SHARED 1
define HAVE_TCL 0
########################################################################
# Handle --with-wasi-sdk=DIR
#
# This must be early because it may change the toolchain and several
# config options.
#
# It's unclear whether we can actually get away with making these
# changes to the autosetup environment.
define HAVE_TCL 0
define HAVE_WASI_SDK 0
if {1} {
# This must be early because it may change the toolchain and disable
# several config options.
proc hwaci-check-wasi-sdk {} {
set wasiSdkDir [opt-val with-wasi-sdk] ; # ??? [lindex [opt-val with-wasi-sdk] end]
define HAVE_WASI_SDK 0
#puts "x wasiSdkDir=$wasiSdkDir foo=[lindex [opt-val with-wasi-sdk] end]"
if {$wasiSdkDir ne ""} {
msg-result "Checking WASI SDK directory \[$wasiSdkDir]... "
#puts "prefix = [prefix $wasiSdkDir/bin {clang ld}]"
hwaci-affirm-files-exist -v {*}[prefix "$wasiSdkDir/bin/" {clang wasm-ld}]
msg-result "Using wasi-sdk clang, disabling: tcl, CLI shell, DLL, loadable extensions, threading"
define HAVE_WASI_SDK 1
define WASI_SDK_DIR $wasiSdkDir
hwaci-opt-set load-extension 0; # ==> --disable-load-extension
hwaci-opt-set threadsafe 0; # ==> --threadsafe=0
hwaci-opt-set tcl 0; # ==> --disable-tcl
define HAVE_TCL 0
set cross_compiling 1
# libtool is apparently hard-coded to use gcc for linking DLLs, so
# we disable the DLL build.
define ENABLE_SHARED 0
# 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.
# XXX CC="${wasiSdkDir}/bin/clang"
# XXX LD="${wasiSdkDir}/bin/wasm-ld"
# XXX RANLIB="${wasiSdkDir}/bin/llvm-ranlib"
define CC "${wasiSdkDir}/bin/clang"
define LD "${wasiSdkDir}/bin/wasm-ld"
#define STRIP "${wasiSdkDir}/bin/strip"
if {$wasiSdkDir eq ""} {
return 0
} elseif {$::cross_compiling} {
hwaci-fatal "Cannot combine --with-wasi-sdk with cross-compilation"
}
unset wasiSdkDir
}; # --wasi-sdk-dir
msg-result "Checking WASI SDK directory \[$wasiSdkDir]... "
#puts "prefix = [prefix $wasiSdkDir/bin {clang ld}]"
hwaci-affirm-files-exist -v {*}[prefix "$wasiSdkDir/bin/" {clang wasm-ld}]
msg-result "Using wasi-sdk clang, disabling: tcl, CLI shell, DLL, loadable extensions, threading"
define HAVE_WASI_SDK 1
define WASI_SDK_DIR $wasiSdkDir
hwaci-opt-set load-extension 0; # ==> --disable-load-extension
hwaci-opt-set threadsafe 0; # ==> --threadsafe=0
hwaci-opt-set tcl 0; # ==> --disable-tcl
define HAVE_TCL 0
set cross_compiling 1
define ENABLE_SHARED 0
# 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.
# XXX CC="${wasiSdkDir}/bin/clang"
# XXX LD="${wasiSdkDir}/bin/wasm-ld"
# XXX RANLIB="${wasiSdkDir}/bin/llvm-ranlib"
define CC "${wasiSdkDir}/bin/clang"
define LD "${wasiSdkDir}/bin/wasm-ld"
#define STRIP "${wasiSdkDir}/bin/strip"
return 1
}; # hwaci-check-wasi-sdk
hwaci-check-wasi-sdk
#
# Enable large file support (if special flags are necessary)
@ -447,6 +446,7 @@ hwaci-if-opt-truthy with-debug {
#
define TCLSH_CMD {exit 1}
proc hwaci-check-tcl {} {
# TODO: document the steps this is taking.
global top_srcdir
puts "Checking for a suitable tcl... "
set optTcl [hwaci-opt-truthy tcl]
@ -535,7 +535,6 @@ proc hwaci-check-tcl {} {
break
}
define HAVE_TCL 0
define TCL_CONFIG_SH $cfg
# The historical configure.ac sources tclConfig.sh so that it can
# use the several TCL_... env vars. We obviously cannot do that from

View File

@ -610,11 +610,11 @@ proc hwaci-affirm-files-exist {args} {
set args [lrange $args 1 end]
}
foreach f $args {
if {$verbose} { msg-checking "looking for file... " }
if {$verbose} { msg-checking "Looking for $f ... " }
if {![file exists $f]} {
user-error "not found: $f"
}
if {$verbose} { msg-result "$f" }
if {$verbose} { msg-result "" }
set rc $f
}
return rc

View File

@ -1,5 +1,5 @@
C Get\sauto.def\shandling\sthe\scase\sthat\sno\stclsh\sis\sinstalled\sin\sa\sdefault\slocation.\s\sIf\snot,\suse\sjimsh\sif\swe\scan\sfind\srealpath(),\selse\sbail\sout.
D 2024-10-23T01:59:34.375
C Minor\scleanups\sin\sthe\s--with-wasi-sdk\sbits.
D 2024-10-23T02:11:52.441
F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1
F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea
F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724
@ -14,7 +14,7 @@ F art/icon-80x90.gif 65509ce3e5f86a9cd64fe7fca2d23954199f31fe44c1e09e208c80fb83d
F art/sqlite370.eps aa97a671332b432a54e1d74ff5e8775be34200c2
F art/sqlite370.ico af56c1d00fee7cd4753e8631ed60703ed0fc6e90
F art/sqlite370.jpg d512473dae7e378a67e28ff96a34da7cb331def2
F auto.def 1b677ab8ca5aaee8f6622ce0f9f1e3c07753c6ad15d258de22ea033b4abc5feb
F auto.def fdb4d96df5bc2ecb26aa4490b22ce0d4734828d6505574d1b22885a6cf2c6f1d
F autoconf/INSTALL 83e4a25da9fd053c7b3665eaaaf7919707915903
F autoconf/Makefile.am adedc1324b6a87fdd1265ddd336d2fb7d4f36a0e77b86ea553ae7cc4ea239347
F autoconf/Makefile.fallback 22fe523eb36dfce31e0f6349f782eb084e86a5620b2b0b4f84a2d6133f53f5ac
@ -48,7 +48,7 @@ F autosetup/cc-lib.tcl 493c5935b5dd3bf9bd4eca89b07c8b1b1a9356d61783035144e21795f
F autosetup/cc-shared.tcl 4f024e94a47f427ba61de1739f6381ef0080210f9fae89112d5c1de1e5460d78
F autosetup/cc.tcl 7e2fe943ae9d45cf39e9f5b05b6230df8e719415edea5af06c30eb68680bde14
F autosetup/default.auto 5cdf016de2140e50f1db190a02039dc42fb390af1dda4cc4853e3042a9ef0e82
F autosetup/hwaci-common.tcl e17ec263ffe52207be99604d0ee9c36ab866605b1881518ab814a47cacedff4d
F autosetup/hwaci-common.tcl 3e9ae4dbdda198e5dea56e2bdf0a073f2acf60f76e83dc3ee25a00390d3f6bc7
F autosetup/jimsh0.c 1b5fe91fffcddbc29f2b16acb80f1650632ea2edbe8336b8155ef7b4c66f6d8d
F autosetup/pkg-config.tcl 4e635bf39022ff65e0d5434339dd41503ea48fc53822c9c5bde88b02d3d952ba
F autosetup/system.tcl 3a39d6e0b3bfba526fd39afe07c1d0d325e5a31925013a1ba7c671e1128e31bb
@ -2240,8 +2240,8 @@ F vsixtest/vsixtest.tcl 6195aba1f12a5e10efc2b8c0009532167be5e301abe5b31385638080
F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc
F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e
F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0
P cd447e50d1b31e7539e4a8b5dc2a88c5a6a3814a28718b5829167b830dfd0edd
R eb16726048dc406bfeeacf1897cc1534
P 359741bc7624006014d73c4cf5cdd29fa38c33a446ed04b46032e5d3ca18d13c
R 6664e3de4f6cbfb5c6f691e38c508252
U stephan
Z f9b2797ed9043665e78aef0c31e48a93
Z 3de5c5fa6fbeeee08097471cc1684856
# Remove this line to create a well-formed Fossil manifest.

View File

@ -1 +1 @@
359741bc7624006014d73c4cf5cdd29fa38c33a446ed04b46032e5d3ca18d13c
d952c17981073cb0158b392edd9b0818dfba2456ab9997d360af56774c9f4216