diff options
author | Thomas Petazzoni <thomas.petazzoni@free-electrons.com> | 2013-01-13 04:52:13 +0000 |
---|---|---|
committer | Peter Korsgaard <jacmet@sunsite.dk> | 2013-01-14 16:33:30 +0100 |
commit | 217ef08a9768221ae02540498ae58e7436801f93 (patch) | |
tree | 0db6f5a84d977e28c88bfe8d4cd50355fafaf43e /support | |
parent | dfe780994bb7fac4418a931478f732b29a09c34a (diff) | |
download | buildroot-217ef08a9768221ae02540498ae58e7436801f93.tar.gz buildroot-217ef08a9768221ae02540498ae58e7436801f93.zip |
Integration with Buildroot Toolchain Eclipse plugin
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 <thomas.petazzoni@free-electrons.com>
Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
Diffstat (limited to 'support')
-rwxr-xr-x | support/scripts/eclipse-register-toolchain | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/support/scripts/eclipse-register-toolchain b/support/scripts/eclipse-register-toolchain new file mode 100755 index 0000000000..dd9f1587f4 --- /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} |