nisshi9の備忘録ブログ

気まぐれなタイミングで、興味のわいた事について書いていくブログです。

OSX mountain lion 10.8.2 にarm-none-eabi-gccをインストールする

普段Linux上でコンパイルしているソースコードを、MacbookAirでもコンパイルできないかと思い始めた。そこで、特にリサーチもせずに、クロスコンパイラのツールチェーンである、arm-none-eabi-gccをインストールして、やれるのかどうか試みることにした。ところが、OSX Mountain Lionをクリーンインストールしていたために、思った程すんなり入らなかったので記録する事に。

 

-Mac Portsをインストールする

 brewには入っていない様子。

 ウェブサイトからpkgをダウンロードしインストール

 http://www.macports.org/install.php

 

-xcodeをインストールする。

 mba13:~ nolu$ sudo port  install arm-none-eabi-gcc
 Error: The installed version of Xcode (2.0orlower) is too old to use on the installed OS

 version. Version 4.1 or later is recommended on Mac OS X 10.8.
 To report a bug, follow the instructions in the guide:
     http://guide.macports.org/#project.tickets
 Error: Processing of port arm-none-eabi-gcc failed

-Command Line Tool for Xcodeをインストールする

 mba13:~ nolu$ sudo port  install arm-none-eabi-gcc
 Warning: The Command Line Tools for Xcode don't appear to be installed; most

 ports will likely fail to build.
 Warning: See http://guide.macports.org/chunked/installing.xcode.html for more

 information.
 --->  Computing dependencies for arm-none-eabi-gccError: Unable to execute port:

 can't read "build.cmd": Failed to locate 'make' in path: '/opt/local/bin:/opt/local/sbin:

 /bin:/sbin:/usr/bin:/usr/sbin' or at its MacPorts configuration time location, did you

 move it?

ということなので、検索すると、Command Line Tool for Xcodeをインストールすると解決する様子。下記のページに感謝!

 http://morikuma.org/blog/348

 

-arm-none-eabi-gccをmac portsでインストール

 mba13:~ nolu$ sudo port  install arm-none-eabi-gcc
 --->  Computing dependencies for arm-none-eabi-gcc
 --->  Dependencies to be installed: arm-none-eabi-binutils gettext expat libiconv

 gperf ncurses gmp libmpc mpfr xz

  ・

  ・

  ・

 --->  Verifying checksum(s) for arm-none-eabi-gcc
 --->  Extracting arm-none-eabi-gcc
 --->  Configuring arm-none-eabi-gcc
 --->  Building arm-none-eabi-gcc
 --->  Staging arm-none-eabi-gcc into destroot

 Warning: arm-none-eabi-gcc installs files outside the common directory structure.
 --->  Installing arm-none-eabi-gcc @4.6.2_0
 --->  Activating arm-none-eabi-gcc @4.6.2_0
 --->  Cleaning arm-none-eabi-gcc
 --->  Updating database of binaries: 100.0%
 --->  Scanning binaries for linking errors: 100.0%
 --->  No broken files found.

 

というわけで、インストールされました。

めでたしめでたし。