Coder Social home page Coder Social logo

mdclyburn / crosstool-arm-osx Goto Github PK

View Code? Open in Web Editor NEW

This project forked from asymptotik/crosstool-arm-osx

0.0 1.0 0.0 100 KB

Scripts to install crosstool-ng and generate a cross compiler on osx for targeting arm-unknown-linux-gnueabi. More specifically, I use it as a script to create a development cross compiler on OS X to compile code for the Raspberry Pi.

Shell 100.00%

crosstool-arm-osx's Introduction

Raspberry Pi Cross Compiler Script for OSX

Author: Rick Boykin

Installs a gcc cross compiler for compiling code for raspberry pi on OSX. This script is based on several scripts and forum posts I've found around the web, the most significant being:

The script downloads, compiles and installs all necessary software. The only prerequisite I know of is to have the latest version of XCode and have the command line tools installed. It works for me without modification on OSX 10.7.4 with XCode 4.5.2

To use: open and read the build.sh script to suite your needs. Then run the script from within the folder it is contained. It will need to access the arm-unknown-linux-gnueabi.config file.

 bash build.sh 

The code will install some HomeBrew packages. I currently use mac ports. At some time during my attempts to setup this cross compiler it interfered with the install and as such I have it setup to install HomeBrew packages /brew/local such that you don't have to be a normal HomeBrew user and the environment is completely controlled.

Once HomeBrew is installed, the script creates a sparse HFSX (case sensitive) filesystem on which to perform the build. The filesystem image is a file that lives in the same directory as the script. It is currently set to be created at 8gig. Please be sure to have that much space available.

The script then downlaods and installs crosstool-ng. It helps to be a little familiar with the tool. See http://crosstool-ng.org/

Once crosstool is installed, it is configured with the arm-unknown-linux-gnueabi.config file by copying that file to the approproite location where crosstool will pick it up. The script then automatically fires up the crosstool config menu (menuconfig) so you can make changes. The menuconfig program is basically a front end for the config file. You can either make changes or just exit. You can also just edit the config file before running the script and remove call to:

   PATH=$BrewHome/bin:$PATH ../${CrossToolVersion}/ct-ng menuconfig

Once that is all done, we run the build. If all goes well, you will then have a toolchain for comiling arm code on osx. The default install is in /Volumes/CrossToolNG/install/arm-unknown-linux-gnueabi

As a smoke test you can create a simple HelloWorld program and compile it. That would be something like:

cat <<EOF >> HelloWorld.cpp
#include <iostream>
using namespace std;

int main ()
{
  cout << "Hello World!";
  return 0;
}
EOF

PATH=/Volumes/CrossToolNG/install/arm-unknown-linux-gnueabi/bin:$PATH arm-linux-gnueabihf-g++ HelloWorld.cpp -o HelloWorld

Go forth and compile.

crosstool-arm-osx's People

Contributors

asymptotik avatar mdclyburn avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.