# HG changeset patch
# User rosfran
# Date 1168009569 0
# Node ID beb4c07dfb65315e6de000f9bd687526f05066f4
# Parent  9612496070ae4f49cff0811ada3f38c643341e85
[svn r244] Fixes some problems with the UPnP library dependencies.

diff -r 9612496070ae -r beb4c07dfb65 gmyth/configure.ac
--- a/gmyth/configure.ac	Thu Jan 04 21:16:44 2007 +0000
+++ b/gmyth/configure.ac	Fri Jan 05 15:06:09 2007 +0000
@@ -225,6 +225,8 @@
 AC_SUBST(MYSQL_CFLAGS)
 AC_SUBST(MYSQL_LIBS)
 
+
+AC_MSG_NOTICE([Checking for the UPnP CyberLink for C library...])
 dnl ========== Check for Cyberlink UPnP Libraries
 AC_ARG_ENABLE(upnp,
 	[AC_HELP_STRING([--disable-upnp], [disable building UPnP related stuff])],
@@ -232,7 +234,7 @@
 	enable_upnp=yes)
 
 if test "x$enable_upnp" = "xyes" ; then
-	PKG_CHECK_MODULES(CYBERLINK_UPNP,
+	PKG_CHECK_MODULES(CYBERLINK,
 	  clinkc,
 	  HAVE_CYBERLINK=yes, HAVE_CYBERLINK=no)
 fi
diff -r 9612496070ae -r beb4c07dfb65 gmyth/gmyth.pc.in
--- a/gmyth/gmyth.pc.in	Thu Jan 04 21:16:44 2007 +0000
+++ b/gmyth/gmyth.pc.in	Fri Jan 05 15:06:09 2007 +0000
@@ -8,5 +8,5 @@
 Version: @VERSION@
 Requires: gobject-2.0 glib-2.0
 
-Libs: @MYSQL_LIBS@ -L${libdir} -lgmyth
-Cflags: @MYSQL_CFLAGS@ -I${includedir}/gmyth
+Libs: @MYSQL_LIBS@ @CYBERLINK_LIBS@ -L${libdir} -lgmyth
+Cflags: @MYSQL_CFLAGS@ @CYBERLINK_CFLAGS@ -I${includedir}/gmyth
diff -r 9612496070ae -r beb4c07dfb65 gmyth/src/Makefile.am
--- a/gmyth/src/Makefile.am	Thu Jan 04 21:16:44 2007 +0000
+++ b/gmyth/src/Makefile.am	Fri Jan 05 15:06:09 2007 +0000
@@ -52,6 +52,11 @@
 	$(GSTPLUGINSBASE_CFLAGS)	\
 	$(MYSQL_CFLAGS)
 
+if WITH_UPNP
+libgmyth_la_CFLAGS += 			\
+	$(CYBERLINK_CFLAGS)
+endif
+
 libgmyth_la_LDFLAGS = 			\
 	-export-dynamic 			\
 	$(MYSQL_LIBS) 				\
@@ -59,6 +64,13 @@
 	$(GSTBASE_LIBS)				\
 	$(GSTPLUGINS_LIBS)
 
+if WITH_UPNP
+libgmyth_la_LDFLAGS += 			\
+	$(CYBERLINK_LIBS)
+libgmyth_la_LIBS = 			\
+	$(CYBERLINK_LIBS)
+endif
+
 libgmyth_includedir = 			\
 	$(pkgincludedir)
 
diff -r 9612496070ae -r beb4c07dfb65 gmyth/src/gmyth_backendinfo.c
--- a/gmyth/src/gmyth_backendinfo.c	Thu Jan 04 21:16:44 2007 +0000
+++ b/gmyth/src/gmyth_backendinfo.c	Fri Jan 05 15:06:09 2007 +0000
@@ -154,7 +154,7 @@
     { 
     #ifdef WITH_UPNP
 	    GMythUPnP *gmyth_upnp = gmyth_upnp_new( backend_info );
-	    backend_info = gmyth_upnp_get_backend_info( gmyth_upnp );
+	    /* backend_info = gmyth_upnp_get_backend_info( gmyth_upnp ); */
 	    backend_info->hostname = g_strdup ( gmyth_upnp_get_host( gmyth_upnp ) );
 	    g_object_unref( gmyth_upnp );
     #else
diff -r 9612496070ae -r beb4c07dfb65 gmyth/src/gmyth_upnp.c
--- a/gmyth/src/gmyth_upnp.c	Thu Jan 04 21:16:44 2007 +0000
+++ b/gmyth/src/gmyth_upnp.c	Fri Jan 05 15:06:09 2007 +0000
@@ -27,6 +27,10 @@
  *   
  */
 
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
 #include "gmyth_upnp.h"
 
 #include <arpa/inet.h>
@@ -253,7 +257,8 @@
 		devName = cg_upnp_device_getfriendlyname(childDev);
 		dev_url = cg_upnp_device_getlocationfromssdppacket( childDev );
 		gmyth_debug( "Device's friendly name = %s, and  device's URL = %s\n", devName, dev_url );
-		if ( upnp_dev_found = ( g_strstr_len( devName, strlen( devName ), mythtvFriendlyName ) != NULL ) ) {
+		if ( ( upnp_dev_found = ( g_strstr_len( devName, strlen( devName ), mythtvFriendlyName ) != NULL ) ) == TRUE ) 
+		{
 			*udn = cg_upnp_device_getudn( childDev );
 			*mythtv_servers_lst = g_list_append( *mythtv_servers_lst, dev_url ); 
 		}
@@ -301,7 +306,7 @@
 	if ( NULL == gmyth_upnp || gmyth_upnp->port <= 0 ) 
 	{
 		gmyth_debug ("[%s] GMythUPnP host field not initialized\n", __FUNCTION__);
-		return NULL;
+		return 0;
 	}
 
 	return gmyth_upnp->port;
diff -r 9612496070ae -r beb4c07dfb65 gmyth/src/gmyth_upnp.h
--- a/gmyth/src/gmyth_upnp.h	Thu Jan 04 21:16:44 2007 +0000
+++ b/gmyth/src/gmyth_upnp.h	Fri Jan 05 15:06:09 2007 +0000
@@ -1,14 +1,13 @@
 /**
  * GMyth Library
  *
- * @file gmyth/gmyth_uri.h
+ * @file gmyth/gmyth_upnp.h
  * 
- * @brief <p> GMythURI utils
- *  - Extracts and parses a URI char string, in according with the RFC 2396 
- *    [http://www.ietf.org/rfc/rfc2396.txt]
- * 
+ * @brief <p> GMythUPnP allows that a MythTV frontend discovers a 
+ * MythTV backend, using the UPnP architecture.
+ *
  * Copyright (C) 2006 INdT - Instituto Nokia de Tecnologia.
- * @author Rosfran Borges <rosfran.borges@indt.org.br>
+ * @author Rosfran Lins Borges <rosfran.borges@indt.org.br>
  *
  *//*
  * 
@@ -25,6 +24,7 @@
  * You should have received a copy of the GNU Lesser General Public License
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *   
  */
 
 #ifndef _GMYTH_UPNP_H_