fix for OS where avahi is not present
Change-Id: Ib3e21b786821baa7c3c47755de5125e1de566c39
This commit is contained in:
@@ -72,13 +72,21 @@ $(eval $(call gb_CppunitTest_use_system_darwin_frameworks,sd_uimpress,\
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(OS), LINUX)
|
ifeq ($(OS), LINUX)
|
||||||
$(eval $(call gb_CppunitTest_use_externals,sd_uimpress,\
|
ifeq ($(ENABLE_AVAHI),TRUE)
|
||||||
boost_headers \
|
$(eval $(call gb_Library_use_externals,sd,\
|
||||||
gtk \
|
boost_headers \
|
||||||
dbus \
|
gtk \
|
||||||
avahi \
|
dbus \
|
||||||
|
avahi \
|
||||||
))
|
))
|
||||||
else
|
else
|
||||||
|
$(eval $(call gb_Library_use_externals,sd,\
|
||||||
|
boost_headers \
|
||||||
|
gtk \
|
||||||
|
dbus \
|
||||||
|
))
|
||||||
|
endif
|
||||||
|
else
|
||||||
$(eval $(call gb_CppunitTest_use_externals,sd_uimpress,\
|
$(eval $(call gb_CppunitTest_use_externals,sd_uimpress,\
|
||||||
boost_headers \
|
boost_headers \
|
||||||
gtk \
|
gtk \
|
||||||
|
@@ -95,6 +95,7 @@ $(eval $(call gb_Library_use_libraries,sd,\
|
|||||||
))
|
))
|
||||||
|
|
||||||
ifeq ($(OS), LINUX)
|
ifeq ($(OS), LINUX)
|
||||||
|
ifeq ($(ENABLE_AVAHI),TRUE)
|
||||||
$(eval $(call gb_Library_use_externals,sd,\
|
$(eval $(call gb_Library_use_externals,sd,\
|
||||||
boost_headers \
|
boost_headers \
|
||||||
libxml2 \
|
libxml2 \
|
||||||
@@ -108,6 +109,13 @@ $(eval $(call gb_Library_use_externals,sd,\
|
|||||||
dbus \
|
dbus \
|
||||||
))
|
))
|
||||||
endif
|
endif
|
||||||
|
else
|
||||||
|
$(eval $(call gb_Library_use_externals,sd,\
|
||||||
|
boost_headers \
|
||||||
|
libxml2 \
|
||||||
|
dbus \
|
||||||
|
))
|
||||||
|
endif
|
||||||
|
|
||||||
ifeq ($(OS),WNT)
|
ifeq ($(OS),WNT)
|
||||||
$(eval $(call gb_Library_use_system_win32_libs,sd,\
|
$(eval $(call gb_Library_use_system_win32_libs,sd,\
|
||||||
|
@@ -10,7 +10,6 @@
|
|||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <unistd.h>
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
@@ -29,6 +28,7 @@
|
|||||||
#include <ws2tcpip.h>
|
#include <ws2tcpip.h>
|
||||||
typedef int socklen_t;
|
typedef int socklen_t;
|
||||||
#else
|
#else
|
||||||
|
#include <unistd.h>
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <sys/socket.h>
|
#include <sys/socket.h>
|
||||||
#include <netinet/in.h>
|
#include <netinet/in.h>
|
||||||
@@ -58,12 +58,14 @@ DiscoveryService::DiscoveryService()
|
|||||||
zService = new OSXNetworkService();
|
zService = new OSXNetworkService();
|
||||||
#endif
|
#endif
|
||||||
#ifdef LINUX
|
#ifdef LINUX
|
||||||
|
#ifdef ENABLE_AVAHI
|
||||||
// Avahi for Linux
|
// Avahi for Linux
|
||||||
char hostname[1024];
|
char hostname[1024];
|
||||||
hostname[1023] = '\0';
|
hostname[1023] = '\0';
|
||||||
gethostname(hostname, 1023);
|
gethostname(hostname, 1023);
|
||||||
|
|
||||||
zService = new AvahiNetworkService(hostname);
|
zService = new AvahiNetworkService(hostname);
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
zService->setup();
|
zService->setup();
|
||||||
|
Reference in New Issue
Block a user