From 900e3bea6b4949cf646071967f2be93ce6009651 Mon Sep 17 00:00:00 2001 From: Sean Date: Sat, 25 Jan 2014 10:44:07 -0800 Subject: Improved support for Plan 9, older SunOS, and AIX. --- toxcore/tox.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/toxcore/tox.h b/toxcore/tox.h index f3118270..aff8b17e 100644 --- a/toxcore/tox.h +++ b/toxcore/tox.h @@ -24,6 +24,11 @@ #ifndef TOX_H #define TOX_H +#ifndef PLAN9 +#include +#include +#endif + #include #if defined(_WIN32) || defined(__WIN32__) || defined (WIN32) @@ -57,6 +62,18 @@ typedef short sa_family_t; extern "C" { #endif +#if defined(__AIX__) +# define _XOPEN_SOURCE 1 +#endif + +#if defined(__sun__) +#define __EXTENSIONS__ 1 /* SunOS */ +#if defined(__SunOS5_6__) || defined(__SunOS5_7__) || defined(__SunOS5_8__) || defined(__SunOS5_9__) || defined(__SunOS5_10__) +//Nothing needed +#else +#define __MAKECONTEXT_V2_SOURCE 1 +#endif + #define TOX_MAX_NAME_LENGTH 128 #define TOX_MAX_STATUSMESSAGE_LENGTH 128 #define TOX_CLIENT_ID_SIZE 32 -- cgit v1.2.3 From d89bd2a6a99701f6367486f70ad48094e5d73fd4 Mon Sep 17 00:00:00 2001 From: Sean Date: Sat, 25 Jan 2014 18:44:36 -0800 Subject: Not my finest moment --- toxcore/tox.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/toxcore/tox.h b/toxcore/tox.h index aff8b17e..072979c8 100644 --- a/toxcore/tox.h +++ b/toxcore/tox.h @@ -24,7 +24,7 @@ #ifndef TOX_H #define TOX_H -#ifndef PLAN9 +#ifdef PLAN9 #include #include #endif -- cgit v1.2.3 From 803c6f41d7c5dd177c7ebd3c75e53908da80dedf Mon Sep 17 00:00:00 2001 From: Sean Date: Sat, 25 Jan 2014 18:48:49 -0800 Subject: Moved to networking.h Plan 9 requires u.h in every file --- toxcore/network.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/toxcore/network.h b/toxcore/network.h index 0e0f0af9..ae2cb081 100644 --- a/toxcore/network.h +++ b/toxcore/network.h @@ -24,6 +24,11 @@ #ifndef NETWORK_H #define NETWORK_H +#ifdef PLAN9 +#include //Plan 9 requires this is imported first +#include +#endif + #include #include #include @@ -75,6 +80,18 @@ typedef int sock_t; #endif +#if defined(__AIX__) +# define _XOPEN_SOURCE 1 +#endif + +#if defined(__sun__) +#define __EXTENSIONS__ 1 // SunOS! +#if defined(__SunOS5_6__) || defined(__SunOS5_7__) || defined(__SunOS5_8__) || defined(__SunOS5_9__) || defined(__SunOS5_10__) +//Nothing needed +#else +#define __MAKECONTEXT_V2_SOURCE 1 +#endif + #ifndef VANILLA_NACL /* We use libsodium by default. */ #include -- cgit v1.2.3 From 4e84497a68de79d5f52471f612a8a0e93c133078 Mon Sep 17 00:00:00 2001 From: Sean Date: Sat, 25 Jan 2014 18:50:23 -0800 Subject: Moved Unix support Networking.h is imported by everything. --- toxcore/tox.h | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/toxcore/tox.h b/toxcore/tox.h index 072979c8..7151c9ae 100644 --- a/toxcore/tox.h +++ b/toxcore/tox.h @@ -23,12 +23,6 @@ #ifndef TOX_H #define TOX_H - -#ifdef PLAN9 -#include -#include -#endif - #include #if defined(_WIN32) || defined(__WIN32__) || defined (WIN32) @@ -62,18 +56,6 @@ typedef short sa_family_t; extern "C" { #endif -#if defined(__AIX__) -# define _XOPEN_SOURCE 1 -#endif - -#if defined(__sun__) -#define __EXTENSIONS__ 1 /* SunOS */ -#if defined(__SunOS5_6__) || defined(__SunOS5_7__) || defined(__SunOS5_8__) || defined(__SunOS5_9__) || defined(__SunOS5_10__) -//Nothing needed -#else -#define __MAKECONTEXT_V2_SOURCE 1 -#endif - #define TOX_MAX_NAME_LENGTH 128 #define TOX_MAX_STATUSMESSAGE_LENGTH 128 #define TOX_CLIENT_ID_SIZE 32 -- cgit v1.2.3 From c766ff95d023b905ad6ded50e57bb89e94627693 Mon Sep 17 00:00:00 2001 From: Sean Date: Sat, 25 Jan 2014 18:51:55 -0800 Subject: That newline looks cleaner --- toxcore/tox.h | 1 + 1 file changed, 1 insertion(+) diff --git a/toxcore/tox.h b/toxcore/tox.h index 7151c9ae..f3118270 100644 --- a/toxcore/tox.h +++ b/toxcore/tox.h @@ -23,6 +23,7 @@ #ifndef TOX_H #define TOX_H + #include #if defined(_WIN32) || defined(__WIN32__) || defined (WIN32) -- cgit v1.2.3 From 2ead95b56bb11643d6d3edb911e22a52c2fb6b68 Mon Sep 17 00:00:00 2001 From: Sean Date: Sat, 25 Jan 2014 19:02:47 -0800 Subject: made install.md Unix friendly --- INSTALL.md | 38 ++++++++++---------------------------- 1 file changed, 10 insertions(+), 28 deletions(-) diff --git a/INSTALL.md b/INSTALL.md index 03e3da2c..4f98831d 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -1,7 +1,7 @@ #Install Instructions - [Installation](#installation) - - [Linux](#linux) + - [Unix like (Linux)](#unix) - [OS X](#osx) - [Homebrew](#homebrew) - [Non-Homebrew](#non-homebrew) @@ -10,11 +10,15 @@ ##Installation - -###Linux: + +###Most Unix like OSes (Linux): Build dependencies: +Note: package fetching commands may vary by OS. + +On Ubuntu: + ```bash sudo apt-get install build-essential libtool autotools-dev automake libconfig-dev ncurses-dev checkinstall check git libswscale-dev libsdl-dev libopenal-dev libopus-dev libvpx-dev yasm ``` @@ -24,7 +28,7 @@ On Fedora: ```bash yum groupinstall "Development Tools" yum install libtool autoconf automake libconfig-devel ncurses-devel check check-devel -``` +``` Note that `libconfig-dev` should be >= 1.4. @@ -54,7 +58,7 @@ make check sudo make install cd .. ``` -If your default prefix is /usr/local and you happen to get an error that says "error while loading shared libraries: libtoxcore.so.0: cannot open shared object file: No such file or directory", then you can try running ```sudo ldconfig```. If that doesn't fix it, run: +If your default prefix is /usr/local and you happen to get an error that says "error while loading shared libraries: libtoxcore.so.0: cannot open shared object file: No such file or directory", then you can try running ```sudo ldconfig```, this is an issue common on Linux. If that doesn't fix it, run: ``` echo '/usr/local/lib/' | sudo tee -a /etc/ld.so.conf.d/locallib.conf sudo ldconfig @@ -100,13 +104,6 @@ The following libraries are required along with libsodium and cmake for Mountain There are no binaries/executables going to /bin/ or /usr/bin/ now. Everything is compiled and ran from the inside your local branch. See [Usage](#usage) below. ####Homebrew: -To install from the formula: -```bash -brew tap Tox/tox -brew install --HEAD libtoxcore -``` - -To do it manually: ``` brew install libtool automake autoconf libconfig libsodium check ``` @@ -119,21 +116,6 @@ autoreconf -i make make install ``` - -If execution fails with errors like "dyld: Library not loaded: /opt/tox-im/lib/libtoxcore.0.dylib", you may need to specify libsodium path: - -Determine paths: -``` -brew list libsodium -``` - -Configure include and lib folder and build again: -```bash -./configure--with-libsodium-headers=/usr/local/Cellar/libsodium/0.4.5/include/ --with-libsodium-libs=/usr/local/Cellar/libsodium/0.4.5/lib/ -make -make install -``` - Advance configure options: - --prefix=/where/to/install - --with-libsodium-headers=/path/to/libsodium/include/ @@ -201,7 +183,7 @@ You should install: - [MinGW](http://sourceforge.net/projects/mingw/) When installing MinGW, make sure to select the MSYS option in the installer. -MinGW 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. +MinGW will install an "MinGW shell" (you should get a shortcut for it), make sure to perform all opeartions (i.e. generating/running configure script, compiling, etc.) from the MinGW shell. First download the source tarball from http://download.libsodium.org/libsodium/releases/ and build it. Assuming that you got the libsodium-0.4.2.tar.gz release: -- cgit v1.2.3 From 934ddff24bac0c99e25942be76f67584845e847f Mon Sep 17 00:00:00 2001 From: Sean Date: Sat, 25 Jan 2014 19:13:07 -0800 Subject: Fixed reverting install.md --- INSTALL.md | 28 +++++++++++++++++++++++++--- 1 file changed, 25 insertions(+), 3 deletions(-) diff --git a/INSTALL.md b/INSTALL.md index 4f98831d..5d8cd2c2 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -28,7 +28,7 @@ On Fedora: ```bash yum groupinstall "Development Tools" yum install libtool autoconf automake libconfig-devel ncurses-devel check check-devel -``` +``` Note that `libconfig-dev` should be >= 1.4. @@ -58,7 +58,7 @@ make check sudo make install cd .. ``` -If your default prefix is /usr/local and you happen to get an error that says "error while loading shared libraries: libtoxcore.so.0: cannot open shared object file: No such file or directory", then you can try running ```sudo ldconfig```, this is an issue common on Linux. If that doesn't fix it, run: +If your default prefix is /usr/local and you happen to get an error that says "error while loading shared libraries: libtoxcore.so.0: cannot open shared object file: No such file or directory", then you can try running ```sudo ldconfig```. If that doesn't fix it, run: ``` echo '/usr/local/lib/' | sudo tee -a /etc/ld.so.conf.d/locallib.conf sudo ldconfig @@ -104,6 +104,13 @@ The following libraries are required along with libsodium and cmake for Mountain There are no binaries/executables going to /bin/ or /usr/bin/ now. Everything is compiled and ran from the inside your local branch. See [Usage](#usage) below. ####Homebrew: +To install from the formula: +```bash +brew tap Tox/tox +brew install --HEAD libtoxcore +``` + +To do it manually: ``` brew install libtool automake autoconf libconfig libsodium check ``` @@ -116,6 +123,21 @@ autoreconf -i make make install ``` + +If execution fails with errors like "dyld: Library not loaded: /opt/tox-im/lib/libtoxcore.0.dylib", you may need to specify libsodium path: + +Determine paths: +``` +brew list libsodium +``` + +Configure include and lib folder and build again: +```bash +./configure--with-libsodium-headers=/usr/local/Cellar/libsodium/0.4.5/include/ --with-libsodium-libs=/usr/local/Cellar/libsodium/0.4.5/lib/ +make +make install +``` + Advance configure options: - --prefix=/where/to/install - --with-libsodium-headers=/path/to/libsodium/include/ @@ -183,7 +205,7 @@ You should install: - [MinGW](http://sourceforge.net/projects/mingw/) When installing MinGW, make sure to select the MSYS option in the installer. -MinGW will install an "MinGW shell" (you should get a shortcut for it), make sure to perform all opeartions (i.e. generating/running configure script, compiling, etc.) from the MinGW shell. +MinGW 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. First download the source tarball from http://download.libsodium.org/libsodium/releases/ and build it. Assuming that you got the libsodium-0.4.2.tar.gz release: -- cgit v1.2.3 From b14fd4fe719f8ef0e2478f38fd45bd425b77edd0 Mon Sep 17 00:00:00 2001 From: Sean Date: Sat, 25 Jan 2014 19:22:30 -0800 Subject: FBSD 10+, SunOS support --- INSTALL.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/INSTALL.md b/INSTALL.md index 5d8cd2c2..858dff61 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -30,6 +30,17 @@ yum groupinstall "Development Tools" yum install libtool autoconf automake libconfig-devel ncurses-devel check check-devel ``` +On SunOS: + +```pfexcec +pkg install autoconf automake gcc-47 +``` +On FreeBSD 10+: + +```tcsh +pkg install automake autoconf +``` + Note that `libconfig-dev` should be >= 1.4. You should get and install [libsodium](https://github.com/jedisct1/libsodium): -- cgit v1.2.3 From 460e52c42696a0de8cbe5b86f67f7cab0d8cf95a Mon Sep 17 00:00:00 2001 From: Sean Date: Sat, 25 Jan 2014 19:49:37 -0800 Subject: missing #endif --- toxcore/network.h | 1 + 1 file changed, 1 insertion(+) diff --git a/toxcore/network.h b/toxcore/network.h index ae2cb081..2ba2b005 100644 --- a/toxcore/network.h +++ b/toxcore/network.h @@ -91,6 +91,7 @@ typedef int sock_t; #else #define __MAKECONTEXT_V2_SOURCE 1 #endif +#endif #ifndef VANILLA_NACL /* We use libsodium by default. */ -- cgit v1.2.3