diff options
| author | Scott Gasch <[email protected]> | 2026-10-25 10:54:23 -0700 |
|---|---|---|
| committer | Scott Gasch <[email protected]> | 2026-10-25 10:54:23 -0700 |
| commit | fc873933e21d9188f2b5a9d13764f00b6ce68ec9 (patch) | |
| tree | c45eadf8396c57808a2933ed14c4676261943c43 /src | |
| parent | 93ddedd408cfebb162068d458ea42484cd3f98d2 (diff) | |
Enable readline by default for command-line history/editing/completion
USE_READLINE was a complete, working, opt-in-only feature -- input.c's
readline()/add_history() integration had no known reason to still be
gated behind a flag nobody was passing. Flips it to default-on
(renamed to a DISABLE_READLINE opt-out, matching the project's own
ifndef-DISABLE_* convention) and fixes the build: readline/history
live under the FreeBSD ports prefix (/usr/local), which this box's
clang/ld don't search by default, so linking bare -lreadline failed
until -L/usr/local/lib (LIBRARIES) and -I/usr/local/include (PROFILE)
were added alongside it.
Unlike the GENERATE_*_BITBOARD cleanup, kept DISABLE_READLINE as a
real escape hatch rather than removing the toggle outright -- this
introduces an actual external library dependency (readline-devel),
not just dead source-level conditionality, so a box without it
installed still needs a way to build.
Verified: both the new default build and `DISABLE_READLINE=1` build
clean (confirmed via ldd that only the latter has no libreadline.so
dependency), and a clean DEBUG=1 TEST=1 self-test run under the new
default with no assertion failures. Batch mode (used by all of this
project's scripted testing) never touches the input thread/readline
path at all, so this has no effect there.
Co-Authored-By: Claude Sonnet 5 <[email protected]>
Diffstat (limited to 'src')
| -rw-r--r-- | src/GNUmakefile | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/src/GNUmakefile b/src/GNUmakefile index 667495e..717006b 100644 --- a/src/GNUmakefile +++ b/src/GNUmakefile @@ -121,9 +121,19 @@ else BINARY = typhoon endif -ifdef USE_READLINE - LIBRARIES += -lreadline - PROFILE += -DUSE_READLINE +# 2026-10-25: command-line history/editing/completion at the prompt, +# default on (was USE_READLINE, opt-in only, for years with no known +# reason it wasn't just always wired up -- input.c's readline/ +# add_history support was already complete and working, just never +# linked). Escape hatch kept (unlike the GENERATE_*_BITBOARD flags' +# full removal) because this adds a real external library dependency +# -- DISABLE_READLINE=1 builds the old fgets()-based prompt for a box +# without readline-devel installed. +ifndef DISABLE_READLINE + # readline/history live under the FreeBSD ports prefix (/usr/local), + # not a directory the linker/compiler search by default on this box. + LIBRARIES += -L/usr/local/lib -lreadline + PROFILE += -DUSE_READLINE -I/usr/local/include endif ifdef SIXTYFOUR |
