All of lore.kernel.org
 help / color / mirror / Atom feed
From: Luca Ceresoli <luca@lucaceresoli.net>
To: buildroot@busybox.net
Subject: [Buildroot] [RFCv1 10/11] toolchain-external: convert to the package infrastructure
Date: Fri, 27 Sep 2013 16:24:33 +0200	[thread overview]
Message-ID: <52459521.9080809@lucaceresoli.net> (raw)
In-Reply-To: <1378416469-17708-11-git-send-email-thomas.petazzoni@free-electrons.com>

Thomas Petazzoni wrote:
> This commit converts the 'toolchain-external' logic to the package
> infrastructure.
>
> The TOOLCHAIN_EXTERNAL_DIR variable (which points to where the
> toolchain is located) is renamed to TOOLCHAIN_EXTERNAL_INSTALL_DIR,
> because the former conflicts with the package infrastructure (which
> defines the <pkg>_DIR variable for each package as pointing to its
> build directory).
>
> The new _SOURCE_ADDONS mechanism is used for Blackfin toolchains.
>
> The extract, configuration and installation steps are converted inside
> the <pkg>_EXTRACT_CMDS, <pkg>_CONFIGURE_CMDS and
> <pkg>_INSTALL_STAGING_CMDS.
>
> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
> ---

...

>   # Checks for an already installed toolchain: check the toolchain
>   # location, check that it supports sysroot, and then verify that it
>   # matches the configuration provided in Buildroot: ABI, C++ support,
>   # type of C library and all C library features.
> -$(STAMP_DIR)/ext-toolchain-checked: $(TOOLCHAIN_EXTERNAL_DEPENDENCIES)
> -	@$(call MESSAGE,"Checking external toolchain settings")
> +define TOOLCHAIN_EXTERNAL_CONFIGURE_CMDS
>   	$(Q)$(call check_cross_compiler_exists,$(TOOLCHAIN_EXTERNAL_CC))
>   	$(Q)LIBC_A_LOCATION=`readlink -f $$(LANG=C $(TOOLCHAIN_EXTERNAL_CC) -print-file-name=libc.a)` ; \
>   	SYSROOT_DIR=`echo $${LIBC_A_LOCATION} | sed -r -e 's:usr/lib(32|64)?/(.*/)?libc\.a::'` ; \
> @@ -385,7 +368,7 @@ $(STAMP_DIR)/ext-toolchain-checked: $(TOOLCHAIN_EXTERNAL_DEPENDENCIES)
>   	else \
>   		$(call check_glibc,$${SYSROOT_DIR}) ; \
>   	fi
> -	$(Q)touch $@
> +endef

...

> -toolchain-external: dependencies $(HOST_DIR)/usr/bin/ext-toolchain-wrapper
> +# Even though we're installing things in both the staging, the host
> +# and the target directory, we do everything within the
> +# install-staging step, arbitrarily.
> +define TOOLCHAIN_EXTERNAL_INSTALL_STAGING_CMDS
> +	$(TOOLCHAIN_EXTERNAL_INSTALL_CORE)
> +	$(TOOLCHAIN_EXTERNAL_INSTALL_BFIN_FDPIC)
> +	$(TOOLCHAIN_EXTERNAL_INSTALL_BFIN_FLAT)
> +	$(TOOLCHAIN_EXTERNAL_INSTALL_WRAPPER)
> +endef

At first sight, hijacking the configure step to check toolchain settings 
and the
install staging step to install into host and target does not look very 
clean.
I think here we are pushing the package infrastructure a bit beyond what 
it is
conceived for.

Nevertheless this it not a very dirty hack (just a bit) and makes the 
whole file
a little simpler. Not to mention this unlocks new features, which is the 
final
goalof the whole patchset, isn't it?

Overall I think the pros are stronger than the cons here. And extending the
package infra just to make this one file more polite wouldn't be worth 
the effort,
I suppose. So:

Acked-by: Luca Ceresoli <luca@lucaceresoli.net>

-- 
Luca

  parent reply	other threads:[~2013-09-27 14:24 UTC|newest]

Thread overview: 49+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-05 21:27 [Buildroot] [RFCv1 00/11] Convert toolchain backends to packages to fix source/external-deps/legal-info Thomas Petazzoni
2013-09-05 21:27 ` [Buildroot] [RFCv1 01/11] Makefile: make $(BUILD_DIR)/.root rule idempotent Thomas Petazzoni
2013-09-08 12:06   ` Thomas De Schampheleire
2013-09-08 13:13   ` Danomi Manchego
2013-09-08 13:30     ` Thomas Petazzoni
2013-09-08 16:59       ` Danomi Manchego
2013-09-08 17:31         ` Thomas Petazzoni
2013-09-09  8:54   ` Luca Ceresoli
2013-09-09 21:38   ` Peter Korsgaard
2013-09-10  7:23     ` Thomas Petazzoni
2013-09-05 21:27 ` [Buildroot] [RFCv1 02/11] toolchain-crosstool-ng: remove support Thomas Petazzoni
2013-09-06  9:35   ` Yann E. MORIN
2013-09-06 15:53   ` Yann E. MORIN
2013-09-06 15:56     ` Thomas Petazzoni
2013-09-08 12:52   ` Thomas De Schampheleire
2013-09-13 16:10   ` Luca Ceresoli
2013-09-05 21:27 ` [Buildroot] [RFCv1 03/11] toolchain-external: make ext-tool.mk includable in all cases Thomas Petazzoni
2013-09-08 15:31   ` Thomas De Schampheleire
2013-09-05 21:27 ` [Buildroot] [RFCv1 04/11] toolchain: move helpers.mk into toolchain-external/ Thomas Petazzoni
2013-09-08 17:50   ` Thomas De Schampheleire
2013-09-13 16:07   ` Luca Ceresoli
2013-09-05 21:27 ` [Buildroot] [RFCv1 05/11] toolchain: introduce a virtual package Thomas Petazzoni
2013-09-13 16:24   ` Luca Ceresoli
2013-09-15 14:27   ` Thomas De Schampheleire
2013-09-05 21:27 ` [Buildroot] [RFCv1 06/11] toolchain-buildroot: convert to the package infrastructure Thomas Petazzoni
2013-09-15 14:30   ` Thomas De Schampheleire
2013-09-05 21:27 ` [Buildroot] [RFCv1 07/11] toolchain: intermediate .mk files no longer needed Thomas Petazzoni
2013-09-15 14:33   ` Thomas De Schampheleire
2013-09-05 21:27 ` [Buildroot] [RFCv1 08/11] package: package-based implementation of source, external-deps and legal-info Thomas Petazzoni
2013-09-15 19:29   ` Thomas De Schampheleire
2013-09-15 20:09     ` Thomas Petazzoni
2013-09-16  1:21       ` Thomas De Schampheleire
2013-09-05 21:27 ` [Buildroot] [RFCv1 09/11] package: add a <pkg>_SOURCE_ADDONS variable Thomas Petazzoni
2013-09-16 13:39   ` Thomas De Schampheleire
2013-09-16 18:31     ` Thomas Petazzoni
2013-09-16 19:20       ` Arnout Vandecappelle
2013-09-17  7:21         ` Thomas De Schampheleire
2013-09-27 14:27           ` Luca Ceresoli
2013-09-05 21:27 ` [Buildroot] [RFCv1 10/11] toolchain-external: convert to the package infrastructure Thomas Petazzoni
2013-09-16 13:29   ` Thomas De Schampheleire
2013-09-27 14:21     ` Luca Ceresoli
2013-09-27 14:24   ` Luca Ceresoli [this message]
2013-09-05 21:27 ` [Buildroot] [RFCv1 11/11] dependencies: remove useless targets Thomas Petazzoni
2013-09-06  8:28 ` [Buildroot] [RFCv1 00/11] Convert toolchain backends to packages to fix source/external-deps/legal-info Fabio Porcedda
2013-09-06  8:38   ` Thomas Petazzoni
2013-09-06  8:50     ` Fabio Porcedda
2013-09-06 12:37   ` Ryan Barnett
2013-09-06  8:57 ` Jérôme Pouiller
2013-09-06  9:05   ` Thomas Petazzoni

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=52459521.9080809@lucaceresoli.net \
    --to=luca@lucaceresoli.net \
    --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.