From: Arnout Vandecappelle <arnout@mind.be>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH v7 06/18] core: make host *-config scripts relocatable
Date: Thu, 10 Mar 2016 01:12:33 +0100 [thread overview]
Message-ID: <56E0BBF1.8020604@mind.be> (raw)
In-Reply-To: <1457564339-27294-7-git-send-email-s.martin49@gmail.com>
On 03/09/16 23:58, Samuel Martin wrote:
> This change adjusts the _CONFIG_SCRIPTS hook to set add {exec_,}prefix computed
> relatively to the script location.
>
> This patch only fixes *-config scripts located in the host area, those
> from the target and staging area are already handled.
>
> This hook is a kind of brute-force sed on all files matching '*-config'
> in the $(HOST_DIR)/usr/bin directory. This allows correctly handle
> script whose name may depends on the host system, not the target
> configuration (e.g. ncurses can be configured for the target to be
> ncurses6w, so ncurses6w-config ; whereas for the host it will be
> ncurses5, so ncurses5-config).
> Since there way less host packages than target ones, it is reasonable to
> assume that processing all *-config scripts found when a host package
> (whose target package set the *_CONFIG_SCRIPTS variable) is fairly short
> and does not add its overhead not even noticeable.
I don't agree with this on the principle that we like to handle things
explicitly, rather than having some automagic stuff that is hard to pinpoint. So
I think we should just set the appropriate HOST_*_CONFIG_SCRIPTS variables. To
alleviate the situation, we could add a ?= in generic-package, so only the cases
where the host script deviates from the target script (or where there is no
target package) have to be handled. Probably just ncurses.
Regards,
Arnout
>
> Signed-off-by: Samuel Martin <s.martin49@gmail.com>
>
> ---
> changes v6->v7:
> - none
>
> changes v5->v6:
> - new patch
> ---
> package/pkg-generic.mk | 12 ++++++++++++
> 1 file changed, 12 insertions(+)
>
> diff --git a/package/pkg-generic.mk b/package/pkg-generic.mk
> index ffa21ee..845c8d3 100644
> --- a/package/pkg-generic.mk
> +++ b/package/pkg-generic.mk
> @@ -207,6 +207,18 @@ $(BUILD_DIR)/%/.stamp_host_installed:
> $(foreach hook,$($(PKG)_PRE_INSTALL_HOOKS),$(call $(hook))$(sep))
> +$($(PKG)_INSTALL_CMDS)
> $(foreach hook,$($(PKG)_POST_INSTALL_HOOKS),$(call $(hook))$(sep))
> + $(Q)if test -n "$($(RAWNAME)_CONFIG_SCRIPTS)" ; then \
> + $(call MESSAGE,"Fixing package configuration files") ;\
> + ls $(HOST_DIR)/usr/bin/*-config 2>/dev/null |\
> + xargs --no-run-if-empty \
> + $(SED) "s,$(BASE_DIR), at BASE_DIR@,g" \
> + -e "s,$(HOST_DIR), at HOST_DIR@,g" \
> + -e "s,^\(exec_\)\?prefix=.*,\1prefix=\`dirname \$$0\`/../../usr,g" \
> + -e "s,-I/usr/,-I at HOST_DIR@/usr/,g" \
> + -e "s,-L/usr/,-L at HOST_DIR@/usr/,g" \
> + -e "s, at HOST_DIR@,$(HOST_DIR),g" \
> + -e "s, at BASE_DIR@,$(BASE_DIR),g" ;\
> + fi
> @$(call step_end,install-host)
> $(Q)touch $@
>
>
--
Arnout Vandecappelle arnout at mind be
Senior Embedded Software Architect +32-16-286500
Essensium/Mind http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint: 7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF
next prev parent reply other threads:[~2016-03-10 0:12 UTC|newest]
Thread overview: 57+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-03-09 22:58 [Buildroot] [PATCH v7 00/18] Relocatable SDK / build machine leaks Samuel Martin
2016-03-09 22:58 ` [Buildroot] [PATCH v7 01/18] package/linux-headers: cleanup installation Samuel Martin
2016-03-09 23:09 ` Yann E. MORIN
2016-03-12 8:46 ` Samuel Martin
2016-03-22 22:10 ` Yann E. MORIN
2016-03-09 22:58 ` [Buildroot] [PATCH v7 02/18] core: use $(CURDIR) to set TOPDIR Samuel Martin
2016-03-09 23:10 ` Yann E. MORIN
2016-03-09 23:51 ` Arnout Vandecappelle
2016-03-10 20:45 ` Thomas Petazzoni
2016-03-10 22:50 ` Thomas Petazzoni
2016-03-09 22:58 ` [Buildroot] [PATCH v7 03/18] core: re-enter make if $(CURDIR) or $(O) are not absolute canonical path Samuel Martin
2016-03-09 23:15 ` Yann E. MORIN
2016-03-12 8:48 ` Samuel Martin
[not found] ` <CAFt09wNvtXGcfZ3PFZOgGu+bDvp6mEr44uwxa_ryjeP6DDQKBQ@mail.gmail.com>
2016-03-21 1:45 ` Matthew Weber
2016-03-21 5:21 ` Samuel Martin
2016-03-21 11:40 ` Matthew Weber
2016-03-22 3:03 ` Matthew Weber
2016-03-22 5:55 ` Samuel Martin
2016-03-22 11:10 ` Matthew Weber
2016-03-22 22:07 ` Yann E. MORIN
2016-03-22 23:11 ` Matthew Weber
2016-03-23 0:54 ` Matthew Weber
2016-03-23 1:36 ` Matthew Weber
2016-03-25 6:31 ` Samuel Martin
2016-03-26 12:21 ` Arnout Vandecappelle
2016-03-23 17:41 ` Yann E. MORIN
2016-03-09 22:58 ` [Buildroot] [PATCH v7 04/18] core: staging symlink uses a relative path when possible Samuel Martin
2016-03-09 23:20 ` Yann E. MORIN
2016-03-10 20:47 ` Thomas Petazzoni
2016-03-12 9:11 ` Samuel Martin
2016-03-12 13:12 ` Thomas Petazzoni
2016-03-09 22:58 ` [Buildroot] [PATCH v7 05/18] core: make staging *-config scripts relocatable Samuel Martin
2016-03-09 23:24 ` Yann E. MORIN
2016-03-10 0:07 ` Arnout Vandecappelle
2016-03-12 9:22 ` Samuel Martin
2016-03-09 22:58 ` [Buildroot] [PATCH v7 06/18] core: make host " Samuel Martin
2016-03-10 0:12 ` Arnout Vandecappelle [this message]
2016-03-10 12:30 ` Samuel Martin
2016-03-10 20:50 ` Thomas Petazzoni
2016-03-09 22:58 ` [Buildroot] [PATCH v7 07/18] package/pkgconf: make the pkg-config wrapper relocatable Samuel Martin
2016-03-10 20:53 ` Thomas Petazzoni
2016-03-10 21:33 ` Peter Korsgaard
2016-03-09 22:58 ` [Buildroot] [PATCH v7 08/18] support/scripts: add fix-rpath script + a bunch of helpers Samuel Martin
2016-03-09 22:58 ` [Buildroot] [PATCH v7 09/18] core: add HOST_SANITIZE_RPATH_HOOK to TARGET_FINALIZE_HOOKS Samuel Martin
2016-03-09 22:58 ` [Buildroot] [PATCH v7 10/18] core: add {TARGET, STAGING}_SANITIZE_RPATH_HOOK " Samuel Martin
2016-03-09 22:58 ` [Buildroot] [PATCH v7 11/18] package/speex: remove no longer needed hook Samuel Martin
2016-03-09 22:58 ` [Buildroot] [PATCH v7 12/18] toolchain: add post-install hooks making the toolchain relocatable Samuel Martin
2016-03-09 22:58 ` [Buildroot] [PATCH v7 13/18] support/scripts: update check-host-rpath to use the shell helpers Samuel Martin
2016-03-09 22:58 ` [Buildroot] [PATCH v7 14/18] support/scripts/check-host-rpath: silent find command Samuel Martin
2016-03-10 0:15 ` Arnout Vandecappelle
2016-03-09 22:58 ` [Buildroot] [PATCH v7 15/18] support/scripts/check-host-rpath: also check HOST_DIR/{bin, sbin} Samuel Martin
2016-03-10 0:16 ` Arnout Vandecappelle
2016-03-09 22:58 ` [Buildroot] [PATCH v7 16/18] support/scripts: add check-host-leaks script + all needed helpers Samuel Martin
2016-03-27 22:38 ` Arnout Vandecappelle
2016-03-09 22:58 ` [Buildroot] [PATCH v7 17/18] core: add check-leaks-in-{target, host, staging} targets Samuel Martin
2016-03-09 22:58 ` [Buildroot] [PATCH v7 18/18] docs/manual: document how to debug shell script Samuel Martin
2016-03-10 0:21 ` Arnout Vandecappelle
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=56E0BBF1.8020604@mind.be \
--to=arnout@mind.be \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox