Difference between revisions of "BuildingWindows"

From Mumble Wiki
Jump to: navigation, search
m
(Change mirror.mxe.cc to pkg.mxe.cc (now online again))
 
(327 intermediate revisions by 18 users not shown)
Line 1: Line 1:
= Introduction =
+
{{Building}}
 
 
Mumble has quite a few dependencies for building on Windows, and as the feature set grows, so does the list of dependencies. This page will try to detail the steps required to set up a Win32 build environment suitable for compiling the current code found in our repository. Be aware that this steps might not work for older revisions of Mumble as dependencies might have been removed or updated to an incompatible version in the meantime.
 
 
 
The paths used here equal the defaults assumed in the Mumble build files. You are free to change them, but you might need to adjust the build files themselves. If you find any problems or incorrect steps in this article please either correct them or contact us and we will try our best to resolve the issue.
 
 
 
Also note, that if you are submitting a bug report for a self-built executable, we expect you to either
 
* Follow these instructions to the letter
 
or
 
* Report any deviations from these instructions
 
 
 
Deviations means anything, from "I installed to the D: drive" to "I changed the gcc build options for Qt" or "I used another version of Speex".
 
 
 
= Preparations =
 
 
 
== Visual Studio ==
 
 
 
You'll need Visual Studio 2008 (or Visual C++ Express Edition) with SP1.
 
 
 
Visual Studio 2008 Professional 90 day trial: http://msdn2.microsoft.com/en-us/vs2008/products/cc268305.aspx
 
 
 
Visual C++ Express Edition: http://www.microsoft.com/express/vc/ (Look at the bottom right corner for "Visual C++ 2008.")
 
 
 
 
 
==Intel C++ Compiler==
 
 
 
You can also use the Intel C++ Compiler in conjuction with VS2008. You can find it here: http://www.intel.com/cd/software/products/asmo-na/eng/368972.htm
 
 
 
'''This is strictly optional and you can compile a perfectly working version of Mumble without this compiler''' following this guide. This guide does not give information on how to use the Intel compiler with VS2008 to compile Mumble, so you will need to either have the programming experience necessary to know how to do this or find the procedures to do so elsewhere.
 
 
 
 
 
== Git ==
 
 
 
Download the most recent Git from http://code.google.com/p/msysgit/downloads/list and install it. Make sure you select "Run Git from the Windows Command Prompt."
 
 
 
 
 
== TortoiseSVN ==
 
 
 
Download the most recent version of TortoiseSVN at http://tortoisesvn.net/downloads and install it. The defaults are fine.
 
 
 
Note:
 
TortoiseSVN is only need to checkout the SVN of WinDBus. You can skip this step.
 
 
 
 
 
==Create the bat file==
 
 
 
Create ''C:\dev'', and inside that directory create a file ''prep.bat'' containing:
 
@echo off
 
SET QTDIR=C:\dev\Qt4.5.2
 
SET DBUSDIR=C:\dev\dbus
 
SET LIB=
 
SET VLD_DIR=C:\dev\vld
 
SET MYSQL=c:\dev\mysql
 
SET ICE=c:\dev\Ice
 
CALL "%DXSDK_DIR%\Utilities\bin\dx_setenv.cmd"
 
IF DEFINED "%PROGRAMFILES(X86)%" (
 
CALL "%PROGRAMFILES(X86)%\Microsoft Visual Studio 9.0\VC\vcvarsall.bat" x86
 
) ELSE (
 
CALL "%PROGRAMFILES%\Microsoft Visual Studio 9.0\VC\vcvarsall.bat" x86
 
)
 
SET PATH=%QTDIR%\bin;%DBUSDIR%\bin;c:\dev\OpenSSL\bin;c:\dev\libsndfile;c:\dev\cmake\bin;%MYSQL%\lib\opt;%ICE%\bin;c:\dev\protobuf-2.2.0\vsprojects\Release;%PATH%
 
change the last line to
 
SET PATH=%QTDIR%\bin;%DBUSDIR%\bin;c:\dev\OpenSSL\bin;c:\dev\libsndfile;c:\dev\cmake\bin;%MYSQL%\lib\opt;%ICE%\bin;c:\dev\protobuf-2.2.0\vsprojects\Release;C:\dev\libogg\win32\VS2008\Win32\Release;%PATH%
 
if you're compiling Mumble 1.1.x.
 
 
 
Start a new command shell (run ''cmd.exe'') (Make sure you have Microsoft Visual C++ and Git installed before you run prep!)
 
cd \dev
 
prep
 
 
 
After you run prep make sure a message similar to "Setting environment for using Microsoft Visual Studio 2008 x86 tools" appears.
 
  
 +
= Commandline instructions =
 
Whenever something appears
 
Whenever something appears
 
  like this
 
  like this
you're supposed to enter it in that command shell (or copy it from this webpage and right click in the command window and select ''Paste''). When you later want to compile things, remember to call prep.bat first to set paths correctly.
+
you're supposed to enter it in that command shell (or copy it from this webpage and right click in the command window and select ''Paste'').  
  
Note to those following this guide: When you extract compressed files, sometimes they will have container folders and sometimes they will not. Please ensure (for example) that when you extract a compressed file like QT4.5.1, that you see "bin" "include" and such folders as that directly inside of the folder named "Qt4.5.1". If you just see one folder and no other files, you have done it wrong.
+
Note that ''each line'' is a separate command. So, if you wanted to do the following,
 +
cd mumble
 +
nmake
 +
you would type "cd mumble" in your command prompt, and press enter, and then you would type "nmake", and press enter.
  
 +
Ok. So you're ready to start working.
  
== Boost ==
+
= Build using MSVC on Windows =
  
Download http://prdownloads.sf.net/boost/boost_1_40_0.7z?download and http://prdownloads.sf.net/boost/boost-jam-3.1.17-1-ntx86.zip?download and unzip both to ''c:\dev''
+
== Introduction ==
  
cd \dev
+
Mumble has quite a few dependencies for building on Windows, and as the feature set grows, so does the list of dependencies. Therefore we have built some automated scripts to create a sane build environment for Mumble. To make this build environment as similar as possible across all of Mumble's supported Platforms, the Windows build is strongly dependent on [https://www.cygwin.com/ Cygwin].
prep
 
cd boost_1_40_0
 
copy ..\boost-jam-3.1.17-1-ntx86\bjam.exe
 
