|
503 | 503 |
|
504 | 504 | <target name="linux64-build" depends="linux-build" description="Build linux (64-bit) version">
|
505 | 505 | <!-- Unzip ARM tools -->
|
506 |
| - <antcall target="unzip-arm-toolchain"> |
| 506 | + <antcall target="unzip-tool"> |
507 | 507 | <param name="dist_file" value="gcc-arm-none-eabi-4.4.1-2010q1-188-linux32.tar.gz" />
|
508 | 508 | <param name="dist_url" value="http://arduino.googlecode.com/files/gcc-arm-none-eabi-4.4.1-2010q1-188-linux32.tar.gz" />
|
509 | 509 | <param name="dist_check_file" value="g++_arm_none_eabi" />
|
|
546 | 546 | </exec>
|
547 | 547 | </target>
|
548 | 548 |
|
| 549 | + |
| 550 | + |
| 551 | + <!-- Set '${dist_file}_available' property if toolchain dist_file is downloaded --> |
| 552 | + <!-- Set '${dist_file}_installed' property if toolchain is installed in working directory --> |
| 553 | + <!-- hardware/tools/${dist_check_file} is checked for existence --> |
| 554 | + <target name="check-tool"> |
| 555 | + <available file="${staging_folder}/dist/${dist_file}" property="${dist_file}_available" /> |
| 556 | + <available file="${staging_folder}/work/hardware/tools/${dist_check_file}" property="${dist_file}_installed" /> |
| 557 | + </target> |
| 558 | + |
| 559 | + <!-- Retrieve tool --> |
| 560 | + <target name="get-tool" depends="check-tool" unless="${dist_file}_available"> |
| 561 | + <get src="${dist_url}" dest="${staging_folder}/dist/${dist_file}" verbose="true" ignoreerrors="true" /> |
| 562 | + </target> |
| 563 | + |
| 564 | + <!-- Ensure that the tool is downloaded and test checksums, if everything's ok unzip it on the tools folder --> |
| 565 | + <target name="unzip-tool" depends="get-tool, check-tool" unless="${dist_file}_installed"> |
| 566 | + <echo>Testing checksum of "${staging_folder}/dist/${dist_file}"</echo> |
| 567 | + <checksum file="${staging_folder}/dist/${dist_file}" algorithm="sha" fileext=".sha" verifyproperty="checksum.matches"/> |
| 568 | + <condition property="checksum.matches.fail"> |
| 569 | + <equals arg1="${checksum.matches}" arg2="false"/> |
| 570 | + </condition> |
| 571 | + <fail if="checksum.matches.fail">Checksum failed. |
| 572 | + |
| 573 | + File ${dist_file} failed checksum. |
| 574 | + Please remove "${staging_folder}/dist/${dist_file}" to download it again. |
| 575 | + </fail> |
| 576 | + |
| 577 | + <!-- Unzip tool to the destination folder --> |
| 578 | + <echo>Unzipping into folder ${staging_folder}/dist/${dist_file}</echo> |
| 579 | + <exec executable="tar"> |
| 580 | + <arg value="xfz"/> |
| 581 | + <arg value="${staging_folder}/dist/${dist_file}"/> |
| 582 | + <arg value="--directory=${staging_folder}/work/${staging_hardware_folder}/tools/"/> |
| 583 | + </exec> |
| 584 | + </target> |
| 585 | + |
| 586 | + |
| 587 | + |
549 | 588 | <!-- Set 'arm_disfile_available' property if ARM toolchain dist_file is downloaded -->
|
550 | 589 | <!-- Set 'arm_toolchain_installed' property if ARM toolchain is installed in working directory -->
|
551 | 590 | <target name="check-arm-toolchain">
|
|
0 commit comments