Get lemon building. Re-indent hwaci-common.tcl for consistency.

FossilOrigin-Name: 53dc33d5e20062e8c4c9856349bbc143c858327ef41f356ffcc574b36d0cc73c
This commit is contained in:
stephan 2024-09-26 18:40:07 +00:00
parent 76bfcd13be
commit c2da952f5d
5 changed files with 163 additions and 162 deletions

View File

@ -889,12 +889,15 @@ SQLITE3_O = $(TOP)/sqlite3.o
#XX##
#XX#sqlite3.lo: sqlite3.c
#XX# $(LTCOMPILE) $(TEMP_STORE) -c sqlite3.c
#XX#
#XX## Rules to build the LEMON compiler generator
#XX##
#XX#lemon$(BEXE): $(TOP)/tool/lemon.c $(TOP)/tool/lempar.c
#XX# $(BCC) -o $@ $(TOP)/tool/lemon.c
#XX# cp $(TOP)/tool/lempar.c .
# Rules to build the LEMON compiler generator
#
lemon$(BEXE): $(TOP)/tool/lemon.c $(TOP)/tool/lempar.c
$(BCC) -o $@ $(TOP)/tool/lemon.c
cp $(TOP)/tool/lempar.c .
@if BUILD_EXEEXT ne ""
lemon: lemon$(BEXE)
@endif
#XX#
#XX## Rules to build the program that generates the source-id
#XX##

View File

