* [Qemu-devel] [PATCH 1/2] ./configure: request pkg-config to provide private libs when static linking
@ 2012-01-23 7:41 Sergei Trofimovich
2012-01-23 7:41 ` [Qemu-devel] [PATCH 2/2] ./configure: add link check for nss-smartcard 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
0 siblings, 2 replies; 9+ messages in thread
From: Sergei Trofimovich @ 2012-01-23 7:41 UTC (permalink / raw)
To: qemu-devel; +Cc: Sergei Trofimovich
From: Sergei Trofimovich <slyfox@gentoo.org>
Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
---
configure | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/configure b/configure
index 467e87b..f3dcfba 100755
--- a/configure
+++ b/configure
@@ -553,6 +553,7 @@ for opt do
--static)
static="yes"
LDFLAGS="-static $LDFLAGS"
+ pkg_config="${pkg_config} --static"
;;
--mandir=*) mandir="$optarg"
;;
--
1.7.3.4
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [Qemu-devel] [PATCH 2/2] ./configure: add link check for nss-smartcard
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
2012-01-23 8:51 ` 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
1 sibling, 2 replies; 9+ messages in thread
From: Sergei Trofimovich @ 2012-01-23 7:41 UTC (permalink / raw)
To: qemu-devel; +Cc: Sergei Trofimovich
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
^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [Qemu-devel] [PATCH 2/2] ./configure: add link check for nss-smartcard
2012-01-23 7:41 ` [Qemu-devel] [PATCH 2/2] ./configure: add link check for nss-smartcard Sergei Trofimovich
@ 2012-01-23 8:51 ` Alon Levy
2012-01-29 7:51 ` Sergei Trofimovich
1 sibling, 0 replies; 9+ messages in thread
From: Alon Levy @ 2012-01-23 8:51 UTC (permalink / raw)
To: Sergei Trofimovich; +Cc: qemu-devel, Sergei Trofimovich
On Mon, Jan 23, 2012 at 10:41:38AM +0300, Sergei Trofimovich wrote:
> From: Sergei Trofimovich <slyfox@gentoo.org>
>
Looks good to me.
> 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
>
>
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [Qemu-devel] [PATCH 2/2] ./configure: add link check for nss-smartcard
2012-01-23 7:41 ` [Qemu-devel] [PATCH 2/2] ./configure: add link check for nss-smartcard Sergei Trofimovich
2012-01-23 8:51 ` Alon Levy
@ 2012-01-29 7:51 ` Sergei Trofimovich
1 sibling, 0 replies; 9+ messages in thread
From: Sergei Trofimovich @ 2012-01-29 7:51 UTC (permalink / raw)
To: qemu-devel
[-- Attachment #1: Type: text/plain, Size: 1249 bytes --]
On Mon, 23 Jan 2012 10:41:38 +0300
Sergei Trofimovich <slyfox@inbox.ru> wrote:
> 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(-)
ping
--
Sergei
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 198 bytes --]
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [Qemu-devel] [PATCH 1/2] ./configure: request pkg-config to provide private libs when static linking
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 ` [Qemu-devel] [PATCH 2/2] ./configure: add link check for nss-smartcard Sergei Trofimovich
@ 2012-01-23 10:33 ` Peter Maydell
2012-01-23 17:44 ` [Qemu-devel] [PATCH v2 " Sergei Trofimovich
1 sibling, 1 reply; 9+ messages in thread
From: Peter Maydell @ 2012-01-23 10:33 UTC (permalink / raw)
To: Sergei Trofimovich; +Cc: qemu-devel, Sergei Trofimovich
On 23 January 2012 07:41, Sergei Trofimovich <slyfox@inbox.ru> wrote:
> From: Sergei Trofimovich <slyfox@gentoo.org>
>
> Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
> ---
> configure | 1 +
> 1 files changed, 1 insertions(+), 0 deletions(-)
>
> diff --git a/configure b/configure
> index 467e87b..f3dcfba 100755
> --- a/configure
> +++ b/configure
> @@ -553,6 +553,7 @@ for opt do
> --static)
> static="yes"
> LDFLAGS="-static $LDFLAGS"
> + pkg_config="${pkg_config} --static"
> ;;
> --mandir=*) mandir="$optarg"
> ;;
I guess this works, but it seems a bit fragile, for example
if ! has $pkg_config; then
...
will work, but
if ! has "$pkg_config"; then
...
won't.
-- PMM
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Qemu-devel] [PATCH v2 1/2] ./configure: request pkg-config to provide private libs when static linking
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 ` Sergei Trofimovich
2012-01-23 18:02 ` Peter Maydell
0 siblings, 1 reply; 9+ messages in thread
From: Sergei Trofimovich @ 2012-01-23 17:44 UTC (permalink / raw)
To: qemu-devel; +Cc: Peter Maydell, Sergei Trofimovich
From: Sergei Trofimovich <slyfox@gentoo.org>
Added wrapper around pkg-config to allow:
- safe options injection via ${QEMU_PKG_CONFIG_FLAGS}
- spaces in path to pkg-config
Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
---
configure | 11 ++++++++---
1 files changed, 8 insertions(+), 3 deletions(-)
diff --git a/configure b/configure
index 467e87b..97d51a7 100755
--- a/configure
+++ b/configure
@@ -234,7 +234,11 @@ ld="${LD-${cross_prefix}ld}"
libtool="${LIBTOOL-${cross_prefix}libtool}"
strip="${STRIP-${cross_prefix}strip}"
windres="${WINDRES-${cross_prefix}windres}"
-pkg_config="${PKG_CONFIG-${cross_prefix}pkg-config}"
+pkg_config_exe="${PKG_CONFIG-${cross_prefix}pkg-config}"
+query_pkg_config() {
+ "${pkg_config_exe}" ${QEMU_PKG_CONFIG_FLAGS} "$@"
+}
+pkg_config=query_pkg_config # TODO: sed 's/$pkg_config/pkg_config/g'
sdl_config="${SDL_CONFIG-${cross_prefix}sdl-config}"
# default flags for all hosts
@@ -553,6 +557,7 @@ for opt do
--static)
static="yes"
LDFLAGS="-static $LDFLAGS"
+ QEMU_PKG_CONFIG_FLAGS="--static $QEMU_PKG_CONFIG_FLAGS"
;;
--mandir=*) mandir="$optarg"
;;
@@ -1445,8 +1450,8 @@ fi
##########################################
# pkg-config probe
-if ! has $pkg_config; then
- echo "Error: pkg-config binary '$pkg_config' not found"
+if ! has "$pkg_config_exe"; then
+ echo "Error: pkg-config binary '$pkg_config_exe' not found"
exit 1
fi
--
1.7.8.3
^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [Qemu-devel] [PATCH v2 1/2] ./configure: request pkg-config to provide private libs when static linking
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
0 siblings, 1 reply; 9+ messages in thread
From: Peter Maydell @ 2012-01-23 18:02 UTC (permalink / raw)
To: Sergei Trofimovich; +Cc: qemu-devel, Sergei Trofimovich
On 23 January 2012 17:44, Sergei Trofimovich <slyfox@inbox.ru> wrote:
> @@ -234,7 +234,11 @@ ld="${LD-${cross_prefix}ld}"
> libtool="${LIBTOOL-${cross_prefix}libtool}"
> strip="${STRIP-${cross_prefix}strip}"
> windres="${WINDRES-${cross_prefix}windres}"
> -pkg_config="${PKG_CONFIG-${cross_prefix}pkg-config}"
> +pkg_config_exe="${PKG_CONFIG-${cross_prefix}pkg-config}"
> +query_pkg_config() {
> + "${pkg_config_exe}" ${QEMU_PKG_CONFIG_FLAGS} "$@"
> +}
> +pkg_config=query_pkg_config # TODO: sed 's/$pkg_config/pkg_config/g'
> sdl_config="${SDL_CONFIG-${cross_prefix}sdl-config}"
Either it's worth making the change suggested in the TODO,
in which case we should have another patch in the series which
does it (and drop the TODO comment here), or it's not worth
making the change, in which case we should just drop the TODO
comment.
If we do make the substitution, I think it should be
s/$pkg_config/query_pkg_config/ because having a local
shell function which silently shadows the well-known
pkg_config binary would be pretty confusing.
I'm happy for us not to make the substitution, I think.
-- PMM
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Qemu-devel] [PATCH v3 1/2] ./configure: request pkg-config to provide private libs when static linking
2012-01-23 18:02 ` Peter Maydell
@ 2012-01-23 18:33 ` Sergei Trofimovich
2012-01-29 7:52 ` Sergei Trofimovich
0 siblings, 1 reply; 9+ messages in thread
From: Sergei Trofimovich @ 2012-01-23 18:33 UTC (permalink / raw)
To: qemu-devel; +Cc: Peter Maydell, Sergei Trofimovich
From: Sergei Trofimovich <slyfox@gentoo.org>
Added wrapper around pkg-config to allow:
- safe options injection via ${QEMU_PKG_CONFIG_FLAGS}
- spaces in path to pkg-config
Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
---
configure | 11 ++++++++---
1 files changed, 8 insertions(+), 3 deletions(-)
diff --git a/configure b/configure
index 467e87b..c90e519 100755
--- a/configure
+++ b/configure
@@ -234,7 +234,11 @@ ld="${LD-${cross_prefix}ld}"
libtool="${LIBTOOL-${cross_prefix}libtool}"
strip="${STRIP-${cross_prefix}strip}"
windres="${WINDRES-${cross_prefix}windres}"
-pkg_config="${PKG_CONFIG-${cross_prefix}pkg-config}"
+pkg_config_exe="${PKG_CONFIG-${cross_prefix}pkg-config}"
+query_pkg_config() {
+ "${pkg_config_exe}" ${QEMU_PKG_CONFIG_FLAGS} "$@"
+}
+pkg_config=query_pkg_config
sdl_config="${SDL_CONFIG-${cross_prefix}sdl-config}"
# default flags for all hosts
@@ -553,6 +557,7 @@ for opt do
--static)
static="yes"
LDFLAGS="-static $LDFLAGS"
+ QEMU_PKG_CONFIG_FLAGS="--static $QEMU_PKG_CONFIG_FLAGS"
;;
--mandir=*) mandir="$optarg"
;;
@@ -1445,8 +1450,8 @@ fi
##########################################
# pkg-config probe
-if ! has $pkg_config; then
- echo "Error: pkg-config binary '$pkg_config' not found"
+if ! has "$pkg_config_exe"; then
+ echo "Error: pkg-config binary '$pkg_config_exe' not found"
exit 1
fi
--
1.7.8.3
^ permalink raw reply related [flat|nested] 9+ messages in thread
end of thread, other threads:[~2012-01-29 7:51 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 ` [Qemu-devel] [PATCH 2/2] ./configure: add link check for nss-smartcard Sergei Trofimovich
2012-01-23 8:51 ` 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
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).