Skip to content
Permalink
Browse files

Merge PR #2907: Implement support for building Mumble and Murmur usin…

…g the MinGW toolchain.

This pull request implements support for building Mumble and Murmur with the MinGW toolchain.

Both x86 and x86_64 targets are supported, and most features work.

For now, we use, and test against MXE (http://www.mxe.cc).

The PR also implements a Linux-based cross-build of Mumble and Murmur on Travis CI. This environment uses Wine as a test runner.
  • Loading branch information...
mkrautz committed Mar 17, 2017
2 parents 8758cf5 + cb1c1b4 commit 10079ed9867308aad098231f86e260bd831b0ac6
@@ -5,8 +5,13 @@ compiler: gcc


env: env:
matrix: matrix:
- MUMBLE_QT=qt4 - MUMBLE_QT=qt4 MUMBLE_HOST=x86_64-linux-gnu
- MUMBLE_QT=qt5 - MUMBLE_QT=qt5 MUMBLE_HOST=x86_64-linux-gnu
- MUMBLE_QT=qt5 MUMBLE_HOST=i686-w64-mingw32
- MUMBLE_QT=qt5 MUMBLE_HOST=x86_64-w64-mingw32
allow_failures:
- env: MUMBLE_QT=qt5 MUMBLE_HOST=i686-w64-mingw32
- env: MUMBLE_QT=qt5 MUMBLE_HOST=x86_64-w64-mingw32


before_install: before_install:
- ./scripts/travis-ci/before_install.bash - ./scripts/travis-ci/before_install.bash
@@ -36,13 +36,21 @@ QMAKE_CFLAGS -= -fPIE -pie


win32 { win32 {
DEFINES += WIN32 _WIN32 DEFINES += WIN32 _WIN32
INCLUDEPATH += ../$$BUILDDIR/win32


CONFIG(sse2) { win32-g++ {
TARGET_VERSION_EXT = .$${VERSION}.sse2 # MinGW uses the config.h for Unix-like systems.
} else { INCLUDEPATH += ../$$BUILDDIR
QMAKE_CFLAGS_RELEASE -= -arch:SSE }
QMAKE_CFLAGS_DEBUG -= -arch:SSE
win32-msvc* {
INCLUDEPATH += ../$$BUILDDIR/win32

CONFIG(sse2) {
TARGET_VERSION_EXT = .$${VERSION}.sse2
} else {
QMAKE_CFLAGS_RELEASE -= -arch:SSE
QMAKE_CFLAGS_DEBUG -= -arch:SSE
}
} }
} }


@@ -43,13 +43,21 @@ QMAKE_CFLAGS -= -fPIE -pie


win32 { win32 {
DEFINES += WIN32 _WIN32 DEFINES += WIN32 _WIN32
INCLUDEPATH += ../$$BUILDDIR/win32


CONFIG(sse2) { win32-g++ {
TARGET_VERSION_EXT = .$${VERSION}.sse2 # MinGW uses the config.h for Unix-like systems.
} else { INCLUDEPATH += ../$$BUILDDIR
QMAKE_CFLAGS_RELEASE -= -arch:SSE }
QMAKE_CFLAGS_DEBUG -= -arch:SSE
win32-msvc* {
INCLUDEPATH += ../$$BUILDDIR/win32

CONFIG(sse2) {
TARGET_VERSION_EXT = .$${VERSION}.sse2
} else {
QMAKE_CFLAGS_RELEASE -= -arch:SSE
QMAKE_CFLAGS_DEBUG -= -arch:SSE
}
} }
} }


@@ -34,11 +34,13 @@ DEFINES += WIN32 _WINDOWS _USRDLL MINHOOK_EXPORTS
CONFIG += warn_off CONFIG += warn_off
} }


QMAKE_CFLAGS_RELEASE -= -MD win32-msvc* {
QMAKE_CFLAGS_DEBUG -= -MDd QMAKE_CFLAGS_RELEASE -= -MD
QMAKE_CFLAGS_DEBUG -= -MDd


QMAKE_CXXFLAGS_RELEASE *= -MT QMAKE_CXXFLAGS_RELEASE *= -MT
QMAKE_CXXFLAGS_DEBUG *= -MTd QMAKE_CXXFLAGS_DEBUG *= -MTd
}