@ -36,7 +36,7 @@ options {
test-status => {Enable status of tests}
threadsafe=1 => {Disable mutexing}
releasemode => {libtool link to release mode}
with-tempstore:=no => {Use an in-ram database for temporary tables: never,no,yes,always}
with-tempstore:=no => {Use an in-ram database for temporary tables: never,no,yes,always.}
editline=0 => {BSD editline support}
readline=0 => {readline support}
largefile=1 => {Disable large file support}
@ -60,9 +60,9 @@ options {
gcov=0 => {Enable coverage testing using gcov}
linemacros => {Enable #line macros in the amalgamation.}
with-wasi-sdk:=/opt/wasi-sdk
=> {Top-most dir of the wasi-sdk for a WASI build}
=> {Top-most dir of the wasi-sdk for a WASI build.}
with-emsdk:DIR => {Top-most dir of the Emscripten SDK installation}
dump-defines=1 => {Dump autosetup defines to $DUMP_DEFINES_FILE}
dump-defines=1 => {Disable dump of autosetup defines to $DUMP_DEFINES_FILE}
}
set srcdir $autosetup(srcdir)
@ -73,8 +73,6 @@ define VERSION $VERSION
define RELEASE $RELEASE
puts "RELEASE = $RELEASE"
puts "VERSION = $VERSION"
#puts "with-wasi-sdk? = [opt-val with-wasi-sdk]"
#puts "with-debug? = [opt-val with-debug]"
set outOfTreeBuild 0
if {![file exists sqlite3.pc.in]} {

View File

@ -27,18 +27,18 @@ array set hwaciCache {} ; # used for caching various results.
#
# On an empty list, returns "".
proc hwaci-lshift {listVar {count 1}} {
upvar 1 $listVar l
if {![info exists l]} {
# make the error message show the real variable name
error "can't read \"$listVar\": no such variable"
}
if {![llength $l]} {
# error Empty
return ""
}
set r [lrange $l 0 [incr count -1]]
set l [lreplace $l [set l 0] $count]
return $r
upvar 1 $listVar l
if {![info exists l]} {
# make the error message show the real variable name
error "can't read \"$listVar\": no such variable"
}
if {![llength $l]} {
# error Empty
return ""
}
set r [lrange $l 0 [incr count -1]]
set l [lreplace $l [set l 0] $count]
return $r
}
########################################################################
@ -46,10 +46,10 @@ proc hwaci-lshift {listVar {count 1}} {
# routine makes to the LIBS define. Returns the result of
# cc-check-function-in-lib.
proc hwaci-check-function-in-lib {function libs {otherlibs {}}} {
set _LIBS [get-define LIBS]
set found [cc-check-function-in-lib $function $libs $otherlibs]
define LIBS $_LIBS
return $found
set _LIBS [get-define LIBS]
set found [cc-check-function-in-lib $function $libs $otherlibs]
define LIBS $_LIBS
return $found
}
########################################################################
@ -62,35 +62,35 @@ proc hwaci-check-function-in-lib {function libs {otherlibs {}}} {
# If defName is empty then "BIN_X" is used, where X is the upper-case
# form of $binName with any '-' characters replaced with '_'.
proc hwaci-bin-define {binName {defName {}}} {
global hwaciCache
set cacheName "$binName:$defName"
set check {}
if {[info exists hwaciCache($cacheName)]} {
set check $hwaciCache($cacheName)
global hwaciCache
set cacheName "$binName:$defName"
set check {}
if {[info exists hwaciCache($cacheName)]} {
set check $hwaciCache($cacheName)
}
msg-checking "Looking for $binName ... "
if {"" ne $check} {
set lbl $check
if {" _ 0 _ " eq $check} {
set lbl "not found"
set check ""
}
msg-checking "Looking for $binName ... "
if {"" ne $check} {
set lbl $check
if {" _ 0 _ " eq $check} {
set lbl "not found"
set check ""
}
msg-result "(cached) $lbl"
return $check
}
set check [find-executable-path $binName]
if {"" eq $check} {
msg-result "not found"
set hwaciCache($cacheName) " _ 0 _ "
} else {
msg-result $check
set hwaciCache($cacheName) $check
}
if {"" eq $defName} {
set defName "BIN_[string toupper [string map {- _} $binName]]"
}
define $defName $check
msg-result "(cached) $lbl"
return $check
}
set check [find-executable-path $binName]
if {"" eq $check} {
msg-result "not found"
set hwaciCache($cacheName) " _ 0 _ "
} else {
msg-result $check
set hwaciCache($cacheName) $check
}
if {"" eq $defName} {
set defName "BIN_[string toupper [string map {- _} $binName]]"
}
define $defName $check
return $check
}
########################################################################
@ -98,11 +98,11 @@ proc hwaci-bin-define {binName {defName {}}} {
# BIN_BASH to the full path to bash and returns that value. We
# _require_ bash because it's the SHELL value used in our makefiles.
proc hwaci-require-bash {} {
set bash [hwaci-bin-define bash]
if {"" eq $bash} {
user-error "Our Makefiles require the bash shell."
}
return $bash
set bash [hwaci-bin-define bash]
if {"" eq $bash} {
user-error "Our Makefiles require the bash shell."
}
return $bash
}
########################################################################
@ -178,31 +178,31 @@ proc hwaci-define-if-opt-truthy {flag def msg {iftrue 1} {iffalse 0}} {
# the option is set, it gets define'd to 0, else 1. Returns the
# define'd value.
proc hwaci-opt-bool-01 {args} {
set invert 0
if {[lindex $args 0] eq "-v"} {
set invert 1
set args [lrange $args 1 end]
set invert 0
if {[lindex $args 0] eq "-v"} {
set invert 1
set args [lrange $args 1 end]
}
set optName [hwaci-lshift args]
set defName [hwaci-lshift args]
set descr [hwaci-lshift args]
if {"" eq $descr} {
set descr $defName
}
set rc 0
msg-checking "$descr ... "
if {[hwaci-opt-truthy $optName]} {
if {0 eq $invert} {
set rc 1
} else {
set rc 0
}
set optName [hwaci-lshift args]
set defName [hwaci-lshift args]
set descr [hwaci-lshift args]
if {"" eq $descr} {
set descr $defName
}
set rc 0
msg-checking "$descr ... "
if {[hwaci-opt-truthy $optName]} {
if {0 eq $invert} {
set rc 1
} else {
set rc 0
}
} elseif {0 ne $invert} {
set rc 1
}
msg-result $rc
define $defName $rc
return $rc
} elseif {0 ne $invert} {
set rc 1
}
msg-result $rc
define $defName $rc
return $rc
}
########################################################################
@ -224,48 +224,48 @@ proc hwaci-opt-bool-01 {args} {
# Note that if it finds LIBLTDL it does not look for LIBDL, so will
# report only that is has LIBLTDL.
proc hwaci-check-module-loader {} {
msg-checking "Looking for module-loader APIs... "
if {99 ne [get-define LDFLAGS_MODULE_LOADER]} {
if {1 eq [get-define HAVE_LIBLTDL 0]} {
msg-result "(cached) libltdl"
return 1
} elseif {1 eq [get-define HAVE_LIBDL 0]} {
msg-result "(cached) libdl"
return 1
}
# else: wha???
msg-checking "Looking for module-loader APIs... "
if {99 ne [get-define LDFLAGS_MODULE_LOADER]} {
if {1 eq [get-define HAVE_LIBLTDL 0]} {
msg-result "(cached) libltdl"
return 1
} elseif {1 eq [get-define HAVE_LIBDL 0]} {
msg-result "(cached) libdl"
return 1
}
set HAVE_LIBLTDL 0
set HAVE_LIBDL 0
# else: wha???
}
set HAVE_LIBLTDL 0
set HAVE_LIBDL 0
set LDFLAGS_MODULE_LOADER ""
set rc 0
puts "" ;# cosmetic kludge for cc-check-XXX
if {[cc-check-includes ltdl.h] && [cc-check-function-in-lib lt_dlopen ltdl]} {
set HAVE_LIBLTDL 1
set LDFLAGS_MODULE_LOADER "-lltdl -rdynamic"
puts " - Got libltdl."
set rc 1
} elseif {[cc-with {-includes dlfcn.h} {
cctest -link 1 -declare "extern char* dlerror(void);" -code "dlerror();"}]} {
puts " - This system can use dlopen() without -ldl."
set HAVE_LIBDL 1
set LDFLAGS_MODULE_LOADER ""
set rc 0
puts "" ;# cosmetic kludge for cc-check-XXX
if {[cc-check-includes ltdl.h] && [cc-check-function-in-lib lt_dlopen ltdl]} {
set HAVE_LIBLTDL 1
set LDFLAGS_MODULE_LOADER "-lltdl -rdynamic"
puts " - Got libltdl."
set rc 1
} elseif {[cc-with {-includes dlfcn.h} {
cctest -link 1 -declare "extern char* dlerror(void);" -code "dlerror();"}]} {
puts " - This system can use dlopen() without -ldl."
set HAVE_LIBDL 1
set LDFLAGS_MODULE_LOADER ""
set rc 1
} elseif {[cc-check-includes dlfcn.h]} {
set HAVE_LIBDL 1
set rc 1
if {[cc-check-function-in-lib dlopen dl]} {
puts " - dlopen() needs libdl."
set LDFLAGS_MODULE_LOADER "-ldl -rdynamic"
} else {
puts " - dlopen() not found in libdl. Assuming dlopen() is built-in."
set LDFLAGS_MODULE_LOADER "-rdynamic"
}
set rc 1
} elseif {[cc-check-includes dlfcn.h]} {
set HAVE_LIBDL 1
set rc 1
if {[cc-check-function-in-lib dlopen dl]} {
puts " - dlopen() needs libdl."
set LDFLAGS_MODULE_LOADER "-ldl -rdynamic"
} else {
puts " - dlopen() not found in libdl. Assuming dlopen() is built-in."
set LDFLAGS_MODULE_LOADER "-rdynamic"
}
define HAVE_LIBLTDL $HAVE_LIBLTDL
define HAVE_LIBDL $HAVE_LIBDL
define LDFLAGS_MODULE_LOADER $LDFLAGS_MODULE_LOADER
return $rc
}
define HAVE_LIBLTDL $HAVE_LIBLTDL
define HAVE_LIBDL $HAVE_LIBDL
define LDFLAGS_MODULE_LOADER $LDFLAGS_MODULE_LOADER
return $rc
}
########################################################################
@ -274,30 +274,30 @@ proc hwaci-check-module-loader {} {
# loader. Intended to be called in place of that function when
# a module loader is explicitly not desired.
proc hwaci-no-check-module-loader {} {
define HAVE_LIBDL 0
define HAVE_LIBLTDL 0
define LDFLAGS_MODULE_LOADER ""
define HAVE_LIBDL 0
define HAVE_LIBLTDL 0
define LDFLAGS_MODULE_LOADER ""
}
########################################################################
# Opens the given file, reads all of its content, and returns it.
proc hwaci-file-content {fname} {
set fp [open $fname r]
set rc [read $fp]
close $fp
return $rc
set fp [open $fname r]
set rc [read $fp]
close $fp
return $rc
}
########################################################################
# Returns the contents of the given file as an array of lines, with
# the EOL stripped from each input line.
proc hwaci-file-content-list {fname} {
set fp [open $fname r]
set rc {}
while { [gets $fp line] >= 0 } {
lappend rc $line
}
return $rc
set fp [open $fname r]
set rc {}
while { [gets $fp line] >= 0 } {
lappend rc $line
}
return $rc
}
########################################################################
@ -308,25 +308,25 @@ proc hwaci-file-content-list {fname} {
# Returns 1 if supported, else 0. Defines MAKE_COMPILATION_DB to "yes"
# if supported, "no" if not.
proc hwaci-check-compile-commands {{configOpt {}}} {
msg-checking "compile_commands.json support... "
if {"" ne $configOpt && [opt-bool $configOpt]} {
msg-result "explicitly disabled"
define MAKE_COMPILATION_DB no
return 0
msg-checking "compile_commands.json support... "
if {"" ne $configOpt && [opt-bool $configOpt]} {
msg-result "explicitly disabled"
define MAKE_COMPILATION_DB no
return 0
} else {
if {[cctest -lang c -cflags {/dev/null -MJ} -source {}]} {
# This test reportedly incorrectly succeeds on one of
# Martin G.'s older systems. drh also reports a false
# positive on an unspecified older Mac system.
msg-result "compiler supports compile_commands.json"
define MAKE_COMPILATION_DB yes
return 1
} else {
if {[cctest -lang c -cflags {/dev/null -MJ} -source {}]} {
# This test reportedly incorrectly succeeds on one of
# Martin G.'s older systems. drh also reports a false
# positive on an unspecified older Mac system.
msg-result "compiler supports compile_commands.json"
define MAKE_COMPILATION_DB yes
return 1
} else {
msg-result "compiler does not support compile_commands.json"
define MAKE_COMPILATION_DB no
return 0
}
msg-result "compiler does not support compile_commands.json"
define MAKE_COMPILATION_DB no
return 0
}
}
}
########################################################################
@ -474,7 +474,7 @@ proc hwaci-check-emsdk {} {
define EMSDK_HOME ""
define EMSDK_ENV ""
define BIN_EMCC ""
# define EMCC_OPT "-Oz"
# define EMCC_OPT "-Oz"
msg-checking "Emscripten SDK? "
if {$emsdkHome eq "" && [info exists ::env(EMSDK)]} {
# Fall back to checking the environment. $EMSDK gets set

View File

@ -1,9 +1,9 @@
C Do\snot\sremove\s*.def\sin\sthe\scleanup\srules\sbecause\sauto.def\sis\sa\srequired\spart\sof\sautosetup.\sRemove\sthe\s.o\svs\s.obj\sdetection/distinction\sbecause\sthe\sUnix-like\sWindows\senvironments\suse\s.o.
D 2024-09-26T14:09:23.248
C Get\slemon\sbuilding.\sRe-indent\shwaci-common.tcl\sfor\sconsistency.
D 2024-09-26T18:40:07.537
F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1
F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea
F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724
F Makefile.in 3806942cc072d2dd09568c530c614dee8274ce2663ba560f7af5271a088d944d
F Makefile.in 9f2eb42f8ace9c686b602f2142325a38417711e3f6aa4355dd904ab21ec77478
F Makefile.linux-gcc f3842a0b1efbfbb74ac0ef60e56b301836d05b4d867d014f714fa750048f1ab6
F Makefile.msc e3c4723c27464acc31da4420b808c8d2690180ba2b915897bece0a9d5d2cecf6
F README.md c3c0f19532ce28f6297a71870f3c7b424729f0e6d9ab889616d3587dd2332159
@ -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 d2d9c2d473a81551ddd29a155c375fa31a068e05b2227862a24a2e84c00a0bdf
F auto.def 32b757ecdb2e2b83190dd160dcff9e508fc97c70f9a59a0fd789cfbf614542f5
F autoconf/INSTALL 83e4a25da9fd053c7b3665eaaaf7919707915903
F autoconf/Makefile.am adedc1324b6a87fdd1265ddd336d2fb7d4f36a0e77b86ea553ae7cc4ea239347
F autoconf/Makefile.fallback 22fe523eb36dfce31e0f6349f782eb084e86a5620b2b0b4f84a2d6133f53f5ac
@ -46,7 +46,7 @@ F autosetup/cc-lib.tcl 493c5935b5dd3bf9bd4eca89b07c8b1b1a9356d61783035144e21795f
F autosetup/cc-shared.tcl 4f024e94a47f427ba61de1739f6381ef0080210f9fae89112d5c1de1e5460d78
F autosetup/cc.tcl 1b52de228642c1db5a714d54ca974d723ec8b4092e8c3765d348b625850f7311
F autosetup/default.auto 5cdf016de2140e50f1db190a02039dc42fb390af1dda4cc4853e3042a9ef0e82
F autosetup/hwaci-common.tcl a112327a1eb29e3d32670e25a464832abb73f028b679a5433c4630446ca76b56
F autosetup/hwaci-common.tcl 087bcd8ec711da2d3e1c3ede32903e45062ffd148b71f28d59e0c5fda0060ef6
F autosetup/jimsh0.c 1b5fe91fffcddbc29f2b16acb80f1650632ea2edbe8336b8155ef7b4c66f6d8d
F autosetup/pkg-config.tcl 4e635bf39022ff65e0d5434339dd41503ea48fc53822c9c5bde88b02d3d952ba
F autosetup/system.tcl 3a39d6e0b3bfba526fd39afe07c1d0d325e5a31925013a1ba7c671e1128e31bb
@ -2233,8 +2233,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 7638f3ad1588ff16c2980763c6c4c1386a711acd64adb21c465f186a47bc975d
R dd990ac14aacc7aef84cea962548e6de
P 65eb1072e297f01ba4ce21fe644f709e75ebaec5307764b549efceafb88f6ebf
R ad341b1fb26f2538d3ce63a52f00cd0b
U stephan
Z 5264d306ffd6b34f18c75d08cd8d2866
Z 949a6a7cca5b4eb8a6b3e740c1f5b1b4
# Remove this line to create a well-formed Fossil manifest.

View File

@ -1 +1 @@
65eb1072e297f01ba4ce21fe644f709e75ebaec5307764b549efceafb88f6ebf
53dc33d5e20062e8c4c9856349bbc143c858327ef41f356ffcc574b36d0cc73c