1
0
mirror of https://github.com/arduino/Arduino.git synced 2025-01-29 18:52:13 +01:00

[sam] Added automatic toolchain download on build.xml (linux only)

This commit is contained in:
Cristian Maglie 2012-05-15 19:58:03 +02:00
parent efbf66ef6b
commit b8f5ba7497
2 changed files with 60 additions and 4 deletions

View File

@ -146,7 +146,24 @@
message="Fix revision number in Base.java" />
</target>
<!-- - - - - - - - - - - - - - - - - - - -->
<!-- Download of toolchains for ARM -->
<!-- - - - - - - - - - - - - - - - - - - -->
<target name="get-arm-toolchain" description="Download and unpack toolchain for ARM">
<antcall target="${platform}-get-arm-toolchain" />
</target>
<target name="get-arm-toolchain-help" if="arm_not_available">
<echo>
=========================================================
To download and install ARM-gcc toolchain use the command
ant get-arm-toolchain
=========================================================
</echo>
</target>
<!-- - - - - - - - -->
<!-- Mac OS X -->
<!-- - - - - - - - -->
@ -344,7 +361,7 @@
<fail message="wrong platform (${os.name})" />
</target>
<target name="linux-build" depends="revision-check, linux-checkos, subprojects-build" description="Build linux version">
<target name="linux-build" depends="revision-check, linux-checkos, subprojects-build, linux-check-arm-toolchain" description="Build linux version">
<mkdir dir="linux/work" />
<copy todir="linux/work">
@ -372,8 +389,7 @@
<chmod perm="755" file="linux/work/hardware/tools/bossac" />
<chmod perm="755" file="linux/work/hardware/tools/bossac64" />
<copy todir="linux/work" file="linux/dist/arduino" />
<chmod perm="755" file="linux/work/arduino" />
<antcall target="get-arm-toolchain-help" />
</target>
<target name="linux64-build" depends="linux-build" description="Build linux (64-bit) version">
@ -391,6 +407,45 @@
<exec executable="./linux/work/arduino" spawn="false"/>
</target>
<target name="linux-check-arm-toolchain">
<available file="linux/work/hardware/tools/g++_arm_none_eabi" property="arm_available" />
<condition property="arm_not_available">
<not>
<isset property="arm_available" />
</not>
</condition>
</target>
<target name="linux-get-arm-toolchain" depends="linux-check-arm-toolchain" if="arm_not_available">
<!-- Retrieve ARM toolchain... -->
<get
src="http://static.leaflabs.com/pub/codesourcery/gcc-arm-none-eabi-latest-linux32.tar.gz"
dest="linux/dist/gcc-arm-none-eabi-latest-linux32.tar.gz"
skipexisting="true" verbose="true" />
<checksum file="linux/dist/gcc-arm-none-eabi-latest-linux32.tar.gz" algorithm="sha"
fileext=".sha" verifyproperty="checksum.matches"/>
<condition property="checksum.matches.fail">
<equals arg1="${checksum.matches}" arg2="false"/>
</condition>
<fail if="checksum.matches.fail">
File gcc-arm-none-eabi-latest-linux32.tar.gz failed checksum.
Please remove "linux/dist/gcc-arm-none-eabi-latest-linux32.tar.gz" to download again.
</fail>
<!-- ...and unzip on the destination folder -->
<exec executable="tar" output="/dev/null" os="Linux">
<arg value="xfz"/>
<arg value="linux/dist/gcc-arm-none-eabi-latest-linux32.tar.gz"/>
<arg value="--directory=linux/work/hardware/tools"/>
</exec>
<move file="linux/work/hardware/tools/arm"
tofile="linux/work/hardware/tools/g++_arm_none_eabi" />
<copy todir="linux/work" file="linux/dist/arduino" />
<chmod perm="755" file="linux/work/arduino" />
</target>
<target name="linux-dist" depends="build"
description="Build .tar.gz of linux version">

View File

@ -0,0 +1 @@
d835b43b066ccb224e2767a26e2ca90abcebe06b