SOURCES *= \ SOURCES *= \
src/hde/hde64.c \ src/hde/hde64.c \
@@ -76,7 +76,7 @@ INCLUDEPATH *= \
../$$SOURCEDIR/silk/x86 \ ../$$SOURCEDIR/silk/x86 \
../$$SOURCEDIR/silk/float ../$$SOURCEDIR/silk/float


win32 { win32-msvc* {
CONFIG *= opus-sse-sources CONFIG *= opus-sse-sources
CONFIG *= opus-sse2-sources CONFIG *= opus-sse2-sources
CONFIG *= opus-sse41-sources CONFIG *= opus-sse41-sources
File renamed without changes.
File renamed without changes.
@@ -43,19 +43,29 @@ INCLUDEPATH = ../speex-src/include ../speex-src/libspeex ../speexdsp-src/include
win32 { win32 {
INCLUDEPATH += ../speex-build/win32 INCLUDEPATH += ../speex-build/win32
DEFINES+=WIN32 _WINDOWS _USE_SSE _USE_MATH_DEFINES DEFINES+=WIN32 _WINDOWS _USE_SSE _USE_MATH_DEFINES

win32-g++ {
# MinGW uses the config.h for Unix-like systems.
INCLUDEPATH += ../speex-build
}

win32-msvc* {
INCLUDEPATH += ../speex-build/win32

CONFIG(sse2) {
TARGET = speex.sse2
DEFINES += _USE_SSE2
} else {
QMAKE_CFLAGS_RELEASE -= -arch:SSE
QMAKE_CFLAGS_DEBUG -= -arch:SSE
}
}

SOURCES *= mumble_speex_init.c SOURCES *= mumble_speex_init.c


CONFIG -= static CONFIG -= static
CONFIG += shared CONFIG += shared


CONFIG(sse2) {
TARGET = speex.sse2
DEFINES += _USE_SSE2
} else {
QMAKE_CFLAGS_RELEASE -= -arch:SSE
QMAKE_CFLAGS_DEBUG -= -arch:SSE
}

DEFINES+=USE_SMALLFT DEFINES+=USE_SMALLFT


} else { } else {
@@ -40,7 +40,10 @@ CONFIG(g15-emulator) {


win32 { win32 {
RC_FILE = g15helper.rc RC_FILE = g15helper.rc
QMAKE_POST_LINK = $$QMAKE_POST_LINK$$escape_expand(\\n\\t)$$quote(mt.exe -nologo -updateresource:$(DESTDIR_TARGET);1 -manifest ../src/mumble/mumble.appcompat.manifest)
win32-msvc* {
QMAKE_POST_LINK = $$QMAKE_POST_LINK$$escape_expand(\\n\\t)$$quote(mt.exe -nologo -updateresource:$(DESTDIR_TARGET);1 -manifest ../src/mumble/mumble.appcompat.manifest)
}
} }
} else { } else {
CONFIG -= qt CONFIG -= qt
@@ -52,7 +55,10 @@ CONFIG(g15-emulator) {
QMAKE_LIBDIR *= "$$G15SDK_PATH/Lib/x86" QMAKE_LIBDIR *= "$$G15SDK_PATH/Lib/x86"
INCLUDEPATH *= "$$G15SDK_PATH/Src" INCLUDEPATH *= "$$G15SDK_PATH/Src"
DEFINES *= WIN32 DEFINES *= WIN32
QMAKE_POST_LINK = $$QMAKE_POST_LINK$$escape_expand(\\n\\t)$$quote(mt.exe -nologo -updateresource:$(DESTDIR_TARGET);1 -manifest ../src/mumble/mumble.appcompat.manifest)
win32-msvc* {
QMAKE_POST_LINK = $$QMAKE_POST_LINK$$escape_expand(\\n\\t)$$quote(mt.exe -nologo -updateresource:$(DESTDIR_TARGET);1 -manifest ../src/mumble/mumble.appcompat.manifest)
}


CONFIG(release, debug|release) { CONFIG(release, debug|release) {
QMAKE_CFLAGS_RELEASE -= -MD QMAKE_CFLAGS_RELEASE -= -MD
@@ -24,8 +24,27 @@ QMAKE_RESOURCE_FLAGS += -compress 9
# QMAKE_TARGET.arch doesn't suffice any longer, and # QMAKE_TARGET.arch doesn't suffice any longer, and
# we define MUMBLE_ARCH to be used in its place. # we define MUMBLE_ARCH to be used in its place.
MUMBLE_ARCH = $$QMAKE_TARGET.arch MUMBLE_ARCH = $$QMAKE_TARGET.arch
# When using Qt 5, use QT_ARCH instead of QMAKE_TARGET.
# It also works for cross-builds.
isEqual(QT_MAJOR_VERSION, 5) {
MUMBLE_ARCH = $$QT_ARCH
}

win32-g++ {
DEFINES *= MINGW_HAS_SECURE_API

# Enable SSE
QMAKE_CFLAGS *= -msse -msse2
QMAKE_CXXFLAGS *= -msse -msse2

CONFIG(symbols) {
# Configure build to be able to properly debug release builds
QMAKE_CFLAGS *= -g
QMAKE_CXXFLAGS *= -g
}
}


win32 { win32-msvc* {
# Define the CONFIG options 'force-x86-toolchain' and # Define the CONFIG options 'force-x86-toolchain' and
# 'force-x86_64-toolchain'. These can be used to force # 'force-x86_64-toolchain'. These can be used to force
# the target of a .pro file to be built for a specific # the target of a .pro file to be built for a specific
@@ -189,7 +208,7 @@ win32 {
} }
} }


unix { unix|win32-g++ {
DEFINES *= RESTRICT=__restrict__ DEFINES *= RESTRICT=__restrict__
QMAKE_CFLAGS *= -fvisibility=hidden QMAKE_CFLAGS *= -fvisibility=hidden
QMAKE_CXXFLAGS *= -fvisibility=hidden QMAKE_CXXFLAGS *= -fvisibility=hidden
@@ -13,12 +13,16 @@ include(pkgconfig.pri)
# This file can't include compiler.pri: it can # This file can't include compiler.pri: it can
# only be included once per .pro file. # only be included once per .pro file.


win32 { win32-msvc* {
INCLUDEPATH *= "$$OPENSSL_PATH/include" INCLUDEPATH *= "$$OPENSSL_PATH/include"
QMAKE_LIBDIR *= "$$OPENSSL_PATH/lib" QMAKE_LIBDIR *= "$$OPENSSL_PATH/lib"
LIBS *= -lgdi32 -llibeay32 LIBS *= -lgdi32 -llibeay32
} }


win32-g++ {
LIBS *= -lssl -lcrypto -lgdi32
}

unix { unix {
contains(UNAME, FreeBSD) { contains(UNAME, FreeBSD) {
LIBS *= -lcrypto -lssl LIBS *= -lcrypto -lssl
@@ -5,14 +5,54 @@
# that can be found in the LICENSE file at the root of the # that can be found in the LICENSE file at the root of the
# Mumble source tree or at <https://www.mumble.info/LICENSE>. # Mumble source tree or at <https://www.mumble.info/LICENSE>.


MUMBLE_HOST_DEB=${MUMBLE_HOST/_/-}

if [ "${TRAVIS_OS_NAME}" == "linux" ]; then if [ "${TRAVIS_OS_NAME}" == "linux" ]; then
if [ "${MUMBLE_QT}" == "qt4" ]; then if [ "${MUMBLE_QT}" == "qt4" ] && [ "${MUMBLE_HOST}" == "x86_64-linux-gnu" ]; then
sudo apt-get -qq update sudo apt-get -qq update
sudo apt-get build-dep -qq mumble sudo apt-get build-dep -qq mumble
elif [ "${MUMBLE_QT}" == "qt5" ]; then elif [ "${MUMBLE_QT}" == "qt5" ] && [ "${MUMBLE_HOST}" == "x86_64-linux-gnu" ]; then
sudo apt-get -qq update sudo apt-get -qq update
sudo apt-get build-dep -qq mumble sudo apt-get build-dep -qq mumble
sudo apt-get install qt5-default qttools5-dev qttools5-dev-tools qtbase5-dev qtbase5-dev-tools qttranslations5-l10n libqt5svg5-dev sudo apt-get install qt5-default qttools5-dev qttools5-dev-tools qtbase5-dev qtbase5-dev-tools qttranslations5-l10n libqt5svg5-dev
elif [ "${MUMBLE_QT}" == "qt5" ] && [ "${MUMBLE_HOST}" == "i686-w64-mingw32" ]; then
sudo dpkg --add-architecture i386
sudo apt-get -qq update
echo "deb http://pkg.mxe.cc/repos/apt/debian jessie main" | sudo tee /etc/apt/sources.list.d/mxeapt.list
sudo apt-key adv --keyserver x-hkp://keys.gnupg.net --recv-keys D43A795B73B16ABE9643FE1AFD8FFF16DB45C6AB
sudo apt-get -qq update
sudo apt-get install \
wine \
mxe-${MUMBLE_HOST_DEB}.static-qtbase \
mxe-${MUMBLE_HOST_DEB}.static-qtsvg \
mxe-${MUMBLE_HOST_DEB}.static-qttools \
mxe-${MUMBLE_HOST_DEB}.static-qttranslations \
mxe-${MUMBLE_HOST_DEB}.static-boost \
mxe-${MUMBLE_HOST_DEB}.static-protobuf \
mxe-${MUMBLE_HOST_DEB}.static-sqlite \
mxe-${MUMBLE_HOST_DEB}.static-flac \
mxe-${MUMBLE_HOST_DEB}.static-ogg \
mxe-${MUMBLE_HOST_DEB}.static-vorbis \
mxe-${MUMBLE_HOST_DEB}.static-libsndfile
elif [ "${MUMBLE_QT}" == "qt5" ] && [ "${MUMBLE_HOST}" == "x86_64-w64-mingw32" ]; then
sudo dpkg --add-architecture i386
sudo apt-get -qq update
echo "deb http://pkg.mxe.cc/repos/apt/debian jessie main" | sudo tee /etc/apt/sources.list.d/mxeapt.list
sudo apt-key adv --keyserver x-hkp://keys.gnupg.net --recv-keys D43A795B73B16ABE9643FE1AFD8FFF16DB45C6AB
sudo apt-get -qq update
sudo apt-get install \
wine \
mxe-${MUMBLE_HOST_DEB}.static-qtbase \
mxe-${MUMBLE_HOST_DEB}.static-qtsvg \
mxe-${MUMBLE_HOST_DEB}.static-qttools \
mxe-${MUMBLE_HOST_DEB}.static-qttranslations \
mxe-${MUMBLE_HOST_DEB}.static-boost \
mxe-${MUMBLE_HOST_DEB}.static-protobuf \
mxe-${MUMBLE_HOST_DEB}.static-sqlite \
mxe-${MUMBLE_HOST_DEB}.static-flac \
mxe-${MUMBLE_HOST_DEB}.static-ogg \
mxe-${MUMBLE_HOST_DEB}.static-vorbis \
mxe-${MUMBLE_HOST_DEB}.static-libsndfile
else else
exit 1 exit 1
fi fi
@@ -6,10 +6,28 @@
# Mumble source tree or at <https://www.mumble.info/LICENSE>. # Mumble source tree or at <https://www.mumble.info/LICENSE>.


if [ "${TRAVIS_OS_NAME}" == "linux" ]; then if [ "${TRAVIS_OS_NAME}" == "linux" ]; then
if [ "${MUMBLE_QT}" == "qt4" ]; then if [ "${MUMBLE_QT}" == "qt4" ] && [ "${MUMBLE_HOST}" == "x86_64-linux-gnu" ]; then
qmake-qt4 CONFIG+="release tests g15-emulator qt4-legacy-compat" -recursive && make -j2 && make check qmake-qt4 CONFIG+="release tests g15-emulator qt4-legacy-compat" -recursive && make -j2 && make check
elif [ "${MUMBLE_QT}" == "qt5" ]; then elif [ "${MUMBLE_QT}" == "qt5" ] && [ "${MUMBLE_HOST}" == "x86_64-linux-gnu" ]; then
qmake CONFIG+="release tests g15-emulator" -recursive && make -j2 && make check qmake CONFIG+="release tests g15-emulator" -recursive && make -j2 && make check
elif [ "${MUMBLE_QT}" == "qt5" ] && [ "${MUMBLE_HOST}" == "i686-w64-mingw32" ]; then
wget http://www.steinberg.net/sdk_downloads/asiosdk2.3.zip -P ../
unzip ../asiosdk2.3.zip -d ../
mv ../ASIOSDK2.3 3rdparty/asio
PATH=$PATH:/usr/lib/mxe/usr/bin
export MUMBLE_PROTOC=/usr/lib/mxe/usr/x86_64-unknown-linux-gnu/bin/protoc
${MUMBLE_HOST}.static-qmake-qt5 -recursive -Wall CONFIG+="release tests warnings-as-errors winpaths_custom g15-emulator no-overlay no-bonjour no-elevation no-ice"
make -j2
make check TESTRUNNER="wine"
elif [ "${MUMBLE_QT}" == "qt5" ] && [ "${MUMBLE_HOST}" == "x86_64-w64-mingw32" ]; then
wget http://www.steinberg.net/sdk_downloads/asiosdk2.3.zip -P ../
unzip ../asiosdk2.3.zip -d ../
mv ../ASIOSDK2.3 3rdparty/asio
PATH=$PATH:/usr/lib/mxe/usr/bin
export MUMBLE_PROTOC=/usr/lib/mxe/usr/x86_64-unknown-linux-gnu/bin/protoc
${MUMBLE_HOST}.static-qmake-qt5 -recursive -Wall CONFIG+="release tests warnings-as-errors winpaths_custom g15-emulator no-overlay no-bonjour no-elevation no-ice"
make -j2
make check TESTRUNNER="wine"
else else
exit 1 exit 1
fi fi
@@ -62,7 +62,7 @@ void Connection::setToS() {
return; return;


dwFlow = 0; dwFlow = 0;
if (! QOSAddSocketToFlow(hQoS, qtsSocket->socketDescriptor(), NULL, QOSTrafficTypeAudioVideo, QOS_NON_ADAPTIVE_FLOW, &dwFlow)) if (! QOSAddSocketToFlow(hQoS, qtsSocket->socketDescriptor(), NULL, QOSTrafficTypeAudioVideo, QOS_NON_ADAPTIVE_FLOW, reinterpret_cast<PQOS_FLOWID>(&dwFlow)))
qWarning("Connection: Failed to add flow to QOS"); qWarning("Connection: Failed to add flow to QOS");
#elif defined(Q_OS_UNIX) #elif defined(Q_OS_UNIX)
int val = 0xa0; int val = 0xa0;
@@ -18,7 +18,7 @@
// https://github.com/boostorg/system/blob/boost-1.56.0/include/boost/system/error_code.hpp#L514-L516 // https://github.com/boostorg/system/blob/boost-1.56.0/include/boost/system/error_code.hpp#L514-L516
// vs. // vs.
// https://github.com/boostorg/system/blob/boost-1.55.0/include/boost/system/error_code.hpp#L515-L517 // https://github.com/boostorg/system/blob/boost-1.55.0/include/boost/system/error_code.hpp#L515-L517
#if BOOST_VERSION >= 105600 #if BOOST_VERSION >= 105600 && !defined(__MINGW32__)
# define USE_BOOST_CHRONO # define USE_BOOST_CHRONO
#endif #endif


@@ -36,7 +36,7 @@ CONFIG(packaged) {
# Add OpenSSL dependency # Add OpenSSL dependency
include(../qmake/openssl.pri) include(../qmake/openssl.pri)


win32 { win32-msvc* {
INCLUDEPATH *= "$$PROTOBUF_PATH/vsprojects/include" "$$PROTOBUF_PATH/src" protobuf INCLUDEPATH *= "$$PROTOBUF_PATH/vsprojects/include" "$$PROTOBUF_PATH/src" protobuf
CONFIG(debug, debug|release) { CONFIG(debug, debug|release) {
QMAKE_LIBDIR *= "$$PROTOBUF_PATH/vsprojects/Debug" QMAKE_LIBDIR *= "$$PROTOBUF_PATH/vsprojects/Debug"
@@ -48,6 +48,11 @@ win32 {
LIBS *= -ldelayimp -lQwave -delayload:Qwave.DLL LIBS *= -ldelayimp -lQwave -delayload:Qwave.DLL
} }


win32-g++ {
LIBS *= -lprotobuf -lcrypt32 -lws2_32
LIBS *= -ldelayimp -lqwave -delayload:qwave.dll
}

unix { unix {
CONFIG(static) { CONFIG(static) {
PKG_CONFIG = pkg-config --static PKG_CONFIG = pkg-config --static
@@ -10,6 +10,7 @@
#include "Global.h" #include "Global.h"
#include "NetworkConfig.h" #include "NetworkConfig.h"
#include "OSInfo.h" #include "OSInfo.h"
#include "EnvUtils.h"


CrashReporter::CrashReporter(QWidget *p) : QDialog(p) { CrashReporter::CrashReporter(QWidget *p) : QDialog(p) {
setWindowTitle(tr("Mumble Crash Report")); setWindowTitle(tr("Mumble Crash Report"));
@@ -146,11 +147,10 @@ void CrashReporter::run() {
qsl << qtf.fileName(); qsl << qtf.fileName();


QString app = QLatin1String("dxdiag.exe"); QString app = QLatin1String("dxdiag.exe");
wchar_t *sr = NULL; QString systemRoot = EnvUtils::getenv(QLatin1String("SystemRoot"));
size_t srsize = 0;
if (_wdupenv_s(&sr, &srsize, L"SystemRoot") == 0) { if (systemRoot.count() > 0) {
app = QDir::fromNativeSeparators(QString::fromWCharArray(sr)) + QLatin1String("/System32/dxdiag.exe"); app = QDir::fromNativeSeparators(systemRoot + QLatin1String("/System32/dxdiag.exe"));
free(sr);
} }


qp.start(app, qsl); qp.start(app, qsl);
@@ -201,7 +201,7 @@ void DXAudioOutput::run() {
LPDIRECTSOUND8 pDS = NULL; LPDIRECTSOUND8 pDS = NULL;
LPDIRECTSOUNDBUFFER pDSBPrimary = NULL; LPDIRECTSOUNDBUFFER pDSBPrimary = NULL;
LPDIRECTSOUNDBUFFER pDSBOutput = NULL; LPDIRECTSOUNDBUFFER pDSBOutput = NULL;
LPDIRECTSOUNDNOTIFY8 pDSNotify = NULL; LPDIRECTSOUNDNOTIFY pDSNotify = NULL;


int iLastwriteblock; int iLastwriteblock;
LPVOID aptr1, aptr2; LPVOID aptr1, aptr2;
@@ -457,7 +457,7 @@ DXAudioInput::~DXAudioInput() {
void DXAudioInput::run() { void DXAudioInput::run() {
LPDIRECTSOUNDCAPTURE8 pDSCapture; LPDIRECTSOUNDCAPTURE8 pDSCapture;
LPDIRECTSOUNDCAPTUREBUFFER pDSCaptureBuffer; LPDIRECTSOUNDCAPTUREBUFFER pDSCaptureBuffer;
LPDIRECTSOUNDNOTIFY8 pDSNotify; LPDIRECTSOUNDNOTIFY pDSNotify;


DWORD dwBufferSize; DWORD dwBufferSize;
bool bOk; bool bOk;
@@ -10,6 +10,7 @@
#include "AudioOutput.h" #include "AudioOutput.h"
#define DIRECTSOUND_VERSION 0x1000 #define DIRECTSOUND_VERSION 0x1000


#include <mmsystem.h>
#include <dsound.h> #include <dsound.h>
#include <ks.h> #include <ks.h>
#include <ksmedia.h> #include <ksmedia.h>

0 comments on commit 10079ed

Please sign in to comment.
You can’t perform that action at this time.