Patchwork [1/2] ./configure: request pkg-config to provide private libs when static linking

login
register
mail settings
Submitter Sergei Trofimovich
Date Jan. 23, 2012, 7:41 a.m.
Message ID <1327304498-11274-1-git-send-email-slyfox@inbox.ru>
Download mbox | patch
Permalink /patch/137295/
State New
Headers show

Comments

Sergei Trofimovich - Jan. 23, 2012, 7:41 a.m.
From: Sergei Trofimovich <slyfox@gentoo.org>

Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
---
 configure |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
Peter Maydell - Jan. 23, 2012, 10:33 a.m.
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

Patch

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"
   ;;