Commit 29baa0f7 authored by Mario Sanchez Prada's avatar Mario Sanchez Prada
Browse files

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.
parent 5db21535
......@@ -37,7 +37,7 @@ MAINTAINERCLEANFILES = \
missing \
mkinstalldirs
SUBDIRS = src po examples help
SUBDIRS = src po help
ACLOCAL_AMFLAGS=-I m4
......
......@@ -192,7 +192,7 @@ AC_CONFIG_FILES([
Makefile
src/Makefile
src/flicksoup/Makefile
examples/Makefile
src/flicksoup/examples/Makefile
po/Makefile.in
help/Makefile
])
......
......@@ -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 \
......
# 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
......@@ -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
/*
* 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);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment