Build Instructions
Currently SilkJS builds on Ubuntu/Linux and Mac OSX. Building for Ubuntu is rather straightforward, thanks to the apt package management system. Building for OSX is a bit more complicated as MacPorts is required as well as downloading and manually compiling libraries that SilkJS links with.
These instructions are for Ubuntu Oneiric, though they will work for other versions of Ubuntu as well. I like to build my C/C++ projects in my ~mschwartz/src directory. Feel free to adapt these instructions to suit your preferences.
See these instructions for how to build v8 with gyp: http://code.google.com/p/v8/wiki/BuildingWithGYP
- sudo apt-get install build-essential
- sudo apt-get install subversion
- mkdir src
- cd src
- svn checkout http://v8.googlecode.com/svn/trunk/ v8-read-only
- cd v8-read-only
- make dependencies
- GYP_GENERATORS=make make x64.release (can do make ia32.release for 32-bit version)
- cd ~/src
- sudo apt-get install git
- git clone git@github.com:mschwartz/SilkJS.git SilkJS
The following prerequisites must be installed before building SilkJS:
- sudo apt-get install libmm-dev
- sudo apt-get install libmysqlclient-dev
- sudo apt-get install libgd2-xpm-dev
- sudo apt-get install libncurses5-dev
- sudo apt-get install libssl-dev
- sudo apt-get install apache2-util
The apache2-util package installs the ab program, which can be used to benchmark SilkJS and other HTTP servers.
SilkJS should now build:
- cd ~/src/SilkJS
- make
To see it works:
- ./SilkJS httpd/main.js
- ab -t 30 -c 50 -k http://localhost:9090/anchor.png
Building for OSX is much more complicated, and there may be some issues with the new gyp build system that prevent SilkJS from being built for OSX using gyp.
According to the gyp build instructions page (for v8): "trying to build x64 targets on Mac currently fails."
That said...
First install Xcode from the App Store. It's free.
Next, install the command line binary version of SubVersion from this page: http://www.wandisco.com/subversion/download#osx
Make sure to edit your ~/.profile to include this line at the end: export PATH=/opt/subversion/bin:$PATH
Then close and open your shell window again.
- cd ~
- mkdir src
- download scons-2.1.0.tar.gz from http://scons.org to your ~/src directory
- cd src && tar xzvfp scons-2.1.0.tar.gz
- cd scons-2.1.0
- sudo python setup.py install
Building the dependent libraries:
-
download mm_1.4.2.orig.tar.gz to your ~/src directory
-
cd ~/src && tar xzvfp mm_1.4.2.orig.tar.gz
-
cd mm-1.4.2
-
./configure
-
make
-
sudo make install
-
download mysql-5.1.58.tar.gz to your ~/src directory
-
cd ~/src && tar xzvfp mysql-5.1.58.tar.gz
-
cd mysql-5.1.58
-
./configure
-
make
-
sudo make install
-
download libjpeg8_8b.orig.tar.gz to your ~/src directory
-
cd ~/src && tar xzvfp libjpeg8_8b.orig.tar.gz
-
cd jpeg-8b
-
./configure
-
make
-
sudo make install
-
download libgd2_2.0.36
rc1dfsg.orig.tar.gz to your ~/src directory -
cd
/src && tar xzvfp libgd2_2.0.36rc1~dfsg.orig.tar.gz -
cd libgd2_2.0.36
rc1dfsg.orig.tar.gz -
./configure
-
make
-
sudo make install
- svn checkout http://v8.googlecode.com/svn/trunk/ v8-read-only
- cd v8-read-only
- scons arch=x64
- git clone git@github.com:mschwartz/SilkJS.git SilkJS
- cd SilkJS
- make -f Makefile.osx