/soc/2013/ankitkv/gobjectification: e77b9f184125: Build libfinch...

Ankit Vani a at nevitus.org
Fri Oct 11 18:16:00 EDT 2013


Changeset: e77b9f1841253ead10044b5f43fa4bb582b8fdf2
Author:	 Ankit Vani <a at nevitus.org>
Date:	 2013-10-12 03:08 +0530
Branch:	 soc.2013.gobjectification.plugins
URL: https://hg.pidgin.im/soc/2013/ankitkv/gobjectification/rev/e77b9f184125

Description:

Build libfinch and libpidgin before building the programs so that gtkdoc-scangobj can introspect finch and pidgin

diffstat:

 finch/Makefile.am     |  32 +++++++++++++++++++-----------
 finch/finch-rename.c  |  53 +++++++++++++++++++++++++++++++++++++++++++++++++++
 finch/finch.h         |   9 ++++++++
 finch/finch.c         |  28 +-------------------------
 libpurple/Makefile.am |   2 +
 pidgin/Makefile.am    |  36 +++++++++++++++++++++-------------
 pidgin/Makefile.mingw |   3 +-
 pidgin/gtkmain.c      |  21 +-------------------
 pidgin/pidgin.c       |  47 +++++++++++++++++++++++++++++++++++++++++++++
 pidgin/pidgin.h       |   5 ++++
 10 files changed, 162 insertions(+), 74 deletions(-)

diffs (truncated from 455 to 300 lines):

diff --git a/finch/Makefile.am b/finch/Makefile.am
--- a/finch/Makefile.am
+++ b/finch/Makefile.am
@@ -11,18 +11,19 @@ SUBDIRS = libgnt plugins
 
 if ENABLE_GNT
 
+noinst_LTLIBRARIES = libfinch.la
 bin_PROGRAMS = finch
 
 endif
 
-finch_SOURCES = \
+libfinch_la_SOURCES = \
 	gntaccount.c \
 	gntblist.c \
 	gntcertmgr.c \
 	gntconn.c \
 	gntconv.c \
 	gntdebug.c \
-	finch.c \
+	gntfinch.c \
 	gntidle.c \
 	gntlog.c \
 	gntmedia.c \
@@ -38,7 +39,7 @@ finch_SOURCES = \
 	gntui.c \
 	gntxfer.c
 
-finch_headers = \
+libfinch_la_headers = \
 	gntaccount.h \
 	gntblist.h \
 	gntcertmgr.h \
@@ -61,13 +62,16 @@ finch_headers = \
 	gntui.h \
 	gntxfer.h
 
-finchincludedir=$(includedir)/finch
-finchinclude_HEADERS = \
-	$(finch_headers)
+finch_SOURCES = \
+	finch-rename.c
 
-finch_DEPENDENCIES = @LIBOBJS@
-finch_LDFLAGS = -export-dynamic
-finch_LDADD = \
+libfinchincludedir=$(includedir)/finch
+libfinchinclude_HEADERS = \
+	$(libfinch_la_headers)
+
+libfinch_la_DEPENDENCIES = @LIBOBJS@
+libfinch_la_LDFLAGS = -export-dynamic
+libfinch_la_LIBADD = \
 	@LIBOBJS@ \
 	$(DBUS_LIBS) \
 	$(INTLLIBS) \
@@ -80,6 +84,10 @@ finch_LDADD = \
 	./libgnt/libgnt.la \
 	$(top_builddir)/libpurple/libpurple.la
 
+finch_DEPENDENCIES = $(builddir)/libfinch.la
+finch_LDFLAGS = -export-dynamic
+finch_LDADD = $(builddir)/libfinch.la $(libfinch_la_LIBADD)
+
 AM_CPPFLAGS = \
 	-DSTANDALONE \
 	-DDATADIR=\"$(datadir)\" \
@@ -105,12 +113,12 @@ INTROSPECTION_SCANNER_ARGS = --add-inclu
 INTROSPECTION_COMPILER_ARGS = --includedir=$(top_builddir)/libpurple
 
 if HAVE_INTROSPECTION
-introspection_sources = $(finchinclude_HEADERS)
+introspection_sources = $(libfinchinclude_HEADERS)
 
