All of lore.kernel.org
 help / color / mirror / Atom feed
From: Romain Naour <romain.naour@gmail.com>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH 24/30] toolchain/toolchain-external: move wrapper logic into a separate file
Date: Sun, 23 Oct 2016 22:48:25 +0200	[thread overview]
Message-ID: <1477255711-28603-25-git-send-email-romain.naour@gmail.com> (raw)
In-Reply-To: <1477255711-28603-1-git-send-email-romain.naour@gmail.com>

Use pkg-toolchain-external-wrapper.mk for the definition of the
TOOLCHAIN_EXTERNAL_INSTALL_WRAPPER function, which installs the
symbolic links to use the wrapper.

Signed-off-by: Romain Naour <romain.naour@gmail.com>
---
 .../pkg-toolchain-external-wrapper.mk              | 40 ++++++++++++++++++++++
 toolchain/toolchain-external/toolchain-external.mk | 33 ------------------
 2 files changed, 40 insertions(+), 33 deletions(-)
 create mode 100644 toolchain/toolchain-external/pkg-toolchain-external-wrapper.mk

diff --git a/toolchain/toolchain-external/pkg-toolchain-external-wrapper.mk b/toolchain/toolchain-external/pkg-toolchain-external-wrapper.mk
new file mode 100644
index 0000000..ea4bb46
--- /dev/null
+++ b/toolchain/toolchain-external/pkg-toolchain-external-wrapper.mk
@@ -0,0 +1,40 @@
+#
+# The following functions creates the symbolic links needed to get the
+# cross-compilation tools visible in $(HOST_DIR)/usr/bin. Some of
+# links are done directly to the corresponding tool in the external
+# toolchain installation directory, while some other links are done to
+# the toolchain wrapper (preprocessor, C, C++ and Fortran compiler)
+#
+# We skip gdb symlink when we are building our own gdb to prevent two
+# gdb's in $(HOST_DIR)/usr/bin.
+#
+# The LTO support in gcc creates wrappers for ar, ranlib and nm which load
+# the lto plugin. These wrappers are called *-gcc-ar, *-gcc-ranlib, and
+# *-gcc-nm and should be used instead of the real programs when -flto is
+# used. However, we should not add the toolchain wrapper for them, and they
+# match the *cc-* pattern. Therefore, an additional case is added for *-ar,
+# *-ranlib and *-nm.
+#
+# $1 toolchain CROSS
+define TOOLCHAIN_EXTERNAL_INSTALL_WRAPPER
+	$(Q)cd $(HOST_DIR)/usr/bin; \
+	for i in $(1)*; do \
+		base=$${i##*/}; \
+		case "$$base" in \
+		*-ar|*-ranlib|*-nm) \
+			ln -sf $$(echo $$i | sed 's%^$(HOST_DIR)%../..%') .; \
+			;; \
+		*cc|*cc-*|*++|*++-*|*cpp|*-gfortran) \
+			ln -sf toolchain-wrapper $$base; \
+			;; \
+		*gdb|*gdbtui) \
+			if test "$(BR2_PACKAGE_HOST_GDB)" != "y"; then \
+				ln -sf $$(echo $$i | sed 's%^$(HOST_DIR)%../..%') .; \
+			fi \
+			;; \
+		*) \
+			ln -sf $$(echo $$i | sed 's%^$(HOST_DIR)%../..%') .; \
+			;; \
+		esac; \
+	done
+endef
diff --git a/toolchain/toolchain-external/toolchain-external.mk b/toolchain/toolchain-external/toolchain-external.mk
index c997a0a..ea8bc36 100644
--- a/toolchain/toolchain-external/toolchain-external.mk
+++ b/toolchain/toolchain-external/toolchain-external.mk
@@ -571,39 +571,6 @@ define TOOLCHAIN_EXTERNAL_INSTALL_TARGET_BFIN_FLAT
 endef
 endif
 
-# Build toolchain wrapper for preprocessor, C, C++ and Fortran compilers
-# and setup symlinks for everything else. Skip gdb symlink when we are
-# building our own gdb to prevent two gdb's in output/host/usr/bin.
-# The LTO support in gcc creates wrappers for ar, ranlib and nm which load
-# the lto plugin. These wrappers are called *-gcc-ar, *-gcc-ranlib, and
-# *-gcc-nm and should be used instead of the real programs when -flto is
-# used. However, we should not add the toolchain wrapper for them, and they
-# match the *cc-* pattern. Therefore, an additional case is added for *-ar,
-# *-ranlib and *-nm.
-# $1 toolchain CROSS
-define TOOLCHAIN_EXTERNAL_INSTALL_WRAPPER
-	$(Q)cd $(HOST_DIR)/usr/bin; \
-	for i in $(1)*; do \
-		base=$${i##*/}; \
-		case "$$base" in \
-		*-ar|*-ranlib|*-nm) \
-			ln -sf $$(echo $$i | sed 's%^$(HOST_DIR)%../..%') .; \
-			;; \
-		*cc|*cc-*|*++|*++-*|*cpp|*-gfortran) \
-			ln -sf toolchain-wrapper $$base; \
-			;; \
-		*gdb|*gdbtui) \
-			if test "$(BR2_PACKAGE_HOST_GDB)" != "y"; then \
-				ln -sf $$(echo $$i | sed 's%^$(HOST_DIR)%../..%') .; \
-			fi \
-			;; \
-		*) \
-			ln -sf $$(echo $$i | sed 's%^$(HOST_DIR)%../..%') .; \
-			;; \
-		esac; \
-	done
-endef
-
 # uClibc-ng dynamic loader is called ld-uClibc.so.1, but gcc is not
 # patched specifically for uClibc-ng, so it continues to generate
 # binaries that expect the dynamic loader to be named ld-uClibc.so.0,
