Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix "stdscr" configure failure & ncursest support #1558

Draft
wants to merge 8 commits into
base: main
Choose a base branch
from

Commits on Oct 28, 2024

  1. build: configure "--with-curses=yes" is now a no-op

    It makes no sense to error out if the builder runs "./configure
    --with-curses" and no option argument. "--with-curses" without an option
    argument now keeps using the default name list for detecting ncurses
    library.
    
    Signed-off-by: Kang-Che Sung <explorer09@gmail.com>
    Explorer09 committed Oct 28, 2024
    Configuration menu
    Copy the full SHA
    a864a5f View commit details
    Browse the repository at this point in the history
  2. build: Log the detected '*curses*.pc' file into config.log

    When "configure" suggests user to install pkg-config, output the
    '*curses*.pc' file detected in the config.log. This aids diagnosing
    the configure script.
    
    Signed-off-by: Kang-Che Sung <explorer09@gmail.com>
    Explorer09 committed Oct 28, 2024
    Configuration menu
    Copy the full SHA
    c3c8108 View commit details
    Browse the repository at this point in the history
  3. build: Improve configure logic with pkg.m4 support

    It is slightly more robust to grep for the 'pkg_m4_included' token when
    running "make dist". Also, shorten the "make dist" warning message, and
    tell users if they need to regenerate configure when we recommend them
    to install pkg-config.
    
    Signed-off-by: Kang-Che Sung <explorer09@gmail.com>
    Explorer09 committed Oct 28, 2024
    Configuration menu
    Copy the full SHA
    5855592 View commit details
    Browse the repository at this point in the history
  4. build: Don't test "stdscr" with linking with libtinfo

    When ncurses is compiled with reentrant support, the "stdscr" may be
    only available as a macro and not a symbol for direct linking. We can
    check for "stdscr" only after the curses headers are included. For now
    we can remove the "stdscr" test when checking for keypad() function.
    
    Signed-off-by: Kang-Che Sung <explorer09@gmail.com>
    Explorer09 committed Oct 28, 2024
    Configuration menu
    Copy the full SHA
    05661ca View commit details
    Browse the repository at this point in the history
  5. build: check for wadd_wchnstr() rather than mvadd_wchnstr()

    According to ncurses man page, mvadd_wchnstr() may be implemented as a
    macro.
    
    Signed-off-by: Kang-Che Sung <explorer09@gmail.com>
    Explorer09 committed Oct 28, 2024
    Configuration menu
    Copy the full SHA
    b1e0b32 View commit details
    Browse the repository at this point in the history
  6. build: Move _XOPEN_SOURCE_EXTENDED define to config.h

    This allows configure tests to utilize the macro.
    Also explain the reasons that we define _XOPEN_SOURCE_EXTENDED and not
    _XOPEN_SOURCE.
    
    Signed-off-by: Kang-Che Sung <explorer09@gmail.com>
    Explorer09 committed Oct 28, 2024
    Configuration menu
    Copy the full SHA
    93f71c9 View commit details
    Browse the repository at this point in the history
  7. build: Add a test for whether curses.h works.

    The main thing I intended to test is "stdscr", but it is also useful to
    test ncurses functions that might be implemented as macros, such as
    refresh() and mvadd_wchnstr().
    
    Signed-off-by: Kang-Che Sung <explorer09@gmail.com>
    Explorer09 committed Oct 28, 2024
    Configuration menu
    Copy the full SHA
    7dfd4dd View commit details
    Browse the repository at this point in the history
  8. build: Check curses "bool" type compatibility

    curses.h may define its own "bool" type, because the X/Open Curses
    standard defines "bool" that predates C99 "bool". If curses.h "bool" is
    not compatible with ISO C, fail at configure time.
    
    (The C23 standard now makes "bool" a keyword so that a
    "typedef /*whatever*/ bool;" is no longer portable. This is a bug that
    curses implementations should fix.)
    
    Solaris 11 is known to ship with a broken curses.h header (the default
    curses, not ncurses).
    
    Signed-off-by: Kang-Che Sung <explorer09@gmail.com>
    Explorer09 committed Oct 28, 2024
    Configuration menu
    Copy the full SHA
    a1f2175 View commit details
    Browse the repository at this point in the history