Skip to contentSkip to conversation

external toolchain: use relative path to external toolchain.

PATCH New Noam Camus 3 participants 3 messages Feb 23, 2014 – Apr 20, 2014

lore
Share & tools
lore

Noam Camus

author
#0 lore raw

PATCH 1/1 external toolchain: use relative path to external toolchain.

Now configuration may include relative path to external toolchain.

---
 toolchain/toolchain-external/toolchain-external.mk |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
toolchain/toolchain-external/toolchain-external.mk +1 -1
index a7bfafc..46f33a9 100644
@@ -131,7 +131,7 @@ TOOLCHAIN_EXTERNAL_PREFIX=$(call qstrip,$(BR2_TOOLCHAIN_EXTERNAL_PREFIX))
 ifeq ($(BR2_TOOLCHAIN_EXTERNAL_DOWNLOAD),y)
 TOOLCHAIN_EXTERNAL_INSTALL_DIR=$(HOST_DIR)/opt/ext-toolchain
 else
-TOOLCHAIN_EXTERNAL_INSTALL_DIR=$(call qstrip,$(BR2_TOOLCHAIN_EXTERNAL_PATH))
+TOOLCHAIN_EXTERNAL_INSTALL_DIR=$(abspath $(call qstrip,$(BR2_TOOLCHAIN_EXTERNAL_PATH)))
 endif
 
 ifeq ($(TOOLCHAIN_EXTERNAL_INSTALL_DIR),)
Signature · 1 line
1.7.1
#1 lore raw

PATCH 1/1 external toolchain: use relative path to external toolchain.

Noam, All,

On 2014-02-23 08:29 +0000, Noam Camus spake thusly:

Quoted 1 line

Now configuration may include relative path to external toolchain.

What is the use-case for providing a relative path?

Do not forget that relative paths are always relative to the top dir of the Buildroot source tree, not the current directory.

For example, if you build out-of-tree, then the relative paths are still relative to Buildroot's tree, not $(O), which can have some strange consequences:

    # ls -lF
    buildroot/
    ext-toolchain/
    $ mkdir -p my/own/output/dir
    $ cd my/own/output/dir
    $ make -C ../../../../buildroot O=$(pwd) my_defconfig all

So, you would have to set BR2_TOOLCHAIN_EXTERNAL_PATH=../ext-toolchain, which is not straightforward, as most users would expect to set a path relative to the current working directory. [0]

But, if you want to use relative paths, you can do use $(TOPDIR) or $(CONFIG_DIR) as a prefix.

So, I'm not really sure we want that.

[0] This is not Buildroot's fault, but a standard behaviour of make, that prevents us from knowing the directory make was run from in the first place. This information is lost, and can not be retrieved from inside a Makefile.

Regards,
Yann E. MORIN.

Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
#2 lore raw

PATCH 1/1 external toolchain: use relative path to external toolchain.

In reply to Noam Camus

Dear Noam Camus,

Quoted 6 lines · Noam Camus

Now configuration may include relative path to external toolchain.

---
 toolchain/toolchain-external/toolchain-external.mk |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

A week or two after you submitted this patch, Yann E. Morin asked some questions about why this is needed (e-mail from March, 4th), and you never came back with answers to Yann's questions. Since Yann basically questions the usefulness of the patch, I'm going to mark this patch as "Rejected" for now in our patchwork tool. If, despite Yann comments, you feel that this patch is still useful for you, please resubmit with a more detailed commit log that explains *why* it is needed.

Thanks!

Thomas

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