Explicitely link against tinfo. Needed for ncurses 6 - #1621
Conversation
|
Meh, fails on macOS :-/ |
seems to be the way to go |
That sounds perfect. I was going to suggest checking if tinfo existed as a package and doing some clever stuff, but just using pkg-config should be even easier and you can copy some existing Makefile stuff. Can you target 0.10 branch with this please too. |
|
Implementation done, let's see how Travis (and you ;)) like that one. Line 442 in 4faf2c5 I know that pkg-config won't tell you the exact location of header files, only via CFLAGS and only indirect there. And since I don't have a system running Dragonfly to test, I better not touched that part. |
|
And sure, when this is approved to be merged, I'll rebase the changes on 0.10 branch and send a new PR for that as well 👍 |
|
Mh, doesn't look good to Travis: |
peternewman
left a comment
There was a problem hiding this comment.
That's even worse now. I think you still need the AM_CONDITIONAL for the variable to exist in the Makefiles, see the FTDI stuff for example (so using the lower case interim state probably makes sense).
|
I've marked it ready for review to see if that fixes the odd Travis python-wip test which should be an allowed failure. |
You could target 0.10 directly if you want, then we can merge that into master from there, whichever is easier? |
Yep, agreed. Those changes were just a quick shot this morning before I started my day-time-job. It just shows my inexperience with automake but I'm working on it ;)
For development right now, master is easier. But as I said, I'll rebase on top of 0.10 once we have a solution we both like. |
|
@peternewman: This looks good to me now. I've looked at how it is implemented for ftdi and adopted the lower-case syntax. I'm currently setting up a DragonFly BSD VM to see how pkg-config behaves there now regarding to ncurses. But since macOS doesn't have pkg-config OR no pkg-config info for ncurses, I think I'll leave this as is |
|
Can't get pkg-config to work at all on Dragonfly. But with the changes done here, it should not affect building on Dragonfly. |
peternewman
left a comment
There was a problem hiding this comment.
Thanks for this, just one more comment to tweak it a bit if you don't mind.
| # Defines libncurses_LIBS that we can use to link against ncurses | ||
| # Needed since >=ncurses-6 where -ltinfo is needed in addition to -lncurses | ||
| PKG_CHECK_MODULES(libncurses, [ncurses >= 5]) | ||
| AM_CONDITIONAL([HAVE_NCURSES_PKGCONFIG], [test "$libncurses_LIBS" != ""]) |
There was a problem hiding this comment.
I think this would fail for some theoretical system which had ncurses support built in, so didn't require a flag, so you'd fall back to adding one which would upset it. See avahi for a better method, where we set a status if PKG_CHECK_MODULES finds the module, and then test that to set the conditional.
You shouldn't need to change the Makefile code, just configure to fix that.
There was a problem hiding this comment.
Mh, not sure if I can follow. The current solution (before this PR), checks for libncurses and adds -lncurses here: https://github.com/OpenLightingProject/ola/pull/1621/files#diff-83cb084b35952ddc152db3cfbc85b9f9L94.
So wouldn't that fail in the current master as well? In that theoretical case where ncurses is "built-in"
No worries, I was just flagging it up in case you hadn't seen it. Most of my automake is still copy/paste existing stuff.
Fine, in general (until we drop 0.10 branch release (probably at the next release), bugfixes can be targeted at 0.10 and new features at master.
Fair enough, I've only used it briefly by proxy. Out of interest, did it build with make/make check okay? I don't suppose you fancy turning that VM into a Buildbot slave for the occasional run? |
That pychecker-wip test should be in allowed failures, I don't really understand how it's escaped! Edit, after a bit more reading and guesswork I've pinned it down. Can you pull the contents of this PR into your PR too or make the equivalent change to .travis.yml: |
👍 I also hope to gain experience there to finish #1188 some time ...
Understood :) However, with current master not building for me (due to older protobuf being required), it's a lots of cherry-picking and rebasing stuff around. But we are working on it!
Hm, that VM was just a quick to check how |
Erm, yes, I could add those changes to this PR. I could also create a new one with those changes. Why don't we just merge #1622 ? |
Various fiddly reasons, but Travis came good so I've done those and merged it. |
Cool, let us know if we can hope at all.
Okay I understand.
Heh no worries, I don't think Dragonfly is particularly important, just different as someone brought it up once. |
|
Indentation fixed and made sure that |
Great :) Can you merge it? I don't have write access. |
Yeah waiting for Travis to play ball. |
This fixes a compilation error when ncurses is installed in version 6 only:
I'm unable to test if this also works with ncurses 5, so I'm sending this as a draft and Travis will tell us if it's okay for ncurses 5 as well.