diff --git a/sd/CppunitTest_sd_uimpress.mk b/sd/CppunitTest_sd_uimpress.mk index c1a66ca5f620..af4b82155b35 100644 --- a/sd/CppunitTest_sd_uimpress.mk +++ b/sd/CppunitTest_sd_uimpress.mk @@ -72,13 +72,21 @@ $(eval $(call gb_CppunitTest_use_system_darwin_frameworks,sd_uimpress,\ endif ifeq ($(OS), LINUX) -$(eval $(call gb_CppunitTest_use_externals,sd_uimpress,\ - boost_headers \ - gtk \ - dbus \ - avahi \ +ifeq ($(ENABLE_AVAHI),TRUE) +$(eval $(call gb_Library_use_externals,sd,\ + boost_headers \ + gtk \ + dbus \ + avahi \ )) else +$(eval $(call gb_Library_use_externals,sd,\ + boost_headers \ + gtk \ + dbus \ +)) +endif +else $(eval $(call gb_CppunitTest_use_externals,sd_uimpress,\ boost_headers \ gtk \ diff --git a/sd/Library_sd.mk b/sd/Library_sd.mk index 9466102eb587..f74514bb8f1d 100644 --- a/sd/Library_sd.mk +++ b/sd/Library_sd.mk @@ -95,6 +95,7 @@ $(eval $(call gb_Library_use_libraries,sd,\ )) ifeq ($(OS), LINUX) +ifeq ($(ENABLE_AVAHI),TRUE) $(eval $(call gb_Library_use_externals,sd,\ boost_headers \ libxml2 \ @@ -108,6 +109,13 @@ $(eval $(call gb_Library_use_externals,sd,\ dbus \ )) endif +else +$(eval $(call gb_Library_use_externals,sd,\ + boost_headers \ + libxml2 \ + dbus \ +)) +endif ifeq ($(OS),WNT) $(eval $(call gb_Library_use_system_win32_libs,sd,\ diff --git a/sd/source/ui/remotecontrol/DiscoveryService.cxx b/sd/source/ui/remotecontrol/DiscoveryService.cxx index 262c47abc0fb..1b2db7747b10 100644 --- a/sd/source/ui/remotecontrol/DiscoveryService.cxx +++ b/sd/source/ui/remotecontrol/DiscoveryService.cxx @@ -10,7 +10,6 @@ #include #include #include -#include #include #include #include @@ -29,6 +28,7 @@ #include typedef int socklen_t; #else + #include #include #include #include @@ -58,12 +58,14 @@ DiscoveryService::DiscoveryService() zService = new OSXNetworkService(); #endif #ifdef LINUX + #ifdef ENABLE_AVAHI // Avahi for Linux char hostname[1024]; hostname[1023] = '\0'; gethostname(hostname, 1023); zService = new AvahiNetworkService(hostname); + #endif #endif zService->setup();