Skip to content

Commit d02af8b

Browse files
committed
[sam] added toolchain download for Mac
1 parent d5a1938 commit d02af8b

File tree

3 files changed

+41
-17
lines changed

3 files changed

+41
-17
lines changed

build/build.xml

+40-17
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@
186186
<fail message="wrong platform (${os.name})" />
187187
</target>
188188

189-
<target name="macosx-build" if="macosx" depends="revision-check, macosx-checkos, subprojects-build" description="Build Mac OS X version">
189+
<target name="macosx-build" if="macosx" depends="revision-check, macosx-checkos, subprojects-build, macosx-check-arm-toolchain" description="Build Mac OS X version">
190190
<mkdir dir="macosx/work" />
191191

192192
<!-- assemble the pde -->
@@ -221,19 +221,6 @@
221221
<arg value="macosx/dist/tools-universal.zip" />
222222
</exec>
223223

224-
<exec executable="unzip">
225-
<arg value="-q" />
226-
<arg value="-n" />
227-
<arg value="-d" />
228-
<arg value="macosx/work/Arduino.app/Contents/Resources/Java/hardware/tools/" />
229-
<arg value="macosx/dist/CodeSourcery_arm.zip" />
230-
</exec>
231-
232-
<exec executable="mv">
233-
<arg value="macosx/work/Arduino.app/Contents/Resources/Java/hardware/tools/CodeSourcery_arm" />
234-
<arg value="macosx/work/Arduino.app/Contents/Resources/Java/hardware/tools/g++_arm_none_eabi" />
235-
</exec>
236-
237224
<copy todir="macosx/work/Arduino.app/Contents/Resources/Java/hardware/tools/">
238225
<fileset file="macosx/dist/bossac" />
239226
</copy>
@@ -247,6 +234,8 @@
247234
<antcall target="assemble">
248235
<param name="target.path" value="macosx/work/Arduino.app/Contents/Resources/Java" />
249236
</antcall>
237+
238+
<antcall target="get-arm-toolchain-help" />
250239
</target>
251240

252241
<target name="macosx-run" depends="macosx-build" description="Run Mac OS X version">
@@ -257,6 +246,40 @@
257246
<exec executable="macosx/work/Arduino.app/Contents/MacOS/JavaApplicationStub" spawn="false"/>
258247
</target>
259248

249+
<target name="macosx-check-arm-toolchain">
250+
<available file="macosx/work/Arduino.app/Contents/Resources/Java/hardware/tools/g++_arm_none_eabi"
251+
property="arm_available" />
252+
<condition property="arm_not_available">
253+
<not>
254+
<isset property="arm_available" />
255+
</not>
256+
</condition>
257+
</target>
258+
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+
<checksum file="macosx/dist/gcc-arm-none-eabi-4.4.1-2010q1-188-macos.tar.gz" algorithm="sha"
266+
fileext=".sha" verifyproperty="checksum.matches"/>
267+
<condition property="checksum.matches.fail">
268+
<equals arg1="${checksum.matches}" arg2="false"/>
269+
</condition>
270+
<fail if="checksum.matches.fail">
271+
File gcc-arm-none-eabi-4.4.1-2010q1-188-macos.tar.gz failed checksum.
272+
Please remove "macosx/dist/gcc-arm-none-eabi-4.4.1-2010q1-188-macos.tar.gz" to download it again.
273+
</fail>
274+
275+
<!-- ...and unzip on the destination folder -->
276+
<exec executable="tar" output="/dev/null">
277+
<arg value="xfz"/>
278+
<arg value="macosx/dist/gcc-arm-none-eabi-4.4.1-2010q1-188-macos.tar.gz"/>
279+
<arg value="--directory=macosx/work/Arduino.app/Contents/Resources/Java/hardware/tools/"/>
280+
</exec>
281+
</target>
282+
260283
<target name="macosx-dist" if="macosx" depends="macosx-build" description="Create a downloadable .zip for the Mac OS X version">
261284
<!-- The ant copy command does not preserve permissions. -->
262285
<chmod file="macosx/work/Arduino.app/Contents/MacOS/JavaApplicationStub" perm="+x" />
@@ -389,6 +412,9 @@
389412
<chmod perm="755" file="linux/work/hardware/tools/bossac" />
390413
<chmod perm="755" file="linux/work/hardware/tools/bossac64" />
391414

415+
<copy todir="linux/work" file="linux/dist/arduino" />
416+
<chmod perm="755" file="linux/work/arduino" />
417+
392418
<antcall target="get-arm-toolchain-help" />
393419
</target>
394420

@@ -438,9 +464,6 @@
438464
<arg value="linux/dist/gcc-arm-none-eabi-4.4.1-2010q1-188-linux32.tar.gz"/>
439465
<arg value="--directory=linux/work/hardware/tools"/>
440466
</exec>
441-
442-
<copy todir="linux/work" file="linux/dist/arduino" />
443-
<chmod perm="755" file="linux/work/arduino" />
444467
</target>
445468

446469
<target name="linux-dist" depends="build"
-34 MB
Binary file not shown.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
14c554bb9aa9f0d0262a593e7452d33f4babc60d

0 commit comments

Comments
 (0)