bjam --toolset=msvc --prefix=C:\dev\Boost install
 
  
This might take a while, but when done you'll have Boost installed.
+
The [https://github.com/mumble-voip/mumble-releng mumble-releng] Github repository has an [https://github.com/mumble-voip/mumble-releng/blob/master/buildenv/1.3.x/win32-static/README up-to-date README] on how to create the build environment!
Note that none of the other build dependencies do themselves depend on boost, so if you want you can just continue in a new command shell (but remember to call ''prep.bat''). Once all is done, you can safely delete the boost_1_40_0 and boost-jam directories. If you get the warning, that some targets were skipped or failed, it can be ignored for our purposes.
+
{{Notice|message=
 +
The most up-to-date information on how to create a Mumble build environment are always to be found in this README file!
 +
}}
 +
{{Elaboration|message=
 +
There is an older deprecated version of this article at [[BuildingWindows (deprecated)]] showing how to build Mumble manually with QT4 which is far more complex.
 +
}}
  
 +
== Software you will need ==
 +
{{Notice|message=
 +
We currently depend on Visual Studio to be in their default locations, and the Windows 7 SDK to be in ''C:\Program Files (x86)\Microsoft SDKs\Windows\v7.1A'' (rather than the default ''C:\Program Files\…'').
 +
}}
  
== Microsoft Windows SDK ==
+
* ''Visual Studio Community 2015 Update 3'': You need MSVC 2015. During installation you can deselect the Windows SDKs, because we are going to install the up-to-date one, listed below.
 +
* [https://www.microsoft.com/en-us/download/details.aspx?id=8279 Windows SDK 7] for XP/x86 Overlay (You may have to [http://stackoverflow.com/questions/19366006/error-when-installing-windows-sdk-7-1#23032807 temporarily remove ''Microsoft Visual C++ 2010 * Redistributable'' for the installer to work].)
 +
* [https://developer.microsoft.com/en-us/windows/downloads/windows-10-sdk Windows SDK] (If you are on Windows 7, don't select "Windows Performance Toolkit", because it isn't compatible)
 +
* [https://msysgit.github.io/ Git]: You can use any version of Git, it only has to be in your PATH variable.
  
Go here to download: http://www.microsoft.com/downloads/details.aspx?FamilyID=c17ba869-9671-4330-a63e-1fd44e0e2505&displaylang=en . At the time of this writing, the latest version is the "Microsoft Windows SDK for Windows 7 and .NET Framework 3.5 SP1". Install it to ''C:\dev\WinSDK''
+
== Creating the build environment ==
 +
First you need to clone the mumble-releng repository into a directory in which your Windows user has write access. ''cd'' into that directory, then
 +
git clone https://github.com/mumble-voip/mumble-releng.git mumble-releng
  
As you are going through the installer you will come to a window where you will see two main categories and then subcategories below them. Uncheck the green check boxes next to “Documentation” and “Samples”. Continue with the installation. These take a long time to download and are not really needed for Mumble.
+
In the terminal window, change to the directory the scripts for Windows (32-bit) and static build reside in.
 +
cd mumble-releng/buildenv/1.3.x/win32-static
 +
and execute
 +
setup.cmd
 +
This should install a Mumble build environment in your ''C:\MumbleBuild'' directory named with a date and shortened commit hash like ''win32-static-1.3.x-2015-05-25-1234ab7''.
  
 +
If everything went right Windows Explorer should open up the new build environment directory as named above.
  
== Microsoft DirectX SDK ==
+
== Build Mumble's dependencies ==
 +
To start building Mumble's dependencies, double-click the "MumbleBuild - cygwin" shortcut. This will open a cygwin terminal. To change the current directory to the ''build environment's local clone'' of the mumble-releng repository type:
 +
cd mumble-releng/buildenv/1.3.x/win32-static
  
Go to http://msdn.microsoft.com/directx/sdk/ and download the latest SDK. Install it to ''c:\dev\DXSDK''
+
{{Notice|message=
 +
This mumble-releng directory is a copy. Should you want to update your build environment in the future, proceed from the original.
 +
}}
  
 +
To download and build all dependencies (this will take a long time!), execute
 +
./build-all.bash
  
== Visual Leak Detector ==
+
Once all dependencies are built, you will be returned to your Cygwin shell. Make sure it did not stop because of an error.
  
[http://dmoulding.googlepages.com/vld Download] VLD and install it to ''C:\dev\vld\''.
+
The built dependencies are located in the corresponding ''.build'' folder.
  
If you're using Visual C++ Express Edition, you will need to manually extract the files using a tool like [http://7-zip.org/ 7-zip ]. Extract it to ''C:\dev\'' and rename it to ''vld''.
+
== Building Mumble ==
 +
To build Mumble itself using your newly-built build environment, you should use the "MumbleBuild - cmd" shortcut to launch a Windows command prompt.
  
'''Note:''' VLD is only enabled for debug builds.
+
Next, make a checkout of the Mumble source tree and enter the root of the source tree with
 
+
git clone --recursive https://github.com/mumble-voip/mumble.git mumble
 
+
cd mumble
== WinDBUS ==
+
to generate Makefiles for use with the build environment, run
 
+
qmake -recursive main.pro CONFIG+="release static no-elevation no-g15 no-asio" CONFIG-=sse2
From http://www.winkde.org/pub/kde/ports/win32/repository/win32libs/ download the following archives:
+
{{Notice|message=
 
+
This build environment does not install the libraries and headers needed to build Mumble with G15 LCD or ASIO audio support. If you want to build Mumble with one of them you need to install them to the build environment on your own. In this case remove ''no-g15'' or rather ''no-asio'' accordingly.
* zlib*lib.zip
+
}}
* zlib*bin.zip
 
* iconv*lib.zip
 
* iconv*bin.zip
 
* libxml2*bin.tar.bz2
 
* libxml2*lib.tar.bz2
 
 
 
Whereas * represents the newest version on the server. Unpack all of them to 'c:\Program Files\win32libs'. If you have extracted them all correctly you should see inside of 'c:\Program Files\win32libs' "include," bin," lib," and "manifest" folders. Note that you may also download the dbus library from there, but if you do it will not automatically spawn dbus-daemon as that needs patching.
 
  
Download [http://www.cmake.org/files/v2.6/cmake-2.6.3-win32-x86.zip CMake] and unpack it to c:\dev. Rename the top directory to just 'cmake'.
+
After all this preparation start the actual Mumble compilation with
 
 
Checkout the SVN of WinDBus from https://windbus.svn.sourceforge.net/svnroot/windbus/trunk to c:\dev\windbus
 
 
 
If you skipped installing TortoiseSVN, download http://windbus.svn.sourceforge.net/viewvc/windbus/trunk.tar.gz?view=tar and extract the archive to ''c:\dev\''. Rename the extracted ''trunk'' folder to ''windbus''.
 
 
 
cd \dev
 
prep
 
mkdir windbus-build
 
cd windbus-build
 
cmake -DCMAKE_BUILD_TYPE=Release -DDBUS_INSTALL_SYSTEM_LIBS=ON -G "NMake Makefiles" c:\dev\windbus\cmake
 
 
  nmake
 
  nmake
nmake install
+
You should end up with a mumble.exe and a murmur.exe binary (and a whole collection of .DLL files to go along with the two) in the "release" directory in the root of the Mumble source tree.
  
Regardless of what you say, Windbus is installed to ''c:\<Program Files>\dbus''. Move that entire directory into ''c:\dev'' (so it ends up as ''c:\dev\dbus'')
+
If you want to distribute your own mumble.exe you can either create an installer (see below) or collect mumble.exe and the needed .DLL files yourself.
  
Copy all .dll files from ''c:\Program Files\win32libs\bin'' to ''c:\dev\dbus\bin''
+
== (Optional) Visual Leak Detector ==
  
You can remove the ''c:\dev\windbus'' and ''c:\dev\windbus-build'' directories at this point.
+
{{Notice|message=
 +
VLD is no longer a default requirement for a Mumble build environment. You only have to install it if you want to use it in which case you have to manually enable it with ''CONFIG+=vld''.
 +
}}
  
 +
[http://dmoulding.googlepages.com/vld Download] VLD and install it to its default install location.
  
== OpenSSL ==
+
If you're using Visual C++ Express Edition, you will need to manually extract the files using a tool like [http://7-zip.org/ 7-zip ]. Extract it to ''C:\dev\'' and adjust [[BuildingWindows#Custom_Dependency_Paths|the VLD_PATH]] to point to it.
  
Download the OpenSSL source named "openssl-0.9.8g.tar.gz" from here http://www.openssl.org/source/. Unpack it to ''c:\dev'' (it will create a directory called openssl-x.y.z)
+
{{Notice|message=
 +
VLD is only enabled for debug builds. If you only compile Release builds you do not need it.
 +
}}
  
Download and install ActivePerl from here: http://www.activestate.com/activeperl/
+
== (Optional) Custom Dependency Paths ==
  
Open a new shell (so that %PATH% includes ActivePerl).
+
The build files were modified to support custom dependency paths a while ago. This is for the people who have '''the dependencies installed in some other place than the autogenerated directory structure'''. To specify the custom paths you need to '''create a ''winpaths_custom.pri'' file''' to the root of your Mumble project. In this file you can override all paths found in ''winpaths_default.pri''. For example:
  
cd \dev
+
  OPENSSL_PATH = C:\\dev\MyOpenSSLIsSomewhereElse
prep
+
  ICE_PATH = C:\\Program Files (x86)\\ZeroC\\Ice-3.4.1
cd openssl<press tab>
 
perl Configure VC-WIN32 --prefix=c:\\dev\\OpenSSL
 
ms\do_masm
 
nmake -f ms\ntdll.mak
 
nmake -f ms\ntdll.mak install
 
  
You can remove ''c:\dev\openssl-x.y.z'' after this.
+
Would make the build process search its OpenSSL and Ice dependencies in the specified folders and use defaults for everything else. Note that you should only override the variables for dependencies you actually installed in non-default locations to prevent clashes with possible future updates.
  
  
== MySQL ==
+
'''Note:''' If you copied ''winpaths_default.pri'' to create your ''winpaths_custom.pri'' make sure to delete the following lines from your ''winpaths_custom.pri'' file:
  
Download the latest release of MySQL Server. It can be found here: http://dev.mysql.com/downloads/mysql/5.1.html#win32 (select "Without installer (unzip in C:\)"). Unzip it to ''c:\dev\MySQL''.
+
# Include custom file if it exists
 +
exists(winpaths_custom.pri) {
 +
include(winpaths_custom.pri)
 +
}
  
 +
== (Optional) Build a Mumble installer package ==
 +
If you want to create an installable .msi package from your self-compiled Mumble some additional steps are needed.
  
== Qt ==
+
Download and install the latest WIX stable Version (currently 3.8) from [http://wixtoolset.org/releases/ here].
  
Download ftp://ftp.trolltech.com/qt/source/qt-win-opensource-src-4.5.2.zip and unzip to ''c:\dev''. Rename the directory
+
Set the following environment variables as needed (see defaults in installer/Settings.wxi):
from ''qt-win-opensource-src-4.5.2'' to ''Qt4.5.2''
+
  MumbleSourceDir  default: \dev\mumble
 +
  MumbleQtDir  default: \dev\QtMumble
 +
  MumbleDebugToolsDir  default: C:\Program Files (x86)\Debugging Tools for Windows (x86)
 +
  MumbleSndFileDir  default: \Program Files (x86)\Mega-Nerd\libsndfile\bin
 +
    Define MumbleNoSndFile to exclude  libsndfile
 +
  MumbleMySQLDir  default: \dev\MySQL
 +
    Define MumbleNoMySQL to exclude  MySQL
 +
  MumbleIceDir  default: \Program Files (x86)\ZeroC\Ice-3.4.2\bin\vc100
 +
    Define MumbleNoIce to exclude Ice
 +
  MumbleOpenSslDir  default: \dev\openssl
 +
  MumbleZlibDir  default: \dev\zlib
 +
  MumbleMergeModuleDir  default: C:\Program Files (x86)\Common Files\Merge Modules
 +
  Define MumbleSSE to include SSE
 +
  Define MumbleNoSSE2 to exclude SSE2
 +
  Define MumbleNoG15 to exclude G15
  
Download http://mumble.sourceforge.net/qt450msvc.patch and put it in ''c:\dev\Qt4.5.2''. Then, start Git Bash, which came with git.
+
Open installer/MumbleInstall.sln, switch to release and build the installer.
  
cd /c/dev/Qt4.5.2
+
Once this completed successfully run the ''build_installer.pl'' script to include all translations into your installer.
patch -lp0 < qt450msvc.patch
 
exit
 
  
Start a regular command shell:
+
You should now have a working .msi installer.
  
cd \dev
+
= Build using MXE on Debian and derivates =
prep
 
cd Qt4.5.2
 
configure -debug-and-release -qt-sql-sqlite -qt-sql-mysql -no-qt3support -no-exceptions -qt-zlib -qt-libpng  -qt-libjpeg  -openssl-linked -dbus-linked -I c:\dev\OpenSSL\include -L c:\dev\OpenSSL\lib -I c:\dev\dbus\include -L c:\dev\dbus\lib -I c:\dev\mysql\include -L c:\dev\mysql\lib\opt -platform win32-msvc2008
 
nmake
 
  
This will also take quite a while.
+
{{Notice|message=
 +
Mumble supports MinGW since [https://github.com/mumble-voip/mumble/commit/10079ed9867308aad098231f86e260bd831b0ac6 commit 10079ed9867308aad098231f86e260bd831b0ac6].
 +
}}
  
The demos and examples need a lot of time and disk space. You can skip them.
+
== Introduction ==
Add the following parameter to the configure line:
 
-nomake demos -nomake examples
 
This saves time, disk space, and nerves.
 
  
 +
It is possible to cross-compile Mumble using a MinGW toolchain. If you're more comfortable with a Unix-like system, you will probably prefer this method. The easiest way to cross-compile Mumble is by using MXE, which provides all the required dependencies.
  
== Protocol Buffers ==
+
Features currently not available with MinGW:
 +
* Overlay
 +
* Logitech G15 LCD
 +
* ZeroC Ice
 +
* Bonjour
  
Download Protocol Buffers from [http://code.google.com/p/protobuf/ Google] (''protobuf-x.y.z.zip'')  and unpack it to ''c:\dev\protobuf-z.y.z''. Follow the documentation in ''c:\dev\protobuf-x.y.z\vsprojects\readme.txt''. Note that if the release number changes you will need to change prep.bat to whatever ''z.y.z'' changed to or you won't be able to call ''protoc.exe''.
+
{{Notice|message=
 +
In the guide there are some commands with ''${ARCH}'' in them.
 +
You need to replace it with the desired architecture, which can be ''x86-64'' (64 bit) or ''i686'' (32 bit).
 +
}}
  
 +
== Installing the required MXE packages ==
  
== libsndfile ==
+
Add MXE's repository to your system's sources:
Download the binary release from http://www.mega-nerd.com/libsndfile/#Download and install it to ''c:\dev\libsndfile\'' . Make sure the libsndfile-1.dll is visible to the executables.
 
  
'''Note''': This dependency is not needed for the server.
+
'''Debian'''
 +
echo "deb https://dl.mumble.info/mirror/pkg.mxe.cc/repos/apt stretch main" | sudo tee /etc/apt/sources.list.d/mxe.list
 +
'''Ubuntu'''
 +
echo "deb https://dl.mumble.info/mirror/pkg.mxe.cc/repos/apt xenial main" | sudo tee /etc/apt/sources.list.d/mxe.list
  
 +
Add the repository's key:
 +
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 86B72ED9
  
== libogg ==
+
Update packages index:
Download the latest libogg-1.x.x.zip from http://downloads.xiph.org/releases/ogg/ and unpack it to ''c:\dev\libogg''.
+
sudo apt update
  
If you want to compile Mumble 1.1.x, you need to go to ''C:\dev\libogg\win32\VS2008'', build the release builds of libogg, and copy ''C:\dev\libogg\win32\VS2008\Win32\Release_SSE2\libogg.lib'' to the new Folder ''C:\dev\libogg\lib\''.
+
Install the required packages
 +
sudo apt install \
 +
mxe-${ARCH}-w64-mingw32.static-qtbase \
 +
mxe-${ARCH}-w64-mingw32.static-qtsvg \
 +
mxe-${ARCH}-w64-mingw32.static-qttools \
 +
mxe-${ARCH}-w64-mingw32.static-qttranslations \
 +
mxe-${ARCH}-w64-mingw32.static-boost \
 +
mxe-${ARCH}-w64-mingw32.static-protobuf \
 +
mxe-${ARCH}-w64-mingw32.static-sqlite \
 +
mxe-${ARCH}-w64-mingw32.static-flac \
 +
  mxe-${ARCH}-w64-mingw32.static-ogg \
 +
mxe-${ARCH}-w64-mingw32.static-vorbis \
 +
mxe-${ARCH}-w64-mingw32.static-libsndfile
  
'''Note:''' This dependency is not needed if you do not want to compile the Mumble compatibility client (Mumble 1.1.x). The Mumble compatibility client can be disabled by passing ''CONFIG+=no-11x'' to qmake. This dependency is not needed for building the server.
+
== Preparing the environment ==
  
 
+
Clone Mumble's Git repository
== ZeroC Ice ==
+
git clone https://github.com/mumble-voip/mumble.git
 
 
Download the latest version of ZeroC Ice from http://www.zeroc.com/download.html and make sure you select the VS2008 version. Install to ''c:\dev\Ice''
 
 
 
'''Note:''' Ice can be disabled by passing ''CONFIG+=no-ice'' to qmake. Bear in mind that the [[Ice]] RPC Interface is the recommended way to control the server. This dependency is not needed for building the client.
 
 
 
 
 
== Bonjour ==
 
Download the bonjour sdk from http://developer.apple.com/networking/bonjour/download/ and install it to ''c:\dev\Bonjour\'' .
 
 
 
'''Note:''' Bonjour can be disabled by passing ''CONFIG+=no-bonjour'' to qmake.
 
 
 
 
 
== G15SDK ==
 
Download the G15 software from here: http://www.logitech.com/index.cfm/434/180&cl=us,en?WT.ac=sc|downloads||dd and install it.
 
 
 
Now go to ''C:\Program Files\Logitech\GamePanel Software\LCD Manager\SDK'' and extract "LCDSDK_3.02.173.zip". Take the folder that has been extracted and rename it to ''G15SDK''. Put this folder into ''c:\dev''.
 
 
 
'''Note:''' Support for G15 Displays can be disabled by passing ''CONFIG+=no-g15'' to qmake.
 
 
 
 
 
== Download Mumble and Submodules ==
 
 
 
To clone the repositories :
 
 
 
cd \dev
 
prep
 
git clone git://mumble.git.sourceforge.net/gitroot/mumble/mumble mumble
 
 
  cd mumble
 
  cd mumble
git submodule init
 
git submodule update
 
  
To use the v1.1.x branch (which you most likely do) run this command after running the commands above:
+
Get the ASIO SDK
  git checkout --track -b v1.1.x origin/v1.1.x
+
wget https://www.steinberg.net/sdk_downloads/asiosdk2.3.zip -P /tmp/
 +
  unzip /tmp/asiosdk2.3.zip -d /tmp/
 +
mv /tmp/ASIOSDK2.3 3rdparty/asio
  
If you are using the current branch, you will need to open git bash and cd to the mumble folder that was created. Now cd to
+
Export environment variable to tell QMake where MXE's protobuf compiler is
src/mumble11x
+
  export MUMBLE_PROTOC=/usr/lib/mxe/usr/x86_64-pc-linux-gnu/bin/protoc
and then do
 
sh mklinks.sh
 
 
 
 
 
= Building Mumble and Murmur =
 
 
 
Once all of the above is done we can get to compiling Mumble itself.
 
 
 
If you want to have ASIO support you have to install an additional, proprietary, ASIO SDK.
 
 
 
There are four dependencies that most people who make their own compiles will not need: g15, asio, bonjour, and 11x. The bonjour dependency is useful if you want to browse servers across a local network, but you can disable it if this feature is not needed.
 
 
 
To compile Mumble without Mumble 1.1.x, replace the qmake command below with this one:
 
 
 
  qmake CONFIG+=no-11x CONFIG+=no-asio CONFIG+=no-g15 CONFIG+=no-bonjour -recursive
 
 
 
To compile Mumble with Mumble 1.1.x, replace the qmake command below with this one:
 
 
 
qmake CONFIG+=no-asio CONFIG+=no-bonjour CONFIG+=no-g15 -recursive
 
 
 
Note that the compile ''will fail'' if you leave out these build flags and do not have the SDK required.
 
 
 
To compile Mumble:
 
 
 
cd \dev
 
prep
 
cd mumble
 
qmake
 
nmake clean
 
nmake
 
 
 
Note that this builds the debug versions, which is what we strongly recommend to use while developing. If you want to send the binary to someone else, use
 
nmake release
 
instead of the  last
 
nmake
 
command listed above. This will result in a much smaller binary with fewer dependencies.
 
  
 +
Add MXE's directory to PATH
 +
PATH=$PATH:/usr/lib/mxe/usr/bin
  
= Running Mumble and Murmur =
+
== Build ==
  
Once compiled, you can go into ''c:\dev\mumble\release'' or (''\debug'' if you compiled the debug version) and can execute mumble.exe or murmur.exe. Before executing Mumble or Murmur you need to open a command prompt and do
+
Run QMake to process the project(s) files
cd \dev
+
  ${ARCH}-w64-mingw32.static-qmake-qt5 -recursive CONFIG+="release g15-emulator no-overlay no-bonjour no-elevation no-ice"
prep
 
cd mumble\debug (or release)
 
Then execute either Mumble or Murmur ''from the command prompt'' with
 
  mumble.exe
 
or
 
murmur.exe
 
  
If you want to run the release build directly from Windows Explorer, you will need to collect all the library files into one folder, along with the executables you built when you compiled Mumble. Have a look at the files the official Mumble installer creates in ''Program Files\Mumble'' to find out which files you will need.
+
Start the build
 +
make
  
 
[[Category:Development]]
 
[[Category:Development]]

Latest revision as of 07:13, 29 July 2019

Building Guides

This page is one of a set of Building pages/guides for the different OSes with information on building Mumble/Murmur.

BuildingLinux BuildingFreeBSD BuildingOpenBSD BuildingMacOSX BuildingWindows


Commandline instructions

Whenever something appears

like this

you're supposed to enter it in that command shell (or copy it from this webpage and right click in the command window and select Paste).

Note that each line is a separate command. So, if you wanted to do the following,

cd mumble
nmake

you would type "cd mumble" in your command prompt, and press enter, and then you would type "nmake", and press enter.

Ok. So you're ready to start working.

Build using MSVC on Windows

Introduction

Mumble has quite a few dependencies for building on Windows, and as the feature set grows, so does the list of dependencies. Therefore we have built some automated scripts to create a sane build environment for Mumble. To make this build environment as similar as possible across all of Mumble's supported Platforms, the Windows build is strongly dependent on Cygwin.

The mumble-releng Github repository has an up-to-date README on how to create the build environment!

Icons oxygen 48x48 actions view-pim-notes.png
Note:
The most up-to-date information on how to create a Mumble build environment are always to be found in this README file!
Elaboration: There is an older deprecated version of this article at BuildingWindows (deprecated) showing how to build Mumble manually with QT4 which is far more complex.


Software you will need

Icons oxygen 48x48 actions view-pim-notes.png
Note:
We currently depend on Visual Studio to be in their default locations, and the Windows 7 SDK to be in C:\Program Files (x86)\Microsoft SDKs\Windows\v7.1A (rather than the default C:\Program Files\…).

Creating the build environment

First you need to clone the mumble-releng repository into a directory in which your Windows user has write access. cd into that directory, then

git clone https://github.com/mumble-voip/mumble-releng.git mumble-releng

In the terminal window, change to the directory the scripts for Windows (32-bit) and static build reside in.

cd mumble-releng/buildenv/1.3.x/win32-static

and execute

setup.cmd

This should install a Mumble build environment in your C:\MumbleBuild directory named with a date and shortened commit hash like win32-static-1.3.x-2015-05-25-1234ab7.

If everything went right Windows Explorer should open up the new build environment directory as named above.

Build Mumble's dependencies

To start building Mumble's dependencies, double-click the "MumbleBuild - cygwin" shortcut. This will open a cygwin terminal. To change the current directory to the build environment's local clone of the mumble-releng repository type:

cd mumble-releng/buildenv/1.3.x/win32-static
Icons oxygen 48x48 actions view-pim-notes.png
Note:
This mumble-releng directory is a copy. Should you want to update your build environment in the future, proceed from the original.

To download and build all dependencies (this will take a long time!), execute

./build-all.bash

Once all dependencies are built, you will be returned to your Cygwin shell. Make sure it did not stop because of an error.

The built dependencies are located in the corresponding .build folder.

Building Mumble

To build Mumble itself using your newly-built build environment, you should use the "MumbleBuild - cmd" shortcut to launch a Windows command prompt.

Next, make a checkout of the Mumble source tree and enter the root of the source tree with

git clone --recursive https://github.com/mumble-voip/mumble.git mumble
cd mumble

to generate Makefiles for use with the build environment, run

qmake -recursive main.pro CONFIG+="release static no-elevation no-g15 no-asio" CONFIG-=sse2
Icons oxygen 48x48 actions view-pim-notes.png
Note:
This build environment does not install the libraries and headers needed to build Mumble with G15 LCD or ASIO audio support. If you want to build Mumble with one of them you need to install them to the build environment on your own. In this case remove no-g15 or rather no-asio accordingly.

After all this preparation start the actual Mumble compilation with

nmake

You should end up with a mumble.exe and a murmur.exe binary (and a whole collection of .DLL files to go along with the two) in the "release" directory in the root of the Mumble source tree.

If you want to distribute your own mumble.exe you can either create an installer (see below) or collect mumble.exe and the needed .DLL files yourself.

(Optional) Visual Leak Detector

Icons oxygen 48x48 actions view-pim-notes.png
Note:
VLD is no longer a default requirement for a Mumble build environment. You only have to install it if you want to use it in which case you have to manually enable it with CONFIG+=vld.

Download VLD and install it to its default install location.

If you're using Visual C++ Express Edition, you will need to manually extract the files using a tool like 7-zip . Extract it to C:\dev\ and adjust the VLD_PATH to point to it.

Icons oxygen 48x48 actions view-pim-notes.png
Note:
VLD is only enabled for debug builds. If you only compile Release builds you do not need it.

(Optional) Custom Dependency Paths

The build files were modified to support custom dependency paths a while ago. This is for the people who have the dependencies installed in some other place than the autogenerated directory structure. To specify the custom paths you need to create a winpaths_custom.pri file to the root of your Mumble project. In this file you can override all paths found in winpaths_default.pri. For example:

 OPENSSL_PATH = C:\\dev\MyOpenSSLIsSomewhereElse
 ICE_PATH = C:\\Program Files (x86)\\ZeroC\\Ice-3.4.1

Would make the build process search its OpenSSL and Ice dependencies in the specified folders and use defaults for everything else. Note that you should only override the variables for dependencies you actually installed in non-default locations to prevent clashes with possible future updates.


Note: If you copied winpaths_default.pri to create your winpaths_custom.pri make sure to delete the following lines from your winpaths_custom.pri file:

# Include custom file if it exists
exists(winpaths_custom.pri) {
	include(winpaths_custom.pri)
}

(Optional) Build a Mumble installer package

If you want to create an installable .msi package from your self-compiled Mumble some additional steps are needed.

Download and install the latest WIX stable Version (currently 3.8) from here.

Set the following environment variables as needed (see defaults in installer/Settings.wxi):

 MumbleSourceDir  default: \dev\mumble
 MumbleQtDir  default: \dev\QtMumble
 MumbleDebugToolsDir  default: C:\Program Files (x86)\Debugging Tools for Windows (x86)
 MumbleSndFileDir  default: \Program Files (x86)\Mega-Nerd\libsndfile\bin
   Define MumbleNoSndFile to exclude  libsndfile
 MumbleMySQLDir  default: \dev\MySQL
   Define MumbleNoMySQL to exclude  MySQL
 MumbleIceDir  default: \Program Files (x86)\ZeroC\Ice-3.4.2\bin\vc100
   Define MumbleNoIce to exclude Ice
 MumbleOpenSslDir  default: \dev\openssl
 MumbleZlibDir  default: \dev\zlib
 MumbleMergeModuleDir  default: C:\Program Files (x86)\Common Files\Merge Modules
 Define MumbleSSE to include SSE
 Define MumbleNoSSE2 to exclude SSE2
 Define MumbleNoG15 to exclude G15

Open installer/MumbleInstall.sln, switch to release and build the installer.

Once this completed successfully run the build_installer.pl script to include all translations into your installer.

You should now have a working .msi installer.

Build using MXE on Debian and derivates

Icons oxygen 48x48 actions view-pim-notes.png
Note:
Mumble supports MinGW since commit 10079ed9867308aad098231f86e260bd831b0ac6.

Introduction

It is possible to cross-compile Mumble using a MinGW toolchain. If you're more comfortable with a Unix-like system, you will probably prefer this method. The easiest way to cross-compile Mumble is by using MXE, which provides all the required dependencies.

Features currently not available with MinGW:

  • Overlay
  • Logitech G15 LCD
  • ZeroC Ice
  • Bonjour
Icons oxygen 48x48 actions view-pim-notes.png
Note:
In the guide there are some commands with ${ARCH} in them. You need to replace it with the desired architecture, which can be x86-64 (64 bit) or i686 (32 bit).

Installing the required MXE packages

Add MXE's repository to your system's sources:

Debian

echo "deb https://dl.mumble.info/mirror/pkg.mxe.cc/repos/apt stretch main" | sudo tee /etc/apt/sources.list.d/mxe.list

Ubuntu

echo "deb https://dl.mumble.info/mirror/pkg.mxe.cc/repos/apt xenial main" | sudo tee /etc/apt/sources.list.d/mxe.list

Add the repository's key:

sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 86B72ED9

Update packages index:

sudo apt update

Install the required packages

sudo apt install \
	mxe-${ARCH}-w64-mingw32.static-qtbase \
	mxe-${ARCH}-w64-mingw32.static-qtsvg \
	mxe-${ARCH}-w64-mingw32.static-qttools \
	mxe-${ARCH}-w64-mingw32.static-qttranslations \
	mxe-${ARCH}-w64-mingw32.static-boost \
	mxe-${ARCH}-w64-mingw32.static-protobuf \
	mxe-${ARCH}-w64-mingw32.static-sqlite \
	mxe-${ARCH}-w64-mingw32.static-flac \
 	mxe-${ARCH}-w64-mingw32.static-ogg \
	mxe-${ARCH}-w64-mingw32.static-vorbis \
	mxe-${ARCH}-w64-mingw32.static-libsndfile

Preparing the environment

Clone Mumble's Git repository

git clone https://github.com/mumble-voip/mumble.git
cd mumble

Get the ASIO SDK

wget https://www.steinberg.net/sdk_downloads/asiosdk2.3.zip -P /tmp/
unzip /tmp/asiosdk2.3.zip -d /tmp/
mv /tmp/ASIOSDK2.3 3rdparty/asio

Export environment variable to tell QMake where MXE's protobuf compiler is

export MUMBLE_PROTOC=/usr/lib/mxe/usr/x86_64-pc-linux-gnu/bin/protoc

Add MXE's directory to PATH

PATH=$PATH:/usr/lib/mxe/usr/bin

Build

Run QMake to process the project(s) files

${ARCH}-w64-mingw32.static-qmake-qt5 -recursive CONFIG+="release g15-emulator no-overlay no-bonjour no-elevation no-ice"

Start the build

make