diff --git a/Makefile.in b/Makefile.in index 0e026097f8..60dfbd13a1 100644 --- a/Makefile.in +++ b/Makefile.in @@ -118,23 +118,23 @@ RELEASE = @RELEASE@ BEXE = @BUILD_EXEEXT@ TEXE = @TARGET_EXEEXT@ -#XX## The following variable is "1" if the configure script was able to locate -#XX## the tclConfig.sh file. It is an empty string otherwise. When this -#XX## variable is "1", the TCL extension library (libtclsqlite3.so) is built -#XX## and installed. -#XX## -#XX#HAVE_TCL = @HAVE_TCL@ -#XX# -#XX## This is the command to use for tclsh - normally just "tclsh", but we may -#XX## know the specific version we want to use -#XX## -#XX#TCLSH_CMD = @TCLSH_CMD@ -#XX# -#XX## Additional options when running tests using testrunner.tcl -#XX## This is usually either blank, or else --status -#XX## -TSTRNNR_OPTS = @TSTRNNR_OPTS@ +# The following variable is "1" if the configure script was able to locate +# the tclConfig.sh file. It is an empty string otherwise. When this +# variable is "1", the TCL extension library (libtclsqlite3.so) is built +# and installed. # +HAVE_TCL = @HAVE_TCL@ + +# This is the command to use for tclsh - normally just "tclsh", but we may +# know the specific version we want to use +# +TCLSH_CMD = @TCLSH_CMD@ + +# Additional options when running tests using testrunner.tcl +# This is usually either blank, or else --status +# +TSTRNNR_OPTS = @TSTRNNR_OPTS@ + #XX## Where do we want to install the tcl plugin #XX## #XX#TCLLIBDIR = @TCLLIBDIR@ @@ -181,8 +181,16 @@ INSTALL = @BIN_INSTALL@ # You should not have to change anything below this line ################################################################################ # + +# Vars with the AS_ prefix are specifically related to AutoSetup. +# +# AS_AUTO_DEF is the main configure script. +# +AS_AUTO_DEF = $(TOP)/auto.def + USE_AMALGAMATION = @USE_AMALGAMATION@ AMALGAMATION_LINE_MACROS = @AMALGAMATION_LINE_MACROS@ + # #XX## Object files for the SQLite library (non-amalgamation). #XX## @@ -674,23 +682,36 @@ SQLITE3_SHELL_TARGET = $(SQLITE3_SHELL_TARGET_@HAVE_WASI_SDK@) SQLITE3_O = $(TOP)/sqlite3.o -#XX## Use $(libtclsqlite3.la_$(HAVE_TCL)) to resolve to either -#XX## libtclsqlite3.la or an empty value. -#XX#libtclsqlite3.la_0 = -#XX#libtclsqlite3.la_1 = libtclsqlite3.la -#XX# -#XX## This is the default Makefile target. The objects listed here -#XX## are what get build when you type just "make" with no arguments. -#XX## -#XX#all: sqlite3.h libsqlite3.la $(SQLITE3_SHELL_TARGET) \ +# Use $(libtclsqlite3.la_$(HAVE_TCL)) to resolve to either +# libtclsqlite3.la or an empty value. +libtclsqlite3.la_0 = +libtclsqlite3.la_1 = libtclsqlite3.la +# +# 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 +#all: libsqlite3.la $(SQLITE3_SHELL_TARGET) \ #XX# $(libtclsqlite3.la_$(HAVE_TCL)) -#XX# -#XX#Makefile: $(TOP)/Makefile.in -#XX# ./config.status -#XX# -#XX#sqlite3.pc: $(TOP)/sqlite3.pc.in -#XX# ./config.status -#XX# + +# Re-run $(TOP)/configure with the same args invoked to produce this +# makefile. +# +AUTOREMAKE = @SQLITE_AUTOREMAKE@ + +Makefile: $(TOP)/Makefile.in + $(AUTOREMAKE) + @touch $@ + +sqlite3.pc: $(TOP)/sqlite3.pc.in + $(AUTOREMAKE) + @touch $@ + +sqlite_cfg.h: $(TOP)/sqlite_cfg.h.in $(AS_AUTO_DEF) + $(AUTOREMAKE) + @touch $@ + #XX#libsqlite3.la: $(LIBOBJ) #XX# $(LTLINK) -no-undefined -o $@ $(LIBOBJ) $(TLIBS) \ #XX# ${ALLOWRELEASE} -rpath "$(libdir)" -version-info "8:6:8" @@ -731,14 +752,14 @@ SQLITE3_O = $(TOP)/sqlite3.o #XX# $(LTLINK) -o $@ -I. -DSCRUB_STANDALONE \ #XX# $(TOP)/ext/misc/scrub.c sqlite3.lo $(TLIBS) #XX# -#XX#srcck1$(BEXE): $(TOP)/tool/srcck1.c -#XX# $(BCC) -o srcck1$(BEXE) $(TOP)/tool/srcck1.c -#XX# -#XX#sourcetest: srcck1$(BEXE) sqlite3.c -#XX# ./srcck1 sqlite3.c -#XX# -#XX#src-verify: $(TOP)/tool/src-verify.c -#XX# $(BCC) -o src-verify$(BEXE) $(TOP)/tool/src-verify.c +srcck1$(BEXE): $(TOP)/tool/srcck1.c + $(BCC) -o srcck1$(BEXE) $(TOP)/tool/srcck1.c + +sourcetest: srcck1$(BEXE) sqlite3.c + ./srcck1 sqlite3.c + +src-verify: $(TOP)/tool/src-verify.c + $(BCC) -o src-verify$(BEXE) $(TOP)/tool/src-verify.c #XX# #XX#verify-source: ./src-verify #XX# ./src-verify $(TOP) @@ -830,52 +851,52 @@ SQLITE3_O = $(TOP)/sqlite3.o #XX# $(MPTEST2) --journalmode DELETE #XX# #XX# -#XX#has_tclsh84: -#XX# sh $(TOP)/tool/cktclsh.sh 8.4 $(TCLSH_CMD) -#XX# touch has_tclsh84 -#XX# -#XX#has_tclsh85: -#XX# sh $(TOP)/tool/cktclsh.sh 8.5 $(TCLSH_CMD) -#XX# touch has_tclsh85 -#XX# +has_tclsh84: + sh $(TOP)/tool/cktclsh.sh 8.4 $(TCLSH_CMD) + touch has_tclsh84 + +has_tclsh85: + sh $(TOP)/tool/cktclsh.sh 8.5 $(TCLSH_CMD) + touch has_tclsh85 + #XX#has_tclconfig: #XX# @ if test x"$(HAVE_TCL)" != "x1"; then echo 'ERROR: Requires access to "tclConfig.sh" which "configure" was not able to locate'; exit 1; fi #XX# touch has_tclconfig #XX# #XX# -#XX## This target creates a directory named "tsrc" and fills it with -#XX## copies of all of the C source code and header files needed to -#XX## build on the target system. Some of the C source code and header -#XX## files are automatically generated. This target takes care of -#XX## all that automatic generation. -#XX## -#XX#.target_source: $(SRC) $(TOP)/tool/vdbe-compress.tcl has_tclsh84 fts5.c -#XX# rm -rf tsrc -#XX# mkdir tsrc -#XX# cp -f $(SRC) tsrc -#XX# rm tsrc/sqlite.h.in tsrc/parse.y -#XX# $(TCLSH_CMD) $(TOP)/tool/vdbe-compress.tcl $(OPTS) vdbe.new -#XX# mv vdbe.new tsrc/vdbe.c -#XX# cp fts5.c fts5.h tsrc -#XX# touch .target_source -#XX# -#XX#sqlite3.c: .target_source $(TOP)/tool/mksqlite3c.tcl src-verify has_tclsh84 -#XX# $(TCLSH_CMD) $(TOP)/tool/mksqlite3c.tcl $(AMALGAMATION_LINE_MACROS) $(EXTRA_SRC) -#XX# cp tsrc/sqlite3ext.h . -#XX# cp $(TOP)/ext/session/sqlite3session.h . -#XX# -#XX#sqlite3r.h: sqlite3.h has_tclsh84 -#XX# $(TCLSH_CMD) $(TOP)/tool/mksqlite3h.tcl $(TOP) --enable-recover >sqlite3r.h -#XX# -#XX#sqlite3r.c: sqlite3.c sqlite3r.h has_tclsh84 -#XX# cp $(TOP)/ext/recover/sqlite3recover.c tsrc/ -#XX# cp $(TOP)/ext/recover/sqlite3recover.h tsrc/ -#XX# cp $(TOP)/ext/recover/dbdata.c tsrc/ -#XX# $(TCLSH_CMD) $(TOP)/tool/mksqlite3c.tcl --enable-recover $(AMALGAMATION_LINE_MACROS) $(EXTRA_SRC) -#XX# -#XX#sqlite3ext.h: .target_source -#XX# cp tsrc/sqlite3ext.h . -#XX# +# This target creates a directory named "tsrc" and fills it with +# copies of all of the C source code and header files needed to +# build on the target system. Some of the C source code and header +# files are automatically generated. This target takes care of +# all that automatic generation. +# +.target_source: $(SRC) $(TOP)/tool/vdbe-compress.tcl has_tclsh84 fts5.c + rm -rf tsrc + mkdir tsrc + cp -f $(SRC) tsrc + rm tsrc/sqlite.h.in tsrc/parse.y + $(TCLSH_CMD) $(TOP)/tool/vdbe-compress.tcl $(OPTS) vdbe.new + mv vdbe.new tsrc/vdbe.c + cp fts5.c fts5.h tsrc + touch .target_source + +sqlite3.c: .target_source $(TOP)/tool/mksqlite3c.tcl src-verify has_tclsh84 + $(TCLSH_CMD) $(TOP)/tool/mksqlite3c.tcl $(AMALGAMATION_LINE_MACROS) $(EXTRA_SRC) + cp tsrc/sqlite3ext.h . + cp $(TOP)/ext/session/sqlite3session.h . + +sqlite3r.h: sqlite3.h has_tclsh84 + $(TCLSH_CMD) $(TOP)/tool/mksqlite3h.tcl $(TOP) --enable-recover >sqlite3r.h + +sqlite3r.c: sqlite3.c sqlite3r.h has_tclsh84 + cp $(TOP)/ext/recover/sqlite3recover.c tsrc/ + cp $(TOP)/ext/recover/sqlite3recover.h tsrc/ + cp $(TOP)/ext/recover/dbdata.c tsrc/ + $(TCLSH_CMD) $(TOP)/tool/mksqlite3c.tcl --enable-recover $(AMALGAMATION_LINE_MACROS) $(EXTRA_SRC) + +sqlite3ext.h: .target_source + cp tsrc/sqlite3ext.h . + #XX#tclsqlite3.c: sqlite3.c #XX# echo '#ifndef USE_SYSTEM_SQLITE' >tclsqlite3.c #XX# cat sqlite3.c >>tclsqlite3.c @@ -898,12 +919,15 @@ lemon$(BEXE): $(TOP)/tool/lemon.c $(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## -#XX#mksourceid$(BEXE): $(TOP)/tool/mksourceid.c -#XX# $(BCC) -o $@ $(TOP)/tool/mksourceid.c -#XX# + +# Rules to build the program that generates the source-id +# +mksourceid$(BEXE): $(TOP)/tool/mksourceid.c + $(BCC) -o $@ $(TOP)/tool/mksourceid.c +@if BUILD_EXEEXT ne "" +mksourceid: mksourceid$(BEXE) +@endif + #XX## Rules to build individual *.o files from generated *.c files. This #XX## applies to: #XX## @@ -1170,71 +1194,71 @@ lemon: lemon$(BEXE) #XX#tclsqlite3$(TEXE): has_tclconfig tclsqlite-shell.lo libsqlite3.la #XX# $(LTLINK) -o $@ tclsqlite-shell.lo \ #XX# libsqlite3.la $(LIBTCL) -#XX# -#XX## Rules to build opcodes.c and opcodes.h -#XX## -#XX#opcodes.c: opcodes.h $(TOP)/tool/mkopcodec.tcl has_tclsh84 -#XX# $(TCLSH_CMD) $(TOP)/tool/mkopcodec.tcl opcodes.h >opcodes.c -#XX# -#XX#opcodes.h: parse.h $(TOP)/src/vdbe.c $(TOP)/tool/mkopcodeh.tcl has_tclsh84 -#XX# cat parse.h $(TOP)/src/vdbe.c | $(TCLSH_CMD) $(TOP)/tool/mkopcodeh.tcl >opcodes.h -#XX# -#XX## Rules to build parse.c and parse.h - the outputs of lemon. -#XX## -#XX#parse.h: parse.c -#XX# -#XX#parse.c: $(TOP)/src/parse.y lemon$(BEXE) -#XX# cp $(TOP)/src/parse.y . -#XX# ./lemon$(BEXE) $(OPT_FEATURE_FLAGS) $(OPTS) -S parse.y -#XX# -#XX#sqlite3.h: $(TOP)/src/sqlite.h.in $(TOP)/manifest mksourceid$(BEXE) $(TOP)/VERSION has_tclsh84 -#XX# $(TCLSH_CMD) $(TOP)/tool/mksqlite3h.tcl $(TOP) >sqlite3.h -#XX# + +# Rules to build opcodes.c and opcodes.h +# +opcodes.c: opcodes.h $(TOP)/tool/mkopcodec.tcl has_tclsh84 + $(TCLSH_CMD) $(TOP)/tool/mkopcodec.tcl opcodes.h >opcodes.c + +opcodes.h: parse.h $(TOP)/src/vdbe.c $(TOP)/tool/mkopcodeh.tcl has_tclsh84 + cat parse.h $(TOP)/src/vdbe.c | $(TCLSH_CMD) $(TOP)/tool/mkopcodeh.tcl >opcodes.h + +# Rules to build parse.c and parse.h - the outputs of lemon. +# +parse.h: parse.c + +parse.c: $(TOP)/src/parse.y lemon$(BEXE) + cp $(TOP)/src/parse.y . + ./lemon$(BEXE) $(OPT_FEATURE_FLAGS) $(OPTS) -S parse.y + +sqlite3.h: $(TOP)/src/sqlite.h.in $(TOP)/manifest mksourceid$(BEXE) $(TOP)/VERSION has_tclsh84 + $(TCLSH_CMD) $(TOP)/tool/mksqlite3h.tcl $(TOP) >sqlite3.h + #XX#sqlite3rc.h: $(TOP)/src/sqlite3.rc $(TOP)/VERSION has_tclsh84 #XX# echo '#ifndef SQLITE_RESOURCE_VERSION' >$@ #XX# echo -n '#define SQLITE_RESOURCE_VERSION ' >>$@ #XX# cat $(TOP)/VERSION | $(TCLSH_CMD) $(TOP)/tool/replace.tcl exact . , >>$@ #XX# echo '#endif' >>sqlite3rc.h -#XX# -#XX#keywordhash.h: $(TOP)/tool/mkkeywordhash.c -#XX# $(BCC) -o mkkeywordhash$(BEXE) $(OPT_FEATURE_FLAGS) $(OPTS) $(TOP)/tool/mkkeywordhash.c -#XX# ./mkkeywordhash$(BEXE) >keywordhash.h -#XX# -#XX## Source and header files that shell.c depends on -#XX#SHELL_DEP = \ -#XX# $(TOP)/src/shell.c.in \ -#XX# $(TOP)/ext/consio/console_io.c \ -#XX# $(TOP)/ext/consio/console_io.h \ -#XX# $(TOP)/ext/expert/sqlite3expert.c \ -#XX# $(TOP)/ext/expert/sqlite3expert.h \ -#XX# $(TOP)/ext/intck/sqlite3intck.c \ -#XX# $(TOP)/ext/intck/sqlite3intck.h \ -#XX# $(TOP)/ext/misc/appendvfs.c \ -#XX# $(TOP)/ext/misc/base64.c \ -#XX# $(TOP)/ext/misc/base85.c \ -#XX# $(TOP)/ext/misc/completion.c \ -#XX# $(TOP)/ext/misc/decimal.c \ -#XX# $(TOP)/ext/misc/fileio.c \ -#XX# $(TOP)/ext/misc/ieee754.c \ -#XX# $(TOP)/ext/misc/memtrace.c \ -#XX# $(TOP)/ext/misc/pcachetrace.c \ -#XX# $(TOP)/ext/misc/percentile.c \ -#XX# $(TOP)/ext/misc/regexp.c \ -#XX# $(TOP)/ext/misc/series.c \ -#XX# $(TOP)/ext/misc/sha1.c \ -#XX# $(TOP)/ext/misc/shathree.c \ -#XX# $(TOP)/ext/misc/sqlar.c \ -#XX# $(TOP)/ext/misc/uint.c \ -#XX# $(TOP)/ext/misc/vfstrace.c \ -#XX# $(TOP)/ext/misc/zipfile.c \ -#XX# $(TOP)/ext/recover/dbdata.c \ -#XX# $(TOP)/ext/recover/sqlite3recover.c \ -#XX# $(TOP)/ext/recover/sqlite3recover.h \ -#XX# $(TOP)/src/test_windirent.c \ -#XX# $(TOP)/src/test_windirent.h -#XX# -#XX#shell.c: $(SHELL_DEP) $(TOP)/tool/mkshellc.tcl has_tclsh84 -#XX# $(TCLSH_CMD) $(TOP)/tool/mkshellc.tcl >shell.c + +keywordhash.h: $(TOP)/tool/mkkeywordhash.c + $(BCC) -o mkkeywordhash$(BEXE) $(OPT_FEATURE_FLAGS) $(OPTS) $(TOP)/tool/mkkeywordhash.c + ./mkkeywordhash$(BEXE) >keywordhash.h + +# Source and header files that shell.c depends on +SHELL_DEP = \ + $(TOP)/src/shell.c.in \ + $(TOP)/ext/consio/console_io.c \ + $(TOP)/ext/consio/console_io.h \ + $(TOP)/ext/expert/sqlite3expert.c \ + $(TOP)/ext/expert/sqlite3expert.h \ + $(TOP)/ext/intck/sqlite3intck.c \ + $(TOP)/ext/intck/sqlite3intck.h \ + $(TOP)/ext/misc/appendvfs.c \ + $(TOP)/ext/misc/base64.c \ + $(TOP)/ext/misc/base85.c \ + $(TOP)/ext/misc/completion.c \ + $(TOP)/ext/misc/decimal.c \ + $(TOP)/ext/misc/fileio.c \ + $(TOP)/ext/misc/ieee754.c \ + $(TOP)/ext/misc/memtrace.c \ + $(TOP)/ext/misc/pcachetrace.c \ + $(TOP)/ext/misc/percentile.c \ + $(TOP)/ext/misc/regexp.c \ + $(TOP)/ext/misc/series.c \ + $(TOP)/ext/misc/sha1.c \ + $(TOP)/ext/misc/shathree.c \ + $(TOP)/ext/misc/sqlar.c \ + $(TOP)/ext/misc/uint.c \ + $(TOP)/ext/misc/vfstrace.c \ + $(TOP)/ext/misc/zipfile.c \ + $(TOP)/ext/recover/dbdata.c \ + $(TOP)/ext/recover/sqlite3recover.c \ + $(TOP)/ext/recover/sqlite3recover.h \ + $(TOP)/src/test_windirent.c \ + $(TOP)/src/test_windirent.h + +shell.c: $(SHELL_DEP) $(TOP)/tool/mkshellc.tcl has_tclsh84 + $(TCLSH_CMD) $(TOP)/tool/mkshellc.tcl >shell.c #XX# #XX# #XX# @@ -1294,37 +1318,37 @@ lemon: lemon$(BEXE) #XX# #XX#stmt.lo: $(TOP)/ext/misc/stmt.c #XX# $(LTCOMPILE) -DSQLITE_CORE -c $(TOP)/ext/misc/stmt.c -#XX# -#XX## FTS5 things -#XX## -#XX#FTS5_SRC = \ -#XX# $(TOP)/ext/fts5/fts5.h \ -#XX# $(TOP)/ext/fts5/fts5Int.h \ -#XX# $(TOP)/ext/fts5/fts5_aux.c \ -#XX# $(TOP)/ext/fts5/fts5_buffer.c \ -#XX# $(TOP)/ext/fts5/fts5_main.c \ -#XX# $(TOP)/ext/fts5/fts5_config.c \ -#XX# $(TOP)/ext/fts5/fts5_expr.c \ -#XX# $(TOP)/ext/fts5/fts5_hash.c \ -#XX# $(TOP)/ext/fts5/fts5_index.c \ -#XX# fts5parse.c fts5parse.h \ -#XX# $(TOP)/ext/fts5/fts5_storage.c \ -#XX# $(TOP)/ext/fts5/fts5_tokenize.c \ -#XX# $(TOP)/ext/fts5/fts5_unicode2.c \ -#XX# $(TOP)/ext/fts5/fts5_varint.c \ -#XX# $(TOP)/ext/fts5/fts5_vocab.c \ -#XX# -#XX#fts5parse.c: $(TOP)/ext/fts5/fts5parse.y lemon$(BEXE) -#XX# cp $(TOP)/ext/fts5/fts5parse.y . -#XX# rm -f fts5parse.h -#XX# ./lemon$(BEXE) $(OPTS) -S fts5parse.y -#XX# -#XX#fts5parse.h: fts5parse.c -#XX# -#XX#fts5.c: $(FTS5_SRC) has_tclsh84 -#XX# $(TCLSH_CMD) $(TOP)/ext/fts5/tool/mkfts5c.tcl -#XX# cp $(TOP)/ext/fts5/fts5.h . -#XX# + +# FTS5 things +# +FTS5_SRC = \ + $(TOP)/ext/fts5/fts5.h \ + $(TOP)/ext/fts5/fts5Int.h \ + $(TOP)/ext/fts5/fts5_aux.c \ + $(TOP)/ext/fts5/fts5_buffer.c \ + $(TOP)/ext/fts5/fts5_main.c \ + $(TOP)/ext/fts5/fts5_config.c \ + $(TOP)/ext/fts5/fts5_expr.c \ + $(TOP)/ext/fts5/fts5_hash.c \ + $(TOP)/ext/fts5/fts5_index.c \ + fts5parse.c fts5parse.h \ + $(TOP)/ext/fts5/fts5_storage.c \ + $(TOP)/ext/fts5/fts5_tokenize.c \ + $(TOP)/ext/fts5/fts5_unicode2.c \ + $(TOP)/ext/fts5/fts5_varint.c \ + $(TOP)/ext/fts5/fts5_vocab.c \ + +fts5parse.c: $(TOP)/ext/fts5/fts5parse.y lemon$(BEXE) + cp $(TOP)/ext/fts5/fts5parse.y . + rm -f fts5parse.h + ./lemon$(BEXE) $(OPTS) -S fts5parse.y + +fts5parse.h: fts5parse.c + +fts5.c: $(FTS5_SRC) has_tclsh84 + $(TCLSH_CMD) $(TOP)/ext/fts5/tool/mkfts5c.tcl + cp $(TOP)/ext/fts5/fts5.h . + #XX#fts5.lo: fts5.c $(HDR) $(EXTHDR) #XX# $(LTCOMPILE) -DSQLITE_CORE -c fts5.c #XX# diff --git a/auto.def b/auto.def index 858044eb99..4b81ce9f16 100644 --- a/auto.def +++ b/auto.def @@ -30,8 +30,8 @@ define cross_compiling ${cross_compiling} # options { with-debug:=1 => {Enable debug build flags} - with-tclsh:PATHNAME => {Full pathname of tclsh to use} - with-tcl:DIR => {Directory containing tclConfig.sh} + with-tclsh: => {Full pathname of tclsh to use} + with-tcl: => {Directory containing tclConfig.sh} tcl=1 => {Disable building accessory programs that require TCL-dev} test-status => {Enable status of tests} threadsafe=1 => {Disable mutexing} @@ -66,7 +66,9 @@ options { } set srcdir $autosetup(srcdir) -#puts "srcdir = $srcdir" +set top_srcdir [get-define abs_top_srcdir] +puts "srcdir = $srcdir" +puts "top_srcdir = $top_srcdir" set RELEASE [readfile $autosetup(srcdir)/VERSION] regsub {([0-9]*\.*[0-9]*).*} $RELEASE {\1} VERSION define VERSION $VERSION @@ -74,6 +76,9 @@ define RELEASE $RELEASE puts "RELEASE = $RELEASE" puts "VERSION = $VERSION" +define SQLITE_AUTOREMAKE cd +define-append SQLITE_AUTOREMAKE $autosetup(srcdir) && $top_srcdir/configure {*}$autosetup(argv) + set outOfTreeBuild 0 if {![file exists sqlite3.pc.in]} { puts "This appears to be an out-of-tree build." @@ -258,7 +263,12 @@ undefine lib_fdatasync ######### # Check for needed/wanted headers -cc-check-includes sys/types.h stdlib.h stdint.h inttypes.h malloc.h +cc-check-includes \ + sys/types.h sys/stat.h dlfcn.h unistd.h \ + stdlib.h malloc.h memory.h \ + string.h strings.h \ + stdint.h inttypes.h + if {[cc-check-includes zlib.h] && [cc-check-function-in-lib deflate z]} { # TODO: port over the more sophisticated zlib search from the fossil auto.def define HAVE_ZLIB 1; # "-DSQLITE_HAVE_ZLIB=1" @@ -292,39 +302,55 @@ if {1} { # Also TODO is figure out whether we can use jimtcl for our internal # build-tool uses (as opposed to testing purposes, which requires # the tcl SQLite module). - if {![cc-path-progs tclsh]} { - user-error "Cannot find tclsh" + set tclsh [hwaci-first-bin-of tclsh8.6 tclsh tclsh9.0] + if {"" eq $tclsh} { + user-error "Cannot find tclsh, which is required to build certain files." } + define TCLSH_CMD $tclsh + define HAVE_TCL 0 ; # until the following elseif block is ported } elseif {0} { + # Porting this section of configure.ac is going to be a bit of a slog... + set tEnable [hwaci-opt-truthy tcl] + set use_tcl $tEnable + set tclsh "" + #set original_use_tcl ${use_tcl} ######### # Figure out all the name of a working tclsh and parameters needed to compile against Tcl. # The --with-tcl= and/or --with-tclsh= configuration arguments might be useful for this. # # XXX AC_ARG_WITH tclsh AS_HELP_STRING([--with-tclsh=PATHNAME],[full pathname of a tclsh to use]) # XXX AC_ARG_WITH tcl AS_HELP_STRING([--with-tcl=DIR],[directory containing (tclConfig.sh)]) - # if {![opt-bool tcl]} { - # set use_tcl $enableval - # } else { - # set use_tcl yes - # } - #set original_use_tcl ${use_tcl} - # XXX if test x"${with_tclsh}" == x -a x"${with_tcl}" == x; then - # XXX AC_CHECK_PROGS TCLSH_CMD tclsh8.6 tclsh tclsh9.0 none - #set with_tclsh ${TCLSH_CMD} - # XXX fi - # XXX if test x"${with_tclsh}" != x -a x"${with_tclsh}" != xnone; then - # XXX TCLSH_CMD=${with_tclsh} - #msg-result "using tclsh at \"$TCLSH_CMD\"" - # XXX if test x"${use_tcl}" = "xyes"; then - #set with_tcl `${with_tclsh} <${srcdir}/tool/find_tclconfig.tcl` - # XXX if test x"${with_tcl}" != x; then - #msg-result "$TCLSH_CMD recommends the tclConfig.sh at ${with_tcl}" - # XXX else - #msg-result Warning: "$TCLSH_CMD is unable to recommend a tclConfig.sh" - #set use_tcl no - # XXX fi - # XXX fi - # XXX fi + set with_tclsh [opt-val with-tclsh] + set with_tcl [opt-val with-tcl] + + if {"" eq $with_tclsh && "" eq $with_tcl} { + # XXX if test x"${with_tclsh}" == x -a x"${with_tcl}" == x; then + # XXX AC_CHECK_PROGS TCLSH_CMD tclsh8.6 tclsh tclsh9.0 none + #set with_tclsh ${TCLSH_CMD} + # XXX fi + set with_tclsh [hwaci-first-bin-of tclsh8.6 tclsh tclsh9.0] + } + + if {"" ne $with_tclsh } { + # XXX if test x"${with_tclsh}" != x -a x"${with_tclsh}" != xnone; then + # XXX TCLSH_CMD=${with_tclsh} + set tclsh $with_tclsh + puts "using tclsh at \"$tclsh\"" + if {$use_tcl} { + # XXX if test x"${use_tcl}" = "xyes"; then + #set with_tcl `${with_tclsh} <${srcdir}/tool/find_tclconfig.tcl` + # XXX if test x"${with_tcl}" != x; then + #msg-result "$TCLSH_CMD recommends the tclConfig.sh at ${with_tcl}" + # XXX else + #msg-result Warning: "$TCLSH_CMD is unable to recommend a tclConfig.sh" + #set use_tcl no + # XXX fi + # XXX fi + } + # XXX fi + } + + # XXX if test x"${use_tcl}" = "xyes"; then # XXX if test x"${with_tcl}" != x; then # XXX if test -r ${with_tcl}/tclConfig.sh; then @@ -414,7 +440,9 @@ if {1} { # XXX done # XXX TCLLIBDIR="${TCLLIBDIR}/sqlite3" # XXX fi -} + + unset tEnable with_tclsh with_tcl +}; # end of tcl msg-checking "Support threadsafe operation? " @@ -744,24 +772,28 @@ foreach {boolFlag featureFlag ifSetEvalThis} { define ENABLE_SHARED $enable_shared +if {1} { + # for sqlite_cfg.h + define PACKAGE_URL {https://sqlite.org} + define PACKAGE_VERSION [get-define VERSION] +} + ######### # Generate the output files. # if {1} { - # mystery: why are defines (srcdir, top_srcdir) both absolute when emitted - # from make-config-header but relative when emitted via make-template? - hwaci-make-from-dot-in Makefile hwaci-make-from-dot-in sqlite3.pc - #hwaci-make-from-dot-in ext/wasm/GNUmakefile - if {0} { - # output from make-config-header is not quite the same as that from the - # autotools. We may need to write a custom replacement. - # hwaci-make-from-dot-in sqlite_cfg.h - # make-config-header sqlite_cfg.h -bare {SIZEOF_* HAVE_DECL_*} -auto HAVE_* -none * - # make-config-header sqlite_cfg.h -bare {SIZEOF_* HAVE_*} -none * - # make-config-header sqlite_cfg.h + # hwaci-make-from-dot-in sqlite_cfg.h + if {1} { + hwaci-make-from-dot-in sqlite_cfg.h + } else { + make-config-header -bare {SIZEOF_* HAVE_DECL_*} \ + -auto {HAVE_* PACKAGE_*} -none * } + # make-config-header sqlite_cfg.h -bare {SIZEOF_* HAVE_*} -none * + # make-config-header sqlite_cfg.h + #hwaci-make-from-dot-in ext/wasm/GNUmakefile } set oFF [get-define OPT_FEATURE_FLAGS] diff --git a/autosetup/hwaci-common.tcl b/autosetup/hwaci-common.tcl index 570fbf4a84..29c7c3da81 100644 --- a/autosetup/hwaci-common.tcl +++ b/autosetup/hwaci-common.tcl @@ -95,6 +95,19 @@ proc hwaci-bin-define {binName {defName {}}} { return $check } +######################################################################## +# Each argument is passed to cc-path-progs. If that function returns +# true, the full path to that binary is returned. If no matches are +# found, "" is returned. +proc hwaci-first-bin-of {args} { + foreach b $args { + if {[cc-path-progs $b]} { + return [get-define [string toupper $b]] + } + } + return "" +} + ######################################################################## # Looks for `bash` binary and dies if not found. On success, defines # BIN_BASH to the full path to bash and returns that value. We diff --git a/manifest b/manifest index 76a18386e7..4f7bc2d529 100644 --- a/manifest +++ b/manifest @@ -1,9 +1,9 @@ -C Re-indent\ssome\stcl\scode. -D 2024-09-26T21:09:22.501 +C Get\sthe\sgenerated\s.c/.h\sfiles\sgenerating. +D 2024-09-27T01:00:32.301 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724 -F Makefile.in 9f2eb42f8ace9c686b602f2142325a38417711e3f6aa4355dd904ab21ec77478 +F Makefile.in baef1f3e06a77386d0ec33ad3f220656b8987e876fb821c03332e4888f43bf07 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 32b757ecdb2e2b83190dd160dcff9e508fc97c70f9a59a0fd789cfbf614542f5 +F auto.def dfd9fca19386af90ef9a32b3e6428e9c868fe5b98bec2a5d46bf397617d86b5d 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 ed4b9197d06dce03938e9f0b59a0d605a37761f23098b8c63fc581c5c0eda1ef +F autosetup/hwaci-common.tcl e47d127a33de5729ebcc0fd83a6e09c332b1867b43abdb90a0da76bdc536cfee F autosetup/jimsh0.c 1b5fe91fffcddbc29f2b16acb80f1650632ea2edbe8336b8155ef7b4c66f6d8d F autosetup/pkg-config.tcl 4e635bf39022ff65e0d5434339dd41503ea48fc53822c9c5bde88b02d3d952ba F autosetup/system.tcl 3a39d6e0b3bfba526fd39afe07c1d0d325e5a31925013a1ba7c671e1128e31bb @@ -717,7 +717,7 @@ F spec.template 86a4a43b99ebb3e75e6b9a735d5fd293a24e90ca F sqlite.pc.in 42b7bf0d02e08b9e77734a47798d1a55a9e0716b F sqlite3.1 acdff36db796e2d00225b911d3047d580cd136547298435426ce9d40347973cc F sqlite3.pc.in 48fed132e7cb71ab676105d2a4dc77127d8c1f3a -F sqlite_cfg.h.in baf2e409c63d4e7a765e17769b6ff17c5a82bbd9cbf1e284fd2e4cefaff3fcf2 +F sqlite_cfg.h.in e820a04b0ea3da638858927513f5ac8a5e8b9a822b531ebfeeac32a2fa396dcd F src/alter.c aa93e37e4a36a0525bbb2a2aeda20d2018f0aa995542c7dc658e031375e3f532 F src/analyze.c 30bf40ec4208ead9e977bec017bccc8a9681820936e38ca5a4a7443100a6d5c5 F src/attach.c 08235ab62ed5ccc93c22bf36e640d19effcd632319615851bccf724ec9341333 @@ -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 feea65bcd54f9266445bc4d65ea5e3cfadee8e3abff5b682e31cdc0034354fbf -R 43bb192919b9c029a6389c0f03cc26a7 +P 34ea629a07bfb00c86df7c62462bf2d699347c34dcb7656c86f5f76b52d33b30 +R 8ff7b530b7faebb0e1dc044ed295782f U stephan -Z d85ef6beb4955ef9438b7cb0c396c13b +Z bb9da4d7a0fa389697e835ecfc66d9c6 # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index adfff17c71..b1a12a15ba 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -34ea629a07bfb00c86df7c62462bf2d699347c34dcb7656c86f5f76b52d33b30 +e890c8508da4e126f43c61f809f750d6cb2d7d01600fe2173fbcd7dabbfce0fd diff --git a/sqlite_cfg.h.in b/sqlite_cfg.h.in index 3adea09936..8a6b5cc7a3 100644 --- a/sqlite_cfg.h.in +++ b/sqlite_cfg.h.in @@ -1,134 +1,179 @@ -/* sqlite_cfg.h.in. Generated from configure.ac by autoheader. */ +/* sqlite_cfg.h.in - autosetup input template for sqlite_cfg.h. */ /* Define to 1 if you have the header file. */ -#undef HAVE_DLFCN_H +/*#undef HAVE_DLFCN_H*/ +@if HAVE_DLFCN_H +#define HAVE_DLFCN_H @HAVE_DLFCN_H@ +@endif /* Define to 1 if you have the `fdatasync' function. */ -#undef HAVE_FDATASYNC +/*#undef HAVE_FDATASYNC*/ +#define HAVE_FDATASYNC @HAVE_FDATASYNC@ /* Define to 1 if you have the `gmtime_r' function. */ -#undef HAVE_GMTIME_R +/*#undef HAVE_GMTIME_R*/ +#define HAVE_GMTIME_R @HAVE_GMTIME_R@ /* Define to 1 if the system has the type `int16_t'. */ -#undef HAVE_INT16_T +/*#undef HAVE_INT16_T*/ +#define HAVE_INT16_T @HAVE_INT16_T@ /* Define to 1 if the system has the type `int32_t'. */ -#undef HAVE_INT32_T +/*#undef HAVE_INT32_T*/ +#define HAVE_INT32_T @HAVE_INT32_T@ /* Define to 1 if the system has the type `int64_t'. */ -#undef HAVE_INT64_T +/*#undef HAVE_INT64_T*/ +#define HAVE_INT64_T @HAVE_INT64_T@ /* Define to 1 if the system has the type `int8_t'. */ -#undef HAVE_INT8_T +/*#undef HAVE_INT8_T*/ +#define HAVE_INT8_T @HAVE_INT8_T@ /* Define to 1 if the system has the type `intptr_t'. */ -#undef HAVE_INTPTR_T +/*#undef HAVE_INTPTR_T*/ +#define HAVE_INTPTR_T @HAVE_INTPTR_T@ /* Define to 1 if you have the header file. */ -#undef HAVE_INTTYPES_H +/*#undef HAVE_INTTYPES_H*/ +#define HAVE_INTTYPES_H @HAVE_INTTYPES_H@ /* Define to 1 if you have the `isnan' function. */ -#undef HAVE_ISNAN +/*#undef HAVE_ISNAN*/ +#define HAVE_ISNAN @HAVE_ISNAN@ /* Define to 1 if you have the `localtime_r' function. */ -#undef HAVE_LOCALTIME_R +/*#undef HAVE_LOCALTIME_R*/ +#define HAVE_LOCALTIME_R @HAVE_LOCALTIME_R@ /* Define to 1 if you have the `localtime_s' function. */ -#undef HAVE_LOCALTIME_S +/*#undef HAVE_LOCALTIME_S*/ +#define HAVE_LOCALTIME_S @HAVE_LOCALTIME_S@ /* Define to 1 if you have the header file. */ -#undef HAVE_MALLOC_H +/*#undef HAVE_MALLOC_H*/ +#define HAVE_MALLOC_H @HAVE_MALLOC_H@ /* Define to 1 if you have the `malloc_usable_size' function. */ -#undef HAVE_MALLOC_USABLE_SIZE +/*#undef HAVE_MALLOC_USABLE_SIZE*/ +#define HAVE_MALLOC_USABLE_SIZE @HAVE_MALLOC_USABLE_SIZE@ /* Define to 1 if you have the header file. */ -#undef HAVE_MEMORY_H +/*#undef HAVE_MEMORY_H*/ +#define HAVE_MEMORY_H @HAVE_MEMORY_H@ /* Define to 1 if you have the `pread' function. */ -#undef HAVE_PREAD +/*#undef HAVE_PREAD*/ +#define HAVE_PREAD @HAVE_PREAD@ /* Define to 1 if you have the `pread64' function. */ -#undef HAVE_PREAD64 +/*#undef HAVE_PREAD64*/ +#define HAVE_PREAD64 @HAVE_PREAD64@ /* Define to 1 if you have the `pwrite' function. */ -#undef HAVE_PWRITE +/*#undef HAVE_PWRITE*/ +#define HAVE_PWRITE @HAVE_PWRITE@ /* Define to 1 if you have the `pwrite64' function. */ -#undef HAVE_PWRITE64 +/*#undef HAVE_PWRITE64*/ +#define HAVE_PWRITE64 @HAVE_PWRITE64@ /* Define to 1 if you have the header file. */ -#undef HAVE_STDINT_H +/*#undef HAVE_STDINT_H*/ +#define HAVE_STDINT_H @HAVE_STDINT_H@ /* Define to 1 if you have the header file. */ -#undef HAVE_STDLIB_H +/*#undef HAVE_STDLIB_H*/ +#define HAVE_STDLIB_H @HAVE_STDLIB_H@ /* Define to 1 if you have the `strchrnul' function. */ -#undef HAVE_STRCHRNUL +/*#undef HAVE_STRCHRNUL*/ +#define HAVE_STRCHRNUL @HAVE_STRCHRNUL@ /* Define to 1 if you have the header file. */ -#undef HAVE_STRINGS_H +/*#undef HAVE_STRINGS_H*/ +#define HAVE_STRINGS_H @HAVE_STRINGS_H@ /* Define to 1 if you have the header file. */ -#undef HAVE_STRING_H +/*#undef HAVE_STRING_H*/ +#define HAVE_STRING_H @HAVE_STRING_H@ /* Define to 1 if you have the header file. */ -#undef HAVE_SYS_STAT_H +/*#undef HAVE_SYS_STAT_H*/ +#define HAVE_SYS_STAT_H @HAVE_SYS_STAT_H@ /* Define to 1 if you have the header file. */ -#undef HAVE_SYS_TYPES_H +/*#undef HAVE_SYS_TYPES_H*/ +#define HAVE_SYS_TYPES_H @HAVE_SYS_TYPES_H@ /* Define to 1 if the system has the type `uint16_t'. */ -#undef HAVE_UINT16_T +/*#undef HAVE_UINT16_T*/ +#define HAVE_UINT16_T @HAVE_UINT16_T@ /* Define to 1 if the system has the type `uint32_t'. */ -#undef HAVE_UINT32_T +/*#undef HAVE_UINT32_T*/ +#define HAVE_UINT32_T @HAVE_UINT32_T@ /* Define to 1 if the system has the type `uint64_t'. */ -#undef HAVE_UINT64_T +/*#undef HAVE_UINT64_T*/ +#define HAVE_UINT64_T @HAVE_UINT64_T@ /* Define to 1 if the system has the type `uint8_t'. */ -#undef HAVE_UINT8_T +/*#undef HAVE_UINT8_T*/ +#define HAVE_UINT8_T @HAVE_UINT8_T@ /* Define to 1 if the system has the type `uintptr_t'. */ -#undef HAVE_UINTPTR_T +/*#undef HAVE_UINTPTR_T*/ +#define HAVE_UINTPTR_T @HAVE_UINTPTR_T@ /* Define to 1 if you have the header file. */ -#undef HAVE_UNISTD_H +/*#undef HAVE_UNISTD_H*/ +#define HAVE_UNISTD_H @HAVE_UNISTD_H@ /* Define to 1 if you have the `usleep' function. */ -#undef HAVE_USLEEP +/*#undef HAVE_USLEEP*/ +#define HAVE_USLEEP @HAVE_USLEEP@ /* Define to 1 if you have the `utime' function. */ -#undef HAVE_UTIME +/*#undef HAVE_UTIME*/ +#define HAVE_UTIME @HAVE_UTIME@ /* Define to 1 if you have the header file. */ -#undef HAVE_ZLIB_H +/*#undef HAVE_ZLIB_H*/ +#define HAVE_ZLIB_H @HAVE_ZLIB_H@ /* Define to the sub-directory in which libtool stores uninstalled libraries. */ -#undef LT_OBJDIR +/*#undef LT_OBJDIR*/ +/*#define LT_OBJDIR @LT_OBJDIR@*/ /* Define to the address where bug reports for this package should be sent. */ -#undef PACKAGE_BUGREPORT +/*#undef PACKAGE_BUGREPORT*/ +#define PACKAGE_BUGREPORT "" /* Define to the full name of this package. */ -#undef PACKAGE_NAME +/*#undef PACKAGE_NAME*/ +#define PACKAGE_NAME "sqlite" /* Define to the full name and version of this package. */ -#undef PACKAGE_STRING +/*#undef PACKAGE_STRING*/ +#define PACKAGE_STRING "sqlite @RELEASE@" /* Define to the one symbol short name of this package. */ -#undef PACKAGE_TARNAME +/*#undef PACKAGE_TARNAME*/ +#define PACKAGE_TARNAME "sqlite" /* Define to the home page for this package. */ -#undef PACKAGE_URL +/*#undef PACKAGE_URL*/ +#define PACKAGE_URL "" /* Define to the version of this package. */ -#undef PACKAGE_VERSION +/*#undef PACKAGE_VERSION*/ +#define PACKAGE_VERSION @VERSION@ /* Define to 1 if you have the ANSI C header files. */ -#undef STDC_HEADERS +/*#undef STDC_HEADERS*/ +#define STDC_HEADERS 1 /* @STDC_HEADERS@ */ /* Enable large inode numbers on Mac OS X 10.5. */ #ifndef _DARWIN_USE_64_BIT_INODE @@ -136,7 +181,14 @@ #endif /* Number of bits in a file offset, on hosts where this is settable. */ -#undef _FILE_OFFSET_BITS +/*#undef _FILE_OFFSET_BITS*/ +/*#define _FILE_OFFSET_BITS @_FILE_OFFSET_BITS@*/ +/*@if _FILE_OFFSET_BITS != ""*/ +/*#define _FILE_OFFSET_BITS @_FILE_OFFSET_BITS@*/ +/*@endif*/ /* Define for large files, on AIX-style hosts. */ -#undef _LARGE_FILES +/*#undef _LARGE_FILES*/ +/*@if _LARGE_FILES*/ +/*#define _LARGE_FILES @_LARGE_FILES@*/ +/*@endif*/