* [PATCH] build-sys: cal requires both ncurses and tinfo
@ 2015-07-23 22:56 Joel Holdsworth
2015-07-24 6:23 ` Bernhard Voelker
2015-07-24 7:51 ` Karel Zak
0 siblings, 2 replies; 7+ messages in thread
From: Joel Holdsworth @ 2015-07-23 22:56 UTC (permalink / raw)
To: util-linux; +Cc: Joel Holdsworth
From: Joel Holdsworth <joel@airwebreathe.org.uk>
This fixes a bug in the build system when building without ncurses
and tinfo. When cal is linked, it depends on both these libraries
and will fail to link if either of them is not available.
This patch resolves the issue by explicitly declaring these
dependencies in the confgure.ac.
---
configure.ac | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/configure.ac b/configure.ac
index 6bc9efd..76ba349 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1232,7 +1232,9 @@ AS_IF([test "x$build_mkswap" = xyes -a "x$build_libuuid" != xyes], [
AC_MSG_WARN([uuid library is not found; mkswap(8) will not generate UUIDs])
])
-UL_BUILD_INIT([cal], [yes])
+UL_BUILD_INIT([cal], [check])
+UL_REQUIRES_HAVE([cal], [ncurses], [ncurses library])
+UL_REQUIRES_HAVE([cal], [tinfo], [tinfo library])
AM_CONDITIONAL([BUILD_CAL], [test "x$build_cal" = xyes])
UL_BUILD_INIT([logger], [yes])
--
1.9.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH] build-sys: cal requires both ncurses and tinfo
2015-07-23 22:56 [PATCH] build-sys: cal requires both ncurses and tinfo Joel Holdsworth
@ 2015-07-24 6:23 ` Bernhard Voelker
2015-07-24 7:56 ` Karel Zak
2015-07-24 7:51 ` Karel Zak
1 sibling, 1 reply; 7+ messages in thread
From: Bernhard Voelker @ 2015-07-24 6:23 UTC (permalink / raw)
To: Joel Holdsworth, util-linux; +Cc: Joel Holdsworth
On 07/24/2015 12:56 AM, Joel Holdsworth wrote:
> This fixes a bug in the build system when building without ncurses
> and tinfo. When cal is linked, it depends on both these libraries
> and will fail to link if either of them is not available.
>
> This patch resolves the issue by explicitly declaring these
> dependencies in the confgure.ac.
wouldn't this invalidate configure's --without-ncurses option?
Have a nice day,
Berny
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] build-sys: cal requires both ncurses and tinfo
2015-07-23 22:56 [PATCH] build-sys: cal requires both ncurses and tinfo Joel Holdsworth
2015-07-24 6:23 ` Bernhard Voelker
@ 2015-07-24 7:51 ` Karel Zak
1 sibling, 0 replies; 7+ messages in thread
From: Karel Zak @ 2015-07-24 7:51 UTC (permalink / raw)
To: Joel Holdsworth; +Cc: util-linux, Joel Holdsworth
On Thu, Jul 23, 2015 at 11:56:39PM +0100, Joel Holdsworth wrote:
> From: Joel Holdsworth <joel@airwebreathe.org.uk>
>
> This fixes a bug in the build system when building without ncurses
> and tinfo. When cal is linked, it depends on both these libraries
> and will fail to link if either of them is not available.
It's optional dependence. I have no problem to to build without the
libs:
$ ldd ./cal
linux-vdso.so.1 (0x00007fff9099e000)
libc.so.6 => /lib64/libc.so.6 (0x0000003f99400000)
/lib64/ld-linux-x86-64.so.2 (0x0000003f99000000)
Karel
--
Karel Zak <kzak@redhat.com>
http://karelzak.blogspot.com
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] build-sys: cal requires both ncurses and tinfo
2015-07-24 6:23 ` Bernhard Voelker
@ 2015-07-24 7:56 ` Karel Zak
2015-07-24 17:33 ` Joel Holdsworth
0 siblings, 1 reply; 7+ messages in thread
From: Karel Zak @ 2015-07-24 7:56 UTC (permalink / raw)
To: Bernhard Voelker; +Cc: Joel Holdsworth, util-linux, Joel Holdsworth
On Fri, Jul 24, 2015 at 08:23:51AM +0200, Bernhard Voelker wrote:
> On 07/24/2015 12:56 AM, Joel Holdsworth wrote:
> > This fixes a bug in the build system when building without ncurses
> > and tinfo. When cal is linked, it depends on both these libraries
> > and will fail to link if either of them is not available.
> >
> > This patch resolves the issue by explicitly declaring these
> > dependencies in the confgure.ac.
>
> wouldn't this invalidate configure's --without-ncurses option?
No, from this point of view the patch is correct
UL_BUILD_INIT([cal], [check])
specifies the util as optional, so
UL_REQUIRES_HAVE([cal], [ncurses], [ncurses library])
checks for the library and if not found then print WARNING and disable
the util.
UL_BUILD_INIT([cal], [yes])
specifies that the util is strictly required.
Anyway from my point of view the patch is unnecessary as cal.c should
be possible to compile without curses and tinfo at all.
Karel
--
Karel Zak <kzak@redhat.com>
http://karelzak.blogspot.com
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] build-sys: cal requires both ncurses and tinfo
2015-07-24 7:56 ` Karel Zak
@ 2015-07-24 17:33 ` Joel Holdsworth
2015-07-24 20:09 ` Karel Zak
2015-07-27 9:55 ` Karel Zak
0 siblings, 2 replies; 7+ messages in thread
From: Joel Holdsworth @ 2015-07-24 17:33 UTC (permalink / raw)
To: Karel Zak, Bernhard Voelker, util-linux; +Cc: Joel Holdsworth
On 24/07/15 08:56, Karel Zak wrote:
> On Fri, Jul 24, 2015 at 08:23:51AM +0200, Bernhard Voelker wrote:
>> On 07/24/2015 12:56 AM, Joel Holdsworth wrote:
>>> This fixes a bug in the build system when building without ncurses
>>> and tinfo. When cal is linked, it depends on both these libraries
>>> and will fail to link if either of them is not available.
>>>
>>> This patch resolves the issue by explicitly declaring these
>>> dependencies in the confgure.ac.
>>
>> wouldn't this invalidate configure's --without-ncurses option?
>
> No, from this point of view the patch is correct
>
> UL_BUILD_INIT([cal], [check])
>
> specifies the util as optional, so
>
> UL_REQUIRES_HAVE([cal], [ncurses], [ncurses library])
>
> checks for the library and if not found then print WARNING and disable
> the util.
>
> UL_BUILD_INIT([cal], [yes])
>
> specifies that the util is strictly required.
>
>
> Anyway from my point of view the patch is unnecessary as cal.c should
> be possible to compile without curses and tinfo at all.
>
> Karel
>
Ok, so cal can build without ncurses and/or tinfo - fine ok.
The problem I have is with misc-utils/Makemodule.am:14
https://git.kernel.org/cgit/utils/util-linux/util-linux.git/tree/misc-utils/Makemodule.am?h=stable%2Fv2.26#n14
...this is making it link with -ltinfo, which fails because I'm not
providing it. Would it be more correct to make NCURSES_LIBS and
TINFO_LIBS become empty when they're not available? Is this how it's
meant to work? Did it ever work this way previously?
I'm slightly suspicious of my cross-build setup if configure is picking
up "-ltinfo" dependencies from the host system, but even with
'--disable-tinfo', TINFO_LIBS is still not set to "".
Also having UL_BUILD_INIT([cal], [yes]) to force cal to always be built
seem ridiculous; in fact why should any of the tools be forced? The user
should be able to mix and match whatever programs they want to have.
Another related issue is that I was hoping to be able to do
'--disable-all-programs', then '--enable-XXX' the ones I need one by one
- but the disable-all flag seems to take precedence right now.
Can someone suggest what a patch to fix this should be like?
Joel
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] build-sys: cal requires both ncurses and tinfo
2015-07-24 17:33 ` Joel Holdsworth
@ 2015-07-24 20:09 ` Karel Zak
2015-07-27 9:55 ` Karel Zak
1 sibling, 0 replies; 7+ messages in thread
From: Karel Zak @ 2015-07-24 20:09 UTC (permalink / raw)
To: Joel Holdsworth; +Cc: Bernhard Voelker, util-linux, Joel Holdsworth
On Fri, Jul 24, 2015 at 06:33:37PM +0100, Joel Holdsworth wrote:
> Ok, so cal can build without ncurses and/or tinfo - fine ok.
>
> The problem I have is with misc-utils/Makemodule.am:14
>
> https://git.kernel.org/cgit/utils/util-linux/util-linux.git/tree/misc-utils/Makemodule.am?h=stable%2Fv2.26#n14
>
> ...this is making it link with -ltinfo, which fails because I'm not
> providing it. Would it be more correct to make NCURSES_LIBS and
> TINFO_LIBS become empty when they're not available? Is this how it's
> meant to work? Did it ever work this way previously?
>
> I'm slightly suspicious of my cross-build setup if configure is picking
> up "-ltinfo" dependencies from the host system, but even with
> '--disable-tinfo', TINFO_LIBS is still not set to "".
>
> Also having UL_BUILD_INIT([cal], [yes]) to force cal to always be built
> seem ridiculous; in fact why should any of the tools be forced? The user
> should be able to mix and match whatever programs they want to have.
>
> Another related issue is that I was hoping to be able to do
> '--disable-all-programs', then '--enable-XXX' the ones I need one by one
> - but the disable-all flag seems to take precedence right now.
>
> Can someone suggest what a patch to fix this should be like?
I'll try to improve it next week, thanks!
Karel
--
Karel Zak <kzak@redhat.com>
http://karelzak.blogspot.com
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] build-sys: cal requires both ncurses and tinfo
2015-07-24 17:33 ` Joel Holdsworth
2015-07-24 20:09 ` Karel Zak
@ 2015-07-27 9:55 ` Karel Zak
1 sibling, 0 replies; 7+ messages in thread
From: Karel Zak @ 2015-07-27 9:55 UTC (permalink / raw)
To: Joel Holdsworth; +Cc: Bernhard Voelker, util-linux, Joel Holdsworth
On Fri, Jul 24, 2015 at 06:33:37PM +0100, Joel Holdsworth wrote:
> Ok, so cal can build without ncurses and/or tinfo - fine ok.
>
> The problem I have is with misc-utils/Makemodule.am:14
>
> https://git.kernel.org/cgit/utils/util-linux/util-linux.git/tree/misc-utils/Makemodule.am?h=stable%2Fv2.26#n14
>
> ...this is making it link with -ltinfo, which fails because I'm not
> providing it. Would it be more correct to make NCURSES_LIBS and
> TINFO_LIBS become empty when they're not available?
It should be empty, see configure. It sets TINFO_LIBS by
PKG_CHECK_MODULES() or AC_CHECK_LIB().
> I'm slightly suspicious of my cross-build setup if configure is picking
> up "-ltinfo" dependencies from the host system, but even with
> '--disable-tinfo', TINFO_LIBS is still not set to "".
You want to use --without-tinfo (see configure --help):
$ ./configure &> /dev/null
$ grep "TINFO_LIBS =" Makefile
TINFO_LIBS = -ltinfo
$ ./configure --without-tinfo &> /dev/null
$ grep "TINFO_LIBS =" Makefile
TINFO_LIBS =
> Also having UL_BUILD_INIT([cal], [yes]) to force cal to always be built
> seem ridiculous; in fact why should any of the tools be forced? The user
> should be able to mix and match whatever programs they want to have.
Well, the script uses [yes] because cal does not have any strict
dependence, so [check] does not have any sense here.
> Another related issue is that I was hoping to be able to do
> '--disable-all-programs', then '--enable-XXX' the ones I need one by one
> - but the disable-all flag seems to take precedence right now.
I don't think so. For example:
./configure --disable-all-programs --enable-unshare
works as expected. The problem is that we currently don't have
--enable- for all stuff, for example --enable-cal is missing.
Fixed now. I have added --disable-cal because it seems that cal(1) is
tricky enough due to compilation with/without ncurses/termpac/tinfo.
Karel
--
Karel Zak <kzak@redhat.com>
http://karelzak.blogspot.com
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2015-07-27 9:55 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-07-23 22:56 [PATCH] build-sys: cal requires both ncurses and tinfo Joel Holdsworth
2015-07-24 6:23 ` Bernhard Voelker
2015-07-24 7:56 ` Karel Zak
2015-07-24 17:33 ` Joel Holdsworth
2015-07-24 20:09 ` Karel Zak
2015-07-27 9:55 ` Karel Zak
2015-07-24 7:51 ` Karel Zak
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox