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

Open
wants to merge 10 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 <[email protected]>
    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 <[email protected]>
    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 <[email protected]>
    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 <[email protected]>
    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 <[email protected]>
    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 <[email protected]>
    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 <[email protected]>
    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 <[email protected]>
    Explorer09 committed Oct 28, 2024
    Configuration menu
    Copy the full SHA
    a1f2175 View commit details
    Browse the repository at this point in the history

Commits on Nov 2, 2024

  1. build: Improve "tinfo" library detection in configure

    Now it can guess the terminfo library name based on the ncurses
    library file name. E.g. "-ltinfow" for the corresponding"-lncursesw".
    If the guessed library name doesn't link, try the "-ltinfo" name then.
    
    Signed-off-by: Kang-Che Sung <[email protected]>
    Explorer09 committed Nov 2, 2024
    Configuration menu
    Copy the full SHA
    174c87d View commit details
    Browse the repository at this point in the history
  2. build: Add "ncurses{t,tw}" to possible ncurses names

    "ncursest" and "ncursestw" are multi-threaded variants of the ncurses
    library. The "t" library names are only used in operating systems that
    do not support weak symbols (so you won't see such names in Linux), but
    the names are documented in ncurses anyway. Adding them to the list of
    names to check won't hurt.
    
    * See the curs_threads(3X) man page, and the INSTALL file from ncurses
      package. Notably the "--enable-reentrant", "--with-pthread" and
      "--enable-weak-symbols" options in ncurses.
    
    Signed-off-by: Kang-Che Sung <[email protected]>
    Explorer09 committed Nov 2, 2024
    Configuration menu
    Copy the full SHA
    917eb57 View commit details
    Browse the repository at this point in the history