[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [Qemu-trivial] [PATCH] configure: try pkg-config ncurse
Re: [Qemu-devel] [Qemu-trivial] [PATCH] configure: try pkg-config ncurses first
Sat, 25 May 2013 08:25:08 +0400
Mozilla/5.0 (X11; Linux i686 on x86_64; rv:17.0) Gecko/17.0 Icedove/17.0
25.05.2013 00:07, Ed Maste wrote:
> When probing for ncurses, try pkg-config first rather than after
> explicit -lncurses and -lcurses. This fixes static linking in the case
> that ncurses has additional dependencies, such as -ltinfo (as on FreeBSD).
This is not a FreeBSD-specific thing, this is the way how current
ncurses works -- they separated a bunch of functions into a new
But this is interesting.
I'm not sure I agree with this approach. When we're building using
shared library, libncurses.so already links with libtinfo.so, so we
don't need to link executable itself with libtinfo.so, since executable
itself uses none of its functions.
On the other hand, the current logic appears to be fine, -- we first
link with just -lncurses, and if that fails, we also try pkg-config --libs --
because, maybe, we're linking statically and in that case, additional
libs from pkg-config may help.
>From yet another point of view, we may use --as-needed linker flag
and just ignore all the above.
Here, it is interesting to note that pkg-config does not actually do
the right thing in this case. Because practically, it should have
one extra flag, something like --static-libs (or --libs --static),
and it should actually be different from plain --libs.
Anyway, I don't see a reason to apply this as it is.
> Signed-off-by: Ed Maste <address@hidden>
> configure | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
> diff --git a/configure b/configure
> index cfdb564..7c99ef9 100755
> --- a/configure
> +++ b/configure
> @@ -2157,7 +2157,7 @@ fi
> if test "$mingw32" = "yes" ; then
> - curses_list="-lncurses:-lcurses:$($pkg_config --libs ncurses
> + curses_list="$($pkg_config --libs ncurses
> if test "$curses" != "no" ; then