From d9345f33126bd882515ddb8d102c4049aed9f73d Mon Sep 17 00:00:00 2001 From: stephan Date: Thu, 7 Nov 2024 07:31:25 +0000 Subject: [PATCH] When --with-linenoise refers to the msteveb flavor and jimsh is the TCL used for code generation, enable linenoise in jimsh. Remove some dead auto.def code. FossilOrigin-Name: 0d558318172dddc8d5c5842625ddf09866ae09cac9cf28731be44db86b5e0fb1 --- auto.def | 31 ++++++++----------------------- manifest | 12 ++++++------ manifest.uuid | 2 +- 3 files changed, 15 insertions(+), 30 deletions(-) diff --git a/auto.def b/auto.def index 46ea9f6107..3e768b65c1 100644 --- a/auto.def +++ b/auto.def @@ -666,12 +666,13 @@ sqlite-check-tcl # - CFLAGS_JIMSH = any flags needed for buildng a BTCLSH-compatible # jimsh. The defaults may be pass on to configure as # CFLAGS_JIMSH=... +set useJimForCodeGen 0 proc sqlite-determine-codegen-tcl {} { msg-result "Checking for TCL to use for code generation... " define CFLAGS_JIMSH [proj-get-env CFLAGS_JIMSH {-O1}] set cgtcl [opt-val with-tclsh jimsh] set flagsToRestore {CC CFLAGS CPPFLAGS LDFLAGS LINKFLAGS LIBS CROSS} - define-push $flagsToRestore { + define-push $flagsToRestore { # We have to swap CC to CC_FOR_BUILD for purposes of the various # [cc-...] tests below. Recall that --with-wasi-sdk may have # swapped out CC with one which is not appropriate for this block. @@ -691,10 +692,12 @@ proc sqlite-determine-codegen-tcl {} { if {$sysh && [cc-check-functions realpath]} { define-append CFLAGS_JIMSH -DHAVE_REALPATH define BTCLSH "\$(JIMSH)" + set ::useJimForCodeGen 1 } elseif {$sysh && [cc-check-functions _fullpath]} { # _fullpath() is a Windows API define-append CFLAGS_JIMSH -DHAVE__FULLPATH define BTCLSH "\$(JIMSH)" + set ::useJimForCodeGen 1 } elseif {[file-isexec [get-define TCLSH_CMD]]} { set cgtcl [get-define TCLSH_CMD] define BTCLSH "\$(TCLSH_CMD)" @@ -845,6 +848,10 @@ proc sqlite-check-line-editing {} { define CFLAGS_READLINE "-I$dirLn $lnC" define HAVE_LINENOISE $lnVal sqlite-add-shell-opt -DHAVE_LINENOISE=$lnVal + if {$::useJimForCodeGen && 2 == $lnVal} { + define-append CFLAGS_JIMSH -DUSE_LINENOISE [get-define CFLAGS_READLINE] + user-notice "Adding linenoise support to jimsh." + } return "linenoise ($flavor)" } elseif {[opt-bool editline]} { # libedit mimics libreadline and on some systems does not have its @@ -997,7 +1004,6 @@ proc sqlite-check-line-editing {} { if {$failIfNotFound} { proj-fatal "Explicit --$editLibName failed to find a matching library." } - return "none" }; # sqlite-check-line-editing msg-result "Line-editing support for the sqlite3 shell: [sqlite-check-line-editing]" @@ -1187,27 +1193,6 @@ if {"" ne $oFF} { } unset oFF -######################################################################## -# Maybe extend JimTCL a bit. As of this writing (2024-09-27) it only -# needs (-DHAVE_REALPATH or -DHAVE__FULLPATH) and -DHAVE_DIRENT_H to -# be compatible with our code generators. It can, however, be slightly -# extended via easy-to-detect features, should we need them. -if {0 && "" ne [get-define CFLAGS_JIMSH]} { - foreach jimFunc {opendir fsync isascii} { - if {[cc-check-functions $jimFunc]} { - define-append CFLAGS_JIMSH -DHAVE_[string toupper $jimFunc] - } - } - #These are hard-coded into jimsh0.c, so we must not -D them: - #foreach jimDef {HAVE_UNISTD_H HAVE_DIRENT_H} { - # if {[is-defined $jimDef]} { - # define-append CFLAGS_JIMSH -D$jimDef - # } - #} - define-append CFLAGS_JIMSH -DHAVE_LONG_LONG; # SQLite relies on long long, so we know it's available -}; # JimTCL - - ######################################################################## # "Re-export" the autoconf-conventional --XYZdir flags into something # which is more easily overridable from a make invocation. See the docs diff --git a/manifest b/manifest index 76ca282253..9321db618c 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Add\smention\sof\sfile-isexec\sin\sautosetup/README.md. -D 2024-11-07T06:02:05.347 +C When\s--with-linenoise\srefers\sto\sthe\smsteveb\sflavor\sand\sjimsh\sis\sthe\sTCL\sused\sfor\scode\sgeneration,\senable\slinenoise\sin\sjimsh.\sRemove\ssome\sdead\sauto.def\scode. +D 2024-11-07T07:31:25.397 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea F LICENSE.md e108e1e69ae8e8a59e93c455654b8ac9356a11720d3345df2a4743e9590fb20d @@ -13,7 +13,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 61da56c0147852d5ec7a86eb96d968f1351cfada821ea54f090cec01e9cabb16 +F auto.def e05db4c72b2a2797f3a53ae4bb26dbca6252dedf8c8f2990d0bff9adeef3fcc3 F autoconf/INSTALL 83e4a25da9fd053c7b3665eaaaf7919707915903 F autoconf/Makefile.am adedc1324b6a87fdd1265ddd336d2fb7d4f36a0e77b86ea553ae7cc4ea239347 F autoconf/Makefile.fallback 22fe523eb36dfce31e0f6349f782eb084e86a5620b2b0b4f84a2d6133f53f5ac @@ -2200,8 +2200,8 @@ F tool/version-info.c 3b36468a90faf1bbd59c65fd0eb66522d9f941eedd364fabccd7227350 F tool/warnings-clang.sh bbf6a1e685e534c92ec2bfba5b1745f34fb6f0bc2a362850723a9ee87c1b31a7 F tool/warnings.sh 49a486c5069de041aedcbde4de178293e0463ae9918ecad7539eedf0ec77a139 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P 052a1b4d7cb43b7f65028c41e9a7a17b533c834d8f620fbc7bc0adddb1fdb843 -R 44b9bde08584eb60e3c1ac7b538f4ce9 +P f469356749b62b3ce4161b40ed105d60867a366a389efa583fe9607a13426803 +R f42449771a357ea3eeabd0c3a3bc0370 U stephan -Z 32ba8fe39d3740f9d9fe595729b68f87 +Z fc12fb834027eddc0e5138b6f2cef0fc # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index fe5637dca4..b6b163c254 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -f469356749b62b3ce4161b40ed105d60867a366a389efa583fe9607a13426803 +0d558318172dddc8d5c5842625ddf09866ae09cac9cf28731be44db86b5e0fb1