[frogr] Do not compile flicksoup as a static library, but as part of frogr.



commit 29baa0f75d8247c8769375c1a1e616c6cc81ddb5
Author: Mario Sanchez Prada <msanchez igalia com>
Date:   Thu Jun 2 20:45:49 2011 +0200

    Do not compile flicksoup as a static library, but as part of frogr.
    
    Also, moved the examples/ directory src/flicksoup/examples/, where it
    should have always been from the start, and made it optional build.

 Makefile.am                                        |    2 +-
 configure.ac                                       |    2 +-
 src/Makefile.am                                    |   13 +++++++--
 src/flicksoup/Makefile.am                          |   27 +++++--------------
 {examples => src/flicksoup/examples}/Makefile.am   |   27 ++++++++++++-------
 {examples => src/flicksoup/examples}/example.c     |   17 +++++++++---
 {examples => src/flicksoup/examples}/testphoto.png |  Bin 9445 -> 9445 bytes
 7 files changed, 48 insertions(+), 40 deletions(-)
---
diff --git a/Makefile.am b/Makefile.am
index f60a7ff..ebc3226 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -37,7 +37,7 @@ MAINTAINERCLEANFILES = \
 	missing \
 	mkinstalldirs
 
-SUBDIRS = src po examples help
+SUBDIRS = src po help
 
 ACLOCAL_AMFLAGS=-I m4
 
diff --git a/configure.ac b/configure.ac
index dd8d51c..d7eb4d8 100644
--- a/configure.ac
+++ b/configure.ac
@@ -192,7 +192,7 @@ AC_CONFIG_FILES([
         Makefile
         src/Makefile
         src/flicksoup/Makefile
-        examples/Makefile
+        src/flicksoup/examples/Makefile
         po/Makefile.in
         help/Makefile
 ])
diff --git a/src/Makefile.am b/src/Makefile.am
index c0d927b..1139665 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -20,9 +20,7 @@ SUBDIRS = flicksoup
 
 bin_PROGRAMS = frogr
 
-frogr_LDADD = 				\
-	flicksoup/libflicksoup.a 	\
-	$(FROGR_LIBS)
+frogr_LDADD = $(FROGR_LIBS)
 
 frogr_CFLAGS = $(FROGR_CFLAGS) \
 	-DDATA_DIR=\"$(DATA_DIR)\"
@@ -42,6 +40,15 @@ frogr_LDFLAGS = -export-dynamic
 endif
 
 frogr_SOURCES = \
+	flicksoup/flicksoup.h \
+	flicksoup/fsp-data.c \
+	flicksoup/fsp-data.h \
+	flicksoup/fsp-error.c \
+	flicksoup/fsp-error.h \
+	flicksoup/fsp-parser.c \
+	flicksoup/fsp-parser.h \
+	flicksoup/fsp-session.c \
+	flicksoup/fsp-session.h \
 	frogr-about-dialog.c \
 	frogr-about-dialog.h \
 	frogr-account.c \
diff --git a/src/flicksoup/Makefile.am b/src/flicksoup/Makefile.am
index 6f355fd..1bdd13e 100644
--- a/src/flicksoup/Makefile.am
+++ b/src/flicksoup/Makefile.am
@@ -1,5 +1,8 @@
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of version 3 of the GNU Lesser General Public
+# Copyright (C) 2009-2011 Mario Sanchez Prada
+# Authors: Mario Sanchez Prada <msanchez igalia com>
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of version 3 of the GNU General Public
 # License as published by the Free Software Foundation.
 #
 # This program is distributed in the hope that it will be useful,
@@ -7,23 +10,7 @@
 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 # General Public License for more details.
 #
-# You should have received a copy of the GNU General Public Lesser License
+# You should have received a copy of the GNU General Public License
 # along with this program; if not, see <http://www.gnu.org/licenses/>
 
-AM_CFLAGS =			  \
-	-I$(top_srcdir)/src 	  \
-	$(LIBSOUP_CFLAGS)	  \
-	$(LIBXML2_CFLAGS)
-
-noinst_LIBRARIES = libflicksoup.a
-
-libflicksoup_a_SOURCES =	\
-	flicksoup.h		\
-	fsp-data.c		\
-	fsp-data.h		\
-	fsp-error.c		\
-	fsp-error.h		\
-	fsp-parser.c		\
-	fsp-parser.h		\
-	fsp-session.c		\
-	fsp-session.h
+SUBDIRS = examples
diff --git a/examples/Makefile.am b/src/flicksoup/examples/Makefile.am
similarity index 68%
rename from examples/Makefile.am
rename to src/flicksoup/examples/Makefile.am
index 29de7d2..4f2e124 100644
--- a/examples/Makefile.am
+++ b/src/flicksoup/examples/Makefile.am
@@ -10,16 +10,23 @@
 # You should have received a copy of the GNU General Public License
 # along with this program; if not, see <http://www.gnu.org/licenses/>
 
-AM_CPPFLAGS = 			\
-	-I$(top_srcdir)/src	\
-	$(GLIB_CFLAGS)		\
-	$(EXTRA_CFLAGS)
-
 noinst_PROGRAMS = \
 	example
 
-example_SOURCES = example.c
-example_LDADD = 					\
-	$(top_builddir)/src/flicksoup/libflicksoup.a	\
-	$(LIBSOUP_LIBS)		  			\
-	$(LIBXML2_LIBS)
+example_CFLAGS = \
+	-I$(top_srcdir)/src \
+	$(FROGR_CFLAGS)
+
+example_LDADD = $(FROGR_LIBS)
+
+example_SOURCES = \
+	../flicksoup.h \
+	../fsp-data.c \
+	../fsp-data.h \
+	../fsp-error.c \
+	../fsp-error.h \
+	../fsp-parser.c \
+	../fsp-parser.h \
+	../fsp-session.c \
+	../fsp-session.h \
+	example.c
\ No newline at end of file
diff --git a/examples/example.c b/src/flicksoup/examples/example.c
similarity index 97%
rename from examples/example.c
rename to src/flicksoup/examples/example.c
index 43f6101..f148dfa 100644
--- a/examples/example.c
+++ b/src/flicksoup/examples/example.c
@@ -1,5 +1,5 @@
 /*
- * example.c -- Random example to test the library
+ * example.c -- Random example to test the flicksoup files
  *
  * Copyright (C) 2010-2011 Mario Sanchez Prada
  * Authors: Mario Sanchez Prada <msanchez igalia com>
@@ -20,16 +20,18 @@
 
 #include <stdio.h>
 #include <glib.h>
+
 #include <flicksoup/flicksoup.h>
 
 #define API_KEY "18861766601de84f0921ce6be729f925"
 #define SHARED_SECRET "6233fbefd85f733a"
 
-#define TEST_PHOTO "./examples/testphoto.png"
+#define TEST_PHOTO "testphoto.png"
 
 static gchar *uploaded_photo_id = NULL;
 static gchar *created_photoset_id = NULL;
 static gchar *first_group_id = NULL;
+static gchar *test_photo_path = NULL;
 
 /* Prototypes */
 
@@ -168,7 +170,7 @@ get_groups_cb                           (GObject      *object,
       /* Continue adding a picture to the group, but first upload a new one */
       g_print ("Uploading a new picture to be added to the group...");
       fsp_session_upload_async (session,
-                                TEST_PHOTO,
+                                test_photo_path,
                                 "Yet another title",
                                 "Yet another description ",
                                 "yet some other tags",
@@ -241,7 +243,7 @@ photoset_created_cb                     (GObject      *object,
       /* Continue adding a picture to the photoset, but first upload a new one */
       g_print ("Uploading a new picture to be added to the photoset...");
       fsp_session_upload_async (session,
-                                TEST_PHOTO,
+                                test_photo_path,
                                 "Yet another title",
                                 "Yet another description ",
                                 "yet some other tags",
@@ -395,7 +397,7 @@ get_tags_list_cb (GObject *object, GAsyncResult *res, gpointer unused)
       /* Continue uploading a picture */
       g_print ("Uploading a picture...\n");
       fsp_session_upload_async (session,
-                                TEST_PHOTO,
+                                test_photo_path,
                                 "title",
                                 "description",
                                 "áèïôu "
@@ -591,6 +593,11 @@ main                                    (int    argc,
 
   g_print ("Running flicksoup example...\n\n");
 
+  /* Find full path to the testing photo */
+  test_photo_path = g_strdup_printf ("file://%s/%s",
+                                     g_get_current_dir (),
+                                     TEST_PHOTO);
+
   /* Queue the work in the main context */
   g_idle_add (do_work, NULL);
 
diff --git a/examples/testphoto.png b/src/flicksoup/examples/testphoto.png
similarity index 100%
rename from examples/testphoto.png
rename to src/flicksoup/examples/testphoto.png



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]