-Finch-$(PURPLE_MAJOR_VERSION).$(PURPLE_MINOR_VERSION).gir: $(builddir)/finch
+Finch-$(PURPLE_MAJOR_VERSION).$(PURPLE_MINOR_VERSION).gir: $(builddir)/libfinch.la
 Finch_3_0_gir_INCLUDES = GObject-2.0 Purple-$(PURPLE_MAJOR_VERSION).$(PURPLE_MINOR_VERSION)
 Finch_3_0_gir_CFLAGS = $(INCLUDES) $(AM_CPPFLAGS)
-Finch_3_0_gir_PROGRAM = $(builddir)/finch
+Finch_3_0_gir_LIBS = $(builddir)/libfinch.la
 Finch_3_0_gir_FILES = $(introspection_sources)
 INTROSPECTION_GIRS += Finch-$(PURPLE_MAJOR_VERSION).$(PURPLE_MINOR_VERSION).gir
 
diff --git a/finch/finch-rename.c b/finch/finch-rename.c
new file mode 100644
--- /dev/null
+++ b/finch/finch-rename.c
@@ -0,0 +1,53 @@
+/**
+ * finch
+ *
+ * Finch is the legal property of its developers, whose names are too numerous
+ * to list here.  Please refer to the COPYRIGHT file distributed with this
+ * source distribution.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * 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 License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02111-1301  USA
+ */
+
+#include "internal.h"
+#include "core.h"
+
+#include "finch.h"
+#include "gnt.h"
+
+int main(int argc, char *argv[])
+{
+	signal(SIGPIPE, SIG_IGN);
+
+#if !GLIB_CHECK_VERSION(2, 32, 0)
+	/* GLib threading system is automaticaly initialized since 2.32.
+	 * For earlier versions, it have to be initialized before calling any
+	 * Glib or GTK+ functions.
+	 */
+	g_thread_init(NULL);
+#endif
+
+	g_set_prgname("Finch");
+	g_set_application_name(_("Finch"));
+
+	if (gnt_start(&argc, &argv)) {
+		gnt_main();
+
+#ifdef STANDALONE
+		purple_core_quit();
+#endif
+	}
+
+	return 0;
+}
diff --git a/finch/finch.h b/finch/finch.h
--- a/finch/finch.h
+++ b/finch/finch.h
@@ -22,6 +22,9 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02111-1301  USA
  */
+#ifndef _FINCH_H_
+#define _FINCH_H_
+
 #include <glib.h>
 
 #define FINCH_UI "gnt-purple"
@@ -31,3 +34,9 @@
 #define FINCH_GET_DATA(obj)        (obj)->ui_data
 #define FINCH_SET_DATA(obj, data)  (obj)->ui_data = data
 
+/**
+ * Start finch with the given command line arguments.
+ */
+gboolean gnt_start(int *argc, char ***argv);
+
+#endif
diff --git a/finch/finch.c b/finch/gntfinch.c
rename from finch/finch.c
rename to finch/gntfinch.c
--- a/finch/finch.c
+++ b/finch/gntfinch.c
@@ -419,7 +419,7 @@ init_libpurple(int argc, char **argv)
 	return 1;
 }
 
