mirror of
https://github.com/PurpleI2P/i2pd
synced 2024-11-13 01:20:22 +03:00
* build docs : markdown cleanup & reformatting
This commit is contained in:
parent
8e1687e7b3
commit
890807b8d7
@ -8,50 +8,58 @@ Pre-requesties
|
|||||||
|
|
||||||
You need to install Android SDK, NDK and QT with android support.
|
You need to install Android SDK, NDK and QT with android support.
|
||||||
|
|
||||||
- [SDK](https://developer.android.com/studio/index.html) (choose command line tools only)
|
- [SDK](https://developer.android.com/studio/index.html) (choose command line tools only)
|
||||||
- [NDK](https://developer.android.com/ndk/downloads/index.html)
|
- [NDK](https://developer.android.com/ndk/downloads/index.html)
|
||||||
- [QT](https://www.qt.io/download-open-source/)(for QT only). Choose one for your platform for android. For example QT 5.6 under Linux would be [this file](http://download.qt.io/official_releases/qt/5.6/5.6.1-1/qt-opensource-linux-x64-android-5.6.1-1.run )
|
- [QT](https://www.qt.io/download-open-source/)(for QT only).
|
||||||
|
Choose one for your platform for android. For example QT 5.6 under Linux would be [this file](http://download.qt.io/official_releases/qt/5.6/5.6.1-1/qt-opensource-linux-x64-android-5.6.1-1.run)
|
||||||
|
|
||||||
You also need Java JDK and Ant.
|
You also need Java JDK and Ant.
|
||||||
|
|
||||||
QT-Creator (for QT only)
|
QT-Creator (for QT only)
|
||||||
------------------------
|
------------------------
|
||||||
Open QT-creator that should be installed with QT.
|
|
||||||
|
Open QT-creator that should be installed with QT.
|
||||||
Go to Settings/Anndroid and specify correct paths to SDK and NDK.
|
Go to Settings/Anndroid and specify correct paths to SDK and NDK.
|
||||||
If everything is correct you will see two set avaiable:
|
If everything is correct you will see two set avaiable:
|
||||||
Android for armeabi-v7a (gcc, qt) and Android for x86 (gcc, qt).
|
Android for armeabi-v7a (gcc, qt) and Android for x86 (gcc, qt).
|
||||||
|
|
||||||
Dependencies
|
Dependencies
|
||||||
--------------
|
--------------
|
||||||
Take following pre-compiled binaries from PurpleI2P's repositories.
|
|
||||||
```bash
|
|
||||||
git clone https://github.com/PurpleI2P/Boost-for-Android-Prebuilt.git
|
|
||||||
git clone https://github.com/PurpleI2P/OpenSSL-for-Android-Prebuilt.git
|
|
||||||
git clone https://github.com/PurpleI2P/MiniUPnP-for-Android-Prebuilt.git
|
|
||||||
git clone https://github.com/PurpleI2P/android-ifaddrs.git
|
|
||||||
```
|
|
||||||
|
|
||||||
|
Take following pre-compiled binaries from PurpleI2P's repositories.
|
||||||
|
|
||||||
|
git clone https://github.com/PurpleI2P/Boost-for-Android-Prebuilt.git
|
||||||
|
git clone https://github.com/PurpleI2P/OpenSSL-for-Android-Prebuilt.git
|
||||||
|
git clone https://github.com/PurpleI2P/MiniUPnP-for-Android-Prebuilt.git
|
||||||
|
git clone https://github.com/PurpleI2P/android-ifaddrs.git
|
||||||
|
|
||||||
Building the app with QT
|
Building the app with QT
|
||||||
------------------------
|
------------------------
|
||||||
- Open qt/i2pd_qt/i2pd_qt.pro in the QT-creator
|
|
||||||
- Change line MAIN_PATH = /path/to/libraries to an actual path where you put the dependancies to
|
- Open `qt/i2pd_qt/i2pd_qt.pro` in the QT-creator
|
||||||
- Select appropriate project (usually armeabi-v7a) and build
|
- Change line `MAIN_PATH = /path/to/libraries` to an actual path where you put the dependancies to
|
||||||
- You will find an .apk file in android-build/bin folder
|
- Select appropriate project (usually armeabi-v7a) and build
|
||||||
|
- You will find an .apk file in `android-build/bin` folder
|
||||||
|
|
||||||
Building the app without QT
|
Building the app without QT
|
||||||
---------------------------
|
---------------------------
|
||||||
- Change line I2PD_LIBS_PATH in android/jni/Application.mk to an actual path where you put the dependancies to
|
|
||||||
- Run 'ndk-build -j4' from andorid folder
|
- Change line `I2PD_LIBS_PATH` in `android/jni/Application.mk` to an actual path where you put the dependancies to
|
||||||
- Create or edit file 'local.properties'. Place 'sdk.dir=<path to SDK>' and 'ndk.dir=<path to NDK>'
|
- Run `ndk-build -j4` from andorid folder
|
||||||
- Run 'ant clean debug'
|
- Create or edit file 'local.properties'. Place 'sdk.dir=<path to SDK>' and 'ndk.dir=<path to NDK>'
|
||||||
|
- Run `ant clean debug`
|
||||||
|
|
||||||
Creating release .apk
|
Creating release .apk
|
||||||
----------------------
|
----------------------
|
||||||
In order to create release .apk you must obtain a Java keystore file(.jks). Either you have in already, or you can generate it yourself using keytool, or from one of you existing well-know ceritificates. For example, i2pd release are signed with this [certificate](https://github.com/PurpleI2P/i2pd/blob/openssl/contrib/certificates/router/orignal_at_mail.i2p.crt).
|
|
||||||
Create file 'ant.propeties'
|
In order to create release .apk you must obtain a Java keystore file(.jks). Either you have in already, or you can generate it yourself using keytool, or from one of you existing well-know ceritificates.
|
||||||
key.store='path to keystore file'
|
For example, i2pd release are signed with this [certificate](https://github.com/PurpleI2P/i2pd/blob/openssl/contrib/certificates/router/orignal_at_mail.i2p.crt).
|
||||||
key.alias='alias name'
|
|
||||||
key.store.password='keystore password'
|
Create file 'ant.propeties':
|
||||||
key.alias.password='alias password'
|
|
||||||
Run 'ant clean release'
|
key.store='path to keystore file'
|
||||||
|
key.alias='alias name'
|
||||||
|
key.store.password='keystore password'
|
||||||
|
key.alias.password='alias password'
|
||||||
|
|
||||||
|
Run `ant clean release`
|
||||||
|
@ -2,74 +2,73 @@ Cross compilation notes
|
|||||||
=======================
|
=======================
|
||||||
|
|
||||||
Static 64 bit windows binary on Ubuntu 15.10 (Wily Werewolf)
|
Static 64 bit windows binary on Ubuntu 15.10 (Wily Werewolf)
|
||||||
---------------------------------------------------------------------
|
------------------------------------------------------------
|
||||||
|
|
||||||
Install cross compiler and friends
|
Install cross compiler and friends
|
||||||
```sh
|
|
||||||
sudo apt-get install g++-mingw-w64-x86-64
|
sudo apt-get install g++-mingw-w64-x86-64
|
||||||
```
|
|
||||||
Default is to use Win32 threading model which lacks std::mutex and such. So we change defaults
|
Default is to use Win32 threading model which lacks std::mutex and such. So we change defaults
|
||||||
```sh
|
|
||||||
sudo update-alternatives --set x86_64-w64-mingw32-g++ /usr/bin/x86_64-w64-mingw32-g++-posix
|
sudo update-alternatives --set x86_64-w64-mingw32-g++ /usr/bin/x86_64-w64-mingw32-g++-posix
|
||||||
```
|
|
||||||
From now on we assume we have everything in `~/dev/`. Get Boost sources unpacked into `~/dev/boost_1_60_0/`
|
From now on we assume we have everything in `~/dev/`. Get Boost sources unpacked into `~/dev/boost_1_60_0/` and change directory to it.
|
||||||
and change directory to it.
|
|
||||||
Now add out cross compiler configuration. Warning: the following will wipe out whatever you had in there.
|
Now add out cross compiler configuration. Warning: the following will wipe out whatever you had in there.
|
||||||
```sh
|
|
||||||
echo "using gcc : mingw : x86_64-w64-mingw32-g++ ;" > ~/user-config.jam
|
echo "using gcc : mingw : x86_64-w64-mingw32-g++ ;" > ~/user-config.jam
|
||||||
```
|
|
||||||
Proceed with building Boost normal way, but let's define dedicated staging directory
|
Proceed with building Boost normal way, but let's define dedicated staging directory
|
||||||
```sh
|
|
||||||
./bootstrap.sh
|
./bootstrap.sh
|
||||||
./b2 toolset=gcc-mingw target-os=windows variant=release link=static runtime-link=static address-model=64 \
|
./b2 toolset=gcc-mingw target-os=windows variant=release link=static runtime-link=static address-model=64 \
|
||||||
--build-type=minimal --with-filesystem --with-program_options --with-date_time \
|
--build-type=minimal --with-filesystem --with-program_options --with-date_time \
|
||||||
--stagedir=stage-mingw-64
|
--stagedir=stage-mingw-64
|
||||||
cd ..
|
cd ..
|
||||||
```
|
|
||||||
Now we get & build OpenSSL
|
Now we get & build OpenSSL
|
||||||
```sh
|
|
||||||
git clone https://github.com/openssl/openssl
|
git clone https://github.com/openssl/openssl
|
||||||
cd openssl
|
cd openssl
|
||||||
git checkout OpenSSL_1_0_2g
|
git checkout OpenSSL_1_0_2g
|
||||||
./Configure mingw64 no-rc2 no-rc4 no-rc5 no-idea no-bf no-cast no-whirlpool no-md2 no-md4 no-ripemd no-mdc2 \
|
./Configure mingw64 no-rc2 no-rc4 no-rc5 no-idea no-bf no-cast no-whirlpool no-md2 no-md4 no-ripemd no-mdc2 \
|
||||||
no-camellia no-seed no-comp no-krb5 no-gmp no-rfc3779 no-ec2m no-ssl2 no-jpake no-srp no-sctp no-srtp \
|
no-camellia no-seed no-comp no-krb5 no-gmp no-rfc3779 no-ec2m no-ssl2 no-jpake no-srp no-sctp no-srtp \
|
||||||
--prefix=~/dev/stage --cross-compile-prefix=x86_64-w64-mingw32-
|
--prefix=~/dev/stage --cross-compile-prefix=x86_64-w64-mingw32-
|
||||||
make depend
|
make depend
|
||||||
make
|
make
|
||||||
make install
|
make install
|
||||||
cd ..
|
cd ..
|
||||||
```
|
|
||||||
and Zlib
|
...and zlib
|
||||||
```sh
|
|
||||||
git clone https://github.com/madler/zlib
|
git clone https://github.com/madler/zlib
|
||||||
cd zlib
|
cd zlib
|
||||||
git checkout v1.2.8
|
git checkout v1.2.8
|
||||||
CC=x86_64-w64-mingw32-gcc CFLAGS=-O3 ./configure --static --64 --prefix=~/dev/stage
|
CC=x86_64-w64-mingw32-gcc CFLAGS=-O3 ./configure --static --64 --prefix=~/dev/stage
|
||||||
make
|
make
|
||||||
make install
|
make install
|
||||||
cd ..
|
cd ..
|
||||||
```
|
|
||||||
Now we prepare cross toolchain hint file for CMake, let's name it `~/dev/toolchain-mingw.cmake`
|
Now we prepare cross toolchain hint file for CMake, let's name it `~/dev/toolchain-mingw.cmake`
|
||||||
```cmake
|
|
||||||
SET(CMAKE_SYSTEM_NAME Windows)
|
set(CMAKE_SYSTEM_NAME Windows)
|
||||||
SET(CMAKE_C_COMPILER x86_64-w64-mingw32-gcc)
|
set(CMAKE_C_COMPILER x86_64-w64-mingw32-gcc)
|
||||||
SET(CMAKE_CXX_COMPILER x86_64-w64-mingw32-g++)
|
set(CMAKE_CXX_COMPILER x86_64-w64-mingw32-g++)
|
||||||
SET(CMAKE_RC_COMPILER x86_64-w64-mingw32-windres)
|
set(CMAKE_RC_COMPILER x86_64-w64-mingw32-windres)
|
||||||
SET(CMAKE_FIND_ROOT_PATH /usr/x86_64-w64-mingw32)
|
set(CMAKE_FIND_ROOT_PATH /usr/x86_64-w64-mingw32)
|
||||||
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
|
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
|
||||||
```
|
|
||||||
Download miniupnpc, unpack, and symlink it into `~/dev/miniupnpc/`.
|
Download miniupnpc, unpack and symlink it into `~/dev/miniupnpc/`.
|
||||||
Finally, we can build i2pd with all that goodness
|
Finally, we can build i2pd with all that goodness
|
||||||
```sh
|
|
||||||
git clone https://github.com/PurpleI2P/i2pd
|
git clone https://github.com/PurpleI2P/i2pd
|
||||||
mkdir i2pd-mingw-64-build
|
mkdir i2pd-mingw-64-build
|
||||||
cd i2pd-mingw-64-build
|
cd i2pd-mingw-64-build
|
||||||
BOOST_ROOT=~/dev/boost_1_60_0 cmake -G 'Unix Makefiles' ~/dev/i2pd/build -DBUILD_TYPE=Release \
|
BOOST_ROOT=~/dev/boost_1_60_0 cmake -G 'Unix Makefiles' ~/dev/i2pd/build -DBUILD_TYPE=Release \
|
||||||
-DCMAKE_TOOLCHAIN_FILE=~/dev/toolchain-mingw.cmake -DWITH_AESNI=ON -DWITH_UPNP=ON -DWITH_STATIC=ON \
|
-DCMAKE_TOOLCHAIN_FILE=~/dev/toolchain-mingw.cmake -DWITH_AESNI=ON -DWITH_UPNP=ON -DWITH_STATIC=ON \
|
||||||
-DWITH_HARDENING=ON -DCMAKE_INSTALL_PREFIX:PATH=~/dev/i2pd-mingw-64-static \
|
-DWITH_HARDENING=ON -DCMAKE_INSTALL_PREFIX:PATH=~/dev/i2pd-mingw-64-static \
|
||||||
-DZLIB_ROOT=~/dev/stage -DBOOST_LIBRARYDIR:PATH=~/dev/boost_1_60_0/stage-mingw-64/lib \
|
-DZLIB_ROOT=~/dev/stage -DBOOST_LIBRARYDIR:PATH=~/dev/boost_1_60_0/stage-mingw-64/lib \
|
||||||
-DOPENSSL_ROOT_DIR:PATH=~/dev/stage
|
-DOPENSSL_ROOT_DIR:PATH=~/dev/stage
|
||||||
make
|
make
|
||||||
x86_64-w64-mingw32-strip i2pd.exe
|
x86_64-w64-mingw32-strip i2pd.exe
|
||||||
```
|
|
||||||
By now, you should have a release build with stripped symbols.
|
By now, you should have a release build with stripped symbols.
|
||||||
|
@ -9,31 +9,30 @@ Prerequisites
|
|||||||
XCode7+, cmake 3.2+
|
XCode7+, cmake 3.2+
|
||||||
|
|
||||||
Dependencies
|
Dependencies
|
||||||
--------------
|
------------
|
||||||
|
|
||||||
- precompiled openssl
|
- precompiled openssl
|
||||||
- precompiled boost with modules `filesystem`, `program_options`, `date_time` and `system`
|
- precompiled boost with modules `filesystem`, `program_options`, `date_time` and `system`
|
||||||
- ios-cmake toolchain from https://github.com/vovasty/ios-cmake.git
|
- ios-cmake toolchain from `https://github.com/vovasty/ios-cmake.git`
|
||||||
|
|
||||||
Building
|
Building
|
||||||
------------------------
|
--------
|
||||||
|
|
||||||
Assume you have folder structure
|
Assume you have folder structure
|
||||||
|
|
||||||
```
|
lib/
|
||||||
lib
|
libboost_date_time.a
|
||||||
libboost_date_time.a
|
libboost_filesystem.a
|
||||||
libboost_filesystem.a
|
libboost_program_options.a
|
||||||
libboost_program_options.a
|
libboost_system.a
|
||||||
libboost_system.a
|
libboost.a
|
||||||
libboost.a
|
libcrypto.a
|
||||||
libcrypto.a
|
libssl.a
|
||||||
libssl.a
|
include/
|
||||||
include
|
boost/
|
||||||
boost
|
openssl/
|
||||||
openssl
|
ios-cmake/
|
||||||
ios-cmake
|
i2pd/
|
||||||
i2pd
|
|
||||||
```
|
|
||||||
|
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
mkdir -p build/simulator/lib build/ios/lib include/i2pd
|
mkdir -p build/simulator/lib build/ios/lib include/i2pd
|
||||||
@ -77,9 +76,10 @@ cp i2pd/*.h include/i2pd
|
|||||||
```
|
```
|
||||||
|
|
||||||
Include into project
|
Include into project
|
||||||
---------------------------
|
--------------------
|
||||||
1. add all libraries in `lib` folder to `Project linked frameworks`.
|
|
||||||
2. add `libc++` and `libz` libraries from system libraries to `Project linked frameworks`.
|
|
||||||
3. add path to i2p headers to your `Headers search paths`
|
|
||||||
|
|
||||||
Alternatively you may use swift wrapper https://github.com/vovasty/SwiftyI2P.git
|
- add all libraries in `lib` folder to `Project linked frameworks`.
|
||||||
|
- add `libc++` and `libz` libraries from system libraries to `Project linked frameworks`.
|
||||||
|
- add path to i2p headers to your `Headers search paths`
|
||||||
|
|
||||||
|
Alternatively you may use swift wrapper `https://github.com/vovasty/SwiftyI2P.git`
|
||||||
|
@ -4,129 +4,34 @@ Building on Unix systems
|
|||||||
First of all we need to make sure that all dependencies are satisfied.
|
First of all we need to make sure that all dependencies are satisfied.
|
||||||
|
|
||||||
This doc is trying to cover:
|
This doc is trying to cover:
|
||||||
|
|
||||||
* [Debian/Ubuntu](#debian-ubuntu) (contains packaging instructions)
|
* [Debian/Ubuntu](#debian-ubuntu) (contains packaging instructions)
|
||||||
* [Fedora/Centos](#fedora-centos)
|
* [Fedora/Centos](#fedora-centos)
|
||||||
* [Fedora/Centos](#mac-os-x)
|
* [Fedora/Centos](#mac-os-x)
|
||||||
* [FreeBSD](#freebsd)
|
* [FreeBSD](#freebsd)
|
||||||
|
|
||||||
Make sure you have all required dependencies for your system successfully installed.
|
Make sure you have all required dependencies for your system successfully installed.
|
||||||
|
See [this](requirements.md) page for common requirements.
|
||||||
|
|
||||||
If so then we are ready to go!
|
If so then we are ready to go!
|
||||||
Let's clone the repository and start building the i2pd:
|
Let's clone the repository and start building the i2pd:
|
||||||
```bash
|
|
||||||
git clone https://github.com/PurpleI2P/i2pd.git
|
git clone https://github.com/PurpleI2P/i2pd.git
|
||||||
cd i2pd/build
|
|
||||||
cmake -DCMAKE_BUILD_TYPE=Release # more options could be passed, see "CMake Options"
|
Generic build process looks like this (with cmake):
|
||||||
make # you may add VERBOSE=1 to cmdline for debugging
|
|
||||||
```
|
cd i2pd/build
|
||||||
|
cmake <cmake options> . # see "CMake Options" section below
|
||||||
|
make # you may add VERBOSE=1 to cmdline for debugging
|
||||||
|
|
||||||
|
..or with quick-and-dirty way with just make:
|
||||||
|
|
||||||
|
cd i2pd/
|
||||||
|
make
|
||||||
|
|
||||||
After successfull build i2pd could be installed with:
|
After successfull build i2pd could be installed with:
|
||||||
```bash
|
|
||||||
make install
|
|
||||||
```
|
|
||||||
or you can just use 'make' once you have all dependencies (boost and openssl) installed
|
|
||||||
|
|
||||||
```bash
|
make install
|
||||||
git clone https://github.com/PurpleI2P/i2pd.git
|
|
||||||
cd i2pd
|
|
||||||
make
|
|
||||||
```
|
|
||||||
|
|
||||||
Debian/Ubuntu
|
|
||||||
-------------
|
|
||||||
|
|
||||||
You will need a compiler and other tools that could be installed with `build-essential` package:
|
|
||||||
```bash
|
|
||||||
sudo apt-get install build-essential
|
|
||||||
```
|
|
||||||
|
|
||||||
Also you will need a bunch of development libraries:
|
|
||||||
```bash
|
|
||||||
sudo apt-get install \
|
|
||||||
libboost-chrono-dev \
|
|
||||||
libboost-date-time-dev \
|
|
||||||
libboost-filesystem-dev \
|
|
||||||
libboost-program-options-dev \
|
|
||||||
libboost-system-dev \
|
|
||||||
libboost-thread-dev \
|
|
||||||
libssl-dev
|
|
||||||
```
|
|
||||||
|
|
||||||
If you need UPnP support (don't forget to run CMake with `WITH_UPNP=ON`) miniupnpc development library should be installed:
|
|
||||||
```bash
|
|
||||||
sudo apt-get install libminiupnpc-dev
|
|
||||||
```
|
|
||||||
|
|
||||||
You may also build deb-package with the following:
|
|
||||||
```bash
|
|
||||||
sudo apt-get install fakeroot devscripts
|
|
||||||
cd i2pd
|
|
||||||
debuild --no-tgz-check
|
|
||||||
```
|
|
||||||
|
|
||||||
Fedora/Centos
|
|
||||||
-------------
|
|
||||||
|
|
||||||
You will need a compiler and other tools to perform a build:
|
|
||||||
```bash
|
|
||||||
sudo yum install make cmake gcc gcc-c++
|
|
||||||
```
|
|
||||||
|
|
||||||
*Latest Fedora system using [DNF](https://en.wikipedia.org/wiki/DNF_(software)) instead of YUM by default, you may prefer to use DNF, but YUM should be ok*
|
|
||||||
|
|
||||||
Also you will need a bunch of development libraries
|
|
||||||
```bash
|
|
||||||
sudo yum install boost-devel openssl-devel
|
|
||||||
```
|
|
||||||
|
|
||||||
If you need UPnP support (don't forget to run CMake with `WITH_UPNP=ON`) miniupnpc development library should be installed:
|
|
||||||
```bash
|
|
||||||
miniupnpc-devel
|
|
||||||
```
|
|
||||||
> *Centos 7 has CMake 2.8.11 in the official repositories that too old to build i2pd, CMake >=2.8.12 is required.*
|
|
||||||
>
|
|
||||||
> But you can use cmake3 from the epel repository:
|
|
||||||
> ```bash
|
|
||||||
> yum install epel-release -y
|
|
||||||
> yum install make cmake3 gcc gcc-c++ miniupnpc-devel boost-devel openssl-devel -y
|
|
||||||
> cmake3 -DWITH_LIBRARY=OFF -DWITH_UPNP=ON -DWITH_HARDENING=ON -DBUILD_SHARED_LIBS:BOOL=OFF
|
|
||||||
> make
|
|
||||||
> ```
|
|
||||||
|
|
||||||
MAC OS X
|
|
||||||
--------
|
|
||||||
|
|
||||||
Requires [homebrew](http://brew.sh/)
|
|
||||||
|
|
||||||
```bash
|
|
||||||
brew install libressl boost
|
|
||||||
```
|
|
||||||
|
|
||||||
Then build:
|
|
||||||
```bash
|
|
||||||
make HOMEBREW=1
|
|
||||||
```
|
|
||||||
|
|
||||||
|
|
||||||
FreeBSD
|
|
||||||
-------
|
|
||||||
|
|
||||||
For 10.X use clang. You would also need boost and openssl ports.
|
|
||||||
Type gmake, it invokes Makefile.bsd, make necessary changes there is required.
|
|
||||||
|
|
||||||
Branch 9.X has gcc v4.2, that knows nothing about required c++11 standart.
|
|
||||||
|
|
||||||
Required ports:
|
|
||||||
|
|
||||||
* `devel/cmake`
|
|
||||||
* `devel/boost-libs`
|
|
||||||
* `lang/gcc47`(or later version)
|
|
||||||
|
|
||||||
To use newer compiler you should set these variables(replace "47" with your actual gcc version):
|
|
||||||
```bash
|
|
||||||
export CC=/usr/local/bin/gcc47
|
|
||||||
export CXX=/usr/local/bin/g++47
|
|
||||||
```
|
|
||||||
|
|
||||||
CMake Options
|
CMake Options
|
||||||
-------------
|
-------------
|
||||||
@ -137,12 +42,94 @@ Available CMake options(each option has a form of `<key>=<value>`, for more info
|
|||||||
* `WITH_BINARY` build i2pd itself
|
* `WITH_BINARY` build i2pd itself
|
||||||
* `WITH_LIBRARY` build libi2pd
|
* `WITH_LIBRARY` build libi2pd
|
||||||
* `WITH_STATIC` build static versions of library and i2pd binary
|
* `WITH_STATIC` build static versions of library and i2pd binary
|
||||||
* `WITH_UPNP` build with UPnP support (requires libupnp)
|
* `WITH_UPNP` build with UPnP support (requires libminiupnp)
|
||||||
* `WITH_AESNI` build with AES-NI support (ON/OFF)
|
* `WITH_AESNI` build with AES-NI support (ON/OFF)
|
||||||
* `WITH_HARDENING` enable hardening features (ON/OFF) (gcc only)
|
* `WITH_HARDENING` enable hardening features (ON/OFF) (gcc only)
|
||||||
* `WITH_PCH` use pre-compiled header (experimental, speeds up build)
|
* `WITH_PCH` use pre-compiled header (experimental, speeds up build)
|
||||||
|
|
||||||
Also there is `-L` flag for CMake that could be used to list current cached options:
|
Also there is `-L` flag for CMake that could be used to list current cached options:
|
||||||
```bash
|
|
||||||
cmake -L
|
cmake -L
|
||||||
```
|
|
||||||
|
Debian/Ubuntu
|
||||||
|
-------------
|
||||||
|
|
||||||
|
You will need a compiler and other tools that could be installed with `build-essential` package:
|
||||||
|
|
||||||
|
sudo apt-get install build-essential
|
||||||
|
|
||||||
|
Also you will need a bunch of development libraries:
|
||||||
|
|
||||||
|
sudo apt-get install \
|
||||||
|
libboost-chrono-dev \
|
||||||
|
libboost-date-time-dev \
|
||||||
|
libboost-filesystem-dev \
|
||||||
|
libboost-program-options-dev \
|
||||||
|
libboost-system-dev \
|
||||||
|
libboost-thread-dev \
|
||||||
|
libssl-dev
|
||||||
|
|
||||||
|
If you need UPnP support miniupnpc development library should be installed (don't forget to rerun CMake with needed option):
|
||||||
|
|
||||||
|
sudo apt-get install libminiupnpc-dev
|
||||||
|
|
||||||
|
You may also build deb-package with the following:
|
||||||
|
|
||||||
|
sudo apt-get install fakeroot devscripts
|
||||||
|
cd i2pd
|
||||||
|
debuild --no-tgz-check
|
||||||
|
|
||||||
|
Fedora/Centos
|
||||||
|
-------------
|
||||||
|
|
||||||
|
You will need a compiler and other tools to perform a build:
|
||||||
|
|
||||||
|
sudo yum install make cmake gcc gcc-c++
|
||||||
|
|
||||||
|
Also you will need a bunch of development libraries
|
||||||
|
|
||||||
|
sudo yum install boost-devel openssl-devel
|
||||||
|
|
||||||
|
If you need UPnP support miniupnpc development library should be installed (don't forget to rerun CMake with needed option):
|
||||||
|
|
||||||
|
sudo yum install miniupnpc-devel
|
||||||
|
|
||||||
|
Latest Fedora systems using [DNF](https://en.wikipedia.org/wiki/DNF_(software)) instead of YUM by default, you may prefer to use DNF, but YUM should be ok
|
||||||
|
|
||||||
|
Centos 7 has CMake 2.8.11 in the official repositories that too old to build i2pd, CMake >=2.8.12 is required.
|
||||||
|
But you can use cmake3 from the epel repository:
|
||||||
|
|
||||||
|
yum install epel-release -y
|
||||||
|
yum install make cmake3 gcc gcc-c++ miniupnpc-devel boost-devel openssl-devel -y
|
||||||
|
|
||||||
|
...and then use 'cmake3' instead 'cmake'.
|
||||||
|
|
||||||
|
MAC OS X
|
||||||
|
--------
|
||||||
|
|
||||||
|
Requires [homebrew](http://brew.sh)
|
||||||
|
|
||||||
|
brew install boost libressl
|
||||||
|
|
||||||
|
Then build:
|
||||||
|
|
||||||
|
make HOMEBREW=1
|
||||||
|
|
||||||
|
FreeBSD
|
||||||
|
-------
|
||||||
|
|
||||||
|
For 10.X use clang. You would also need devel/boost-libs, security/openssl and devel/gmake ports.
|
||||||
|
Type gmake, it invokes Makefile.bsd, make necessary changes there is required.
|
||||||
|
|
||||||
|
Branch 9.X has gcc v4.2, that is too old (not supports -std=c++11)
|
||||||
|
|
||||||
|
Required ports:
|
||||||
|
|
||||||
|
* `devel/cmake`
|
||||||
|
* `devel/boost-libs`
|
||||||
|
* `lang/gcc47`(or later version)
|
||||||
|
|
||||||
|
To use newer compiler you should set these variables(replace "47" with your actual gcc version):
|
||||||
|
|
||||||
|
export CC=/usr/local/bin/gcc47
|
||||||
|
export CXX=/usr/local/bin/g++47
|
||||||
|
@ -23,81 +23,55 @@ paths like /c/dev/ for C:\dev\.
|
|||||||
msys2
|
msys2
|
||||||
-----
|
-----
|
||||||
|
|
||||||
### x86 (32-bit architecture)
|
Get install file `msys2-$ARCH-*.exe` from `https://msys2.github.io`
|
||||||
|
|
||||||
Get install file msys2-i686-*.exe from https://msys2.github.io.
|
Where $ARCH is `i686` or `x86_64` (matching your system).
|
||||||
open MSYS2 Shell (from Start menu).
|
|
||||||
Install all prerequisites and download i2pd source:
|
|
||||||
|
|
||||||
```bash
|
- Open MSYS2 Shell (from Start menu).
|
||||||
pacman -S mingw-w64-i686-boost mingw-w64-i686-openssl mingw-w64-i686-gcc git make
|
- Install all prerequisites and download i2pd source:
|
||||||
mkdir -p /c/dev/i2pd
|
|
||||||
cd /c/dev/i2pd
|
|
||||||
git clone https://github.com/PurpleI2P/i2pd.git
|
|
||||||
cd i2pd
|
|
||||||
export PATH=/mingw32/bin:/usr/bin # we need compiler on PATH which is usually heavily cluttered on Windows
|
|
||||||
make
|
|
||||||
```
|
|
||||||
|
|
||||||
|
|
||||||
### x64 (64-bit architecture)
|
|
||||||
|
|
||||||
Get install file msys2-x86_64-*.exe from https://msys2.github.io.
|
|
||||||
open MSYS2 Shell (from Start menu).
|
|
||||||
Install all prerequisites and download i2pd source:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
pacman -S mingw-w64-x86_64-boost mingw-w64-x86_64-openssl mingw-w64-x86_64-gcc git make
|
|
||||||
mkdir -p /c/dev/i2pd
|
|
||||||
cd /c/dev/i2pd
|
|
||||||
git clone https://github.com/PurpleI2P/i2pd.git
|
|
||||||
cd i2pd
|
|
||||||
export PATH=/mingw64/bin:/usr/bin # we need compiler on PATH which is usually heavily cluttered on Windows
|
|
||||||
make
|
|
||||||
```
|
|
||||||
|
|
||||||
|
export ARCH='i686' # or 'x86_64'
|
||||||
|
export MINGW='mingw32' # or 'mingw64'
|
||||||
|
pacman -S mingw-w64-$ARCH-boost mingw-w64-$ARCH-openssl mingw-w64-$ARCH-gcc git make
|
||||||
|
mkdir -p /c/dev/i2pd
|
||||||
|
cd /c/dev/i2pd
|
||||||
|
git clone https://github.com/PurpleI2P/i2pd.git
|
||||||
|
cd i2pd
|
||||||
|
# we need compiler on PATH which is usually heavily cluttered on Windows
|
||||||
|
export PATH=/$MINGW/bin:/usr/bin
|
||||||
|
make
|
||||||
|
|
||||||
### Caveats
|
### Caveats
|
||||||
|
|
||||||
It is important to restrict PATH as described above. If you have
|
It is important to restrict PATH as described above.
|
||||||
Strawberry Perl and/or Mercurial installed, it will pick up gcc &
|
If you have Strawberry Perl and/or Mercurial installed,
|
||||||
openssl from the wrong places.
|
it will pick up gcc & openssl from the wrong places.
|
||||||
|
|
||||||
If you do use precompiled headers to speed up compilation
|
If you do use precompiled headers to speed up compilation (recommended),
|
||||||
(recommended), things can go wrong if compiler options have changed
|
things can go wrong if compiler options have changed for whatever reason.
|
||||||
for whatever reason. Just delete `stdafx.h.gch` found in your build
|
Just delete `stdafx.h.gch` found in your build folder, note the file extension.
|
||||||
folder, note the file extension.
|
|
||||||
|
|
||||||
If you are an Arch Linux user, refrain from updating system with
|
|
||||||
`pacman -Syu`. Always update runtime separately as described on the
|
|
||||||
home page, otherwise you might end up with DLLs incompatibility
|
|
||||||
problems.
|
|
||||||
|
|
||||||
|
If you are an Arch Linux user, refrain from updating system with `pacman -Syu`.
|
||||||
|
Always update runtime separately as described on the home page,
|
||||||
|
otherwise you might end up with DLLs incompatibility problems.
|
||||||
|
|
||||||
### AES-NI
|
### AES-NI
|
||||||
|
|
||||||
If your processor has
|
If your processor has [AES instruction set](https://en.wikipedia.org/wiki/AES_instruction_set),
|
||||||
[AES instruction set](https://en.wikipedia.org/wiki/AES_instruction_set),
|
use `make USE_AESNI=1` instead just `make`. No check is done however, it will compile,
|
||||||
you use `make USE_AESNI=1`. No check is done however, it
|
but it might crash with `Illegal instruction` if this feature is not supported by your processor.
|
||||||
will compile, but it might crash with `Illegal instruction` if not supported.
|
|
||||||
|
|
||||||
You should be able to run ./i2pd . If you need to start from the new
|
You should be able to run ./i2pd . If you need to start from the new shell,
|
||||||
shell, consider starting *MinGW-w64 Win32 Shell* instead of *MSYS2 Shell* as
|
consider starting *MinGW-w64 Win32 Shell* instead of *MSYS2 Shell*
|
||||||
it adds`/minw32/bin` to the PATH.
|
as it adds `/minw32/bin` to the PATH.
|
||||||
|
|
||||||
### UPnP
|
### UPnP
|
||||||
You can install it through the MSYS2
|
|
||||||
and build with USE_UPNP key.
|
|
||||||
|
|
||||||
```bash
|
You can install it through the MSYS2 and build with `USE_UPNP` key.
|
||||||
pacman -S mingw-w64-i686-miniupnpc
|
|
||||||
make USE_UPNP=yes
|
export ARCH='i686' # or 'x86_64'
|
||||||
```
|
pacman -S mingw-w64-$ARCH-miniupnpc
|
||||||
or
|
make USE_UPNP=yes
|
||||||
```bash
|
|
||||||
pacman -S mingw-w64-x86_64-miniupnpc
|
|
||||||
make USE_UPNP=yes
|
|
||||||
```
|
|
||||||
|
|
||||||
Using Visual Studio
|
Using Visual Studio
|
||||||
-------------------
|
-------------------
|
||||||
@ -112,7 +86,6 @@ Requirements for building:
|
|||||||
* [Netwide assembler](http://www.nasm.us/)
|
* [Netwide assembler](http://www.nasm.us/)
|
||||||
* Strawberry Perl or ActiveState Perl, do NOT try msys2 perl, it won't work
|
* Strawberry Perl or ActiveState Perl, do NOT try msys2 perl, it won't work
|
||||||
|
|
||||||
|
|
||||||
### Building Boost
|
### Building Boost
|
||||||
|
|
||||||
Open a Command Prompt (there is no need to start Visual Studio command
|
Open a Command Prompt (there is no need to start Visual Studio command
|
||||||
@ -129,11 +102,9 @@ If you are on 64-bit Windows and you want to build 64-bit version as well
|
|||||||
After Boost is compiled, set the environment variable `BOOST_ROOT` to
|
After Boost is compiled, set the environment variable `BOOST_ROOT` to
|
||||||
the directory Boost was unpacked to, e.g., C:\dev\boost.
|
the directory Boost was unpacked to, e.g., C:\dev\boost.
|
||||||
|
|
||||||
If you are planning on building only particular variant, e.g. Debug
|
If you are planning on building only particular variant, e.g. Debug only and static linking,
|
||||||
only and static linking, and/or you are out of space/time, you might
|
and/or you are out of space/time, you might consider `--build-type=minimal`.
|
||||||
consider `--build-type=minimal`. Take a look at
|
Take a look at [appveyor.yml](../appveyor.yml) for details on how test builds are done.
|
||||||
[appveyor.yml](../appveyor.yml) for details on how test builds are done.
|
|
||||||
|
|
||||||
|
|
||||||
### Building OpenSSL
|
### Building OpenSSL
|
||||||
|
|
||||||
@ -153,23 +124,19 @@ Now open Visual Studio command prompt and change directory to that with OpenSSL
|
|||||||
|
|
||||||
You should have it installed into C:\OpenSSL-Win32 by now.
|
You should have it installed into C:\OpenSSL-Win32 by now.
|
||||||
|
|
||||||
Note that you might consider providing `-DOPENSSL_ROOT_DIR` to CMake
|
Note that you might consider providing `-DOPENSSL_ROOT_DIR` to CMake and/or
|
||||||
and/or create a symlink (with mklink /J) to C:\OpenSSL if you plan on
|
create a symlink (with mklink /J) to C:\OpenSSL if you plan on maintain
|
||||||
maintaining multiple versions, e.g. 64 bit and/or
|
multiple versions, e.g. 64 bit and/or static/shared.
|
||||||
static/shared. Consult `C:\Program Files
|
See `C:\Program Files (x86)\CMake\share\cmake-3.3\Modules\FindOpenSSL.cmake` for details.
|
||||||
(x86)\CMake\share\cmake-3.3\Modules\FindOpenSSL.cmake` for details.
|
|
||||||
|
|
||||||
|
|
||||||
### Get miniupnpc
|
### Get miniupnpc
|
||||||
|
|
||||||
If you are behind a UPnP enabled router and don't feel like manually
|
If you are behind a UPnP enabled router and don't feel like manually configuring port forwarding,
|
||||||
configuring port forwarding, you should consider using
|
you should consider using [MiniUPnP](http://miniupnp.free.fr) client.
|
||||||
[MiniUPnP](http://miniupnp.free.fr) client. I2pd can be built capable
|
I2pd can be built capable of using miniupnpc shared library (DLL) to open up necessary port.
|
||||||
of using miniupnpc shared library (DLL) to open up necessary
|
You'd want to have include headers around to build i2pd with support for this.
|
||||||
port. You'd want to have include headers around to build i2pd with
|
Unpack client source code to subdir, e.g. `C:\dev\miniupnpc`.
|
||||||
support for this. Unpack client source code in a sibling folder,
|
You may want to remove version number from folder name included in downloaded archive.
|
||||||
e.g. C:\dev\miniupnpc . You may want to remove version number from
|
|
||||||
folder name included in downloaded archive.
|
|
||||||
|
|
||||||
### Creating Visual Studio project
|
### Creating Visual Studio project
|
||||||
|
|
||||||
@ -177,19 +144,16 @@ Start CMake GUI, navigate to i2pd directory, choose building directory, e.g. ./
|
|||||||
|
|
||||||
Alternatively, if you feel adventurous, try that from the command line
|
Alternatively, if you feel adventurous, try that from the command line
|
||||||
|
|
||||||
```
|
mkdir i2pd\out
|
||||||
cd <i2pd_dir>
|
cd i2pd\out
|
||||||
mkdir out
|
cmake ..\build -G "Visual Studio 12 2013" -DWITH_UPNP=ON -DWITH_PCH=ON -DCMAKE_INSTALL_PREFIX:PATH=C:\dev\Debug_Win32_stage
|
||||||
cd out
|
|
||||||
cmake ..\build -G "Visual Studio 12 2013" -DWITH_UPNP=ON -DWITH_PCH=ON -DCMAKE_INSTALL_PREFIX:PATH=C:\dev\Debug_Win32_stage
|
|
||||||
```
|
|
||||||
|
|
||||||
WITH_UPNP will stay off, if necessary files are not found.
|
|
||||||
|
|
||||||
|
If necessary files are not found `WITH_UPNP` will stay off.
|
||||||
|
|
||||||
### Building i2pd
|
### Building i2pd
|
||||||
|
|
||||||
You can open generated solution/project with Visual Studio and build
|
You can open generated solution/project with Visual Studio and build from there,
|
||||||
from there, alternatively you can use `cmake --build . --config Release --target install` or
|
alternatively you can use `cmake --build . --config Release --target install` or
|
||||||
[MSBuild tool](https://msdn.microsoft.com/en-us/library/dd293626.aspx)
|
[MSBuild tool](https://msdn.microsoft.com/en-us/library/dd293626.aspx)
|
||||||
`msbuild i2pd.sln /p:Configuration=Release`.
|
|
||||||
|
msbuild i2pd.sln /p:Configuration=Release
|
||||||
|
Loading…
Reference in New Issue
Block a user