|
146 | 146 | message="Fix revision number in Base.java" />
|
147 | 147 | </target>
|
148 | 148 |
|
149 |
| - |
| 149 | + <!-- - - - - - - - - - - - - - - - - - - --> |
| 150 | + <!-- Download of toolchains for ARM --> |
| 151 | + <!-- - - - - - - - - - - - - - - - - - - --> |
| 152 | + |
| 153 | + <target name="get-arm-toolchain" description="Download and unpack toolchain for ARM"> |
| 154 | + <antcall target="${platform}-get-arm-toolchain" /> |
| 155 | + </target> |
| 156 | + |
| 157 | + <target name="get-arm-toolchain-help" if="arm_not_available"> |
| 158 | + <echo> |
| 159 | + ========================================================= |
| 160 | + To download and install ARM-gcc toolchain use the command |
| 161 | + |
| 162 | + ant get-arm-toolchain |
| 163 | + ========================================================= |
| 164 | + </echo> |
| 165 | + </target> |
| 166 | + |
150 | 167 | <!-- - - - - - - - -->
|
151 | 168 | <!-- Mac OS X -->
|
152 | 169 | <!-- - - - - - - - -->
|
|
344 | 361 | <fail message="wrong platform (${os.name})" />
|
345 | 362 | </target>
|
346 | 363 |
|
347 |
| - <target name="linux-build" depends="revision-check, linux-checkos, subprojects-build" description="Build linux version"> |
| 364 | + <target name="linux-build" depends="revision-check, linux-checkos, subprojects-build, linux-check-arm-toolchain" description="Build linux version"> |
348 | 365 | <mkdir dir="linux/work" />
|
349 | 366 |
|
350 | 367 | <copy todir="linux/work">
|
|
372 | 389 | <chmod perm="755" file="linux/work/hardware/tools/bossac" />
|
373 | 390 | <chmod perm="755" file="linux/work/hardware/tools/bossac64" />
|
374 | 391 |
|
375 |
| - <copy todir="linux/work" file="linux/dist/arduino" /> |
376 |
| - <chmod perm="755" file="linux/work/arduino" /> |
| 392 | + <antcall target="get-arm-toolchain-help" /> |
377 | 393 | </target>
|
378 | 394 |
|
379 | 395 | <target name="linux64-build" depends="linux-build" description="Build linux (64-bit) version">
|
|
391 | 407 | <exec executable="./linux/work/arduino" spawn="false"/>
|
392 | 408 | </target>
|
393 | 409 |
|
| 410 | + <target name="linux-check-arm-toolchain"> |
| 411 | + <available file="linux/work/hardware/tools/g++_arm_none_eabi" property="arm_available" /> |
| 412 | + <condition property="arm_not_available"> |
| 413 | + <not> |
| 414 | + <isset property="arm_available" /> |
| 415 | + </not> |
| 416 | + </condition> |
| 417 | + </target> |
| 418 | + |
| 419 | + <target name="linux-get-arm-toolchain" depends="linux-check-arm-toolchain" if="arm_not_available"> |
| 420 | + <!-- Retrieve ARM toolchain... --> |
| 421 | + <get |
| 422 | + src="http://static.leaflabs.com/pub/codesourcery/gcc-arm-none-eabi-latest-linux32.tar.gz" |
| 423 | + dest="linux/dist/gcc-arm-none-eabi-latest-linux32.tar.gz" |
| 424 | + skipexisting="true" verbose="true" /> |
| 425 | + <checksum file="linux/dist/gcc-arm-none-eabi-latest-linux32.tar.gz" algorithm="sha" |
| 426 | + fileext=".sha" verifyproperty="checksum.matches"/> |
| 427 | + <condition property="checksum.matches.fail"> |
| 428 | + <equals arg1="${checksum.matches}" arg2="false"/> |
| 429 | + </condition> |
| 430 | + <fail if="checksum.matches.fail"> |
| 431 | + File gcc-arm-none-eabi-latest-linux32.tar.gz failed checksum. |
| 432 | + Please remove "linux/dist/gcc-arm-none-eabi-latest-linux32.tar.gz" to download again. |
| 433 | + </fail> |
| 434 | + |
| 435 | + <!-- ...and unzip on the destination folder --> |
| 436 | + <exec executable="tar" output="/dev/null" os="Linux"> |
| 437 | + <arg value="xfz"/> |
| 438 | + <arg value="linux/dist/gcc-arm-none-eabi-latest-linux32.tar.gz"/> |
| 439 | + <arg value="--directory=linux/work/hardware/tools"/> |
| 440 | + </exec> |
| 441 | + |
| 442 | + <move file="linux/work/hardware/tools/arm" |
| 443 | + tofile="linux/work/hardware/tools/g++_arm_none_eabi" /> |
| 444 | + |
| 445 | + <copy todir="linux/work" file="linux/dist/arduino" /> |
| 446 | + <chmod perm="755" file="linux/work/arduino" /> |
| 447 | + </target> |
| 448 | + |
394 | 449 | <target name="linux-dist" depends="build"
|
395 | 450 | description="Build .tar.gz of linux version">
|
396 | 451 |
|
|
0 commit comments