lecram / rover

simple file browser for the terminal
http://lecram.github.io/p/rover/
329 stars 30 forks source link

Add LDFLAGS and terminfo #19

Closed Ypnose closed 8 years ago

Ypnose commented 8 years ago

Hi, The following patch allows user-defined LDFLAGS to be used.-lterminfo was added to be able to compile rover with netbsd-curses from Sabotage Linux. Without that, we have a ton of those fatal messages:

tty.c:(.text+0x978): undefined reference to `ti_puts'
[...]
cr_put.c:(.text+0x2da): undefined reference to `cur_term'
cr_put.c:(.text+0x2f6): undefined reference to `tputs'

Here you go: http://sprunge.us/ibge

lecram commented 8 years ago

Hi, In many systems, the terminfo library is included in the curses library, so you don't need to link it separated. In fact, in those systems there's no libterminfo so adding -lterminfo to LDLIBS will cause the build to fail. IIRC, there are also systems where you do need to link it, but it's called libtinfo instead of libterminfo, so the correct flag would be -ltinfo. In other words, there's no "universally correct" value for LDLIBS. We could probably add some sort of hand-written configure script to automatically find the correct value of LDLIBS for the running system. In the meantime, people will have to tweak the makefile locally.

The inclusion of LDFLAGS is ok. I can't push any change now because I'm on mobile and probably will be for some time. If you send a pull request just changing that line I think I can accept it, though.

The "terminal not found" error usually just mean that you don't have a terminfo entry (a file that describes a terminal) for that terminal (in this case, the "tmux terminal" or whatever) installed. The file is usually located on /usr/share/terminfo. See terminfo(5) for more information.

Hope that helps.

Ypnose commented 8 years ago

Ok I see. No problem for LDLIBS. I can tune the value by myself. The PR is done for the LDFLAGS. Could you also create a tag, once the PR is merged? It will be easier for maintainers.

lecram commented 8 years ago

Thanks. I want to add a small FAQ.md before making a new release.