summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOlivier CrĂȘte <olivier.crete@collabora.co.uk>2008-10-17 14:56:18 -0400
committerOlivier CrĂȘte <olivier.crete@collabora.co.uk>2008-10-17 14:56:18 -0400
commitca88bd5fba3b79c7fe78f2af803d433e56411352 (patch)
treee72007f7fc5d169936b470aae31ae7ec617fb3aa
parent8e30430bc521a106921acd1031bde801b3b2272d (diff)
downloadtelepathy-farstream-ca88bd5fba3b79c7fe78f2af803d433e56411352.tar.gz
Generate the signal marshaller .list files from the code automagically
Code taken from telepathy-gabble
-rw-r--r--.gitignore2
-rw-r--r--src/Makefile.am15
-rw-r--r--src/tp-stream-engine-signals-marshal.list6
-rw-r--r--telepathy-farsight/Makefile.am14
-rw-r--r--telepathy-farsight/tf-signals-marshal.list5
5 files changed, 29 insertions, 13 deletions
diff --git a/.gitignore b/.gitignore
index fc80c20..127f6a6 100644
--- a/.gitignore
+++ b/.gitignore
@@ -19,7 +19,9 @@ data/org.maemo.Telepathy.StreamEngine.service
src/telepathy-stream-engine
src/tp-stream-engine-signals-marshal.[ch]
+src/tp-stream-engine-signals-marshal.list
telepathy-farsight/tf-signals-marshal.[ch]
+telepathy-farsight/tf-signals-marshal.list
telepathy-farsight/telepathy-farsight.pc
diff --git a/src/Makefile.am b/src/Makefile.am
index 9034e6f..08f0138 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -2,7 +2,8 @@ BUILT_SOURCES = \
tp-stream-engine-signals-marshal.h \
tp-stream-engine-signals-marshal.c
-CLEANFILES = $(BUILT_SOURCES)
+CLEANFILES = $(BUILT_SOURCES) tp-stream-engine-signals-marshal.list
+
libexec_PROGRAMS = telepathy-stream-engine
@@ -48,6 +49,18 @@ AM_LDFLAGS = \
$(top_builddir)/telepathy-farsight/libtelepathy-farsight.la
# rules to generate signal marshallers
+tp-stream-engine-signals-marshal.list: $(telepathy_stream_engine_SOURCES) Makefile.am
+ ( cd $(srcdir) && \
+ sed -n -e 's/.*tp_stream_engine_marshal_\([[:upper:][:digit:]]*__[[:upper:][:digit:]_]*\).*/\1/p' \
+ $(telepathy_stream_engine_SOURCES) ) \
+ | sed -e 's/__/:/' -e 'y/_/,/' | sort -u > $@.tmp
+ if cmp -s $@.tmp $@; then \
+ rm $@.tmp; \
+ touch $@; \
+ else \
+ mv $@.tmp $@; \
+ fi
+
%-signals-marshal.h: %-signals-marshal.list Makefile.in
glib-genmarshal --header --prefix=$(subst -,_,$*)_marshal $< > $*-signals-marshal.h
diff --git a/src/tp-stream-engine-signals-marshal.list b/src/tp-stream-engine-signals-marshal.list
deleted file mode 100644
index 47ab3ab..0000000
--- a/src/tp-stream-engine-signals-marshal.list
+++ /dev/null
@@ -1,6 +0,0 @@
-VOID:BOXED,STRING
-VOID:BOXED,UINT,UINT,UINT
-VOID:STRING,BOXED
-VOID:STRING,STRING
-VOID:UINT,UINT
-OBJECT:VOID
diff --git a/telepathy-farsight/Makefile.am b/telepathy-farsight/Makefile.am
index 0a71da6..faf74cd 100644
--- a/telepathy-farsight/Makefile.am
+++ b/telepathy-farsight/Makefile.am
@@ -2,7 +2,7 @@ BUILT_SOURCES = \
tf-signals-marshal.h \
tf-signals-marshal.c
-CLEANFILES = $(BUILT_SOURCES)
+CLEANFILES = $(BUILT_SOURCES) tf-signals-marshal.list
tfincludedir = $(includedir)/telepathy-1.0/telepathy-farsight
@@ -50,6 +50,18 @@ libtelepathy_farsight_la_LDFLAGS = -no-undefined \
# rules to generate signal marshallers
+tf-signals-marshal.list: $(libtelepathy_farsight_la_SOURCES) Makefile.am
+ ( cd $(srcdir) && \
+ sed -n -e 's/.*_tf_marshal_\([[:upper:][:digit:]]*__[[:upper:][:digit:]_]*\).*/\1/p' \
+ $(libtelepathy_farsight_la_SOURCES) ) \
+ | sed -e 's/__/:/' -e 'y/_/,/' | sort -u > $@.tmp
+ if cmp -s $@.tmp $@; then \
+ rm $@.tmp; \
+ touch $@; \
+ else \
+ mv $@.tmp $@; \
+ fi
+
%-signals-marshal.h: %-signals-marshal.list Makefile.in
glib-genmarshal --header --prefix=_$(subst -,_,$*)_marshal $< > $*-signals-marshal.h
diff --git a/telepathy-farsight/tf-signals-marshal.list b/telepathy-farsight/tf-signals-marshal.list
deleted file mode 100644
index 7d5dbc7..0000000
--- a/telepathy-farsight/tf-signals-marshal.list
+++ /dev/null
@@ -1,5 +0,0 @@
-BOXED:UINT,UINT,UINT
-VOID:BOXED,UINT,UINT,UINT
-BOOLEAN:UINT
-VOID:OBJECT,BOXED
-VOID:OBJECT,OBJECT