Carambola2 OpenWRT on Mac OS X Mavericks

There are some sources about building developing OpenWRT on Mac OS X, you have follow different instructions in different web sites. Here is the complete steps to build OpenWRT on Mac OS X 10.9 Mavericks. I tested it both Carambola 2 native and OpenWRT x86 architectures.

First, you need a disk image on your mac. Go to Disk Utiliy->New Image-> Case sensitive, sparse disk Image. I allocate 15GB to work on 2 different builds.

Second, you have to install XCode from App Store, and Command Line Tools or run this on terminal;

xcode-select --install

Third, install macports and install required packages by macports using commandline;

sudo port selfupdate

sudo port install gcc47

sudo port install apple-gcc42

sudo port install coreutils asciidoc bzip2 fastjar flex getopt gtk2 intltool jikes zlib openssl p5-extutils-makemaker rsync ruby sdcc unzip gettext libxslt bison gawk autoconf wget gmake ncurses e2fsprogs ossp-uuid gawk findutils gnutar

Now, everything is ready to get the source code and build.  Mount the disk we setup in the first step and cd into and get OpenWRT stable version.

cd /Volumes/OpenWRT

git clone git://git.openwrt.org/12.09/openwrt.git

or you can clone Carambola 2 sources from github

git clone https://github.com/8devices/carambola2.git

Select gcc 4.2 to compile tools and gcc 4.7 for the rest.

sudo port select –set gcc apple-gcc42

export PATH=/opt/local/libexec/gnubin:/opt/local/bin:${PATH}

make menuconfig

If you are building carambola 2 don’t change architecture. For OpenWRT  you  can choose x86 or whatever you want. For development purposes, following options need to be enabled.

Save changes and run;

make tools/install

After everything compiles successfully, select gcc 4.7 and run make;

sudo port select –set gcc mp-gcc47

make

References;
http://wiki.openwrt.org/easy.build.macosx

http://wiki.openwrt.org/doc/howto/buildroot.exigence.macosx

https://forum.openwrt.org/viewtopic.php?id=47058