changeset 1450:69bff388b0f8

now it compiles
author Cristi Magherusan <majeru@atheme-project.org>
date Wed, 08 Aug 2007 22:06:42 +0300
parents e92d0f4d2793
children 31a21423999f
files src/daap/Makefile src/daap/daap.c src/daap/xmms2-daap/Makefile
diffstat 3 files changed, 26 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/src/daap/Makefile	Mon Aug 06 02:58:04 2007 +0300
+++ b/src/daap/Makefile	Wed Aug 08 22:06:42 2007 +0300
@@ -7,7 +7,15 @@
 
 LIBDIR = $(plugindir)/$(TRANSPORT_PLUGIN_DIR)
 
-LIBADD += ./xmms2-daap/xmms2-daap.a $(GTK_LIBS) $(GLIB_LIBS) $(PANGO_LIBS) 
+#For the moment i'm hardcoding it but it will be configurable
+#MDNS_LIBS=-ldns_sd
+MDNS_LIBS=-lavahi-glib -lavahi-common -lavahi-client
+#MDNS_LIBS= 
+
+
+
+
+LIBADD += ./xmms2-daap/xmms2-daap.a $(GTK_LIBS) $(GLIB_LIBS) $(PANGO_LIBS) $(MDNS_LIBS)
 
 SOURCES = daap.c
 
--- a/src/daap/daap.c	Mon Aug 06 02:58:04 2007 +0300
+++ b/src/daap/daap.c	Wed Aug 08 22:06:42 2007 +0300
@@ -27,8 +27,8 @@
 #include <curl/curl.h>
 */
 #include <glib.h>
-#include "daap_mdns_browse.h"
-#include "daap_cmd.h"
+#include "xmms2-daap/daap_mdns_browse.h"
+#include "xmms2-daap/daap_cmd.h"
 
 gboolean daap_initialized=FALSE;
 
@@ -58,11 +58,14 @@
         return NULL;
 
     g_mutex_lock(mutex_discovery);
-
+    g_print ("caut\n");
     daap_found_devices  = daap_mdns_get_server_list ();
     current_server=daap_found_devices;
-    for (current_server = daap_found_devices; current_server; current_server = g_slist_next (current_server)) 
+    g_print ("entering for\n");
+    for (; current_server; current_server = g_slist_next (current_server)) 
     {
+     g_print ("in for\n");
+
         current_device = g_new0(discovery_device_t,1);
         daap_mdns_server_t *serv=current_server->data;
         current_device->device_name = 
@@ -83,10 +86,11 @@
                     serv->port
                     );
         returned_devices = g_list_prepend(returned_devices,current_device); 
-#if DEBUG
+#if 1
         g_print("DAAP: Found device %s at address %s\n", current_device->device_name ,current_device->device_address );
 #endif
     }
+    g_print("am iesit\n");
     g_slist_free(daap_found_devices);
     g_mutex_unlock(mutex_discovery);
     return g_list_reverse(returned_devices);
@@ -115,9 +119,10 @@
         else
             daap_initialized=TRUE;
 
-    }
+    
     if(daap_initialized)
         daap_discovery_get_devices_impl();
+    }
     g_mutex_unlock(mutex_init);  /*init ended*/
 
     file = g_new0(VFSFile, 1);
--- a/src/daap/xmms2-daap/Makefile	Mon Aug 06 02:58:04 2007 +0300
+++ b/src/daap/xmms2-daap/Makefile	Wed Aug 08 22:06:42 2007 +0300
@@ -14,11 +14,14 @@
 
 #		 daap_xform.c 
 LIBADD = $(GLIB_LIBS) 
- 
 
-CFLAGS = $(GLIB_CFLAGS)  -I/usr/include   -std=c99 -Wall # -H -v
+#For the moment i'm hardcoding it but it will be configurable
+#MDNS_IMPL=DAAP_MDNS_DNSSD
+MDNS_IMPL=DAAP_MDNS_AVAHI
+#MDNS_IMPL=DAAP_MDNS_DUMMY 
 
-#CFLAGS += $(PICFLAGS) $(ARCH_DEFINES) $(CURL_CFLAGS) -c -I../../../intl -I../../.. -I/usr/include -Wall   -std=c99 -H -v
+CFLAGS = $(GLIB_CFLAGS) $(PICFLAGS) -std=c99 -Wall -D_POSIX_SOURCE -D$(MDNS_IMPL) 
+
 OBJECTS=${SOURCES:.c=.o}
 
 include ../../../mk/objective.mk