* [Buildroot] [PATCH] Prepare to handle more than two toolchain types
@ 2010-03-26 19:46 Yann E. MORIN
2010-03-26 19:46 ` [Buildroot] [PATCH] toolchain: prepare for more than two alternatives Yann E. MORIN
0 siblings, 1 reply; 4+ messages in thread
From: Yann E. MORIN @ 2010-03-26 19:46 UTC (permalink / raw)
To: buildroot
To prepare to handle more than two toolchian types, we should always
explicitly check the configured toolchain type, rather than falling
back to the non-selected one.
As this is a choice, we are sure that either the 'buildroot' or the
'external' toolchain is seleted, so we do not have to handle the
default case (both/none selected).
---
Yann E. MORIN (1):
toolchain: prepare for more than two alternatives
Makefile | 6 +++---
package/Makefile.in | 11 +++++------
package/gettext/gettext.mk | 2 +-
3 files changed, 9 insertions(+), 10 deletions(-)
--
.-----------------.--------------------.------------------.--------------------.
| 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. |
'------------------------------^-------^------------------^--------------------'
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Buildroot] [PATCH] toolchain: prepare for more than two alternatives
2010-03-26 19:46 [Buildroot] [PATCH] Prepare to handle more than two toolchain types Yann E. MORIN
@ 2010-03-26 19:46 ` Yann E. MORIN
2010-03-26 20:34 ` Thomas Petazzoni
2010-03-31 8:53 ` Peter Korsgaard
0 siblings, 2 replies; 4+ messages in thread
From: Yann E. MORIN @ 2010-03-26 19:46 UTC (permalink / raw)
To: buildroot
From: Yann E. MORIN <yann.morin.1998@anciens.enib.fr>
Lay down the path to add more than two toolchain kinds:
- check the type of toolchain as:
ifeq (toolchain_buildroot,y)
blabla buildroot-specific
else ifeq (toolchain_external,y)
blabla external-specific
endif
- prefer using positive checks, a-la:
ifeq (foo,y)
instead of:
ifneq (bar,y)
(where foo and bar are mutually exclusive)
- have the toolchain_buildroot case always appear first
- gettext is handled differently, because we want to add an option
only if not using the buildroot toolchain, hence we use ifneq.
Signed-off-by: Yann E. MORIN <yann.morin.1998@anciens.enib.fr>
---
Makefile | 6 +++---
package/Makefile.in | 11 +++++------
package/gettext/gettext.mk | 2 +-
3 files changed, 9 insertions(+), 10 deletions(-)
diff --git a/Makefile b/Makefile
index fed6e12..b746934 100644
--- a/Makefile
+++ b/Makefile
@@ -199,7 +199,7 @@ PREFERRED_LIB_FLAGS:=--enable-static --enable-shared
##############################################################
ifeq ($(BR2_TOOLCHAIN_BUILDROOT),y)
BASE_TARGETS:=uclibc-configured binutils cross_compiler uclibc-target-utils kernel-headers
-else
+else ifeq ($(BR2_TOOLCHAIN_EXTERNAL),y)
BASE_TARGETS:=uclibc
endif
TARGETS:=
@@ -301,7 +301,7 @@ include toolchain/kernel-headers/kernel-headers.mk
include toolchain/mklibs/mklibs.mk
include toolchain/sstrip/sstrip.mk
include toolchain/uClibc/uclibc.mk
-else
+else ifeq ($(BR2_TOOLCHAIN_EXTERNAL),y)
include toolchain/*/*.mk
endif
@@ -363,7 +363,7 @@ $(STAGING_DIR):
ifeq ($(BR2_TOOLCHAIN_SYSROOT),y)
@mkdir -p $(STAGING_DIR)/usr/lib
else
-ifneq ($(BR2_TOOLCHAIN_EXTERNAL),y)
+ifeq ($(BR2_TOOLCHAIN_BUILDROOT),y)
@ln -snf . $(STAGING_DIR)/usr
@mkdir -p $(STAGING_DIR)/usr/$(REAL_GNU_TARGET_NAME)
@ln -snf ../lib $(STAGING_DIR)/usr/lib
diff --git a/package/Makefile.in b/package/Makefile.in
index 1e412a6..2bd3640 100644
--- a/package/Makefile.in
+++ b/package/Makefile.in
@@ -88,9 +88,8 @@ endif
TARGET_CXXFLAGS=$(TARGET_CFLAGS)
-# else it's an external toolchain
#########################################################################
-else
+else ifeq ($(BR2_TOOLCHAIN_EXTERNAL),y)
TARGET_CFLAGS=$(TARGET_OPTIMIZATION) $(TARGET_DEBUGGING) --sysroot $(STAGING_DIR)/
TARGET_CXXFLAGS=$(TARGET_CFLAGS)
TARGET_LDFLAGS=--sysroot $(STAGING_DIR)/
@@ -115,7 +114,7 @@ GNU_TARGET_NAME=$(OPTIMIZE_FOR_CPU)-linux
REAL_GNU_TARGET_NAME=$(OPTIMIZE_FOR_CPU)$(GNU_TARGET_SUFFIX)
TARGET_CROSS=$(STAGING_DIR)/usr/bin/$(REAL_GNU_TARGET_NAME)-
KERNEL_CROSS=$(TARGET_CROSS)
-else
+else ifeq ($(BR2_TOOLCHAIN_EXTERNAL),y)
TOOLCHAIN_EXTERNAL_PREFIX:=$(call qstrip,$(BR2_TOOLCHAIN_EXTERNAL_PREFIX))
TOOLCHAIN_EXTERNAL_PATH:=$(call qstrip,$(BR2_TOOLCHAIN_EXTERNAL_PATH))
TOOLCHAIN_DIR=$(BASE_DIR)/toolchain
@@ -139,10 +138,10 @@ TARGET_NM=$(TARGET_CROSS)nm
TARGET_RANLIB=$(TARGET_CROSS)ranlib
TARGET_OBJCOPY=$(TARGET_CROSS)objcopy
TARGET_OBJDUMP=$(TARGET_CROSS)objdump
-ifeq ($(BR2_TOOLCHAIN_EXTERNAL),y)
-TARGET_LDCONFIG=/sbin/ldconfig
-else
+ifeq ($(BR2_TOOLCHAIN_BUILDROOT),y)
TARGET_LDCONFIG=$(TARGET_CROSS)ldconfig
+else ifeq ($(BR2_TOOLCHAIN_EXTERNAL),y)
+TARGET_LDCONFIG=/sbin/ldconfig
endif
ifeq ($(BR2_STRIP_strip),y)
STRIP_DISCARD_ALL:=--discard-all
diff --git a/package/gettext/gettext.mk b/package/gettext/gettext.mk
index dbc1f2c..81ab9de 100644
--- a/package/gettext/gettext.mk
+++ b/package/gettext/gettext.mk
@@ -29,7 +29,7 @@ $(GETTEXT_DIR)/.unpacked: $(DL_DIR)/$(GETTEXT_SOURCE)
$(CONFIG_UPDATE) $(GETTEXT_DIR)/build-aux
touch $@
-ifeq ($(BR2_TOOLCHAIN_EXTERNAL),y)
+ifneq ($(BR2_TOOLCHAIN_BUILDROOT),y)
IGNORE_EXTERNAL_GETTEXT:=--with-included-gettext
endif
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [Buildroot] [PATCH] toolchain: prepare for more than two alternatives
2010-03-26 19:46 ` [Buildroot] [PATCH] toolchain: prepare for more than two alternatives Yann E. MORIN
@ 2010-03-26 20:34 ` Thomas Petazzoni
2010-03-31 8:53 ` Peter Korsgaard
1 sibling, 0 replies; 4+ messages in thread
From: Thomas Petazzoni @ 2010-03-26 20:34 UTC (permalink / raw)
To: buildroot
On Fri, 26 Mar 2010 20:46:37 +0100
"Yann E. MORIN" <yann.morin.1998@anciens.enib.fr> wrote:
> Signed-off-by: Yann E. MORIN <yann.morin.1998@anciens.enib.fr>
Acked-By: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
--
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Buildroot] [PATCH] toolchain: prepare for more than two alternatives
2010-03-26 19:46 ` [Buildroot] [PATCH] toolchain: prepare for more than two alternatives Yann E. MORIN
2010-03-26 20:34 ` Thomas Petazzoni
@ 2010-03-31 8:53 ` Peter Korsgaard
1 sibling, 0 replies; 4+ messages in thread
From: Peter Korsgaard @ 2010-03-31 8:53 UTC (permalink / raw)
To: buildroot
>>>>> "Yann" == Yann E MORIN <yann.morin.1998@anciens.enib.fr> writes:
Yann> From: Yann E. MORIN <yann.morin.1998@anciens.enib.fr>
Yann> Lay down the path to add more than two toolchain kinds:
Yann> - check the type of toolchain as:
Yann> ifeq (toolchain_buildroot,y)
Yann> blabla buildroot-specific
Yann> else ifeq (toolchain_external,y)
Yann> blabla external-specific
Yann> endif
Committed, thanks.
--
Bye, Peter Korsgaard
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2010-03-31 8:53 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-03-26 19:46 [Buildroot] [PATCH] Prepare to handle more than two toolchain types Yann E. MORIN
2010-03-26 19:46 ` [Buildroot] [PATCH] toolchain: prepare for more than two alternatives Yann E. MORIN
2010-03-26 20:34 ` Thomas Petazzoni
2010-03-31 8:53 ` Peter Korsgaard
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox