From: "Andreas Färber" <afaerber@suse.de>
To: Michael Tokarev <mjt@tls.msk.ru>
Cc: qemu-trivial@nongnu.org, Ed Maste <emaste@freebsd.org>,
qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [Qemu-trivial] [PATCH] configure: try pkg-config ncurses first
Date: Sat, 25 May 2013 13:38:20 +0200 [thread overview]
Message-ID: <51A0A2AC.6050506@suse.de> (raw)
In-Reply-To: <51A03D24.5010306@msgid.tls.msk.ru>
Am 25.05.2013 06:25, schrieb Michael Tokarev:
> 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
> library, libtinfo.
>
> 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.
I think the submitter wanted to assure that pkg-config --libs ncurses is
tried *before* falling back to -lcurses? (Rather than caring about the
order of -lncurses vs. pkg-config --libs ncurses.)
> 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.
$pkg_config should already contain --static for static builds, so I see
nothing wrong with this patch,
Reviewed-by: Andreas Färber <afaerber@suse.de>
but maybe I'm missing something?
One thing to note is that in an unfortunate layering violation unicore32
uses curses, so static libs and their potential need to link in
additional dependencies may be more than just a theoretical concern.
Regards,
Andreas
> Anyway, I don't see a reason to apply this as it is.
>
> Thanks,
>
> /mjt
>
>>
>> Signed-off-by: Ed Maste <emaste@freebsd.org>
>> ---
>> 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="-lpdcurses"
>> else
>> - curses_list="-lncurses:-lcurses:$($pkg_config --libs ncurses 2>/dev/null)"
>> + curses_list="$($pkg_config --libs ncurses 2>/dev/null):-lncurses:-lcurses"
>> fi
>>
>> if test "$curses" != "no" ; then
>>
--
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg
next prev parent reply other threads:[~2013-05-25 11:38 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-05-24 20:07 [Qemu-devel] [PATCH] configure: try pkg-config ncurses first Ed Maste
2013-05-25 4:25 ` [Qemu-devel] [Qemu-trivial] " Michael Tokarev
2013-05-25 11:30 ` Ed Maste
2013-05-25 11:38 ` Andreas Färber [this message]
2013-05-25 11:58 ` Michael Tokarev
2013-05-27 19:44 ` Michael Tokarev
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=51A0A2AC.6050506@suse.de \
--to=afaerber@suse.de \
--cc=emaste@freebsd.org \
--cc=mjt@tls.msk.ru \
--cc=qemu-devel@nongnu.org \
--cc=qemu-trivial@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).