Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [pull request] Pull request for branch for-2011.02/pkg-config-fix
@ 2010-12-28 11:19 Thomas Petazzoni
  2010-12-28 11:19 ` [Buildroot] [PATCH 1/1] package: correct usage of PKG_CONFIG_LIBDIR and PKG_CONFIG_PATH Thomas Petazzoni
  0 siblings, 1 reply; 3+ messages in thread
From: Thomas Petazzoni @ 2010-12-28 11:19 UTC (permalink / raw)
  To: buildroot

The following changes since commit 6527001c9d42b95c76b7689ed8eeecd8d17740cd:
  Peter Korsgaard (1):
        php: fix gmp extension build after libgmp bump

are available in the git repository at:

  git://git.busybox.net/~tpetazzoni/git/buildroot for-2011.02/pkg-config-fix

Thomas Petazzoni (1):
      package: correct usage of PKG_CONFIG_LIBDIR and PKG_CONFIG_PATH

 package/Makefile.in |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

Thanks,
-- 
Thomas Petazzoni

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Buildroot] [PATCH 1/1] package: correct usage of PKG_CONFIG_LIBDIR and PKG_CONFIG_PATH
  2010-12-28 11:19 [Buildroot] [pull request] Pull request for branch for-2011.02/pkg-config-fix Thomas Petazzoni
@ 2010-12-28 11:19 ` Thomas Petazzoni
  2010-12-28 12:30   ` Peter Korsgaard
  0 siblings, 1 reply; 3+ messages in thread
From: Thomas Petazzoni @ 2010-12-28 11:19 UTC (permalink / raw)
  To: buildroot

Our usage of PKG_CONFIG_LIBDIR and PKG_CONFIG_PATH was
incorrect. According to pkg-config's documentation:

  PKG_CONFIG_PATH

     A colon-separated (on Windows, semicolon-separated) list of
     directories to search for .pc files.  The default directory will
     always be searched after searching the path; the default is
     libdir/pkgconfig:datadir/pkgconfig where libdir is the libdir
     where pkg-config and datadir is the datadir where pkg-config was
     installed.

  PKG_CONFIG_LIBDIR

     Replaces the default pkg-config search directory.

In TARGET_CONFIGURE_OPTS (used to build packages for the target), we
were doing:

 PKG_CONFIG_PATH="$(STAGING_DIR)/usr/lib/pkgconfig:$(PKG_CONFIG_PATH)"

This is incorrect for two reasons:

 * Adding $(PKG_CONFIG_PATH) to the PKG_CONFIG_PATH is useless, as
   PKG_CONFIG_PATH only *adds* new paths to the existing search paths.

 * PKG_CONFIG_PATH keeps default path (/usr/lib/pkgconfig) in the
   search path, which is incorrect for target packages: we should only
   look in $(STAGING_DIR)/usr/lib/pkgconfig. Lionel was hit by an
   issue caused by this: while compiling packages for the target, it
   was looking at .pc files in /usr/lib/pkgconfig on his host machine.

So instead, we just use PKG_CONFIG_LIBDIR with
$(STAGING_DIR)/usr/lib/pkgconfig.

In HOST_CONFIGURE_OPTS (used to build packages for the host), we were
doing:

   PKG_CONFIG_LIBDIR="$(HOST_DIR)/usr/lib/pkgconfig"

But there's no real reason to use PKG_CONFIG_LIBDIR here: as we are
compiling for the host, we may well have some interesting libraries in
/usr/lib/pkgconfig. So searching through them after
$(HOST_DIR)/usr/lib/pkgconfig sounds like the right thing to do.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
---
 package/Makefile.in |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/package/Makefile.in b/package/Makefile.in
index 71c8dbc..4f1f1e4 100644
--- a/package/Makefile.in
+++ b/package/Makefile.in
@@ -219,7 +219,7 @@ TARGET_CONFIGURE_OPTS=PATH=$(TARGET_PATH) \
 		FCFLAGS="$(TARGET_FCFLAGS)" \
 		PKG_CONFIG_SYSROOT_DIR="$(STAGING_DIR)" \
 		PKG_CONFIG="$(PKG_CONFIG_HOST_BINARY)" \
-		PKG_CONFIG_PATH="$(STAGING_DIR)/usr/lib/pkgconfig:$(PKG_CONFIG_PATH)" \
+		PKG_CONFIG_LIBDIR="$(STAGING_DIR)/usr/lib/pkgconfig" \
 		PERLLIB="$(HOST_DIR)/usr/lib/perl" \
 		STAGING_DIR="$(STAGING_DIR)"
 
@@ -241,7 +241,7 @@ HOST_CONFIGURE_OPTS=PATH=$(HOST_PATH) \
 		PKG_CONFIG_ALLOW_SYSTEM_CFLAGS=1 \
 		PKG_CONFIG_ALLOW_SYSTEM_LIBS=1 \
 		PKG_CONFIG="$(PKG_CONFIG_HOST_BINARY)" \
-		PKG_CONFIG_LIBDIR="$(HOST_DIR)/usr/lib/pkgconfig" \
+		PKG_CONFIG_PATH="$(HOST_DIR)/usr/lib/pkgconfig" \
 		PERLLIB="$(HOST_DIR)/usr/lib/perl" \
 		LD_LIBRARY_PATH="$(HOST_DIR)/usr/lib:$(LD_LIBRARY_PATH)"
 
-- 
1.7.0.4

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [Buildroot] [PATCH 1/1] package: correct usage of PKG_CONFIG_LIBDIR and PKG_CONFIG_PATH
  2010-12-28 11:19 ` [Buildroot] [PATCH 1/1] package: correct usage of PKG_CONFIG_LIBDIR and PKG_CONFIG_PATH Thomas Petazzoni
