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