From: Thomas De Schampheleire <patrickdepinguin@gmail.com>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH] infra: simplify .la/.pc fixup commands
Date: Sun, 29 Jun 2014 14:16:25 +0200 [thread overview]
Message-ID: <6d38fb9f8bb567d8a4a2.1404044185@localhost> (raw)
The commands fixing up .la and .pc files in the pkg-generic and
pkg-autotools infrastructures can be simplified a little, since STAGING_DIR
already contains BASE_DIR.
Additionally, this patch rewords the comment in pkg-autotools that explains
the replacements.
Suggested-by: Arnout Vandecappelle <arnout@mind.be>
Signed-off-by: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>
---
package/pkg-autotools.mk | 19 ++++++++-----------
package/pkg-generic.mk | 7 +++----
2 files changed, 11 insertions(+), 15 deletions(-)
diff -r 4d6d2ac6a601 -r 6d38fb9f8bb5 package/pkg-autotools.mk
--- a/package/pkg-autotools.mk Thu Jun 19 18:13:36 2014 +0200
+++ b/package/pkg-autotools.mk Sun Jun 29 13:44:48 2014 +0200
@@ -267,25 +267,22 @@
# Most autotools packages install libtool .la files alongside any
# installed libraries. These .la files sometimes refer to paths
# relative to the sysroot, which libtool will interpret as absolute
-# paths to host libraries instead of the target libraries. Since we
-# configure with --prefix=/usr, such absolute paths start with
-# /usr. So we add $(STAGING_DIR) in front of any path that starts with
-# /usr.
+# paths to host libraries instead of the target libraries. Since this
+# is not what we want, these paths are fixed by prefixing them with
+# $(STAGING_DIR). As we configure with --prefix=/usr, this fix
+# needs to be applied to any path that starts with /usr.
#
# To protect against the case that the output directory itself is
# under /usr, we first substitute away any occurences of the output
-# directory to @BASE_DIR at .
+# directory as @BASE_DIR at .
#
ifndef $(2)_INSTALL_STAGING_CMDS
define $(2)_INSTALL_STAGING_CMDS
$$(TARGET_MAKE_ENV) $$($$(PKG)_MAKE_ENV) $$($$(PKG)_MAKE) $$($$(PKG)_INSTALL_STAGING_OPT) -C $$($$(PKG)_SRCDIR)
- for i in $$$$(find $$(STAGING_DIR)/usr/lib* -name "*.la"); do \
+ find $$(STAGING_DIR)/usr/lib* -name "*.la" | xargs \
$$(SED) "s:$$(BASE_DIR):@BASE_DIR@:g" \
- -e "s:\(['= ]\)/usr:\\1 at STAGING_DIR@/usr:g" \
- -e "s:@STAGING_DIR@:$$(STAGING_DIR):g" \
- -e "s:@BASE_DIR@:$$(BASE_DIR):g" \
- $$$$i; \
- done
+ -e "s:\(['= ]\)/usr:\\1$$(STAGING_DIR)/usr:g" \
+ -e "s:@BASE_DIR@:$$(BASE_DIR):g"
endef
endif
diff -r 4d6d2ac6a601 -r 6d38fb9f8bb5 package/pkg-generic.mk
--- a/package/pkg-generic.mk Thu Jun 19 18:13:36 2014 +0200
+++ b/package/pkg-generic.mk Sun Jun 29 13:44:48 2014 +0200
@@ -202,10 +202,9 @@
$(Q)if test -n "$($(PKG)_CONFIG_SCRIPTS)" ; then \
$(call MESSAGE,"Fixing package configuration files") ;\
$(SED) "s,$(BASE_DIR), at BASE_DIR@,g" \
- -e "s,^\(exec_\)\?prefix=.*,\1prefix=@STAGING_DIR@/usr,g" \
- -e "s,-I/usr/,-I at STAGING_DIR@/usr/,g" \
- -e "s,-L/usr/,-L at STAGING_DIR@/usr/,g" \
- -e "s, at STAGING_DIR@,$(STAGING_DIR),g" \
+ -e "s,^\(exec_\)\?prefix=.*,\1prefix=$(STAGING_DIR)/usr,g" \
+ -e "s,-I/usr/,-I$(STAGING_DIR)/usr/,g" \
+ -e "s,-L/usr/,-L$(STAGING_DIR)/usr/,g" \
-e "s, at BASE_DIR@,$(BASE_DIR),g" \
$(addprefix $(STAGING_DIR)/usr/bin/,$($(PKG)_CONFIG_SCRIPTS)) ;\
fi
next reply other threads:[~2014-06-29 12:16 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-06-29 12:16 Thomas De Schampheleire [this message]
2014-06-29 14:15 ` [Buildroot] [PATCH] infra: simplify .la/.pc fixup commands Thomas Petazzoni
2014-06-29 14:47 ` Thomas De Schampheleire
2014-06-29 14:48 ` Thomas Petazzoni
2014-06-29 15:42 ` Thomas De Schampheleire
2014-06-30 7:57 ` Thomas De Schampheleire
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=6d38fb9f8bb567d8a4a2.1404044185@localhost \
--to=patrickdepinguin@gmail.com \
--cc=buildroot@busybox.net \
/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 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.