Skip to content

Makefile-alt with CURSESCFLAGS and CURSESLIBS options#45

Open
Hibou57 wants to merge 2 commits intodeadpixi:masterfrom
Hibou57:patch-1
Open

Makefile-alt with CURSESCFLAGS and CURSESLIBS options#45
Hibou57 wants to merge 2 commits intodeadpixi:masterfrom
Hibou57:patch-1

Conversation

@Hibou57
Copy link

@Hibou57 Hibou57 commented May 7, 2020

An additional and alternate Makefile, better suited to people using pkg-config for their ncursesw library (the one on my Ubuntu 16.04 32bits is obsolete, it is still v5 while MTM expects v6). I could have added an invocation to pkg-config directly in the Makefile, but it makes it more general if it just uses two CURSESCFLAGS and CURSESLIBS options which can freely be set on invocation.

Example usage:

make CURSESCFLAGS="$(pkg-config --cflags ncursesw)" \
   CURSESLIBS="$(pkg-config --libs ncursesw)"

Note CURSESLIBS is not always just a matter of paths, it may be a matter of linker options. Ex for me, what pkg-config says about ncursesw, is:

$ pkg-config --cflags ncursesw
> -D_DEFAULT_SOURCE -D_XOPEN_SOURCE=600 -I/home/…/apps/ncurses/include/ncursesw -I/home/…/apps/ncurses/include
$ pkg-config --libs ncursesw
> -L/home/…/apps/ncurses/lib -Wl,-rpath,/home/…/apps/ncurses/lib -lncursesw

Note the -Wl,-rpath … part, which is why a library path is not always enough. For a custom ncurses library, an -I… option is also required for the C compilation.

This is why I’m proposing an additional and alternate Makefile, with CURSESCFLAGS and CURSESLIBS options.

Hibou57 added 2 commits May 7, 2020 20:34
An alternate Makefile better suited to people using `pkg-config` for their ncurses library (the one on my Ubuntu 16.04 32bits is obsolete, it is still v5 while MTM expects v6). I could have added an invocation to `pkg-config`, but it makes it more general if it just use two `CURSESCFLAGS` and `CURSESLIBS`. Not `CURSESLIBS` is not always just a matter of paths, it may be a matter of linker options. Ex for me, `pkg-config` says:

    $ pkg-config --cflags ncursesw
    > -D_DEFAULT_SOURCE -D_XOPEN_SOURCE=600 -I/home/yannick/apps/ncurses/include/ncursesw -I/home/yannick/apps/ncurses/include
    $ pkg-config --libs ncursesw
    > -L/home/yannick/apps/ncurses/lib -Wl,-rpath,/home/yannick/apps/ncurses/lib -lncursesw

Note the `-Wl,-rpath …` part, which is why a library path is not always enough. For a custom ncurses library, an `-I…` option is also required for the C compilation.

This is why I’m proposing alternate Makefile addition, with `CURSESCFLAGS` and `CURSESLIBS` options.
@paulmenzel
Copy link

I’d squash the second into the first commit, but besides that, that’s also what I need for my environment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants