qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Sergei Trofimovich <slyfox@inbox.ru>
To: qemu-devel@nongnu.org
Cc: Sergei Trofimovich <slyfox@gentoo.org>
Subject: [Qemu-devel] [PATCH 2/2] ./configure: add link check for nss-smartcard
Date: Mon, 23 Jan 2012 10:41:38 +0300	[thread overview]
Message-ID: <1327304498-11274-2-git-send-email-slyfox@inbox.ru> (raw)
In-Reply-To: <1327304498-11274-1-git-send-email-slyfox@inbox.ru>

From: Sergei Trofimovich <slyfox@gentoo.org>

Current './configure --static && make' fails for me:

    LINK  qemu-nbd
    /usr/lib/gcc/x86_64-pc-linux-gnu/4.5.3/../../../../x86_64-pc-linux-gnu/bin/ld: cannot find -lssl3
    /usr/lib/gcc/x86_64-pc-linux-gnu/4.5.3/../../../../x86_64-pc-linux-gnu/bin/ld: cannot find -lsmime3
    /usr/lib/gcc/x86_64-pc-linux-gnu/4.5.3/../../../../x86_64-pc-linux-gnu/bin/ld: cannot find -lnssutil3
    /usr/lib/gcc/x86_64-pc-linux-gnu/4.5.3/../../../../x86_64-pc-linux-gnu/bin/ld: cannot find -lnss3
    /usr/lib/gcc/x86_64-pc-linux-gnu/4.5.3/../../../../x86_64-pc-linux-gnu/bin/ld: cannot find -lplds4
    /usr/lib/gcc/x86_64-pc-linux-gnu/4.5.3/../../../../x86_64-pc-linux-gnu/bin/ld: cannot find -lplc4
    /usr/lib/gcc/x86_64-pc-linux-gnu/4.5.3/../../../../x86_64-pc-linux-gnu/bin/ld: cannot find -lnspr4

My system does not provide static libraries for nss, so
fix autoconfiguration by link checking.

Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
---
 configure |   13 +++++++++----
 1 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/configure b/configure
index f3dcfba..9ef8422 100755
--- a/configure
+++ b/configure
@@ -2520,11 +2520,16 @@ if test "$smartcard" != "no" ; then
     smartcard_cflags=""
     # TODO - what's the minimal nss version we support?
     if test "$smartcard_nss" != "no"; then
-        if $pkg_config --atleast-version=3.12.8 nss >/dev/null 2>&1 ; then
+      cat > $TMPC << EOF
+#include <pk11pub.h>
+int main(void) { PK11_FreeSlot(0); return 0; }
+EOF
+        smartcard_cflags="-I\$(SRC_PATH)/libcacard"
+        libcacard_libs=$($pkg_config --libs nss 2>/dev/null)
+        libcacard_cflags=$($pkg_config --cflags nss 2>/dev/null)
+        if $pkg_config --atleast-version=3.12.8 nss >/dev/null 2>&1 && \
+          compile_prog "$smartcard_cflags $libcacard_cflags" "$libcacard_libs"; then
             smartcard_nss="yes"
-            smartcard_cflags="-I\$(SRC_PATH)/libcacard"
-            libcacard_libs=$($pkg_config --libs nss 2>/dev/null)
-            libcacard_cflags=$($pkg_config --cflags nss 2>/dev/null)
             QEMU_CFLAGS="$QEMU_CFLAGS $smartcard_cflags $libcacard_cflags"
             LIBS="$libcacard_libs $LIBS"
         else
-- 
1.7.3.4

  reply	other threads:[~2012-01-23  7:42 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-23  7:41 [Qemu-devel] [PATCH 1/2] ./configure: request pkg-config to provide private libs when static linking Sergei Trofimovich
2012-01-23  7:41 ` Sergei Trofimovich [this message]
2012-01-23  8:51   ` [Qemu-devel] [PATCH 2/2] ./configure: add link check for nss-smartcard Alon Levy
2012-01-29  7:51   ` Sergei Trofimovich
2012-01-23 10:33 ` [Qemu-devel] [PATCH 1/2] ./configure: request pkg-config to provide private libs when static linking Peter Maydell
2012-01-23 17:44   ` [Qemu-devel] [PATCH v2 " Sergei Trofimovich
2012-01-23 18:02     ` Peter Maydell
2012-01-23 18:33       ` [Qemu-devel] [PATCH v3 " Sergei Trofimovich
2012-01-29  7:52         ` Sergei Trofimovich

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=1327304498-11274-2-git-send-email-slyfox@inbox.ru \
    --to=slyfox@inbox.ru \
    --cc=qemu-devel@nongnu.org \
    --cc=slyfox@gentoo.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).