Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
To: buildroot@busybox.net
Subject: [Buildroot] [RFCv1 1/4] toolchain-external: split target installation from staging installation
Date: Tue, 10 Jun 2014 10:04:46 +0200	[thread overview]
Message-ID: <20140610100446.2adc73c4@free-electrons.com> (raw)
In-Reply-To: <20140609214928.GJ3512@free.fr>

Dear Yann E. MORIN,

On Mon, 9 Jun 2014 23:49:28 +0200, Yann E. MORIN wrote:

> > +define TOOLCHAIN_EXTERNAL_INSTALL_SYSROOT_LIBS
> 
> Maybe the code from here...
> 
> > +	$(Q)SYSROOT_DIR="$(call toolchain_find_sysroot,$(TOOLCHAIN_EXTERNAL_CC))" ; \
> > +	if test -z "$${SYSROOT_DIR}" ; then \
> > +		@echo "External toolchain doesn't support --sysroot. Cannot use." ; \
> > +		exit 1 ; \
> > +	fi ; \
> > +	ARCH_SYSROOT_DIR="$(call toolchain_find_sysroot,$(TOOLCHAIN_EXTERNAL_CC) $(TOOLCHAIN_EXTERNAL_CFLAGS))" ; \
> > +	ARCH_LIB_DIR="$(call toolchain_find_libdir,$(TOOLCHAIN_EXTERNAL_CC) $(TOOLCHAIN_EXTERNAL_CFLAGS))" ; \
> > +	SUPPORT_LIB_DIR="" ; \
> > +	if test `find $${ARCH_SYSROOT_DIR} -name 'libstdc++.a' | wc -l` -eq 0 ; then \
> > +		LIBSTDCPP_A_LOCATION=$$(LANG=C $(TOOLCHAIN_EXTERNAL_CC) $(TOOLCHAIN_EXTERNAL_CFLAGS) -print-file-name=libstdc++.a) ; \
> > +		if [ -e "$${LIBSTDCPP_A_LOCATION}" ]; then \
> > +			SUPPORT_LIB_DIR=`readlink -f $${LIBSTDCPP_A_LOCATION} | sed -r -e 's:libstdc\+\+\.a::'` ; \
> > +		fi ; \
> > +	fi ; \
> > +	ARCH_SUBDIR=`echo $${ARCH_SYSROOT_DIR} | sed -r -e "s:^$${SYSROOT_DIR}(.*)/$$:\1:"` ; \
> 
> ... to here could be moved to a common function, so it can be shared
> between the staging and target functions?

How do you suggest this to be done? The problem is that we need those
variables to be defined within the shell block that follows. I don't
see any easy way to factorize that. Or maybe I should just take this
opportunity, and move some of this crap into a helper shell script,
which will avoid these horrible shell blocks with lots of quoting and
backslashes.

I'll take a look at this.

Best regards,

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

  reply	other threads:[~2014-06-10  8:04 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-07 21:46 [Buildroot] [RFCv1 0/4] Generating a graph of the size installed by each package Thomas Petazzoni
2014-06-07 21:46 ` [Buildroot] [RFCv1 1/4] toolchain-external: split target installation from staging installation Thomas Petazzoni
2014-06-09 21:49   ` Yann E. MORIN
2014-06-10  8:04     ` Thomas Petazzoni [this message]
2014-06-10 16:49       ` Yann E. MORIN
2014-06-07 21:46 ` [Buildroot] [RFCv1 2/4] pkg-generic: add step_pkg_size global instrumentation hook Thomas Petazzoni
2014-06-08  2:56   ` Baruch Siach
2014-06-08  8:19     ` Thomas Petazzoni
2014-06-09 22:02   ` Yann E. MORIN
2014-06-10 16:42     ` Jérôme Pouiller
     [not found]     ` <3156840.4l9buZIenR@sagittea>
2014-06-10 16:58       ` Yann E. MORIN
2014-06-10 17:37         ` Jérôme Pouiller
2014-06-24 16:36   ` Arnout Vandecappelle
2014-06-24 16:41     ` Thomas Petazzoni
2014-06-24 16:53     ` Yann E. MORIN
2014-06-07 21:46 ` [Buildroot] [RFCv1 3/4] support/scripts: add graph-size script Thomas Petazzoni
2014-06-09 22:06   ` Yann E. MORIN
2014-06-07 21:46 ` [Buildroot] [RFCv1 4/4] Makefile: implement a graph-size target Thomas Petazzoni
2014-06-09 22:28   ` Yann E. MORIN
2014-06-07 21:54 ` [Buildroot] [RFCv1 0/4] Generating a graph of the size installed by each package Will Wagner
2014-06-08  7:42   ` Thomas Petazzoni
2014-06-24 13:05 ` Luca Ceresoli
2014-06-24 16:26   ` Yann E. MORIN
2014-06-24 16:31   ` Arnout Vandecappelle
2014-06-24 16:42     ` Thomas Petazzoni
2014-06-24 19:54     ` Luca Ceresoli
2014-06-24 20:11       ` 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=20140610100446.2adc73c4@free-electrons.com \
    --to=thomas.petazzoni@free-electrons.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox