mtm icon indicating copy to clipboard operation
mtm copied to clipboard

OS and distribution dependent makefile

Open matu3ba opened this issue 5 years ago • 3 comments

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 ?

matu3ba avatar Feb 11 '20 17:02 matu3ba

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

chanana avatar Apr 13 '20 09:04 chanana

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.

matu3ba avatar Apr 13 '20 11:04 matu3ba

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.

matu3ba avatar Apr 15 '20 14:04 matu3ba