From patchwork Sun Jan 13 14:52:13 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Petazzoni X-Patchwork-Id: 211626 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from fraxinus.osuosl.org (fraxinus.osuosl.org [140.211.166.137]) by ozlabs.org (Postfix) with ESMTP id 020762C0107 for ; Mon, 14 Jan 2013 01:52:40 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 4358710156D; Sun, 13 Jan 2013 14:52:29 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id FDBE8JgFGfzS; Sun, 13 Jan 2013 14:52:19 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by fraxinus.osuosl.org (Postfix) with ESMTP id 642FD10147B; Sun, 13 Jan 2013 14:52:15 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from fraxinus.osuosl.org (fraxinus.osuosl.org [140.211.166.137]) by ash.osuosl.org (Postfix) with ESMTP id 5172A8F7A0 for ; Sun, 13 Jan 2013 14:52:30 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 3C04110078F for ; Sun, 13 Jan 2013 14:52:13 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 9Qz2F2lEShad for ; Sun, 13 Jan 2013 14:52:11 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mail.free-electrons.com (ns368539.ovh.net [94.23.35.102]) by fraxinus.osuosl.org (Postfix) with ESMTP id E58DA100799 for ; Sun, 13 Jan 2013 14:52:10 +0000 (UTC) Received: by mail.free-electrons.com (Postfix, from userid 106) id 133056728; Sun, 13 Jan 2013 15:52:20 +0100 (CET) Received: from localhost (humanoidz.org [82.247.183.72]) by mail.free-electrons.com (Postfix) with ESMTPSA id 93C9966FF; Sun, 13 Jan 2013 15:52:18 +0100 (CET) From: Thomas Petazzoni To: buildroot@uclibc.org Date: Sun, 13 Jan 2013 15:52:13 +0100 Message-Id: <1358088734-23460-2-git-send-email-thomas.petazzoni@free-electrons.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1358088734-23460-1-git-send-email-thomas.petazzoni@free-electrons.com> References: <1358088734-23460-1-git-send-email-thomas.petazzoni@free-electrons.com> Cc: melanie.bats@obeo.fr Subject: [Buildroot] [PATCH 1/2] Integration with Buildroot Toolchain Eclipse plugin X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.14 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: buildroot-bounces@busybox.net The Eclipse plugin at https://github.com/mbats/eclipse-buildroot-toolchain-plugin allows users of Eclipse to easily use the toolchain available in Buildroot. To do so, this plugin reads ~/.buildroot-eclipse.toolchains, which contains the list of Buildroot toolchains available on the system, and then offer those toolchains to compile Eclipse projects. In order to interface with this plugin, this commit adds an option that allows the user to tell whether (s)he wants the Buildroot project toolchain to be visible under this Eclipse plugin. It simply adds a line in this ~/.buildroot-eclipse.toolchains file. Signed-off-by: Thomas Petazzoni --- Makefile | 7 +++++++ support/scripts/eclipse-register-toolchain | 28 ++++++++++++++++++++++++++++ toolchain/toolchain-common.in | 7 +++++++ 3 files changed, 42 insertions(+) create mode 100755 support/scripts/eclipse-register-toolchain diff --git a/Makefile b/Makefile index 074674a..70cb229 100644 --- a/Makefile +++ b/Makefile @@ -336,6 +336,10 @@ TARGETS+=target-generatelocales endif endif +ifeq ($(BR2_ECLIPSE_REGISTER),y) +TARGETS+=toolchain-eclipse-register +endif + include fs/common.mk TARGETS_CLEAN:=$(patsubst %,%-clean,$(TARGETS)) @@ -531,6 +535,9 @@ target-generatelocales: host-localedef done endif +toolchain-eclipse-register: + ./support/scripts/eclipse-register-toolchain `readlink -f $(O)` $(notdir $(TARGET_CROSS)) $(BR2_ARCH) + source: dirs $(TARGETS_SOURCE) $(HOST_SOURCE) external-deps: diff --git a/support/scripts/eclipse-register-toolchain b/support/scripts/eclipse-register-toolchain new file mode 100755 index 0000000..dd9f158 --- /dev/null +++ b/support/scripts/eclipse-register-toolchain @@ -0,0 +1,28 @@ +#!/bin/sh + +project_directory=$1 +toolchain_prefix=$2 +architecture=$3 + +TOOLCHAIN_ECLIPSE_FILE=${HOME}/.buildroot-eclipse.toolchains + +if test -f ${TOOLCHAIN_ECLIPSE_FILE} ; then + mv ${TOOLCHAIN_ECLIPSE_FILE} ${TOOLCHAIN_ECLIPSE_FILE}.tmp + cat ${TOOLCHAIN_ECLIPSE_FILE}.tmp | while read toolchain ; do + path=$(echo ${toolchain} | cut -f1 -d ':') + # Filter lines corresponding to still existing projects + echo "Testing ${path} ..." + if ! test -d ${path} ; then + continue + fi + # .. and the current project + if test ${path} = ${project_directory} ; then + continue + fi + echo ${toolchain} >> ${TOOLCHAIN_ECLIPSE_FILE} + done + rm ${TOOLCHAIN_ECLIPSE_FILE}.tmp +fi + +# Add the toolchain +echo "${project_directory}:${toolchain_prefix}:${architecture}" >> ${TOOLCHAIN_ECLIPSE_FILE} diff --git a/toolchain/toolchain-common.in b/toolchain/toolchain-common.in index 9f11a39..f6905ae 100644 --- a/toolchain/toolchain-common.in +++ b/toolchain/toolchain-common.in @@ -131,3 +131,10 @@ config BR2_TARGET_LDFLAGS string "Target linker options" help Extra options to pass to the linker when building for the target. + +config BR2_ECLIPSE_REGISTER + bool "Register toolchain within Eclipse Buildroot plug-in" + help + This options tells Buildroot to generate the necessary + configuration files to make your toolchain appear within + Eclipse, through the Eclipse Buildroot plugin.