This is an old revision of the document!
Table of Contents
Compiling VMime
Introduction
VMime is the library we intend to use in Mail2Voice Next. It supports emails protocols such as IMAP and SMTP. Visit http://vmime.org for more informations.
Compiling
GNU/Linux (Ubuntu)
Prerequisites
Packages needed:
- git
- cmake
- build-essential
- pkg-config
- libgsasl7
- libgsasl7-dev
- libgnutls-dev
- libssl-dev
- sendmail
- doxygen
One can install all the stuff needed with the following command:
sudo apt-get install -y git cmake build-essential pkg-config libgsasl7 libgsasl7-dev libgnutls-dev libssl-dev sendmail doxygen
Building
git clone https://github.com/kisli/vmime.git mkdir vmime/build cd vmime/build cmake -DVMIME_BUILD_SAMPLES=OFF -DVMIME_SHARED_PTR_USE_BOOST=OFF -DVMIME_SHARED_PTR_USE_CXX=ON -DVMIME_SENDMAIL_PATH=/run/sendmail -DCMAKE_BUILD_TYPE=RELEASE .. make sudo make install
Windows (MSYS + MinGW64)
Prerequisites
- Download and install MinGW64 from sourceforge (https://sourceforge.net/projects/mingw-w64/).
- Use the following settings:
- Version: latest (6.2.0 on 2016-09-21)
- Architecture: x86_64
- Threads: win32
- Exception: seh
- Build revision: 1
- And install it on “C:\” (it will create a mingw64 directory)
- Download MSYS (https://sourceforge.net/projects/mingw-w64/files/External%20binary%20packages%20%28Win64%20hosted%29/MSYS%20%2832-bit%29/ ). On 2016-09-21, the latest version is MSYS-20111123.zip.
- Extract the msys folder to “C:\”
- Run C:\msys\msys.bat, it will open a unix-like terminal
- From this terminal, run: sh /postinstall/pi.sh
- Answer “y” for the two first questions.
- Enter the path to your mingw64 installation (C:/mingw64) in our case. Make sure to use “/” instead of “\”.
- It should “Normalizing your MSYS environment”.
- Download and install CMake (https://cmake.org/download/)
- When installing, choose to add CMake to the “path” environment variable.
Preparing dependencies
Compiling GSASL
- Download GSASL from ftp://ftp.gnu.org/gnu/gsasl/ (latest version is 1.8.0 on 2016-09-21) and extract files.
- Open C:\msys\msys.bat
- Then type the following commands :
cd /path/to/your/libgsasl_src_dir/ (i.e. /c/Users/MrNobody/dev/libgsasl-1.8.0/) mkdir build cd build ../configure --prefix=/path/to/your/libgsasl_src_dir/dist make make install
Get other dependencies
Fortunately, the Winbuilds project offers some precompiled dependencies we need. You can then download the following packages from http://win-builds.org/doku.php/1.5.0_packages:
- gnutls
- pkg-config
- win-iconv
Compiling VMime
git clone https://github.com/kisli/vmime.git mkdir vmime/build cd vmime/build export DEPS=/path/to/dependencies/parent/dir
cmake .. -G “MinGW Makefiles” -DCMAKE_CXX_COMPILER=/C/mingw64/bin/g++.exe -DCMAKE_C_COMPILER=/C/mingw64/bin/gcc.exe -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/C/Users/Matthieu/dev/vmime-master/install -DCMAKE_MAKE_PROGRAM=/C/mingw64/bin/mingw32-make.exe -DGNUTLS_INCLUDE_DIR=$DEPS/gnutls-3.2.21/include -DGNUTLS_LIBRARY=$DEPS/gnutls-3.2.21/lib64/libgnutls.dll.a -DGSASL_INCLUDE_DIR=$DEPS/libgsasl-1.8.0/include -DGSASL_LIBRARIES=$DEPS/libgsasl-1.8.0/lib/libgsasl.dll.a -DICONV_INCLUDE_DIR=$DEPS/win-iconv-0.0.6/include -DICONV_LIBRARIES=$DEPS/win-iconv-0.0.6/lib64/libiconv.dll.a -DPKG_CONFIG_EXECUTABLE=$DEPS/pkg-config/bin/pkg-config.exe -DVMIME_BUILD_DOCUMENTATION=OFF -DVMIME_BUILD_SAMPLES=OFF -DVMIME_BUILD_TESTS=OFF -DVMIME_CHARSETCONV_LIB=iconv -DVMIME_HAVE_MLANG_H=OFF -DVMIME_HAVE_MLANG_LIB=OFF -DVMIME_HAVE_MESSAGING_PROTO_SENDMAIL=OFF -DVMIME_SHARED_PTR_USE_BOOST=OFF -DVMIME_SHARED_PTR_USE_CXX=ON