Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
Comment: | Move the linenoise flavor check from auto.def to proj.tcl for re-use in downstream projects. |
---|---|
Downloads: | Tarball | ZIP archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA3-256: |
84e503dc1e3672fe7787fb747ed70ca1 |
User & Date: | stephan 2024-10-30 22:49:40.804 |
Context
2024-10-30
| ||
23:10 | Minor cleanups to the linenoise flavor detection test. (check-in: 3be32de162 user: stephan tags: trunk) | |
22:49 | Move the linenoise flavor check from auto.def to proj.tcl for re-use in downstream projects. (check-in: 84e503dc1e user: stephan tags: trunk) | |
22:41 | Expand [c0048e4482e9] to determine the linenoise API flavor via a compile test rather than guessing based on the filename. (check-in: dbf0079190 user: stephan tags: trunk) | |
Changes
Changes to auto.def.
︙ | ︙ | |||
727 728 729 730 731 732 733 | } } msg-result $ts define TEMP_STORE $tsn unset ts tsn } | < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < | 727 728 729 730 731 732 733 734 735 736 737 738 739 740 | } } msg-result $ts define TEMP_STORE $tsn unset ts tsn } ######################################################################## # sqlite-check-line-editing jumps through proverbial hoops to try to # find a working line-editing library, setting: # # - HAVE_READLINE to 0 or 1 # - HAVE_LINENOISE to 0, 1, or 2 # - HAVE_EDITLINE to 0 or 1 |
︙ | ︙ | |||
817 818 819 820 821 822 823 | if {![file isdir $dirLn]} { proj-fatal "--with-linenoise value is not a directory" } set lnH $dirLn/linenoise.h if {![file exists $lnH] } { proj-fatal "Cannot find linenoise.h in $dirLn" } | < < < < < < < < < < < < < < | > > > > > > > > > | | 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 | if {![file isdir $dirLn]} { proj-fatal "--with-linenoise value is not a directory" } set lnH $dirLn/linenoise.h if {![file exists $lnH] } { proj-fatal "Cannot find linenoise.h in $dirLn" } set lnC "" set lnCOpts {linenoise-ship.c linenoise.c} foreach f $lnCOpts { if {[file exists $dirLn/$f]} { set lnC $dirLn/$f break; } } if {"" eq $lnC} { proj-fatal "Cannot find any of $lnCOpts in $dirLn" } set flavor "" set lnVal [proj-which-linenoise $lnH] switch -- $lnVal { 1 { set flavor "antirez" } 2 { set flavor "msteveb" } default { proj-fatal "Cannot determine the flavor of linenoise from $lnH" } } define CFLAGS_READLINE "-I$dirLn $lnC" define HAVE_LINENOISE $lnVal sqlite-add-shell-opt -DHAVE_LINENOISE=$lnVal return "linenoise ($flavor)" } elseif {[opt-bool editline]} { # libedit mimics libreadline and on some systems does not have its # own header installed (instead, that of libreadline is used). # # shell.c historically expects HAVE_EDITLINE to be set for # libedit, but it then expects to see <editline/readline.h>, which |
︙ | ︙ |
Changes to autosetup/proj.tcl.
︙ | ︙ | |||
985 986 987 988 989 990 991 | if {![proj-is-cross-compiling] && "nope" eq [get-env CC_FOR_BUILD "nope"] && [get-define CC] ne [get-define CC_FOR_BUILD]} { user-notice "Re-defining CC_FOR_BUILD to CC=[get-define CC]. To avoid this, explicitly pass CC_FOR_BUILD=..." define CC_FOR_BUILD [get-define CC] } } | > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 | if {![proj-is-cross-compiling] && "nope" eq [get-env CC_FOR_BUILD "nope"] && [get-define CC] ne [get-define CC_FOR_BUILD]} { user-notice "Re-defining CC_FOR_BUILD to CC=[get-define CC]. To avoid this, explicitly pass CC_FOR_BUILD=..." define CC_FOR_BUILD [get-define CC] } } ######################################################################## # Attempts to determine whether the given linenoise header file is of # the "antirez" or "msteveb" flavor. It returns 1 for antirez, 2 for # msteveb, and 0 if it's neither. proc proj-which-linenoise {dotH} { set sourceOrig { #include <stdio.h> #include <stdlib.h> #include <stddef.h> /* size_t has to be be in there _somewhere_ */ } append sourceOrig [proj-file-content $dotH] set sourceTail { int main(void) { linenoiseSetCompletionCallback(0 $arg); return 0; } } set arg "" set source $sourceOrig append source [subst $sourceTail] if {[cctest -nooutput 1 -source $source]} { return 1 } set arg ", 0" set source $sourceOrig append source [subst $sourceTail] if {[cctest -nooutput 1 -source $source]} { return 2 } return 0 } |