ncurses header import issue when building against MacPorts
Using MacPorts on macOS 10.13 to satisfy the build dependencies, I can successfully configure using LDFLAGS=-L/opt/local/lib ./configure. But when I run make, there's a header issue with ncurses:
src/duc/cmd-ui.c:30:10: fatal error: 'ncursesw/ncurses.h' file not found
#include <ncursesw/ncurses.h>
^~~~~~~~~~~~~~~~~~~~
1 error generated.
make[1]: *** [src/duc/cmd-ui.o] Error 1
MacPorts looks like it has a wide-char ncurses, and config.h has the following relevant entries that all look correct:
/* Define to 1 if you have the `ncurses' library (-lncurses). */
/* #undef HAVE_LIBNCURSES */
/* Define to 1 if you have the `ncursesw' library (-lncursesw). */
#define HAVE_LIBNCURSESW 1
/* Define to 1 if you have the <ncursesw/ncurses.h> header file. */
/* #undef HAVE_NCURSESW_NCURSES_H */
/* Define to 1 if you have the <ncurses.h> header file. */
#define HAVE_NCURSES_H 1
/* Define to 1 if you have the <ncurses/ncurses.h> header file. */
/* #undef HAVE_NCURSES_NCURSES_H */
(This is resolved by using #include <ncurses.h>.)
I guess we need to do some autoconf tweaking to fix this, still?
Yes, this reproduces with current MacPorts.
I confirm that the same issue exists with Manjaro Linux 18.
This is resolved by using #include <ncurses.h> in file cmd-ui.c.
It means that for some Linux distributions manual tweaking is required in order to compile.
As the package is not present in the repository of all distros, some users may give up on this compilation error. The test with tputs in ./configure is maybe not sufficient to detect the appropriate #include