summaryrefslogtreecommitdiff
path: root/INSTALL.md
diff options
context:
space:
mode:
Diffstat (limited to 'INSTALL.md')
-rw-r--r--INSTALL.md204
1 files changed, 188 insertions, 16 deletions
diff --git a/INSTALL.md b/INSTALL.md
index adab3c05..1aed5375 100644
--- a/INSTALL.md
+++ b/INSTALL.md
@@ -1,18 +1,22 @@
1#Install Instructions 1#Install Instructions
2 2
3- [Installation](#installation) 3- [Installation](#installation)
4 - [Unix like](#unix) 4 - [Unix like](#unix)
5 - [OS X](#osx) 5 - [OS X](#osx)
6 - [Homebrew](#homebrew) 6 - [Homebrew](#homebrew)
7 - [Non-Homebrew](#non-homebrew) 7 - [Non-Homebrew](#non-homebrew)
8 - [Windows](#windows) 8 - [Windows](#windows)
9 9 - [Cross-Compile](#windows-cross-compile)
10 - [Setting up a VM](#windows-cross-compile-vm)
11 - [Setting up the environment](#windows-cross-compile-environment)
12 - [Compiling](#windows-cross-compile-compiling)
13 - [Native](#windows-native)
10- [Additional](#additional) 14- [Additional](#additional)
11 - [Advanced configure options] (#aconf) 15 - [Advanced configure options](#aconf)
12 - [A/V support](#av) 16 - [A/V support](#av)
13 - [libtoxav] (#libtoxav) 17 - [libtoxav](#libtoxav)
14 - [Bootstrap daemon] (#bootstrapd) 18 - [Bootstrap daemon](#bootstrapd)
15 - [nTox] (#ntox) 19 - [nTox](#ntox)
16 20
17<a name="installation" /> 21<a name="installation" />
18##Installation 22##Installation
@@ -176,12 +180,182 @@ http://caiustheory.com/install-gcc-421-apple-build-56663-with-xcode-42
176<a name="windows" /> 180<a name="windows" />
177###Windows: 181###Windows:
178 182
183<a name="windows-cross-compile" />
184
185####Cross-compile
186
187It's a bit challenging to build Tox and all of its dependencies nativly on Windows, so we will show an easier, less error and headache prone method of building it -- cross-compiling.
188
189<a name="windows-cross-compile-vm" />
190#####Setting up a VM
191
192We will assume that you don't have any VM running Linux around and will guide you from the ground up.
193
194First, you would need to get a virtual machine and a Linux distribution image file.
195
196For a virtual machine we will use VirtualBox. You can get it [here](https://www.virtualbox.org/wiki/Downloads).
197
198For a Linux distribution we will use Lubuntu 14.04 32-bit, which you can get [here](https://help.ubuntu.com/community/Lubuntu/GetLubuntu).
199
200After you have those downloaded, install the VirtualBox and create a VM in it. The default of 512mb of RAM and 8gb of dynamically-allocated virtual hard drive would be enough.
201
202When you have created the VM, go into its **Settings** -> **System** -> **Processor** and add some cores, if you have any additional available, for faster builds.
203
204Then, go to **Settings** -> **Storage**, click on **Empty** under **Controller: IDE**, click on the little disc icon on the right side of the window, click on **Choose a virtual CD/DVD disk file** and select the downloaded Lubuntu image file.
205
206Start the VM and follow the installation instructions.
207
208After Lubuntu is installed and you have booted into it, in VirtualBox menu on top of the window select **Devices** -> **Insert Guest Additions CD image...**.
209
210Open terminal from **Lubuntu's menu** -> **Accessories**.
211
212Execute:
213```bash
214sudo apt-get update
215sudo apt-get install build-essential -y
216cd /media/*/*/
217sudo ./VBoxLinuxAdditions.run
218```
219
220After that, create a folder called `toxbuild` somewhere on your Windows system. The go to **Devices** -> **Shared Folders Settings...** in the VirtualBox menu, add the `toxbuild` folder there and set **Auto-mount** and **Make Permanent** options.
221
222Execute:
223```bash
224sudo adduser `whoami` vboxsf
225```
226Note the use of a [grave accent](http://en.wikipedia.org/wiki/Grave_accent) instead of an apostrophe.
227
228Then just reboot the system with:
229```bash
230sudo reboot
231```
232
233After the system is booted, go to **Devices** -> **Shared Clipboard** and select **Bidirectional**. Now you will be able to copy-paste text between the host and the guest systems.
234
235Now that the virtual machine is all set up, let's move to getting build dependencies and setting up environment variables.
236
237<a name="windows-cross-compile-environment" />
238#####Setting up the environment
239
240First we will install all tools that we would need for building:
241```bash
242sudo apt-get install build-essential libtool autotools-dev automake checkinstall check git yasm pkg-config mingw-w64 -y
243```
244
245Then we will define a few variables, **depending on which you will build either 32-bit or 64-bit Tox**.
246
247For 32-bit Tox build, do:
248```bash
249WINDOWS_TOOLCHAIN=i686-w64-mingw32
250LIB_VPX_TARGET=x86-win32-gcc
251```
252
253For 64-bit Tox build, do:
254```bash
255WINDOWS_TOOLCHAIN=x86_64-w64-mingw32
256LIB_VPX_TARGET=x86_64-win64-gcc
257```
258
259This is the only difference between 32-bit and 64-bit build procedures.
260
261For speeding up the build process do:
262```
263MAKEFLAGS=j$(nproc)
264export MAKEFLAGS
265```
266
267And let's make a folder where we will be building everything at
268```bash
269cd ~
270mkdir prefix
271cd prefix
272PREFIX_DIR=$(pwd)
273cd ..
274mkdir build
275cd build
276```
277
278<a name="windows-cross-compile-compiling" />
279#####Compiling
280
281Now we will build libraries needed for audio/video: VPX and Opus.
282
283VPX:
284```bash
285git clone http://git.chromium.org/webm/libvpx.git
286cd libvpx
287git checkout tags/v1.3.0
288CROSS="$WINDOWS_TOOLCHAIN"- ./configure --target="$LIB_VPX_TARGET" --prefix="$PREFIX_DIR" --disable-examples --disable-unit-tests --disable-shared --enable-static
289make
290make install
291cd ..
292```
293
294Opus:
295```bash
296wget http://downloads.xiph.org/releases/opus/opus-1.1.tar.gz
297tar -xf opus-1.1.tar.gz
298cd opus-1.1
299./configure --host="$WINDOWS_TOOLCHAIN" --prefix="$PREFIX_DIR" --disable-extra-programs --disable-doc --disable-shared --enable-static
300make
301make install
302cd ..
303```
304
305Now we will build sodium crypto library:
306```bash
307git clone https://github.com/jedisct1/libsodium/
308cd libsodium
309git checkout tags/0.4.5
310./autogen.sh
311./configure --host="$WINDOWS_TOOLCHAIN" --prefix="$PREFIX_DIR" --disable-shared --enable-static
312make
313make install
314cd ..
315```
316
317And finally we will build Tox:
318```bash
319git clone https://github.com/irungentoo/toxcore
320cd toxcore
321./autogen.sh
322./configure --host="$WINDOWS_TOOLCHAIN" --prefix="$PREFIX_DIR" --disable-ntox --disable-tests --disable-testing --with-dependency-search="$PREFIX_DIR" --disable-shared --enable-static
323make
324make install
325cd ..
326```
327
328Then we make Tox shared library:
329```bash
330cd "$PREFIX_DIR"
331mkdir tmp
332cd tmp
333$WINDOWS_TOOLCHAIN-ar x ../lib/libtoxcore.a
334$WINDOWS_TOOLCHAIN-ar x ../lib/libtoxav.a
335$WINDOWS_TOOLCHAIN-ar x ../lib/libtoxdns.a
336$WINDOWS_TOOLCHAIN-gcc -Wl,--export-all-symbols -Wl,--out-implib=libtox.dll.a -shared -o libtox.dll *.o ../lib/*.a /usr/$WINDOWS_TOOLCHAIN/lib/libwinpthread.a -lws2_32 -static-libgcc
337```
338
339And we will copy it over to the `toxbuild` directory:
340```bash
341mkdir -p /media/sf_toxbuild/release/lib
342mv libtox.dll* /media/sf_toxbuild/release/lib
343mkdir -p /media/sf_toxbuild/release/include
344mv ../include/tox /media/sf_toxbuild/release/include
345```
346
347That's it. Now you should have `release/lib/libtox.dll` and `release/include/tox/<headers>` in your `toxbuild` directory on the Windows system.
348
349<a name="windows-native" />
350####Native
351
352Note that the Native instructions are incomplete, in a sense that they miss instructions needed for adding audio/video support to Tox. You also might stumble upon some unknown MinGW+msys issues while trying to build it.
353
179You should install: 354You should install:
180 - [MinGW](http://sourceforge.net/projects/mingw/) 355 - [MinGW](http://sourceforge.net/projects/mingw/)
181 356
182When installing MinGW, make sure to select the MSYS option in the installer. 357When installing MinGW, make sure to select the MSYS option in the installer.
183MinGW will install an "MinGW shell" (you should get a shortcut for it), make 358MinGW will install an "MinGW shell" (you should get a shortcut for it), make sure to perform all operations (i.e., generating/running configure script, compiling, etc.) from the MinGW shell.
184sure to perform all operations (i.e., generating/running configure script, compiling, etc.) from the MinGW shell.
185 359
186First download the source tarball from https://download.libsodium.org/libsodium/releases/ and build it. 360First download the source tarball from https://download.libsodium.org/libsodium/releases/ and build it.
187Assuming that you got the libsodium-0.5.0.tar.gz release: 361Assuming that you got the libsodium-0.5.0.tar.gz release:
@@ -194,8 +368,7 @@ make install
194cd .. 368cd ..
195``` 369```
196 370
197You can also use a precompiled win32 binary of libsodium, however you will have 371You can also use a precompiled win32 binary of libsodium, however you will have to place the files in places where they can be found, i.e., dll's go to /bin headers to /include and libraries to /lib directories in your MinGW shell.
198to place the files in places where they can be found, i.e., dll's go to /bin headers to /include and libraries to /lib directories in your MinGW shell.
199 372
200Next, install ProjectTox-Core library, 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. 373Next, install ProjectTox-Core library, 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.
201 374
@@ -335,4 +508,3 @@ Install on ubuntu:
335```bash 508```bash
336sudo apt-get install ncurses-dev 509sudo apt-get install ncurses-dev
337``` 510```
338