OS X Readme
===========

This manual explains how to manually build tarantool from sources.

Supporting kinds of build with default Apple developer software and external as
homebrew as MacPorts.

If you want to build at the Homebrew environment execute just:

        brew install http://tarantool.org/dist/tarantool.rb

Target OS: MacOS X "Lion"

First of all, make sure mac ports are available (to install packages from).

1. Install necessary packages (ports):
-------------

Default build depended by Developer tools by Apple and -DDARWIN_BUILD_TYPE=None:

	sudo xcode-select --install
	sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer

To enable build type with MacPorts set up the flag -DDARWIN_BUILD_TYPE=Ports:

	port install autoconf binutils cmake ncurses zlib readline

2. Upgrade clang to 3.2+
-------------

Go to http://developer.apple.com/ to download and install the latest version
of "Command Line Tools for Xcode". This package contains /usr/bin/clang and
/usr/bin/clang++ binaries. Check that clang version is at least 3.2.

3. Install necessary python modules: pyYAML, daemon
-------------
NB: it is recommended to install python modules through setup.py,
using the default python (which should be >= 2.6.x and < 3.x);

tar -xzf module.tar.gz
cd module-dir
sudo python setup.py install

where module is the name of the installed module and module-dir is the name of
the directory the module's archive deflates into.

4. Download & build tarantool source code:
-------------

NOTE: If you want to get DMG package go to section 6.

git clone --recursive git://github.com/tarantool/tarantool.git

cd tarantool
mkdir build && cd build
CC=clang CXX=clang++ cmake .. \
	-DCMAKE_BUILD_TYPE=RelWithDebugInfo \
	-DENABLE_CLIENT=true \
	-DDARWIN_BUILD_TYPE=Ports
make

5. Run tarantool test suite
-------------
NB: the following tests are not runnable on MacOS X at this point:

box/lua.test
box_big/lua.test
connector_c/xlog_rpl.test

To disable those add each of them to the 'disabled' clause in suite.ini file
in the appropriate directory; for instance, tarantool/test/box/suite.ini must
be edited to disable any test in the 'box' suite;

To run all tests then, execute:

cd ~/build/tarantool/test
./run

6. Build DMG package
-------------

Building DMG depended by "Auxiliary Tools for Xcode", which be able to download from:

https://developer.apple.com (necessary login with Apple ID account).

Execute commands to get DMG package by root (if you not root you'll get files with incorrect permissions):

mkdir build && cd build
sudo -s
cmake ..  \
	-DCMAKE_INSTALL_PREFIX=/usr/local \
	-DCMAKE_BUILD_TYPE=Rel \
	-DENABLE_BACKTRACE=OFF \
	-DCMAKE_C_COMPILER="clang" \
	-DCMAKE_CXX_COMPILER="clang++" \
	-DDARWIN_BUILD_TYPE=None \
	-DENABLE_CLIENT=ON

make package


-- EOF