-- 
2.5.5

  parent reply	other threads:[~2016-10-23 20:48 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-23 20:48 [Buildroot] [PATCH 00/30] Splitting the toolchain-external package Romain Naour
2016-10-23 20:48 ` [Buildroot] [PATCH 01/30] toolchain-external: pass CC and CFLAGS as arguments Romain Naour
2016-10-25 10:50   ` Arnout Vandecappelle
2016-10-23 20:48 ` [Buildroot] [PATCH 02/30] " Romain Naour
2016-10-25 11:07   ` Arnout Vandecappelle
2016-10-25 11:44     ` Thomas Petazzoni
2016-10-25 12:46       ` Arnout Vandecappelle
2016-10-25 12:48         ` Thomas Petazzoni
2016-10-25 12:57           ` Arnout Vandecappelle
2016-10-23 20:48 ` [Buildroot] [PATCH 03/30] toolchain-external: pass arguments CROSS to install wrapper Romain Naour
2016-10-23 20:48 ` [Buildroot] [PATCH 04/30] toolchain-external: pass arguments CC, CFLAGS, INSTALL_DIR while installing gdbserver Romain Naour
2016-10-23 20:48 ` [Buildroot] [PATCH 05/30] toolchain-external-blackfin-uclinux: new package Romain Naour
2016-10-23 20:48 ` [Buildroot] [PATCH 06/30] toolchain-external-arago-armv7a: " Romain Naour
2016-10-23 20:48 ` [Buildroot] [PATCH 07/30] toolchain-external-arago-armv5te: " Romain Naour
2016-10-23 20:48 ` [Buildroot] [PATCH 08/30] toolchain-external-custom: " Romain Naour
2016-10-23 20:48 ` [Buildroot] [PATCH 09/30] toolchain-external-linaro-aarch64: " Romain Naour
2016-10-23 20:48 ` [Buildroot] [PATCH 10/30] toolchain-external-linaro-arm: " Romain Naour
2016-10-23 20:48 ` [Buildroot] [PATCH 11/30] toolchain-external-linaro-armeb: " Romain Naour
2016-10-23 20:48 ` [Buildroot] [PATCH 12/30] toolchain-external-musl-cross: " Romain Naour
2016-10-23 20:48 ` [Buildroot] [PATCH 13/30] toolchain-external-codesourcery-aarch64: " Romain Naour
2016-10-23 20:48 ` [Buildroot] [PATCH 14/30] toolchain-external-codesourcery-arm: " Romain Naour
2016-10-23 20:48 ` [Buildroot] [PATCH 15/30] toolchain-external-codesourcery-mips: " Romain Naour
2016-10-23 20:48 ` [Buildroot] [PATCH 16/30] toolchain-external-codesourcery-niosII: " Romain Naour
2016-10-23 20:48 ` [Buildroot] [PATCH 17/30] toolchain-external-codesourcery-sh: " Romain Naour
2016-10-23 20:48 ` [Buildroot] [PATCH 18/30] toolchain-external-codesourcery-x86: " Romain Naour
2016-10-23 20:48 ` [Buildroot] [PATCH 19/30] toolchain-external-codesourcery-amd64: " Romain Naour
2016-10-23 20:48 ` [Buildroot] [PATCH 20/30] toolchain-external-synopsys-arc: " Romain Naour
2016-10-23 20:48 ` [Buildroot] [PATCH 21/30] toolchain-external-codescape-img-mips: " Romain Naour
2016-10-23 20:48 ` [Buildroot] [PATCH 22/30] toolchain-external-codescape-mti-mips: " Romain Naour
2016-10-23 20:48 ` [Buildroot] [PATCH 23/30] toolchain/toolchain-external: move functions and utility logic into a separate file Romain Naour
2016-10-23 20:48 ` Romain Naour [this message]
2016-10-23 20:48 ` [Buildroot] [PATCH 25/30] toolchain/toolchain-external: move the definition of various variables " Romain Naour
2016-10-23 20:48 ` [Buildroot] [PATCH 26/30] toolchain/toolchain-external: move uClibc specific logic " Romain Naour
2016-10-23 20:48 ` [Buildroot] [PATCH 27/30] toolchain/toolchain-external: move musl " Romain Naour
2016-10-23 20:48 ` [Buildroot] [PATCH 28/30] toolchain/toolchain-external: move bfin " Romain Naour
2016-10-23 20:48 ` [Buildroot] [PATCH 29/30] toolchain/toolchain-external: move external toolchain definition " Romain Naour
2016-10-25  9:55   ` Thomas Petazzoni
2016-10-23 20:48 ` [Buildroot] [PATCH 30/30] toolchain-external: introduce and use external toolchain infra Romain Naour
2016-10-25 10:38 ` [Buildroot] [PATCH 00/30] Splitting the toolchain-external package Thomas Petazzoni
2016-10-25 14:26 ` Arnout Vandecappelle
2016-10-25 14:54   ` Thomas Petazzoni
2016-10-25 15:11     ` Arnout Vandecappelle
2016-10-25 15:38       ` Thomas Petazzoni
2016-10-25 18:03         ` Romain Naour

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=1477255711-28603-25-git-send-email-romain.naour@gmail.com \
    --to=romain.naour@gmail.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 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.