@ 2010-12-28 12:30   ` Peter Korsgaard
  0 siblings, 0 replies; 3+ messages in thread
From: Peter Korsgaard @ 2010-12-28 12:30 UTC (permalink / raw)
  To: buildroot

>>>>> "Thomas" == Thomas Petazzoni <thomas.petazzoni@free-electrons.com> writes:

Hi,

 Thomas> In TARGET_CONFIGURE_OPTS (used to build packages for the target), we
 Thomas> were doing:

 Thomas>  PKG_CONFIG_PATH="$(STAGING_DIR)/usr/lib/pkgconfig:$(PKG_CONFIG_PATH)"

 Thomas> This is incorrect for two reasons:

 Thomas>  * Adding $(PKG_CONFIG_PATH) to the PKG_CONFIG_PATH is useless, as
 Thomas>    PKG_CONFIG_PATH only *adds* new paths to the existing search paths.

 Thomas>  * PKG_CONFIG_PATH keeps default path (/usr/lib/pkgconfig) in the
 Thomas>    search path, which is incorrect for target packages: we should only
 Thomas>    look in $(STAGING_DIR)/usr/lib/pkgconfig. Lionel was hit by an
 Thomas>    issue caused by this: while compiling packages for the target, it
 Thomas>    was looking at .pc files in /usr/lib/pkgconfig on his host machine.

Hmm, but we compile a dedicated (host) pkg-config for this, where we
have set --pc-path=staging, so none of this should be needed, right?
(with the possible exception of ensuring PKG_CONFIG_PATH isn't set in
the environment).

 Thomas>    PKG_CONFIG_LIBDIR="$(HOST_DIR)/usr/lib/pkgconfig"

 Thomas> But there's no real reason to use PKG_CONFIG_LIBDIR here: as we are
 Thomas> compiling for the host, we may well have some interesting libraries in
 Thomas> /usr/lib/pkgconfig. So searching through them after
 Thomas> $(HOST_DIR)/usr/lib/pkgconfig sounds like the right thing to do.

That seems wrong as our pkg-config looks in staging by default, and
random host libraries shouldn't get picked up if that then breaks the
build for people without those libs.

-- 
Bye, Peter Korsgaard

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2010-12-28 12:30 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-12-28 11:19 [Buildroot] [pull request] Pull request for branch for-2011.02/pkg-config-fix Thomas Petazzoni
2010-12-28 11:19 ` [Buildroot] [PATCH 1/1] package: correct usage of PKG_CONFIG_LIBDIR and PKG_CONFIG_PATH Thomas Petazzoni
2010-12-28 12:30   ` Peter Korsgaard

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox