Skip to content

Commit 844f559

Browse files
committed
[sam] refactored build.xml to ensure compatibility with ant 1.7.1
1 parent d9d0840 commit 844f559

File tree

1 file changed

+39
-30
lines changed

1 file changed

+39
-30
lines changed

build/build.xml

+39-30
Original file line numberDiff line numberDiff line change
@@ -150,16 +150,16 @@
150150
<!-- Download of toolchains for ARM -->
151151
<!-- - - - - - - - - - - - - - - - - - - -->
152152

153-
<target name="get-arm-toolchain" description="Download and unpack toolchain for ARM">
154-
<antcall target="${platform}-get-arm-toolchain" />
153+
<target name="unzip-arm-toolchain" description="Unpack toolchain for ARM. Also download latest distribution file if needed.">
154+
<antcall target="${platform}-unzip-arm-toolchain" />
155155
</target>
156156

157-
<target name="get-arm-toolchain-help" if="arm_not_available">
157+
<target name="get-arm-toolchain-help" unless="arm_available">
158158
<echo>
159159
=========================================================
160160
To download and install ARM-gcc toolchain use the command
161161

162-
ant get-arm-toolchain
162+
ant unzip-arm-toolchain
163163
=========================================================
164164
</echo>
165165
</target>
@@ -246,28 +246,30 @@
246246
<exec executable="macosx/work/Arduino.app/Contents/MacOS/JavaApplicationStub" spawn="false"/>
247247
</target>
248248

249+
<target name="macosx-check-arm-toolchain-distfile">
250+
<available file="linux/dist/gcc-arm-none-eabi-4.4.1-2010q1-188-macosx.tar.gz" property="arm_distfile_available" />
251+
</target>
252+
253+
<target name="macosx-get-arm-toolchain" depends="macosx-check-arm-toolchain-distfile" unless="arm_distfile_available">
254+
<!-- Retrieve ARM toolchain -->
255+
<get
256+
src="http://arduino.googlecode.com/files/gcc-arm-none-eabi-4.4.1-2010q1-188-macos.tar.gz"
257+
dest="macosx/dist/gcc-arm-none-eabi-4.4.1-2010q1-188-macos.tar.gz" verbose="true" />
258+
</target>
259+
249260
<target name="macosx-check-arm-toolchain">
250261
<available file="macosx/work/Arduino.app/Contents/Resources/Java/hardware/tools/g++_arm_none_eabi"
251262
property="arm_available" />
252-
<condition property="arm_not_available">
253-
<not>
254-
<isset property="arm_available" />
255-
</not>
256-
</condition>
257263
</target>
258264

259-
<target name="macosx-get-arm-toolchain" depends="macosx-check-arm-toolchain" if="arm_not_available">
260-
<!-- Retrieve ARM toolchain... -->
261-
<get
262-
src="http://arduino.googlecode.com/files/gcc-arm-none-eabi-4.4.1-2010q1-188-macos.tar.gz"
263-
dest="macosx/dist/gcc-arm-none-eabi-4.4.1-2010q1-188-macos.tar.gz"
264-
skipexisting="true" verbose="true" />
265+
<target name="macosx-unzip-arm-toolchain" depends="macosx-get-arm-toolchain, macosx-check-arm-toolchain" unless="arm_available">
265266
<checksum file="macosx/dist/gcc-arm-none-eabi-4.4.1-2010q1-188-macos.tar.gz" algorithm="sha"
266267
fileext=".sha" verifyproperty="checksum.matches"/>
267268
<condition property="checksum.matches.fail">
268269
<equals arg1="${checksum.matches}" arg2="false"/>
269270
</condition>
270-
<fail if="checksum.matches.fail">
271+
<fail if="checksum.matches.fail">Checksum failed.
272+
271273
File gcc-arm-none-eabi-4.4.1-2010q1-188-macos.tar.gz failed checksum.
272274
Please remove "macosx/dist/gcc-arm-none-eabi-4.4.1-2010q1-188-macos.tar.gz" to download it again.
273275
</fail>
@@ -433,43 +435,50 @@
433435
<exec executable="./linux/work/arduino" spawn="false"/>
434436
</target>
435437

436-
<target name="linux-check-arm-toolchain">
437-
<available file="linux/work/hardware/tools/g++_arm_none_eabi" property="arm_available" />
438-
<condition property="arm_not_available">
439-
<not>
440-
<isset property="arm_available" />
441-
</not>
442-
</condition>
438+
<target name="linux-check-arm-toolchain-distfile">
439+
<available file="linux/dist/gcc-arm-none-eabi-4.4.1-2010q1-188-linux32.tar.gz" property="arm_distfile_available" />
443440
</target>
444441

445-
<target name="linux-get-arm-toolchain" depends="linux-check-arm-toolchain" if="arm_not_available">
446-
<!-- Retrieve ARM toolchain... -->
442+
<target name="linux-get-arm-toolchain" depends="linux-check-arm-toolchain-distfile" unless="arm_distfile_available">
443+
<!-- Retrieve ARM toolchain -->
447444
<get
448445
src="http://arduino.googlecode.com/files/gcc-arm-none-eabi-4.4.1-2010q1-188-linux32.tar.gz"
449446
dest="linux/dist/gcc-arm-none-eabi-4.4.1-2010q1-188-linux32.tar.gz"
450-
skipexisting="true" verbose="true" />
447+
verbose="true" />
448+
</target>
449+
450+
<target name="linux-check-arm-toolchain">
451+
<available file="linux/work/hardware/tools/g++_arm_none_eabi" property="arm_available" />
452+
</target>
453+
454+
<target name="linux-unzip-arm-toolchain" depends="linux-get-arm-toolchain, linux-check-arm-toolchain" unless="arm_available">
451455
<checksum file="linux/dist/gcc-arm-none-eabi-4.4.1-2010q1-188-linux32.tar.gz" algorithm="sha"
452456
fileext=".sha" verifyproperty="checksum.matches"/>
453457
<condition property="checksum.matches.fail">
454458
<equals arg1="${checksum.matches}" arg2="false"/>
455459
</condition>
456-
<fail if="checksum.matches.fail">
460+
<fail if="checksum.matches.fail">Checksum failed.
461+
457462
File gcc-arm-none-eabi-4.4.1-2010q1-188-linux32.tar.gz failed checksum.
458-
Please remove "linux/dist/gcc-arm-none-eabi-4.4.1-2010q1-188-linux32.tar.gz" to download again.
463+
Please remove "linux/dist/gcc-arm-none-eabi-4.4.1-2010q1-188-linux32.tar.gz" to download it again.
459464
</fail>
460465

461-
<!-- ...and unzip on the destination folder -->
466+
<!-- Unzip toolchain to the destination folder -->
462467
<exec executable="tar" output="/dev/null" os="Linux">
463468
<arg value="xfz"/>
464469
<arg value="linux/dist/gcc-arm-none-eabi-4.4.1-2010q1-188-linux32.tar.gz"/>
465470
<arg value="--directory=linux/work/hardware/tools"/>
466471
</exec>
467472
</target>
468473

469-
<target name="linux64-get-arm-toolchain" depends="linux-check-arm-toolchain" if="arm_not_available">
474+
<target name="linux64-get-arm-toolchain" depends="linux-check-arm-toolchain-distfile" unless="arm_distfile_available">
470475
<antcall target="linux-get-arm-toolchain" />
471476
</target>
472477

478+
<target name="linux64-unzip-arm-toolchain" depends="linux-get-arm-toolchain" unless="arm_available">
479+
<antcall target="linux-unzip-arm-toolchain" />
480+
</target>
481+
473482
<target name="linux-dist" depends="build"
474483
description="Build .tar.gz of linux version">
475484

0 commit comments

Comments
 (0)