2013-07-19 04:29:59 +08:00
##Installation
###Linux:
You should get and install [libsodium ](https://github.com/jedisct1/libsodium ):
```bash
git clone git://github.com/jedisct1/libsodium.git
cd libsodium
git checkout tags/0.4.2
./autogen.sh
./configure & & make check
sudo make install
sudo ldconfig
```
Then clone this repo and run:
```bash
2013-07-22 09:12:00 +08:00
mkdir build & & cd build
cmake ..
2013-07-19 04:29:59 +08:00
```
2013-07-22 09:12:00 +08:00
Then you can build any of the [`/testing` ](/testing ) and [`/other` ](/other ) that are currently supported on your platform by running:
2013-07-19 04:29:59 +08:00
```bash
make name_of_c_file
```
For example, to build [`Messenger_test.c` ](/others/Messenger_test.c ) you would run:
```bash
make Messenger_test
```
2013-07-22 09:12:00 +08:00
Or you could just build everything that is supported on your platform by running:
```bash
make
```
2013-07-22 01:15:05 +08:00
###OSX:
Much the same as above, remember to install the latest XCode and the developer tools (Preferences -> Downloads -> Command Line Tools).
Users running Mountain Lion and the latest version of XCode (4.6.3) will also need to install libtool
Libtool is easy enough to install, grab it from http://www.gnu.org/software/libtool/ and:
./configure
make
sudo make install
Do not install it from macports (or any dependencies for that matter) as they get shoved in the wrong directory
and make your life more annoying.
Another thing you may want to install is the latest gcc, this caused me a few problems as XCode from 4.3
no longer includes gcc and instead uses LLVM-GCC, a nice install guide can be found at
http://caiustheory.com/install-gcc-421-apple-build-56663-with-xcode-42
2013-07-19 04:29:59 +08:00
###Windows:
You should install:
- [MinGW ](http://sourceforge.net/projects/mingw/ )'s C compiler
- [CMake ](http://www.cmake.org/cmake/resources/software.html )
2013-07-27 08:39:16 +08:00
2013-07-27 08:46:35 +08:00
Firstly, you need to change your system's PATH. Navigate to My Computer>System Properties>Advanced System Settings>Environment Variables.
2013-07-27 08:39:16 +08:00
Then under System Variables, edit your PATH and add C:\MinGW\bin; to the end of it (Change this to your MinGW install directory - C:\MinGW by default).
Make sure there's a ";" preceding this entry as well.
2013-07-19 04:29:59 +08:00
Then you should either clone this repo by using git, or just download a [zip of current Master branch ](https://github.com/irungentoo/ProjectTox-Core/archive/master.zip ) and extract it somewhere.
After that you should get precompiled packages of libsodium from [here ](https://download.libsodium.org/libsodium/releases/ ) and extract the archive into this repo's root. That is, `sodium` folder should be along with `core` , `testing` and other folders.
Navigate in `cmd` to this repo and run:
```cmd
2013-07-22 09:12:00 +08:00
mkdir build & & cd build
cmake -G "MinGW Makefiles" ..
2013-07-19 04:29:59 +08:00
```
2013-07-22 09:12:00 +08:00
Then you can build any of the [`/testing` ](/testing ) and [`/other` ](/other ) that are currently supported on your platform by running:
2013-07-19 04:29:59 +08:00
```cmd
mingw32-make name_of_c_file
```
For example, to build [`Messenger_test.c` ](/others/Messenger_test.c ) you would run:
```cmd
mingw32-make Messenger_test
2013-07-22 01:15:05 +08:00
```
2013-07-22 09:12:00 +08:00
Or you could just build everything that is supported on your platform by running:
```bash
mingw32-make
```