-static gboolean gnt_start(int *argc, char ***argv)
+gboolean gnt_start(int *argc, char ***argv)
 {
 	/* Initialize the libpurple stuff */
 	if (!init_libpurple(*argc, *argv))
@@ -429,29 +429,3 @@ static gboolean gnt_start(int *argc, cha
 	return TRUE;
 }
 
-int main(int argc, char *argv[])
-{
-	signal(SIGPIPE, SIG_IGN);
-
-#if !GLIB_CHECK_VERSION(2, 32, 0)
-	/* GLib threading system is automaticaly initialized since 2.32.
-	 * For earlier versions, it have to be initialized before calling any
-	 * Glib or GTK+ functions.
-	 */
-	g_thread_init(NULL);
-#endif
-
-	g_set_prgname("Finch");
-	g_set_application_name(_("Finch"));
-
-	if (gnt_start(&argc, &argv)) {
-		gnt_main();
-
-#ifdef STANDALONE
-		purple_core_quit();
-#endif
-	}
-
-	return 0;
-}
-
diff --git a/libpurple/Makefile.am b/libpurple/Makefile.am
--- a/libpurple/Makefile.am
+++ b/libpurple/Makefile.am
@@ -398,6 +398,7 @@ libpurple_la_LIBADD = \
 	$(JSON_LIBS) \
 	$(GNUTLS_LIBS) \
 	$(NSS_LIBS) \
+	$(ZLIB_LIBS) \
 	$(INTROSPECTION_LIBS) \
 	-lm
 
@@ -420,6 +421,7 @@ AM_CPPFLAGS = \
 	$(JSON_CFLAGS) \
 	$(GNUTLS_CFLAGS) \
 	$(NSS_CFLAGS) \
+	$(ZLIB_CFLAGS) \
 	$(INTROSPECTION_CFLAGS)
 
 # INSTALL_SSL_CERTIFICATES is true when SSL_CERTIFICATES_DIR is empty.
diff --git a/pidgin/Makefile.am b/pidgin/Makefile.am
--- a/pidgin/Makefile.am
+++ b/pidgin/Makefile.am
@@ -38,9 +38,10 @@ pkgconfig_DATA = pidgin-3.pc
 
 SUBDIRS = pixmaps plugins themes
 
+noinst_LTLIBRARIES = libpidgin.la
 bin_PROGRAMS = pidgin
 
-pidgin_SOURCES = \
+libpidgin_la_SOURCES = \
 	pidginstock.c \
 	gtkaccount.c \
 	gtkblist.c \
@@ -63,7 +64,7 @@ pidgin_SOURCES = \
 	gtkimhtml.c \
 	gtkimhtmltoolbar.c \
 	gtklog.c \
-	gtkmain.c \
+	gtkpidgin.c \
 	gtkmedia.c \
 	gtkmenutray.c \
 	gtknotify.c \
@@ -94,7 +95,7 @@ pidgin_SOURCES = \
 	pidgintooltip.c \
 	smileyparser.c
 
-pidgin_headers = \
+libpidgin_la_headers = \
 	gtkaccount.h \
 	gtkblist.h \
 	gtkblist-theme.h \
@@ -150,22 +151,25 @@ pidgin_headers = \
 	pidgin.h \
 	smileyparser.h
 
-pidginincludedir=$(includedir)/pidgin
-pidgininclude_HEADERS = \
-	$(pidgin_headers)
+pidgin_SOURCES = \
+	pidgin.c
 
-pidgin_builtheaders = gtkdebug.html.h
+libpidginincludedir=$(includedir)/pidgin
+libpidgininclude_HEADERS = \
+	$(libpidgin_la_headers)
 
-BUILT_SOURCES = $(pidgin_builtheaders)
+libpidgin_la_builtheaders = gtkdebug.html.h
+
+BUILT_SOURCES = $(libpidgin_la_builtheaders)
 
 %.html.h: %.html
 	$(AM_V_GEN)echo "static const char $*_html[] = {" > $@
 	$(AM_V_at)$(sedpath) -e 's/^[ 	]\+//g' -e 's/[ 	]\+/ /g' $< | $(xxdpath) -i | sed -e 's/\(0x[0-9a-f][0-9a-f]\)$$/\1, 0x00/' >> $@
 	$(AM_V_at)echo "};" >> $@
 
-pidgin_DEPENDENCIES = @LIBOBJS@
-pidgin_LDFLAGS = -export-dynamic
-pidgin_LDADD = \
+libpidgin_la_DEPENDENCIES = @LIBOBJS@
+libpidgin_la_LDFLAGS = -export-dynamic
+libpidgin_la_LIBADD = \
 	@LIBOBJS@ \
 	$(GLIB_LIBS) \
 	$(GPLUGIN_LIBS) \
@@ -189,6 +193,10 @@ if USE_INTERNAL_LIBGADU
 INTGG_CFLAGS = -DUSE_INTERNAL_LIBGADU
 endif
 
+pidgin_DEPENDENCIES = $(builddir)/libpidgin.la



More information about the Commits mailing list