mtm
mtm copied to clipboard
OS and distribution dependent makefile
Manjaro and Arch do use #define NCURSESW_INCLUDE_H <curses.h>,
but __Linux__
only provides here <ncursesw/curses.h>.
The general way to detect the Linux in the shell is this. However for Windows to work we need this.
Any idea to make this easier ?
I'm running Manjaro linux where in trying to do make
gave me a similar error
cc -std=c99 -Wall -Wextra -pedantic -Os -D_POSIX_C_SOURCE=200809L -D_XOPEN_SOURCE=600 -D_XOPEN_SOURCE_EXTENDED -o mtm vtparser.c mtm.c -lncursesw -lutil
In file included from mtm.c:35:
config.h:67:36: fatal error: ncursesw/curses.h: No such file or directory
67 | #define NCURSESW_INCLUDE_H <ncursesw/curses.h>
| ^
compilation terminated.
make: *** [Makefile:14: mtm] Error 1
so I went ahead and did the following:
sudo ln -s /usr/include/ncurses.h /usr/include/ncursesw/ncurses.h
which fixed the error. This was based on a closed bug report I found. I thought I should file this here since it worked for me and may potentially help others. :smiley: #41 #27 are similar issues
Very sad to need working around distribution flaws. If you have any idea how to get around this madness of make and distribution setups without a gazillion of configurations for each distribution, post your ideas.
We could use the shell for flag inclusion-DNCURSESW_INCLUDE_H="<curses.h>"
, which does not work properly in Makefiles or give manual Makefile adaption for user.