Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.


#71 Use configure to determine whether to redefine cbreak, etc

Wim Lewis

This is another solution to the bug reported in 2873621 --- this patch causes the configure script to check whether the cbreak, erasechar, and killchar macros are defined, and only if they aren't, then constants.h provides alternate definitions for them. I think this is a somewhat more trouble-free approach, checking for the availability of the macros at configure time, rather than trying to maintain a list of which systems have which curses variant.

This patch will result in changes to config.h(.in) next time auto* is run. I've tested with autoconf-2.63 and 2.65 on osx-10.6.


  • Wim Lewis
    Wim Lewis

    use autoconf checks for curses macros

  • Hmm... what's the benefit you expect from doing this in configure, compared to simple tests at compile time, along the lines of

    #if !defined(cbreak)
    # define cbreak /*whatever*/


  • Wim Lewis
    Wim Lewis

    The configure approach will correctly detect if curses supplies those as functions rather than macros. I don't know if there are any curses implementations that do that, though. The approach you suggest is definitely simpler, which is good...

  • I tried to apply this patch, but ran into a snafu: AC_CHECK_DECLS apparently can't be run with extra include directories, which is needed on platforms that have ncurses.h in a directory like /usr/include/ncurses.