All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [git commit] package/apr-util: fix build with per-package directories
@ 2020-02-18 22:16 Peter Korsgaard
  0 siblings, 0 replies; only message in thread
From: Peter Korsgaard @ 2020-02-18 22:16 UTC (permalink / raw)
  To: buildroot

commit: https://git.buildroot.net/buildroot/commit/?id=84b4c19e551288911a230c2b73e96bc6e2ed12f9
branch: https://git.buildroot.net/buildroot/commit/?id=refs/heads/master

With per-package directories support enabled, the build of apr-util
fails, for two reasons:

 - The rules.mk file is generated by the 'apr' package, and then
   copied into the 'apr-util' source directory. This is done by the
   'apr-util' build process. Unfortunately, this rules.mk file has a
   number of hardcoded paths: to the compiler and to the libtool
   script.

   Due to this, the compiler from the 'apr' per-package directory gets
   used. But this compiler uses the 'apr' package sysroot, which does
   not have all the dependencies of the 'apr-util' package, causing
   the build to fail because <expat.h> is not found.

 - Similarly, the libtool script itself has some hardcoded paths,
   which make it use the compiler/linker from the 'apr' per-package
   directory, so it does not find the expat library.

We fix both issues by doing the necessary replacement in both rules.mk
and libtool.

Fixes:

  http://autobuild.buildroot.net/results/2a67b5d58f79348e20a972125e4797eff5585716/

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
---
 package/apr-util/apr-util.mk | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/package/apr-util/apr-util.mk b/package/apr-util/apr-util.mk
index b006964ccb..53b633b159 100644
--- a/package/apr-util/apr-util.mk
+++ b/package/apr-util/apr-util.mk
@@ -15,6 +15,16 @@ APR_UTIL_CONF_OPTS = \
 	--with-apr=$(STAGING_DIR)/usr/bin/apr-1-config
 APR_UTIL_CONFIG_SCRIPTS = apu-1-config
 
+ifeq ($(BR2_PER_PACKAGE_DIRECTORIES),y)
+define APR_UTIL_FIX_RULES_MK_LIBTOOL
+	$(SED) 's,$(PER_PACKAGE_DIR)/apr/,$(PER_PACKAGE_DIR)/apr-util/,g' \
+		$(@D)/build/rules.mk
+	$(SED) 's,$(PER_PACKAGE_DIR)/apr/,$(PER_PACKAGE_DIR)/apr-util/,g' \
+		$(STAGING_DIR)/usr/build-1/libtool
+endef
+APR_UTIL_POST_CONFIGURE_HOOKS += APR_UTIL_FIX_RULES_MK_LIBTOOL
+endif
+
 # When iconv is available, then use it to provide charset conversion
 # features.
 APR_UTIL_DEPENDENCIES += $(if $(BR2_PACKAGE_LIBICONV),libiconv)

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2020-02-18 22:16 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-18 22:16 [Buildroot] [git commit] package/apr-util: fix build with per-package directories Peter Korsgaard

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.