Build bonjour on nix

This commit is contained in:
Thorvald Natvig 2009-07-15 21:18:37 +02:00
parent b94dd05cf3
commit 1a38dd4cfc
9 changed files with 27 additions and 17 deletions

View File

@ -27,16 +27,20 @@
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "BonjourClient.h"
BonjourClient::BonjourClient() : bsrResolver(NULL), bsbBrowser(NULL) {
BonjourClient::BonjourClient() {
bsrResolver = NULL;
bsbBrowser = NULL;
#ifdef Q_OS_WIN
HMODULE hLib = LoadLibrary(L"DNSSD.DLL");
if (hLib == NULL) {
qWarning("Bonjour: Failed to load dnssd.dll");
return;
}
FreeLibrary(hLib);
#endif
bsbBrowser = new BonjourServiceBrowser(this);
bsbBrowser->browseForServiceType(QLatin1String("_murmur._tcp"));
bsrResolver = new BonjourServiceResolver(this);

View File

@ -30,9 +30,8 @@
#ifndef _BONJOURCLIENT_H
#define _BONJOURCLIENT_H
#include <delayimp.h>
#include "../Bonjour/bonjourservicebrowser.h"
#include "../Bonjour/bonjourserviceresolver.h"
#include "bonjourservicebrowser.h"
#include "bonjourserviceresolver.h"
class BonjourClient : public QObject {
private:
@ -47,6 +46,5 @@ class BonjourClient : public QObject {
};
#else
class Bonjour;
class BonjourServer;
class BonjourClient;
#endif

View File

@ -43,7 +43,6 @@
#include <functiondiscoverykeys.h>
#include <propidl.h>
#include <initguid.h>
#include <delayimp.h>
#include <Audiopolicy.h>
class WASAPISystem : public QObject {

View File

@ -187,6 +187,7 @@ bonjour {
HEADERS *= ../bonjour/bonjourrecord.h ../bonjour/bonjourserviceresolver.h ../bonjour/bonjourservicebrowser.h BonjourClient.h
SOURCES *= ../bonjour/bonjourserviceresolver.cpp ../bonjour/bonjourservicebrowser.cpp BonjourClient.cpp
INCLUDEPATH *= ../bonjour
win32 {
INCLUDEPATH *= /dev/Bonjour/include
LIBPATH *= /dev/Bonjour/lib/win32

View File

@ -77,6 +77,7 @@
#include <wintrust.h>
#include <Softpub.h>
#include <Dbt.h>
#include <delayimp.h>
#ifndef Q_CC_INTEL
#include <math.h>
#define lroundf(x) ( static_cast<long int>( (x) + ((x) >= 0.0f ? 0.5f : -0.5f) ) )
@ -100,4 +101,8 @@ typedef WId HWND;
#define iroundf(x) ( static_cast<int>(x) )
#ifdef USE_BONJOUR
#include <dns_sd.h>
#endif
#endif

View File

@ -29,9 +29,10 @@
*/
#include "BonjourServer.h"
bool BonjourServer::bDelayLoadFailed = false;
BonjourServer::BonjourServer() : bsrRegister(NULL) {
BonjourServer::BonjourServer() {
bsrRegister = NULL;
#ifdef Q_OS_WIN
static bool bDelayLoadFailed = false;
if (bDelayLoadFailed) return;
HMODULE hLib = LoadLibrary(L"DNSSD.DLL");
@ -41,6 +42,7 @@ BonjourServer::BonjourServer() : bsrRegister(NULL) {
return;
}
FreeLibrary(hLib);
#endif
bsrRegister = new BonjourServiceRegister(this);
}

View File

@ -30,15 +30,12 @@
#ifndef _BONJOURSERVER_H
#define _BONJOURSERVER_H
#include <delayimp.h>
#include "../Bonjour/bonjourserviceregister.h"
#include "bonjourserviceregister.h"
class BonjourServer : public QObject {
private:
Q_OBJECT
Q_DISABLE_COPY(BonjourServer)
protected:
static bool bDelayLoadFailed;
public:
BonjourServer();
~BonjourServer();
@ -47,6 +44,5 @@ class BonjourServer : public QObject {
};
#else
class Bonjour;
class BonjourServer;
#endif

View File

@ -115,6 +115,7 @@ bonjour {
HEADERS *= ../bonjour/bonjourrecord.h ../bonjour/bonjourserviceregister.h BonjourServer.h
SOURCES *= ../bonjour/bonjourserviceregister.cpp BonjourServer.cpp
INCLUDEPATH *= ../bonjour
win32 {
INCLUDEPATH *= /dev/Bonjour/include
LIBPATH *= /dev/Bonjour/lib/win32
@ -124,4 +125,3 @@ bonjour {
PKGCONFIG *= avahi-compat-libdns_sd
}
}

View File

@ -29,6 +29,7 @@
#include <windows.h>
#include <shellapi.h>
#include <intrin.h>
#include <delayimp.h>
#endif
#include <openssl/aes.h>
@ -94,4 +95,8 @@
#include <boost/weak_ptr.hpp>
#endif
#ifdef USE_BONJOUR
#include <dns_sd.h>
#endif
#endif