How To: compile Gargoyle on Mac OS X
Posted: Mon Feb 04, 2013 9:38 am
This is a streamlined version of this OpenWRT How To. Tested on Mac OS X 10.6.8 so your 10.x may have other issues (you may need git). Expect a full build to take about an hour.
------------------------------------------------------------------
1. Get the build environment. You'll need Xcode installed & macports. Then in Terminal.app:and
Some of these are probably no longer needed, but its pretty painless since port will get binaries for most of these. You only have to do this once.
2. Optional: install Node & UglifyJS for Gargoyle's javascript compression. If you are going to compile Gargoyle a few times, this just saves Gargoyle having to fetch & install Node; UglifyJS is pretty quick.
You may have to close a terminal window & reopen it the first time after installing npm for it to be available.
UglifyJS2 has some issue when it tries to mangle variables (shorten var some_absurdly_long_variable_name to var s) when I tried - TypeError: Cannot call method 'walk' of undefined - so UglifyJS1 (installed via the @1 switch above) mangles automagically.
3. The build scripts use features of utilities which are not present in the relative antiques that Apple provides. You will need to issue this command in each terminal session - it isn't permanent:
4. Set up a case sensitive disk image onto which Gargoyle/OpenWrt/Linux will be downloaded & compiled. This will create a 10GB disk image. Ammend TARGET_HARD_DRIVE to your system:
5. Get Gargoyle from the git repository:
5 & 1/2. Currently, disktype-9 needs to be patched (passed onto OpenWrt)
Download & extract this patch file:
5 & 3/4. Currently, some gargoyle libraries need to be patched - bugreport
Download & extract this patch file:
6. Compile. This will compile for the ar71xx platform with the usb_large profile:
I compared a Linux Mint 14 image with a Mac OS X image. They didn't match. I compared a single small .ipk file. They didn't match. It seems an .ipk file is 2 tar.gzip files - these files have timestamps. The timestamps alone will throw off any comparison, but I also found size discrepancies between a Linux&Mac build arising from (probably) deflate optimizations. At the end of it all, I have successfully flashed an image onto my TP-Link WRT3600 router using a Mac compiled image.
2013-Mar01 updated steps to expand $PATH to gnubin
2013-Mar10 (optional) Node & Uglify installed globally
2013-May23 updated GargoyleLibs.patch
------------------------------------------------------------------
1. Get the build environment. You'll need Xcode installed & macports. Then in Terminal.app:
Code: Select all
sudo port -v selfupdate
Code: Select all
sudo port -v install coreutils asciidoc binutils bzip2 fastjar flex getopt gtk2 intltool jikes zlib openssl p5-extutils-makemaker python26 rsync ruby sdcc unzip gettext libxslt bison gawk autoconf wget gmake ncurses bash
2. Optional: install Node & UglifyJS for Gargoyle's javascript compression. If you are going to compile Gargoyle a few times, this just saves Gargoyle having to fetch & install Node; UglifyJS is pretty quick.
Code: Select all
sudo port -v install nodejs npm
Code: Select all
sudo npm install -g uglify-js@1
3. The build scripts use features of utilities which are not present in the relative antiques that Apple provides. You will need to issue this command in each terminal session - it isn't permanent:
Code: Select all
export PATH=/opt/local/libexec/gnubin:$PATH
Code: Select all
hdiutil create /Volumes/TARGET_HARD_DRIVE/Gargoyle.sparsebundle -type SPARSEBUNDLE -size 10g -fs 'JHFS+X' -volname Gargoyle_source -layout NONE -attach
Code: Select all
cd /Volumes/Gargoyle_source && git clone git://gargoyle-router.com/gargoyle.git
Download & extract this patch file:
Code: Select all
cp ~/Desktop/03-disktype-MacMakefile.patch /Volumes/Gargoyle_source/gargoyle/package/disktype/patches
Download & extract this patch file:
Code: Select all
cd /Volumes/Gargoyle_source/gargoyle && patch -p0 -i ~/Desktop/GargoyleLibs.patch
Code: Select all
cd /Volumes/Gargoyle_source/gargoyle && make V=99 ar71xx.usb_large
I compared a Linux Mint 14 image with a Mac OS X image. They didn't match. I compared a single small .ipk file. They didn't match. It seems an .ipk file is 2 tar.gzip files - these files have timestamps. The timestamps alone will throw off any comparison, but I also found size discrepancies between a Linux&Mac build arising from (probably) deflate optimizations. At the end of it all, I have successfully flashed an image onto my TP-Link WRT3600 router using a Mac compiled image.
2013-Mar01 updated steps to expand $PATH to gnubin
2013-Mar10 (optional) Node & Uglify installed globally
2013-May23 updated GargoyleLibs.patch