diff options
| author | Paul Buetow <paul@buetow.org> | 2026-07-02 00:53:37 +0300 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2026-07-02 00:53:37 +0300 |
| commit | 5c744e37b6375f3f6842cdf3758a180a649bafea (patch) | |
| tree | eb28d27988539228727b0d47d32b2d7927bc145c /ycurses/configure | |
| parent | 58602a28d2c92b603208f3e01c14c169d28cc7b0 (diff) | |
ycurses: get it building on modern GCC, verify in Docker (task 9s0)
ycurses shares no source files with ychat/yhttpd (it's an ncurses UI
toolkit, not part of the httpd/socket engine), so none of the sock/reqp/
html/logd/tool fixes apply here - only the same class of toolchain-gate
bugs did:
- Top-level configure's g++ 3.x version gate now accepts any GNU g++
(same fix as yhttpd/configure).
- scripts/config.pl silently BEGIN-failed on modern Perl (`use
scripts::modules::file` needs "." on @INC, dropped by Perl 5.26+); the
"yes" default answer was never actually read. Fixed with `perl -I.`
(also applied to yhttpd/configure, which had the same latent bug).
- src/configure's library search paths predate 64-bit multilib distros
(no /usr/lib64), so installed libpanel/libmenu/libncurses were reported
"NOT OK" on Rocky Linux 9 (also backported to yhttpd/src/configure).
- attributes.h declared `set<int> set_attr` (std::set, via `using
namespace std`) and separately two member functions literally named
`set` - GCC 11 treats that as ill-formed ("changes meaning of 'set'"),
not just a warning. Renamed both overloads to set_attr_flag; no
external caller used the bare set(...)/set(int) names.
Verified in a Rocky Linux 9 container: builds clean, links, and runs -
initializes curses, draws the demo screen using color/attributes
(exercising the fix above), exits cleanly. Added Dockerfile (build
verification only - it's an interactive demo, not a service) and
BUILD.md documenting the fixes and one pre-existing, deliberately
unfixed bug (unset() never actually clears an attribute).
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Diffstat (limited to 'ycurses/configure')
| -rwxr-xr-x | ycurses/configure | 26 |
1 files changed, 17 insertions, 9 deletions
diff --git a/ycurses/configure b/ycurses/configure index 9aab971..56f015f 100755 --- a/ycurses/configure +++ b/ycurses/configure @@ -51,17 +51,25 @@ perl -e ' } &check_make; print "Checking compiler version\n"; - my $r = 0; - for (my $i = 4; $i > 0 && $r == 0; --$i ) { - $r = &check_gcc(3,$i); - } - if ($r == 0) { - print "No suitable g++ compiler found!\n"; - print "Please install a right version of GNU G++!\n"; + # Accept any GNU g++ (the original check only accepted g++ 3.x; modern GCC + # works fine with the legacy-C++ fixes applied). Write g++.version as + # "<version>\ng++\n" - src/configure reads the last line as the compiler. + my $ver = `g++ -dumpversion 2>/dev/null`; + chomp $ver; + if ( $ver eq "" ) { + print "No GNU g++ compiler found!\nPlease install GNU G++!\n"; exit(1); } - - system("perl \"scripts/config.pl\""); + `echo $ver > g++.version`; + `echo g++ >> g++.version`; + print "GNU G++ $ver found!\n"; + + # -I. : scripts/config.pl does "use scripts::modules::file", which needs + # "." on @INC. Perl 5.26+ dropped "." from the default @INC, so this + # silently BEGIN-failed on modern Perl (the "yes" answer was never even + # read - it happened to be harmless only because the committed glob.h + # defaults were already correct). + system("perl -I. \"scripts/config.pl\""); chdir("src"); system("./configure ".join(" ", @ARGV)); chdir(".."); |
